1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3 4/***/ 9525: 5/***/ ((module) => { 6 7(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports; 8var _$breadcrumbTypes_8 = ['navigation', 'request', 'process', 'log', 'user', 'state', 'error', 'manual']; 9 10// Array#reduce 11var _$reduce_17 = function (arr, fn, accum) { 12 var val = accum; 13 for (var i = 0, len = arr.length; i < len; i++) val = fn(val, arr[i], i, arr); 14 return val; 15}; 16 17/* removed: var _$reduce_17 = require('./reduce'); */; 18 19// Array#filter 20var _$filter_12 = function (arr, fn) { 21 return _$reduce_17(arr, function (accum, item, i, arr) { 22 return !fn(item, i, arr) ? accum : accum.concat(item); 23 }, []); 24}; 25 26/* removed: var _$reduce_17 = require('./reduce'); */; 27// Array#includes 28var _$includes_13 = function (arr, x) { 29 return _$reduce_17(arr, function (accum, item, i, arr) { 30 return accum === true || item === x; 31 }, false); 32}; 33 34// Array#isArray 35var _$isArray_14 = function (obj) { 36 return Object.prototype.toString.call(obj) === '[object Array]'; 37}; 38 39/* eslint-disable-next-line no-prototype-builtins */ 40var _hasDontEnumBug = !{ 41 toString: null 42}.propertyIsEnumerable('toString'); 43var _dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor']; 44 45// Object#keys 46var _$keys_15 = function (obj) { 47 // stripped down version of 48 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/Keys 49 var result = []; 50 var prop; 51 for (prop in obj) { 52 if (Object.prototype.hasOwnProperty.call(obj, prop)) result.push(prop); 53 } 54 if (!_hasDontEnumBug) return result; 55 for (var i = 0, len = _dontEnums.length; i < len; i++) { 56 if (Object.prototype.hasOwnProperty.call(obj, _dontEnums[i])) result.push(_dontEnums[i]); 57 } 58 return result; 59}; 60 61var _$intRange_24 = function (min, max) { 62 if (min === void 0) { 63 min = 1; 64 } 65 if (max === void 0) { 66 max = Infinity; 67 } 68 return function (value) { 69 return typeof value === 'number' && parseInt('' + value, 10) === value && value >= min && value <= max; 70 }; 71}; 72 73/* removed: var _$filter_12 = require('../es-utils/filter'); */; 74/* removed: var _$isArray_14 = require('../es-utils/is-array'); */; 75var _$listOfFunctions_25 = function (value) { 76 return typeof value === 'function' || _$isArray_14(value) && _$filter_12(value, function (f) { 77 return typeof f === 'function'; 78 }).length === value.length; 79}; 80 81var _$stringWithLength_26 = function (value) { 82 return typeof value === 'string' && !!value.length; 83}; 84 85var _$config_5 = {}; 86/* removed: var _$filter_12 = require('./lib/es-utils/filter'); */; 87/* removed: var _$reduce_17 = require('./lib/es-utils/reduce'); */; 88/* removed: var _$keys_15 = require('./lib/es-utils/keys'); */; 89/* removed: var _$isArray_14 = require('./lib/es-utils/is-array'); */; 90/* removed: var _$includes_13 = require('./lib/es-utils/includes'); */; 91/* removed: var _$intRange_24 = require('./lib/validators/int-range'); */; 92/* removed: var _$stringWithLength_26 = require('./lib/validators/string-with-length'); */; 93/* removed: var _$listOfFunctions_25 = require('./lib/validators/list-of-functions'); */; 94/* removed: var _$breadcrumbTypes_8 = require('./lib/breadcrumb-types'); */; 95var defaultErrorTypes = function () { 96 return { 97 unhandledExceptions: true, 98 unhandledRejections: true 99 }; 100}; 101_$config_5.schema = { 102 apiKey: { 103 defaultValue: function () { 104 return null; 105 }, 106 message: 'is required', 107 validate: _$stringWithLength_26 108 }, 109 appVersion: { 110 defaultValue: function () { 111 return undefined; 112 }, 113 message: 'should be a string', 114 validate: function (value) { 115 return value === undefined || _$stringWithLength_26(value); 116 } 117 }, 118 appType: { 119 defaultValue: function () { 120 return undefined; 121 }, 122 message: 'should be a string', 123 validate: function (value) { 124 return value === undefined || _$stringWithLength_26(value); 125 } 126 }, 127 autoDetectErrors: { 128 defaultValue: function () { 129 return true; 130 }, 131 message: 'should be true|false', 132 validate: function (value) { 133 return value === true || value === false; 134 } 135 }, 136 enabledErrorTypes: { 137 defaultValue: function () { 138 return defaultErrorTypes(); 139 },
140 message: 'should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }', 141 allowPartialObject: true, 142 validate: function (value) { 143 // ensure we have an object 144 if (typeof value !== 'object' || !value) return false; 145 var providedKeys = _$keys_15(value); 146 var defaultKeys = _$keys_15(defaultErrorTypes()); 147 // ensure it only has a subset of the allowed keys 148 if (_$filter_12(providedKeys, function (k) { 149 return _$includes_13(defaultKeys, k); 150 }).length < providedKeys.length) return false; 151 // ensure all of the values are boolean 152 if (_$filter_12(_$keys_15(value), function (k) { 153 return typeof value[k] !== 'boolean'; 154 }).length > 0) return false; 155 return true; 156 } 157 }, 158 onError: { 159 defaultValue: function () { 160 return []; 161 }, 162 message: 'should be a function or array of functions', 163 validate: _$listOfFunctions_25 164 }, 165 onSession: { 166 defaultValue: function () { 167 return []; 168 }, 169 message: 'should be a function or array of functions', 170 validate: _$listOfFunctions_25 171 }, 172 onBreadcrumb: { 173 defaultValue: function () { 174 return []; 175 }, 176 message: 'should be a function or array of functions', 177 validate: _$listOfFunctions_25 178 }, 179 endpoints: { 180 defaultValue: function () { 181 return { 182 notify: 'https://notify.bugsnag.com', 183 sessions: 'https://sessions.bugsnag.com' 184 }; 185 }, 186 message: 'should be an object containing endpoint URLs { notify, sessions }', 187 validate: function (val) { 188 return ( 189 // first, ensure it's an object 190 val && typeof val === 'object' && 191 // notify and sessions must always be set 192 _$stringWithLength_26(val.notify) && _$stringWithLength_26(val.sessions) && 193 // ensure no keys other than notify/session are set on endpoints object 194 _$filter_12(_$keys_15(val), function (k) { 195 return !_$includes_13(['notify', 'sessions'], k); 196 }).length === 0 197 ); 198 } 199 }, 200 autoTrackSessions: { 201 defaultValue: function (val) { 202 return true; 203 }, 204 message: 'should be true|false', 205 validate: function (val) { 206 return val === true || val === false; 207 } 208 }, 209 enabledReleaseStages: { 210 defaultValue: function () { 211 return null; 212 }, 213 message: 'should be an array of strings', 214 validate: function (value) { 215 return value === null || _$isArray_14(value) && _$filter_12(value, function (f) { 216 return typeof f === 'string'; 217 }).length === value.length; 218 } 219 }, 220 releaseStage: { 221 defaultValue: function () { 222 return 'production'; 223 }, 224 message: 'should be a string', 225 validate: function (value) { 226 return typeof value === 'string' && value.length; 227 } 228 }, 229 maxBreadcrumbs: { 230 defaultValue: function () { 231 return 25; 232 }, 233 message: 'should be a number â¤100', 234 validate: function (value) { 235 return _$intRange_24(0, 100)(value); 236 } 237 }, 238 enabledBreadcrumbTypes: { 239 defaultValue: function () { 240 return _$breadcrumbTypes_8; 241 }, 242 message: "should be null or a list of available breadcrumb types (" + _$breadcrumbTypes_8.join(',') + ")", 243 validate: function (value) { 244 return value === null || _$isArray_14(value) && _$reduce_17(value, function (accum, maybeType) { 245 if (accum === false) return accum; 246 return _$includes_13(_$breadcrumbTypes_8, maybeType); 247 }, true); 248 } 249 }, 250 context: { 251 defaultValue: function () { 252 return undefined; 253 }, 254 message: 'should be a string', 255 validate: function (value) { 256 return value === undefined || typeof value === 'string'; 257 } 258 }, 259 user: { 260 defaultValue: function () { 261 return {}; 262 }, 263 message: 'should be an object with { id, email, name } properties', 264 validate: function (value) { 265 return value === null || value && _$reduce_17(_$keys_15(value), function (accum, key) { 266 return accum && _$includes_13(['id', 'email', 'name'], key); 267 }, true); 268 } 269 }, 270 metadata: { 271 defaultValue: function () { 272 return {}; 273 }, 274 message: 'should be an object', 275 validate: function (value) { 276 return typeof value === 'object' && value !== null; 277 } 278 }, 279 logger: { 280 defaultValue: function () { 281 return undefined; 282 }, 283 message: 'should be null or an object with methods { debug, info, warn, error }', 284 validate: function (value) { 285 return !value || value && _$reduce_17(['debug', 'info', 'warn', 'error'], function (accum, method) { 286 return accum && typeof value[method] === 'function'; 287 }, true); 288 } 289 }, 290 redactedKeys: { 291 defaultValue: function () { 292 return ['password']; 293 },
294 message: 'should be an array of strings|regexes', 295 validate: function (value) { 296 return _$isArray_14(value) && value.length === _$filter_12(value, function (s) { 297 return typeof s === 'string' || s && typeof s.test === 'function'; 298 }).length; 299 } 300 }, 301 plugins: { 302 defaultValue: function () { 303 return []; 304 }, 305 message: 'should be an array of plugin objects', 306 validate: function (value) { 307 return _$isArray_14(value) && value.length === _$filter_12(value, function (p) { 308 return p && typeof p === 'object' && typeof p.load === 'function'; 309 }).length; 310 } 311 }, 312 featureFlags: { 313 defaultValue: function () { 314 return []; 315 }, 316 message: 'should be an array of objects that have a "name" property', 317 validate: function (value) { 318 return _$isArray_14(value) && value.length === _$filter_12(value, function (feature) { 319 return feature && typeof feature === 'object' && typeof feature.name === 'string'; 320 }).length; 321 } 322 } 323}; 324 325// extends helper from babel 326// https://github.com/babel/babel/blob/916429b516e6466fd06588ee820e40e025d7f3a3/packages/babel-helpers/src/helpers.js#L377-L393 327var _$assign_11 = function (target) { 328 for (var i = 1; i < arguments.length; i++) { 329 var source = arguments[i]; 330 for (var key in source) { 331 if (Object.prototype.hasOwnProperty.call(source, key)) { 332 target[key] = source[key]; 333 } 334 } 335 } 336 return target; 337}; 338 339/* removed: var _$reduce_17 = require('./reduce'); */; 340 341// Array#map 342var _$map_16 = function (arr, fn) { 343 return _$reduce_17(arr, function (accum, item, i, arr) { 344 return accum.concat(fn(item, i, arr)); 345 }, []); 346}; 347 348function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } 349var schema = _$config_5.schema; 350/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */; 351/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */; 352var _$config_1 = { 353 releaseStage: _$assign_11({}, schema.releaseStage, { 354 defaultValue: function () { 355 if (/^localhost(:\d+)?$/.test(window.location.host)) return 'development'; 356 return 'production'; 357 } 358 }), 359 appType: _extends({}, schema.appType, { 360 defaultValue: function () { 361 return 'browser'; 362 } 363 }), 364 logger: _$assign_11({}, schema.logger, { 365 defaultValue: function () { 366 return ( 367 // set logger based on browser capability 368 typeof console !== 'undefined' && typeof console.debug === 'function' ? getPrefixedConsole() : undefined 369 ); 370 } 371 }) 372}; 373var getPrefixedConsole = function () { 374 var logger = {}; 375 var consoleLog = console.log; 376 _$map_16(['debug', 'info', 'warn', 'error'], function (method) { 377 var consoleMethod = console[method]; 378 logger[method] = typeof consoleMethod === 'function' ? consoleMethod.bind(console, '[bugsnag]') : consoleLog.bind(console, '[bugsnag]'); 379 }); 380 return logger; 381}; 382 383var Breadcrumb = /*#__PURE__*/function () { 384 function Breadcrumb(message, metadata, type, timestamp) { 385 if (timestamp === void 0) { 386 timestamp = new Date(); 387 } 388 this.type = type; 389 this.message = message; 390 this.metadata = metadata; 391 this.timestamp = timestamp; 392 } 393 var _proto = Breadcrumb.prototype; 394 _proto.toJSON = function toJSON() { 395 return { 396 type: this.type, 397 name: this.message, 398 timestamp: this.timestamp, 399 metaData: this.metadata 400 }; 401 }; 402 return Breadcrumb; 403}(); 404var _$Breadcrumb_3 = Breadcrumb; 405 406var _$stackframe_34 = {}; 407(function (root, factory) { 408 'use strict'; 409 410 // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. 411 412 /* istanbul ignore next */ 413 if (typeof define === 'function' && define.amd) { 414 define('stackframe', [], factory); 415 } else if (typeof _$stackframe_34 === 'object') { 416 _$stackframe_34 = factory(); 417 } else { 418 root.StackFrame = factory(); 419 } 420})(this, function () { 421 'use strict'; 422 423 function _isNumber(n) { 424 return !isNaN(parseFloat(n)) && isFinite(n); 425 } 426 function _capitalize(str) { 427 return str.charAt(0).toUpperCase() + str.substring(1); 428 } 429 function _getter(p) { 430 return function () { 431 return this[p]; 432 }; 433 } 434 var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel']; 435 var numericProps = ['columnNumber', 'lineNumber']; 436 var stringProps = ['fileName', 'functionName', 'source']; 437 var arrayProps = ['args']; 438 var props = booleanProps.concat(numericProps, stringProps, arrayProps); 439 function StackFrame(obj) { 440 if (obj instanceof Object) { 441 for (var i = 0; i < props.length; i++) { 442 if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) { 443 this['set' + _capitalize(props[i])](obj[props[i]]); 444 } 445 } 446 } 447 } 448 StackFrame.prototype = { 449 getArgs: function () { 450 return this.args; 451 }, 452 setArgs: function (v) { 453 if (Object.prototype.toString.call(v) !== '[object Array]') { 454 throw new TypeError('Args must be an Array'); 455 } 456 this.args = v; 457 }, 458 getEvalOrigin: function () { 459 return this.evalOrigin; 460 }, 461 setEvalOrigin: function (v) { 462 if (v instanceof StackFrame) { 463 this.evalOrigin = v; 464 } else if (v instanceof Object) { 465 this.evalOrigin = new StackFrame(v); 466 } else { 467 throw new TypeError('Eval Origin must be an Object or StackFrame'); 468 } 469 }, 470 toString: function () { 471 var functionName = this.getFunctionName() || '{anonymous}'; 472 var args = '(' + (this.getArgs() || []).join(',') + ')'; 473 var fileName = this.getFileName() ? '@' + this.getFileName() : ''; 474 var lineNumber = _isNumber(this.getLineNumber()) ? ':' + this.getLineNumber() : ''; 475 var columnNumber = _isNumber(this.getColumnNumber()) ? ':' + this.getColumnNumber() : ''; 476 return functionName + args + fileName + lineNumber + columnNumber; 477 } 478 }; 479 for (var i = 0; i < booleanProps.length; i++) { 480 StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]); 481 StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function (p) { 482 return function (v) { 483 this[p] = Boolean(v); 484 }; 485 }(booleanProps[i]); 486 } 487 for (var j = 0; j < numericProps.length; j++) { 488 StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]); 489 StackFrame.prototype['set' + _capitalize(numericProps[j])] = function (p) { 490 return function (v) { 491 if (!_isNumber(v)) { 492 throw new TypeError(p + ' must be a Number'); 493 } 494 this[p] = Number(v); 495 }; 496 }(numericProps[j]); 497 } 498 for (var k = 0; k < stringProps.length; k++) { 499 StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]); 500 StackFrame.prototype['set' + _capitalize(stringProps[k])] = function (p) { 501 return function (v) { 502 this[p] = String(v); 503 }; 504 }(stringProps[k]); 505 } 506 return StackFrame; 507}); 508 509var _$errorStackParser_31 = {}; 510(function (root, factory) { 511 'use strict'; 512
513 // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. 514 515 /* istanbul ignore next */ 516 if (typeof define === 'function' && define.amd) { 517 define('error-stack-parser', ['stackframe'], factory); 518 } else if (typeof _$errorStackParser_31 === 'object') { 519 _$errorStackParser_31 = factory(_$stackframe_34); 520 } else { 521 root.ErrorStackParser = factory(root.StackFrame); 522 } 523})(this, function ErrorStackParser(StackFrame) { 524 'use strict'; 525 526 var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+\:\d+/; 527 var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+\:\d+|\(native\))/m; 528 var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code\])?$/; 529 return { 530 /** 531 * Given an Error object, extract the most information from it. 532 * 533 * @param {Error} error object 534 * @return {Array} of StackFrames 535 */ 536 parse: function ErrorStackParser$$parse(error) { 537 if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') { 538 return this.parseOpera(error); 539 } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) { 540 return this.parseV8OrIE(error); 541 } else if (error.stack) { 542 return this.parseFFOrSafari(error); 543 } else { 544 throw new Error('Cannot parse given Error object'); 545 } 546 }, 547 // Separate line and column numbers from a string of the form: (URI:Line:Column) 548 extractLocation: function ErrorStackParser$$extractLocation(urlLike) { 549 // Fail-fast but return locations like "(native)" 550 if (urlLike.indexOf(':') === -1) { 551 return [urlLike]; 552 } 553 var regExp = /(.+?)(?:\:(\d+))?(?:\:(\d+))?$/; 554 var parts = regExp.exec(urlLike.replace(/[\(\)]/g, '')); 555 return [parts[1], parts[2] || undefined, parts[3] || undefined]; 556 }, 557 parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { 558 var filtered = error.stack.split('\n').filter(function (line) { 559 return !!line.match(CHROME_IE_STACK_REGEXP); 560 }, this); 561 return filtered.map(function (line) { 562 if (line.indexOf('(eval ') > -1) { 563 // Throw away eval information until we implement stacktrace.js/stackframe#8 564 line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^\()]*)|(\)\,.*$)/g, ''); 565 } 566 var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); 567 568 // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in 569 // case it has spaces in it, as the string is split on \s+ later on 570 var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); 571 572 // remove the parenthesized location from the line, if it was matched 573 sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine; 574 var tokens = sanitizedLine.split(/\s+/).slice(1); 575 // if a location was matched, pass it to extractLocation() otherwise pop the last token 576 var locationParts = this.extractLocation(location ? location[1] : tokens.pop()); 577 var functionName = tokens.join(' ') || undefined; 578 var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0]; 579 return new StackFrame({ 580 functionName: functionName, 581 fileName: fileName, 582 lineNumber: locationParts[1], 583 columnNumber: locationParts[2], 584 source: line 585 }); 586 }, this); 587 }, 588 parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) { 589 var filtered = error.stack.split('\n').filter(function (line) { 590 return !line.match(SAFARI_NATIVE_CODE_REGEXP); 591 }, this); 592 return filtered.map(function (line) { 593 // Throw away eval information until we implement stacktrace.js/stackframe#8 594 if (line.indexOf(' > eval') > -1) { 595 line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g, ':$1'); 596 } 597 if (line.indexOf('@') === -1 && line.indexOf(':') === -1) { 598 // Safari eval frames only have function names and nothing else 599 return new StackFrame({ 600 functionName: line 601 }); 602 } else { 603 var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; 604 var matches = line.match(functionNameRegex); 605 var functionName = matches && matches[1] ? matches[1] : undefined; 606 var locationParts = this.extractLocation(line.replace(functionNameRegex, '')); 607 return new StackFrame({ 608 functionName: functionName, 609 fileName: locationParts[0], 610 lineNumber: locationParts[1], 611 columnNumber: locationParts[2], 612 source: line 613 }); 614 } 615 }, this); 616 }, 617 parseOpera: function ErrorStackParser$$parseOpera(e) { 618 if (!e.stacktrace || e.message.indexOf('\n') > -1 && e.message.split('\n').length > e.stacktrace.split('\n').length) { 619 return this.parseOpera9(e); 620 } else if (!e.stack) { 621 return this.parseOpera10(e); 622 } else { 623 return this.parseOpera11(e); 624 } 625 }, 626 parseOpera9: function ErrorStackParser$$parseOpera9(e) { 627 var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; 628 var lines = e.message.split('\n'); 629 var result = []; 630 for (var i = 2, len = lines.length; i < len; i += 2) { 631 var match = lineRE.exec(lines[i]); 632 if (match) { 633 result.push(new StackFrame({ 634 fileName: match[2], 635 lineNumber: match[1], 636 source: lines[i] 637 })); 638 } 639 } 640 return result; 641 }, 642 parseOpera10: function ErrorStackParser$$parseOpera10(e) { 643 var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; 644 var lines = e.stacktrace.split('\n'); 645 var result = []; 646 for (var i = 0, len = lines.length; i < len; i += 2) { 647 var match = lineRE.exec(lines[i]); 648 if (match) { 649 result.push(new StackFrame({ 650 functionName: match[3] || undefined, 651 fileName: match[2], 652 lineNumber: match[1], 653 source: lines[i] 654 })); 655 } 656 } 657 return result; 658 }, 659 // Opera 10.65+ Error.stack very similar to FF/Safari 660 parseOpera11: function ErrorStackParser$$parseOpera11(error) { 661 var filtered = error.stack.split('\n').filter(function (line) { 662 return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/); 663 }, this); 664 return filtered.map(function (line) { 665 var tokens = line.split('@'); 666 var locationParts = this.extractLocation(tokens.pop()); 667 var functionCall = tokens.shift() || ''; 668 var functionName = functionCall.replace(/<anonymous function(: (\w+))?>/, '$2').replace(/\([^\)]*\)/g, '') || undefined; 669 var argsRaw; 670 if (functionCall.match(/\(([^\)]*)\)/)) { 671 argsRaw = functionCall.replace(/^[^\(]+\(([^\)]*)\)$/, '$1'); 672 } 673 var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(','); 674 return new StackFrame({ 675 functionName: functionName, 676 args: args, 677 fileName: locationParts[0], 678 lineNumber: locationParts[1], 679 columnNumber: locationParts[2], 680 source: line 681 }); 682 }, this); 683 } 684 }; 685}); 686 687var _$errorStackParser_10 = _$errorStackParser_31; 688 689var _$safeJsonStringify_30 = function (data, replacer, space, opts) { 690 var redactedKeys = opts && opts.redactedKeys ? opts.redactedKeys : []; 691 var redactedPaths = opts && opts.redactedPaths ? opts.redactedPaths : []; 692 return JSON.stringify(prepareObjForSerialization(data, redactedKeys, redactedPaths), replacer, space); 693}; 694var MAX_DEPTH = 20; 695var MAX_EDGES = 25000; 696var MIN_PRESERVED_DEPTH = 8; 697var REPLACEMENT_NODE = '...'; 698function isError(o) { 699 return o instanceof Error || /^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(o)); 700} 701function throwsMessage(err) { 702 return '[Throws: ' + (err ? err.message : '?') + ']'; 703} 704function find(haystack, needle) { 705 for (var i = 0, len = haystack.length; i < len; i++) { 706 if (haystack[i] === needle) return true; 707 } 708 return false;
709} 710 711// returns true if the string `path` starts with any of the provided `paths` 712function isDescendent(paths, path) { 713 for (var i = 0, len = paths.length; i < len; i++) { 714 if (path.indexOf(paths[i]) === 0) return true; 715 } 716 return false; 717} 718function shouldRedact(patterns, key) { 719 for (var i = 0, len = patterns.length; i < len; i++) { 720 if (typeof patterns[i] === 'string' && patterns[i].toLowerCase() === key.toLowerCase()) return true; 721 if (patterns[i] && typeof patterns[i].test === 'function' && patterns[i].test(key)) return true; 722 } 723 return false; 724} 725function __isArray_30(obj) { 726 return Object.prototype.toString.call(obj) === '[object Array]'; 727} 728function safelyGetProp(obj, prop) { 729 try { 730 return obj[prop]; 731 } catch (err) { 732 return throwsMessage(err); 733 } 734} 735function prepareObjForSerialization(obj, redactedKeys, redactedPaths) { 736 var seen = []; // store references to objects we have seen before 737 var edges = 0; 738 function visit(obj, path) { 739 function edgesExceeded() { 740 return path.length > MIN_PRESERVED_DEPTH && edges > MAX_EDGES; 741 } 742 edges++; 743 if (path.length > MAX_DEPTH) return REPLACEMENT_NODE; 744 if (edgesExceeded()) return REPLACEMENT_NODE; 745 if (obj === null || typeof obj !== 'object') return obj; 746 if (find(seen, obj)) return '[Circular]'; 747 seen.push(obj); 748 if (typeof obj.toJSON === 'function') { 749 try { 750 // we're not going to count this as an edge because it 751 // replaces the value of the currently visited object 752 edges--; 753 var fResult = visit(obj.toJSON(), path); 754 seen.pop(); 755 return fResult; 756 } catch (err) { 757 return throwsMessage(err); 758 } 759 } 760 var er = isError(obj); 761 if (er) { 762 edges--; 763 var eResult = visit({ 764 name: obj.name, 765 message: obj.message 766 }, path); 767 seen.pop(); 768 return eResult; 769 } 770 if (__isArray_30(obj)) { 771 var aResult = []; 772 for (var i = 0, len = obj.length; i < len; i++) { 773 if (edgesExceeded()) { 774 aResult.push(REPLACEMENT_NODE); 775 break; 776 } 777 aResult.push(visit(obj[i], path.concat('[]'))); 778 } 779 seen.pop(); 780 return aResult; 781 } 782 var result = {}; 783 try { 784 for (var prop in obj) { 785 if (!Object.prototype.hasOwnProperty.call(obj, prop)) continue; 786 if (isDescendent(redactedPaths, path.join('.')) && shouldRedact(redactedKeys, prop)) { 787 result[prop] = '[REDACTED]'; 788 continue; 789 } 790 if (edgesExceeded()) { 791 result[prop] = REPLACEMENT_NODE; 792 break; 793 } 794 result[prop] = visit(safelyGetProp(obj, prop), path.concat(prop)); 795 } 796 } catch (e) {} 797 seen.pop(); 798 return result; 799 } 800 return visit(obj, []); 801} 802 803/* removed: var _$map_16 = require('./es-utils/map'); */; 804/* removed: var _$filter_12 = require('./es-utils/filter'); */; 805/* removed: var _$isArray_14 = require('./es-utils/is-array'); */; 806/* removed: var _$safeJsonStringify_30 = require('@bugsnag/safe-json-stringify'); */; 807function add(existingFeatures, existingFeatureKeys, name, variant) { 808 if (typeof name !== 'string') { 809 return; 810 } 811 if (variant === undefined) { 812 variant = null; 813 } else if (variant !== null && typeof variant !== 'string') { 814 variant = _$safeJsonStringify_30(variant); 815 } 816 var existingIndex = existingFeatureKeys[name]; 817 if (typeof existingIndex === 'number') { 818 existingFeatures[existingIndex] = { 819 name: name, 820 variant: variant 821 }; 822 return; 823 } 824 existingFeatures.push({ 825 name: name, 826 variant: variant 827 }); 828 existingFeatureKeys[name] = existingFeatures.length - 1; 829} 830function merge(existingFeatures, newFeatures, existingFeatureKeys) { 831 if (!_$isArray_14(newFeatures)) { 832 return; 833 } 834 for (var i = 0; i < newFeatures.length; ++i) { 835 var feature = newFeatures[i]; 836 if (feature === null || typeof feature !== 'object') { 837 continue; 838 } 839 840 // 'add' will handle if 'name' doesn't exist & 'variant' is optional 841 add(existingFeatures, existingFeatureKeys, feature.name, feature.variant); 842 } 843 return existingFeatures; 844} 845 846// convert feature flags from a map of 'name -> variant' into the format required 847// by the Bugsnag Event API: 848// [{ featureFlag: 'name', variant: 'variant' }, { featureFlag: 'name 2' }] 849function toEventApi(featureFlags) { 850 return _$map_16(_$filter_12(featureFlags, Boolean), function (_ref) { 851 var name = _ref.name, 852 variant = _ref.variant; 853 var flag = { 854 featureFlag: name 855 }; 856 857 // don't add a 'variant' property unless there's actually a value 858 if (typeof variant === 'string') { 859 flag.variant = variant; 860 } 861 return flag; 862 }); 863} 864function clear(features, featuresIndex, name) { 865 var existingIndex = featuresIndex[name]; 866 if (typeof existingIndex === 'number') { 867 features[existingIndex] = null; 868 delete featuresIndex[name]; 869 } 870} 871var _$featureFlagDelegate_18 = { 872 add: add, 873 clear: clear, 874 merge: merge, 875 toEventApi: toEventApi 876}; 877 878// Given `err` which may be an error, does it have a stack property which is a string? 879var _$hasStack_19 = function (err) { 880 return !!err && (!!err.stack || !!err.stacktrace || !!err['opera#sourceloc']) && typeof (err.stack || err.stacktrace || err['opera#sourceloc']) === 'string' && err.stack !== err.name + ": " + err.message; 881}; 882 883/** 884 * Expose `isError`. 885 */ 886 887var _$isError_32 = __isError_32; 888 889/** 890 * Test whether `value` is error object. 891 * 892 * @param {*} value 893 * @returns {boolean} 894 */ 895 896function __isError_32(value) { 897 switch (Object.prototype.toString.call(value)) { 898 case '[object Error]': 899 return true;
900 case '[object Exception]': 901 return true; 902 case '[object DOMException]': 903 return true; 904 default: 905 return value instanceof Error; 906 } 907} 908 909var _$iserror_20 = _$isError_32; 910 911/* removed: var _$assign_11 = require('./es-utils/assign'); */; 912var __add_22 = function (state, section, keyOrObj, maybeVal) { 913 var _updates; 914 if (!section) return; 915 var updates; 916 917 // addMetadata("section", null) -> clears section 918 if (keyOrObj === null) return __clear_22(state, section); 919 920 // normalise the two supported input types into object form 921 if (typeof keyOrObj === 'object') updates = keyOrObj; 922 if (typeof keyOrObj === 'string') updates = (_updates = {}, _updates[keyOrObj] = maybeVal, _updates); 923 924 // exit if we don't have an updates object at this point 925 if (!updates) return; 926 927 // preventing the __proto__ property from being used as a key 928 if (section === '__proto__' || section === 'constructor' || section === 'prototype') { 929 return; 930 } 931 932 // ensure a section with this name exists 933 if (!state[section]) state[section] = {}; 934 935 // merge the updates with the existing section 936 state[section] = _$assign_11({}, state[section], updates); 937}; 938var get = function (state, section, key) { 939 if (typeof section !== 'string') return undefined; 940 if (!key) { 941 return state[section]; 942 } 943 if (state[section]) { 944 return state[section][key]; 945 } 946 return undefined; 947}; 948var __clear_22 = function (state, section, key) { 949 if (typeof section !== 'string') return; 950 951 // clear an entire section 952 if (!key) { 953 delete state[section]; 954 return; 955 } 956 957 // preventing the __proto__ property from being used as a key 958 if (section === '__proto__' || section === 'constructor' || section === 'prototype') { 959 return; 960 } 961 962 // clear a single value from a section 963 if (state[section]) { 964 delete state[section][key]; 965 } 966}; 967var _$metadataDelegate_22 = { 968 add: __add_22, 969 get: get, 970 clear: __clear_22 971}; 972 973var _$stackGenerator_33 = {}; 974(function (root, factory) { 975 'use strict'; 976 977 // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. 978 979 /* istanbul ignore next */ 980 if (typeof define === 'function' && define.amd) { 981 define('stack-generator', ['stackframe'], factory); 982 } else if (typeof _$stackGenerator_33 === 'object') { 983 _$stackGenerator_33 = factory(_$stackframe_34); 984 } else { 985 root.StackGenerator = factory(root.StackFrame); 986 } 987})(this, function (StackFrame) { 988 return { 989 backtrace: function StackGenerator$$backtrace(opts) { 990 var stack = []; 991 var maxStackSize = 10; 992 if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') { 993 maxStackSize = opts.maxStackSize; 994 } 995 var curr = arguments.callee; 996 while (curr && stack.length < maxStackSize && curr['arguments']) { 997 // Allow V8 optimizations 998 var args = new Array(curr['arguments'].length); 999 for (var i = 0; i < args.length; ++i) { 1000 args[i] = curr['arguments'][i]; 1001 } 1002 if (/function(?:\s+([\w$]+))+\s*\(/.test(curr.toString())) { 1003 stack.push(new StackFrame({ 1004 functionName: RegExp.$1 || undefined, 1005 args: args 1006 })); 1007 } else { 1008 stack.push(new StackFrame({ 1009 args: args 1010 })); 1011 } 1012 try { 1013 curr = curr.caller; 1014 } catch (e) { 1015 break; 1016 } 1017 } 1018 return stack; 1019 } 1020 }; 1021}); 1022 1023function ___extends_6() { ___extends_6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return ___extends_6.apply(this, arguments); } 1024/* removed: var _$errorStackParser_10 = require('./lib/error-stack-parser'); */; 1025/* removed: var _$stackGenerator_33 = require('stack-generator'); */; 1026/* removed: var _$hasStack_19 = require('./lib/has-stack'); */; 1027/* removed: var _$map_16 = require('./lib/es-utils/map'); */; 1028/* removed: var _$reduce_17 = require('./lib/es-utils/reduce'); */; 1029/* removed: var _$filter_12 = require('./lib/es-utils/filter'); */; 1030/* removed: var _$assign_11 = require('./lib/es-utils/assign'); */; 1031/* removed: var _$metadataDelegate_22 = require('./lib/metadata-delegate'); */; 1032/* removed: var _$featureFlagDelegate_18 = require('./lib/feature-flag-delegate'); */; 1033/* removed: var _$iserror_20 = require('./lib/iserror'); */; 1034var Event = /*#__PURE__*/function () { 1035 function Event(errorClass, errorMessage, stacktrace, handledState, originalError) { 1036 if (stacktrace === void 0) { 1037 stacktrace = []; 1038 } 1039 if (handledState === void 0) { 1040 handledState = defaultHandledState(); 1041 } 1042 this.apiKey = undefined; 1043 this.context = undefined; 1044 this.groupingHash = undefined; 1045 this.originalError = originalError; 1046 this._handledState = handledState; 1047 this.severity = this._handledState.severity; 1048 this.unhandled = this._handledState.unhandled; 1049 this.app = {}; 1050 this.device = {}; 1051 this.request = {}; 1052 this.breadcrumbs = []; 1053 this.threads = []; 1054 this._metadata = {}; 1055 this._features = []; 1056 this._featuresIndex = {}; 1057 this._user = {}; 1058 this._session = undefined; 1059 this._correlation = undefined; 1060 this.errors = [createBugsnagError(errorClass, errorMessage, Event.__type, stacktrace)]; 1061 1062 // Flags. 1063 // Note these are not initialised unless they are used 1064 // to save unnecessary bytes in the browser bundle 1065 1066 /* this.attemptImmediateDelivery, default: true */ 1067 } 1068 var _proto = Event.prototype; 1069 _proto.addMetadata = function addMetadata(section, keyOrObj, maybeVal) { 1070 return _$metadataDelegate_22.add(this._metadata, section, keyOrObj, maybeVal); 1071 } 1072 1073 /** 1074 * Associate this event with a specific trace. This is usually done automatically when 1075 * using bugsnag-js-performance, but can also be set manually if required. 1076 * 1077 * @param traceId the ID of the trace the event occurred within 1078 * @param spanId the ID of the span that the event occurred within 1079 */; 1080 _proto.setTraceCorrelation = function setTraceCorrelation(traceId, spanId) { 1081 if (typeof traceId === 'string') { 1082 this._correlation = ___extends_6({ 1083 traceId: traceId 1084 }, typeof spanId === 'string' ? { 1085 spanId: spanId 1086 } : {}); 1087 } 1088 }; 1089 _proto.getMetadata = function getMetadata(section, key) { 1090 return _$metadataDelegate_22.get(this._metadata, section, key); 1091 }; 1092 _proto.clearMetadata = function clearMetadata(section, key) { 1093 return _$metadataDelegate_22.clear(this._metadata, section, key); 1094 }; 1095 _proto.addFeatureFlag = function addFeatureFlag(name, variant) { 1096 if (variant === void 0) { 1097 variant = null; 1098 } 1099 _$featureFlagDelegate_18.add(this._features, this._featuresIndex, name, variant); 1100 }; 1101 _proto.addFeatureFlags = function addFeatureFlags(featureFlags) { 1102 _$featureFlagDelegate_18.merge(this._features, featureFlags, this._featuresIndex); 1103 }; 1104 _proto.getFeatureFlags = function getFeatureFlags() { 1105 return _$featureFlagDelegate_18.toEventApi(this._features); 1106 }; 1107 _proto.clearFeatureFlag = function clearFeatureFlag(name) { 1108 _$featureFlagDelegate_18.clear(this._features, this._featuresIndex, name); 1109 }; 1110 _proto.clearFeatureFlags = function clearFeatureFlags() { 1111 this._features = []; 1112 this._featuresIndex = {}; 1113 }; 1114 _proto.getUser = function getUser() { 1115 return this._user; 1116 }; 1117 _proto.setUser = function setUser(id, email, name) { 1118 this._user = { 1119 id: id, 1120 email: email, 1121 name: name 1122 }; 1123 }; 1124 _proto.toJSON = function toJSON() { 1125 return { 1126 payloadVersion: '4', 1127 exceptions: _$map_16(this.errors, function (er) { 1128 return _$assign_11({}, er, { 1129 message: er.errorMessage 1130 }); 1131 }), 1132 severity: this.severity, 1133 unhandled: this._handledState.unhandled, 1134 severityReason: this._handledState.severityReason, 1135 app: this.app, 1136 device: this.device, 1137 request: this.request, 1138 breadcrumbs: this.breadcrumbs, 1139 context: this.context, 1140 groupingHash: this.groupingHash, 1141 metaData: this._metadata, 1142 user: this._user, 1143 session: this._session, 1144 featureFlags: this.getFeatureFlags(), 1145 correlation: this._correlation 1146 }; 1147 }; 1148 return Event; 1149}(); // takes a stacktrace.js style stackframe (https://github.com/stacktracejs/stackframe) 1150// and returns a Bugsnag compatible stackframe (https://docs.bugsnag.com/api/error-reporting/#json-payload) 1151var formatStackframe = function (frame) { 1152 var f = { 1153 file: frame.fileName, 1154 method: normaliseFunctionName(frame.functionName), 1155 lineNumber: frame.lineNumber, 1156 columnNumber: frame.columnNumber, 1157 code: undefined, 1158 inProject: undefined 1159 }; 1160 // Some instances result in no file: 1161 // - calling notify() from chrome's terminal results in no file/method. 1162 // - non-error exception thrown from global code in FF 1163 // This adds one. 1164 if (f.lineNumber > -1 && !f.file && !f.method) { 1165 f.file = 'global code'; 1166 } 1167 return f; 1168}; 1169var normaliseFunctionName = function (name) { 1170 return /^global code$/i.test(name) ? 'global code' : name; 1171}; 1172var defaultHandledState = function () { 1173 return { 1174 unhandled: false, 1175 severity: 'warning', 1176 severityReason: { 1177 type: 'handledException' 1178 } 1179 }; 1180}; 1181var ensureString = function (str) { 1182 return typeof str === 'string' ? str : ''; 1183}; 1184function createBugsnagError(errorClass, errorMessage, type, stacktrace) { 1185 return { 1186 errorClass: ensureString(errorClass), 1187 errorMessage: ensureString(errorMessage),
1188 type: type, 1189 stacktrace: _$reduce_17(stacktrace, function (accum, frame) { 1190 var f = formatStackframe(frame); 1191 // don't include a stackframe if none of its properties are defined 1192 try { 1193 if (JSON.stringify(f) === '{}') return accum; 1194 return accum.concat(f); 1195 } catch (e) { 1196 return accum; 1197 } 1198 }, []) 1199 }; 1200} 1201function getCauseStack(error) { 1202 if (error.cause) { 1203 return [error].concat(getCauseStack(error.cause)); 1204 } else { 1205 return [error]; 1206 } 1207} 1208 1209// Helpers 1210 1211Event.getStacktrace = function (error, errorFramesToSkip, backtraceFramesToSkip) { 1212 if (_$hasStack_19(error)) return _$errorStackParser_10.parse(error).slice(errorFramesToSkip); 1213 // error wasn't provided or didn't have a stacktrace so try to walk the callstack 1214 try { 1215 return _$filter_12(_$stackGenerator_33.backtrace(), function (frame) { 1216 return (frame.functionName || '').indexOf('StackGenerator$$') === -1; 1217 }).slice(1 + backtraceFramesToSkip); 1218 } catch (e) { 1219 return []; 1220 } 1221}; 1222Event.create = function (maybeError, tolerateNonErrors, handledState, component, errorFramesToSkip, logger) { 1223 if (errorFramesToSkip === void 0) { 1224 errorFramesToSkip = 0; 1225 } 1226 var _normaliseError = normaliseError(maybeError, tolerateNonErrors, component, logger), 1227 error = _normaliseError[0], 1228 internalFrames = _normaliseError[1]; 1229 var event; 1230 try { 1231 var stacktrace = Event.getStacktrace(error, 1232 // if an error was created/throw in the normaliseError() function, we need to 1233 // tell the getStacktrace() function to skip the number of frames we know will 1234 // be from our own functions. This is added to the number of frames deep we 1235 // were told about 1236 internalFrames > 0 ? 1 + internalFrames + errorFramesToSkip : 0, 1237 // if there's no stacktrace, the callstack may be walked to generated one. 1238 // this is how many frames should be removed because they come from our library 1239 1 + errorFramesToSkip); 1240 event = new Event(error.name, error.message, stacktrace, handledState, maybeError); 1241 } catch (e) { 1242 event = new Event(error.name, error.message, [], handledState, maybeError); 1243 } 1244 if (error.name === 'InvalidError') { 1245 event.addMetadata("" + component, 'non-error parameter', makeSerialisable(maybeError)); 1246 } 1247 if (error.cause) { 1248 var _event$errors; 1249 var causes = getCauseStack(error).slice(1); 1250 var normalisedCauses = _$map_16(causes, function (cause) { 1251 // Only get stacktrace for error causes that are a valid JS Error and already have a stack 1252 var stacktrace = _$iserror_20(cause) && _$hasStack_19(cause) ? _$errorStackParser_10.parse(cause) : []; 1253 var _normaliseError2 = normaliseError(cause, true, 'error cause'), 1254 error = _normaliseError2[0]; 1255 if (error.name === 'InvalidError') event.addMetadata('error cause', makeSerialisable(cause)); 1256 return createBugsnagError(error.name, error.message, Event.__type, stacktrace); 1257 }); 1258 (_event$errors = event.errors).push.apply(_event$errors, normalisedCauses); 1259 } 1260 return event; 1261}; 1262var makeSerialisable = function (err) { 1263 if (err === null) return 'null'; 1264 if (err === undefined) return 'undefined'; 1265 return err; 1266}; 1267var normaliseError = function (maybeError, tolerateNonErrors, component, logger) { 1268 var error; 1269 var internalFrames = 0; 1270 var createAndLogInputError = function (reason) { 1271 var verb = component === 'error cause' ? 'was' : 'received'; 1272 if (logger) logger.warn(component + " " + verb + " a non-error: \"" + reason + "\""); 1273 var err = new Error(component + " " + verb + " a non-error. See \"" + component + "\" tab for more detail."); 1274 err.name = 'InvalidError'; 1275 return err; 1276 }; 1277 1278 // In some cases: 1279 // 1280 // - the promise rejection handler (both in the browser and node) 1281 // - the node uncaughtException handler 1282 // 1283 // We are really limited in what we can do to get a stacktrace. So we use the 1284 // tolerateNonErrors option to ensure that the resulting error communicates as 1285 // such. 1286 if (!tolerateNonErrors) { 1287 if (_$iserror_20(maybeError)) { 1288 error = maybeError; 1289 } else { 1290 error = createAndLogInputError(typeof maybeError); 1291 internalFrames += 2; 1292 } 1293 } else { 1294 switch (typeof maybeError) { 1295 case 'string': 1296 case 'number': 1297 case 'boolean': 1298 error = new Error(String(maybeError)); 1299 internalFrames += 1; 1300 break; 1301 case 'function': 1302 error = createAndLogInputError('function'); 1303 internalFrames += 2; 1304 break; 1305 case 'object': 1306 if (maybeError !== null && _$iserror_20(maybeError)) { 1307 error = maybeError; 1308 } else if (maybeError !== null && hasNecessaryFields(maybeError)) { 1309 error = new Error(maybeError.message || maybeError.errorMessage);
1310 error.name = maybeError.name || maybeError.errorClass; 1311 internalFrames += 1; 1312 } else { 1313 error = createAndLogInputError(maybeError === null ? 'null' : 'unsupported object'); 1314 internalFrames += 2; 1315 } 1316 break; 1317 default: 1318 error = createAndLogInputError('nothing'); 1319 internalFrames += 2; 1320 } 1321 } 1322 if (!_$hasStack_19(error)) { 1323 // in IE10/11 a new Error() doesn't have a stacktrace until you throw it, so try that here 1324 try { 1325 throw error; 1326 } catch (e) { 1327 if (_$hasStack_19(e)) { 1328 error = e; 1329 // if the error only got a stacktrace after we threw it here, we know it 1330 // will only have one extra internal frame from this function, regardless 1331 // of whether it went through createAndLogInputError() or not 1332 internalFrames = 1; 1333 } 1334 } 1335 } 1336 return [error, internalFrames]; 1337}; 1338 1339// default value for stacktrace.type 1340Event.__type = 'browserjs'; 1341var hasNecessaryFields = function (error) { 1342 return (typeof error.name === 'string' || typeof error.errorClass === 'string') && (typeof error.message === 'string' || typeof error.errorMessage === 'string'); 1343}; 1344var _$Event_6 = Event; 1345 1346// This is a heavily modified/simplified version of 1347// https://github.com/othiym23/async-some 1348// with the logic flipped so that it is akin to the 1349// synchronous "every" method instead of "some". 1350 1351// run the asynchronous test function (fn) over each item in the array (arr) 1352// in series until: 1353// - fn(item, cb) => calls cb(null, false) 1354// - or the end of the array is reached 1355// the callback (cb) will be passed (null, false) if any of the items in arr 1356// caused fn to call back with false, otherwise it will be passed (null, true) 1357var _$asyncEvery_7 = function (arr, fn, cb) { 1358 var index = 0; 1359 var next = function () { 1360 if (index >= arr.length) return cb(null, true); 1361 fn(arr[index], function (err, result) { 1362 if (err) return cb(err); 1363 if (result === false) return cb(null, false); 1364 index++; 1365 next(); 1366 }); 1367 }; 1368 next(); 1369}; 1370 1371/* removed: var _$asyncEvery_7 = require('./async-every'); */; 1372var _$callbackRunner_9 = function (callbacks, event, onCallbackError, cb) { 1373 // This function is how we support different kinds of callback: 1374 // - synchronous - return value 1375 // - node-style async with callback - cb(err, value) 1376 // - promise/thenable - resolve(value) 1377 // It normalises each of these into the lowest common denominator â a node-style callback 1378 var runMaybeAsyncCallback = function (fn, cb) { 1379 if (typeof fn !== 'function') return cb(null); 1380 try { 1381 // if function appears sync⦠1382 if (fn.length !== 2) { 1383 var ret = fn(event); 1384 // check if it returned a "thenable" (promise) 1385 if (ret && typeof ret.then === 'function') { 1386 return ret.then( 1387 // resolve 1388 function (val) { 1389 return setTimeout(function () { 1390 return cb(null, val); 1391 }); 1392 }, 1393 // reject 1394 function (err) { 1395 setTimeout(function () { 1396 onCallbackError(err); 1397 return cb(null, true); 1398 }); 1399 }); 1400 } 1401 return cb(null, ret); 1402 } 1403 // if function is async⦠1404 fn(event, function (err, result) { 1405 if (err) { 1406 onCallbackError(err); 1407 return cb(null); 1408 } 1409 cb(null, result); 1410 }); 1411 } catch (e) { 1412 onCallbackError(e); 1413 cb(null); 1414 } 1415 }; 1416 _$asyncEvery_7(callbacks, runMaybeAsyncCallback, cb); 1417}; 1418 1419var _$syncCallbackRunner_23 = function (callbacks, callbackArg, callbackType, logger) { 1420 var ignore = false; 1421 var cbs = callbacks.slice(); 1422 while (!ignore) { 1423 if (!cbs.length) break; 1424 try { 1425 ignore = cbs.pop()(callbackArg) === false; 1426 } catch (e) { 1427 logger.error("Error occurred in " + callbackType + " callback, continuing anyway\u2026"); 1428 logger.error(e); 1429 } 1430 } 1431 return ignore; 1432}; 1433 1434var _$pad_29 = function pad(num, size) { 1435 var s = '000000000' + num; 1436 return s.substr(s.length - size); 1437}; 1438 1439/* removed: var _$pad_29 = require('./pad.js'); */; 1440var env = typeof window === 'object' ? window : self; 1441var globalCount = 0; 1442for (var prop in env) { 1443 if (Object.hasOwnProperty.call(env, prop)) globalCount++; 1444} 1445var mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0;
1446var clientId = _$pad_29((mimeTypesLength + navigator.userAgent.length).toString(36) + globalCount.toString(36), 4); 1447var _$fingerprint_28 = function fingerprint() { 1448 return clientId; 1449}; 1450 1451/** 1452 * cuid.js 1453 * Collision-resistant UID generator for browsers and node. 1454 * Sequential for fast db lookups and recency sorting. 1455 * Safe for element IDs and server-side lookups. 1456 * 1457 * Extracted from CLCTR 1458 * 1459 * Copyright (c) Eric Elliott 2012 1460 * MIT License 1461 */ 1462 1463/* removed: var _$fingerprint_28 = require('./lib/fingerprint.js'); */; 1464/* removed: var _$pad_29 = require('./lib/pad.js'); */; 1465var c = 0, 1466 blockSize = 4, 1467 base = 36, 1468 discreteValues = Math.pow(base, blockSize); 1469function randomBlock() { 1470 return _$pad_29((Math.random() * discreteValues << 0).toString(base), blockSize); 1471} 1472function safeCounter() { 1473 c = c < discreteValues ? c : 0; 1474 c++; // this is not subliminal 1475 return c - 1; 1476} 1477function cuid() { 1478 // Starting with a lowercase letter makes 1479 // it HTML element ID friendly. 1480 var letter = 'c', 1481 // hard-coded allows for sequential access 1482 1483 // timestamp 1484 // warning: this exposes the exact date and time 1485 // that the uid was created. 1486 timestamp = new Date().getTime().toString(base), 1487 // Prevent same-machine collisions. 1488 counter = _$pad_29(safeCounter().toString(base), blockSize), 1489 // A few chars to generate distinct ids for different 1490 // clients (so different computers are far less 1491 // likely to generate the same id) 1492 print = _$fingerprint_28(), 1493 // Grab some more chars from Math.random() 1494 random = randomBlock() + randomBlock(); 1495 return letter + timestamp + counter + print + random; 1496} 1497cuid.fingerprint = _$fingerprint_28; 1498var _$cuid_27 = cuid; 1499 1500/* removed: var _$cuid_27 = require('@bugsnag/cuid'); */; 1501var Session = /*#__PURE__*/function () { 1502 function Session() { 1503 this.id = _$cuid_27(); 1504 this.startedAt = new Date(); 1505 this._handled = 0; 1506 this._unhandled = 0; 1507 this._user = {}; 1508 this.app = {}; 1509 this.device = {}; 1510 } 1511 var _proto = Session.prototype; 1512 _proto.getUser = function getUser() { 1513 return this._user; 1514 }; 1515 _proto.setUser = function setUser(id, email, name) { 1516 this._user = { 1517 id: id, 1518 email: email, 1519 name: name 1520 }; 1521 }; 1522 _proto.toJSON = function toJSON() { 1523 return { 1524 id: this.id, 1525 startedAt: this.startedAt, 1526 events: { 1527 handled: this._handled, 1528 unhandled: this._unhandled 1529 } 1530 }; 1531 }; 1532 _proto._track = function _track(event) { 1533 this[event._handledState.unhandled ? '_unhandled' : '_handled'] += 1; 1534 }; 1535 return Session; 1536}(); 1537var _$Session_35 = Session; 1538 1539/* removed: var _$config_5 = require('./config'); */; 1540/* removed: var _$Event_6 = require('./event'); */; 1541/* removed: var _$Breadcrumb_3 = require('./breadcrumb'); */; 1542/* removed: var _$Session_35 = require('./session'); */; 1543/* removed: var _$map_16 = require('./lib/es-utils/map'); */; 1544/* removed: var _$includes_13 = require('./lib/es-utils/includes'); */; 1545/* removed: var _$filter_12 = require('./lib/es-utils/filter'); */; 1546/* removed: var _$reduce_17 = require('./lib/es-utils/reduce'); */; 1547/* removed: var _$keys_15 = require('./lib/es-utils/keys'); */; 1548/* removed: var _$assign_11 = require('./lib/es-utils/assign'); */; 1549/* removed: var _$callbackRunner_9 = require('./lib/callback-runner'); */; 1550/* removed: var _$metadataDelegate_22 = require('./lib/metadata-delegate'); */; 1551/* removed: var _$syncCallbackRunner_23 = require('./lib/sync-callback-runner'); */; 1552/* removed: var _$breadcrumbTypes_8 = require('./lib/breadcrumb-types'); */; 1553var __add_4 = _$featureFlagDelegate_18.add, 1554 __clear_4 = _$featureFlagDelegate_18.clear, 1555 __merge_4 = _$featureFlagDelegate_18.merge; 1556var noop = function () {}; 1557var Client = /*#__PURE__*/function () { 1558 function Client(configuration, schema, internalPlugins, notifier) { 1559 var _this = this; 1560 if (schema === void 0) { 1561 schema = _$config_5.schema; 1562 } 1563 if (internalPlugins === void 0) { 1564 internalPlugins = []; 1565 } 1566 // notifier id 1567 this._notifier = notifier; 1568 1569 // intialise opts and config 1570 this._config = {}; 1571 this._schema = schema; 1572 1573 // i/o 1574 this._delivery = { 1575 sendSession: noop, 1576 sendEvent: noop 1577 }; 1578 this._logger = { 1579 debug: noop, 1580 info: noop, 1581 warn: noop, 1582 error: noop 1583 }; 1584 1585 // plugins 1586 this._plugins = {}; 1587 1588 // state 1589 this._breadcrumbs = []; 1590 this._session = null; 1591 this._metadata = {}; 1592 this._featuresIndex = {}; 1593 this._features = []; 1594 this._context = undefined; 1595 this._user = {}; 1596 1597 // callbacks: 1598 // e: onError 1599 // s: onSession 1600 // sp: onSessionPayload 1601 // b: onBreadcrumb 1602 // (note these names are minified by hand because object 1603 // properties are not safe to minify automatically) 1604 this._cbs = { 1605 e: [], 1606 s: [], 1607 sp: [], 1608 b: [] 1609 }; 1610
1611 // expose internal constructors 1612 this.Client = Client; 1613 this.Event = _$Event_6; 1614 this.Breadcrumb = _$Breadcrumb_3; 1615 this.Session = _$Session_35; 1616 this._config = this._configure(configuration, internalPlugins); 1617 _$map_16(internalPlugins.concat(this._config.plugins), function (pl) { 1618 if (pl) _this._loadPlugin(pl); 1619 }); 1620 1621 // when notify() is called we need to know how many frames are from our own source 1622 // this inital value is 1 not 0 because we wrap notify() to ensure it is always 1623 // bound to have the client as its `this` value â see below. 1624 this._depth = 1; 1625 var self = this; 1626 var notify = this.notify; 1627 this.notify = function () { 1628 return notify.apply(self, arguments); 1629 }; 1630 } 1631 var _proto = Client.prototype; 1632 _proto.addMetadata = function addMetadata(section, keyOrObj, maybeVal) { 1633 return _$metadataDelegate_22.add(this._metadata, section, keyOrObj, maybeVal); 1634 }; 1635 _proto.getMetadata = function getMetadata(section, key) { 1636 return _$metadataDelegate_22.get(this._metadata, section, key); 1637 }; 1638 _proto.clearMetadata = function clearMetadata(section, key) { 1639 return _$metadataDelegate_22.clear(this._metadata, section, key); 1640 }; 1641 _proto.addFeatureFlag = function addFeatureFlag(name, variant) { 1642 if (variant === void 0) { 1643 variant = null; 1644 } 1645 __add_4(this._features, this._featuresIndex, name, variant); 1646 }; 1647 _proto.addFeatureFlags = function addFeatureFlags(featureFlags) { 1648 __merge_4(this._features, featureFlags, this._featuresIndex); 1649 }; 1650 _proto.clearFeatureFlag = function clearFeatureFlag(name) { 1651 __clear_4(this._features, this._featuresIndex, name); 1652 }; 1653 _proto.clearFeatureFlags = function clearFeatureFlags() { 1654 this._features = []; 1655 this._featuresIndex = {}; 1656 }; 1657 _proto.getContext = function getContext() { 1658 return this._context; 1659 }; 1660 _proto.setContext = function setContext(c) { 1661 this._context = c; 1662 }; 1663 _proto._configure = function _configure(opts, internalPlugins) { 1664 var schema = _$reduce_17(internalPlugins, function (schema, plugin) { 1665 if (plugin && plugin.configSchema) return _$assign_11({}, schema, plugin.configSchema); 1666 return schema; 1667 }, this._schema); 1668 1669 // accumulate configuration and error messages 1670 var _reduce = _$reduce_17(_$keys_15(schema), function (accum, key) { 1671 var defaultValue = schema[key].defaultValue(opts[key]); 1672 if (opts[key] !== undefined) { 1673 var valid = schema[key].validate(opts[key]); 1674 if (!valid) { 1675 accum.errors[key] = schema[key].message; 1676 accum.config[key] = defaultValue; 1677 } else { 1678 if (schema[key].allowPartialObject) { 1679 accum.config[key] = _$assign_11(defaultValue, opts[key]); 1680 } else { 1681 accum.config[key] = opts[key]; 1682 } 1683 } 1684 } else { 1685 accum.config[key] = defaultValue; 1686 } 1687 return accum; 1688 }, { 1689 errors: {}, 1690 config: {} 1691 }), 1692 errors = _reduce.errors, 1693 config = _reduce.config; 1694 if (schema.apiKey) { 1695 // missing api key is the only fatal error 1696 if (!config.apiKey) throw new Error('No Bugsnag API Key set'); 1697 // warn about an apikey that is not of the expected format 1698 if (!/^[0-9a-f]{32}$/i.test(config.apiKey)) errors.apiKey = 'should be a string of 32 hexadecimal characters'; 1699 } 1700 1701 // update and elevate some options 1702 this._metadata = _$assign_11({}, config.metadata); 1703 __merge_4(this._features, config.featureFlags, this._featuresIndex); 1704 this._user = _$assign_11({}, config.user); 1705 this._context = config.context; 1706 if (config.logger) this._logger = config.logger; 1707 1708 // add callbacks 1709 if (config.onError) this._cbs.e = this._cbs.e.concat(config.onError); 1710 if (config.onBreadcrumb) this._cbs.b = this._cbs.b.concat(config.onBreadcrumb); 1711 if (config.onSession) this._cbs.s = this._cbs.s.concat(config.onSession); 1712 1713 // finally warn about any invalid config where we fell back to the default 1714 if (_$keys_15(errors).length) { 1715 this._logger.warn(generateConfigErrorMessage(errors, opts)); 1716 } 1717 return config; 1718 }; 1719 _proto.getUser = function getUser() { 1720 return this._user; 1721 }; 1722 _proto.setUser = function setUser(id, email, name) { 1723 this._user = { 1724 id: id, 1725 email: email, 1726 name: name 1727 }; 1728 }; 1729 _proto._loadPlugin = function _loadPlugin(plugin) { 1730 var result = plugin.load(this); 1731 // JS objects are not the safest way to store arbitrarily keyed values, 1732 // so bookend the key with some characters that prevent tampering with 1733 // stuff like __proto__ etc. (only store the result if the plugin had a 1734 // name) 1735 if (plugin.name) this._plugins["~" + plugin.name + "~"] = result; 1736 return this; 1737 }; 1738 _proto.getPlugin = function getPlugin(name) { 1739 return this._plugins["~" + name + "~"]; 1740 }; 1741 _proto._setDelivery = function _setDelivery(d) { 1742 this._delivery = d(this); 1743 }; 1744 _proto.startSession = function startSession() { 1745 var session = new _$Session_35(); 1746 session.app.releaseStage = this._config.releaseStage; 1747 session.app.version = this._config.appVersion; 1748 session.app.type = this._config.appType; 1749 session._user = _$assign_11({}, this._user); 1750 1751 // run onSession callbacks 1752 var ignore = _$syncCallbackRunner_23(this._cbs.s, session, 'onSession', this._logger); 1753 if (ignore) { 1754 this._logger.debug('Session not started due to onSession callback'); 1755 return this; 1756 } 1757 return this._sessionDelegate.startSession(this, session); 1758 }; 1759 _proto.addOnError = function addOnError(fn, front) { 1760 if (front === void 0) { 1761 front = false;
1762 } 1763 this._cbs.e[front ? 'unshift' : 'push'](fn); 1764 }; 1765 _proto.removeOnError = function removeOnError(fn) { 1766 this._cbs.e = _$filter_12(this._cbs.e, function (f) { 1767 return f !== fn; 1768 }); 1769 }; 1770 _proto._addOnSessionPayload = function _addOnSessionPayload(fn) { 1771 this._cbs.sp.push(fn); 1772 }; 1773 _proto.addOnSession = function addOnSession(fn) { 1774 this._cbs.s.push(fn); 1775 }; 1776 _proto.removeOnSession = function removeOnSession(fn) { 1777 this._cbs.s = _$filter_12(this._cbs.s, function (f) { 1778 return f !== fn; 1779 }); 1780 }; 1781 _proto.addOnBreadcrumb = function addOnBreadcrumb(fn, front) { 1782 if (front === void 0) { 1783 front = false; 1784 } 1785 this._cbs.b[front ? 'unshift' : 'push'](fn); 1786 }; 1787 _proto.removeOnBreadcrumb = function removeOnBreadcrumb(fn) { 1788 this._cbs.b = _$filter_12(this._cbs.b, function (f) { 1789 return f !== fn; 1790 }); 1791 }; 1792 _proto.pauseSession = function pauseSession() { 1793 return this._sessionDelegate.pauseSession(this); 1794 }; 1795 _proto.resumeSession = function resumeSession() { 1796 return this._sessionDelegate.resumeSession(this); 1797 }; 1798 _proto.leaveBreadcrumb = function leaveBreadcrumb(message, metadata, type) { 1799 // coerce bad values so that the defaults get set 1800 message = typeof message === 'string' ? message : ''; 1801 type = typeof type === 'string' && _$includes_13(_$breadcrumbTypes_8, type) ? type : 'manual'; 1802 metadata = typeof metadata === 'object' && metadata !== null ? metadata : {}; 1803 1804 // if no message, discard 1805 if (!message) return; 1806 var crumb = new _$Breadcrumb_3(message, metadata, type); 1807 1808 // run onBreadcrumb callbacks 1809 var ignore = _$syncCallbackRunner_23(this._cbs.b, crumb, 'onBreadcrumb', this._logger); 1810 if (ignore) { 1811 this._logger.debug('Breadcrumb not attached due to onBreadcrumb callback'); 1812 return; 1813 } 1814 1815 // push the valid crumb onto the queue and maintain the length 1816 this._breadcrumbs.push(crumb); 1817 if (this._breadcrumbs.length > this._config.maxBreadcrumbs) { 1818 this._breadcrumbs = this._breadcrumbs.slice(this._breadcrumbs.length - this._config.maxBreadcrumbs); 1819 } 1820 }; 1821 _proto._isBreadcrumbTypeEnabled = function _isBreadcrumbTypeEnabled(type) { 1822 var types = this._config.enabledBreadcrumbTypes; 1823 return types === null || _$includes_13(types, type); 1824 }; 1825 _proto.notify = function notify(maybeError, onError, postReportCallback) { 1826 if (postReportCallback === void 0) { 1827 postReportCallback = noop; 1828 } 1829 var event = _$Event_6.create(maybeError, true, undefined, 'notify()', this._depth + 1, this._logger); 1830 this._notify(event, onError, postReportCallback); 1831 }; 1832 _proto._notify = function _notify(event, onError, postReportCallback) { 1833 var _this2 = this; 1834 if (postReportCallback === void 0) { 1835 postReportCallback = noop; 1836 } 1837 event.app = _$assign_11({}, event.app, { 1838 releaseStage: this._config.releaseStage, 1839 version: this._config.appVersion, 1840 type: this._config.appType 1841 }); 1842 event.context = event.context || this._context; 1843 event._metadata = _$assign_11({}, event._metadata, this._metadata); 1844 event._user = _$assign_11({}, event._user, this._user); 1845 event.breadcrumbs = this._breadcrumbs.slice(); 1846 __merge_4(event._features, this._features, event._featuresIndex); 1847 1848 // exit early if events should not be sent on the current releaseStage 1849 if (this._config.enabledReleaseStages !== null && !_$includes_13(this._config.enabledReleaseStages, this._config.releaseStage)) { 1850 this._logger.warn('Event not sent due to releaseStage/enabledReleaseStages configuration'); 1851 return postReportCallback(null, event); 1852 } 1853 var originalSeverity = event.severity; 1854 var onCallbackError = function (err) { 1855 // errors in callbacks are tolerated but we want to log them out 1856 _this2._logger.error('Error occurred in onError callback, continuing anywayâ¦'); 1857 _this2._logger.error(err); 1858 }; 1859 var callbacks = [].concat(this._cbs.e).concat(onError); 1860 _$callbackRunner_9(callbacks, event, onCallbackError, function (err, shouldSend) { 1861 if (err) onCallbackError(err); 1862 if (!shouldSend) { 1863 _this2._logger.debug('Event not sent due to onError callback'); 1864 return postReportCallback(null, event); 1865 } 1866 if (_this2._isBreadcrumbTypeEnabled('error')) { 1867 // only leave a crumb for the error if actually got sent 1868 Client.prototype.leaveBreadcrumb.call(_this2, event.errors[0].errorClass, { 1869 errorClass: event.errors[0].errorClass, 1870 errorMessage: event.errors[0].errorMessage, 1871 severity: event.severity 1872 }, 'error'); 1873 } 1874 if (originalSeverity !== event.severity) { 1875 event._handledState.severityReason = { 1876 type: 'userCallbackSetSeverity' 1877 }; 1878 } 1879 if (event.unhandled !== event._handledState.unhandled) {
1880 event._handledState.severityReason.unhandledOverridden = true; 1881 event._handledState.unhandled = event.unhandled; 1882 } 1883 if (_this2._session) { 1884 _this2._session._track(event); 1885 event._session = _this2._session; 1886 } 1887 _this2._delivery.sendEvent({ 1888 apiKey: event.apiKey || _this2._config.apiKey, 1889 notifier: _this2._notifier, 1890 events: [event] 1891 }, function (err) { 1892 return postReportCallback(err, event); 1893 }); 1894 }); 1895 }; 1896 return Client; 1897}(); 1898var generateConfigErrorMessage = function (errors, rawInput) { 1899 var er = new Error("Invalid configuration\n" + _$map_16(_$keys_15(errors), function (key) { 1900 return " - " + key + " " + errors[key] + ", got " + stringify(rawInput[key]); 1901 }).join('\n\n')); 1902 return er; 1903}; 1904var stringify = function (val) { 1905 switch (typeof val) { 1906 case 'string': 1907 case 'number': 1908 case 'object': 1909 return JSON.stringify(val); 1910 default: 1911 return String(val); 1912 } 1913}; 1914var _$Client_4 = Client; 1915 1916var _$jsonPayload_21 = {}; 1917/* removed: var _$safeJsonStringify_30 = require('@bugsnag/safe-json-stringify'); */; 1918var EVENT_REDACTION_PATHS = ['events.[].metaData', 'events.[].breadcrumbs.[].metaData', 'events.[].request']; 1919_$jsonPayload_21.event = function (event, redactedKeys) { 1920 var payload = _$safeJsonStringify_30(event, null, null, { 1921 redactedPaths: EVENT_REDACTION_PATHS, 1922 redactedKeys: redactedKeys 1923 }); 1924 if (payload.length > 10e5) { 1925 event.events[0]._metadata = { 1926 notifier: "WARNING!\nSerialized payload was " + payload.length / 10e5 + "MB (limit = 1MB)\nmetadata was removed" 1927 }; 1928 payload = _$safeJsonStringify_30(event, null, null, { 1929 redactedPaths: EVENT_REDACTION_PATHS, 1930 redactedKeys: redactedKeys 1931 }); 1932 } 1933 return payload; 1934}; 1935_$jsonPayload_21.session = function (session, redactedKeys) { 1936 var payload = _$safeJsonStringify_30(session, null, null); 1937 return payload; 1938}; 1939 1940var _$delivery_36 = {}; 1941/* removed: var _$jsonPayload_21 = require('@bugsnag/core/lib/json-payload'); */; 1942_$delivery_36 = function (client, win) { 1943 if (win === void 0) { 1944 win = window; 1945 } 1946 return { 1947 sendEvent: function (event, cb) { 1948 if (cb === void 0) { 1949 cb = function () {}; 1950 } 1951 var url = getApiUrl(client._config, 'notify', '4', win); 1952 var body = _$jsonPayload_21.event(event, client._config.redactedKeys); 1953 var req = new win.XDomainRequest(); 1954 req.onload = function () { 1955 cb(null); 1956 }; 1957 req.onerror = function () { 1958 var err = new Error('Event failed to send'); 1959 client._logger.error('Event failed to sendâ¦', err); 1960 if (body.length > 10e5) { 1961 client._logger.warn("Event oversized (" + (body.length / 10e5).toFixed(2) + " MB)"); 1962 } 1963 cb(err); 1964 }; 1965 req.open('POST', url); 1966 setTimeout(function () { 1967 try { 1968 req.send(body); 1969 } catch (e) { 1970 client._logger.error(e); 1971 cb(e); 1972 } 1973 }, 0); 1974 }, 1975 sendSession: function (session, cb) { 1976 if (cb === void 0) { 1977 cb = function () {}; 1978 } 1979 var url = getApiUrl(client._config, 'sessions', '1', win); 1980 var req = new win.XDomainRequest(); 1981 req.onload = function () { 1982 cb(null); 1983 }; 1984 req.open('POST', url); 1985 setTimeout(function () { 1986 try { 1987 req.send(_$jsonPayload_21.session(session, client._config.redactedKeys)); 1988 } catch (e) { 1989 client._logger.error(e); 1990 cb(e); 1991 } 1992 }, 0); 1993 } 1994 }; 1995}; 1996var getApiUrl = function (config, endpoint, version, win) { 1997 // IE8 doesn't support Date.prototype.toISOstring(), but it does convert a date 1998 // to an ISO string when you use JSON stringify. Simply parsing the result of 1999 // JSON.stringify is smaller than using a toISOstring() polyfill. 2000 var isoDate = JSON.parse(JSON.stringify(new Date())); 2001 var url = matchPageProtocol(config.endpoints[endpoint], win.location.protocol); 2002 return url + "?apiKey=" + encodeURIComponent(config.apiKey) + "&payloadVersion=" + version + "&sentAt=" + encodeURIComponent(isoDate); 2003}; 2004var matchPageProtocol = _$delivery_36._matchPageProtocol = function (endpoint, pageProtocol) { 2005 return pageProtocol === 'http:' ? endpoint.replace(/^https:/, 'http:') : endpoint; 2006}; 2007 2008/* removed: var _$jsonPayload_21 = require('@bugsnag/core/lib/json-payload'); */; 2009var _$delivery_37 = function (client, win) { 2010 if (win === void 0) { 2011 win = window; 2012 } 2013 return { 2014 sendEvent: function (event, cb) { 2015 if (cb === void 0) { 2016 cb = function () {}; 2017 }
2018 try { 2019 var url = client._config.endpoints.notify; 2020 var req = new win.XMLHttpRequest(); 2021 var body = _$jsonPayload_21.event(event, client._config.redactedKeys); 2022 req.onreadystatechange = function () { 2023 if (req.readyState === win.XMLHttpRequest.DONE) { 2024 var status = req.status; 2025 if (status === 0 || status >= 400) { 2026 var err = new Error("Request failed with status " + status); 2027 client._logger.error('Event failed to sendâ¦', err); 2028 if (body.length > 10e5) { 2029 client._logger.warn("Event oversized (" + (body.length / 10e5).toFixed(2) + " MB)"); 2030 } 2031 cb(err); 2032 } else { 2033 cb(null); 2034 } 2035 } 2036 }; 2037 req.open('POST', url); 2038 req.setRequestHeader('Content-Type', 'application/json'); 2039 req.setRequestHeader('Bugsnag-Api-Key', event.apiKey || client._config.apiKey); 2040 req.setRequestHeader('Bugsnag-Payload-Version', '4'); 2041 req.setRequestHeader('Bugsnag-Sent-At', new Date().toISOString()); 2042 req.send(body); 2043 } catch (e) { 2044 client._logger.error(e); 2045 } 2046 }, 2047 sendSession: function (session, cb) { 2048 if (cb === void 0) { 2049 cb = function () {}; 2050 } 2051 try { 2052 var url = client._config.endpoints.sessions; 2053 var req = new win.XMLHttpRequest(); 2054 req.onreadystatechange = function () { 2055 if (req.readyState === win.XMLHttpRequest.DONE) { 2056 var status = req.status; 2057 if (status === 0 || status >= 400) { 2058 var err = new Error("Request failed with status " + status); 2059 client._logger.error('Session failed to sendâ¦', err); 2060 cb(err); 2061 } else { 2062 cb(null); 2063 } 2064 } 2065 }; 2066 req.open('POST', url); 2067 req.setRequestHeader('Content-Type', 'application/json'); 2068 req.setRequestHeader('Bugsnag-Api-Key', client._config.apiKey); 2069 req.setRequestHeader('Bugsnag-Payload-Version', '1'); 2070 req.setRequestHeader('Bugsnag-Sent-At', new Date().toISOString()); 2071 req.send(_$jsonPayload_21.session(session, client._config.redactedKeys)); 2072 } catch (e) { 2073 client._logger.error(e); 2074 } 2075 } 2076 }; 2077}; 2078 2079var appStart = new Date(); 2080var reset = function () { 2081 appStart = new Date(); 2082}; 2083var _$app_38 = { 2084 name: 'appDuration', 2085 load: function (client) { 2086 client.addOnError(function (event) { 2087 var now = new Date(); 2088 event.app.duration = now - appStart; 2089 }, true); 2090 return { 2091 reset: reset 2092 }; 2093 } 2094}; 2095 2096/* 2097 * Sets the default context to be the current URL 2098 */ 2099var _$context_39 = function (win) { 2100 if (win === void 0) { 2101 win = window; 2102 } 2103 return { 2104 load: function (client) { 2105 client.addOnError(function (event) { 2106 if (event.context !== undefined) return; 2107 event.context = win.location.pathname; 2108 }, true); 2109 } 2110 }; 2111}; 2112 2113var _$pad_43 = function pad(num, size) { 2114 var s = '000000000' + num; 2115 return s.substr(s.length - size); 2116}; 2117 2118/* removed: var _$pad_43 = require('./pad.js'); */; 2119var __env_42 = typeof window === 'object' ? window : self; 2120var __globalCount_42 = 0; 2121for (var __prop_42 in __env_42) { 2122 if (Object.hasOwnProperty.call(__env_42, __prop_42)) __globalCount_42++; 2123} 2124var __mimeTypesLength_42 = navigator.mimeTypes ? navigator.mimeTypes.length : 0; 2125var __clientId_42 = _$pad_43((__mimeTypesLength_42 + navigator.userAgent.length).toString(36) + __globalCount_42.toString(36), 4); 2126var _$fingerprint_42 = function fingerprint() { 2127 return __clientId_42; 2128}; 2129 2130/** 2131 * cuid.js 2132 * Collision-resistant UID generator for browsers and node. 2133 * Sequential for fast db lookups and recency sorting. 2134 * Safe for element IDs and server-side lookups. 2135 * 2136 * Extracted from CLCTR 2137 * 2138 * Copyright (c) Eric Elliott 2012 2139 * MIT License 2140 */ 2141 2142/* removed: var _$fingerprint_42 = require('./lib/fingerprint.js'); */; 2143/* removed: var _$pad_43 = require('./lib/pad.js'); */; 2144var __c_41 = 0, 2145 __blockSize_41 = 4, 2146 __base_41 = 36, 2147 __discreteValues_41 = Math.pow(__base_41, __blockSize_41); 2148function __randomBlock_41() { 2149 return _$pad_43((Math.random() * __discreteValues_41 << 0).toString(__base_41), __blockSize_41); 2150} 2151function __safeCounter_41() { 2152 __c_41 = __c_41 < __discreteValues_41 ? __c_41 : 0; 2153 __c_41++; // this is not subliminal 2154 return __c_41 - 1; 2155} 2156function __cuid_41() { 2157 // Starting with a lowercase letter makes 2158 // it HTML element ID friendly. 2159 var letter = 'c', 2160 // hard-coded allows for sequential access 2161 2162 // timestamp 2163 // warning: this exposes the exact date and time 2164 // that the uid was created. 2165 timestamp = new Date().getTime().toString(__base_41), 2166 // Prevent same-machine collisions. 2167 counter = _$pad_43(__safeCounter_41().toString(__base_41), __blockSize_41), 2168 // A few chars to generate distinct ids for different
2169 // clients (so different computers are far less 2170 // likely to generate the same id) 2171 print = _$fingerprint_42(), 2172 // Grab some more chars from Math.random() 2173 random = __randomBlock_41() + __randomBlock_41(); 2174 return letter + timestamp + counter + print + random; 2175} 2176__cuid_41.fingerprint = _$fingerprint_42; 2177var _$cuid_41 = __cuid_41; 2178 2179/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */; 2180var BUGSNAG_ANONYMOUS_ID_KEY = 'bugsnag-anonymous-id'; 2181var getDeviceId = function (win) { 2182 try { 2183 var storage = win.localStorage; 2184 var id = storage.getItem(BUGSNAG_ANONYMOUS_ID_KEY); 2185 2186 // If we get an ID, make sure it looks like a valid cuid. The length can 2187 // fluctuate slightly, so some leeway is built in 2188 if (id && /^c[a-z0-9]{20,32}$/.test(id)) { 2189 return id; 2190 } 2191 /* removed: var _$cuid_41 = require('@bugsnag/cuid'); */; 2192 id = _$cuid_41(); 2193 storage.setItem(BUGSNAG_ANONYMOUS_ID_KEY, id); 2194 return id; 2195 } catch (err) { 2196 // If localStorage is not available (e.g. because it's disabled) then give up 2197 } 2198}; 2199 2200/* 2201 * Automatically detects browser device details 2202 */ 2203var _$device_40 = function (nav, win) { 2204 if (nav === void 0) { 2205 nav = navigator; 2206 } 2207 if (win === void 0) { 2208 win = window; 2209 } 2210 return { 2211 load: function (client) { 2212 var device = { 2213 locale: nav.browserLanguage || nav.systemLanguage || nav.userLanguage || nav.language, 2214 userAgent: nav.userAgent 2215 }; 2216 if (win && win.screen && win.screen.orientation && win.screen.orientation.type) { 2217 device.orientation = win.screen.orientation.type; 2218 } else if (win && win.document) { 2219 device.orientation = win.document.documentElement.clientWidth > win.document.documentElement.clientHeight ? 'landscape' : 'portrait'; 2220 } 2221 if (client._config.generateAnonymousId) { 2222 device.id = getDeviceId(win); 2223 } 2224 client.addOnSession(function (session) { 2225 session.device = _$assign_11({}, session.device, device); 2226 // only set device id if collectUserIp is false 2227 if (!client._config.collectUserIp) setDefaultUserId(session); 2228 }); 2229 2230 // add time just as the event is sent 2231 client.addOnError(function (event) { 2232 event.device = _$assign_11({}, event.device, device, { 2233 time: new Date() 2234 }); 2235 if (!client._config.collectUserIp) setDefaultUserId(event); 2236 }, true); 2237 }, 2238 configSchema: { 2239 generateAnonymousId: { 2240 validate: function (value) { 2241 return value === true || value === false; 2242 }, 2243 defaultValue: function () { 2244 return true; 2245 }, 2246 message: 'should be true|false' 2247 } 2248 } 2249 }; 2250}; 2251var setDefaultUserId = function (eventOrSession) { 2252 // device id is also used to populate the user id field, if it's not already set 2253 var user = eventOrSession.getUser(); 2254 if (!user || !user.id) { 2255 eventOrSession.setUser(eventOrSession.device.id); 2256 } 2257}; 2258 2259/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */; 2260 2261/* 2262 * Sets the event request: { url } to be the current href 2263 */ 2264var _$request_44 = function (win) { 2265 if (win === void 0) { 2266 win = window; 2267 } 2268 return { 2269 load: function (client) { 2270 client.addOnError(function (event) { 2271 if (event.request && event.request.url) return; 2272 event.request = _$assign_11({}, event.request, { 2273 url: win.location.href 2274 }); 2275 }, true); 2276 } 2277 }; 2278}; 2279 2280/* removed: var _$includes_13 = require('@bugsnag/core/lib/es-utils/includes'); */; 2281var _$session_45 = { 2282 load: function (client) { 2283 client._sessionDelegate = sessionDelegate; 2284 } 2285}; 2286var sessionDelegate = { 2287 startSession: function (client, session) { 2288 var sessionClient = client; 2289 sessionClient._session = session; 2290 sessionClient._pausedSession = null; 2291 2292 // exit early if the current releaseStage is not enabled 2293 if (sessionClient._config.enabledReleaseStages !== null && !_$includes_13(sessionClient._config.enabledReleaseStages, sessionClient._config.releaseStage)) { 2294 sessionClient._logger.warn('Session not sent due to releaseStage/enabledReleaseStages configuration'); 2295 return sessionClient; 2296 } 2297 sessionClient._delivery.sendSession({ 2298 notifier: sessionClient._notifier, 2299 device: session.device, 2300 app: session.app, 2301 sessions: [{ 2302 id: session.id, 2303 startedAt: session.startedAt, 2304 user: session._user 2305 }] 2306 }); 2307 return sessionClient; 2308 }, 2309 resumeSession: function (client) {
2310 // Do nothing if there's already an active session 2311 if (client._session) { 2312 return client; 2313 } 2314 2315 // If we have a paused session then make it the active session 2316 if (client._pausedSession) { 2317 client._session = client._pausedSession; 2318 client._pausedSession = null; 2319 return client; 2320 } 2321 2322 // Otherwise start a new session 2323 return client.startSession(); 2324 }, 2325 pauseSession: function (client) { 2326 client._pausedSession = client._session; 2327 client._session = null; 2328 } 2329}; 2330 2331/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */; 2332 2333/* 2334 * Prevent collection of user IPs 2335 */ 2336var _$clientIp_46 = { 2337 load: function (client) { 2338 if (client._config.collectUserIp) return; 2339 client.addOnError(function (event) { 2340 // If user.id is explicitly undefined, it will be missing from the payload. It needs 2341 // removing so that the following line replaces it 2342 if (event._user && typeof event._user.id === 'undefined') delete event._user.id; 2343 event._user = _$assign_11({ 2344 id: '[REDACTED]' 2345 }, event._user); 2346 event.request = _$assign_11({ 2347 clientIp: '[REDACTED]' 2348 }, event.request); 2349 }); 2350 }, 2351 configSchema: { 2352 collectUserIp: { 2353 defaultValue: function () { 2354 return true; 2355 }, 2356 message: 'should be true|false', 2357 validate: function (value) { 2358 return value === true || value === false; 2359 } 2360 } 2361 } 2362}; 2363 2364var _$consoleBreadcrumbs_47 = {}; 2365/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */; 2366/* removed: var _$reduce_17 = require('@bugsnag/core/lib/es-utils/reduce'); */; 2367/* removed: var _$filter_12 = require('@bugsnag/core/lib/es-utils/filter'); */; 2368 2369/* 2370 * Leaves breadcrumbs when console log methods are called 2371 */ 2372_$consoleBreadcrumbs_47.load = function (client) { 2373 var isDev = /^(local-)?dev(elopment)?$/.test(client._config.releaseStage); 2374 if (isDev || !client._isBreadcrumbTypeEnabled('log')) return; 2375 _$map_16(CONSOLE_LOG_METHODS, function (method) { 2376 var original = console[method]; 2377 console[method] = function () { 2378 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 2379 args[_key] = arguments[_key]; 2380 } 2381 client.leaveBreadcrumb('Console output', _$reduce_17(args, function (accum, arg, i) { 2382 // do the best/simplest stringification of each argument 2383 var stringified = '[Unknown value]'; 2384 // this may fail if the input is: 2385 // - an object whose [[Prototype]] is null (no toString) 2386 // - an object with a broken toString or @@toPrimitive implementation 2387 try { 2388 stringified = String(arg); 2389 } catch (e) {} 2390 // if it stringifies to [object Object] attempt to JSON stringify 2391 if (stringified === '[object Object]') { 2392 // catch stringify errors and fallback to [object Object] 2393 try { 2394 stringified = JSON.stringify(arg); 2395 } catch (e) {} 2396 } 2397 accum["[" + i + "]"] = stringified; 2398 return accum; 2399 }, { 2400 severity: method.indexOf('group') === 0 ? 'log' : method 2401 }), 'log'); 2402 original.apply(console, args); 2403 }; 2404 console[method]._restore = function () { 2405 console[method] = original; 2406 }; 2407 }); 2408}; 2409if (false) {} 2410var CONSOLE_LOG_METHODS = _$filter_12(['log', 'debug', 'info', 'warn', 'error'], function (method) { 2411 return typeof console !== 'undefined' && typeof console[method] === 'function'; 2412}); 2413 2414/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */; 2415/* removed: var _$reduce_17 = require('@bugsnag/core/lib/es-utils/reduce'); */; 2416/* removed: var _$filter_12 = require('@bugsnag/core/lib/es-utils/filter'); */; 2417var MAX_LINE_LENGTH = 200; 2418var MAX_SCRIPT_LENGTH = 500000; 2419var _$inlineScriptContent_48 = function (doc, win) { 2420 if (doc === void 0) { 2421 doc = document; 2422 } 2423 if (win === void 0) { 2424 win = window; 2425 } 2426 return { 2427 load: function (client) { 2428 if (!client._config.trackInlineScripts) return; 2429 var originalLocation = win.location.href; 2430 var html = ''; 2431 2432 // in IE8-10 the 'interactive' state can fire too soon (before scripts have finished executing), so in those 2433 // we wait for the 'complete' state before assuming that synchronous scripts are no longer executing 2434 var isOldIe = !!doc.attachEvent; 2435 var DOMContentLoaded = isOldIe ? doc.readyState === 'complete' : doc.readyState !== 'loading'; 2436 var getHtml = function () { 2437 return doc.documentElement.outerHTML; 2438 }; 2439
2440 // get whatever HTML exists at this point in time 2441 html = getHtml(); 2442 var prev = doc.onreadystatechange; 2443 // then update it when the DOM content has loaded 2444 doc.onreadystatechange = function () { 2445 // IE8 compatible alternative to document#DOMContentLoaded 2446 if (doc.readyState === 'interactive') { 2447 html = getHtml(); 2448 DOMContentLoaded = true; 2449 } 2450 try { 2451 prev.apply(this, arguments); 2452 } catch (e) {} 2453 }; 2454 var _lastScript = null; 2455 var updateLastScript = function (script) { 2456 _lastScript = script; 2457 }; 2458 var getCurrentScript = function () { 2459 var script = doc.currentScript || _lastScript; 2460 if (!script && !DOMContentLoaded) { 2461 var scripts = doc.scripts || doc.getElementsByTagName('script'); 2462 script = scripts[scripts.length - 1]; 2463 } 2464 return script; 2465 }; 2466 var addSurroundingCode = function (lineNumber) { 2467 // get whatever html has rendered at this point 2468 if (!DOMContentLoaded || !html) html = getHtml(); 2469 // simulate the raw html 2470 var htmlLines = ['<!-- DOC START -->'].concat(html.split('\n')); 2471 var zeroBasedLine = lineNumber - 1; 2472 var start = Math.max(zeroBasedLine - 3, 0); 2473 var end = Math.min(zeroBasedLine + 3, htmlLines.length); 2474 return _$reduce_17(htmlLines.slice(start, end), function (accum, line, i) { 2475 accum[start + 1 + i] = line.length <= MAX_LINE_LENGTH ? line : line.substr(0, MAX_LINE_LENGTH); 2476 return accum; 2477 }, {}); 2478 }; 2479 client.addOnError(function (event) { 2480 // remove any of our own frames that may be part the stack this 2481 // happens before the inline script check as it happens for all errors 2482 event.errors[0].stacktrace = _$filter_12(event.errors[0].stacktrace, function (f) { 2483 return !/__trace__$/.test(f.method); 2484 }); 2485 var frame = event.errors[0].stacktrace[0]; 2486 2487 // remove hash and query string from url 2488 var cleanUrl = function (url) { 2489 return url.replace(/#.*$/, '').replace(/\?.*$/, ''); 2490 }; 2491 2492 // if frame.file exists and is not the original location of the page, this can't be an inline script 2493 if (frame && frame.file && cleanUrl(frame.file) !== cleanUrl(originalLocation)) return; 2494 2495 // grab the last script known to have run 2496 var currentScript = getCurrentScript(); 2497 if (currentScript) { 2498 var content = currentScript.innerHTML; 2499 event.addMetadata('script', 'content', content.length <= MAX_SCRIPT_LENGTH ? content : content.substr(0, MAX_SCRIPT_LENGTH)); 2500 2501 // only attempt to grab some surrounding code if we have a line number 2502 if (frame && frame.lineNumber) { 2503 frame.code = addSurroundingCode(frame.lineNumber); 2504 } 2505 } 2506 }, true); 2507 2508 // Proxy all the timer functions whose callback is their 0th argument. 2509 // Keep a reference to the original setTimeout because we need it later 2510 var _map = _$map_16(['setTimeout', 'setInterval', 'setImmediate', 'requestAnimationFrame'], function (fn) { 2511 return __proxy(win, fn, function (original) { 2512 return __traceOriginalScript(original, function (args) { 2513 return { 2514 get: function () { 2515 return args[0]; 2516 }, 2517 replace: function (fn) { 2518 args[0] = fn; 2519 } 2520 }; 2521 }); 2522 }); 2523 }), 2524 _setTimeout = _map[0]; 2525 2526 // Proxy all the host objects whose prototypes have an addEventListener function 2527 _$map_16(['EventTarget', 'Window', 'Node', 'ApplicationCache', 'AudioTrackList', 'ChannelMergerNode', 'CryptoOperation', 'EventSource', 'FileReader', 'HTMLUnknownElement', 'IDBDatabase', 'IDBRequest', 'IDBTransaction', 'KeyOperation', 'MediaController', 'MessagePort', 'ModalWindow', 'Notification', 'SVGElementInstance', 'Screen', 'TextTrack', 'TextTrackCue', 'TextTrackList', 'WebSocket', 'WebSocketWorker', 'Worker', 'XMLHttpRequest', 'XMLHttpRequestEventTarget', 'XMLHttpRequestUpload'], function (o) { 2528 if (!win[o] || !win[o].prototype || !Object.prototype.hasOwnProperty.call(win[o].prototype, 'addEventListener')) return; 2529 __proxy(win[o].prototype, 'addEventListener', function (original) { 2530 return __traceOriginalScript(original, eventTargetCallbackAccessor); 2531 }); 2532 __proxy(win[o].prototype, 'removeEventListener', function (original) { 2533 return __traceOriginalScript(original, eventTargetCallbackAccessor, true); 2534 }); 2535 }); 2536 function __traceOriginalScript(fn, callbackAccessor, alsoCallOriginal) { 2537 if (alsoCallOriginal === void 0) { 2538 alsoCallOriginal = false;
2539 } 2540 return function () { 2541 // this is required for removeEventListener to remove anything added with 2542 // addEventListener before the functions started being wrapped by Bugsnag 2543 var args = [].slice.call(arguments); 2544 try { 2545 var cba = callbackAccessor(args); 2546 var cb = cba.get(); 2547 if (alsoCallOriginal) fn.apply(this, args); 2548 if (typeof cb !== 'function') return fn.apply(this, args); 2549 if (cb.__trace__) { 2550 cba.replace(cb.__trace__); 2551 } else { 2552 var script = getCurrentScript(); 2553 // this function mustn't be annonymous due to a bug in the stack 2554 // generation logic, meaning it gets tripped up 2555 // see: https://github.com/stacktracejs/stack-generator/issues/6 2556 cb.__trace__ = function __trace__() { 2557 // set the script that called this function 2558 updateLastScript(script); 2559 // immediately unset the currentScript synchronously below, however 2560 // if this cb throws an error the line after will not get run so schedule 2561 // an almost-immediate aysnc update too 2562 _setTimeout(function () { 2563 updateLastScript(null); 2564 }, 0); 2565 var ret = cb.apply(this, arguments); 2566 updateLastScript(null); 2567 return ret; 2568 }; 2569 cb.__trace__.__trace__ = cb.__trace__; 2570 cba.replace(cb.__trace__); 2571 } 2572 } catch (e) { 2573 // swallow these errors on Selenium: 2574 // Permission denied to access property '__trace__' 2575 // WebDriverException: Message: Permission denied to access property "handleEvent" 2576 } 2577 // IE8 doesn't let you call .apply() on setTimeout/setInterval 2578 if (fn.apply) return fn.apply(this, args); 2579 switch (args.length) { 2580 case 1: 2581 return fn(args[0]); 2582 case 2: 2583 return fn(args[0], args[1]); 2584 default: 2585 return fn(); 2586 } 2587 }; 2588 } 2589 }, 2590 configSchema: { 2591 trackInlineScripts: { 2592 validate: function (value) { 2593 return value === true || value === false; 2594 }, 2595 defaultValue: function () { 2596 return true; 2597 }, 2598 message: 'should be true|false' 2599 } 2600 } 2601 }; 2602}; 2603function __proxy(host, name, replacer) { 2604 var original = host[name]; 2605 if (!original) return original; 2606 var replacement = replacer(original); 2607 host[name] = replacement; 2608 return original; 2609} 2610function eventTargetCallbackAccessor(args) { 2611 var isEventHandlerObj = !!args[1] && typeof args[1].handleEvent === 'function'; 2612 return { 2613 get: function () { 2614 return isEventHandlerObj ? args[1].handleEvent : args[1]; 2615 }, 2616 replace: function (fn) { 2617 if (isEventHandlerObj) { 2618 args[1].handleEvent = fn; 2619 } else { 2620 args[1] = fn; 2621 } 2622 } 2623 }; 2624} 2625 2626/* 2627 * Leaves breadcrumbs when the user interacts with the DOM 2628 */ 2629var _$interactionBreadcrumbs_49 = function (win) { 2630 if (win === void 0) { 2631 win = window; 2632 } 2633 return { 2634 load: function (client) { 2635 if (!('addEventListener' in win)) return; 2636 if (!client._isBreadcrumbTypeEnabled('user')) return; 2637 win.addEventListener('click', function (event) { 2638 var targetText, targetSelector; 2639 try { 2640 targetText = getNodeText(event.target); 2641 targetSelector = getNodeSelector(event.target, win); 2642 } catch (e) { 2643 targetText = '[hidden]'; 2644 targetSelector = '[hidden]'; 2645 client._logger.error('Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z'); 2646 } 2647 client.leaveBreadcrumb('UI click', { 2648 targetText: targetText, 2649 targetSelector: targetSelector 2650 }, 'user'); 2651 }, true); 2652 } 2653 }; 2654}; 2655var trim = /^\s*([^\s][\s\S]{0,139}[^\s])?\s*/; 2656function getNodeText(el) { 2657 var text = el.textContent || el.innerText || ''; 2658 if (!text && (el.type === 'submit' || el.type === 'button')) { 2659 text = el.value; 2660 } 2661 text = text.replace(trim, '$1'); 2662 if (text.length > 140) { 2663 return text.slice(0, 135) + '(...)'; 2664 } 2665 return text; 2666} 2667 2668// Create a label from tagname, id and css class of the element 2669function getNodeSelector(el, win) { 2670 var parts = [el.tagName]; 2671 if (el.id) parts.push('#' + el.id); 2672 if (el.className && el.className.length) parts.push("." + el.className.split(' ').join('.')); 2673 // Can't get much more advanced with the current browser 2674 if (!win.document.querySelectorAll || !Array.prototype.indexOf) return parts.join(''); 2675 try { 2676 if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join(''); 2677 } catch (e) { 2678 // Sometimes the query selector can be invalid just return it as-is 2679 return parts.join(''); 2680 } 2681 // try to get a more specific selector if this one matches more than one element 2682 if (el.parentNode.childNodes.length > 1) { 2683 var index = Array.prototype.indexOf.call(el.parentNode.childNodes, el) + 1; 2684 parts.push(":nth-child(" + index + ")"); 2685 } 2686 if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join(''); 2687 // try prepending the parent node selector 2688 if (el.parentNode) return getNodeSelector(el.parentNode, win) + " > " + parts.join(''); 2689 return parts.join(''); 2690} 2691 2692var _$navigationBreadcrumbs_50 = {}; 2693/* 2694* Leaves breadcrumbs when navigation methods are called or events are emitted 2695*/ 2696_$navigationBreadcrumbs_50 = function (win) { 2697 if (win === void 0) { 2698 win = window; 2699 } 2700 var plugin = { 2701 load: function (client) { 2702 if (!('addEventListener' in win)) return; 2703 if (!client._isBreadcrumbTypeEnabled('navigation')) return; 2704 2705 // returns a function that will drop a breadcrumb with a given name 2706 var drop = function (name) { 2707 return function () { 2708 return client.leaveBreadcrumb(name, {}, 'navigation'); 2709 }; 2710 }; 2711 2712 // simple drops â just names, no meta 2713 win.addEventListener('pagehide', drop('Page hidden'), true); 2714 win.addEventListener('pageshow', drop('Page shown'), true); 2715 win.addEventListener('load', drop('Page loaded'), true); 2716 win.document.addEventListener('DOMContentLoaded', drop('DOMContentLoaded'), true); 2717 // some browsers like to emit popstate when the page loads, so only add the popstate listener after that 2718 win.addEventListener('load', function () { 2719 return win.addEventListener('popstate', drop('Navigated back'), true); 2720 }); 2721 2722 // hashchange has some metadata that we care about 2723 win.addEventListener('hashchange', function (event) { 2724 var metadata = event.oldURL ? { 2725 from: relativeLocation(event.oldURL, win),
2726 to: relativeLocation(event.newURL, win), 2727 state: getCurrentState(win) 2728 } : { 2729 to: relativeLocation(win.location.href, win) 2730 }; 2731 client.leaveBreadcrumb('Hash changed', metadata, 'navigation'); 2732 }, true); 2733 2734 // the only way to know about replaceState/pushState is to wrap them⦠>_< 2735 2736 if (win.history.replaceState) wrapHistoryFn(client, win.history, 'replaceState', win); 2737 if (win.history.pushState) wrapHistoryFn(client, win.history, 'pushState', win); 2738 } 2739 }; 2740 if (false) {} 2741 return plugin; 2742}; 2743if (false) {} 2744 2745// takes a full url like http://foo.com:1234/pages/01.html?yes=no#section-2 and returns 2746// just the path and hash parts, e.g. /pages/01.html?yes=no#section-2 2747var relativeLocation = function (url, win) { 2748 var a = win.document.createElement('A'); 2749 a.href = url; 2750 return "" + a.pathname + a.search + a.hash; 2751}; 2752var stateChangeToMetadata = function (win, state, title, url) { 2753 var currentPath = relativeLocation(win.location.href, win); 2754 return { 2755 title: title, 2756 state: state, 2757 prevState: getCurrentState(win), 2758 to: url || currentPath, 2759 from: currentPath 2760 }; 2761}; 2762var wrapHistoryFn = function (client, target, fn, win) { 2763 var orig = target[fn]; 2764 target[fn] = function (state, title, url) { 2765 client.leaveBreadcrumb("History " + fn, stateChangeToMetadata(win, state, title, url), 'navigation'); 2766 // if throttle plugin is in use, reset the event sent count 2767 if (typeof client.resetEventCount === 'function') client.resetEventCount(); 2768 // if the client is operating in auto session-mode, a new route should trigger a new session 2769 if (client._config.autoTrackSessions) client.startSession(); 2770 // Internet Explorer will convert `undefined` to a string when passed, causing an unintended redirect 2771 // to '/undefined'. therefore we only pass the url if it's not undefined. 2772 orig.apply(target, [state, title].concat(url !== undefined ? url : [])); 2773 }; 2774 if (false) {} 2775}; 2776var getCurrentState = function (win) { 2777 try { 2778 return win.history.state; 2779 } catch (e) {} 2780}; 2781 2782var BREADCRUMB_TYPE = 'request'; 2783/* removed: var _$includes_13 = require('@bugsnag/core/lib/es-utils/includes'); */; 2784 2785/* 2786 * Leaves breadcrumbs when network requests occur 2787 */ 2788var _$networkBreadcrumbs_51 = function (_ignoredUrls, win) { 2789 if (_ignoredUrls === void 0) { 2790 _ignoredUrls = []; 2791 } 2792 if (win === void 0) { 2793 win = window; 2794 } 2795 var restoreFunctions = []; 2796 var plugin = { 2797 load: function (client) { 2798 if (!client._isBreadcrumbTypeEnabled('request')) return; 2799 var ignoredUrls = [client._config.endpoints.notify, client._config.endpoints.sessions].concat(_ignoredUrls); 2800 monkeyPatchXMLHttpRequest(); 2801 monkeyPatchFetch(); 2802 2803 // XMLHttpRequest monkey patch 2804 function monkeyPatchXMLHttpRequest() { 2805 if (!('addEventListener' in win.XMLHttpRequest.prototype)) return; 2806 var nativeOpen = win.XMLHttpRequest.prototype.open; 2807 2808 // override native open() 2809 win.XMLHttpRequest.prototype.open = function open(method, url) { 2810 var _this = this; 2811 var requestSetupKey = false; 2812 var error = function () { 2813 return handleXHRError(method, url); 2814 }; 2815 var load = function () { 2816 return handleXHRLoad(method, url, _this.status); 2817 }; 2818 2819 // if we have already setup listeners, it means open() was called twice, we need to remove 2820 // the listeners and recreate them 2821 if (requestSetupKey) { 2822 this.removeEventListener('load', load); 2823 this.removeEventListener('error', error); 2824 } 2825 2826 // attach load event listener 2827 this.addEventListener('load', load); 2828 // attach error event listener 2829 this.addEventListener('error', error); 2830 requestSetupKey = true; 2831 nativeOpen.apply(this, arguments); 2832 }; 2833 if (false) {} 2834 } 2835 function handleXHRLoad(method, url, status) { 2836 if (url === undefined) { 2837 client._logger.warn('The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.'); 2838 return; 2839 } 2840 2841 // an XMLHttpRequest's URL can be an object as long as its 'toString' 2842 // returns a URL, e.g. a HTMLAnchorElement 2843 if (typeof url === 'string' && _$includes_13(ignoredUrls, url.replace(/\?.*$/, ''))) { 2844 // don't leave a network breadcrumb from bugsnag notify calls 2845 return; 2846 } 2847 var metadata = { 2848 status: status, 2849 request: method + " " + url 2850 }; 2851 if (status >= 400) { 2852 // contacted server but got an error response 2853 client.leaveBreadcrumb('XMLHttpRequest failed', metadata, BREADCRUMB_TYPE); 2854 } else { 2855 client.leaveBreadcrumb('XMLHttpRequest succeeded', metadata, BREADCRUMB_TYPE); 2856 } 2857 } 2858 function handleXHRError(method, url) { 2859 if (url === undefined) { 2860 client._logger.warn('The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.'); 2861 return; 2862 } 2863 if (typeof url === 'string' && _$includes_13(ignoredUrls, url.replace(/\?.*$/, ''))) { 2864 // don't leave a network breadcrumb from bugsnag notify calls 2865 return; 2866 } 2867 2868 // failed to contact server 2869 client.leaveBreadcrumb('XMLHttpRequest error', { 2870 request: method + " " + url 2871 }, BREADCRUMB_TYPE); 2872 } 2873 2874 // window.fetch monkey patch 2875 function monkeyPatchFetch() { 2876 // only patch it if it exists and if it is not a polyfill (patching a polyfilled 2877 // fetch() results in duplicate breadcrumbs for the same request because the 2878 // implementation uses XMLHttpRequest which is also patched) 2879 if (!('fetch' in win) || win.fetch.polyfill) return; 2880 var oldFetch = win.fetch; 2881 win.fetch = function fetch() { 2882 var _arguments = arguments; 2883 var urlOrRequest = arguments[0]; 2884 var options = arguments[1]; 2885 var method; 2886 var url = null; 2887 if (urlOrRequest && typeof urlOrRequest === 'object') { 2888 url = urlOrRequest.url; 2889 if (options && 'method' in options) { 2890 method = options.method; 2891 } else if (urlOrRequest && 'method' in urlOrRequest) { 2892 method = urlOrRequest.method; 2893 } 2894 } else { 2895 url = urlOrRequest; 2896 if (options && 'method' in options) { 2897 method = options.method; 2898 } 2899 } 2900 if (method === undefined) { 2901 method = 'GET'; 2902 } 2903 return new Promise(function (resolve, reject) { 2904 // pass through to native fetch 2905 oldFetch.apply(void 0, _arguments).then(function (response) { 2906 handleFetchSuccess(response, method, url); 2907 resolve(response); 2908 })["catch"](function (error) { 2909 handleFetchError(method, url); 2910 reject(error); 2911 }); 2912 }); 2913 }; 2914 if (false) {} 2915 } 2916 var handleFetchSuccess = function (response, method, url) { 2917 var metadata = { 2918 status: response.status, 2919 request: method + " " + url 2920 }; 2921 if (response.status >= 400) { 2922 // when the request comes back with a 4xx or 5xx status it does not reject the fetch promise, 2923 client.leaveBreadcrumb('fetch() failed', metadata, BREADCRUMB_TYPE); 2924 } else { 2925 client.leaveBreadcrumb('fetch() succeeded', metadata, BREADCRUMB_TYPE); 2926 } 2927 }; 2928 var handleFetchError = function (method, url) { 2929 client.leaveBreadcrumb('fetch() error', { 2930 request: method + " " + url 2931 }, BREADCRUMB_TYPE); 2932 }; 2933 } 2934 }; 2935 if (false) {} 2936 return plugin; 2937}; 2938
2939/* removed: var _$intRange_24 = require('@bugsnag/core/lib/validators/int-range'); */; 2940 2941/* 2942 * Throttles and dedupes events 2943 */ 2944 2945var _$throttle_52 = { 2946 load: function (client) { 2947 // track sent events for each init of the plugin 2948 var n = 0; 2949 2950 // add onError hook 2951 client.addOnError(function (event) { 2952 // have max events been sent already? 2953 if (n >= client._config.maxEvents) { 2954 client._logger.warn("Cancelling event send due to maxEvents per session limit of " + client._config.maxEvents + " being reached"); 2955 return false; 2956 } 2957 n++; 2958 }); 2959 client.resetEventCount = function () { 2960 n = 0; 2961 }; 2962 }, 2963 configSchema: { 2964 maxEvents: { 2965 defaultValue: function () { 2966 return 10; 2967 }, 2968 message: 'should be a positive integer â¤100', 2969 validate: function (val) { 2970 return _$intRange_24(1, 100)(val); 2971 } 2972 } 2973 } 2974}; 2975 2976var _$stripQueryString_53 = {}; 2977/* 2978 * Remove query strings (and fragments) from stacktraces 2979 */ 2980/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */; 2981/* removed: var _$reduce_17 = require('@bugsnag/core/lib/es-utils/reduce'); */; 2982_$stripQueryString_53 = { 2983 load: function (client) { 2984 client.addOnError(function (event) { 2985 var allFrames = _$reduce_17(event.errors, function (accum, er) { 2986 return accum.concat(er.stacktrace); 2987 }, []); 2988 _$map_16(allFrames, function (frame) { 2989 frame.file = strip(frame.file); 2990 }); 2991 }); 2992 } 2993}; 2994var strip = _$stripQueryString_53._strip = function (str) { 2995 return typeof str === 'string' ? str.replace(/\?.*$/, '').replace(/#.*$/, '') : str; 2996}; 2997 2998/* 2999 * Automatically notifies Bugsnag when window.onerror is called 3000 */ 3001 3002var _$onerror_54 = function (win, component) { 3003 if (win === void 0) { 3004 win = window; 3005 } 3006 if (component === void 0) { 3007 component = 'window onerror'; 3008 } 3009 return { 3010 load: function (client) { 3011 if (!client._config.autoDetectErrors) return; 3012 if (!client._config.enabledErrorTypes.unhandledExceptions) return; 3013 function onerror(messageOrEvent, url, lineNo, charNo, error) { 3014 // Ignore errors with no info due to CORS settings 3015 if (lineNo === 0 && /Script error\.?/.test(messageOrEvent)) { 3016 client._logger.warn('Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z'); 3017 } else { 3018 // any error sent to window.onerror is unhandled and has severity=error 3019 var handledState = { 3020 severity: 'error', 3021 unhandled: true, 3022 severityReason: { 3023 type: 'unhandledException' 3024 } 3025 }; 3026 var event; 3027 3028 // window.onerror can be called in a number of ways. This big if-else is how we 3029 // figure out which arguments were supplied, and what kind of values it received. 3030 3031 if (error) { 3032 // if the last parameter (error) was supplied, this is a modern browser's 3033 // way of saying "this value was thrown and not caught" 3034 event = client.Event.create(error, true, handledState, component, 1); 3035 decorateStack(event.errors[0].stacktrace, url, lineNo, charNo); 3036 } else if ( 3037 // This complex case detects "error" events that are typically synthesised 3038 // by jquery's trigger method (although can be created in other ways). In 3039 // order to detect this: 3040 // - the first argument (message) must exist and be an object (most likely it's a jQuery event) 3041 // - the second argument (url) must either not exist or be something other than a string (if it 3042 // exists and is not a string, it'll be the extraParameters argument from jQuery's trigger() 3043 // function) 3044 // - the third, fourth and fifth arguments must not exist (lineNo, charNo and error) 3045 typeof messageOrEvent === 'object' && messageOrEvent !== null && (!url || typeof url !== 'string') && !lineNo && !charNo && !error) { 3046 // The jQuery event may have a "type" property, if so use it as part of the error message 3047 var name = messageOrEvent.type ? "Event: " + messageOrEvent.type : 'Error'; 3048 // attempt to find a message from one of the conventional properties, but 3049 // default to empty string (the event will fill it with a placeholder) 3050 var message = messageOrEvent.message || messageOrEvent.detail || ''; 3051 event = client.Event.create({ 3052 name: name, 3053 message: message 3054 }, true, handledState, component, 1); 3055 3056 // provide the original thing onerror received â not our error-like object we passed to _notify 3057 event.originalError = messageOrEvent; 3058 3059 // include the raw input as metadata â it might contain more info than we extracted 3060 event.addMetadata(component, { 3061 event: messageOrEvent, 3062 extraParameters: url 3063 }); 3064 } else { 3065 // Lastly, if there was no "error" parameter this event was probably from an old 3066 // browser that doesn't support that. Instead we need to generate a stacktrace. 3067 event = client.Event.create(messageOrEvent, true, handledState, component, 1); 3068 decorateStack(event.errors[0].stacktrace, url, lineNo, charNo); 3069 } 3070 client._notify(event); 3071 } 3072 if (typeof prevOnError === 'function') prevOnError.apply(this, arguments); 3073 } 3074 var prevOnError = win.onerror; 3075 win.onerror = onerror; 3076 } 3077 }; 3078}; 3079 3080// Sometimes the stacktrace has less information than was passed to window.onerror. 3081// This function will augment the first stackframe with any useful info that was 3082// received as arguments to the onerror callback. 3083var decorateStack = function (stack, url, lineNo, charNo) { 3084 if (!stack[0]) stack.push({}); 3085 var culprit = stack[0]; 3086 if (!culprit.file && typeof url === 'string') culprit.file = url; 3087 if (!culprit.lineNumber && isActualNumber(lineNo)) culprit.lineNumber = lineNo; 3088 if (!culprit.columnNumber) { 3089 if (isActualNumber(charNo)) { 3090 culprit.columnNumber = charNo; 3091 } else if (window.event && isActualNumber(window.event.errorCharacter)) { 3092 culprit.columnNumber = window.event.errorCharacter; 3093 } 3094 } 3095}; 3096var isActualNumber = function (n) { 3097 return typeof n === 'number' && String.call(n) !== 'NaN'; 3098}; 3099 3100/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */; 3101/* removed: var _$iserror_20 = require('@bugsnag/core/lib/iserror'); */; 3102var _listener; 3103/* 3104 * Automatically notifies Bugsnag when window.onunhandledrejection is called 3105 */ 3106var _$unhandledRejection_55 = function (win) { 3107 if (win === void 0) { 3108 win = window; 3109 } 3110 var plugin = { 3111 load: function (client) { 3112 if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return; 3113 var listener = function (evt) { 3114 var error = evt.reason; 3115 var isBluebird = false;
3116 3117 // accessing properties on evt.detail can throw errors (see #394) 3118 try { 3119 if (evt.detail && evt.detail.reason) { 3120 error = evt.detail.reason; 3121 isBluebird = true; 3122 } 3123 } catch (e) {} 3124 var event = client.Event.create(error, false, { 3125 severity: 'error', 3126 unhandled: true, 3127 severityReason: { 3128 type: 'unhandledPromiseRejection' 3129 } 3130 }, 'unhandledrejection handler', 1, client._logger); 3131 if (isBluebird) { 3132 _$map_16(event.errors[0].stacktrace, fixBluebirdStacktrace(error)); 3133 } 3134 client._notify(event, function (event) { 3135 if (_$iserror_20(event.originalError) && !event.originalError.stack) { 3136 var _event$addMetadata; 3137 event.addMetadata('unhandledRejection handler', (_event$addMetadata = {}, _event$addMetadata[Object.prototype.toString.call(event.originalError)] = { 3138 name: event.originalError.name, 3139 message: event.originalError.message, 3140 code: event.originalError.code 3141 }, _event$addMetadata)); 3142 } 3143 }); 3144 }; 3145 if ('addEventListener' in win) { 3146 win.addEventListener('unhandledrejection', listener); 3147 } else { 3148 win.onunhandledrejection = function (reason, promise) { 3149 listener({ 3150 detail: { 3151 reason: reason, 3152 promise: promise 3153 } 3154 }); 3155 }; 3156 } 3157 _listener = listener; 3158 } 3159 }; 3160 if (false) {} 3161 return plugin; 3162}; 3163 3164// The stack parser on bluebird stacks in FF get a suprious first frame: 3165// 3166// Error: derp 3167// b@http://localhost:5000/bluebird.html:22:24 3168// a@http://localhost:5000/bluebird.html:18:9 3169// @http://localhost:5000/bluebird.html:14:9 3170// 3171// results in 3172// [â¦] 3173// 0: Object { file: "Error: derp", method: undefined, lineNumber: undefined, ⦠} 3174// 1: Object { file: "http://localhost:5000/bluebird.html", method: "b", lineNumber: 22, ⦠} 3175// 2: Object { file: "http://localhost:5000/bluebird.html", method: "a", lineNumber: 18, ⦠} 3176// 3: Object { file: "http://localhost:5000/bluebird.html", lineNumber: 14, columnNumber: 9, ⦠} 3177// 3178// so the following reduce/accumulator function removes such frames 3179// 3180// Bluebird pads method names with spaces so trim that too⦠3181// https://github.com/petkaantonov/bluebird/blob/b7f21399816d02f979fe434585334ce901dcaf44/src/debuggability.js#L568-L571 3182var fixBluebirdStacktrace = function (error) { 3183 return function (frame) { 3184 if (frame.file === error.toString()) return; 3185 if (frame.method) { 3186 frame.method = frame.method.replace(/^\s+/, ''); 3187 } 3188 }; 3189}; 3190 3191var _$notifier_2 = {}; 3192var name = 'Bugsnag JavaScript'; 3193var version = '7.25.0'; 3194var url = 'https://github.com/bugsnag/bugsnag-js'; 3195/* removed: var _$Client_4 = require('@bugsnag/core/client'); */; 3196/* removed: var _$Event_6 = require('@bugsnag/core/event'); */; 3197/* removed: var _$Session_35 = require('@bugsnag/core/session'); */; 3198/* removed: var _$Breadcrumb_3 = require('@bugsnag/core/breadcrumb'); */; 3199/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */; 3200/* removed: var _$keys_15 = require('@bugsnag/core/lib/es-utils/keys'); */; 3201/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */; 3202 3203// extend the base config schema with some browser-specific options 3204var __schema_2 = _$assign_11({}, _$config_5.schema, _$config_1); 3205/* removed: var _$onerror_54 = require('@bugsnag/plugin-window-onerror'); */; 3206/* removed: var _$unhandledRejection_55 = require('@bugsnag/plugin-window-unhandled-rejection'); */; 3207/* removed: var _$app_38 = require('@bugsnag/plugin-app-duration'); */; 3208/* removed: var _$device_40 = require('@bugsnag/plugin-browser-device'); */; 3209/* removed: var _$context_39 = require('@bugsnag/plugin-browser-context'); */; 3210/* removed: var _$request_44 = require('@bugsnag/plugin-browser-request'); */; 3211/* removed: var _$throttle_52 = require('@bugsnag/plugin-simple-throttle'); */; 3212/* removed: var _$consoleBreadcrumbs_47 = require('@bugsnag/plugin-console-breadcrumbs'); */; 3213/* removed: var _$networkBreadcrumbs_51 = require('@bugsnag/plugin-network-breadcrumbs'); */; 3214/* removed: var _$navigationBreadcrumbs_50 = require('@bugsnag/plugin-navigation-breadcrumbs'); */; 3215/* removed: var _$interactionBreadcrumbs_49 = require('@bugsnag/plugin-interaction-breadcrumbs'); */; 3216/* removed: var _$inlineScriptContent_48 = require('@bugsnag/plugin-inline-script-content'); */; 3217/* removed: var _$session_45 = require('@bugsnag/plugin-browser-session'); */; 3218/* removed: var _$clientIp_46 = require('@bugsnag/plugin-client-ip'); */; 3219/* removed: var _$stripQueryString_53 = require('@bugsnag/plugin-strip-query-string'); */; 3220 3221// delivery mechanisms 3222/* removed: var _$delivery_36 = require('@bugsnag/delivery-x-domain-request'); */; 3223/* removed: var _$delivery_37 = require('@bugsnag/delivery-xml-http-request'); */; 3224var Bugsnag = { 3225 _client: null, 3226 createClient: function (opts) { 3227 // handle very simple use case where user supplies just the api key as a
3227string 3228 if (typeof opts === 'string') opts = { 3229 apiKey: opts 3230 }; 3231 if (!opts) opts = {}; 3232 var internalPlugins = [ 3233 // add browser-specific plugins 3234 _$app_38, _$device_40(), _$context_39(), _$request_44(), _$throttle_52, _$session_45, _$clientIp_46, _$stripQueryString_53, _$onerror_54(), _$unhandledRejection_55(), _$navigationBreadcrumbs_50(), _$interactionBreadcrumbs_49(), _$networkBreadcrumbs_51(), _$consoleBreadcrumbs_47, 3235 // this one added last to avoid wrapping functionality before bugsnag uses it 3236 _$inlineScriptContent_48()]; 3237 3238 // configure a client with user supplied options 3239 var bugsnag = new _$Client_4(opts, __schema_2, internalPlugins, { 3240 name: name, 3241 version: version, 3242 url: url 3243 }); 3244 3245 // set delivery based on browser capability (IE 8+9 have an XDomainRequest object) 3246 bugsnag._setDelivery(window.XDomainRequest ? _$delivery_36 : _$delivery_37); 3247 bugsnag._logger.debug('Loaded!'); 3248 bugsnag.leaveBreadcrumb('Bugsnag loaded', {}, 'state'); 3249 return bugsnag._config.autoTrackSessions ? bugsnag.startSession() : bugsnag; 3250 }, 3251 start: function (opts) { 3252 if (Bugsnag._client) { 3253 Bugsnag._client._logger.warn('Bugsnag.start() was called more than once. Ignoring.'); 3254 return Bugsnag._client; 3255 } 3256 Bugsnag._client = Bugsnag.createClient(opts); 3257 return Bugsnag._client; 3258 }, 3259 isStarted: function () { 3260 return Bugsnag._client != null; 3261 } 3262}; 3263_$map_16(['resetEventCount'].concat(_$keys_15(_$Client_4.prototype)), function (m) { 3264 if (/^_/.test(m)) return; 3265 Bugsnag[m] = function () { 3266 if (!Bugsnag._client) return console.log("Bugsnag." + m + "() was called before Bugsnag.start()"); 3267 Bugsnag._client._depth += 1; 3268 var ret = Bugsnag._client[m].apply(Bugsnag._client, arguments); 3269 Bugsnag._client._depth -= 1; 3270 return ret; 3271 }; 3272}); 3273_$notifier_2 = Bugsnag; 3274_$notifier_2.Client = _$Client_4; 3275_$notifier_2.Event = _$Event_6; 3276_$notifier_2.Session = _$Session_35; 3277_$notifier_2.Breadcrumb = _$Breadcrumb_3; 3278 3279// Export a "default" property for compatibility with ESM imports 3280_$notifier_2["default"] = Bugsnag; 3281 3282return _$notifier_2; 3283 3284}); 3285//# sourceMappingURL=bugsnag.js.map 3286 3287 3288/***/ }), 3289 3290/***/ 5993: 3291/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 3292 3293module.exports = __webpack_require__(9525) 3294 3295 3296/***/ }), 3297 3298/***/ 1702: 3299/***/ ((module) => { 3300 3301(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports; 3302var _$src_1 = {}; 3303function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } 3304function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 3305function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } 3306function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 3307_$src_1 = /*#__PURE__*/function () { 3308 function BugsnagPluginReact() { 3309 // Fetch React from the window object, if it exists 3310 var globalReact = typeof window !== 'undefined' && window.React; 3311 this.name = 'react'; 3312 this.lazy = arguments.length === 0 && !globalReact; 3313 if (!this.lazy) { 3314 this.React = (arguments.length <= 0 ? undefined : arguments[0]) || globalReact; 3315 if (!this.React) throw new Error('@bugsnag/plugin-react reference to `React` was undefined'); 3316 } 3317 } 3318 var _proto = BugsnagPluginReact.prototype; 3319 _proto.load = function load(client) { 3320 if (!this.lazy) { 3321 var ErrorBoundary = createClass(this.React, client); 3322 ErrorBoundary.createErrorBoundary = function () { 3323 return ErrorBoundary; 3324 }; 3325 return ErrorBoundary; 3326 } 3327 var BugsnagPluginReactLazyInitializer = function () { 3328 throw new Error("@bugsnag/plugin-react was used incorrectly. Valid usage is as follows:\nPass React to the plugin constructor\n\n `Bugsnag.start({ plugins: [new BugsnagPluginReact(React)] })`\nand then call `const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary()`\n\nOr if React is not available until after Bugsnag has started,\nconstruct the plugin with no arguments\n `Bugsnag.start({ plugins: [new BugsnagPluginReact()] })`,\nthen pass in React when available to construct your error boundary\n `const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React)`"); 3329 }; 3330 BugsnagPluginReactLazyInitializer.createErrorBoundary = function (React) { 3331 if (!React) throw new Error('@bugsnag/plugin-react reference to `React` was undefined'); 3332 return createClass(React, client); 3333 }; 3334 return BugsnagPluginReactLazyInitializer; 3335 }; 3336 return BugsnagPluginReact; 3337}(); 3338var formatComponentStack = function (str) { 3339 var lines = str.split(/\n/g); 3340 var ret = ''; 3341 for (var line = 0, len = lines.length; line < len; line++) { 3342 if (lines[line].length) ret += "" + (ret.length ? '\n' : '') + lines[line].trim(); 3343 } 3344 return ret; 3345}; 3346var createClass = function (React, client) { 3347 return /*#__PURE__*/function (_React$Component) { 3348 _inheritsLoose(ErrorBoundary, _React$Component); 3349 function ErrorBoundary(props) { 3350 var _this; 3351 _this = _React$Component.call(this, props) || this; 3352 _this.state = { 3353 error: null, 3354 info: null 3355 }; 3356 _this.handleClearError = _this.handleClearError.bind(_assertThisInitialized(_this)); 3357 return _this; 3358 } 3359 var _proto2 = ErrorBoundary.prototype; 3360 _proto2.handleClearError = function handleClearError() { 3361 this.setState({ 3362 error: null, 3363 info: null 3364 }); 3365 }; 3366 _proto2.componentDidCatch = function componentDidCatch(error, info) { 3367 var onError = this.props.onError; 3368 var handledState = { 3369 severity: 'error', 3370 unhandled: true, 3371 severityReason: { 3372 type: 'unhandledException' 3373 } 3374 }; 3375 var event = client.Event.create(error, true, handledState, 1); 3376 if (info && info.componentStack) info.componentStack = formatComponentStack(info.componentStack); 3377 event.addMetadata('react', info); 3378 client._notify(event, onError); 3379 this.setState({ 3380 error: error, 3381 info: info 3382 }); 3383 }; 3384 _proto2.render = function render() { 3385 var error = this.state.error; 3386 if (error) { 3387 var FallbackComponent = this.props.FallbackComponent; 3388 if (FallbackComponent) return React.createElement(FallbackComponent, _extends({}, this.state, { 3389 clearError: this.handleClearError 3390 })); 3391 return null; 3392 } 3393 return this.props.children; 3394 }; 3395 return ErrorBoundary; 3396 }(React.Component); 3397}; 3398_$src_1.formatComponentStack = formatComponentStack; 3399_$src_1["default"] = _$src_1; 3400 3401return _$src_1; 3402 3403}); 3404//# sourceMappingURL=bugsnag-react.js.map 3405 3406 3407/***/ }), 3408 3409/***/ 2348: 3410/***/ ((module, __webpack_exports__, __webpack_require__) => { 3411 3412"use strict"; 3413/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3414/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) 3415/* harmony export */ }); 3416/* harmony import */ var _css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1601); 3417/* harmony import */ var _css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); 3418/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6314); 3419/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); 3420// Imports 3421 3422 3423var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); 3424// Module
3425___CSS_LOADER_EXPORT___.push([module.id, `@keyframes react-loading-skeleton { 3426 100% { 3427 transform: translateX(100%); 3428 } 3429} 3430 3431.react-loading-skeleton { 3432 --base-color: #ebebeb; 3433 --highlight-color: #f5f5f5; 3434 --animation-duration: 1.5s; 3435 --animation-direction: normal; 3436 --pseudo-element-display: block; /* Enable animation */ 3437 3438 background-color: var(--base-color); 3439 3440 width: 100%; 3441 border-radius: 0.25rem; 3442 display: inline-flex; 3443 line-height: 1; 3444 3445 position: relative; 3446 user-select: none; 3447 overflow: hidden; 3448} 3449 3450.react-loading-skeleton::after { 3451 content: ' '; 3452 display: var(--pseudo-element-display); 3453 position: absolute; 3454 top: 0; 3455 left: 0; 3456 right: 0; 3457 height: 100%; 3458 background-repeat: no-repeat; 3459 background-image: linear-gradient( 3460 90deg, 3461 var(--base-color), 3462 var(--highlight-color), 3463 var(--base-color) 3464 ); 3465 transform: translateX(-100%); 3466 3467 animation-name: react-loading-skeleton; 3468 animation-direction: var(--animation-direction); 3469 animation-duration: var(--animation-duration); 3470 animation-timing-function: ease-in-out; 3471 animation-iteration-count: infinite; 3472} 3473 3474@media (prefers-reduced-motion) { 3475 .react-loading-skeleton { 3476 --pseudo-element-display: none; /* Disable animation */ 3477 } 3478} 3479`, ""]); 3480// Exports 3481/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); 3482 3483 3484/***/ }), 3485 3486/***/ 7455: 3487/***/ ((module, __webpack_exports__, __webpack_require__) => { 3488 3489"use strict"; 3490/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3491/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) 3492/* harmony export */ }); 3493/* harmony import */ var _css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1601); 3494/* harmony import */ var _css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); 3495/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6314); 3496/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); 3497// Imports 3498 3499 3500var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); 3501// Module 3502___CSS_LOADER_EXPORT___.push([module.id, `:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{left:0;opacity:0;pointer-events:none;position:absolute;top:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{background:inherit;position:absolute}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay) ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay) ease-in}.styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;padding:8px 16px;width:max-content}.styles-module_arrow__K0L3T{height:8px;width:8px}[class*=react-tooltip__place-top]>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*=react-tooltip__place-right]>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*=react-tooltip__place-bottom]>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*=react-tooltip__place-left]>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`, ""]); 3503// Exports 3504/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_
vendor: 2,525 bytes, lines 3504-3614
3504LOADER_EXPORT___); 3505 3506 3507/***/ }), 3508 3509/***/ 6314: 3510/***/ ((module) => { 3511 3512"use strict"; 3513 3514 3515/* 3516 MIT License http://www.opensource.org/licenses/mit-license.php 3517 Author Tobias Koppers @sokra 3518*/ 3519module.exports = function (cssWithMappingToString) { 3520 var list = []; 3521 3522 // return the list of modules as css string 3523 list.toString = function toString() { 3524 return this.map(function (item) { 3525 var content = ""; 3526 var needLayer = typeof item[5] !== "undefined"; 3527 if (item[4]) { 3528 content += "@supports (".concat(item[4], ") {"); 3529 } 3530 if (item[2]) { 3531 content += "@media ".concat(item[2], " {"); 3532 } 3533 if (needLayer) { 3534 content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {"); 3535 } 3536 content += cssWithMappingToString(item); 3537 if (needLayer) { 3538 content += "}"; 3539 } 3540 if (item[2]) { 3541 content += "}"; 3542 } 3543 if (item[4]) { 3544 content += "}"; 3545 } 3546 return content; 3547 }).join(""); 3548 }; 3549 3550 // import a list of modules into the list 3551 list.i = function i(modules, media, dedupe, supports, layer) { 3552 if (typeof modules === "string") { 3553 modules = [[null, modules, undefined]]; 3554 } 3555 var alreadyImportedModules = {}; 3556 if (dedupe) { 3557 for (var k = 0; k < this.length; k++) { 3558 var id = this[k][0]; 3559 if (id != null) { 3560 alreadyImportedModules[id] = true; 3561 } 3562 } 3563 } 3564 for (var _k = 0; _k < modules.length; _k++) { 3565 var item = [].concat(modules[_k]); 3566 if (dedupe && alreadyImportedModules[item[0]]) { 3567 continue; 3568 } 3569 if (typeof layer !== "undefined") { 3570 if (typeof item[5] === "undefined") { 3571 item[5] = layer; 3572 } else { 3573 item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}"); 3574 item[5] = layer; 3575 } 3576 } 3577 if (media) { 3578 if (!item[2]) { 3579 item[2] = media; 3580 } else { 3581 item[1] = "@media ".concat(item[2], " {").concat(item[1], "}"); 3582 item[2] = media; 3583 } 3584 } 3585 if (supports) { 3586 if (!item[4]) { 3587 item[4] = "".concat(supports); 3588 } else { 3589 item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}"); 3590 item[4] = supports; 3591 } 3592 } 3593 list.push(item); 3594 } 3595 }; 3596 return list; 3597}; 3598 3599/***/ }), 3600 3601/***/ 1601: 3602/***/ ((module) => { 3603 3604"use strict"; 3605 3606 3607module.exports = function (i) { 3608 return i[1]; 3609}; 3610 3611/***/ }), 3612 3613/***/ 7007: 3614/***/ ((module) =>
vendor: 4,392 bytes, lines 3614-3745
3614 { 3615 3616"use strict"; 3617// Copyright Joyent, Inc. and other Node contributors. 3618// 3619// Permission is hereby granted, free of charge, to any person obtaining a 3620// copy of this software and associated documentation files (the 3621// "Software"), to deal in the Software without restriction, including 3622// without limitation the rights to use, copy, modify, merge, publish, 3623// distribute, sublicense, and/or sell copies of the Software, and to permit 3624// persons to whom the Software is furnished to do so, subject to the 3625// following conditions: 3626// 3627// The above copyright notice and this permission notice shall be included 3628// in all copies or substantial portions of the Software. 3629// 3630// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 3631// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 3632// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 3633// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 3634// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 3635// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 3636// USE OR OTHER DEALINGS IN THE SOFTWARE. 3637 3638 3639 3640var R = typeof Reflect === 'object' ? Reflect : null 3641var ReflectApply = R && typeof R.apply === 'function' 3642 ? R.apply 3643 : function ReflectApply(target, receiver, args) { 3644 return Function.prototype.apply.call(target, receiver, args); 3645 } 3646 3647var ReflectOwnKeys 3648if (R && typeof R.ownKeys === 'function') { 3649 ReflectOwnKeys = R.ownKeys 3650} else if (Object.getOwnPropertySymbols) { 3651 ReflectOwnKeys = function ReflectOwnKeys(target) { 3652 return Object.getOwnPropertyNames(target) 3653 .concat(Object.getOwnPropertySymbols(target)); 3654 }; 3655} else { 3656 ReflectOwnKeys = function ReflectOwnKeys(target) { 3657 return Object.getOwnPropertyNames(target); 3658 }; 3659} 3660 3661function ProcessEmitWarning(warning) { 3662 if (console && console.warn) console.warn(warning); 3663} 3664 3665var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { 3666 return value !== value; 3667} 3668 3669function EventEmitter() { 3670 EventEmitter.init.call(this); 3671} 3672module.exports = EventEmitter; 3673module.exports.once = once; 3674 3675// Backwards-compat with node 0.10.x 3676EventEmitter.EventEmitter = EventEmitter; 3677 3678EventEmitter.prototype._events = undefined; 3679EventEmitter.prototype._eventsCount = 0; 3680EventEmitter.prototype._maxListeners = undefined; 3681 3682// By default EventEmitters will print a warning if more than 10 listeners are 3683// added to it. This is a useful default which helps finding memory leaks. 3684var defaultMaxListeners = 10; 3685 3686function checkListener(listener) { 3687 if (typeof listener !== 'function') { 3688 throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); 3689 } 3690} 3691 3692Object.defineProperty(EventEmitter, 'defaultMaxListeners', { 3693 enumerable: true, 3694 get: function() { 3695 return defaultMaxListeners; 3696 }, 3697 set: function(arg) { 3698 if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { 3699 throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); 3700 } 3701 defaultMaxListeners = arg; 3702 } 3703}); 3704 3705EventEmitter.init = function() { 3706 3707 if (this._events === undefined || 3708 this._events === Object.getPrototypeOf(this)._events) { 3709 this._events = Object.create(null); 3710 this._eventsCount = 0; 3711 } 3712 3713 this._maxListeners = this._maxListeners || undefined; 3714}; 3715 3716// Obviously not all Emitters should be limited to 10. This function allows 3717// that to be increased. Set to zero for unlimited. 3718EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { 3719 if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { 3720 throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); 3721 } 3722 this._maxListeners = n; 3723 return this; 3724}; 3725 3726function _getMaxListeners(that) { 3727 if (that._maxListeners === undefined) 3728 return EventEmitter.defaultMaxListeners; 3729 return that._maxListeners; 3730} 3731 3732EventEmitter.prototype.getMaxListeners = function getMaxListeners() { 3733 return _getMaxListeners(this); 3734}; 3735 3736EventEmitter.prototype.emit = function emit(type) { 3737 var args = []; 3738 for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); 3739 var doError = (type === 'error'); 3740 3741 var events = this._events; 3742 if (events !== undefined) 3743 doError = (doError && events.error === undefined); 3744 else if (!doError) 3745 return false;
vendor: 10,522 bytes, lines 3746-4118
3746 3747 // If there is no 'error' event listener then throw. 3748 if (doError) { 3749 var er; 3750 if (args.length > 0) 3751 er = args[0]; 3752 if (er instanceof Error) { 3753 // Note: The comments on the `throw` lines are intentional, they show 3754 // up in Node's output if this results in an unhandled exception. 3755 throw er; // Unhandled 'error' event 3756 } 3757 // At least give some kind of context to the user 3758 var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); 3759 err.context = er; 3760 throw err; // Unhandled 'error' event 3761 } 3762 3763 var handler = events[type]; 3764 3765 if (handler === undefined) 3766 return false; 3767 3768 if (typeof handler === 'function') { 3769 ReflectApply(handler, this, args); 3770 } else { 3771 var len = handler.length; 3772 var listeners = arrayClone(handler, len); 3773 for (var i = 0; i < len; ++i) 3774 ReflectApply(listeners[i], this, args); 3775 } 3776 3777 return true; 3778}; 3779 3780function _addListener(target, type, listener, prepend) { 3781 var m; 3782 var events; 3783 var existing; 3784 3785 checkListener(listener); 3786 3787 events = target._events; 3788 if (events === undefined) { 3789 events = target._events = Object.create(null); 3790 target._eventsCount = 0; 3791 } else { 3792 // To avoid recursion in the case that type === "newListener"! Before 3793 // adding it to the listeners, first emit "newListener". 3794 if (events.newListener !== undefined) { 3795 target.emit('newListener', type, 3796 listener.listener ? listener.listener : listener); 3797 3798 // Re-assign `events` because a newListener handler could have caused the 3799 // this._events to be assigned to a new object 3800 events = target._events; 3801 } 3802 existing = events[type]; 3803 } 3804 3805 if (existing === undefined) { 3806 // Optimize the case of one listener. Don't need the extra array object. 3807 existing = events[type] = listener; 3808 ++target._eventsCount; 3809 } else { 3810 if (typeof existing === 'function') { 3811 // Adding the second element, need to change to array. 3812 existing = events[type] = 3813 prepend ? [listener, existing] : [existing, listener]; 3814 // If we've already got an array, just append. 3815 } else if (prepend) { 3816 existing.unshift(listener); 3817 } else { 3818 existing.push(listener); 3819 } 3820 3821 // Check for listener leak 3822 m = _getMaxListeners(target); 3823 if (m > 0 && existing.length > m && !existing.warned) { 3824 existing.warned = true; 3825 // No error code for this since it is a Warning 3826 // eslint-disable-next-line no-restricted-syntax 3827 var w = new Error('Possible EventEmitter memory leak detected. ' + 3828 existing.length + ' ' + String(type) + ' listeners ' + 3829 'added. Use emitter.setMaxListeners() to ' + 3830 'increase limit'); 3831 w.name = 'MaxListenersExceededWarning'; 3832 w.emitter = target; 3833 w.type = type; 3834 w.count = existing.length; 3835 ProcessEmitWarning(w); 3836 } 3837 } 3838 3839 return target; 3840} 3841 3842EventEmitter.prototype.addListener = function addListener(type, listener) { 3843 return _addListener(this, type, listener, false); 3844}; 3845 3846EventEmitter.prototype.on = EventEmitter.prototype.addListener; 3847 3848EventEmitter.prototype.prependListener = 3849 function prependListener(type, listener) { 3850 return _addListener(this, type, listener, true); 3851 }; 3852 3853function onceWrapper() { 3854 if (!this.fired) { 3855 this.target.removeListener(this.type, this.wrapFn); 3856 this.fired = true; 3857 if (arguments.length === 0) 3858 return this.listener.call(this.target); 3859 return this.listener.apply(this.target, arguments); 3860 } 3861} 3862 3863function _onceWrap(target, type, listener) { 3864 var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; 3865 var wrapped = onceWrapper.bind(state); 3866 wrapped.listener = listener; 3867 state.wrapFn = wrapped; 3868 return wrapped; 3869} 3870 3871EventEmitter.prototype.once = function once(type, listener) { 3872 checkListener(listener); 3873 this.on(type, _onceWrap(this, type, listener)); 3874 return this; 3875}; 3876 3877EventEmitter.prototype.prependOnceListener = 3878 function prependOnceListener(type, listener) { 3879 checkListener(listener); 3880 this.prependListener(type, _onceWrap(this, type, listener)); 3881 return this; 3882 }; 3883 3884// Emits a 'removeListener' event if and only if the listener was removed. 3885EventEmitter.prototype.removeListener = 3886 function removeListener(type, listener) { 3887 var list, events, position, i, originalListener; 3888 3889 checkListener(listener); 3890 3891 events = this._events; 3892 if (events === undefined) 3893 return this; 3894 3895 list = events[type]; 3896 if (list === undefined) 3897 return this; 3898 3899 if (list === listener || list.listener === listener) { 3900 if (--this._eventsCount === 0) 3901 this._events = Object.create(null); 3902 else { 3903 delete events[type]; 3904 if (events.removeListener) 3905 this.emit('removeListener', type, list.listener || listener); 3906 } 3907 } else if (typeof list !== 'function') { 3908 position = -1; 3909 3910 for (i = list.length - 1; i >= 0; i--) { 3911 if (list[i] === listener || list[i].listener === listener) { 3912 originalListener = list[i].listener; 3913 position = i; 3914 break; 3915 } 3916 } 3917 3918 if (position < 0) 3919 return this; 3920 3921 if (position === 0) 3922 list.shift(); 3923 else { 3924 spliceOne(list, position); 3925 } 3926 3927 if (list.length === 1) 3928 events[type] = list[0]; 3929 3930 if (events.removeListener !== undefined) 3931 this.emit('removeListener', type, originalListener || listener); 3932 } 3933 3934 return this; 3935 }; 3936 3937EventEmitter.prototype.off = EventEmitter.prototype.removeListener; 3938 3939EventEmitter.prototype.removeAllListeners = 3940 function removeAllListeners(type) { 3941 var listeners, events, i; 3942 3943 events = this._events; 3944 if (events === undefined) 3945 return this; 3946 3947 // not listening for removeListener, no need to emit 3948 if (events.removeListener === undefined) { 3949 if (arguments.length === 0) { 3950 this._events = Object.create(null); 3951 this._eventsCount = 0; 3952 } else if (events[type] !== undefined) { 3953 if (--this._eventsCount === 0) 3954 this._events = Object.create(null); 3955 else 3956 delete events[type]; 3957 } 3958 return this; 3959 } 3960 3961 // emit removeListener for all listeners on all events 3962 if (arguments.length === 0) { 3963 var keys = Object.keys(events); 3964 var key; 3965 for (i = 0; i < keys.length; ++i) { 3966 key = keys[i]; 3967 if (key === 'removeListener') continue; 3968 this.removeAllListeners(key); 3969 } 3970 this.removeAllListeners('removeListener'); 3971 this._events = Object.create(null); 3972 this._eventsCount = 0; 3973 return this; 3974 } 3975 3976 listeners = events[type]; 3977 3978 if (typeof listeners === 'function') { 3979 this.removeListener(type, listeners); 3980 } else if (listeners !== undefined) { 3981 // LIFO order 3982 for (i = listeners.length - 1; i >= 0; i--) { 3983 this.removeListener(type, listeners[i]); 3984 } 3985 } 3986 3987 return this; 3988 }; 3989 3990function _listeners(target, type, unwrap) { 3991 var events = target._events; 3992 3993 if (events === undefined) 3994 return []; 3995 3996 var evlistener = events[type]; 3997 if (evlistener === undefined) 3998 return []; 3999 4000 if (typeof evlistener === 'function') 4001 return unwrap ? [evlistener.listener || evlistener] : [evlistener]; 4002 4003 return unwrap ? 4004 unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); 4005} 4006 4007EventEmitter.prototype.listeners = function listeners(type) { 4008 return _listeners(this, type, true); 4009}; 4010 4011EventEmitter.prototype.rawListeners = function rawListeners(type) { 4012 return _listeners(this, type, false); 4013}; 4014 4015EventEmitter.listenerCount = function(emitter, type) { 4016 if (typeof emitter.listenerCount === 'function') { 4017 return emitter.listenerCount(type); 4018 } else { 4019 return listenerCount.call(emitter, type); 4020 } 4021}; 4022 4023EventEmitter.prototype.listenerCount = listenerCount; 4024function listenerCount(type) { 4025 var events = this._events; 4026 4027 if (events !== undefined) { 4028 var evlistener = events[type]; 4029 4030 if (typeof evlistener === 'function') { 4031 return 1; 4032 } else if (evlistener !== undefined) { 4033 return evlistener.length; 4034 } 4035 } 4036 4037 return 0; 4038} 4039 4040EventEmitter.prototype.eventNames = function eventNames() { 4041 return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; 4042}; 4043 4044function arrayClone(arr, n) { 4045 var copy = new Array(n); 4046 for (var i = 0; i < n; ++i) 4047 copy[i] = arr[i]; 4048 return copy; 4049} 4050 4051function spliceOne(list, index) { 4052 for (; index + 1 < list.length; index++) 4053 list[index] = list[index + 1]; 4054 list.pop(); 4055} 4056 4057function unwrapListeners(arr) { 4058 var ret = new Array(arr.length); 4059 for (var i = 0; i < ret.length; ++i) { 4060 ret[i] = arr[i].listener || arr[i]; 4061 } 4062 return ret; 4063} 4064 4065function once(emitter, name) { 4066 return new Promise(function (resolve, reject) { 4067 function errorListener(err) { 4068 emitter.removeListener(name, resolver); 4069 reject(err); 4070 } 4071 4072 function resolver() { 4073 if (typeof emitter.removeListener === 'function') { 4074 emitter.removeListener('error', errorListener); 4075 } 4076 resolve([].slice.call(arguments)); 4077 }; 4078 4079 eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); 4080 if (name !== 'error') { 4081 addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); 4082 } 4083 }); 4084} 4085 4086function addErrorHandlerIfEventEmitter(emitter, handler, flags) { 4087 if (typeof emitter.on === 'function') { 4088 eventTargetAgnosticAddListener(emitter, 'error', handler, flags); 4089 } 4090} 4091 4092function eventTargetAgnosticAddListener(emitter, name, listener, flags) { 4093 if (typeof emitter.on === 'function') { 4094 if (flags.once) { 4095 emitter.once(name, listener); 4096 } else { 4097 emitter.on(name, listener); 4098 } 4099 } else if (typeof emitter.addEventListener === 'function') { 4100 // EventTarget does not have `error` event semantics like Node 4101 // EventEmitters, we do not listen for `error` events here. 4102 emitter.addEventListener(name, function wrapListener(arg) { 4103 // IE does not have builtin `{ once: true }` support so we 4104 // have to do it manually. 4105 if (flags.once) { 4106 emitter.removeEventListener(name, wrapListener); 4107 } 4108 listener(arg); 4109 }); 4110 } else { 4111 throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); 4112 } 4113} 4114 4115 4116/***/ }), 4117 4118/***/
41184692: 4119/***/ (function
vendor: 12,488 bytes, lines 4119-4628
4119(module, exports) { 4120 4121var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 4122 * jQuery JavaScript Library v3.7.1 4123 * https://jquery.com/ 4124 * 4125 * Copyright OpenJS Foundation and other contributors 4126 * Released under the MIT license 4127 * https://jquery.org/license 4128 * 4129 * Date: 2023-08-28T13:37Z 4130 */ 4131( function( global, factory ) { 4132 4133 "use strict"; 4134 4135 if ( true && typeof module.exports === "object" ) { 4136 4137 // For CommonJS and CommonJS-like environments where a proper `window` 4138 // is present, execute the factory and get jQuery. 4139 // For environments that do not have a `window` with a `document` 4140 // (such as Node.js), expose a factory as module.exports. 4141 // This accentuates the need for the creation of a real `window`. 4142 // e.g. var jQuery = require("jquery")(window); 4143 // See ticket trac-14549 for more info. 4144 module.exports = global.document ? 4145 factory( global, true ) : 4146 function( w ) { 4147 if ( !w.document ) { 4148 throw new Error( "jQuery requires a window with a document" ); 4149 } 4150 return factory( w ); 4151 }; 4152 } else { 4153 factory( global ); 4154 } 4155 4156// Pass this if window is not defined yet 4157} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 4158 4159// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 4160// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 4161// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 4162// enough that all such attempts are guarded in a try block. 4163"use strict"; 4164 4165var arr = []; 4166 4167var getProto = Object.getPrototypeOf; 4168 4169var slice = arr.slice; 4170 4171var flat = arr.flat ? function( array ) { 4172 return arr.flat.call( array ); 4173} : function( array ) { 4174 return arr.concat.apply( [], array ); 4175}; 4176 4177 4178var push = arr.push; 4179 4180var indexOf = arr.indexOf; 4181 4182var class2type = {}; 4183 4184var toString = class2type.toString; 4185 4186var hasOwn = class2type.hasOwnProperty; 4187 4188var fnToString = hasOwn.toString; 4189 4190var ObjectFunctionString = fnToString.call( Object ); 4191 4192var support = {}; 4193 4194var isFunction = function isFunction( obj ) { 4195 4196 // Support: Chrome <=57, Firefox <=52 4197 // In some browsers, typeof returns "function" for HTML <object> elements 4198 // (i.e., `typeof document.createElement( "object" ) === "function"`). 4199 // We don't want to classify *any* DOM node as a function. 4200 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 4201 // Plus for old WebKit, typeof returns "function" for HTML collections 4202 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 4203 return typeof obj === "function" && typeof obj.nodeType !== "number" && 4204 typeof obj.item !== "function"; 4205 }; 4206 4207 4208var isWindow = function isWindow( obj ) { 4209 return obj != null && obj === obj.window; 4210 }; 4211 4212 4213var document = window.document; 4214 4215 4216 4217 var preservedScriptAttributes = { 4218 type: true, 4219 src: true, 4220 nonce: true, 4221 noModule: true 4222 }; 4223 4224 function DOMEval( code, node, doc ) { 4225 doc = doc || document; 4226 4227 var i, val, 4228 script = doc.createElement( "script" ); 4229 4230 script.text = code; 4231 if ( node ) { 4232 for ( i in preservedScriptAttributes ) { 4233 4234 // Support: Firefox 64+, Edge 18+ 4235 // Some browsers don't support the "nonce" property on scripts. 4236 // On the other hand, just using `getAttribute` is not enough as 4237 // the `nonce` attribute is reset to an empty string whenever it 4238 // becomes browsing-context connected. 4239 // See https://github.com/whatwg/html/issues/2369 4240 // See https://html.spec.whatwg.org/#nonce-attributes 4241 // The `node.getAttribute` check was added for the sake of 4242 // `jQuery.globalEval` so that it can fake a nonce-containing node 4243 // via an object. 4244 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 4245 if ( val ) { 4246 script.setAttribute( i, val ); 4247 } 4248 } 4249 } 4250 doc.head.appendChild( script ).parentNode.removeChild( script ); 4251 } 4252 4253 4254function toType( obj ) { 4255 if ( obj == null ) { 4256 return obj + ""; 4257 } 4258 4259 // Support: Android <=2.3 only (functionish RegExp) 4260 return typeof obj === "object" || typeof obj === "function" ? 4261 class2type[ toString.call( obj ) ] || "object" : 4262 typeof obj; 4263} 4264/* global Symbol */ 4265// Defining this global in .eslintrc.json would create a danger of using the global 4266// unguarded in another place, it seems safer to define global only for this module 4267 4268 4269 4270var version = "3.7.1", 4271 4272 rhtmlSuffix = /HTML$/i, 4273 4274 // Define a local copy of jQuery 4275 jQuery = function( selector, context ) { 4276 4277 // The jQuery object is actually just the init constructor 'enhanced' 4278 // Need init if jQuery is called (just allow error to be thrown if not included) 4279 return new jQuery.fn.init( selector, context ); 4280 }; 4281 4282jQuery.fn = jQuery.prototype = { 4283 4284 // The current version of jQuery being used 4285 jquery: version, 4286 4287 constructor: jQuery, 4288 4289 // The default length of a jQuery object is 0 4290 length: 0, 4291 4292 toArray: function() { 4293 return slice.call( this ); 4294 }, 4295 4296 // Get the Nth element in the matched element set OR 4297 // Get the whole matched element set as a clean array 4298 get: function( num ) { 4299 4300 // Return all the elements in a clean array 4301 if ( num == null ) { 4302 return slice.call( this ); 4303 } 4304 4305 // Return just the one element from the set 4306 return num < 0 ? this[ num + this.length ] : this[ num ]; 4307 }, 4308 4309 // Take an array of elements and push it onto the stack 4310 // (returning the new matched element set) 4311 pushStack: function( elems ) { 4312 4313 // Build a new jQuery matched element set 4314 var ret = jQuery.merge( this.constructor(), elems ); 4315 4316 // Add the old object onto the stack (as a reference) 4317 ret.prevObject = this; 4318 4319 // Return the newly-formed element set 4320 return ret; 4321 }, 4322 4323 // Execute a callback for every element in the matched set. 4324 each: function( callback ) { 4325 return jQuery.each( this, callback ); 4326 }, 4327 4328 map: function( callback ) { 4329 return this.pushStack( jQuery.map( this, function( elem, i ) { 4330 return callback.call( elem, i, elem ); 4331 } ) ); 4332 }, 4333 4334 slice: function() { 4335 return this.pushStack( slice.apply( this, arguments ) ); 4336 }, 4337 4338 first: function() { 4339 return this.eq( 0 ); 4340 }, 4341 4342 last: function() { 4343 return this.eq( -1 ); 4344 }, 4345 4346 even: function() { 4347 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 4348 return ( i + 1 ) % 2; 4349 } ) ); 4350 }, 4351 4352 odd: function() { 4353 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 4354 return i % 2; 4355 } ) ); 4356 }, 4357 4358 eq: function( i ) { 4359 var len = this.length, 4360 j = +i + ( i < 0 ? len : 0 ); 4361 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 4362 }, 4363 4364 end: function() { 4365 return this.prevObject || this.constructor(); 4366 }, 4367 4368 // For internal use only. 4369 // Behaves like an Array's method, not like a jQuery method. 4370 push: push, 4371 sort: arr.sort, 4372 splice: arr.splice 4373}; 4374 4375jQuery.extend = jQuery.fn.extend = function() { 4376 var options, name, src, copy, copyIsArray, clone, 4377 target = arguments[ 0 ] || {}, 4378 i = 1, 4379 length = arguments.length, 4380 deep = false; 4381 4382 // Handle a deep copy situation 4383 if ( typeof target === "boolean" ) { 4384 deep = target; 4385 4386 // Skip the boolean and the target 4387 target = arguments[ i ] || {}; 4388 i++; 4389 } 4390 4391 // Handle case when target is a string or something (possible in deep copy) 4392 if ( typeof target !== "object" && !isFunction( target ) ) { 4393 target = {}; 4394 } 4395 4396 // Extend jQuery itself if only one argument is passed 4397 if ( i === length ) { 4398 target = this; 4399 i--; 4400 } 4401 4402 for ( ; i < length; i++ ) { 4403 4404 // Only deal with non-null/undefined values 4405 if ( ( options = arguments[ i ] ) != null ) { 4406 4407 // Extend the base object 4408 for ( name in options ) { 4409 copy = options[ name ]; 4410 4411 // Prevent Object.prototype pollution 4412 // Prevent never-ending loop 4413 if ( name === "__proto__" || target === copy ) { 4414 continue; 4415 } 4416 4417 // Recurse if we're merging plain objects or arrays 4418 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 4419 ( copyIsArray = Array.isArray( copy ) ) ) ) { 4420 src = target[ name ]; 4421 4422 // Ensure proper type for the source value 4423 if ( copyIsArray && !Array.isArray( src ) ) { 4424 clone = []; 4425 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 4426 clone = {}; 4427 } else { 4428 clone = src; 4429 } 4430 copyIsArray = false; 4431 4432 // Never move original objects, clone them 4433 target[ name ] = jQuery.extend( deep, clone, copy ); 4434 4435 // Don't bring in undefined values 4436 } else if ( copy !== undefined ) { 4437 target[ name ] = copy; 4438 } 4439 } 4440 } 4441 } 4442 4443 // Return the modified object 4444 return target; 4445}; 4446 4447jQuery.extend( { 4448 4449 // Unique for each copy of jQuery on the page 4450 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 4451 4452 // Assume jQuery is ready without the ready module 4453 isReady: true, 4454 4455 error: function( msg ) { 4456 throw new Error( msg ); 4457 }, 4458 4459 noop: function() {}, 4460 4461 isPlainObject: function( obj ) { 4462 var proto, Ctor; 4463 4464 // Detect obvious negatives 4465 // Use toString instead of jQuery.type to catch host objects 4466 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 4467 return false; 4468 } 4469 4470 proto = getProto( obj ); 4471 4472 // Objects with no prototype (e.g., `Object.create( null )`) are plain 4473 if ( !proto ) { 4474 return true; 4475 } 4476 4477 // Objects with prototype are plain iff they were constructed by a global Object function 4478 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 4479 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 4480 }, 4481 4482 isEmptyObject: function( obj ) { 4483 var name; 4484 4485 for ( name in obj ) { 4486 return false; 4487 } 4488 return true; 4489 }, 4490 4491 // Evaluates a script in a provided context; falls back to the global one 4492 // if not specified. 4493 globalEval: function( code, options, doc ) { 4494 DOMEval( code, { nonce: options && options.nonce }, doc ); 4495 }, 4496 4497 each: function( obj, callback ) { 4498 var length, i = 0; 4499 4500 if ( isArrayLike( obj ) ) { 4501 length = obj.length; 4502 for ( ; i < length; i++ ) { 4503 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 4504 break; 4505 } 4506 } 4507 } else { 4508 for ( i in obj ) { 4509 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 4510 break; 4511 } 4512 } 4513 } 4514 4515 return obj; 4516 }, 4517 4518 4519 // Retrieve the text value of an array of DOM nodes 4520 text: function( elem ) { 4521 var node, 4522 ret = "", 4523 i = 0, 4524 nodeType = elem.nodeType; 4525 4526 if ( !nodeType ) { 4527 4528 // If no nodeType, this is expected to be an array 4529 while ( ( node = elem[ i++ ] ) ) { 4530 4531 // Do not traverse comment nodes 4532 ret += jQuery.text( node ); 4533 } 4534 } 4535 if ( nodeType === 1 || nodeType === 11 ) { 4536 return elem.textContent; 4537 } 4538 if ( nodeType === 9 ) { 4539 return elem.documentElement.textContent; 4540 } 4541 if ( nodeType === 3 || nodeType === 4 ) { 4542 return elem.nodeValue; 4543 } 4544 4545 // Do not include comment or processing instruction nodes 4546 4547 return ret; 4548 }, 4549 4550 // results is for internal usage only 4551 makeArray: function( arr, results ) { 4552 var ret = results || []; 4553 4554 if ( arr != null ) { 4555 if ( isArrayLike( Object( arr ) ) ) { 4556 jQuery.merge( ret, 4557 typeof arr === "string" ? 4558 [ arr ] : arr 4559 ); 4560 } else { 4561 push.call( ret, arr ); 4562 } 4563 } 4564 4565 return ret; 4566 }, 4567 4568 inArray: function( elem, arr, i ) { 4569 return arr == null ? -1 : indexOf.call( arr, elem, i ); 4570 }, 4571 4572 isXMLDoc: function( elem ) { 4573 var namespace = elem && elem.namespaceURI, 4574 docElem = elem && ( elem.ownerDocument || elem ).documentElement; 4575 4576 // Assume HTML when documentElement doesn't yet exist, such as inside 4577 // document fragments. 4578 return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" ); 4579 }, 4580 4581 // Support: Android <=4.0 only, PhantomJS 1 only 4582 // push.apply(_, arraylike) throws on ancient WebKit 4583 merge: function( first, second ) { 4584 var len = +second.length, 4585 j = 0, 4586 i = first.length; 4587 4588 for ( ; j < len; j++ ) { 4589 first[ i++ ] = second[ j ]; 4590 } 4591 4592 first.length = i; 4593 4594 return first; 4595 }, 4596 4597 grep: function( elems, callback, invert ) { 4598 var callbackInverse, 4599 matches = [], 4600 i = 0, 4601 length = elems.length, 4602 callbackExpect = !invert; 4603 4604 // Go through the array, only saving the items 4605 // that pass the validator function 4606 for ( ; i < length; i++ ) { 4607 callbackInverse = !callback( elems[ i ], i ); 4608 if ( callbackInverse !== callbackExpect ) { 4609 matches.push( elems[ i ] ); 4610 } 4611 } 4612 4613 return matches; 4614 }, 4615 4616 // arg is for internal usage only 4617 map: function( elems, callback, arg ) { 4618 var length, value, 4619 i = 0, 4620 ret = []; 4621 4622 // Go through the array, translating each of the items to their new values 4623 if ( isArrayLike( elems ) ) { 4624 length = elems.length; 4625 for ( ; i < length; i++ ) { 4626 value = callback( elems[ i ], i, arg ); 4627 4628 if ( value != null ) {
vendor: 17,514 bytes, lines 4629-5250
4629 ret.push( value ); 4630 } 4631 } 4632 4633 // Go through every key on the object, 4634 } else { 4635 for ( i in elems ) { 4636 value = callback( elems[ i ], i, arg ); 4637 4638 if ( value != null ) { 4639 ret.push( value ); 4640 } 4641 } 4642 } 4643 4644 // Flatten any nested arrays 4645 return flat( ret ); 4646 }, 4647 4648 // A global GUID counter for objects 4649 guid: 1, 4650 4651 // jQuery.support is not used in Core but other projects attach their 4652 // properties to it so it needs to exist. 4653 support: support 4654} ); 4655 4656if ( typeof Symbol === "function" ) { 4657 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 4658} 4659 4660// Populate the class2type map 4661jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 4662 function( _i, name ) { 4663 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 4664 } ); 4665 4666function isArrayLike( obj ) { 4667 4668 // Support: real iOS 8.2 only (not reproducible in simulator) 4669 // `in` check used to prevent JIT error (gh-2145) 4670 // hasOwn isn't used here due to false negatives 4671 // regarding Nodelist length in IE 4672 var length = !!obj && "length" in obj && obj.length, 4673 type = toType( obj ); 4674 4675 if ( isFunction( obj ) || isWindow( obj ) ) { 4676 return false; 4677 } 4678 4679 return type === "array" || length === 0 || 4680 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 4681} 4682 4683 4684function nodeName( elem, name ) { 4685 4686 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 4687 4688} 4689var pop = arr.pop; 4690 4691 4692var sort = arr.sort; 4693 4694 4695var splice = arr.splice; 4696 4697 4698var whitespace = "[\\x20\\t\\r\\n\\f]"; 4699 4700 4701var rtrimCSS = new RegExp( 4702 "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", 4703 "g" 4704); 4705 4706 4707 4708 4709// Note: an element does not contain itself 4710jQuery.contains = function( a, b ) { 4711 var bup = b && b.parentNode; 4712 4713 return a === bup || !!( bup && bup.nodeType === 1 && ( 4714 4715 // Support: IE 9 - 11+ 4716 // IE doesn't have `contains` on SVG. 4717 a.contains ? 4718 a.contains( bup ) : 4719 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 4720 ) ); 4721}; 4722 4723 4724 4725 4726// CSS string/identifier serialization 4727// https://drafts.csswg.org/cssom/#common-serializing-idioms 4728var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 4729 4730function fcssescape( ch, asCodePoint ) { 4731 if ( asCodePoint ) { 4732 4733 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 4734 if ( ch === "\0" ) { 4735 return "\uFFFD"; 4736 } 4737 4738 // Control characters and (dependent upon position) numbers get escaped as code points 4739 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 4740 } 4741 4742 // Other potentially-special ASCII characters get backslash-escaped 4743 return "\\" + ch; 4744} 4745 4746jQuery.escapeSelector = function( sel ) { 4747 return ( sel + "" ).replace( rcssescape, fcssescape ); 4748}; 4749 4750 4751 4752 4753var preferredDoc = document, 4754 pushNative = push; 4755 4756( function() { 4757 4758var i, 4759 Expr, 4760 outermostContext, 4761 sortInput, 4762 hasDuplicate, 4763 push = pushNative, 4764 4765 // Local document vars 4766 document, 4767 documentElement, 4768 documentIsHTML, 4769 rbuggyQSA, 4770 matches, 4771 4772 // Instance-specific data 4773 expando = jQuery.expando, 4774 dirruns = 0, 4775 done = 0, 4776 classCache = createCache(), 4777 tokenCache = createCache(), 4778 compilerCache = createCache(), 4779 nonnativeSelectorCache = createCache(), 4780 sortOrder = function( a, b ) { 4781 if ( a === b ) { 4782 hasDuplicate = true; 4783 } 4784 return 0; 4785 }, 4786 4787 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + 4788 "loop|multiple|open|readonly|required|scoped", 4789 4790 // Regular expressions 4791 4792 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 4793 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 4794 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 4795 4796 // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors 4797 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 4798 4799 // Operator (capture 2) 4800 "*([*^$|!~]?=)" + whitespace + 4801 4802 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 4803 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 4804 whitespace + "*\\]", 4805 4806 pseudos = ":(" + identifier + ")(?:\\((" + 4807 4808 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 4809 // 1. quoted (capture 3; capture 4 or capture 5) 4810 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 4811 4812 // 2. simple (capture 6) 4813 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 4814 4815 // 3. anything else (capture 2) 4816 ".*" + 4817 ")\\)|)", 4818 4819 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 4820 rwhitespace = new RegExp( whitespace + "+", "g" ), 4821 4822 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 4823 rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + 4824 whitespace + "*" ), 4825 rdescend = new RegExp( whitespace + "|>" ), 4826 4827 rpseudo = new RegExp( pseudos ), 4828 ridentifier = new RegExp( "^" + identifier + "$" ), 4829 4830 matchExpr = { 4831 ID: new RegExp( "^#(" + identifier + ")" ), 4832 CLASS: new RegExp( "^\\.(" + identifier + ")" ), 4833 TAG: new RegExp( "^(" + identifier + "|[*])" ), 4834 ATTR: new RegExp( "^" + attributes ), 4835 PSEUDO: new RegExp( "^" + pseudos ), 4836 CHILD: new RegExp( 4837 "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 4838 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 4839 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 4840 bool: new RegExp( "^(?:" + booleans + ")$", "i" ), 4841 4842 // For use in libraries implementing .is() 4843 // We use this for POS matching in `select` 4844 needsContext: new RegExp( "^" + whitespace + 4845 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 4846 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 4847 }, 4848 4849 rinputs = /^(?:input|select|textarea|button)$/i, 4850 rheader = /^h\d$/i, 4851 4852 // Easily-parseable/retrievable ID or TAG or CLASS selectors 4853 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 4854 4855 rsibling = /[+~]/, 4856 4857 // CSS escapes 4858 // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters 4859 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + 4860 "?|\\\\([^\\r\\n\\f])", "g" ), 4861 funescape = function( escape, nonHex ) { 4862 var high = "0x" + escape.slice( 1 ) - 0x10000; 4863 4864 if ( nonHex ) { 4865 4866 // Strip the backslash prefix from a non-hex escape sequence 4867 return nonHex; 4868 } 4869 4870 // Replace a hexadecimal escape sequence with the encoded Unicode code point 4871 // Support: IE <=11+ 4872 // For values outside the Basic Multilingual Plane (BMP), manually construct a 4873 // surrogate pair 4874 return high < 0 ? 4875 String.fromCharCode( high + 0x10000 ) : 4876 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 4877 }, 4878 4879 // Used for iframes; see `setDocument`. 4880 // Support: IE 9 - 11+, Edge 12 - 18+ 4881 // Removing the function wrapper causes a "Permission Denied" 4882 // error in IE/Edge. 4883 unloadHandler = function() { 4884 setDocument(); 4885 }, 4886 4887 inDisabledFieldset = addCombinator( 4888 function( elem ) { 4889 return elem.disabled === true && nodeName( elem, "fieldset" ); 4890 }, 4891 { dir: "parentNode", next: "legend" } 4892 ); 4893 4894// Support: IE <=9 only 4895// Accessing document.activeElement can throw unexpectedly 4896// https://bugs.jquery.com/ticket/13393 4897function safeActiveElement() { 4898 try { 4899 return document.activeElement; 4900 } catch ( err ) { } 4901} 4902 4903// Optimize for push.apply( _, NodeList ) 4904try { 4905 push.apply( 4906 ( arr = slice.call( preferredDoc.childNodes ) ), 4907 preferredDoc.childNodes 4908 ); 4909 4910 // Support: Android <=4.0 4911 // Detect silently failing push.apply 4912 // eslint-disable-next-line no-unused-expressions 4913 arr[ preferredDoc.childNodes.length ].nodeType; 4914} catch ( e ) { 4915 push = { 4916 apply: function( target, els ) { 4917 pushNative.apply( target, slice.call( els ) ); 4918 }, 4919 call: function( target ) { 4920 pushNative.apply( target, slice.call( arguments, 1 ) ); 4921 } 4922 }; 4923} 4924 4925function find( selector, context, results, seed ) { 4926 var m, i, elem, nid, match, groups, newSelector, 4927 newContext = context && context.ownerDocument, 4928 4929 // nodeType defaults to 9, since context defaults to document 4930 nodeType = context ? context.nodeType : 9; 4931 4932 results = results || []; 4933 4934 // Return early from calls with invalid selector or context 4935 if ( typeof selector !== "string" || !selector || 4936 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 4937 4938 return results; 4939 } 4940 4941 // Try to shortcut find operations (as opposed to filters) in HTML documents 4942 if ( !seed ) { 4943 setDocument( context ); 4944 context = context || document; 4945 4946 if ( documentIsHTML ) { 4947 4948 // If the selector is sufficiently simple, try using a "get*By*" DOM method 4949 // (excepting DocumentFragment context, where the methods don't exist) 4950 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 4951 4952 // ID selector 4953 if ( ( m = match[ 1 ] ) ) { 4954 4955 // Document context 4956 if ( nodeType === 9 ) { 4957 if ( ( elem = context.getElementById( m ) ) ) { 4958 4959 // Support: IE 9 only 4960 // getElementById can match elements by name instead of ID 4961 if ( elem.id === m ) { 4962 push.call( results, elem ); 4963 return results; 4964 } 4965 } else { 4966 return results; 4967 } 4968 4969 // Element context 4970 } else { 4971 4972 // Support: IE 9 only 4973 // getElementById can match elements by name instead of ID 4974 if ( newContext && ( elem = newContext.getElementById( m ) ) && 4975 find.contains( context, elem ) && 4976 elem.id === m ) { 4977 4978 push.call( results, elem ); 4979 return results; 4980 } 4981 } 4982 4983 // Type selector 4984 } else if ( match[ 2 ] ) { 4985 push.apply( results, context.getElementsByTagName( selector ) ); 4986 return results; 4987 4988 // Class selector 4989 } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { 4990 push.apply( results, context.getElementsByClassName( m ) ); 4991 return results; 4992 } 4993 } 4994 4995 // Take advantage of querySelectorAll 4996 if ( !nonnativeSelectorCache[ selector + " " ] && 4997 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { 4998 4999 newSelector = selector; 5000 newContext = context; 5001 5002 // qSA considers elements outside a scoping root when evaluating child or 5003 // descendant combinators, which is not what we want. 5004 // In such cases, we work around the behavior by prefixing every selector in the 5005 // list with an ID selector referencing the scope context. 5006 // The technique has to be used as well when a leading combinator is used 5007 // as such selectors are not recognized by querySelectorAll. 5008 // Thanks to Andrew Dupont for this technique. 5009 if ( nodeType === 1 && 5010 ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) { 5011 5012 // Expand context for sibling selectors 5013 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 5014 context; 5015 5016 // We can use :scope instead of the ID hack if the browser 5017 // supports it & if we're not changing the context. 5018 // Support: IE 11+, Edge 17 - 18+ 5019 // IE/Edge sometimes throw a "Permission denied" error when 5020 // strict-comparing two documents; shallow comparisons work. 5021 // eslint-disable-next-line eqeqeq 5022 if ( newContext != context || !support.scope ) { 5023 5024 // Capture the context ID, setting it first if necessary 5025 if ( ( nid = context.getAttribute( "id" ) ) ) { 5026 nid = jQuery.escapeSelector( nid ); 5027 } else { 5028 context.setAttribute( "id", ( nid = expando ) ); 5029 } 5030 } 5031 5032 // Prefix every selector in the list 5033 groups = tokenize( selector ); 5034 i = groups.length; 5035 while ( i-- ) { 5036 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 5037 toSelector( groups[ i ] ); 5038 } 5039 newSelector = groups.join( "," ); 5040 } 5041 5042 try { 5043 push.apply( results, 5044 newContext.querySelectorAll( newSelector ) 5045 ); 5046 return results; 5047 } catch ( qsaError ) { 5048 nonnativeSelectorCache( selector, true ); 5049 } finally { 5050 if ( nid === expando ) { 5051 context.removeAttribute( "id" ); 5052 } 5053 } 5054 } 5055 } 5056 } 5057 5058 // All others 5059 return select( selector.replace( rtrimCSS, "$1" ), context, results, seed ); 5060} 5061 5062/** 5063 * Create key-value caches of limited size 5064 * @returns {function(string, object)} Returns the Object data after storing it on itself with 5065 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 5066 * deleting the oldest entry 5067 */ 5068function createCache() { 5069 var keys = []; 5070 5071 function cache( key, value ) { 5072 5073 // Use (key + " ") to avoid collision with native prototype properties 5074 // (see https://github.com/jquery/sizzle/issues/157) 5075 if ( keys.push( key + " " ) > Expr.cacheLength ) { 5076 5077 // Only keep the most recent entries 5078 delete cache[ keys.shift() ]; 5079 } 5080 return ( cache[ key + " " ] = value ); 5081 } 5082 return cache; 5083} 5084 5085/** 5086 * Mark a function for special use by jQuery selector module 5087 * @param {Function} fn The function to mark 5088 */ 5089function markFunction( fn ) { 5090 fn[ expando ] = true; 5091 return fn; 5092} 5093 5094/** 5095 * Support testing using an element 5096 * @param {Function} fn Passed the created element and returns a boolean result 5097 */ 5098function assert( fn ) { 5099 var el = document.createElement( "fieldset" ); 5100 5101 try { 5102 return !!fn( el ); 5103 } catch ( e ) { 5104 return false; 5105 } finally { 5106 5107 // Remove from its parent by default 5108 if ( el.parentNode ) { 5109 el.parentNode.removeChild( el ); 5110 } 5111 5112 // release memory in IE 5113 el = null; 5114 } 5115} 5116 5117/** 5118 * Returns a function to use in pseudos for input types 5119 * @param {String} type 5120 */ 5121function createInputPseudo( type ) { 5122 return function( elem ) { 5123 return nodeName( elem, "input" ) && elem.type === type; 5124 }; 5125} 5126 5127/** 5128 * Returns a function to use in pseudos for buttons 5129 * @param {String} type 5130 */ 5131function createButtonPseudo( type ) { 5132 return function( elem ) { 5133 return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) && 5134 elem.type === type; 5135 }; 5136} 5137 5138/** 5139 * Returns a function to use in pseudos for :enabled/:disabled 5140 * @param {Boolean} disabled true for :disabled; false for :enabled 5141 */ 5142function createDisabledPseudo( disabled ) { 5143 5144 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 5145 return function( elem ) { 5146 5147 // Only certain elements can match :enabled or :disabled 5148 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 5149 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 5150 if ( "form" in elem ) { 5151 5152 // Check for inherited disabledness on relevant non-disabled elements: 5153 // * listed form-associated elements in a disabled fieldset 5154 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 5155 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 5156 // * option elements in a disabled optgroup 5157 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 5158 // All such elements have a "form" property. 5159 if ( elem.parentNode && elem.disabled === false ) { 5160 5161 // Option elements defer to a parent optgroup if present 5162 if ( "label" in elem ) { 5163 if ( "label" in elem.parentNode ) { 5164 return elem.parentNode.disabled === disabled; 5165 } else { 5166 return elem.disabled === disabled; 5167 } 5168 } 5169 5170 // Support: IE 6 - 11+ 5171 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 5172 return elem.isDisabled === disabled || 5173 5174 // Where there is no isDisabled, check manually 5175 elem.isDisabled !== !disabled && 5176 inDisabledFieldset( elem ) === disabled; 5177 } 5178 5179 return elem.disabled === disabled; 5180 5181 // Try to winnow out elements that can't be disabled before trusting the disabled property. 5182 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 5183 // even exist on them, let alone have a boolean value. 5184 } else if ( "label" in elem ) { 5185 return elem.disabled === disabled; 5186 } 5187 5188 // Remaining elements are neither :enabled nor :disabled 5189 return false; 5190 }; 5191} 5192 5193/** 5194 * Returns a function to use in pseudos for positionals 5195 * @param {Function} fn 5196 */ 5197function createPositionalPseudo( fn ) { 5198 return markFunction( function( argument ) { 5199 argument = +argument; 5200 return markFunction( function( seed, matches ) { 5201 var j, 5202 matchIndexes = fn( [], seed.length, argument ), 5203 i = matchIndexes.length; 5204 5205 // Match elements found at the specified indexes 5206 while ( i-- ) { 5207 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 5208 seed[ j ] = !( matches[ j ] = seed[ j ] ); 5209 } 5210 } 5211 } ); 5212 } ); 5213} 5214 5215/** 5216 * Checks a node for validity as a jQuery selector context 5217 * @param {Element|Object=} context 5218 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 5219 */ 5220function testContext( context ) { 5221 return context && typeof context.getElementsByTagName !== "undefined" && context; 5222} 5223 5224/** 5225 * Sets document-related variables once based on the current document 5226 * @param {Element|Object} [node] An element or document object to use to set the document 5227 * @returns {Object} Returns the current document 5228 */ 5229function setDocument( node ) { 5230 var subWindow, 5231 doc = node ? node.ownerDocument || node : preferredDoc; 5232 5233 // Return early if doc is invalid or already selected 5234 // Support: IE 11+, Edge 17 - 18+ 5235 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5236 // two documents; shallow comparisons work. 5237 // eslint-disable-next-line eqeqeq 5238 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 5239 return document; 5240 } 5241 5242 // Update global variables 5243 document = doc; 5244 documentElement = document.documentElement; 5245 documentIsHTML = !jQuery.isXMLDoc( document ); 5246 5247 // Support: iOS 7 only, IE 9 - 11+ 5248 // Older browsers didn't support unprefixed `matches`. 5249 matches = documentElement.matches || 5250 documentElement.webkitMatchesSelector ||
vendor: 4,667 bytes, lines 5251-5402
5251 documentElement.msMatchesSelector; 5252 5253 // Support: IE 9 - 11+, Edge 12 - 18+ 5254 // Accessing iframe documents after unload throws "permission denied" errors 5255 // (see trac-13936). 5256 // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`, 5257 // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well. 5258 if ( documentElement.msMatchesSelector && 5259 5260 // Support: IE 11+, Edge 17 - 18+ 5261 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5262 // two documents; shallow comparisons work. 5263 // eslint-disable-next-line eqeqeq 5264 preferredDoc != document && 5265 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 5266 5267 // Support: IE 9 - 11+, Edge 12 - 18+ 5268 subWindow.addEventListener( "unload", unloadHandler ); 5269 } 5270 5271 // Support: IE <10 5272 // Check if getElementById returns elements by name 5273 // The broken getElementById methods don't pick up programmatically-set names, 5274 // so use a roundabout getElementsByName test 5275 support.getById = assert( function( el ) { 5276 documentElement.appendChild( el ).id = jQuery.expando; 5277 return !document.getElementsByName || 5278 !document.getElementsByName( jQuery.expando ).length; 5279 } ); 5280 5281 // Support: IE 9 only 5282 // Check to see if it's possible to do matchesSelector 5283 // on a disconnected node. 5284 support.disconnectedMatch = assert( function( el ) { 5285 return matches.call( el, "*" ); 5286 } ); 5287 5288 // Support: IE 9 - 11+, Edge 12 - 18+ 5289 // IE/Edge don't support the :scope pseudo-class. 5290 support.scope = assert( function() { 5291 return document.querySelectorAll( ":scope" ); 5292 } ); 5293 5294 // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only 5295 // Make sure the `:has()` argument is parsed unforgivingly. 5296 // We include `*` in the test to detect buggy implementations that are 5297 // _selectively_ forgiving (specifically when the list includes at least 5298 // one valid selector). 5299 // Note that we treat complete lack of support for `:has()` as if it were 5300 // spec-compliant support, which is fine because use of `:has()` in such 5301 // environments will fail in the qSA path and fall back to jQuery traversal 5302 // anyway. 5303 support.cssHas = assert( function() { 5304 try { 5305 document.querySelector( ":has(*,:jqfake)" ); 5306 return false; 5307 } catch ( e ) { 5308 return true; 5309 } 5310 } ); 5311 5312 // ID filter and find 5313 if ( support.getById ) { 5314 Expr.filter.ID = function( id ) { 5315 var attrId = id.replace( runescape, funescape ); 5316 return function( elem ) { 5317 return elem.getAttribute( "id" ) === attrId; 5318 }; 5319 }; 5320 Expr.find.ID = function( id, context ) { 5321 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 5322 var elem = context.getElementById( id ); 5323 return elem ? [ elem ] : []; 5324 } 5325 }; 5326 } else { 5327 Expr.filter.ID = function( id ) { 5328 var attrId = id.replace( runescape, funescape ); 5329 return function( elem ) { 5330 var node = typeof elem.getAttributeNode !== "undefined" && 5331 elem.getAttributeNode( "id" ); 5332 return node && node.value === attrId; 5333 }; 5334 }; 5335 5336 // Support: IE 6 - 7 only 5337 // getElementById is not reliable as a find shortcut 5338 Expr.find.ID = function( id, context ) { 5339 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 5340 var node, i, elems, 5341 elem = context.getElementById( id ); 5342 5343 if ( elem ) { 5344 5345 // Verify the id attribute 5346 node = elem.getAttributeNode( "id" ); 5347 if ( node && node.value === id ) { 5348 return [ elem ]; 5349 } 5350 5351 // Fall back on getElementsByName 5352 elems = context.getElementsByName( id ); 5353 i = 0; 5354 while ( ( elem = elems[ i++ ] ) ) { 5355 node = elem.getAttributeNode( "id" ); 5356 if ( node && node.value === id ) { 5357 return [ elem ]; 5358 } 5359 } 5360 } 5361 5362 return []; 5363 } 5364 }; 5365 } 5366 5367 // Tag 5368 Expr.find.TAG = function( tag, context ) { 5369 if ( typeof context.getElementsByTagName !== "undefined" ) { 5370 return context.getElementsByTagName( tag ); 5371 5372 // DocumentFragment nodes don't have gEBTN 5373 } else { 5374 return context.querySelectorAll( tag ); 5375 } 5376 }; 5377 5378 // Class 5379 Expr.find.CLASS = function( className, context ) { 5380 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 5381 return context.getElementsByClassName( className ); 5382 } 5383 }; 5384 5385 /* QSA/matchesSelector 5386 ---------------------------------------------------------------------- */ 5387 5388 // QSA and matchesSelector support 5389 5390 rbuggyQSA = []; 5391 5392 // Build QSA regex 5393 // Regex strategy adopted from Diego Perini 5394 assert( function( el ) { 5395 5396 var input; 5397 5398 documentElement.appendChild( el ).innerHTML = 5399 "<a id='" + expando + "' href='' disabled='disabled'></a>" + 5400 "<select id='" + expando + "-\r\\' disabled='disabled'>" + 5401 "<option selected=''></option></select>"; 5402
vendor: 38,614 bytes, lines 5403-6774
5403 // Support: iOS <=7 - 8 only 5404 // Boolean attributes and "value" are not treated correctly in some XML documents 5405 if ( !el.querySelectorAll( "[selected]" ).length ) { 5406 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 5407 } 5408 5409 // Support: iOS <=7 - 8 only 5410 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 5411 rbuggyQSA.push( "~=" ); 5412 } 5413 5414 // Support: iOS 8 only 5415 // https://bugs.webkit.org/show_bug.cgi?id=136851 5416 // In-page `selector#id sibling-combinator selector` fails 5417 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 5418 rbuggyQSA.push( ".#.+[+~]" ); 5419 } 5420 5421 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 5422 // In some of the document kinds, these selectors wouldn't work natively. 5423 // This is probably OK but for backwards compatibility we want to maintain 5424 // handling them through jQuery traversal in jQuery 3.x. 5425 if ( !el.querySelectorAll( ":checked" ).length ) { 5426 rbuggyQSA.push( ":checked" ); 5427 } 5428 5429 // Support: Windows 8 Native Apps 5430 // The type and name attributes are restricted during .innerHTML assignment 5431 input = document.createElement( "input" ); 5432 input.setAttribute( "type", "hidden" ); 5433 el.appendChild( input ).setAttribute( "name", "D" ); 5434 5435 // Support: IE 9 - 11+ 5436 // IE's :disabled selector does not pick up the children of disabled fieldsets 5437 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 5438 // In some of the document kinds, these selectors wouldn't work natively. 5439 // This is probably OK but for backwards compatibility we want to maintain 5440 // handling them through jQuery traversal in jQuery 3.x. 5441 documentElement.appendChild( el ).disabled = true; 5442 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 5443 rbuggyQSA.push( ":enabled", ":disabled" ); 5444 } 5445 5446 // Support: IE 11+, Edge 15 - 18+ 5447 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 5448 // Adding a temporary attribute to the document before the selection works 5449 // around the issue. 5450 // Interestingly, IE 10 & older don't seem to have the issue. 5451 input = document.createElement( "input" ); 5452 input.setAttribute( "name", "" ); 5453 el.appendChild( input ); 5454 if ( !el.querySelectorAll( "[name='']" ).length ) { 5455 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 5456 whitespace + "*(?:''|\"\")" ); 5457 } 5458 } ); 5459 5460 if ( !support.cssHas ) { 5461 5462 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ 5463 // Our regular `try-catch` mechanism fails to detect natively-unsupported 5464 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) 5465 // in browsers that parse the `:has()` argument as a forgiving selector list. 5466 // https://drafts.csswg.org/selectors/#relational now requires the argument 5467 // to be parsed unforgivingly, but browsers have not yet fully adjusted. 5468 rbuggyQSA.push( ":has" ); 5469 } 5470 5471 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 5472 5473 /* Sorting 5474 ---------------------------------------------------------------------- */ 5475 5476 // Document order sorting 5477 sortOrder = function( a, b ) { 5478 5479 // Flag for duplicate removal 5480 if ( a === b ) { 5481 hasDuplicate = true; 5482 return 0; 5483 } 5484 5485 // Sort on method existence if only one input has compareDocumentPosition 5486 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 5487 if ( compare ) { 5488 return compare; 5489 } 5490 5491 // Calculate position if both inputs belong to the same document 5492 // Support: IE 11+, Edge 17 - 18+ 5493 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5494 // two documents; shallow comparisons work. 5495 // eslint-disable-next-line eqeqeq 5496 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 5497 a.compareDocumentPosition( b ) : 5498 5499 // Otherwise we know they are disconnected 5500 1; 5501 5502 // Disconnected nodes 5503 if ( compare & 1 || 5504 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 5505 5506 // Choose the first element that is related to our preferred document 5507 // Support: IE 11+, Edge 17 - 18+ 5508 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5509 // two documents; shallow comparisons work. 5510 // eslint-disable-next-line eqeqeq 5511 if ( a === document || a.ownerDocument == preferredDoc && 5512 find.contains( preferredDoc, a ) ) { 5513 return -1; 5514 } 5515 5516 // Support: IE 11+, Edge 17 - 18+ 5517 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5518 // two documents; shallow comparisons work. 5519 // eslint-disable-next-line eqeqeq 5520 if ( b === document || b.ownerDocument == preferredDoc && 5521 find.contains( preferredDoc, b ) ) { 5522 return 1; 5523 } 5524 5525 // Maintain original order 5526 return sortInput ? 5527 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 5528 0; 5529 } 5530 5531 return compare & 4 ? -1 : 1; 5532 }; 5533 5534 return document; 5535} 5536 5537find.matches = function( expr, elements ) { 5538 return find( expr, null, null, elements ); 5539}; 5540 5541find.matchesSelector = function( elem, expr ) { 5542 setDocument( elem ); 5543 5544 if ( documentIsHTML && 5545 !nonnativeSelectorCache[ expr + " " ] && 5546 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 5547 5548 try { 5549 var ret = matches.call( elem, expr ); 5550 5551 // IE 9's matchesSelector returns false on disconnected nodes 5552 if ( ret || support.disconnectedMatch || 5553 5554 // As well, disconnected nodes are said to be in a document 5555 // fragment in IE 9 5556 elem.document && elem.document.nodeType !== 11 ) { 5557 return ret; 5558 } 5559 } catch ( e ) { 5560 nonnativeSelectorCache( expr, true ); 5561 } 5562 } 5563 5564 return find( expr, document, null, [ elem ] ).length > 0; 5565}; 5566 5567find.contains = function( context, elem ) { 5568 5569 // Set document vars if needed 5570 // Support: IE 11+, Edge 17 - 18+ 5571 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5572 // two documents; shallow comparisons work. 5573 // eslint-disable-next-line eqeqeq 5574 if ( ( context.ownerDocument || context ) != document ) { 5575 setDocument( context ); 5576 } 5577 return jQuery.contains( context, elem ); 5578}; 5579 5580 5581find.attr = function( elem, name ) { 5582 5583 // Set document vars if needed 5584 // Support: IE 11+, Edge 17 - 18+ 5585 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5586 // two documents; shallow comparisons work. 5587 // eslint-disable-next-line eqeqeq 5588 if ( ( elem.ownerDocument || elem ) != document ) { 5589 setDocument( elem ); 5590 } 5591 5592 var fn = Expr.attrHandle[ name.toLowerCase() ], 5593 5594 // Don't get fooled by Object.prototype properties (see trac-13807) 5595 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 5596 fn( elem, name, !documentIsHTML ) : 5597 undefined; 5598 5599 if ( val !== undefined ) { 5600 return val; 5601 } 5602 5603 return elem.getAttribute( name ); 5604}; 5605 5606find.error = function( msg ) { 5607 throw new Error( "Syntax error, unrecognized expression: " + msg ); 5608}; 5609 5610/** 5611 * Document sorting and removing duplicates 5612 * @param {ArrayLike} results 5613 */ 5614jQuery.uniqueSort = function( results ) { 5615 var elem, 5616 duplicates = [], 5617 j = 0, 5618 i = 0; 5619 5620 // Unless we *know* we can detect duplicates, assume their presence 5621 // 5622 // Support: Android <=4.0+ 5623 // Testing for detecting duplicates is unpredictable so instead assume we can't 5624 // depend on duplicate detection in all browsers without a stable sort. 5625 hasDuplicate = !support.sortStable; 5626 sortInput = !support.sortStable && slice.call( results, 0 ); 5627 sort.call( results, sortOrder ); 5628 5629 if ( hasDuplicate ) { 5630 while ( ( elem = results[ i++ ] ) ) { 5631 if ( elem === results[ i ] ) { 5632 j = duplicates.push( i ); 5633 } 5634 } 5635 while ( j-- ) { 5636 splice.call( results, duplicates[ j ], 1 ); 5637 } 5638 } 5639 5640 // Clear input after sorting to release objects 5641 // See https://github.com/jquery/sizzle/pull/225 5642 sortInput = null; 5643 5644 return results; 5645}; 5646 5647jQuery.fn.uniqueSort = function() { 5648 return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) ); 5649}; 5650 5651Expr = jQuery.expr = { 5652 5653 // Can be adjusted by the user 5654 cacheLength: 50, 5655 5656 createPseudo: markFunction, 5657 5658 match: matchExpr, 5659 5660 attrHandle: {}, 5661 5662 find: {}, 5663 5664 relative: { 5665 ">": { dir: "parentNode", first: true }, 5666 " ": { dir: "parentNode" }, 5667 "+": { dir: "previousSibling", first: true }, 5668 "~": { dir: "previousSibling" } 5669 }, 5670 5671 preFilter: { 5672 ATTR: function( match ) { 5673 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 5674 5675 // Move the given value to match[3] whether quoted or unquoted 5676 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ) 5677 .replace( runescape, funescape ); 5678 5679 if ( match[ 2 ] === "~=" ) { 5680 match[ 3 ] = " " + match[ 3 ] + " "; 5681 } 5682 5683 return match.slice( 0, 4 ); 5684 }, 5685 5686 CHILD: function( match ) { 5687 5688 /* matches from matchExpr["CHILD"] 5689 1 type (only|nth|...) 5690 2 what (child|of-type) 5691 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 5692 4 xn-component of xn+y argument ([+-]?\d*n|) 5693 5 sign of xn-component 5694 6 x of xn-component 5695 7 sign of y-component 5696 8 y of y-component 5697 */ 5698 match[ 1 ] = match[ 1 ].toLowerCase(); 5699 5700 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 5701 5702 // nth-* requires argument 5703 if ( !match[ 3 ] ) { 5704 find.error( match[ 0 ] ); 5705 } 5706 5707 // numeric x and y parameters for Expr.filter.CHILD 5708 // remember that false/true cast respectively to 0/1 5709 match[ 4 ] = +( match[ 4 ] ? 5710 match[ 5 ] + ( match[ 6 ] || 1 ) : 5711 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) 5712 ); 5713 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 5714 5715 // other types prohibit arguments 5716 } else if ( match[ 3 ] ) { 5717 find.error( match[ 0 ] ); 5718 } 5719 5720 return match; 5721 }, 5722 5723 PSEUDO: function( match ) { 5724 var excess, 5725 unquoted = !match[ 6 ] && match[ 2 ]; 5726 5727 if ( matchExpr.CHILD.test( match[ 0 ] ) ) { 5728 return null; 5729 } 5730 5731 // Accept quoted arguments as-is 5732 if ( match[ 3 ] ) { 5733 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 5734 5735 // Strip excess characters from unquoted arguments 5736 } else if ( unquoted && rpseudo.test( unquoted ) && 5737 5738 // Get excess from tokenize (recursively) 5739 ( excess = tokenize( unquoted, true ) ) && 5740 5741 // advance to the next closing parenthesis 5742 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 5743 5744 // excess is a negative index 5745 match[ 0 ] = match[ 0 ].slice( 0, excess ); 5746 match[ 2 ] = unquoted.slice( 0, excess ); 5747 } 5748 5749 // Return only captures needed by the pseudo filter method (type and argument) 5750 return match.slice( 0, 3 ); 5751 } 5752 }, 5753 5754 filter: { 5755 5756 TAG: function( nodeNameSelector ) { 5757 var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 5758 return nodeNameSelector === "*" ? 5759 function() { 5760 return true; 5761 } : 5762 function( elem ) { 5763 return nodeName( elem, expectedNodeName ); 5764 }; 5765 }, 5766 5767 CLASS: function( className ) { 5768 var pattern = classCache[ className + " " ]; 5769 5770 return pattern || 5771 ( pattern = new RegExp( "(^|" + whitespace + ")" + className + 5772 "(" + whitespace + "|$)" ) ) && 5773 classCache( className, function( elem ) { 5774 return pattern.test( 5775 typeof elem.className === "string" && elem.className || 5776 typeof elem.getAttribute !== "undefined" && 5777 elem.getAttribute( "class" ) || 5778 "" 5779 ); 5780 } ); 5781 }, 5782 5783 ATTR: function( name, operator, check ) { 5784 return function( elem ) { 5785 var result = find.attr( elem, name ); 5786 5787 if ( result == null ) { 5788 return operator === "!="; 5789 } 5790 if ( !operator ) { 5791 return true; 5792 } 5793 5794 result += ""; 5795 5796 if ( operator === "=" ) { 5797 return result === check; 5798 } 5799 if ( operator === "!=" ) { 5800 return result !== check; 5801 } 5802 if ( operator === "^=" ) { 5803 return check && result.indexOf( check ) === 0; 5804 } 5805 if ( operator === "*=" ) { 5806 return check && result.indexOf( check ) > -1; 5807 } 5808 if ( operator === "$=" ) { 5809 return check && result.slice( -check.length ) === check; 5810 } 5811 if ( operator === "~=" ) { 5812 return ( " " + result.replace( rwhitespace, " " ) + " " ) 5813 .indexOf( check ) > -1; 5814 } 5815 if ( operator === "|=" ) { 5816 return result === check || result.slice( 0, check.length + 1 ) === check + "-"; 5817 } 5818 5819 return false; 5820 }; 5821 }, 5822 5823 CHILD: function( type, what, _argument, first, last ) { 5824 var simple = type.slice( 0, 3 ) !== "nth", 5825 forward = type.slice( -4 ) !== "last", 5826 ofType = what === "of-type"; 5827 5828 return first === 1 && last === 0 ? 5829 5830 // Shortcut for :nth-*(n) 5831 function( elem ) { 5832 return !!elem.parentNode; 5833 } : 5834 5835 function( elem, _context, xml ) { 5836 var cache, outerCache, node, nodeIndex, start, 5837 dir = simple !== forward ? "nextSibling" : "previousSibling", 5838 parent = elem.parentNode, 5839 name = ofType && elem.nodeName.toLowerCase(), 5840 useCache = !xml && !ofType, 5841 diff = false; 5842 5843 if ( parent ) { 5844 5845 // :(first|last|only)-(child|of-type) 5846 if ( simple ) { 5847 while ( dir ) { 5848 node = elem; 5849 while ( ( node = node[ dir ] ) ) { 5850 if ( ofType ? 5851 nodeName( node, name ) : 5852 node.nodeType === 1 ) { 5853 5854 return false; 5855 } 5856 } 5857 5858 // Reverse direction for :only-* (if we haven't yet done so) 5859 start = dir = type === "only" && !start && "nextSibling"; 5860 } 5861 return true; 5862 } 5863 5864 start = [ forward ? parent.firstChild : parent.lastChild ]; 5865 5866 // non-xml :nth-child(...) stores cache data on `parent` 5867 if ( forward && useCache ) { 5868 5869 // Seek `elem` from a previously-cached index 5870 outerCache = parent[ expando ] || ( parent[ expando ] = {} ); 5871 cache = outerCache[ type ] || []; 5872 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 5873 diff = nodeIndex && cache[ 2 ]; 5874 node = nodeIndex && parent.childNodes[ nodeIndex ]; 5875 5876 while ( ( node = ++nodeIndex && node && node[ dir ] || 5877 5878 // Fallback to seeking `elem` from the start 5879 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 5880 5881 // When found, cache indexes on `parent` and break 5882 if ( node.nodeType === 1 && ++diff && node === elem ) { 5883 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; 5884 break; 5885 } 5886 } 5887 5888 } else { 5889 5890 // Use previously-cached element index if available 5891 if ( useCache ) { 5892 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 5893 cache = outerCache[ type ] || []; 5894 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 5895 diff = nodeIndex; 5896 } 5897 5898 // xml :nth-child(...) 5899 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 5900 if ( diff === false ) { 5901 5902 // Use the same loop as above to seek `elem` from the start 5903 while ( ( node = ++nodeIndex && node && node[ dir ] || 5904 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 5905 5906 if ( ( ofType ? 5907 nodeName( node, name ) : 5908 node.nodeType === 1 ) && 5909 ++diff ) { 5910 5911 // Cache the index of each encountered element 5912 if ( useCache ) { 5913 outerCache = node[ expando ] || 5914 ( node[ expando ] = {} ); 5915 outerCache[ type ] = [ dirruns, diff ]; 5916 } 5917 5918 if ( node === elem ) { 5919 break; 5920 } 5921 } 5922 } 5923 } 5924 } 5925 5926 // Incorporate the offset, then check against cycle size 5927 diff -= last; 5928 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 5929 } 5930 }; 5931 }, 5932 5933 PSEUDO: function( pseudo, argument ) { 5934 5935 // pseudo-class names are case-insensitive 5936 // https://www.w3.org/TR/selectors/#pseudo-classes 5937 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 5938 // Remember that setFilters inherits from pseudos 5939 var args, 5940 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 5941 find.error( "unsupported pseudo: " + pseudo ); 5942 5943 // The user may use createPseudo to indicate that 5944 // arguments are needed to create the filter function 5945 // just as jQuery does 5946 if ( fn[ expando ] ) { 5947 return fn( argument ); 5948 } 5949 5950 // But maintain support for old signatures 5951 if ( fn.length > 1 ) { 5952 args = [ pseudo, pseudo, "", argument ]; 5953 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 5954 markFunction( function( seed, matches ) { 5955 var idx, 5956 matched = fn( seed, argument ), 5957 i = matched.length; 5958 while ( i-- ) { 5959 idx = indexOf.call( seed, matched[ i ] ); 5960 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 5961 } 5962 } ) : 5963 function( elem ) { 5964 return fn( elem, 0, args ); 5965 }; 5966 } 5967 5968 return fn; 5969 } 5970 }, 5971 5972 pseudos: { 5973 5974 // Potentially complex pseudos 5975 not: markFunction( function( selector ) { 5976 5977 // Trim the selector passed to compile 5978 // to avoid treating leading and trailing 5979 // spaces as combinators 5980 var input = [], 5981 results = [], 5982 matcher = compile( selector.replace( rtrimCSS, "$1" ) ); 5983 5984 return matcher[ expando ] ? 5985 markFunction( function( seed, matches, _context, xml ) { 5986 var elem, 5987 unmatched = matcher( seed, null, xml, [] ), 5988 i = seed.length; 5989 5990 // Match elements unmatched by `matcher` 5991 while ( i-- ) { 5992 if ( ( elem = unmatched[ i ] ) ) { 5993 seed[ i ] = !( matches[ i ] = elem ); 5994 } 5995 } 5996 } ) : 5997 function( elem, _context, xml ) { 5998 input[ 0 ] = elem; 5999 matcher( input, null, xml, results ); 6000 6001 // Don't keep the element 6002 // (see https://github.com/jquery/sizzle/issues/299) 6003 input[ 0 ] = null; 6004 return !results.pop(); 6005 }; 6006 } ), 6007 6008 has: markFunction( function( selector ) { 6009 return function( elem ) { 6010 return find( selector, elem ).length > 0; 6011 }; 6012 } ), 6013 6014 contains: markFunction( function( text ) { 6015 text = text.replace( runescape, funescape ); 6016 return function( elem ) { 6017 return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1; 6018 }; 6019 } ), 6020 6021 // "Whether an element is represented by a :lang() selector 6022 // is based solely on the element's language value 6023 // being equal to the identifier C, 6024 // or beginning with the identifier C immediately followed by "-". 6025 // The matching of C against the element's language value is performed case-insensitively. 6026 // The identifier C does not have to be a valid language name." 6027 // https://www.w3.org/TR/selectors/#lang-pseudo 6028 lang: markFunction( function( lang ) { 6029 6030 // lang value must be a valid identifier 6031 if ( !ridentifier.test( lang || "" ) ) { 6032 find.error( "unsupported lang: " + lang ); 6033 } 6034 lang = lang.replace( runescape, funescape ).toLowerCase(); 6035 return function( elem ) { 6036 var elemLang; 6037 do { 6038 if ( ( elemLang = documentIsHTML ? 6039 elem.lang : 6040 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 6041 6042 elemLang = elemLang.toLowerCase(); 6043 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 6044 } 6045 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 6046 return false; 6047 }; 6048 } ), 6049 6050 // Miscellaneous 6051 target: function( elem ) { 6052 var hash = window.location && window.location.hash; 6053 return hash && hash.slice( 1 ) === elem.id; 6054 }, 6055 6056 root: function( elem ) { 6057 return elem === documentElement; 6058 }, 6059 6060 focus: function( elem ) { 6061 return elem === safeActiveElement() && 6062 document.hasFocus() && 6063 !!( elem.type || elem.href || ~elem.tabIndex ); 6064 }, 6065 6066 // Boolean properties 6067 enabled: createDisabledPseudo( false ), 6068 disabled: createDisabledPseudo( true ), 6069 6070 checked: function( elem ) { 6071 6072 // In CSS3, :checked should return both checked and selected elements 6073 // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 6074 return ( nodeName( elem, "input" ) && !!elem.checked ) || 6075 ( nodeName( elem, "option" ) && !!elem.selected ); 6076 }, 6077 6078 selected: function( elem ) { 6079 6080 // Support: IE <=11+ 6081 // Accessing the selectedIndex property 6082 // forces the browser to treat the default option as 6083 // selected when in an optgroup. 6084 if ( elem.parentNode ) { 6085 // eslint-disable-next-line no-unused-expressions 6086 elem.parentNode.selectedIndex; 6087 } 6088 6089 return elem.selected === true; 6090 }, 6091 6092 // Contents 6093 empty: function( elem ) { 6094 6095 // https://www.w3.org/TR/selectors/#empty-pseudo 6096 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 6097 // but not by others (comment: 8; processing instruction: 7; etc.) 6098 // nodeType < 6 works because attributes (2) do not appear as children 6099 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 6100 if ( elem.nodeType < 6 ) { 6101 return false; 6102 } 6103 } 6104 return true; 6105 }, 6106 6107 parent: function( elem ) { 6108 return !Expr.pseudos.empty( elem ); 6109 }, 6110 6111 // Element/input types 6112 header: function( elem ) { 6113 return rheader.test( elem.nodeName ); 6114 }, 6115 6116 input: function( elem ) { 6117 return rinputs.test( elem.nodeName ); 6118 }, 6119 6120 button: function( elem ) { 6121 return nodeName( elem, "input" ) && elem.type === "button" || 6122 nodeName( elem, "button" ); 6123 }, 6124 6125 text: function( elem ) { 6126 var attr; 6127 return nodeName( elem, "input" ) && elem.type === "text" && 6128 6129 // Support: IE <10 only 6130 // New HTML5 attribute values (e.g., "search") appear 6131 // with elem.type === "text" 6132 ( ( attr = elem.getAttribute( "type" ) ) == null || 6133 attr.toLowerCase() === "text" ); 6134 }, 6135 6136 // Position-in-collection 6137 first: createPositionalPseudo( function() { 6138 return [ 0 ]; 6139 } ), 6140 6141 last: createPositionalPseudo( function( _matchIndexes, length ) { 6142 return [ length - 1 ]; 6143 } ), 6144 6145 eq: createPositionalPseudo( function( _matchIndexes, length, argument ) { 6146 return [ argument < 0 ? argument + length : argument ]; 6147 } ), 6148 6149 even: createPositionalPseudo( function( matchIndexes, length ) { 6150 var i = 0; 6151 for ( ; i < length; i += 2 ) { 6152 matchIndexes.push( i ); 6153 } 6154 return matchIndexes; 6155 } ), 6156 6157 odd: createPositionalPseudo( function( matchIndexes, length ) { 6158 var i = 1; 6159 for ( ; i < length; i += 2 ) { 6160 matchIndexes.push( i ); 6161 } 6162 return matchIndexes; 6163 } ), 6164 6165 lt: createPositionalPseudo( function( matchIndexes, length, argument ) { 6166 var i; 6167 6168 if ( argument < 0 ) { 6169 i = argument + length; 6170 } else if ( argument > length ) { 6171 i = length; 6172 } else { 6173 i = argument; 6174 } 6175 6176 for ( ; --i >= 0; ) { 6177 matchIndexes.push( i ); 6178 } 6179 return matchIndexes; 6180 } ), 6181 6182 gt: createPositionalPseudo( function( matchIndexes, length, argument ) { 6183 var i = argument < 0 ? argument + length : argument; 6184 for ( ; ++i < length; ) { 6185 matchIndexes.push( i ); 6186 } 6187 return matchIndexes; 6188 } ) 6189 } 6190}; 6191 6192Expr.pseudos.nth = Expr.pseudos.eq; 6193 6194// Add button/input type pseudos 6195for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 6196 Expr.pseudos[ i ] = createInputPseudo( i ); 6197} 6198for ( i in { submit: true, reset: true } ) { 6199 Expr.pseudos[ i ] = createButtonPseudo( i ); 6200} 6201 6202// Easy API for creating new setFilters 6203function setFilters() {} 6204setFilters.prototype = Expr.filters = Expr.pseudos; 6205Expr.setFilters = new setFilters(); 6206 6207function tokenize( selector, parseOnly ) { 6208 var matched, match, tokens, type, 6209 soFar, groups, preFilters, 6210 cached = tokenCache[ selector + " " ]; 6211 6212 if ( cached ) { 6213 return parseOnly ? 0 : cached.slice( 0 ); 6214 } 6215 6216 soFar = selector; 6217 groups = []; 6218 preFilters = Expr.preFilter; 6219 6220 while ( soFar ) { 6221 6222 // Comma and first run 6223 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 6224 if ( match ) { 6225 6226 // Don't consume trailing commas as valid 6227 soFar = soFar.slice( match[ 0 ].length ) || soFar; 6228 } 6229 groups.push( ( tokens = [] ) ); 6230 } 6231 6232 matched = false; 6233 6234 // Combinators 6235 if ( ( match = rleadingCombinator.exec( soFar ) ) ) { 6236 matched = match.shift(); 6237 tokens.push( { 6238 value: matched, 6239 6240 // Cast descendant combinators to space 6241 type: match[ 0 ].replace( rtrimCSS, " " ) 6242 } ); 6243 soFar = soFar.slice( matched.length ); 6244 } 6245 6246 // Filters 6247 for ( type in Expr.filter ) { 6248 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 6249 ( match = preFilters[ type ]( match ) ) ) ) { 6250 matched = match.shift(); 6251 tokens.push( { 6252 value: matched, 6253 type: type, 6254 matches: match 6255 } ); 6256 soFar = soFar.slice( matched.length ); 6257 } 6258 } 6259 6260 if ( !matched ) { 6261 break; 6262 } 6263 } 6264 6265 // Return the length of the invalid excess 6266 // if we're just parsing 6267 // Otherwise, throw an error or return tokens 6268 if ( parseOnly ) { 6269 return soFar.length; 6270 } 6271 6272 return soFar ? 6273 find.error( selector ) : 6274 6275 // Cache the tokens 6276 tokenCache( selector, groups ).slice( 0 ); 6277} 6278 6279function toSelector( tokens ) { 6280 var i = 0, 6281 len = tokens.length, 6282 selector = ""; 6283 for ( ; i < len; i++ ) { 6284 selector += tokens[ i ].value; 6285 } 6286 return selector; 6287} 6288 6289function addCombinator( matcher, combinator, base ) { 6290 var dir = combinator.dir, 6291 skip = combinator.next, 6292 key = skip || dir, 6293 checkNonElements = base && key === "parentNode", 6294 doneName = done++; 6295 6296 return combinator.first ? 6297 6298 // Check against closest ancestor/preceding element 6299 function( elem, context, xml ) { 6300 while ( ( elem = elem[ dir ] ) ) { 6301 if ( elem.nodeType === 1 || checkNonElements ) { 6302 return matcher( elem, context, xml ); 6303 } 6304 } 6305 return false; 6306 } : 6307 6308 // Check against all ancestor/preceding elements 6309 function( elem, context, xml ) { 6310 var oldCache, outerCache, 6311 newCache = [ dirruns, doneName ]; 6312 6313 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 6314 if ( xml ) { 6315 while ( ( elem = elem[ dir ] ) ) { 6316 if ( elem.nodeType === 1 || checkNonElements ) { 6317 if ( matcher( elem, context, xml ) ) { 6318 return true; 6319 } 6320 } 6321 } 6322 } else { 6323 while ( ( elem = elem[ dir ] ) ) { 6324 if ( elem.nodeType === 1 || checkNonElements ) { 6325 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 6326 6327 if ( skip && nodeName( elem, skip ) ) { 6328 elem = elem[ dir ] || elem; 6329 } else if ( ( oldCache = outerCache[ key ] ) && 6330 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 6331 6332 // Assign to newCache so results back-propagate to previous elements 6333 return ( newCache[ 2 ] = oldCache[ 2 ] ); 6334 } else { 6335 6336 // Reuse newcache so results back-propagate to previous elements 6337 outerCache[ key ] = newCache; 6338 6339 // A match means we're done; a fail means we have to keep checking 6340 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 6341 return true; 6342 } 6343 } 6344 } 6345 } 6346 } 6347 return false; 6348 }; 6349} 6350 6351function elementMatcher( matchers ) { 6352 return matchers.length > 1 ? 6353 function( elem, context, xml ) { 6354 var i = matchers.length; 6355 while ( i-- ) { 6356 if ( !matchers[ i ]( elem, context, xml ) ) { 6357 return false; 6358 } 6359 } 6360 return true; 6361 } : 6362 matchers[ 0 ]; 6363} 6364 6365function multipleContexts( selector, contexts, results ) { 6366 var i = 0, 6367 len = contexts.length; 6368 for ( ; i < len; i++ ) { 6369 find( selector, contexts[ i ], results ); 6370 } 6371 return results; 6372} 6373 6374function condense( unmatched, map, filter, context, xml ) { 6375 var elem, 6376 newUnmatched = [], 6377 i = 0, 6378 len = unmatched.length, 6379 mapped = map != null; 6380 6381 for ( ; i < len; i++ ) { 6382 if ( ( elem = unmatched[ i ] ) ) { 6383 if ( !filter || filter( elem, context, xml ) ) { 6384 newUnmatched.push( elem ); 6385 if ( mapped ) { 6386 map.push( i ); 6387 } 6388 } 6389 } 6390 } 6391 6392 return newUnmatched; 6393} 6394 6395function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 6396 if ( postFilter && !postFilter[ expando ] ) { 6397 postFilter = setMatcher( postFilter ); 6398 } 6399 if ( postFinder && !postFinder[ expando ] ) { 6400 postFinder = setMatcher( postFinder, postSelector ); 6401 } 6402 return markFunction( function( seed, results, context, xml ) { 6403 var temp, i, elem, matcherOut, 6404 preMap = [], 6405 postMap = [], 6406 preexisting = results.length, 6407 6408 // Get initial elements from seed or context 6409 elems = seed || 6410 multipleContexts( selector || "*", 6411 context.nodeType ? [ context ] : context, [] ), 6412 6413 // Prefilter to get matcher input, preserving a map for seed-results synchronization 6414 matcherIn = preFilter && ( seed || !selector ) ? 6415 condense( elems, preMap, preFilter, context, xml ) : 6416 elems; 6417 6418 if ( matcher ) { 6419 6420 // If we have a postFinder, or filtered seed, or non-seed postFilter 6421 // or preexisting results, 6422 matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 6423 6424 // ...intermediate processing is necessary 6425 [] : 6426 6427 // ...otherwise use results directly 6428 results; 6429 6430 // Find primary matches 6431 matcher( matcherIn, matcherOut, context, xml ); 6432 } else { 6433 matcherOut = matcherIn; 6434 } 6435 6436 // Apply postFilter 6437 if ( postFilter ) { 6438 temp = condense( matcherOut, postMap ); 6439 postFilter( temp, [], context, xml ); 6440 6441 // Un-match failing elements by moving them back to matcherIn 6442 i = temp.length; 6443 while ( i-- ) { 6444 if ( ( elem = temp[ i ] ) ) { 6445 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 6446 } 6447 } 6448 } 6449 6450 if ( seed ) { 6451 if ( postFinder || preFilter ) { 6452 if ( postFinder ) { 6453 6454 // Get the final matcherOut by condensing this intermediate into postFinder contexts 6455 temp = []; 6456 i = matcherOut.length; 6457 while ( i-- ) { 6458 if ( ( elem = matcherOut[ i ] ) ) { 6459 6460 // Restore matcherIn since elem is not yet a final match 6461 temp.push( ( matcherIn[ i ] = elem ) ); 6462 } 6463 } 6464 postFinder( null, ( matcherOut = [] ), temp, xml ); 6465 } 6466 6467 // Move matched elements from seed to results to keep them synchronized 6468 i = matcherOut.length; 6469 while ( i-- ) { 6470 if ( ( elem = matcherOut[ i ] ) && 6471 ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) { 6472 6473 seed[ temp ] = !( results[ temp ] = elem ); 6474 } 6475 } 6476 } 6477 6478 // Add elements to results, through postFinder if defined 6479 } else { 6480 matcherOut = condense( 6481 matcherOut === results ? 6482 matcherOut.splice( preexisting, matcherOut.length ) : 6483 matcherOut 6484 ); 6485 if ( postFinder ) { 6486 postFinder( null, results, matcherOut, xml ); 6487 } else { 6488 push.apply( results, matcherOut ); 6489 } 6490 } 6491 } ); 6492} 6493 6494function matcherFromTokens( tokens ) { 6495 var checkContext, matcher, j, 6496 len = tokens.length, 6497 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 6498 implicitRelative = leadingRelative || Expr.relative[ " " ], 6499 i = leadingRelative ? 1 : 0, 6500 6501 // The foundational matcher ensures that elements are reachable from top-level context(s) 6502 matchContext = addCombinator( function( elem ) { 6503 return elem === checkContext; 6504 }, implicitRelative, true ), 6505 matchAnyContext = addCombinator( function( elem ) { 6506 return indexOf.call( checkContext, elem ) > -1; 6507 }, implicitRelative, true ), 6508 matchers = [ function( elem, context, xml ) { 6509 6510 // Support: IE 11+, Edge 17 - 18+ 6511 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6512 // two documents; shallow comparisons work. 6513 // eslint-disable-next-line eqeqeq 6514 var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || ( 6515 ( checkContext = context ).nodeType ? 6516 matchContext( elem, context, xml ) : 6517 matchAnyContext( elem, context, xml ) ); 6518 6519 // Avoid hanging onto element 6520 // (see https://github.com/jquery/sizzle/issues/299) 6521 checkContext = null; 6522 return ret; 6523 } ]; 6524 6525 for ( ; i < len; i++ ) { 6526 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 6527 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 6528 } else { 6529 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 6530 6531 // Return special upon seeing a positional matcher 6532 if ( matcher[ expando ] ) { 6533 6534 // Find the next relative operator (if any) for proper handling 6535 j = ++i; 6536 for ( ; j < len; j++ ) { 6537 if ( Expr.relative[ tokens[ j ].type ] ) { 6538 break; 6539 } 6540 } 6541 return setMatcher( 6542 i > 1 && elementMatcher( matchers ), 6543 i > 1 && toSelector( 6544 6545 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 6546 tokens.slice( 0, i - 1 ) 6547 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 6548 ).replace( rtrimCSS, "$1" ), 6549 matcher, 6550 i < j && matcherFromTokens( tokens.slice( i, j ) ), 6551 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 6552 j < len && toSelector( tokens ) 6553 ); 6554 } 6555 matchers.push( matcher ); 6556 } 6557 } 6558 6559 return elementMatcher( matchers ); 6560} 6561 6562function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 6563 var bySet = setMatchers.length > 0, 6564 byElement = elementMatchers.length > 0, 6565 superMatcher = function( seed, context, xml, results, outermost ) { 6566 var elem, j, matcher, 6567 matchedCount = 0, 6568 i = "0", 6569 unmatched = seed && [], 6570 setMatched = [], 6571 contextBackup = outermostContext, 6572 6573 // We must always have either seed elements or outermost context 6574 elems = seed || byElement && Expr.find.TAG( "*", outermost ), 6575 6576 // Use integer dirruns iff this is the outermost matcher 6577 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 6578 len = elems.length; 6579 6580 if ( outermost ) { 6581 6582 // Support: IE 11+, Edge 17 - 18+ 6583 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6584 // two documents; shallow comparisons work. 6585 // eslint-disable-next-line eqeqeq 6586 outermostContext = context == document || context || outermost; 6587 } 6588 6589 // Add elements passing elementMatchers directly to results 6590 // Support: iOS <=7 - 9 only 6591 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching 6592 // elements by id. (see trac-14142) 6593 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 6594 if ( byElement && elem ) { 6595 j = 0; 6596 6597 // Support: IE 11+, Edge 17 - 18+ 6598 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6599 // two documents; shallow comparisons work. 6600 // eslint-disable-next-line eqeqeq 6601 if ( !context && elem.ownerDocument != document ) { 6602 setDocument( elem ); 6603 xml = !documentIsHTML; 6604 } 6605 while ( ( matcher = elementMatchers[ j++ ] ) ) { 6606 if ( matcher( elem, context || document, xml ) ) { 6607 push.call( results, elem ); 6608 break; 6609 } 6610 } 6611 if ( outermost ) { 6612 dirruns = dirrunsUnique; 6613 } 6614 } 6615 6616 // Track unmatched elements for set filters 6617 if ( bySet ) { 6618 6619 // They will have gone through all possible matchers 6620 if ( ( elem = !matcher && elem ) ) { 6621 matchedCount--; 6622 } 6623 6624 // Lengthen the array for every element, matched or not 6625 if ( seed ) { 6626 unmatched.push( elem ); 6627 } 6628 } 6629 } 6630 6631 // `i` is now the count of elements visited above, and adding it to `matchedCount` 6632 // makes the latter nonnegative. 6633 matchedCount += i; 6634 6635 // Apply set filters to unmatched elements 6636 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 6637 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 6638 // no element matchers and no seed. 6639 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 6640 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 6641 // numerically zero. 6642 if ( bySet && i !== matchedCount ) { 6643 j = 0; 6644 while ( ( matcher = setMatchers[ j++ ] ) ) { 6645 matcher( unmatched, setMatched, context, xml ); 6646 } 6647 6648 if ( seed ) { 6649 6650 // Reintegrate element matches to eliminate the need for sorting 6651 if ( matchedCount > 0 ) { 6652 while ( i-- ) { 6653 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 6654 setMatched[ i ] = pop.call( results ); 6655 } 6656 } 6657 } 6658 6659 // Discard index placeholder values to get only actual matches 6660 setMatched = condense( setMatched ); 6661 } 6662 6663 // Add matches to results 6664 push.apply( results, setMatched ); 6665 6666 // Seedless set matches succeeding multiple successful matchers stipulate sorting 6667 if ( outermost && !seed && setMatched.length > 0 && 6668 ( matchedCount + setMatchers.length ) > 1 ) { 6669 6670 jQuery.uniqueSort( results ); 6671 } 6672 } 6673 6674 // Override manipulation of globals by nested matchers 6675 if ( outermost ) { 6676 dirruns = dirrunsUnique; 6677 outermostContext = contextBackup; 6678 } 6679 6680 return unmatched; 6681 }; 6682 6683 return bySet ? 6684 markFunction( superMatcher ) : 6685 superMatcher; 6686} 6687 6688function compile( selector, match /* Internal Use Only */ ) { 6689 var i, 6690 setMatchers = [], 6691 elementMatchers = [], 6692 cached = compilerCache[ selector + " " ]; 6693 6694 if ( !cached ) { 6695 6696 // Generate a function of recursive functions that can be used to check each element 6697 if ( !match ) { 6698 match = tokenize( selector ); 6699 } 6700 i = match.length; 6701 while ( i-- ) { 6702 cached = matcherFromTokens( match[ i ] ); 6703 if ( cached[ expando ] ) { 6704 setMatchers.push( cached ); 6705 } else { 6706 elementMatchers.push( cached ); 6707 } 6708 } 6709 6710 // Cache the compiled function 6711 cached = compilerCache( selector, 6712 matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 6713 6714 // Save selector and tokenization 6715 cached.selector = selector; 6716 } 6717 return cached; 6718} 6719 6720/** 6721 * A low-level selection function that works with jQuery's compiled 6722 * selector functions 6723 * @param {String|Function} selector A selector or a pre-compiled 6724 * selector function built with jQuery selector compile 6725 * @param {Element} context 6726 * @param {Array} [results] 6727 * @param {Array} [seed] A set of elements to match against 6728 */ 6729function select( selector, context, results, seed ) { 6730 var i, tokens, token, type, find, 6731 compiled = typeof selector === "function" && selector, 6732 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 6733 6734 results = results || []; 6735 6736 // Try to minimize operations if there is only one selector in the list and no seed 6737 // (the latter of which guarantees us context) 6738 if ( match.length === 1 ) { 6739 6740 // Reduce context if the leading compound selector is an ID 6741 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 6742 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 6743 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 6744 6745 context = ( Expr.find.ID( 6746 token.matches[ 0 ].replace( runescape, funescape ), 6747 context 6748 ) || [] )[ 0 ]; 6749 if ( !context ) { 6750 return results; 6751 6752 // Precompiled matchers will still verify ancestry, so step up a level 6753 } else if ( compiled ) { 6754 context = context.parentNode; 6755 } 6756 6757 selector = selector.slice( tokens.shift().value.length ); 6758 } 6759 6760 // Fetch a seed set for right-to-left matching 6761 i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length; 6762 while ( i-- ) { 6763 token = tokens[ i ]; 6764 6765 // Abort if we hit a combinator 6766 if ( Expr.relative[ ( type = token.type ) ] ) { 6767 break; 6768 } 6769 if ( ( find = Expr.find[ type ] ) ) { 6770 6771 // Search, expanding context for leading sibling combinators 6772 if ( ( seed = find( 6773 token.matches[ 0 ].replace( runescape, funescape ), 6774 rsibling.test( tokens[ 0 ].type ) &&
vendor: 4,497 bytes, lines 6775-6959
6775 testContext( context.parentNode ) || context 6776 ) ) ) { 6777 6778 // If seed is empty or no tokens remain, we can return early 6779 tokens.splice( i, 1 ); 6780 selector = seed.length && toSelector( tokens ); 6781 if ( !selector ) { 6782 push.apply( results, seed ); 6783 return results; 6784 } 6785 6786 break; 6787 } 6788 } 6789 } 6790 } 6791 6792 // Compile and execute a filtering function if one is not provided 6793 // Provide `match` to avoid retokenization if we modified the selector above 6794 ( compiled || compile( selector, match ) )( 6795 seed, 6796 context, 6797 !documentIsHTML, 6798 results, 6799 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 6800 ); 6801 return results; 6802} 6803 6804// One-time assignments 6805 6806// Support: Android <=4.0 - 4.1+ 6807// Sort stability 6808support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 6809 6810// Initialize against the default document 6811setDocument(); 6812 6813// Support: Android <=4.0 - 4.1+ 6814// Detached nodes confoundingly follow *each other* 6815support.sortDetached = assert( function( el ) { 6816 6817 // Should return 1, but returns 4 (following) 6818 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 6819} ); 6820 6821jQuery.find = find; 6822 6823// Deprecated 6824jQuery.expr[ ":" ] = jQuery.expr.pseudos; 6825jQuery.unique = jQuery.uniqueSort; 6826 6827// These have always been private, but they used to be documented as part of 6828// Sizzle so let's maintain them for now for backwards compatibility purposes. 6829find.compile = compile; 6830find.select = select; 6831find.setDocument = setDocument; 6832find.tokenize = tokenize; 6833 6834find.escape = jQuery.escapeSelector; 6835find.getText = jQuery.text; 6836find.isXML = jQuery.isXMLDoc; 6837find.selectors = jQuery.expr; 6838find.support = jQuery.support; 6839find.uniqueSort = jQuery.uniqueSort; 6840 6841 /* eslint-enable */ 6842 6843} )(); 6844 6845 6846var dir = function( elem, dir, until ) { 6847 var matched = [], 6848 truncate = until !== undefined; 6849 6850 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 6851 if ( elem.nodeType === 1 ) { 6852 if ( truncate && jQuery( elem ).is( until ) ) { 6853 break; 6854 } 6855 matched.push( elem ); 6856 } 6857 } 6858 return matched; 6859}; 6860 6861 6862var siblings = function( n, elem ) { 6863 var matched = []; 6864 6865 for ( ; n; n = n.nextSibling ) { 6866 if ( n.nodeType === 1 && n !== elem ) { 6867 matched.push( n ); 6868 } 6869 } 6870 6871 return matched; 6872}; 6873 6874 6875var rneedsContext = jQuery.expr.match.needsContext; 6876 6877var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 6878 6879 6880 6881// Implement the identical functionality for filter and not 6882function winnow( elements, qualifier, not ) { 6883 if ( isFunction( qualifier ) ) { 6884 return jQuery.grep( elements, function( elem, i ) { 6885 return !!qualifier.call( elem, i, elem ) !== not; 6886 } ); 6887 } 6888 6889 // Single element 6890 if ( qualifier.nodeType ) { 6891 return jQuery.grep( elements, function( elem ) { 6892 return ( elem === qualifier ) !== not; 6893 } ); 6894 } 6895 6896 // Arraylike of elements (jQuery, arguments, Array) 6897 if ( typeof qualifier !== "string" ) { 6898 return jQuery.grep( elements, function( elem ) { 6899 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 6900 } ); 6901 } 6902 6903 // Filtered directly for both simple and complex selectors 6904 return jQuery.filter( qualifier, elements, not ); 6905} 6906 6907jQuery.filter = function( expr, elems, not ) { 6908 var elem = elems[ 0 ]; 6909 6910 if ( not ) { 6911 expr = ":not(" + expr + ")"; 6912 } 6913 6914 if ( elems.length === 1 && elem.nodeType === 1 ) { 6915 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 6916 } 6917 6918 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 6919 return elem.nodeType === 1; 6920 } ) ); 6921}; 6922 6923jQuery.fn.extend( { 6924 find: function( selector ) { 6925 var i, ret, 6926 len = this.length, 6927 self = this; 6928 6929 if ( typeof selector !== "string" ) { 6930 return this.pushStack( jQuery( selector ).filter( function() { 6931 for ( i = 0; i < len; i++ ) { 6932 if ( jQuery.contains( self[ i ], this ) ) { 6933 return true; 6934 } 6935 } 6936 } ) ); 6937 } 6938 6939 ret = this.pushStack( [] ); 6940 6941 for ( i = 0; i < len; i++ ) { 6942 jQuery.find( selector, self[ i ], ret ); 6943 } 6944 6945 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 6946 }, 6947 filter: function( selector ) { 6948 return this.pushStack( winnow( this, selector || [], false ) ); 6949 }, 6950 not: function( selector ) { 6951 return this.pushStack( winnow( this, selector || [], true ) ); 6952 }, 6953 is: function( selector ) { 6954 return !!winnow( 6955 this, 6956 6957 // If this is a positional/relative selector, check membership in the returned set 6958 // so $("p:first").is("p:last") won't return true for a doc with two "p". 6959 typeof selector === "string" && rneedsContext.test( selector ) ?
vendor: 9,941 bytes, lines 6960-7348
6960 jQuery( selector ) : 6961 selector || [], 6962 false 6963 ).length; 6964 } 6965} ); 6966 6967 6968// Initialize a jQuery object 6969 6970 6971// A central reference to the root jQuery(document) 6972var rootjQuery, 6973 6974 // A simple way to check for HTML strings 6975 // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521) 6976 // Strict HTML recognition (trac-11290: must start with <) 6977 // Shortcut simple #id case for speed 6978 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 6979 6980 init = jQuery.fn.init = function( selector, context, root ) { 6981 var match, elem; 6982 6983 // HANDLE: $(""), $(null), $(undefined), $(false) 6984 if ( !selector ) { 6985 return this; 6986 } 6987 6988 // Method init() accepts an alternate rootjQuery 6989 // so migrate can support jQuery.sub (gh-2101) 6990 root = root || rootjQuery; 6991 6992 // Handle HTML strings 6993 if ( typeof selector === "string" ) { 6994 if ( selector[ 0 ] === "<" && 6995 selector[ selector.length - 1 ] === ">" && 6996 selector.length >= 3 ) { 6997 6998 // Assume that strings that start and end with <> are HTML and skip the regex check 6999 match = [ null, selector, null ]; 7000 7001 } else { 7002 match = rquickExpr.exec( selector ); 7003 } 7004 7005 // Match html or make sure no context is specified for #id 7006 if ( match && ( match[ 1 ] || !context ) ) { 7007 7008 // HANDLE: $(html) -> $(array) 7009 if ( match[ 1 ] ) { 7010 context = context instanceof jQuery ? context[ 0 ] : context; 7011 7012 // Option to run scripts is true for back-compat 7013 // Intentionally let the error be thrown if parseHTML is not present 7014 jQuery.merge( this, jQuery.parseHTML( 7015 match[ 1 ], 7016 context && context.nodeType ? context.ownerDocument || context : document, 7017 true 7018 ) ); 7019 7020 // HANDLE: $(html, props) 7021 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 7022 for ( match in context ) { 7023 7024 // Properties of context are called as methods if possible 7025 if ( isFunction( this[ match ] ) ) { 7026 this[ match ]( context[ match ] ); 7027 7028 // ...and otherwise set as attributes 7029 } else { 7030 this.attr( match, context[ match ] ); 7031 } 7032 } 7033 } 7034 7035 return this; 7036 7037 // HANDLE: $(#id) 7038 } else { 7039 elem = document.getElementById( match[ 2 ] ); 7040 7041 if ( elem ) { 7042 7043 // Inject the element directly into the jQuery object 7044 this[ 0 ] = elem; 7045 this.length = 1; 7046 } 7047 return this; 7048 } 7049 7050 // HANDLE: $(expr, $(...)) 7051 } else if ( !context || context.jquery ) { 7052 return ( context || root ).find( selector ); 7053 7054 // HANDLE: $(expr, context) 7055 // (which is just equivalent to: $(context).find(expr) 7056 } else { 7057 return this.constructor( context ).find( selector ); 7058 } 7059 7060 // HANDLE: $(DOMElement) 7061 } else if ( selector.nodeType ) { 7062 this[ 0 ] = selector; 7063 this.length = 1; 7064 return this; 7065 7066 // HANDLE: $(function) 7067 // Shortcut for document ready 7068 } else if ( isFunction( selector ) ) { 7069 return root.ready !== undefined ? 7070 root.ready( selector ) : 7071 7072 // Execute immediately if ready is not present 7073 selector( jQuery ); 7074 } 7075 7076 return jQuery.makeArray( selector, this ); 7077 }; 7078 7079// Give the init function the jQuery prototype for later instantiation 7080init.prototype = jQuery.fn; 7081 7082// Initialize central reference 7083rootjQuery = jQuery( document ); 7084 7085 7086var rparentsprev = /^(?:parents|prev(?:Until|All))/, 7087 7088 // Methods guaranteed to produce a unique set when starting from a unique set 7089 guaranteedUnique = { 7090 children: true, 7091 contents: true, 7092 next: true, 7093 prev: true 7094 }; 7095 7096jQuery.fn.extend( { 7097 has: function( target ) { 7098 var targets = jQuery( target, this ), 7099 l = targets.length; 7100 7101 return this.filter( function() { 7102 var i = 0; 7103 for ( ; i < l; i++ ) { 7104 if ( jQuery.contains( this, targets[ i ] ) ) { 7105 return true; 7106 } 7107 } 7108 } ); 7109 }, 7110 7111 closest: function( selectors, context ) { 7112 var cur, 7113 i = 0, 7114 l = this.length, 7115 matched = [], 7116 targets = typeof selectors !== "string" && jQuery( selectors ); 7117 7118 // Positional selectors never match, since there's no _selection_ context 7119 if ( !rneedsContext.test( selectors ) ) { 7120 for ( ; i < l; i++ ) { 7121 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 7122 7123 // Always skip document fragments 7124 if ( cur.nodeType < 11 && ( targets ? 7125 targets.index( cur ) > -1 : 7126 7127 // Don't pass non-elements to jQuery#find 7128 cur.nodeType === 1 && 7129 jQuery.find.matchesSelector( cur, selectors ) ) ) { 7130 7131 matched.push( cur ); 7132 break; 7133 } 7134 } 7135 } 7136 } 7137 7138 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 7139 }, 7140 7141 // Determine the position of an element within the set 7142 index: function( elem ) { 7143 7144 // No argument, return index in parent 7145 if ( !elem ) { 7146 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 7147 } 7148 7149 // Index in selector 7150 if ( typeof elem === "string" ) { 7151 return indexOf.call( jQuery( elem ), this[ 0 ] ); 7152 } 7153 7154 // Locate the position of the desired element 7155 return indexOf.call( this, 7156 7157 // If it receives a jQuery object, the first element is used 7158 elem.jquery ? elem[ 0 ] : elem 7159 ); 7160 }, 7161 7162 add: function( selector, context ) { 7163 return this.pushStack( 7164 jQuery.uniqueSort( 7165 jQuery.merge( this.get(), jQuery( selector, context ) ) 7166 ) 7167 ); 7168 }, 7169 7170 addBack: function( selector ) { 7171 return this.add( selector == null ? 7172 this.prevObject : this.prevObject.filter( selector ) 7173 ); 7174 } 7175} ); 7176 7177function sibling( cur, dir ) { 7178 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 7179 return cur; 7180} 7181 7182jQuery.each( { 7183 parent: function( elem ) { 7184 var parent = elem.parentNode; 7185 return parent && parent.nodeType !== 11 ? parent : null; 7186 }, 7187 parents: function( elem ) { 7188 return dir( elem, "parentNode" ); 7189 }, 7190 parentsUntil: function( elem, _i, until ) { 7191 return dir( elem, "parentNode", until ); 7192 }, 7193 next: function( elem ) { 7194 return sibling( elem, "nextSibling" ); 7195 }, 7196 prev: function( elem ) { 7197 return sibling( elem, "previousSibling" ); 7198 }, 7199 nextAll: function( elem ) { 7200 return dir( elem, "nextSibling" ); 7201 }, 7202 prevAll: function( elem ) { 7203 return dir( elem, "previousSibling" ); 7204 }, 7205 nextUntil: function( elem, _i, until ) { 7206 return dir( elem, "nextSibling", until ); 7207 }, 7208 prevUntil: function( elem, _i, until ) { 7209 return dir( elem, "previousSibling", until ); 7210 }, 7211 siblings: function( elem ) { 7212 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 7213 }, 7214 children: function( elem ) { 7215 return siblings( elem.firstChild ); 7216 }, 7217 contents: function( elem ) { 7218 if ( elem.contentDocument != null && 7219 7220 // Support: IE 11+ 7221 // <object> elements with no `data` attribute has an object 7222 // `contentDocument` with a `null` prototype. 7223 getProto( elem.contentDocument ) ) { 7224 7225 return elem.contentDocument; 7226 } 7227 7228 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 7229 // Treat the template element as a regular one in browsers that 7230 // don't support it. 7231 if ( nodeName( elem, "template" ) ) { 7232 elem = elem.content || elem; 7233 } 7234 7235 return jQuery.merge( [], elem.childNodes ); 7236 } 7237}, function( name, fn ) { 7238 jQuery.fn[ name ] = function( until, selector ) { 7239 var matched = jQuery.map( this, fn, until ); 7240 7241 if ( name.slice( -5 ) !== "Until" ) { 7242 selector = until; 7243 } 7244 7245 if ( selector && typeof selector === "string" ) { 7246 matched = jQuery.filter( selector, matched ); 7247 } 7248 7249 if ( this.length > 1 ) { 7250 7251 // Remove duplicates 7252 if ( !guaranteedUnique[ name ] ) { 7253 jQuery.uniqueSort( matched ); 7254 } 7255 7256 // Reverse order for parents* and prev-derivatives 7257 if ( rparentsprev.test( name ) ) { 7258 matched.reverse(); 7259 } 7260 } 7261 7262 return this.pushStack( matched ); 7263 }; 7264} ); 7265var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 7266 7267 7268 7269// Convert String-formatted options into Object-formatted ones 7270function createOptions( options ) { 7271 var object = {}; 7272 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 7273 object[ flag ] = true; 7274 } ); 7275 return object; 7276} 7277 7278/* 7279 * Create a callback list using the following parameters: 7280 * 7281 * options: an optional list of space-separated options that will change how 7282 * the callback list behaves or a more traditional option object 7283 * 7284 * By default a callback list will act like an event callback list and can be 7285 * "fired" multiple times. 7286 * 7287 * Possible options: 7288 * 7289 * once: will ensure the callback list can only be fired once (like a Deferred) 7290 * 7291 * memory: will keep track of previous values and will call any callback added 7292 * after the list has been fired right away with the latest "memorized" 7293 * values (like a Deferred) 7294 * 7295 * unique: will ensure a callback can only be added once (no duplicate in the list) 7296 * 7297 * stopOnFalse: interrupt callings when a callback returns false 7298 * 7299 */ 7300jQuery.Callbacks = function( options ) { 7301 7302 // Convert options from String-formatted to Object-formatted if needed 7303 // (we check in cache first) 7304 options = typeof options === "string" ? 7305 createOptions( options ) : 7306 jQuery.extend( {}, options ); 7307 7308 var // Flag to know if list is currently firing 7309 firing, 7310 7311 // Last fire value for non-forgettable lists 7312 memory, 7313 7314 // Flag to know if list was already fired 7315 fired, 7316 7317 // Flag to prevent firing 7318 locked, 7319 7320 // Actual callback list 7321 list = [], 7322 7323 // Queue of execution data for repeatable lists 7324 queue = [], 7325 7326 // Index of currently firing callback (modified by add/remove as needed) 7327 firingIndex = -1, 7328 7329 // Fire callbacks 7330 fire = function() { 7331 7332 // Enforce single-firing 7333 locked = locked || options.once; 7334 7335 // Execute callbacks for all pending executions, 7336 // respecting firingIndex overrides and runtime changes 7337 fired = firing = true; 7338 for ( ; queue.length; firingIndex = -1 ) { 7339 memory = queue.shift(); 7340 while ( ++firingIndex < list.length ) { 7341 7342 // Run callback and check for early termination 7343 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 7344 options.stopOnFalse ) { 7345 7346 // Jump to end and forget the data so .add doesn't re-fire 7347 firingIndex = list.length; 7348 memory = false;
vendor: 4,918 bytes, lines 7349-7558
7349 } 7350 } 7351 } 7352 7353 // Forget the data if we're done with it 7354 if ( !options.memory ) { 7355 memory = false; 7356 } 7357 7358 firing = false; 7359 7360 // Clean up if we're done firing for good 7361 if ( locked ) { 7362 7363 // Keep an empty list if we have data for future add calls 7364 if ( memory ) { 7365 list = []; 7366 7367 // Otherwise, this object is spent 7368 } else { 7369 list = ""; 7370 } 7371 } 7372 }, 7373 7374 // Actual Callbacks object 7375 self = { 7376 7377 // Add a callback or a collection of callbacks to the list 7378 add: function() { 7379 if ( list ) { 7380 7381 // If we have memory from a past run, we should fire after adding 7382 if ( memory && !firing ) { 7383 firingIndex = list.length - 1; 7384 queue.push( memory ); 7385 } 7386 7387 ( function add( args ) { 7388 jQuery.each( args, function( _, arg ) { 7389 if ( isFunction( arg ) ) { 7390 if ( !options.unique || !self.has( arg ) ) { 7391 list.push( arg ); 7392 } 7393 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 7394 7395 // Inspect recursively 7396 add( arg ); 7397 } 7398 } ); 7399 } )( arguments ); 7400 7401 if ( memory && !firing ) { 7402 fire(); 7403 } 7404 } 7405 return this; 7406 }, 7407 7408 // Remove a callback from the list 7409 remove: function() { 7410 jQuery.each( arguments, function( _, arg ) { 7411 var index; 7412 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 7413 list.splice( index, 1 ); 7414 7415 // Handle firing indexes 7416 if ( index <= firingIndex ) { 7417 firingIndex--; 7418 } 7419 } 7420 } ); 7421 return this; 7422 }, 7423 7424 // Check if a given callback is in the list. 7425 // If no argument is given, return whether or not list has callbacks attached. 7426 has: function( fn ) { 7427 return fn ? 7428 jQuery.inArray( fn, list ) > -1 : 7429 list.length > 0; 7430 }, 7431 7432 // Remove all callbacks from the list 7433 empty: function() { 7434 if ( list ) { 7435 list = []; 7436 } 7437 return this; 7438 }, 7439 7440 // Disable .fire and .add 7441 // Abort any current/pending executions 7442 // Clear all callbacks and values 7443 disable: function() { 7444 locked = queue = []; 7445 list = memory = ""; 7446 return this; 7447 }, 7448 disabled: function() { 7449 return !list; 7450 }, 7451 7452 // Disable .fire 7453 // Also disable .add unless we have memory (since it would have no effect) 7454 // Abort any pending executions 7455 lock: function() { 7456 locked = queue = []; 7457 if ( !memory && !firing ) { 7458 list = memory = ""; 7459 } 7460 return this; 7461 }, 7462 locked: function() { 7463 return !!locked; 7464 }, 7465 7466 // Call all callbacks with the given context and arguments 7467 fireWith: function( context, args ) { 7468 if ( !locked ) { 7469 args = args || []; 7470 args = [ context, args.slice ? args.slice() : args ]; 7471 queue.push( args ); 7472 if ( !firing ) { 7473 fire(); 7474 } 7475 } 7476 return this; 7477 }, 7478 7479 // Call all the callbacks with the given arguments 7480 fire: function() { 7481 self.fireWith( this, arguments ); 7482 return this; 7483 }, 7484 7485 // To know if the callbacks have already been called at least once 7486 fired: function() { 7487 return !!fired; 7488 } 7489 }; 7490 7491 return self; 7492}; 7493 7494 7495function Identity( v ) { 7496 return v; 7497} 7498function Thrower( ex ) { 7499 throw ex; 7500} 7501 7502function adoptValue( value, resolve, reject, noValue ) { 7503 var method; 7504 7505 try { 7506 7507 // Check for promise aspect first to privilege synchronous behavior 7508 if ( value && isFunction( ( method = value.promise ) ) ) { 7509 method.call( value ).done( resolve ).fail( reject ); 7510 7511 // Other thenables 7512 } else if ( value && isFunction( ( method = value.then ) ) ) { 7513 method.call( value, resolve, reject ); 7514 7515 // Other non-thenables 7516 } else { 7517 7518 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 7519 // * false: [ value ].slice( 0 ) => resolve( value ) 7520 // * true: [ value ].slice( 1 ) => resolve() 7521 resolve.apply( undefined, [ value ].slice( noValue ) ); 7522 } 7523 7524 // For Promises/A+, convert exceptions into rejections 7525 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 7526 // Deferred#then to conditionally suppress rejection. 7527 } catch ( value ) { 7528 7529 // Support: Android 4.0 only 7530 // Strict mode functions invoked without .call/.apply get global-object context 7531 reject.apply( undefined, [ value ] ); 7532 } 7533} 7534 7535jQuery.extend( { 7536 7537 Deferred: function( func ) { 7538 var tuples = [ 7539 7540 // action, add listener, callbacks, 7541 // ... .then handlers, argument index, [final state] 7542 [ "notify", "progress", jQuery.Callbacks( "memory" ), 7543 jQuery.Callbacks( "memory" ), 2 ], 7544 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 7545 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 7546 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 7547 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 7548 ], 7549 state = "pending", 7550 promise = { 7551 state: function() { 7552 return state; 7553 }, 7554 always: function() { 7555 deferred.done( arguments ).fail( arguments ); 7556 return this; 7557 }, 7558 "catch": function( fn ) {
vendor: 28,472 bytes, lines 7559-8670
7559 return promise.then( null, fn ); 7560 }, 7561 7562 // Keep pipe for back-compat 7563 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 7564 var fns = arguments; 7565 7566 return jQuery.Deferred( function( newDefer ) { 7567 jQuery.each( tuples, function( _i, tuple ) { 7568 7569 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 7570 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 7571 7572 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 7573 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 7574 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 7575 deferred[ tuple[ 1 ] ]( function() { 7576 var returned = fn && fn.apply( this, arguments ); 7577 if ( returned && isFunction( returned.promise ) ) { 7578 returned.promise() 7579 .progress( newDefer.notify ) 7580 .done( newDefer.resolve ) 7581 .fail( newDefer.reject ); 7582 } else { 7583 newDefer[ tuple[ 0 ] + "With" ]( 7584 this, 7585 fn ? [ returned ] : arguments 7586 ); 7587 } 7588 } ); 7589 } ); 7590 fns = null; 7591 } ).promise(); 7592 }, 7593 then: function( onFulfilled, onRejected, onProgress ) { 7594 var maxDepth = 0; 7595 function resolve( depth, deferred, handler, special ) { 7596 return function() { 7597 var that = this, 7598 args = arguments, 7599 mightThrow = function() { 7600 var returned, then; 7601 7602 // Support: Promises/A+ section 2.3.3.3.3 7603 // https://promisesaplus.com/#point-59 7604 // Ignore double-resolution attempts 7605 if ( depth < maxDepth ) { 7606 return; 7607 } 7608 7609 returned = handler.apply( that, args ); 7610 7611 // Support: Promises/A+ section 2.3.1 7612 // https://promisesaplus.com/#point-48 7613 if ( returned === deferred.promise() ) { 7614 throw new TypeError( "Thenable self-resolution" ); 7615 } 7616 7617 // Support: Promises/A+ sections 2.3.3.1, 3.5 7618 // https://promisesaplus.com/#point-54 7619 // https://promisesaplus.com/#point-75 7620 // Retrieve `then` only once 7621 then = returned && 7622 7623 // Support: Promises/A+ section 2.3.4 7624 // https://promisesaplus.com/#point-64 7625 // Only check objects and functions for thenability 7626 ( typeof returned === "object" || 7627 typeof returned === "function" ) && 7628 returned.then; 7629 7630 // Handle a returned thenable 7631 if ( isFunction( then ) ) { 7632 7633 // Special processors (notify) just wait for resolution 7634 if ( special ) { 7635 then.call( 7636 returned, 7637 resolve( maxDepth, deferred, Identity, special ), 7638 resolve( maxDepth, deferred, Thrower, special ) 7639 ); 7640 7641 // Normal processors (resolve) also hook into progress 7642 } else { 7643 7644 // ...and disregard older resolution values 7645 maxDepth++; 7646 7647 then.call( 7648 returned, 7649 resolve( maxDepth, deferred, Identity, special ), 7650 resolve( maxDepth, deferred, Thrower, special ), 7651 resolve( maxDepth, deferred, Identity, 7652 deferred.notifyWith ) 7653 ); 7654 } 7655 7656 // Handle all other returned values 7657 } else { 7658 7659 // Only substitute handlers pass on context 7660 // and multiple values (non-spec behavior) 7661 if ( handler !== Identity ) { 7662 that = undefined; 7663 args = [ returned ]; 7664 } 7665 7666 // Process the value(s) 7667 // Default process is resolve 7668 ( special || deferred.resolveWith )( that, args ); 7669 } 7670 }, 7671 7672 // Only normal processors (resolve) catch and reject exceptions 7673 process = special ? 7674 mightThrow : 7675 function() { 7676 try { 7677 mightThrow(); 7678 } catch ( e ) { 7679 7680 if ( jQuery.Deferred.exceptionHook ) { 7681 jQuery.Deferred.exceptionHook( e, 7682 process.error ); 7683 } 7684 7685 // Support: Promises/A+ section 2.3.3.3.4.1 7686 // https://promisesaplus.com/#point-61 7687 // Ignore post-resolution exceptions 7688 if ( depth + 1 >= maxDepth ) { 7689 7690 // Only substitute handlers pass on context 7691 // and multiple values (non-spec behavior) 7692 if ( handler !== Thrower ) { 7693 that = undefined; 7694 args = [ e ]; 7695 } 7696 7697 deferred.rejectWith( that, args ); 7698 } 7699 } 7700 }; 7701 7702 // Support: Promises/A+ section 2.3.3.3.1 7703 // https://promisesaplus.com/#point-57 7704 // Re-resolve promises immediately to dodge false rejection from 7705 // subsequent errors 7706 if ( depth ) { 7707 process(); 7708 } else { 7709 7710 // Call an optional hook to record the error, in case of exception 7711 // since it's otherwise lost when execution goes async 7712 if ( jQuery.Deferred.getErrorHook ) { 7713 process.error = jQuery.Deferred.getErrorHook(); 7714 7715 // The deprecated alias of the above. While the name suggests 7716 // returning the stack, not an error instance, jQuery just passes 7717 // it directly to `console.warn` so both will work; an instance 7718 // just better cooperates with source maps. 7719 } else if ( jQuery.Deferred.getStackHook ) { 7720 process.error = jQuery.Deferred.getStackHook(); 7721 } 7722 window.setTimeout( process ); 7723 } 7724 }; 7725 } 7726 7727 return jQuery.Deferred( function( newDefer ) { 7728 7729 // progress_handlers.add( ... ) 7730 tuples[ 0 ][ 3 ].add( 7731 resolve( 7732 0, 7733 newDefer, 7734 isFunction( onProgress ) ? 7735 onProgress : 7736 Identity, 7737 newDefer.notifyWith 7738 ) 7739 ); 7740 7741 // fulfilled_handlers.add( ... ) 7742 tuples[ 1 ][ 3 ].add( 7743 resolve( 7744 0, 7745 newDefer, 7746 isFunction( onFulfilled ) ? 7747 onFulfilled : 7748 Identity 7749 ) 7750 ); 7751 7752 // rejected_handlers.add( ... ) 7753 tuples[ 2 ][ 3 ].add( 7754 resolve( 7755 0, 7756 newDefer, 7757 isFunction( onRejected ) ? 7758 onRejected : 7759 Thrower 7760 ) 7761 ); 7762 } ).promise(); 7763 }, 7764 7765 // Get a promise for this deferred 7766 // If obj is provided, the promise aspect is added to the object 7767 promise: function( obj ) { 7768 return obj != null ? jQuery.extend( obj, promise ) : promise; 7769 } 7770 }, 7771 deferred = {}; 7772 7773 // Add list-specific methods 7774 jQuery.each( tuples, function( i, tuple ) { 7775 var list = tuple[ 2 ], 7776 stateString = tuple[ 5 ]; 7777 7778 // promise.progress = list.add 7779 // promise.done = list.add 7780 // promise.fail = list.add 7781 promise[ tuple[ 1 ] ] = list.add; 7782 7783 // Handle state 7784 if ( stateString ) { 7785 list.add( 7786 function() { 7787 7788 // state = "resolved" (i.e., fulfilled) 7789 // state = "rejected" 7790 state = stateString; 7791 }, 7792 7793 // rejected_callbacks.disable 7794 // fulfilled_callbacks.disable 7795 tuples[ 3 - i ][ 2 ].disable, 7796 7797 // rejected_handlers.disable 7798 // fulfilled_handlers.disable 7799 tuples[ 3 - i ][ 3 ].disable, 7800 7801 // progress_callbacks.lock 7802 tuples[ 0 ][ 2 ].lock, 7803 7804 // progress_handlers.lock 7805 tuples[ 0 ][ 3 ].lock 7806 ); 7807 } 7808 7809 // progress_handlers.fire 7810 // fulfilled_handlers.fire 7811 // rejected_handlers.fire 7812 list.add( tuple[ 3 ].fire ); 7813 7814 // deferred.notify = function() { deferred.notifyWith(...) } 7815 // deferred.resolve = function() { deferred.resolveWith(...) } 7816 // deferred.reject = function() { deferred.rejectWith(...) } 7817 deferred[ tuple[ 0 ] ] = function() { 7818 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 7819 return this; 7820 }; 7821 7822 // deferred.notifyWith = list.fireWith 7823 // deferred.resolveWith = list.fireWith 7824 // deferred.rejectWith = list.fireWith 7825 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 7826 } ); 7827 7828 // Make the deferred a promise 7829 promise.promise( deferred ); 7830 7831 // Call given func if any 7832 if ( func ) { 7833 func.call( deferred, deferred ); 7834 } 7835 7836 // All done! 7837 return deferred; 7838 }, 7839 7840 // Deferred helper 7841 when: function( singleValue ) { 7842 var 7843 7844 // count of uncompleted subordinates 7845 remaining = arguments.length, 7846 7847 // count of unprocessed arguments 7848 i = remaining, 7849 7850 // subordinate fulfillment data 7851 resolveContexts = Array( i ), 7852 resolveValues = slice.call( arguments ), 7853 7854 // the primary Deferred 7855 primary = jQuery.Deferred(), 7856 7857 // subordinate callback factory 7858 updateFunc = function( i ) { 7859 return function( value ) { 7860 resolveContexts[ i ] = this; 7861 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 7862 if ( !( --remaining ) ) { 7863 primary.resolveWith( resolveContexts, resolveValues ); 7864 } 7865 }; 7866 }; 7867 7868 // Single- and empty arguments are adopted like Promise.resolve 7869 if ( remaining <= 1 ) { 7870 adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, 7871 !remaining ); 7872 7873 // Use .then() to unwrap secondary thenables (cf. gh-3000) 7874 if ( primary.state() === "pending" || 7875 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 7876 7877 return primary.then(); 7878 } 7879 } 7880 7881 // Multiple arguments are aggregated like Promise.all array elements 7882 while ( i-- ) { 7883 adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); 7884 } 7885 7886 return primary.promise(); 7887 } 7888} ); 7889 7890 7891// These usually indicate a programmer mistake during development, 7892// warn about them ASAP rather than swallowing them by default. 7893var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 7894 7895// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error 7896// captured before the async barrier to get the original error cause 7897// which may otherwise be hidden. 7898jQuery.Deferred.exceptionHook = function( error, asyncError ) { 7899 7900 // Support: IE 8 - 9 only 7901 // Console exists when dev tools are open, which can happen at any time 7902 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 7903 window.console.warn( "jQuery.Deferred exception: " + error.message, 7904 error.stack, asyncError ); 7905 } 7906}; 7907 7908 7909 7910 7911jQuery.readyException = function( error ) { 7912 window.setTimeout( function() { 7913 throw error; 7914 } ); 7915}; 7916 7917 7918 7919 7920// The deferred used on DOM ready 7921var readyList = jQuery.Deferred(); 7922 7923jQuery.fn.ready = function( fn ) { 7924 7925 readyList 7926 .then( fn ) 7927 7928 // Wrap jQuery.readyException in a function so that the lookup 7929 // happens at the time of error handling instead of callback 7930 // registration. 7931 .catch( function( error ) { 7932 jQuery.readyException( error ); 7933 } ); 7934 7935 return this; 7936}; 7937 7938jQuery.extend( { 7939 7940 // Is the DOM ready to be used? Set to true once it occurs. 7941 isReady: false, 7942 7943 // A counter to track how many items to wait for before 7944 // the ready event fires. See trac-6781 7945 readyWait: 1, 7946 7947 // Handle when the DOM is ready 7948 ready: function( wait ) { 7949 7950 // Abort if there are pending holds or we're already ready 7951 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 7952 return; 7953 } 7954 7955 // Remember that the DOM is ready 7956 jQuery.isReady = true; 7957 7958 // If a normal DOM Ready event fired, decrement, and wait if need be 7959 if ( wait !== true && --jQuery.readyWait > 0 ) { 7960 return; 7961 } 7962 7963 // If there are functions bound, to execute 7964 readyList.resolveWith( document, [ jQuery ] ); 7965 } 7966} ); 7967 7968jQuery.ready.then = readyList.then; 7969 7970// The ready event handler and self cleanup method 7971function completed() { 7972 document.removeEventListener( "DOMContentLoaded", completed ); 7973 window.removeEventListener( "load", completed ); 7974 jQuery.ready(); 7975} 7976 7977// Catch cases where $(document).ready() is called 7978// after the browser event has already occurred. 7979// Support: IE <=9 - 10 only 7980// Older IE sometimes signals "interactive" too soon 7981if ( document.readyState === "complete" || 7982 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 7983 7984 // Handle it asynchronously to allow scripts the opportunity to delay ready 7985 window.setTimeout( jQuery.ready ); 7986 7987} else { 7988 7989 // Use the handy event callback 7990 document.addEventListener( "DOMContentLoaded", completed ); 7991 7992 // A fallback to window.onload, that will always work 7993 window.addEventListener( "load", completed ); 7994} 7995 7996 7997 7998 7999// Multifunctional method to get and set values of a collection 8000// The value/s can optionally be executed if it's a function 8001var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 8002 var i = 0, 8003 len = elems.length, 8004 bulk = key == null; 8005 8006 // Sets many values 8007 if ( toType( key ) === "object" ) { 8008 chainable = true; 8009 for ( i in key ) { 8010 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 8011 } 8012 8013 // Sets one value 8014 } else if ( value !== undefined ) { 8015 chainable = true; 8016 8017 if ( !isFunction( value ) ) { 8018 raw = true; 8019 } 8020 8021 if ( bulk ) { 8022 8023 // Bulk operations run against the entire set 8024 if ( raw ) { 8025 fn.call( elems, value ); 8026 fn = null; 8027 8028 // ...except when executing function values 8029 } else { 8030 bulk = fn; 8031 fn = function( elem, _key, value ) { 8032 return bulk.call( jQuery( elem ), value ); 8033 }; 8034 } 8035 } 8036 8037 if ( fn ) { 8038 for ( ; i < len; i++ ) { 8039 fn( 8040 elems[ i ], key, raw ? 8041 value : 8042 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 8043 ); 8044 } 8045 } 8046 } 8047 8048 if ( chainable ) { 8049 return elems; 8050 } 8051 8052 // Gets 8053 if ( bulk ) { 8054 return fn.call( elems ); 8055 } 8056 8057 return len ? fn( elems[ 0 ], key ) : emptyGet; 8058}; 8059 8060 8061// Matches dashed string for camelizing 8062var rmsPrefix = /^-ms-/, 8063 rdashAlpha = /-([a-z])/g; 8064 8065// Used by camelCase as callback to replace() 8066function fcamelCase( _all, letter ) { 8067 return letter.toUpperCase(); 8068} 8069 8070// Convert dashed to camelCase; used by the css and data modules 8071// Support: IE <=9 - 11, Edge 12 - 15 8072// Microsoft forgot to hump their vendor prefix (trac-9572) 8073function camelCase( string ) { 8074 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 8075} 8076var acceptData = function( owner ) { 8077 8078 // Accepts only: 8079 // - Node 8080 // - Node.ELEMENT_NODE 8081 // - Node.DOCUMENT_NODE 8082 // - Object 8083 // - Any 8084 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 8085}; 8086 8087 8088 8089 8090function Data() { 8091 this.expando = jQuery.expando + Data.uid++; 8092} 8093 8094Data.uid = 1; 8095 8096Data.prototype = { 8097 8098 cache: function( owner ) { 8099 8100 // Check if the owner object already has a cache 8101 var value = owner[ this.expando ]; 8102 8103 // If not, create one 8104 if ( !value ) { 8105 value = {}; 8106 8107 // We can accept data for non-element nodes in modern browsers, 8108 // but we should not, see trac-8335. 8109 // Always return an empty object. 8110 if ( acceptData( owner ) ) { 8111 8112 // If it is a node unlikely to be stringify-ed or looped over 8113 // use plain assignment 8114 if ( owner.nodeType ) { 8115 owner[ this.expando ] = value; 8116 8117 // Otherwise secure it in a non-enumerable property 8118 // configurable must be true to allow the property to be 8119 // deleted when data is removed 8120 } else { 8121 Object.defineProperty( owner, this.expando, { 8122 value: value, 8123 configurable: true 8124 } ); 8125 } 8126 } 8127 } 8128 8129 return value; 8130 }, 8131 set: function( owner, data, value ) { 8132 var prop, 8133 cache = this.cache( owner ); 8134 8135 // Handle: [ owner, key, value ] args 8136 // Always use camelCase key (gh-2257) 8137 if ( typeof data === "string" ) { 8138 cache[ camelCase( data ) ] = value; 8139 8140 // Handle: [ owner, { properties } ] args 8141 } else { 8142 8143 // Copy the properties one-by-one to the cache object 8144 for ( prop in data ) { 8145 cache[ camelCase( prop ) ] = data[ prop ]; 8146 } 8147 } 8148 return cache; 8149 }, 8150 get: function( owner, key ) { 8151 return key === undefined ? 8152 this.cache( owner ) : 8153 8154 // Always use camelCase key (gh-2257) 8155 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 8156 }, 8157 access: function( owner, key, value ) { 8158 8159 // In cases where either: 8160 // 8161 // 1. No key was specified 8162 // 2. A string key was specified, but no value provided 8163 // 8164 // Take the "read" path and allow the get method to determine 8165 // which value to return, respectively either: 8166 // 8167 // 1. The entire cache object 8168 // 2. The data stored at the key 8169 // 8170 if ( key === undefined || 8171 ( ( key && typeof key === "string" ) && value === undefined ) ) { 8172 8173 return this.get( owner, key ); 8174 } 8175 8176 // When the key is not a string, or both a key and value 8177 // are specified, set or extend (existing objects) with either: 8178 // 8179 // 1. An object of properties 8180 // 2. A key and value 8181 // 8182 this.set( owner, key, value ); 8183 8184 // Since the "set" path can have two possible entry points 8185 // return the expected data based on which path was taken[*] 8186 return value !== undefined ? value : key; 8187 }, 8188 remove: function( owner, key ) { 8189 var i, 8190 cache = owner[ this.expando ]; 8191 8192 if ( cache === undefined ) { 8193 return; 8194 } 8195 8196 if ( key !== undefined ) { 8197 8198 // Support array or space separated string of keys 8199 if ( Array.isArray( key ) ) { 8200 8201 // If key is an array of keys... 8202 // We always set camelCase keys, so remove that. 8203 key = key.map( camelCase ); 8204 } else { 8205 key = camelCase( key ); 8206 8207 // If a key with the spaces exists, use it. 8208 // Otherwise, create an array by matching non-whitespace 8209 key = key in cache ? 8210 [ key ] : 8211 ( key.match( rnothtmlwhite ) || [] ); 8212 } 8213 8214 i = key.length; 8215 8216 while ( i-- ) { 8217 delete cache[ key[ i ] ]; 8218 } 8219 } 8220 8221 // Remove the expando if there's no more data 8222 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 8223 8224 // Support: Chrome <=35 - 45 8225 // Webkit & Blink performance suffers when deleting properties 8226 // from DOM nodes, so set to undefined instead 8227 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 8228 if ( owner.nodeType ) { 8229 owner[ this.expando ] = undefined; 8230 } else { 8231 delete owner[ this.expando ]; 8232 } 8233 } 8234 }, 8235 hasData: function( owner ) { 8236 var cache = owner[ this.expando ]; 8237 return cache !== undefined && !jQuery.isEmptyObject( cache ); 8238 } 8239}; 8240var dataPriv = new Data(); 8241 8242var dataUser = new Data(); 8243 8244 8245 8246// Implementation Summary 8247// 8248// 1. Enforce API surface and semantic compatibility with 1.9.x branch 8249// 2. Improve the module's maintainability by reducing the storage 8250// paths to a single mechanism. 8251// 3. Use the same single mechanism to support "private" and "user" data. 8252// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 8253// 5. Avoid exposing implementation details on user objects (eg. expando properties) 8254// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 8255 8256var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 8257 rmultiDash = /[A-Z]/g; 8258 8259function getData( data ) { 8260 if ( data === "true" ) { 8261 return true; 8262 } 8263 8264 if ( data === "false" ) { 8265 return false; 8266 } 8267 8268 if ( data === "null" ) { 8269 return null; 8270 } 8271 8272 // Only convert to a number if it doesn't change the string 8273 if ( data === +data + "" ) { 8274 return +data; 8275 } 8276 8277 if ( rbrace.test( data ) ) { 8278 return JSON.parse( data ); 8279 } 8280 8281 return data; 8282} 8283 8284function dataAttr( elem, key, data ) { 8285 var name; 8286 8287 // If nothing was found internally, try to fetch any 8288 // data from the HTML5 data-* attribute 8289 if ( data === undefined && elem.nodeType === 1 ) { 8290 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 8291 data = elem.getAttribute( name ); 8292 8293 if ( typeof data === "string" ) { 8294 try { 8295 data = getData( data ); 8296 } catch ( e ) {} 8297 8298 // Make sure we set the data so it isn't changed later 8299 dataUser.set( elem, key, data ); 8300 } else { 8301 data = undefined; 8302 } 8303 } 8304 return data; 8305} 8306 8307jQuery.extend( { 8308 hasData: function( elem ) { 8309 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 8310 }, 8311 8312 data: function( elem, name, data ) { 8313 return dataUser.access( elem, name, data ); 8314 }, 8315 8316 removeData: function( elem, name ) { 8317 dataUser.remove( elem, name ); 8318 }, 8319 8320 // TODO: Now that all calls to _data and _removeData have been replaced 8321 // with direct calls to dataPriv methods, these can be deprecated. 8322 _data: function( elem, name, data ) { 8323 return dataPriv.access( elem, name, data ); 8324 }, 8325 8326 _removeData: function( elem, name ) { 8327 dataPriv.remove( elem, name ); 8328 } 8329} ); 8330 8331jQuery.fn.extend( { 8332 data: function( key, value ) { 8333 var i, name, data, 8334 elem = this[ 0 ], 8335 attrs = elem && elem.attributes; 8336 8337 // Gets all values 8338 if ( key === undefined ) { 8339 if ( this.length ) { 8340 data = dataUser.get( elem ); 8341 8342 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 8343 i = attrs.length; 8344 while ( i-- ) { 8345 8346 // Support: IE 11 only 8347 // The attrs elements can be null (trac-14894) 8348 if ( attrs[ i ] ) { 8349 name = attrs[ i ].name; 8350 if ( name.indexOf( "data-" ) === 0 ) { 8351 name = camelCase( name.slice( 5 ) ); 8352 dataAttr( elem, name, data[ name ] ); 8353 } 8354 } 8355 } 8356 dataPriv.set( elem, "hasDataAttrs", true ); 8357 } 8358 } 8359 8360 return data; 8361 } 8362 8363 // Sets multiple values 8364 if ( typeof key === "object" ) { 8365 return this.each( function() { 8366 dataUser.set( this, key ); 8367 } ); 8368 } 8369 8370 return access( this, function( value ) { 8371 var data; 8372 8373 // The calling jQuery object (element matches) is not empty 8374 // (and therefore has an element appears at this[ 0 ]) and the 8375 // `value` parameter was not undefined. An empty jQuery object 8376 // will result in `undefined` for elem = this[ 0 ] which will 8377 // throw an exception if an attempt to read a data cache is made. 8378 if ( elem && value === undefined ) { 8379 8380 // Attempt to get data from the cache 8381 // The key will always be camelCased in Data 8382 data = dataUser.get( elem, key ); 8383 if ( data !== undefined ) { 8384 return data; 8385 } 8386 8387 // Attempt to "discover" the data in 8388 // HTML5 custom data-* attrs 8389 data = dataAttr( elem, key ); 8390 if ( data !== undefined ) { 8391 return data; 8392 } 8393 8394 // We tried really hard, but the data doesn't exist. 8395 return; 8396 } 8397 8398 // Set the data... 8399 this.each( function() { 8400 8401 // We always store the camelCased key 8402 dataUser.set( this, key, value ); 8403 } ); 8404 }, null, value, arguments.length > 1, null, true ); 8405 }, 8406 8407 removeData: function( key ) { 8408 return this.each( function() { 8409 dataUser.remove( this, key ); 8410 } ); 8411 } 8412} ); 8413 8414 8415jQuery.extend( { 8416 queue: function( elem, type, data ) { 8417 var queue; 8418 8419 if ( elem ) { 8420 type = ( type || "fx" ) + "queue"; 8421 queue = dataPriv.get( elem, type ); 8422 8423 // Speed up dequeue by getting out quickly if this is just a lookup 8424 if ( data ) { 8425 if ( !queue || Array.isArray( data ) ) { 8426 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 8427 } else { 8428 queue.push( data ); 8429 } 8430 } 8431 return queue || []; 8432 } 8433 }, 8434 8435 dequeue: function( elem, type ) { 8436 type = type || "fx"; 8437 8438 var queue = jQuery.queue( elem, type ), 8439 startLength = queue.length, 8440 fn = queue.shift(), 8441 hooks = jQuery._queueHooks( elem, type ), 8442 next = function() { 8443 jQuery.dequeue( elem, type ); 8444 }; 8445 8446 // If the fx queue is dequeued, always remove the progress sentinel 8447 if ( fn === "inprogress" ) { 8448 fn = queue.shift(); 8449 startLength--; 8450 } 8451 8452 if ( fn ) { 8453 8454 // Add a progress sentinel to prevent the fx queue from being 8455 // automatically dequeued 8456 if ( type === "fx" ) { 8457 queue.unshift( "inprogress" ); 8458 } 8459 8460 // Clear up the last queue stop function 8461 delete hooks.stop; 8462 fn.call( elem, next, hooks ); 8463 } 8464 8465 if ( !startLength && hooks ) { 8466 hooks.empty.fire(); 8467 } 8468 }, 8469 8470 // Not public - generate a queueHooks object, or return the current one 8471 _queueHooks: function( elem, type ) { 8472 var key = type + "queueHooks"; 8473 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 8474 empty: jQuery.Callbacks( "once memory" ).add( function() { 8475 dataPriv.remove( elem, [ type + "queue", key ] ); 8476 } ) 8477 } ); 8478 } 8479} ); 8480 8481jQuery.fn.extend( { 8482 queue: function( type, data ) { 8483 var setter = 2; 8484 8485 if ( typeof type !== "string" ) { 8486 data = type; 8487 type = "fx"; 8488 setter--; 8489 } 8490 8491 if ( arguments.length < setter ) { 8492 return jQuery.queue( this[ 0 ], type ); 8493 } 8494 8495 return data === undefined ? 8496 this : 8497 this.each( function() { 8498 var queue = jQuery.queue( this, type, data ); 8499 8500 // Ensure a hooks for this queue 8501 jQuery._queueHooks( this, type ); 8502 8503 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 8504 jQuery.dequeue( this, type ); 8505 } 8506 } ); 8507 }, 8508 dequeue: function( type ) { 8509 return this.each( function() { 8510 jQuery.dequeue( this, type ); 8511 } ); 8512 }, 8513 clearQueue: function( type ) { 8514 return this.queue( type || "fx", [] ); 8515 }, 8516 8517 // Get a promise resolved when queues of a certain type 8518 // are emptied (fx is the type by default) 8519 promise: function( type, obj ) { 8520 var tmp, 8521 count = 1, 8522 defer = jQuery.Deferred(), 8523 elements = this, 8524 i = this.length, 8525 resolve = function() { 8526 if ( !( --count ) ) { 8527 defer.resolveWith( elements, [ elements ] ); 8528 } 8529 }; 8530 8531 if ( typeof type !== "string" ) { 8532 obj = type; 8533 type = undefined; 8534 } 8535 type = type || "fx"; 8536 8537 while ( i-- ) { 8538 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 8539 if ( tmp && tmp.empty ) { 8540 count++; 8541 tmp.empty.add( resolve ); 8542 } 8543 } 8544 resolve(); 8545 return defer.promise( obj ); 8546 } 8547} ); 8548var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 8549 8550var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 8551 8552 8553var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 8554 8555var documentElement = document.documentElement; 8556 8557 8558 8559 var isAttached = function( elem ) { 8560 return jQuery.contains( elem.ownerDocument, elem ); 8561 }, 8562 composed = { composed: true }; 8563 8564 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 8565 // Check attachment across shadow DOM boundaries when possible (gh-3504) 8566 // Support: iOS 10.0-10.2 only 8567 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 8568 // leading to errors. We need to check for `getRootNode`. 8569 if ( documentElement.getRootNode ) { 8570 isAttached = function( elem ) { 8571 return jQuery.contains( elem.ownerDocument, elem ) || 8572 elem.getRootNode( composed ) === elem.ownerDocument; 8573 }; 8574 } 8575var isHiddenWithinTree = function( elem, el ) { 8576 8577 // isHiddenWithinTree might be called from jQuery#filter function; 8578 // in that case, element will be second argument 8579 elem = el || elem; 8580 8581 // Inline style trumps all 8582 return elem.style.display === "none" || 8583 elem.style.display === "" && 8584 8585 // Otherwise, check computed style 8586 // Support: Firefox <=43 - 45 8587 // Disconnected elements can have computed display: none, so first confirm that elem is 8588 // in the document. 8589 isAttached( elem ) && 8590 8591 jQuery.css( elem, "display" ) === "none"; 8592 }; 8593 8594 8595 8596function adjustCSS( elem, prop, valueParts, tween ) { 8597 var adjusted, scale, 8598 maxIterations = 20, 8599 currentValue = tween ? 8600 function() { 8601 return tween.cur(); 8602 } : 8603 function() { 8604 return jQuery.css( elem, prop, "" ); 8605 }, 8606 initial = currentValue(), 8607 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 8608 8609 // Starting value computation is required for potential unit mismatches 8610 initialInUnit = elem.nodeType && 8611 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 8612 rcssNum.exec( jQuery.css( elem, prop ) ); 8613 8614 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 8615 8616 // Support: Firefox <=54 8617 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 8618 initial = initial / 2; 8619 8620 // Trust units reported by jQuery.css 8621 unit = unit || initialInUnit[ 3 ]; 8622 8623 // Iteratively approximate from a nonzero starting point 8624 initialInUnit = +initial || 1; 8625 8626 while ( maxIterations-- ) { 8627 8628 // Evaluate and update our best guess (doubling guesses that zero out). 8629 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 8630 jQuery.style( elem, prop, initialInUnit + unit ); 8631 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 8632 maxIterations = 0; 8633 } 8634 initialInUnit = initialInUnit / scale; 8635 8636 } 8637 8638 initialInUnit = initialInUnit * 2; 8639 jQuery.style( elem, prop, initialInUnit + unit ); 8640 8641 // Make sure we update the tween properties later on 8642 valueParts = valueParts || []; 8643 } 8644 8645 if ( valueParts ) { 8646 initialInUnit = +initialInUnit || +initial || 0; 8647 8648 // Apply relative offset (+=/-=) if specified 8649 adjusted = valueParts[ 1 ] ? 8650 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 8651 +valueParts[ 2 ]; 8652 if ( tween ) { 8653 tween.unit = unit; 8654 tween.start = initialInUnit; 8655 tween.end = adjusted; 8656 } 8657 } 8658 return adjusted; 8659} 8660 8661 8662var defaultDisplayMap = {}; 8663 8664function getDefaultDisplay( elem ) { 8665 var temp, 8666 doc = elem.ownerDocument, 8667 nodeName = elem.nodeName, 8668 display = defaultDisplayMap[ nodeName ]; 8669 8670 if ( display ) {
vendor: 2,317 bytes, lines 8671-8769
8671 return display; 8672 } 8673 8674 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 8675 display = jQuery.css( temp, "display" ); 8676 8677 temp.parentNode.removeChild( temp ); 8678 8679 if ( display === "none" ) { 8680 display = "block"; 8681 } 8682 defaultDisplayMap[ nodeName ] = display; 8683 8684 return display; 8685} 8686 8687function showHide( elements, show ) { 8688 var display, elem, 8689 values = [], 8690 index = 0, 8691 length = elements.length; 8692 8693 // Determine new display value for elements that need to change 8694 for ( ; index < length; index++ ) { 8695 elem = elements[ index ]; 8696 if ( !elem.style ) { 8697 continue; 8698 } 8699 8700 display = elem.style.display; 8701 if ( show ) { 8702 8703 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 8704 // check is required in this first loop unless we have a nonempty display value (either 8705 // inline or about-to-be-restored) 8706 if ( display === "none" ) { 8707 values[ index ] = dataPriv.get( elem, "display" ) || null; 8708 if ( !values[ index ] ) { 8709 elem.style.display = ""; 8710 } 8711 } 8712 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 8713 values[ index ] = getDefaultDisplay( elem ); 8714 } 8715 } else { 8716 if ( display !== "none" ) { 8717 values[ index ] = "none"; 8718 8719 // Remember what we're overwriting 8720 dataPriv.set( elem, "display", display ); 8721 } 8722 } 8723 } 8724 8725 // Set the display of the elements in a second loop to avoid constant reflow 8726 for ( index = 0; index < length; index++ ) { 8727 if ( values[ index ] != null ) { 8728 elements[ index ].style.display = values[ index ]; 8729 } 8730 } 8731 8732 return elements; 8733} 8734 8735jQuery.fn.extend( { 8736 show: function() { 8737 return showHide( this, true ); 8738 }, 8739 hide: function() { 8740 return showHide( this ); 8741 }, 8742 toggle: function( state ) { 8743 if ( typeof state === "boolean" ) { 8744 return state ? this.show() : this.hide(); 8745 } 8746 8747 return this.each( function() { 8748 if ( isHiddenWithinTree( this ) ) { 8749 jQuery( this ).show(); 8750 } else { 8751 jQuery( this ).hide(); 8752 } 8753 } ); 8754 } 8755} ); 8756var rcheckableType = ( /^(?:checkbox|radio)$/i ); 8757 8758var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 8759 8760var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 8761 8762 8763 8764( function() { 8765 var fragment = document.createDocumentFragment(), 8766 div = fragment.appendChild( document.createElement( "div" ) ), 8767 input = document.createElement( "input" ); 8768 8769 // Support: Android 4.0 - 4.3 only
vendor: 10,092 bytes, lines 8770-9154
8770 // Check state lost if the name is set (trac-11217) 8771 // Support: Windows Web Apps (WWA) 8772 // `name` and `type` must use .setAttribute for WWA (trac-14901) 8773 input.setAttribute( "type", "radio" ); 8774 input.setAttribute( "checked", "checked" ); 8775 input.setAttribute( "name", "t" ); 8776 8777 div.appendChild( input ); 8778 8779 // Support: Android <=4.1 only 8780 // Older WebKit doesn't clone checked state correctly in fragments 8781 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 8782 8783 // Support: IE <=11 only 8784 // Make sure textarea (and checkbox) defaultValue is properly cloned 8785 div.innerHTML = "<textarea>x</textarea>"; 8786 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 8787 8788 // Support: IE <=9 only 8789 // IE <=9 replaces <option> tags with their contents when inserted outside of 8790 // the select element. 8791 div.innerHTML = "<option></option>"; 8792 support.option = !!div.lastChild; 8793} )(); 8794 8795 8796// We have to close these tags to support XHTML (trac-13200) 8797var wrapMap = { 8798 8799 // XHTML parsers do not magically insert elements in the 8800 // same way that tag soup parsers do. So we cannot shorten 8801 // this by omitting <tbody> or other required elements. 8802 thead: [ 1, "<table>", "</table>" ], 8803 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 8804 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 8805 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 8806 8807 _default: [ 0, "", "" ] 8808}; 8809 8810wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 8811wrapMap.th = wrapMap.td; 8812 8813// Support: IE <=9 only 8814if ( !support.option ) { 8815 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 8816} 8817 8818 8819function getAll( context, tag ) { 8820 8821 // Support: IE <=9 - 11 only 8822 // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) 8823 var ret; 8824 8825 if ( typeof context.getElementsByTagName !== "undefined" ) { 8826 ret = context.getElementsByTagName( tag || "*" ); 8827 8828 } else if ( typeof context.querySelectorAll !== "undefined" ) { 8829 ret = context.querySelectorAll( tag || "*" ); 8830 8831 } else { 8832 ret = []; 8833 } 8834 8835 if ( tag === undefined || tag && nodeName( context, tag ) ) { 8836 return jQuery.merge( [ context ], ret ); 8837 } 8838 8839 return ret; 8840} 8841 8842 8843// Mark scripts as having already been evaluated 8844function setGlobalEval( elems, refElements ) { 8845 var i = 0, 8846 l = elems.length; 8847 8848 for ( ; i < l; i++ ) { 8849 dataPriv.set( 8850 elems[ i ], 8851 "globalEval", 8852 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 8853 ); 8854 } 8855} 8856 8857 8858var rhtml = /<|&#?\w+;/; 8859 8860function buildFragment( elems, context, scripts, selection, ignored ) { 8861 var elem, tmp, tag, wrap, attached, j, 8862 fragment = context.createDocumentFragment(), 8863 nodes = [], 8864 i = 0, 8865 l = elems.length; 8866 8867 for ( ; i < l; i++ ) { 8868 elem = elems[ i ]; 8869 8870 if ( elem || elem === 0 ) { 8871 8872 // Add nodes directly 8873 if ( toType( elem ) === "object" ) { 8874 8875 // Support: Android <=4.0 only, PhantomJS 1 only 8876 // push.apply(_, arraylike) throws on ancient WebKit 8877 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 8878 8879 // Convert non-html into a text node 8880 } else if ( !rhtml.test( elem ) ) { 8881 nodes.push( context.createTextNode( elem ) ); 8882 8883 // Convert html into DOM nodes 8884 } else { 8885 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 8886 8887 // Deserialize a standard representation 8888 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 8889 wrap = wrapMap[ tag ] || wrapMap._default; 8890 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 8891 8892 // Descend through wrappers to the right content 8893 j = wrap[ 0 ]; 8894 while ( j-- ) { 8895 tmp = tmp.lastChild; 8896 } 8897 8898 // Support: Android <=4.0 only, PhantomJS 1 only 8899 // push.apply(_, arraylike) throws on ancient WebKit 8900 jQuery.merge( nodes, tmp.childNodes ); 8901 8902 // Remember the top-level container 8903 tmp = fragment.firstChild; 8904 8905 // Ensure the created nodes are orphaned (trac-12392) 8906 tmp.textContent = ""; 8907 } 8908 } 8909 } 8910 8911 // Remove wrapper from fragment 8912 fragment.textContent = ""; 8913 8914 i = 0; 8915 while ( ( elem = nodes[ i++ ] ) ) { 8916 8917 // Skip elements already in the context collection (trac-4087) 8918 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 8919 if ( ignored ) { 8920 ignored.push( elem ); 8921 } 8922 continue; 8923 } 8924 8925 attached = isAttached( elem ); 8926 8927 // Append to fragment 8928 tmp = getAll( fragment.appendChild( elem ), "script" ); 8929 8930 // Preserve script evaluation history 8931 if ( attached ) { 8932 setGlobalEval( tmp ); 8933 } 8934 8935 // Capture executables 8936 if ( scripts ) { 8937 j = 0; 8938 while ( ( elem = tmp[ j++ ] ) ) { 8939 if ( rscriptType.test( elem.type || "" ) ) { 8940 scripts.push( elem ); 8941 } 8942 } 8943 } 8944 } 8945 8946 return fragment; 8947} 8948 8949 8950var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 8951 8952function returnTrue() { 8953 return true; 8954} 8955 8956function returnFalse() { 8957 return false; 8958} 8959 8960function on( elem, types, selector, data, fn, one ) { 8961 var origFn, type; 8962 8963 // Types can be a map of types/handlers 8964 if ( typeof types === "object" ) { 8965 8966 // ( types-Object, selector, data ) 8967 if ( typeof selector !== "string" ) { 8968 8969 // ( types-Object, data ) 8970 data = data || selector; 8971 selector = undefined; 8972 } 8973 for ( type in types ) { 8974 on( elem, type, selector, data, types[ type ], one ); 8975 } 8976 return elem; 8977 } 8978 8979 if ( data == null && fn == null ) { 8980 8981 // ( types, fn ) 8982 fn = selector; 8983 data = selector = undefined; 8984 } else if ( fn == null ) { 8985 if ( typeof selector === "string" ) { 8986 8987 // ( types, selector, fn ) 8988 fn = data; 8989 data = undefined; 8990 } else { 8991 8992 // ( types, data, fn ) 8993 fn = data; 8994 data = selector; 8995 selector = undefined; 8996 } 8997 } 8998 if ( fn === false ) { 8999 fn = returnFalse; 9000 } else if ( !fn ) { 9001 return elem; 9002 } 9003 9004 if ( one === 1 ) { 9005 origFn = fn; 9006 fn = function( event ) { 9007 9008 // Can use an empty set, since event contains the info 9009 jQuery().off( event ); 9010 return origFn.apply( this, arguments ); 9011 }; 9012 9013 // Use same guid so caller can remove using origFn 9014 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 9015 } 9016 return elem.each( function() { 9017 jQuery.event.add( this, types, fn, data, selector ); 9018 } ); 9019} 9020 9021/* 9022 * Helper functions for managing events -- not part of the public interface. 9023 * Props to Dean Edwards' addEvent library for many of the ideas. 9024 */ 9025jQuery.event = { 9026 9027 global: {}, 9028 9029 add: function( elem, types, handler, data, selector ) { 9030 9031 var handleObjIn, eventHandle, tmp, 9032 events, t, handleObj, 9033 special, handlers, type, namespaces, origType, 9034 elemData = dataPriv.get( elem ); 9035 9036 // Only attach events to objects that accept data 9037 if ( !acceptData( elem ) ) { 9038 return; 9039 } 9040 9041 // Caller can pass in an object of custom data in lieu of the handler 9042 if ( handler.handler ) { 9043 handleObjIn = handler; 9044 handler = handleObjIn.handler; 9045 selector = handleObjIn.selector; 9046 } 9047 9048 // Ensure that invalid selectors throw exceptions at attach time 9049 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 9050 if ( selector ) { 9051 jQuery.find.matchesSelector( documentElement, selector ); 9052 } 9053 9054 // Make sure that the handler has a unique ID, used to find/remove it later 9055 if ( !handler.guid ) { 9056 handler.guid = jQuery.guid++; 9057 } 9058 9059 // Init the element's event structure and main handler, if this is the first 9060 if ( !( events = elemData.events ) ) { 9061 events = elemData.events = Object.create( null ); 9062 } 9063 if ( !( eventHandle = elemData.handle ) ) { 9064 eventHandle = elemData.handle = function( e ) { 9065 9066 // Discard the second event of a jQuery.event.trigger() and 9067 // when an event is called after a page has unloaded 9068 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 9069 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 9070 }; 9071 } 9072 9073 // Handle multiple events separated by a space 9074 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 9075 t = types.length; 9076 while ( t-- ) { 9077 tmp = rtypenamespace.exec( types[ t ] ) || []; 9078 type = origType = tmp[ 1 ]; 9079 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 9080 9081 // There *must* be a type, no attaching namespace-only handlers 9082 if ( !type ) { 9083 continue; 9084 } 9085 9086 // If event changes its type, use the special event handlers for the changed type 9087 special = jQuery.event.special[ type ] || {}; 9088 9089 // If selector defined, determine special event api type, otherwise given type 9090 type = ( selector ? special.delegateType : special.bindType ) || type; 9091 9092 // Update special based on newly reset type 9093 special = jQuery.event.special[ type ] || {}; 9094 9095 // handleObj is passed to all event handlers 9096 handleObj = jQuery.extend( { 9097 type: type, 9098 origType: origType, 9099 data: data, 9100 handler: handler, 9101 guid: handler.guid, 9102 selector: selector, 9103 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 9104 namespace: namespaces.join( "." ) 9105 }, handleObjIn ); 9106 9107 // Init the event handler queue if we're the first 9108 if ( !( handlers = events[ type ] ) ) { 9109 handlers = events[ type ] = []; 9110 handlers.delegateCount = 0; 9111 9112 // Only use addEventListener if the special events handler returns false 9113 if ( !special.setup || 9114 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 9115 9116 if ( elem.addEventListener ) { 9117 elem.addEventListener( type, eventHandle ); 9118 } 9119 } 9120 } 9121 9122 if ( special.add ) { 9123 special.add.call( elem, handleObj ); 9124 9125 if ( !handleObj.handler.guid ) { 9126 handleObj.handler.guid = handler.guid; 9127 } 9128 } 9129 9130 // Add to the element's handler list, delegates in front 9131 if ( selector ) { 9132 handlers.splice( handlers.delegateCount++, 0, handleObj ); 9133 } else { 9134 handlers.push( handleObj ); 9135 } 9136 9137 // Keep track of which events have ever been used, for event optimization 9138 jQuery.event.global[ type ] = true; 9139 } 9140 9141 }, 9142 9143 // Detach an event or set of events from an element 9144 remove: function( elem, types, handler, selector, mappedTypes ) { 9145 9146 var j, origCount, tmp, 9147 events, t, handleObj, 9148 special, handlers, type, namespaces, origType, 9149 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 9150 9151 if ( !elemData || !( events = elemData.events ) ) { 9152 return; 9153 } 9154
vendor: 4,197 bytes, lines 9155-9293
9155 // Once for each type.namespace in types; type may be omitted 9156 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 9157 t = types.length; 9158 while ( t-- ) { 9159 tmp = rtypenamespace.exec( types[ t ] ) || []; 9160 type = origType = tmp[ 1 ]; 9161 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 9162 9163 // Unbind all events (on this namespace, if provided) for the element 9164 if ( !type ) { 9165 for ( type in events ) { 9166 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 9167 } 9168 continue; 9169 } 9170 9171 special = jQuery.event.special[ type ] || {}; 9172 type = ( selector ? special.delegateType : special.bindType ) || type; 9173 handlers = events[ type ] || []; 9174 tmp = tmp[ 2 ] && 9175 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 9176 9177 // Remove matching events 9178 origCount = j = handlers.length; 9179 while ( j-- ) { 9180 handleObj = handlers[ j ]; 9181 9182 if ( ( mappedTypes || origType === handleObj.origType ) && 9183 ( !handler || handler.guid === handleObj.guid ) && 9184 ( !tmp || tmp.test( handleObj.namespace ) ) && 9185 ( !selector || selector === handleObj.selector || 9186 selector === "**" && handleObj.selector ) ) { 9187 handlers.splice( j, 1 ); 9188 9189 if ( handleObj.selector ) { 9190 handlers.delegateCount--; 9191 } 9192 if ( special.remove ) { 9193 special.remove.call( elem, handleObj ); 9194 } 9195 } 9196 } 9197 9198 // Remove generic event handler if we removed something and no more handlers exist 9199 // (avoids potential for endless recursion during removal of special event handlers) 9200 if ( origCount && !handlers.length ) { 9201 if ( !special.teardown || 9202 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 9203 9204 jQuery.removeEvent( elem, type, elemData.handle ); 9205 } 9206 9207 delete events[ type ]; 9208 } 9209 } 9210 9211 // Remove data and the expando if it's no longer used 9212 if ( jQuery.isEmptyObject( events ) ) { 9213 dataPriv.remove( elem, "handle events" ); 9214 } 9215 }, 9216 9217 dispatch: function( nativeEvent ) { 9218 9219 var i, j, ret, matched, handleObj, handlerQueue, 9220 args = new Array( arguments.length ), 9221 9222 // Make a writable jQuery.Event from the native event object 9223 event = jQuery.event.fix( nativeEvent ), 9224 9225 handlers = ( 9226 dataPriv.get( this, "events" ) || Object.create( null ) 9227 )[ event.type ] || [], 9228 special = jQuery.event.special[ event.type ] || {}; 9229 9230 // Use the fix-ed jQuery.Event rather than the (read-only) native event 9231 args[ 0 ] = event; 9232 9233 for ( i = 1; i < arguments.length; i++ ) { 9234 args[ i ] = arguments[ i ]; 9235 } 9236 9237 event.delegateTarget = this; 9238 9239 // Call the preDispatch hook for the mapped type, and let it bail if desired 9240 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 9241 return; 9242 } 9243 9244 // Determine handlers 9245 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 9246 9247 // Run delegates first; they may want to stop propagation beneath us 9248 i = 0; 9249 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 9250 event.currentTarget = matched.elem; 9251 9252 j = 0; 9253 while ( ( handleObj = matched.handlers[ j++ ] ) && 9254 !event.isImmediatePropagationStopped() ) { 9255 9256 // If the event is namespaced, then each handler is only invoked if it is 9257 // specially universal or its namespaces are a superset of the event's. 9258 if ( !event.rnamespace || handleObj.namespace === false || 9259 event.rnamespace.test( handleObj.namespace ) ) { 9260 9261 event.handleObj = handleObj; 9262 event.data = handleObj.data; 9263 9264 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 9265 handleObj.handler ).apply( matched.elem, args ); 9266 9267 if ( ret !== undefined ) { 9268 if ( ( event.result = ret ) === false ) { 9269 event.preventDefault(); 9270 event.stopPropagation(); 9271 } 9272 } 9273 } 9274 } 9275 } 9276 9277 // Call the postDispatch hook for the mapped type 9278 if ( special.postDispatch ) { 9279 special.postDispatch.call( this, event ); 9280 } 9281 9282 return event.result; 9283 }, 9284 9285 handlers: function( event, handlers ) { 9286 var i, handleObj, sel, matchedHandlers, matchedSelectors, 9287 handlerQueue = [], 9288 delegateCount = handlers.delegateCount, 9289 cur = event.target; 9290 9291 // Find delegate handlers 9292 if ( delegateCount && 9293
vendor: 19,034 bytes, lines 9294-9940
9294 // Support: IE <=9 9295 // Black-hole SVG <use> instance trees (trac-13180) 9296 cur.nodeType && 9297 9298 // Support: Firefox <=42 9299 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 9300 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 9301 // Support: IE 11 only 9302 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 9303 !( event.type === "click" && event.button >= 1 ) ) { 9304 9305 for ( ; cur !== this; cur = cur.parentNode || this ) { 9306 9307 // Don't check non-elements (trac-13208) 9308 // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764) 9309 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 9310 matchedHandlers = []; 9311 matchedSelectors = {}; 9312 for ( i = 0; i < delegateCount; i++ ) { 9313 handleObj = handlers[ i ]; 9314 9315 // Don't conflict with Object.prototype properties (trac-13203) 9316 sel = handleObj.selector + " "; 9317 9318 if ( matchedSelectors[ sel ] === undefined ) { 9319 matchedSelectors[ sel ] = handleObj.needsContext ? 9320 jQuery( sel, this ).index( cur ) > -1 : 9321 jQuery.find( sel, this, null, [ cur ] ).length; 9322 } 9323 if ( matchedSelectors[ sel ] ) { 9324 matchedHandlers.push( handleObj ); 9325 } 9326 } 9327 if ( matchedHandlers.length ) { 9328 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 9329 } 9330 } 9331 } 9332 } 9333 9334 // Add the remaining (directly-bound) handlers 9335 cur = this; 9336 if ( delegateCount < handlers.length ) { 9337 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 9338 } 9339 9340 return handlerQueue; 9341 }, 9342 9343 addProp: function( name, hook ) { 9344 Object.defineProperty( jQuery.Event.prototype, name, { 9345 enumerable: true, 9346 configurable: true, 9347 9348 get: isFunction( hook ) ? 9349 function() { 9350 if ( this.originalEvent ) { 9351 return hook( this.originalEvent ); 9352 } 9353 } : 9354 function() { 9355 if ( this.originalEvent ) { 9356 return this.originalEvent[ name ]; 9357 } 9358 }, 9359 9360 set: function( value ) { 9361 Object.defineProperty( this, name, { 9362 enumerable: true, 9363 configurable: true, 9364 writable: true, 9365 value: value 9366 } ); 9367 } 9368 } ); 9369 }, 9370 9371 fix: function( originalEvent ) { 9372 return originalEvent[ jQuery.expando ] ? 9373 originalEvent : 9374 new jQuery.Event( originalEvent ); 9375 }, 9376 9377 special: { 9378 load: { 9379 9380 // Prevent triggered image.load events from bubbling to window.load 9381 noBubble: true 9382 }, 9383 click: { 9384 9385 // Utilize native event to ensure correct state for checkable inputs 9386 setup: function( data ) { 9387 9388 // For mutual compressibility with _default, replace `this` access with a local var. 9389 // `|| data` is dead code meant only to preserve the variable through minification. 9390 var el = this || data; 9391 9392 // Claim the first handler 9393 if ( rcheckableType.test( el.type ) && 9394 el.click && nodeName( el, "input" ) ) { 9395 9396 // dataPriv.set( el, "click", ... ) 9397 leverageNative( el, "click", true ); 9398 } 9399 9400 // Return false to allow normal processing in the caller 9401 return false; 9402 }, 9403 trigger: function( data ) { 9404 9405 // For mutual compressibility with _default, replace `this` access with a local var. 9406 // `|| data` is dead code meant only to preserve the variable through minification. 9407 var el = this || data; 9408 9409 // Force setup before triggering a click 9410 if ( rcheckableType.test( el.type ) && 9411 el.click && nodeName( el, "input" ) ) { 9412 9413 leverageNative( el, "click" ); 9414 } 9415 9416 // Return non-false to allow normal event-path propagation 9417 return true; 9418 }, 9419 9420 // For cross-browser consistency, suppress native .click() on links 9421 // Also prevent it if we're currently inside a leveraged native-event stack 9422 _default: function( event ) { 9423 var target = event.target; 9424 return rcheckableType.test( target.type ) && 9425 target.click && nodeName( target, "input" ) && 9426 dataPriv.get( target, "click" ) || 9427 nodeName( target, "a" ); 9428 } 9429 }, 9430 9431 beforeunload: { 9432 postDispatch: function( event ) { 9433 9434 // Support: Firefox 20+ 9435 // Firefox doesn't alert if the returnValue field is not set. 9436 if ( event.result !== undefined && event.originalEvent ) { 9437 event.originalEvent.returnValue = event.result; 9438 } 9439 } 9440 } 9441 } 9442}; 9443 9444// Ensure the presence of an event listener that handles manually-triggered 9445// synthetic events by interrupting progress until reinvoked in response to 9446// *native* events that it fires directly, ensuring that state changes have 9447// already occurred before other listeners are invoked. 9448function leverageNative( el, type, isSetup ) { 9449 9450 // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add 9451 if ( !isSetup ) { 9452 if ( dataPriv.get( el, type ) === undefined ) { 9453 jQuery.event.add( el, type, returnTrue ); 9454 } 9455 return; 9456 } 9457 9458 // Register the controller as a special universal handler for all event namespaces 9459 dataPriv.set( el, type, false ); 9460 jQuery.event.add( el, type, { 9461 namespace: false, 9462 handler: function( event ) { 9463 var result, 9464 saved = dataPriv.get( this, type ); 9465 9466 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 9467 9468 // Interrupt processing of the outer synthetic .trigger()ed event 9469 if ( !saved ) { 9470 9471 // Store arguments for use when handling the inner native event 9472 // There will always be at least one argument (an event object), so this array 9473 // will not be confused with a leftover capture object. 9474 saved = slice.call( arguments ); 9475 dataPriv.set( this, type, saved ); 9476 9477 // Trigger the native event and capture its result 9478 this[ type ](); 9479 result = dataPriv.get( this, type ); 9480 dataPriv.set( this, type, false ); 9481 9482 if ( saved !== result ) { 9483 9484 // Cancel the outer synthetic event 9485 event.stopImmediatePropagation(); 9486 event.preventDefault(); 9487 9488 return result; 9489 } 9490 9491 // If this is an inner synthetic event for an event with a bubbling surrogate 9492 // (focus or blur), assume that the surrogate already propagated from triggering 9493 // the native event and prevent that from happening again here. 9494 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 9495 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 9496 // less bad than duplication. 9497 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 9498 event.stopPropagation(); 9499 } 9500 9501 // If this is a native event triggered above, everything is now in order 9502 // Fire an inner synthetic event with the original arguments 9503 } else if ( saved ) { 9504 9505 // ...and capture the result 9506 dataPriv.set( this, type, jQuery.event.trigger( 9507 saved[ 0 ], 9508 saved.slice( 1 ), 9509 this 9510 ) ); 9511 9512 // Abort handling of the native event by all jQuery handlers while allowing 9513 // native handlers on the same element to run. On target, this is achieved 9514 // by stopping immediate propagation just on the jQuery event. However, 9515 // the native event is re-wrapped by a jQuery one on each level of the 9516 // propagation so the only way to stop it for jQuery is to stop it for 9517 // everyone via native `stopPropagation()`. This is not a problem for 9518 // focus/blur which don't bubble, but it does also stop click on checkboxes 9519 // and radios. We accept this limitation. 9520 event.stopPropagation(); 9521 event.isImmediatePropagationStopped = returnTrue; 9522 } 9523 } 9524 } ); 9525} 9526 9527jQuery.removeEvent = function( elem, type, handle ) { 9528 9529 // This "if" is needed for plain objects 9530 if ( elem.removeEventListener ) { 9531 elem.removeEventListener( type, handle ); 9532 } 9533}; 9534 9535jQuery.Event = function( src, props ) { 9536 9537 // Allow instantiation without the 'new' keyword 9538 if ( !( this instanceof jQuery.Event ) ) { 9539 return new jQuery.Event( src, props ); 9540 } 9541 9542 // Event object 9543 if ( src && src.type ) { 9544 this.originalEvent = src; 9545 this.type = src.type; 9546 9547 // Events bubbling up the document may have been marked as prevented 9548 // by a handler lower down the tree; reflect the correct value. 9549 this.isDefaultPrevented = src.defaultPrevented || 9550 src.defaultPrevented === undefined && 9551 9552 // Support: Android <=2.3 only 9553 src.returnValue === false ? 9554 returnTrue : 9555 returnFalse; 9556 9557 // Create target properties 9558 // Support: Safari <=6 - 7 only 9559 // Target should not be a text node (trac-504, trac-13143) 9560 this.target = ( src.target && src.target.nodeType === 3 ) ? 9561 src.target.parentNode : 9562 src.target; 9563 9564 this.currentTarget = src.currentTarget; 9565 this.relatedTarget = src.relatedTarget; 9566 9567 // Event type 9568 } else { 9569 this.type = src; 9570 } 9571 9572 // Put explicitly provided properties onto the event object 9573 if ( props ) { 9574 jQuery.extend( this, props ); 9575 } 9576 9577 // Create a timestamp if incoming event doesn't have one 9578 this.timeStamp = src && src.timeStamp || Date.now(); 9579 9580 // Mark it as fixed 9581 this[ jQuery.expando ] = true; 9582}; 9583 9584// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 9585// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 9586jQuery.Event.prototype = { 9587 constructor: jQuery.Event, 9588 isDefaultPrevented: returnFalse, 9589 isPropagationStopped: returnFalse, 9590 isImmediatePropagationStopped: returnFalse, 9591 isSimulated: false, 9592 9593 preventDefault: function() { 9594 var e = this.originalEvent; 9595 9596 this.isDefaultPrevented = returnTrue; 9597 9598 if ( e && !this.isSimulated ) { 9599 e.preventDefault(); 9600 } 9601 }, 9602 stopPropagation: function() { 9603 var e = this.originalEvent; 9604 9605 this.isPropagationStopped = returnTrue; 9606 9607 if ( e && !this.isSimulated ) { 9608 e.stopPropagation(); 9609 } 9610 }, 9611 stopImmediatePropagation: function() { 9612 var e = this.originalEvent; 9613 9614 this.isImmediatePropagationStopped = returnTrue; 9615 9616 if ( e && !this.isSimulated ) { 9617 e.stopImmediatePropagation(); 9618 } 9619 9620 this.stopPropagation(); 9621 } 9622}; 9623 9624// Includes all common event props including KeyEvent and MouseEvent specific props 9625jQuery.each( { 9626 altKey: true, 9627 bubbles: true, 9628 cancelable: true, 9629 changedTouches: true, 9630 ctrlKey: true, 9631 detail: true, 9632 eventPhase: true, 9633 metaKey: true, 9634 pageX: true, 9635 pageY: true, 9636 shiftKey: true, 9637 view: true, 9638 "char": true, 9639 code: true, 9640 charCode: true, 9641 key: true, 9642 keyCode: true, 9643 button: true, 9644 buttons: true, 9645 clientX: true, 9646 clientY: true, 9647 offsetX: true, 9648 offsetY: true, 9649 pointerId: true, 9650 pointerType: true, 9651 screenX: true, 9652 screenY: true, 9653 targetTouches: true, 9654 toElement: true, 9655 touches: true, 9656 which: true 9657}, jQuery.event.addProp ); 9658 9659jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 9660 9661 function focusMappedHandler( nativeEvent ) { 9662 if ( document.documentMode ) { 9663 9664 // Support: IE 11+ 9665 // Attach a single focusin/focusout handler on the document while someone wants 9666 // focus/blur. This is because the former are synchronous in IE while the latter 9667 // are async. In other browsers, all those handlers are invoked synchronously. 9668 9669 // `handle` from private data would already wrap the event, but we need 9670 // to change the `type` here. 9671 var handle = dataPriv.get( this, "handle" ), 9672 event = jQuery.event.fix( nativeEvent ); 9673 event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; 9674 event.isSimulated = true; 9675 9676 // First, handle focusin/focusout 9677 handle( nativeEvent ); 9678 9679 // ...then, handle focus/blur 9680 // 9681 // focus/blur don't bubble while focusin/focusout do; simulate the former by only 9682 // invoking the handler at the lower level. 9683 if ( event.target === event.currentTarget ) { 9684 9685 // The setup part calls `leverageNative`, which, in turn, calls 9686 // `jQuery.event.add`, so event handle will already have been set 9687 // by this point. 9688 handle( event ); 9689 } 9690 } else { 9691 9692 // For non-IE browsers, attach a single capturing handler on the document 9693 // while someone wants focusin/focusout. 9694 jQuery.event.simulate( delegateType, nativeEvent.target, 9695 jQuery.event.fix( nativeEvent ) ); 9696 } 9697 } 9698 9699 jQuery.event.special[ type ] = { 9700 9701 // Utilize native event if possible so blur/focus sequence is correct 9702 setup: function() { 9703 9704 var attaches; 9705 9706 // Claim the first handler 9707 // dataPriv.set( this, "focus", ... ) 9708 // dataPriv.set( this, "blur", ... ) 9709 leverageNative( this, type, true ); 9710 9711 if ( document.documentMode ) { 9712 9713 // Support: IE 9 - 11+ 9714 // We use the same native handler for focusin & focus (and focusout & blur) 9715 // so we need to coordinate setup & teardown parts between those events. 9716 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 9717 attaches = dataPriv.get( this, delegateType ); 9718 if ( !attaches ) { 9719 this.addEventListener( delegateType, focusMappedHandler ); 9720 } 9721 dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 ); 9722 } else { 9723 9724 // Return false to allow normal processing in the caller 9725 return false; 9726 } 9727 }, 9728 trigger: function() { 9729 9730 // Force setup before trigger 9731 leverageNative( this, type ); 9732 9733 // Return non-false to allow normal event-path propagation 9734 return true; 9735 }, 9736 9737 teardown: function() { 9738 var attaches; 9739 9740 if ( document.documentMode ) { 9741 attaches = dataPriv.get( this, delegateType ) - 1; 9742 if ( !attaches ) { 9743 this.removeEventListener( delegateType, focusMappedHandler ); 9744 dataPriv.remove( this, delegateType ); 9745 } else { 9746 dataPriv.set( this, delegateType, attaches ); 9747 } 9748 } else { 9749 9750 // Return false to indicate standard teardown should be applied 9751 return false; 9752 } 9753 }, 9754 9755 // Suppress native focus or blur if we're currently inside 9756 // a leveraged native-event stack 9757 _default: function( event ) { 9758 return dataPriv.get( event.target, type ); 9759 }, 9760 9761 delegateType: delegateType 9762 }; 9763 9764 // Support: Firefox <=44 9765 // Firefox doesn't have focus(in | out) events 9766 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 9767 // 9768 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 9769 // focus(in | out) events fire after focus & blur events, 9770 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 9771 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 9772 // 9773 // Support: IE 9 - 11+ 9774 // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, 9775 // attach a single handler for both events in IE. 9776 jQuery.event.special[ delegateType ] = { 9777 setup: function() { 9778 9779 // Handle: regular nodes (via `this.ownerDocument`), window 9780 // (via `this.document`) & document (via `this`). 9781 var doc = this.ownerDocument || this.document || this, 9782 dataHolder = document.documentMode ? this : doc, 9783 attaches = dataPriv.get( dataHolder, delegateType ); 9784 9785 // Support: IE 9 - 11+ 9786 // We use the same native handler for focusin & focus (and focusout & blur) 9787 // so we need to coordinate setup & teardown parts between those events. 9788 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 9789 if ( !attaches ) { 9790 if ( document.documentMode ) { 9791 this.addEventListener( delegateType, focusMappedHandler ); 9792 } else { 9793 doc.addEventListener( type, focusMappedHandler, true ); 9794 } 9795 } 9796 dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 ); 9797 }, 9798 teardown: function() { 9799 var doc = this.ownerDocument || this.document || this, 9800 dataHolder = document.documentMode ? this : doc, 9801 attaches = dataPriv.get( dataHolder, delegateType ) - 1; 9802 9803 if ( !attaches ) { 9804 if ( document.documentMode ) { 9805 this.removeEventListener( delegateType, focusMappedHandler ); 9806 } else { 9807 doc.removeEventListener( type, focusMappedHandler, true ); 9808 } 9809 dataPriv.remove( dataHolder, delegateType ); 9810 } else { 9811 dataPriv.set( dataHolder, delegateType, attaches ); 9812 } 9813 } 9814 }; 9815} ); 9816 9817// Create mouseenter/leave events using mouseover/out and event-time checks 9818// so that event delegation works in jQuery. 9819// Do the same for pointerenter/pointerleave and pointerover/pointerout 9820// 9821// Support: Safari 7 only 9822// Safari sends mouseenter too often; see: 9823// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 9824// for the description of the bug (it existed in older Chrome versions as well). 9825jQuery.each( { 9826 mouseenter: "mouseover", 9827 mouseleave: "mouseout", 9828 pointerenter: "pointerover", 9829 pointerleave: "pointerout" 9830}, function( orig, fix ) { 9831 jQuery.event.special[ orig ] = { 9832 delegateType: fix, 9833 bindType: fix, 9834 9835 handle: function( event ) { 9836 var ret, 9837 target = this, 9838 related = event.relatedTarget, 9839 handleObj = event.handleObj; 9840 9841 // For mouseenter/leave call the handler if related is outside the target. 9842 // NB: No relatedTarget if the mouse left/entered the browser window 9843 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 9844 event.type = handleObj.origType; 9845 ret = handleObj.handler.apply( this, arguments ); 9846 event.type = fix; 9847 } 9848 return ret; 9849 } 9850 }; 9851} ); 9852 9853jQuery.fn.extend( { 9854 9855 on: function( types, selector, data, fn ) { 9856 return on( this, types, selector, data, fn ); 9857 }, 9858 one: function( types, selector, data, fn ) { 9859 return on( this, types, selector, data, fn, 1 ); 9860 }, 9861 off: function( types, selector, fn ) { 9862 var handleObj, type; 9863 if ( types && types.preventDefault && types.handleObj ) { 9864 9865 // ( event ) dispatched jQuery.Event 9866 handleObj = types.handleObj; 9867 jQuery( types.delegateTarget ).off( 9868 handleObj.namespace ? 9869 handleObj.origType + "." + handleObj.namespace : 9870 handleObj.origType, 9871 handleObj.selector, 9872 handleObj.handler 9873 ); 9874 return this; 9875 } 9876 if ( typeof types === "object" ) { 9877 9878 // ( types-object [, selector] ) 9879 for ( type in types ) { 9880 this.off( type, selector, types[ type ] ); 9881 } 9882 return this; 9883 } 9884 if ( selector === false || typeof selector === "function" ) { 9885 9886 // ( types [, fn] ) 9887 fn = selector; 9888 selector = undefined; 9889 } 9890 if ( fn === false ) { 9891 fn = returnFalse; 9892 } 9893 return this.each( function() { 9894 jQuery.event.remove( this, types, fn, selector ); 9895 } ); 9896 } 9897} ); 9898 9899 9900var 9901 9902 // Support: IE <=10 - 11, Edge 12 - 13 only 9903 // In IE/Edge using regex groups here causes severe slowdowns. 9904 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 9905 rnoInnerhtml = /<script|<style|<link/i, 9906 9907 // checked="checked" or checked 9908 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 9909 9910 rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g; 9911 9912// Prefer a tbody over its parent table for containing new rows 9913function manipulationTarget( elem, content ) { 9914 if ( nodeName( elem, "table" ) && 9915 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 9916 9917 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 9918 } 9919 9920 return elem; 9921} 9922 9923// Replace/restore the type attribute of script elements for safe DOM manipulation 9924function disableScript( elem ) { 9925 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 9926 return elem; 9927} 9928function restoreScript( elem ) { 9929 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 9930 elem.type = elem.type.slice( 5 ); 9931 } else { 9932 elem.removeAttribute( "type" ); 9933 } 9934 9935 return elem; 9936} 9937 9938function cloneCopyEvent( src, dest ) { 9939 var i, l, type, pdataOld, udataOld, udataCur, events; 9940
vendor: 6,382 bytes, lines 9941-10170
9941 if ( dest.nodeType !== 1 ) { 9942 return; 9943 } 9944 9945 // 1. Copy private data: events, handlers, etc. 9946 if ( dataPriv.hasData( src ) ) { 9947 pdataOld = dataPriv.get( src ); 9948 events = pdataOld.events; 9949 9950 if ( events ) { 9951 dataPriv.remove( dest, "handle events" ); 9952 9953 for ( type in events ) { 9954 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 9955 jQuery.event.add( dest, type, events[ type ][ i ] ); 9956 } 9957 } 9958 } 9959 } 9960 9961 // 2. Copy user data 9962 if ( dataUser.hasData( src ) ) { 9963 udataOld = dataUser.access( src ); 9964 udataCur = jQuery.extend( {}, udataOld ); 9965 9966 dataUser.set( dest, udataCur ); 9967 } 9968} 9969 9970// Fix IE bugs, see support tests 9971function fixInput( src, dest ) { 9972 var nodeName = dest.nodeName.toLowerCase(); 9973 9974 // Fails to persist the checked state of a cloned checkbox or radio button. 9975 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 9976 dest.checked = src.checked; 9977 9978 // Fails to return the selected option to the default selected state when cloning options 9979 } else if ( nodeName === "input" || nodeName === "textarea" ) { 9980 dest.defaultValue = src.defaultValue; 9981 } 9982} 9983 9984function domManip( collection, args, callback, ignored ) { 9985 9986 // Flatten any nested arrays 9987 args = flat( args ); 9988 9989 var fragment, first, scripts, hasScripts, node, doc, 9990 i = 0, 9991 l = collection.length, 9992 iNoClone = l - 1, 9993 value = args[ 0 ], 9994 valueIsFunction = isFunction( value ); 9995 9996 // We can't cloneNode fragments that contain checked, in WebKit 9997 if ( valueIsFunction || 9998 ( l > 1 && typeof value === "string" && 9999 !support.checkClone && rchecked.test( value ) ) ) { 10000 return collection.each( function( index ) { 10001 var self = collection.eq( index ); 10002 if ( valueIsFunction ) { 10003 args[ 0 ] = value.call( this, index, self.html() ); 10004 } 10005 domManip( self, args, callback, ignored ); 10006 } ); 10007 } 10008 10009 if ( l ) { 10010 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 10011 first = fragment.firstChild; 10012 10013 if ( fragment.childNodes.length === 1 ) { 10014 fragment = first; 10015 } 10016 10017 // Require either new content or an interest in ignored elements to invoke the callback 10018 if ( first || ignored ) { 10019 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 10020 hasScripts = scripts.length; 10021 10022 // Use the original fragment for the last item 10023 // instead of the first because it can end up 10024 // being emptied incorrectly in certain situations (trac-8070). 10025 for ( ; i < l; i++ ) { 10026 node = fragment; 10027 10028 if ( i !== iNoClone ) { 10029 node = jQuery.clone( node, true, true ); 10030 10031 // Keep references to cloned scripts for later restoration 10032 if ( hasScripts ) { 10033 10034 // Support: Android <=4.0 only, PhantomJS 1 only 10035 // push.apply(_, arraylike) throws on ancient WebKit 10036 jQuery.merge( scripts, getAll( node, "script" ) ); 10037 } 10038 } 10039 10040 callback.call( collection[ i ], node, i ); 10041 } 10042 10043 if ( hasScripts ) { 10044 doc = scripts[ scripts.length - 1 ].ownerDocument; 10045 10046 // Re-enable scripts 10047 jQuery.map( scripts, restoreScript ); 10048 10049 // Evaluate executable scripts on first document insertion 10050 for ( i = 0; i < hasScripts; i++ ) { 10051 node = scripts[ i ]; 10052 if ( rscriptType.test( node.type || "" ) && 10053 !dataPriv.access( node, "globalEval" ) && 10054 jQuery.contains( doc, node ) ) { 10055 10056 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 10057 10058 // Optional AJAX dependency, but won't run scripts if not present 10059 if ( jQuery._evalUrl && !node.noModule ) { 10060 jQuery._evalUrl( node.src, { 10061 nonce: node.nonce || node.getAttribute( "nonce" ) 10062 }, doc ); 10063 } 10064 } else { 10065 10066 // Unwrap a CDATA section containing script contents. This shouldn't be 10067 // needed as in XML documents they're already not visible when 10068 // inspecting element contents and in HTML documents they have no 10069 // meaning but we're preserving that logic for backwards compatibility. 10070 // This will be removed completely in 4.0. See gh-4904. 10071 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 10072 } 10073 } 10074 } 10075 } 10076 } 10077 } 10078 10079 return collection; 10080} 10081 10082function remove( elem, selector, keepData ) { 10083 var node, 10084 nodes = selector ? jQuery.filter( selector, elem ) : elem, 10085 i = 0; 10086 10087 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 10088 if ( !keepData && node.nodeType === 1 ) { 10089 jQuery.cleanData( getAll( node ) ); 10090 } 10091 10092 if ( node.parentNode ) { 10093 if ( keepData && isAttached( node ) ) { 10094 setGlobalEval( getAll( node, "script" ) ); 10095 } 10096 node.parentNode.removeChild( node ); 10097 } 10098 } 10099 10100 return elem; 10101} 10102 10103jQuery.extend( { 10104 htmlPrefilter: function( html ) { 10105 return html; 10106 }, 10107 10108 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 10109 var i, l, srcElements, destElements, 10110 clone = elem.cloneNode( true ), 10111 inPage = isAttached( elem ); 10112 10113 // Fix IE cloning issues 10114 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 10115 !jQuery.isXMLDoc( elem ) ) { 10116 10117 // We eschew jQuery#find here for performance reasons: 10118 // https://jsperf.com/getall-vs-sizzle/2 10119 destElements = getAll( clone ); 10120 srcElements = getAll( elem ); 10121 10122 for ( i = 0, l = srcElements.length; i < l; i++ ) { 10123 fixInput( srcElements[ i ], destElements[ i ] ); 10124 } 10125 } 10126 10127 // Copy the events from the original to the clone 10128 if ( dataAndEvents ) { 10129 if ( deepDataAndEvents ) { 10130 srcElements = srcElements || getAll( elem ); 10131 destElements = destElements || getAll( clone ); 10132 10133 for ( i = 0, l = srcElements.length; i < l; i++ ) { 10134 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 10135 } 10136 } else { 10137 cloneCopyEvent( elem, clone ); 10138 } 10139 } 10140 10141 // Preserve script evaluation history 10142 destElements = getAll( clone, "script" ); 10143 if ( destElements.length > 0 ) { 10144 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 10145 } 10146 10147 // Return the cloned set 10148 return clone; 10149 }, 10150 10151 cleanData: function( elems ) { 10152 var data, elem, type, 10153 special = jQuery.event.special, 10154 i = 0; 10155 10156 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 10157 if ( acceptData( elem ) ) { 10158 if ( ( data = elem[ dataPriv.expando ] ) ) { 10159 if ( data.events ) { 10160 for ( type in data.events ) { 10161 if ( special[ type ] ) { 10162 jQuery.event.remove( elem, type ); 10163 10164 // This is a shortcut to avoid jQuery.event.remove's overhead 10165 } else { 10166 jQuery.removeEvent( elem, type, data.handle ); 10167 } 10168 } 10169 } 10170
vendor: 1,119 bytes, lines 10171-10215
10171 // Support: Chrome <=35 - 45+ 10172 // Assign undefined instead of using delete, see Data#remove 10173 elem[ dataPriv.expando ] = undefined; 10174 } 10175 if ( elem[ dataUser.expando ] ) { 10176 10177 // Support: Chrome <=35 - 45+ 10178 // Assign undefined instead of using delete, see Data#remove 10179 elem[ dataUser.expando ] = undefined; 10180 } 10181 } 10182 } 10183 } 10184} ); 10185 10186jQuery.fn.extend( { 10187 detach: function( selector ) { 10188 return remove( this, selector, true ); 10189 }, 10190 10191 remove: function( selector ) { 10192 return remove( this, selector ); 10193 }, 10194 10195 text: function( value ) { 10196 return access( this, function( value ) { 10197 return value === undefined ? 10198 jQuery.text( this ) : 10199 this.empty().each( function() { 10200 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 10201 this.textContent = value; 10202 } 10203 } ); 10204 }, null, value, arguments.length ); 10205 }, 10206 10207 append: function() { 10208 return domManip( this, arguments, function( elem ) { 10209 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 10210 var target = manipulationTarget( this, elem ); 10211 target.appendChild( elem ); 10212 } 10213 } ); 10214 }, 10215
vendor: 4,514 bytes, lines 10216-10407
10216 prepend: function() { 10217 return domManip( this, arguments, function( elem ) { 10218 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 10219 var target = manipulationTarget( this, elem ); 10220 target.insertBefore( elem, target.firstChild ); 10221 } 10222 } ); 10223 }, 10224 10225 before: function() { 10226 return domManip( this, arguments, function( elem ) { 10227 if ( this.parentNode ) { 10228 this.parentNode.insertBefore( elem, this ); 10229 } 10230 } ); 10231 }, 10232 10233 after: function() { 10234 return domManip( this, arguments, function( elem ) { 10235 if ( this.parentNode ) { 10236 this.parentNode.insertBefore( elem, this.nextSibling ); 10237 } 10238 } ); 10239 }, 10240 10241 empty: function() { 10242 var elem, 10243 i = 0; 10244 10245 for ( ; ( elem = this[ i ] ) != null; i++ ) { 10246 if ( elem.nodeType === 1 ) { 10247 10248 // Prevent memory leaks 10249 jQuery.cleanData( getAll( elem, false ) ); 10250 10251 // Remove any remaining nodes 10252 elem.textContent = ""; 10253 } 10254 } 10255 10256 return this; 10257 }, 10258 10259 clone: function( dataAndEvents, deepDataAndEvents ) { 10260 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 10261 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 10262 10263 return this.map( function() { 10264 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 10265 } ); 10266 }, 10267 10268 html: function( value ) { 10269 return access( this, function( value ) { 10270 var elem = this[ 0 ] || {}, 10271 i = 0, 10272 l = this.length; 10273 10274 if ( value === undefined && elem.nodeType === 1 ) { 10275 return elem.innerHTML; 10276 } 10277 10278 // See if we can take a shortcut and just use innerHTML 10279 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 10280 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 10281 10282 value = jQuery.htmlPrefilter( value ); 10283 10284 try { 10285 for ( ; i < l; i++ ) { 10286 elem = this[ i ] || {}; 10287 10288 // Remove element nodes and prevent memory leaks 10289 if ( elem.nodeType === 1 ) { 10290 jQuery.cleanData( getAll( elem, false ) ); 10291 elem.innerHTML = value; 10292 } 10293 } 10294 10295 elem = 0; 10296 10297 // If using innerHTML throws an exception, use the fallback method 10298 } catch ( e ) {} 10299 } 10300 10301 if ( elem ) { 10302 this.empty().append( value ); 10303 } 10304 }, null, value, arguments.length ); 10305 }, 10306 10307 replaceWith: function() { 10308 var ignored = []; 10309 10310 // Make the changes, replacing each non-ignored context element with the new content 10311 return domManip( this, arguments, function( elem ) { 10312 var parent = this.parentNode; 10313 10314 if ( jQuery.inArray( this, ignored ) < 0 ) { 10315 jQuery.cleanData( getAll( this ) ); 10316 if ( parent ) { 10317 parent.replaceChild( elem, this ); 10318 } 10319 } 10320 10321 // Force callback invocation 10322 }, ignored ); 10323 } 10324} ); 10325 10326jQuery.each( { 10327 appendTo: "append", 10328 prependTo: "prepend", 10329 insertBefore: "before", 10330 insertAfter: "after", 10331 replaceAll: "replaceWith" 10332}, function( name, original ) { 10333 jQuery.fn[ name ] = function( selector ) { 10334 var elems, 10335 ret = [], 10336 insert = jQuery( selector ), 10337 last = insert.length - 1, 10338 i = 0; 10339 10340 for ( ; i <= last; i++ ) { 10341 elems = i === last ? this : this.clone( true ); 10342 jQuery( insert[ i ] )[ original ]( elems ); 10343 10344 // Support: Android <=4.0 only, PhantomJS 1 only 10345 // .get() because push.apply(_, arraylike) throws on ancient WebKit 10346 push.apply( ret, elems.get() ); 10347 } 10348 10349 return this.pushStack( ret ); 10350 }; 10351} ); 10352var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 10353 10354var rcustomProp = /^--/; 10355 10356 10357var getStyles = function( elem ) { 10358 10359 // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150) 10360 // IE throws on elements created in popups 10361 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 10362 var view = elem.ownerDocument.defaultView; 10363 10364 if ( !view || !view.opener ) { 10365 view = window; 10366 } 10367 10368 return view.getComputedStyle( elem ); 10369 }; 10370 10371var swap = function( elem, options, callback ) { 10372 var ret, name, 10373 old = {}; 10374 10375 // Remember the old values, and insert the new ones 10376 for ( name in options ) { 10377 old[ name ] = elem.style[ name ]; 10378 elem.style[ name ] = options[ name ]; 10379 } 10380 10381 ret = callback.call( elem ); 10382 10383 // Revert the old values 10384 for ( name in options ) { 10385 elem.style[ name ] = old[ name ]; 10386 } 10387 10388 return ret; 10389}; 10390 10391 10392var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 10393 10394 10395 10396( function() { 10397 10398 // Executing both pixelPosition & boxSizingReliable tests require only one layout 10399 // so they're executed at the same time to save the second computation. 10400 function computeStyleTests() { 10401 10402 // This is a singleton, we need to execute it only once 10403 if ( !div ) { 10404 return; 10405 } 10406 10407 container.style.cssText = "position:absolute;
vendor: 4,156 bytes, lines 10407-10526
10407left:-11111px;width:60px;" + 10408 "margin-top:1px;padding:0;border:0"; 10409 div.style.cssText = 10410 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 10411 "margin:auto;border:1px;padding:1px;" + 10412 "width:60%;top:1%"; 10413 documentElement.appendChild( container ).appendChild( div ); 10414 10415 var divStyle = window.getComputedStyle( div ); 10416 pixelPositionVal = divStyle.top !== "1%"; 10417 10418 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 10419 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 10420 10421 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 10422 // Some styles come back with percentage values, even though they shouldn't 10423 div.style.right = "60%"; 10424 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 10425 10426 // Support: IE 9 - 11 only 10427 // Detect misreporting of content dimensions for box-sizing:border-box elements 10428 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 10429 10430 // Support: IE 9 only 10431 // Detect overflow:scroll screwiness (gh-3699) 10432 // Support: Chrome <=64 10433 // Don't get tricked when zoom affects offsetWidth (gh-4029) 10434 div.style.position = "absolute"; 10435 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 10436 10437 documentElement.removeChild( container ); 10438 10439 // Nullify the div so it wouldn't be stored in the memory and 10440 // it will also be a sign that checks already performed 10441 div = null; 10442 } 10443 10444 function roundPixelMeasures( measure ) { 10445 return Math.round( parseFloat( measure ) ); 10446 } 10447 10448 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 10449 reliableTrDimensionsVal, reliableMarginLeftVal, 10450 container = document.createElement( "div" ), 10451 div = document.createElement( "div" ); 10452 10453 // Finish early in limited (non-browser) environments 10454 if ( !div.style ) { 10455 return; 10456 } 10457 10458 // Support: IE <=9 - 11 only 10459 // Style of cloned element affects source element cloned (trac-8908) 10460 div.style.backgroundClip = "content-box"; 10461 div.cloneNode( true ).style.backgroundClip = ""; 10462 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 10463 10464 jQuery.extend( support, { 10465 boxSizingReliable: function() { 10466 computeStyleTests(); 10467 return boxSizingReliableVal; 10468 }, 10469 pixelBoxStyles: function() { 10470 computeStyleTests(); 10471 return pixelBoxStylesVal; 10472 }, 10473 pixelPosition: function() { 10474 computeStyleTests(); 10475 return pixelPositionVal; 10476 }, 10477 reliableMarginLeft: function() { 10478 computeStyleTests(); 10479 return reliableMarginLeftVal; 10480 }, 10481 scrollboxSize: function() { 10482 computeStyleTests(); 10483 return scrollboxSizeVal; 10484 }, 10485 10486 // Support: IE 9 - 11+, Edge 15 - 18+ 10487 // IE/Edge misreport `getComputedStyle` of table rows with width/height 10488 // set in CSS while `offset*` properties report correct values. 10489 // Behavior in IE 9 is more subtle than in newer versions & it passes 10490 // some versions of this test; make sure not to make it pass there! 10491 // 10492 // Support: Firefox 70+ 10493 // Only Firefox includes border widths 10494 // in computed dimensions. (gh-4529) 10495 reliableTrDimensions: function() { 10496 var table, tr, trChild, trStyle; 10497 if ( reliableTrDimensionsVal == null ) { 10498 table = document.createElement( "table" ); 10499 tr = document.createElement( "tr" ); 10500 trChild = document.createElement( "div" ); 10501 10502 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 10503 tr.style.cssText = "box-sizing:content-box;border:1px solid"; 10504 10505 // Support: Chrome 86+ 10506 // Height set through cssText does not get applied. 10507 // Computed height then comes back as 0. 10508 tr.style.height = "1px"; 10509 trChild.style.height = "9px"; 10510 10511 // Support: Android 8 Chrome 86+ 10512 // In our bodyBackground.html iframe, 10513 // display for all div elements is set to "inline", 10514 // which causes a problem only in Android 8 Chrome 86. 10515 // Ensuring the div is `display: block` 10516 // gets around this issue. 10517 trChild.style.display = "block"; 10518 10519 documentElement 10520 .appendChild( table ) 10521 .appendChild( tr ) 10522 .appendChild( trChild ); 10523 10524 trStyle = window.getComputedStyle( tr ); 10525 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + 10526 parseInt( trStyle.borderTopWidth, 10 ) +
vendor: 12,879 bytes, lines 10527-10953
10527 parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; 10528 10529 documentElement.removeChild( table ); 10530 } 10531 return reliableTrDimensionsVal; 10532 } 10533 } ); 10534} )(); 10535 10536 10537function curCSS( elem, name, computed ) { 10538 var width, minWidth, maxWidth, ret, 10539 isCustomProp = rcustomProp.test( name ), 10540 10541 // Support: Firefox 51+ 10542 // Retrieving style before computed somehow 10543 // fixes an issue with getting wrong values 10544 // on detached elements 10545 style = elem.style; 10546 10547 computed = computed || getStyles( elem ); 10548 10549 // getPropertyValue is needed for: 10550 // .css('filter') (IE 9 only, trac-12537) 10551 // .css('--customProperty) (gh-3144) 10552 if ( computed ) { 10553 10554 // Support: IE <=9 - 11+ 10555 // IE only supports `"float"` in `getPropertyValue`; in computed styles 10556 // it's only available as `"cssFloat"`. We no longer modify properties 10557 // sent to `.css()` apart from camelCasing, so we need to check both. 10558 // Normally, this would create difference in behavior: if 10559 // `getPropertyValue` returns an empty string, the value returned 10560 // by `.css()` would be `undefined`. This is usually the case for 10561 // disconnected elements. However, in IE even disconnected elements 10562 // with no styles return `"none"` for `getPropertyValue( "float" )` 10563 ret = computed.getPropertyValue( name ) || computed[ name ]; 10564 10565 if ( isCustomProp && ret ) { 10566 10567 // Support: Firefox 105+, Chrome <=105+ 10568 // Spec requires trimming whitespace for custom properties (gh-4926). 10569 // Firefox only trims leading whitespace. Chrome just collapses 10570 // both leading & trailing whitespace to a single space. 10571 // 10572 // Fall back to `undefined` if empty string returned. 10573 // This collapses a missing definition with property defined 10574 // and set to an empty string but there's no standard API 10575 // allowing us to differentiate them without a performance penalty 10576 // and returning `undefined` aligns with older jQuery. 10577 // 10578 // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED 10579 // as whitespace while CSS does not, but this is not a problem 10580 // because CSS preprocessing replaces them with U+000A LINE FEED 10581 // (which *is* CSS whitespace) 10582 // https://www.w3.org/TR/css-syntax-3/#input-preprocessing 10583 ret = ret.replace( rtrimCSS, "$1" ) || undefined; 10584 } 10585 10586 if ( ret === "" && !isAttached( elem ) ) { 10587 ret = jQuery.style( elem, name ); 10588 } 10589 10590 // A tribute to the "awesome hack by Dean Edwards" 10591 // Android Browser returns percentage for some values, 10592 // but width seems to be reliably pixels. 10593 // This is against the CSSOM draft spec: 10594 // https://drafts.csswg.org/cssom/#resolved-values 10595 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 10596 10597 // Remember the original values 10598 width = style.width; 10599 minWidth = style.minWidth; 10600 maxWidth = style.maxWidth; 10601 10602 // Put in the new values to get a computed value out 10603 style.minWidth = style.maxWidth = style.width = ret; 10604 ret = computed.width; 10605 10606 // Revert the changed values 10607 style.width = width; 10608 style.minWidth = minWidth; 10609 style.maxWidth = maxWidth; 10610 } 10611 } 10612 10613 return ret !== undefined ? 10614 10615 // Support: IE <=9 - 11 only 10616 // IE returns zIndex value as an integer. 10617 ret + "" : 10618 ret; 10619} 10620 10621 10622function addGetHookIf( conditionFn, hookFn ) { 10623 10624 // Define the hook, we'll check on the first run if it's really needed. 10625 return { 10626 get: function() { 10627 if ( conditionFn() ) { 10628 10629 // Hook not needed (or it's not possible to use it due 10630 // to missing dependency), remove it. 10631 delete this.get; 10632 return; 10633 } 10634 10635 // Hook needed; redefine it so that the support test is not executed again. 10636 return ( this.get = hookFn ).apply( this, arguments ); 10637 } 10638 }; 10639} 10640 10641 10642var cssPrefixes = [ "Webkit", "Moz", "ms" ], 10643 emptyStyle = document.createElement( "div" ).style, 10644 vendorProps = {}; 10645 10646// Return a vendor-prefixed property or undefined 10647function vendorPropName( name ) { 10648 10649 // Check for vendor prefixed names 10650 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 10651 i = cssPrefixes.length; 10652 10653 while ( i-- ) { 10654 name = cssPrefixes[ i ] + capName; 10655 if ( name in emptyStyle ) { 10656 return name; 10657 } 10658 } 10659} 10660 10661// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 10662function finalPropName( name ) { 10663 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 10664 10665 if ( final ) { 10666 return final; 10667 } 10668 if ( name in emptyStyle ) { 10669 return name; 10670 } 10671 return vendorProps[ name ] = vendorPropName( name ) || name; 10672} 10673 10674 10675var 10676 10677 // Swappable if display is none or starts with table 10678 // except "table", "table-cell", or "table-caption" 10679 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 10680 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 10681 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 10682 cssNormalTransform = { 10683 letterSpacing: "0", 10684 fontWeight: "400" 10685 }; 10686 10687function setPositiveNumber( _elem, value, subtract ) { 10688 10689 // Any relative (+/-) values have already been 10690 // normalized at this point 10691 var matches = rcssNum.exec( value ); 10692 return matches ? 10693 10694 // Guard against undefined "subtract", e.g., when used as in cssHooks 10695 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 10696 value; 10697} 10698 10699function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 10700 var i = dimension === "width" ? 1 : 0, 10701 extra = 0, 10702 delta = 0, 10703 marginDelta = 0; 10704 10705 // Adjustment may not be necessary 10706 if ( box === ( isBorderBox ? "border" : "content" ) ) { 10707 return 0; 10708 } 10709 10710 for ( ; i < 4; i += 2 ) { 10711 10712 // Both box models exclude margin 10713 // Count margin delta separately to only add it after scroll gutter adjustment. 10714 // This is needed to make negative margins work with `outerHeight( true )` (gh-3982). 10715 if ( box === "margin" ) { 10716 marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 10717 } 10718 10719 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 10720 if ( !isBorderBox ) { 10721 10722 // Add padding 10723 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 10724 10725 // For "border" or "margin", add border 10726 if ( box !== "padding" ) { 10727 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 10728 10729 // But still keep track of it otherwise 10730 } else { 10731 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 10732 } 10733 10734 // If we get here with a border-box (content + padding + border), we're seeking "content" or 10735 // "padding" or "margin" 10736 } else { 10737 10738 // For "content", subtract padding 10739 if ( box === "content" ) { 10740 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 10741 } 10742 10743 // For "content" or "padding", subtract border 10744 if ( box !== "margin" ) { 10745 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 10746 } 10747 } 10748 } 10749 10750 // Account for positive content-box scroll gutter when requested by providing computedVal 10751 if ( !isBorderBox && computedVal >= 0 ) { 10752 10753 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 10754 // Assuming integer scroll gutter, subtract the rest and round down 10755 delta += Math.max( 0, Math.ceil( 10756 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 10757 computedVal - 10758 delta - 10759 extra - 10760 0.5 10761 10762 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 10763 // Use an explicit zero to avoid NaN (gh-3964) 10764 ) ) || 0; 10765 } 10766 10767 return delta + marginDelta; 10768} 10769 10770function getWidthOrHeight( elem, dimension, extra ) { 10771 10772 // Start with computed style 10773 var styles = getStyles( elem ), 10774 10775 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 10776 // Fake content-box until we know it's needed to know the true value. 10777 boxSizingNeeded = !support.boxSizingReliable() || extra, 10778 isBorderBox = boxSizingNeeded && 10779 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 10780 valueIsBorderBox = isBorderBox, 10781 10782 val = curCSS( elem, dimension, styles ), 10783 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 10784 10785 // Support: Firefox <=54 10786 // Return a confounding non-pixel value or feign ignorance, as appropriate. 10787 if ( rnumnonpx.test( val ) ) { 10788 if ( !extra ) { 10789 return val; 10790 } 10791 val = "auto"; 10792 } 10793 10794 10795 // Support: IE 9 - 11 only 10796 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 10797 // In those cases, the computed value can be trusted to be border-box. 10798 if ( ( !support.boxSizingReliable() && isBorderBox || 10799 10800 // Support: IE 10 - 11+, Edge 15 - 18+ 10801 // IE/Edge misreport `getComputedStyle` of table rows with width/height 10802 // set in CSS while `offset*` properties report correct values. 10803 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 10804 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 10805 10806 // Fall back to offsetWidth/offsetHeight when value is "auto" 10807 // This happens for inline elements with no explicit setting (gh-3571) 10808 val === "auto" || 10809 10810 // Support: Android <=4.1 - 4.3 only 10811 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 10812 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 10813 10814 // Make sure the element is visible & connected 10815 elem.getClientRects().length ) { 10816 10817 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 10818 10819 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 10820 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 10821 // retrieved value as a content box dimension. 10822 valueIsBorderBox = offsetProp in elem; 10823 if ( valueIsBorderBox ) { 10824 val = elem[ offsetProp ]; 10825 } 10826 } 10827 10828 // Normalize "" and auto 10829 val = parseFloat( val ) || 0; 10830 10831 // Adjust for the element's box model 10832 return ( val + 10833 boxModelAdjustment( 10834 elem, 10835 dimension, 10836 extra || ( isBorderBox ? "border" : "content" ), 10837 valueIsBorderBox, 10838 styles, 10839 10840 // Provide the current computed size to request scroll gutter calculation (gh-3589) 10841 val 10842 ) 10843 ) + "px"; 10844} 10845 10846jQuery.extend( { 10847 10848 // Add in style property hooks for overriding the default 10849 // behavior of getting and setting a style property 10850 cssHooks: { 10851 opacity: { 10852 get: function( elem, computed ) { 10853 if ( computed ) { 10854 10855 // We should always get a number back from opacity 10856 var ret = curCSS( elem, "opacity" ); 10857 return ret === "" ? "1" : ret; 10858 } 10859 } 10860 } 10861 }, 10862 10863 // Don't automatically add "px" to these possibly-unitless properties 10864 cssNumber: { 10865 animationIterationCount: true, 10866 aspectRatio: true, 10867 borderImageSlice: true, 10868 columnCount: true, 10869 flexGrow: true, 10870 flexShrink: true, 10871 fontWeight: true, 10872 gridArea: true, 10873 gridColumn: true, 10874 gridColumnEnd: true, 10875 gridColumnStart: true, 10876 gridRow: true, 10877 gridRowEnd: true, 10878 gridRowStart: true, 10879 lineHeight: true, 10880 opacity: true, 10881 order: true, 10882 orphans: true, 10883 scale: true, 10884 widows: true, 10885 zIndex: true, 10886 zoom: true, 10887 10888 // SVG-related 10889 fillOpacity: true, 10890 floodOpacity: true, 10891 stopOpacity: true, 10892 strokeMiterlimit: true, 10893 strokeOpacity: true 10894 }, 10895 10896 // Add in properties whose names you wish to fix before 10897 // setting or getting the value 10898 cssProps: {}, 10899 10900 // Get and set the style property on a DOM Node 10901 style: function( elem, name, value, extra ) { 10902 10903 // Don't set styles on text and comment nodes 10904 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 10905 return; 10906 } 10907 10908 // Make sure that we're working with the right name 10909 var ret, type, hooks, 10910 origName = camelCase( name ), 10911 isCustomProp = rcustomProp.test( name ), 10912 style = elem.style; 10913 10914 // Make sure that we're working with the right name. We don't 10915 // want to query the value if it is a CSS custom property 10916 // since they are user-defined. 10917 if ( !isCustomProp ) { 10918 name = finalPropName( origName ); 10919 } 10920 10921 // Gets hook for the prefixed version, then unprefixed version 10922 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 10923 10924 // Check if we're setting a value 10925 if ( value !== undefined ) { 10926 type = typeof value; 10927 10928 // Convert "+=" or "-=" to relative numbers (trac-7345) 10929 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 10930 value = adjustCSS( elem, name, ret ); 10931 10932 // Fixes bug trac-9237 10933 type = "number"; 10934 } 10935 10936 // Make sure that null and NaN values aren't set (trac-7116) 10937 if ( value == null || value !== value ) { 10938 return; 10939 } 10940 10941 // If a number was passed in, add the unit (except for certain CSS properties) 10942 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 10943 // "px" to a few hardcoded values. 10944 if ( type === "number" && !isCustomProp ) { 10945 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 10946 } 10947 10948 // background-* props affect original clone's values 10949 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 10950 style[ name ] = "inherit"; 10951 } 10952 10953 // If a hook was provided, use that value, otherwise just set the specified value
vendor: 16,052 bytes, lines 10954-11558
10954 if ( !hooks || !( "set" in hooks ) || 10955 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 10956 10957 if ( isCustomProp ) { 10958 style.setProperty( name, value ); 10959 } else { 10960 style[ name ] = value; 10961 } 10962 } 10963 10964 } else { 10965 10966 // If a hook was provided get the non-computed value from there 10967 if ( hooks && "get" in hooks && 10968 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 10969 10970 return ret; 10971 } 10972 10973 // Otherwise just get the value from the style object 10974 return style[ name ]; 10975 } 10976 }, 10977 10978 css: function( elem, name, extra, styles ) { 10979 var val, num, hooks, 10980 origName = camelCase( name ), 10981 isCustomProp = rcustomProp.test( name ); 10982 10983 // Make sure that we're working with the right name. We don't 10984 // want to modify the value if it is a CSS custom property 10985 // since they are user-defined. 10986 if ( !isCustomProp ) { 10987 name = finalPropName( origName ); 10988 } 10989 10990 // Try prefixed name followed by the unprefixed name 10991 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 10992 10993 // If a hook was provided get the computed value from there 10994 if ( hooks && "get" in hooks ) { 10995 val = hooks.get( elem, true, extra ); 10996 } 10997 10998 // Otherwise, if a way to get the computed value exists, use that 10999 if ( val === undefined ) { 11000 val = curCSS( elem, name, styles ); 11001 } 11002 11003 // Convert "normal" to computed value 11004 if ( val === "normal" && name in cssNormalTransform ) { 11005 val = cssNormalTransform[ name ]; 11006 } 11007 11008 // Make numeric if forced or a qualifier was provided and val looks numeric 11009 if ( extra === "" || extra ) { 11010 num = parseFloat( val ); 11011 return extra === true || isFinite( num ) ? num || 0 : val; 11012 } 11013 11014 return val; 11015 } 11016} ); 11017 11018jQuery.each( [ "height", "width" ], function( _i, dimension ) { 11019 jQuery.cssHooks[ dimension ] = { 11020 get: function( elem, computed, extra ) { 11021 if ( computed ) { 11022 11023 // Certain elements can have dimension info if we invisibly show them 11024 // but it must have a current display style that would benefit 11025 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 11026 11027 // Support: Safari 8+ 11028 // Table columns in Safari have non-zero offsetWidth & zero 11029 // getBoundingClientRect().width unless display is changed. 11030 // Support: IE <=11 only 11031 // Running getBoundingClientRect on a disconnected node 11032 // in IE throws an error. 11033 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 11034 swap( elem, cssShow, function() { 11035 return getWidthOrHeight( elem, dimension, extra ); 11036 } ) : 11037 getWidthOrHeight( elem, dimension, extra ); 11038 } 11039 }, 11040 11041 set: function( elem, value, extra ) { 11042 var matches, 11043 styles = getStyles( elem ), 11044 11045 // Only read styles.position if the test has a chance to fail 11046 // to avoid forcing a reflow. 11047 scrollboxSizeBuggy = !support.scrollboxSize() && 11048 styles.position === "absolute", 11049 11050 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 11051 boxSizingNeeded = scrollboxSizeBuggy || extra, 11052 isBorderBox = boxSizingNeeded && 11053 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 11054 subtract = extra ? 11055 boxModelAdjustment( 11056 elem, 11057 dimension, 11058 extra, 11059 isBorderBox, 11060 styles 11061 ) : 11062 0; 11063 11064 // Account for unreliable border-box dimensions by comparing offset* to computed and 11065 // faking a content-box to get border and padding (gh-3699) 11066 if ( isBorderBox && scrollboxSizeBuggy ) { 11067 subtract -= Math.ceil( 11068 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 11069 parseFloat( styles[ dimension ] ) - 11070 boxModelAdjustment( elem, dimension, "border", false, styles ) - 11071 0.5 11072 ); 11073 } 11074 11075 // Convert to pixels if value adjustment is needed 11076 if ( subtract && ( matches = rcssNum.exec( value ) ) && 11077 ( matches[ 3 ] || "px" ) !== "px" ) { 11078 11079 elem.style[ dimension ] = value; 11080 value = jQuery.css( elem, dimension ); 11081 } 11082 11083 return setPositiveNumber( elem, value, subtract ); 11084 } 11085 }; 11086} ); 11087 11088jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 11089 function( elem, computed ) { 11090 if ( computed ) { 11091 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 11092 elem.getBoundingClientRect().left - 11093 swap( elem, { marginLeft: 0 }, function() { 11094 return elem.getBoundingClientRect().left; 11095 } ) 11096 ) + "px"; 11097 } 11098 } 11099); 11100 11101// These hooks are used by animate to expand properties 11102jQuery.each( { 11103 margin: "", 11104 padding: "", 11105 border: "Width" 11106}, function( prefix, suffix ) { 11107 jQuery.cssHooks[ prefix + suffix ] = { 11108 expand: function( value ) { 11109 var i = 0, 11110 expanded = {}, 11111 11112 // Assumes a single number if not a string 11113 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 11114 11115 for ( ; i < 4; i++ ) { 11116 expanded[ prefix + cssExpand[ i ] + suffix ] = 11117 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 11118 } 11119 11120 return expanded; 11121 } 11122 }; 11123 11124 if ( prefix !== "margin" ) { 11125 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 11126 } 11127} ); 11128 11129jQuery.fn.extend( { 11130 css: function( name, value ) { 11131 return access( this, function( elem, name, value ) { 11132 var styles, len, 11133 map = {}, 11134 i = 0; 11135 11136 if ( Array.isArray( name ) ) { 11137 styles = getStyles( elem ); 11138 len = name.length; 11139 11140 for ( ; i < len; i++ ) { 11141 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 11142 } 11143 11144 return map; 11145 } 11146 11147 return value !== undefined ? 11148 jQuery.style( elem, name, value ) : 11149 jQuery.css( elem, name ); 11150 }, name, value, arguments.length > 1 ); 11151 } 11152} ); 11153 11154 11155function Tween( elem, options, prop, end, easing ) { 11156 return new Tween.prototype.init( elem, options, prop, end, easing ); 11157} 11158jQuery.Tween = Tween; 11159 11160Tween.prototype = { 11161 constructor: Tween, 11162 init: function( elem, options, prop, end, easing, unit ) { 11163 this.elem = elem; 11164 this.prop = prop; 11165 this.easing = easing || jQuery.easing._default; 11166 this.options = options; 11167 this.start = this.now = this.cur(); 11168 this.end = end; 11169 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 11170 }, 11171 cur: function() { 11172 var hooks = Tween.propHooks[ this.prop ]; 11173 11174 return hooks && hooks.get ? 11175 hooks.get( this ) : 11176 Tween.propHooks._default.get( this ); 11177 }, 11178 run: function( percent ) { 11179 var eased, 11180 hooks = Tween.propHooks[ this.prop ]; 11181 11182 if ( this.options.duration ) { 11183 this.pos = eased = jQuery.easing[ this.easing ]( 11184 percent, this.options.duration * percent, 0, 1, this.options.duration 11185 ); 11186 } else { 11187 this.pos = eased = percent; 11188 } 11189 this.now = ( this.end - this.start ) * eased + this.start; 11190 11191 if ( this.options.step ) { 11192 this.options.step.call( this.elem, this.now, this ); 11193 } 11194 11195 if ( hooks && hooks.set ) { 11196 hooks.set( this ); 11197 } else { 11198 Tween.propHooks._default.set( this ); 11199 } 11200 return this; 11201 } 11202}; 11203 11204Tween.prototype.init.prototype = Tween.prototype; 11205 11206Tween.propHooks = { 11207 _default: { 11208 get: function( tween ) { 11209 var result; 11210 11211 // Use a property on the element directly when it is not a DOM element, 11212 // or when there is no matching style property that exists. 11213 if ( tween.elem.nodeType !== 1 || 11214 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 11215 return tween.elem[ tween.prop ]; 11216 } 11217 11218 // Passing an empty string as a 3rd parameter to .css will automatically 11219 // attempt a parseFloat and fallback to a string if the parse fails. 11220 // Simple values such as "10px" are parsed to Float; 11221 // complex values such as "rotate(1rad)" are returned as-is. 11222 result = jQuery.css( tween.elem, tween.prop, "" ); 11223 11224 // Empty strings, null, undefined and "auto" are converted to 0. 11225 return !result || result === "auto" ? 0 : result; 11226 }, 11227 set: function( tween ) { 11228 11229 // Use step hook for back compat. 11230 // Use cssHook if its there. 11231 // Use .style if available and use plain properties where available. 11232 if ( jQuery.fx.step[ tween.prop ] ) { 11233 jQuery.fx.step[ tween.prop ]( tween ); 11234 } else if ( tween.elem.nodeType === 1 && ( 11235 jQuery.cssHooks[ tween.prop ] || 11236 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 11237 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 11238 } else { 11239 tween.elem[ tween.prop ] = tween.now; 11240 } 11241 } 11242 } 11243}; 11244 11245// Support: IE <=9 only 11246// Panic based approach to setting things on disconnected nodes 11247Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 11248 set: function( tween ) { 11249 if ( tween.elem.nodeType && tween.elem.parentNode ) { 11250 tween.elem[ tween.prop ] = tween.now; 11251 } 11252 } 11253}; 11254 11255jQuery.easing = { 11256 linear: function( p ) { 11257 return p; 11258 }, 11259 swing: function( p ) { 11260 return 0.5 - Math.cos( p * Math.PI ) / 2; 11261 }, 11262 _default: "swing" 11263}; 11264 11265jQuery.fx = Tween.prototype.init; 11266 11267// Back compat <1.8 extension point 11268jQuery.fx.step = {}; 11269 11270 11271 11272 11273var 11274 fxNow, inProgress, 11275 rfxtypes = /^(?:toggle|show|hide)$/, 11276 rrun = /queueHooks$/; 11277 11278function schedule() { 11279 if ( inProgress ) { 11280 if ( document.hidden === false && window.requestAnimationFrame ) { 11281 window.requestAnimationFrame( schedule ); 11282 } else { 11283 window.setTimeout( schedule, jQuery.fx.interval ); 11284 } 11285 11286 jQuery.fx.tick(); 11287 } 11288} 11289 11290// Animations created synchronously will run synchronously 11291function createFxNow() { 11292 window.setTimeout( function() { 11293 fxNow = undefined; 11294 } ); 11295 return ( fxNow = Date.now() ); 11296} 11297 11298// Generate parameters to create a standard animation 11299function genFx( type, includeWidth ) { 11300 var which, 11301 i = 0, 11302 attrs = { height: type }; 11303 11304 // If we include width, step value is 1 to do all cssExpand values, 11305 // otherwise step value is 2 to skip over Left and Right 11306 includeWidth = includeWidth ? 1 : 0; 11307 for ( ; i < 4; i += 2 - includeWidth ) { 11308 which = cssExpand[ i ]; 11309 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 11310 } 11311 11312 if ( includeWidth ) { 11313 attrs.opacity = attrs.width = type; 11314 } 11315 11316 return attrs; 11317} 11318 11319function createTween( value, prop, animation ) { 11320 var tween, 11321 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 11322 index = 0, 11323 length = collection.length; 11324 for ( ; index < length; index++ ) { 11325 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 11326 11327 // We're done with this property 11328 return tween; 11329 } 11330 } 11331} 11332 11333function defaultPrefilter( elem, props, opts ) { 11334 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 11335 isBox = "width" in props || "height" in props, 11336 anim = this, 11337 orig = {}, 11338 style = elem.style, 11339 hidden = elem.nodeType && isHiddenWithinTree( elem ), 11340 dataShow = dataPriv.get( elem, "fxshow" ); 11341 11342 // Queue-skipping animations hijack the fx hooks 11343 if ( !opts.queue ) { 11344 hooks = jQuery._queueHooks( elem, "fx" ); 11345 if ( hooks.unqueued == null ) { 11346 hooks.unqueued = 0; 11347 oldfire = hooks.empty.fire; 11348 hooks.empty.fire = function() { 11349 if ( !hooks.unqueued ) { 11350 oldfire(); 11351 } 11352 }; 11353 } 11354 hooks.unqueued++; 11355 11356 anim.always( function() { 11357 11358 // Ensure the complete handler is called before this completes 11359 anim.always( function() { 11360 hooks.unqueued--; 11361 if ( !jQuery.queue( elem, "fx" ).length ) { 11362 hooks.empty.fire(); 11363 } 11364 } ); 11365 } ); 11366 } 11367 11368 // Detect show/hide animations 11369 for ( prop in props ) { 11370 value = props[ prop ]; 11371 if ( rfxtypes.test( value ) ) { 11372 delete props[ prop ]; 11373 toggle = toggle || value === "toggle"; 11374 if ( value === ( hidden ? "hide" : "show" ) ) { 11375 11376 // Pretend to be hidden if this is a "show" and 11377 // there is still data from a stopped show/hide 11378 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 11379 hidden = true; 11380 11381 // Ignore all other no-op show/hide data 11382 } else { 11383 continue; 11384 } 11385 } 11386 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 11387 } 11388 } 11389 11390 // Bail out if this is a no-op like .hide().hide() 11391 propTween = !jQuery.isEmptyObject( props ); 11392 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 11393 return; 11394 } 11395 11396 // Restrict "overflow" and "display" styles during box animations 11397 if ( isBox && elem.nodeType === 1 ) { 11398 11399 // Support: IE <=9 - 11, Edge 12 - 15 11400 // Record all 3 overflow attributes because IE does not infer the shorthand 11401 // from identically-valued overflowX and overflowY and Edge just mirrors 11402 // the overflowX value there. 11403 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 11404 11405 // Identify a display type, preferring old show/hide data over the CSS cascade 11406 restoreDisplay = dataShow && dataShow.display; 11407 if ( restoreDisplay == null ) { 11408 restoreDisplay = dataPriv.get( elem, "display" ); 11409 } 11410 display = jQuery.css( elem, "display" ); 11411 if ( display === "none" ) { 11412 if ( restoreDisplay ) { 11413 display = restoreDisplay; 11414 } else { 11415 11416 // Get nonempty value(s) by temporarily forcing visibility 11417 showHide( [ elem ], true ); 11418 restoreDisplay = elem.style.display || restoreDisplay; 11419 display = jQuery.css( elem, "display" ); 11420 showHide( [ elem ] ); 11421 } 11422 } 11423 11424 // Animate inline elements as inline-block 11425 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 11426 if ( jQuery.css( elem, "float" ) === "none" ) { 11427 11428 // Restore the original display value at the end of pure show/hide animations 11429 if ( !propTween ) { 11430 anim.done( function() { 11431 style.display = restoreDisplay; 11432 } ); 11433 if ( restoreDisplay == null ) { 11434 display = style.display; 11435 restoreDisplay = display === "none" ? "" : display; 11436 } 11437 } 11438 style.display = "inline-block"; 11439 } 11440 } 11441 } 11442 11443 if ( opts.overflow ) { 11444 style.overflow = "hidden"; 11445 anim.always( function() { 11446 style.overflow = opts.overflow[ 0 ]; 11447 style.overflowX = opts.overflow[ 1 ]; 11448 style.overflowY = opts.overflow[ 2 ]; 11449 } ); 11450 } 11451 11452 // Implement show/hide animations 11453 propTween = false; 11454 for ( prop in orig ) { 11455 11456 // General show/hide setup for this element animation 11457 if ( !propTween ) { 11458 if ( dataShow ) { 11459 if ( "hidden" in dataShow ) { 11460 hidden = dataShow.hidden; 11461 } 11462 } else { 11463 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 11464 } 11465 11466 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 11467 if ( toggle ) { 11468 dataShow.hidden = !hidden; 11469 } 11470 11471 // Show elements before animating them 11472 if ( hidden ) { 11473 showHide( [ elem ], true ); 11474 } 11475 11476 /* eslint-disable no-loop-func */ 11477 11478 anim.done( function() { 11479 11480 /* eslint-enable no-loop-func */ 11481 11482 // The final step of a "hide" animation is actually hiding the element 11483 if ( !hidden ) { 11484 showHide( [ elem ] ); 11485 } 11486 dataPriv.remove( elem, "fxshow" ); 11487 for ( prop in orig ) { 11488 jQuery.style( elem, prop, orig[ prop ] ); 11489 } 11490 } ); 11491 } 11492 11493 // Per-property setup 11494 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 11495 if ( !( prop in dataShow ) ) { 11496 dataShow[ prop ] = propTween.start; 11497 if ( hidden ) { 11498 propTween.end = propTween.start; 11499 propTween.start = 0; 11500 } 11501 } 11502 } 11503} 11504 11505function propFilter( props, specialEasing ) { 11506 var index, name, easing, value, hooks; 11507 11508 // camelCase, specialEasing and expand cssHook pass 11509 for ( index in props ) { 11510 name = camelCase( index ); 11511 easing = specialEasing[ name ]; 11512 value = props[ index ]; 11513 if ( Array.isArray( value ) ) { 11514 easing = value[ 1 ]; 11515 value = props[ index ] = value[ 0 ]; 11516 } 11517 11518 if ( index !== name ) { 11519 props[ name ] = value; 11520 delete props[ index ]; 11521 } 11522 11523 hooks = jQuery.cssHooks[ name ]; 11524 if ( hooks && "expand" in hooks ) { 11525 value = hooks.expand( value ); 11526 delete props[ name ]; 11527 11528 // Not quite $.extend, this won't overwrite existing keys. 11529 // Reusing 'index' because we have the correct "name" 11530 for ( index in value ) { 11531 if ( !( index in props ) ) { 11532 props[ index ] = value[ index ]; 11533 specialEasing[ index ] = easing; 11534 } 11535 } 11536 } else { 11537 specialEasing[ name ] = easing; 11538 } 11539 } 11540} 11541 11542function Animation( elem, properties, options ) { 11543 var result, 11544 stopped, 11545 index = 0, 11546 length = Animation.prefilters.length, 11547 deferred = jQuery.Deferred().always( function() { 11548 11549 // Don't match elem in the :animated selector 11550 delete tick.elem; 11551 } ), 11552 tick = function() { 11553 if ( stopped ) { 11554 return false; 11555 } 11556 var currentTime = fxNow || createFxNow(), 11557 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 11558
vendor: 9,542 bytes, lines 11559-11949
11559 // Support: Android 2.3 only 11560 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497) 11561 temp = remaining / animation.duration || 0, 11562 percent = 1 - temp, 11563 index = 0, 11564 length = animation.tweens.length; 11565 11566 for ( ; index < length; index++ ) { 11567 animation.tweens[ index ].run( percent ); 11568 } 11569 11570 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 11571 11572 // If there's more to do, yield 11573 if ( percent < 1 && length ) { 11574 return remaining; 11575 } 11576 11577 // If this was an empty animation, synthesize a final progress notification 11578 if ( !length ) { 11579 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 11580 } 11581 11582 // Resolve the animation and report its conclusion 11583 deferred.resolveWith( elem, [ animation ] ); 11584 return false; 11585 }, 11586 animation = deferred.promise( { 11587 elem: elem, 11588 props: jQuery.extend( {}, properties ), 11589 opts: jQuery.extend( true, { 11590 specialEasing: {}, 11591 easing: jQuery.easing._default 11592 }, options ), 11593 originalProperties: properties, 11594 originalOptions: options, 11595 startTime: fxNow || createFxNow(), 11596 duration: options.duration, 11597 tweens: [], 11598 createTween: function( prop, end ) { 11599 var tween = jQuery.Tween( elem, animation.opts, prop, end, 11600 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 11601 animation.tweens.push( tween ); 11602 return tween; 11603 }, 11604 stop: function( gotoEnd ) { 11605 var index = 0, 11606 11607 // If we are going to the end, we want to run all the tweens 11608 // otherwise we skip this part 11609 length = gotoEnd ? animation.tweens.length : 0; 11610 if ( stopped ) { 11611 return this; 11612 } 11613 stopped = true; 11614 for ( ; index < length; index++ ) { 11615 animation.tweens[ index ].run( 1 ); 11616 } 11617 11618 // Resolve when we played the last frame; otherwise, reject 11619 if ( gotoEnd ) { 11620 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 11621 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 11622 } else { 11623 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 11624 } 11625 return this; 11626 } 11627 } ), 11628 props = animation.props; 11629 11630 propFilter( props, animation.opts.specialEasing ); 11631 11632 for ( ; index < length; index++ ) { 11633 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 11634 if ( result ) { 11635 if ( isFunction( result.stop ) ) { 11636 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 11637 result.stop.bind( result ); 11638 } 11639 return result; 11640 } 11641 } 11642 11643 jQuery.map( props, createTween, animation ); 11644 11645 if ( isFunction( animation.opts.start ) ) { 11646 animation.opts.start.call( elem, animation ); 11647 } 11648 11649 // Attach callbacks from options 11650 animation 11651 .progress( animation.opts.progress ) 11652 .done( animation.opts.done, animation.opts.complete ) 11653 .fail( animation.opts.fail ) 11654 .always( animation.opts.always ); 11655 11656 jQuery.fx.timer( 11657 jQuery.extend( tick, { 11658 elem: elem, 11659 anim: animation, 11660 queue: animation.opts.queue 11661 } ) 11662 ); 11663 11664 return animation; 11665} 11666 11667jQuery.Animation = jQuery.extend( Animation, { 11668 11669 tweeners: { 11670 "*": [ function( prop, value ) { 11671 var tween = this.createTween( prop, value ); 11672 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 11673 return tween; 11674 } ] 11675 }, 11676 11677 tweener: function( props, callback ) { 11678 if ( isFunction( props ) ) { 11679 callback = props; 11680 props = [ "*" ]; 11681 } else { 11682 props = props.match( rnothtmlwhite ); 11683 } 11684 11685 var prop, 11686 index = 0, 11687 length = props.length; 11688 11689 for ( ; index < length; index++ ) { 11690 prop = props[ index ]; 11691 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 11692 Animation.tweeners[ prop ].unshift( callback ); 11693 } 11694 }, 11695 11696 prefilters: [ defaultPrefilter ], 11697 11698 prefilter: function( callback, prepend ) { 11699 if ( prepend ) { 11700 Animation.prefilters.unshift( callback ); 11701 } else { 11702 Animation.prefilters.push( callback ); 11703 } 11704 } 11705} ); 11706 11707jQuery.speed = function( speed, easing, fn ) { 11708 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 11709 complete: fn || !fn && easing || 11710 isFunction( speed ) && speed, 11711 duration: speed, 11712 easing: fn && easing || easing && !isFunction( easing ) && easing 11713 }; 11714 11715 // Go to the end state if fx are off 11716 if ( jQuery.fx.off ) { 11717 opt.duration = 0; 11718 11719 } else { 11720 if ( typeof opt.duration !== "number" ) { 11721 if ( opt.duration in jQuery.fx.speeds ) { 11722 opt.duration = jQuery.fx.speeds[ opt.duration ]; 11723 11724 } else { 11725 opt.duration = jQuery.fx.speeds._default; 11726 } 11727 } 11728 } 11729 11730 // Normalize opt.queue - true/undefined/null -> "fx" 11731 if ( opt.queue == null || opt.queue === true ) { 11732 opt.queue = "fx"; 11733 } 11734 11735 // Queueing 11736 opt.old = opt.complete; 11737 11738 opt.complete = function() { 11739 if ( isFunction( opt.old ) ) { 11740 opt.old.call( this ); 11741 } 11742 11743 if ( opt.queue ) { 11744 jQuery.dequeue( this, opt.queue ); 11745 } 11746 }; 11747 11748 return opt; 11749}; 11750 11751jQuery.fn.extend( { 11752 fadeTo: function( speed, to, easing, callback ) { 11753 11754 // Show any hidden elements after setting opacity to 0 11755 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 11756 11757 // Animate to the value specified 11758 .end().animate( { opacity: to }, speed, easing, callback ); 11759 }, 11760 animate: function( prop, speed, easing, callback ) { 11761 var empty = jQuery.isEmptyObject( prop ), 11762 optall = jQuery.speed( speed, easing, callback ), 11763 doAnimation = function() { 11764 11765 // Operate on a copy of prop so per-property easing won't be lost 11766 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 11767 11768 // Empty animations, or finishing resolves immediately 11769 if ( empty || dataPriv.get( this, "finish" ) ) { 11770 anim.stop( true ); 11771 } 11772 }; 11773 11774 doAnimation.finish = doAnimation; 11775 11776 return empty || optall.queue === false ? 11777 this.each( doAnimation ) : 11778 this.queue( optall.queue, doAnimation ); 11779 }, 11780 stop: function( type, clearQueue, gotoEnd ) { 11781 var stopQueue = function( hooks ) { 11782 var stop = hooks.stop; 11783 delete hooks.stop; 11784 stop( gotoEnd ); 11785 }; 11786 11787 if ( typeof type !== "string" ) { 11788 gotoEnd = clearQueue; 11789 clearQueue = type; 11790 type = undefined; 11791 } 11792 if ( clearQueue ) { 11793 this.queue( type || "fx", [] ); 11794 } 11795 11796 return this.each( function() { 11797 var dequeue = true, 11798 index = type != null && type + "queueHooks", 11799 timers = jQuery.timers, 11800 data = dataPriv.get( this ); 11801 11802 if ( index ) { 11803 if ( data[ index ] && data[ index ].stop ) { 11804 stopQueue( data[ index ] ); 11805 } 11806 } else { 11807 for ( index in data ) { 11808 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 11809 stopQueue( data[ index ] ); 11810 } 11811 } 11812 } 11813 11814 for ( index = timers.length; index--; ) { 11815 if ( timers[ index ].elem === this && 11816 ( type == null || timers[ index ].queue === type ) ) { 11817 11818 timers[ index ].anim.stop( gotoEnd ); 11819 dequeue = false; 11820 timers.splice( index, 1 ); 11821 } 11822 } 11823 11824 // Start the next in the queue if the last step wasn't forced. 11825 // Timers currently will call their complete callbacks, which 11826 // will dequeue but only if they were gotoEnd. 11827 if ( dequeue || !gotoEnd ) { 11828 jQuery.dequeue( this, type ); 11829 } 11830 } ); 11831 }, 11832 finish: function( type ) { 11833 if ( type !== false ) { 11834 type = type || "fx"; 11835 } 11836 return this.each( function() { 11837 var index, 11838 data = dataPriv.get( this ), 11839 queue = data[ type + "queue" ], 11840 hooks = data[ type + "queueHooks" ], 11841 timers = jQuery.timers, 11842 length = queue ? queue.length : 0; 11843 11844 // Enable finishing flag on private data 11845 data.finish = true; 11846 11847 // Empty the queue first 11848 jQuery.queue( this, type, [] ); 11849 11850 if ( hooks && hooks.stop ) { 11851 hooks.stop.call( this, true ); 11852 } 11853 11854 // Look for any active animations, and finish them 11855 for ( index = timers.length; index--; ) { 11856 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 11857 timers[ index ].anim.stop( true ); 11858 timers.splice( index, 1 ); 11859 } 11860 } 11861 11862 // Look for any animations in the old queue and finish them 11863 for ( index = 0; index < length; index++ ) { 11864 if ( queue[ index ] && queue[ index ].finish ) { 11865 queue[ index ].finish.call( this ); 11866 } 11867 } 11868 11869 // Turn off finishing flag 11870 delete data.finish; 11871 } ); 11872 } 11873} ); 11874 11875jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 11876 var cssFn = jQuery.fn[ name ]; 11877 jQuery.fn[ name ] = function( speed, easing, callback ) { 11878 return speed == null || typeof speed === "boolean" ? 11879 cssFn.apply( this, arguments ) : 11880 this.animate( genFx( name, true ), speed, easing, callback ); 11881 }; 11882} ); 11883 11884// Generate shortcuts for custom animations 11885jQuery.each( { 11886 slideDown: genFx( "show" ), 11887 slideUp: genFx( "hide" ), 11888 slideToggle: genFx( "toggle" ), 11889 fadeIn: { opacity: "show" }, 11890 fadeOut: { opacity: "hide" }, 11891 fadeToggle: { opacity: "toggle" } 11892}, function( name, props ) { 11893 jQuery.fn[ name ] = function( speed, easing, callback ) { 11894 return this.animate( props, speed, easing, callback ); 11895 }; 11896} ); 11897 11898jQuery.timers = []; 11899jQuery.fx.tick = function() { 11900 var timer, 11901 i = 0, 11902 timers = jQuery.timers; 11903 11904 fxNow = Date.now(); 11905 11906 for ( ; i < timers.length; i++ ) { 11907 timer = timers[ i ]; 11908 11909 // Run the timer and safely remove it when done (allowing for external removal) 11910 if ( !timer() && timers[ i ] === timer ) { 11911 timers.splice( i--, 1 ); 11912 } 11913 } 11914 11915 if ( !timers.length ) { 11916 jQuery.fx.stop(); 11917 } 11918 fxNow = undefined; 11919}; 11920 11921jQuery.fx.timer = function( timer ) { 11922 jQuery.timers.push( timer ); 11923 jQuery.fx.start(); 11924}; 11925 11926jQuery.fx.interval = 13; 11927jQuery.fx.start = function() { 11928 if ( inProgress ) { 11929 return; 11930 } 11931 11932 inProgress = true; 11933 schedule(); 11934}; 11935 11936jQuery.fx.stop = function() { 11937 inProgress = null; 11938}; 11939 11940jQuery.fx.speeds = { 11941 slow: 600, 11942 fast: 200, 11943 11944 // Default speed 11945 _default: 400 11946}; 11947 11948 11949// Based off of the plugin by Clint Helfers, with permission.
vendor: 5,177 bytes, lines 11950-12170
11950jQuery.fn.delay = function( time, type ) { 11951 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 11952 type = type || "fx"; 11953 11954 return this.queue( type, function( next, hooks ) { 11955 var timeout = window.setTimeout( next, time ); 11956 hooks.stop = function() { 11957 window.clearTimeout( timeout ); 11958 }; 11959 } ); 11960}; 11961 11962 11963( function() { 11964 var input = document.createElement( "input" ), 11965 select = document.createElement( "select" ), 11966 opt = select.appendChild( document.createElement( "option" ) ); 11967 11968 input.type = "checkbox"; 11969 11970 // Support: Android <=4.3 only 11971 // Default value for a checkbox should be "on" 11972 support.checkOn = input.value !== ""; 11973 11974 // Support: IE <=11 only 11975 // Must access selectedIndex to make default options select 11976 support.optSelected = opt.selected; 11977 11978 // Support: IE <=11 only 11979 // An input loses its value after becoming a radio 11980 input = document.createElement( "input" ); 11981 input.value = "t"; 11982 input.type = "radio"; 11983 support.radioValue = input.value === "t"; 11984} )(); 11985 11986 11987var boolHook, 11988 attrHandle = jQuery.expr.attrHandle; 11989 11990jQuery.fn.extend( { 11991 attr: function( name, value ) { 11992 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 11993 }, 11994 11995 removeAttr: function( name ) { 11996 return this.each( function() { 11997 jQuery.removeAttr( this, name ); 11998 } ); 11999 } 12000} ); 12001 12002jQuery.extend( { 12003 attr: function( elem, name, value ) { 12004 var ret, hooks, 12005 nType = elem.nodeType; 12006 12007 // Don't get/set attributes on text, comment and attribute nodes 12008 if ( nType === 3 || nType === 8 || nType === 2 ) { 12009 return; 12010 } 12011 12012 // Fallback to prop when attributes are not supported 12013 if ( typeof elem.getAttribute === "undefined" ) { 12014 return jQuery.prop( elem, name, value ); 12015 } 12016 12017 // Attribute hooks are determined by the lowercase version 12018 // Grab necessary hook if one is defined 12019 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 12020 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 12021 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 12022 } 12023 12024 if ( value !== undefined ) { 12025 if ( value === null ) { 12026 jQuery.removeAttr( elem, name ); 12027 return; 12028 } 12029 12030 if ( hooks && "set" in hooks && 12031 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 12032 return ret; 12033 } 12034 12035 elem.setAttribute( name, value + "" ); 12036 return value; 12037 } 12038 12039 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 12040 return ret; 12041 } 12042 12043 ret = jQuery.find.attr( elem, name ); 12044 12045 // Non-existent attributes return null, we normalize to undefined 12046 return ret == null ? undefined : ret; 12047 }, 12048 12049 attrHooks: { 12050 type: { 12051 set: function( elem, value ) { 12052 if ( !support.radioValue && value === "radio" && 12053 nodeName( elem, "input" ) ) { 12054 var val = elem.value; 12055 elem.setAttribute( "type", value ); 12056 if ( val ) { 12057 elem.value = val; 12058 } 12059 return value; 12060 } 12061 } 12062 } 12063 }, 12064 12065 removeAttr: function( elem, value ) { 12066 var name, 12067 i = 0, 12068 12069 // Attribute names can contain non-HTML whitespace characters 12070 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 12071 attrNames = value && value.match( rnothtmlwhite ); 12072 12073 if ( attrNames && elem.nodeType === 1 ) { 12074 while ( ( name = attrNames[ i++ ] ) ) { 12075 elem.removeAttribute( name ); 12076 } 12077 } 12078 } 12079} ); 12080 12081// Hooks for boolean attributes 12082boolHook = { 12083 set: function( elem, value, name ) { 12084 if ( value === false ) { 12085 12086 // Remove boolean attributes when set to false 12087 jQuery.removeAttr( elem, name ); 12088 } else { 12089 elem.setAttribute( name, name ); 12090 } 12091 return name; 12092 } 12093}; 12094 12095jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 12096 var getter = attrHandle[ name ] || jQuery.find.attr; 12097 12098 attrHandle[ name ] = function( elem, name, isXML ) { 12099 var ret, handle, 12100 lowercaseName = name.toLowerCase(); 12101 12102 if ( !isXML ) { 12103 12104 // Avoid an infinite loop by temporarily removing this function from the getter 12105 handle = attrHandle[ lowercaseName ]; 12106 attrHandle[ lowercaseName ] = ret; 12107 ret = getter( elem, name, isXML ) != null ? 12108 lowercaseName : 12109 null; 12110 attrHandle[ lowercaseName ] = handle; 12111 } 12112 return ret; 12113 }; 12114} ); 12115 12116 12117 12118 12119var rfocusable = /^(?:input|select|textarea|button)$/i, 12120 rclickable = /^(?:a|area)$/i; 12121 12122jQuery.fn.extend( { 12123 prop: function( name, value ) { 12124 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 12125 }, 12126 12127 removeProp: function( name ) { 12128 return this.each( function() { 12129 delete this[ jQuery.propFix[ name ] || name ]; 12130 } ); 12131 } 12132} ); 12133 12134jQuery.extend( { 12135 prop: function( elem, name, value ) { 12136 var ret, hooks, 12137 nType = elem.nodeType; 12138 12139 // Don't get/set properties on text, comment and attribute nodes 12140 if ( nType === 3 || nType === 8 || nType === 2 ) { 12141 return; 12142 } 12143 12144 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 12145 12146 // Fix name and attach hooks 12147 name = jQuery.propFix[ name ] || name; 12148 hooks = jQuery.propHooks[ name ]; 12149 } 12150 12151 if ( value !== undefined ) { 12152 if ( hooks && "set" in hooks && 12153 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 12154 return ret; 12155 } 12156 12157 return ( elem[ name ] = value ); 12158 } 12159 12160 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 12161 return ret; 12162 } 12163 12164 return elem[ name ]; 12165 }, 12166 12167 propHooks: { 12168 tabIndex: { 12169 get: function( elem ) { 12170
vendor: 6,126 bytes, lines 12171-12430
12171 // Support: IE <=9 - 11 only 12172 // elem.tabIndex doesn't always return the 12173 // correct value when it hasn't been explicitly set 12174 // Use proper attribute retrieval (trac-12072) 12175 var tabindex = jQuery.find.attr( elem, "tabindex" ); 12176 12177 if ( tabindex ) { 12178 return parseInt( tabindex, 10 ); 12179 } 12180 12181 if ( 12182 rfocusable.test( elem.nodeName ) || 12183 rclickable.test( elem.nodeName ) && 12184 elem.href 12185 ) { 12186 return 0; 12187 } 12188 12189 return -1; 12190 } 12191 } 12192 }, 12193 12194 propFix: { 12195 "for": "htmlFor", 12196 "class": "className" 12197 } 12198} ); 12199 12200// Support: IE <=11 only 12201// Accessing the selectedIndex property 12202// forces the browser to respect setting selected 12203// on the option 12204// The getter ensures a default option is selected 12205// when in an optgroup 12206// eslint rule "no-unused-expressions" is disabled for this code 12207// since it considers such accessions noop 12208if ( !support.optSelected ) { 12209 jQuery.propHooks.selected = { 12210 get: function( elem ) { 12211 12212 /* eslint no-unused-expressions: "off" */ 12213 12214 var parent = elem.parentNode; 12215 if ( parent && parent.parentNode ) { 12216 parent.parentNode.selectedIndex; 12217 } 12218 return null; 12219 }, 12220 set: function( elem ) { 12221 12222 /* eslint no-unused-expressions: "off" */ 12223 12224 var parent = elem.parentNode; 12225 if ( parent ) { 12226 parent.selectedIndex; 12227 12228 if ( parent.parentNode ) { 12229 parent.parentNode.selectedIndex; 12230 } 12231 } 12232 } 12233 }; 12234} 12235 12236jQuery.each( [ 12237 "tabIndex", 12238 "readOnly", 12239 "maxLength", 12240 "cellSpacing", 12241 "cellPadding", 12242 "rowSpan", 12243 "colSpan", 12244 "useMap", 12245 "frameBorder", 12246 "contentEditable" 12247], function() { 12248 jQuery.propFix[ this.toLowerCase() ] = this; 12249} ); 12250 12251 12252 12253 12254 // Strip and collapse whitespace according to HTML spec 12255 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 12256 function stripAndCollapse( value ) { 12257 var tokens = value.match( rnothtmlwhite ) || []; 12258 return tokens.join( " " ); 12259 } 12260 12261 12262function getClass( elem ) { 12263 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 12264} 12265 12266function classesToArray( value ) { 12267 if ( Array.isArray( value ) ) { 12268 return value; 12269 } 12270 if ( typeof value === "string" ) { 12271 return value.match( rnothtmlwhite ) || []; 12272 } 12273 return []; 12274} 12275 12276jQuery.fn.extend( { 12277 addClass: function( value ) { 12278 var classNames, cur, curValue, className, i, finalValue; 12279 12280 if ( isFunction( value ) ) { 12281 return this.each( function( j ) { 12282 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 12283 } ); 12284 } 12285 12286 classNames = classesToArray( value ); 12287 12288 if ( classNames.length ) { 12289 return this.each( function() { 12290 curValue = getClass( this ); 12291 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 12292 12293 if ( cur ) { 12294 for ( i = 0; i < classNames.length; i++ ) { 12295 className = classNames[ i ]; 12296 if ( cur.indexOf( " " + className + " " ) < 0 ) { 12297 cur += className + " "; 12298 } 12299 } 12300 12301 // Only assign if different to avoid unneeded rendering. 12302 finalValue = stripAndCollapse( cur ); 12303 if ( curValue !== finalValue ) { 12304 this.setAttribute( "class", finalValue ); 12305 } 12306 } 12307 } ); 12308 } 12309 12310 return this; 12311 }, 12312 12313 removeClass: function( value ) { 12314 var classNames, cur, curValue, className, i, finalValue; 12315 12316 if ( isFunction( value ) ) { 12317 return this.each( function( j ) { 12318 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 12319 } ); 12320 } 12321 12322 if ( !arguments.length ) { 12323 return this.attr( "class", "" ); 12324 } 12325 12326 classNames = classesToArray( value ); 12327 12328 if ( classNames.length ) { 12329 return this.each( function() { 12330 curValue = getClass( this ); 12331 12332 // This expression is here for better compressibility (see addClass) 12333 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 12334 12335 if ( cur ) { 12336 for ( i = 0; i < classNames.length; i++ ) { 12337 className = classNames[ i ]; 12338 12339 // Remove *all* instances 12340 while ( cur.indexOf( " " + className + " " ) > -1 ) { 12341 cur = cur.replace( " " + className + " ", " " ); 12342 } 12343 } 12344 12345 // Only assign if different to avoid unneeded rendering. 12346 finalValue = stripAndCollapse( cur ); 12347 if ( curValue !== finalValue ) { 12348 this.setAttribute( "class", finalValue ); 12349 } 12350 } 12351 } ); 12352 } 12353 12354 return this; 12355 }, 12356 12357 toggleClass: function( value, stateVal ) { 12358 var classNames, className, i, self, 12359 type = typeof value, 12360 isValidValue = type === "string" || Array.isArray( value ); 12361 12362 if ( isFunction( value ) ) { 12363 return this.each( function( i ) { 12364 jQuery( this ).toggleClass( 12365 value.call( this, i, getClass( this ), stateVal ), 12366 stateVal 12367 ); 12368 } ); 12369 } 12370 12371 if ( typeof stateVal === "boolean" && isValidValue ) { 12372 return stateVal ? this.addClass( value ) : this.removeClass( value ); 12373 } 12374 12375 classNames = classesToArray( value ); 12376 12377 return this.each( function() { 12378 if ( isValidValue ) { 12379 12380 // Toggle individual class names 12381 self = jQuery( this ); 12382 12383 for ( i = 0; i < classNames.length; i++ ) { 12384 className = classNames[ i ]; 12385 12386 // Check each className given, space separated list 12387 if ( self.hasClass( className ) ) { 12388 self.removeClass( className ); 12389 } else { 12390 self.addClass( className ); 12391 } 12392 } 12393 12394 // Toggle whole class name 12395 } else if ( value === undefined || type === "boolean" ) { 12396 className = getClass( this ); 12397 if ( className ) { 12398 12399 // Store className if set 12400 dataPriv.set( this, "__className__", className ); 12401 } 12402 12403 // If the element has a class name or if we're passed `false`, 12404 // then remove the whole classname (if there was one, the above saved it). 12405 // Otherwise bring back whatever was previously saved (if anything), 12406 // falling back to the empty string if nothing was stored. 12407 if ( this.setAttribute ) { 12408 this.setAttribute( "class", 12409 className || value === false ? 12410 "" : 12411 dataPriv.get( this, "__className__" ) || "" 12412 ); 12413 } 12414 } 12415 } ); 12416 }, 12417 12418 hasClass: function( selector ) { 12419 var className, elem, 12420 i = 0; 12421 12422 className = " " + selector + " "; 12423 while ( ( elem = this[ i++ ] ) ) { 12424 if ( elem.nodeType === 1 && 12425 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 12426 return true; 12427 } 12428 } 12429 12430 return false;
vendor: 1,385 bytes, lines 12431-12500
12431 } 12432} ); 12433 12434 12435 12436 12437var rreturn = /\r/g; 12438 12439jQuery.fn.extend( { 12440 val: function( value ) { 12441 var hooks, ret, valueIsFunction, 12442 elem = this[ 0 ]; 12443 12444 if ( !arguments.length ) { 12445 if ( elem ) { 12446 hooks = jQuery.valHooks[ elem.type ] || 12447 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 12448 12449 if ( hooks && 12450 "get" in hooks && 12451 ( ret = hooks.get( elem, "value" ) ) !== undefined 12452 ) { 12453 return ret; 12454 } 12455 12456 ret = elem.value; 12457 12458 // Handle most common string cases 12459 if ( typeof ret === "string" ) { 12460 return ret.replace( rreturn, "" ); 12461 } 12462 12463 // Handle cases where value is null/undef or number 12464 return ret == null ? "" : ret; 12465 } 12466 12467 return; 12468 } 12469 12470 valueIsFunction = isFunction( value ); 12471 12472 return this.each( function( i ) { 12473 var val; 12474 12475 if ( this.nodeType !== 1 ) { 12476 return; 12477 } 12478 12479 if ( valueIsFunction ) { 12480 val = value.call( this, i, jQuery( this ).val() ); 12481 } else { 12482 val = value; 12483 } 12484 12485 // Treat null/undefined as ""; convert numbers to string 12486 if ( val == null ) { 12487 val = ""; 12488 12489 } else if ( typeof val === "number" ) { 12490 val += ""; 12491 12492 } else if ( Array.isArray( val ) ) { 12493 val = jQuery.map( val, function( value ) { 12494 return value == null ? "" : value + ""; 12495 } ); 12496 } 12497 12498 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 12499 12500 // If set returns undefined, fall back to normal setting
vendor: 4,458 bytes, lines 12501-12686
12501 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 12502 this.value = val; 12503 } 12504 } ); 12505 } 12506} ); 12507 12508jQuery.extend( { 12509 valHooks: { 12510 option: { 12511 get: function( elem ) { 12512 12513 var val = jQuery.find.attr( elem, "value" ); 12514 return val != null ? 12515 val : 12516 12517 // Support: IE <=10 - 11 only 12518 // option.text throws exceptions (trac-14686, trac-14858) 12519 // Strip and collapse whitespace 12520 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 12521 stripAndCollapse( jQuery.text( elem ) ); 12522 } 12523 }, 12524 select: { 12525 get: function( elem ) { 12526 var value, option, i, 12527 options = elem.options, 12528 index = elem.selectedIndex, 12529 one = elem.type === "select-one", 12530 values = one ? null : [], 12531 max = one ? index + 1 : options.length; 12532 12533 if ( index < 0 ) { 12534 i = max; 12535 12536 } else { 12537 i = one ? index : 0; 12538 } 12539 12540 // Loop through all the selected options 12541 for ( ; i < max; i++ ) { 12542 option = options[ i ]; 12543 12544 // Support: IE <=9 only 12545 // IE8-9 doesn't update selected after form reset (trac-2551) 12546 if ( ( option.selected || i === index ) && 12547 12548 // Don't return options that are disabled or in a disabled optgroup 12549 !option.disabled && 12550 ( !option.parentNode.disabled || 12551 !nodeName( option.parentNode, "optgroup" ) ) ) { 12552 12553 // Get the specific value for the option 12554 value = jQuery( option ).val(); 12555 12556 // We don't need an array for one selects 12557 if ( one ) { 12558 return value; 12559 } 12560 12561 // Multi-Selects return an array 12562 values.push( value ); 12563 } 12564 } 12565 12566 return values; 12567 }, 12568 12569 set: function( elem, value ) { 12570 var optionSet, option, 12571 options = elem.options, 12572 values = jQuery.makeArray( value ), 12573 i = options.length; 12574 12575 while ( i-- ) { 12576 option = options[ i ]; 12577 12578 /* eslint-disable no-cond-assign */ 12579 12580 if ( option.selected = 12581 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 12582 ) { 12583 optionSet = true; 12584 } 12585 12586 /* eslint-enable no-cond-assign */ 12587 } 12588 12589 // Force browsers to behave consistently when non-matching value is set 12590 if ( !optionSet ) { 12591 elem.selectedIndex = -1; 12592 } 12593 return values; 12594 } 12595 } 12596 } 12597} ); 12598 12599// Radios and checkboxes getter/setter 12600jQuery.each( [ "radio", "checkbox" ], function() { 12601 jQuery.valHooks[ this ] = { 12602 set: function( elem, value ) { 12603 if ( Array.isArray( value ) ) { 12604 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 12605 } 12606 } 12607 }; 12608 if ( !support.checkOn ) { 12609 jQuery.valHooks[ this ].get = function( elem ) { 12610 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 12611 }; 12612 } 12613} ); 12614 12615 12616 12617 12618// Return jQuery for attributes-only inclusion 12619var location = window.location; 12620 12621var nonce = { guid: Date.now() }; 12622 12623var rquery = ( /\?/ ); 12624 12625 12626 12627// Cross-browser xml parsing 12628jQuery.parseXML = function( data ) { 12629 var xml, parserErrorElem; 12630 if ( !data || typeof data !== "string" ) { 12631 return null; 12632 } 12633 12634 // Support: IE 9 - 11 only 12635 // IE throws on parseFromString with invalid input. 12636 try { 12637 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 12638 } catch ( e ) {} 12639 12640 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; 12641 if ( !xml || parserErrorElem ) { 12642 jQuery.error( "Invalid XML: " + ( 12643 parserErrorElem ? 12644 jQuery.map( parserErrorElem.childNodes, function( el ) { 12645 return el.textContent; 12646 } ).join( "\n" ) : 12647 data 12648 ) ); 12649 } 12650 return xml; 12651}; 12652 12653 12654var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 12655 stopPropagationCallback = function( e ) { 12656 e.stopPropagation(); 12657 }; 12658 12659jQuery.extend( jQuery.event, { 12660 12661 trigger: function( event, data, elem, onlyHandlers ) { 12662 12663 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 12664 eventPath = [ elem || document ], 12665 type = hasOwn.call( event, "type" ) ? event.type : event, 12666 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 12667 12668 cur = lastElement = tmp = elem = elem || document; 12669 12670 // Don't do events on text and comment nodes 12671 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 12672 return; 12673 } 12674 12675 // focus/blur morphs to focusin/out; ensure we're not firing them right now 12676 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 12677 return; 12678 } 12679 12680 if ( type.indexOf( "." ) > -1 ) { 12681 12682 // Namespaced trigger; create a regexp to match event type in handle() 12683 namespaces = type.split( "." ); 12684 type = namespaces.shift(); 12685 namespaces.sort(); 12686 }
vendor: 6,524 bytes, lines 12687-12936
12687 ontype = type.indexOf( ":" ) < 0 && "on" + type; 12688 12689 // Caller can pass in a jQuery.Event object, Object, or just an event type string 12690 event = event[ jQuery.expando ] ? 12691 event : 12692 new jQuery.Event( type, typeof event === "object" && event ); 12693 12694 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 12695 event.isTrigger = onlyHandlers ? 2 : 3; 12696 event.namespace = namespaces.join( "." ); 12697 event.rnamespace = event.namespace ? 12698 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 12699 null; 12700 12701 // Clean up the event in case it is being reused 12702 event.result = undefined; 12703 if ( !event.target ) { 12704 event.target = elem; 12705 } 12706 12707 // Clone any incoming data and prepend the event, creating the handler arg list 12708 data = data == null ? 12709 [ event ] : 12710 jQuery.makeArray( data, [ event ] ); 12711 12712 // Allow special events to draw outside the lines 12713 special = jQuery.event.special[ type ] || {}; 12714 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 12715 return; 12716 } 12717 12718 // Determine event propagation path in advance, per W3C events spec (trac-9951) 12719 // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724) 12720 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 12721 12722 bubbleType = special.delegateType || type; 12723 if ( !rfocusMorph.test( bubbleType + type ) ) { 12724 cur = cur.parentNode; 12725 } 12726 for ( ; cur; cur = cur.parentNode ) { 12727 eventPath.push( cur ); 12728 tmp = cur; 12729 } 12730 12731 // Only add window if we got to document (e.g., not plain obj or detached DOM) 12732 if ( tmp === ( elem.ownerDocument || document ) ) { 12733 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 12734 } 12735 } 12736 12737 // Fire handlers on the event path 12738 i = 0; 12739 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 12740 lastElement = cur; 12741 event.type = i > 1 ? 12742 bubbleType : 12743 special.bindType || type; 12744 12745 // jQuery handler 12746 handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && 12747 dataPriv.get( cur, "handle" ); 12748 if ( handle ) { 12749 handle.apply( cur, data ); 12750 } 12751 12752 // Native handler 12753 handle = ontype && cur[ ontype ]; 12754 if ( handle && handle.apply && acceptData( cur ) ) { 12755 event.result = handle.apply( cur, data ); 12756 if ( event.result === false ) { 12757 event.preventDefault(); 12758 } 12759 } 12760 } 12761 event.type = type; 12762 12763 // If nobody prevented the default action, do it now 12764 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 12765 12766 if ( ( !special._default || 12767 special._default.apply( eventPath.pop(), data ) === false ) && 12768 acceptData( elem ) ) { 12769 12770 // Call a native DOM method on the target with the same name as the event. 12771 // Don't do default actions on window, that's where global variables be (trac-6170) 12772 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 12773 12774 // Don't re-trigger an onFOO event when we call its FOO() method 12775 tmp = elem[ ontype ]; 12776 12777 if ( tmp ) { 12778 elem[ ontype ] = null; 12779 } 12780 12781 // Prevent re-triggering of the same event, since we already bubbled it above 12782 jQuery.event.triggered = type; 12783 12784 if ( event.isPropagationStopped() ) { 12785 lastElement.addEventListener( type, stopPropagationCallback ); 12786 } 12787 12788 elem[ type ](); 12789 12790 if ( event.isPropagationStopped() ) { 12791 lastElement.removeEventListener( type, stopPropagationCallback ); 12792 } 12793 12794 jQuery.event.triggered = undefined; 12795 12796 if ( tmp ) { 12797 elem[ ontype ] = tmp; 12798 } 12799 } 12800 } 12801 } 12802 12803 return event.result; 12804 }, 12805 12806 // Piggyback on a donor event to simulate a different one 12807 // Used only for `focus(in | out)` events 12808 simulate: function( type, elem, event ) { 12809 var e = jQuery.extend( 12810 new jQuery.Event(), 12811 event, 12812 { 12813 type: type, 12814 isSimulated: true 12815 } 12816 ); 12817 12818 jQuery.event.trigger( e, null, elem ); 12819 } 12820 12821} ); 12822 12823jQuery.fn.extend( { 12824 12825 trigger: function( type, data ) { 12826 return this.each( function() { 12827 jQuery.event.trigger( type, data, this ); 12828 } ); 12829 }, 12830 triggerHandler: function( type, data ) { 12831 var elem = this[ 0 ]; 12832 if ( elem ) { 12833 return jQuery.event.trigger( type, data, elem, true ); 12834 } 12835 } 12836} ); 12837 12838 12839var 12840 rbracket = /\[\]$/, 12841 rCRLF = /\r?\n/g, 12842 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 12843 rsubmittable = /^(?:input|select|textarea|keygen)/i; 12844 12845function buildParams( prefix, obj, traditional, add ) { 12846 var name; 12847 12848 if ( Array.isArray( obj ) ) { 12849 12850 // Serialize array item. 12851 jQuery.each( obj, function( i, v ) { 12852 if ( traditional || rbracket.test( prefix ) ) { 12853 12854 // Treat each array item as a scalar. 12855 add( prefix, v ); 12856 12857 } else { 12858 12859 // Item is non-scalar (array or object), encode its numeric index. 12860 buildParams( 12861 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 12862 v, 12863 traditional, 12864 add 12865 ); 12866 } 12867 } ); 12868 12869 } else if ( !traditional && toType( obj ) === "object" ) { 12870 12871 // Serialize object item. 12872 for ( name in obj ) { 12873 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 12874 } 12875 12876 } else { 12877 12878 // Serialize scalar item. 12879 add( prefix, obj ); 12880 } 12881} 12882 12883// Serialize an array of form elements or a set of 12884// key/values into a query string 12885jQuery.param = function( a, traditional ) { 12886 var prefix, 12887 s = [], 12888 add = function( key, valueOrFunction ) { 12889 12890 // If value is a function, invoke it and use its return value 12891 var value = isFunction( valueOrFunction ) ? 12892 valueOrFunction() : 12893 valueOrFunction; 12894 12895 s[ s.length ] = encodeURIComponent( key ) + "=" + 12896 encodeURIComponent( value == null ? "" : value ); 12897 }; 12898 12899 if ( a == null ) { 12900 return ""; 12901 } 12902 12903 // If an array was passed in, assume that it is an array of form elements. 12904 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 12905 12906 // Serialize the form elements 12907 jQuery.each( a, function() { 12908 add( this.name, this.value ); 12909 } ); 12910 12911 } else { 12912 12913 // If traditional, encode the "old" way (the way 1.3.2 or older 12914 // did it), otherwise encode params recursively. 12915 for ( prefix in a ) { 12916 buildParams( prefix, a[ prefix ], traditional, add ); 12917 } 12918 } 12919 12920 // Return the resulting serialization 12921 return s.join( "&" ); 12922}; 12923 12924jQuery.fn.extend( { 12925 serialize: function() { 12926 return jQuery.param( this.serializeArray() ); 12927 }, 12928 serializeArray: function() { 12929 return this.map( function() { 12930 12931 // Can add propHook for "elements" to filter or add form elements 12932 var elements = jQuery.prop( this, "elements" ); 12933 return elements ? jQuery.makeArray( elements ) : this; 12934 } ).filter( function() { 12935 var type = this.type; 12936
vendor: 32,437 bytes, lines 12937-14190
12937 // Use .is( ":disabled" ) so that fieldset[disabled] works 12938 return this.name && !jQuery( this ).is( ":disabled" ) && 12939 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 12940 ( this.checked || !rcheckableType.test( type ) ); 12941 } ).map( function( _i, elem ) { 12942 var val = jQuery( this ).val(); 12943 12944 if ( val == null ) { 12945 return null; 12946 } 12947 12948 if ( Array.isArray( val ) ) { 12949 return jQuery.map( val, function( val ) { 12950 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 12951 } ); 12952 } 12953 12954 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 12955 } ).get(); 12956 } 12957} ); 12958 12959 12960var 12961 r20 = /%20/g, 12962 rhash = /#.*$/, 12963 rantiCache = /([?&])_=[^&]*/, 12964 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 12965 12966 // trac-7653, trac-8125, trac-8152: local protocol detection 12967 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 12968 rnoContent = /^(?:GET|HEAD)$/, 12969 rprotocol = /^\/\//, 12970 12971 /* Prefilters 12972 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 12973 * 2) These are called: 12974 * - BEFORE asking for a transport 12975 * - AFTER param serialization (s.data is a string if s.processData is true) 12976 * 3) key is the dataType 12977 * 4) the catchall symbol "*" can be used 12978 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 12979 */ 12980 prefilters = {}, 12981 12982 /* Transports bindings 12983 * 1) key is the dataType 12984 * 2) the catchall symbol "*" can be used 12985 * 3) selection will start with transport dataType and THEN go to "*" if needed 12986 */ 12987 transports = {}, 12988 12989 // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression 12990 allTypes = "*/".concat( "*" ), 12991 12992 // Anchor tag for parsing the document origin 12993 originAnchor = document.createElement( "a" ); 12994 12995originAnchor.href = location.href; 12996 12997// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 12998function addToPrefiltersOrTransports( structure ) { 12999 13000 // dataTypeExpression is optional and defaults to "*" 13001 return function( dataTypeExpression, func ) { 13002 13003 if ( typeof dataTypeExpression !== "string" ) { 13004 func = dataTypeExpression; 13005 dataTypeExpression = "*"; 13006 } 13007 13008 var dataType, 13009 i = 0, 13010 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 13011 13012 if ( isFunction( func ) ) { 13013 13014 // For each dataType in the dataTypeExpression 13015 while ( ( dataType = dataTypes[ i++ ] ) ) { 13016 13017 // Prepend if requested 13018 if ( dataType[ 0 ] === "+" ) { 13019 dataType = dataType.slice( 1 ) || "*"; 13020 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 13021 13022 // Otherwise append 13023 } else { 13024 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 13025 } 13026 } 13027 } 13028 }; 13029} 13030 13031// Base inspection function for prefilters and transports 13032function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 13033 13034 var inspected = {}, 13035 seekingTransport = ( structure === transports ); 13036 13037 function inspect( dataType ) { 13038 var selected; 13039 inspected[ dataType ] = true; 13040 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 13041 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 13042 if ( typeof dataTypeOrTransport === "string" && 13043 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 13044 13045 options.dataTypes.unshift( dataTypeOrTransport ); 13046 inspect( dataTypeOrTransport ); 13047 return false; 13048 } else if ( seekingTransport ) { 13049 return !( selected = dataTypeOrTransport ); 13050 } 13051 } ); 13052 return selected; 13053 } 13054 13055 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 13056} 13057 13058// A special extend for ajax options 13059// that takes "flat" options (not to be deep extended) 13060// Fixes trac-9887 13061function ajaxExtend( target, src ) { 13062 var key, deep, 13063 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 13064 13065 for ( key in src ) { 13066 if ( src[ key ] !== undefined ) { 13067 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 13068 } 13069 } 13070 if ( deep ) { 13071 jQuery.extend( true, target, deep ); 13072 } 13073 13074 return target; 13075} 13076 13077/* Handles responses to an ajax request: 13078 * - finds the right dataType (mediates between content-type and expected dataType) 13079 * - returns the corresponding response 13080 */ 13081function ajaxHandleResponses( s, jqXHR, responses ) { 13082 13083 var ct, type, finalDataType, firstDataType, 13084 contents = s.contents, 13085 dataTypes = s.dataTypes; 13086 13087 // Remove auto dataType and get content-type in the process 13088 while ( dataTypes[ 0 ] === "*" ) { 13089 dataTypes.shift(); 13090 if ( ct === undefined ) { 13091 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 13092 } 13093 } 13094 13095 // Check if we're dealing with a known content-type 13096 if ( ct ) { 13097 for ( type in contents ) { 13098 if ( contents[ type ] && contents[ type ].test( ct ) ) { 13099 dataTypes.unshift( type ); 13100 break; 13101 } 13102 } 13103 } 13104 13105 // Check to see if we have a response for the expected dataType 13106 if ( dataTypes[ 0 ] in responses ) { 13107 finalDataType = dataTypes[ 0 ]; 13108 } else { 13109 13110 // Try convertible dataTypes 13111 for ( type in responses ) { 13112 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 13113 finalDataType = type; 13114 break; 13115 } 13116 if ( !firstDataType ) { 13117 firstDataType = type; 13118 } 13119 } 13120 13121 // Or just use first one 13122 finalDataType = finalDataType || firstDataType; 13123 } 13124 13125 // If we found a dataType 13126 // We add the dataType to the list if needed 13127 // and return the corresponding response 13128 if ( finalDataType ) { 13129 if ( finalDataType !== dataTypes[ 0 ] ) { 13130 dataTypes.unshift( finalDataType ); 13131 } 13132 return responses[ finalDataType ]; 13133 } 13134} 13135 13136/* Chain conversions given the request and the original response 13137 * Also sets the responseXXX fields on the jqXHR instance 13138 */ 13139function ajaxConvert( s, response, jqXHR, isSuccess ) { 13140 var conv2, current, conv, tmp, prev, 13141 converters = {}, 13142 13143 // Work with a copy of dataTypes in case we need to modify it for conversion 13144 dataTypes = s.dataTypes.slice(); 13145 13146 // Create converters map with lowercased keys 13147 if ( dataTypes[ 1 ] ) { 13148 for ( conv in s.converters ) { 13149 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 13150 } 13151 } 13152 13153 current = dataTypes.shift(); 13154 13155 // Convert to each sequential dataType 13156 while ( current ) { 13157 13158 if ( s.responseFields[ current ] ) { 13159 jqXHR[ s.responseFields[ current ] ] = response; 13160 } 13161 13162 // Apply the dataFilter if provided 13163 if ( !prev && isSuccess && s.dataFilter ) { 13164 response = s.dataFilter( response, s.dataType ); 13165 } 13166 13167 prev = current; 13168 current = dataTypes.shift(); 13169 13170 if ( current ) { 13171 13172 // There's only work to do if current dataType is non-auto 13173 if ( current === "*" ) { 13174 13175 current = prev; 13176 13177 // Convert response if prev dataType is non-auto and differs from current 13178 } else if ( prev !== "*" && prev !== current ) { 13179 13180 // Seek a direct converter 13181 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 13182 13183 // If none found, seek a pair 13184 if ( !conv ) { 13185 for ( conv2 in converters ) { 13186 13187 // If conv2 outputs current 13188 tmp = conv2.split( " " ); 13189 if ( tmp[ 1 ] === current ) { 13190 13191 // If prev can be converted to accepted input 13192 conv = converters[ prev + " " + tmp[ 0 ] ] || 13193 converters[ "* " + tmp[ 0 ] ]; 13194 if ( conv ) { 13195 13196 // Condense equivalence converters 13197 if ( conv === true ) { 13198 conv = converters[ conv2 ]; 13199 13200 // Otherwise, insert the intermediate dataType 13201 } else if ( converters[ conv2 ] !== true ) { 13202 current = tmp[ 0 ]; 13203 dataTypes.unshift( tmp[ 1 ] ); 13204 } 13205 break; 13206 } 13207 } 13208 } 13209 } 13210 13211 // Apply converter (if not an equivalence) 13212 if ( conv !== true ) { 13213 13214 // Unless errors are allowed to bubble, catch and return them 13215 if ( conv && s.throws ) { 13216 response = conv( response ); 13217 } else { 13218 try { 13219 response = conv( response ); 13220 } catch ( e ) { 13221 return { 13222 state: "parsererror", 13223 error: conv ? e : "No conversion from " + prev + " to " + current 13224 }; 13225 } 13226 } 13227 } 13228 } 13229 } 13230 } 13231 13232 return { state: "success", data: response }; 13233} 13234 13235jQuery.extend( { 13236 13237 // Counter for holding the number of active queries 13238 active: 0, 13239 13240 // Last-Modified header cache for next request 13241 lastModified: {}, 13242 etag: {}, 13243 13244 ajaxSettings: { 13245 url: location.href, 13246 type: "GET", 13247 isLocal: rlocalProtocol.test( location.protocol ), 13248 global: true, 13249 processData: true, 13250 async: true, 13251 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 13252 13253 /* 13254 timeout: 0, 13255 data: null, 13256 dataType: null, 13257 username: null, 13258 password: null, 13259 cache: null, 13260 throws: false, 13261 traditional: false, 13262 headers: {}, 13263 */ 13264 13265 accepts: { 13266 "*": allTypes, 13267 text: "text/plain", 13268 html: "text/html", 13269 xml: "application/xml, text/xml", 13270 json: "application/json, text/javascript" 13271 }, 13272 13273 contents: { 13274 xml: /\bxml\b/, 13275 html: /\bhtml/, 13276 json: /\bjson\b/ 13277 }, 13278 13279 responseFields: { 13280 xml: "responseXML", 13281 text: "responseText", 13282 json: "responseJSON" 13283 }, 13284 13285 // Data converters 13286 // Keys separate source (or catchall "*") and destination types with a single space 13287 converters: { 13288 13289 // Convert anything to text 13290 "* text": String, 13291 13292 // Text to html (true = no transformation) 13293 "text html": true, 13294 13295 // Evaluate text as a json expression 13296 "text json": JSON.parse, 13297 13298 // Parse text as xml 13299 "text xml": jQuery.parseXML 13300 }, 13301 13302 // For options that shouldn't be deep extended: 13303 // you can add your own custom options here if 13304 // and when you create one that shouldn't be 13305 // deep extended (see ajaxExtend) 13306 flatOptions: { 13307 url: true, 13308 context: true 13309 } 13310 }, 13311 13312 // Creates a full fledged settings object into target 13313 // with both ajaxSettings and settings fields. 13314 // If target is omitted, writes into ajaxSettings. 13315 ajaxSetup: function( target, settings ) { 13316 return settings ? 13317 13318 // Building a settings object 13319 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 13320 13321 // Extending ajaxSettings 13322 ajaxExtend( jQuery.ajaxSettings, target ); 13323 }, 13324 13325 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 13326 ajaxTransport: addToPrefiltersOrTransports( transports ), 13327 13328 // Main method 13329 ajax: function( url, options ) { 13330 13331 // If url is an object, simulate pre-1.5 signature 13332 if ( typeof url === "object" ) { 13333 options = url; 13334 url = undefined; 13335 } 13336 13337 // Force options to be an object 13338 options = options || {}; 13339 13340 var transport, 13341 13342 // URL without anti-cache param 13343 cacheURL, 13344 13345 // Response headers 13346 responseHeadersString, 13347 responseHeaders, 13348 13349 // timeout handle 13350 timeoutTimer, 13351 13352 // Url cleanup var 13353 urlAnchor, 13354 13355 // Request state (becomes false upon send and true upon completion) 13356 completed, 13357 13358 // To know if global events are to be dispatched 13359 fireGlobals, 13360 13361 // Loop variable 13362 i, 13363 13364 // uncached part of the url 13365 uncached, 13366 13367 // Create the final options object 13368 s = jQuery.ajaxSetup( {}, options ), 13369 13370 // Callbacks context 13371 callbackContext = s.context || s, 13372 13373 // Context for global events is callbackContext if it is a DOM node or jQuery collection 13374 globalEventContext = s.context && 13375 ( callbackContext.nodeType || callbackContext.jquery ) ? 13376 jQuery( callbackContext ) : 13377 jQuery.event, 13378 13379 // Deferreds 13380 deferred = jQuery.Deferred(), 13381 completeDeferred = jQuery.Callbacks( "once memory" ), 13382 13383 // Status-dependent callbacks 13384 statusCode = s.statusCode || {}, 13385 13386 // Headers (they are sent all at once) 13387 requestHeaders = {}, 13388 requestHeadersNames = {}, 13389 13390 // Default abort message 13391 strAbort = "canceled", 13392 13393 // Fake xhr 13394 jqXHR = { 13395 readyState: 0, 13396 13397 // Builds headers hashtable if needed 13398 getResponseHeader: function( key ) { 13399 var match; 13400 if ( completed ) { 13401 if ( !responseHeaders ) { 13402 responseHeaders = {}; 13403 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 13404 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 13405 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 13406 .concat( match[ 2 ] ); 13407 } 13408 } 13409 match = responseHeaders[ key.toLowerCase() + " " ]; 13410 } 13411 return match == null ? null : match.join( ", " ); 13412 }, 13413 13414 // Raw string 13415 getAllResponseHeaders: function() { 13416 return completed ? responseHeadersString : null; 13417 }, 13418 13419 // Caches the header 13420 setRequestHeader: function( name, value ) { 13421 if ( completed == null ) { 13422 name = requestHeadersNames[ name.toLowerCase() ] = 13423 requestHeadersNames[ name.toLowerCase() ] || name; 13424 requestHeaders[ name ] = value; 13425 } 13426 return this; 13427 }, 13428 13429 // Overrides response content-type header 13430 overrideMimeType: function( type ) { 13431 if ( completed == null ) { 13432 s.mimeType = type; 13433 } 13434 return this; 13435 }, 13436 13437 // Status-dependent callbacks 13438 statusCode: function( map ) { 13439 var code; 13440 if ( map ) { 13441 if ( completed ) { 13442 13443 // Execute the appropriate callbacks 13444 jqXHR.always( map[ jqXHR.status ] ); 13445 } else { 13446 13447 // Lazy-add the new callbacks in a way that preserves old ones 13448 for ( code in map ) { 13449 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 13450 } 13451 } 13452 } 13453 return this; 13454 }, 13455 13456 // Cancel the request 13457 abort: function( statusText ) { 13458 var finalText = statusText || strAbort; 13459 if ( transport ) { 13460 transport.abort( finalText ); 13461 } 13462 done( 0, finalText ); 13463 return this; 13464 } 13465 }; 13466 13467 // Attach deferreds 13468 deferred.promise( jqXHR ); 13469 13470 // Add protocol if not provided (prefilters might expect it) 13471 // Handle falsy url in the settings object (trac-10093: consistency with old signature) 13472 // We also use the url parameter if available 13473 s.url = ( ( url || s.url || location.href ) + "" ) 13474 .replace( rprotocol, location.protocol + "//" ); 13475 13476 // Alias method option to type as per ticket trac-12004 13477 s.type = options.method || options.type || s.method || s.type; 13478 13479 // Extract dataTypes list 13480 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 13481 13482 // A cross-domain request is in order when the origin doesn't match the current origin. 13483 if ( s.crossDomain == null ) { 13484 urlAnchor = document.createElement( "a" ); 13485 13486 // Support: IE <=8 - 11, Edge 12 - 15 13487 // IE throws exception on accessing the href property if url is malformed, 13488 // e.g. http://example.com:80x/ 13489 try { 13490 urlAnchor.href = s.url; 13491 13492 // Support: IE <=8 - 11 only 13493 // Anchor's host property isn't correctly set when s.url is relative 13494 urlAnchor.href = urlAnchor.href; 13495 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 13496 urlAnchor.protocol + "//" + urlAnchor.host; 13497 } catch ( e ) { 13498 13499 // If there is an error parsing the URL, assume it is crossDomain, 13500 // it can be rejected by the transport if it is invalid 13501 s.crossDomain = true; 13502 } 13503 } 13504 13505 // Convert data if not already a string 13506 if ( s.data && s.processData && typeof s.data !== "string" ) { 13507 s.data = jQuery.param( s.data, s.traditional ); 13508 } 13509 13510 // Apply prefilters 13511 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 13512 13513 // If request was aborted inside a prefilter, stop there 13514 if ( completed ) { 13515 return jqXHR; 13516 } 13517 13518 // We can fire global events as of now if asked to 13519 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118) 13520 fireGlobals = jQuery.event && s.global; 13521 13522 // Watch for a new set of requests 13523 if ( fireGlobals && jQuery.active++ === 0 ) { 13524 jQuery.event.trigger( "ajaxStart" ); 13525 } 13526 13527 // Uppercase the type 13528 s.type = s.type.toUpperCase(); 13529 13530 // Determine if request has content 13531 s.hasContent = !rnoContent.test( s.type ); 13532 13533 // Save the URL in case we're toying with the If-Modified-Since 13534 // and/or If-None-Match header later on 13535 // Remove hash to simplify url manipulation 13536 cacheURL = s.url.replace( rhash, "" ); 13537 13538 // More options handling for requests with no content 13539 if ( !s.hasContent ) { 13540 13541 // Remember the hash so we can put it back 13542 uncached = s.url.slice( cacheURL.length ); 13543 13544 // If data is available and should be processed, append data to url 13545 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 13546 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 13547 13548 // trac-9682: remove data so that it's not used in an eventual retry 13549 delete s.data; 13550 } 13551 13552 // Add or update anti-cache param if needed 13553 if ( s.cache === false ) { 13554 cacheURL = cacheURL.replace( rantiCache, "$1" ); 13555 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 13556 uncached; 13557 } 13558 13559 // Put hash and anti-cache on the URL that will be requested (gh-1732) 13560 s.url = cacheURL + uncached; 13561 13562 // Change '%20' to '+' if this is encoded form body content (gh-2658) 13563 } else if ( s.data && s.processData && 13564 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 13565 s.data = s.data.replace( r20, "+" ); 13566 } 13567 13568 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 13569 if ( s.ifModified ) { 13570 if ( jQuery.lastModified[ cacheURL ] ) { 13571 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 13572 } 13573 if ( jQuery.etag[ cacheURL ] ) { 13574 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 13575 } 13576 } 13577 13578 // Set the correct header, if data is being sent 13579 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 13580 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 13581 } 13582 13583 // Set the Accepts header for the server, depending on the dataType 13584 jqXHR.setRequestHeader( 13585 "Accept", 13586 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 13587 s.accepts[ s.dataTypes[ 0 ] ] + 13588 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 13589 s.accepts[ "*" ] 13590 ); 13591 13592 // Check for headers option 13593 for ( i in s.headers ) { 13594 jqXHR.setRequestHeader( i, s.headers[ i ] ); 13595 } 13596 13597 // Allow custom headers/mimetypes and early abort 13598 if ( s.beforeSend && 13599 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 13600 13601 // Abort if not done already and return 13602 return jqXHR.abort(); 13603 } 13604 13605 // Aborting is no longer a cancellation 13606 strAbort = "abort"; 13607 13608 // Install callbacks on deferreds 13609 completeDeferred.add( s.complete ); 13610 jqXHR.done( s.success ); 13611 jqXHR.fail( s.error ); 13612 13613 // Get transport 13614 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 13615 13616 // If no transport, we auto-abort 13617 if ( !transport ) { 13618 done( -1, "No Transport" ); 13619 } else { 13620 jqXHR.readyState = 1; 13621 13622 // Send global event 13623 if ( fireGlobals ) { 13624 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 13625 } 13626 13627 // If request was aborted inside ajaxSend, stop there 13628 if ( completed ) { 13629 return jqXHR; 13630 } 13631 13632 // Timeout 13633 if ( s.async && s.timeout > 0 ) { 13634 timeoutTimer = window.setTimeout( function() { 13635 jqXHR.abort( "timeout" ); 13636 }, s.timeout ); 13637 } 13638 13639 try { 13640 completed = false; 13641 transport.send( requestHeaders, done ); 13642 } catch ( e ) { 13643 13644 // Rethrow post-completion exceptions 13645 if ( completed ) { 13646 throw e; 13647 } 13648 13649 // Propagate others as results 13650 done( -1, e ); 13651 } 13652 } 13653 13654 // Callback for when everything is done 13655 function done( status, nativeStatusText, responses, headers ) { 13656 var isSuccess, success, error, response, modified, 13657 statusText = nativeStatusText; 13658 13659 // Ignore repeat invocations 13660 if ( completed ) { 13661 return; 13662 } 13663 13664 completed = true; 13665 13666 // Clear timeout if it exists 13667 if ( timeoutTimer ) { 13668 window.clearTimeout( timeoutTimer ); 13669 } 13670 13671 // Dereference transport for early garbage collection 13672 // (no matter how long the jqXHR object will be used) 13673 transport = undefined; 13674 13675 // Cache response headers 13676 responseHeadersString = headers || ""; 13677 13678 // Set readyState 13679 jqXHR.readyState = status > 0 ? 4 : 0; 13680 13681 // Determine if successful 13682 isSuccess = status >= 200 && status < 300 || status === 304; 13683 13684 // Get response data 13685 if ( responses ) { 13686 response = ajaxHandleResponses( s, jqXHR, responses ); 13687 } 13688 13689 // Use a noop converter for missing script but not if jsonp 13690 if ( !isSuccess && 13691 jQuery.inArray( "script", s.dataTypes ) > -1 && 13692 jQuery.inArray( "json", s.dataTypes ) < 0 ) { 13693 s.converters[ "text script" ] = function() {}; 13694 } 13695 13696 // Convert no matter what (that way responseXXX fields are always set) 13697 response = ajaxConvert( s, response, jqXHR, isSuccess ); 13698 13699 // If successful, handle type chaining 13700 if ( isSuccess ) { 13701 13702 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 13703 if ( s.ifModified ) { 13704 modified = jqXHR.getResponseHeader( "Last-Modified" ); 13705 if ( modified ) { 13706 jQuery.lastModified[ cacheURL ] = modified; 13707 } 13708 modified = jqXHR.getResponseHeader( "etag" ); 13709 if ( modified ) { 13710 jQuery.etag[ cacheURL ] = modified; 13711 } 13712 } 13713 13714 // if no content 13715 if ( status === 204 || s.type === "HEAD" ) { 13716 statusText = "nocontent"; 13717 13718 // if not modified 13719 } else if ( status === 304 ) { 13720 statusText = "notmodified"; 13721 13722 // If we have data, let's convert it 13723 } else { 13724 statusText = response.state; 13725 success = response.data; 13726 error = response.error; 13727 isSuccess = !error; 13728 } 13729 } else { 13730 13731 // Extract error from statusText and normalize for non-aborts 13732 error = statusText; 13733 if ( status || !statusText ) { 13734 statusText = "error"; 13735 if ( status < 0 ) { 13736 status = 0; 13737 } 13738 } 13739 } 13740 13741 // Set data for the fake xhr object 13742 jqXHR.status = status; 13743 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 13744 13745 // Success/Error 13746 if ( isSuccess ) { 13747 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 13748 } else { 13749 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 13750 } 13751 13752 // Status-dependent callbacks 13753 jqXHR.statusCode( statusCode ); 13754 statusCode = undefined; 13755 13756 if ( fireGlobals ) { 13757 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 13758 [ jqXHR, s, isSuccess ? success : error ] ); 13759 } 13760 13761 // Complete 13762 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 13763 13764 if ( fireGlobals ) { 13765 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 13766 13767 // Handle the global AJAX counter 13768 if ( !( --jQuery.active ) ) { 13769 jQuery.event.trigger( "ajaxStop" ); 13770 } 13771 } 13772 } 13773 13774 return jqXHR; 13775 }, 13776 13777 getJSON: function( url, data, callback ) { 13778 return jQuery.get( url, data, callback, "json" ); 13779 }, 13780 13781 getScript: function( url, callback ) { 13782 return jQuery.get( url, undefined, callback, "script" ); 13783 } 13784} ); 13785 13786jQuery.each( [ "get", "post" ], function( _i, method ) { 13787 jQuery[ method ] = function( url, data, callback, type ) { 13788 13789 // Shift arguments if data argument was omitted 13790 if ( isFunction( data ) ) { 13791 type = type || callback; 13792 callback = data; 13793 data = undefined; 13794 } 13795 13796 // The url can be an options object (which then must have .url) 13797 return jQuery.ajax( jQuery.extend( { 13798 url: url, 13799 type: method, 13800 dataType: type, 13801 data: data, 13802 success: callback 13803 }, jQuery.isPlainObject( url ) && url ) ); 13804 }; 13805} ); 13806 13807jQuery.ajaxPrefilter( function( s ) { 13808 var i; 13809 for ( i in s.headers ) { 13810 if ( i.toLowerCase() === "content-type" ) { 13811 s.contentType = s.headers[ i ] || ""; 13812 } 13813 } 13814} ); 13815 13816 13817jQuery._evalUrl = function( url, options, doc ) { 13818 return jQuery.ajax( { 13819 url: url, 13820 13821 // Make this explicit, since user can override this through ajaxSetup (trac-11264) 13822 type: "GET", 13823 dataType: "script", 13824 cache: true, 13825 async: false, 13826 global: false, 13827 13828 // Only evaluate the response if it is successful (gh-4126) 13829 // dataFilter is not invoked for failure responses, so using it instead 13830 // of the default converter is kludgy but it works. 13831 converters: { 13832 "text script": function() {} 13833 }, 13834 dataFilter: function( response ) { 13835 jQuery.globalEval( response, options, doc ); 13836 } 13837 } ); 13838}; 13839 13840 13841jQuery.fn.extend( { 13842 wrapAll: function( html ) { 13843 var wrap; 13844 13845 if ( this[ 0 ] ) { 13846 if ( isFunction( html ) ) { 13847 html = html.call( this[ 0 ] ); 13848 } 13849 13850 // The elements to wrap the target around 13851 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 13852 13853 if ( this[ 0 ].parentNode ) { 13854 wrap.insertBefore( this[ 0 ] ); 13855 } 13856 13857 wrap.map( function() { 13858 var elem = this; 13859 13860 while ( elem.firstElementChild ) { 13861 elem = elem.firstElementChild; 13862 } 13863 13864 return elem; 13865 } ).append( this ); 13866 } 13867 13868 return this; 13869 }, 13870 13871 wrapInner: function( html ) { 13872 if ( isFunction( html ) ) { 13873 return this.each( function( i ) { 13874 jQuery( this ).wrapInner( html.call( this, i ) ); 13875 } ); 13876 } 13877 13878 return this.each( function() { 13879 var self = jQuery( this ), 13880 contents = self.contents(); 13881 13882 if ( contents.length ) { 13883 contents.wrapAll( html ); 13884 13885 } else { 13886 self.append( html ); 13887 } 13888 } ); 13889 }, 13890 13891 wrap: function( html ) { 13892 var htmlIsFunction = isFunction( html ); 13893 13894 return this.each( function( i ) { 13895 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 13896 } ); 13897 }, 13898 13899 unwrap: function( selector ) { 13900 this.parent( selector ).not( "body" ).each( function() { 13901 jQuery( this ).replaceWith( this.childNodes ); 13902 } ); 13903 return this; 13904 } 13905} ); 13906 13907 13908jQuery.expr.pseudos.hidden = function( elem ) { 13909 return !jQuery.expr.pseudos.visible( elem ); 13910}; 13911jQuery.expr.pseudos.visible = function( elem ) { 13912 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 13913}; 13914 13915 13916 13917 13918jQuery.ajaxSettings.xhr = function() { 13919 try { 13920 return new window.XMLHttpRequest(); 13921 } catch ( e ) {} 13922}; 13923 13924var xhrSuccessStatus = { 13925 13926 // File protocol always yields status code 0, assume 200 13927 0: 200, 13928 13929 // Support: IE <=9 only 13930 // trac-1450: sometimes IE returns 1223 when it should be 204 13931 1223: 204 13932 }, 13933 xhrSupported = jQuery.ajaxSettings.xhr(); 13934 13935support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 13936support.ajax = xhrSupported = !!xhrSupported; 13937 13938jQuery.ajaxTransport( function( options ) { 13939 var callback, errorCallback; 13940 13941 // Cross domain only allowed if supported through XMLHttpRequest 13942 if ( support.cors || xhrSupported && !options.crossDomain ) { 13943 return { 13944 send: function( headers, complete ) { 13945 var i, 13946 xhr = options.xhr(); 13947 13948 xhr.open( 13949 options.type, 13950 options.url, 13951 options.async, 13952 options.username, 13953 options.password 13954 ); 13955 13956 // Apply custom fields if provided 13957 if ( options.xhrFields ) { 13958 for ( i in options.xhrFields ) { 13959 xhr[ i ] = options.xhrFields[ i ]; 13960 } 13961 } 13962 13963 // Override mime type if needed 13964 if ( options.mimeType && xhr.overrideMimeType ) { 13965 xhr.overrideMimeType( options.mimeType ); 13966 } 13967 13968 // X-Requested-With header 13969 // For cross-domain requests, seeing as conditions for a preflight are 13970 // akin to a jigsaw puzzle, we simply never set it to be sure. 13971 // (it can always be set on a per-request basis or even using ajaxSetup) 13972 // For same-domain requests, won't change header if already provided. 13973 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 13974 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 13975 } 13976 13977 // Set headers 13978 for ( i in headers ) { 13979 xhr.setRequestHeader( i, headers[ i ] ); 13980 } 13981 13982 // Callback 13983 callback = function( type ) { 13984 return function() { 13985 if ( callback ) { 13986 callback = errorCallback = xhr.onload = 13987 xhr.onerror = xhr.onabort = xhr.ontimeout = 13988 xhr.onreadystatechange = null; 13989 13990 if ( type === "abort" ) { 13991 xhr.abort(); 13992 } else if ( type === "error" ) { 13993 13994 // Support: IE <=9 only 13995 // On a manual native abort, IE9 throws 13996 // errors on any property access that is not readyState 13997 if ( typeof xhr.status !== "number" ) { 13998 complete( 0, "error" ); 13999 } else { 14000 complete( 14001 14002 // File: protocol always yields status 0; see trac-8605, trac-14207 14003 xhr.status, 14004 xhr.statusText 14005 ); 14006 } 14007 } else { 14008 complete( 14009 xhrSuccessStatus[ xhr.status ] || xhr.status, 14010 xhr.statusText, 14011 14012 // Support: IE <=9 only 14013 // IE9 has no XHR2 but throws on binary (trac-11426) 14014 // For XHR2 non-text, let the caller handle it (gh-2498) 14015 ( xhr.responseType || "text" ) !== "text" || 14016 typeof xhr.responseText !== "string" ? 14017 { binary: xhr.response } : 14018 { text: xhr.responseText }, 14019 xhr.getAllResponseHeaders() 14020 ); 14021 } 14022 } 14023 }; 14024 }; 14025 14026 // Listen to events 14027 xhr.onload = callback(); 14028 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 14029 14030 // Support: IE 9 only 14031 // Use onreadystatechange to replace onabort 14032 // to handle uncaught aborts 14033 if ( xhr.onabort !== undefined ) { 14034 xhr.onabort = errorCallback; 14035 } else { 14036 xhr.onreadystatechange = function() { 14037 14038 // Check readyState before timeout as it changes 14039 if ( xhr.readyState === 4 ) { 14040 14041 // Allow onerror to be called first, 14042 // but that will not handle a native abort 14043 // Also, save errorCallback to a variable 14044 // as xhr.onerror cannot be accessed 14045 window.setTimeout( function() { 14046 if ( callback ) { 14047 errorCallback(); 14048 } 14049 } ); 14050 } 14051 }; 14052 } 14053 14054 // Create the abort callback 14055 callback = callback( "abort" ); 14056 14057 try { 14058 14059 // Do send the request (this may raise an exception) 14060 xhr.send( options.hasContent && options.data || null ); 14061 } catch ( e ) { 14062 14063 // trac-14683: Only rethrow if this hasn't been notified as an error yet 14064 if ( callback ) { 14065 throw e; 14066 } 14067 } 14068 }, 14069 14070 abort: function() { 14071 if ( callback ) { 14072 callback(); 14073 } 14074 } 14075 }; 14076 } 14077} ); 14078 14079 14080 14081 14082// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 14083jQuery.ajaxPrefilter( function( s ) { 14084 if ( s.crossDomain ) { 14085 s.contents.script = false; 14086 } 14087} ); 14088 14089// Install script dataType 14090jQuery.ajaxSetup( { 14091 accepts: { 14092 script: "text/javascript, application/javascript, " + 14093 "application/ecmascript, application/x-ecmascript" 14094 }, 14095 contents: { 14096 script: /\b(?:java|ecma)script\b/ 14097 }, 14098 converters: { 14099 "text script": function( text ) { 14100 jQuery.globalEval( text ); 14101 return text; 14102 } 14103 } 14104} ); 14105 14106// Handle cache's special case and crossDomain 14107jQuery.ajaxPrefilter( "script", function( s ) { 14108 if ( s.cache === undefined ) { 14109 s.cache = false; 14110 } 14111 if ( s.crossDomain ) { 14112 s.type = "GET"; 14113 } 14114} ); 14115 14116// Bind script tag hack transport 14117jQuery.ajaxTransport( "script", function( s ) { 14118 14119 // This transport only deals with cross domain or forced-by-attrs requests 14120 if ( s.crossDomain || s.scriptAttrs ) { 14121 var script, callback; 14122 return { 14123 send: function( _, complete ) { 14124 script = jQuery( "<script>" ) 14125 .attr( s.scriptAttrs || {} ) 14126 .prop( { charset: s.scriptCharset, src: s.url } ) 14127 .on( "load error", callback = function( evt ) { 14128 script.remove(); 14129 callback = null; 14130 if ( evt ) { 14131 complete( evt.type === "error" ? 404 : 200, evt.type ); 14132 } 14133 } ); 14134 14135 // Use native DOM manipulation to avoid our domManip AJAX trickery 14136 document.head.appendChild( script[ 0 ] ); 14137 }, 14138 abort: function() { 14139 if ( callback ) { 14140 callback(); 14141 } 14142 } 14143 }; 14144 } 14145} ); 14146 14147 14148 14149 14150var oldCallbacks = [], 14151 rjsonp = /(=)\?(?=&|$)|\?\?/; 14152 14153// Default jsonp settings 14154jQuery.ajaxSetup( { 14155 jsonp: "callback", 14156 jsonpCallback: function() { 14157 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 14158 this[ callback ] = true; 14159 return callback; 14160 } 14161} ); 14162 14163// Detect, normalize options and install callbacks for jsonp requests 14164jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 14165 14166 var callbackName, overwritten, responseContainer, 14167 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 14168 "url" : 14169 typeof s.data === "string" && 14170 ( s.contentType || "" ) 14171 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 14172 rjsonp.test( s.data ) && "data" 14173 ); 14174 14175 // Handle iff the expected data type is "jsonp" or we have a parameter to set 14176 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 14177 14178 // Get callback name, remembering preexisting value associated with it 14179 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 14180 s.jsonpCallback() : 14181 s.jsonpCallback; 14182 14183 // Insert callback into url or form data 14184 if ( jsonProp ) { 14185 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 14186 } else if ( s.jsonp !== false ) { 14187 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 14188 } 14189 14190 // Use data converter to retrieve json after script execution
vendor: 8,362 bytes, lines 14191-14502
14191 s.converters[ "script json" ] = function() { 14192 if ( !responseContainer ) { 14193 jQuery.error( callbackName + " was not called" ); 14194 } 14195 return responseContainer[ 0 ]; 14196 }; 14197 14198 // Force json dataType 14199 s.dataTypes[ 0 ] = "json"; 14200 14201 // Install callback 14202 overwritten = window[ callbackName ]; 14203 window[ callbackName ] = function() { 14204 responseContainer = arguments; 14205 }; 14206 14207 // Clean-up function (fires after converters) 14208 jqXHR.always( function() { 14209 14210 // If previous value didn't exist - remove it 14211 if ( overwritten === undefined ) { 14212 jQuery( window ).removeProp( callbackName ); 14213 14214 // Otherwise restore preexisting value 14215 } else { 14216 window[ callbackName ] = overwritten; 14217 } 14218 14219 // Save back as free 14220 if ( s[ callbackName ] ) { 14221 14222 // Make sure that re-using the options doesn't screw things around 14223 s.jsonpCallback = originalSettings.jsonpCallback; 14224 14225 // Save the callback name for future use 14226 oldCallbacks.push( callbackName ); 14227 } 14228 14229 // Call if it was a function and we have a response 14230 if ( responseContainer && isFunction( overwritten ) ) { 14231 overwritten( responseContainer[ 0 ] ); 14232 } 14233 14234 responseContainer = overwritten = undefined; 14235 } ); 14236 14237 // Delegate to script 14238 return "script"; 14239 } 14240} ); 14241 14242 14243 14244 14245// Support: Safari 8 only 14246// In Safari 8 documents created via document.implementation.createHTMLDocument 14247// collapse sibling forms: the second one becomes a child of the first one. 14248// Because of that, this security measure has to be disabled in Safari 8. 14249// https://bugs.webkit.org/show_bug.cgi?id=137337 14250support.createHTMLDocument = ( function() { 14251 var body = document.implementation.createHTMLDocument( "" ).body; 14252 body.innerHTML = "<form></form><form></form>"; 14253 return body.childNodes.length === 2; 14254} )(); 14255 14256 14257// Argument "data" should be string of html 14258// context (optional): If specified, the fragment will be created in this context, 14259// defaults to document 14260// keepScripts (optional): If true, will include scripts passed in the html string 14261jQuery.parseHTML = function( data, context, keepScripts ) { 14262 if ( typeof data !== "string" ) { 14263 return []; 14264 } 14265 if ( typeof context === "boolean" ) { 14266 keepScripts = context; 14267 context = false; 14268 } 14269 14270 var base, parsed, scripts; 14271 14272 if ( !context ) { 14273 14274 // Stop scripts or inline event handlers from being executed immediately 14275 // by using document.implementation 14276 if ( support.createHTMLDocument ) { 14277 context = document.implementation.createHTMLDocument( "" ); 14278 14279 // Set the base href for the created document 14280 // so any parsed elements with URLs 14281 // are based on the document's URL (gh-2965) 14282 base = context.createElement( "base" ); 14283 base.href = document.location.href; 14284 context.head.appendChild( base ); 14285 } else { 14286 context = document; 14287 } 14288 } 14289 14290 parsed = rsingleTag.exec( data ); 14291 scripts = !keepScripts && []; 14292 14293 // Single tag 14294 if ( parsed ) { 14295 return [ context.createElement( parsed[ 1 ] ) ]; 14296 } 14297 14298 parsed = buildFragment( [ data ], context, scripts ); 14299 14300 if ( scripts && scripts.length ) { 14301 jQuery( scripts ).remove(); 14302 } 14303 14304 return jQuery.merge( [], parsed.childNodes ); 14305}; 14306 14307 14308/** 14309 * Load a url into a page 14310 */ 14311jQuery.fn.load = function( url, params, callback ) { 14312 var selector, type, response, 14313 self = this, 14314 off = url.indexOf( " " ); 14315 14316 if ( off > -1 ) { 14317 selector = stripAndCollapse( url.slice( off ) ); 14318 url = url.slice( 0, off ); 14319 } 14320 14321 // If it's a function 14322 if ( isFunction( params ) ) { 14323 14324 // We assume that it's the callback 14325 callback = params; 14326 params = undefined; 14327 14328 // Otherwise, build a param string 14329 } else if ( params && typeof params === "object" ) { 14330 type = "POST"; 14331 } 14332 14333 // If we have elements to modify, make the request 14334 if ( self.length > 0 ) { 14335 jQuery.ajax( { 14336 url: url, 14337 14338 // If "type" variable is undefined, then "GET" method will be used. 14339 // Make value of this field explicit since 14340 // user can override it through ajaxSetup method 14341 type: type || "GET", 14342 dataType: "html", 14343 data: params 14344 } ).done( function( responseText ) { 14345 14346 // Save response for use in complete callback 14347 response = arguments; 14348 14349 self.html( selector ? 14350 14351 // If a selector was specified, locate the right elements in a dummy div 14352 // Exclude scripts to avoid IE 'Permission Denied' errors 14353 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 14354 14355 // Otherwise use the full result 14356 responseText ); 14357 14358 // If the request succeeds, this function gets "data", "status", "jqXHR" 14359 // but they are ignored because response was set above. 14360 // If it fails, this function gets "jqXHR", "status", "error" 14361 } ).always( callback && function( jqXHR, status ) { 14362 self.each( function() { 14363 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 14364 } ); 14365 } ); 14366 } 14367 14368 return this; 14369}; 14370 14371 14372 14373 14374jQuery.expr.pseudos.animated = function( elem ) { 14375 return jQuery.grep( jQuery.timers, function( fn ) { 14376 return elem === fn.elem; 14377 } ).length; 14378}; 14379 14380 14381 14382 14383jQuery.offset = { 14384 setOffset: function( elem, options, i ) { 14385 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 14386 position = jQuery.css( elem, "position" ), 14387 curElem = jQuery( elem ), 14388 props = {}; 14389 14390 // Set position first, in-case top/left are set even on static elem 14391 if ( position === "static" ) { 14392 elem.style.position = "relative"; 14393 } 14394 14395 curOffset = curElem.offset(); 14396 curCSSTop = jQuery.css( elem, "top" ); 14397 curCSSLeft = jQuery.css( elem, "left" ); 14398 calculatePosition = ( position === "absolute" || position === "fixed" ) && 14399 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 14400 14401 // Need to be able to calculate position if either 14402 // top or left is auto and position is either absolute or fixed 14403 if ( calculatePosition ) { 14404 curPosition = curElem.position(); 14405 curTop = curPosition.top; 14406 curLeft = curPosition.left; 14407 14408 } else { 14409 curTop = parseFloat( curCSSTop ) || 0; 14410 curLeft = parseFloat( curCSSLeft ) || 0; 14411 } 14412 14413 if ( isFunction( options ) ) { 14414 14415 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 14416 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 14417 } 14418 14419 if ( options.top != null ) { 14420 props.top = ( options.top - curOffset.top ) + curTop; 14421 } 14422 if ( options.left != null ) { 14423 props.left = ( options.left - curOffset.left ) + curLeft; 14424 } 14425 14426 if ( "using" in options ) { 14427 options.using.call( elem, props ); 14428 14429 } else { 14430 curElem.css( props ); 14431 } 14432 } 14433}; 14434 14435jQuery.fn.extend( { 14436 14437 // offset() relates an element's border box to the document origin 14438 offset: function( options ) { 14439 14440 // Preserve chaining for setter 14441 if ( arguments.length ) { 14442 return options === undefined ? 14443 this : 14444 this.each( function( i ) { 14445 jQuery.offset.setOffset( this, options, i ); 14446 } ); 14447 } 14448 14449 var rect, win, 14450 elem = this[ 0 ]; 14451 14452 if ( !elem ) { 14453 return; 14454 } 14455 14456 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 14457 // Support: IE <=11 only 14458 // Running getBoundingClientRect on a 14459 // disconnected node in IE throws an error 14460 if ( !elem.getClientRects().length ) { 14461 return { top: 0, left: 0 }; 14462 } 14463 14464 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 14465 rect = elem.getBoundingClientRect(); 14466 win = elem.ownerDocument.defaultView; 14467 return { 14468 top: rect.top + win.pageYOffset, 14469 left: rect.left + win.pageXOffset 14470 }; 14471 }, 14472 14473 // position() relates an element's margin box to its offset parent's padding box 14474 // This corresponds to the behavior of CSS absolute positioning 14475 position: function() { 14476 if ( !this[ 0 ] ) { 14477 return; 14478 } 14479 14480 var offsetParent, offset, doc, 14481 elem = this[ 0 ], 14482 parentOffset = { top: 0, left: 0 }; 14483 14484 // position:fixed elements are offset from the viewport, which itself always has zero offset 14485 if ( jQuery.css( elem, "position" ) === "fixed" ) { 14486 14487 // Assume position:fixed implies availability of getBoundingClientRect 14488 offset = elem.getBoundingClientRect(); 14489 14490 } else { 14491 offset = this.offset(); 14492 14493 // Account for the *real* offset parent, which can be the document or its root element 14494 // when a statically positioned element is identified 14495 doc = elem.ownerDocument; 14496 offsetParent = elem.offsetParent || doc.documentElement; 14497 while ( offsetParent && 14498 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 14499 jQuery.css( offsetParent, "position" ) === "static" ) { 14500 14501 offsetParent = offsetParent.parentNode; 14502 }
vendor: 9,677 bytes, lines 14503-14840
14503 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 14504 14505 // Incorporate borders into its offset, since they are outside its content origin 14506 parentOffset = jQuery( offsetParent ).offset(); 14507 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 14508 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 14509 } 14510 } 14511 14512 // Subtract parent offsets and element margins 14513 return { 14514 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 14515 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 14516 }; 14517 }, 14518 14519 // This method will return documentElement in the following cases: 14520 // 1) For the element inside the iframe without offsetParent, this method will return 14521 // documentElement of the parent window 14522 // 2) For the hidden or detached element 14523 // 3) For body or html element, i.e. in case of the html node - it will return itself 14524 // 14525 // but those exceptions were never presented as a real life use-cases 14526 // and might be considered as more preferable results. 14527 // 14528 // This logic, however, is not guaranteed and can change at any point in the future 14529 offsetParent: function() { 14530 return this.map( function() { 14531 var offsetParent = this.offsetParent; 14532 14533 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 14534 offsetParent = offsetParent.offsetParent; 14535 } 14536 14537 return offsetParent || documentElement; 14538 } ); 14539 } 14540} ); 14541 14542// Create scrollLeft and scrollTop methods 14543jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 14544 var top = "pageYOffset" === prop; 14545 14546 jQuery.fn[ method ] = function( val ) { 14547 return access( this, function( elem, method, val ) { 14548 14549 // Coalesce documents and windows 14550 var win; 14551 if ( isWindow( elem ) ) { 14552 win = elem; 14553 } else if ( elem.nodeType === 9 ) { 14554 win = elem.defaultView; 14555 } 14556 14557 if ( val === undefined ) { 14558 return win ? win[ prop ] : elem[ method ]; 14559 } 14560 14561 if ( win ) { 14562 win.scrollTo( 14563 !top ? val : win.pageXOffset, 14564 top ? val : win.pageYOffset 14565 ); 14566 14567 } else { 14568 elem[ method ] = val; 14569 } 14570 }, method, val, arguments.length ); 14571 }; 14572} ); 14573 14574// Support: Safari <=7 - 9.1, Chrome <=37 - 49 14575// Add the top/left cssHooks using jQuery.fn.position 14576// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 14577// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 14578// getComputedStyle returns percent when specified for top/left/bottom/right; 14579// rather than make the css module depend on the offset module, just check for it here 14580jQuery.each( [ "top", "left" ], function( _i, prop ) { 14581 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 14582 function( elem, computed ) { 14583 if ( computed ) { 14584 computed = curCSS( elem, prop ); 14585 14586 // If curCSS returns percentage, fallback to offset 14587 return rnumnonpx.test( computed ) ? 14588 jQuery( elem ).position()[ prop ] + "px" : 14589 computed; 14590 } 14591 } 14592 ); 14593} ); 14594 14595 14596// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 14597jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 14598 jQuery.each( { 14599 padding: "inner" + name, 14600 content: type, 14601 "": "outer" + name 14602 }, function( defaultExtra, funcName ) { 14603 14604 // Margin is only for outerHeight, outerWidth 14605 jQuery.fn[ funcName ] = function( margin, value ) { 14606 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 14607 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 14608 14609 return access( this, function( elem, type, value ) { 14610 var doc; 14611 14612 if ( isWindow( elem ) ) { 14613 14614 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 14615 return funcName.indexOf( "outer" ) === 0 ? 14616 elem[ "inner" + name ] : 14617 elem.document.documentElement[ "client" + name ]; 14618 } 14619 14620 // Get document width or height 14621 if ( elem.nodeType === 9 ) { 14622 doc = elem.documentElement; 14623 14624 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 14625 // whichever is greatest 14626 return Math.max( 14627 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 14628 elem.body[ "offset" + name ], doc[ "offset" + name ], 14629 doc[ "client" + name ] 14630 ); 14631 } 14632 14633 return value === undefined ? 14634 14635 // Get width or height on the element, requesting but not forcing parseFloat 14636 jQuery.css( elem, type, extra ) : 14637 14638 // Set width or height on the element 14639 jQuery.style( elem, type, value, extra ); 14640 }, type, chainable ? margin : undefined, chainable ); 14641 }; 14642 } ); 14643} ); 14644 14645 14646jQuery.each( [ 14647 "ajaxStart", 14648 "ajaxStop", 14649 "ajaxComplete", 14650 "ajaxError", 14651 "ajaxSuccess", 14652 "ajaxSend" 14653], function( _i, type ) { 14654 jQuery.fn[ type ] = function( fn ) { 14655 return this.on( type, fn ); 14656 }; 14657} ); 14658 14659 14660 14661 14662jQuery.fn.extend( { 14663 14664 bind: function( types, data, fn ) { 14665 return this.on( types, null, data, fn ); 14666 }, 14667 unbind: function( types, fn ) { 14668 return this.off( types, null, fn ); 14669 }, 14670 14671 delegate: function( selector, types, data, fn ) { 14672 return this.on( types, selector, data, fn ); 14673 }, 14674 undelegate: function( selector, types, fn ) { 14675 14676 // ( namespace ) or ( selector, types [, fn] ) 14677 return arguments.length === 1 ? 14678 this.off( selector, "**" ) : 14679 this.off( types, selector || "**", fn ); 14680 }, 14681 14682 hover: function( fnOver, fnOut ) { 14683 return this 14684 .on( "mouseenter", fnOver ) 14685 .on( "mouseleave", fnOut || fnOver ); 14686 } 14687} ); 14688 14689jQuery.each( 14690 ( "blur focus focusin focusout resize scroll click dblclick " + 14691 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 14692 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 14693 function( _i, name ) { 14694 14695 // Handle event binding 14696 jQuery.fn[ name ] = function( data, fn ) { 14697 return arguments.length > 0 ? 14698 this.on( name, null, data, fn ) : 14699 this.trigger( name ); 14700 }; 14701 } 14702); 14703 14704 14705 14706 14707// Support: Android <=4.0 only 14708// Make sure we trim BOM and NBSP 14709// Require that the "whitespace run" starts from a non-whitespace 14710// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. 14711var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; 14712 14713// Bind a function to a context, optionally partially applying any 14714// arguments. 14715// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 14716// However, it is not slated for removal any time soon 14717jQuery.proxy = function( fn, context ) { 14718 var tmp, args, proxy; 14719 14720 if ( typeof context === "string" ) { 14721 tmp = fn[ context ]; 14722 context = fn; 14723 fn = tmp; 14724 } 14725 14726 // Quick check to determine if target is callable, in the spec 14727 // this throws a TypeError, but we will just return undefined. 14728 if ( !isFunction( fn ) ) { 14729 return undefined; 14730 } 14731 14732 // Simulated bind 14733 args = slice.call( arguments, 2 ); 14734 proxy = function() { 14735 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 14736 }; 14737 14738 // Set the guid of unique handler to the same of original handler, so it can be removed 14739 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 14740 14741 return proxy; 14742}; 14743 14744jQuery.holdReady = function( hold ) { 14745 if ( hold ) { 14746 jQuery.readyWait++; 14747 } else { 14748 jQuery.ready( true ); 14749 } 14750}; 14751jQuery.isArray = Array.isArray; 14752jQuery.parseJSON = JSON.parse; 14753jQuery.nodeName = nodeName; 14754jQuery.isFunction = isFunction; 14755jQuery.isWindow = isWindow; 14756jQuery.camelCase = camelCase; 14757jQuery.type = toType; 14758 14759jQuery.now = Date.now; 14760 14761jQuery.isNumeric = function( obj ) { 14762 14763 // As of jQuery 3.0, isNumeric is limited to 14764 // strings and numbers (primitives or objects) 14765 // that can be coerced to finite numbers (gh-2662) 14766 var type = jQuery.type( obj ); 14767 return ( type === "number" || type === "string" ) && 14768 14769 // parseFloat NaNs numeric-cast false positives ("") 14770 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 14771 // subtraction forces infinities to NaN 14772 !isNaN( obj - parseFloat( obj ) ); 14773}; 14774 14775jQuery.trim = function( text ) { 14776 return text == null ? 14777 "" : 14778 ( text + "" ).replace( rtrim, "$1" ); 14779}; 14780 14781 14782 14783// Register as a named AMD module, since jQuery can be concatenated with other 14784// files that may use define, but not via a proper concatenation script that 14785// understands anonymous AMD modules. A named AMD is safest and most robust 14786// way to register. Lowercase jquery is used because AMD module names are 14787// derived from file names, and jQuery is normally delivered in a lowercase 14788// file name. Do this after creating the global so that if an AMD module wants 14789// to call noConflict to hide this version of jQuery, it will work. 14790 14791// Note that for maximum portability, libraries that are not jQuery should 14792// declare themselves as anonymous modules, and avoid setting a global if an 14793// AMD loader is present. jQuery is a special case. For more information, see 14794// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 14795 14796if ( true ) { 14797 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 14798 return jQuery; 14799 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 14800 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 14801} 14802 14803 14804 14805 14806var 14807 14808 // Map over jQuery in case of overwrite 14809 _jQuery = window.jQuery, 14810 14811 // Map over the $ in case of overwrite 14812 _$ = window.$; 14813 14814jQuery.noConflict = function( deep ) { 14815 if ( window.$ === jQuery ) { 14816 window.$ = _$; 14817 } 14818 14819 if ( deep && window.jQuery === jQuery ) { 14820 window.jQuery = _jQuery; 14821 } 14822 14823 return jQuery; 14824}; 14825 14826// Expose jQuery and $ identifiers, even in AMD 14827// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557) 14828// and CommonJS for browser emulators (trac-13566) 14829if ( typeof noGlobal === "undefined" ) { 14830 window.jQuery = window.$ = jQuery; 14831} 14832 14833 14834 14835 14836return jQuery; 14837} ); 14838 14839 14840/***/ }
14840), 14841 14842/***/ 5338: 14843/***/ ((__unused_webpack_module, exports, __webpack_require__) => { 14844 14845"use strict"; 14846 14847 14848var m = __webpack_require__(4500); 14849if (true) { 14850 exports.createRoot = m.createRoot; 14851 exports.hydrateRoot = m.hydrateRoot; 14852} else { var i; } 14853 14854 14855/***/ }), 14856 14857/***/ 1020: 14858/***/ ((__unused_webpack_module, exports, __webpack_require__) => { 14859 14860"use strict"; 14861/** 14862 * @license React 14863 * react-jsx-runtime.production.min.js 14864 * 14865 * Copyright (c) Facebook, Inc. and its affiliates. 14866 * 14867 * This source code is licensed under the MIT license found in the 14868 * LICENSE file in the root directory of this source tree. 14869 */ 14870var f=__webpack_require__(3328),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0}; 14871function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q; 14872 14873 14874/***/ }), 14875 14876/***/ 4848: 14877/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 14878 14879"use strict"; 14880 14881 14882if (true) { 14883 module.exports = __webpack_require__(1020); 14884} else {} 14885 14886 14887/***/ }), 14888 14889/***/ 5072: 14890/***/ ((module) => { 14891 14892"use strict"; 14893 14894 14895var stylesInDOM = []; 14896function getIndexByIdentifier(identifier) { 14897 var result = -1; 14898 for (var i = 0; i < stylesInDOM.length; i++) { 14899 if (stylesInDOM[i].identifier === identifier) { 14900 result = i; 14901 break; 14902 } 14903 } 14904 return result; 14905} 14906function modulesToDom(list, options) { 14907 var idCountMap = {}; 14908 var identifiers = []; 14909 for (var i = 0; i < list.length; i++) { 14910 var item = list[i]; 14911 var id = options.base ? item[0] + options.base : item[0]; 14912 var count = idCountMap[id] || 0; 14913 var identifier = "".concat(id, " ").concat(count); 14914 idCountMap[id] = count + 1; 14915 var indexByIdentifier = getIndexByIdentifier(identifier); 14916 var obj = { 14917 css: item[1], 14918 media: item[2], 14919 sourceMap: item[3], 14920 supports: item[4], 14921 layer: item[5] 14922 }; 14923 if (indexByIdentifier !== -1) { 14924 stylesInDOM[indexByIdentifier].references++; 14925 stylesInDOM[indexByIdentifier].updater(obj); 14926 } else { 14927 var updater = addElementStyle(obj, options); 14928 options.byIndex = i; 14929 stylesInDOM.splice(i, 0, { 14930 identifier: identifier, 14931 updater: updater, 14932 references: 1 14933 }); 14934 } 14935 identifiers.push(identifier); 14936 } 14937 return identifiers; 14938} 14939function addElementStyle(obj, options) { 14940 var api = options.domAPI(options); 14941 api.update(obj); 14942 var updater = function updater(newObj) { 14943 if (newObj) { 14944 if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) { 14945 return; 14946 } 14947 api.update(obj = newObj); 14948 } else { 14949 api.remove(); 14950 } 14951 }; 14952 return updater; 14953} 14954module.exports = function (list, options) { 14955 options = options || {}; 14956 list = list || []; 14957 var lastIdentifiers = modulesToDom(list, options); 14958 return function update(newList) { 14959 newList = newList || []; 14960 for (var i = 0; i < lastIdentifiers.length; i++) { 14961 var identifier = lastIdentifiers[i]; 14962 var index = getIndexByIdentifier(identifier); 14963 stylesInDOM[index].references--; 14964 } 14965 var newLastIdentifiers = modulesToDom(newList, options); 14966 for (var _i = 0; _i < lastIdentifiers.length; _i++) { 14967 var _identifier = lastIdentifiers[_i]; 14968 var _index = getIndexByIdentifier(_identifier); 14969 if (stylesInDOM[_index].references === 0) { 14970 stylesInDOM[_index].updater(); 14971 stylesInDOM.splice(_index, 1); 14972 } 14973 } 14974 lastIdentifiers = newLastIdentifiers; 14975 }; 14976}; 14977 14978/***/ }), 14979 14980/***/ 7659: 14981/***/ ((module) => { 14982 14983"use strict"; 14984 14985 14986var memo = {}; 14987 14988/* istanbul ignore next */ 14989function getTarget(target) { 14990 if (typeof memo[target] === "undefined") { 14991 var styleTarget = document.querySelector(target); 14992 14993 // Special case to return head of iframe instead of iframe itself 14994 if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
vendor: 4,337 bytes, lines 14995-15166
14995 try { 14996 // This will throw an exception if access to iframe is blocked 14997 // due to cross-origin restrictions 14998 styleTarget = styleTarget.contentDocument.head; 14999 } catch (e) { 15000 // istanbul ignore next 15001 styleTarget = null; 15002 } 15003 } 15004 memo[target] = styleTarget; 15005 } 15006 return memo[target]; 15007} 15008 15009/* istanbul ignore next */ 15010function insertBySelector(insert, style) { 15011 var target = getTarget(insert); 15012 if (!target) { 15013 throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); 15014 } 15015 target.appendChild(style); 15016} 15017module.exports = insertBySelector; 15018 15019/***/ }), 15020 15021/***/ 540: 15022/***/ ((module) => { 15023 15024"use strict"; 15025 15026 15027/* istanbul ignore next */ 15028function insertStyleElement(options) { 15029 var element = document.createElement("style"); 15030 options.setAttributes(element, options.attributes); 15031 options.insert(element, options.options); 15032 return element; 15033} 15034module.exports = insertStyleElement; 15035 15036/***/ }), 15037 15038/***/ 5056: 15039/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 15040 15041"use strict"; 15042 15043 15044/* istanbul ignore next */ 15045function setAttributesWithoutAttributes(styleElement) { 15046 var nonce = true ? __webpack_require__.nc : 0; 15047 if (nonce) { 15048 styleElement.setAttribute("nonce", nonce); 15049 } 15050} 15051module.exports = setAttributesWithoutAttributes; 15052 15053/***/ }), 15054 15055/***/ 7825: 15056/***/ ((module) => { 15057 15058"use strict"; 15059 15060 15061/* istanbul ignore next */ 15062function apply(styleElement, options, obj) { 15063 var css = ""; 15064 if (obj.supports) { 15065 css += "@supports (".concat(obj.supports, ") {"); 15066 } 15067 if (obj.media) { 15068 css += "@media ".concat(obj.media, " {"); 15069 } 15070 var needLayer = typeof obj.layer !== "undefined"; 15071 if (needLayer) { 15072 css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {"); 15073 } 15074 css += obj.css; 15075 if (needLayer) { 15076 css += "}"; 15077 } 15078 if (obj.media) { 15079 css += "}"; 15080 } 15081 if (obj.supports) { 15082 css += "}"; 15083 } 15084 var sourceMap = obj.sourceMap; 15085 if (sourceMap && typeof btoa !== "undefined") { 15086 css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); 15087 } 15088 15089 // For old IE 15090 /* istanbul ignore if */ 15091 options.styleTagTransform(css, styleElement, options.options); 15092} 15093function removeStyleElement(styleElement) { 15094 // istanbul ignore if 15095 if (styleElement.parentNode === null) { 15096 return false; 15097 } 15098 styleElement.parentNode.removeChild(styleElement); 15099} 15100 15101/* istanbul ignore next */ 15102function domAPI(options) { 15103 if (typeof document === "undefined") { 15104 return { 15105 update: function update() {}, 15106 remove: function remove() {} 15107 }; 15108 } 15109 var styleElement = options.insertStyleElement(options); 15110 return { 15111 update: function update(obj) { 15112 apply(styleElement, options, obj); 15113 }, 15114 remove: function remove() { 15115 removeStyleElement(styleElement); 15116 } 15117 }; 15118} 15119module.exports = domAPI; 15120 15121/***/ }), 15122 15123/***/ 1113: 15124/***/ ((module) => { 15125 15126"use strict"; 15127 15128 15129/* istanbul ignore next */ 15130function styleTagTransform(css, styleElement) { 15131 if (styleElement.styleSheet) { 15132 styleElement.styleSheet.cssText = css; 15133 } else { 15134 while (styleElement.firstChild) { 15135 styleElement.removeChild(styleElement.firstChild); 15136 } 15137 styleElement.appendChild(document.createTextNode(css)); 15138 } 15139} 15140module.exports = styleTagTransform; 15141 15142/***/ }), 15143 15144/***/ 8595: 15145/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 15146 15147"use strict"; 15148 15149// EXPORTS 15150__webpack_require__.d(__webpack_exports__, { 15151 Ay: () => (/* binding */ src_App), 15152 cA: () => (/* binding */ environment), 15153 Bt: () => (/* binding */ eventBus) 15154}); 15155 15156// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 15157var jsx_runtime = __webpack_require__(4848); 15158// EXTERNAL MODULE: ./node_modules/@tanstack/query-core/build/modern/utils.js 15159var utils = __webpack_require__(4880); 15160// EXTERNAL MODULE: ./node_modules/@tanstack/query-core/build/modern/notifyManager.js 15161var notifyManager = __webpack_require__(6261); 15162// EXTERNAL MODULE: ./node_modules/@tanstack/query-core/build/modern/retryer.js 15163var retryer = __webpack_require__(8904); 15164// EXTERNAL MODULE: ./node_modules/@tanstack/query-core/build/modern/removable.js 15165var removable = __webpack_require__(1692); 15166;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/query.js
15167// src/query.ts 15168 15169 15170 15171 15172var Query = class extends removable/* Removable */.k { 15173 constructor(config) { 15174 super(); 15175 this.#abortSignalConsumed = false; 15176 this.#defaultOptions = config.defaultOptions; 15177 this.#setOptions(config.options); 15178 this.#observers = []; 15179 this.#cache = config.cache; 15180 this.queryKey = config.queryKey; 15181 this.queryHash = config.queryHash; 15182 this.#initialState = config.state || getDefaultState(this.options); 15183 this.state = this.#initialState; 15184 this.scheduleGc(); 15185 } 15186 #initialState; 15187 #revertState; 15188 #cache; 15189 #promise; 15190 #retryer; 15191 #observers; 15192 #defaultOptions; 15193 #abortSignalConsumed; 15194 get meta() { 15195 return this.options.meta; 15196 } 15197 #setOptions(options) { 15198 this.options = { ...this.#defaultOptions, ...options }; 15199 this.updateGcTime(this.options.gcTime); 15200 } 15201 optionalRemove() { 15202 if (!this.#observers.length && this.state.fetchStatus === "idle") { 15203 this.#cache.remove(this); 15204 } 15205 } 15206 setData(newData, options) { 15207 const data = (0,utils/* replaceData */.pl)(this.state.data, newData, this.options); 15208 this.#dispatch({ 15209 data, 15210 type: "success", 15211 dataUpdatedAt: options?.updatedAt, 15212 manual: options?.manual 15213 }); 15214 return data; 15215 } 15216 setState(state, setStateOptions) { 15217 this.#dispatch({ type: "setState", state, setStateOptions }); 15218 } 15219 cancel(options) { 15220 const promise = this.#promise; 15221 this.#retryer?.cancel(options); 15222 return promise ? promise.then(utils/* noop */.lQ).catch(utils/* noop */.lQ) : Promise.resolve(); 15223 } 15224 destroy() { 15225 super.destroy(); 15226 this.cancel({ silent: true }); 15227 } 15228 reset() { 15229 this.destroy(); 15230 this.setState(this.#initialState); 15231 } 15232 isActive() { 15233 return this.#observers.some( 15234 (observer) => observer.options.enabled !== false 15235 ); 15236 } 15237 isDisabled() { 15238 return this.getObserversCount() > 0 && !this.isActive(); 15239 } 15240 isStale() { 15241 return this.state.isInvalidated || !this.state.dataUpdatedAt || this.#observers.some((observer) => observer.getCurrentResult().isStale); 15242 } 15243 isStaleByTime(staleTime = 0) { 15244 return this.state.isInvalidated || !this.state.dataUpdatedAt || !(0,utils/* timeUntilStale */.j3)(this.state.dataUpdatedAt, staleTime); 15245 } 15246 onFocus() { 15247 const observer = this.#observers.find((x) => x.shouldFetchOnWindowFocus()); 15248 observer?.refetch({ cancelRefetch: false }); 15249 this.#retryer?.continue(); 15250 } 15251 onOnline() { 15252 const observer = this.#observers.find((x) => x.shouldFetchOnReconnect()); 15253 observer?.refetch({ cancelRefetch: false }); 15254 this.#retryer?.continue(); 15255 } 15256 addObserver(observer) { 15257 if (!this.#observers.includes(observer)) { 15258 this.#observers.push(observer); 15259 this.clearGcTimeout(); 15260 this.#cache.notify({ type: "observerAdded", query: this, observer }); 15261 } 15262 } 15263 removeObserver(observer) { 15264 if (this.#observers.includes(observer)) { 15265 this.#observers = this.#observers.filter((x) => x !== observer); 15266 if (!this.#observers.length) { 15267 if (this.#retryer) { 15268 if (this.#abortSignalConsumed) { 15269 this.#retryer.cancel({ revert: true }); 15270 } else { 15271 this.#retryer.cancelRetry(); 15272 } 15273 } 15274 this.scheduleGc(); 15275 } 15276 this.#cache.notify({ type: "observerRemoved", query: this, observer }); 15277 } 15278 } 15279 getObserversCount() { 15280 return this.#observers.length; 15281 } 15282 invalidate() { 15283 if (!this.state.isInvalidated) { 15284 this.#dispatch({ type: "invalidate" }); 15285 } 15286 } 15287 fetch(options, fetchOptions) { 15288 if (this.state.fetchStatus !== "idle") { 15289 if (this.state.dataUpdatedAt && fetchOptions?.cancelRefetch) { 15290 this.cancel({ silent: true }); 15291 } else if (this.#promise) { 15292 this.#retryer?.continueRetry(); 15293 return this.#promise; 15294 } 15295 } 15296 if (options) { 15297 this.#setOptions(options); 15298 } 15299 if (!this.options.queryFn) { 15300 const observer = this.#observers.find((x) => x.options.queryFn); 15301 if (observer) { 15302 this.#setOptions(observer.options); 15303 } 15304 } 15305 if (false) {} 15306 const abortController = new AbortController(); 15307 const queryFnContext = { 15308 queryKey: this.queryKey, 15309 meta: this.meta 15310 }; 15311 const addSignalProperty = (object) => { 15312 Object.defineProperty(object, "signal", { 15313 enumerable: true, 15314 get: () => { 15315 this.#abortSignalConsumed = true; 15316 return abortController.signal; 15317 } 15318 }); 15319 }; 15320 addSignalProperty(queryFnContext); 15321 const fetchFn = () => { 15322 if (!this.options.queryFn) { 15323 return Promise.reject( 15324 new Error(`Missing queryFn: '${this.options.queryHash}'`) 15325 ); 15326 } 15327 this.#abortSignalConsumed = false;
15328 if (this.options.persister) { 15329 return this.options.persister( 15330 this.options.queryFn, 15331 queryFnContext, 15332 this 15333 ); 15334 } 15335 return this.options.queryFn( 15336 queryFnContext 15337 ); 15338 }; 15339 const context = { 15340 fetchOptions, 15341 options: this.options, 15342 queryKey: this.queryKey, 15343 state: this.state, 15344 fetchFn 15345 }; 15346 addSignalProperty(context); 15347 this.options.behavior?.onFetch( 15348 context, 15349 this 15350 ); 15351 this.#revertState = this.state; 15352 if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { 15353 this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); 15354 } 15355 const onError = (error) => { 15356 if (!((0,retryer/* isCancelledError */.wm)(error) && error.silent)) { 15357 this.#dispatch({ 15358 type: "error", 15359 error 15360 }); 15361 } 15362 if (!(0,retryer/* isCancelledError */.wm)(error)) { 15363 this.#cache.config.onError?.( 15364 error, 15365 this 15366 ); 15367 this.#cache.config.onSettled?.( 15368 this.state.data, 15369 error, 15370 this 15371 ); 15372 } 15373 if (!this.isFetchingOptimistic) { 15374 this.scheduleGc(); 15375 } 15376 this.isFetchingOptimistic = false; 15377 }; 15378 this.#retryer = (0,retryer/* createRetryer */.II)({ 15379 fn: context.fetchFn, 15380 abort: abortController.abort.bind(abortController), 15381 onSuccess: (data) => { 15382 if (typeof data === "undefined") { 15383 if (false) {} 15384 onError(new Error(`${this.queryHash} data is undefined`)); 15385 return; 15386 } 15387 this.setData(data); 15388 this.#cache.config.onSuccess?.(data, this); 15389 this.#cache.config.onSettled?.( 15390 data, 15391 this.state.error, 15392 this 15393 ); 15394 if (!this.isFetchingOptimistic) { 15395 this.scheduleGc(); 15396 } 15397 this.isFetchingOptimistic = false; 15398 }, 15399 onError, 15400 onFail: (failureCount, error) => { 15401 this.#dispatch({ type: "failed", failureCount, error }); 15402 }, 15403 onPause: () => { 15404 this.#dispatch({ type: "pause" }); 15405 }, 15406 onContinue: () => { 15407 this.#dispatch({ type: "continue" }); 15408 }, 15409 retry: context.options.retry, 15410 retryDelay: context.options.retryDelay, 15411 networkMode: context.options.networkMode 15412 }); 15413 this.#promise = this.#retryer.promise; 15414 return this.#promise; 15415 } 15416 #dispatch(action) { 15417 const reducer = (state) => { 15418 switch (action.type) { 15419 case "failed": 15420 return { 15421 ...state, 15422 fetchFailureCount: action.failureCount, 15423 fetchFailureReason: action.error 15424 }; 15425 case "pause": 15426 return { 15427 ...state, 15428 fetchStatus: "paused" 15429 }; 15430 case "continue": 15431 return { 15432 ...state, 15433 fetchStatus: "fetching" 15434 }; 15435 case "fetch": 15436 return { 15437 ...state, 15438 fetchFailureCount: 0, 15439 fetchFailureReason: null, 15440 fetchMeta: action.meta ?? null, 15441 fetchStatus: (0,retryer/* canFetch */.v_)(this.options.networkMode) ? "fetching" : "paused", 15442 ...!state.dataUpdatedAt && { 15443 error: null, 15444 status: "pending" 15445 } 15446 }; 15447 case "success": 15448 return { 15449 ...state, 15450 data: action.data, 15451 dataUpdateCount: state.dataUpdateCount + 1, 15452 dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), 15453 error: null, 15454 isInvalidated: false, 15455 status: "success", 15456 ...!action.manual && { 15457 fetchStatus: "idle", 15458 fetchFailureCount: 0, 15459 fetchFailureReason: null 15460 } 15461 }; 15462 case "error": 15463 const error = action.error; 15464 if ((0,retryer/* isCancelledError */.wm)(error) && error.revert && this.#revertState) { 15465 return { ...this.#revertState, fetchStatus: "idle" }; 15466 } 15467 return { 15468 ...state, 15469 error,
15470 errorUpdateCount: state.errorUpdateCount + 1, 15471 errorUpdatedAt: Date.now(), 15472 fetchFailureCount: state.fetchFailureCount + 1, 15473 fetchFailureReason: error, 15474 fetchStatus: "idle", 15475 status: "error" 15476 }; 15477 case "invalidate": 15478 return { 15479 ...state, 15480 isInvalidated: true 15481 }; 15482 case "setState": 15483 return { 15484 ...state, 15485 ...action.state 15486 }; 15487 } 15488 }; 15489 this.state = reducer(this.state); 15490 notifyManager/* notifyManager */.j.batch(() => { 15491 this.#observers.forEach((observer) => { 15492 observer.onQueryUpdate(); 15493 }); 15494 this.#cache.notify({ query: this, type: "updated", action }); 15495 }); 15496 } 15497}; 15498function getDefaultState(options) { 15499 const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; 15500 const hasData = typeof data !== "undefined"; 15501 const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; 15502 return { 15503 data, 15504 dataUpdateCount: 0, 15505 dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, 15506 error: null, 15507 errorUpdateCount: 0, 15508 errorUpdatedAt: 0, 15509 fetchFailureCount: 0, 15510 fetchFailureReason: null, 15511 fetchMeta: null, 15512 isInvalidated: false, 15513 status: hasData ? "success" : "pending", 15514 fetchStatus: "idle" 15515 }; 15516} 15517 15518//# sourceMappingURL=query.js.map 15519// EXTERNAL MODULE: ./node_modules/@tanstack/query-core/build/modern/subscribable.js 15520var subscribable = __webpack_require__(6500); 15521;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/queryCache.js
15522// src/queryCache.ts 15523 15524 15525 15526 15527var QueryCache = class extends subscribable/* Subscribable */.Q { 15528 constructor(config = {}) { 15529 super(); 15530 this.config = config; 15531 this.#queries = /* @__PURE__ */ new Map(); 15532 } 15533 #queries; 15534 build(client, options, state) { 15535 const queryKey = options.queryKey; 15536 const queryHash = options.queryHash ?? (0,utils/* hashQueryKeyByOptions */.F$)(queryKey, options); 15537 let query = this.get(queryHash); 15538 if (!query) { 15539 query = new Query({ 15540 cache: this, 15541 queryKey, 15542 queryHash, 15543 options: client.defaultQueryOptions(options), 15544 state, 15545 defaultOptions: client.getQueryDefaults(queryKey) 15546 }); 15547 this.add(query); 15548 } 15549 return query; 15550 } 15551 add(query) { 15552 if (!this.#queries.has(query.queryHash)) { 15553 this.#queries.set(query.queryHash, query); 15554 this.notify({ 15555 type: "added", 15556 query 15557 }); 15558 } 15559 } 15560 remove(query) { 15561 const queryInMap = this.#queries.get(query.queryHash); 15562 if (queryInMap) { 15563 query.destroy(); 15564 if (queryInMap === query) { 15565 this.#queries.delete(query.queryHash); 15566 } 15567 this.notify({ type: "removed", query }); 15568 } 15569 } 15570 clear() { 15571 notifyManager/* notifyManager */.j.batch(() => { 15572 this.getAll().forEach((query) => { 15573 this.remove(query); 15574 }); 15575 }); 15576 } 15577 get(queryHash) { 15578 return this.#queries.get(queryHash); 15579 } 15580 getAll() { 15581 return [...this.#queries.values()]; 15582 } 15583 find(filters) { 15584 const defaultedFilters = { exact: true, ...filters }; 15585 return this.getAll().find( 15586 (query) => (0,utils/* matchQuery */.MK)(defaultedFilters, query) 15587 ); 15588 } 15589 findAll(filters = {}) { 15590 const queries = this.getAll(); 15591 return Object.keys(filters).length > 0 ? queries.filter((query) => (0,utils/* matchQuery */.MK)(filters, query)) : queries; 15592 } 15593 notify(event) { 15594 notifyManager/* notifyManager */.j.batch(() => { 15595 this.listeners.forEach((listener) => { 15596 listener(event); 15597 }); 15598 }); 15599 } 15600 onFocus() { 15601 notifyManager/* notifyManager */.j.batch(() => { 15602 this.getAll().forEach((query) => { 15603 query.onFocus(); 15604 }); 15605 }); 15606 } 15607 onOnline() { 15608 notifyManager/* notifyManager */.j.batch(() => { 15609 this.getAll().forEach((query) => { 15610 query.onOnline(); 15611 }); 15612 }); 15613 } 15614}; 15615 15616//# sourceMappingURL=queryCache.js.map 15617// EXTERNAL MODULE: ./node_modules/@tanstack/query-core/build/modern/mutation.js 15618var modern_mutation = __webpack_require__(6158); 15619;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/mutationCache.js
15620// src/mutationCache.ts 15621 15622 15623 15624 15625var MutationCache = class extends subscribable/* Subscribable */.Q { 15626 constructor(config = {}) { 15627 super(); 15628 this.config = config; 15629 this.#mutations = []; 15630 this.#mutationId = 0; 15631 } 15632 #mutations; 15633 #mutationId; 15634 #resuming; 15635 build(client, options, state) { 15636 const mutation = new modern_mutation/* Mutation */.s({ 15637 mutationCache: this, 15638 mutationId: ++this.#mutationId, 15639 options: client.defaultMutationOptions(options), 15640 state 15641 }); 15642 this.add(mutation); 15643 return mutation; 15644 } 15645 add(mutation) { 15646 this.#mutations.push(mutation); 15647 this.notify({ type: "added", mutation }); 15648 } 15649 remove(mutation) { 15650 this.#mutations = this.#mutations.filter((x) => x !== mutation); 15651 this.notify({ type: "removed", mutation }); 15652 } 15653 clear() { 15654 notifyManager/* notifyManager */.j.batch(() => { 15655 this.#mutations.forEach((mutation) => { 15656 this.remove(mutation); 15657 }); 15658 }); 15659 } 15660 getAll() { 15661 return this.#mutations; 15662 } 15663 find(filters) { 15664 const defaultedFilters = { exact: true, ...filters }; 15665 return this.#mutations.find( 15666 (mutation) => (0,utils/* matchMutation */.nJ)(defaultedFilters, mutation) 15667 ); 15668 } 15669 findAll(filters = {}) { 15670 return this.#mutations.filter( 15671 (mutation) => (0,utils/* matchMutation */.nJ)(filters, mutation) 15672 ); 15673 } 15674 notify(event) { 15675 notifyManager/* notifyManager */.j.batch(() => { 15676 this.listeners.forEach((listener) => { 15677 listener(event); 15678 }); 15679 }); 15680 } 15681 resumePausedMutations() { 15682 this.#resuming = (this.#resuming ?? Promise.resolve()).then(() => { 15683 const pausedMutations = this.#mutations.filter((x) => x.state.isPaused); 15684 return notifyManager/* notifyManager */.j.batch( 15685 () => pausedMutations.reduce( 15686 (promise, mutation) => promise.then(() => mutation.continue().catch(utils/* noop */.lQ)), 15687 Promise.resolve() 15688 ) 15689 ); 15690 }).then(() => { 15691 this.#resuming = void 0; 15692 }); 15693 return this.#resuming; 15694 } 15695}; 15696 15697//# sourceMappingURL=mutationCache.js.map 15698// EXTERNAL MODULE: ./node_modules/@tanstack/query-core/build/modern/focusManager.js 15699var focusManager = __webpack_require__(9658); 15700// EXTERNAL MODULE: ./node_modules/@tanstack/query-core/build/modern/onlineManager.js 15701var onlineManager = __webpack_require__(6035); 15702;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
15703// src/infiniteQueryBehavior.ts 15704 15705function infiniteQueryBehavior(pages) { 15706 return { 15707 onFetch: (context, query) => { 15708 const fetchFn = async () => { 15709 const options = context.options; 15710 const direction = context.fetchOptions?.meta?.fetchMore?.direction; 15711 const oldPages = context.state.data?.pages || []; 15712 const oldPageParams = context.state.data?.pageParams || []; 15713 const empty = { pages: [], pageParams: [] }; 15714 let cancelled = false; 15715 const addSignalProperty = (object) => { 15716 Object.defineProperty(object, "signal", { 15717 enumerable: true, 15718 get: () => { 15719 if (context.signal.aborted) { 15720 cancelled = true; 15721 } else { 15722 context.signal.addEventListener("abort", () => { 15723 cancelled = true; 15724 }); 15725 } 15726 return context.signal; 15727 } 15728 }); 15729 }; 15730 const queryFn = context.options.queryFn || (() => Promise.reject( 15731 new Error(`Missing queryFn: '${context.options.queryHash}'`) 15732 )); 15733 const fetchPage = async (data, param, previous) => { 15734 if (cancelled) { 15735 return Promise.reject(); 15736 } 15737 if (param == null && data.pages.length) { 15738 return Promise.resolve(data); 15739 } 15740 const queryFnContext = { 15741 queryKey: context.queryKey, 15742 pageParam: param, 15743 direction: previous ? "backward" : "forward", 15744 meta: context.options.meta 15745 }; 15746 addSignalProperty(queryFnContext); 15747 const page = await queryFn( 15748 queryFnContext 15749 ); 15750 const { maxPages } = context.options; 15751 const addTo = previous ? utils/* addToStart */.ZZ : utils/* addToEnd */.y9; 15752 return { 15753 pages: addTo(data.pages, page, maxPages), 15754 pageParams: addTo(data.pageParams, param, maxPages) 15755 }; 15756 }; 15757 let result; 15758 if (direction && oldPages.length) { 15759 const previous = direction === "backward"; 15760 const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; 15761 const oldData = { 15762 pages: oldPages, 15763 pageParams: oldPageParams 15764 }; 15765 const param = pageParamFn(options, oldData); 15766 result = await fetchPage(oldData, param, previous); 15767 } else { 15768 result = await fetchPage( 15769 empty, 15770 oldPageParams[0] ?? options.initialPageParam 15771 ); 15772 const remainingPages = pages ?? oldPages.length; 15773 for (let i = 1; i < remainingPages; i++) { 15774 const param = getNextPageParam(options, result); 15775 result = await fetchPage(result, param); 15776 } 15777 } 15778 return result; 15779 }; 15780 if (context.options.persister) { 15781 context.fetchFn = () => { 15782 return context.options.persister?.( 15783 fetchFn, 15784 { 15785 queryKey: context.queryKey, 15786 meta: context.options.meta, 15787 signal: context.signal 15788 }, 15789 query 15790 ); 15791 }; 15792 } else { 15793 context.fetchFn = fetchFn; 15794 } 15795 } 15796 }; 15797} 15798function getNextPageParam(options, { pages, pageParams }) { 15799 const lastIndex = pages.length - 1; 15800 return options.getNextPageParam( 15801 pages[lastIndex], 15802 pages, 15803 pageParams[lastIndex], 15804 pageParams 15805 ); 15806} 15807function getPreviousPageParam(options, { pages, pageParams }) { 15808 return options.getPreviousPageParam?.( 15809 pages[0], 15810 pages, 15811 pageParams[0], 15812 pageParams 15813 ); 15814} 15815function hasNextPage(options, data) { 15816 if (!data) 15817 return false; 15818 return getNextPageParam(options, data) != null; 15819} 15820function hasPreviousPage(options, data) { 15821 if (!data || !options.getPreviousPageParam) 15822 return false; 15823 return getPreviousPageParam(options, data) != null; 15824} 15825 15826//# sourceMappingURL=infiniteQueryBehavior.js.map 15827;// CONCATENATED MODULE: ./node_modules/@tanstack/query-core/build/modern/queryClient.js
15828// src/queryClient.ts 15829 15830 15831 15832 15833 15834 15835 15836var QueryClient = class { 15837 #queryCache; 15838 #mutationCache; 15839 #defaultOptions; 15840 #queryDefaults; 15841 #mutationDefaults; 15842 #mountCount; 15843 #unsubscribeFocus; 15844 #unsubscribeOnline; 15845 constructor(config = {}) { 15846 this.#queryCache = config.queryCache || new QueryCache(); 15847 this.#mutationCache = config.mutationCache || new MutationCache(); 15848 this.#defaultOptions = config.defaultOptions || {}; 15849 this.#queryDefaults = /* @__PURE__ */ new Map(); 15850 this.#mutationDefaults = /* @__PURE__ */ new Map(); 15851 this.#mountCount = 0; 15852 } 15853 mount() { 15854 this.#mountCount++; 15855 if (this.#mountCount !== 1) 15856 return; 15857 this.#unsubscribeFocus = focusManager/* focusManager */.m.subscribe(() => { 15858 if (focusManager/* focusManager */.m.isFocused()) { 15859 this.resumePausedMutations(); 15860 this.#queryCache.onFocus(); 15861 } 15862 }); 15863 this.#unsubscribeOnline = onlineManager/* onlineManager */.t.subscribe(() => { 15864 if (onlineManager/* onlineManager */.t.isOnline()) { 15865 this.resumePausedMutations(); 15866 this.#queryCache.onOnline(); 15867 } 15868 }); 15869 } 15870 unmount() { 15871 this.#mountCount--; 15872 if (this.#mountCount !== 0) 15873 return; 15874 this.#unsubscribeFocus?.(); 15875 this.#unsubscribeFocus = void 0; 15876 this.#unsubscribeOnline?.(); 15877 this.#unsubscribeOnline = void 0; 15878 } 15879 isFetching(filters) { 15880 return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; 15881 } 15882 isMutating(filters) { 15883 return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; 15884 } 15885 getQueryData(queryKey) { 15886 return this.#queryCache.find({ queryKey })?.state.data; 15887 } 15888 ensureQueryData(options) { 15889 const cachedData = this.getQueryData(options.queryKey); 15890 return cachedData !== void 0 ? Promise.resolve(cachedData) : this.fetchQuery(options); 15891 } 15892 getQueriesData(filters) { 15893 return this.getQueryCache().findAll(filters).map(({ queryKey, state }) => { 15894 const data = state.data; 15895 return [queryKey, data]; 15896 }); 15897 } 15898 setQueryData(queryKey, updater, options) { 15899 const query = this.#queryCache.find({ queryKey }); 15900 const prevData = query?.state.data; 15901 const data = (0,utils/* functionalUpdate */.Zw)(updater, prevData); 15902 if (typeof data === "undefined") { 15903 return void 0; 15904 } 15905 const defaultedOptions = this.defaultQueryOptions({ queryKey }); 15906 return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); 15907 } 15908 setQueriesData(filters, updater, options) { 15909 return notifyManager/* notifyManager */.j.batch( 15910 () => this.getQueryCache().findAll(filters).map(({ queryKey }) => [ 15911 queryKey, 15912 this.setQueryData(queryKey, updater, options) 15913 ]) 15914 ); 15915 } 15916 getQueryState(queryKey) { 15917 return this.#queryCache.find({ queryKey })?.state; 15918 } 15919 removeQueries(filters) { 15920 const queryCache = this.#queryCache; 15921 notifyManager/* notifyManager */.j.batch(() => { 15922 queryCache.findAll(filters).forEach((query) => { 15923 queryCache.remove(query); 15924 }); 15925 }); 15926 } 15927 resetQueries(filters, options) { 15928 const queryCache = this.#queryCache; 15929 const refetchFilters = { 15930 type: "active", 15931 ...filters 15932 }; 15933 return notifyManager/* notifyManager */.j.batch(() => { 15934 queryCache.findAll(filters).forEach((query) => { 15935 query.reset(); 15936 }); 15937 return this.refetchQueries(refetchFilters, options); 15938 }); 15939 } 15940 cancelQueries(filters = {}, cancelOptions = {}) { 15941 const defaultedCancelOptions = { revert: true, ...cancelOptions }; 15942 const promises = notifyManager/* notifyManager */.j.batch( 15943 () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) 15944 ); 15945 return Promise.all(promises).then(utils/* noop */.lQ).catch(utils/* noop */.lQ); 15946 } 15947 invalidateQueries(filters = {}, options = {}) { 15948 return notifyManager/* notifyManager */.j.batch(() => { 15949 this.#queryCache.findAll(filters).forEach((query) => { 15950 query.invalidate(); 15951 }); 15952 if (filters.refetchType === "none") { 15953 return Promise.resolve(); 15954 } 15955 const refetchFilters = { 15956 ...filters, 15957 type: filters.refetchType ?? filters.type ?? "active" 15958 }; 15959 return this.refetchQueries(refetchFilters, options); 15960 }); 15961 } 15962 refetchQueries(filters = {}, options) { 15963 const fetchOptions = { 15964 ...options, 15965 cancelRefetch: options?.cancelRefetch ?? true 15966 }; 15967 const promises = notifyManager/* notifyManager */.j.batch( 15968 () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => { 15969 let promise = query.fetch(void 0, fetchOptions); 15970 if (!fetchOptions.throwOnError) { 15971 promise = promise.catch(utils/* noop */.lQ); 15972 } 15973 return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; 15974 }) 15975 ); 15976 return Promise.all(promises).then(utils/* noop */.lQ); 15977 } 15978 fetchQuery(options) { 15979 const defaultedOptions = this.defaultQueryOptions(options); 15980 if (typeof defaultedOptions.retry === "undefined") { 15981 defaultedOptions.retry = false;
15982 } 15983 const query = this.#queryCache.build(this, defaultedOptions); 15984 return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); 15985 } 15986 prefetchQuery(options) { 15987 return this.fetchQuery(options).then(utils/* noop */.lQ).catch(utils/* noop */.lQ); 15988 } 15989 fetchInfiniteQuery(options) { 15990 options.behavior = infiniteQueryBehavior(options.pages); 15991 return this.fetchQuery(options); 15992 } 15993 prefetchInfiniteQuery(options) { 15994 return this.fetchInfiniteQuery(options).then(utils/* noop */.lQ).catch(utils/* noop */.lQ); 15995 } 15996 resumePausedMutations() { 15997 return this.#mutationCache.resumePausedMutations(); 15998 } 15999 getQueryCache() { 16000 return this.#queryCache; 16001 } 16002 getMutationCache() { 16003 return this.#mutationCache; 16004 } 16005 getDefaultOptions() { 16006 return this.#defaultOptions; 16007 } 16008 setDefaultOptions(options) { 16009 this.#defaultOptions = options; 16010 } 16011 setQueryDefaults(queryKey, options) { 16012 this.#queryDefaults.set((0,utils/* hashKey */.EN)(queryKey), { 16013 queryKey, 16014 defaultOptions: options 16015 }); 16016 } 16017 getQueryDefaults(queryKey) { 16018 const defaults = [...this.#queryDefaults.values()]; 16019 let result = {}; 16020 defaults.forEach((queryDefault) => { 16021 if ((0,utils/* partialMatchKey */.Cp)(queryKey, queryDefault.queryKey)) { 16022 result = { ...result, ...queryDefault.defaultOptions }; 16023 } 16024 }); 16025 return result; 16026 } 16027 setMutationDefaults(mutationKey, options) { 16028 this.#mutationDefaults.set((0,utils/* hashKey */.EN)(mutationKey), { 16029 mutationKey, 16030 defaultOptions: options 16031 }); 16032 } 16033 getMutationDefaults(mutationKey) { 16034 const defaults = [...this.#mutationDefaults.values()]; 16035 let result = {}; 16036 defaults.forEach((queryDefault) => { 16037 if ((0,utils/* partialMatchKey */.Cp)(mutationKey, queryDefault.mutationKey)) { 16038 result = { ...result, ...queryDefault.defaultOptions }; 16039 } 16040 }); 16041 return result; 16042 } 16043 defaultQueryOptions(options) { 16044 if (options?._defaulted) { 16045 return options; 16046 } 16047 const defaultedOptions = { 16048 ...this.#defaultOptions.queries, 16049 ...options?.queryKey && this.getQueryDefaults(options.queryKey), 16050 ...options, 16051 _defaulted: true 16052 }; 16053 if (!defaultedOptions.queryHash) { 16054 defaultedOptions.queryHash = (0,utils/* hashQueryKeyByOptions */.F$)( 16055 defaultedOptions.queryKey, 16056 defaultedOptions 16057 ); 16058 } 16059 if (typeof defaultedOptions.refetchOnReconnect === "undefined") { 16060 defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; 16061 } 16062 if (typeof defaultedOptions.throwOnError === "undefined") { 16063 defaultedOptions.throwOnError = !!defaultedOptions.suspense; 16064 } 16065 if (typeof defaultedOptions.networkMode === "undefined" && defaultedOptions.persister) { 16066 defaultedOptions.networkMode = "offlineFirst"; 16067 } 16068 return defaultedOptions; 16069 } 16070 defaultMutationOptions(options) { 16071 if (options?._defaulted) { 16072 return options; 16073 } 16074 return { 16075 ...this.#defaultOptions.mutations, 16076 ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), 16077 ...options, 16078 _defaulted: true 16079 }; 16080 } 16081 clear() { 16082 this.#queryCache.clear(); 16083 this.#mutationCache.clear(); 16084 } 16085}; 16086 16087//# sourceMappingURL=queryClient.js.map 16088// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js 16089var QueryClientProvider = __webpack_require__(7665); 16090// EXTERNAL MODULE: delegated ./node_modules/react/index.js from dll-reference common_lib 16091var reactfrom_dll_reference_common_lib = __webpack_require__(3328); 16092// EXTERNAL MODULE: ./src/context/ModuleContext.tsx 16093var ModuleContext = __webpack_require__(5837); 16094// EXTERNAL MODULE: ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs + 3 modules 16095var floating_ui_dom = __webpack_require__(7663); 16096// EXTERNAL MODULE: ./node_modules/classnames/index.js 16097var classnames = __webpack_require__(6942); 16098;// CONCATENATED MODULE: ./node_modules/react-tooltip/dist/react-tooltip.min.mjs 16099/* 16100* React Tooltip 16101* {@link https://github.com/ReactTooltip/react-tooltip} 16102* @copyright ReactTooltip Team 16103* @license MIT
16104*/ 16105const h="react-tooltip-core-styles",w="react-tooltip-base-styles",b={core:!1,base:!1};function S({css:e,id:t=w,type:o="base",ref:l}){var r,n;if(!e||"undefined"==typeof document||b[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(r=null===process||void 0===process?void 0:process.env)||void 0===r?void 0:r.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=h),l||(l={});const{insertAt:i}=l;if(document.getElementById(t))return;const c=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===i&&c.firstChild?c.insertBefore(s,c.firstChild):c.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),b[o]=!0}function g({type:e="base",id:t=w}={}){if(!b[e])return;"core"===e&&(t=h);const o=document.getElementById(t);"style"===(null==o?void 0:o.tagName)?null==o||o.remove():console.warn(`[react-tooltip] Failed to remove 'style' element with id '${t}'. Call \`injectStyle()\` first`),b[e]=!1}const E=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:l="top",offset:r=10,strategy:n="absolute",middlewares:i=[(0,floating_ui_dom/* offset */.cY)(Number(r)),(0,floating_ui_dom/* flip */.UU)({fallbackAxisSideDirection:"start"}),(0,floating_ui_dom/* shift */.BN)({padding:5})],border:c})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:l};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:l};const s=i;return o?(s.push((0,floating_ui_dom/* arrow */.UE)({element:o,padding:5})),(0,floating_ui_dom/* computePosition */.rD)(e,t,{placement:l,strategy:n,middleware:s}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const i={left:`${e}px`,top:`${t}px`,border:c},{x:s,y:a}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=c&&{borderBottom:c,borderRight:c};let p=0;if(c){const e=`${c}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:i,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):(0,floating_ui_dom/* computePosition */.rD)(e,t,{placement:"bottom",strategy:n,middleware:s}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},A=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),_=(e,t,o)=>{let l=null;const r=function(...r){const n=()=>{l=null,o||e.apply(this,r)};o&&!l&&(e.apply(this,r),l=setTimeout(n,t)),o||(l&&clearTimeout(l),l=setTimeout(n,t))};return r.cancel=()=>{l&&(clearTimeout(l),l=null)},r},O=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,k=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>k(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!O(e)||!O(t))return e===t;const o=Object.keys(e),l=Object.keys(t);return o.length===l.length&&o.every((o=>k(e[o],t[o])))},T=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},L=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(T(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},C="undefined"!=typeof window?reactfrom_dll_reference_common_lib.useLayoutEffect:reactfrom_dll_reference_common_lib.useEffect,R=e=>{e.current&&(clearTimeout(e.current),e.current=null)},x="DEFAULT_TOOLTIP_ID",N={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},$=(0,reactfrom_dll_reference_common_lib.createContext)({getTooltipData:()=>N}),I=({children:t})=>{const[o,l]=r({[x]:new Set}),[c,s]=r({[x]:{current:null}}),a=(e,...t)=>{l((o=>{var l;const r=null!==(l=o[e])&&void 0!==l?l:new Set;return t.forEach((e=>r.add(e))),{...o,[e]:new Set(r)}}))},u=(e,...t)=>{l((o=>{const l=o[e];return l?(t.forEach((e=>l.delete(e))),{...o}):o}))},d=n(((e=x)=>{var t,l;return{anchorRefs:null!==(t=o[e])&&void 0!==t?t:new Set,activeAnchor:null!==(l=c[e])&&void 0!==l?l:{current:null},attach:(...t)=>a(e,...t),detach:(...t)=>u(e,...t),setActiveAnchor:t=>((e,t)=>{s((o=>{var l;return(null===(l=o[e])||void 0===l?void 0:l.current)===t.current?o:{...o,[e]:t}}))})(e,t)}}),[o,c,a,u]),p=i((()=>({getTooltipData:d})),[d]);return e.createElement($.Provider,{value:p},t)};function j(e=x){return (0,reactfrom_dll_reference_common_lib.useContext)($).getTooltipData(e)}const B=({tooltipId:t,children:l,className:r,place:n,content:i,html:c,variant:a,offset:u,wrapper:d,events:p,positionStrategy:v,delayShow:m,delayHide:f})=>{const{attach:h,detach:w}=j(t),b=s(null);return o((()=>(h(b),()=>{w(b)})),[]),e.createElement("span",{ref:b,className:y("react-tooltip-wrapper",r),"data-tooltip-place":n,"data-tooltip-content":i,"data-tooltip-html":c,"data-tooltip-variant":a,"data-tooltip-offset":u,"data-tooltip-wrapper":d,"data-tooltip-events":p,"data-tooltip-position-strategy":v,"data-tooltip-delay-show":m,"data-tooltip-delay-hide":f},l)};var z={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},D={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const q=({forwardRef:t,id:l,className:i,classNameArrow:c,variant:u="dark",anchorId:d,anchorSelect:p,place:v="top",offset:m=10,events:h=["hover"],openOnClick:w=!1,positionStrategy:b="absolute",middlewares:S,wrapper:g,delayShow:A=0,delayHide:O=0,float:T=!1,hidden:x=!1,noArrow:N=!1,clickable:$=!1,closeOnEsc:I=!1,closeOnScroll:B=!1,closeOnResize:q=!1,openEvents:H,closeEvents:M,globalCloseEvents:W,imperativeModeOnly:P,style:V,position:F,afterShow:K,afterHide:U,content:X,contentWrapperRef:Y,isOpen:G,defaultIsOpen:Z=!1,setIsOpen:J,activeAnchor:Q,setA
16105ctiveAnchor:ee,border:te,opacity:oe,arrowColor:le,role:re="tooltip"})=>{var ne;const ie=(0,reactfrom_dll_reference_common_lib.useRef)(null),ce=(0,reactfrom_dll_reference_common_lib.useRef)(null),se=(0,reactfrom_dll_reference_common_lib.useRef)(null),ae=(0,reactfrom_dll_reference_common_lib.useRef)(null),ue=(0,reactfrom_dll_reference_common_lib.useRef)(null),[de,pe]=(0,reactfrom_dll_reference_common_lib.useState)({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[ve,me]=(0,reactfrom_dll_reference_common_lib.useState)(!1),[fe,ye]=(0,reactfrom_dll_reference_common_lib.useState)(!1),[he,we]=(0,reactfrom_dll_reference_common_lib.useState)(null),be=(0,reactfrom_dll_reference_common_lib.useRef)(!1),Se=(0,reactfrom_dll_reference_common_lib.useRef)(null),{anchorRefs:ge,setActiveAnchor:Ee}=j(l),Ae=(0,reactfrom_dll_reference_common_lib.useRef)(!1),[_e,Oe]=(0,reactfrom_dll_reference_common_lib.useState)([]),ke=(0,reactfrom_dll_reference_common_lib.useRef)(!1),Te=w||h.includes("click"),Le=Te||(null==H?void 0:H.click)||(null==H?void 0:H.dblclick)||(null==H?void 0:H.mousedown),Ce=H?{...H}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!H&&Te&&Object.assign(Ce,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const Re=M?{...M}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};
16105!M&&Te&&Object.assign(Re,{mouseleave:!1,blur:!1,mouseout:!1});const xe=W?{...W}:{escape:I||!1,scroll:B||!1,resize:q||!1,clickOutsideAnchor:Le||!1};P&&(Object.assign(Ce,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Re,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(xe,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),C((()=>(ke.current=!0,()=>{ke.current=!1})),[]);const Ne=e=>{ke.current&&(e&&ye(!0),setTimeout((()=>{ke.current&&(null==J||J(e),void 0===G&&me(e))}),10))};(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{if(void 0===G)return()=>null;G&&ye(!0);const e=setTimeout((()=>{me(G)}),10);return()=>{clearTimeout(e)}}),[G]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{if(ve!==be.current)if(R(ue),be.current=ve,ve)null==K||K();else{const e=(e=>{const t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,o,l]=t;return Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));ue.current=setTimeout((()=>{ye(!1),we(null),null==U||U()}),e+25)}}),[ve]);const $e=e=>{pe((t=>k(t,e)?t:e))},Ie=(e=A)=>{R(se),fe?Ne(!0):se.current=setTimeout((()=>{Ne(!0)}),e)},je=(e=O)=>{R(ae),ae.current=setTimeout((()=>{Ae.current||Ne(!1)}),e)},Be=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return ee(null),void Ee({current:null});A?Ie():Ne(!0),ee(o),Ee({current:o}),R(ae)},ze=()=>{$?je(O||100):O?je():Ne(!1),R(se)},De=({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};E({place:null!==(o=null==he?void 0:he.place)&&void 0!==o?o:v,offset:m,elementReference:l,tooltipReference:ie.current,tooltipArrowReference:ce.current,strategy:b,middlewares:S,border:te}).then((e=>{$e(e)}))},qe=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};De(o),Se.current=o},He=e=>{var t;if(!ve)return;const o=e.target;if(!o.isConnected)return;if(null===(t=ie.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${d}']`),..._e].some((e=>null==e?void 0:e.contains(o)))||(Ne(!1),R(se))},Me=_(Be,50,!0),We=_(ze,50,!0),Pe=e=>{We.cancel(),Me(e)},Ve=()=>{Me.cancel(),We()},Fe=(0,reactfrom_dll_reference_common_lib.useCallback)((()=>{var e,t;const o=null!==(e=null==he?void 0:he.position)&&void 0!==e?e:F;o?De(o):T?Se.current&&De(Se.current):(null==Q?void 0:Q.isConnected)&&E({place:null!==(t=null==he?void 0:he.place)&&void 0!==t?t:v,offset:m,elementReference:Q,tooltipReference:ie.current,tooltipArrowReference:ce.current,strategy:b,middlewares:S,border:te}).then((e=>{ke.current&&$e(e)}))}),[ve,Q,X,V,v,null==he?void 0:he.place,m,b,F,null==he?void 0:he.position,T]);(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{var e,t;const o=new Set(ge);_e.forEach((e=>{o.add({current:e})}));const l=document.querySelector(`[id='${d}']`);l&&o.add({current:l});const r=()=>{Ne(!1)},n=L(Q),i=L(ie.current);xe.scroll&&(window.addEventListener("scroll",r),null==n||n.addEventListener("scroll",r),null==i||i.addEventListener("scroll",r));let c=null;xe.resize?window.addEventListener("resize",r):Q&&ie.current&&(c=(0,floating_ui_dom/* autoUpdate */.ll)(Q,ie.current,Fe,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const s=e=>{"Escape"===e.key&&Ne(!1)};xe.escape&&window.addEventListener("keydown",s),xe.clickOutsideAnchor&&window.addEventListener("click",He);const a=[],u=e=>{ve&&(null==e?void 0:e.target)===Q||Be(e)},p=e=>{ve&&(null==e?void 0:e.target)===Q&&ze()},v=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],m=["click","dblclick","mousedown","mouseup"];Object.entries(Ce).forEach((([e,t])=>{t&&(v.includes(e)?a.push({event:e,listener:Pe}):m.includes(e)&&a.push({event:e,listener:u}))})),Object.entries(Re).forEach((([e,t])=>{t&&(v.includes(e)?a.push({event:e,listener:Ve}):m.includes(e)&&a.push({event:e,listener:p}))})),T&&a.push({event:"pointermove",listener:qe});const y=()=>{Ae.current=!0},h=()=>{Ae.current=!1,ze()};return $&&!Le&&(null===(e=ie.current)||void 0===e||e.addEventListener("mouseenter",y),null===(t=ie.current)||void 0===t||t.addEventListener("mouseleave",h)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.addEventListener(e,t)}))})),()=>{var e,t;xe.scroll&&(window.removeEventListener("scroll",r),null==n||n.removeEventListener("scroll",r),null==i||i.removeEventListener("scroll",r)),xe.resize?window.removeEventListener("resize",r):null==c||c(),xe.clickOutsideAnchor&&window.removeEventListener("click",He),xe.escape&&window.removeEventListener("keydown",s),$&&!Le&&(null===(e=ie.current)||void 0===e||e.removeEventListener("mouseenter",y),null===(t=ie.current)||void 0===t||t.removeEventListener("mouseleave",h)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.removeEventListener(e,t)}))}))}}),[Q,Fe,fe,ge,_e,H,M,W,Te,A,O]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{var e,t;let o=null!==(t=null!==(e=null==he?void 0:he.anchorSelect)&&void 0!==e?e:p)&&void 0!==t?t:"";!o&&l&&(o=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`);const r=new MutationObserver((e=>{const t=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===l?t.pu
16105sh(e.target):e.oldValue===l&&r.push(e.target)}if("childList"===e.type){if(Q){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,Q))&&(ye(!1),Ne(!1),ee(null),R(se),R(ae),!0)}))}if(o)try{const l=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...l.filter((e=>e.matches(o)))),t.push(...l.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}}})),(t.length||r.length)&&Oe((e=>[...e.filter((e=>!r.includes(e))),...t]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{r.disconnect()}}),[l,p,null==he?void 0:he.anchorSelect,Q]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{Fe()}),[Fe]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{if(!(null==Y?void 0:Y.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Fe()))}));return e.observe(Y.current),()=>{e.disconnect()}}),[X,null==Y?void 0:Y.current]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{var e;const t=document.querySelector(`[id='${d}']`),o=[..._e,t];Q&&o.includes(Q)||ee(null!==(e=_e[0])&&void 0!==e?e:t)}),[d,_e,Q]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>(Z&&Ne(!0),()=>{R(se),R(ae)})),[]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{var e;let t=null!==(e=null==he?void 0:he.anchorSelect)&&void 0!==e?e:p;if(!t&&l&&(t=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));Oe(e)}catch(e){Oe([])}}),[l,p,null==he?void 0:he.anchorSelect]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{se.current&&(R(se),Ie(A))}),[A]);const Ke=null!==(ne=null==he?void 0:he.content)&&void 0!==ne?ne:X,Ue=ve&&Object.keys(de.tooltipStyles).length>0;return (0,reactfrom_dll_reference_common_lib.useImperativeHandle)(t,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}we(null!=e?e:null),(null==e?void 0:e.delay)?Ie(e.delay):Ne(!0)},close:e=>{(null==e?void 0:e.delay)?je(e.delay):Ne(!1)},activeAnchor:Q,place:de.place,isOpen:Boolean(fe&&!x&&Ke&&Ue)}))),fe&&!x&&Ke?reactfrom_dll_reference_common_lib.createElement(g,{id:l,role:re,className:classnames("react-tooltip",z.tooltip,D.tooltip,D[u],i,`react-tooltip__place-${de.place}`,z[Ue?"show":"closing"],Ue?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&z.fixed,$&&z.clickable),onTransitionEnd:e=>{R(ue),ve||"opacity"!==e.propertyName||(ye(!1),we(null),null==U||U())},style:{...V,...de.tooltipStyles,opacity:void 0!==oe&&Ue?oe:void 0},ref:ie},Ke,reactfrom_dll_reference_common_lib.createElement(g,{className:classnames("react-tooltip-arrow",z.arrow,D.arrow,c,N&&z.noArrow),style:{...de.tooltipArrowStyles,background:le?`linear-gradient(to right bottom, transparent 50%, ${le} 50%)`:void 0},ref:ce})):null},H=({content:t})=>reactfrom_dll_reference_common_lib.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),M=reactfrom_dll_reference_common_lib.forwardRef((({id:t,anchorId:l,anchorSelect:n,content:i,html:c,render:a,className:u,classNameArrow:d,variant:p="dark",place:v="top",offset:m=10,wrapper:f="div",children:h=null,events:w=["hover"],openOnClick:b=!1,positionStrategy:S="absolute",middlewares:g,delayShow:E=0,delayHide:_=0,float:O=!1,hidden:k=!1,noArrow:T=!1,clickable:L=!1,closeOnEsc:C=!1,closeOnScroll:R=!1,closeOnResize:x=!1,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:B=!1,style:z,position:D,isOpen:M,defaultIsOpen:W=!1,disableStyleInjection:P=!1,border:V,opacity:F,arrowColor:K,setIsOpen:U,afterShow:X,afterHide:Y,role:G="tooltip"},Z)=>{const[J,Q]=(0,reactfrom_dll_reference_common_lib.useState)(i),[ee,te]=(0,reactfrom_dll_reference_common_lib.useState)(c),[oe,le]=(0,reactfrom_dll_reference_common_lib.useState)(v),[re,ne]=(0,reactfrom_dll_reference_common_lib.useState)(p),[ie,ce]=(0,reactfrom_dll_reference_common_lib.useState)(m),[se,ae]=(0,reactfrom_dll_reference_common_lib.useState)(E),[ue,de]=(0,reactfrom_dll_reference_common_lib.useState)(_),[pe,ve]=(0,reactfrom_dll_reference_common_lib.useState)(O),[me,fe]=(0,reactfrom_dll_reference_common_lib.useState)(k),[ye,he]=(0,reactfrom_dll_reference_common_lib.useState)(f),[we,be]=(0,reactfrom_dll_reference_common_lib.useState)(w),[Se,ge]=(0,reactfrom_dll_reference_common_lib.useState)(S),[Ee,Ae]=(0,reactfrom_dll_reference_common_lib.useState)(null),[_e,Oe]=(0,reactfrom_dll_reference_common_lib.useState)(null),ke=(0,reactfrom_dll_reference_common_lib.useRef)(P),{anch
16105orRefs:Te,activeAnchor:Le}=j(t),Ce=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null}return t}),{}),Re=e=>{const t={place:e=>{var t;le(null!==(t=e)&&void 0!==t?t:v)},content:e=>{Q(null!=e?e:i)},html:e=>{te(null!=e?e:c)},variant:e=>{var t;ne(null!==(t=e)&&void 0!==t?t:p)},offset:e=>{ce(null===e?m:Number(e))},wrapper:e=>{var t;he(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");be(null!=t?t:w)},"position-strategy":e=>{var t;ge(null!==(t=e)&&void 0!==t?t:S)},"delay-show":e=>{ae(null===e?E:Number(e))},"delay-hide":e=>{de(null===e?_:Number(e))},float:e=>{ve(null===e?O:"true"===e)},hidden:e=>{fe(null===e?k:"true"===e)},"class-name":e=>{Ae(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o)}))};(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{Q(i)}),[i]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{te(c)}),[c]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{le(v)}),[v]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{ne(p)}),[p]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{ce(m)}),[m]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{ae(E)}),[E]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{de(_)}),[_]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{ve(O)}),[O]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{fe(k)}),[k]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{ge(S)}),[S]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{ke.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[P]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}))}),[]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{var e;const o=new Set(Te);let r=n;if(!r&&t&&(r=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),r)try{document.querySelectorAll(r).forEach((e=>{o.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`)}const i=document.querySelector(`[id='${l}']`);if(i&&o.add({current:i}),!o.size)return()=>null;const c=null!==(e=null!=_e?_e:i)&&void 0!==e?e:Le.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=Ce(c);Re(o)}))})),a={attributes:!0,childList:!1,subtree:!1};if(c){const e=Ce(c);Re(e),s.observe(c,a)}return()=>{s.disconnect()}}),[Te,Le,_e,l,n]),(0,reactfrom_dll_reference_common_lib.useEffect)((()=>{(null==z?void 0:z.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),V&&!A("border",`${V}`)&&console.warn(`[react-tooltip] "${V}" is not a valid \`border\`.`),(null==z?void 0:z.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!A("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`)}),[]);let xe=h;const Ne=(0,reactfrom_dll_reference_common_lib.useRef)(null);if(a){const t=a({content:(null==_e?void 0:_e.getAttribute("data-tooltip-content"))||J||null,activeAnchor:_e});xe=t?reactfrom_dll_reference_common_lib.createElement("div",{ref:Ne,className:"react-tooltip-content-wrapper"},t):null}else J&&(xe=J);ee&&(xe=reactfrom_dll_reference_common_lib.createElement(H,{content:ee}));const $e={forwardRef:Z,id:t,anchorId:l,anchorSelect:n,className:classnames(u,Ee),classNameArrow:d,content:xe,contentWrapperRef:Ne,place:oe,variant:re,offset:ie,wrapper:ye,events:we,openOnClick:b,positionStrategy:Se,middlewares:g,delayShow:se,delayHide:ue,float:pe,hidden:me,noArrow:T,clickable:L,closeOnEsc:C,closeOnScroll:R,closeOnResize:x,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:B,style:z,position:D,isOpen:M,defaultIsOpen:W,border:V,opacity:F,arrowColor:K,setIsOpen:U,afterShow:X,afterHide:Y,activeAnchor:_e,setActiveAnchor:e=>Oe(e),role:G};return reactfrom_dll_reference_common_lib.createElement(q,{...$e})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||S({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}
16105.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||S({css:` 16106.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})})); 16107 16108// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js 16109var injectStylesIntoStyleTag = __webpack_require__(5072); 16110var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag); 16111// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleDomAPI.js 16112var styleDomAPI = __webpack_require__(7825); 16113var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI); 16114// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertBySelector.js 16115var insertBySelector = __webpack_require__(7659); 16116var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector); 16117// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js 16118var setAttributesWithoutAttributes = __webpack_require__(5056); 16119var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes); 16120// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertStyleElement.js 16121var insertStyleElement = __webpack_require__(540); 16122var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement); 16123// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleTagTransform.js 16124var styleTagTransform = __webpack_require__(1113); 16125var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform); 16126// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/react-tooltip/dist/react-tooltip.min.css 16127var react_tooltip_min = __webpack_require__(7455); 16128;// CONCATENATED MODULE: ./node_modules/react-tooltip/dist/react-tooltip.min.css 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140var options = {}; 16141 16142options.styleTagTransform = (styleTagTransform_default()); 16143options.setAttributes = (setAttributesWithoutAttributes_default()); 16144options.insert = insertBySelector_default().bind(null, "head"); 16145options.domAPI = (styleDomAPI_default()); 16146options.insertStyleElement = (insertStyleElement_default()); 16147 16148var update = injectStylesIntoStyleTag_default()(react_tooltip_min/* default */.A, options); 16149 16150 16151 16152 16153 /* harmony default export */ const dist_react_tooltip_min = (react_tooltip_min/* default */.A && react_tooltip_min/* default */.A.locals ? react_tooltip_min/* default */.A.locals : undefined); 16154 16155// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/react-loading-skeleton/dist/skeleton.css 16156var skeleton = __webpack_require__(2348); 16157;// CONCATENATED MODULE: ./node_modules/react-loading-skeleton/dist/skeleton.css 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169var skeleton_options = {}; 16170 16171skeleton_options.styleTagTransform = (styleTagTransform_default()); 16172skeleton_options.setAttributes = (setAttributesWithoutAttributes_default()); 16173skeleton_options.insert = insertBySelector_default().bind(null, "head"); 16174skeleton_options.domAPI = (styleDomAPI_default()); 16175skeleton_options.insertStyleElement = (insertStyleElement_default()); 16176 16177var skeleton_update = injectStylesIntoStyleTag_default()(skeleton/* default */.A, skeleton_options); 16178 16179 16180 16181 16182 /* harmony default export */ const dist_skeleton = (skeleton/* default */.A && skeleton/* default */.A.locals ? skeleton/* default */.A.locals : undefined); 16183 16184// EXTERNAL MODULE: ./node_modules/@bugsnag/js/browser/notifier.js 16185var notifier = __webpack_require__(5993); 16186var notifier_default = /*#__PURE__*/__webpack_require__.n(notifier); 16187// EXTERNAL MODULE: ./node_modules/@bugsnag/plugin-react/dist/bugsnag-react.js 16188var bugsnag_react = __webpack_require__(1702); 16189var bugsnag_react_default = /*#__PURE__*/__webpack_require__.n(bugsnag_react); 16190// EXTERNAL MODULE: ./node_modules/events/events.js 16191var events = __webpack_require__(7007); 16192var events_default = /*#__PURE__*/__webpack_require__.n(events); 16193;// CONCATENATED MODULE: ./src/App.tsx 16194var __assign = (undefined && undefined.__assign) || function () { 16195 __assign = Object.assign || function(t) { 16196 for (var s, i = 1, n = arguments.length; i < n; i++) { 16197 s = arguments[i]; 16198 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 16199 t[p] = s[p]; 16200 } 16201 return t; 16202 }; 16203 return __assign.apply(this, arguments); 16204}; 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215var Layout = (0,reactfrom_dll_reference_common_lib.lazy)(function () { return Promise.all(/* import() */[__webpack_require__.e(220), __webpack_require__.e(548)]).then(__webpack_require__.bind(__webpack_require__, 7548)); }); 16216var queryClient = new QueryClient(); 16217var newWindow = window; 16218var eventBus = new (events_default())(); 16219var environment = "production"; // check for environment from webpack define plugin 16220var App = reactfrom_dll_reference_common_lib.memo(function (_a) { 16221 var moduleId = _a.moduleId, portalId = _a.portalId, tabId = _a.tabId; 16222 var ErrorBoundary = reactfrom_dll_reference_common_lib.Fragment; 16223 // Enables Bugsnag for only production and staging 16224 if (environment === "production" || environment === "staging") { 16225 notifier_default().start({ 16226 apiKey: 'cda9f0e26157fe5cd4c66b83a0bd59ec', 16227 autoTrackSessions: false, 16228 enabledReleaseStages: ['production', 'staging'], 16229 plugins: [new (bugsnag_react_default())(reactfrom_dll_reference_common_lib)], 16230 onError: function (event) { 16231 event.addMetadata("errorMetadata", { 16232 portalid: pid, 16233 moduleid: mid, 16234 userid: newWindow.cuid, 16235 url: window.location.href, 16236 modulename: "Banner" 16237 }); 16238 } 16239 }); 16240 ErrorBoundary = notifier_default().getPlugin('react').createErrorBoundary(reactfrom_dll_reference_common_lib); 16241 } 16242 var _b = (0,reactfrom_dll_reference_common_lib.useContext)(ModuleContext/* ModuleContext */.U), _c = _b.ids, mid = _
16242c.moduleId, tid = _c.tabId, pid = _c.portalId, setIds = _b.setIds; 16243 (0,reactfrom_dll_reference_common_lib.useEffect)(function () { 16244 setIds(function (prev) { return (__assign(__assign({}, prev), { moduleId: moduleId, portalId: portalId, tabId: tabId })); }); 16245 }, []); 16246 return ((0,jsx_runtime.jsx)(ErrorBoundary, { children: (0,jsx_runtime.jsx)(QueryClientProvider/* QueryClientProvider */.Ht, { client: queryClient, children: mid !== 0 && tid !== 0 && pid !== 0 && ((0,jsx_runtime.jsxs)(reactfrom_dll_reference_common_lib.Suspense, { fallback: null, children: [(0,jsx_runtime.jsx)(Layout, {}), (0,jsx_runtime.jsx)(M, { id: "show-image-carousel-tooltip-".concat(moduleId), className: "mht-font-sans", place: "bottom", style: { 16247 maxWidth: 800, 16248 overflowWrap: "break-word", 16249 zIndex: 1200, 16250 backgroundColor: "#fff", 16251 whiteSpace: "initial", 16252 boxShadow: "0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12), 0 11px 15px -7px rgba(0,0,0,0.2)", 16253 borderRadius: "8px", 16254 color: "black", 16255 } })] })) }) })); 16256}); 16257/* harmony default export */ const src_App = (App); 16258 16259 16260/***/ }), 16261 16262/***/ 5837: 16263/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 16264 16265"use strict"; 16266/* harmony export */ __webpack_require__.d(__webpack_exports__, { 16267/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__), 16268/* harmony export */ U: () => (/* binding */ ModuleContext) 16269/* harmony export */ }); 16270/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4848); 16271/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3328); 16272 16273 16274var ModuleContext = react__WEBPACK_IMPORTED_MODULE_1__.createContext(0); 16275var initialState = { 16276 moduleId: 0, 16277 tabId: 0, 16278 portalId: 0, 16279 width: -1 16280}; 16281var ModuleProvider = function (props) { 16282 var _a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialState), ids = _a[0], setIds = _a[1]; 16283 return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ModuleContext.Provider, { value: { ids: ids, setIds: setIds }, children: props.children })); 16284}; 16285/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModuleProvider); 16286 16287 16288/***/ }), 16289 16290/***/ 3328: 16291/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 16292 16293module.exports = (__webpack_require__(3526))(294); 16294 16295/***/ }), 16296 16297/***/ 8013: 16298/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 16299 16300module.exports = (__webpack_require__(7246))(38535); 16301 16302/***/ }), 16303 16304/***/ 3845: 16305/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 16306 16307module.exports = (__webpack_require__(7246))(56405); 16308 16309/***/ }), 16310 16311/***/ 4500: 16312/***/ ((module, __unused_webpack_exports, __webpack_require__) => { 16313 16314module.exports = (__webpack_require__(3526))(935); 16315 16316/***/ }), 16317 16318/***/ 7246: 16319/***/ ((module) => { 16320 16321"use strict"; 16322module.exports = all_component_lib; 16323 16324/***/ }), 16325 16326/***/ 3526: 16327/***/ ((module) => { 16328 16329"use strict"; 16330module.exports = common_lib; 16331 16332/***/ }), 16333 16334/***/ 738: 16335/***/ ((module) => { 16336 16337"use strict"; 16338module.exports = editor_lib; 16339 16340/***/ }), 16341 16342/***/ 6942: 16343/***/ ((module, exports) => { 16344 16345var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 16346 Copyright (c) 2018 Jed Watson. 16347 Licensed under the MIT License (MIT), see 16348 http://jedwatson.github.io/classnames 16349*/ 16350/* global define */ 16351 16352(function () { 16353 'use strict'; 16354 16355 var hasOwn = {}.hasOwnProperty; 16356 16357 function classNames () { 16358 var classes = ''; 16359 16360 for (var i = 0; i < arguments.length; i++) { 16361 var arg = arguments[i]; 16362 if (arg) {
16363 classes = appendClass(classes, parseValue(arg)); 16364 } 16365 } 16366 16367 return classes; 16368 } 16369 16370 function parseValue (arg) { 16371 if (typeof arg === 'string' || typeof arg === 'number') { 16372 return arg; 16373 } 16374 16375 if (typeof arg !== 'object') { 16376 return ''; 16377 } 16378 16379 if (Array.isArray(arg)) { 16380 return classNames.apply(null, arg); 16381 } 16382 16383 if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { 16384 return arg.toString(); 16385 } 16386 16387 var classes = ''; 16388 16389 for (var key in arg) { 16390 if (hasOwn.call(arg, key) && arg[key]) { 16391 classes = appendClass(classes, key); 16392 } 16393 } 16394 16395 return classes; 16396 } 16397 16398 function appendClass (value, newClass) { 16399 if (!newClass) { 16400 return value; 16401 } 16402 16403 if (value) { 16404 return value + ' ' + newClass; 16405 } 16406 16407 return value + newClass; 16408 } 16409 16410 if ( true && module.exports) { 16411 classNames.default = classNames; 16412 module.exports = classNames; 16413 } else if (true) { 16414 // register as 'classnames', consistent with npm package name 16415 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 16416 return classNames; 16417 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 16418 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 16419 } else {} 16420}()); 16421 16422 16423/***/ }), 16424 16425/***/ 7663: 16426/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 16427 16428"use strict"; 16429 16430// EXPORTS 16431__webpack_require__.d(__webpack_exports__, { 16432 UE: () => (/* binding */ floating_ui_dom_arrow), 16433 ll: () => (/* binding */ autoUpdate), 16434 rD: () => (/* binding */ floating_ui_dom_computePosition), 16435 UU: () => (/* binding */ floating_ui_dom_flip), 16436 cY: () => (/* binding */ floating_ui_dom_offset), 16437 BN: () => (/* binding */ floating_ui_dom_shift) 16438}); 16439 16440// UNUSED EXPORTS: autoPlacement, detectOverflow, getOverflowAncestors, hide, inline, limitShift, platform, size 16441 16442;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 16443/** 16444 * Custom positioning reference element. 16445 * @see https://floating-ui.com/docs/virtual-elements 16446 */ 16447 16448const floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); 16449const alignments = (/* unused pure expression or super */ null && (['start', 'end'])); 16450const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []))); 16451const floating_ui_utils_min = Math.min; 16452const floating_ui_utils_max = Math.max; 16453const round = Math.round; 16454const floor = Math.floor; 16455const createCoords = v => ({ 16456 x: v, 16457 y: v 16458}); 16459const oppositeSideMap = { 16460 left: 'right', 16461 right: 'left', 16462 bottom: 'top', 16463 top: 'bottom' 16464}; 16465function clamp(start, value, end) { 16466 return floating_ui_utils_max(start, floating_ui_utils_min(value, end)); 16467} 16468function floating_ui_utils_evaluate(value, param) { 16469 return typeof value === 'function' ? value(param) : value; 16470} 16471function floating_ui_utils_getSide(placement) { 16472 return placement.split('-')[0]; 16473} 16474function floating_ui_utils_getAlignment(placement) { 16475 return placement.split('-')[1]; 16476} 16477function floating_ui_utils_getOppositeAxis(axis) { 16478 return axis === 'x' ? 'y' : 'x'; 16479} 16480function getAxisLength(axis) { 16481 return axis === 'y' ? 'height' : 'width'; 16482} 16483function floating_ui_utils_getSideAxis(placement) { 16484 const firstChar = placement[0]; 16485 return firstChar === 't' || firstChar === 'b' ? 'y' : 'x'; 16486} 16487function getAlignmentAxis(placement) { 16488 return floating_ui_utils_getOppositeAxis(floating_ui_utils_getSideAxis(placement)); 16489} 16490function floating_ui_utils_getAlignmentSides(placement, rects, rtl) { 16491 if (rtl === void 0) { 16492 rtl = false; 16493 } 16494 const alignment = floating_ui_utils_getAlignment(placement); 16495 const alignmentAxis = getAlignmentAxis(placement); 16496 const length = getAxisLength(alignmentAxis); 16497 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; 16498 if (rects.reference[length] > rects.floating[length]) { 16499 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 16500 } 16501 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 16502} 16503function getExpandedPlacements(placement) { 16504 const oppositePlacement = getOppositePlacement(placement); 16505 return [floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)]; 16506} 16507function floating_ui_utils_getOppositeAlignmentPlacement(placement) { 16508 return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start'); 16509} 16510const lrPlacement = ['left', 'right']; 16511const rlPlacement = ['right', 'left']; 16512const tbPlacement = ['top', 'bottom']; 16513const btPlacement = ['bottom', 'top']; 16514function getSideList(side, isStart, rtl) { 16515 switch (side) { 16516 case 'top': 16517 case 'bottom': 16518 if (rtl) return isStart ? rlPlacement : lrPlacement; 16519 return isStart ? lrPlacement : rlPlacement; 16520 case 'left': 16521 case 'right': 16522 return isStart ? tbPlacement : btPlacement; 16523 default: 16524 return []; 16525 } 16526} 16527function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 16528 const alignment = floating_ui_utils_getAlignment(placement); 16529 let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl); 16530 if (alignment) { 16531 list = list.map(side => side + "-" + alignment); 16532 if (flipAlignment) { 16533 list = list.concat(list.map(floating_ui_utils_getOppositeAlignmentPlacement)); 16534 } 16535 } 16536 return list; 16537} 16538function getOppositePlacement(placement) { 16539 const side = floating_ui_utils_getSide(placement); 16540 return oppositeSideMap[side] + placement.slice(side.length); 16541}
vendor: 4,993 bytes, lines 16542-16709
16542function expandPaddingObject(padding) { 16543 return { 16544 top: 0, 16545 right: 0, 16546 bottom: 0, 16547 left: 0, 16548 ...padding 16549 }; 16550} 16551function floating_ui_utils_getPaddingObject(padding) { 16552 return typeof padding !== 'number' ? expandPaddingObject(padding) : { 16553 top: padding, 16554 right: padding, 16555 bottom: padding, 16556 left: padding 16557 }; 16558} 16559function floating_ui_utils_rectToClientRect(rect) { 16560 const { 16561 x, 16562 y, 16563 width, 16564 height 16565 } = rect; 16566 return { 16567 width, 16568 height, 16569 top: y, 16570 left: x, 16571 right: x + width, 16572 bottom: y + height, 16573 x, 16574 y 16575 }; 16576} 16577 16578 16579 16580;// CONCATENATED MODULE: ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs 16581 16582 16583 16584function computeCoordsFromPlacement(_ref, placement, rtl) { 16585 let { 16586 reference, 16587 floating 16588 } = _ref; 16589 const sideAxis = floating_ui_utils_getSideAxis(placement); 16590 const alignmentAxis = getAlignmentAxis(placement); 16591 const alignLength = getAxisLength(alignmentAxis); 16592 const side = floating_ui_utils_getSide(placement); 16593 const isVertical = sideAxis === 'y'; 16594 const commonX = reference.x + reference.width / 2 - floating.width / 2; 16595 const commonY = reference.y + reference.height / 2 - floating.height / 2; 16596 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 16597 let coords; 16598 switch (side) { 16599 case 'top': 16600 coords = { 16601 x: commonX, 16602 y: reference.y - floating.height 16603 }; 16604 break; 16605 case 'bottom': 16606 coords = { 16607 x: commonX, 16608 y: reference.y + reference.height 16609 }; 16610 break; 16611 case 'right': 16612 coords = { 16613 x: reference.x + reference.width, 16614 y: commonY 16615 }; 16616 break; 16617 case 'left': 16618 coords = { 16619 x: reference.x - floating.width, 16620 y: commonY 16621 }; 16622 break; 16623 default: 16624 coords = { 16625 x: reference.x, 16626 y: reference.y 16627 }; 16628 } 16629 switch (floating_ui_utils_getAlignment(placement)) { 16630 case 'start': 16631 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 16632 break; 16633 case 'end': 16634 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 16635 break; 16636 } 16637 return coords; 16638} 16639 16640/** 16641 * Resolves with an object of overflow side offsets that determine how much the 16642 * element is overflowing a given clipping boundary on each side. 16643 * - positive = overflowing the boundary by that number of pixels 16644 * - negative = how many pixels left before it will overflow 16645 * - 0 = lies flush with the boundary 16646 * @see https://floating-ui.com/docs/detectOverflow 16647 */ 16648async function detectOverflow(state, options) { 16649 var _await$platform$isEle; 16650 if (options === void 0) { 16651 options = {}; 16652 } 16653 const { 16654 x, 16655 y, 16656 platform, 16657 rects, 16658 elements, 16659 strategy 16660 } = state; 16661 const { 16662 boundary = 'clippingAncestors', 16663 rootBoundary = 'viewport', 16664 elementContext = 'floating', 16665 altBoundary = false, 16666 padding = 0 16667 } = floating_ui_utils_evaluate(options, state); 16668 const paddingObject = floating_ui_utils_getPaddingObject(padding); 16669 const altContext = elementContext === 'floating' ? 'reference' : 'floating'; 16670 const element = elements[altBoundary ? altContext : elementContext]; 16671 const clippingClientRect = floating_ui_utils_rectToClientRect(await platform.getClippingRect({ 16672 element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), 16673 boundary, 16674 rootBoundary, 16675 strategy 16676 })); 16677 const rect = elementContext === 'floating' ? { 16678 x, 16679 y, 16680 width: rects.floating.width, 16681 height: rects.floating.height 16682 } : rects.reference; 16683 const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); 16684 const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { 16685 x: 1, 16686 y: 1 16687 } : { 16688 x: 1, 16689 y: 1 16690 }; 16691 const elementClientRect = floating_ui_utils_rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ 16692 elements, 16693 rect, 16694 offsetParent, 16695 strategy 16696 }) : rect); 16697 return { 16698 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 16699 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 16700 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 16701 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 16702 }; 16703} 16704 16705// Maximum number of resets that can occur before bailing to avoid infinite reset loops. 16706const MAX_RESET_COUNT = 50; 16707 16708/** 16709 * Computes the `x` and `y` coordinates that will place the floating element
vendor: 4,288 bytes, lines 16710-16856
16710 * next to a given reference element. 16711 * 16712 * This export does not have any `platform` interface logic. You will need to 16713 * write one for the platform you are using Floating UI with. 16714 */ 16715const computePosition = async (reference, floating, config) => { 16716 const { 16717 placement = 'bottom', 16718 strategy = 'absolute', 16719 middleware = [], 16720 platform 16721 } = config; 16722 const platformWithDetectOverflow = platform.detectOverflow ? platform : { 16723 ...platform, 16724 detectOverflow 16725 }; 16726 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); 16727 let rects = await platform.getElementRects({ 16728 reference, 16729 floating, 16730 strategy 16731 }); 16732 let { 16733 x, 16734 y 16735 } = computeCoordsFromPlacement(rects, placement, rtl); 16736 let statefulPlacement = placement; 16737 let resetCount = 0; 16738 const middlewareData = {}; 16739 for (let i = 0; i < middleware.length; i++) { 16740 const currentMiddleware = middleware[i]; 16741 if (!currentMiddleware) { 16742 continue; 16743 } 16744 const { 16745 name, 16746 fn 16747 } = currentMiddleware; 16748 const { 16749 x: nextX, 16750 y: nextY, 16751 data, 16752 reset 16753 } = await fn({ 16754 x, 16755 y, 16756 initialPlacement: placement, 16757 placement: statefulPlacement, 16758 strategy, 16759 middlewareData, 16760 rects, 16761 platform: platformWithDetectOverflow, 16762 elements: { 16763 reference, 16764 floating 16765 } 16766 }); 16767 x = nextX != null ? nextX : x; 16768 y = nextY != null ? nextY : y; 16769 middlewareData[name] = { 16770 ...middlewareData[name], 16771 ...data 16772 }; 16773 if (reset && resetCount < MAX_RESET_COUNT) { 16774 resetCount++; 16775 if (typeof reset === 'object') { 16776 if (reset.placement) { 16777 statefulPlacement = reset.placement; 16778 } 16779 if (reset.rects) { 16780 rects = reset.rects === true ? await platform.getElementRects({ 16781 reference, 16782 floating, 16783 strategy 16784 }) : reset.rects; 16785 } 16786 ({ 16787 x, 16788 y 16789 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 16790 } 16791 i = -1; 16792 } 16793 } 16794 return { 16795 x, 16796 y, 16797 placement: statefulPlacement, 16798 strategy, 16799 middlewareData 16800 }; 16801}; 16802 16803/** 16804 * Provides data to position an inner element of the floating element so that it 16805 * appears centered to the reference element. 16806 * @see https://floating-ui.com/docs/arrow 16807 */ 16808const arrow = options => ({ 16809 name: 'arrow', 16810 options, 16811 async fn(state) { 16812 const { 16813 x, 16814 y, 16815 placement, 16816 rects, 16817 platform, 16818 elements, 16819 middlewareData 16820 } = state; 16821 // Since `element` is required, we don't Partial<> the type. 16822 const { 16823 element, 16824 padding = 0 16825 } = floating_ui_utils_evaluate(options, state) || {}; 16826 if (element == null) { 16827 return {}; 16828 } 16829 const paddingObject = floating_ui_utils_getPaddingObject(padding); 16830 const coords = { 16831 x, 16832 y 16833 }; 16834 const axis = getAlignmentAxis(placement); 16835 const length = getAxisLength(axis); 16836 const arrowDimensions = await platform.getDimensions(element); 16837 const isYAxis = axis === 'y'; 16838 const minProp = isYAxis ? 'top' : 'left'; 16839 const maxProp = isYAxis ? 'bottom' : 'right'; 16840 const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; 16841 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 16842 const startDiff = coords[axis] - rects.reference[axis]; 16843 const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); 16844 let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; 16845 16846 // DOM platform can return `window` as the `offsetParent`. 16847 if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { 16848 clientSize = elements.floating[clientProp] || rects.floating[length]; 16849 } 16850 const centerToReference = endDiff / 2 - startDiff / 2; 16851 16852 // If the padding is large enough that it causes the arrow to no longer be 16853 // centered, modify the padding so that it is centered. 16854 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 16855 const minPadding = floating_ui_utils_min(paddingObject[minProp], largestPossiblePadding); 16856 const maxPadding = floating_ui_utils_min(paddingObject[maxPro
vendor: 6,245 bytes, lines 16856-17015
16856p], largestPossiblePadding); 16857 16858 // Make sure the arrow doesn't overflow the floating element if the center 16859 // point is outside the floating element's bounds. 16860 const min$1 = minPadding; 16861 const max = clientSize - arrowDimensions[length] - maxPadding; 16862 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 16863 const offset = clamp(min$1, center, max); 16864 16865 // If the reference is small enough that the arrow's padding causes it to 16866 // to point to nothing for an aligned placement, adjust the offset of the 16867 // floating element itself. To ensure `shift()` continues to take action, 16868 // a single reset is performed when this is true. 16869 const shouldAddOffset = !middlewareData.arrow && floating_ui_utils_getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 16870 const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; 16871 return { 16872 [axis]: coords[axis] + alignmentOffset, 16873 data: { 16874 [axis]: offset, 16875 centerOffset: center - offset - alignmentOffset, 16876 ...(shouldAddOffset && { 16877 alignmentOffset 16878 }) 16879 }, 16880 reset: shouldAddOffset 16881 }; 16882 } 16883}); 16884 16885function getPlacementList(alignment, autoAlignment, allowedPlacements) { 16886 const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); 16887 return allowedPlacementsSortedByAlignment.filter(placement => { 16888 if (alignment) { 16889 return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); 16890 } 16891 return true; 16892 }); 16893} 16894/** 16895 * Optimizes the visibility of the floating element by choosing the placement 16896 * that has the most space available automatically, without needing to specify a 16897 * preferred placement. Alternative to `flip`. 16898 * @see https://floating-ui.com/docs/autoPlacement 16899 */ 16900const autoPlacement = function (options) { 16901 if (options === void 0) { 16902 options = {}; 16903 } 16904 return { 16905 name: 'autoPlacement', 16906 options, 16907 async fn(state) { 16908 var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; 16909 const { 16910 rects, 16911 middlewareData, 16912 placement, 16913 platform, 16914 elements 16915 } = state; 16916 const { 16917 crossAxis = false, 16918 alignment, 16919 allowedPlacements = placements, 16920 autoAlignment = true, 16921 ...detectOverflowOptions 16922 } = evaluate(options, state); 16923 const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; 16924 const overflow = await platform.detectOverflow(state, detectOverflowOptions); 16925 const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; 16926 const currentPlacement = placements$1[currentIndex]; 16927 if (currentPlacement == null) { 16928 return {}; 16929 } 16930 const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); 16931 16932 // Make `computeCoords` start from the right place. 16933 if (placement !== currentPlacement) { 16934 return { 16935 reset: { 16936 placement: placements$1[0] 16937 } 16938 }; 16939 } 16940 const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; 16941 const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { 16942 placement: currentPlacement, 16943 overflows: currentOverflows 16944 }]; 16945 const nextPlacement = placements$1[currentIndex + 1]; 16946 16947 // There are more placements to check. 16948 if (nextPlacement) { 16949 return { 16950 data: { 16951 index: currentIndex + 1, 16952 overflows: allOverflows 16953 }, 16954 reset: { 16955 placement: nextPlacement 16956 } 16957 }; 16958 } 16959 const placementsSortedByMostSpace = allOverflows.map(d => { 16960 const alignment = getAlignment(d.placement); 16961 return [d.placement, alignment && crossAxis ? 16962 // Check along the mainAxis and main crossAxis side. 16963 d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : 16964 // Check only the mainAxis. 16965 d.overflows[0], d.overflows]; 16966 }).sort((a, b) => a[1] - b[1]); 16967 const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, 16968 // Aligned placements should not check their opposite crossAxis 16969 // side. 16970 getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); 16971 const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; 16972 if (resetPlacement !== placement) { 16973 return { 16974 data: { 16975 index: currentIndex + 1, 16976 overflows: allOverflows 16977 }, 16978 reset: { 16979 placement: resetPlacement 16980 } 16981 }; 16982 } 16983 return {}; 16984 } 16985 }; 16986}; 16987 16988/** 16989 * Optimizes the visibility of the floating element by flipping the `placement` 16990 * in order to keep it in view when the preferred placement(s) will overflow the 16991 * clipping boundary. Alternative to `autoPlacement`. 16992 * @see https://floating-ui.com/docs/flip 16993 */ 16994const flip = function (options) { 16995 if (options === void 0) { 16996 options = {}; 16997 } 16998 return { 16999 name: 'flip', 17000 options, 17001 async fn(state) { 17002 var _middlewareData$arrow, _middlewareData$flip; 17003 const { 17004 placement, 17005 middlewareData, 17006 rects, 17007 initialPlacement, 17008 platform, 17009 elements 17010 } = state; 17011 const { 17012 mainAxis: checkMainAxis = true, 17013 crossAxis: checkCrossAxis = true, 17014 fallbackPlacements: specifiedFallbackPlacements, 17015 fallbackStrategy = 'bestFit',
vendor: 6,793 bytes, lines 17016-17189
17016 fallbackAxisSideDirection = 'none', 17017 flipAlignment = true, 17018 ...detectOverflowOptions 17019 } = floating_ui_utils_evaluate(options, state); 17020 17021 // If a reset by the arrow was caused due to an alignment offset being 17022 // added, we should skip any logic now since `flip()` has already done its 17023 // work. 17024 // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 17025 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 17026 return {}; 17027 } 17028 const side = floating_ui_utils_getSide(placement); 17029 const initialSideAxis = floating_ui_utils_getSideAxis(initialPlacement); 17030 const isBasePlacement = floating_ui_utils_getSide(initialPlacement) === initialPlacement; 17031 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 17032 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 17033 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; 17034 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 17035 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 17036 } 17037 const placements = [initialPlacement, ...fallbackPlacements]; 17038 const overflow = await platform.detectOverflow(state, detectOverflowOptions); 17039 const overflows = []; 17040 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 17041 if (checkMainAxis) { 17042 overflows.push(overflow[side]); 17043 } 17044 if (checkCrossAxis) { 17045 const sides = floating_ui_utils_getAlignmentSides(placement, rects, rtl); 17046 overflows.push(overflow[sides[0]], overflow[sides[1]]); 17047 } 17048 overflowsData = [...overflowsData, { 17049 placement, 17050 overflows 17051 }]; 17052 17053 // One or more sides is overflowing. 17054 if (!overflows.every(side => side <= 0)) { 17055 var _middlewareData$flip2, _overflowsData$filter; 17056 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 17057 const nextPlacement = placements[nextIndex]; 17058 if (nextPlacement) { 17059 const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== floating_ui_utils_getSideAxis(nextPlacement) : false; 17060 if (!ignoreCrossAxisOverflow || 17061 // We leave the current main axis only if every placement on that axis 17062 // overflows the main axis. 17063 overflowsData.every(d => floating_ui_utils_getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { 17064 // Try next placement and re-run the lifecycle. 17065 return { 17066 data: { 17067 index: nextIndex, 17068 overflows: overflowsData 17069 }, 17070 reset: { 17071 placement: nextPlacement 17072 } 17073 }; 17074 } 17075 } 17076 17077 // First, find the candidates that fit on the mainAxis side of overflow, 17078 // then find the placement that fits the best on the main crossAxis side. 17079 let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 17080 17081 // Otherwise fallback. 17082 if (!resetPlacement) { 17083 switch (fallbackStrategy) { 17084 case 'bestFit': 17085 { 17086 var _overflowsData$filter2; 17087 const placement = (_overflowsData$filter2 = overflowsData.filter(d => { 17088 if (hasFallbackAxisSideDirection) { 17089 const currentSideAxis = floating_ui_utils_getSideAxis(d.placement); 17090 return currentSideAxis === initialSideAxis || 17091 // Create a bias to the `y` side axis due to horizontal 17092 // reading directions favoring greater width. 17093 currentSideAxis === 'y'; 17094 } 17095 return true; 17096 }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 17097 if (placement) { 17098 resetPlacement = placement; 17099 } 17100 break; 17101 } 17102 case 'initialPlacement': 17103 resetPlacement = initialPlacement; 17104 break; 17105 } 17106 } 17107 if (placement !== resetPlacement) { 17108 return { 17109 reset: { 17110 placement: resetPlacement 17111 } 17112 }; 17113 } 17114 } 17115 return {}; 17116 } 17117 }; 17118}; 17119 17120function getSideOffsets(overflow, rect) { 17121 return { 17122 top: overflow.top - rect.height, 17123 right: overflow.right - rect.width, 17124 bottom: overflow.bottom - rect.height, 17125 left: overflow.left - rect.width 17126 }; 17127} 17128function isAnySideFullyClipped(overflow) { 17129 return sides.some(side => overflow[side] >= 0); 17130} 17131/** 17132 * Provides data to hide the floating element in applicable situations, such as 17133 * when it is not in the same clipping context as the reference element. 17134 * @see https://floating-ui.com/docs/hide 17135 */ 17136const hide = function (options) { 17137 if (options === void 0) { 17138 options = {}; 17139 } 17140 return { 17141 name: 'hide', 17142 options, 17143 async fn(state) { 17144 const { 17145 rects, 17146 platform 17147 } = state; 17148 const { 17149 strategy = 'referenceHidden', 17150 ...detectOverflowOptions 17151 } = evaluate(options, state); 17152 switch (strategy) { 17153 case 'referenceHidden': 17154 { 17155 const overflow = await platform.detectOverflow(state, { 17156 ...detectOverflowOptions, 17157 elementContext: 'reference' 17158 }); 17159 const offsets = getSideOffsets(overflow, rects.reference); 17160 return { 17161 data: { 17162 referenceHiddenOffsets: offsets, 17163 referenceHidden: isAnySideFullyClipped(offsets) 17164 } 17165 }; 17166 } 17167 case 'escaped': 17168 { 17169 const overflow = await platform.detectOverflow(state, { 17170 ...detectOverflowOptions, 17171 altBoundary: true 17172 }); 17173 const offsets = getSideOffsets(overflow, rects.floating); 17174 return { 17175 data: { 17176 escapedOffsets: offsets, 17177 escaped: isAnySideFullyClipped(offsets) 17178 } 17179 }; 17180 } 17181 default: 17182 { 17183 return {}; 17184 } 17185 } 17186 } 17187 }; 17188}; 17189
vendor: 15,779 bytes, lines 17190-17663
17190function getBoundingRect(rects) { 17191 const minX = min(...rects.map(rect => rect.left)); 17192 const minY = min(...rects.map(rect => rect.top)); 17193 const maxX = max(...rects.map(rect => rect.right)); 17194 const maxY = max(...rects.map(rect => rect.bottom)); 17195 return { 17196 x: minX, 17197 y: minY, 17198 width: maxX - minX, 17199 height: maxY - minY 17200 }; 17201} 17202function getRectsByLine(rects) { 17203 const sortedRects = rects.slice().sort((a, b) => a.y - b.y); 17204 const groups = []; 17205 let prevRect = null; 17206 for (let i = 0; i < sortedRects.length; i++) { 17207 const rect = sortedRects[i]; 17208 if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { 17209 groups.push([rect]); 17210 } else { 17211 groups[groups.length - 1].push(rect); 17212 } 17213 prevRect = rect; 17214 } 17215 return groups.map(rect => rectToClientRect(getBoundingRect(rect))); 17216} 17217/** 17218 * Provides improved positioning for inline reference elements that can span 17219 * over multiple lines, such as hyperlinks or range selections. 17220 * @see https://floating-ui.com/docs/inline 17221 */ 17222const inline = function (options) { 17223 if (options === void 0) { 17224 options = {}; 17225 } 17226 return { 17227 name: 'inline', 17228 options, 17229 async fn(state) { 17230 const { 17231 placement, 17232 elements, 17233 rects, 17234 platform, 17235 strategy 17236 } = state; 17237 // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a 17238 // ClientRect's bounds, despite the event listener being triggered. A 17239 // padding of 2 seems to handle this issue. 17240 const { 17241 padding = 2, 17242 x, 17243 y 17244 } = evaluate(options, state); 17245 const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); 17246 const clientRects = getRectsByLine(nativeClientRects); 17247 const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); 17248 const paddingObject = getPaddingObject(padding); 17249 function getBoundingClientRect() { 17250 // There are two rects and they are disjoined. 17251 if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { 17252 // Find the first rect in which the point is fully inside. 17253 return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; 17254 } 17255 17256 // There are 2 or more connected rects. 17257 if (clientRects.length >= 2) { 17258 if (getSideAxis(placement) === 'y') { 17259 const firstRect = clientRects[0]; 17260 const lastRect = clientRects[clientRects.length - 1]; 17261 const isTop = getSide(placement) === 'top'; 17262 const top = firstRect.top; 17263 const bottom = lastRect.bottom; 17264 const left = isTop ? firstRect.left : lastRect.left; 17265 const right = isTop ? firstRect.right : lastRect.right; 17266 const width = right - left; 17267 const height = bottom - top; 17268 return { 17269 top, 17270 bottom, 17271 left, 17272 right, 17273 width, 17274 height, 17275 x: left, 17276 y: top 17277 }; 17278 } 17279 const isLeftSide = getSide(placement) === 'left'; 17280 const maxRight = max(...clientRects.map(rect => rect.right)); 17281 const minLeft = min(...clientRects.map(rect => rect.left)); 17282 const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); 17283 const top = measureRects[0].top; 17284 const bottom = measureRects[measureRects.length - 1].bottom; 17285 const left = minLeft; 17286 const right = maxRight; 17287 const width = right - left; 17288 const height = bottom - top; 17289 return { 17290 top, 17291 bottom, 17292 left, 17293 right, 17294 width, 17295 height, 17296 x: left, 17297 y: top 17298 }; 17299 } 17300 return fallback; 17301 } 17302 const resetRects = await platform.getElementRects({ 17303 reference: { 17304 getBoundingClientRect 17305 }, 17306 floating: elements.floating, 17307 strategy 17308 }); 17309 if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { 17310 return { 17311 reset: { 17312 rects: resetRects 17313 } 17314 }; 17315 } 17316 return {}; 17317 } 17318 }; 17319}; 17320 17321const originSides = /*#__PURE__*/new Set(['left', 'top']); 17322 17323// For type backwards-compatibility, the `OffsetOptions` type was also 17324// Derivable. 17325 17326async function convertValueToCoords(state, options) { 17327 const { 17328 placement, 17329 platform, 17330 elements 17331 } = state; 17332 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 17333 const side = floating_ui_utils_getSide(placement); 17334 const alignment = floating_ui_utils_getAlignment(placement); 17335 const isVertical = floating_ui_utils_getSideAxis(placement) === 'y'; 17336 const mainAxisMulti = originSides.has(side) ? -1 : 1; 17337 const crossAxisMulti = rtl && isVertical ? -1 : 1; 17338 const rawValue = floating_ui_utils_evaluate(options, state); 17339 17340 // eslint-disable-next-line prefer-const 17341 let { 17342 mainAxis, 17343 crossAxis, 17344 alignmentAxis 17345 } = typeof rawValue === 'number' ? { 17346 mainAxis: rawValue, 17347 crossAxis: 0, 17348 alignmentAxis: null 17349 } : { 17350 mainAxis: rawValue.mainAxis || 0, 17351 crossAxis: rawValue.crossAxis || 0, 17352 alignmentAxis: rawValue.alignmentAxis 17353 }; 17354 if (alignment && typeof alignmentAxis === 'number') { 17355 crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; 17356 } 17357 return isVertical ? { 17358 x: crossAxis * crossAxisMulti, 17359 y: mainAxis * mainAxisMulti 17360 } : { 17361 x: mainAxis * mainAxisMulti, 17362 y: crossAxis * crossAxisMulti 17363 }; 17364} 17365 17366/** 17367 * Modifies the placement by translating the floating element along the 17368 * specified axes. 17369 * A number (shorthand for `mainAxis` or distance), or an axes configuration 17370 * object may be passed. 17371 * @see https://floating-ui.com/docs/offset 17372 */ 17373const offset = function (options) { 17374 if (options === void 0) { 17375 options = 0; 17376 } 17377 return { 17378 name: 'offset', 17379 options, 17380 async fn(state) { 17381 var _middlewareData$offse, _middlewareData$arrow; 17382 const { 17383 x, 17384 y, 17385 placement, 17386 middlewareData 17387 } = state; 17388 const diffCoords = await convertValueToCoords(state, options); 17389 17390 // If the placement is the same and the arrow caused an alignment offset 17391 // then we don't need to change the positioning coordinates. 17392 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 17393 return {}; 17394 } 17395 return { 17396 x: x + diffCoords.x, 17397 y: y + diffCoords.y, 17398 data: { 17399 ...diffCoords, 17400 placement 17401 } 17402 }; 17403 } 17404 }; 17405}; 17406 17407/** 17408 * Optimizes the visibility of the floating element by shifting it in order to 17409 * keep it in view when it will overflow the clipping boundary. 17410 * @see https://floating-ui.com/docs/shift 17411 */ 17412const shift = function (options) { 17413 if (options === void 0) { 17414 options = {}; 17415 } 17416 return { 17417 name: 'shift', 17418 options, 17419 async fn(state) { 17420 const { 17421 x, 17422 y, 17423 placement, 17424 platform 17425 } = state; 17426 const { 17427 mainAxis: checkMainAxis = true, 17428 crossAxis: checkCrossAxis = false, 17429 limiter = { 17430 fn: _ref => { 17431 let { 17432 x, 17433 y 17434 } = _ref; 17435 return { 17436 x, 17437 y 17438 }; 17439 } 17440 }, 17441 ...detectOverflowOptions 17442 } = floating_ui_utils_evaluate(options, state); 17443 const coords = { 17444 x, 17445 y 17446 }; 17447 const overflow = await platform.detectOverflow(state, detectOverflowOptions); 17448 const crossAxis = floating_ui_utils_getSideAxis(floating_ui_utils_getSide(placement)); 17449 const mainAxis = floating_ui_utils_getOppositeAxis(crossAxis); 17450 let mainAxisCoord = coords[mainAxis]; 17451 let crossAxisCoord = coords[crossAxis]; 17452 if (checkMainAxis) { 17453 const minSide = mainAxis === 'y' ? 'top' : 'left'; 17454 const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; 17455 const min = mainAxisCoord + overflow[minSide]; 17456 const max = mainAxisCoord - overflow[maxSide]; 17457 mainAxisCoord = clamp(min, mainAxisCoord, max); 17458 } 17459 if (checkCrossAxis) { 17460 const minSide = crossAxis === 'y' ? 'top' : 'left'; 17461 const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; 17462 const min = crossAxisCoord + overflow[minSide]; 17463 const max = crossAxisCoord - overflow[maxSide]; 17464 crossAxisCoord = clamp(min, crossAxisCoord, max); 17465 } 17466 const limitedCoords = limiter.fn({ 17467 ...state, 17468 [mainAxis]: mainAxisCoord, 17469 [crossAxis]: crossAxisCoord 17470 }); 17471 return { 17472 ...limitedCoords, 17473 data: { 17474 x: limitedCoords.x - x, 17475 y: limitedCoords.y - y, 17476 enabled: { 17477 [mainAxis]: checkMainAxis, 17478 [crossAxis]: checkCrossAxis 17479 } 17480 } 17481 }; 17482 } 17483 }; 17484}; 17485/** 17486 * Built-in `limiter` that will stop `shift()` at a certain point. 17487 */ 17488const limitShift = function (options) { 17489 if (options === void 0) { 17490 options = {}; 17491 } 17492 return { 17493 options, 17494 fn(state) { 17495 const { 17496 x, 17497 y, 17498 placement, 17499 rects, 17500 middlewareData 17501 } = state; 17502 const { 17503 offset = 0, 17504 mainAxis: checkMainAxis = true, 17505 crossAxis: checkCrossAxis = true 17506 } = evaluate(options, state); 17507 const coords = { 17508 x, 17509 y 17510 }; 17511 const crossAxis = getSideAxis(placement); 17512 const mainAxis = getOppositeAxis(crossAxis); 17513 let mainAxisCoord = coords[mainAxis]; 17514 let crossAxisCoord = coords[crossAxis]; 17515 const rawOffset = evaluate(offset, state); 17516 const computedOffset = typeof rawOffset === 'number' ? { 17517 mainAxis: rawOffset, 17518 crossAxis: 0 17519 } : { 17520 mainAxis: 0, 17521 crossAxis: 0, 17522 ...rawOffset 17523 }; 17524 if (checkMainAxis) { 17525 const len = mainAxis === 'y' ? 'height' : 'width'; 17526 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 17527 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 17528 if (mainAxisCoord < limitMin) { 17529 mainAxisCoord = limitMin; 17530 } else if (mainAxisCoord > limitMax) { 17531 mainAxisCoord = limitMax; 17532 } 17533 } 17534 if (checkCrossAxis) { 17535 var _middlewareData$offse, _middlewareData$offse2; 17536 const len = mainAxis === 'y' ? 'width' : 'height'; 17537 const isOriginSide = originSides.has(getSide(placement)); 17538 const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); 17539 const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); 17540 if (crossAxisCoord < limitMin) { 17541 crossAxisCoord = limitMin; 17542 } else if (crossAxisCoord > limitMax) { 17543 crossAxisCoord = limitMax; 17544 } 17545 } 17546 return { 17547 [mainAxis]: mainAxisCoord, 17548 [crossAxis]: crossAxisCoord 17549 }; 17550 } 17551 }; 17552}; 17553 17554/** 17555 * Provides data that allows you to change the size of the floating element â 17556 * for instance, prevent it from overflowing the clipping boundary or match the 17557 * width of the reference element. 17558 * @see https://floating-ui.com/docs/size 17559 */ 17560const size = function (options) { 17561 if (options === void 0) { 17562 options = {}; 17563 } 17564 return { 17565 name: 'size', 17566 options, 17567 async fn(state) { 17568 var _state$middlewareData, _state$middlewareData2; 17569 const { 17570 placement, 17571 rects, 17572 platform, 17573 elements 17574 } = state; 17575 const { 17576 apply = () => {}, 17577 ...detectOverflowOptions 17578 } = evaluate(options, state); 17579 const overflow = await platform.detectOverflow(state, detectOverflowOptions); 17580 const side = getSide(placement); 17581 const alignment = getAlignment(placement); 17582 const isYAxis = getSideAxis(placement) === 'y'; 17583 const { 17584 width, 17585 height 17586 } = rects.floating; 17587 let heightSide; 17588 let widthSide; 17589 if (side === 'top' || side === 'bottom') { 17590 heightSide = side; 17591 widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; 17592 } else { 17593 widthSide = side; 17594 heightSide = alignment === 'end' ? 'top' : 'bottom'; 17595 } 17596 const maximumClippingHeight = height - overflow.top - overflow.bottom; 17597 const maximumClippingWidth = width - overflow.left - overflow.right; 17598 const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); 17599 const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); 17600 const noShift = !state.middlewareData.shift; 17601 let availableHeight = overflowAvailableHeight; 17602 let availableWidth = overflowAvailableWidth; 17603 if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { 17604 availableWidth = maximumClippingWidth; 17605 } 17606 if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { 17607 availableHeight = maximumClippingHeight; 17608 } 17609 if (noShift && !alignment) { 17610 const xMin = max(overflow.left, 0); 17611 const xMax = max(overflow.right, 0); 17612 const yMin = max(overflow.top, 0); 17613 const yMax = max(overflow.bottom, 0); 17614 if (isYAxis) { 17615 availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); 17616 } else { 17617 availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); 17618 } 17619 } 17620 await apply({ 17621 ...state, 17622 availableWidth, 17623 availableHeight 17624 }); 17625 const nextDimensions = await platform.getDimensions(elements.floating); 17626 if (width !== nextDimensions.width || height !== nextDimensions.height) { 17627 return { 17628 reset: { 17629 rects: true 17630 } 17631 }; 17632 } 17633 return {}; 17634 } 17635 }; 17636}; 17637 17638 17639 17640;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 17641function hasWindow() { 17642 return typeof window !== 'undefined'; 17643} 17644function getNodeName(node) { 17645 if (isNode(node)) { 17646 return (node.nodeName || '').toLowerCase(); 17647 } 17648 // Mocked nodes in testing environments may not be instances of Node. By 17649 // returning `#document` an infinite loop won't occur. 17650 // https://github.com/floating-ui/floating-ui/issues/2317 17651 return '#document'; 17652} 17653function getWindow(node) { 17654 var _node$ownerDocument; 17655 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 17656} 17657function getDocumentElement(node) { 17658 var _ref; 17659 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 17660} 17661function isNode(value) { 17662 if (!hasWindow()) { 17663 return false;
vendor: 4,075 bytes, lines 17664-17791
17664 } 17665 return value instanceof Node || value instanceof getWindow(value).Node; 17666} 17667function isElement(value) { 17668 if (!hasWindow()) { 17669 return false; 17670 } 17671 return value instanceof Element || value instanceof getWindow(value).Element; 17672} 17673function isHTMLElement(value) { 17674 if (!hasWindow()) { 17675 return false; 17676 } 17677 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 17678} 17679function isShadowRoot(value) { 17680 if (!hasWindow() || typeof ShadowRoot === 'undefined') { 17681 return false; 17682 } 17683 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 17684} 17685function isOverflowElement(element) { 17686 const { 17687 overflow, 17688 overflowX, 17689 overflowY, 17690 display 17691 } = floating_ui_utils_dom_getComputedStyle(element); 17692 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents'; 17693} 17694function isTableElement(element) { 17695 return /^(table|td|th)$/.test(getNodeName(element)); 17696} 17697function isTopLayer(element) { 17698 try { 17699 if (element.matches(':popover-open')) { 17700 return true; 17701 } 17702 } catch (_e) { 17703 // no-op 17704 } 17705 try { 17706 return element.matches(':modal'); 17707 } catch (_e) { 17708 return false; 17709 } 17710} 17711const willChangeRe = /transform|translate|scale|rotate|perspective|filter/; 17712const containRe = /paint|layout|strict|content/; 17713const isNotNone = value => !!value && value !== 'none'; 17714let isWebKitValue; 17715function isContainingBlock(elementOrCss) { 17716 const css = isElement(elementOrCss) ? floating_ui_utils_dom_getComputedStyle(elementOrCss) : elementOrCss; 17717 17718 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 17719 // https://drafts.csswg.org/css-transforms-2/#individual-transforms 17720 return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || ''); 17721} 17722function getContainingBlock(element) { 17723 let currentNode = getParentNode(element); 17724 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 17725 if (isContainingBlock(currentNode)) { 17726 return currentNode; 17727 } else if (isTopLayer(currentNode)) { 17728 return null; 17729 } 17730 currentNode = getParentNode(currentNode); 17731 } 17732 return null; 17733} 17734function isWebKit() { 17735 if (isWebKitValue == null) { 17736 isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none'); 17737 } 17738 return isWebKitValue; 17739} 17740function isLastTraversableNode(node) { 17741 return /^(html|body|#document)$/.test(getNodeName(node)); 17742} 17743function floating_ui_utils_dom_getComputedStyle(element) { 17744 return getWindow(element).getComputedStyle(element); 17745} 17746function getNodeScroll(element) { 17747 if (isElement(element)) { 17748 return { 17749 scrollLeft: element.scrollLeft, 17750 scrollTop: element.scrollTop 17751 }; 17752 } 17753 return { 17754 scrollLeft: element.scrollX, 17755 scrollTop: element.scrollY 17756 }; 17757} 17758function getParentNode(node) { 17759 if (getNodeName(node) === 'html') { 17760 return node; 17761 } 17762 const result = 17763 // Step into the shadow DOM of the parent of a slotted node. 17764 node.assignedSlot || 17765 // DOM Element detected. 17766 node.parentNode || 17767 // ShadowRoot detected. 17768 isShadowRoot(node) && node.host || 17769 // Fallback. 17770 getDocumentElement(node); 17771 return isShadowRoot(result) ? result.host : result; 17772} 17773function getNearestOverflowAncestor(node) { 17774 const parentNode = getParentNode(node); 17775 if (isLastTraversableNode(parentNode)) { 17776 return node.ownerDocument ? node.ownerDocument.body : node.body; 17777 } 17778 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 17779 return parentNode; 17780 } 17781 return getNearestOverflowAncestor(parentNode); 17782} 17783function getOverflowAncestors(node, list, traverseIframes) { 17784 var _node$ownerDocument2; 17785 if (list === void 0) { 17786 list = []; 17787 } 17788 if (traverseIframes === void 0) { 17789 traverseIframes = true; 17790 } 17791 const scrollableAncestor = getNearestOverflowAncestor(node);
vendor: 3,762 bytes, lines 17792-17913
17792 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 17793 const win = getWindow(scrollableAncestor); 17794 if (isBody) { 17795 const frameElement = getFrameElement(win); 17796 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 17797 } else { 17798 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 17799 } 17800} 17801function getFrameElement(win) { 17802 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 17803} 17804 17805 17806 17807;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 17808 17809 17810 17811 17812 17813function getCssDimensions(element) { 17814 const css = floating_ui_utils_dom_getComputedStyle(element); 17815 // In testing environments, the `width` and `height` properties are empty 17816 // strings for SVG elements, returning NaN. Fallback to `0` in this case. 17817 let width = parseFloat(css.width) || 0; 17818 let height = parseFloat(css.height) || 0; 17819 const hasOffset = isHTMLElement(element); 17820 const offsetWidth = hasOffset ? element.offsetWidth : width; 17821 const offsetHeight = hasOffset ? element.offsetHeight : height; 17822 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 17823 if (shouldFallback) { 17824 width = offsetWidth; 17825 height = offsetHeight; 17826 } 17827 return { 17828 width, 17829 height, 17830 $: shouldFallback 17831 }; 17832} 17833 17834function unwrapElement(element) { 17835 return !isElement(element) ? element.contextElement : element; 17836} 17837 17838function getScale(element) { 17839 const domElement = unwrapElement(element); 17840 if (!isHTMLElement(domElement)) { 17841 return createCoords(1); 17842 } 17843 const rect = domElement.getBoundingClientRect(); 17844 const { 17845 width, 17846 height, 17847 $ 17848 } = getCssDimensions(domElement); 17849 let x = ($ ? round(rect.width) : rect.width) / width; 17850 let y = ($ ? round(rect.height) : rect.height) / height; 17851 17852 // 0, NaN, or Infinity should always fallback to 1. 17853 17854 if (!x || !Number.isFinite(x)) { 17855 x = 1; 17856 } 17857 if (!y || !Number.isFinite(y)) { 17858 y = 1; 17859 } 17860 return { 17861 x, 17862 y 17863 }; 17864} 17865 17866const noOffsets = /*#__PURE__*/createCoords(0); 17867function getVisualOffsets(element) { 17868 const win = getWindow(element); 17869 if (!isWebKit() || !win.visualViewport) { 17870 return noOffsets; 17871 } 17872 return { 17873 x: win.visualViewport.offsetLeft, 17874 y: win.visualViewport.offsetTop 17875 }; 17876} 17877function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 17878 if (isFixed === void 0) { 17879 isFixed = false; 17880 } 17881 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { 17882 return false; 17883 } 17884 return isFixed; 17885} 17886 17887function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 17888 if (includeScale === void 0) { 17889 includeScale = false; 17890 } 17891 if (isFixedStrategy === void 0) { 17892 isFixedStrategy = false; 17893 } 17894 const clientRect = element.getBoundingClientRect(); 17895 const domElement = unwrapElement(element); 17896 let scale = createCoords(1); 17897 if (includeScale) { 17898 if (offsetParent) { 17899 if (isElement(offsetParent)) { 17900 scale = getScale(offsetParent); 17901 } 17902 } else { 17903 scale = getScale(element); 17904 } 17905 } 17906 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 17907 let x = (clientRect.left + visualOffsets.x) / scale.x; 17908 let y = (clientRect.top + visualOffsets.y) / scale.y; 17909 let width = clientRect.width / scale.x; 17910 let height = clientRect.height / scale.y; 17911 if (domElement) { 17912 const win = getWindow(domElement); 17913 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
vendor: 20,294 bytes, lines 17914-18475
17914 let currentWin = win; 17915 let currentIFrame = getFrameElement(currentWin); 17916 while (currentIFrame && offsetParent && offsetWin !== currentWin) { 17917 const iframeScale = getScale(currentIFrame); 17918 const iframeRect = currentIFrame.getBoundingClientRect(); 17919 const css = floating_ui_utils_dom_getComputedStyle(currentIFrame); 17920 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 17921 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 17922 x *= iframeScale.x; 17923 y *= iframeScale.y; 17924 width *= iframeScale.x; 17925 height *= iframeScale.y; 17926 x += left; 17927 y += top; 17928 currentWin = getWindow(currentIFrame); 17929 currentIFrame = getFrameElement(currentWin); 17930 } 17931 } 17932 return floating_ui_utils_rectToClientRect({ 17933 width, 17934 height, 17935 x, 17936 y 17937 }); 17938} 17939 17940// If <html> has a CSS width greater than the viewport, then this will be 17941// incorrect for RTL. 17942function getWindowScrollBarX(element, rect) { 17943 const leftScroll = getNodeScroll(element).scrollLeft; 17944 if (!rect) { 17945 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 17946 } 17947 return rect.left + leftScroll; 17948} 17949 17950function getHTMLOffset(documentElement, scroll) { 17951 const htmlRect = documentElement.getBoundingClientRect(); 17952 const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 17953 const y = htmlRect.top + scroll.scrollTop; 17954 return { 17955 x, 17956 y 17957 }; 17958} 17959 17960function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 17961 let { 17962 elements, 17963 rect, 17964 offsetParent, 17965 strategy 17966 } = _ref; 17967 const isFixed = strategy === 'fixed'; 17968 const documentElement = getDocumentElement(offsetParent); 17969 const topLayer = elements ? isTopLayer(elements.floating) : false; 17970 if (offsetParent === documentElement || topLayer && isFixed) { 17971 return rect; 17972 } 17973 let scroll = { 17974 scrollLeft: 0, 17975 scrollTop: 0 17976 }; 17977 let scale = createCoords(1); 17978 const offsets = createCoords(0); 17979 const isOffsetParentAnElement = isHTMLElement(offsetParent); 17980 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 17981 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { 17982 scroll = getNodeScroll(offsetParent); 17983 } 17984 if (isOffsetParentAnElement) { 17985 const offsetRect = getBoundingClientRect(offsetParent); 17986 scale = getScale(offsetParent); 17987 offsets.x = offsetRect.x + offsetParent.clientLeft; 17988 offsets.y = offsetRect.y + offsetParent.clientTop; 17989 } 17990 } 17991 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 17992 return { 17993 width: rect.width * scale.x, 17994 height: rect.height * scale.y, 17995 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 17996 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 17997 }; 17998} 17999 18000function getClientRects(element) { 18001 return Array.from(element.getClientRects()); 18002} 18003 18004// Gets the entire size of the scrollable document area, even extending outside 18005// of the `<html>` and `<body>` rect bounds if horizontally scrollable. 18006function getDocumentRect(element) { 18007 const html = getDocumentElement(element); 18008 const scroll = getNodeScroll(element); 18009 const body = element.ownerDocument.body; 18010 const width = floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 18011 const height = floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 18012 let x = -scroll.scrollLeft + getWindowScrollBarX(element); 18013 const y = -scroll.scrollTop; 18014 if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') { 18015 x += floating_ui_utils_max(html.clientWidth, body.clientWidth) - width; 18016 } 18017 return { 18018 width, 18019 height, 18020 x, 18021 y 18022 }; 18023} 18024 18025// Safety check: ensure the scrollbar space is reasonable in case this 18026// calculation is affected by unusual styles. 18027// Most scrollbars leave 15-18px of space. 18028const SCROLLBAR_MAX = 25; 18029function getViewportRect(element, strategy) { 18030 const win = getWindow(element); 18031 const html = getDocumentElement(element); 18032 const visualViewport = win.visualViewport; 18033 let width = html.clientWidth; 18034 let height = html.clientHeight; 18035 let x = 0; 18036 let y = 0; 18037 if (visualViewport) { 18038 width = visualViewport.width; 18039 height = visualViewport.height; 18040 const visualViewportBased = isWebKit(); 18041 if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { 18042 x = visualViewport.offsetLeft; 18043 y = visualViewport.offsetTop; 18044 } 18045 } 18046 const windowScrollbarX = getWindowScrollBarX(html); 18047 // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the 18048 // visual width of the <html> but this is not considered in the size 18049 // of `html.clientWidth`. 18050 if (windowScrollbarX <= 0) { 18051 const doc = html.ownerDocument; 18052 const body = doc.body; 18053 const bodyStyles = getComputedStyle(body); 18054 const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 18055 const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); 18056 if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { 18057 width -= clippingStableScrollbarWidth; 18058 } 18059 } else if (windowScrollbarX <= SCROLLBAR_MAX) { 18060 // If the <body> scrollbar is on the left, the width needs to be extended 18061 // by the scrollbar amount so there isn't extra space on the right. 18062 width += windowScrollbarX; 18063 } 18064 return { 18065 width, 18066 height, 18067 x, 18068 y 18069 }; 18070} 18071 18072// Returns the inner client rect, subtracting scrollbars if present. 18073function getInnerBoundingClientRect(element, strategy) { 18074 const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); 18075 const top = clientRect.top + element.clientTop; 18076 const left = clientRect.left + element.clientLeft; 18077 const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); 18078 const width = element.clientWidth * scale.x; 18079 const height = element.clientHeight * scale.y; 18080 const x = left * scale.x; 18081 const y = top * scale.y; 18082 return { 18083 width, 18084 height, 18085 x, 18086 y 18087 }; 18088} 18089function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 18090 let rect; 18091 if (clippingAncestor === 'viewport') { 18092 rect = getViewportRect(element, strategy); 18093 } else if (clippingAncestor === 'document') { 18094 rect = getDocumentRect(getDocumentElement(element)); 18095 } else if (isElement(clippingAncestor)) { 18096 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 18097 } else { 18098 const visualOffsets = getVisualOffsets(element); 18099 rect = { 18100 x: clippingAncestor.x - visualOffsets.x, 18101 y: clippingAncestor.y - visualOffsets.y, 18102 width: clippingAncestor.width, 18103 height: clippingAncestor.height 18104 }; 18105 } 18106 return floating_ui_utils_rectToClientRect(rect); 18107} 18108function hasFixedPositionAncestor(element, stopNode) { 18109 const parentNode = getParentNode(element); 18110 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { 18111 return false; 18112 } 18113 return floating_ui_utils_dom_getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); 18114} 18115 18116// A "clipping ancestor" is an `overflow` element with the characteristic of 18117// clipping (or hiding) child elements. This returns all clipping ancestors 18118// of the given element up the tree. 18119function getClippingElementAncestors(element, cache) { 18120 const cachedResult = cache.get(element); 18121 if (cachedResult) { 18122 return cachedResult; 18123 } 18124 let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); 18125 let currentContainingBlockComputedStyle = null; 18126 const elementIsFixed = floating_ui_utils_dom_getComputedStyle(element).position === 'fixed'; 18127 let currentNode = elementIsFixed ? getParentNode(element) : element; 18128 18129 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 18130 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 18131 const computedStyle = floating_ui_utils_dom_getComputedStyle(currentNode); 18132 const currentNodeIsContaining = isContainingBlock(currentNode); 18133 if (!currentNodeIsContaining && computedStyle.position === 'fixed') { 18134 currentContainingBlockComputedStyle = null; 18135 } 18136 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); 18137 if (shouldDropCurrentNode) { 18138 // Drop non-containing blocks. 18139 result = result.filter(ancestor => ancestor !== currentNode); 18140 } else { 18141 // Record last containing block for next iteration. 18142 currentContainingBlockComputedStyle = computedStyle; 18143 } 18144 currentNode = getParentNode(currentNode); 18145 } 18146 cache.set(element, result); 18147 return result; 18148} 18149 18150// Gets the maximum area that the element is visible in due to any number of 18151// clipping ancestors. 18152function getClippingRect(_ref) { 18153 let { 18154 element, 18155 boundary, 18156 rootBoundary, 18157 strategy 18158 } = _ref; 18159 const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 18160 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 18161 const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); 18162 let top = firstRect.top; 18163 let right = firstRect.right; 18164 let bottom = firstRect.bottom; 18165 let left = firstRect.left; 18166 for (let i = 1; i < clippingAncestors.length; i++) { 18167 const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy); 18168 top = floating_ui_utils_max(rect.top, top); 18169 right = floating_ui_utils_min(rect.right, right); 18170 bottom = floating_ui_utils_min(rect.bottom, bottom); 18171 left = floating_ui_utils_max(rect.left, left); 18172 } 18173 return { 18174 width: right - left, 18175 height: bottom - top, 18176 x: left, 18177 y: top 18178 }; 18179} 18180 18181function getDimensions(element) { 18182 const { 18183 width, 18184 height 18185 } = getCssDimensions(element); 18186 return { 18187 width, 18188 height 18189 }; 18190} 18191 18192function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 18193 const isOffsetParentAnElement = isHTMLElement(offsetParent); 18194 const documentElement = getDocumentElement(offsetParent); 18195 const isFixed = strategy === 'fixed'; 18196 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 18197 let scroll = { 18198 scrollLeft: 0, 18199 scrollTop: 0 18200 }; 18201 const offsets = createCoords(0); 18202 18203 // If the <body> scrollbar appears on the left (e.g. RTL systems). Use 18204 // Firefox with layout.scrollbar.side = 3 in about:config to test this. 18205 function setLeftRTLScrollbarOffset() { 18206 offsets.x = getWindowScrollBarX(documentElement); 18207 } 18208 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 18209 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { 18210 scroll = getNodeScroll(offsetParent); 18211 } 18212 if (isOffsetParentAnElement) { 18213 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 18214 offsets.x = offsetRect.x + offsetParent.clientLeft; 18215 offsets.y = offsetRect.y + offsetParent.clientTop; 18216 } else if (documentElement) { 18217 setLeftRTLScrollbarOffset(); 18218 } 18219 } 18220 if (isFixed && !isOffsetParentAnElement && documentElement) { 18221 setLeftRTLScrollbarOffset(); 18222 } 18223 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 18224 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 18225 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 18226 return { 18227 x, 18228 y, 18229 width: rect.width, 18230 height: rect.height 18231 }; 18232} 18233 18234function isStaticPositioned(element) { 18235 return floating_ui_utils_dom_getComputedStyle(element).position === 'static'; 18236} 18237 18238function getTrueOffsetParent(element, polyfill) { 18239 if (!isHTMLElement(element) || floating_ui_utils_dom_getComputedStyle(element).position === 'fixed') { 18240 return null; 18241 } 18242 if (polyfill) { 18243 return polyfill(element); 18244 } 18245 let rawOffsetParent = element.offsetParent; 18246 18247 // Firefox returns the <html> element as the offsetParent if it's non-static, 18248 // while Chrome and Safari return the <body> element. The <body> element must 18249 // be used to perform the correct calculations even if the <html> element is 18250 // non-static. 18251 if (getDocumentElement(element) === rawOffsetParent) { 18252 rawOffsetParent = rawOffsetParent.ownerDocument.body; 18253 } 18254 return rawOffsetParent; 18255} 18256 18257// Gets the closest ancestor positioned element. Handles some edge cases, 18258// such as table ancestors and cross browser bugs. 18259function getOffsetParent(element, polyfill) { 18260 const win = getWindow(element); 18261 if (isTopLayer(element)) { 18262 return win; 18263 } 18264 if (!isHTMLElement(element)) { 18265 let svgOffsetParent = getParentNode(element); 18266 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 18267 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 18268 return svgOffsetParent; 18269 } 18270 svgOffsetParent = getParentNode(svgOffsetParent); 18271 } 18272 return win; 18273 } 18274 let offsetParent = getTrueOffsetParent(element, polyfill); 18275 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 18276 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 18277 } 18278 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 18279 return win; 18280 } 18281 return offsetParent || getContainingBlock(element) || win; 18282} 18283 18284const getElementRects = async function (data) { 18285 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 18286 const getDimensionsFn = this.getDimensions; 18287 const floatingDimensions = await getDimensionsFn(data.floating); 18288 return { 18289 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 18290 floating: { 18291 x: 0, 18292 y: 0, 18293 width: floatingDimensions.width, 18294 height: floatingDimensions.height 18295 } 18296 }; 18297}; 18298 18299function isRTL(element) { 18300 return floating_ui_utils_dom_getComputedStyle(element).direction === 'rtl'; 18301} 18302 18303const platform = { 18304 convertOffsetParentRelativeRectToViewportRelativeRect, 18305 getDocumentElement: getDocumentElement, 18306 getClippingRect, 18307 getOffsetParent, 18308 getElementRects, 18309 getClientRects, 18310 getDimensions, 18311 getScale, 18312 isElement: isElement, 18313 isRTL 18314}; 18315 18316function rectsAreEqual(a, b) { 18317 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 18318} 18319 18320// https://samthor.au/2021/observing-dom/ 18321function observeMove(element, onMove) { 18322 let io = null; 18323 let timeoutId; 18324 const root = getDocumentElement(element); 18325 function cleanup() { 18326 var _io; 18327 clearTimeout(timeoutId); 18328 (_io = io) == null || _io.disconnect(); 18329 io = null; 18330 } 18331 function refresh(skip, threshold) { 18332 if (skip === void 0) { 18333 skip = false; 18334 } 18335 if (threshold === void 0) { 18336 threshold = 1; 18337 } 18338 cleanup(); 18339 const elementRectForRootMargin = element.getBoundingClientRect(); 18340 const { 18341 left, 18342 top, 18343 width, 18344 height 18345 } = elementRectForRootMargin; 18346 if (!skip) { 18347 onMove(); 18348 } 18349 if (!width || !height) { 18350 return; 18351 } 18352 const insetTop = floor(top); 18353 const insetRight = floor(root.clientWidth - (left + width)); 18354 const insetBottom = floor(root.clientHeight - (top + height)); 18355 const insetLeft = floor(left); 18356 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 18357 const options = { 18358 rootMargin, 18359 threshold: floating_ui_utils_max(0, floating_ui_utils_min(1, threshold)) || 1 18360 }; 18361 let isFirstUpdate = true; 18362 function handleObserve(entries) { 18363 const ratio = entries[0].intersectionRatio; 18364 if (ratio !== threshold) { 18365 if (!isFirstUpdate) { 18366 return refresh(); 18367 } 18368 if (!ratio) { 18369 // If the reference is clipped, the ratio is 0. Throttle the refresh 18370 // to prevent an infinite loop of updates. 18371 timeoutId = setTimeout(() => { 18372 refresh(false, 1e-7); 18373 }, 1000); 18374 } else { 18375 refresh(false, ratio); 18376 } 18377 } 18378 if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 18379 // It's possible that even though the ratio is reported as 1, the 18380 // element is not actually fully within the IntersectionObserver's root 18381 // area anymore. This can happen under performance constraints. This may 18382 // be a bug in the browser's IntersectionObserver implementation. To 18383 // work around this, we compare the element's bounding rect now with 18384 // what it was at the time we created the IntersectionObserver. If they 18385 // are not equal then the element moved, so we refresh. 18386 refresh(); 18387 } 18388 isFirstUpdate = false; 18389 } 18390 18391 // Older browsers don't support a `document` as the root and will throw an 18392 // error. 18393 try { 18394 io = new IntersectionObserver(handleObserve, { 18395 ...options, 18396 // Handle <iframe>s 18397 root: root.ownerDocument 18398 }); 18399 } catch (_e) { 18400 io = new IntersectionObserver(handleObserve, options); 18401 } 18402 io.observe(element); 18403 } 18404 refresh(true); 18405 return cleanup; 18406} 18407 18408/** 18409 * Automatically updates the position of the floating element when necessary. 18410 * Should only be called when the floating element is mounted on the DOM or 18411 * visible on the screen. 18412 * @returns cleanup function that should be invoked when the floating element is 18413 * removed from the DOM or hidden from the screen. 18414 * @see https://floating-ui.com/docs/autoUpdate 18415 */ 18416function autoUpdate(reference, floating, update, options) { 18417 if (options === void 0) { 18418 options = {}; 18419 } 18420 const { 18421 ancestorScroll = true, 18422 ancestorResize = true, 18423 elementResize = typeof ResizeObserver === 'function', 18424 layoutShift = typeof IntersectionObserver === 'function', 18425 animationFrame = false 18426 } = options; 18427 const referenceEl = unwrapElement(reference); 18428 const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : []; 18429 ancestors.forEach(ancestor => { 18430 ancestorScroll && ancestor.addEventListener('scroll', update, { 18431 passive: true 18432 }); 18433 ancestorResize && ancestor.addEventListener('resize', update); 18434 }); 18435 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; 18436 let reobserveFrame = -1; 18437 let resizeObserver = null; 18438 if (elementResize) { 18439 resizeObserver = new ResizeObserver(_ref => { 18440 let [firstEntry] = _ref; 18441 if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) { 18442 // Prevent update loops when using the `size` middleware. 18443 // https://github.com/floating-ui/floating-ui/issues/1740 18444 resizeObserver.unobserve(floating); 18445 cancelAnimationFrame(reobserveFrame); 18446 reobserveFrame = requestAnimationFrame(() => { 18447 var _resizeObserver; 18448 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 18449 }); 18450 } 18451 update(); 18452 }); 18453 if (referenceEl && !animationFrame) { 18454 resizeObserver.observe(referenceEl); 18455 } 18456 if (floating) { 18457 resizeObserver.observe(floating); 18458 } 18459 } 18460 let frameId; 18461 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 18462 if (animationFrame) { 18463 frameLoop(); 18464 } 18465 function frameLoop() { 18466 const nextRefRect = getBoundingClientRect(reference); 18467 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 18468 update(); 18469 } 18470 prevRefRect = nextRefRect; 18471 frameId = requestAnimationFrame(frameLoop); 18472 } 18473 update(); 18474 return () => { 18475 var _resizeObserver2;
18476 ancestors.forEach(ancestor => { 18477 ancestorScroll && ancestor.removeEventListener('scroll', update); 18478 ancestorResize && ancestor.removeEventListener('resize', update); 18479 }); 18480 cleanupIo == null || cleanupIo(); 18481 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 18482 resizeObserver = null; 18483 if (animationFrame) { 18484 cancelAnimationFrame(frameId); 18485 } 18486 }; 18487} 18488 18489/** 18490 * Resolves with an object of overflow side offsets that determine how much the 18491 * element is overflowing a given clipping boundary on each side. 18492 * - positive = overflowing the boundary by that number of pixels 18493 * - negative = how many pixels left before it will overflow 18494 * - 0 = lies flush with the boundary 18495 * @see https://floating-ui.com/docs/detectOverflow 18496 */ 18497const floating_ui_dom_detectOverflow = (/* unused pure expression or super */ null && (detectOverflow$1)); 18498 18499/** 18500 * Modifies the placement by translating the floating element along the 18501 * specified axes. 18502 * A number (shorthand for `mainAxis` or distance), or an axes configuration 18503 * object may be passed. 18504 * @see https://floating-ui.com/docs/offset 18505 */ 18506const floating_ui_dom_offset = offset; 18507 18508/** 18509 * Optimizes the visibility of the floating element by choosing the placement 18510 * that has the most space available automatically, without needing to specify a 18511 * preferred placement. Alternative to `flip`. 18512 * @see https://floating-ui.com/docs/autoPlacement 18513 */ 18514const floating_ui_dom_autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1)); 18515 18516/** 18517 * Optimizes the visibility of the floating element by shifting it in order to 18518 * keep it in view when it will overflow the clipping boundary. 18519 * @see https://floating-ui.com/docs/shift 18520 */ 18521const floating_ui_dom_shift = shift; 18522 18523/** 18524 * Optimizes the visibility of the floating element by flipping the `placement` 18525 * in order to keep it in view when the preferred placement(s) will overflow the 18526 * clipping boundary. Alternative to `autoPlacement`. 18527 * @see https://floating-ui.com/docs/flip 18528 */ 18529const floating_ui_dom_flip = flip; 18530 18531/** 18532 * Provides data that allows you to change the size of the floating element â 18533 * for instance, prevent it from overflowing the clipping boundary or match the 18534 * width of the reference element. 18535 * @see https://floating-ui.com/docs/size 18536 */ 18537const floating_ui_dom_size = (/* unused pure expression or super */ null && (size$1)); 18538 18539/** 18540 * Provides data to hide the floating element in applicable situations, such as 18541 * when it is not in the same clipping context as the reference element. 18542 * @see https://floating-ui.com/docs/hide 18543 */ 18544const floating_ui_dom_hide = (/* unused pure expression or super */ null && (hide$1)); 18545 18546/** 18547 * Provides data to position an inner element of the floating element so that it 18548 * appears centered to the reference element. 18549 * @see https://floating-ui.com/docs/arrow 18550 */ 18551const floating_ui_dom_arrow = arrow; 18552 18553/** 18554 * Provides improved positioning for inline reference elements that can span 18555 * over multiple lines, such as hyperlinks or range selections. 18556 * @see https://floating-ui.com/docs/inline 18557 */ 18558const floating_ui_dom_inline = (/* unused pure expression or super */ null && (inline$1)); 18559 18560/** 18561 * Built-in `limiter` that will stop `shift()` at a certain point. 18562 */ 18563const floating_ui_dom_limitShift = (/* unused pure expression or super */ null && (limitShift$1)); 18564 18565/** 18566 * Computes the `x` and `y` coordinates that will place the floating element 18567 * next to a given reference element. 18568 */ 18569const floating_ui_dom_computePosition = (reference, floating, options) => { 18570 // This caches the expensive `getClippingElementAncestors` function so that 18571 // multiple lifecycle resets re-use the same result. It only lives for a 18572 // single call. If other functions become expensive, we can add them as well. 18573 const cache = new Map(); 18574 const mergedOptions = { 18575 platform, 18576 ...options 18577 }; 18578 const platformWithCache = { 18579 ...mergedOptions.platform, 18580 _c: cache 18581 }; 18582 return computePosition(reference, floating, { 18583 ...mergedOptions, 18584 platform: platformWithCache 18585 }); 18586}; 18587 18588 18589 18590 18591/***/ }), 18592 18593/***/ 9658: 18594/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 18595 18596"use strict"; 18597/* harmony export */ __webpack_require__.d(__webpack_exports__, { 18598/* harmony export */ m: () => (/* binding */ focusManager) 18599/* harmony export */ }); 18600/* unused harmony export FocusManager */ 18601/* harmony import */ var _subscribable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6500); 18602/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4880);
18603// src/focusManager.ts 18604 18605 18606var FocusManager = class extends _subscribable_js__WEBPACK_IMPORTED_MODULE_0__/* .Subscribable */ .Q { 18607 #focused; 18608 #cleanup; 18609 #setup; 18610 constructor() { 18611 super(); 18612 this.#setup = (onFocus) => { 18613 if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .isServer */ .S$ && window.addEventListener) { 18614 const listener = () => onFocus(); 18615 window.addEventListener("visibilitychange", listener, false); 18616 return () => { 18617 window.removeEventListener("visibilitychange", listener); 18618 }; 18619 } 18620 return; 18621 }; 18622 } 18623 onSubscribe() { 18624 if (!this.#cleanup) { 18625 this.setEventListener(this.#setup); 18626 } 18627 } 18628 onUnsubscribe() { 18629 if (!this.hasListeners()) { 18630 this.#cleanup?.(); 18631 this.#cleanup = void 0; 18632 } 18633 } 18634 setEventListener(setup) { 18635 this.#setup = setup; 18636 this.#cleanup?.(); 18637 this.#cleanup = setup((focused) => { 18638 if (typeof focused === "boolean") { 18639 this.setFocused(focused); 18640 } else { 18641 this.onFocus(); 18642 } 18643 }); 18644 } 18645 setFocused(focused) { 18646 const changed = this.#focused !== focused; 18647 if (changed) { 18648 this.#focused = focused; 18649 this.onFocus(); 18650 } 18651 } 18652 onFocus() { 18653 this.listeners.forEach((listener) => { 18654 listener(); 18655 }); 18656 } 18657 isFocused() { 18658 if (typeof this.#focused === "boolean") { 18659 return this.#focused; 18660 } 18661 return globalThis.document?.visibilityState !== "hidden"; 18662 } 18663}; 18664var focusManager = new FocusManager(); 18665 18666//# sourceMappingURL=focusManager.js.map 18667 18668/***/ }), 18669 18670/***/ 6158: 18671/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 18672 18673"use strict"; 18674/* harmony export */ __webpack_require__.d(__webpack_exports__, { 18675/* harmony export */ $: () => (/* binding */ getDefaultState), 18676/* harmony export */ s: () => (/* binding */ Mutation) 18677/* harmony export */ }); 18678/* harmony import */ var _notifyManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6261); 18679/* harmony import */ var _removable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 18680/* harmony import */ var _retryer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8904);
18681// src/mutation.ts 18682 18683 18684 18685var Mutation = class extends _removable_js__WEBPACK_IMPORTED_MODULE_0__/* .Removable */ .k { 18686 constructor(config) { 18687 super(); 18688 this.mutationId = config.mutationId; 18689 this.#defaultOptions = config.defaultOptions; 18690 this.#mutationCache = config.mutationCache; 18691 this.#observers = []; 18692 this.state = config.state || getDefaultState(); 18693 this.setOptions(config.options); 18694 this.scheduleGc(); 18695 } 18696 #observers; 18697 #defaultOptions; 18698 #mutationCache; 18699 #retryer; 18700 setOptions(options) { 18701 this.options = { ...this.#defaultOptions, ...options }; 18702 this.updateGcTime(this.options.gcTime); 18703 } 18704 get meta() { 18705 return this.options.meta; 18706 } 18707 addObserver(observer) { 18708 if (!this.#observers.includes(observer)) { 18709 this.#observers.push(observer); 18710 this.clearGcTimeout(); 18711 this.#mutationCache.notify({ 18712 type: "observerAdded", 18713 mutation: this, 18714 observer 18715 }); 18716 } 18717 } 18718 removeObserver(observer) { 18719 this.#observers = this.#observers.filter((x) => x !== observer); 18720 this.scheduleGc(); 18721 this.#mutationCache.notify({ 18722 type: "observerRemoved", 18723 mutation: this, 18724 observer 18725 }); 18726 } 18727 optionalRemove() { 18728 if (!this.#observers.length) { 18729 if (this.state.status === "pending") { 18730 this.scheduleGc(); 18731 } else { 18732 this.#mutationCache.remove(this); 18733 } 18734 } 18735 } 18736 continue() { 18737 return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before 18738 this.execute(this.state.variables); 18739 } 18740 async execute(variables) { 18741 const executeMutation = () => { 18742 this.#retryer = (0,_retryer_js__WEBPACK_IMPORTED_MODULE_1__/* .createRetryer */ .II)({ 18743 fn: () => { 18744 if (!this.options.mutationFn) { 18745 return Promise.reject(new Error("No mutationFn found")); 18746 } 18747 return this.options.mutationFn(variables); 18748 }, 18749 onFail: (failureCount, error) => { 18750 this.#dispatch({ type: "failed", failureCount, error }); 18751 }, 18752 onPause: () => { 18753 this.#dispatch({ type: "pause" }); 18754 }, 18755 onContinue: () => { 18756 this.#dispatch({ type: "continue" }); 18757 }, 18758 retry: this.options.retry ?? 0, 18759 retryDelay: this.options.retryDelay, 18760 networkMode: this.options.networkMode 18761 }); 18762 return this.#retryer.promise; 18763 }; 18764 const restored = this.state.status === "pending"; 18765 try { 18766 if (!restored) { 18767 this.#dispatch({ type: "pending", variables }); 18768 await this.#mutationCache.config.onMutate?.( 18769 variables, 18770 this 18771 ); 18772 const context = await this.options.onMutate?.(variables); 18773 if (context !== this.state.context) { 18774 this.#dispatch({ 18775 type: "pending", 18776 context, 18777 variables 18778 }); 18779 } 18780 } 18781 const data = await executeMutation(); 18782 await this.#mutationCache.config.onSuccess?.( 18783 data, 18784 variables, 18785 this.state.context, 18786 this 18787 ); 18788 await this.options.onSuccess?.(data, variables, this.state.context); 18789 await this.#mutationCache.config.onSettled?.( 18790 data, 18791 null, 18792 this.state.variables, 18793 this.state.context, 18794 this 18795 ); 18796 await this.options.onSettled?.(data, null, variables, this.state.context); 18797 this.#dispatch({ type: "success", data }); 18798 return data; 18799 } catch (error) { 18800 try { 18801 await this.#mutationCache.config.onError?.( 18802 error, 18803 variables, 18804 this.state.context, 18805 this 18806 ); 18807 await this.options.onError?.( 18808 error, 18809 variables, 18810 this.state.context 18811 ); 18812 await this.#mutationCache.config.onSettled?.( 18813 void 0, 18814 error, 18815 this.state.variables, 18816 this.state.context, 18817 this 18818 ); 18819 await this.options.onSettled?.( 18820 void 0, 18821 error, 18822 variables, 18823 this.state.context 18824 ); 18825 throw error; 18826 } finally { 18827 this.#dispatch({ type: "error", error }); 18828 } 18829 } 18830 } 18831 #dispatch(action) { 18832 const reducer = (state) => { 18833 switch (action.type) { 18834 case "failed": 18835 return { 18836 ...state, 18837 failureCount: action.failureCount, 18838 failureReason: action.error 18839 }; 18840 case "pause": 18841 return { 18842 ...state, 18843 isPaused: true 18844 }; 18845 case "continue": 18846 return { 18847 ...state, 18848 isPaused: false 18849 }; 18850 case "pending": 18851 return { 18852 ...state, 18853 context: action.context, 18854 data: void 0, 18855 failureCount: 0, 18856 failureReason: null, 18857 error: null, 18858 isPaused: !(0,_retryer_js__WEBPACK_IMPORTED_MODULE_1__/* .canFetch */ .v_)(this.options.networkMode), 18859 status: "pending", 18860 variables: action.variables, 18861 submittedAt: Date.now() 18862 }; 18863 case "success": 18864 return { 18865 ...state, 18866 data: action.data, 18867 failureCount: 0, 18868 failureReason: null, 18869 error: null, 18870 status: "success", 18871 isPaused: false 18872 }; 18873 case "error": 18874 return { 18875 ...state, 18876 data: void 0, 18877 error: action.error, 18878 failureCount: state.failureCount + 1, 18879 failureReason: action.error, 18880 isPaused: false, 18881 status: "error" 18882 }; 18883 } 18884 }; 18885 this.state = reducer(this.state); 18886 _notifyManager_js__WEBPACK_IMPORTED_MODULE_2__/* .notifyManager */ .j.batch(() => {
18887 this.#observers.forEach((observer) => { 18888 observer.onMutationUpdate(action); 18889 }); 18890 this.#mutationCache.notify({ 18891 mutation: this, 18892 type: "updated", 18893 action 18894 }); 18895 }); 18896 } 18897}; 18898function getDefaultState() { 18899 return { 18900 context: void 0, 18901 data: void 0, 18902 error: null, 18903 failureCount: 0, 18904 failureReason: null, 18905 isPaused: false, 18906 status: "idle", 18907 variables: void 0, 18908 submittedAt: 0 18909 }; 18910} 18911 18912//# sourceMappingURL=mutation.js.map 18913 18914/***/ }), 18915 18916/***/ 6261: 18917/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 18918 18919"use strict"; 18920/* harmony export */ __webpack_require__.d(__webpack_exports__, { 18921/* harmony export */ j: () => (/* binding */ notifyManager) 18922/* harmony export */ }); 18923/* unused harmony export createNotifyManager */
18924// src/notifyManager.ts 18925function createNotifyManager() { 18926 let queue = []; 18927 let transactions = 0; 18928 let notifyFn = (callback) => { 18929 callback(); 18930 }; 18931 let batchNotifyFn = (callback) => { 18932 callback(); 18933 }; 18934 let scheduleFn = (cb) => setTimeout(cb, 0); 18935 const setScheduler = (fn) => { 18936 scheduleFn = fn; 18937 }; 18938 const batch = (callback) => { 18939 let result; 18940 transactions++; 18941 try { 18942 result = callback(); 18943 } finally { 18944 transactions--; 18945 if (!transactions) { 18946 flush(); 18947 } 18948 } 18949 return result; 18950 }; 18951 const schedule = (callback) => { 18952 if (transactions) { 18953 queue.push(callback); 18954 } else { 18955 scheduleFn(() => { 18956 notifyFn(callback); 18957 }); 18958 } 18959 }; 18960 const batchCalls = (callback) => { 18961 return (...args) => { 18962 schedule(() => { 18963 callback(...args); 18964 }); 18965 }; 18966 }; 18967 const flush = () => { 18968 const originalQueue = queue; 18969 queue = []; 18970 if (originalQueue.length) { 18971 scheduleFn(() => { 18972 batchNotifyFn(() => { 18973 originalQueue.forEach((callback) => { 18974 notifyFn(callback); 18975 }); 18976 }); 18977 }); 18978 } 18979 }; 18980 const setNotifyFunction = (fn) => { 18981 notifyFn = fn; 18982 }; 18983 const setBatchNotifyFunction = (fn) => { 18984 batchNotifyFn = fn; 18985 }; 18986 return { 18987 batch, 18988 batchCalls, 18989 schedule, 18990 setNotifyFunction, 18991 setBatchNotifyFunction, 18992 setScheduler 18993 }; 18994} 18995var notifyManager = createNotifyManager(); 18996 18997//# sourceMappingURL=notifyManager.js.map 18998 18999/***/ }), 19000 19001/***/ 6035: 19002/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 19003 19004"use strict"; 19005/* harmony export */ __webpack_require__.d(__webpack_exports__, { 19006/* harmony export */ t: () => (/* binding */ onlineManager) 19007/* harmony export */ }); 19008/* unused harmony export OnlineManager */ 19009/* harmony import */ var _subscribable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6500); 19010/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4880);
19011// src/onlineManager.ts 19012 19013 19014var OnlineManager = class extends _subscribable_js__WEBPACK_IMPORTED_MODULE_0__/* .Subscribable */ .Q { 19015 #online = true; 19016 #cleanup; 19017 #setup; 19018 constructor() { 19019 super(); 19020 this.#setup = (onOnline) => { 19021 if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .isServer */ .S$ && window.addEventListener) { 19022 const onlineListener = () => onOnline(true); 19023 const offlineListener = () => onOnline(false); 19024 window.addEventListener("online", onlineListener, false); 19025 window.addEventListener("offline", offlineListener, false); 19026 return () => { 19027 window.removeEventListener("online", onlineListener); 19028 window.removeEventListener("offline", offlineListener); 19029 }; 19030 } 19031 return; 19032 }; 19033 } 19034 onSubscribe() { 19035 if (!this.#cleanup) { 19036 this.setEventListener(this.#setup); 19037 } 19038 } 19039 onUnsubscribe() { 19040 if (!this.hasListeners()) { 19041 this.#cleanup?.(); 19042 this.#cleanup = void 0; 19043 } 19044 } 19045 setEventListener(setup) { 19046 this.#setup = setup; 19047 this.#cleanup?.(); 19048 this.#cleanup = setup(this.setOnline.bind(this)); 19049 } 19050 setOnline(online) { 19051 const changed = this.#online !== online; 19052 if (changed) { 19053 this.#online = online; 19054 this.listeners.forEach((listener) => { 19055 listener(online); 19056 }); 19057 } 19058 } 19059 isOnline() { 19060 return this.#online; 19061 } 19062}; 19063var onlineManager = new OnlineManager(); 19064 19065//# sourceMappingURL=onlineManager.js.map 19066 19067/***/ }), 19068 19069/***/ 1692: 19070/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 19071 19072"use strict"; 19073/* harmony export */ __webpack_require__.d(__webpack_exports__, { 19074/* harmony export */ k: () => (/* binding */ Removable) 19075/* harmony export */ }); 19076/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4880);
19077// src/removable.ts 19078 19079var Removable = class { 19080 #gcTimeout; 19081 destroy() { 19082 this.clearGcTimeout(); 19083 } 19084 scheduleGc() { 19085 this.clearGcTimeout(); 19086 if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .isValidTimeout */ .gn)(this.gcTime)) { 19087 this.#gcTimeout = setTimeout(() => { 19088 this.optionalRemove(); 19089 }, this.gcTime); 19090 } 19091 } 19092 updateGcTime(newGcTime) { 19093 this.gcTime = Math.max( 19094 this.gcTime || 0, 19095 newGcTime ?? (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* .isServer */ .S$ ? Infinity : 5 * 60 * 1e3) 19096 ); 19097 } 19098 clearGcTimeout() { 19099 if (this.#gcTimeout) { 19100 clearTimeout(this.#gcTimeout); 19101 this.#gcTimeout = void 0; 19102 } 19103 } 19104}; 19105 19106//# sourceMappingURL=removable.js.map 19107 19108/***/ }), 19109 19110/***/ 8904: 19111/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 19112 19113"use strict"; 19114/* harmony export */ __webpack_require__.d(__webpack_exports__, { 19115/* harmony export */ II: () => (/* binding */ createRetryer), 19116/* harmony export */ v_: () => (/* binding */ canFetch), 19117/* harmony export */ wm: () => (/* binding */ isCancelledError) 19118/* harmony export */ }); 19119/* unused harmony export CancelledError */ 19120/* harmony import */ var _focusManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9658); 19121/* harmony import */ var _onlineManager_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6035); 19122/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4880);
19123// src/retryer.ts 19124 19125 19126 19127function defaultRetryDelay(failureCount) { 19128 return Math.min(1e3 * 2 ** failureCount, 3e4); 19129} 19130function canFetch(networkMode) { 19131 return (networkMode ?? "online") === "online" ? _onlineManager_js__WEBPACK_IMPORTED_MODULE_0__/* .onlineManager */ .t.isOnline() : true; 19132} 19133var CancelledError = class { 19134 constructor(options) { 19135 this.revert = options?.revert; 19136 this.silent = options?.silent; 19137 } 19138}; 19139function isCancelledError(value) { 19140 return value instanceof CancelledError; 19141} 19142function createRetryer(config) { 19143 let isRetryCancelled = false; 19144 let failureCount = 0; 19145 let isResolved = false; 19146 let continueFn; 19147 let promiseResolve; 19148 let promiseReject; 19149 const promise = new Promise((outerResolve, outerReject) => { 19150 promiseResolve = outerResolve; 19151 promiseReject = outerReject; 19152 }); 19153 const cancel = (cancelOptions) => { 19154 if (!isResolved) { 19155 reject(new CancelledError(cancelOptions)); 19156 config.abort?.(); 19157 } 19158 }; 19159 const cancelRetry = () => { 19160 isRetryCancelled = true; 19161 }; 19162 const continueRetry = () => { 19163 isRetryCancelled = false; 19164 }; 19165 const shouldPause = () => !_focusManager_js__WEBPACK_IMPORTED_MODULE_1__/* .focusManager */ .m.isFocused() || config.networkMode !== "always" && !_onlineManager_js__WEBPACK_IMPORTED_MODULE_0__/* .onlineManager */ .t.isOnline(); 19166 const resolve = (value) => { 19167 if (!isResolved) { 19168 isResolved = true; 19169 config.onSuccess?.(value); 19170 continueFn?.(); 19171 promiseResolve(value); 19172 } 19173 }; 19174 const reject = (value) => { 19175 if (!isResolved) { 19176 isResolved = true; 19177 config.onError?.(value); 19178 continueFn?.(); 19179 promiseReject(value); 19180 } 19181 }; 19182 const pause = () => { 19183 return new Promise((continueResolve) => { 19184 continueFn = (value) => { 19185 const canContinue = isResolved || !shouldPause(); 19186 if (canContinue) { 19187 continueResolve(value); 19188 } 19189 return canContinue; 19190 }; 19191 config.onPause?.(); 19192 }).then(() => { 19193 continueFn = void 0; 19194 if (!isResolved) { 19195 config.onContinue?.(); 19196 } 19197 }); 19198 }; 19199 const run = () => { 19200 if (isResolved) { 19201 return; 19202 } 19203 let promiseOrValue; 19204 try { 19205 promiseOrValue = config.fn(); 19206 } catch (error) { 19207 promiseOrValue = Promise.reject(error); 19208 } 19209 Promise.resolve(promiseOrValue).then(resolve).catch((error) => { 19210 if (isResolved) { 19211 return; 19212 } 19213 const retry = config.retry ?? (_utils_js__WEBPACK_IMPORTED_MODULE_2__/* .isServer */ .S$ ? 0 : 3); 19214 const retryDelay = config.retryDelay ?? defaultRetryDelay; 19215 const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; 19216 const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); 19217 if (isRetryCancelled || !shouldRetry) { 19218 reject(error); 19219 return; 19220 } 19221 failureCount++; 19222 config.onFail?.(failureCount, error); 19223 (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__/* .sleep */ .yy)(delay).then(() => { 19224 if (shouldPause()) { 19225 return pause(); 19226 } 19227 return; 19228 }).then(() => { 19229 if (isRetryCancelled) { 19230 reject(error); 19231 } else { 19232 run(); 19233 } 19234 }); 19235 }); 19236 }; 19237 if (canFetch(config.networkMode)) { 19238 run(); 19239 } else { 19240 pause().then(run); 19241 } 19242 return { 19243 promise, 19244 cancel, 19245 continue: () => { 19246 const didContinue = continueFn?.(); 19247 return didContinue ? promise : Promise.resolve(); 19248 }, 19249 cancelRetry, 19250 continueRetry 19251 }; 19252} 19253 19254//# sourceMappingURL=retryer.js.map 19255 19256/***/ }), 19257 19258/***/ 6500: 19259/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 19260 19261"use strict"; 19262/* harmony export */ __webpack_require__.d(__webpack_exports__, { 19263/* harmony export */ Q: () => (/* binding */ Subscribable) 19264/* harmony export */ });
19265// src/subscribable.ts 19266var Subscribable = class { 19267 constructor() { 19268 this.listeners = /* @__PURE__ */ new Set(); 19269 this.subscribe = this.subscribe.bind(this); 19270 } 19271 subscribe(listener) { 19272 this.listeners.add(listener); 19273 this.onSubscribe(); 19274 return () => { 19275 this.listeners.delete(listener); 19276 this.onUnsubscribe(); 19277 }; 19278 } 19279 hasListeners() { 19280 return this.listeners.size > 0; 19281 } 19282 onSubscribe() { 19283 } 19284 onUnsubscribe() { 19285 } 19286}; 19287 19288//# sourceMappingURL=subscribable.js.map 19289 19290/***/ }), 19291 19292/***/ 4880: 19293/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 19294 19295"use strict"; 19296/* harmony export */ __webpack_require__.d(__webpack_exports__, { 19297/* harmony export */ Cp: () => (/* binding */ partialMatchKey), 19298/* harmony export */ EN: () => (/* binding */ hashKey), 19299/* harmony export */ F$: () => (/* binding */ hashQueryKeyByOptions), 19300/* harmony export */ MK: () => (/* binding */ matchQuery), 19301/* harmony export */ S$: () => (/* binding */ isServer), 19302/* harmony export */ ZZ: () => (/* binding */ addToStart), 19303/* harmony export */ Zw: () => (/* binding */ functionalUpdate), 19304/* harmony export */ f8: () => (/* binding */ shallowEqualObjects), 19305/* harmony export */ gn: () => (/* binding */ isValidTimeout), 19306/* harmony export */ j3: () => (/* binding */ timeUntilStale), 19307/* harmony export */ lQ: () => (/* binding */ noop), 19308/* harmony export */ nJ: () => (/* binding */ matchMutation), 19309/* harmony export */ pl: () => (/* binding */ replaceData), 19310/* harmony export */ y9: () => (/* binding */ addToEnd), 19311/* harmony export */ yy: () => (/* binding */ sleep) 19312/* harmony export */ }); 19313/* unused harmony exports isPlainArray, isPlainObject, keepPreviousData, replaceEqualDeep */
19314// src/utils.ts 19315var isServer = typeof window === "undefined" || "Deno" in window; 19316function noop() { 19317 return void 0; 19318} 19319function functionalUpdate(updater, input) { 19320 return typeof updater === "function" ? updater(input) : updater; 19321} 19322function isValidTimeout(value) { 19323 return typeof value === "number" && value >= 0 && value !== Infinity; 19324} 19325function timeUntilStale(updatedAt, staleTime) { 19326 return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); 19327} 19328function matchQuery(filters, query) { 19329 const { 19330 type = "all", 19331 exact, 19332 fetchStatus, 19333 predicate, 19334 queryKey, 19335 stale 19336 } = filters; 19337 if (queryKey) { 19338 if (exact) { 19339 if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { 19340 return false; 19341 } 19342 } else if (!partialMatchKey(query.queryKey, queryKey)) { 19343 return false; 19344 } 19345 } 19346 if (type !== "all") { 19347 const isActive = query.isActive(); 19348 if (type === "active" && !isActive) { 19349 return false; 19350 } 19351 if (type === "inactive" && isActive) { 19352 return false; 19353 } 19354 } 19355 if (typeof stale === "boolean" && query.isStale() !== stale) { 19356 return false; 19357 } 19358 if (typeof fetchStatus !== "undefined" && fetchStatus !== query.state.fetchStatus) { 19359 return false; 19360 } 19361 if (predicate && !predicate(query)) { 19362 return false; 19363 } 19364 return true; 19365} 19366function matchMutation(filters, mutation) { 19367 const { exact, status, predicate, mutationKey } = filters; 19368 if (mutationKey) { 19369 if (!mutation.options.mutationKey) { 19370 return false; 19371 } 19372 if (exact) { 19373 if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { 19374 return false; 19375 } 19376 } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { 19377 return false; 19378 } 19379 } 19380 if (status && mutation.state.status !== status) { 19381 return false; 19382 } 19383 if (predicate && !predicate(mutation)) { 19384 return false; 19385 } 19386 return true; 19387} 19388function hashQueryKeyByOptions(queryKey, options) { 19389 const hashFn = options?.queryKeyHashFn || hashKey; 19390 return hashFn(queryKey); 19391} 19392function hashKey(queryKey) { 19393 return JSON.stringify( 19394 queryKey, 19395 (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { 19396 result[key] = val[key]; 19397 return result; 19398 }, {}) : val 19399 ); 19400} 19401function partialMatchKey(a, b) { 19402 if (a === b) { 19403 return true; 19404 } 19405 if (typeof a !== typeof b) { 19406 return false; 19407 } 19408 if (a && b && typeof a === "object" && typeof b === "object") { 19409 return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key])); 19410 } 19411 return false; 19412} 19413function replaceEqualDeep(a, b) { 19414 if (a === b) { 19415 return a; 19416 } 19417 const array = isPlainArray(a) && isPlainArray(b); 19418 if (array || isPlainObject(a) && isPlainObject(b)) { 19419 const aSize = array ? a.length : Object.keys(a).length; 19420 const bItems = array ? b : Object.keys(b); 19421 const bSize = bItems.length; 19422 const copy = array ? [] : {}; 19423 let equalItems = 0; 19424 for (let i = 0; i < bSize; i++) { 19425 const key = array ? i : bItems[i]; 19426 copy[key] = replaceEqualDeep(a[key], b[key]); 19427 if (copy[key] === a[key]) { 19428 equalItems++; 19429 } 19430 } 19431 return aSize === bSize && equalItems === aSize ? a : copy; 19432 } 19433 return b; 19434} 19435function shallowEqualObjects(a, b) { 19436 if (a && !b || b && !a) { 19437 return false; 19438 } 19439 for (const key in a) { 19440 if (a[key] !== b[key]) { 19441 return false; 19442 } 19443 } 19444 return true; 19445} 19446function isPlainArray(value) { 19447 return Array.isArray(value) && value.length === Object.keys(value).length; 19448} 19449function isPlainObject(o) { 19450 if (!hasObjectPrototype(o)) { 19451 return false; 19452 } 19453 const ctor = o.constructor; 19454 if (typeof ctor === "undefined") { 19455 return true; 19456 } 19457 const prot = ctor.prototype; 19458 if (!hasObjectPrototype(prot)) { 19459 return false; 19460 } 19461 if (!prot.hasOwnProperty("isPrototypeOf")) { 19462 return false; 19463 } 19464 return true; 19465} 19466function hasObjectPrototype(o) { 19467 return Object.prototype.toString.call(o) === "[object Object]"; 19468} 19469function sleep(ms) { 19470 return new Promise((resolve) => { 19471 setTimeout(resolve, ms); 19472 }); 19473} 19474function replaceData(prevData, data, options) { 19475 if (typeof options.structuralSharing === "function") { 19476 return options.structuralSharing(prevData, data); 19477 } else if (options.structuralSharing !== false) { 19478 return replaceEqualDeep(prevData, data); 19479 } 19480 return data; 19481} 19482function keepPreviousData(previousData) { 19483 return previousData; 19484} 19485function addToEnd(items, item, max = 0) { 19486 const newItems = [...items, item]; 19487 return max && newItems.length > max ? newItems.slice(1) : newItems; 19488} 19489function addToStart(items, item, max = 0) { 19490 const newItems = [item, ...items]; 19491 return max && newItems.length > max ? newItems.slice(0, -1) : newItems; 19492} 19493 19494//# sourceMappingURL=utils.js.map 19495 19496/***/ }), 19497 19498/***/ 7665: 19499/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 19500 19501"use strict"; 19502/* harmony export */ __webpack_require__.d(__webpack_exports__, { 19503/* harmony export */ Ht: () => (/* binding */ QueryClientProvider), 19504/* harmony export */ jE: () => (/* binding */ useQueryClient) 19505/* harmony export */ }); 19506/* unused harmony export QueryClientContext */ 19507/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3328); 19508"use client"; 19509
vendor: 4,704 bytes, lines 19510-19632
19510// src/QueryClientProvider.tsx 19511 19512var QueryClientContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext( 19513 void 0 19514); 19515var useQueryClient = (queryClient) => { 19516 const client = react__WEBPACK_IMPORTED_MODULE_0__.useContext(QueryClientContext); 19517 if (queryClient) { 19518 return queryClient; 19519 } 19520 if (!client) { 19521 throw new Error("No QueryClient set, use QueryClientProvider to set one"); 19522 } 19523 return client; 19524}; 19525var QueryClientProvider = ({ 19526 client, 19527 children 19528}) => { 19529 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 19530 client.mount(); 19531 return () => { 19532 client.unmount(); 19533 }; 19534 }, [client]); 19535 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(QueryClientContext.Provider, { value: client }, children); 19536}; 19537 19538//# sourceMappingURL=QueryClientProvider.js.map 19539 19540/***/ }) 19541 19542/******/ }); 19543/************************************************************************/ 19544/******/ // The module cache 19545/******/ var __webpack_module_cache__ = {}; 19546/******/ 19547/******/ // The require function 19548/******/ function __webpack_require__(moduleId) { 19549/******/ // Check if module is in cache 19550/******/ var cachedModule = __webpack_module_cache__[moduleId]; 19551/******/ if (cachedModule !== undefined) { 19552/******/ return cachedModule.exports; 19553/******/ } 19554/******/ // Create a new module (and put it into the cache) 19555/******/ var module = __webpack_module_cache__[moduleId] = { 19556/******/ id: moduleId, 19557/******/ loaded: false, 19558/******/ exports: {} 19559/******/ }; 19560/******/ 19561/******/ // Execute the module function 19562/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 19563/******/ 19564/******/ // Flag the module as loaded 19565/******/ module.loaded = true; 19566/******/ 19567/******/ // Return the exports of the module 19568/******/ return module.exports; 19569/******/ } 19570/******/ 19571/******/ // expose the modules object (__webpack_modules__) 19572/******/ __webpack_require__.m = __webpack_modules__; 19573/******/ 19574/************************************************************************/ 19575/******/ /* webpack/runtime/compat get default export */ 19576/******/ (() => { 19577/******/ // getDefaultExport function for compatibility with non-harmony modules 19578/******/ __webpack_require__.n = (module) => { 19579/******/ var getter = module && module.__esModule ? 19580/******/ () => (module['default']) : 19581/******/ () => (module); 19582/******/ __webpack_require__.d(getter, { a: getter }); 19583/******/ return getter; 19584/******/ }; 19585/******/ })(); 19586/******/ 19587/******/ /* webpack/runtime/create fake namespace object */ 19588/******/ (() => { 19589/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); 19590/******/ var leafPrototypes; 19591/******/ // create a fake namespace object 19592/******/ // mode & 1: value is a module id, require it 19593/******/ // mode & 2: merge all properties of value into the ns 19594/******/ // mode & 4: return value when already ns object 19595/******/ // mode & 16: return value when it's Promise-like 19596/******/ // mode & 8|1: behave like require 19597/******/ __webpack_require__.t = function(value, mode) { 19598/******/ if(mode & 1) value = this(value); 19599/******/ if(mode & 8) return value; 19600/******/ if(typeof value === 'object' && value) { 19601/******/ if((mode & 4) && value.__esModule) return value; 19602/******/ if((mode & 16) && typeof value.then === 'function') return value; 19603/******/ } 19604/******/ var ns = Object.create(null); 19605/******/ __webpack_require__.r(ns); 19606/******/ var def = {}; 19607/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; 19608/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { 19609/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); 19610/******/ } 19611/******/ def['default'] = () => (value); 19612/******/ __webpack_require__.d(ns, def); 19613/******/ return ns; 19614/******/ }; 19615/******/ })(); 19616/******/ 19617/******/ /* webpack/runtime/define property getters */ 19618/******/ (() => { 19619/******/ // define getter functions for harmony exports 19620/******/ __webpack_require__.d = (exports, definition) => { 19621/******/ for(var key in definition) { 19622/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 19623/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 19624/******/ } 19625/******/ } 19626/******/ }; 19627/******/ })(); 19628/******/ 19629/******/ /* webpack/runtime/ensure chunk */ 19630/******/ (() => { 19631/******/ __webpack_require__.f = {}; 19632/******/ // This file contains only the entry chunk.
vendor: 5,063 bytes, lines 19633-19751
19633/******/ // The chunk loading function for additional chunks 19634/******/ __webpack_require__.e = (chunkId) => { 19635/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { 19636/******/ __webpack_require__.f[key](chunkId, promises); 19637/******/ return promises; 19638/******/ }, [])); 19639/******/ }; 19640/******/ })(); 19641/******/ 19642/******/ /* webpack/runtime/get javascript chunk filename */ 19643/******/ (() => { 19644/******/ // This function allow to reference async chunks 19645/******/ __webpack_require__.u = (chunkId) => { 19646/******/ // return url for filenames based on template 19647/******/ return "myhub.modules.imageCarousel." + chunkId + ".js"; 19648/******/ }; 19649/******/ })(); 19650/******/ 19651/******/ /* webpack/runtime/global */ 19652/******/ (() => { 19653/******/ __webpack_require__.g = (function() { 19654/******/ if (typeof globalThis === 'object') return globalThis; 19655/******/ try { 19656/******/ return this || new Function('return this')(); 19657/******/ } catch (e) { 19658/******/ if (typeof window === 'object') return window; 19659/******/ } 19660/******/ })(); 19661/******/ })(); 19662/******/ 19663/******/ /* webpack/runtime/hasOwnProperty shorthand */ 19664/******/ (() => { 19665/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 19666/******/ })(); 19667/******/ 19668/******/ /* webpack/runtime/load script */ 19669/******/ (() => { 19670/******/ var inProgress = {}; 19671/******/ var dataWebpackPrefix = "myhub-banner:"; 19672/******/ // loadScript function to load a script via script tag 19673/******/ __webpack_require__.l = (url, done, key, chunkId) => { 19674/******/ if(inProgress[url]) { inProgress[url].push(done); return; } 19675/******/ var script, needAttach; 19676/******/ if(key !== undefined) { 19677/******/ var scripts = document.getElementsByTagName("script"); 19678/******/ for(var i = 0; i < scripts.length; i++) { 19679/******/ var s = scripts[i]; 19680/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } 19681/******/ } 19682/******/ } 19683/******/ if(!script) { 19684/******/ needAttach = true; 19685/******/ script = document.createElement('script'); 19686/******/ 19687/******/ script.charset = 'utf-8'; 19688/******/ script.timeout = 120; 19689/******/ if (__webpack_require__.nc) { 19690/******/ script.setAttribute("nonce", __webpack_require__.nc); 19691/******/ } 19692/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key); 19693/******/ 19694/******/ script.src = url; 19695/******/ } 19696/******/ inProgress[url] = [done]; 19697/******/ var onScriptComplete = (prev, event) => { 19698/******/ // avoid mem leaks in IE. 19699/******/ script.onerror = script.onload = null; 19700/******/ clearTimeout(timeout); 19701/******/ var doneFns = inProgress[url]; 19702/******/ delete inProgress[url]; 19703/******/ script.parentNode && script.parentNode.removeChild(script); 19704/******/ doneFns && doneFns.forEach((fn) => (fn(event))); 19705/******/ if(prev) return prev(event); 19706/******/ } 19707/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); 19708/******/ script.onerror = onScriptComplete.bind(null, script.onerror); 19709/******/ script.onload = onScriptComplete.bind(null, script.onload); 19710/******/ needAttach && document.head.appendChild(script); 19711/******/ }; 19712/******/ })(); 19713/******/ 19714/******/ /* webpack/runtime/make namespace object */ 19715/******/ (() => { 19716/******/ // define __esModule on exports 19717/******/ __webpack_require__.r = (exports) => { 19718/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 19719/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 19720/******/ } 19721/******/ Object.defineProperty(exports, '__esModule', { value: true }); 19722/******/ }; 19723/******/ })(); 19724/******/ 19725/******/ /* webpack/runtime/node module decorator */ 19726/******/ (() => { 19727/******/ __webpack_require__.nmd = (module) => { 19728/******/ module.paths = []; 19729/******/ if (!module.children) module.children = []; 19730/******/ return module; 19731/******/ }; 19732/******/ })(); 19733/******/ 19734/******/ /* webpack/runtime/publicPath */ 19735/******/ (() => { 19736/******/ var scriptUrl; 19737/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; 19738/******/ var document = __webpack_require__.g.document; 19739/******/ if (!scriptUrl && document) { 19740/******/ if (document.currentScript) 19741/******/ scriptUrl = document.currentScript.src; 19742/******/ if (!scriptUrl) { 19743/******/ var scripts = document.getElementsByTagName("script"); 19744/******/ if(scripts.length) { 19745/******/ var i = scripts.length - 1; 19746/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; 19747/******/ } 19748/******/ } 19749/******/ } 19750/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration 19751/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your co
19751de to use your own logic. 19752/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); 19753/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); 19754/******/ __webpack_require__.p = scriptUrl; 19755/******/ })(); 19756/******/ 19757/******/ /* webpack/runtime/jsonp chunk loading */ 19758/******/ (() => { 19759/******/ __webpack_require__.b = document.baseURI || self.location.href; 19760/******/ 19761/******/ // object to store loaded and loading chunks 19762/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 19763/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 19764/******/ var installedChunks = { 19765/******/ 792: 0 19766/******/ }; 19767/******/ 19768/******/ __webpack_require__.f.j = (chunkId, promises) => { 19769/******/ // JSONP chunk loading for javascript 19770/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; 19771/******/ if(installedChunkData !== 0) { // 0 means "already installed". 19772/******/ 19773/******/ // a Promise means "currently loading". 19774/******/ if(installedChunkData) { 19775/******/ promises.push(installedChunkData[2]); 19776/******/ } else { 19777/******/ if(true) { // all chunks have JS 19778/******/ // setup Promise in chunk cache 19779/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); 19780/******/ promises.push(installedChunkData[2] = promise); 19781/******/ 19782/******/ // start chunk loading 19783/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); 19784/******/ // create error before stack unwound to get useful stacktrace later 19785/******/ var error = new Error(); 19786/******/ var loadingEnded = (event) => { 19787/******/ if(__webpack_require__.o(installedChunks, chunkId)) { 19788/******/ installedChunkData = installedChunks[chunkId]; 19789/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; 19790/******/ if(installedChunkData) { 19791/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); 19792/******/ var realSrc = event && event.target && event.target.src; 19793/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; 19794/******/ error.name = 'ChunkLoadError'; 19795/******/ error.type = errorType; 19796/******/ error.request = realSrc; 19797/******/ installedChunkData[1](error); 19798/******/ } 19799/******/ } 19800/******/ }; 19801/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); 19802/******/ } 19803/******/ } 19804/******/ } 19805/******/ }; 19806/******/ 19807/******/ // no prefetching 19808/******/ 19809/******/ // no preloaded 19810/******/ 19811/******/ // no HMR 19812/******/ 19813/******/ // no HMR manifest 19814/******/ 19815/******/ // no on chunks loaded 19816/******/ 19817/******/ // install a JSONP callback for chunk loading 19818/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 19819/******/ var [chunkIds, moreModules, runtime] = data; 19820/******/ // add "moreModules" to the modules object, 19821/******/ // then flag all "chunkIds" as loaded and fire callback 19822/******/ var moduleId, chunkId, i = 0; 19823/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 19824/******/ for(moduleId in moreModules) { 19825/******/ if(__webpack_require__.o(moreModules, moduleId)) { 19826/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 19827/******/ } 19828/******/ } 19829/******/ if(runtime) var result = runtime(__webpack_require__); 19830/******/ } 19831/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 19832/******/ for(;i < chunkIds.length; i++) { 19833/******/ chunkId = chunkIds[i]; 19834/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 19835/******/ installedChunks[chunkId][0](); 19836/******/ } 19837/******/ installedChunks[chunkId] = 0; 19838/******/ } 19839/******/ 19840/******/ } 19841/******/ 19842/******/ var chunkLoadingGlobal = self["webpackChunkmyhub_banner"] = self["webpackChunkmyhub_banner"] || []; 19843/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 19844/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 19845/******/ })(); 19846/******/ 19847/******/ /* webpack/runtime/nonce */ 19848/******/ (() => { 19849/******/ __webpack_require__.nc = undefined; 19850/******/ })(); 19851/******/ 19852/************************************************************************/ 19853var __webpack_exports__ = {}; 19854// This entry need to be wrapped in an IIFE because it need to be in strict mode. 19855(() => { 19856"use strict"; 19857 19858// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 19859var jsx_runtime = __webpack_require__(4848); 19860// EXTERNAL MODULE: delegated ./node_modules/react/index.js from dll-reference common_lib 19861var reactfrom_dll_reference_common_lib = __webpack_require__(3328); 19862// EXTERNAL MODULE: ./node_modules/react-dom/client.js 19863var client = __webpack_require__(5338); 19864// EXTERNAL MODULE: ./src/App.tsx + 8 modules 19865var App = __webpack_require__(8595); 19866;// CONCATENATED MODULE: ./src/reportWebVitals.ts 19867var reportWebVitals = function (onPerfEntry) { 19868 if (onPerfEntry && onPerfEntry instanceof Function) { 19869 __webpack_require__.e(/* import() */ 237).then(__webpack_require__.bind(__webpack_require__, 3237)).then(function (_a) { 19870 var onCLS = _a.onCLS, onINP = _a.onINP, onFCP = _a.onFCP, onLCP = _a.onLCP, onTTFB = _a.onTTFB; 19871 onCLS(onPerfEntry); 19872 onINP(onPerfEntry); 19873 onFCP(onPerfEntry); 19874 onLCP(onPerfEntry); 19875 onTTFB(onPerfEntry); 19876 }); 19877 } 19878}; 19879/* harmony default export */ const src_reportWebVitals = (reportWebVitals); 19880 19881// EXTERNAL MODULE: ./node_modules/jquery/dist/jquery.js 19882var jquery = __webpack_require__(4692); 19883var jquery_default = /*#__PURE__*/__webpack_require__.n(jquery); 19884// EXTERNAL MODULE: ./src/context/ModuleContext.tsx 19885var ModuleContext = __webpack_require__(5837); 19886// EXTERNAL MODULE: delegated ./node_modules/myhub_components/dist/esm/ActionMenu/ActionMenu.js from dll-reference all_component_lib 19887var ActionMenufrom_dll_reference_all_component_lib = __webpack_require__(8013); 19888;// CONCATENATED MODULE: ./src/MainIndex.tsx 19889 19890 19891 19892 19893 19894 19895var newWindow = window; 19896var MainIndex = function (_a) { 19897 var portalId = _a.portalId, tabId = _a.tabId; 19898 var moduleAdded = function () { 19899 var moduleId = localStorage.getItem("Banner"); 19900 if (moduleId) { 19901 var element = document.getElementById("MyHub_Modules_Banner-" + moduleId); 19902 var actionEle = element.closest(".DnnModule"); 19903 var permission = actionEle.getAttribute("data-has-page-permission"); 19904 var actionData = newWindow.generateActionMenuJson(moduleId, 563); 19905 var customData = newWindow.generatecustomMenuJson(); 19906 waitForElement(actionEle, ".DnnModule .actionMenu").then(function (elementRender) { 19907 var newActionRoot = client.createRoot(elementRender); 19908 newActionRoot.render((0,jsx_runtime.jsx)(ActionMenufrom_dll_reference_all_component_lib["default"], { moduleId: moduleId, eventEmitter: App/* eventBus */.Bt, moduleIdName: "MyHub_Modules_Banner-".concat(moduleId), videoHelpClass: "banner-video-help" })); 19909 }); 19910 var rootElement = (0,client.createRoot)(document.getElementById("MyHub_Modules_Banner-" + moduleId)); 19911 rootElement.render((0,jsx_runtime.jsx)(reactfrom_dll_reference_common_lib.StrictMode, { children: (0,jsx_runtime.jsx)(ModuleContext/* default */.A, { children: (0,jsx_runtime.jsx)(App/* default */.Ay, { moduleId: moduleId, portalId: portalId, tabId: tabId }) }) })); 19912 } 19913 }; 19914 (0,reactfrom_dll_reference_common_lib.useEffect)(function () { 19915 window.addEventListener("newBanner", moduleAdded); 19916 return function () { 19917 window.removeEventListener("newBanner", moduleAdded); 19918 }; 19919 }, []); 19920 return null; 19921}; 19922/* harmony default export */ const src_MainIndex = (MainIndex); 19923function waitForElement(parentElement, elementSelector) { 19924 return new Promise(function (resolve, reject) { 19925 // Check if the element is already present 19926 var targetElement = parentElement.querySelector(elementSelector); 19927 if (targetElement) { 19928 resolve(targetElement); 19929 return; // Exit early if the element is already present 19930 } 19931 // If not present, observe mutations on the parentElement 19932 var observer = new MutationObserver(function (mutations) { 19933 for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) { 19934 var mutation = mutations_1[_i]; 19935 if (mutation.type === "childList") { 19936 var addedNodes = Array.from(mutation.addedNodes); 19937 var matchingElement = addedNodes.find(function (node) { return node.matches && node.matches(elementSelector); }); 19938 if (matchingElement) { 19939 resolve(matchingElement); 19940 observer.disconnect(); 19941 return; // Exit after finding the element 19942 } 19943 } 19944 } 19945 }); 19946 if (parentElement) { 19947 observer.observe(parentElement, { childList: true, subtree: true }); 19948 } 19949 }); 19950} 19951 19952// EXTERNAL MODULE: delegated ./node_modules/react-dom/index.js from dll-reference common_lib 19953var react_domfrom_dll_reference_common_lib = __webpack_require__(4500); 19954// EXTERNAL MODULE: delegated ./node_modules/myhub_components/dist/esm/ActionMenu/ReadOnlyActionMenu.js from dll-reference all_component_lib 19955var ReadOnlyActionMenufrom_dll_reference_all_component_lib = __webpack_require__(3845); 19956;// CONCATENATED MODULE: ./src/index.tsx 19957var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { 19958 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 19959 return new (P || (P = Promise))(function (resolve, reject) { 19960 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 19961 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 19962 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 19963 step((generator = generator.apply(thisArg, _arguments || [])).next()); 19964 }); 19965}; 19966var __generator = (undefined && undefined.__generator) || function (thisArg, body) { 19967 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 19968 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 19969 function verb(n) { return function (v) { return step([n, v]); }; } 19970 function step(op) { 19971 if (f) throw new TypeError("Generator is already executing."); 19972 while (g && (g = 0, op[0] && (_ = 0)), _) try {
19973 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 19974 if (y = 0, t) op = [op[0] & 2, t.value]; 19975 switch (op[0]) { 19976 case 0: case 1: t = op; break; 19977 case 4: _.label++; return { value: op[1], done: false }; 19978 case 5: _.label++; y = op[1]; op = [0]; continue; 19979 case 7: op = _.ops.pop(); _.trys.pop(); continue; 19980 default: 19981 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 19982 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 19983 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 19984 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 19985 if (t[2]) _.ops.pop(); 19986 _.trys.pop(); continue; 19987 } 19988 op = body.call(thisArg, _); 19989 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 19990 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 19991 } 19992}; 19993 19994 19995 19996 19997 19998 19999 20000 20001 20002 20003var $ = (jquery_default()); 20004var src_newWindow = window; 20005function renderActionMenu(actionEle_1, moduleId_1, moduleIdName_1, videoHelpClass_1) { 20006 return __awaiter(this, arguments, void 0, function (actionEle, moduleId, moduleIdName, videoHelpClass, isNewmodule) { 20007 if (isNewmodule === void 0) { isNewmodule = false; } 20008 return __generator(this, function (_a) { 20009 switch (_a.label) { 20010 case 0: return [4 /*yield*/, waitForElement(actionEle, ".DnnModule ".concat(isNewmodule ? ".actionMenu" : ".new-action-menu-".concat(moduleId))).then(function (elementRender) { 20011 var newActionRoot = client.createRoot(elementRender); 20012 newActionRoot.render((0,jsx_runtime.jsx)(ActionMenufrom_dll_reference_all_component_lib["default"], { moduleId: moduleId, eventEmitter: App/* eventBus */.Bt, moduleIdName: moduleIdName, videoHelpClass: videoHelpClass })); 20013 })]; 20014 case 1: return [2 /*return*/, _a.sent()]; 20015 } 20016 }); 20017 }); 20018} 20019function RenderReadOnlyActionMenu(actionEle, moduleId) { 20020 return __awaiter(this, void 0, void 0, function () { 20021 return __generator(this, function (_a) { 20022 switch (_a.label) { 20023 case 0: return [4 /*yield*/, waitForElement(actionEle, ".actionmenu-".concat(moduleId, "-readonly")).then(function (elementRender) { 20024 var newActionDiv = document.createElement("div"); 20025 newActionDiv.classList.add("w-100"); 20026 elementRender.prepend(newActionDiv); 20027 var newActionRoot = client.createRoot(newActionDiv); 20028 newActionRoot.render((0,jsx_runtime.jsx)(ReadOnlyActionMenufrom_dll_reference_all_component_lib["default"], { moduleId: moduleId, eventEmitter: App/* eventBus */.Bt })); 20029 })]; 20030 case 1: return [2 /*return*/, _a.sent()]; 20031 } 20032 }); 20033 }); 20034} 20035document.addEventListener("DOMContentLoaded", function () { 20036 var elements = document.getElementsByClassName("myhub-modules-banner"); 20037 var portalId = $(elements).attr("data-portalid"); 20038 var tabId = $(elements).attr("data-tabid"); 20039 if (elements.length > 0) { 20040 for (var i = 0; i < elements.length; i++) { 20041 var moduleId = $(elements[i]).attr("data-id"); 20042 var actionEle = elements[i].closest(".DnnModule"); 20043 var permission = actionEle.getAttribute("data-has-page-permission"); 20044 if (permission) { 20045 renderActionMenu(actionEle, moduleId, "MyHub_Modules_Banner-".concat(moduleId), "banner-video-help"); 20046 } 20047 else { 20048 RenderReadOnlyActionMenu(actionEle, moduleId); 20049 } 20050 var rootElement = client.createRoot(document.getElementById("MyHub_Modules_Banner-" + moduleId)); 20051 rootElement.render((0,jsx_runtime.jsx)(reactfrom_dll_reference_common_lib.StrictMode, { children: (0,jsx_runtime.jsx)(ModuleContext/* default */.A, { children: (0,jsx_runtime.jsx)(App/* default */.Ay, { moduleId: moduleId, portalId: portalId, tabId: tabId }) }) })); 20052 } 20053 } 20054 var parent = document.getElementById("myhWrapper"); 20055 var div = document.createElement("div"); 20056 div.classList.add("new_my_favorites"); 20057 parent === null || parent === void 0 ? void 0 : parent.appendChild(div); 20058 (0,react_domfrom_dll_reference_common_lib.render)((0,jsx_runtime.jsx)(src_MainIndex, { portalId: src_newWindow.portalId, tabId: src_newWindow.currentTabId }), div); 20059}); 20060// If you want to start measuring performance in your app, pass a function 20061// to log results (for example: reportWebVitals(console.log)) 20062// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 20063src_reportWebVitals(); 20064 20065})(); 20066 20067/******/ })() 20068;
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.