1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3
vendor: 37,880 bytes, lines 4-996
4/***/ "./node_modules/@googlemaps/markerclusterer/dist/index.esm.js": 5/*!********************************************************************!*\ 6 !*** ./node_modules/@googlemaps/markerclusterer/dist/index.esm.js ***! 7 \********************************************************************/ 8/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9 10"use strict"; 11__webpack_require__.r(__webpack_exports__); 12/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13/* harmony export */ AbstractAlgorithm: () => (/* binding */ AbstractAlgorithm), 14/* harmony export */ AbstractViewportAlgorithm: () => (/* binding */ AbstractViewportAlgorithm), 15/* harmony export */ Cluster: () => (/* binding */ Cluster), 16/* harmony export */ ClusterStats: () => (/* binding */ ClusterStats), 17/* harmony export */ DefaultRenderer: () => (/* binding */ DefaultRenderer), 18/* harmony export */ GridAlgorithm: () => (/* binding */ GridAlgorithm), 19/* harmony export */ MarkerClusterer: () => (/* binding */ MarkerClusterer), 20/* harmony export */ MarkerClustererEvents: () => (/* binding */ MarkerClustererEvents), 21/* harmony export */ MarkerUtils: () => (/* binding */ MarkerUtils), 22/* harmony export */ NoopAlgorithm: () => (/* binding */ NoopAlgorithm), 23/* harmony export */ SuperClusterAlgorithm: () => (/* binding */ SuperClusterAlgorithm), 24/* harmony export */ SuperClusterViewportAlgorithm: () => (/* binding */ SuperClusterViewportAlgorithm), 25/* harmony export */ defaultOnClusterClickHandler: () => (/* binding */ defaultOnClusterClickHandler), 26/* harmony export */ distanceBetweenPoints: () => (/* binding */ distanceBetweenPoints), 27/* harmony export */ extendBoundsToPaddedViewport: () => (/* binding */ extendBoundsToPaddedViewport), 28/* harmony export */ extendPixelBounds: () => (/* binding */ extendPixelBounds), 29/* harmony export */ filterMarkersToPaddedViewport: () => (/* binding */ filterMarkersToPaddedViewport), 30/* harmony export */ getPaddedViewport: () => (/* binding */ getPaddedViewport), 31/* harmony export */ noop: () => (/* binding */ noop), 32/* harmony export */ pixelBoundsToLatLngBounds: () => (/* binding */ pixelBoundsToLatLngBounds) 33/* harmony export */ }); 34/* harmony import */ var fast_deep_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-deep-equal */ "./node_modules/fast-deep-equal/index.js"); 35/* harmony import */ var fast_deep_equal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal__WEBPACK_IMPORTED_MODULE_0__); 36/* harmony import */ var supercluster__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! supercluster */ "./node_modules/supercluster/index.js"); 37 38 39 40/*! ***************************************************************************** 41Copyright (c) Microsoft Corporation. 42 43Permission to use, copy, modify, and/or distribute this software for any 44purpose with or without fee is hereby granted. 45 46THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 47REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 48AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 49INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 50LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 51OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 52PERFORMANCE OF THIS SOFTWARE. 53***************************************************************************** */ 54 55function __rest(s, e) { 56 var t = {}; 57 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 58 t[p] = s[p]; 59 if (s != null && typeof Object.getOwnPropertySymbols === "function") 60 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 61 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 62 t[p[i]] = s[p[i]]; 63 } 64 return t; 65} 66 67/** 68 * Copyright 2023 Google LLC 69 * 70 * Licensed under the Apache License, Version 2.0 (the "License"); 71 * you may not use this file except in compliance with the License. 72 * You may obtain a copy of the License at 73 * 74 * http://www.apache.org/licenses/LICENSE-2.0 75 * 76 * Unless required by applicable law or agreed to in writing, software 77 * distributed under the License is distributed on an "AS IS" BASIS, 78 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 79 * See the License for the specific language governing permissions and 80 * limitations under the License. 81 */ 82/** 83 * util class that creates a common set of convenience functions to wrap 84 * shared behavior of Advanced Markers and Markers. 85 */ 86class MarkerUtils { 87 static isAdvancedMarkerAvailable(map) { 88 return (google.maps.marker && 89 map.getMapCapabilities().isAdvancedMarkersAvailable === true); 90 } 91 static isAdvancedMarker(marker) { 92 return (google.maps.marker && 93 marker instanceof google.maps.marker.AdvancedMarkerElement); 94 } 95 static setMap(marker, map) { 96 if (this.isAdvancedMarker(marker)) { 97 marker.map = map; 98 } 99 else { 100 marker.setMap(map); 101 } 102 } 103 static getPosition(marker) { 104 // SuperClusterAlgorithm.calculate expects a LatLng instance so we fake it for Adv Markers 105 if (this.isAdvancedMarker(marker)) { 106 if (marker.position) { 107 if (marker.position instanceof google.maps.LatLng) { 108 return marker.position; 109 } 110 // since we can't cast to LatLngLiteral for reasons =( 111 if (marker.position.lat && marker.position.lng) { 112 return new google.maps.LatLng(marker.position.lat, marker.position.lng); 113 } 114 } 115 return new google.maps.LatLng(null); 116 } 117 return marker.getPosition(); 118 } 119 static getVisible(marker) { 120 if (this.isAdvancedMarker(marker)) { 121 /** 122 * Always return true for Advanced Markers because the clusterer 123 * uses getVisible as a way to count legacy markers not as an actual 124 * indicator of visibility for some reason. Even when markers are hidden 125 * Marker.getVisible returns `true` and this is used to set the marker count 126 * on the cluster. See the behavior of Cluster.count 127 */ 128 return true; 129 } 130 return marker.getVisible(); 131 } 132} 133 134/** 135 * Copyright 2021 Google LLC 136 * 137 * Licensed under the Apache License, Version 2.0 (the "License"); 138 * you may not use this file except in compliance with the License. 139 * You may obtain a copy of the License at 140 * 141 * http://www.apache.org/licenses/LICENSE-2.0 142 * 143 * Unless required by applicable law or agreed to in writing, software 144 * distributed under the License is distributed on an "AS IS" BASIS, 145 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 146 * See the License for the specific language governing permissions and 147 * limitations under the License. 148 */ 149class Cluster { 150 constructor({ markers, position }) { 151 this.markers = markers; 152 if (position) { 153 if (position instanceof google.maps.LatLng) { 154 this._position = position; 155 } 156 else { 157 this._position = new google.maps.LatLng(position); 158 } 159 } 160 } 161 get bounds() { 162 if (this.markers.length === 0 && !this._position) { 163 return; 164 } 165 const bounds = new google.maps.LatLngBounds(this._position, this._position); 166 for (const marker of this.markers) { 167 bounds.extend(MarkerUtils.getPosition(marker)); 168 } 169 return bounds; 170 } 171 get position() { 172 return this._position || this.bounds.getCenter(); 173 } 174 /** 175 * Get the count of **visible** markers. 176 */ 177 get count() { 178 return this.markers.filter((m) => MarkerUtils.getVisible(m)).length; 179 } 180 /** 181 * Add a marker to the cluster. 182 */ 183 push(marker) { 184 this.markers.push(marker); 185 } 186 /** 187 * Cleanup references and remove marker from map. 188 */ 189 delete() { 190 if (this.marker) { 191 MarkerUtils.setMap(this.marker, null); 192 this.marker = undefined; 193 } 194 this.markers.length = 0; 195 } 196} 197 198/** 199 * Copyright 2021 Google LLC 200 * 201 * Licensed under the Apache License, Version 2.0 (the "License"); 202 * you may not use this file except in compliance with the License. 203 * You may obtain a copy of the License at 204 * 205 * http://www.apache.org/licenses/LICENSE-2.0 206 * 207 * Unless required by applicable law or agreed to in writing, software 208 * distributed under the License is distributed on an "AS IS" BASIS, 209 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 210 * See the License for the specific language governing permissions and 211 * limitations under the License. 212 */ 213/** 214 * Returns the markers visible in a padded map viewport 215 * 216 * @param map 217 * @param mapCanvasProjection 218 * @param markers The list of marker to filter 219 * @param viewportPaddingPixels The padding in pixel 220 * @returns The list of markers in the padded viewport 221 */ 222const filterMarkersToPaddedViewport = (map, mapCanvasProjection, markers, viewportPaddingPixels) => { 223 const extendedMapBounds = extendBoundsToPaddedViewport(map.getBounds(), mapCanvasProjection, viewportPaddingPixels); 224 return markers.filter((marker) => extendedMapBounds.contains(MarkerUtils.getPosition(marker))); 225}; 226/** 227 * Extends a bounds by a number of pixels in each direction 228 */ 229const extendBoundsToPaddedViewport = (bounds, projection, numPixels) => { 230 const { northEast, southWest } = latLngBoundsToPixelBounds(bounds, projection); 231 const extendedPixelBounds = extendPixelBounds({ northEast, southWest }, numPixels); 232 return pixelBoundsToLatLngBounds(extendedPixelBounds, projection); 233}; 234/** 235 * Gets the extended bounds as a bbox [westLng, southLat, eastLng, northLat] 236 */ 237const getPaddedViewport = (bounds, projection, pixels) => { 238 const extended = extendBoundsToPaddedViewport(bounds, projection, pixels); 239 const ne = extended.getNorthEast(); 240 const sw = extended.getSouthWest(); 241 return [sw.lng(), sw.lat(), ne.lng(), ne.lat()]; 242}; 243/** 244 * Returns the distance between 2 positions. 245 * 246 * @hidden 247 */ 248const distanceBetweenPoints = (p1, p2) => { 249 const R = 6371; // Radius of the Earth in km 250 const dLat = ((p2.lat - p1.lat) * Math.PI) / 180; 251 const dLon = ((p2.lng - p1.lng) * Math.PI) / 180; 252 const sinDLat = Math.sin(dLat / 2); 253 const sinDLon = Math.sin(dLon / 2); 254 const a = sinDLat * sinDLat + 255 Math.cos((p1.lat * Math.PI) / 180) * 256 Math.cos((p2.lat * Math.PI) / 180) * 257 sinDLon * 258 sinDLon; 259 const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); 260 return R * c; 261}; 262/** 263 * Converts a LatLng bound to pixels. 264 * 265 * @hidden 266 */ 267const latLngBoundsToPixelBounds = (bounds, projection) => { 268 return { 269 northEast: projection.fromLatLngToDivPixel(bounds.getNorthEast()), 270 southWest: projection.fromLatLngToDivPixel(bounds.getSouthWest()), 271 }; 272}; 273/** 274 * Extends a pixel bounds by numPixels in all directions. 275 * 276 * @hidden 277 */ 278const extendPixelBounds = ({ northEast, southWest }, numPixels) => { 279 northEast.x += numPixels; 280 northEast.y -= numPixels; 281 southWest.x -= numPixels; 282 southWest.y += numPixels; 283 return { northEast, southWest }; 284}; 285/** 286 * @hidden 287 */ 288const pixelBoundsToLatLngBounds = ({ northEast, southWest }, projection) => { 289 const sw = projection.fromDivPixelToLatLng(southWest); 290 const ne = projection.fromDivPixelToLatLng(northEast); 291 return new google.maps.LatLngBounds(sw, ne); 292}; 293 294/** 295 * Copyright 2021 Google LLC 296 * 297 * Licensed under the Apache License, Version 2.0 (the "License"); 298 * you may not use this file except in compliance with the License. 299 * You may obtain a copy of the License at 300 * 301 * http://www.apache.org/licenses/LICENSE-2.0 302 * 303 * Unless required by applicable law or agreed to in writing, software 304 * distributed under the License is distributed on an "AS IS" BASIS, 305 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 306 * See the License for the specific language governing permissions and 307 * limitations under the License. 308 */ 309/** 310 * @hidden 311 */ 312class AbstractAlgorithm { 313 constructor({ maxZoom = 16 }) { 314 this.maxZoom = maxZoom; 315 } 316 /** 317 * Helper function to bypass clustering based upon some map state such as 318 * zoom, number of markers, etc. 319 * 320 * ```typescript 321 * cluster({markers, map}: AlgorithmInput): Cluster[] { 322 * if (shouldBypassClustering(map)) { 323 * return this.noop({markers}) 324 * } 325 * } 326 * ``` 327 */ 328 noop({ markers, }) { 329 return noop(markers); 330 } 331} 332/** 333 * Abstract viewport algorithm proves a class to filter markers by a padded 334 * viewport. This is a common optimization. 335 * 336 * @hidden 337 */ 338class AbstractViewportAlgorithm extends AbstractAlgorithm { 339 constructor(_a) { 340 var { viewportPadding = 60 } = _a, options = __rest(_a, ["viewportPadding"]); 341 super(options); 342 this.viewportPadding = 60; 343 this.viewportPadding = viewportPadding; 344 } 345 calculate({ markers, map, mapCanvasProjection, }) { 346 if (map.getZoom() >= this.maxZoom) { 347 return { 348 clusters: this.noop({ 349 markers, 350 }), 351 changed: false, 352 }; 353 } 354 return { 355 clusters: this.cluster({ 356 markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding), 357 map, 358 mapCanvasProjection, 359 }), 360 }; 361 } 362} 363/** 364 * @hidden 365 */ 366const noop = (markers) => { 367 const clusters = markers.map((marker) => new Cluster({ 368 position: MarkerUtils.getPosition(marker), 369 markers: [marker], 370 })); 371 return clusters; 372}; 373 374/** 375 * Copyright 2021 Google LLC 376 * 377 * Licensed under the Apache License, Version 2.0 (the "License"); 378 * you may not use this file except in compliance with the License. 379 * You may obtain a copy of the License at 380 * 381 * http://www.apache.org/licenses/LICENSE-2.0 382 * 383 * Unless required by applicable law or agreed to in writing, software 384 * distributed under the License is distributed on an "AS IS" BASIS, 385 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 386 * See the License for the specific language governing permissions and 387 * limitations under the License. 388 */ 389/** 390 * The default Grid algorithm historically used in Google Maps marker 391 * clustering. 392 * 393 * The Grid algorithm does not implement caching and markers may flash as the 394 * viewport changes. Instead use {@link SuperClusterAlgorithm}. 395 */ 396class GridAlgorithm extends AbstractViewportAlgorithm { 397 constructor(_a) { 398 var { maxDistance = 40000, gridSize = 40 } = _a, options = __rest(_a, ["maxDistance", "gridSize"]); 399 super(options); 400 this.clusters = []; 401 this.state = { zoom: -1 }; 402 this.maxDistance = maxDistance; 403 this.gridSize = gridSize; 404 } 405 calculate({ markers, map, mapCanvasProjection, }) { 406 const state = { zoom: map.getZoom() }; 407 let changed = false; 408 if (this.state.zoom >= this.maxZoom && state.zoom >= this.maxZoom) ; 409 else { 410 changed = !fast_deep_equal__WEBPACK_IMPORTED_MODULE_0___default()(this.state, state); 411 } 412 this.state = state; 413 if (map.getZoom() >= this.maxZoom) { 414 return { 415 clusters: this.noop({ 416 markers, 417 }), 418 changed, 419 }; 420 } 421 return { 422 clusters: this.cluster({ 423 markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding), 424 map, 425 mapCanvasProjection, 426 }), 427 }; 428 } 429 cluster({ markers, map, mapCanvasProjection, }) { 430 this.clusters = []; 431 markers.forEach((marker) => { 432 this.addToClosestCluster(marker, map, mapCanvasProjection); 433 }); 434 return this.clusters; 435 } 436 addToClosestCluster(marker, map, projection) { 437 let maxDistance = this.maxDistance; // Some large number 438 let cluster = null; 439 for (let i = 0; i < this.clusters.length; i++) { 440 const candidate = this.clusters[i]; 441 const distance = distanceBetweenPoints(candidate.bounds.getCenter().toJSON(), MarkerUtils.getPosition(marker).toJSON()); 442 if (distance < maxDistance) { 443 maxDistance = distance; 444 cluster = candidate; 445 } 446 } 447 if (cluster && 448 extendBoundsToPaddedViewport(cluster.bounds, projection, this.gridSize).contains(MarkerUtils.getPosition(marker))) { 449 cluster.push(marker); 450 } 451 else { 452 const cluster = new Cluster({ markers: [marker] }); 453 this.clusters.push(cluster); 454 } 455 } 456} 457 458/** 459 * Copyright 2021 Google LLC 460 * 461 * Licensed under the Apache License, Version 2.0 (the "License"); 462 * you may not use this file except in compliance with the License. 463 * You may obtain a copy of the License at 464 * 465 * http://www.apache.org/licenses/LICENSE-2.0 466 * 467 * Unless required by applicable law or agreed to in writing, software 468 * distributed under the License is distributed on an "AS IS" BASIS, 469 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 470 * See the License for the specific language governing permissions and 471 * limitations under the License. 472 */ 473/** 474 * Noop algorithm does not generate any clusters or filter markers by the an extended viewport. 475 */ 476class NoopAlgorithm extends AbstractAlgorithm { 477 constructor(_a) { 478 var options = __rest(_a, []); 479 super(options); 480 } 481 calculate({ markers, map, mapCanvasProjection, }) { 482 return { 483 clusters: this.cluster({ markers, map, mapCanvasProjection }), 484 changed: false, 485 }; 486 } 487 cluster(input) { 488 return this.noop(input); 489 } 490} 491 492/** 493 * Copyright 2021 Google LLC 494 * 495 * Licensed under the Apache License, Version 2.0 (the "License"); 496 * you may not use this file except in compliance with the License. 497 * You may obtain a copy of the License at 498 * 499 * http://www.apache.org/licenses/LICENSE-2.0 500 * 501 * Unless required by applicable law or agreed to in writing, software 502 * distributed under the License is distributed on an "AS IS" BASIS, 503 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 504 * See the License for the specific language governing permissions and 505 * limitations under the License. 506 */ 507/** 508 * A very fast JavaScript algorithm for geospatial point clustering using KD trees. 509 * 510 * @see https://www.npmjs.com/package/supercluster for more information on options. 511 */ 512class SuperClusterAlgorithm extends AbstractAlgorithm { 513 constructor(_a) { 514 var { maxZoom, radius = 60 } = _a, options = __rest(_a, ["maxZoom", "radius"]); 515 super({ maxZoom }); 516 this.state = { zoom: -1 }; 517 this.superCluster = new supercluster__WEBPACK_IMPORTED_MODULE_1__["default"](Object.assign({ maxZoom: this.maxZoom, radius }, options)); 518 } 519 calculate(input) { 520 let changed = false; 521 const state = { zoom: input.map.getZoom() }; 522 if (!fast_deep_equal__WEBPACK_IMPORTED_MODULE_0___default()(input.markers, this.markers)) { 523 changed = true; 524 // TODO use proxy to avoid copy? 525 this.markers = [...input.markers]; 526 const points = this.markers.map((marker) => { 527 const position = MarkerUtils.getPosition(marker); 528 const coordinates = [position.lng(), position.lat()]; 529 return { 530 type: "Feature", 531 geometry: { 532 type: "Point", 533 coordinates, 534 }, 535 properties: { marker }, 536 }; 537 }); 538 this.superCluster.load(points); 539 } 540 if (!changed) { 541 if (this.state.zoom <= this.maxZoom || state.zoom <= this.maxZoom) { 542 changed = !fast_deep_equal__WEBPACK_IMPORTED_MODULE_0___default()(this.state, state); 543 } 544 } 545 this.state = state; 546 if (changed) { 547 this.clusters = this.cluster(input); 548 } 549 return { clusters: this.clusters, changed }; 550 } 551 cluster({ map }) { 552 return this.superCluster 553 .getClusters([-180, -90, 180, 90], Math.round(map.getZoom())) 554 .map((feature) => this.transformCluster(feature)); 555 } 556 transformCluster({ geometry: { coordinates: [lng, lat], }, properties, }) { 557 if (properties.cluster) { 558 return new Cluster({ 559 markers: this.superCluster 560 .getLeaves(properties.cluster_id, Infinity) 561 .map((leaf) => leaf.properties.marker), 562 position: { lat, lng }, 563 }); 564 } 565 const marker = properties.marker; 566 return new Cluster({ 567 markers: [marker], 568 position: MarkerUtils.getPosition(marker), 569 }); 570 } 571} 572 573/** 574 * Copyright 2021 Google LLC 575 * 576 * Licensed under the Apache License, Version 2.0 (the "License"); 577 * you may not use this file except in compliance with the License. 578 * You may obtain a copy of the License at 579 * 580 * http://www.apache.org/licenses/LICENSE-2.0 581 * 582 * Unless required by applicable law or agreed to in writing, software 583 * distributed under the License is distributed on an "AS IS" BASIS, 584 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 585 * See the License for the specific language governing permissions and 586 * limitations under the License. 587 */ 588/** 589 * A very fast JavaScript algorithm for geospatial point clustering using KD trees. 590 * 591 * @see https://www.npmjs.com/package/supercluster for more information on options. 592 */ 593class SuperClusterViewportAlgorithm extends AbstractViewportAlgorithm { 594 constructor(_a) { 595 var { maxZoom, radius = 60, viewportPadding = 60 } = _a, options = __rest(_a, ["maxZoom", "radius", "viewportPadding"]); 596 super({ maxZoom, viewportPadding }); 597 this.superCluster = new supercluster__WEBPACK_IMPORTED_MODULE_1__["default"](Object.assign({ maxZoom: this.maxZoom, radius }, options)); 598 this.state = { zoom: -1, view: [0, 0, 0, 0] }; 599 } 600 calculate(input) { 601 const state = { 602 zoom: Math.round(input.map.getZoom()), 603 view: getPaddedViewport(input.map.getBounds(), input.mapCanvasProjection, this.viewportPadding), 604 }; 605 let changed = !fast_deep_equal__WEBPACK_IMPORTED_MODULE_0___default()(this.state, state); 606 if (!fast_deep_equal__WEBPACK_IMPORTED_MODULE_0___default()(input.markers, this.markers)) { 607 changed = true; 608 // TODO use proxy to avoid copy? 609 this.markers = [...input.markers]; 610 const points = this.markers.map((marker) => { 611 const position = MarkerUtils.getPosition(marker); 612 const coordinates = [position.lng(), position.lat()]; 613 return { 614 type: "Feature", 615 geometry: { 616 type: "Point", 617 coordinates, 618 }, 619 properties: { marker }, 620 }; 621 }); 622 this.superCluster.load(points); 623 } 624 if (changed) { 625 this.clusters = this.cluster(input); 626 this.state = state; 627 } 628 return { clusters: this.clusters, changed }; 629 } 630 cluster({ map, mapCanvasProjection }) { 631 /* recalculate new state because we can't use the cached version. */ 632 const state = { 633 zoom: Math.round(map.getZoom()), 634 view: getPaddedViewport(map.getBounds(), mapCanvasProjection, this.viewportPadding), 635 }; 636 return this.superCluster 637 .getClusters(state.view, state.zoom) 638 .map((feature) => this.transformCluster(feature)); 639 } 640 transformCluster({ geometry: { coordinates: [lng, lat], }, properties, }) { 641 if (properties.cluster) { 642 return new Cluster({ 643 markers: this.superCluster 644 .getLeaves(properties.cluster_id, Infinity) 645 .map((leaf) => leaf.properties.marker), 646 position: { lat, lng }, 647 }); 648 } 649 const marker = properties.marker; 650 return new Cluster({ 651 markers: [marker], 652 position: MarkerUtils.getPosition(marker), 653 }); 654 } 655} 656 657/** 658 * Copyright 2021 Google LLC 659 * 660 * Licensed under the Apache License, Version 2.0 (the "License"); 661 * you may not use this file except in compliance with the License. 662 * You may obtain a copy of the License at 663 * 664 * http://www.apache.org/licenses/LICENSE-2.0 665 * 666 * Unless required by applicable law or agreed to in writing, software 667 * distributed under the License is distributed on an "AS IS" BASIS, 668 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 669 * See the License for the specific language governing permissions and 670 * limitations under the License. 671 */ 672/** 673 * Provides statistics on all clusters in the current render cycle for use in {@link Renderer.render}. 674 */ 675class ClusterStats { 676 constructor(markers, clusters) { 677 this.markers = { sum: markers.length }; 678 const clusterMarkerCounts = clusters.map((a) => a.count); 679 const clusterMarkerSum = clusterMarkerCounts.reduce((a, b) => a + b, 0); 680 this.clusters = { 681 count: clusters.length, 682 markers: { 683 mean: clusterMarkerSum / clusters.length, 684 sum: clusterMarkerSum, 685 min: Math.min(...clusterMarkerCounts), 686 max: Math.max(...clusterMarkerCounts), 687 }, 688 }; 689 } 690} 691class DefaultRenderer { 692 /** 693 * The default render function for the library used by {@link MarkerClusterer}. 694 * 695 * Currently set to use the following: 696 * 697 * ```typescript 698 * // change color if this cluster has more markers than the mean cluster 699 * const color = 700 * count > Math.max(10, stats.clusters.markers.mean) 701 * ? "#ff0000" 702 * : "#0000ff"; 703 * 704 * // create svg url with fill color 705 * const svg = window.btoa(` 706 * <svg fill="${color}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"> 707 * <circle cx="120" cy="120" opacity=".6" r="70" /> 708 * <circle cx="120" cy="120" opacity=".3" r="90" /> 709 * <circle cx="120" cy="120" opacity=".2" r="110" /> 710 * <circle cx="120" cy="120" opacity=".1" r="130" /> 711 * </svg>`); 712 * 713 * // create marker using svg icon 714 * return new google.maps.Marker({ 715 * position, 716 * icon: { 717 * url: `data:image/svg+xml;base64,${svg}`, 718 * scaledSize: new google.maps.Size(45, 45), 719 * }, 720 * label: { 721 * text: String(count), 722 * color: "rgba(255,255,255,0.9)", 723 * fontSize: "12px", 724 * }, 725 * // adjust zIndex to be above other markers 726 * zIndex: 1000 + count, 727 * }); 728 * ``` 729 */ 730 render({ count, position }, stats, map) { 731 // change color if this cluster has more markers than the mean cluster 732 const color = count > Math.max(10, stats.clusters.markers.mean) ? "#ff0000" : "#0000ff"; 733 // create svg literal with fill color 734 const svg = `<svg fill="${color}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50"> 735<circle cx="120" cy="120" opacity=".6" r="70" /> 736<circle cx="120" cy="120" opacity=".3" r="90" /> 737<circle cx="120" cy="120" opacity=".2" r="110" /> 738<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${count}</text> 739</svg>`; 740 const title = `Cluster of ${count} markers`, 741 // adjust zIndex to be above other markers 742 zIndex = Number(google.maps.Marker.MAX_ZINDEX) + count; 743 if (MarkerUtils.isAdvancedMarkerAvailable(map)) { 744 // create cluster SVG element 745 const parser = new DOMParser(); 746 const svgEl = parser.parseFromString(svg, "image/svg+xml").documentElement; 747 svgEl.setAttribute("transform", "translate(0 25)"); 748 const clusterOptions = { 749 map, 750 position, 751 zIndex, 752 title, 753 content: svgEl, 754 }; 755 return new google.maps.marker.AdvancedMarkerElement(clusterOptions); 756 } 757 const clusterOptions = { 758 position, 759 zIndex, 760 title, 761 icon: { 762 url: `data:image/svg+xml;base64,${btoa(svg)}`, 763 anchor: new google.maps.Point(25, 25), 764 }, 765 }; 766 return new google.maps.Marker(clusterOptions); 767 } 768} 769 770/** 771 * Copyright 2019 Google LLC. All Rights Reserved. 772 * 773 * Licensed under the Apache License, Version 2.0 (the "License"); 774 * you may not use this file except in compliance with the License. 775 * You may obtain a copy of the License at 776 * 777 * http://www.apache.org/licenses/LICENSE-2.0 778 * 779 * Unless required by applicable law or agreed to in writing, software 780 * distributed under the License is distributed on an "AS IS" BASIS, 781 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 782 * See the License for the specific language governing permissions and 783 * limitations under the License. 784 */ 785/** 786 * Extends an object's prototype by another's. 787 * 788 * @param type1 The Type to be extended. 789 * @param type2 The Type to extend with. 790 * @ignore 791 */ 792// eslint-disable-next-line @typescript-eslint/no-explicit-any 793function extend(type1, type2) { 794 /* istanbul ignore next */ 795 // eslint-disable-next-line prefer-const 796 for (let property in type2.prototype) { 797 type1.prototype[property] = type2.prototype[property]; 798 } 799} 800/** 801 * @ignore 802 */ 803class OverlayViewSafe { 804 constructor() { 805 // MarkerClusterer implements google.maps.OverlayView interface. We use the 806 // extend function to extend MarkerClusterer with google.maps.OverlayView 807 // because it might not always be available when the code is defined so we 808 // look for it at the last possible moment. If it doesn't exist now then 809 // there is no point going ahead :) 810 extend(OverlayViewSafe, google.maps.OverlayView); 811 } 812} 813 814/** 815 * Copyright 2021 Google LLC 816 * 817 * Licensed under the Apache License, Version 2.0 (the "License"); 818 * you may not use this file except in compliance with the License. 819 * You may obtain a copy of the License at 820 * 821 * http://www.apache.org/licenses/LICENSE-2.0 822 * 823 * Unless required by applicable law or agreed to in writing, software 824 * distributed under the License is distributed on an "AS IS" BASIS, 825 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 826 * See the License for the specific language governing permissions and 827 * limitations under the License. 828 */ 829var MarkerClustererEvents; 830(function (MarkerClustererEvents) { 831 MarkerClustererEvents["CLUSTERING_BEGIN"] = "clusteringbegin"; 832 MarkerClustererEvents["CLUSTERING_END"] = "clusteringend"; 833 MarkerClustererEvents["CLUSTER_CLICK"] = "click"; 834})(MarkerClustererEvents || (MarkerClustererEvents = {})); 835const defaultOnClusterClickHandler = (_, cluster, map) => { 836 map.fitBounds(cluster.bounds); 837}; 838/** 839 * MarkerClusterer creates and manages per-zoom-level clusters for large amounts 840 * of markers. See {@link MarkerClustererOptions} for more details. 841 * 842 */ 843class MarkerClusterer extends OverlayViewSafe { 844 constructor({ map, markers = [], algorithmOptions = {}, algorithm = new SuperClusterAlgorithm(algorithmOptions), renderer = new DefaultRenderer(), onClusterClick = defaultOnClusterClickHandler, }) { 845 super(); 846 this.markers = [...markers]; 847 this.clusters = []; 848 this.algorithm = algorithm; 849 this.renderer = renderer; 850 this.onClusterClick = onClusterClick; 851 if (map) { 852 this.setMap(map); 853 } 854 } 855 addMarker(marker, noDraw) { 856 if (this.markers.includes(marker)) { 857 return; 858 } 859 this.markers.push(marker); 860 if (!noDraw) { 861 this.render(); 862 } 863 } 864 addMarkers(markers, noDraw) { 865 markers.forEach((marker) => { 866 this.addMarker(marker, true); 867 }); 868 if (!noDraw) { 869 this.render(); 870 } 871 } 872 removeMarker(marker, noDraw) { 873 const index = this.markers.indexOf(marker); 874 if (index === -1) { 875 // Marker is not in our list of markers, so do nothing: 876 return false; 877 } 878 MarkerUtils.setMap(marker, null); 879 this.markers.splice(index, 1); // Remove the marker from the list of managed markers 880 if (!noDraw) { 881 this.render(); 882 } 883 return true; 884 } 885 removeMarkers(markers, noDraw) { 886 let removed = false; 887 markers.forEach((marker) => { 888 removed = this.removeMarker(marker, true) || removed; 889 }); 890 if (removed && !noDraw) { 891 this.render(); 892 } 893 return removed; 894 } 895 clearMarkers(noDraw) { 896 this.markers.length = 0; 897 if (!noDraw) { 898 this.render(); 899 } 900 } 901 /** 902 * Recalculates and draws all the marker clusters. 903 */ 904 render() { 905 const map = this.getMap(); 906 if (map instanceof google.maps.Map && map.getProjection()) { 907 google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_BEGIN, this); 908 const { clusters, changed } = this.algorithm.calculate({ 909 markers: this.markers, 910 map, 911 mapCanvasProjection: this.getProjection(), 912 }); 913 // Allow algorithms to return flag on whether the clusters/markers have changed. 914 if (changed || changed == undefined) { 915 // Accumulate the markers of the clusters composed of a single marker. 916 // Those clusters directly use the marker. 917 // Clusters with more than one markers use a group marker generated by a renderer. 918 const singleMarker = new Set(); 919 for (const cluster of clusters) { 920 if (cluster.markers.length == 1) { 921 singleMarker.add(cluster.markers[0]); 922 } 923 } 924 const groupMarkers = []; 925 // Iterate the clusters that are currently rendered. 926 for (const cluster of this.clusters) { 927 if (cluster.marker == null) { 928 continue; 929 } 930 if (cluster.markers.length == 1) { 931 if (!singleMarker.has(cluster.marker)) { 932 // The marker: 933 // - was previously rendered because it is from a cluster with 1 marker, 934 // - should no more be rendered as it is not in singleMarker. 935 MarkerUtils.setMap(cluster.marker, null); 936 } 937 } 938 else { 939 // Delay the removal of old group markers to avoid flickering. 940 groupMarkers.push(cluster.marker); 941 } 942 } 943 this.clusters = clusters; 944 this.renderClusters(); 945 // Delayed removal of the markers of the former groups. 946 requestAnimationFrame(() => groupMarkers.forEach((marker) => MarkerUtils.setMap(marker, null))); 947 } 948 google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_END, this); 949 } 950 } 951 onAdd() { 952 this.idleListener = this.getMap().addListener("idle", this.render.bind(this)); 953 this.render(); 954 } 955 onRemove() { 956 google.maps.event.removeListener(this.idleListener); 957 this.reset(); 958 } 959 reset() { 960 this.markers.forEach((marker) => MarkerUtils.setMap(marker, null)); 961 this.clusters.forEach((cluster) => cluster.delete()); 962 this.clusters = []; 963 } 964 renderClusters() { 965 // Generate stats to pass to renderers. 966 const stats = new ClusterStats(this.markers, this.clusters); 967 const map = this.getMap(); 968 this.clusters.forEach((cluster) => { 969 if (cluster.markers.length === 1) { 970 cluster.marker = cluster.markers[0]; 971 } 972 else { 973 // Generate the marker to represent the group. 974 cluster.marker = this.renderer.render(cluster, stats, map); 975 // Make sure all individual markers are removed from the map. 976 cluster.markers.forEach((marker) => MarkerUtils.setMap(marker, null)); 977 if (this.onClusterClick) { 978 cluster.marker.addListener("click", 979 /* istanbul ignore next */ 980 (event) => { 981 google.maps.event.trigger(this, MarkerClustererEvents.CLUSTER_CLICK, cluster); 982 this.onClusterClick(event, cluster, map); 983 }); 984 } 985 } 986 MarkerUtils.setMap(cluster.marker, map); 987 }); 988 } 989} 990 991 992//# sourceMappingURL=index.esm.js.map 993 994 995/***/ }), 996
997/***/ "./assets/js/gca_event-map-code.js": 998/*!*****************************************!*\ 999 !*** ./assets/js/gca_event-map-code.js ***! 1000 \*****************************************/ 1001/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 1002 1003"use strict"; 1004__webpack_require__.r(__webpack_exports__); 1005/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1006/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 1007/* harmony export */ }); 1008/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 1009/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1010/* harmony import */ var _googlemaps_markerclusterer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @googlemaps/markerclusterer */ "./node_modules/@googlemaps/markerclusterer/dist/index.esm.js"); 1011function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
vendor: 9,051 bytes, lines 1011-1012
1011 1012function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
vendor: 2,594 bytes, lines 1013-1035
1013function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 1014function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 1015function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } 1016function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 1017function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 1018function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 1019function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 1020function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 1021function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 1022function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 1023 1024 1025var MainMap = /*#__PURE__*/function () { 1026 function MainMap() { 1027 _classCallCheck(this, MainMap); 1028 this._init(); 1029 self = this; 1030 } 1031 return _createClass(MainMap, [{ 1032 key: "_init", 1033 value: function _init() { 1034 // drag to scroll 1035 var mouseDown = false;
1036 var startX, scrollLeft; 1037 var option_items_slider = document.querySelector('.js-gca_event-map .ul-wrap'); 1038 var startDragging = function startDragging(e) { 1039 mouseDown = true; 1040 startX = e.pageX - option_items_slider.offsetLeft; 1041 scrollLeft = option_items_slider.scrollLeft; 1042 }; 1043 var stopDragging = function stopDragging(e) { 1044 mouseDown = false; 1045 }; 1046 var move = function move(e) { 1047 e.preventDefault(); 1048 if (!mouseDown) { 1049 return; 1050 } 1051 var x = e.pageX - option_items_slider.offsetLeft; 1052 var scroll = x - startX; 1053 option_items_slider.scrollLeft = scrollLeft - scroll; 1054 }; 1055 1056 // Add the event listeners 1057 // option_items_slider_add_event_listener(selector); 1058 1059 function option_items_slider_add_event_listener() { 1060 option_items_slider.addEventListener('mousemove', move, false); 1061 option_items_slider.addEventListener('mousedown', startDragging, false); 1062 option_items_slider.addEventListener('mouseup', stopDragging, false); 1063 option_items_slider.addEventListener('mouseleave', stopDragging, false); 1064 } 1065 function option_items_slider_remove_event_listener() { 1066 option_items_slider.removeEventListener('mousemove', move, false); 1067 option_items_slider.removeEventListener('mousedown', startDragging, false); 1068 option_items_slider.removeEventListener('mouseup', stopDragging, false); 1069 option_items_slider.removeEventListener('mouseleave', stopDragging, false); 1070 } 1071 function dragSlider() { 1072 option_items_slider = document.querySelector('.js-gca_event-map .ul-wrap'); 1073 if (option_items_slider) { 1074 option_items_slider_add_event_listener(); 1075 } 1076 } 1077 dragSlider(); 1078 jquery__WEBPACK_IMPORTED_MODULE_0___default()('.js-gca_event-map').on('click', '.gca_event_map_detail .js-galery-list-item', function (e) { 1079 e.preventDefault(); 1080 var url = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('data-url'); 1081 var type = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('data-type'); 1082 var html = ''; 1083 if (type == 'video') { 1084 html = "<video src=\"".concat(url, "\" controls></video>"); 1085 } else { 1086 html = "<img src=\"".concat(url, "\" alt=\"galery-feature\">"); 1087 } 1088 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).closest('.details-galery').find('.galery-feature').html(html); 1089 }); 1090 var gcaAjaxSend = /*#__PURE__*/function () { 1091 var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(formData) { 1092 var button, 1093 _args = arguments; 1094 return _regeneratorRuntime().wrap(function _callee$(_context) { 1095 while (1) switch (_context.prev = _context.next) { 1096 case 0: 1097 button = _args.length > 1 && _args[1] !== undefined ? _args[1] : null; 1098 _context.next = 3; 1099 return jquery__WEBPACK_IMPORTED_MODULE_0___default().ajax({ 1100 type: "POST", 1101 dataType: "json", 1102 url: gca.ajaxurl, 1103 data: _objectSpread({ 1104 nonce: gca.nonce 1105 }, formData), 1106 success: function success(res) { 1107 if (button) { 1108 jquery__WEBPACK_IMPORTED_MODULE_0___default()(button).removeClass('disabled'); 1109 } 1110 return res; 1111 }, 1112 error: function error(x, xhr, e) { 1113 console.error(x, xhr, e); 1114 if (button) { 1115 jquery__WEBPACK_IMPORTED_MODULE_0___default()(button).removeClass('disabled'); 1116 } 1117 return { 1118 status: 0, 1119 message: 'Unexpected error' 1120 }; 1121 } 1122 }); 1123 case 3: 1124 return _context.abrupt("return", _context.sent); 1125 case 4: 1126 case "end": 1127 return _context.stop(); 1128 } 1129 }, _callee); 1130 })); 1131 return function gcaAjaxSend(_x) { 1132 return _ref.apply(this, arguments); 1133 }; 1134 }(); 1135 var gcaMapData = { 1136 google_map_api_key: 'AIzaSyAI47VcBDMx4v8V4vOaUiwXbtbRyBRJAWM', 1137 get_locale: 'en' 1138 }; 1139 jquery__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { 1140 var formData, res, loadMap; 1141 return _regeneratorRuntime().wrap(function _callee2$(_context2) { 1142 while (1) switch (_context2.prev = _context2.next) { 1143 case 0: 1144 loadMap = function _loadMap() { 1145 var apiKey = gcaMapData.google_map_api_key; 1146 var script = document.createElement('script');
1147 script.src = 'https://maps.googleapis.com/maps/api/js?key=' + apiKey + '&callback=initMap&libraries=places&language=' + gcaMapData.get_locale; 1148 script.defer = true; 1149 script.async = true; 1150 window.initMap = initMap; 1151 document.head.appendChild(script); 1152 }; 1153 if (!(jquery__WEBPACK_IMPORTED_MODULE_0___default()('.js-gca_event-map').length > 0)) { 1154 _context2.next = 8; 1155 break; 1156 } 1157 // loadMap(); 1158 formData = { 1159 action: 'gca_event_map', 1160 event_version: jquery__WEBPACK_IMPORTED_MODULE_0___default()('.js-gca_event-map [name="event_version"]').val() 1161 }; 1162 console.log(formData); 1163 _context2.next = 6; 1164 return gcaAjaxSend(formData); 1165 case 6: 1166 res = _context2.sent; 1167 if (res.status == 1) { 1168 gcaMapData.map_org_locations = res.data.map_org_locations; 1169 gcaMapData.map_org_center = res.data.map_org_center; 1170 gcaMapData.map_org_zoom = res.data.map_org_zoom; 1171 gcaMapData.map_org_zoom_location = res.data.map_org_zoom_location; 1172 gcaMapData.words = res.data.words; 1173 loadMap(); 1174 } else { 1175 console.error("Error loading map", res.message); 1176 } 1177 case 8: 1178 case "end": 1179 return _context2.stop(); 1180 } 1181 }, _callee2); 1182 }))); 1183 function initMap() { 1184 function isMobile() { 1185 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).width() <= 980) { 1186 return true; 1187 } 1188 return false; 1189 } 1190 var locations = gcaMapData.map_org_locations; 1191 var mapEl = document.getElementById("the_map"); 1192 if (mapEl == null) { 1193 return; 1194 } 1195 var zoom = Number(gcaMapData.map_org_zoom); 1196 if (zoom <= 0 || isNaN(zoom)) { 1197 zoom = 4; 1198 } 1199 var zoomResult = Number(gcaMapData.map_org_zoom_location); 1200 if (zoomResult <= 0 || isNaN(zoomResult)) { 1201 zoomResult = 14; 1202 } 1203 zoomResult = 12; 1204 var lngCenter = 0.01; 1205 var latCenter = 0.015; 1206 // Chișinău 1207 // https://www.google.com/maps/place/Chi%C8%99in%C4%83u/data=!4m2!3m1!1s0x40c97c3628b769a1:0x37d1d6305749dd3c?sa=X&ved=2ahUKEwj2sY2Pi_H4AhXlVfEDHdhLDScQ8gF6BAgCEAE 1208 var center = { 1209 lat: 46.789566, 1210 lng: 7.965492 1211 }; 1212 if (gcaMapData.map_org_center && gcaMapData.map_org_center.lat && gcaMapData.map_org_center.lng) { 1213 center = { 1214 lat: Number(gcaMapData.map_org_center.lat), 1215 lng: Number(gcaMapData.map_org_center.lng) 1216 }; 1217 } 1218 // if(!isMobile()){ 1219 // center.lng -= lngCenter; 1220 // } 1221 var markers = []; 1222 var map = new google.maps.Map(mapEl, { 1223 zoom: zoom, 1224 center: center, 1225 disableDefaultUI: true, 1226 zoomControl: true, 1227 styles: [{ 1228 "elementType": "geometry", 1229 "stylers": [{ 1230 "color": "#f5f5f5" 1231 }] 1232 }, { 1233 "elementType": "labels.icon", 1234 "stylers": [{ 1235 "visibility": "off" 1236 }] 1237 }, { 1238 "elementType": "labels.text.fill", 1239 "stylers": [{ 1240 "color": "#616161" 1241 }] 1242 }, { 1243 "elementType": "labels.text.stroke", 1244 "stylers": [{ 1245 "color": "#f5f5f5" 1246 }] 1247 }, { 1248 "featureType": "administrative.land_parcel", 1249 "elementType": "labels.text.fill", 1250 "stylers": [{ 1251 "color": "#bdbdbd" 1252 }] 1253 }, { 1254 "featureType": "poi", 1255 "elementType": "geometry", 1256 "stylers": [{ 1257 "color": "#eeeeee" 1258 }] 1259 }, { 1260 "featureType": "poi", 1261 "elementType": "labels.text.fill", 1262 "stylers": [{ 1263 "color": "#757575" 1264 }] 1265 }, { 1266 "featureType": "poi.park", 1267 "elementType": "geometry", 1268 "stylers": [{ 1269 "color": "#e5e5e5" 1270 }] 1271 }, { 1272 "featureType": "poi.park", 1273 "elementType": "labels.text.fill", 1274 "stylers": [{ 1275 "color": "#9e9e9e" 1276 }] 1277 }, { 1278 "featureType": "road", 1279 "elementType": "geometry", 1280 "stylers": [{ 1281 "color": "#ffffff" 1282 }] 1283 }, { 1284 "featureType": "road.arterial", 1285 "elementType": "labels.text.fill", 1286 "stylers": [{ 1287 "color": "#757575" 1288 }] 1289 }, { 1290 "featureType": "road.highway", 1291 "elementType": "geometry", 1292 "stylers": [{ 1293 "color": "#dadada" 1294 }] 1295 }, { 1296 "featureType": "road.highway", 1297 "elementType": "labels.text.fill", 1298 "stylers": [{ 1299 "color": "#616161" 1300 }] 1301 }, { 1302 "featureType": "road.local", 1303 "elementType": "labels.text.fill", 1304 "stylers": [{ 1305 "color": "#9e9e9e" 1306 }] 1307 }, { 1308 "featureType": "transit.line", 1309 "elementType": "geometry", 1310 "stylers": [{ 1311 "color": "#e5e5e5" 1312 }] 1313 }, { 1314 "featureType": "transit.station", 1315 "elementType": "geometry", 1316 "stylers": [{ 1317 "color": "#eeeeee" 1318 }] 1319 }, { 1320 "featureType": "water", 1321 "elementType": "geometry", 1322 "stylers": [{ 1323 "color": "#c9c9c9" 1324 }] 1325 }, { 1326 "featureType": "water", 1327 "elementType": "labels.text.fill", 1328 "stylers": [{ 1329 "color": "#9e9e9e" 1330 }] 1331 }] 1332 }); 1333 var svgMarkerPin = window.btoa("<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#111A30\"/></svg>"); 1334 var svgMarkerPinActive = window.btoa("<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#00D0AB\"/></svg>"); 1335 var svgMarkerPinInActive = window.btoa("<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#111A30\"/></svg>"); 1336 1337 // svgMarkerPinActive = svgMarkerPin; 1338 1339 var centerControlResultDiv = document.createElement("div"); 1340 centerControlResultDiv.classList.add('result');
1341 centerControlResultDiv.classList.add('org-list'); 1342 var centerControlResultDivHead = document.createElement("div"); 1343 centerControlResultDivHead.classList.add('result-div-head'); 1344 var centerControlResultDivBody = document.createElement("div"); 1345 centerControlResultDivBody.classList.add('result-div-body'); 1346 1347 // const centerControlResultDivFoot = document.createElement("div"); 1348 // centerControlResultDivFoot.classList.add('result-div-foot'); 1349 1350 // result header 1351 var centerControlResultHeader = document.createElement("div"); 1352 centerControlResultHeader.classList.add('result-header'); 1353 var centerControlResultHeaderBack = document.createElement("button"); 1354 centerControlResultHeaderBack.classList.add('back'); 1355 centerControlResultHeaderBack.innerHTML = '' + ' <svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">' + ' <circle cx="19" cy="19" r="19" fill="#F1F4FC"/>' + ' <path d="M9.29289 18.2929C8.90237 18.6834 8.90237 19.3166 9.29289 19.7071L15.6569 26.0711C16.0474 26.4616 16.6805 26.4616 17.0711 26.0711C17.4616 25.6805 17.4616 25.0474 17.0711 24.6569L11.4142 19L17.0711 13.3431C17.4616 12.9526 17.4616 12.3195 17.0711 11.9289C16.6805 11.5384 16.0474 11.5384 15.6569 11.9289L9.29289 18.2929ZM29 18L10 18V20L29 20V18Z" fill="#8997BC"/>' + ' </svg>'; 1356 centerControlResultHeaderBack.addEventListener("click", function () { 1357 controlCloseResult(); 1358 }); 1359 var centerControlResultHeaderClose = document.createElement("button"); 1360 centerControlResultHeaderClose.classList.add('close'); 1361 centerControlResultHeaderClose.innerHTML = "\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"1\" y=\"1\" width=\"30\" height=\"30\" rx=\"15\" fill=\"white\"/>\n <rect x=\"1\" y=\"1\" width=\"30\" height=\"30\" rx=\"15\" stroke=\"#E6E6E6\"/>\n <path d=\"M20 11.9988L11.9988 20.0012\" stroke=\"#1A1A1A\" stroke-linecap=\"square\" stroke-linejoin=\"round\"/>\n <path d=\"M20 20.0012L11.9988 11.9988\" stroke=\"#1A1A1A\" stroke-linecap=\"square\" stroke-linejoin=\"round\"/>\n </svg>\n "; 1362 centerControlResultHeaderClose.addEventListener("click", function () { 1363 controlCloseResult(); 1364 // if(isMobile()){ 1365 // controlCloseList(); 1366 // } 1367 }); 1368 var $scrollTop = 0; 1369 centerControlResultDivBody.addEventListener("scroll", function () { 1370 if (centerControlResultDivBody.scrollTop > $scrollTop) { 1371 centerControlResultHeaderClose.style.opacity = 0; 1372 } else { 1373 centerControlResultHeaderClose.style.opacity = 1; 1374 } 1375 $scrollTop = centerControlResultDivBody.scrollTop; 1376 }); 1377 1378 // centerControlResultHeader.appendChild(centerControlResultHeaderBack); 1379 centerControlResultHeader.appendChild(centerControlResultHeaderClose); 1380 1381 // result figure 1382 // const centerControlResultFigure = document.createElement("figure"); 1383 // centerControlResultFigure.classList.add('figure'); 1384 1385 // result title 1386 var centerControlResultTitle = document.createElement("div"); 1387 centerControlResultTitle.classList.add('result-title'); 1388 1389 // result actions_list 1390 // const centerControlResultActionsList = document.createElement("div"); 1391 // centerControlResultActionsList.classList.add('action_list'); 1392 1393 // result loader 1394 var centerControlResultLoader = document.createElement("div"); 1395 centerControlResultLoader.classList.add('result-loader'); 1396 centerControlResultLoader.classList.add('inline-loader'); 1397 centerControlResultLoader.innerHTML = '' + ' <div class="loader-inner">' + ' <div class="loader-image">' + ' <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin:auto;background:transparent;display:block;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><g transform="rotate(0 50 50)"><rect x="48" y="30.5" rx="2" ry="2.42" width="4" height="11" fill="#0e68d1"> <animate attributeName="opacity" values="1;0" keyTimes="0;
13971" dur="1s" begin="-0.875s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(45 50 50)"><rect x="48" y="30.5" rx="2" ry="2.42" width="4" height="11" fill="#0e68d1"> <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.75s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(90 50 50)"><rect x="48" y="30.5" rx="2" ry="2.42" width="4" height="11" fill="#0e68d1"> <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.625s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(135 50 50)"><rect x="48" y="30.5" rx="2" ry="2.42" width="4" height="11" fill="#0e68d1"> <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(180 50 50)"><rect x="48" y="30.5" rx="2" ry="2.42" width="4" height="11" fill="#0e68d1"> <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.375s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(225 50 50)"><rect x="48" y="30.5" rx="2" ry="2.42" width="4" height="11" fill="#0e68d1"> <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.25s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(270 50 50)"><rect x="48" y="30.5" rx="2" ry="2.42" width="4" height="11" fill="#0e68d1"> <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.125s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(315 50 50)"><rect x="48" y="30.5" rx="2" ry="2.42" width="4" height="11" fill="#0e68d1"> <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animate></rect></g></svg>' + ' </div>' + ' </div>'; 1398 var centerControlResultEventDetails = document.createElement("div"); 1399 centerControlResultEventDetails.classList.add('result-event-details'); 1400 // result box box-direction 1401 // const centerControlResultBoxDirection = document.createElement("div"); 1402 // centerControlResultBoxDirection.classList.add('box'); 1403 // centerControlResultBoxDirection.classList.add('box-direction'); 1404 1405 // const centerControlResultBoxDirectionInfo = document.createElement("div"); 1406 // centerControlResultBoxDirectionInfo.classList.add('box-info'); 1407 // centerControlResultBoxDirectionInfo.classList.add('icon-text'); 1408 1409 // const centerControlResultBoxDirectionInfoIcon = document.createElement("div"); 1410 // centerControlResultBoxDirectionInfoIcon.classList.add('icon'); 1411 // centerControlResultBoxDirectionInfoIcon.innerHTML = '' 1412 // +' <svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">' 1413 // +' <path d="M10.5 1.3125C8.58617 1.31476 6.75136 2.07603 5.39807 3.42932C4.04479 4.78261 3.28352 6.61741 3.28126 8.53125C3.27897 10.0952 3.78984 11.6168 4.73551 12.8625C4.73551 12.8625 4.93238 13.1217 4.96454 13.1591L10.5 19.6875L16.0381 13.1558C16.067 13.1211 16.2645 12.8625 16.2645 12.8625L16.2652 12.8605C17.2104 11.6154 17.721 10.0945 17.7188 8.53125C17.7165 6.61741 16.9552 4.78261 15.6019 3.42932C14.2487 2.07603 12.4138 1.31476 10.5 1.3125ZM10.5 11.1562C9.98083 11.1562 9.47331 11.0023 9.04164 10.7139C8.60996 10.4254 8.2735 10.0155 8.07482 9.53579C7.87614 9.05614 7.82416 8.52834 7.92545 8.01914C8.02673 7.50994 8.27674 7.04221 8.64385 6.67509C9.01096 6.30798 9.4787 6.05797 9.9879 5.95669C10.4971 5.8554 11.0249 5.90739 11.5046 6.10607C11.9842 6.30475 12.3942 6.6412 12.6826 7.07288C12.9711 7.50456 13.125 8.01207 13.125 8.53125C13.1241 9.22718 12.8473 9.89435 12.3552 10.3864C11.8631 10.8785 11.1959 11.1554 10.5 11.1562Z" fill="#FF0000"/>' 1414 // +' </svg>'; 1415 1416 // const centerControlResultBoxDirectionInfoText = document.createElement("div"); 1417 // centerControlResultBoxDirectionInfoText.classList.add('text'); 1418 1419 // centerControlResultBoxDirectionInfo.appendChild(centerControlResultBoxDirectionInfoIcon); 1420 // centerControlResultBoxDirectionInfo.appendChild(centerControlResultBoxDirectionInfoText); 1421 1422 // const centerControlResultBoxDirectionBtn = document.createElement("a"); 1423 // centerControlResultBoxDirectionBtn.classList.add('btn'); 1424 // centerControlResultBoxDirectionBtn.classList.add('icon-text'); 1425 // centerControlResultBoxDirectionBtn.innerHTML = '' 1426 // +' <div class="text">
1426'+gcaMapData.words.directions+'</div>' 1427 // +' <div class="icon">' 1428 // +' <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">' 1429 // +' <path d="M11.495 6.49498C11.7683 6.22161 11.7683 5.77839 11.495 5.50503L7.0402 1.05025C6.76684 0.776886 6.32362 0.776886 6.05025 1.05025C5.77689 1.32362 5.77689 1.76684 6.05025 2.0402L10.0101 6L6.05025 9.9598C5.77689 10.2332 5.77689 10.6764 6.05025 10.9497C6.32362 11.2231 6.76683 11.2231 7.0402 10.9497L11.495 6.49498ZM-6.11959e-08 6.7L11 6.7L11 5.3L6.11959e-08 5.3L-6.11959e-08 6.7Z" fill="white"/>' 1430 // +' </svg>' 1431 // +' </div>'; 1432 1433 // centerControlResultBoxDirection.appendChild(centerControlResultBoxDirectionInfo); 1434 // centerControlResultBoxDirection.appendChild(centerControlResultBoxDirectionBtn); 1435 1436 // result box box-Phone 1437 // const centerControlResultBoxPhone = document.createElement("div"); 1438 // centerControlResultBoxPhone.classList.add('box'); 1439 // centerControlResultBoxPhone.classList.add('box-phone'); 1440 1441 // const centerControlResultBoxPhoneInfo = document.createElement("div"); 1442 // centerControlResultBoxPhoneInfo.classList.add('box-info'); 1443 // centerControlResultBoxPhoneInfo.classList.add('icon-text'); 1444 1445 // const centerControlResultBoxPhoneInfoIcon = document.createElement("div"); 1446 // centerControlResultBoxPhoneInfoIcon.classList.add('icon'); 1447 // centerControlResultBoxPhoneInfoIcon.innerHTML = '' 1448 // +' <svg width="19" height="21" viewBox="0 0 19 21" fill="none" xmlns="http://www.w3.org/2000/svg">' 1449 // +' <path d="M6.95904 2.16936C7.34761 2.03083 7.76459 2.05384 8.14056 2.23457C8.51653 2.4153 8.82881 2.74283 9.02541 3.16266L9.09112 3.31911L9.67898 4.86366C9.85739 5.33246 9.9153 5.85295 9.84551 6.36036C9.77573 6.86778 9.58133 7.33975 9.28648 7.71756L9.16838 7.85616L8.2422 8.87781C8.07525 9.06471 8.20046 9.78816 8.8043 11.0251C9.34775 12.1381 9.78998 12.6578 10.0075 12.6862H10.0457L10.0928 12.6757L11.9132 12.0173C12.1578 11.9286 12.4189 11.9251 12.6652 12.0072C12.9115 12.0893 13.1326 12.2536 13.302 12.4804L13.3828 12.6011L14.5878 14.5751C14.824 14.962 14.9417 15.4325 14.9215 15.9091C14.9013 16.3856 14.7445 16.8399 14.4768 17.197L14.3685 17.3293L13.8872 17.869C13.455 18.3529 12.9144 18.68 12.3296 18.8112C11.7448 18.9424 11.1404 18.8723 10.5883 18.6092C8.87001 17.7902 7.30891 15.9191 5.89077 13.0148C4.46997 10.1032 3.87945 7.56531 4.14319 5.39181C4.223 4.73479 4.4518 4.11559 4.80531 3.59998C5.15882 3.08436 5.62383 2.69159 6.15096 2.46336L6.32234 2.39616L6.95904 2.16936Z" fill="#FF0000"/>' 1450 // +' </svg>'; 1451 1452 // const centerControlResultBoxPhoneInfoText = document.createElement("div"); 1453 // centerControlResultBoxPhoneInfoText.classList.add('text'); 1454 1455 // // centerControlResultBoxPhoneInfo.appendChild(centerControlResultBoxPhoneInfoIcon); 1456 // // centerControlResultBoxPhoneInfo.appendChild(centerControlResultBoxPhoneInfoText); 1457 1458 // const centerControlResultBoxPhoneBtn = document.createElement("a"); 1459 // centerControlResultBoxPhoneBtn.classList.add('btn'); 1460 // centerControlResultBoxPhoneBtn.classList.add('icon-text'); 1461 // centerControlResultBoxPhoneBtn.innerHTML = '' 1462 // +' <div class="text">'+gcaMapData.words.call+'</div>' 1463 // +' <div class="icon">' 1464 // +' <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">' 1465 // +' <path d="M11.495 6.49498C11.7683 6.22161 11.7683 5.77839 11.495 5.50503L7.0402 1.05025C6.76684 0.776886 6.32362 0.776886 6.05025 1.05025C5.77689 1.32362 5.77689 1.76684 6.05025 2.0402L10.0101 6L6.05025 9.9598C5.77689 10.2332 5.77689 10.6764 6.05025 10.9497C6.32362 11.2231 6.76683 11.2231 7.0402 10.9497L11.495 6.49498ZM-6.11959e-08 6.7L11 6.7L11 5.3L6.11959e-08 5.3L-6.11959e-08 6.7Z" fill="white"/>' 1466 // +' </svg>' 1467 // +' </div>'; 1468 1469 // // centerControlResultBoxPhone.appendChild(centerControlResultBoxPhoneInfo); 1470 // // centerControlResultBoxPhone.appendChild(centerControlResultBoxPhoneBtn); 1471 1472 // result footer text 1473 var centerControlResultFooter = document.createElement("div"); 1474 centerControlResultFooter.classList.add('footer-btns'); 1475 // centerControlResultFooter.innerHTML = '' 1476 // +'<div class="btns">' 1477 // +'<a href="#" class="btn btn-link alt">' 1478 // +' '+gcaMapData.words.learn_more 1479 // +'</a>' 1480 // +'</div>'; 1481 var centerControlResultFooterBtns = document.createElement("div"); 1482 centerControlResultFooterBtns.classList.add('btns'); 1483 var centerControlResultFooterLink = document.createElement("a"); 1484 centerControlResultFooterLink.classList.add('btn'); 1485 centerControlResultFooterLink.classList.add('btn-link'); 1486 centerControlResultFooterLink.classList.add('alt'); 1487 centerControlResultFooterLink.classList.add('btn-external-with-arrow'); 1488 centerControlResultFooterLink.innerHTML = "\n ".concat(gcaMapData.words.learn_more, "\n <div class=\"icon\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M13.75 6.41667L13.75 2.75001M13.7
14885 2.75001H10.0833M13.75 2.75001L8.25 8.25M7.02778 2.75C6.50274 2.75 5.68333 2.75 5.68333 2.75M13.75 9.47222C13.75 9.99726 13.75 10.8167 13.75 10.8167M13.75 10.8167C13.75 11.8434 13.75 12.3568 13.5502 12.749C13.3744 13.0939 13.0939 13.3744 12.749 13.5502C12.3568 13.75 11.8434 13.75 10.8167 13.75H5.68333C4.65657 13.75 4.14319 13.75 3.75102 13.5502C3.40605 13.3744 3.12559 13.0939 2.94982 12.749C2.75 12.3568 2.75 11.8434 2.75 10.8167V5.68333C2.75 4.65657 2.75 4.14319 2.94982 3.75102C3.12559 3.40605 3.40605 3.12559 3.75102 2.94982C4.14319 2.75 4.65657 2.75 5.68333 2.75M13.75 10.8167 13.75 10.8167ZM5.68333 2.75 5.68333 2.75Z\" stroke=\"#111213\" stroke-linecap=\"square\" stroke-linejoin=\"round\"></path>\n </svg>\n </div>\n "); 1489 centerControlResultFooterLink.target = '_blank'; 1490 centerControlResultFooterBtns.append(centerControlResultFooterLink); 1491 centerControlResultFooter.append(centerControlResultFooterBtns); 1492 1493 // add part to result div 1494 centerControlResultDivHead.appendChild(centerControlResultHeader); 1495 // // centerControlResultDivHead.appendChild(centerControlResultBoxDirection); 1496 // centerControlResultDivHead.appendChild(centerControlResultBoxPhone); 1497 1498 // centerControlResultDivBody.appendChild(centerControlResultFigure); 1499 centerControlResultDivBody.appendChild(centerControlResultTitle); 1500 // centerControlResultDivBody.appendChild(centerControlResultActionsList); 1501 centerControlResultDivBody.appendChild(centerControlResultLoader); 1502 centerControlResultDivBody.appendChild(centerControlResultEventDetails); 1503 1504 // centerControlResultDivFoot.appendChild(centerControlResultFooter); 1505 centerControlResultDiv.appendChild(centerControlResultDivHead); 1506 centerControlResultDiv.appendChild(centerControlResultDivBody); 1507 // centerControlResultDiv.appendChild(centerControlResultDivFoot); 1508 1509 var centerControlDiv = document.createElement("div"); 1510 centerControlDiv.classList.add('org-list'); 1511 // if(!isMobile()){ 1512 // centerControlDiv.classList.add('open'); 1513 // } 1514 // header 1515 var centerControlHeader = document.createElement("div"); 1516 centerControlHeader.classList.add('list-header'); 1517 var centerControlHeaderBack = document.createElement("div"); 1518 var centerControlHeaderClose = document.createElement("button"); 1519 centerControlHeaderClose.classList.add('close'); 1520 centerControlHeaderClose.innerHTML = '' + ' <svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">' + ' <circle cx="19" cy="19" r="19" fill="#F1F4FC"/>' + ' <path d="M24.9688 14L14 24.9688M14 14L24.9688 24.9688" stroke="#8997BC" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>' + ' </svg>'; 1521 centerControlHeaderClose.addEventListener("click", function () { 1522 controlCloseList(); 1523 }); 1524 centerControlHeader.appendChild(centerControlHeaderBack); 1525 centerControlHeader.appendChild(centerControlHeaderClose); 1526 // search box 1527 var controlSearch = document.createElement("div"); 1528 controlSearch.classList.add('search-box'); 1529 var controlSearchLabel = document.createElement("label"); 1530 var controlSearchInput = document.createElement("input"); 1531 controlSearchInput.type = 'text'; 1532 controlSearchInput.placeholder = gcaMapData.words.search_placeholder; 1533 controlSearchInput.addEventListener("keyup", debounce(function () { 1534 searching(controlSearchInput.value); 1535 })); 1536 controlSearchInput.addEventListener('paste', function () { 1537 controlSearchInput.dispatchEvent(new Event('keyup')); 1538 }); 1539 var controlSearchIcon = document.createElement("div"); 1540 controlSearchIcon.classList.add('icon'); 1541 controlSearchIcon.innerHTML = '' + ' <svg style="display:block;" width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">' + ' <path d="M20 20L15.514 15.506M18 9.5C18 11.7543 17.1045 13.9163 15.5104 15.5104C13.9163 17.1045 11.7543 18 9.5 18C7.24566 18 5.
154108365 17.1045 3.48959 15.5104C1.89553 13.9163 1 11.7543 1 9.5C1 7.24566 1.89553 5.08365 3.48959 3.48959C5.08365 1.89553 7.24566 1 9.5 1C11.7543 1 13.9163 1.89553 15.5104 3.48959C17.1045 5.08365 18 7.24566 18 9.5V9.5Z" stroke="#585858" stroke-width="2" stroke-linecap="round"/>' + ' </svg>'; 1542 controlSearchLabel.appendChild(controlSearchInput); 1543 controlSearchLabel.appendChild(controlSearchIcon); 1544 controlSearch.appendChild(controlSearchLabel); 1545 controlSearch.classList.add('search-box'); 1546 // 1547 var controlLists = document.createElement("div"); 1548 controlLists.classList.add('list'); 1549 var controlListOrgItemsEmpty = document.createElement("div"); 1550 controlListOrgItemsEmpty.classList.add('empty-items'); 1551 controlListOrgItemsEmpty.innerHTML = '' + '<div class="text">' + ' ' + gcaMapData.words.list_no_result + '</div>'; 1552 var controlListOrgItems = document.createElement("div"); 1553 controlListOrgItems.classList.add('items'); 1554 var locationsTemp = []; 1555 if (locations.length > 0) { 1556 var _loop = function _loop(i) { 1557 var pos = {}; 1558 var posCenter = {}; 1559 var marker = ''; 1560 if (locations[i].address_map && locations[i].address_map.lat && locations[i].address_map.lng) { 1561 pos = { 1562 lat: locations[i].address_map.lat, 1563 lng: locations[i].address_map.lng 1564 }; 1565 posCenter = { 1566 lat: locations[i].address_map.lat, 1567 lng: locations[i].address_map.lng 1568 }; 1569 // if(!isMobile()){ 1570 // posCenter.lng -= lngCenter; 1571 // } 1572 // else{ 1573 // // posCenter.lat -= latCenter; 1574 // } 1575 1576 var place_id = locations[i].address_map.place_id; 1577 var existed = false; 1578 if (locationsTemp.length > 0) { 1579 existed = locationsTemp.some(function (el) { 1580 return el.lat === locations[i].address_map.lat && el.lng === locations[i].address_map.lng; 1581 }); 1582 } 1583 if (!existed) { 1584 locationsTemp.push(_objectSpread(_objectSpread({}, pos), {}, { 1585 place_id: place_id 1586 })); 1587 marker = new google.maps.Marker({ 1588 position: pos, 1589 icon: { 1590 url: "data:image/svg+xml;base64,".concat(svgMarkerPin), 1591 scaledSize: new google.maps.Size(40, 40) 1592 } 1593 }); 1594 marker.addListener("click", function () { 1595 markers.map(function (marker) { 1596 marker.setIcon({ 1597 url: "data:image/svg+xml;base64,".concat(svgMarkerPinInActive), 1598 scaledSize: new google.maps.Size(40, 40) 1599 }); 1600 }); 1601 controlOpenResult(pos, posCenter, marker, locations[i]); 1602 }); 1603 markers.push(marker); 1604 } 1605 }
1606 // const controlListOrgItem = document.createElement("div"); 1607 // controlListOrgItem.classList.add('item'); 1608 // controlListOrgItem.innerHTML = '' 1609 // +' <div class="text" data-keysearch="'+locations[i].title+'">'+locations[i].title+'</div>' 1610 // +' <div class="icon">' 1611 // +' <svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">' 1612 // +' <rect width="38" height="38" rx="19" fill="url(#paint0_linear_1_300)"/>' 1613 // +' <path d="M26.7071 20.7071C27.0976 20.3166 27.0976 19.6834 26.7071 19.2929L20.3431 12.9289C19.9526 12.5384 19.3195 12.5384 18.9289 12.9289C18.5384 13.3195 18.5384 13.9526 18.9289 14.3431L24.5858 20L18.9289 25.6569C18.5384 26.0474 18.5384 26.6805 18.9289 27.0711C19.3195 27.4616 19.9526 27.4616 20.3431 27.0711L26.7071 20.7071ZM12 21L26 21L26 19L12 19L12 21Z" fill="white"/>' 1614 // +' <defs>' 1615 // +' <linearGradient id="paint0_linear_1_300" x1="7.54614e-07" y1="-9.77943" x2="41.8774" y2="-7.47006" gradientUnits="userSpaceOnUse">' 1616 // +' <stop stop-color="#FF0000"/>' 1617 // +' <stop offset="0.4875" stop-color="#FF4D4D"/>' 1618 // +' <stop offset="0.9999" stop-color="#FF0000"/>' 1619 // +' <stop offset="1" stop-color="#FF0000"/>' 1620 // +' </linearGradient>' 1621 // +' </defs>' 1622 // +' </svg>' 1623 // +' </div>'; 1624 // if(locations[i].address_map){ 1625 // } 1626 // controlListOrgItem.addEventListener("click", () => { 1627 // controlOpenResult(pos, posCenter, marker, locations[i]); 1628 // }); 1629 // controlListOrgItems.appendChild(controlListOrgItem);
1630 // const controlListOrgItemSep = document.createElement("div"); 1631 // controlListOrgItemSep.classList.add('item-sep'); 1632 // controlListOrgItems.appendChild(controlListOrgItemSep); 1633 }; 1634 for (var i = 0; i < locations.length; i++) { 1635 _loop(i); 1636 } 1637 } else { 1638 controlLists.classList.add('empty'); 1639 } 1640 var marker_svg = window.btoa("\n <svg fill=\"#111A30\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 240 240\">\n <circle cx=\"120\" cy=\"120\" opacity=\"1\" r=\"70\" />\n <circle cx=\"120\" cy=\"120\" opacity=\"0\" r=\"90\" />\n <circle cx=\"120\" cy=\"120\" opacity=\"1\" r=\"110\" />\n </svg>"); 1641 var marker_svg_hover = window.btoa("\n <svg fill=\"#00D0AB\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 240 240\">\n <circle cx=\"120\" cy=\"120\" opacity=\"1\" r=\"70\" />\n <circle cx=\"120\" cy=\"120\" opacity=\"0\" r=\"90\" />\n <circle cx=\"120\" cy=\"120\" opacity=\"1\" r=\"110\" />\n </svg>"); 1642 var renderer = { 1643 render: function render(_ref3, stats) { 1644 var count = _ref3.count, 1645 position = _ref3.position; 1646 // change color if this cluster has more markers than the mean cluster 1647 // const color = count > Math.max(10, stats.clusters.markers.mean) ? "#ff0000" : "#0000ff"; 1648 // create svg url with fill color 1649 var marker1 = { 1650 position: position, 1651 icon: { 1652 url: "data:image/svg+xml;base64,".concat(marker_svg), 1653 scaledSize: new google.maps.Size(40, 40), 1654 boxShadow: "0px 4px 32px rgba(17, 18, 19, 0.1)" 1655 }, 1656 label: { 1657 text: String(count), 1658 color: "#FFFFFF", 1659 fontSize: "14px" 1660 }, 1661 title: "Cluster of ".concat(count, " markers"), 1662 zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count 1663 }; 1664 1665 // const marker2 = { 1666 // position, 1667 // icon: { 1668 // url: `data:image/svg+xml;base64,${marker_svg_hover}`, 1669 // scaledSize: new google.maps.Size(40, 40), 1670 // boxShadow: `0px 4px 32px rgba(17, 18, 19, 0.1)`, 1671 // }, 1672 // label: { 1673 // text: String(count), 1674 // color: "#FFFFFF", 1675 // fontSize: "15px", 1676 // }, 1677 // title: `Cluster of ${count} markers`, 1678 // zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count, 1679 // } 1680 1681 var m = new google.maps.Marker(marker1); 1682 google.maps.event.addListener(m, 'mouseover', function () { 1683 m.setIcon({ 1684 url: "data:image/svg+xml;base64,".concat(marker_svg_hover), 1685 scaledSize: new google.maps.Size(40, 40), 1686 boxShadow: "0px 4px 32px rgba(17, 18, 19, 0.1)" 1687 }); 1688 m.label.color = "#FFFFFF"; 1689 }); 1690 google.maps.event.addListener(m, 'mouseout', function () { 1691 m.setIcon({ 1692 url: "data:image/svg+xml;base64,".concat(marker_svg), 1693 scaledSize: new google.maps.Size(40, 40), 1694 boxShadow: "0px 4px 32px rgba(17, 18, 19, 0.1)" 1695 }); 1696 m.label.color = "#FFFFFF"; 1697 }); 1698 return m; 1699 } 1700 }; 1701 new _googlemaps_markerclusterer__WEBPACK_IMPORTED_MODULE_1__.MarkerClusterer({ 1702 map: map, 1703 markers: markers, 1704 renderer: renderer 1705 }); 1706 centerControlDiv.appendChild(centerControlHeader); 1707 centerControlDiv.appendChild(controlSearch); 1708 controlLists.appendChild(controlListOrgItems); 1709 controlLists.appendChild(controlListOrgItemsEmpty); 1710 centerControlDiv.appendChild(controlLists); 1711 1712 // map.controls[google.maps.ControlPosition.LEFT_CENTER].push(centerControlDiv); 1713 map.controls[google.maps.ControlPosition.LEFT_CENTER].push(centerControlResultDiv); 1714 var controlSearchMobile = document.createElement("button"); 1715 controlSearchMobile.classList.add('btn'); 1716 controlSearchMobile.classList.add('search-mobile'); 1717 controlSearchMobile.innerHTML = '' + '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">' + '<path d="M18.375 18.375L14.4497 14.4428M16.625 9.1875C16.625 11.16 15.8414 13.0518 14.4466 14.4466C13.0518 15.8414 11.16 16.625 9.1875 16.625C7.21495 16.625 5.3232 15.8414 3.92839 14.4466C2.53359 13.0518 1.75 11.16 1.75 9.1875C1.75 7.21495 2.53359 5.3232 3.92839 3.92839C5.3232 2.53359 7.21495 1.75 9.1875 1.75C11.16 1.75 13.0518 2.53359 14.4466 3.92839C15.8414 5.3232 16.625 7.21495 16.625 9.1875V9.1875Z" stroke="#585858" stroke-width="2" stroke-linecap="round"/>' + '</svg>'; 1718 controlSearchMobile.addEventListener("click", function () { 1719 centerControlDiv.classList.add('open'); 1720 controlSearchMobile.classList.add('list-open'); 1721 }); 1722 1723 // map.controls[google.maps.ControlPosition.TOP_RIGHT].push(controlSearchMobile); 1724 1725 function controlCloseList() { 1726 centerControlResultDiv.classList.remove('open'); 1727 centerControlDiv.classList.remove('open'); 1728 controlSearchMobile.classList.remove('list-open'); 1729 } 1730 function controlCloseResult() { 1731 centerControlResultDiv.classList.remove('open'); 1732 if (markers.length > 0) { 1733 for (var _i = 0; _i < markers.length; _i++) { 1734 markers[_i].setIcon({ 1735 url: "data:image/svg+xml;base64,".concat(svgMarkerPin), 1736 scaledSize: new google.maps.Size(40, 40) 1737 }); 1738 } 1739 } 1740 document.body.classList.remove('gca_event-popup-open'); 1741 } 1742 function controlOpenResult(_x2, _x3, _x4, _x5) { 1743 return _controlOpenResult.apply(this, arguments); 1744 } 1745 function _controlOpenResult() { 1746 _controlOpenResult = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(pos, posCenter, marker, item) { 1747 var formData, res; 1748 return _regeneratorRuntime().wrap(function _callee3$(_context3) { 1749 while (1) switch (_context3.prev = _context3.next) { 1750 case 0: 1751 document.body.classList.add('gca_event-popup-open'); 1752 controlSearchMobile.classList.add('list-open'); 1753 centerControlResultDivBody.scrollTop = 0; 1754 1755 // map.setZoom(zoomResult); 1756 map.setCenter(posCenter); 1757 centerControlResultDiv.classList.add('open'); 1758 // if(item.logo){ 1759 // // centerControlResultFigure.innerHTML = `<img src="${item.logo.url}" alt="${item.logo.title}">`; 1760 // // centerControlResultFigure.style.display = "block"; 1761 // } 1762 // else{ 1763 // // centerControlResultFigure.style.display = "none"; 1764 // } 1765 centerControlResultTitle.innerHTML = item.title; 1766 // centerControlResultActionsList.innerHTML = ''; 1767 // if(item.website){ 1768 // centerControlResultDivFoot.style.display = "block"; 1769 // centerControlResultFooterLink.href = item.website; 1770 // } 1771 // else{ 1772 // centerControlResultDivFoot.style.display = "none"; 1773 // } 1774 1775 // // centerControlResultBoxDirectionBtn.target = "_blank"; 1776 // if(item.address_map.address){ 1777 // // centerControlResultBoxDirectionBtn.href = "https://www.google.com/maps/dir/My+Location/"+item.address_map.address+"?hl="+gcaMapData.get_locale; 1778 // } 1779 // else if(item.address_map.name){ 1780 // // centerControlResultBoxDirectionBtn.href = "https://www.google.com/maps/dir/My+Location/"+item.address_map.name+"?hl="+gcaMapData.get_locale; 1781 // } 1782 // else if(item.address_map.place_id){ 1783 // // centerControlResultBoxDirectionBtn.href = "https://www.google.com/maps/place/?q=place_id:"+item.address_map.place_id+"?hl="+gcaMapData.get_locale;; 1784 // } 1785 // else{ 1786 // // centerControlResultBoxDirectionBtn.href = "https://www.google.com/maps/place/"+pos.lat+","+pos.lng+"?hl="+gcaMapData.get_locale;; 1787 // } 1788 1789 marker.setIcon({ 1790 url: "data:image/svg+xml;base64,".concat(svgMarkerPinActive), 1791 scaledSize: new google.maps.Size(40, 40) 1792 }); 1793 centerControlResultLoader.style.display = 'block'; 1794 formData = { 1795 action: 'gca_event_map_detail', 1796 post_id: item.post_id 1797 }; 1798 centerControlResultEventDetails.innerHTML = ''; 1799 _context3.next = 12; 1800 return gcaAjaxSend(formData); 1801 case 12: 1802 res = _context3.sent; 1803 if (res.status == 1 && res.details_html) { 1804 // centerControlResultActionsList.innerHTML = res.actions_html; 1805 centerControlResultEventDetails.innerHTML = res.details_html; 1806 dragSlider(); 1807 } else { 1808 console.error("Error loading map", res.message); 1809 } 1810 centerControlResultLoader.style.display = 'none'; 1811 case 15: 1812 case "end": 1813 return _context3.stop(); 1814 } 1815 }, _callee3); 1816 })); 1817 return _controlOpenResult.apply(this, arguments); 1818 } 1819 function openPlaceUrl(pos) { 1820 var url = "https://www.google.com/maps/place/" + pos.lat + "," + pos.lng; 1821 window.open(url, "_blank"); 1822 } 1823 function searching() { 1824 var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 1825 s = s.toLocaleLowerCase().trim(); 1826 if (controlListOrgItems.childNodes.length > 0) { 1827 if (s != '') { 1828 var item_show_count = 0; 1829 for (var _i2 = 0; _i2 < controlListOrgItems.childNodes.length; _i2++) { 1830 var item_show = false;
1831 for (var j = 0; j < controlListOrgItems.children[_i2].children.length; j++) { 1832 if (controlListOrgItems.children[_i2].children[j].hasAttribute('data-keysearch')) { 1833 var keysearch = controlListOrgItems.children[_i2].children[j].getAttribute('data-keysearch').toLocaleLowerCase().trim(); 1834 if (keysearch.includes(s)) { 1835 item_show = true; 1836 } 1837 } 1838 } 1839 if (item_show) { 1840 controlListOrgItems.children[_i2].classList.remove('hide'); 1841 item_show_count++; 1842 } else { 1843 controlListOrgItems.children[_i2].classList.add('hide'); 1844 } 1845 } 1846 if (item_show_count <= 0) { 1847 controlLists.classList.add('empty'); 1848 } else { 1849 controlLists.classList.remove('empty'); 1850 } 1851 } else { 1852 controlLists.classList.remove('empty'); 1853 for (var _i3 = 0; _i3 < controlListOrgItems.childNodes.length; _i3++) { 1854 controlListOrgItems.children[_i3].classList.remove('hide'); 1855 } 1856 } 1857 } else { 1858 controlLists.classList.add('empty'); 1859 } 1860 } 1861 function debounce(func) { 1862 var timer; 1863 return function (event) { 1864 if (timer) clearTimeout(timer); 1865 timer = setTimeout(func, 400, event); 1866 }; 1867 } 1868 function hide_close_buttons() { 1869 centerControlResultHeaderClose.style.display = 'none'; 1870 centerControlResultHeaderBack.style.display = 'none'; 1871 } 1872 function map_org_singular() { 1873 controlListOrgItems.children[0].dispatchEvent(new Event('click')); 1874 } 1875 if (gcaMapData.map_org_is_singular == "1") { 1876 map_org_singular(); 1877 hide_close_buttons(); 1878 } 1879 document.addEventListener("click", function (e) { 1880 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(centerControlResultDiv).is(e.target) && jquery__WEBPACK_IMPORTED_MODULE_0___default()(centerControlResultDiv).has(e.target).length <= 0 && e.target.nodeName != 'IMG') { 1881 var action_popup = document.querySelector('.action_popup'); 1882 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(action_popup).is(e.target) && jquery__WEBPACK_IMPORTED_MODULE_0___default()(action_popup).has(e.target).length <= 0) { 1883 if (document.querySelector('.action_popup.show')) { 1884 var site_header = document.querySelector('.site-header'); 1885 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(site_header).is(e.target) && jquery__WEBPACK_IMPORTED_MODULE_0___default()(site_header).has(e.target).length <= 0) { 1886 controlCloseResult(); 1887 } 1888 } else { 1889 controlCloseResult(); 1890 } 1891 } 1892 } 1893 }); 1894 } 1895 } 1896 }]); 1897}(); 1898/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MainMap); 1899 1900/***/ }), 1901
vendor: 1,420 bytes, lines 1902-1958
1902/***/ "./node_modules/fast-deep-equal/index.js": 1903/*!***********************************************!*\ 1904 !*** ./node_modules/fast-deep-equal/index.js ***! 1905 \***********************************************/ 1906/***/ ((module) => { 1907 1908"use strict"; 1909 1910 1911// do not edit .js files directly - edit src/index.jst 1912 1913 1914 1915module.exports = function equal(a, b) { 1916 if (a === b) return true; 1917 1918 if (a && b && typeof a == 'object' && typeof b == 'object') { 1919 if (a.constructor !== b.constructor) return false; 1920 1921 var length, i, keys; 1922 if (Array.isArray(a)) { 1923 length = a.length; 1924 if (length != b.length) return false; 1925 for (i = length; i-- !== 0;) 1926 if (!equal(a[i], b[i])) return false; 1927 return true; 1928 } 1929 1930 1931 1932 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 1933 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 1934 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 1935 1936 keys = Object.keys(a); 1937 length = keys.length; 1938 if (length !== Object.keys(b).length) return false; 1939 1940 for (i = length; i-- !== 0;) 1941 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 1942 1943 for (i = length; i-- !== 0;) { 1944 var key = keys[i]; 1945 1946 if (!equal(a[key], b[key])) return false; 1947 } 1948 1949 return true; 1950 } 1951 1952 // true if both NaN, false otherwise 1953 return a!==a && b!==b; 1954}; 1955 1956 1957/***/ }), 1958
vendor: 285,755 bytes, lines 1959-12685
1959/***/ "./node_modules/jquery/dist/jquery.js": 1960/*!********************************************!*\ 1961 !*** ./node_modules/jquery/dist/jquery.js ***! 1962 \********************************************/ 1963/***/ (function(module, exports) { 1964 1965var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 1966 * jQuery JavaScript Library v3.7.1 1967 * https://jquery.com/ 1968 * 1969 * Copyright OpenJS Foundation and other contributors 1970 * Released under the MIT license 1971 * https://jquery.org/license 1972 * 1973 * Date: 2023-08-28T13:37Z 1974 */ 1975( function( global, factory ) { 1976 1977 "use strict"; 1978 1979 if ( true && typeof module.exports === "object" ) { 1980 1981 // For CommonJS and CommonJS-like environments where a proper `window` 1982 // is present, execute the factory and get jQuery. 1983 // For environments that do not have a `window` with a `document` 1984 // (such as Node.js), expose a factory as module.exports. 1985 // This accentuates the need for the creation of a real `window`. 1986 // e.g. var jQuery = require("jquery")(window); 1987 // See ticket trac-14549 for more info. 1988 module.exports = global.document ? 1989 factory( global, true ) : 1990 function( w ) { 1991 if ( !w.document ) { 1992 throw new Error( "jQuery requires a window with a document" ); 1993 } 1994 return factory( w ); 1995 }; 1996 } else { 1997 factory( global ); 1998 } 1999 2000// Pass this if window is not defined yet 2001} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 2002 2003// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 2004// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 2005// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 2006// enough that all such attempts are guarded in a try block. 2007"use strict"; 2008 2009var arr = []; 2010 2011var getProto = Object.getPrototypeOf; 2012 2013var slice = arr.slice; 2014 2015var flat = arr.flat ? function( array ) { 2016 return arr.flat.call( array ); 2017} : function( array ) { 2018 return arr.concat.apply( [], array ); 2019}; 2020 2021 2022var push = arr.push; 2023 2024var indexOf = arr.indexOf; 2025 2026var class2type = {}; 2027 2028var toString = class2type.toString; 2029 2030var hasOwn = class2type.hasOwnProperty; 2031 2032var fnToString = hasOwn.toString; 2033 2034var ObjectFunctionString = fnToString.call( Object ); 2035 2036var support = {}; 2037 2038var isFunction = function isFunction( obj ) { 2039 2040 // Support: Chrome <=57, Firefox <=52 2041 // In some browsers, typeof returns "function" for HTML <object> elements 2042 // (i.e., `typeof document.createElement( "object" ) === "function"`). 2043 // We don't want to classify *any* DOM node as a function. 2044 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 2045 // Plus for old WebKit, typeof returns "function" for HTML collections 2046 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 2047 return typeof obj === "function" && typeof obj.nodeType !== "number" && 2048 typeof obj.item !== "function"; 2049 }; 2050 2051 2052var isWindow = function isWindow( obj ) { 2053 return obj != null && obj === obj.window; 2054 }; 2055 2056 2057var document = window.document; 2058 2059 2060 2061 var preservedScriptAttributes = { 2062 type: true, 2063 src: true, 2064 nonce: true, 2065 noModule: true 2066 }; 2067 2068 function DOMEval( code, node, doc ) { 2069 doc = doc || document; 2070 2071 var i, val, 2072 script = doc.createElement( "script" ); 2073 2074 script.text = code; 2075 if ( node ) { 2076 for ( i in preservedScriptAttributes ) { 2077 2078 // Support: Firefox 64+, Edge 18+ 2079 // Some browsers don't support the "nonce" property on scripts. 2080 // On the other hand, just using `getAttribute` is not enough as 2081 // the `nonce` attribute is reset to an empty string whenever it 2082 // becomes browsing-context connected. 2083 // See https://github.com/whatwg/html/issues/2369 2084 // See https://html.spec.whatwg.org/#nonce-attributes 2085 // The `node.getAttribute` check was added for the sake of 2086 // `jQuery.globalEval` so that it can fake a nonce-containing node 2087 // via an object. 2088 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 2089 if ( val ) { 2090 script.setAttribute( i, val ); 2091 } 2092 } 2093 } 2094 doc.head.appendChild( script ).parentNode.removeChild( script ); 2095 } 2096 2097 2098function toType( obj ) { 2099 if ( obj == null ) { 2100 return obj + ""; 2101 } 2102 2103 // Support: Android <=2.3 only (functionish RegExp) 2104 return typeof obj === "object" || typeof obj === "function" ? 2105 class2type[ toString.call( obj ) ] || "object" : 2106 typeof obj; 2107} 2108/* global Symbol */ 2109// Defining this global in .eslintrc.json would create a danger of using the global 2110// unguarded in another place, it seems safer to define global only for this module 2111 2112 2113 2114var version = "3.7.1", 2115 2116 rhtmlSuffix = /HTML$/i, 2117 2118 // Define a local copy of jQuery 2119 jQuery = function( selector, context ) { 2120 2121 // The jQuery object is actually just the init constructor 'enhanced' 2122 // Need init if jQuery is called (just allow error to be thrown if not included) 2123 return new jQuery.fn.init( selector, context ); 2124 }; 2125 2126jQuery.fn = jQuery.prototype = { 2127 2128 // The current version of jQuery being used 2129 jquery: version, 2130 2131 constructor: jQuery, 2132 2133 // The default length of a jQuery object is 0 2134 length: 0, 2135 2136 toArray: function() { 2137 return slice.call( this ); 2138 }, 2139 2140 // Get the Nth element in the matched element set OR 2141 // Get the whole matched element set as a clean array 2142 get: function( num ) { 2143 2144 // Return all the elements in a clean array 2145 if ( num == null ) { 2146 return slice.call( this ); 2147 } 2148 2149 // Return just the one element from the set 2150 return num < 0 ? this[ num + this.length ] : this[ num ]; 2151 }, 2152 2153 // Take an array of elements and push it onto the stack 2154 // (returning the new matched element set) 2155 pushStack: function( elems ) { 2156 2157 // Build a new jQuery matched element set 2158 var ret = jQuery.merge( this.constructor(), elems ); 2159 2160 // Add the old object onto the stack (as a reference) 2161 ret.prevObject = this; 2162 2163 // Return the newly-formed element set 2164 return ret; 2165 }, 2166 2167 // Execute a callback for every element in the matched set. 2168 each: function( callback ) { 2169 return jQuery.each( this, callback ); 2170 }, 2171 2172 map: function( callback ) { 2173 return this.pushStack( jQuery.map( this, function( elem, i ) { 2174 return callback.call( elem, i, elem ); 2175 } ) ); 2176 }, 2177 2178 slice: function() { 2179 return this.pushStack( slice.apply( this, arguments ) ); 2180 }, 2181 2182 first: function() { 2183 return this.eq( 0 ); 2184 }, 2185 2186 last: function() { 2187 return this.eq( -1 ); 2188 }, 2189 2190 even: function() { 2191 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 2192 return ( i + 1 ) % 2; 2193 } ) ); 2194 }, 2195 2196 odd: function() { 2197 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 2198 return i % 2; 2199 } ) ); 2200 }, 2201 2202 eq: function( i ) { 2203 var len = this.length, 2204 j = +i + ( i < 0 ? len : 0 ); 2205 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 2206 }, 2207 2208 end: function() { 2209 return this.prevObject || this.constructor(); 2210 }, 2211 2212 // For internal use only. 2213 // Behaves like an Array's method, not like a jQuery method. 2214 push: push, 2215 sort: arr.sort, 2216 splice: arr.splice 2217}; 2218 2219jQuery.extend = jQuery.fn.extend = function() { 2220 var options, name, src, copy, copyIsArray, clone, 2221 target = arguments[ 0 ] || {}, 2222 i = 1, 2223 length = arguments.length, 2224 deep = false; 2225 2226 // Handle a deep copy situation 2227 if ( typeof target === "boolean" ) { 2228 deep = target; 2229 2230 // Skip the boolean and the target 2231 target = arguments[ i ] || {}; 2232 i++; 2233 } 2234 2235 // Handle case when target is a string or something (possible in deep copy) 2236 if ( typeof target !== "object" && !isFunction( target ) ) { 2237 target = {}; 2238 } 2239 2240 // Extend jQuery itself if only one argument is passed 2241 if ( i === length ) { 2242 target = this; 2243 i--; 2244 } 2245 2246 for ( ; i < length; i++ ) { 2247 2248 // Only deal with non-null/undefined values 2249 if ( ( options = arguments[ i ] ) != null ) { 2250 2251 // Extend the base object 2252 for ( name in options ) { 2253 copy = options[ name ]; 2254 2255 // Prevent Object.prototype pollution 2256 // Prevent never-ending loop 2257 if ( name === "__proto__" || target === copy ) { 2258 continue; 2259 } 2260 2261 // Recurse if we're merging plain objects or arrays 2262 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 2263 ( copyIsArray = Array.isArray( copy ) ) ) ) { 2264 src = target[ name ]; 2265 2266 // Ensure proper type for the source value 2267 if ( copyIsArray && !Array.isArray( src ) ) { 2268 clone = []; 2269 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 2270 clone = {}; 2271 } else { 2272 clone = src; 2273 } 2274 copyIsArray = false; 2275 2276 // Never move original objects, clone them 2277 target[ name ] = jQuery.extend( deep, clone, copy ); 2278 2279 // Don't bring in undefined values 2280 } else if ( copy !== undefined ) { 2281 target[ name ] = copy; 2282 } 2283 } 2284 } 2285 } 2286 2287 // Return the modified object 2288 return target; 2289}; 2290 2291jQuery.extend( { 2292 2293 // Unique for each copy of jQuery on the page 2294 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 2295 2296 // Assume jQuery is ready without the ready module 2297 isReady: true, 2298 2299 error: function( msg ) { 2300 throw new Error( msg ); 2301 }, 2302 2303 noop: function() {}, 2304 2305 isPlainObject: function( obj ) { 2306 var proto, Ctor; 2307 2308 // Detect obvious negatives 2309 // Use toString instead of jQuery.type to catch host objects 2310 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 2311 return false; 2312 } 2313 2314 proto = getProto( obj ); 2315 2316 // Objects with no prototype (e.g., `Object.create( null )`) are plain 2317 if ( !proto ) { 2318 return true; 2319 } 2320 2321 // Objects with prototype are plain iff they were constructed by a global Object function 2322 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 2323 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 2324 }, 2325 2326 isEmptyObject: function( obj ) { 2327 var name; 2328 2329 for ( name in obj ) { 2330 return false; 2331 } 2332 return true; 2333 }, 2334 2335 // Evaluates a script in a provided context; falls back to the global one 2336 // if not specified. 2337 globalEval: function( code, options, doc ) { 2338 DOMEval( code, { nonce: options && options.nonce }, doc ); 2339 }, 2340 2341 each: function( obj, callback ) { 2342 var length, i = 0; 2343 2344 if ( isArrayLike( obj ) ) { 2345 length = obj.length; 2346 for ( ; i < length; i++ ) { 2347 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 2348 break; 2349 } 2350 } 2351 } else { 2352 for ( i in obj ) { 2353 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 2354 break; 2355 } 2356 } 2357 } 2358 2359 return obj; 2360 }, 2361 2362 2363 // Retrieve the text value of an array of DOM nodes 2364 text: function( elem ) { 2365 var node, 2366 ret = "", 2367 i = 0, 2368 nodeType = elem.nodeType; 2369 2370 if ( !nodeType ) { 2371 2372 // If no nodeType, this is expected to be an array 2373 while ( ( node = elem[ i++ ] ) ) { 2374 2375 // Do not traverse comment nodes 2376 ret += jQuery.text( node ); 2377 } 2378 } 2379 if ( nodeType === 1 || nodeType === 11 ) { 2380 return elem.textContent; 2381 } 2382 if ( nodeType === 9 ) { 2383 return elem.documentElement.textContent; 2384 } 2385 if ( nodeType === 3 || nodeType === 4 ) { 2386 return elem.nodeValue; 2387 } 2388 2389 // Do not include comment or processing instruction nodes 2390 2391 return ret; 2392 }, 2393 2394 // results is for internal usage only 2395 makeArray: function( arr, results ) { 2396 var ret = results || []; 2397 2398 if ( arr != null ) { 2399 if ( isArrayLike( Object( arr ) ) ) { 2400 jQuery.merge( ret, 2401 typeof arr === "string" ? 2402 [ arr ] : arr 2403 ); 2404 } else { 2405 push.call( ret, arr ); 2406 } 2407 } 2408 2409 return ret; 2410 }, 2411 2412 inArray: function( elem, arr, i ) { 2413 return arr == null ? -1 : indexOf.call( arr, elem, i ); 2414 }, 2415 2416 isXMLDoc: function( elem ) { 2417 var namespace = elem && elem.namespaceURI, 2418 docElem = elem && ( elem.ownerDocument || elem ).documentElement; 2419 2420 // Assume HTML when documentElement doesn't yet exist, such as inside 2421 // document fragments. 2422 return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" ); 2423 }, 2424 2425 // Support: Android <=4.0 only, PhantomJS 1 only 2426 // push.apply(_, arraylike) throws on ancient WebKit 2427 merge: function( first, second ) { 2428 var len = +second.length, 2429 j = 0, 2430 i = first.length; 2431 2432 for ( ; j < len; j++ ) { 2433 first[ i++ ] = second[ j ]; 2434 } 2435 2436 first.length = i; 2437 2438 return first; 2439 }, 2440 2441 grep: function( elems, callback, invert ) { 2442 var callbackInverse, 2443 matches = [], 2444 i = 0, 2445 length = elems.length, 2446 callbackExpect = !invert; 2447 2448 // Go through the array, only saving the items 2449 // that pass the validator function 2450 for ( ; i < length; i++ ) { 2451 callbackInverse = !callback( elems[ i ], i ); 2452 if ( callbackInverse !== callbackExpect ) { 2453 matches.push( elems[ i ] ); 2454 } 2455 } 2456 2457 return matches; 2458 }, 2459 2460 // arg is for internal usage only 2461 map: function( elems, callback, arg ) { 2462 var length, value, 2463 i = 0, 2464 ret = []; 2465 2466 // Go through the array, translating each of the items to their new values 2467 if ( isArrayLike( elems ) ) { 2468 length = elems.length; 2469 for ( ; i < length; i++ ) { 2470 value = callback( elems[ i ], i, arg ); 2471 2472 if ( value != null ) { 2473 ret.push( value ); 2474 } 2475 } 2476 2477 // Go through every key on the object, 2478 } else { 2479 for ( i in elems ) { 2480 value = callback( elems[ i ], i, arg ); 2481 2482 if ( value != null ) { 2483 ret.push( value ); 2484 } 2485 } 2486 } 2487 2488 // Flatten any nested arrays 2489 return flat( ret ); 2490 }, 2491 2492 // A global GUID counter for objects 2493 guid: 1, 2494 2495 // jQuery.support is not used in Core but other projects attach their 2496 // properties to it so it needs to exist. 2497 support: support 2498} ); 2499 2500if ( typeof Symbol === "function" ) { 2501 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 2502} 2503 2504// Populate the class2type map 2505jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 2506 function( _i, name ) { 2507 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 2508 } ); 2509 2510function isArrayLike( obj ) { 2511 2512 // Support: real iOS 8.2 only (not reproducible in simulator) 2513 // `in` check used to prevent JIT error (gh-2145) 2514 // hasOwn isn't used here due to false negatives 2515 // regarding Nodelist length in IE 2516 var length = !!obj && "length" in obj && obj.length, 2517 type = toType( obj ); 2518 2519 if ( isFunction( obj ) || isWindow( obj ) ) { 2520 return false; 2521 } 2522 2523 return type === "array" || length === 0 || 2524 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 2525} 2526 2527 2528function nodeName( elem, name ) { 2529 2530 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 2531 2532} 2533var pop = arr.pop; 2534 2535 2536var sort = arr.sort; 2537 2538 2539var splice = arr.splice; 2540 2541 2542var whitespace = "[\\x20\\t\\r\\n\\f]"; 2543 2544 2545var rtrimCSS = new RegExp( 2546 "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", 2547 "g" 2548); 2549 2550 2551 2552 2553// Note: an element does not contain itself 2554jQuery.contains = function( a, b ) { 2555 var bup = b && b.parentNode; 2556 2557 return a === bup || !!( bup && bup.nodeType === 1 && ( 2558 2559 // Support: IE 9 - 11+ 2560 // IE doesn't have `contains` on SVG. 2561 a.contains ? 2562 a.contains( bup ) : 2563 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 2564 ) ); 2565}; 2566 2567 2568 2569 2570// CSS string/identifier serialization 2571// https://drafts.csswg.org/cssom/#common-serializing-idioms 2572var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 2573 2574function fcssescape( ch, asCodePoint ) { 2575 if ( asCodePoint ) { 2576 2577 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 2578 if ( ch === "\0" ) { 2579 return "\uFFFD"; 2580 } 2581 2582 // Control characters and (dependent upon position) numbers get escaped as code points 2583 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 2584 } 2585 2586 // Other potentially-special ASCII characters get backslash-escaped 2587 return "\\" + ch; 2588} 2589 2590jQuery.escapeSelector = function( sel ) { 2591 return ( sel + "" ).replace( rcssescape, fcssescape ); 2592}; 2593 2594 2595 2596 2597var preferredDoc = document, 2598 pushNative = push; 2599 2600( function() { 2601 2602var i, 2603 Expr, 2604 outermostContext, 2605 sortInput, 2606 hasDuplicate, 2607 push = pushNative, 2608 2609 // Local document vars 2610 document, 2611 documentElement, 2612 documentIsHTML, 2613 rbuggyQSA, 2614 matches, 2615 2616 // Instance-specific data 2617 expando = jQuery.expando, 2618 dirruns = 0, 2619 done = 0, 2620 classCache = createCache(), 2621 tokenCache = createCache(), 2622 compilerCache = createCache(), 2623 nonnativeSelectorCache = createCache(), 2624 sortOrder = function( a, b ) { 2625 if ( a === b ) { 2626 hasDuplicate = true; 2627 } 2628 return 0; 2629 }, 2630 2631 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + 2632 "loop|multiple|open|readonly|required|scoped", 2633 2634 // Regular expressions 2635 2636 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 2637 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 2638 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 2639 2640 // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors 2641 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 2642 2643 // Operator (capture 2) 2644 "*([*^$|!~]?=)" + whitespace + 2645 2646 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 2647 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 2648 whitespace + "*\\]", 2649 2650 pseudos = ":(" + identifier + ")(?:\\((" + 2651 2652 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 2653 // 1. quoted (capture 3; capture 4 or capture 5) 2654 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 2655 2656 // 2. simple (capture 6) 2657 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 2658 2659 // 3. anything else (capture 2) 2660 ".*" + 2661 ")\\)|)", 2662 2663 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 2664 rwhitespace = new RegExp( whitespace + "+", "g" ), 2665 2666 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 2667 rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + 2668 whitespace + "*" ), 2669 rdescend = new RegExp( whitespace + "|>" ), 2670 2671 rpseudo = new RegExp( pseudos ), 2672 ridentifier = new RegExp( "^" + identifier + "$" ), 2673 2674 matchExpr = { 2675 ID: new RegExp( "^#(" + identifier + ")" ), 2676 CLASS: new RegExp( "^\\.(" + identifier + ")" ), 2677 TAG: new RegExp( "^(" + identifier + "|[*])" ), 2678 ATTR: new RegExp( "^" + attributes ), 2679 PSEUDO: new RegExp( "^" + pseudos ), 2680 CHILD: new RegExp( 2681 "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 2682 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 2683 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 2684 bool: new RegExp( "^(?:" + booleans + ")$", "i" ), 2685 2686 // For use in libraries implementing .is() 2687 // We use this for POS matching in `select` 2688 needsContext: new RegExp( "^" + whitespace + 2689 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 2690 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 2691 }, 2692 2693 rinputs = /^(?:input|select|textarea|button)$/i, 2694 rheader = /^h\d$/i, 2695 2696 // Easily-parseable/retrievable ID or TAG or CLASS selectors 2697 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 2698 2699 rsibling = /[+~]/, 2700 2701 // CSS escapes 2702 // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters 2703 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + 2704 "?|\\\\([^\\r\\n\\f])", "g" ), 2705 funescape = function( escape, nonHex ) { 2706 var high = "0x" + escape.slice( 1 ) - 0x10000; 2707 2708 if ( nonHex ) { 2709 2710 // Strip the backslash prefix from a non-hex escape sequence 2711 return nonHex; 2712 } 2713 2714 // Replace a hexadecimal escape sequence with the encoded Unicode code point 2715 // Support: IE <=11+ 2716 // For values outside the Basic Multilingual Plane (BMP), manually construct a 2717 // surrogate pair 2718 return high < 0 ? 2719 String.fromCharCode( high + 0x10000 ) : 2720 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 2721 }, 2722 2723 // Used for iframes; see `setDocument`. 2724 // Support: IE 9 - 11+, Edge 12 - 18+ 2725 // Removing the function wrapper causes a "Permission Denied" 2726 // error in IE/Edge. 2727 unloadHandler = function() { 2728 setDocument(); 2729 }, 2730 2731 inDisabledFieldset = addCombinator( 2732 function( elem ) { 2733 return elem.disabled === true && nodeName( elem, "fieldset" ); 2734 }, 2735 { dir: "parentNode", next: "legend" } 2736 ); 2737 2738// Support: IE <=9 only 2739// Accessing document.activeElement can throw unexpectedly 2740// https://bugs.jquery.com/ticket/13393 2741function safeActiveElement() { 2742 try { 2743 return document.activeElement; 2744 } catch ( err ) { } 2745} 2746 2747// Optimize for push.apply( _, NodeList ) 2748try { 2749 push.apply( 2750 ( arr = slice.call( preferredDoc.childNodes ) ), 2751 preferredDoc.childNodes 2752 ); 2753 2754 // Support: Android <=4.0 2755 // Detect silently failing push.apply 2756 // eslint-disable-next-line no-unused-expressions 2757 arr[ preferredDoc.childNodes.length ].nodeType; 2758} catch ( e ) { 2759 push = { 2760 apply: function( target, els ) { 2761 pushNative.apply( target, slice.call( els ) ); 2762 }, 2763 call: function( target ) { 2764 pushNative.apply( target, slice.call( arguments, 1 ) ); 2765 } 2766 }; 2767} 2768 2769function find( selector, context, results, seed ) { 2770 var m, i, elem, nid, match, groups, newSelector, 2771 newContext = context && context.ownerDocument, 2772 2773 // nodeType defaults to 9, since context defaults to document 2774 nodeType = context ? context.nodeType : 9; 2775 2776 results = results || []; 2777 2778 // Return early from calls with invalid selector or context 2779 if ( typeof selector !== "string" || !selector || 2780 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 2781 2782 return results; 2783 } 2784 2785 // Try to shortcut find operations (as opposed to filters) in HTML documents 2786 if ( !seed ) { 2787 setDocument( context ); 2788 context = context || document; 2789 2790 if ( documentIsHTML ) { 2791 2792 // If the selector is sufficiently simple, try using a "get*By*" DOM method 2793 // (excepting DocumentFragment context, where the methods don't exist) 2794 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 2795 2796 // ID selector 2797 if ( ( m = match[ 1 ] ) ) { 2798 2799 // Document context 2800 if ( nodeType === 9 ) { 2801 if ( ( elem = context.getElementById( m ) ) ) { 2802 2803 // Support: IE 9 only 2804 // getElementById can match elements by name instead of ID 2805 if ( elem.id === m ) { 2806 push.call( results, elem ); 2807 return results; 2808 } 2809 } else { 2810 return results; 2811 } 2812 2813 // Element context 2814 } else { 2815 2816 // Support: IE 9 only 2817 // getElementById can match elements by name instead of ID 2818 if ( newContext && ( elem = newContext.getElementById( m ) ) && 2819 find.contains( context, elem ) && 2820 elem.id === m ) { 2821 2822 push.call( results, elem ); 2823 return results; 2824 } 2825 } 2826 2827 // Type selector 2828 } else if ( match[ 2 ] ) { 2829 push.apply( results, context.getElementsByTagName( selector ) ); 2830 return results; 2831 2832 // Class selector 2833 } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { 2834 push.apply( results, context.getElementsByClassName( m ) ); 2835 return results; 2836 } 2837 } 2838 2839 // Take advantage of querySelectorAll 2840 if ( !nonnativeSelectorCache[ selector + " " ] && 2841 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { 2842 2843 newSelector = selector; 2844 newContext = context; 2845 2846 // qSA considers elements outside a scoping root when evaluating child or 2847 // descendant combinators, which is not what we want. 2848 // In such cases, we work around the behavior by prefixing every selector in the 2849 // list with an ID selector referencing the scope context. 2850 // The technique has to be used as well when a leading combinator is used 2851 // as such selectors are not recognized by querySelectorAll. 2852 // Thanks to Andrew Dupont for this technique. 2853 if ( nodeType === 1 && 2854 ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) { 2855 2856 // Expand context for sibling selectors 2857 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 2858 context; 2859 2860 // We can use :scope instead of the ID hack if the browser 2861 // supports it & if we're not changing the context. 2862 // Support: IE 11+, Edge 17 - 18+ 2863 // IE/Edge sometimes throw a "Permission denied" error when 2864 // strict-comparing two documents; shallow comparisons work. 2865 // eslint-disable-next-line eqeqeq 2866 if ( newContext != context || !support.scope ) { 2867 2868 // Capture the context ID, setting it first if necessary 2869 if ( ( nid = context.getAttribute( "id" ) ) ) { 2870 nid = jQuery.escapeSelector( nid ); 2871 } else { 2872 context.setAttribute( "id", ( nid = expando ) ); 2873 } 2874 } 2875 2876 // Prefix every selector in the list 2877 groups = tokenize( selector ); 2878 i = groups.length; 2879 while ( i-- ) { 2880 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 2881 toSelector( groups[ i ] ); 2882 } 2883 newSelector = groups.join( "," ); 2884 } 2885 2886 try { 2887 push.apply( results, 2888 newContext.querySelectorAll( newSelector ) 2889 ); 2890 return results; 2891 } catch ( qsaError ) { 2892 nonnativeSelectorCache( selector, true ); 2893 } finally { 2894 if ( nid === expando ) { 2895 context.removeAttribute( "id" ); 2896 } 2897 } 2898 } 2899 } 2900 } 2901 2902 // All others 2903 return select( selector.replace( rtrimCSS, "$1" ), context, results, seed ); 2904} 2905 2906/** 2907 * Create key-value caches of limited size 2908 * @returns {function(string, object)} Returns the Object data after storing it on itself with 2909 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 2910 * deleting the oldest entry 2911 */ 2912function createCache() { 2913 var keys = []; 2914 2915 function cache( key, value ) { 2916 2917 // Use (key + " ") to avoid collision with native prototype properties 2918 // (see https://github.com/jquery/sizzle/issues/157) 2919 if ( keys.push( key + " " ) > Expr.cacheLength ) { 2920 2921 // Only keep the most recent entries 2922 delete cache[ keys.shift() ]; 2923 } 2924 return ( cache[ key + " " ] = value ); 2925 } 2926 return cache; 2927} 2928 2929/** 2930 * Mark a function for special use by jQuery selector module 2931 * @param {Function} fn The function to mark 2932 */ 2933function markFunction( fn ) { 2934 fn[ expando ] = true; 2935 return fn; 2936} 2937 2938/** 2939 * Support testing using an element 2940 * @param {Function} fn Passed the created element and returns a boolean result 2941 */ 2942function assert( fn ) { 2943 var el = document.createElement( "fieldset" ); 2944 2945 try { 2946 return !!fn( el ); 2947 } catch ( e ) { 2948 return false; 2949 } finally { 2950 2951 // Remove from its parent by default 2952 if ( el.parentNode ) { 2953 el.parentNode.removeChild( el ); 2954 } 2955 2956 // release memory in IE 2957 el = null; 2958 } 2959} 2960 2961/** 2962 * Returns a function to use in pseudos for input types 2963 * @param {String} type 2964 */ 2965function createInputPseudo( type ) { 2966 return function( elem ) { 2967 return nodeName( elem, "input" ) && elem.type === type; 2968 }; 2969} 2970 2971/** 2972 * Returns a function to use in pseudos for buttons 2973 * @param {String} type 2974 */ 2975function createButtonPseudo( type ) { 2976 return function( elem ) { 2977 return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) && 2978 elem.type === type; 2979 }; 2980} 2981 2982/** 2983 * Returns a function to use in pseudos for :enabled/:disabled 2984 * @param {Boolean} disabled true for :disabled; false for :enabled 2985 */ 2986function createDisabledPseudo( disabled ) { 2987 2988 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 2989 return function( elem ) { 2990 2991 // Only certain elements can match :enabled or :disabled 2992 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 2993 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 2994 if ( "form" in elem ) { 2995 2996 // Check for inherited disabledness on relevant non-disabled elements: 2997 // * listed form-associated elements in a disabled fieldset 2998 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 2999 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 3000 // * option elements in a disabled optgroup 3001 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 3002 // All such elements have a "form" property. 3003 if ( elem.parentNode && elem.disabled === false ) { 3004 3005 // Option elements defer to a parent optgroup if present 3006 if ( "label" in elem ) { 3007 if ( "label" in elem.parentNode ) { 3008 return elem.parentNode.disabled === disabled; 3009 } else { 3010 return elem.disabled === disabled; 3011 } 3012 } 3013 3014 // Support: IE 6 - 11+ 3015 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 3016 return elem.isDisabled === disabled || 3017 3018 // Where there is no isDisabled, check manually 3019 elem.isDisabled !== !disabled && 3020 inDisabledFieldset( elem ) === disabled; 3021 } 3022 3023 return elem.disabled === disabled; 3024 3025 // Try to winnow out elements that can't be disabled before trusting the disabled property. 3026 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 3027 // even exist on them, let alone have a boolean value. 3028 } else if ( "label" in elem ) { 3029 return elem.disabled === disabled; 3030 } 3031 3032 // Remaining elements are neither :enabled nor :disabled 3033 return false; 3034 }; 3035} 3036 3037/** 3038 * Returns a function to use in pseudos for positionals 3039 * @param {Function} fn 3040 */ 3041function createPositionalPseudo( fn ) { 3042 return markFunction( function( argument ) { 3043 argument = +argument; 3044 return markFunction( function( seed, matches ) { 3045 var j, 3046 matchIndexes = fn( [], seed.length, argument ), 3047 i = matchIndexes.length; 3048 3049 // Match elements found at the specified indexes 3050 while ( i-- ) { 3051 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 3052 seed[ j ] = !( matches[ j ] = seed[ j ] ); 3053 } 3054 } 3055 } ); 3056 } ); 3057} 3058 3059/** 3060 * Checks a node for validity as a jQuery selector context 3061 * @param {Element|Object=} context 3062 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 3063 */ 3064function testContext( context ) { 3065 return context && typeof context.getElementsByTagName !== "undefined" && context; 3066} 3067 3068/** 3069 * Sets document-related variables once based on the current document 3070 * @param {Element|Object} [node] An element or document object to use to set the document 3071 * @returns {Object} Returns the current document 3072 */ 3073function setDocument( node ) { 3074 var subWindow, 3075 doc = node ? node.ownerDocument || node : preferredDoc; 3076 3077 // Return early if doc is invalid or already selected 3078 // Support: IE 11+, Edge 17 - 18+ 3079 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3080 // two documents; shallow comparisons work. 3081 // eslint-disable-next-line eqeqeq 3082 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 3083 return document; 3084 } 3085 3086 // Update global variables 3087 document = doc; 3088 documentElement = document.documentElement; 3089 documentIsHTML = !jQuery.isXMLDoc( document ); 3090 3091 // Support: iOS 7 only, IE 9 - 11+ 3092 // Older browsers didn't support unprefixed `matches`. 3093 matches = documentElement.matches || 3094 documentElement.webkitMatchesSelector || 3095 documentElement.msMatchesSelector; 3096 3097 // Support: IE 9 - 11+, Edge 12 - 18+ 3098 // Accessing iframe documents after unload throws "permission denied" errors 3099 // (see trac-13936). 3100 // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`, 3101 // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well. 3102 if ( documentElement.msMatchesSelector && 3103 3104 // Support: IE 11+, Edge 17 - 18+ 3105 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3106 // two documents; shallow comparisons work. 3107 // eslint-disable-next-line eqeqeq 3108 preferredDoc != document && 3109 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 3110 3111 // Support: IE 9 - 11+, Edge 12 - 18+ 3112 subWindow.addEventListener( "unload", unloadHandler ); 3113 } 3114 3115 // Support: IE <10 3116 // Check if getElementById returns elements by name 3117 // The broken getElementById methods don't pick up programmatically-set names, 3118 // so use a roundabout getElementsByName test 3119 support.getById = assert( function( el ) { 3120 documentElement.appendChild( el ).id = jQuery.expando; 3121 return !document.getElementsByName || 3122 !document.getElementsByName( jQuery.expando ).length; 3123 } ); 3124 3125 // Support: IE 9 only 3126 // Check to see if it's possible to do matchesSelector 3127 // on a disconnected node. 3128 support.disconnectedMatch = assert( function( el ) { 3129 return matches.call( el, "*" ); 3130 } ); 3131 3132 // Support: IE 9 - 11+, Edge 12 - 18+ 3133 // IE/Edge don't support the :scope pseudo-class. 3134 support.scope = assert( function() { 3135 return document.querySelectorAll( ":scope" ); 3136 } ); 3137 3138 // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only 3139 // Make sure the `:has()` argument is parsed unforgivingly. 3140 // We include `*` in the test to detect buggy implementations that are 3141 // _selectively_ forgiving (specifically when the list includes at least 3142 // one valid selector). 3143 // Note that we treat complete lack of support for `:has()` as if it were 3144 // spec-compliant support, which is fine because use of `:has()` in such 3145 // environments will fail in the qSA path and fall back to jQuery traversal 3146 // anyway. 3147 support.cssHas = assert( function() { 3148 try { 3149 document.querySelector( ":has(*,:jqfake)" ); 3150 return false; 3151 } catch ( e ) { 3152 return true; 3153 } 3154 } ); 3155 3156 // ID filter and find 3157 if ( support.getById ) { 3158 Expr.filter.ID = function( id ) { 3159 var attrId = id.replace( runescape, funescape ); 3160 return function( elem ) { 3161 return elem.getAttribute( "id" ) === attrId; 3162 }; 3163 }; 3164 Expr.find.ID = function( id, context ) { 3165 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 3166 var elem = context.getElementById( id ); 3167 return elem ? [ elem ] : []; 3168 } 3169 }; 3170 } else { 3171 Expr.filter.ID = function( id ) { 3172 var attrId = id.replace( runescape, funescape ); 3173 return function( elem ) { 3174 var node = typeof elem.getAttributeNode !== "undefined" && 3175 elem.getAttributeNode( "id" ); 3176 return node && node.value === attrId; 3177 }; 3178 }; 3179 3180 // Support: IE 6 - 7 only 3181 // getElementById is not reliable as a find shortcut 3182 Expr.find.ID = function( id, context ) { 3183 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 3184 var node, i, elems, 3185 elem = context.getElementById( id ); 3186 3187 if ( elem ) { 3188 3189 // Verify the id attribute 3190 node = elem.getAttributeNode( "id" ); 3191 if ( node && node.value === id ) { 3192 return [ elem ]; 3193 } 3194 3195 // Fall back on getElementsByName 3196 elems = context.getElementsByName( id ); 3197 i = 0; 3198 while ( ( elem = elems[ i++ ] ) ) { 3199 node = elem.getAttributeNode( "id" ); 3200 if ( node && node.value === id ) { 3201 return [ elem ]; 3202 } 3203 } 3204 } 3205 3206 return []; 3207 } 3208 }; 3209 } 3210 3211 // Tag 3212 Expr.find.TAG = function( tag, context ) { 3213 if ( typeof context.getElementsByTagName !== "undefined" ) { 3214 return context.getElementsByTagName( tag ); 3215 3216 // DocumentFragment nodes don't have gEBTN 3217 } else { 3218 return context.querySelectorAll( tag ); 3219 } 3220 }; 3221 3222 // Class 3223 Expr.find.CLASS = function( className, context ) { 3224 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 3225 return context.getElementsByClassName( className ); 3226 } 3227 }; 3228 3229 /* QSA/matchesSelector 3230 ---------------------------------------------------------------------- */ 3231 3232 // QSA and matchesSelector support 3233 3234 rbuggyQSA = []; 3235 3236 // Build QSA regex 3237 // Regex strategy adopted from Diego Perini 3238 assert( function( el ) { 3239 3240 var input; 3241 3242 documentElement.appendChild( el ).innerHTML = 3243 "<a id='" + expando + "' href='' disabled='disabled'></a>" + 3244 "<select id='" + expando + "-\r\\' disabled='disabled'>" + 3245 "<option selected=''></option></select>"; 3246 3247 // Support: iOS <=7 - 8 only 3248 // Boolean attributes and "value" are not treated correctly in some XML documents 3249 if ( !el.querySelectorAll( "[selected]" ).length ) { 3250 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 3251 } 3252 3253 // Support: iOS <=7 - 8 only 3254 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 3255 rbuggyQSA.push( "~=" ); 3256 } 3257 3258 // Support: iOS 8 only 3259 // https://bugs.webkit.org/show_bug.cgi?id=136851 3260 // In-page `selector#id sibling-combinator selector` fails 3261 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 3262 rbuggyQSA.push( ".#.+[+~]" ); 3263 } 3264 3265 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 3266 // In some of the document kinds, these selectors wouldn't work natively. 3267 // This is probably OK but for backwards compatibility we want to maintain 3268 // handling them through jQuery traversal in jQuery 3.x. 3269 if ( !el.querySelectorAll( ":checked" ).length ) { 3270 rbuggyQSA.push( ":checked" ); 3271 } 3272 3273 // Support: Windows 8 Native Apps 3274 // The type and name attributes are restricted during .innerHTML assignment 3275 input = document.createElement( "input" ); 3276 input.setAttribute( "type", "hidden" ); 3277 el.appendChild( input ).setAttribute( "name", "D" ); 3278 3279 // Support: IE 9 - 11+ 3280 // IE's :disabled selector does not pick up the children of disabled fieldsets 3281 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 3282 // In some of the document kinds, these selectors wouldn't work natively. 3283 // This is probably OK but for backwards compatibility we want to maintain 3284 // handling them through jQuery traversal in jQuery 3.x. 3285 documentElement.appendChild( el ).disabled = true; 3286 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 3287 rbuggyQSA.push( ":enabled", ":disabled" ); 3288 } 3289 3290 // Support: IE 11+, Edge 15 - 18+ 3291 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 3292 // Adding a temporary attribute to the document before the selection works 3293 // around the issue. 3294 // Interestingly, IE 10 & older don't seem to have the issue. 3295 input = document.createElement( "input" ); 3296 input.setAttribute( "name", "" ); 3297 el.appendChild( input ); 3298 if ( !el.querySelectorAll( "[name='']" ).length ) { 3299 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 3300 whitespace + "*(?:''|\"\")" ); 3301 } 3302 } ); 3303 3304 if ( !support.cssHas ) { 3305 3306 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ 3307 // Our regular `try-catch` mechanism fails to detect natively-unsupported 3308 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) 3309 // in browsers that parse the `:has()` argument as a forgiving selector list. 3310 // https://drafts.csswg.org/selectors/#relational now requires the argument 3311 // to be parsed unforgivingly, but browsers have not yet fully adjusted. 3312 rbuggyQSA.push( ":has" ); 3313 } 3314 3315 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 3316 3317 /* Sorting 3318 ---------------------------------------------------------------------- */ 3319 3320 // Document order sorting 3321 sortOrder = function( a, b ) { 3322 3323 // Flag for duplicate removal 3324 if ( a === b ) { 3325 hasDuplicate = true; 3326 return 0; 3327 } 3328 3329 // Sort on method existence if only one input has compareDocumentPosition 3330 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 3331 if ( compare ) { 3332 return compare; 3333 } 3334 3335 // Calculate position if both inputs belong to the same document 3336 // Support: IE 11+, Edge 17 - 18+ 3337 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3338 // two documents; shallow comparisons work. 3339 // eslint-disable-next-line eqeqeq 3340 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 3341 a.compareDocumentPosition( b ) : 3342 3343 // Otherwise we know they are disconnected 3344 1; 3345 3346 // Disconnected nodes 3347 if ( compare & 1 || 3348 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 3349 3350 // Choose the first element that is related to our preferred document 3351 // Support: IE 11+, Edge 17 - 18+ 3352 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3353 // two documents; shallow comparisons work. 3354 // eslint-disable-next-line eqeqeq 3355 if ( a === document || a.ownerDocument == preferredDoc && 3356 find.contains( preferredDoc, a ) ) { 3357 return -1; 3358 } 3359 3360 // Support: IE 11+, Edge 17 - 18+ 3361 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3362 // two documents; shallow comparisons work. 3363 // eslint-disable-next-line eqeqeq 3364 if ( b === document || b.ownerDocument == preferredDoc && 3365 find.contains( preferredDoc, b ) ) { 3366 return 1; 3367 } 3368 3369 // Maintain original order 3370 return sortInput ? 3371 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 3372 0; 3373 } 3374 3375 return compare & 4 ? -1 : 1; 3376 }; 3377 3378 return document; 3379} 3380 3381find.matches = function( expr, elements ) { 3382 return find( expr, null, null, elements ); 3383}; 3384 3385find.matchesSelector = function( elem, expr ) { 3386 setDocument( elem ); 3387 3388 if ( documentIsHTML && 3389 !nonnativeSelectorCache[ expr + " " ] && 3390 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 3391 3392 try { 3393 var ret = matches.call( elem, expr ); 3394 3395 // IE 9's matchesSelector returns false on disconnected nodes 3396 if ( ret || support.disconnectedMatch || 3397 3398 // As well, disconnected nodes are said to be in a document 3399 // fragment in IE 9 3400 elem.document && elem.document.nodeType !== 11 ) { 3401 return ret; 3402 } 3403 } catch ( e ) { 3404 nonnativeSelectorCache( expr, true ); 3405 } 3406 } 3407 3408 return find( expr, document, null, [ elem ] ).length > 0; 3409}; 3410 3411find.contains = function( context, elem ) { 3412 3413 // Set document vars if needed 3414 // Support: IE 11+, Edge 17 - 18+ 3415 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3416 // two documents; shallow comparisons work. 3417 // eslint-disable-next-line eqeqeq 3418 if ( ( context.ownerDocument || context ) != document ) { 3419 setDocument( context ); 3420 } 3421 return jQuery.contains( context, elem ); 3422}; 3423 3424 3425find.attr = function( elem, name ) { 3426 3427 // Set document vars if needed 3428 // Support: IE 11+, Edge 17 - 18+ 3429 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3430 // two documents; shallow comparisons work. 3431 // eslint-disable-next-line eqeqeq 3432 if ( ( elem.ownerDocument || elem ) != document ) { 3433 setDocument( elem ); 3434 } 3435 3436 var fn = Expr.attrHandle[ name.toLowerCase() ], 3437 3438 // Don't get fooled by Object.prototype properties (see trac-13807) 3439 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 3440 fn( elem, name, !documentIsHTML ) : 3441 undefined; 3442 3443 if ( val !== undefined ) { 3444 return val; 3445 } 3446 3447 return elem.getAttribute( name ); 3448}; 3449 3450find.error = function( msg ) { 3451 throw new Error( "Syntax error, unrecognized expression: " + msg ); 3452}; 3453 3454/** 3455 * Document sorting and removing duplicates 3456 * @param {ArrayLike} results 3457 */ 3458jQuery.uniqueSort = function( results ) { 3459 var elem, 3460 duplicates = [], 3461 j = 0, 3462 i = 0; 3463 3464 // Unless we *know* we can detect duplicates, assume their presence 3465 // 3466 // Support: Android <=4.0+ 3467 // Testing for detecting duplicates is unpredictable so instead assume we can't 3468 // depend on duplicate detection in all browsers without a stable sort. 3469 hasDuplicate = !support.sortStable; 3470 sortInput = !support.sortStable && slice.call( results, 0 ); 3471 sort.call( results, sortOrder ); 3472 3473 if ( hasDuplicate ) { 3474 while ( ( elem = results[ i++ ] ) ) { 3475 if ( elem === results[ i ] ) { 3476 j = duplicates.push( i ); 3477 } 3478 } 3479 while ( j-- ) { 3480 splice.call( results, duplicates[ j ], 1 ); 3481 } 3482 } 3483 3484 // Clear input after sorting to release objects 3485 // See https://github.com/jquery/sizzle/pull/225 3486 sortInput = null; 3487 3488 return results; 3489}; 3490 3491jQuery.fn.uniqueSort = function() { 3492 return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) ); 3493}; 3494 3495Expr = jQuery.expr = { 3496 3497 // Can be adjusted by the user 3498 cacheLength: 50, 3499 3500 createPseudo: markFunction, 3501 3502 match: matchExpr, 3503 3504 attrHandle: {}, 3505 3506 find: {}, 3507 3508 relative: { 3509 ">": { dir: "parentNode", first: true }, 3510 " ": { dir: "parentNode" }, 3511 "+": { dir: "previousSibling", first: true }, 3512 "~": { dir: "previousSibling" } 3513 }, 3514 3515 preFilter: { 3516 ATTR: function( match ) { 3517 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 3518 3519 // Move the given value to match[3] whether quoted or unquoted 3520 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ) 3521 .replace( runescape, funescape ); 3522 3523 if ( match[ 2 ] === "~=" ) { 3524 match[ 3 ] = " " + match[ 3 ] + " "; 3525 } 3526 3527 return match.slice( 0, 4 ); 3528 }, 3529 3530 CHILD: function( match ) { 3531 3532 /* matches from matchExpr["CHILD"] 3533 1 type (only|nth|...) 3534 2 what (child|of-type) 3535 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 3536 4 xn-component of xn+y argument ([+-]?\d*n|) 3537 5 sign of xn-component 3538 6 x of xn-component 3539 7 sign of y-component 3540 8 y of y-component 3541 */ 3542 match[ 1 ] = match[ 1 ].toLowerCase(); 3543 3544 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 3545 3546 // nth-* requires argument 3547 if ( !match[ 3 ] ) { 3548 find.error( match[ 0 ] ); 3549 } 3550 3551 // numeric x and y parameters for Expr.filter.CHILD 3552 // remember that false/true cast respectively to 0/1 3553 match[ 4 ] = +( match[ 4 ] ? 3554 match[ 5 ] + ( match[ 6 ] || 1 ) : 3555 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) 3556 ); 3557 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 3558 3559 // other types prohibit arguments 3560 } else if ( match[ 3 ] ) { 3561 find.error( match[ 0 ] ); 3562 } 3563 3564 return match; 3565 }, 3566 3567 PSEUDO: function( match ) { 3568 var excess, 3569 unquoted = !match[ 6 ] && match[ 2 ]; 3570 3571 if ( matchExpr.CHILD.test( match[ 0 ] ) ) { 3572 return null; 3573 } 3574 3575 // Accept quoted arguments as-is 3576 if ( match[ 3 ] ) { 3577 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 3578 3579 // Strip excess characters from unquoted arguments 3580 } else if ( unquoted && rpseudo.test( unquoted ) && 3581 3582 // Get excess from tokenize (recursively) 3583 ( excess = tokenize( unquoted, true ) ) && 3584 3585 // advance to the next closing parenthesis 3586 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 3587 3588 // excess is a negative index 3589 match[ 0 ] = match[ 0 ].slice( 0, excess ); 3590 match[ 2 ] = unquoted.slice( 0, excess ); 3591 } 3592 3593 // Return only captures needed by the pseudo filter method (type and argument) 3594 return match.slice( 0, 3 ); 3595 } 3596 }, 3597 3598 filter: { 3599 3600 TAG: function( nodeNameSelector ) { 3601 var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 3602 return nodeNameSelector === "*" ? 3603 function() { 3604 return true; 3605 } : 3606 function( elem ) { 3607 return nodeName( elem, expectedNodeName ); 3608 }; 3609 }, 3610 3611 CLASS: function( className ) { 3612 var pattern = classCache[ className + " " ]; 3613 3614 return pattern || 3615 ( pattern = new RegExp( "(^|" + whitespace + ")" + className + 3616 "(" + whitespace + "|$)" ) ) && 3617 classCache( className, function( elem ) { 3618 return pattern.test( 3619 typeof elem.className === "string" && elem.className || 3620 typeof elem.getAttribute !== "undefined" && 3621 elem.getAttribute( "class" ) || 3622 "" 3623 ); 3624 } ); 3625 }, 3626 3627 ATTR: function( name, operator, check ) { 3628 return function( elem ) { 3629 var result = find.attr( elem, name ); 3630 3631 if ( result == null ) { 3632 return operator === "!="; 3633 } 3634 if ( !operator ) { 3635 return true; 3636 } 3637 3638 result += ""; 3639 3640 if ( operator === "=" ) { 3641 return result === check; 3642 } 3643 if ( operator === "!=" ) { 3644 return result !== check; 3645 } 3646 if ( operator === "^=" ) { 3647 return check && result.indexOf( check ) === 0; 3648 } 3649 if ( operator === "*=" ) { 3650 return check && result.indexOf( check ) > -1; 3651 } 3652 if ( operator === "$=" ) { 3653 return check && result.slice( -check.length ) === check; 3654 } 3655 if ( operator === "~=" ) { 3656 return ( " " + result.replace( rwhitespace, " " ) + " " ) 3657 .indexOf( check ) > -1; 3658 } 3659 if ( operator === "|=" ) { 3660 return result === check || result.slice( 0, check.length + 1 ) === check + "-"; 3661 } 3662 3663 return false; 3664 }; 3665 }, 3666 3667 CHILD: function( type, what, _argument, first, last ) { 3668 var simple = type.slice( 0, 3 ) !== "nth", 3669 forward = type.slice( -4 ) !== "last", 3670 ofType = what === "of-type"; 3671 3672 return first === 1 && last === 0 ? 3673 3674 // Shortcut for :nth-*(n) 3675 function( elem ) { 3676 return !!elem.parentNode; 3677 } : 3678 3679 function( elem, _context, xml ) { 3680 var cache, outerCache, node, nodeIndex, start, 3681 dir = simple !== forward ? "nextSibling" : "previousSibling", 3682 parent = elem.parentNode, 3683 name = ofType && elem.nodeName.toLowerCase(), 3684 useCache = !xml && !ofType, 3685 diff = false; 3686 3687 if ( parent ) { 3688 3689 // :(first|last|only)-(child|of-type) 3690 if ( simple ) { 3691 while ( dir ) { 3692 node = elem; 3693 while ( ( node = node[ dir ] ) ) { 3694 if ( ofType ? 3695 nodeName( node, name ) : 3696 node.nodeType === 1 ) { 3697 3698 return false; 3699 } 3700 } 3701 3702 // Reverse direction for :only-* (if we haven't yet done so) 3703 start = dir = type === "only" && !start && "nextSibling"; 3704 } 3705 return true; 3706 } 3707 3708 start = [ forward ? parent.firstChild : parent.lastChild ]; 3709 3710 // non-xml :nth-child(...) stores cache data on `parent` 3711 if ( forward && useCache ) { 3712 3713 // Seek `elem` from a previously-cached index 3714 outerCache = parent[ expando ] || ( parent[ expando ] = {} ); 3715 cache = outerCache[ type ] || []; 3716 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 3717 diff = nodeIndex && cache[ 2 ]; 3718 node = nodeIndex && parent.childNodes[ nodeIndex ]; 3719 3720 while ( ( node = ++nodeIndex && node && node[ dir ] || 3721 3722 // Fallback to seeking `elem` from the start 3723 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 3724 3725 // When found, cache indexes on `parent` and break 3726 if ( node.nodeType === 1 && ++diff && node === elem ) { 3727 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; 3728 break; 3729 } 3730 } 3731 3732 } else { 3733 3734 // Use previously-cached element index if available 3735 if ( useCache ) { 3736 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 3737 cache = outerCache[ type ] || []; 3738 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 3739 diff = nodeIndex; 3740 } 3741 3742 // xml :nth-child(...) 3743 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 3744 if ( diff === false ) { 3745 3746 // Use the same loop as above to seek `elem` from the start 3747 while ( ( node = ++nodeIndex && node && node[ dir ] || 3748 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 3749 3750 if ( ( ofType ? 3751 nodeName( node, name ) : 3752 node.nodeType === 1 ) && 3753 ++diff ) { 3754 3755 // Cache the index of each encountered element 3756 if ( useCache ) { 3757 outerCache = node[ expando ] || 3758 ( node[ expando ] = {} ); 3759 outerCache[ type ] = [ dirruns, diff ]; 3760 } 3761 3762 if ( node === elem ) { 3763 break; 3764 } 3765 } 3766 } 3767 } 3768 } 3769 3770 // Incorporate the offset, then check against cycle size 3771 diff -= last; 3772 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 3773 } 3774 }; 3775 }, 3776 3777 PSEUDO: function( pseudo, argument ) { 3778 3779 // pseudo-class names are case-insensitive 3780 // https://www.w3.org/TR/selectors/#pseudo-classes 3781 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 3782 // Remember that setFilters inherits from pseudos 3783 var args, 3784 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 3785 find.error( "unsupported pseudo: " + pseudo ); 3786 3787 // The user may use createPseudo to indicate that 3788 // arguments are needed to create the filter function 3789 // just as jQuery does 3790 if ( fn[ expando ] ) { 3791 return fn( argument ); 3792 } 3793 3794 // But maintain support for old signatures 3795 if ( fn.length > 1 ) { 3796 args = [ pseudo, pseudo, "", argument ]; 3797 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 3798 markFunction( function( seed, matches ) { 3799 var idx, 3800 matched = fn( seed, argument ), 3801 i = matched.length; 3802 while ( i-- ) { 3803 idx = indexOf.call( seed, matched[ i ] ); 3804 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 3805 } 3806 } ) : 3807 function( elem ) { 3808 return fn( elem, 0, args ); 3809 }; 3810 } 3811 3812 return fn; 3813 } 3814 }, 3815 3816 pseudos: { 3817 3818 // Potentially complex pseudos 3819 not: markFunction( function( selector ) { 3820 3821 // Trim the selector passed to compile 3822 // to avoid treating leading and trailing 3823 // spaces as combinators 3824 var input = [], 3825 results = [], 3826 matcher = compile( selector.replace( rtrimCSS, "$1" ) ); 3827 3828 return matcher[ expando ] ? 3829 markFunction( function( seed, matches, _context, xml ) { 3830 var elem, 3831 unmatched = matcher( seed, null, xml, [] ), 3832 i = seed.length; 3833 3834 // Match elements unmatched by `matcher` 3835 while ( i-- ) { 3836 if ( ( elem = unmatched[ i ] ) ) { 3837 seed[ i ] = !( matches[ i ] = elem ); 3838 } 3839 } 3840 } ) : 3841 function( elem, _context, xml ) { 3842 input[ 0 ] = elem; 3843 matcher( input, null, xml, results ); 3844 3845 // Don't keep the element 3846 // (see https://github.com/jquery/sizzle/issues/299) 3847 input[ 0 ] = null; 3848 return !results.pop(); 3849 }; 3850 } ), 3851 3852 has: markFunction( function( selector ) { 3853 return function( elem ) { 3854 return find( selector, elem ).length > 0; 3855 }; 3856 } ), 3857 3858 contains: markFunction( function( text ) { 3859 text = text.replace( runescape, funescape ); 3860 return function( elem ) { 3861 return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1; 3862 }; 3863 } ), 3864 3865 // "Whether an element is represented by a :lang() selector 3866 // is based solely on the element's language value 3867 // being equal to the identifier C, 3868 // or beginning with the identifier C immediately followed by "-". 3869 // The matching of C against the element's language value is performed case-insensitively. 3870 // The identifier C does not have to be a valid language name." 3871 // https://www.w3.org/TR/selectors/#lang-pseudo 3872 lang: markFunction( function( lang ) { 3873 3874 // lang value must be a valid identifier 3875 if ( !ridentifier.test( lang || "" ) ) { 3876 find.error( "unsupported lang: " + lang ); 3877 } 3878 lang = lang.replace( runescape, funescape ).toLowerCase(); 3879 return function( elem ) { 3880 var elemLang; 3881 do { 3882 if ( ( elemLang = documentIsHTML ? 3883 elem.lang : 3884 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 3885 3886 elemLang = elemLang.toLowerCase(); 3887 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 3888 } 3889 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 3890 return false; 3891 }; 3892 } ), 3893 3894 // Miscellaneous 3895 target: function( elem ) { 3896 var hash = window.location && window.location.hash; 3897 return hash && hash.slice( 1 ) === elem.id; 3898 }, 3899 3900 root: function( elem ) { 3901 return elem === documentElement; 3902 }, 3903 3904 focus: function( elem ) { 3905 return elem === safeActiveElement() && 3906 document.hasFocus() && 3907 !!( elem.type || elem.href || ~elem.tabIndex ); 3908 }, 3909 3910 // Boolean properties 3911 enabled: createDisabledPseudo( false ), 3912 disabled: createDisabledPseudo( true ), 3913 3914 checked: function( elem ) { 3915 3916 // In CSS3, :checked should return both checked and selected elements 3917 // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 3918 return ( nodeName( elem, "input" ) && !!elem.checked ) || 3919 ( nodeName( elem, "option" ) && !!elem.selected ); 3920 }, 3921 3922 selected: function( elem ) { 3923 3924 // Support: IE <=11+ 3925 // Accessing the selectedIndex property 3926 // forces the browser to treat the default option as 3927 // selected when in an optgroup. 3928 if ( elem.parentNode ) { 3929 // eslint-disable-next-line no-unused-expressions 3930 elem.parentNode.selectedIndex; 3931 } 3932 3933 return elem.selected === true; 3934 }, 3935 3936 // Contents 3937 empty: function( elem ) { 3938 3939 // https://www.w3.org/TR/selectors/#empty-pseudo 3940 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 3941 // but not by others (comment: 8; processing instruction: 7; etc.) 3942 // nodeType < 6 works because attributes (2) do not appear as children 3943 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 3944 if ( elem.nodeType < 6 ) { 3945 return false; 3946 } 3947 } 3948 return true; 3949 }, 3950 3951 parent: function( elem ) { 3952 return !Expr.pseudos.empty( elem ); 3953 }, 3954 3955 // Element/input types 3956 header: function( elem ) { 3957 return rheader.test( elem.nodeName ); 3958 }, 3959 3960 input: function( elem ) { 3961 return rinputs.test( elem.nodeName ); 3962 }, 3963 3964 button: function( elem ) { 3965 return nodeName( elem, "input" ) && elem.type === "button" || 3966 nodeName( elem, "button" ); 3967 }, 3968 3969 text: function( elem ) { 3970 var attr; 3971 return nodeName( elem, "input" ) && elem.type === "text" && 3972 3973 // Support: IE <10 only 3974 // New HTML5 attribute values (e.g., "search") appear 3975 // with elem.type === "text" 3976 ( ( attr = elem.getAttribute( "type" ) ) == null || 3977 attr.toLowerCase() === "text" ); 3978 }, 3979 3980 // Position-in-collection 3981 first: createPositionalPseudo( function() { 3982 return [ 0 ]; 3983 } ), 3984 3985 last: createPositionalPseudo( function( _matchIndexes, length ) { 3986 return [ length - 1 ]; 3987 } ), 3988 3989 eq: createPositionalPseudo( function( _matchIndexes, length, argument ) { 3990 return [ argument < 0 ? argument + length : argument ]; 3991 } ), 3992 3993 even: createPositionalPseudo( function( matchIndexes, length ) { 3994 var i = 0; 3995 for ( ; i < length; i += 2 ) { 3996 matchIndexes.push( i ); 3997 } 3998 return matchIndexes; 3999 } ), 4000 4001 odd: createPositionalPseudo( function( matchIndexes, length ) { 4002 var i = 1; 4003 for ( ; i < length; i += 2 ) { 4004 matchIndexes.push( i ); 4005 } 4006 return matchIndexes; 4007 } ), 4008 4009 lt: createPositionalPseudo( function( matchIndexes, length, argument ) { 4010 var i; 4011 4012 if ( argument < 0 ) { 4013 i = argument + length; 4014 } else if ( argument > length ) { 4015 i = length; 4016 } else { 4017 i = argument; 4018 } 4019 4020 for ( ; --i >= 0; ) { 4021 matchIndexes.push( i ); 4022 } 4023 return matchIndexes; 4024 } ), 4025 4026 gt: createPositionalPseudo( function( matchIndexes, length, argument ) { 4027 var i = argument < 0 ? argument + length : argument; 4028 for ( ; ++i < length; ) { 4029 matchIndexes.push( i ); 4030 } 4031 return matchIndexes; 4032 } ) 4033 } 4034}; 4035 4036Expr.pseudos.nth = Expr.pseudos.eq; 4037 4038// Add button/input type pseudos 4039for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 4040 Expr.pseudos[ i ] = createInputPseudo( i ); 4041} 4042for ( i in { submit: true, reset: true } ) { 4043 Expr.pseudos[ i ] = createButtonPseudo( i ); 4044} 4045 4046// Easy API for creating new setFilters 4047function setFilters() {} 4048setFilters.prototype = Expr.filters = Expr.pseudos; 4049Expr.setFilters = new setFilters(); 4050 4051function tokenize( selector, parseOnly ) { 4052 var matched, match, tokens, type, 4053 soFar, groups, preFilters, 4054 cached = tokenCache[ selector + " " ]; 4055 4056 if ( cached ) { 4057 return parseOnly ? 0 : cached.slice( 0 ); 4058 } 4059 4060 soFar = selector; 4061 groups = []; 4062 preFilters = Expr.preFilter; 4063 4064 while ( soFar ) { 4065 4066 // Comma and first run 4067 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 4068 if ( match ) { 4069 4070 // Don't consume trailing commas as valid 4071 soFar = soFar.slice( match[ 0 ].length ) || soFar; 4072 } 4073 groups.push( ( tokens = [] ) ); 4074 } 4075 4076 matched = false; 4077 4078 // Combinators 4079 if ( ( match = rleadingCombinator.exec( soFar ) ) ) { 4080 matched = match.shift(); 4081 tokens.push( { 4082 value: matched, 4083 4084 // Cast descendant combinators to space 4085 type: match[ 0 ].replace( rtrimCSS, " " ) 4086 } ); 4087 soFar = soFar.slice( matched.length ); 4088 } 4089 4090 // Filters 4091 for ( type in Expr.filter ) { 4092 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 4093 ( match = preFilters[ type ]( match ) ) ) ) { 4094 matched = match.shift(); 4095 tokens.push( { 4096 value: matched, 4097 type: type, 4098 matches: match 4099 } ); 4100 soFar = soFar.slice( matched.length ); 4101 } 4102 } 4103 4104 if ( !matched ) { 4105 break; 4106 } 4107 } 4108 4109 // Return the length of the invalid excess 4110 // if we're just parsing 4111 // Otherwise, throw an error or return tokens 4112 if ( parseOnly ) { 4113 return soFar.length; 4114 } 4115 4116 return soFar ? 4117 find.error( selector ) : 4118 4119 // Cache the tokens 4120 tokenCache( selector, groups ).slice( 0 ); 4121} 4122 4123function toSelector( tokens ) { 4124 var i = 0, 4125 len = tokens.length, 4126 selector = ""; 4127 for ( ; i < len; i++ ) { 4128 selector += tokens[ i ].value; 4129 } 4130 return selector; 4131} 4132 4133function addCombinator( matcher, combinator, base ) { 4134 var dir = combinator.dir, 4135 skip = combinator.next, 4136 key = skip || dir, 4137 checkNonElements = base && key === "parentNode", 4138 doneName = done++; 4139 4140 return combinator.first ? 4141 4142 // Check against closest ancestor/preceding element 4143 function( elem, context, xml ) { 4144 while ( ( elem = elem[ dir ] ) ) { 4145 if ( elem.nodeType === 1 || checkNonElements ) { 4146 return matcher( elem, context, xml ); 4147 } 4148 } 4149 return false; 4150 } : 4151 4152 // Check against all ancestor/preceding elements 4153 function( elem, context, xml ) { 4154 var oldCache, outerCache, 4155 newCache = [ dirruns, doneName ]; 4156 4157 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 4158 if ( xml ) { 4159 while ( ( elem = elem[ dir ] ) ) { 4160 if ( elem.nodeType === 1 || checkNonElements ) { 4161 if ( matcher( elem, context, xml ) ) { 4162 return true; 4163 } 4164 } 4165 } 4166 } else { 4167 while ( ( elem = elem[ dir ] ) ) { 4168 if ( elem.nodeType === 1 || checkNonElements ) { 4169 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 4170 4171 if ( skip && nodeName( elem, skip ) ) { 4172 elem = elem[ dir ] || elem; 4173 } else if ( ( oldCache = outerCache[ key ] ) && 4174 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 4175 4176 // Assign to newCache so results back-propagate to previous elements 4177 return ( newCache[ 2 ] = oldCache[ 2 ] ); 4178 } else { 4179 4180 // Reuse newcache so results back-propagate to previous elements 4181 outerCache[ key ] = newCache; 4182 4183 // A match means we're done; a fail means we have to keep checking 4184 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 4185 return true; 4186 } 4187 } 4188 } 4189 } 4190 } 4191 return false; 4192 }; 4193} 4194 4195function elementMatcher( matchers ) { 4196 return matchers.length > 1 ? 4197 function( elem, context, xml ) { 4198 var i = matchers.length; 4199 while ( i-- ) { 4200 if ( !matchers[ i ]( elem, context, xml ) ) { 4201 return false; 4202 } 4203 } 4204 return true; 4205 } : 4206 matchers[ 0 ]; 4207} 4208 4209function multipleContexts( selector, contexts, results ) { 4210 var i = 0, 4211 len = contexts.length; 4212 for ( ; i < len; i++ ) { 4213 find( selector, contexts[ i ], results ); 4214 } 4215 return results; 4216} 4217 4218function condense( unmatched, map, filter, context, xml ) { 4219 var elem, 4220 newUnmatched = [], 4221 i = 0, 4222 len = unmatched.length, 4223 mapped = map != null; 4224 4225 for ( ; i < len; i++ ) { 4226 if ( ( elem = unmatched[ i ] ) ) { 4227 if ( !filter || filter( elem, context, xml ) ) { 4228 newUnmatched.push( elem ); 4229 if ( mapped ) { 4230 map.push( i ); 4231 } 4232 } 4233 } 4234 } 4235 4236 return newUnmatched; 4237} 4238 4239function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 4240 if ( postFilter && !postFilter[ expando ] ) { 4241 postFilter = setMatcher( postFilter ); 4242 } 4243 if ( postFinder && !postFinder[ expando ] ) { 4244 postFinder = setMatcher( postFinder, postSelector ); 4245 } 4246 return markFunction( function( seed, results, context, xml ) { 4247 var temp, i, elem, matcherOut, 4248 preMap = [], 4249 postMap = [], 4250 preexisting = results.length, 4251 4252 // Get initial elements from seed or context 4253 elems = seed || 4254 multipleContexts( selector || "*", 4255 context.nodeType ? [ context ] : context, [] ), 4256 4257 // Prefilter to get matcher input, preserving a map for seed-results synchronization 4258 matcherIn = preFilter && ( seed || !selector ) ? 4259 condense( elems, preMap, preFilter, context, xml ) : 4260 elems; 4261 4262 if ( matcher ) { 4263 4264 // If we have a postFinder, or filtered seed, or non-seed postFilter 4265 // or preexisting results, 4266 matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 4267 4268 // ...intermediate processing is necessary 4269 [] : 4270 4271 // ...otherwise use results directly 4272 results; 4273 4274 // Find primary matches 4275 matcher( matcherIn, matcherOut, context, xml ); 4276 } else { 4277 matcherOut = matcherIn; 4278 } 4279 4280 // Apply postFilter 4281 if ( postFilter ) { 4282 temp = condense( matcherOut, postMap ); 4283 postFilter( temp, [], context, xml ); 4284 4285 // Un-match failing elements by moving them back to matcherIn 4286 i = temp.length; 4287 while ( i-- ) { 4288 if ( ( elem = temp[ i ] ) ) { 4289 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 4290 } 4291 } 4292 } 4293 4294 if ( seed ) { 4295 if ( postFinder || preFilter ) { 4296 if ( postFinder ) { 4297 4298 // Get the final matcherOut by condensing this intermediate into postFinder contexts 4299 temp = []; 4300 i = matcherOut.length; 4301 while ( i-- ) { 4302 if ( ( elem = matcherOut[ i ] ) ) { 4303 4304 // Restore matcherIn since elem is not yet a final match 4305 temp.push( ( matcherIn[ i ] = elem ) ); 4306 } 4307 } 4308 postFinder( null, ( matcherOut = [] ), temp, xml ); 4309 } 4310 4311 // Move matched elements from seed to results to keep them synchronized 4312 i = matcherOut.length; 4313 while ( i-- ) { 4314 if ( ( elem = matcherOut[ i ] ) && 4315 ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) { 4316 4317 seed[ temp ] = !( results[ temp ] = elem ); 4318 } 4319 } 4320 } 4321 4322 // Add elements to results, through postFinder if defined 4323 } else { 4324 matcherOut = condense( 4325 matcherOut === results ? 4326 matcherOut.splice( preexisting, matcherOut.length ) : 4327 matcherOut 4328 ); 4329 if ( postFinder ) { 4330 postFinder( null, results, matcherOut, xml ); 4331 } else { 4332 push.apply( results, matcherOut ); 4333 } 4334 } 4335 } ); 4336} 4337 4338function matcherFromTokens( tokens ) { 4339 var checkContext, matcher, j, 4340 len = tokens.length, 4341 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 4342 implicitRelative = leadingRelative || Expr.relative[ " " ], 4343 i = leadingRelative ? 1 : 0, 4344 4345 // The foundational matcher ensures that elements are reachable from top-level context(s) 4346 matchContext = addCombinator( function( elem ) { 4347 return elem === checkContext; 4348 }, implicitRelative, true ), 4349 matchAnyContext = addCombinator( function( elem ) { 4350 return indexOf.call( checkContext, elem ) > -1; 4351 }, implicitRelative, true ), 4352 matchers = [ function( elem, context, xml ) { 4353 4354 // Support: IE 11+, Edge 17 - 18+ 4355 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4356 // two documents; shallow comparisons work. 4357 // eslint-disable-next-line eqeqeq 4358 var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || ( 4359 ( checkContext = context ).nodeType ? 4360 matchContext( elem, context, xml ) : 4361 matchAnyContext( elem, context, xml ) ); 4362 4363 // Avoid hanging onto element 4364 // (see https://github.com/jquery/sizzle/issues/299) 4365 checkContext = null; 4366 return ret; 4367 } ]; 4368 4369 for ( ; i < len; i++ ) { 4370 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 4371 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 4372 } else { 4373 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 4374 4375 // Return special upon seeing a positional matcher 4376 if ( matcher[ expando ] ) { 4377 4378 // Find the next relative operator (if any) for proper handling 4379 j = ++i; 4380 for ( ; j < len; j++ ) { 4381 if ( Expr.relative[ tokens[ j ].type ] ) { 4382 break; 4383 } 4384 } 4385 return setMatcher( 4386 i > 1 && elementMatcher( matchers ), 4387 i > 1 && toSelector( 4388 4389 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 4390 tokens.slice( 0, i - 1 ) 4391 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 4392 ).replace( rtrimCSS, "$1" ), 4393 matcher, 4394 i < j && matcherFromTokens( tokens.slice( i, j ) ), 4395 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 4396 j < len && toSelector( tokens ) 4397 ); 4398 } 4399 matchers.push( matcher ); 4400 } 4401 } 4402 4403 return elementMatcher( matchers ); 4404} 4405 4406function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 4407 var bySet = setMatchers.length > 0, 4408 byElement = elementMatchers.length > 0, 4409 superMatcher = function( seed, context, xml, results, outermost ) { 4410 var elem, j, matcher, 4411 matchedCount = 0, 4412 i = "0", 4413 unmatched = seed && [], 4414 setMatched = [], 4415 contextBackup = outermostContext, 4416 4417 // We must always have either seed elements or outermost context 4418 elems = seed || byElement && Expr.find.TAG( "*", outermost ), 4419 4420 // Use integer dirruns iff this is the outermost matcher 4421 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 4422 len = elems.length; 4423 4424 if ( outermost ) { 4425 4426 // Support: IE 11+, Edge 17 - 18+ 4427 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4428 // two documents; shallow comparisons work. 4429 // eslint-disable-next-line eqeqeq 4430 outermostContext = context == document || context || outermost; 4431 } 4432 4433 // Add elements passing elementMatchers directly to results 4434 // Support: iOS <=7 - 9 only 4435 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching 4436 // elements by id. (see trac-14142) 4437 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 4438 if ( byElement && elem ) { 4439 j = 0; 4440 4441 // Support: IE 11+, Edge 17 - 18+ 4442 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4443 // two documents; shallow comparisons work. 4444 // eslint-disable-next-line eqeqeq 4445 if ( !context && elem.ownerDocument != document ) { 4446 setDocument( elem ); 4447 xml = !documentIsHTML; 4448 } 4449 while ( ( matcher = elementMatchers[ j++ ] ) ) { 4450 if ( matcher( elem, context || document, xml ) ) { 4451 push.call( results, elem ); 4452 break; 4453 } 4454 } 4455 if ( outermost ) { 4456 dirruns = dirrunsUnique; 4457 } 4458 } 4459 4460 // Track unmatched elements for set filters 4461 if ( bySet ) { 4462 4463 // They will have gone through all possible matchers 4464 if ( ( elem = !matcher && elem ) ) { 4465 matchedCount--; 4466 } 4467 4468 // Lengthen the array for every element, matched or not 4469 if ( seed ) { 4470 unmatched.push( elem ); 4471 } 4472 } 4473 } 4474 4475 // `i` is now the count of elements visited above, and adding it to `matchedCount` 4476 // makes the latter nonnegative. 4477 matchedCount += i; 4478 4479 // Apply set filters to unmatched elements 4480 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 4481 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 4482 // no element matchers and no seed. 4483 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 4484 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 4485 // numerically zero. 4486 if ( bySet && i !== matchedCount ) { 4487 j = 0; 4488 while ( ( matcher = setMatchers[ j++ ] ) ) { 4489 matcher( unmatched, setMatched, context, xml ); 4490 } 4491 4492 if ( seed ) { 4493 4494 // Reintegrate element matches to eliminate the need for sorting 4495 if ( matchedCount > 0 ) { 4496 while ( i-- ) { 4497 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 4498 setMatched[ i ] = pop.call( results ); 4499 } 4500 } 4501 } 4502 4503 // Discard index placeholder values to get only actual matches 4504 setMatched = condense( setMatched ); 4505 } 4506 4507 // Add matches to results 4508 push.apply( results, setMatched ); 4509 4510 // Seedless set matches succeeding multiple successful matchers stipulate sorting 4511 if ( outermost && !seed && setMatched.length > 0 && 4512 ( matchedCount + setMatchers.length ) > 1 ) { 4513 4514 jQuery.uniqueSort( results ); 4515 } 4516 } 4517 4518 // Override manipulation of globals by nested matchers 4519 if ( outermost ) { 4520 dirruns = dirrunsUnique; 4521 outermostContext = contextBackup; 4522 } 4523 4524 return unmatched; 4525 }; 4526 4527 return bySet ? 4528 markFunction( superMatcher ) : 4529 superMatcher; 4530} 4531 4532function compile( selector, match /* Internal Use Only */ ) { 4533 var i, 4534 setMatchers = [], 4535 elementMatchers = [], 4536 cached = compilerCache[ selector + " " ]; 4537 4538 if ( !cached ) { 4539 4540 // Generate a function of recursive functions that can be used to check each element 4541 if ( !match ) { 4542 match = tokenize( selector ); 4543 } 4544 i = match.length; 4545 while ( i-- ) { 4546 cached = matcherFromTokens( match[ i ] ); 4547 if ( cached[ expando ] ) { 4548 setMatchers.push( cached ); 4549 } else { 4550 elementMatchers.push( cached ); 4551 } 4552 } 4553 4554 // Cache the compiled function 4555 cached = compilerCache( selector, 4556 matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 4557 4558 // Save selector and tokenization 4559 cached.selector = selector; 4560 } 4561 return cached; 4562} 4563 4564/** 4565 * A low-level selection function that works with jQuery's compiled 4566 * selector functions 4567 * @param {String|Function} selector A selector or a pre-compiled 4568 * selector function built with jQuery selector compile 4569 * @param {Element} context 4570 * @param {Array} [results] 4571 * @param {Array} [seed] A set of elements to match against 4572 */ 4573function select( selector, context, results, seed ) { 4574 var i, tokens, token, type, find, 4575 compiled = typeof selector === "function" && selector, 4576 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 4577 4578 results = results || []; 4579 4580 // Try to minimize operations if there is only one selector in the list and no seed 4581 // (the latter of which guarantees us context) 4582 if ( match.length === 1 ) { 4583 4584 // Reduce context if the leading compound selector is an ID 4585 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 4586 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 4587 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 4588 4589 context = ( Expr.find.ID( 4590 token.matches[ 0 ].replace( runescape, funescape ), 4591 context 4592 ) || [] )[ 0 ]; 4593 if ( !context ) { 4594 return results; 4595 4596 // Precompiled matchers will still verify ancestry, so step up a level 4597 } else if ( compiled ) { 4598 context = context.parentNode; 4599 } 4600 4601 selector = selector.slice( tokens.shift().value.length ); 4602 } 4603 4604 // Fetch a seed set for right-to-left matching 4605 i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length; 4606 while ( i-- ) { 4607 token = tokens[ i ]; 4608 4609 // Abort if we hit a combinator 4610 if ( Expr.relative[ ( type = token.type ) ] ) { 4611 break; 4612 } 4613 if ( ( find = Expr.find[ type ] ) ) { 4614 4615 // Search, expanding context for leading sibling combinators 4616 if ( ( seed = find( 4617 token.matches[ 0 ].replace( runescape, funescape ), 4618 rsibling.test( tokens[ 0 ].type ) && 4619 testContext( context.parentNode ) || context 4620 ) ) ) { 4621 4622 // If seed is empty or no tokens remain, we can return early 4623 tokens.splice( i, 1 ); 4624 selector = seed.length && toSelector( tokens ); 4625 if ( !selector ) { 4626 push.apply( results, seed ); 4627 return results; 4628 } 4629 4630 break; 4631 } 4632 } 4633 } 4634 } 4635 4636 // Compile and execute a filtering function if one is not provided 4637 // Provide `match` to avoid retokenization if we modified the selector above 4638 ( compiled || compile( selector, match ) )( 4639 seed, 4640 context, 4641 !documentIsHTML, 4642 results, 4643 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 4644 ); 4645 return results; 4646} 4647 4648// One-time assignments 4649 4650// Support: Android <=4.0 - 4.1+ 4651// Sort stability 4652support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 4653 4654// Initialize against the default document 4655setDocument(); 4656 4657// Support: Android <=4.0 - 4.1+ 4658// Detached nodes confoundingly follow *each other* 4659support.sortDetached = assert( function( el ) { 4660 4661 // Should return 1, but returns 4 (following) 4662 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 4663} ); 4664 4665jQuery.find = find; 4666 4667// Deprecated 4668jQuery.expr[ ":" ] = jQuery.expr.pseudos; 4669jQuery.unique = jQuery.uniqueSort; 4670 4671// These have always been private, but they used to be documented as part of 4672// Sizzle so let's maintain them for now for backwards compatibility purposes. 4673find.compile = compile; 4674find.select = select; 4675find.setDocument = setDocument; 4676find.tokenize = tokenize; 4677 4678find.escape = jQuery.escapeSelector; 4679find.getText = jQuery.text; 4680find.isXML = jQuery.isXMLDoc; 4681find.selectors = jQuery.expr; 4682find.support = jQuery.support; 4683find.uniqueSort = jQuery.uniqueSort; 4684 4685 /* eslint-enable */ 4686 4687} )(); 4688 4689 4690var dir = function( elem, dir, until ) { 4691 var matched = [], 4692 truncate = until !== undefined; 4693 4694 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 4695 if ( elem.nodeType === 1 ) { 4696 if ( truncate && jQuery( elem ).is( until ) ) { 4697 break; 4698 } 4699 matched.push( elem ); 4700 } 4701 } 4702 return matched; 4703}; 4704 4705 4706var siblings = function( n, elem ) { 4707 var matched = []; 4708 4709 for ( ; n; n = n.nextSibling ) { 4710 if ( n.nodeType === 1 && n !== elem ) { 4711 matched.push( n ); 4712 } 4713 } 4714 4715 return matched; 4716}; 4717 4718 4719var rneedsContext = jQuery.expr.match.needsContext; 4720 4721var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 4722 4723 4724 4725// Implement the identical functionality for filter and not 4726function winnow( elements, qualifier, not ) { 4727 if ( isFunction( qualifier ) ) { 4728 return jQuery.grep( elements, function( elem, i ) { 4729 return !!qualifier.call( elem, i, elem ) !== not; 4730 } ); 4731 } 4732 4733 // Single element 4734 if ( qualifier.nodeType ) { 4735 return jQuery.grep( elements, function( elem ) { 4736 return ( elem === qualifier ) !== not; 4737 } ); 4738 } 4739 4740 // Arraylike of elements (jQuery, arguments, Array) 4741 if ( typeof qualifier !== "string" ) { 4742 return jQuery.grep( elements, function( elem ) { 4743 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 4744 } ); 4745 } 4746 4747 // Filtered directly for both simple and complex selectors 4748 return jQuery.filter( qualifier, elements, not ); 4749} 4750 4751jQuery.filter = function( expr, elems, not ) { 4752 var elem = elems[ 0 ]; 4753 4754 if ( not ) { 4755 expr = ":not(" + expr + ")"; 4756 } 4757 4758 if ( elems.length === 1 && elem.nodeType === 1 ) { 4759 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 4760 } 4761 4762 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 4763 return elem.nodeType === 1; 4764 } ) ); 4765}; 4766 4767jQuery.fn.extend( { 4768 find: function( selector ) { 4769 var i, ret, 4770 len = this.length, 4771 self = this; 4772 4773 if ( typeof selector !== "string" ) { 4774 return this.pushStack( jQuery( selector ).filter( function() { 4775 for ( i = 0; i < len; i++ ) { 4776 if ( jQuery.contains( self[ i ], this ) ) { 4777 return true; 4778 } 4779 } 4780 } ) ); 4781 } 4782 4783 ret = this.pushStack( [] ); 4784 4785 for ( i = 0; i < len; i++ ) { 4786 jQuery.find( selector, self[ i ], ret ); 4787 } 4788 4789 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 4790 }, 4791 filter: function( selector ) { 4792 return this.pushStack( winnow( this, selector || [], false ) ); 4793 }, 4794 not: function( selector ) { 4795 return this.pushStack( winnow( this, selector || [], true ) ); 4796 }, 4797 is: function( selector ) { 4798 return !!winnow( 4799 this, 4800 4801 // If this is a positional/relative selector, check membership in the returned set 4802 // so $("p:first").is("p:last") won't return true for a doc with two "p". 4803 typeof selector === "string" && rneedsContext.test( selector ) ? 4804 jQuery( selector ) : 4805 selector || [], 4806 false 4807 ).length; 4808 } 4809} ); 4810 4811 4812// Initialize a jQuery object 4813 4814 4815// A central reference to the root jQuery(document) 4816var rootjQuery, 4817 4818 // A simple way to check for HTML strings 4819 // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521) 4820 // Strict HTML recognition (trac-11290: must start with <) 4821 // Shortcut simple #id case for speed 4822 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 4823 4824 init = jQuery.fn.init = function( selector, context, root ) { 4825 var match, elem; 4826 4827 // HANDLE: $(""), $(null), $(undefined), $(false) 4828 if ( !selector ) { 4829 return this; 4830 } 4831 4832 // Method init() accepts an alternate rootjQuery 4833 // so migrate can support jQuery.sub (gh-2101) 4834 root = root || rootjQuery; 4835 4836 // Handle HTML strings 4837 if ( typeof selector === "string" ) { 4838 if ( selector[ 0 ] === "<" && 4839 selector[ selector.length - 1 ] === ">" && 4840 selector.length >= 3 ) { 4841 4842 // Assume that strings that start and end with <> are HTML and skip the regex check 4843 match = [ null, selector, null ]; 4844 4845 } else { 4846 match = rquickExpr.exec( selector ); 4847 } 4848 4849 // Match html or make sure no context is specified for #id 4850 if ( match && ( match[ 1 ] || !context ) ) { 4851 4852 // HANDLE: $(html) -> $(array) 4853 if ( match[ 1 ] ) { 4854 context = context instanceof jQuery ? context[ 0 ] : context; 4855 4856 // Option to run scripts is true for back-compat 4857 // Intentionally let the error be thrown if parseHTML is not present 4858 jQuery.merge( this, jQuery.parseHTML( 4859 match[ 1 ], 4860 context && context.nodeType ? context.ownerDocument || context : document, 4861 true 4862 ) ); 4863 4864 // HANDLE: $(html, props) 4865 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 4866 for ( match in context ) { 4867 4868 // Properties of context are called as methods if possible 4869 if ( isFunction( this[ match ] ) ) { 4870 this[ match ]( context[ match ] ); 4871 4872 // ...and otherwise set as attributes 4873 } else { 4874 this.attr( match, context[ match ] ); 4875 } 4876 } 4877 } 4878 4879 return this; 4880 4881 // HANDLE: $(#id) 4882 } else { 4883 elem = document.getElementById( match[ 2 ] ); 4884 4885 if ( elem ) { 4886 4887 // Inject the element directly into the jQuery object 4888 this[ 0 ] = elem; 4889 this.length = 1; 4890 } 4891 return this; 4892 } 4893 4894 // HANDLE: $(expr, $(...)) 4895 } else if ( !context || context.jquery ) { 4896 return ( context || root ).find( selector ); 4897 4898 // HANDLE: $(expr, context) 4899 // (which is just equivalent to: $(context).find(expr) 4900 } else { 4901 return this.constructor( context ).find( selector ); 4902 } 4903 4904 // HANDLE: $(DOMElement) 4905 } else if ( selector.nodeType ) { 4906 this[ 0 ] = selector; 4907 this.length = 1; 4908 return this; 4909 4910 // HANDLE: $(function) 4911 // Shortcut for document ready 4912 } else if ( isFunction( selector ) ) { 4913 return root.ready !== undefined ? 4914 root.ready( selector ) : 4915 4916 // Execute immediately if ready is not present 4917 selector( jQuery ); 4918 } 4919 4920 return jQuery.makeArray( selector, this ); 4921 }; 4922 4923// Give the init function the jQuery prototype for later instantiation 4924init.prototype = jQuery.fn; 4925 4926// Initialize central reference 4927rootjQuery = jQuery( document ); 4928 4929 4930var rparentsprev = /^(?:parents|prev(?:Until|All))/, 4931 4932 // Methods guaranteed to produce a unique set when starting from a unique set 4933 guaranteedUnique = { 4934 children: true, 4935 contents: true, 4936 next: true, 4937 prev: true 4938 }; 4939 4940jQuery.fn.extend( { 4941 has: function( target ) { 4942 var targets = jQuery( target, this ), 4943 l = targets.length; 4944 4945 return this.filter( function() { 4946 var i = 0; 4947 for ( ; i < l; i++ ) { 4948 if ( jQuery.contains( this, targets[ i ] ) ) { 4949 return true; 4950 } 4951 } 4952 } ); 4953 }, 4954 4955 closest: function( selectors, context ) { 4956 var cur, 4957 i = 0, 4958 l = this.length, 4959 matched = [], 4960 targets = typeof selectors !== "string" && jQuery( selectors ); 4961 4962 // Positional selectors never match, since there's no _selection_ context 4963 if ( !rneedsContext.test( selectors ) ) { 4964 for ( ; i < l; i++ ) { 4965 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 4966 4967 // Always skip document fragments 4968 if ( cur.nodeType < 11 && ( targets ? 4969 targets.index( cur ) > -1 : 4970 4971 // Don't pass non-elements to jQuery#find 4972 cur.nodeType === 1 && 4973 jQuery.find.matchesSelector( cur, selectors ) ) ) { 4974 4975 matched.push( cur ); 4976 break; 4977 } 4978 } 4979 } 4980 } 4981 4982 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 4983 }, 4984 4985 // Determine the position of an element within the set 4986 index: function( elem ) { 4987 4988 // No argument, return index in parent 4989 if ( !elem ) { 4990 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 4991 } 4992 4993 // Index in selector 4994 if ( typeof elem === "string" ) { 4995 return indexOf.call( jQuery( elem ), this[ 0 ] ); 4996 } 4997 4998 // Locate the position of the desired element 4999 return indexOf.call( this, 5000 5001 // If it receives a jQuery object, the first element is used 5002 elem.jquery ? elem[ 0 ] : elem 5003 ); 5004 }, 5005 5006 add: function( selector, context ) { 5007 return this.pushStack( 5008 jQuery.uniqueSort( 5009 jQuery.merge( this.get(), jQuery( selector, context ) ) 5010 ) 5011 ); 5012 }, 5013 5014 addBack: function( selector ) { 5015 return this.add( selector == null ? 5016 this.prevObject : this.prevObject.filter( selector ) 5017 ); 5018 } 5019} ); 5020 5021function sibling( cur, dir ) { 5022 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 5023 return cur; 5024} 5025 5026jQuery.each( { 5027 parent: function( elem ) { 5028 var parent = elem.parentNode; 5029 return parent && parent.nodeType !== 11 ? parent : null; 5030 }, 5031 parents: function( elem ) { 5032 return dir( elem, "parentNode" ); 5033 }, 5034 parentsUntil: function( elem, _i, until ) { 5035 return dir( elem, "parentNode", until ); 5036 }, 5037 next: function( elem ) { 5038 return sibling( elem, "nextSibling" ); 5039 }, 5040 prev: function( elem ) { 5041 return sibling( elem, "previousSibling" ); 5042 }, 5043 nextAll: function( elem ) { 5044 return dir( elem, "nextSibling" ); 5045 }, 5046 prevAll: function( elem ) { 5047 return dir( elem, "previousSibling" ); 5048 }, 5049 nextUntil: function( elem, _i, until ) { 5050 return dir( elem, "nextSibling", until ); 5051 }, 5052 prevUntil: function( elem, _i, until ) { 5053 return dir( elem, "previousSibling", until ); 5054 }, 5055 siblings: function( elem ) { 5056 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 5057 }, 5058 children: function( elem ) { 5059 return siblings( elem.firstChild ); 5060 }, 5061 contents: function( elem ) { 5062 if ( elem.contentDocument != null && 5063 5064 // Support: IE 11+ 5065 // <object> elements with no `data` attribute has an object 5066 // `contentDocument` with a `null` prototype. 5067 getProto( elem.contentDocument ) ) { 5068 5069 return elem.contentDocument; 5070 } 5071 5072 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 5073 // Treat the template element as a regular one in browsers that 5074 // don't support it. 5075 if ( nodeName( elem, "template" ) ) { 5076 elem = elem.content || elem; 5077 } 5078 5079 return jQuery.merge( [], elem.childNodes ); 5080 } 5081}, function( name, fn ) { 5082 jQuery.fn[ name ] = function( until, selector ) { 5083 var matched = jQuery.map( this, fn, until ); 5084 5085 if ( name.slice( -5 ) !== "Until" ) { 5086 selector = until; 5087 } 5088 5089 if ( selector && typeof selector === "string" ) { 5090 matched = jQuery.filter( selector, matched ); 5091 } 5092 5093 if ( this.length > 1 ) { 5094 5095 // Remove duplicates 5096 if ( !guaranteedUnique[ name ] ) { 5097 jQuery.uniqueSort( matched ); 5098 } 5099 5100 // Reverse order for parents* and prev-derivatives 5101 if ( rparentsprev.test( name ) ) { 5102 matched.reverse(); 5103 } 5104 } 5105 5106 return this.pushStack( matched ); 5107 }; 5108} ); 5109var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 5110 5111 5112 5113// Convert String-formatted options into Object-formatted ones 5114function createOptions( options ) { 5115 var object = {}; 5116 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 5117 object[ flag ] = true; 5118 } ); 5119 return object; 5120} 5121 5122/* 5123 * Create a callback list using the following parameters: 5124 * 5125 * options: an optional list of space-separated options that will change how 5126 * the callback list behaves or a more traditional option object 5127 * 5128 * By default a callback list will act like an event callback list and can be 5129 * "fired" multiple times. 5130 * 5131 * Possible options: 5132 * 5133 * once: will ensure the callback list can only be fired once (like a Deferred) 5134 * 5135 * memory: will keep track of previous values and will call any callback added 5136 * after the list has been fired right away with the latest "memorized" 5137 * values (like a Deferred) 5138 * 5139 * unique: will ensure a callback can only be added once (no duplicate in the list) 5140 * 5141 * stopOnFalse: interrupt callings when a callback returns false 5142 * 5143 */ 5144jQuery.Callbacks = function( options ) { 5145 5146 // Convert options from String-formatted to Object-formatted if needed 5147 // (we check in cache first) 5148 options = typeof options === "string" ? 5149 createOptions( options ) : 5150 jQuery.extend( {}, options ); 5151 5152 var // Flag to know if list is currently firing 5153 firing, 5154 5155 // Last fire value for non-forgettable lists 5156 memory, 5157 5158 // Flag to know if list was already fired 5159 fired, 5160 5161 // Flag to prevent firing 5162 locked, 5163 5164 // Actual callback list 5165 list = [], 5166 5167 // Queue of execution data for repeatable lists 5168 queue = [], 5169 5170 // Index of currently firing callback (modified by add/remove as needed) 5171 firingIndex = -1, 5172 5173 // Fire callbacks 5174 fire = function() { 5175 5176 // Enforce single-firing 5177 locked = locked || options.once; 5178 5179 // Execute callbacks for all pending executions, 5180 // respecting firingIndex overrides and runtime changes 5181 fired = firing = true; 5182 for ( ; queue.length; firingIndex = -1 ) { 5183 memory = queue.shift(); 5184 while ( ++firingIndex < list.length ) { 5185 5186 // Run callback and check for early termination 5187 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 5188 options.stopOnFalse ) { 5189 5190 // Jump to end and forget the data so .add doesn't re-fire 5191 firingIndex = list.length; 5192 memory = false; 5193 } 5194 } 5195 } 5196 5197 // Forget the data if we're done with it 5198 if ( !options.memory ) { 5199 memory = false; 5200 } 5201 5202 firing = false; 5203 5204 // Clean up if we're done firing for good 5205 if ( locked ) { 5206 5207 // Keep an empty list if we have data for future add calls 5208 if ( memory ) { 5209 list = []; 5210 5211 // Otherwise, this object is spent 5212 } else { 5213 list = ""; 5214 } 5215 } 5216 }, 5217 5218 // Actual Callbacks object 5219 self = { 5220 5221 // Add a callback or a collection of callbacks to the list 5222 add: function() { 5223 if ( list ) { 5224 5225 // If we have memory from a past run, we should fire after adding 5226 if ( memory && !firing ) { 5227 firingIndex = list.length - 1; 5228 queue.push( memory ); 5229 } 5230 5231 ( function add( args ) { 5232 jQuery.each( args, function( _, arg ) { 5233 if ( isFunction( arg ) ) { 5234 if ( !options.unique || !self.has( arg ) ) { 5235 list.push( arg ); 5236 } 5237 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 5238 5239 // Inspect recursively 5240 add( arg ); 5241 } 5242 } ); 5243 } )( arguments ); 5244 5245 if ( memory && !firing ) { 5246 fire(); 5247 } 5248 } 5249 return this; 5250 }, 5251 5252 // Remove a callback from the list 5253 remove: function() { 5254 jQuery.each( arguments, function( _, arg ) { 5255 var index; 5256 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 5257 list.splice( index, 1 ); 5258 5259 // Handle firing indexes 5260 if ( index <= firingIndex ) { 5261 firingIndex--; 5262 } 5263 } 5264 } ); 5265 return this; 5266 }, 5267 5268 // Check if a given callback is in the list. 5269 // If no argument is given, return whether or not list has callbacks attached. 5270 has: function( fn ) { 5271 return fn ? 5272 jQuery.inArray( fn, list ) > -1 : 5273 list.length > 0; 5274 }, 5275 5276 // Remove all callbacks from the list 5277 empty: function() { 5278 if ( list ) { 5279 list = []; 5280 } 5281 return this; 5282 }, 5283 5284 // Disable .fire and .add 5285 // Abort any current/pending executions 5286 // Clear all callbacks and values 5287 disable: function() { 5288 locked = queue = []; 5289 list = memory = ""; 5290 return this; 5291 }, 5292 disabled: function() { 5293 return !list; 5294 }, 5295 5296 // Disable .fire 5297 // Also disable .add unless we have memory (since it would have no effect) 5298 // Abort any pending executions 5299 lock: function() { 5300 locked = queue = []; 5301 if ( !memory && !firing ) { 5302 list = memory = ""; 5303 } 5304 return this; 5305 }, 5306 locked: function() { 5307 return !!locked; 5308 }, 5309 5310 // Call all callbacks with the given context and arguments 5311 fireWith: function( context, args ) { 5312 if ( !locked ) { 5313 args = args || []; 5314 args = [ context, args.slice ? args.slice() : args ]; 5315 queue.push( args ); 5316 if ( !firing ) { 5317 fire(); 5318 } 5319 } 5320 return this; 5321 }, 5322 5323 // Call all the callbacks with the given arguments 5324 fire: function() { 5325 self.fireWith( this, arguments ); 5326 return this; 5327 }, 5328 5329 // To know if the callbacks have already been called at least once 5330 fired: function() { 5331 return !!fired; 5332 } 5333 }; 5334 5335 return self; 5336}; 5337 5338 5339function Identity( v ) { 5340 return v; 5341} 5342function Thrower( ex ) { 5343 throw ex; 5344} 5345 5346function adoptValue( value, resolve, reject, noValue ) { 5347 var method; 5348 5349 try { 5350 5351 // Check for promise aspect first to privilege synchronous behavior 5352 if ( value && isFunction( ( method = value.promise ) ) ) { 5353 method.call( value ).done( resolve ).fail( reject ); 5354 5355 // Other thenables 5356 } else if ( value && isFunction( ( method = value.then ) ) ) { 5357 method.call( value, resolve, reject ); 5358 5359 // Other non-thenables 5360 } else { 5361 5362 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 5363 // * false: [ value ].slice( 0 ) => resolve( value ) 5364 // * true: [ value ].slice( 1 ) => resolve() 5365 resolve.apply( undefined, [ value ].slice( noValue ) ); 5366 } 5367 5368 // For Promises/A+, convert exceptions into rejections 5369 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 5370 // Deferred#then to conditionally suppress rejection. 5371 } catch ( value ) { 5372 5373 // Support: Android 4.0 only 5374 // Strict mode functions invoked without .call/.apply get global-object context 5375 reject.apply( undefined, [ value ] ); 5376 } 5377} 5378 5379jQuery.extend( { 5380 5381 Deferred: function( func ) { 5382 var tuples = [ 5383 5384 // action, add listener, callbacks, 5385 // ... .then handlers, argument index, [final state] 5386 [ "notify", "progress", jQuery.Callbacks( "memory" ), 5387 jQuery.Callbacks( "memory" ), 2 ], 5388 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 5389 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 5390 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 5391 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 5392 ], 5393 state = "pending", 5394 promise = { 5395 state: function() { 5396 return state; 5397 }, 5398 always: function() { 5399 deferred.done( arguments ).fail( arguments ); 5400 return this; 5401 }, 5402 "catch": function( fn ) { 5403 return promise.then( null, fn ); 5404 }, 5405 5406 // Keep pipe for back-compat 5407 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 5408 var fns = arguments; 5409 5410 return jQuery.Deferred( function( newDefer ) { 5411 jQuery.each( tuples, function( _i, tuple ) { 5412 5413 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 5414 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 5415 5416 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 5417 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 5418 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 5419 deferred[ tuple[ 1 ] ]( function() { 5420 var returned = fn && fn.apply( this, arguments ); 5421 if ( returned && isFunction( returned.promise ) ) { 5422 returned.promise() 5423 .progress( newDefer.notify ) 5424 .done( newDefer.resolve ) 5425 .fail( newDefer.reject ); 5426 } else { 5427 newDefer[ tuple[ 0 ] + "With" ]( 5428 this, 5429 fn ? [ returned ] : arguments 5430 ); 5431 } 5432 } ); 5433 } ); 5434 fns = null; 5435 } ).promise(); 5436 }, 5437 then: function( onFulfilled, onRejected, onProgress ) { 5438 var maxDepth = 0; 5439 function resolve( depth, deferred, handler, special ) { 5440 return function() { 5441 var that = this, 5442 args = arguments, 5443 mightThrow = function() { 5444 var returned, then; 5445 5446 // Support: Promises/A+ section 2.3.3.3.3 5447 // https://promisesaplus.com/#point-59 5448 // Ignore double-resolution attempts 5449 if ( depth < maxDepth ) { 5450 return; 5451 } 5452 5453 returned = handler.apply( that, args ); 5454 5455 // Support: Promises/A+ section 2.3.1 5456 // https://promisesaplus.com/#point-48 5457 if ( returned === deferred.promise() ) { 5458 throw new TypeError( "Thenable self-resolution" ); 5459 } 5460 5461 // Support: Promises/A+ sections 2.3.3.1, 3.5 5462 // https://promisesaplus.com/#point-54 5463 // https://promisesaplus.com/#point-75 5464 // Retrieve `then` only once 5465 then = returned && 5466 5467 // Support: Promises/A+ section 2.3.4 5468 // https://promisesaplus.com/#point-64 5469 // Only check objects and functions for thenability 5470 ( typeof returned === "object" || 5471 typeof returned === "function" ) && 5472 returned.then; 5473 5474 // Handle a returned thenable 5475 if ( isFunction( then ) ) { 5476 5477 // Special processors (notify) just wait for resolution 5478 if ( special ) { 5479 then.call( 5480 returned, 5481 resolve( maxDepth, deferred, Identity, special ), 5482 resolve( maxDepth, deferred, Thrower, special ) 5483 ); 5484 5485 // Normal processors (resolve) also hook into progress 5486 } else { 5487 5488 // ...and disregard older resolution values 5489 maxDepth++; 5490 5491 then.call( 5492 returned, 5493 resolve( maxDepth, deferred, Identity, special ), 5494 resolve( maxDepth, deferred, Thrower, special ), 5495 resolve( maxDepth, deferred, Identity, 5496 deferred.notifyWith ) 5497 ); 5498 } 5499 5500 // Handle all other returned values 5501 } else { 5502 5503 // Only substitute handlers pass on context 5504 // and multiple values (non-spec behavior) 5505 if ( handler !== Identity ) { 5506 that = undefined; 5507 args = [ returned ]; 5508 } 5509 5510 // Process the value(s) 5511 // Default process is resolve 5512 ( special || deferred.resolveWith )( that, args ); 5513 } 5514 }, 5515 5516 // Only normal processors (resolve) catch and reject exceptions 5517 process = special ? 5518 mightThrow : 5519 function() { 5520 try { 5521 mightThrow(); 5522 } catch ( e ) { 5523 5524 if ( jQuery.Deferred.exceptionHook ) { 5525 jQuery.Deferred.exceptionHook( e, 5526 process.error ); 5527 } 5528 5529 // Support: Promises/A+ section 2.3.3.3.4.1 5530 // https://promisesaplus.com/#point-61 5531 // Ignore post-resolution exceptions 5532 if ( depth + 1 >= maxDepth ) { 5533 5534 // Only substitute handlers pass on context 5535 // and multiple values (non-spec behavior) 5536 if ( handler !== Thrower ) { 5537 that = undefined; 5538 args = [ e ]; 5539 } 5540 5541 deferred.rejectWith( that, args ); 5542 } 5543 } 5544 }; 5545 5546 // Support: Promises/A+ section 2.3.3.3.1 5547 // https://promisesaplus.com/#point-57 5548 // Re-resolve promises immediately to dodge false rejection from 5549 // subsequent errors 5550 if ( depth ) { 5551 process(); 5552 } else { 5553 5554 // Call an optional hook to record the error, in case of exception 5555 // since it's otherwise lost when execution goes async 5556 if ( jQuery.Deferred.getErrorHook ) { 5557 process.error = jQuery.Deferred.getErrorHook(); 5558 5559 // The deprecated alias of the above. While the name suggests 5560 // returning the stack, not an error instance, jQuery just passes 5561 // it directly to `console.warn` so both will work; an instance 5562 // just better cooperates with source maps. 5563 } else if ( jQuery.Deferred.getStackHook ) { 5564 process.error = jQuery.Deferred.getStackHook(); 5565 } 5566 window.setTimeout( process ); 5567 } 5568 }; 5569 } 5570 5571 return jQuery.Deferred( function( newDefer ) { 5572 5573 // progress_handlers.add( ... ) 5574 tuples[ 0 ][ 3 ].add( 5575 resolve( 5576 0, 5577 newDefer, 5578 isFunction( onProgress ) ? 5579 onProgress : 5580 Identity, 5581 newDefer.notifyWith 5582 ) 5583 ); 5584 5585 // fulfilled_handlers.add( ... ) 5586 tuples[ 1 ][ 3 ].add( 5587 resolve( 5588 0, 5589 newDefer, 5590 isFunction( onFulfilled ) ? 5591 onFulfilled : 5592 Identity 5593 ) 5594 ); 5595 5596 // rejected_handlers.add( ... ) 5597 tuples[ 2 ][ 3 ].add( 5598 resolve( 5599 0, 5600 newDefer, 5601 isFunction( onRejected ) ? 5602 onRejected : 5603 Thrower 5604 ) 5605 ); 5606 } ).promise(); 5607 }, 5608 5609 // Get a promise for this deferred 5610 // If obj is provided, the promise aspect is added to the object 5611 promise: function( obj ) { 5612 return obj != null ? jQuery.extend( obj, promise ) : promise; 5613 } 5614 }, 5615 deferred = {}; 5616 5617 // Add list-specific methods 5618 jQuery.each( tuples, function( i, tuple ) { 5619 var list = tuple[ 2 ], 5620 stateString = tuple[ 5 ]; 5621 5622 // promise.progress = list.add 5623 // promise.done = list.add 5624 // promise.fail = list.add 5625 promise[ tuple[ 1 ] ] = list.add; 5626 5627 // Handle state 5628 if ( stateString ) { 5629 list.add( 5630 function() { 5631 5632 // state = "resolved" (i.e., fulfilled) 5633 // state = "rejected" 5634 state = stateString; 5635 }, 5636 5637 // rejected_callbacks.disable 5638 // fulfilled_callbacks.disable 5639 tuples[ 3 - i ][ 2 ].disable, 5640 5641 // rejected_handlers.disable 5642 // fulfilled_handlers.disable 5643 tuples[ 3 - i ][ 3 ].disable, 5644 5645 // progress_callbacks.lock 5646 tuples[ 0 ][ 2 ].lock, 5647 5648 // progress_handlers.lock 5649 tuples[ 0 ][ 3 ].lock 5650 ); 5651 } 5652 5653 // progress_handlers.fire 5654 // fulfilled_handlers.fire 5655 // rejected_handlers.fire 5656 list.add( tuple[ 3 ].fire ); 5657 5658 // deferred.notify = function() { deferred.notifyWith(...) } 5659 // deferred.resolve = function() { deferred.resolveWith(...) } 5660 // deferred.reject = function() { deferred.rejectWith(...) } 5661 deferred[ tuple[ 0 ] ] = function() { 5662 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 5663 return this; 5664 }; 5665 5666 // deferred.notifyWith = list.fireWith 5667 // deferred.resolveWith = list.fireWith 5668 // deferred.rejectWith = list.fireWith 5669 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 5670 } ); 5671 5672 // Make the deferred a promise 5673 promise.promise( deferred ); 5674 5675 // Call given func if any 5676 if ( func ) { 5677 func.call( deferred, deferred ); 5678 } 5679 5680 // All done! 5681 return deferred; 5682 }, 5683 5684 // Deferred helper 5685 when: function( singleValue ) { 5686 var 5687 5688 // count of uncompleted subordinates 5689 remaining = arguments.length, 5690 5691 // count of unprocessed arguments 5692 i = remaining, 5693 5694 // subordinate fulfillment data 5695 resolveContexts = Array( i ), 5696 resolveValues = slice.call( arguments ), 5697 5698 // the primary Deferred 5699 primary = jQuery.Deferred(), 5700 5701 // subordinate callback factory 5702 updateFunc = function( i ) { 5703 return function( value ) { 5704 resolveContexts[ i ] = this; 5705 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 5706 if ( !( --remaining ) ) { 5707 primary.resolveWith( resolveContexts, resolveValues ); 5708 } 5709 }; 5710 }; 5711 5712 // Single- and empty arguments are adopted like Promise.resolve 5713 if ( remaining <= 1 ) { 5714 adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, 5715 !remaining ); 5716 5717 // Use .then() to unwrap secondary thenables (cf. gh-3000) 5718 if ( primary.state() === "pending" || 5719 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 5720 5721 return primary.then(); 5722 } 5723 } 5724 5725 // Multiple arguments are aggregated like Promise.all array elements 5726 while ( i-- ) { 5727 adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); 5728 } 5729 5730 return primary.promise(); 5731 } 5732} ); 5733 5734 5735// These usually indicate a programmer mistake during development, 5736// warn about them ASAP rather than swallowing them by default. 5737var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 5738 5739// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error 5740// captured before the async barrier to get the original error cause 5741// which may otherwise be hidden. 5742jQuery.Deferred.exceptionHook = function( error, asyncError ) { 5743 5744 // Support: IE 8 - 9 only 5745 // Console exists when dev tools are open, which can happen at any time 5746 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 5747 window.console.warn( "jQuery.Deferred exception: " + error.message, 5748 error.stack, asyncError ); 5749 } 5750}; 5751 5752 5753 5754 5755jQuery.readyException = function( error ) { 5756 window.setTimeout( function() { 5757 throw error; 5758 } ); 5759}; 5760 5761 5762 5763 5764// The deferred used on DOM ready 5765var readyList = jQuery.Deferred(); 5766 5767jQuery.fn.ready = function( fn ) { 5768 5769 readyList 5770 .then( fn ) 5771 5772 // Wrap jQuery.readyException in a function so that the lookup 5773 // happens at the time of error handling instead of callback 5774 // registration. 5775 .catch( function( error ) { 5776 jQuery.readyException( error ); 5777 } ); 5778 5779 return this; 5780}; 5781 5782jQuery.extend( { 5783 5784 // Is the DOM ready to be used? Set to true once it occurs. 5785 isReady: false, 5786 5787 // A counter to track how many items to wait for before 5788 // the ready event fires. See trac-6781 5789 readyWait: 1, 5790 5791 // Handle when the DOM is ready 5792 ready: function( wait ) { 5793 5794 // Abort if there are pending holds or we're already ready 5795 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 5796 return; 5797 } 5798 5799 // Remember that the DOM is ready 5800 jQuery.isReady = true; 5801 5802 // If a normal DOM Ready event fired, decrement, and wait if need be 5803 if ( wait !== true && --jQuery.readyWait > 0 ) { 5804 return; 5805 } 5806 5807 // If there are functions bound, to execute 5808 readyList.resolveWith( document, [ jQuery ] ); 5809 } 5810} ); 5811 5812jQuery.ready.then = readyList.then; 5813 5814// The ready event handler and self cleanup method 5815function completed() { 5816 document.removeEventListener( "DOMContentLoaded", completed ); 5817 window.removeEventListener( "load", completed ); 5818 jQuery.ready(); 5819} 5820 5821// Catch cases where $(document).ready() is called 5822// after the browser event has already occurred. 5823// Support: IE <=9 - 10 only 5824// Older IE sometimes signals "interactive" too soon 5825if ( document.readyState === "complete" || 5826 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 5827 5828 // Handle it asynchronously to allow scripts the opportunity to delay ready 5829 window.setTimeout( jQuery.ready ); 5830 5831} else { 5832 5833 // Use the handy event callback 5834 document.addEventListener( "DOMContentLoaded", completed ); 5835 5836 // A fallback to window.onload, that will always work 5837 window.addEventListener( "load", completed ); 5838} 5839 5840 5841 5842 5843// Multifunctional method to get and set values of a collection 5844// The value/s can optionally be executed if it's a function 5845var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 5846 var i = 0, 5847 len = elems.length, 5848 bulk = key == null; 5849 5850 // Sets many values 5851 if ( toType( key ) === "object" ) { 5852 chainable = true; 5853 for ( i in key ) { 5854 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 5855 } 5856 5857 // Sets one value 5858 } else if ( value !== undefined ) { 5859 chainable = true; 5860 5861 if ( !isFunction( value ) ) { 5862 raw = true; 5863 } 5864 5865 if ( bulk ) { 5866 5867 // Bulk operations run against the entire set 5868 if ( raw ) { 5869 fn.call( elems, value ); 5870 fn = null; 5871 5872 // ...except when executing function values 5873 } else { 5874 bulk = fn; 5875 fn = function( elem, _key, value ) { 5876 return bulk.call( jQuery( elem ), value ); 5877 }; 5878 } 5879 } 5880 5881 if ( fn ) { 5882 for ( ; i < len; i++ ) { 5883 fn( 5884 elems[ i ], key, raw ? 5885 value : 5886 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 5887 ); 5888 } 5889 } 5890 } 5891 5892 if ( chainable ) { 5893 return elems; 5894 } 5895 5896 // Gets 5897 if ( bulk ) { 5898 return fn.call( elems ); 5899 } 5900 5901 return len ? fn( elems[ 0 ], key ) : emptyGet; 5902}; 5903 5904 5905// Matches dashed string for camelizing 5906var rmsPrefix = /^-ms-/, 5907 rdashAlpha = /-([a-z])/g; 5908 5909// Used by camelCase as callback to replace() 5910function fcamelCase( _all, letter ) { 5911 return letter.toUpperCase(); 5912} 5913 5914// Convert dashed to camelCase; used by the css and data modules 5915// Support: IE <=9 - 11, Edge 12 - 15 5916// Microsoft forgot to hump their vendor prefix (trac-9572) 5917function camelCase( string ) { 5918 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 5919} 5920var acceptData = function( owner ) { 5921 5922 // Accepts only: 5923 // - Node 5924 // - Node.ELEMENT_NODE 5925 // - Node.DOCUMENT_NODE 5926 // - Object 5927 // - Any 5928 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 5929}; 5930 5931 5932 5933 5934function Data() { 5935 this.expando = jQuery.expando + Data.uid++; 5936} 5937 5938Data.uid = 1; 5939 5940Data.prototype = { 5941 5942 cache: function( owner ) { 5943 5944 // Check if the owner object already has a cache 5945 var value = owner[ this.expando ]; 5946 5947 // If not, create one 5948 if ( !value ) { 5949 value = {}; 5950 5951 // We can accept data for non-element nodes in modern browsers, 5952 // but we should not, see trac-8335. 5953 // Always return an empty object. 5954 if ( acceptData( owner ) ) { 5955 5956 // If it is a node unlikely to be stringify-ed or looped over 5957 // use plain assignment 5958 if ( owner.nodeType ) { 5959 owner[ this.expando ] = value; 5960 5961 // Otherwise secure it in a non-enumerable property 5962 // configurable must be true to allow the property to be 5963 // deleted when data is removed 5964 } else { 5965 Object.defineProperty( owner, this.expando, { 5966 value: value, 5967 configurable: true 5968 } ); 5969 } 5970 } 5971 } 5972 5973 return value; 5974 }, 5975 set: function( owner, data, value ) { 5976 var prop, 5977 cache = this.cache( owner ); 5978 5979 // Handle: [ owner, key, value ] args 5980 // Always use camelCase key (gh-2257) 5981 if ( typeof data === "string" ) { 5982 cache[ camelCase( data ) ] = value; 5983 5984 // Handle: [ owner, { properties } ] args 5985 } else { 5986 5987 // Copy the properties one-by-one to the cache object 5988 for ( prop in data ) { 5989 cache[ camelCase( prop ) ] = data[ prop ]; 5990 } 5991 } 5992 return cache; 5993 }, 5994 get: function( owner, key ) { 5995 return key === undefined ? 5996 this.cache( owner ) : 5997 5998 // Always use camelCase key (gh-2257) 5999 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 6000 }, 6001 access: function( owner, key, value ) { 6002 6003 // In cases where either: 6004 // 6005 // 1. No key was specified 6006 // 2. A string key was specified, but no value provided 6007 // 6008 // Take the "read" path and allow the get method to determine 6009 // which value to return, respectively either: 6010 // 6011 // 1. The entire cache object 6012 // 2. The data stored at the key 6013 // 6014 if ( key === undefined || 6015 ( ( key && typeof key === "string" ) && value === undefined ) ) { 6016 6017 return this.get( owner, key ); 6018 } 6019 6020 // When the key is not a string, or both a key and value 6021 // are specified, set or extend (existing objects) with either: 6022 // 6023 // 1. An object of properties 6024 // 2. A key and value 6025 // 6026 this.set( owner, key, value ); 6027 6028 // Since the "set" path can have two possible entry points 6029 // return the expected data based on which path was taken[*] 6030 return value !== undefined ? value : key; 6031 }, 6032 remove: function( owner, key ) { 6033 var i, 6034 cache = owner[ this.expando ]; 6035 6036 if ( cache === undefined ) { 6037 return; 6038 } 6039 6040 if ( key !== undefined ) { 6041 6042 // Support array or space separated string of keys 6043 if ( Array.isArray( key ) ) { 6044 6045 // If key is an array of keys... 6046 // We always set camelCase keys, so remove that. 6047 key = key.map( camelCase ); 6048 } else { 6049 key = camelCase( key ); 6050 6051 // If a key with the spaces exists, use it. 6052 // Otherwise, create an array by matching non-whitespace 6053 key = key in cache ? 6054 [ key ] : 6055 ( key.match( rnothtmlwhite ) || [] ); 6056 } 6057 6058 i = key.length; 6059 6060 while ( i-- ) { 6061 delete cache[ key[ i ] ]; 6062 } 6063 } 6064 6065 // Remove the expando if there's no more data 6066 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 6067 6068 // Support: Chrome <=35 - 45 6069 // Webkit & Blink performance suffers when deleting properties 6070 // from DOM nodes, so set to undefined instead 6071 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 6072 if ( owner.nodeType ) { 6073 owner[ this.expando ] = undefined; 6074 } else { 6075 delete owner[ this.expando ]; 6076 } 6077 } 6078 }, 6079 hasData: function( owner ) { 6080 var cache = owner[ this.expando ]; 6081 return cache !== undefined && !jQuery.isEmptyObject( cache ); 6082 } 6083}; 6084var dataPriv = new Data(); 6085 6086var dataUser = new Data(); 6087 6088 6089 6090// Implementation Summary 6091// 6092// 1. Enforce API surface and semantic compatibility with 1.9.x branch 6093// 2. Improve the module's maintainability by reducing the storage 6094// paths to a single mechanism. 6095// 3. Use the same single mechanism to support "private" and "user" data. 6096// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 6097// 5. Avoid exposing implementation details on user objects (eg. expando properties) 6098// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 6099 6100var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 6101 rmultiDash = /[A-Z]/g; 6102 6103function getData( data ) { 6104 if ( data === "true" ) { 6105 return true; 6106 } 6107 6108 if ( data === "false" ) { 6109 return false; 6110 } 6111 6112 if ( data === "null" ) { 6113 return null; 6114 } 6115 6116 // Only convert to a number if it doesn't change the string 6117 if ( data === +data + "" ) { 6118 return +data; 6119 } 6120 6121 if ( rbrace.test( data ) ) { 6122 return JSON.parse( data ); 6123 } 6124 6125 return data; 6126} 6127 6128function dataAttr( elem, key, data ) { 6129 var name; 6130 6131 // If nothing was found internally, try to fetch any 6132 // data from the HTML5 data-* attribute 6133 if ( data === undefined && elem.nodeType === 1 ) { 6134 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 6135 data = elem.getAttribute( name ); 6136 6137 if ( typeof data === "string" ) { 6138 try { 6139 data = getData( data ); 6140 } catch ( e ) {} 6141 6142 // Make sure we set the data so it isn't changed later 6143 dataUser.set( elem, key, data ); 6144 } else { 6145 data = undefined; 6146 } 6147 } 6148 return data; 6149} 6150 6151jQuery.extend( { 6152 hasData: function( elem ) { 6153 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 6154 }, 6155 6156 data: function( elem, name, data ) { 6157 return dataUser.access( elem, name, data ); 6158 }, 6159 6160 removeData: function( elem, name ) { 6161 dataUser.remove( elem, name ); 6162 }, 6163 6164 // TODO: Now that all calls to _data and _removeData have been replaced 6165 // with direct calls to dataPriv methods, these can be deprecated. 6166 _data: function( elem, name, data ) { 6167 return dataPriv.access( elem, name, data ); 6168 }, 6169 6170 _removeData: function( elem, name ) { 6171 dataPriv.remove( elem, name ); 6172 } 6173} ); 6174 6175jQuery.fn.extend( { 6176 data: function( key, value ) { 6177 var i, name, data, 6178 elem = this[ 0 ], 6179 attrs = elem && elem.attributes; 6180 6181 // Gets all values 6182 if ( key === undefined ) { 6183 if ( this.length ) { 6184 data = dataUser.get( elem ); 6185 6186 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 6187 i = attrs.length; 6188 while ( i-- ) { 6189 6190 // Support: IE 11 only 6191 // The attrs elements can be null (trac-14894) 6192 if ( attrs[ i ] ) { 6193 name = attrs[ i ].name; 6194 if ( name.indexOf( "data-" ) === 0 ) { 6195 name = camelCase( name.slice( 5 ) ); 6196 dataAttr( elem, name, data[ name ] ); 6197 } 6198 } 6199 } 6200 dataPriv.set( elem, "hasDataAttrs", true ); 6201 } 6202 } 6203 6204 return data; 6205 } 6206 6207 // Sets multiple values 6208 if ( typeof key === "object" ) { 6209 return this.each( function() { 6210 dataUser.set( this, key ); 6211 } ); 6212 } 6213 6214 return access( this, function( value ) { 6215 var data; 6216 6217 // The calling jQuery object (element matches) is not empty 6218 // (and therefore has an element appears at this[ 0 ]) and the 6219 // `value` parameter was not undefined. An empty jQuery object 6220 // will result in `undefined` for elem = this[ 0 ] which will 6221 // throw an exception if an attempt to read a data cache is made. 6222 if ( elem && value === undefined ) { 6223 6224 // Attempt to get data from the cache 6225 // The key will always be camelCased in Data 6226 data = dataUser.get( elem, key ); 6227 if ( data !== undefined ) { 6228 return data; 6229 } 6230 6231 // Attempt to "discover" the data in 6232 // HTML5 custom data-* attrs 6233 data = dataAttr( elem, key ); 6234 if ( data !== undefined ) { 6235 return data; 6236 } 6237 6238 // We tried really hard, but the data doesn't exist. 6239 return; 6240 } 6241 6242 // Set the data... 6243 this.each( function() { 6244 6245 // We always store the camelCased key 6246 dataUser.set( this, key, value ); 6247 } ); 6248 }, null, value, arguments.length > 1, null, true ); 6249 }, 6250 6251 removeData: function( key ) { 6252 return this.each( function() { 6253 dataUser.remove( this, key ); 6254 } ); 6255 } 6256} ); 6257 6258 6259jQuery.extend( { 6260 queue: function( elem, type, data ) { 6261 var queue; 6262 6263 if ( elem ) { 6264 type = ( type || "fx" ) + "queue"; 6265 queue = dataPriv.get( elem, type ); 6266 6267 // Speed up dequeue by getting out quickly if this is just a lookup 6268 if ( data ) { 6269 if ( !queue || Array.isArray( data ) ) { 6270 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 6271 } else { 6272 queue.push( data ); 6273 } 6274 } 6275 return queue || []; 6276 } 6277 }, 6278 6279 dequeue: function( elem, type ) { 6280 type = type || "fx"; 6281 6282 var queue = jQuery.queue( elem, type ), 6283 startLength = queue.length, 6284 fn = queue.shift(), 6285 hooks = jQuery._queueHooks( elem, type ), 6286 next = function() { 6287 jQuery.dequeue( elem, type ); 6288 }; 6289 6290 // If the fx queue is dequeued, always remove the progress sentinel 6291 if ( fn === "inprogress" ) { 6292 fn = queue.shift(); 6293 startLength--; 6294 } 6295 6296 if ( fn ) { 6297 6298 // Add a progress sentinel to prevent the fx queue from being 6299 // automatically dequeued 6300 if ( type === "fx" ) { 6301 queue.unshift( "inprogress" ); 6302 } 6303 6304 // Clear up the last queue stop function 6305 delete hooks.stop; 6306 fn.call( elem, next, hooks ); 6307 } 6308 6309 if ( !startLength && hooks ) { 6310 hooks.empty.fire(); 6311 } 6312 }, 6313 6314 // Not public - generate a queueHooks object, or return the current one 6315 _queueHooks: function( elem, type ) { 6316 var key = type + "queueHooks"; 6317 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 6318 empty: jQuery.Callbacks( "once memory" ).add( function() { 6319 dataPriv.remove( elem, [ type + "queue", key ] ); 6320 } ) 6321 } ); 6322 } 6323} ); 6324 6325jQuery.fn.extend( { 6326 queue: function( type, data ) { 6327 var setter = 2; 6328 6329 if ( typeof type !== "string" ) { 6330 data = type; 6331 type = "fx"; 6332 setter--; 6333 } 6334 6335 if ( arguments.length < setter ) { 6336 return jQuery.queue( this[ 0 ], type ); 6337 } 6338 6339 return data === undefined ? 6340 this : 6341 this.each( function() { 6342 var queue = jQuery.queue( this, type, data ); 6343 6344 // Ensure a hooks for this queue 6345 jQuery._queueHooks( this, type ); 6346 6347 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 6348 jQuery.dequeue( this, type ); 6349 } 6350 } ); 6351 }, 6352 dequeue: function( type ) { 6353 return this.each( function() { 6354 jQuery.dequeue( this, type ); 6355 } ); 6356 }, 6357 clearQueue: function( type ) { 6358 return this.queue( type || "fx", [] ); 6359 }, 6360 6361 // Get a promise resolved when queues of a certain type 6362 // are emptied (fx is the type by default) 6363 promise: function( type, obj ) { 6364 var tmp, 6365 count = 1, 6366 defer = jQuery.Deferred(), 6367 elements = this, 6368 i = this.length, 6369 resolve = function() { 6370 if ( !( --count ) ) { 6371 defer.resolveWith( elements, [ elements ] ); 6372 } 6373 }; 6374 6375 if ( typeof type !== "string" ) { 6376 obj = type; 6377 type = undefined; 6378 } 6379 type = type || "fx"; 6380 6381 while ( i-- ) { 6382 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 6383 if ( tmp && tmp.empty ) { 6384 count++; 6385 tmp.empty.add( resolve ); 6386 } 6387 } 6388 resolve(); 6389 return defer.promise( obj ); 6390 } 6391} ); 6392var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 6393 6394var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 6395 6396 6397var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 6398 6399var documentElement = document.documentElement; 6400 6401 6402 6403 var isAttached = function( elem ) { 6404 return jQuery.contains( elem.ownerDocument, elem ); 6405 }, 6406 composed = { composed: true }; 6407 6408 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 6409 // Check attachment across shadow DOM boundaries when possible (gh-3504) 6410 // Support: iOS 10.0-10.2 only 6411 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 6412 // leading to errors. We need to check for `getRootNode`. 6413 if ( documentElement.getRootNode ) { 6414 isAttached = function( elem ) { 6415 return jQuery.contains( elem.ownerDocument, elem ) || 6416 elem.getRootNode( composed ) === elem.ownerDocument; 6417 }; 6418 } 6419var isHiddenWithinTree = function( elem, el ) { 6420 6421 // isHiddenWithinTree might be called from jQuery#filter function; 6422 // in that case, element will be second argument 6423 elem = el || elem; 6424 6425 // Inline style trumps all 6426 return elem.style.display === "none" || 6427 elem.style.display === "" && 6428 6429 // Otherwise, check computed style 6430 // Support: Firefox <=43 - 45 6431 // Disconnected elements can have computed display: none, so first confirm that elem is 6432 // in the document. 6433 isAttached( elem ) && 6434 6435 jQuery.css( elem, "display" ) === "none"; 6436 }; 6437 6438 6439 6440function adjustCSS( elem, prop, valueParts, tween ) { 6441 var adjusted, scale, 6442 maxIterations = 20, 6443 currentValue = tween ? 6444 function() { 6445 return tween.cur(); 6446 } : 6447 function() { 6448 return jQuery.css( elem, prop, "" ); 6449 }, 6450 initial = currentValue(), 6451 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 6452 6453 // Starting value computation is required for potential unit mismatches 6454 initialInUnit = elem.nodeType && 6455 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 6456 rcssNum.exec( jQuery.css( elem, prop ) ); 6457 6458 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 6459 6460 // Support: Firefox <=54 6461 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 6462 initial = initial / 2; 6463 6464 // Trust units reported by jQuery.css 6465 unit = unit || initialInUnit[ 3 ]; 6466 6467 // Iteratively approximate from a nonzero starting point 6468 initialInUnit = +initial || 1; 6469 6470 while ( maxIterations-- ) { 6471 6472 // Evaluate and update our best guess (doubling guesses that zero out). 6473 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 6474 jQuery.style( elem, prop, initialInUnit + unit ); 6475 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 6476 maxIterations = 0; 6477 } 6478 initialInUnit = initialInUnit / scale; 6479 6480 } 6481 6482 initialInUnit = initialInUnit * 2; 6483 jQuery.style( elem, prop, initialInUnit + unit ); 6484 6485 // Make sure we update the tween properties later on 6486 valueParts = valueParts || []; 6487 } 6488 6489 if ( valueParts ) { 6490 initialInUnit = +initialInUnit || +initial || 0; 6491 6492 // Apply relative offset (+=/-=) if specified 6493 adjusted = valueParts[ 1 ] ? 6494 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 6495 +valueParts[ 2 ]; 6496 if ( tween ) { 6497 tween.unit = unit; 6498 tween.start = initialInUnit; 6499 tween.end = adjusted; 6500 } 6501 } 6502 return adjusted; 6503} 6504 6505 6506var defaultDisplayMap = {}; 6507 6508function getDefaultDisplay( elem ) { 6509 var temp, 6510 doc = elem.ownerDocument, 6511 nodeName = elem.nodeName, 6512 display = defaultDisplayMap[ nodeName ]; 6513 6514 if ( display ) { 6515 return display; 6516 } 6517 6518 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 6519 display = jQuery.css( temp, "display" ); 6520 6521 temp.parentNode.removeChild( temp ); 6522 6523 if ( display === "none" ) { 6524 display = "block"; 6525 } 6526 defaultDisplayMap[ nodeName ] = display; 6527 6528 return display; 6529} 6530 6531function showHide( elements, show ) { 6532 var display, elem, 6533 values = [], 6534 index = 0, 6535 length = elements.length; 6536 6537 // Determine new display value for elements that need to change 6538 for ( ; index < length; index++ ) { 6539 elem = elements[ index ]; 6540 if ( !elem.style ) { 6541 continue; 6542 } 6543 6544 display = elem.style.display; 6545 if ( show ) { 6546 6547 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 6548 // check is required in this first loop unless we have a nonempty display value (either 6549 // inline or about-to-be-restored) 6550 if ( display === "none" ) { 6551 values[ index ] = dataPriv.get( elem, "display" ) || null; 6552 if ( !values[ index ] ) { 6553 elem.style.display = ""; 6554 } 6555 } 6556 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 6557 values[ index ] = getDefaultDisplay( elem ); 6558 } 6559 } else { 6560 if ( display !== "none" ) { 6561 values[ index ] = "none"; 6562 6563 // Remember what we're overwriting 6564 dataPriv.set( elem, "display", display ); 6565 } 6566 } 6567 } 6568 6569 // Set the display of the elements in a second loop to avoid constant reflow 6570 for ( index = 0; index < length; index++ ) { 6571 if ( values[ index ] != null ) { 6572 elements[ index ].style.display = values[ index ]; 6573 } 6574 } 6575 6576 return elements; 6577} 6578 6579jQuery.fn.extend( { 6580 show: function() { 6581 return showHide( this, true ); 6582 }, 6583 hide: function() { 6584 return showHide( this ); 6585 }, 6586 toggle: function( state ) { 6587 if ( typeof state === "boolean" ) { 6588 return state ? this.show() : this.hide(); 6589 } 6590 6591 return this.each( function() { 6592 if ( isHiddenWithinTree( this ) ) { 6593 jQuery( this ).show(); 6594 } else { 6595 jQuery( this ).hide(); 6596 } 6597 } ); 6598 } 6599} ); 6600var rcheckableType = ( /^(?:checkbox|radio)$/i ); 6601 6602var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 6603 6604var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 6605 6606 6607 6608( function() { 6609 var fragment = document.createDocumentFragment(), 6610 div = fragment.appendChild( document.createElement( "div" ) ), 6611 input = document.createElement( "input" ); 6612 6613 // Support: Android 4.0 - 4.3 only 6614 // Check state lost if the name is set (trac-11217) 6615 // Support: Windows Web Apps (WWA) 6616 // `name` and `type` must use .setAttribute for WWA (trac-14901) 6617 input.setAttribute( "type", "radio" ); 6618 input.setAttribute( "checked", "checked" ); 6619 input.setAttribute( "name", "t" ); 6620 6621 div.appendChild( input ); 6622 6623 // Support: Android <=4.1 only 6624 // Older WebKit doesn't clone checked state correctly in fragments 6625 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 6626 6627 // Support: IE <=11 only 6628 // Make sure textarea (and checkbox) defaultValue is properly cloned 6629 div.innerHTML = "<textarea>x</textarea>"; 6630 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 6631 6632 // Support: IE <=9 only 6633 // IE <=9 replaces <option> tags with their contents when inserted outside of 6634 // the select element. 6635 div.innerHTML = "<option></option>"; 6636 support.option = !!div.lastChild; 6637} )(); 6638 6639 6640// We have to close these tags to support XHTML (trac-13200) 6641var wrapMap = { 6642 6643 // XHTML parsers do not magically insert elements in the 6644 // same way that tag soup parsers do. So we cannot shorten 6645 // this by omitting <tbody> or other required elements. 6646 thead: [ 1, "<table>", "</table>" ], 6647 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 6648 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 6649 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 6650 6651 _default: [ 0, "", "" ] 6652}; 6653 6654wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 6655wrapMap.th = wrapMap.td; 6656 6657// Support: IE <=9 only 6658if ( !support.option ) { 6659 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 6660} 6661 6662 6663function getAll( context, tag ) { 6664 6665 // Support: IE <=9 - 11 only 6666 // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) 6667 var ret; 6668 6669 if ( typeof context.getElementsByTagName !== "undefined" ) { 6670 ret = context.getElementsByTagName( tag || "*" ); 6671 6672 } else if ( typeof context.querySelectorAll !== "undefined" ) { 6673 ret = context.querySelectorAll( tag || "*" ); 6674 6675 } else { 6676 ret = []; 6677 } 6678 6679 if ( tag === undefined || tag && nodeName( context, tag ) ) { 6680 return jQuery.merge( [ context ], ret ); 6681 } 6682 6683 return ret; 6684} 6685 6686 6687// Mark scripts as having already been evaluated 6688function setGlobalEval( elems, refElements ) { 6689 var i = 0, 6690 l = elems.length; 6691 6692 for ( ; i < l; i++ ) { 6693 dataPriv.set( 6694 elems[ i ], 6695 "globalEval", 6696 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 6697 ); 6698 } 6699} 6700 6701 6702var rhtml = /<|&#?\w+;/; 6703 6704function buildFragment( elems, context, scripts, selection, ignored ) { 6705 var elem, tmp, tag, wrap, attached, j, 6706 fragment = context.createDocumentFragment(), 6707 nodes = [], 6708 i = 0, 6709 l = elems.length; 6710 6711 for ( ; i < l; i++ ) { 6712 elem = elems[ i ]; 6713 6714 if ( elem || elem === 0 ) { 6715 6716 // Add nodes directly 6717 if ( toType( elem ) === "object" ) { 6718 6719 // Support: Android <=4.0 only, PhantomJS 1 only 6720 // push.apply(_, arraylike) throws on ancient WebKit 6721 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 6722 6723 // Convert non-html into a text node 6724 } else if ( !rhtml.test( elem ) ) { 6725 nodes.push( context.createTextNode( elem ) ); 6726 6727 // Convert html into DOM nodes 6728 } else { 6729 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 6730 6731 // Deserialize a standard representation 6732 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 6733 wrap = wrapMap[ tag ] || wrapMap._default; 6734 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 6735 6736 // Descend through wrappers to the right content 6737 j = wrap[ 0 ]; 6738 while ( j-- ) { 6739 tmp = tmp.lastChild; 6740 } 6741 6742 // Support: Android <=4.0 only, PhantomJS 1 only 6743 // push.apply(_, arraylike) throws on ancient WebKit 6744 jQuery.merge( nodes, tmp.childNodes ); 6745 6746 // Remember the top-level container 6747 tmp = fragment.firstChild; 6748 6749 // Ensure the created nodes are orphaned (trac-12392) 6750 tmp.textContent = ""; 6751 } 6752 } 6753 } 6754 6755 // Remove wrapper from fragment 6756 fragment.textContent = ""; 6757 6758 i = 0; 6759 while ( ( elem = nodes[ i++ ] ) ) { 6760 6761 // Skip elements already in the context collection (trac-4087) 6762 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 6763 if ( ignored ) { 6764 ignored.push( elem ); 6765 } 6766 continue; 6767 } 6768 6769 attached = isAttached( elem ); 6770 6771 // Append to fragment 6772 tmp = getAll( fragment.appendChild( elem ), "script" ); 6773 6774 // Preserve script evaluation history 6775 if ( attached ) { 6776 setGlobalEval( tmp ); 6777 } 6778 6779 // Capture executables 6780 if ( scripts ) { 6781 j = 0; 6782 while ( ( elem = tmp[ j++ ] ) ) { 6783 if ( rscriptType.test( elem.type || "" ) ) { 6784 scripts.push( elem ); 6785 } 6786 } 6787 } 6788 } 6789 6790 return fragment; 6791} 6792 6793 6794var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 6795 6796function returnTrue() { 6797 return true; 6798} 6799 6800function returnFalse() { 6801 return false; 6802} 6803 6804function on( elem, types, selector, data, fn, one ) { 6805 var origFn, type; 6806 6807 // Types can be a map of types/handlers 6808 if ( typeof types === "object" ) { 6809 6810 // ( types-Object, selector, data ) 6811 if ( typeof selector !== "string" ) { 6812 6813 // ( types-Object, data ) 6814 data = data || selector; 6815 selector = undefined; 6816 } 6817 for ( type in types ) { 6818 on( elem, type, selector, data, types[ type ], one ); 6819 } 6820 return elem; 6821 } 6822 6823 if ( data == null && fn == null ) { 6824 6825 // ( types, fn ) 6826 fn = selector; 6827 data = selector = undefined; 6828 } else if ( fn == null ) { 6829 if ( typeof selector === "string" ) { 6830 6831 // ( types, selector, fn ) 6832 fn = data; 6833 data = undefined; 6834 } else { 6835 6836 // ( types, data, fn ) 6837 fn = data; 6838 data = selector; 6839 selector = undefined; 6840 } 6841 } 6842 if ( fn === false ) { 6843 fn = returnFalse; 6844 } else if ( !fn ) { 6845 return elem; 6846 } 6847 6848 if ( one === 1 ) { 6849 origFn = fn; 6850 fn = function( event ) { 6851 6852 // Can use an empty set, since event contains the info 6853 jQuery().off( event ); 6854 return origFn.apply( this, arguments ); 6855 }; 6856 6857 // Use same guid so caller can remove using origFn 6858 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 6859 } 6860 return elem.each( function() { 6861 jQuery.event.add( this, types, fn, data, selector ); 6862 } ); 6863} 6864 6865/* 6866 * Helper functions for managing events -- not part of the public interface. 6867 * Props to Dean Edwards' addEvent library for many of the ideas. 6868 */ 6869jQuery.event = { 6870 6871 global: {}, 6872 6873 add: function( elem, types, handler, data, selector ) { 6874 6875 var handleObjIn, eventHandle, tmp, 6876 events, t, handleObj, 6877 special, handlers, type, namespaces, origType, 6878 elemData = dataPriv.get( elem ); 6879 6880 // Only attach events to objects that accept data 6881 if ( !acceptData( elem ) ) { 6882 return; 6883 } 6884 6885 // Caller can pass in an object of custom data in lieu of the handler 6886 if ( handler.handler ) { 6887 handleObjIn = handler; 6888 handler = handleObjIn.handler; 6889 selector = handleObjIn.selector; 6890 } 6891 6892 // Ensure that invalid selectors throw exceptions at attach time 6893 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 6894 if ( selector ) { 6895 jQuery.find.matchesSelector( documentElement, selector ); 6896 } 6897 6898 // Make sure that the handler has a unique ID, used to find/remove it later 6899 if ( !handler.guid ) { 6900 handler.guid = jQuery.guid++; 6901 } 6902 6903 // Init the element's event structure and main handler, if this is the first 6904 if ( !( events = elemData.events ) ) { 6905 events = elemData.events = Object.create( null ); 6906 } 6907 if ( !( eventHandle = elemData.handle ) ) { 6908 eventHandle = elemData.handle = function( e ) { 6909 6910 // Discard the second event of a jQuery.event.trigger() and 6911 // when an event is called after a page has unloaded 6912 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 6913 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 6914 }; 6915 } 6916 6917 // Handle multiple events separated by a space 6918 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 6919 t = types.length; 6920 while ( t-- ) { 6921 tmp = rtypenamespace.exec( types[ t ] ) || []; 6922 type = origType = tmp[ 1 ]; 6923 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 6924 6925 // There *must* be a type, no attaching namespace-only handlers 6926 if ( !type ) { 6927 continue; 6928 } 6929 6930 // If event changes its type, use the special event handlers for the changed type 6931 special = jQuery.event.special[ type ] || {}; 6932 6933 // If selector defined, determine special event api type, otherwise given type 6934 type = ( selector ? special.delegateType : special.bindType ) || type; 6935 6936 // Update special based on newly reset type 6937 special = jQuery.event.special[ type ] || {}; 6938 6939 // handleObj is passed to all event handlers 6940 handleObj = jQuery.extend( { 6941 type: type, 6942 origType: origType, 6943 data: data, 6944 handler: handler, 6945 guid: handler.guid, 6946 selector: selector, 6947 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 6948 namespace: namespaces.join( "." ) 6949 }, handleObjIn ); 6950 6951 // Init the event handler queue if we're the first 6952 if ( !( handlers = events[ type ] ) ) { 6953 handlers = events[ type ] = []; 6954 handlers.delegateCount = 0; 6955 6956 // Only use addEventListener if the special events handler returns false 6957 if ( !special.setup || 6958 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 6959 6960 if ( elem.addEventListener ) { 6961 elem.addEventListener( type, eventHandle ); 6962 } 6963 } 6964 } 6965 6966 if ( special.add ) { 6967 special.add.call( elem, handleObj ); 6968 6969 if ( !handleObj.handler.guid ) { 6970 handleObj.handler.guid = handler.guid; 6971 } 6972 } 6973 6974 // Add to the element's handler list, delegates in front 6975 if ( selector ) { 6976 handlers.splice( handlers.delegateCount++, 0, handleObj ); 6977 } else { 6978 handlers.push( handleObj ); 6979 } 6980 6981 // Keep track of which events have ever been used, for event optimization 6982 jQuery.event.global[ type ] = true; 6983 } 6984 6985 }, 6986 6987 // Detach an event or set of events from an element 6988 remove: function( elem, types, handler, selector, mappedTypes ) { 6989 6990 var j, origCount, tmp, 6991 events, t, handleObj, 6992 special, handlers, type, namespaces, origType, 6993 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 6994 6995 if ( !elemData || !( events = elemData.events ) ) { 6996 return; 6997 } 6998 6999 // Once for each type.namespace in types; type may be omitted 7000 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 7001 t = types.length; 7002 while ( t-- ) { 7003 tmp = rtypenamespace.exec( types[ t ] ) || []; 7004 type = origType = tmp[ 1 ]; 7005 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 7006 7007 // Unbind all events (on this namespace, if provided) for the element 7008 if ( !type ) { 7009 for ( type in events ) { 7010 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 7011 } 7012 continue; 7013 } 7014 7015 special = jQuery.event.special[ type ] || {}; 7016 type = ( selector ? special.delegateType : special.bindType ) || type; 7017 handlers = events[ type ] || []; 7018 tmp = tmp[ 2 ] && 7019 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 7020 7021 // Remove matching events 7022 origCount = j = handlers.length; 7023 while ( j-- ) { 7024 handleObj = handlers[ j ]; 7025 7026 if ( ( mappedTypes || origType === handleObj.origType ) && 7027 ( !handler || handler.guid === handleObj.guid ) && 7028 ( !tmp || tmp.test( handleObj.namespace ) ) && 7029 ( !selector || selector === handleObj.selector || 7030 selector === "**" && handleObj.selector ) ) { 7031 handlers.splice( j, 1 ); 7032 7033 if ( handleObj.selector ) { 7034 handlers.delegateCount--; 7035 } 7036 if ( special.remove ) { 7037 special.remove.call( elem, handleObj ); 7038 } 7039 } 7040 } 7041 7042 // Remove generic event handler if we removed something and no more handlers exist 7043 // (avoids potential for endless recursion during removal of special event handlers) 7044 if ( origCount && !handlers.length ) { 7045 if ( !special.teardown || 7046 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 7047 7048 jQuery.removeEvent( elem, type, elemData.handle ); 7049 } 7050 7051 delete events[ type ]; 7052 } 7053 } 7054 7055 // Remove data and the expando if it's no longer used 7056 if ( jQuery.isEmptyObject( events ) ) { 7057 dataPriv.remove( elem, "handle events" ); 7058 } 7059 }, 7060 7061 dispatch: function( nativeEvent ) { 7062 7063 var i, j, ret, matched, handleObj, handlerQueue, 7064 args = new Array( arguments.length ), 7065 7066 // Make a writable jQuery.Event from the native event object 7067 event = jQuery.event.fix( nativeEvent ), 7068 7069 handlers = ( 7070 dataPriv.get( this, "events" ) || Object.create( null ) 7071 )[ event.type ] || [], 7072 special = jQuery.event.special[ event.type ] || {}; 7073 7074 // Use the fix-ed jQuery.Event rather than the (read-only) native event 7075 args[ 0 ] = event; 7076 7077 for ( i = 1; i < arguments.length; i++ ) { 7078 args[ i ] = arguments[ i ]; 7079 } 7080 7081 event.delegateTarget = this; 7082 7083 // Call the preDispatch hook for the mapped type, and let it bail if desired 7084 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 7085 return; 7086 } 7087 7088 // Determine handlers 7089 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 7090 7091 // Run delegates first; they may want to stop propagation beneath us 7092 i = 0; 7093 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 7094 event.currentTarget = matched.elem; 7095 7096 j = 0; 7097 while ( ( handleObj = matched.handlers[ j++ ] ) && 7098 !event.isImmediatePropagationStopped() ) { 7099 7100 // If the event is namespaced, then each handler is only invoked if it is 7101 // specially universal or its namespaces are a superset of the event's. 7102 if ( !event.rnamespace || handleObj.namespace === false || 7103 event.rnamespace.test( handleObj.namespace ) ) { 7104 7105 event.handleObj = handleObj; 7106 event.data = handleObj.data; 7107 7108 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 7109 handleObj.handler ).apply( matched.elem, args ); 7110 7111 if ( ret !== undefined ) { 7112 if ( ( event.result = ret ) === false ) { 7113 event.preventDefault(); 7114 event.stopPropagation(); 7115 } 7116 } 7117 } 7118 } 7119 } 7120 7121 // Call the postDispatch hook for the mapped type 7122 if ( special.postDispatch ) { 7123 special.postDispatch.call( this, event ); 7124 } 7125 7126 return event.result; 7127 }, 7128 7129 handlers: function( event, handlers ) { 7130 var i, handleObj, sel, matchedHandlers, matchedSelectors, 7131 handlerQueue = [], 7132 delegateCount = handlers.delegateCount, 7133 cur = event.target; 7134 7135 // Find delegate handlers 7136 if ( delegateCount && 7137 7138 // Support: IE <=9 7139 // Black-hole SVG <use> instance trees (trac-13180) 7140 cur.nodeType && 7141 7142 // Support: Firefox <=42 7143 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 7144 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 7145 // Support: IE 11 only 7146 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 7147 !( event.type === "click" && event.button >= 1 ) ) { 7148 7149 for ( ; cur !== this; cur = cur.parentNode || this ) { 7150 7151 // Don't check non-elements (trac-13208) 7152 // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764) 7153 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 7154 matchedHandlers = []; 7155 matchedSelectors = {}; 7156 for ( i = 0; i < delegateCount; i++ ) { 7157 handleObj = handlers[ i ]; 7158 7159 // Don't conflict with Object.prototype properties (trac-13203) 7160 sel = handleObj.selector + " "; 7161 7162 if ( matchedSelectors[ sel ] === undefined ) { 7163 matchedSelectors[ sel ] = handleObj.needsContext ? 7164 jQuery( sel, this ).index( cur ) > -1 : 7165 jQuery.find( sel, this, null, [ cur ] ).length; 7166 } 7167 if ( matchedSelectors[ sel ] ) { 7168 matchedHandlers.push( handleObj ); 7169 } 7170 } 7171 if ( matchedHandlers.length ) { 7172 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 7173 } 7174 } 7175 } 7176 } 7177 7178 // Add the remaining (directly-bound) handlers 7179 cur = this; 7180 if ( delegateCount < handlers.length ) { 7181 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 7182 } 7183 7184 return handlerQueue; 7185 }, 7186 7187 addProp: function( name, hook ) { 7188 Object.defineProperty( jQuery.Event.prototype, name, { 7189 enumerable: true, 7190 configurable: true, 7191 7192 get: isFunction( hook ) ? 7193 function() { 7194 if ( this.originalEvent ) { 7195 return hook( this.originalEvent ); 7196 } 7197 } : 7198 function() { 7199 if ( this.originalEvent ) { 7200 return this.originalEvent[ name ]; 7201 } 7202 }, 7203 7204 set: function( value ) { 7205 Object.defineProperty( this, name, { 7206 enumerable: true, 7207 configurable: true, 7208 writable: true, 7209 value: value 7210 } ); 7211 } 7212 } ); 7213 }, 7214 7215 fix: function( originalEvent ) { 7216 return originalEvent[ jQuery.expando ] ? 7217 originalEvent : 7218 new jQuery.Event( originalEvent ); 7219 }, 7220 7221 special: { 7222 load: { 7223 7224 // Prevent triggered image.load events from bubbling to window.load 7225 noBubble: true 7226 }, 7227 click: { 7228 7229 // Utilize native event to ensure correct state for checkable inputs 7230 setup: function( data ) { 7231 7232 // For mutual compressibility with _default, replace `this` access with a local var. 7233 // `|| data` is dead code meant only to preserve the variable through minification. 7234 var el = this || data; 7235 7236 // Claim the first handler 7237 if ( rcheckableType.test( el.type ) && 7238 el.click && nodeName( el, "input" ) ) { 7239 7240 // dataPriv.set( el, "click", ... ) 7241 leverageNative( el, "click", true ); 7242 } 7243 7244 // Return false to allow normal processing in the caller 7245 return false; 7246 }, 7247 trigger: function( data ) { 7248 7249 // For mutual compressibility with _default, replace `this` access with a local var. 7250 // `|| data` is dead code meant only to preserve the variable through minification. 7251 var el = this || data; 7252 7253 // Force setup before triggering a click 7254 if ( rcheckableType.test( el.type ) && 7255 el.click && nodeName( el, "input" ) ) { 7256 7257 leverageNative( el, "click" ); 7258 } 7259 7260 // Return non-false to allow normal event-path propagation 7261 return true; 7262 }, 7263 7264 // For cross-browser consistency, suppress native .click() on links 7265 // Also prevent it if we're currently inside a leveraged native-event stack 7266 _default: function( event ) { 7267 var target = event.target; 7268 return rcheckableType.test( target.type ) && 7269 target.click && nodeName( target, "input" ) && 7270 dataPriv.get( target, "click" ) || 7271 nodeName( target, "a" ); 7272 } 7273 }, 7274 7275 beforeunload: { 7276 postDispatch: function( event ) { 7277 7278 // Support: Firefox 20+ 7279 // Firefox doesn't alert if the returnValue field is not set. 7280 if ( event.result !== undefined && event.originalEvent ) { 7281 event.originalEvent.returnValue = event.result; 7282 } 7283 } 7284 } 7285 } 7286}; 7287 7288// Ensure the presence of an event listener that handles manually-triggered 7289// synthetic events by interrupting progress until reinvoked in response to 7290// *native* events that it fires directly, ensuring that state changes have 7291// already occurred before other listeners are invoked. 7292function leverageNative( el, type, isSetup ) { 7293 7294 // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add 7295 if ( !isSetup ) { 7296 if ( dataPriv.get( el, type ) === undefined ) { 7297 jQuery.event.add( el, type, returnTrue ); 7298 } 7299 return; 7300 } 7301 7302 // Register the controller as a special universal handler for all event namespaces 7303 dataPriv.set( el, type, false ); 7304 jQuery.event.add( el, type, { 7305 namespace: false, 7306 handler: function( event ) { 7307 var result, 7308 saved = dataPriv.get( this, type ); 7309 7310 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 7311 7312 // Interrupt processing of the outer synthetic .trigger()ed event 7313 if ( !saved ) { 7314 7315 // Store arguments for use when handling the inner native event 7316 // There will always be at least one argument (an event object), so this array 7317 // will not be confused with a leftover capture object. 7318 saved = slice.call( arguments ); 7319 dataPriv.set( this, type, saved ); 7320 7321 // Trigger the native event and capture its result 7322 this[ type ](); 7323 result = dataPriv.get( this, type ); 7324 dataPriv.set( this, type, false ); 7325 7326 if ( saved !== result ) { 7327 7328 // Cancel the outer synthetic event 7329 event.stopImmediatePropagation(); 7330 event.preventDefault(); 7331 7332 return result; 7333 } 7334 7335 // If this is an inner synthetic event for an event with a bubbling surrogate 7336 // (focus or blur), assume that the surrogate already propagated from triggering 7337 // the native event and prevent that from happening again here. 7338 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 7339 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 7340 // less bad than duplication. 7341 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 7342 event.stopPropagation(); 7343 } 7344 7345 // If this is a native event triggered above, everything is now in order 7346 // Fire an inner synthetic event with the original arguments 7347 } else if ( saved ) { 7348 7349 // ...and capture the result 7350 dataPriv.set( this, type, jQuery.event.trigger( 7351 saved[ 0 ], 7352 saved.slice( 1 ), 7353 this 7354 ) ); 7355 7356 // Abort handling of the native event by all jQuery handlers while allowing 7357 // native handlers on the same element to run. On target, this is achieved 7358 // by stopping immediate propagation just on the jQuery event. However, 7359 // the native event is re-wrapped by a jQuery one on each level of the 7360 // propagation so the only way to stop it for jQuery is to stop it for 7361 // everyone via native `stopPropagation()`. This is not a problem for 7362 // focus/blur which don't bubble, but it does also stop click on checkboxes 7363 // and radios. We accept this limitation. 7364 event.stopPropagation(); 7365 event.isImmediatePropagationStopped = returnTrue; 7366 } 7367 } 7368 } ); 7369} 7370 7371jQuery.removeEvent = function( elem, type, handle ) { 7372 7373 // This "if" is needed for plain objects 7374 if ( elem.removeEventListener ) { 7375 elem.removeEventListener( type, handle ); 7376 } 7377}; 7378 7379jQuery.Event = function( src, props ) { 7380 7381 // Allow instantiation without the 'new' keyword 7382 if ( !( this instanceof jQuery.Event ) ) { 7383 return new jQuery.Event( src, props ); 7384 } 7385 7386 // Event object 7387 if ( src && src.type ) { 7388 this.originalEvent = src; 7389 this.type = src.type; 7390 7391 // Events bubbling up the document may have been marked as prevented 7392 // by a handler lower down the tree; reflect the correct value. 7393 this.isDefaultPrevented = src.defaultPrevented || 7394 src.defaultPrevented === undefined && 7395 7396 // Support: Android <=2.3 only 7397 src.returnValue === false ? 7398 returnTrue : 7399 returnFalse; 7400 7401 // Create target properties 7402 // Support: Safari <=6 - 7 only 7403 // Target should not be a text node (trac-504, trac-13143) 7404 this.target = ( src.target && src.target.nodeType === 3 ) ? 7405 src.target.parentNode : 7406 src.target; 7407 7408 this.currentTarget = src.currentTarget; 7409 this.relatedTarget = src.relatedTarget; 7410 7411 // Event type 7412 } else { 7413 this.type = src; 7414 } 7415 7416 // Put explicitly provided properties onto the event object 7417 if ( props ) { 7418 jQuery.extend( this, props ); 7419 } 7420 7421 // Create a timestamp if incoming event doesn't have one 7422 this.timeStamp = src && src.timeStamp || Date.now(); 7423 7424 // Mark it as fixed 7425 this[ jQuery.expando ] = true; 7426}; 7427 7428// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 7429// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 7430jQuery.Event.prototype = { 7431 constructor: jQuery.Event, 7432 isDefaultPrevented: returnFalse, 7433 isPropagationStopped: returnFalse, 7434 isImmediatePropagationStopped: returnFalse, 7435 isSimulated: false, 7436 7437 preventDefault: function() { 7438 var e = this.originalEvent; 7439 7440 this.isDefaultPrevented = returnTrue; 7441 7442 if ( e && !this.isSimulated ) { 7443 e.preventDefault(); 7444 } 7445 }, 7446 stopPropagation: function() { 7447 var e = this.originalEvent; 7448 7449 this.isPropagationStopped = returnTrue; 7450 7451 if ( e && !this.isSimulated ) { 7452 e.stopPropagation(); 7453 } 7454 }, 7455 stopImmediatePropagation: function() { 7456 var e = this.originalEvent; 7457 7458 this.isImmediatePropagationStopped = returnTrue; 7459 7460 if ( e && !this.isSimulated ) { 7461 e.stopImmediatePropagation(); 7462 } 7463 7464 this.stopPropagation(); 7465 } 7466}; 7467 7468// Includes all common event props including KeyEvent and MouseEvent specific props 7469jQuery.each( { 7470 altKey: true, 7471 bubbles: true, 7472 cancelable: true, 7473 changedTouches: true, 7474 ctrlKey: true, 7475 detail: true, 7476 eventPhase: true, 7477 metaKey: true, 7478 pageX: true, 7479 pageY: true, 7480 shiftKey: true, 7481 view: true, 7482 "char": true, 7483 code: true, 7484 charCode: true, 7485 key: true, 7486 keyCode: true, 7487 button: true, 7488 buttons: true, 7489 clientX: true, 7490 clientY: true, 7491 offsetX: true, 7492 offsetY: true, 7493 pointerId: true, 7494 pointerType: true, 7495 screenX: true, 7496 screenY: true, 7497 targetTouches: true, 7498 toElement: true, 7499 touches: true, 7500 which: true 7501}, jQuery.event.addProp ); 7502 7503jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 7504 7505 function focusMappedHandler( nativeEvent ) { 7506 if ( document.documentMode ) { 7507 7508 // Support: IE 11+ 7509 // Attach a single focusin/focusout handler on the document while someone wants 7510 // focus/blur. This is because the former are synchronous in IE while the latter 7511 // are async. In other browsers, all those handlers are invoked synchronously. 7512 7513 // `handle` from private data would already wrap the event, but we need 7514 // to change the `type` here. 7515 var handle = dataPriv.get( this, "handle" ), 7516 event = jQuery.event.fix( nativeEvent ); 7517 event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; 7518 event.isSimulated = true; 7519 7520 // First, handle focusin/focusout 7521 handle( nativeEvent ); 7522 7523 // ...then, handle focus/blur 7524 // 7525 // focus/blur don't bubble while focusin/focusout do; simulate the former by only 7526 // invoking the handler at the lower level. 7527 if ( event.target === event.currentTarget ) { 7528 7529 // The setup part calls `leverageNative`, which, in turn, calls 7530 // `jQuery.event.add`, so event handle will already have been set 7531 // by this point. 7532 handle( event ); 7533 } 7534 } else { 7535 7536 // For non-IE browsers, attach a single capturing handler on the document 7537 // while someone wants focusin/focusout. 7538 jQuery.event.simulate( delegateType, nativeEvent.target, 7539 jQuery.event.fix( nativeEvent ) ); 7540 } 7541 } 7542 7543 jQuery.event.special[ type ] = { 7544 7545 // Utilize native event if possible so blur/focus sequence is correct 7546 setup: function() { 7547 7548 var attaches; 7549 7550 // Claim the first handler 7551 // dataPriv.set( this, "focus", ... ) 7552 // dataPriv.set( this, "blur", ... ) 7553 leverageNative( this, type, true ); 7554 7555 if ( document.documentMode ) { 7556 7557 // Support: IE 9 - 11+ 7558 // We use the same native handler for focusin & focus (and focusout & blur) 7559 // so we need to coordinate setup & teardown parts between those events. 7560 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 7561 attaches = dataPriv.get( this, delegateType ); 7562 if ( !attaches ) { 7563 this.addEventListener( delegateType, focusMappedHandler ); 7564 } 7565 dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 ); 7566 } else { 7567 7568 // Return false to allow normal processing in the caller 7569 return false; 7570 } 7571 }, 7572 trigger: function() { 7573 7574 // Force setup before trigger 7575 leverageNative( this, type ); 7576 7577 // Return non-false to allow normal event-path propagation 7578 return true; 7579 }, 7580 7581 teardown: function() { 7582 var attaches; 7583 7584 if ( document.documentMode ) { 7585 attaches = dataPriv.get( this, delegateType ) - 1; 7586 if ( !attaches ) { 7587 this.removeEventListener( delegateType, focusMappedHandler ); 7588 dataPriv.remove( this, delegateType ); 7589 } else { 7590 dataPriv.set( this, delegateType, attaches ); 7591 } 7592 } else { 7593 7594 // Return false to indicate standard teardown should be applied 7595 return false; 7596 } 7597 }, 7598 7599 // Suppress native focus or blur if we're currently inside 7600 // a leveraged native-event stack 7601 _default: function( event ) { 7602 return dataPriv.get( event.target, type ); 7603 }, 7604 7605 delegateType: delegateType 7606 }; 7607 7608 // Support: Firefox <=44 7609 // Firefox doesn't have focus(in | out) events 7610 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 7611 // 7612 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 7613 // focus(in | out) events fire after focus & blur events, 7614 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 7615 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 7616 // 7617 // Support: IE 9 - 11+ 7618 // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, 7619 // attach a single handler for both events in IE. 7620 jQuery.event.special[ delegateType ] = { 7621 setup: function() { 7622 7623 // Handle: regular nodes (via `this.ownerDocument`), window 7624 // (via `this.document`) & document (via `this`). 7625 var doc = this.ownerDocument || this.document || this, 7626 dataHolder = document.documentMode ? this : doc, 7627 attaches = dataPriv.get( dataHolder, delegateType ); 7628 7629 // Support: IE 9 - 11+ 7630 // We use the same native handler for focusin & focus (and focusout & blur) 7631 // so we need to coordinate setup & teardown parts between those events. 7632 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 7633 if ( !attaches ) { 7634 if ( document.documentMode ) { 7635 this.addEventListener( delegateType, focusMappedHandler ); 7636 } else { 7637 doc.addEventListener( type, focusMappedHandler, true ); 7638 } 7639 } 7640 dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 ); 7641 }, 7642 teardown: function() { 7643 var doc = this.ownerDocument || this.document || this, 7644 dataHolder = document.documentMode ? this : doc, 7645 attaches = dataPriv.get( dataHolder, delegateType ) - 1; 7646 7647 if ( !attaches ) { 7648 if ( document.documentMode ) { 7649 this.removeEventListener( delegateType, focusMappedHandler ); 7650 } else { 7651 doc.removeEventListener( type, focusMappedHandler, true ); 7652 } 7653 dataPriv.remove( dataHolder, delegateType ); 7654 } else { 7655 dataPriv.set( dataHolder, delegateType, attaches ); 7656 } 7657 } 7658 }; 7659} ); 7660 7661// Create mouseenter/leave events using mouseover/out and event-time checks 7662// so that event delegation works in jQuery. 7663// Do the same for pointerenter/pointerleave and pointerover/pointerout 7664// 7665// Support: Safari 7 only 7666// Safari sends mouseenter too often; see: 7667// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 7668// for the description of the bug (it existed in older Chrome versions as well). 7669jQuery.each( { 7670 mouseenter: "mouseover", 7671 mouseleave: "mouseout", 7672 pointerenter: "pointerover", 7673 pointerleave: "pointerout" 7674}, function( orig, fix ) { 7675 jQuery.event.special[ orig ] = { 7676 delegateType: fix, 7677 bindType: fix, 7678 7679 handle: function( event ) { 7680 var ret, 7681 target = this, 7682 related = event.relatedTarget, 7683 handleObj = event.handleObj; 7684 7685 // For mouseenter/leave call the handler if related is outside the target. 7686 // NB: No relatedTarget if the mouse left/entered the browser window 7687 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 7688 event.type = handleObj.origType; 7689 ret = handleObj.handler.apply( this, arguments ); 7690 event.type = fix; 7691 } 7692 return ret; 7693 } 7694 }; 7695} ); 7696 7697jQuery.fn.extend( { 7698 7699 on: function( types, selector, data, fn ) { 7700 return on( this, types, selector, data, fn ); 7701 }, 7702 one: function( types, selector, data, fn ) { 7703 return on( this, types, selector, data, fn, 1 ); 7704 }, 7705 off: function( types, selector, fn ) { 7706 var handleObj, type; 7707 if ( types && types.preventDefault && types.handleObj ) { 7708 7709 // ( event ) dispatched jQuery.Event 7710 handleObj = types.handleObj; 7711 jQuery( types.delegateTarget ).off( 7712 handleObj.namespace ? 7713 handleObj.origType + "." + handleObj.namespace : 7714 handleObj.origType, 7715 handleObj.selector, 7716 handleObj.handler 7717 ); 7718 return this; 7719 } 7720 if ( typeof types === "object" ) { 7721 7722 // ( types-object [, selector] ) 7723 for ( type in types ) { 7724 this.off( type, selector, types[ type ] ); 7725 } 7726 return this; 7727 } 7728 if ( selector === false || typeof selector === "function" ) { 7729 7730 // ( types [, fn] ) 7731 fn = selector; 7732 selector = undefined; 7733 } 7734 if ( fn === false ) { 7735 fn = returnFalse; 7736 } 7737 return this.each( function() { 7738 jQuery.event.remove( this, types, fn, selector ); 7739 } ); 7740 } 7741} ); 7742 7743 7744var 7745 7746 // Support: IE <=10 - 11, Edge 12 - 13 only 7747 // In IE/Edge using regex groups here causes severe slowdowns. 7748 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 7749 rnoInnerhtml = /<script|<style|<link/i, 7750 7751 // checked="checked" or checked 7752 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 7753 7754 rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g; 7755 7756// Prefer a tbody over its parent table for containing new rows 7757function manipulationTarget( elem, content ) { 7758 if ( nodeName( elem, "table" ) && 7759 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 7760 7761 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 7762 } 7763 7764 return elem; 7765} 7766 7767// Replace/restore the type attribute of script elements for safe DOM manipulation 7768function disableScript( elem ) { 7769 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 7770 return elem; 7771} 7772function restoreScript( elem ) { 7773 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 7774 elem.type = elem.type.slice( 5 ); 7775 } else { 7776 elem.removeAttribute( "type" ); 7777 } 7778 7779 return elem; 7780} 7781 7782function cloneCopyEvent( src, dest ) { 7783 var i, l, type, pdataOld, udataOld, udataCur, events; 7784 7785 if ( dest.nodeType !== 1 ) { 7786 return; 7787 } 7788 7789 // 1. Copy private data: events, handlers, etc. 7790 if ( dataPriv.hasData( src ) ) { 7791 pdataOld = dataPriv.get( src ); 7792 events = pdataOld.events; 7793 7794 if ( events ) { 7795 dataPriv.remove( dest, "handle events" ); 7796 7797 for ( type in events ) { 7798 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 7799 jQuery.event.add( dest, type, events[ type ][ i ] ); 7800 } 7801 } 7802 } 7803 } 7804 7805 // 2. Copy user data 7806 if ( dataUser.hasData( src ) ) { 7807 udataOld = dataUser.access( src ); 7808 udataCur = jQuery.extend( {}, udataOld ); 7809 7810 dataUser.set( dest, udataCur ); 7811 } 7812} 7813 7814// Fix IE bugs, see support tests 7815function fixInput( src, dest ) { 7816 var nodeName = dest.nodeName.toLowerCase(); 7817 7818 // Fails to persist the checked state of a cloned checkbox or radio button. 7819 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 7820 dest.checked = src.checked; 7821 7822 // Fails to return the selected option to the default selected state when cloning options 7823 } else if ( nodeName === "input" || nodeName === "textarea" ) { 7824 dest.defaultValue = src.defaultValue; 7825 } 7826} 7827 7828function domManip( collection, args, callback, ignored ) { 7829 7830 // Flatten any nested arrays 7831 args = flat( args ); 7832 7833 var fragment, first, scripts, hasScripts, node, doc, 7834 i = 0, 7835 l = collection.length, 7836 iNoClone = l - 1, 7837 value = args[ 0 ], 7838 valueIsFunction = isFunction( value ); 7839 7840 // We can't cloneNode fragments that contain checked, in WebKit 7841 if ( valueIsFunction || 7842 ( l > 1 && typeof value === "string" && 7843 !support.checkClone && rchecked.test( value ) ) ) { 7844 return collection.each( function( index ) { 7845 var self = collection.eq( index ); 7846 if ( valueIsFunction ) { 7847 args[ 0 ] = value.call( this, index, self.html() ); 7848 } 7849 domManip( self, args, callback, ignored ); 7850 } ); 7851 } 7852 7853 if ( l ) { 7854 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 7855 first = fragment.firstChild; 7856 7857 if ( fragment.childNodes.length === 1 ) { 7858 fragment = first; 7859 } 7860 7861 // Require either new content or an interest in ignored elements to invoke the callback 7862 if ( first || ignored ) { 7863 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 7864 hasScripts = scripts.length; 7865 7866 // Use the original fragment for the last item 7867 // instead of the first because it can end up 7868 // being emptied incorrectly in certain situations (trac-8070). 7869 for ( ; i < l; i++ ) { 7870 node = fragment; 7871 7872 if ( i !== iNoClone ) { 7873 node = jQuery.clone( node, true, true ); 7874 7875 // Keep references to cloned scripts for later restoration 7876 if ( hasScripts ) { 7877 7878 // Support: Android <=4.0 only, PhantomJS 1 only 7879 // push.apply(_, arraylike) throws on ancient WebKit 7880 jQuery.merge( scripts, getAll( node, "script" ) ); 7881 } 7882 } 7883 7884 callback.call( collection[ i ], node, i ); 7885 } 7886 7887 if ( hasScripts ) { 7888 doc = scripts[ scripts.length - 1 ].ownerDocument; 7889 7890 // Re-enable scripts 7891 jQuery.map( scripts, restoreScript ); 7892 7893 // Evaluate executable scripts on first document insertion 7894 for ( i = 0; i < hasScripts; i++ ) { 7895 node = scripts[ i ]; 7896 if ( rscriptType.test( node.type || "" ) && 7897 !dataPriv.access( node, "globalEval" ) && 7898 jQuery.contains( doc, node ) ) { 7899 7900 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 7901 7902 // Optional AJAX dependency, but won't run scripts if not present 7903 if ( jQuery._evalUrl && !node.noModule ) { 7904 jQuery._evalUrl( node.src, { 7905 nonce: node.nonce || node.getAttribute( "nonce" ) 7906 }, doc ); 7907 } 7908 } else { 7909 7910 // Unwrap a CDATA section containing script contents. This shouldn't be 7911 // needed as in XML documents they're already not visible when 7912 // inspecting element contents and in HTML documents they have no 7913 // meaning but we're preserving that logic for backwards compatibility. 7914 // This will be removed completely in 4.0. See gh-4904. 7915 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 7916 } 7917 } 7918 } 7919 } 7920 } 7921 } 7922 7923 return collection; 7924} 7925 7926function remove( elem, selector, keepData ) { 7927 var node, 7928 nodes = selector ? jQuery.filter( selector, elem ) : elem, 7929 i = 0; 7930 7931 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 7932 if ( !keepData && node.nodeType === 1 ) { 7933 jQuery.cleanData( getAll( node ) ); 7934 } 7935 7936 if ( node.parentNode ) { 7937 if ( keepData && isAttached( node ) ) { 7938 setGlobalEval( getAll( node, "script" ) ); 7939 } 7940 node.parentNode.removeChild( node ); 7941 } 7942 } 7943 7944 return elem; 7945} 7946 7947jQuery.extend( { 7948 htmlPrefilter: function( html ) { 7949 return html; 7950 }, 7951 7952 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 7953 var i, l, srcElements, destElements, 7954 clone = elem.cloneNode( true ), 7955 inPage = isAttached( elem ); 7956 7957 // Fix IE cloning issues 7958 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 7959 !jQuery.isXMLDoc( elem ) ) { 7960 7961 // We eschew jQuery#find here for performance reasons: 7962 // https://jsperf.com/getall-vs-sizzle/2 7963 destElements = getAll( clone ); 7964 srcElements = getAll( elem ); 7965 7966 for ( i = 0, l = srcElements.length; i < l; i++ ) { 7967 fixInput( srcElements[ i ], destElements[ i ] ); 7968 } 7969 } 7970 7971 // Copy the events from the original to the clone 7972 if ( dataAndEvents ) { 7973 if ( deepDataAndEvents ) { 7974 srcElements = srcElements || getAll( elem ); 7975 destElements = destElements || getAll( clone ); 7976 7977 for ( i = 0, l = srcElements.length; i < l; i++ ) { 7978 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 7979 } 7980 } else { 7981 cloneCopyEvent( elem, clone ); 7982 } 7983 } 7984 7985 // Preserve script evaluation history 7986 destElements = getAll( clone, "script" ); 7987 if ( destElements.length > 0 ) { 7988 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 7989 } 7990 7991 // Return the cloned set 7992 return clone; 7993 }, 7994 7995 cleanData: function( elems ) { 7996 var data, elem, type, 7997 special = jQuery.event.special, 7998 i = 0; 7999 8000 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 8001 if ( acceptData( elem ) ) { 8002 if ( ( data = elem[ dataPriv.expando ] ) ) { 8003 if ( data.events ) { 8004 for ( type in data.events ) { 8005 if ( special[ type ] ) { 8006 jQuery.event.remove( elem, type ); 8007 8008 // This is a shortcut to avoid jQuery.event.remove's overhead 8009 } else { 8010 jQuery.removeEvent( elem, type, data.handle ); 8011 } 8012 } 8013 } 8014 8015 // Support: Chrome <=35 - 45+ 8016 // Assign undefined instead of using delete, see Data#remove 8017 elem[ dataPriv.expando ] = undefined; 8018 } 8019 if ( elem[ dataUser.expando ] ) { 8020 8021 // Support: Chrome <=35 - 45+ 8022 // Assign undefined instead of using delete, see Data#remove 8023 elem[ dataUser.expando ] = undefined; 8024 } 8025 } 8026 } 8027 } 8028} ); 8029 8030jQuery.fn.extend( { 8031 detach: function( selector ) { 8032 return remove( this, selector, true ); 8033 }, 8034 8035 remove: function( selector ) { 8036 return remove( this, selector ); 8037 }, 8038 8039 text: function( value ) { 8040 return access( this, function( value ) { 8041 return value === undefined ? 8042 jQuery.text( this ) : 8043 this.empty().each( function() { 8044 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 8045 this.textContent = value; 8046 } 8047 } ); 8048 }, null, value, arguments.length ); 8049 }, 8050 8051 append: function() { 8052 return domManip( this, arguments, function( elem ) { 8053 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 8054 var target = manipulationTarget( this, elem ); 8055 target.appendChild( elem ); 8056 } 8057 } ); 8058 }, 8059 8060 prepend: function() { 8061 return domManip( this, arguments, function( elem ) { 8062 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 8063 var target = manipulationTarget( this, elem ); 8064 target.insertBefore( elem, target.firstChild ); 8065 } 8066 } ); 8067 }, 8068 8069 before: function() { 8070 return domManip( this, arguments, function( elem ) { 8071 if ( this.parentNode ) { 8072 this.parentNode.insertBefore( elem, this ); 8073 } 8074 } ); 8075 }, 8076 8077 after: function() { 8078 return domManip( this, arguments, function( elem ) { 8079 if ( this.parentNode ) { 8080 this.parentNode.insertBefore( elem, this.nextSibling ); 8081 } 8082 } ); 8083 }, 8084 8085 empty: function() { 8086 var elem, 8087 i = 0; 8088 8089 for ( ; ( elem = this[ i ] ) != null; i++ ) { 8090 if ( elem.nodeType === 1 ) { 8091 8092 // Prevent memory leaks 8093 jQuery.cleanData( getAll( elem, false ) ); 8094 8095 // Remove any remaining nodes 8096 elem.textContent = ""; 8097 } 8098 } 8099 8100 return this; 8101 }, 8102 8103 clone: function( dataAndEvents, deepDataAndEvents ) { 8104 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 8105 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 8106 8107 return this.map( function() { 8108 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 8109 } ); 8110 }, 8111 8112 html: function( value ) { 8113 return access( this, function( value ) { 8114 var elem = this[ 0 ] || {}, 8115 i = 0, 8116 l = this.length; 8117 8118 if ( value === undefined && elem.nodeType === 1 ) { 8119 return elem.innerHTML; 8120 } 8121 8122 // See if we can take a shortcut and just use innerHTML 8123 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 8124 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 8125 8126 value = jQuery.htmlPrefilter( value ); 8127 8128 try { 8129 for ( ; i < l; i++ ) { 8130 elem = this[ i ] || {}; 8131 8132 // Remove element nodes and prevent memory leaks 8133 if ( elem.nodeType === 1 ) { 8134 jQuery.cleanData( getAll( elem, false ) ); 8135 elem.innerHTML = value; 8136 } 8137 } 8138 8139 elem = 0; 8140 8141 // If using innerHTML throws an exception, use the fallback method 8142 } catch ( e ) {} 8143 } 8144 8145 if ( elem ) { 8146 this.empty().append( value ); 8147 } 8148 }, null, value, arguments.length ); 8149 }, 8150 8151 replaceWith: function() { 8152 var ignored = []; 8153 8154 // Make the changes, replacing each non-ignored context element with the new content 8155 return domManip( this, arguments, function( elem ) { 8156 var parent = this.parentNode; 8157 8158 if ( jQuery.inArray( this, ignored ) < 0 ) { 8159 jQuery.cleanData( getAll( this ) ); 8160 if ( parent ) { 8161 parent.replaceChild( elem, this ); 8162 } 8163 } 8164 8165 // Force callback invocation 8166 }, ignored ); 8167 } 8168} ); 8169 8170jQuery.each( { 8171 appendTo: "append", 8172 prependTo: "prepend", 8173 insertBefore: "before", 8174 insertAfter: "after", 8175 replaceAll: "replaceWith" 8176}, function( name, original ) { 8177 jQuery.fn[ name ] = function( selector ) { 8178 var elems, 8179 ret = [], 8180 insert = jQuery( selector ), 8181 last = insert.length - 1, 8182 i = 0; 8183 8184 for ( ; i <= last; i++ ) { 8185 elems = i === last ? this : this.clone( true ); 8186 jQuery( insert[ i ] )[ original ]( elems ); 8187 8188 // Support: Android <=4.0 only, PhantomJS 1 only 8189 // .get() because push.apply(_, arraylike) throws on ancient WebKit 8190 push.apply( ret, elems.get() ); 8191 } 8192 8193 return this.pushStack( ret ); 8194 }; 8195} ); 8196var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 8197 8198var rcustomProp = /^--/; 8199 8200 8201var getStyles = function( elem ) { 8202 8203 // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150) 8204 // IE throws on elements created in popups 8205 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 8206 var view = elem.ownerDocument.defaultView; 8207 8208 if ( !view || !view.opener ) { 8209 view = window; 8210 } 8211 8212 return view.getComputedStyle( elem ); 8213 }; 8214 8215var swap = function( elem, options, callback ) { 8216 var ret, name, 8217 old = {}; 8218 8219 // Remember the old values, and insert the new ones 8220 for ( name in options ) { 8221 old[ name ] = elem.style[ name ]; 8222 elem.style[ name ] = options[ name ]; 8223 } 8224 8225 ret = callback.call( elem ); 8226 8227 // Revert the old values 8228 for ( name in options ) { 8229 elem.style[ name ] = old[ name ]; 8230 } 8231 8232 return ret; 8233}; 8234 8235 8236var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 8237 8238 8239 8240( function() { 8241 8242 // Executing both pixelPosition & boxSizingReliable tests require only one layout 8243 // so they're executed at the same time to save the second computation. 8244 function computeStyleTests() { 8245 8246 // This is a singleton, we need to execute it only once 8247 if ( !div ) { 8248 return; 8249 } 8250 8251 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 8252 "margin-top:1px;padding:0;border:0"; 8253 div.style.cssText = 8254 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 8255 "margin:auto;border:1px;padding:1px;" + 8256 "width:60%;top:1%"; 8257 documentElement.appendChild( container ).appendChild( div ); 8258 8259 var divStyle = window.getComputedStyle( div ); 8260 pixelPositionVal = divStyle.top !== "1%"; 8261 8262 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 8263 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 8264 8265 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 8266 // Some styles come back with percentage values, even though they shouldn't 8267 div.style.right = "60%"; 8268 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 8269 8270 // Support: IE 9 - 11 only 8271 // Detect misreporting of content dimensions for box-sizing:border-box elements 8272 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 8273 8274 // Support: IE 9 only 8275 // Detect overflow:scroll screwiness (gh-3699) 8276 // Support: Chrome <=64 8277 // Don't get tricked when zoom affects offsetWidth (gh-4029) 8278 div.style.position = "absolute"; 8279 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 8280 8281 documentElement.removeChild( container ); 8282 8283 // Nullify the div so it wouldn't be stored in the memory and 8284 // it will also be a sign that checks already performed 8285 div = null; 8286 } 8287 8288 function roundPixelMeasures( measure ) { 8289 return Math.round( parseFloat( measure ) ); 8290 } 8291 8292 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 8293 reliableTrDimensionsVal, reliableMarginLeftVal, 8294 container = document.createElement( "div" ), 8295 div = document.createElement( "div" ); 8296 8297 // Finish early in limited (non-browser) environments 8298 if ( !div.style ) { 8299 return; 8300 } 8301 8302 // Support: IE <=9 - 11 only 8303 // Style of cloned element affects source element cloned (trac-8908) 8304 div.style.backgroundClip = "content-box"; 8305 div.cloneNode( true ).style.backgroundClip = ""; 8306 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 8307 8308 jQuery.extend( support, { 8309 boxSizingReliable: function() { 8310 computeStyleTests(); 8311 return boxSizingReliableVal; 8312 }, 8313 pixelBoxStyles: function() { 8314 computeStyleTests(); 8315 return pixelBoxStylesVal; 8316 }, 8317 pixelPosition: function() { 8318 computeStyleTests(); 8319 return pixelPositionVal; 8320 }, 8321 reliableMarginLeft: function() { 8322 computeStyleTests(); 8323 return reliableMarginLeftVal; 8324 }, 8325 scrollboxSize: function() { 8326 computeStyleTests(); 8327 return scrollboxSizeVal; 8328 }, 8329 8330 // Support: IE 9 - 11+, Edge 15 - 18+ 8331 // IE/Edge misreport `getComputedStyle` of table rows with width/height 8332 // set in CSS while `offset*` properties report correct values. 8333 // Behavior in IE 9 is more subtle than in newer versions & it passes 8334 // some versions of this test; make sure not to make it pass there! 8335 // 8336 // Support: Firefox 70+ 8337 // Only Firefox includes border widths 8338 // in computed dimensions. (gh-4529) 8339 reliableTrDimensions: function() { 8340 var table, tr, trChild, trStyle; 8341 if ( reliableTrDimensionsVal == null ) { 8342 table = document.createElement( "table" ); 8343 tr = document.createElement( "tr" ); 8344 trChild = document.createElement( "div" ); 8345 8346 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 8347 tr.style.cssText = "box-sizing:content-box;border:1px solid"; 8348 8349 // Support: Chrome 86+ 8350 // Height set through cssText does not get applied. 8351 // Computed height then comes back as 0. 8352 tr.style.height = "1px"; 8353 trChild.style.height = "9px"; 8354 8355 // Support: Android 8 Chrome 86+ 8356 // In our bodyBackground.html iframe, 8357 // display for all div elements is set to "inline", 8358 // which causes a problem only in Android 8 Chrome 86. 8359 // Ensuring the div is `display: block` 8360 // gets around this issue. 8361 trChild.style.display = "block"; 8362 8363 documentElement 8364 .appendChild( table ) 8365 .appendChild( tr ) 8366 .appendChild( trChild ); 8367 8368 trStyle = window.getComputedStyle( tr ); 8369 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + 8370 parseInt( trStyle.borderTopWidth, 10 ) + 8371 parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; 8372 8373 documentElement.removeChild( table ); 8374 } 8375 return reliableTrDimensionsVal; 8376 } 8377 } ); 8378} )(); 8379 8380 8381function curCSS( elem, name, computed ) { 8382 var width, minWidth, maxWidth, ret, 8383 isCustomProp = rcustomProp.test( name ), 8384 8385 // Support: Firefox 51+ 8386 // Retrieving style before computed somehow 8387 // fixes an issue with getting wrong values 8388 // on detached elements 8389 style = elem.style; 8390 8391 computed = computed || getStyles( elem ); 8392 8393 // getPropertyValue is needed for: 8394 // .css('filter') (IE 9 only, trac-12537) 8395 // .css('--customProperty) (gh-3144) 8396 if ( computed ) { 8397 8398 // Support: IE <=9 - 11+ 8399 // IE only supports `"float"` in `getPropertyValue`; in computed styles 8400 // it's only available as `"cssFloat"`. We no longer modify properties 8401 // sent to `.css()` apart from camelCasing, so we need to check both. 8402 // Normally, this would create difference in behavior: if 8403 // `getPropertyValue` returns an empty string, the value returned 8404 // by `.css()` would be `undefined`. This is usually the case for 8405 // disconnected elements. However, in IE even disconnected elements 8406 // with no styles return `"none"` for `getPropertyValue( "float" )` 8407 ret = computed.getPropertyValue( name ) || computed[ name ]; 8408 8409 if ( isCustomProp && ret ) { 8410 8411 // Support: Firefox 105+, Chrome <=105+ 8412 // Spec requires trimming whitespace for custom properties (gh-4926). 8413 // Firefox only trims leading whitespace. Chrome just collapses 8414 // both leading & trailing whitespace to a single space. 8415 // 8416 // Fall back to `undefined` if empty string returned. 8417 // This collapses a missing definition with property defined 8418 // and set to an empty string but there's no standard API 8419 // allowing us to differentiate them without a performance penalty 8420 // and returning `undefined` aligns with older jQuery. 8421 // 8422 // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED 8423 // as whitespace while CSS does not, but this is not a problem 8424 // because CSS preprocessing replaces them with U+000A LINE FEED 8425 // (which *is* CSS whitespace) 8426 // https://www.w3.org/TR/css-syntax-3/#input-preprocessing 8427 ret = ret.replace( rtrimCSS, "$1" ) || undefined; 8428 } 8429 8430 if ( ret === "" && !isAttached( elem ) ) { 8431 ret = jQuery.style( elem, name ); 8432 } 8433 8434 // A tribute to the "awesome hack by Dean Edwards" 8435 // Android Browser returns percentage for some values, 8436 // but width seems to be reliably pixels. 8437 // This is against the CSSOM draft spec: 8438 // https://drafts.csswg.org/cssom/#resolved-values 8439 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 8440 8441 // Remember the original values 8442 width = style.width; 8443 minWidth = style.minWidth; 8444 maxWidth = style.maxWidth; 8445 8446 // Put in the new values to get a computed value out 8447 style.minWidth = style.maxWidth = style.width = ret; 8448 ret = computed.width; 8449 8450 // Revert the changed values 8451 style.width = width; 8452 style.minWidth = minWidth; 8453 style.maxWidth = maxWidth; 8454 } 8455 } 8456 8457 return ret !== undefined ? 8458 8459 // Support: IE <=9 - 11 only 8460 // IE returns zIndex value as an integer. 8461 ret + "" : 8462 ret; 8463} 8464 8465 8466function addGetHookIf( conditionFn, hookFn ) { 8467 8468 // Define the hook, we'll check on the first run if it's really needed. 8469 return { 8470 get: function() { 8471 if ( conditionFn() ) { 8472 8473 // Hook not needed (or it's not possible to use it due 8474 // to missing dependency), remove it. 8475 delete this.get; 8476 return; 8477 } 8478 8479 // Hook needed; redefine it so that the support test is not executed again. 8480 return ( this.get = hookFn ).apply( this, arguments ); 8481 } 8482 }; 8483} 8484 8485 8486var cssPrefixes = [ "Webkit", "Moz", "ms" ], 8487 emptyStyle = document.createElement( "div" ).style, 8488 vendorProps = {}; 8489 8490// Return a vendor-prefixed property or undefined 8491function vendorPropName( name ) { 8492 8493 // Check for vendor prefixed names 8494 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 8495 i = cssPrefixes.length; 8496 8497 while ( i-- ) { 8498 name = cssPrefixes[ i ] + capName; 8499 if ( name in emptyStyle ) { 8500 return name; 8501 } 8502 } 8503} 8504 8505// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 8506function finalPropName( name ) { 8507 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 8508 8509 if ( final ) { 8510 return final; 8511 } 8512 if ( name in emptyStyle ) { 8513 return name; 8514 } 8515 return vendorProps[ name ] = vendorPropName( name ) || name; 8516} 8517 8518 8519var 8520 8521 // Swappable if display is none or starts with table 8522 // except "table", "table-cell", or "table-caption" 8523 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 8524 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 8525 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 8526 cssNormalTransform = { 8527 letterSpacing: "0", 8528 fontWeight: "400" 8529 }; 8530 8531function setPositiveNumber( _elem, value, subtract ) { 8532 8533 // Any relative (+/-) values have already been 8534 // normalized at this point 8535 var matches = rcssNum.exec( value ); 8536 return matches ? 8537 8538 // Guard against undefined "subtract", e.g., when used as in cssHooks 8539 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 8540 value; 8541} 8542 8543function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 8544 var i = dimension === "width" ? 1 : 0, 8545 extra = 0, 8546 delta = 0, 8547 marginDelta = 0; 8548 8549 // Adjustment may not be necessary 8550 if ( box === ( isBorderBox ? "border" : "content" ) ) { 8551 return 0; 8552 } 8553 8554 for ( ; i < 4; i += 2 ) { 8555 8556 // Both box models exclude margin 8557 // Count margin delta separately to only add it after scroll gutter adjustment. 8558 // This is needed to make negative margins work with `outerHeight( true )` (gh-3982). 8559 if ( box === "margin" ) { 8560 marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 8561 } 8562 8563 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 8564 if ( !isBorderBox ) { 8565 8566 // Add padding 8567 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 8568 8569 // For "border" or "margin", add border 8570 if ( box !== "padding" ) { 8571 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 8572 8573 // But still keep track of it otherwise 8574 } else { 8575 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 8576 } 8577 8578 // If we get here with a border-box (content + padding + border), we're seeking "content" or 8579 // "padding" or "margin" 8580 } else { 8581 8582 // For "content", subtract padding 8583 if ( box === "content" ) { 8584 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 8585 } 8586 8587 // For "content" or "padding", subtract border 8588 if ( box !== "margin" ) { 8589 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 8590 } 8591 } 8592 } 8593 8594 // Account for positive content-box scroll gutter when requested by providing computedVal 8595 if ( !isBorderBox && computedVal >= 0 ) { 8596 8597 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 8598 // Assuming integer scroll gutter, subtract the rest and round down 8599 delta += Math.max( 0, Math.ceil( 8600 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 8601 computedVal - 8602 delta - 8603 extra - 8604 0.5 8605 8606 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 8607 // Use an explicit zero to avoid NaN (gh-3964) 8608 ) ) || 0; 8609 } 8610 8611 return delta + marginDelta; 8612} 8613 8614function getWidthOrHeight( elem, dimension, extra ) { 8615 8616 // Start with computed style 8617 var styles = getStyles( elem ), 8618 8619 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 8620 // Fake content-box until we know it's needed to know the true value. 8621 boxSizingNeeded = !support.boxSizingReliable() || extra, 8622 isBorderBox = boxSizingNeeded && 8623 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 8624 valueIsBorderBox = isBorderBox, 8625 8626 val = curCSS( elem, dimension, styles ), 8627 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 8628 8629 // Support: Firefox <=54 8630 // Return a confounding non-pixel value or feign ignorance, as appropriate. 8631 if ( rnumnonpx.test( val ) ) { 8632 if ( !extra ) { 8633 return val; 8634 } 8635 val = "auto"; 8636 } 8637 8638 8639 // Support: IE 9 - 11 only 8640 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 8641 // In those cases, the computed value can be trusted to be border-box. 8642 if ( ( !support.boxSizingReliable() && isBorderBox || 8643 8644 // Support: IE 10 - 11+, Edge 15 - 18+ 8645 // IE/Edge misreport `getComputedStyle` of table rows with width/height 8646 // set in CSS while `offset*` properties report correct values. 8647 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 8648 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 8649 8650 // Fall back to offsetWidth/offsetHeight when value is "auto" 8651 // This happens for inline elements with no explicit setting (gh-3571) 8652 val === "auto" || 8653 8654 // Support: Android <=4.1 - 4.3 only 8655 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 8656 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 8657 8658 // Make sure the element is visible & connected 8659 elem.getClientRects().length ) { 8660 8661 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 8662 8663 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 8664 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 8665 // retrieved value as a content box dimension. 8666 valueIsBorderBox = offsetProp in elem; 8667 if ( valueIsBorderBox ) { 8668 val = elem[ offsetProp ]; 8669 } 8670 } 8671 8672 // Normalize "" and auto 8673 val = parseFloat( val ) || 0; 8674 8675 // Adjust for the element's box model 8676 return ( val + 8677 boxModelAdjustment( 8678 elem, 8679 dimension, 8680 extra || ( isBorderBox ? "border" : "content" ), 8681 valueIsBorderBox, 8682 styles, 8683 8684 // Provide the current computed size to request scroll gutter calculation (gh-3589) 8685 val 8686 ) 8687 ) + "px"; 8688} 8689 8690jQuery.extend( { 8691 8692 // Add in style property hooks for overriding the default 8693 // behavior of getting and setting a style property 8694 cssHooks: { 8695 opacity: { 8696 get: function( elem, computed ) { 8697 if ( computed ) { 8698 8699 // We should always get a number back from opacity 8700 var ret = curCSS( elem, "opacity" ); 8701 return ret === "" ? "1" : ret; 8702 } 8703 } 8704 } 8705 }, 8706 8707 // Don't automatically add "px" to these possibly-unitless properties 8708 cssNumber: { 8709 animationIterationCount: true, 8710 aspectRatio: true, 8711 borderImageSlice: true, 8712 columnCount: true, 8713 flexGrow: true, 8714 flexShrink: true, 8715 fontWeight: true, 8716 gridArea: true, 8717 gridColumn: true, 8718 gridColumnEnd: true, 8719 gridColumnStart: true, 8720 gridRow: true, 8721 gridRowEnd: true, 8722 gridRowStart: true, 8723 lineHeight: true, 8724 opacity: true, 8725 order: true, 8726 orphans: true, 8727 scale: true, 8728 widows: true, 8729 zIndex: true, 8730 zoom: true, 8731 8732 // SVG-related 8733 fillOpacity: true, 8734 floodOpacity: true, 8735 stopOpacity: true, 8736 strokeMiterlimit: true, 8737 strokeOpacity: true 8738 }, 8739 8740 // Add in properties whose names you wish to fix before 8741 // setting or getting the value 8742 cssProps: {}, 8743 8744 // Get and set the style property on a DOM Node 8745 style: function( elem, name, value, extra ) { 8746 8747 // Don't set styles on text and comment nodes 8748 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 8749 return; 8750 } 8751 8752 // Make sure that we're working with the right name 8753 var ret, type, hooks, 8754 origName = camelCase( name ), 8755 isCustomProp = rcustomProp.test( name ), 8756 style = elem.style; 8757 8758 // Make sure that we're working with the right name. We don't 8759 // want to query the value if it is a CSS custom property 8760 // since they are user-defined. 8761 if ( !isCustomProp ) { 8762 name = finalPropName( origName ); 8763 } 8764 8765 // Gets hook for the prefixed version, then unprefixed version 8766 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 8767 8768 // Check if we're setting a value 8769 if ( value !== undefined ) { 8770 type = typeof value; 8771 8772 // Convert "+=" or "-=" to relative numbers (trac-7345) 8773 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 8774 value = adjustCSS( elem, name, ret ); 8775 8776 // Fixes bug trac-9237 8777 type = "number"; 8778 } 8779 8780 // Make sure that null and NaN values aren't set (trac-7116) 8781 if ( value == null || value !== value ) { 8782 return; 8783 } 8784 8785 // If a number was passed in, add the unit (except for certain CSS properties) 8786 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 8787 // "px" to a few hardcoded values. 8788 if ( type === "number" && !isCustomProp ) { 8789 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 8790 } 8791 8792 // background-* props affect original clone's values 8793 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 8794 style[ name ] = "inherit"; 8795 } 8796 8797 // If a hook was provided, use that value, otherwise just set the specified value 8798 if ( !hooks || !( "set" in hooks ) || 8799 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 8800 8801 if ( isCustomProp ) { 8802 style.setProperty( name, value ); 8803 } else { 8804 style[ name ] = value; 8805 } 8806 } 8807 8808 } else { 8809 8810 // If a hook was provided get the non-computed value from there 8811 if ( hooks && "get" in hooks && 8812 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 8813 8814 return ret; 8815 } 8816 8817 // Otherwise just get the value from the style object 8818 return style[ name ]; 8819 } 8820 }, 8821 8822 css: function( elem, name, extra, styles ) { 8823 var val, num, hooks, 8824 origName = camelCase( name ), 8825 isCustomProp = rcustomProp.test( name ); 8826 8827 // Make sure that we're working with the right name. We don't 8828 // want to modify the value if it is a CSS custom property 8829 // since they are user-defined. 8830 if ( !isCustomProp ) { 8831 name = finalPropName( origName ); 8832 } 8833 8834 // Try prefixed name followed by the unprefixed name 8835 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 8836 8837 // If a hook was provided get the computed value from there 8838 if ( hooks && "get" in hooks ) { 8839 val = hooks.get( elem, true, extra ); 8840 } 8841 8842 // Otherwise, if a way to get the computed value exists, use that 8843 if ( val === undefined ) { 8844 val = curCSS( elem, name, styles ); 8845 } 8846 8847 // Convert "normal" to computed value 8848 if ( val === "normal" && name in cssNormalTransform ) { 8849 val = cssNormalTransform[ name ]; 8850 } 8851 8852 // Make numeric if forced or a qualifier was provided and val looks numeric 8853 if ( extra === "" || extra ) { 8854 num = parseFloat( val ); 8855 return extra === true || isFinite( num ) ? num || 0 : val; 8856 } 8857 8858 return val; 8859 } 8860} ); 8861 8862jQuery.each( [ "height", "width" ], function( _i, dimension ) { 8863 jQuery.cssHooks[ dimension ] = { 8864 get: function( elem, computed, extra ) { 8865 if ( computed ) { 8866 8867 // Certain elements can have dimension info if we invisibly show them 8868 // but it must have a current display style that would benefit 8869 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 8870 8871 // Support: Safari 8+ 8872 // Table columns in Safari have non-zero offsetWidth & zero 8873 // getBoundingClientRect().width unless display is changed. 8874 // Support: IE <=11 only 8875 // Running getBoundingClientRect on a disconnected node 8876 // in IE throws an error. 8877 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 8878 swap( elem, cssShow, function() { 8879 return getWidthOrHeight( elem, dimension, extra ); 8880 } ) : 8881 getWidthOrHeight( elem, dimension, extra ); 8882 } 8883 }, 8884 8885 set: function( elem, value, extra ) { 8886 var matches, 8887 styles = getStyles( elem ), 8888 8889 // Only read styles.position if the test has a chance to fail 8890 // to avoid forcing a reflow. 8891 scrollboxSizeBuggy = !support.scrollboxSize() && 8892 styles.position === "absolute", 8893 8894 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 8895 boxSizingNeeded = scrollboxSizeBuggy || extra, 8896 isBorderBox = boxSizingNeeded && 8897 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 8898 subtract = extra ? 8899 boxModelAdjustment( 8900 elem, 8901 dimension, 8902 extra, 8903 isBorderBox, 8904 styles 8905 ) : 8906 0; 8907 8908 // Account for unreliable border-box dimensions by comparing offset* to computed and 8909 // faking a content-box to get border and padding (gh-3699) 8910 if ( isBorderBox && scrollboxSizeBuggy ) { 8911 subtract -= Math.ceil( 8912 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 8913 parseFloat( styles[ dimension ] ) - 8914 boxModelAdjustment( elem, dimension, "border", false, styles ) - 8915 0.5 8916 ); 8917 } 8918 8919 // Convert to pixels if value adjustment is needed 8920 if ( subtract && ( matches = rcssNum.exec( value ) ) && 8921 ( matches[ 3 ] || "px" ) !== "px" ) { 8922 8923 elem.style[ dimension ] = value; 8924 value = jQuery.css( elem, dimension ); 8925 } 8926 8927 return setPositiveNumber( elem, value, subtract ); 8928 } 8929 }; 8930} ); 8931 8932jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 8933 function( elem, computed ) { 8934 if ( computed ) { 8935 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 8936 elem.getBoundingClientRect().left - 8937 swap( elem, { marginLeft: 0 }, function() { 8938 return elem.getBoundingClientRect().left; 8939 } ) 8940 ) + "px"; 8941 } 8942 } 8943); 8944 8945// These hooks are used by animate to expand properties 8946jQuery.each( { 8947 margin: "", 8948 padding: "", 8949 border: "Width" 8950}, function( prefix, suffix ) { 8951 jQuery.cssHooks[ prefix + suffix ] = { 8952 expand: function( value ) { 8953 var i = 0, 8954 expanded = {}, 8955 8956 // Assumes a single number if not a string 8957 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 8958 8959 for ( ; i < 4; i++ ) { 8960 expanded[ prefix + cssExpand[ i ] + suffix ] = 8961 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 8962 } 8963 8964 return expanded; 8965 } 8966 }; 8967 8968 if ( prefix !== "margin" ) { 8969 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 8970 } 8971} ); 8972 8973jQuery.fn.extend( { 8974 css: function( name, value ) { 8975 return access( this, function( elem, name, value ) { 8976 var styles, len, 8977 map = {}, 8978 i = 0; 8979 8980 if ( Array.isArray( name ) ) { 8981 styles = getStyles( elem ); 8982 len = name.length; 8983 8984 for ( ; i < len; i++ ) { 8985 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 8986 } 8987 8988 return map; 8989 } 8990 8991 return value !== undefined ? 8992 jQuery.style( elem, name, value ) : 8993 jQuery.css( elem, name ); 8994 }, name, value, arguments.length > 1 ); 8995 } 8996} ); 8997 8998 8999function Tween( elem, options, prop, end, easing ) { 9000 return new Tween.prototype.init( elem, options, prop, end, easing ); 9001} 9002jQuery.Tween = Tween; 9003 9004Tween.prototype = { 9005 constructor: Tween, 9006 init: function( elem, options, prop, end, easing, unit ) { 9007 this.elem = elem; 9008 this.prop = prop; 9009 this.easing = easing || jQuery.easing._default; 9010 this.options = options; 9011 this.start = this.now = this.cur(); 9012 this.end = end; 9013 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 9014 }, 9015 cur: function() { 9016 var hooks = Tween.propHooks[ this.prop ]; 9017 9018 return hooks && hooks.get ? 9019 hooks.get( this ) : 9020 Tween.propHooks._default.get( this ); 9021 }, 9022 run: function( percent ) { 9023 var eased, 9024 hooks = Tween.propHooks[ this.prop ]; 9025 9026 if ( this.options.duration ) { 9027 this.pos = eased = jQuery.easing[ this.easing ]( 9028 percent, this.options.duration * percent, 0, 1, this.options.duration 9029 ); 9030 } else { 9031 this.pos = eased = percent; 9032 } 9033 this.now = ( this.end - this.start ) * eased + this.start; 9034 9035 if ( this.options.step ) { 9036 this.options.step.call( this.elem, this.now, this ); 9037 } 9038 9039 if ( hooks && hooks.set ) { 9040 hooks.set( this ); 9041 } else { 9042 Tween.propHooks._default.set( this ); 9043 } 9044 return this; 9045 } 9046}; 9047 9048Tween.prototype.init.prototype = Tween.prototype; 9049 9050Tween.propHooks = { 9051 _default: { 9052 get: function( tween ) { 9053 var result; 9054 9055 // Use a property on the element directly when it is not a DOM element, 9056 // or when there is no matching style property that exists. 9057 if ( tween.elem.nodeType !== 1 || 9058 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 9059 return tween.elem[ tween.prop ]; 9060 } 9061 9062 // Passing an empty string as a 3rd parameter to .css will automatically 9063 // attempt a parseFloat and fallback to a string if the parse fails. 9064 // Simple values such as "10px" are parsed to Float; 9065 // complex values such as "rotate(1rad)" are returned as-is. 9066 result = jQuery.css( tween.elem, tween.prop, "" ); 9067 9068 // Empty strings, null, undefined and "auto" are converted to 0. 9069 return !result || result === "auto" ? 0 : result; 9070 }, 9071 set: function( tween ) { 9072 9073 // Use step hook for back compat. 9074 // Use cssHook if its there. 9075 // Use .style if available and use plain properties where available. 9076 if ( jQuery.fx.step[ tween.prop ] ) { 9077 jQuery.fx.step[ tween.prop ]( tween ); 9078 } else if ( tween.elem.nodeType === 1 && ( 9079 jQuery.cssHooks[ tween.prop ] || 9080 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 9081 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 9082 } else { 9083 tween.elem[ tween.prop ] = tween.now; 9084 } 9085 } 9086 } 9087}; 9088 9089// Support: IE <=9 only 9090// Panic based approach to setting things on disconnected nodes 9091Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 9092 set: function( tween ) { 9093 if ( tween.elem.nodeType && tween.elem.parentNode ) { 9094 tween.elem[ tween.prop ] = tween.now; 9095 } 9096 } 9097}; 9098 9099jQuery.easing = { 9100 linear: function( p ) { 9101 return p; 9102 }, 9103 swing: function( p ) { 9104 return 0.5 - Math.cos( p * Math.PI ) / 2; 9105 }, 9106 _default: "swing" 9107}; 9108 9109jQuery.fx = Tween.prototype.init; 9110 9111// Back compat <1.8 extension point 9112jQuery.fx.step = {}; 9113 9114 9115 9116 9117var 9118 fxNow, inProgress, 9119 rfxtypes = /^(?:toggle|show|hide)$/, 9120 rrun = /queueHooks$/; 9121 9122function schedule() { 9123 if ( inProgress ) { 9124 if ( document.hidden === false && window.requestAnimationFrame ) { 9125 window.requestAnimationFrame( schedule ); 9126 } else { 9127 window.setTimeout( schedule, jQuery.fx.interval ); 9128 } 9129 9130 jQuery.fx.tick(); 9131 } 9132} 9133 9134// Animations created synchronously will run synchronously 9135function createFxNow() { 9136 window.setTimeout( function() { 9137 fxNow = undefined; 9138 } ); 9139 return ( fxNow = Date.now() ); 9140} 9141 9142// Generate parameters to create a standard animation 9143function genFx( type, includeWidth ) { 9144 var which, 9145 i = 0, 9146 attrs = { height: type }; 9147 9148 // If we include width, step value is 1 to do all cssExpand values, 9149 // otherwise step value is 2 to skip over Left and Right 9150 includeWidth = includeWidth ? 1 : 0; 9151 for ( ; i < 4; i += 2 - includeWidth ) { 9152 which = cssExpand[ i ]; 9153 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 9154 } 9155 9156 if ( includeWidth ) { 9157 attrs.opacity = attrs.width = type; 9158 } 9159 9160 return attrs; 9161} 9162 9163function createTween( value, prop, animation ) { 9164 var tween, 9165 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 9166 index = 0, 9167 length = collection.length; 9168 for ( ; index < length; index++ ) { 9169 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 9170 9171 // We're done with this property 9172 return tween; 9173 } 9174 } 9175} 9176 9177function defaultPrefilter( elem, props, opts ) { 9178 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 9179 isBox = "width" in props || "height" in props, 9180 anim = this, 9181 orig = {}, 9182 style = elem.style, 9183 hidden = elem.nodeType && isHiddenWithinTree( elem ), 9184 dataShow = dataPriv.get( elem, "fxshow" ); 9185 9186 // Queue-skipping animations hijack the fx hooks 9187 if ( !opts.queue ) { 9188 hooks = jQuery._queueHooks( elem, "fx" ); 9189 if ( hooks.unqueued == null ) { 9190 hooks.unqueued = 0; 9191 oldfire = hooks.empty.fire; 9192 hooks.empty.fire = function() { 9193 if ( !hooks.unqueued ) { 9194 oldfire(); 9195 } 9196 }; 9197 } 9198 hooks.unqueued++; 9199 9200 anim.always( function() { 9201 9202 // Ensure the complete handler is called before this completes 9203 anim.always( function() { 9204 hooks.unqueued--; 9205 if ( !jQuery.queue( elem, "fx" ).length ) { 9206 hooks.empty.fire(); 9207 } 9208 } ); 9209 } ); 9210 } 9211 9212 // Detect show/hide animations 9213 for ( prop in props ) { 9214 value = props[ prop ]; 9215 if ( rfxtypes.test( value ) ) { 9216 delete props[ prop ]; 9217 toggle = toggle || value === "toggle"; 9218 if ( value === ( hidden ? "hide" : "show" ) ) { 9219 9220 // Pretend to be hidden if this is a "show" and 9221 // there is still data from a stopped show/hide 9222 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 9223 hidden = true; 9224 9225 // Ignore all other no-op show/hide data 9226 } else { 9227 continue; 9228 } 9229 } 9230 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 9231 } 9232 } 9233 9234 // Bail out if this is a no-op like .hide().hide() 9235 propTween = !jQuery.isEmptyObject( props ); 9236 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 9237 return; 9238 } 9239 9240 // Restrict "overflow" and "display" styles during box animations 9241 if ( isBox && elem.nodeType === 1 ) { 9242 9243 // Support: IE <=9 - 11, Edge 12 - 15 9244 // Record all 3 overflow attributes because IE does not infer the shorthand 9245 // from identically-valued overflowX and overflowY and Edge just mirrors 9246 // the overflowX value there. 9247 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 9248 9249 // Identify a display type, preferring old show/hide data over the CSS cascade 9250 restoreDisplay = dataShow && dataShow.display; 9251 if ( restoreDisplay == null ) { 9252 restoreDisplay = dataPriv.get( elem, "display" ); 9253 } 9254 display = jQuery.css( elem, "display" ); 9255 if ( display === "none" ) { 9256 if ( restoreDisplay ) { 9257 display = restoreDisplay; 9258 } else { 9259 9260 // Get nonempty value(s) by temporarily forcing visibility 9261 showHide( [ elem ], true ); 9262 restoreDisplay = elem.style.display || restoreDisplay; 9263 display = jQuery.css( elem, "display" ); 9264 showHide( [ elem ] ); 9265 } 9266 } 9267 9268 // Animate inline elements as inline-block 9269 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 9270 if ( jQuery.css( elem, "float" ) === "none" ) { 9271 9272 // Restore the original display value at the end of pure show/hide animations 9273 if ( !propTween ) { 9274 anim.done( function() { 9275 style.display = restoreDisplay; 9276 } ); 9277 if ( restoreDisplay == null ) { 9278 display = style.display; 9279 restoreDisplay = display === "none" ? "" : display; 9280 } 9281 } 9282 style.display = "inline-block"; 9283 } 9284 } 9285 } 9286 9287 if ( opts.overflow ) { 9288 style.overflow = "hidden"; 9289 anim.always( function() { 9290 style.overflow = opts.overflow[ 0 ]; 9291 style.overflowX = opts.overflow[ 1 ]; 9292 style.overflowY = opts.overflow[ 2 ]; 9293 } ); 9294 } 9295 9296 // Implement show/hide animations 9297 propTween = false; 9298 for ( prop in orig ) { 9299 9300 // General show/hide setup for this element animation 9301 if ( !propTween ) { 9302 if ( dataShow ) { 9303 if ( "hidden" in dataShow ) { 9304 hidden = dataShow.hidden; 9305 } 9306 } else { 9307 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 9308 } 9309 9310 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 9311 if ( toggle ) { 9312 dataShow.hidden = !hidden; 9313 } 9314 9315 // Show elements before animating them 9316 if ( hidden ) { 9317 showHide( [ elem ], true ); 9318 } 9319 9320 /* eslint-disable no-loop-func */ 9321 9322 anim.done( function() { 9323 9324 /* eslint-enable no-loop-func */ 9325 9326 // The final step of a "hide" animation is actually hiding the element 9327 if ( !hidden ) { 9328 showHide( [ elem ] ); 9329 } 9330 dataPriv.remove( elem, "fxshow" ); 9331 for ( prop in orig ) { 9332 jQuery.style( elem, prop, orig[ prop ] ); 9333 } 9334 } ); 9335 } 9336 9337 // Per-property setup 9338 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 9339 if ( !( prop in dataShow ) ) { 9340 dataShow[ prop ] = propTween.start; 9341 if ( hidden ) { 9342 propTween.end = propTween.start; 9343 propTween.start = 0; 9344 } 9345 } 9346 } 9347} 9348 9349function propFilter( props, specialEasing ) { 9350 var index, name, easing, value, hooks; 9351 9352 // camelCase, specialEasing and expand cssHook pass 9353 for ( index in props ) { 9354 name = camelCase( index ); 9355 easing = specialEasing[ name ]; 9356 value = props[ index ]; 9357 if ( Array.isArray( value ) ) { 9358 easing = value[ 1 ]; 9359 value = props[ index ] = value[ 0 ]; 9360 } 9361 9362 if ( index !== name ) { 9363 props[ name ] = value; 9364 delete props[ index ]; 9365 } 9366 9367 hooks = jQuery.cssHooks[ name ]; 9368 if ( hooks && "expand" in hooks ) { 9369 value = hooks.expand( value ); 9370 delete props[ name ]; 9371 9372 // Not quite $.extend, this won't overwrite existing keys. 9373 // Reusing 'index' because we have the correct "name" 9374 for ( index in value ) { 9375 if ( !( index in props ) ) { 9376 props[ index ] = value[ index ]; 9377 specialEasing[ index ] = easing; 9378 } 9379 } 9380 } else { 9381 specialEasing[ name ] = easing; 9382 } 9383 } 9384} 9385 9386function Animation( elem, properties, options ) { 9387 var result, 9388 stopped, 9389 index = 0, 9390 length = Animation.prefilters.length, 9391 deferred = jQuery.Deferred().always( function() { 9392 9393 // Don't match elem in the :animated selector 9394 delete tick.elem; 9395 } ), 9396 tick = function() { 9397 if ( stopped ) { 9398 return false; 9399 } 9400 var currentTime = fxNow || createFxNow(), 9401 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 9402 9403 // Support: Android 2.3 only 9404 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497) 9405 temp = remaining / animation.duration || 0, 9406 percent = 1 - temp, 9407 index = 0, 9408 length = animation.tweens.length; 9409 9410 for ( ; index < length; index++ ) { 9411 animation.tweens[ index ].run( percent ); 9412 } 9413 9414 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 9415 9416 // If there's more to do, yield 9417 if ( percent < 1 && length ) { 9418 return remaining; 9419 } 9420 9421 // If this was an empty animation, synthesize a final progress notification 9422 if ( !length ) { 9423 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 9424 } 9425 9426 // Resolve the animation and report its conclusion 9427 deferred.resolveWith( elem, [ animation ] ); 9428 return false; 9429 }, 9430 animation = deferred.promise( { 9431 elem: elem, 9432 props: jQuery.extend( {}, properties ), 9433 opts: jQuery.extend( true, { 9434 specialEasing: {}, 9435 easing: jQuery.easing._default 9436 }, options ), 9437 originalProperties: properties, 9438 originalOptions: options, 9439 startTime: fxNow || createFxNow(), 9440 duration: options.duration, 9441 tweens: [], 9442 createTween: function( prop, end ) { 9443 var tween = jQuery.Tween( elem, animation.opts, prop, end, 9444 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 9445 animation.tweens.push( tween ); 9446 return tween; 9447 }, 9448 stop: function( gotoEnd ) { 9449 var index = 0, 9450 9451 // If we are going to the end, we want to run all the tweens 9452 // otherwise we skip this part 9453 length = gotoEnd ? animation.tweens.length : 0; 9454 if ( stopped ) { 9455 return this; 9456 } 9457 stopped = true; 9458 for ( ; index < length; index++ ) { 9459 animation.tweens[ index ].run( 1 ); 9460 } 9461 9462 // Resolve when we played the last frame; otherwise, reject 9463 if ( gotoEnd ) { 9464 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 9465 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 9466 } else { 9467 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 9468 } 9469 return this; 9470 } 9471 } ), 9472 props = animation.props; 9473 9474 propFilter( props, animation.opts.specialEasing ); 9475 9476 for ( ; index < length; index++ ) { 9477 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 9478 if ( result ) { 9479 if ( isFunction( result.stop ) ) { 9480 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 9481 result.stop.bind( result ); 9482 } 9483 return result; 9484 } 9485 } 9486 9487 jQuery.map( props, createTween, animation ); 9488 9489 if ( isFunction( animation.opts.start ) ) { 9490 animation.opts.start.call( elem, animation ); 9491 } 9492 9493 // Attach callbacks from options 9494 animation 9495 .progress( animation.opts.progress ) 9496 .done( animation.opts.done, animation.opts.complete ) 9497 .fail( animation.opts.fail ) 9498 .always( animation.opts.always ); 9499 9500 jQuery.fx.timer( 9501 jQuery.extend( tick, { 9502 elem: elem, 9503 anim: animation, 9504 queue: animation.opts.queue 9505 } ) 9506 ); 9507 9508 return animation; 9509} 9510 9511jQuery.Animation = jQuery.extend( Animation, { 9512 9513 tweeners: { 9514 "*": [ function( prop, value ) { 9515 var tween = this.createTween( prop, value ); 9516 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 9517 return tween; 9518 } ] 9519 }, 9520 9521 tweener: function( props, callback ) { 9522 if ( isFunction( props ) ) { 9523 callback = props; 9524 props = [ "*" ]; 9525 } else { 9526 props = props.match( rnothtmlwhite ); 9527 } 9528 9529 var prop, 9530 index = 0, 9531 length = props.length; 9532 9533 for ( ; index < length; index++ ) { 9534 prop = props[ index ]; 9535 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 9536 Animation.tweeners[ prop ].unshift( callback ); 9537 } 9538 }, 9539 9540 prefilters: [ defaultPrefilter ], 9541 9542 prefilter: function( callback, prepend ) { 9543 if ( prepend ) { 9544 Animation.prefilters.unshift( callback ); 9545 } else { 9546 Animation.prefilters.push( callback ); 9547 } 9548 } 9549} ); 9550 9551jQuery.speed = function( speed, easing, fn ) { 9552 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 9553 complete: fn || !fn && easing || 9554 isFunction( speed ) && speed, 9555 duration: speed, 9556 easing: fn && easing || easing && !isFunction( easing ) && easing 9557 }; 9558 9559 // Go to the end state if fx are off 9560 if ( jQuery.fx.off ) { 9561 opt.duration = 0; 9562 9563 } else { 9564 if ( typeof opt.duration !== "number" ) { 9565 if ( opt.duration in jQuery.fx.speeds ) { 9566 opt.duration = jQuery.fx.speeds[ opt.duration ]; 9567 9568 } else { 9569 opt.duration = jQuery.fx.speeds._default; 9570 } 9571 } 9572 } 9573 9574 // Normalize opt.queue - true/undefined/null -> "fx" 9575 if ( opt.queue == null || opt.queue === true ) { 9576 opt.queue = "fx"; 9577 } 9578 9579 // Queueing 9580 opt.old = opt.complete; 9581 9582 opt.complete = function() { 9583 if ( isFunction( opt.old ) ) { 9584 opt.old.call( this ); 9585 } 9586 9587 if ( opt.queue ) { 9588 jQuery.dequeue( this, opt.queue ); 9589 } 9590 }; 9591 9592 return opt; 9593}; 9594 9595jQuery.fn.extend( { 9596 fadeTo: function( speed, to, easing, callback ) { 9597 9598 // Show any hidden elements after setting opacity to 0 9599 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 9600 9601 // Animate to the value specified 9602 .end().animate( { opacity: to }, speed, easing, callback ); 9603 }, 9604 animate: function( prop, speed, easing, callback ) { 9605 var empty = jQuery.isEmptyObject( prop ), 9606 optall = jQuery.speed( speed, easing, callback ), 9607 doAnimation = function() { 9608 9609 // Operate on a copy of prop so per-property easing won't be lost 9610 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 9611 9612 // Empty animations, or finishing resolves immediately 9613 if ( empty || dataPriv.get( this, "finish" ) ) { 9614 anim.stop( true ); 9615 } 9616 }; 9617 9618 doAnimation.finish = doAnimation; 9619 9620 return empty || optall.queue === false ? 9621 this.each( doAnimation ) : 9622 this.queue( optall.queue, doAnimation ); 9623 }, 9624 stop: function( type, clearQueue, gotoEnd ) { 9625 var stopQueue = function( hooks ) { 9626 var stop = hooks.stop; 9627 delete hooks.stop; 9628 stop( gotoEnd ); 9629 }; 9630 9631 if ( typeof type !== "string" ) { 9632 gotoEnd = clearQueue; 9633 clearQueue = type; 9634 type = undefined; 9635 } 9636 if ( clearQueue ) { 9637 this.queue( type || "fx", [] ); 9638 } 9639 9640 return this.each( function() { 9641 var dequeue = true, 9642 index = type != null && type + "queueHooks", 9643 timers = jQuery.timers, 9644 data = dataPriv.get( this ); 9645 9646 if ( index ) { 9647 if ( data[ index ] && data[ index ].stop ) { 9648 stopQueue( data[ index ] ); 9649 } 9650 } else { 9651 for ( index in data ) { 9652 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 9653 stopQueue( data[ index ] ); 9654 } 9655 } 9656 } 9657 9658 for ( index = timers.length; index--; ) { 9659 if ( timers[ index ].elem === this && 9660 ( type == null || timers[ index ].queue === type ) ) { 9661 9662 timers[ index ].anim.stop( gotoEnd ); 9663 dequeue = false; 9664 timers.splice( index, 1 ); 9665 } 9666 } 9667 9668 // Start the next in the queue if the last step wasn't forced. 9669 // Timers currently will call their complete callbacks, which 9670 // will dequeue but only if they were gotoEnd. 9671 if ( dequeue || !gotoEnd ) { 9672 jQuery.dequeue( this, type ); 9673 } 9674 } ); 9675 }, 9676 finish: function( type ) { 9677 if ( type !== false ) { 9678 type = type || "fx"; 9679 } 9680 return this.each( function() { 9681 var index, 9682 data = dataPriv.get( this ), 9683 queue = data[ type + "queue" ], 9684 hooks = data[ type + "queueHooks" ], 9685 timers = jQuery.timers, 9686 length = queue ? queue.length : 0; 9687 9688 // Enable finishing flag on private data 9689 data.finish = true; 9690 9691 // Empty the queue first 9692 jQuery.queue( this, type, [] ); 9693 9694 if ( hooks && hooks.stop ) { 9695 hooks.stop.call( this, true ); 9696 } 9697 9698 // Look for any active animations, and finish them 9699 for ( index = timers.length; index--; ) { 9700 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 9701 timers[ index ].anim.stop( true ); 9702 timers.splice( index, 1 ); 9703 } 9704 } 9705 9706 // Look for any animations in the old queue and finish them 9707 for ( index = 0; index < length; index++ ) { 9708 if ( queue[ index ] && queue[ index ].finish ) { 9709 queue[ index ].finish.call( this ); 9710 } 9711 } 9712 9713 // Turn off finishing flag 9714 delete data.finish; 9715 } ); 9716 } 9717} ); 9718 9719jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 9720 var cssFn = jQuery.fn[ name ]; 9721 jQuery.fn[ name ] = function( speed, easing, callback ) { 9722 return speed == null || typeof speed === "boolean" ? 9723 cssFn.apply( this, arguments ) : 9724 this.animate( genFx( name, true ), speed, easing, callback ); 9725 }; 9726} ); 9727 9728// Generate shortcuts for custom animations 9729jQuery.each( { 9730 slideDown: genFx( "show" ), 9731 slideUp: genFx( "hide" ), 9732 slideToggle: genFx( "toggle" ), 9733 fadeIn: { opacity: "show" }, 9734 fadeOut: { opacity: "hide" }, 9735 fadeToggle: { opacity: "toggle" } 9736}, function( name, props ) { 9737 jQuery.fn[ name ] = function( speed, easing, callback ) { 9738 return this.animate( props, speed, easing, callback ); 9739 }; 9740} ); 9741 9742jQuery.timers = []; 9743jQuery.fx.tick = function() { 9744 var timer, 9745 i = 0, 9746 timers = jQuery.timers; 9747 9748 fxNow = Date.now(); 9749 9750 for ( ; i < timers.length; i++ ) { 9751 timer = timers[ i ]; 9752 9753 // Run the timer and safely remove it when done (allowing for external removal) 9754 if ( !timer() && timers[ i ] === timer ) { 9755 timers.splice( i--, 1 ); 9756 } 9757 } 9758 9759 if ( !timers.length ) { 9760 jQuery.fx.stop(); 9761 } 9762 fxNow = undefined; 9763}; 9764 9765jQuery.fx.timer = function( timer ) { 9766 jQuery.timers.push( timer ); 9767 jQuery.fx.start(); 9768}; 9769 9770jQuery.fx.interval = 13; 9771jQuery.fx.start = function() { 9772 if ( inProgress ) { 9773 return; 9774 } 9775 9776 inProgress = true; 9777 schedule(); 9778}; 9779 9780jQuery.fx.stop = function() { 9781 inProgress = null; 9782}; 9783 9784jQuery.fx.speeds = { 9785 slow: 600, 9786 fast: 200, 9787 9788 // Default speed 9789 _default: 400 9790}; 9791 9792 9793// Based off of the plugin by Clint Helfers, with permission. 9794jQuery.fn.delay = function( time, type ) { 9795 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 9796 type = type || "fx"; 9797 9798 return this.queue( type, function( next, hooks ) { 9799 var timeout = window.setTimeout( next, time ); 9800 hooks.stop = function() { 9801 window.clearTimeout( timeout ); 9802 }; 9803 } ); 9804}; 9805 9806 9807( function() { 9808 var input = document.createElement( "input" ), 9809 select = document.createElement( "select" ), 9810 opt = select.appendChild( document.createElement( "option" ) ); 9811 9812 input.type = "checkbox"; 9813 9814 // Support: Android <=4.3 only 9815 // Default value for a checkbox should be "on" 9816 support.checkOn = input.value !== ""; 9817 9818 // Support: IE <=11 only 9819 // Must access selectedIndex to make default options select 9820 support.optSelected = opt.selected; 9821 9822 // Support: IE <=11 only 9823 // An input loses its value after becoming a radio 9824 input = document.createElement( "input" ); 9825 input.value = "t"; 9826 input.type = "radio"; 9827 support.radioValue = input.value === "t"; 9828} )(); 9829 9830 9831var boolHook, 9832 attrHandle = jQuery.expr.attrHandle; 9833 9834jQuery.fn.extend( { 9835 attr: function( name, value ) { 9836 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 9837 }, 9838 9839 removeAttr: function( name ) { 9840 return this.each( function() { 9841 jQuery.removeAttr( this, name ); 9842 } ); 9843 } 9844} ); 9845 9846jQuery.extend( { 9847 attr: function( elem, name, value ) { 9848 var ret, hooks, 9849 nType = elem.nodeType; 9850 9851 // Don't get/set attributes on text, comment and attribute nodes 9852 if ( nType === 3 || nType === 8 || nType === 2 ) { 9853 return; 9854 } 9855 9856 // Fallback to prop when attributes are not supported 9857 if ( typeof elem.getAttribute === "undefined" ) { 9858 return jQuery.prop( elem, name, value ); 9859 } 9860 9861 // Attribute hooks are determined by the lowercase version 9862 // Grab necessary hook if one is defined 9863 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 9864 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 9865 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 9866 } 9867 9868 if ( value !== undefined ) { 9869 if ( value === null ) { 9870 jQuery.removeAttr( elem, name ); 9871 return; 9872 } 9873 9874 if ( hooks && "set" in hooks && 9875 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 9876 return ret; 9877 } 9878 9879 elem.setAttribute( name, value + "" ); 9880 return value; 9881 } 9882 9883 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 9884 return ret; 9885 } 9886 9887 ret = jQuery.find.attr( elem, name ); 9888 9889 // Non-existent attributes return null, we normalize to undefined 9890 return ret == null ? undefined : ret; 9891 }, 9892 9893 attrHooks: { 9894 type: { 9895 set: function( elem, value ) { 9896 if ( !support.radioValue && value === "radio" && 9897 nodeName( elem, "input" ) ) { 9898 var val = elem.value; 9899 elem.setAttribute( "type", value ); 9900 if ( val ) { 9901 elem.value = val; 9902 } 9903 return value; 9904 } 9905 } 9906 } 9907 }, 9908 9909 removeAttr: function( elem, value ) { 9910 var name, 9911 i = 0, 9912 9913 // Attribute names can contain non-HTML whitespace characters 9914 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 9915 attrNames = value && value.match( rnothtmlwhite ); 9916 9917 if ( attrNames && elem.nodeType === 1 ) { 9918 while ( ( name = attrNames[ i++ ] ) ) { 9919 elem.removeAttribute( name ); 9920 } 9921 } 9922 } 9923} ); 9924 9925// Hooks for boolean attributes 9926boolHook = { 9927 set: function( elem, value, name ) { 9928 if ( value === false ) { 9929 9930 // Remove boolean attributes when set to false 9931 jQuery.removeAttr( elem, name ); 9932 } else { 9933 elem.setAttribute( name, name ); 9934 } 9935 return name; 9936 } 9937}; 9938 9939jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 9940 var getter = attrHandle[ name ] || jQuery.find.attr; 9941 9942 attrHandle[ name ] = function( elem, name, isXML ) { 9943 var ret, handle, 9944 lowercaseName = name.toLowerCase(); 9945 9946 if ( !isXML ) { 9947 9948 // Avoid an infinite loop by temporarily removing this function from the getter 9949 handle = attrHandle[ lowercaseName ]; 9950 attrHandle[ lowercaseName ] = ret; 9951 ret = getter( elem, name, isXML ) != null ? 9952 lowercaseName : 9953 null; 9954 attrHandle[ lowercaseName ] = handle; 9955 } 9956 return ret; 9957 }; 9958} ); 9959 9960 9961 9962 9963var rfocusable = /^(?:input|select|textarea|button)$/i, 9964 rclickable = /^(?:a|area)$/i; 9965 9966jQuery.fn.extend( { 9967 prop: function( name, value ) { 9968 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 9969 }, 9970 9971 removeProp: function( name ) { 9972 return this.each( function() { 9973 delete this[ jQuery.propFix[ name ] || name ]; 9974 } ); 9975 } 9976} ); 9977 9978jQuery.extend( { 9979 prop: function( elem, name, value ) { 9980 var ret, hooks, 9981 nType = elem.nodeType; 9982 9983 // Don't get/set properties on text, comment and attribute nodes 9984 if ( nType === 3 || nType === 8 || nType === 2 ) { 9985 return; 9986 } 9987 9988 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 9989 9990 // Fix name and attach hooks 9991 name = jQuery.propFix[ name ] || name; 9992 hooks = jQuery.propHooks[ name ]; 9993 } 9994 9995 if ( value !== undefined ) { 9996 if ( hooks && "set" in hooks && 9997 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 9998 return ret; 9999 } 10000 10001 return ( elem[ name ] = value ); 10002 } 10003 10004 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 10005 return ret; 10006 } 10007 10008 return elem[ name ]; 10009 }, 10010 10011 propHooks: { 10012 tabIndex: { 10013 get: function( elem ) { 10014 10015 // Support: IE <=9 - 11 only 10016 // elem.tabIndex doesn't always return the 10017 // correct value when it hasn't been explicitly set 10018 // Use proper attribute retrieval (trac-12072) 10019 var tabindex = jQuery.find.attr( elem, "tabindex" ); 10020 10021 if ( tabindex ) { 10022 return parseInt( tabindex, 10 ); 10023 } 10024 10025 if ( 10026 rfocusable.test( elem.nodeName ) || 10027 rclickable.test( elem.nodeName ) && 10028 elem.href 10029 ) { 10030 return 0; 10031 } 10032 10033 return -1; 10034 } 10035 } 10036 }, 10037 10038 propFix: { 10039 "for": "htmlFor", 10040 "class": "className" 10041 } 10042} ); 10043 10044// Support: IE <=11 only 10045// Accessing the selectedIndex property 10046// forces the browser to respect setting selected 10047// on the option 10048// The getter ensures a default option is selected 10049// when in an optgroup 10050// eslint rule "no-unused-expressions" is disabled for this code 10051// since it considers such accessions noop 10052if ( !support.optSelected ) { 10053 jQuery.propHooks.selected = { 10054 get: function( elem ) { 10055 10056 /* eslint no-unused-expressions: "off" */ 10057 10058 var parent = elem.parentNode; 10059 if ( parent && parent.parentNode ) { 10060 parent.parentNode.selectedIndex; 10061 } 10062 return null; 10063 }, 10064 set: function( elem ) { 10065 10066 /* eslint no-unused-expressions: "off" */ 10067 10068 var parent = elem.parentNode; 10069 if ( parent ) { 10070 parent.selectedIndex; 10071 10072 if ( parent.parentNode ) { 10073 parent.parentNode.selectedIndex; 10074 } 10075 } 10076 } 10077 }; 10078} 10079 10080jQuery.each( [ 10081 "tabIndex", 10082 "readOnly", 10083 "maxLength", 10084 "cellSpacing", 10085 "cellPadding", 10086 "rowSpan", 10087 "colSpan", 10088 "useMap", 10089 "frameBorder", 10090 "contentEditable" 10091], function() { 10092 jQuery.propFix[ this.toLowerCase() ] = this; 10093} ); 10094 10095 10096 10097 10098 // Strip and collapse whitespace according to HTML spec 10099 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 10100 function stripAndCollapse( value ) { 10101 var tokens = value.match( rnothtmlwhite ) || []; 10102 return tokens.join( " " ); 10103 } 10104 10105 10106function getClass( elem ) { 10107 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 10108} 10109 10110function classesToArray( value ) { 10111 if ( Array.isArray( value ) ) { 10112 return value; 10113 } 10114 if ( typeof value === "string" ) { 10115 return value.match( rnothtmlwhite ) || []; 10116 } 10117 return []; 10118} 10119 10120jQuery.fn.extend( { 10121 addClass: function( value ) { 10122 var classNames, cur, curValue, className, i, finalValue; 10123 10124 if ( isFunction( value ) ) { 10125 return this.each( function( j ) { 10126 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 10127 } ); 10128 } 10129 10130 classNames = classesToArray( value ); 10131 10132 if ( classNames.length ) { 10133 return this.each( function() { 10134 curValue = getClass( this ); 10135 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 10136 10137 if ( cur ) { 10138 for ( i = 0; i < classNames.length; i++ ) { 10139 className = classNames[ i ]; 10140 if ( cur.indexOf( " " + className + " " ) < 0 ) { 10141 cur += className + " "; 10142 } 10143 } 10144 10145 // Only assign if different to avoid unneeded rendering. 10146 finalValue = stripAndCollapse( cur ); 10147 if ( curValue !== finalValue ) { 10148 this.setAttribute( "class", finalValue ); 10149 } 10150 } 10151 } ); 10152 } 10153 10154 return this; 10155 }, 10156 10157 removeClass: function( value ) { 10158 var classNames, cur, curValue, className, i, finalValue; 10159 10160 if ( isFunction( value ) ) { 10161 return this.each( function( j ) { 10162 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 10163 } ); 10164 } 10165 10166 if ( !arguments.length ) { 10167 return this.attr( "class", "" ); 10168 } 10169 10170 classNames = classesToArray( value ); 10171 10172 if ( classNames.length ) { 10173 return this.each( function() { 10174 curValue = getClass( this ); 10175 10176 // This expression is here for better compressibility (see addClass) 10177 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 10178 10179 if ( cur ) { 10180 for ( i = 0; i < classNames.length; i++ ) { 10181 className = classNames[ i ]; 10182 10183 // Remove *all* instances 10184 while ( cur.indexOf( " " + className + " " ) > -1 ) { 10185 cur = cur.replace( " " + className + " ", " " ); 10186 } 10187 } 10188 10189 // Only assign if different to avoid unneeded rendering. 10190 finalValue = stripAndCollapse( cur ); 10191 if ( curValue !== finalValue ) { 10192 this.setAttribute( "class", finalValue ); 10193 } 10194 } 10195 } ); 10196 } 10197 10198 return this; 10199 }, 10200 10201 toggleClass: function( value, stateVal ) { 10202 var classNames, className, i, self, 10203 type = typeof value, 10204 isValidValue = type === "string" || Array.isArray( value ); 10205 10206 if ( isFunction( value ) ) { 10207 return this.each( function( i ) { 10208 jQuery( this ).toggleClass( 10209 value.call( this, i, getClass( this ), stateVal ), 10210 stateVal 10211 ); 10212 } ); 10213 } 10214 10215 if ( typeof stateVal === "boolean" && isValidValue ) { 10216 return stateVal ? this.addClass( value ) : this.removeClass( value ); 10217 } 10218 10219 classNames = classesToArray( value ); 10220 10221 return this.each( function() { 10222 if ( isValidValue ) { 10223 10224 // Toggle individual class names 10225 self = jQuery( this ); 10226 10227 for ( i = 0; i < classNames.length; i++ ) { 10228 className = classNames[ i ]; 10229 10230 // Check each className given, space separated list 10231 if ( self.hasClass( className ) ) { 10232 self.removeClass( className ); 10233 } else { 10234 self.addClass( className ); 10235 } 10236 } 10237 10238 // Toggle whole class name 10239 } else if ( value === undefined || type === "boolean" ) { 10240 className = getClass( this ); 10241 if ( className ) { 10242 10243 // Store className if set 10244 dataPriv.set( this, "__className__", className ); 10245 } 10246 10247 // If the element has a class name or if we're passed `false`, 10248 // then remove the whole classname (if there was one, the above saved it). 10249 // Otherwise bring back whatever was previously saved (if anything), 10250 // falling back to the empty string if nothing was stored. 10251 if ( this.setAttribute ) { 10252 this.setAttribute( "class", 10253 className || value === false ? 10254 "" : 10255 dataPriv.get( this, "__className__" ) || "" 10256 ); 10257 } 10258 } 10259 } ); 10260 }, 10261 10262 hasClass: function( selector ) { 10263 var className, elem, 10264 i = 0; 10265 10266 className = " " + selector + " "; 10267 while ( ( elem = this[ i++ ] ) ) { 10268 if ( elem.nodeType === 1 && 10269 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 10270 return true; 10271 } 10272 } 10273 10274 return false; 10275 } 10276} ); 10277 10278 10279 10280 10281var rreturn = /\r/g; 10282 10283jQuery.fn.extend( { 10284 val: function( value ) { 10285 var hooks, ret, valueIsFunction, 10286 elem = this[ 0 ]; 10287 10288 if ( !arguments.length ) { 10289 if ( elem ) { 10290 hooks = jQuery.valHooks[ elem.type ] || 10291 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 10292 10293 if ( hooks && 10294 "get" in hooks && 10295 ( ret = hooks.get( elem, "value" ) ) !== undefined 10296 ) { 10297 return ret; 10298 } 10299 10300 ret = elem.value; 10301 10302 // Handle most common string cases 10303 if ( typeof ret === "string" ) { 10304 return ret.replace( rreturn, "" ); 10305 } 10306 10307 // Handle cases where value is null/undef or number 10308 return ret == null ? "" : ret; 10309 } 10310 10311 return; 10312 } 10313 10314 valueIsFunction = isFunction( value ); 10315 10316 return this.each( function( i ) { 10317 var val; 10318 10319 if ( this.nodeType !== 1 ) { 10320 return; 10321 } 10322 10323 if ( valueIsFunction ) { 10324 val = value.call( this, i, jQuery( this ).val() ); 10325 } else { 10326 val = value; 10327 } 10328 10329 // Treat null/undefined as ""; convert numbers to string 10330 if ( val == null ) { 10331 val = ""; 10332 10333 } else if ( typeof val === "number" ) { 10334 val += ""; 10335 10336 } else if ( Array.isArray( val ) ) { 10337 val = jQuery.map( val, function( value ) { 10338 return value == null ? "" : value + ""; 10339 } ); 10340 } 10341 10342 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 10343 10344 // If set returns undefined, fall back to normal setting 10345 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 10346 this.value = val; 10347 } 10348 } ); 10349 } 10350} ); 10351 10352jQuery.extend( { 10353 valHooks: { 10354 option: { 10355 get: function( elem ) { 10356 10357 var val = jQuery.find.attr( elem, "value" ); 10358 return val != null ? 10359 val : 10360 10361 // Support: IE <=10 - 11 only 10362 // option.text throws exceptions (trac-14686, trac-14858) 10363 // Strip and collapse whitespace 10364 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 10365 stripAndCollapse( jQuery.text( elem ) ); 10366 } 10367 }, 10368 select: { 10369 get: function( elem ) { 10370 var value, option, i, 10371 options = elem.options, 10372 index = elem.selectedIndex, 10373 one = elem.type === "select-one", 10374 values = one ? null : [], 10375 max = one ? index + 1 : options.length; 10376 10377 if ( index < 0 ) { 10378 i = max; 10379 10380 } else { 10381 i = one ? index : 0; 10382 } 10383 10384 // Loop through all the selected options 10385 for ( ; i < max; i++ ) { 10386 option = options[ i ]; 10387 10388 // Support: IE <=9 only 10389 // IE8-9 doesn't update selected after form reset (trac-2551) 10390 if ( ( option.selected || i === index ) && 10391 10392 // Don't return options that are disabled or in a disabled optgroup 10393 !option.disabled && 10394 ( !option.parentNode.disabled || 10395 !nodeName( option.parentNode, "optgroup" ) ) ) { 10396 10397 // Get the specific value for the option 10398 value = jQuery( option ).val(); 10399 10400 // We don't need an array for one selects 10401 if ( one ) { 10402 return value; 10403 } 10404 10405 // Multi-Selects return an array 10406 values.push( value ); 10407 } 10408 } 10409 10410 return values; 10411 }, 10412 10413 set: function( elem, value ) { 10414 var optionSet, option, 10415 options = elem.options, 10416 values = jQuery.makeArray( value ), 10417 i = options.length; 10418 10419 while ( i-- ) { 10420 option = options[ i ]; 10421 10422 /* eslint-disable no-cond-assign */ 10423 10424 if ( option.selected = 10425 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 10426 ) { 10427 optionSet = true; 10428 } 10429 10430 /* eslint-enable no-cond-assign */ 10431 } 10432 10433 // Force browsers to behave consistently when non-matching value is set 10434 if ( !optionSet ) { 10435 elem.selectedIndex = -1; 10436 } 10437 return values; 10438 } 10439 } 10440 } 10441} ); 10442 10443// Radios and checkboxes getter/setter 10444jQuery.each( [ "radio", "checkbox" ], function() { 10445 jQuery.valHooks[ this ] = { 10446 set: function( elem, value ) { 10447 if ( Array.isArray( value ) ) { 10448 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 10449 } 10450 } 10451 }; 10452 if ( !support.checkOn ) { 10453 jQuery.valHooks[ this ].get = function( elem ) { 10454 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 10455 }; 10456 } 10457} ); 10458 10459 10460 10461 10462// Return jQuery for attributes-only inclusion 10463var location = window.location; 10464 10465var nonce = { guid: Date.now() }; 10466 10467var rquery = ( /\?/ ); 10468 10469 10470 10471// Cross-browser xml parsing 10472jQuery.parseXML = function( data ) { 10473 var xml, parserErrorElem; 10474 if ( !data || typeof data !== "string" ) { 10475 return null; 10476 } 10477 10478 // Support: IE 9 - 11 only 10479 // IE throws on parseFromString with invalid input. 10480 try { 10481 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 10482 } catch ( e ) {} 10483 10484 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; 10485 if ( !xml || parserErrorElem ) { 10486 jQuery.error( "Invalid XML: " + ( 10487 parserErrorElem ? 10488 jQuery.map( parserErrorElem.childNodes, function( el ) { 10489 return el.textContent; 10490 } ).join( "\n" ) : 10491 data 10492 ) ); 10493 } 10494 return xml; 10495}; 10496 10497 10498var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 10499 stopPropagationCallback = function( e ) { 10500 e.stopPropagation(); 10501 }; 10502 10503jQuery.extend( jQuery.event, { 10504 10505 trigger: function( event, data, elem, onlyHandlers ) { 10506 10507 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 10508 eventPath = [ elem || document ], 10509 type = hasOwn.call( event, "type" ) ? event.type : event, 10510 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 10511 10512 cur = lastElement = tmp = elem = elem || document; 10513 10514 // Don't do events on text and comment nodes 10515 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 10516 return; 10517 } 10518 10519 // focus/blur morphs to focusin/out; ensure we're not firing them right now 10520 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 10521 return; 10522 } 10523 10524 if ( type.indexOf( "." ) > -1 ) { 10525 10526 // Namespaced trigger; create a regexp to match event type in handle() 10527 namespaces = type.split( "." ); 10528 type = namespaces.shift(); 10529 namespaces.sort(); 10530 } 10531 ontype = type.indexOf( ":" ) < 0 && "on" + type; 10532 10533 // Caller can pass in a jQuery.Event object, Object, or just an event type string 10534 event = event[ jQuery.expando ] ? 10535 event : 10536 new jQuery.Event( type, typeof event === "object" && event ); 10537 10538 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 10539 event.isTrigger = onlyHandlers ? 2 : 3; 10540 event.namespace = namespaces.join( "." ); 10541 event.rnamespace = event.namespace ? 10542 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 10543 null; 10544 10545 // Clean up the event in case it is being reused 10546 event.result = undefined; 10547 if ( !event.target ) { 10548 event.target = elem; 10549 } 10550 10551 // Clone any incoming data and prepend the event, creating the handler arg list 10552 data = data == null ? 10553 [ event ] : 10554 jQuery.makeArray( data, [ event ] ); 10555 10556 // Allow special events to draw outside the lines 10557 special = jQuery.event.special[ type ] || {}; 10558 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 10559 return; 10560 } 10561 10562 // Determine event propagation path in advance, per W3C events spec (trac-9951) 10563 // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724) 10564 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 10565 10566 bubbleType = special.delegateType || type; 10567 if ( !rfocusMorph.test( bubbleType + type ) ) { 10568 cur = cur.parentNode; 10569 } 10570 for ( ; cur; cur = cur.parentNode ) { 10571 eventPath.push( cur ); 10572 tmp = cur; 10573 } 10574 10575 // Only add window if we got to document (e.g., not plain obj or detached DOM) 10576 if ( tmp === ( elem.ownerDocument || document ) ) { 10577 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 10578 } 10579 } 10580 10581 // Fire handlers on the event path 10582 i = 0; 10583 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 10584 lastElement = cur; 10585 event.type = i > 1 ? 10586 bubbleType : 10587 special.bindType || type; 10588 10589 // jQuery handler 10590 handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && 10591 dataPriv.get( cur, "handle" ); 10592 if ( handle ) { 10593 handle.apply( cur, data ); 10594 } 10595 10596 // Native handler 10597 handle = ontype && cur[ ontype ]; 10598 if ( handle && handle.apply && acceptData( cur ) ) { 10599 event.result = handle.apply( cur, data ); 10600 if ( event.result === false ) { 10601 event.preventDefault(); 10602 } 10603 } 10604 } 10605 event.type = type; 10606 10607 // If nobody prevented the default action, do it now 10608 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 10609 10610 if ( ( !special._default || 10611 special._default.apply( eventPath.pop(), data ) === false ) && 10612 acceptData( elem ) ) { 10613 10614 // Call a native DOM method on the target with the same name as the event. 10615 // Don't do default actions on window, that's where global variables be (trac-6170) 10616 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 10617 10618 // Don't re-trigger an onFOO event when we call its FOO() method 10619 tmp = elem[ ontype ]; 10620 10621 if ( tmp ) { 10622 elem[ ontype ] = null; 10623 } 10624 10625 // Prevent re-triggering of the same event, since we already bubbled it above 10626 jQuery.event.triggered = type; 10627 10628 if ( event.isPropagationStopped() ) { 10629 lastElement.addEventListener( type, stopPropagationCallback ); 10630 } 10631 10632 elem[ type ](); 10633 10634 if ( event.isPropagationStopped() ) { 10635 lastElement.removeEventListener( type, stopPropagationCallback ); 10636 } 10637 10638 jQuery.event.triggered = undefined; 10639 10640 if ( tmp ) { 10641 elem[ ontype ] = tmp; 10642 } 10643 } 10644 } 10645 } 10646 10647 return event.result; 10648 }, 10649 10650 // Piggyback on a donor event to simulate a different one 10651 // Used only for `focus(in | out)` events 10652 simulate: function( type, elem, event ) { 10653 var e = jQuery.extend( 10654 new jQuery.Event(), 10655 event, 10656 { 10657 type: type, 10658 isSimulated: true 10659 } 10660 ); 10661 10662 jQuery.event.trigger( e, null, elem ); 10663 } 10664 10665} ); 10666 10667jQuery.fn.extend( { 10668 10669 trigger: function( type, data ) { 10670 return this.each( function() { 10671 jQuery.event.trigger( type, data, this ); 10672 } ); 10673 }, 10674 triggerHandler: function( type, data ) { 10675 var elem = this[ 0 ]; 10676 if ( elem ) { 10677 return jQuery.event.trigger( type, data, elem, true ); 10678 } 10679 } 10680} ); 10681 10682 10683var 10684 rbracket = /\[\]$/, 10685 rCRLF = /\r?\n/g, 10686 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 10687 rsubmittable = /^(?:input|select|textarea|keygen)/i; 10688 10689function buildParams( prefix, obj, traditional, add ) { 10690 var name; 10691 10692 if ( Array.isArray( obj ) ) { 10693 10694 // Serialize array item. 10695 jQuery.each( obj, function( i, v ) { 10696 if ( traditional || rbracket.test( prefix ) ) { 10697 10698 // Treat each array item as a scalar. 10699 add( prefix, v ); 10700 10701 } else { 10702 10703 // Item is non-scalar (array or object), encode its numeric index. 10704 buildParams( 10705 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 10706 v, 10707 traditional, 10708 add 10709 ); 10710 } 10711 } ); 10712 10713 } else if ( !traditional && toType( obj ) === "object" ) { 10714 10715 // Serialize object item. 10716 for ( name in obj ) { 10717 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 10718 } 10719 10720 } else { 10721 10722 // Serialize scalar item. 10723 add( prefix, obj ); 10724 } 10725} 10726 10727// Serialize an array of form elements or a set of 10728// key/values into a query string 10729jQuery.param = function( a, traditional ) { 10730 var prefix, 10731 s = [], 10732 add = function( key, valueOrFunction ) { 10733 10734 // If value is a function, invoke it and use its return value 10735 var value = isFunction( valueOrFunction ) ? 10736 valueOrFunction() : 10737 valueOrFunction; 10738 10739 s[ s.length ] = encodeURIComponent( key ) + "=" + 10740 encodeURIComponent( value == null ? "" : value ); 10741 }; 10742 10743 if ( a == null ) { 10744 return ""; 10745 } 10746 10747 // If an array was passed in, assume that it is an array of form elements. 10748 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 10749 10750 // Serialize the form elements 10751 jQuery.each( a, function() { 10752 add( this.name, this.value ); 10753 } ); 10754 10755 } else { 10756 10757 // If traditional, encode the "old" way (the way 1.3.2 or older 10758 // did it), otherwise encode params recursively. 10759 for ( prefix in a ) { 10760 buildParams( prefix, a[ prefix ], traditional, add ); 10761 } 10762 } 10763 10764 // Return the resulting serialization 10765 return s.join( "&" ); 10766}; 10767 10768jQuery.fn.extend( { 10769 serialize: function() { 10770 return jQuery.param( this.serializeArray() ); 10771 }, 10772 serializeArray: function() { 10773 return this.map( function() { 10774 10775 // Can add propHook for "elements" to filter or add form elements 10776 var elements = jQuery.prop( this, "elements" ); 10777 return elements ? jQuery.makeArray( elements ) : this; 10778 } ).filter( function() { 10779 var type = this.type; 10780 10781 // Use .is( ":disabled" ) so that fieldset[disabled] works 10782 return this.name && !jQuery( this ).is( ":disabled" ) && 10783 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 10784 ( this.checked || !rcheckableType.test( type ) ); 10785 } ).map( function( _i, elem ) { 10786 var val = jQuery( this ).val(); 10787 10788 if ( val == null ) { 10789 return null; 10790 } 10791 10792 if ( Array.isArray( val ) ) { 10793 return jQuery.map( val, function( val ) { 10794 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 10795 } ); 10796 } 10797 10798 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 10799 } ).get(); 10800 } 10801} ); 10802 10803 10804var 10805 r20 = /%20/g, 10806 rhash = /#.*$/, 10807 rantiCache = /([?&])_=[^&]*/, 10808 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 10809 10810 // trac-7653, trac-8125, trac-8152: local protocol detection 10811 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 10812 rnoContent = /^(?:GET|HEAD)$/, 10813 rprotocol = /^\/\//, 10814 10815 /* Prefilters 10816 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 10817 * 2) These are called: 10818 * - BEFORE asking for a transport 10819 * - AFTER param serialization (s.data is a string if s.processData is true) 10820 * 3) key is the dataType 10821 * 4) the catchall symbol "*" can be used 10822 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 10823 */ 10824 prefilters = {}, 10825 10826 /* Transports bindings 10827 * 1) key is the dataType 10828 * 2) the catchall symbol "*" can be used 10829 * 3) selection will start with transport dataType and THEN go to "*" if needed 10830 */ 10831 transports = {}, 10832 10833 // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression 10834 allTypes = "*/".concat( "*" ), 10835 10836 // Anchor tag for parsing the document origin 10837 originAnchor = document.createElement( "a" ); 10838 10839originAnchor.href = location.href; 10840 10841// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 10842function addToPrefiltersOrTransports( structure ) { 10843 10844 // dataTypeExpression is optional and defaults to "*" 10845 return function( dataTypeExpression, func ) { 10846 10847 if ( typeof dataTypeExpression !== "string" ) { 10848 func = dataTypeExpression; 10849 dataTypeExpression = "*"; 10850 } 10851 10852 var dataType, 10853 i = 0, 10854 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 10855 10856 if ( isFunction( func ) ) { 10857 10858 // For each dataType in the dataTypeExpression 10859 while ( ( dataType = dataTypes[ i++ ] ) ) { 10860 10861 // Prepend if requested 10862 if ( dataType[ 0 ] === "+" ) { 10863 dataType = dataType.slice( 1 ) || "*"; 10864 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 10865 10866 // Otherwise append 10867 } else { 10868 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 10869 } 10870 } 10871 } 10872 }; 10873} 10874 10875// Base inspection function for prefilters and transports 10876function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 10877 10878 var inspected = {}, 10879 seekingTransport = ( structure === transports ); 10880 10881 function inspect( dataType ) { 10882 var selected; 10883 inspected[ dataType ] = true; 10884 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 10885 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 10886 if ( typeof dataTypeOrTransport === "string" && 10887 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 10888 10889 options.dataTypes.unshift( dataTypeOrTransport ); 10890 inspect( dataTypeOrTransport ); 10891 return false; 10892 } else if ( seekingTransport ) { 10893 return !( selected = dataTypeOrTransport ); 10894 } 10895 } ); 10896 return selected; 10897 } 10898 10899 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 10900} 10901 10902// A special extend for ajax options 10903// that takes "flat" options (not to be deep extended) 10904// Fixes trac-9887 10905function ajaxExtend( target, src ) { 10906 var key, deep, 10907 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 10908 10909 for ( key in src ) { 10910 if ( src[ key ] !== undefined ) { 10911 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 10912 } 10913 } 10914 if ( deep ) { 10915 jQuery.extend( true, target, deep ); 10916 } 10917 10918 return target; 10919} 10920 10921/* Handles responses to an ajax request: 10922 * - finds the right dataType (mediates between content-type and expected dataType) 10923 * - returns the corresponding response 10924 */ 10925function ajaxHandleResponses( s, jqXHR, responses ) { 10926 10927 var ct, type, finalDataType, firstDataType, 10928 contents = s.contents, 10929 dataTypes = s.dataTypes; 10930 10931 // Remove auto dataType and get content-type in the process 10932 while ( dataTypes[ 0 ] === "*" ) { 10933 dataTypes.shift(); 10934 if ( ct === undefined ) { 10935 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 10936 } 10937 } 10938 10939 // Check if we're dealing with a known content-type 10940 if ( ct ) { 10941 for ( type in contents ) { 10942 if ( contents[ type ] && contents[ type ].test( ct ) ) { 10943 dataTypes.unshift( type ); 10944 break; 10945 } 10946 } 10947 } 10948 10949 // Check to see if we have a response for the expected dataType 10950 if ( dataTypes[ 0 ] in responses ) { 10951 finalDataType = dataTypes[ 0 ]; 10952 } else { 10953 10954 // Try convertible dataTypes 10955 for ( type in responses ) { 10956 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 10957 finalDataType = type; 10958 break; 10959 } 10960 if ( !firstDataType ) { 10961 firstDataType = type; 10962 } 10963 } 10964 10965 // Or just use first one 10966 finalDataType = finalDataType || firstDataType; 10967 } 10968 10969 // If we found a dataType 10970 // We add the dataType to the list if needed 10971 // and return the corresponding response 10972 if ( finalDataType ) { 10973 if ( finalDataType !== dataTypes[ 0 ] ) { 10974 dataTypes.unshift( finalDataType ); 10975 } 10976 return responses[ finalDataType ]; 10977 } 10978} 10979 10980/* Chain conversions given the request and the original response 10981 * Also sets the responseXXX fields on the jqXHR instance 10982 */ 10983function ajaxConvert( s, response, jqXHR, isSuccess ) { 10984 var conv2, current, conv, tmp, prev, 10985 converters = {}, 10986 10987 // Work with a copy of dataTypes in case we need to modify it for conversion 10988 dataTypes = s.dataTypes.slice(); 10989 10990 // Create converters map with lowercased keys 10991 if ( dataTypes[ 1 ] ) { 10992 for ( conv in s.converters ) { 10993 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 10994 } 10995 } 10996 10997 current = dataTypes.shift(); 10998 10999 // Convert to each sequential dataType 11000 while ( current ) { 11001 11002 if ( s.responseFields[ current ] ) { 11003 jqXHR[ s.responseFields[ current ] ] = response; 11004 } 11005 11006 // Apply the dataFilter if provided 11007 if ( !prev && isSuccess && s.dataFilter ) { 11008 response = s.dataFilter( response, s.dataType ); 11009 } 11010 11011 prev = current; 11012 current = dataTypes.shift(); 11013 11014 if ( current ) { 11015 11016 // There's only work to do if current dataType is non-auto 11017 if ( current === "*" ) { 11018 11019 current = prev; 11020 11021 // Convert response if prev dataType is non-auto and differs from current 11022 } else if ( prev !== "*" && prev !== current ) { 11023 11024 // Seek a direct converter 11025 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 11026 11027 // If none found, seek a pair 11028 if ( !conv ) { 11029 for ( conv2 in converters ) { 11030 11031 // If conv2 outputs current 11032 tmp = conv2.split( " " ); 11033 if ( tmp[ 1 ] === current ) { 11034 11035 // If prev can be converted to accepted input 11036 conv = converters[ prev + " " + tmp[ 0 ] ] || 11037 converters[ "* " + tmp[ 0 ] ]; 11038 if ( conv ) { 11039 11040 // Condense equivalence converters 11041 if ( conv === true ) { 11042 conv = converters[ conv2 ]; 11043 11044 // Otherwise, insert the intermediate dataType 11045 } else if ( converters[ conv2 ] !== true ) { 11046 current = tmp[ 0 ]; 11047 dataTypes.unshift( tmp[ 1 ] ); 11048 } 11049 break; 11050 } 11051 } 11052 } 11053 } 11054 11055 // Apply converter (if not an equivalence) 11056 if ( conv !== true ) { 11057 11058 // Unless errors are allowed to bubble, catch and return them 11059 if ( conv && s.throws ) { 11060 response = conv( response ); 11061 } else { 11062 try { 11063 response = conv( response ); 11064 } catch ( e ) { 11065 return { 11066 state: "parsererror", 11067 error: conv ? e : "No conversion from " + prev + " to " + current 11068 }; 11069 } 11070 } 11071 } 11072 } 11073 } 11074 } 11075 11076 return { state: "success", data: response }; 11077} 11078 11079jQuery.extend( { 11080 11081 // Counter for holding the number of active queries 11082 active: 0, 11083 11084 // Last-Modified header cache for next request 11085 lastModified: {}, 11086 etag: {}, 11087 11088 ajaxSettings: { 11089 url: location.href, 11090 type: "GET", 11091 isLocal: rlocalProtocol.test( location.protocol ), 11092 global: true, 11093 processData: true, 11094 async: true, 11095 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 11096 11097 /* 11098 timeout: 0, 11099 data: null, 11100 dataType: null, 11101 username: null, 11102 password: null, 11103 cache: null, 11104 throws: false, 11105 traditional: false, 11106 headers: {}, 11107 */ 11108 11109 accepts: { 11110 "*": allTypes, 11111 text: "text/plain", 11112 html: "text/html", 11113 xml: "application/xml, text/xml", 11114 json: "application/json, text/javascript" 11115 }, 11116 11117 contents: { 11118 xml: /\bxml\b/, 11119 html: /\bhtml/, 11120 json: /\bjson\b/ 11121 }, 11122 11123 responseFields: { 11124 xml: "responseXML", 11125 text: "responseText", 11126 json: "responseJSON" 11127 }, 11128 11129 // Data converters 11130 // Keys separate source (or catchall "*") and destination types with a single space 11131 converters: { 11132 11133 // Convert anything to text 11134 "* text": String, 11135 11136 // Text to html (true = no transformation) 11137 "text html": true, 11138 11139 // Evaluate text as a json expression 11140 "text json": JSON.parse, 11141 11142 // Parse text as xml 11143 "text xml": jQuery.parseXML 11144 }, 11145 11146 // For options that shouldn't be deep extended: 11147 // you can add your own custom options here if 11148 // and when you create one that shouldn't be 11149 // deep extended (see ajaxExtend) 11150 flatOptions: { 11151 url: true, 11152 context: true 11153 } 11154 }, 11155 11156 // Creates a full fledged settings object into target 11157 // with both ajaxSettings and settings fields. 11158 // If target is omitted, writes into ajaxSettings. 11159 ajaxSetup: function( target, settings ) { 11160 return settings ? 11161 11162 // Building a settings object 11163 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 11164 11165 // Extending ajaxSettings 11166 ajaxExtend( jQuery.ajaxSettings, target ); 11167 }, 11168 11169 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 11170 ajaxTransport: addToPrefiltersOrTransports( transports ), 11171 11172 // Main method 11173 ajax: function( url, options ) { 11174 11175 // If url is an object, simulate pre-1.5 signature 11176 if ( typeof url === "object" ) { 11177 options = url; 11178 url = undefined; 11179 } 11180 11181 // Force options to be an object 11182 options = options || {}; 11183 11184 var transport, 11185 11186 // URL without anti-cache param 11187 cacheURL, 11188 11189 // Response headers 11190 responseHeadersString, 11191 responseHeaders, 11192 11193 // timeout handle 11194 timeoutTimer, 11195 11196 // Url cleanup var 11197 urlAnchor, 11198 11199 // Request state (becomes false upon send and true upon completion) 11200 completed, 11201 11202 // To know if global events are to be dispatched 11203 fireGlobals, 11204 11205 // Loop variable 11206 i, 11207 11208 // uncached part of the url 11209 uncached, 11210 11211 // Create the final options object 11212 s = jQuery.ajaxSetup( {}, options ), 11213 11214 // Callbacks context 11215 callbackContext = s.context || s, 11216 11217 // Context for global events is callbackContext if it is a DOM node or jQuery collection 11218 globalEventContext = s.context && 11219 ( callbackContext.nodeType || callbackContext.jquery ) ? 11220 jQuery( callbackContext ) : 11221 jQuery.event, 11222 11223 // Deferreds 11224 deferred = jQuery.Deferred(), 11225 completeDeferred = jQuery.Callbacks( "once memory" ), 11226 11227 // Status-dependent callbacks 11228 statusCode = s.statusCode || {}, 11229 11230 // Headers (they are sent all at once) 11231 requestHeaders = {}, 11232 requestHeadersNames = {}, 11233 11234 // Default abort message 11235 strAbort = "canceled", 11236 11237 // Fake xhr 11238 jqXHR = { 11239 readyState: 0, 11240 11241 // Builds headers hashtable if needed 11242 getResponseHeader: function( key ) { 11243 var match; 11244 if ( completed ) { 11245 if ( !responseHeaders ) { 11246 responseHeaders = {}; 11247 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 11248 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 11249 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 11250 .concat( match[ 2 ] ); 11251 } 11252 } 11253 match = responseHeaders[ key.toLowerCase() + " " ]; 11254 } 11255 return match == null ? null : match.join( ", " ); 11256 }, 11257 11258 // Raw string 11259 getAllResponseHeaders: function() { 11260 return completed ? responseHeadersString : null; 11261 }, 11262 11263 // Caches the header 11264 setRequestHeader: function( name, value ) { 11265 if ( completed == null ) { 11266 name = requestHeadersNames[ name.toLowerCase() ] = 11267 requestHeadersNames[ name.toLowerCase() ] || name; 11268 requestHeaders[ name ] = value; 11269 } 11270 return this; 11271 }, 11272 11273 // Overrides response content-type header 11274 overrideMimeType: function( type ) { 11275 if ( completed == null ) { 11276 s.mimeType = type; 11277 } 11278 return this; 11279 }, 11280 11281 // Status-dependent callbacks 11282 statusCode: function( map ) { 11283 var code; 11284 if ( map ) { 11285 if ( completed ) { 11286 11287 // Execute the appropriate callbacks 11288 jqXHR.always( map[ jqXHR.status ] ); 11289 } else { 11290 11291 // Lazy-add the new callbacks in a way that preserves old ones 11292 for ( code in map ) { 11293 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 11294 } 11295 } 11296 } 11297 return this; 11298 }, 11299 11300 // Cancel the request 11301 abort: function( statusText ) { 11302 var finalText = statusText || strAbort; 11303 if ( transport ) { 11304 transport.abort( finalText ); 11305 } 11306 done( 0, finalText ); 11307 return this; 11308 } 11309 }; 11310 11311 // Attach deferreds 11312 deferred.promise( jqXHR ); 11313 11314 // Add protocol if not provided (prefilters might expect it) 11315 // Handle falsy url in the settings object (trac-10093: consistency with old signature) 11316 // We also use the url parameter if available 11317 s.url = ( ( url || s.url || location.href ) + "" ) 11318 .replace( rprotocol, location.protocol + "//" ); 11319 11320 // Alias method option to type as per ticket trac-12004 11321 s.type = options.method || options.type || s.method || s.type; 11322 11323 // Extract dataTypes list 11324 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 11325 11326 // A cross-domain request is in order when the origin doesn't match the current origin. 11327 if ( s.crossDomain == null ) { 11328 urlAnchor = document.createElement( "a" ); 11329 11330 // Support: IE <=8 - 11, Edge 12 - 15 11331 // IE throws exception on accessing the href property if url is malformed, 11332 // e.g. http://example.com:80x/ 11333 try { 11334 urlAnchor.href = s.url; 11335 11336 // Support: IE <=8 - 11 only 11337 // Anchor's host property isn't correctly set when s.url is relative 11338 urlAnchor.href = urlAnchor.href; 11339 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 11340 urlAnchor.protocol + "//" + urlAnchor.host; 11341 } catch ( e ) { 11342 11343 // If there is an error parsing the URL, assume it is crossDomain, 11344 // it can be rejected by the transport if it is invalid 11345 s.crossDomain = true; 11346 } 11347 } 11348 11349 // Convert data if not already a string 11350 if ( s.data && s.processData && typeof s.data !== "string" ) { 11351 s.data = jQuery.param( s.data, s.traditional ); 11352 } 11353 11354 // Apply prefilters 11355 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 11356 11357 // If request was aborted inside a prefilter, stop there 11358 if ( completed ) { 11359 return jqXHR; 11360 } 11361 11362 // We can fire global events as of now if asked to 11363 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118) 11364 fireGlobals = jQuery.event && s.global; 11365 11366 // Watch for a new set of requests 11367 if ( fireGlobals && jQuery.active++ === 0 ) { 11368 jQuery.event.trigger( "ajaxStart" ); 11369 } 11370 11371 // Uppercase the type 11372 s.type = s.type.toUpperCase(); 11373 11374 // Determine if request has content 11375 s.hasContent = !rnoContent.test( s.type ); 11376 11377 // Save the URL in case we're toying with the If-Modified-Since 11378 // and/or If-None-Match header later on 11379 // Remove hash to simplify url manipulation 11380 cacheURL = s.url.replace( rhash, "" ); 11381 11382 // More options handling for requests with no content 11383 if ( !s.hasContent ) { 11384 11385 // Remember the hash so we can put it back 11386 uncached = s.url.slice( cacheURL.length ); 11387 11388 // If data is available and should be processed, append data to url 11389 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 11390 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 11391 11392 // trac-9682: remove data so that it's not used in an eventual retry 11393 delete s.data; 11394 } 11395 11396 // Add or update anti-cache param if needed 11397 if ( s.cache === false ) { 11398 cacheURL = cacheURL.replace( rantiCache, "$1" ); 11399 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 11400 uncached; 11401 } 11402 11403 // Put hash and anti-cache on the URL that will be requested (gh-1732) 11404 s.url = cacheURL + uncached; 11405 11406 // Change '%20' to '+' if this is encoded form body content (gh-2658) 11407 } else if ( s.data && s.processData && 11408 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 11409 s.data = s.data.replace( r20, "+" ); 11410 } 11411 11412 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 11413 if ( s.ifModified ) { 11414 if ( jQuery.lastModified[ cacheURL ] ) { 11415 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 11416 } 11417 if ( jQuery.etag[ cacheURL ] ) { 11418 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 11419 } 11420 } 11421 11422 // Set the correct header, if data is being sent 11423 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 11424 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 11425 } 11426 11427 // Set the Accepts header for the server, depending on the dataType 11428 jqXHR.setRequestHeader( 11429 "Accept", 11430 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 11431 s.accepts[ s.dataTypes[ 0 ] ] + 11432 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 11433 s.accepts[ "*" ] 11434 ); 11435 11436 // Check for headers option 11437 for ( i in s.headers ) { 11438 jqXHR.setRequestHeader( i, s.headers[ i ] ); 11439 } 11440 11441 // Allow custom headers/mimetypes and early abort 11442 if ( s.beforeSend && 11443 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 11444 11445 // Abort if not done already and return 11446 return jqXHR.abort(); 11447 } 11448 11449 // Aborting is no longer a cancellation 11450 strAbort = "abort"; 11451 11452 // Install callbacks on deferreds 11453 completeDeferred.add( s.complete ); 11454 jqXHR.done( s.success ); 11455 jqXHR.fail( s.error ); 11456 11457 // Get transport 11458 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 11459 11460 // If no transport, we auto-abort 11461 if ( !transport ) { 11462 done( -1, "No Transport" ); 11463 } else { 11464 jqXHR.readyState = 1; 11465 11466 // Send global event 11467 if ( fireGlobals ) { 11468 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 11469 } 11470 11471 // If request was aborted inside ajaxSend, stop there 11472 if ( completed ) { 11473 return jqXHR; 11474 } 11475 11476 // Timeout 11477 if ( s.async && s.timeout > 0 ) { 11478 timeoutTimer = window.setTimeout( function() { 11479 jqXHR.abort( "timeout" ); 11480 }, s.timeout ); 11481 } 11482 11483 try { 11484 completed = false; 11485 transport.send( requestHeaders, done ); 11486 } catch ( e ) { 11487 11488 // Rethrow post-completion exceptions 11489 if ( completed ) { 11490 throw e; 11491 } 11492 11493 // Propagate others as results 11494 done( -1, e ); 11495 } 11496 } 11497 11498 // Callback for when everything is done 11499 function done( status, nativeStatusText, responses, headers ) { 11500 var isSuccess, success, error, response, modified, 11501 statusText = nativeStatusText; 11502 11503 // Ignore repeat invocations 11504 if ( completed ) { 11505 return; 11506 } 11507 11508 completed = true; 11509 11510 // Clear timeout if it exists 11511 if ( timeoutTimer ) { 11512 window.clearTimeout( timeoutTimer ); 11513 } 11514 11515 // Dereference transport for early garbage collection 11516 // (no matter how long the jqXHR object will be used) 11517 transport = undefined; 11518 11519 // Cache response headers 11520 responseHeadersString = headers || ""; 11521 11522 // Set readyState 11523 jqXHR.readyState = status > 0 ? 4 : 0; 11524 11525 // Determine if successful 11526 isSuccess = status >= 200 && status < 300 || status === 304; 11527 11528 // Get response data 11529 if ( responses ) { 11530 response = ajaxHandleResponses( s, jqXHR, responses ); 11531 } 11532 11533 // Use a noop converter for missing script but not if jsonp 11534 if ( !isSuccess && 11535 jQuery.inArray( "script", s.dataTypes ) > -1 && 11536 jQuery.inArray( "json", s.dataTypes ) < 0 ) { 11537 s.converters[ "text script" ] = function() {}; 11538 } 11539 11540 // Convert no matter what (that way responseXXX fields are always set) 11541 response = ajaxConvert( s, response, jqXHR, isSuccess ); 11542 11543 // If successful, handle type chaining 11544 if ( isSuccess ) { 11545 11546 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 11547 if ( s.ifModified ) { 11548 modified = jqXHR.getResponseHeader( "Last-Modified" ); 11549 if ( modified ) { 11550 jQuery.lastModified[ cacheURL ] = modified; 11551 } 11552 modified = jqXHR.getResponseHeader( "etag" ); 11553 if ( modified ) { 11554 jQuery.etag[ cacheURL ] = modified; 11555 } 11556 } 11557 11558 // if no content 11559 if ( status === 204 || s.type === "HEAD" ) { 11560 statusText = "nocontent"; 11561 11562 // if not modified 11563 } else if ( status === 304 ) { 11564 statusText = "notmodified"; 11565 11566 // If we have data, let's convert it 11567 } else { 11568 statusText = response.state; 11569 success = response.data; 11570 error = response.error; 11571 isSuccess = !error; 11572 } 11573 } else { 11574 11575 // Extract error from statusText and normalize for non-aborts 11576 error = statusText; 11577 if ( status || !statusText ) { 11578 statusText = "error"; 11579 if ( status < 0 ) { 11580 status = 0; 11581 } 11582 } 11583 } 11584 11585 // Set data for the fake xhr object 11586 jqXHR.status = status; 11587 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 11588 11589 // Success/Error 11590 if ( isSuccess ) { 11591 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 11592 } else { 11593 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 11594 } 11595 11596 // Status-dependent callbacks 11597 jqXHR.statusCode( statusCode ); 11598 statusCode = undefined; 11599 11600 if ( fireGlobals ) { 11601 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 11602 [ jqXHR, s, isSuccess ? success : error ] ); 11603 } 11604 11605 // Complete 11606 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 11607 11608 if ( fireGlobals ) { 11609 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 11610 11611 // Handle the global AJAX counter 11612 if ( !( --jQuery.active ) ) { 11613 jQuery.event.trigger( "ajaxStop" ); 11614 } 11615 } 11616 } 11617 11618 return jqXHR; 11619 }, 11620 11621 getJSON: function( url, data, callback ) { 11622 return jQuery.get( url, data, callback, "json" ); 11623 }, 11624 11625 getScript: function( url, callback ) { 11626 return jQuery.get( url, undefined, callback, "script" ); 11627 } 11628} ); 11629 11630jQuery.each( [ "get", "post" ], function( _i, method ) { 11631 jQuery[ method ] = function( url, data, callback, type ) { 11632 11633 // Shift arguments if data argument was omitted 11634 if ( isFunction( data ) ) { 11635 type = type || callback; 11636 callback = data; 11637 data = undefined; 11638 } 11639 11640 // The url can be an options object (which then must have .url) 11641 return jQuery.ajax( jQuery.extend( { 11642 url: url, 11643 type: method, 11644 dataType: type, 11645 data: data, 11646 success: callback 11647 }, jQuery.isPlainObject( url ) && url ) ); 11648 }; 11649} ); 11650 11651jQuery.ajaxPrefilter( function( s ) { 11652 var i; 11653 for ( i in s.headers ) { 11654 if ( i.toLowerCase() === "content-type" ) { 11655 s.contentType = s.headers[ i ] || ""; 11656 } 11657 } 11658} ); 11659 11660 11661jQuery._evalUrl = function( url, options, doc ) { 11662 return jQuery.ajax( { 11663 url: url, 11664 11665 // Make this explicit, since user can override this through ajaxSetup (trac-11264) 11666 type: "GET", 11667 dataType: "script", 11668 cache: true, 11669 async: false, 11670 global: false, 11671 11672 // Only evaluate the response if it is successful (gh-4126) 11673 // dataFilter is not invoked for failure responses, so using it instead 11674 // of the default converter is kludgy but it works. 11675 converters: { 11676 "text script": function() {} 11677 }, 11678 dataFilter: function( response ) { 11679 jQuery.globalEval( response, options, doc ); 11680 } 11681 } ); 11682}; 11683 11684 11685jQuery.fn.extend( { 11686 wrapAll: function( html ) { 11687 var wrap; 11688 11689 if ( this[ 0 ] ) { 11690 if ( isFunction( html ) ) { 11691 html = html.call( this[ 0 ] ); 11692 } 11693 11694 // The elements to wrap the target around 11695 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 11696 11697 if ( this[ 0 ].parentNode ) { 11698 wrap.insertBefore( this[ 0 ] ); 11699 } 11700 11701 wrap.map( function() { 11702 var elem = this; 11703 11704 while ( elem.firstElementChild ) { 11705 elem = elem.firstElementChild; 11706 } 11707 11708 return elem; 11709 } ).append( this ); 11710 } 11711 11712 return this; 11713 }, 11714 11715 wrapInner: function( html ) { 11716 if ( isFunction( html ) ) { 11717 return this.each( function( i ) { 11718 jQuery( this ).wrapInner( html.call( this, i ) ); 11719 } ); 11720 } 11721 11722 return this.each( function() { 11723 var self = jQuery( this ), 11724 contents = self.contents(); 11725 11726 if ( contents.length ) { 11727 contents.wrapAll( html ); 11728 11729 } else { 11730 self.append( html ); 11731 } 11732 } ); 11733 }, 11734 11735 wrap: function( html ) { 11736 var htmlIsFunction = isFunction( html ); 11737 11738 return this.each( function( i ) { 11739 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 11740 } ); 11741 }, 11742 11743 unwrap: function( selector ) { 11744 this.parent( selector ).not( "body" ).each( function() { 11745 jQuery( this ).replaceWith( this.childNodes ); 11746 } ); 11747 return this; 11748 } 11749} ); 11750 11751 11752jQuery.expr.pseudos.hidden = function( elem ) { 11753 return !jQuery.expr.pseudos.visible( elem ); 11754}; 11755jQuery.expr.pseudos.visible = function( elem ) { 11756 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 11757}; 11758 11759 11760 11761 11762jQuery.ajaxSettings.xhr = function() { 11763 try { 11764 return new window.XMLHttpRequest(); 11765 } catch ( e ) {} 11766}; 11767 11768var xhrSuccessStatus = { 11769 11770 // File protocol always yields status code 0, assume 200 11771 0: 200, 11772 11773 // Support: IE <=9 only 11774 // trac-1450: sometimes IE returns 1223 when it should be 204 11775 1223: 204 11776 }, 11777 xhrSupported = jQuery.ajaxSettings.xhr(); 11778 11779support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 11780support.ajax = xhrSupported = !!xhrSupported; 11781 11782jQuery.ajaxTransport( function( options ) { 11783 var callback, errorCallback; 11784 11785 // Cross domain only allowed if supported through XMLHttpRequest 11786 if ( support.cors || xhrSupported && !options.crossDomain ) { 11787 return { 11788 send: function( headers, complete ) { 11789 var i, 11790 xhr = options.xhr(); 11791 11792 xhr.open( 11793 options.type, 11794 options.url, 11795 options.async, 11796 options.username, 11797 options.password 11798 ); 11799 11800 // Apply custom fields if provided 11801 if ( options.xhrFields ) { 11802 for ( i in options.xhrFields ) { 11803 xhr[ i ] = options.xhrFields[ i ]; 11804 } 11805 } 11806 11807 // Override mime type if needed 11808 if ( options.mimeType && xhr.overrideMimeType ) { 11809 xhr.overrideMimeType( options.mimeType ); 11810 } 11811 11812 // X-Requested-With header 11813 // For cross-domain requests, seeing as conditions for a preflight are 11814 // akin to a jigsaw puzzle, we simply never set it to be sure. 11815 // (it can always be set on a per-request basis or even using ajaxSetup) 11816 // For same-domain requests, won't change header if already provided. 11817 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 11818 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 11819 } 11820 11821 // Set headers 11822 for ( i in headers ) { 11823 xhr.setRequestHeader( i, headers[ i ] ); 11824 } 11825 11826 // Callback 11827 callback = function( type ) { 11828 return function() { 11829 if ( callback ) { 11830 callback = errorCallback = xhr.onload = 11831 xhr.onerror = xhr.onabort = xhr.ontimeout = 11832 xhr.onreadystatechange = null; 11833 11834 if ( type === "abort" ) { 11835 xhr.abort(); 11836 } else if ( type === "error" ) { 11837 11838 // Support: IE <=9 only 11839 // On a manual native abort, IE9 throws 11840 // errors on any property access that is not readyState 11841 if ( typeof xhr.status !== "number" ) { 11842 complete( 0, "error" ); 11843 } else { 11844 complete( 11845 11846 // File: protocol always yields status 0; see trac-8605, trac-14207 11847 xhr.status, 11848 xhr.statusText 11849 ); 11850 } 11851 } else { 11852 complete( 11853 xhrSuccessStatus[ xhr.status ] || xhr.status, 11854 xhr.statusText, 11855 11856 // Support: IE <=9 only 11857 // IE9 has no XHR2 but throws on binary (trac-11426) 11858 // For XHR2 non-text, let the caller handle it (gh-2498) 11859 ( xhr.responseType || "text" ) !== "text" || 11860 typeof xhr.responseText !== "string" ? 11861 { binary: xhr.response } : 11862 { text: xhr.responseText }, 11863 xhr.getAllResponseHeaders() 11864 ); 11865 } 11866 } 11867 }; 11868 }; 11869 11870 // Listen to events 11871 xhr.onload = callback(); 11872 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 11873 11874 // Support: IE 9 only 11875 // Use onreadystatechange to replace onabort 11876 // to handle uncaught aborts 11877 if ( xhr.onabort !== undefined ) { 11878 xhr.onabort = errorCallback; 11879 } else { 11880 xhr.onreadystatechange = function() { 11881 11882 // Check readyState before timeout as it changes 11883 if ( xhr.readyState === 4 ) { 11884 11885 // Allow onerror to be called first, 11886 // but that will not handle a native abort 11887 // Also, save errorCallback to a variable 11888 // as xhr.onerror cannot be accessed 11889 window.setTimeout( function() { 11890 if ( callback ) { 11891 errorCallback(); 11892 } 11893 } ); 11894 } 11895 }; 11896 } 11897 11898 // Create the abort callback 11899 callback = callback( "abort" ); 11900 11901 try { 11902 11903 // Do send the request (this may raise an exception) 11904 xhr.send( options.hasContent && options.data || null ); 11905 } catch ( e ) { 11906 11907 // trac-14683: Only rethrow if this hasn't been notified as an error yet 11908 if ( callback ) { 11909 throw e; 11910 } 11911 } 11912 }, 11913 11914 abort: function() { 11915 if ( callback ) { 11916 callback(); 11917 } 11918 } 11919 }; 11920 } 11921} ); 11922 11923 11924 11925 11926// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 11927jQuery.ajaxPrefilter( function( s ) { 11928 if ( s.crossDomain ) { 11929 s.contents.script = false; 11930 } 11931} ); 11932 11933// Install script dataType 11934jQuery.ajaxSetup( { 11935 accepts: { 11936 script: "text/javascript, application/javascript, " + 11937 "application/ecmascript, application/x-ecmascript" 11938 }, 11939 contents: { 11940 script: /\b(?:java|ecma)script\b/ 11941 }, 11942 converters: { 11943 "text script": function( text ) { 11944 jQuery.globalEval( text ); 11945 return text; 11946 } 11947 } 11948} ); 11949 11950// Handle cache's special case and crossDomain 11951jQuery.ajaxPrefilter( "script", function( s ) { 11952 if ( s.cache === undefined ) { 11953 s.cache = false; 11954 } 11955 if ( s.crossDomain ) { 11956 s.type = "GET"; 11957 } 11958} ); 11959 11960// Bind script tag hack transport 11961jQuery.ajaxTransport( "script", function( s ) { 11962 11963 // This transport only deals with cross domain or forced-by-attrs requests 11964 if ( s.crossDomain || s.scriptAttrs ) { 11965 var script, callback; 11966 return { 11967 send: function( _, complete ) { 11968 script = jQuery( "<script>" ) 11969 .attr( s.scriptAttrs || {} ) 11970 .prop( { charset: s.scriptCharset, src: s.url } ) 11971 .on( "load error", callback = function( evt ) { 11972 script.remove(); 11973 callback = null; 11974 if ( evt ) { 11975 complete( evt.type === "error" ? 404 : 200, evt.type ); 11976 } 11977 } ); 11978 11979 // Use native DOM manipulation to avoid our domManip AJAX trickery 11980 document.head.appendChild( script[ 0 ] ); 11981 }, 11982 abort: function() { 11983 if ( callback ) { 11984 callback(); 11985 } 11986 } 11987 }; 11988 } 11989} ); 11990 11991 11992 11993 11994var oldCallbacks = [], 11995 rjsonp = /(=)\?(?=&|$)|\?\?/; 11996 11997// Default jsonp settings 11998jQuery.ajaxSetup( { 11999 jsonp: "callback", 12000 jsonpCallback: function() { 12001 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 12002 this[ callback ] = true; 12003 return callback; 12004 } 12005} ); 12006 12007// Detect, normalize options and install callbacks for jsonp requests 12008jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 12009 12010 var callbackName, overwritten, responseContainer, 12011 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 12012 "url" : 12013 typeof s.data === "string" && 12014 ( s.contentType || "" ) 12015 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 12016 rjsonp.test( s.data ) && "data" 12017 ); 12018 12019 // Handle iff the expected data type is "jsonp" or we have a parameter to set 12020 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 12021 12022 // Get callback name, remembering preexisting value associated with it 12023 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 12024 s.jsonpCallback() : 12025 s.jsonpCallback; 12026 12027 // Insert callback into url or form data 12028 if ( jsonProp ) { 12029 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 12030 } else if ( s.jsonp !== false ) { 12031 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 12032 } 12033 12034 // Use data converter to retrieve json after script execution 12035 s.converters[ "script json" ] = function() { 12036 if ( !responseContainer ) { 12037 jQuery.error( callbackName + " was not called" ); 12038 } 12039 return responseContainer[ 0 ]; 12040 }; 12041 12042 // Force json dataType 12043 s.dataTypes[ 0 ] = "json"; 12044 12045 // Install callback 12046 overwritten = window[ callbackName ]; 12047 window[ callbackName ] = function() { 12048 responseContainer = arguments; 12049 }; 12050 12051 // Clean-up function (fires after converters) 12052 jqXHR.always( function() { 12053 12054 // If previous value didn't exist - remove it 12055 if ( overwritten === undefined ) { 12056 jQuery( window ).removeProp( callbackName ); 12057 12058 // Otherwise restore preexisting value 12059 } else { 12060 window[ callbackName ] = overwritten; 12061 } 12062 12063 // Save back as free 12064 if ( s[ callbackName ] ) { 12065 12066 // Make sure that re-using the options doesn't screw things around 12067 s.jsonpCallback = originalSettings.jsonpCallback; 12068 12069 // Save the callback name for future use 12070 oldCallbacks.push( callbackName ); 12071 } 12072 12073 // Call if it was a function and we have a response 12074 if ( responseContainer && isFunction( overwritten ) ) { 12075 overwritten( responseContainer[ 0 ] ); 12076 } 12077 12078 responseContainer = overwritten = undefined; 12079 } ); 12080 12081 // Delegate to script 12082 return "script"; 12083 } 12084} ); 12085 12086 12087 12088 12089// Support: Safari 8 only 12090// In Safari 8 documents created via document.implementation.createHTMLDocument 12091// collapse sibling forms: the second one becomes a child of the first one. 12092// Because of that, this security measure has to be disabled in Safari 8. 12093// https://bugs.webkit.org/show_bug.cgi?id=137337 12094support.createHTMLDocument = ( function() { 12095 var body = document.implementation.createHTMLDocument( "" ).body; 12096 body.innerHTML = "<form></form><form></form>"; 12097 return body.childNodes.length === 2; 12098} )(); 12099 12100 12101// Argument "data" should be string of html 12102// context (optional): If specified, the fragment will be created in this context, 12103// defaults to document 12104// keepScripts (optional): If true, will include scripts passed in the html string 12105jQuery.parseHTML = function( data, context, keepScripts ) { 12106 if ( typeof data !== "string" ) { 12107 return []; 12108 } 12109 if ( typeof context === "boolean" ) { 12110 keepScripts = context; 12111 context = false; 12112 } 12113 12114 var base, parsed, scripts; 12115 12116 if ( !context ) { 12117 12118 // Stop scripts or inline event handlers from being executed immediately 12119 // by using document.implementation 12120 if ( support.createHTMLDocument ) { 12121 context = document.implementation.createHTMLDocument( "" ); 12122 12123 // Set the base href for the created document 12124 // so any parsed elements with URLs 12125 // are based on the document's URL (gh-2965) 12126 base = context.createElement( "base" ); 12127 base.href = document.location.href; 12128 context.head.appendChild( base ); 12129 } else { 12130 context = document; 12131 } 12132 } 12133 12134 parsed = rsingleTag.exec( data ); 12135 scripts = !keepScripts && []; 12136 12137 // Single tag 12138 if ( parsed ) { 12139 return [ context.createElement( parsed[ 1 ] ) ]; 12140 } 12141 12142 parsed = buildFragment( [ data ], context, scripts ); 12143 12144 if ( scripts && scripts.length ) { 12145 jQuery( scripts ).remove(); 12146 } 12147 12148 return jQuery.merge( [], parsed.childNodes ); 12149}; 12150 12151 12152/** 12153 * Load a url into a page 12154 */ 12155jQuery.fn.load = function( url, params, callback ) { 12156 var selector, type, response, 12157 self = this, 12158 off = url.indexOf( " " ); 12159 12160 if ( off > -1 ) { 12161 selector = stripAndCollapse( url.slice( off ) ); 12162 url = url.slice( 0, off ); 12163 } 12164 12165 // If it's a function 12166 if ( isFunction( params ) ) { 12167 12168 // We assume that it's the callback 12169 callback = params; 12170 params = undefined; 12171 12172 // Otherwise, build a param string 12173 } else if ( params && typeof params === "object" ) { 12174 type = "POST"; 12175 } 12176 12177 // If we have elements to modify, make the request 12178 if ( self.length > 0 ) { 12179 jQuery.ajax( { 12180 url: url, 12181 12182 // If "type" variable is undefined, then "GET" method will be used. 12183 // Make value of this field explicit since 12184 // user can override it through ajaxSetup method 12185 type: type || "GET", 12186 dataType: "html", 12187 data: params 12188 } ).done( function( responseText ) { 12189 12190 // Save response for use in complete callback 12191 response = arguments; 12192 12193 self.html( selector ? 12194 12195 // If a selector was specified, locate the right elements in a dummy div 12196 // Exclude scripts to avoid IE 'Permission Denied' errors 12197 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 12198 12199 // Otherwise use the full result 12200 responseText ); 12201 12202 // If the request succeeds, this function gets "data", "status", "jqXHR" 12203 // but they are ignored because response was set above. 12204 // If it fails, this function gets "jqXHR", "status", "error" 12205 } ).always( callback && function( jqXHR, status ) { 12206 self.each( function() { 12207 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 12208 } ); 12209 } ); 12210 } 12211 12212 return this; 12213}; 12214 12215 12216 12217 12218jQuery.expr.pseudos.animated = function( elem ) { 12219 return jQuery.grep( jQuery.timers, function( fn ) { 12220 return elem === fn.elem; 12221 } ).length; 12222}; 12223 12224 12225 12226 12227jQuery.offset = { 12228 setOffset: function( elem, options, i ) { 12229 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 12230 position = jQuery.css( elem, "position" ), 12231 curElem = jQuery( elem ), 12232 props = {}; 12233 12234 // Set position first, in-case top/left are set even on static elem 12235 if ( position === "static" ) { 12236 elem.style.position = "relative"; 12237 } 12238 12239 curOffset = curElem.offset(); 12240 curCSSTop = jQuery.css( elem, "top" ); 12241 curCSSLeft = jQuery.css( elem, "left" ); 12242 calculatePosition = ( position === "absolute" || position === "fixed" ) && 12243 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 12244 12245 // Need to be able to calculate position if either 12246 // top or left is auto and position is either absolute or fixed 12247 if ( calculatePosition ) { 12248 curPosition = curElem.position(); 12249 curTop = curPosition.top; 12250 curLeft = curPosition.left; 12251 12252 } else { 12253 curTop = parseFloat( curCSSTop ) || 0; 12254 curLeft = parseFloat( curCSSLeft ) || 0; 12255 } 12256 12257 if ( isFunction( options ) ) { 12258 12259 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 12260 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 12261 } 12262 12263 if ( options.top != null ) { 12264 props.top = ( options.top - curOffset.top ) + curTop; 12265 } 12266 if ( options.left != null ) { 12267 props.left = ( options.left - curOffset.left ) + curLeft; 12268 } 12269 12270 if ( "using" in options ) { 12271 options.using.call( elem, props ); 12272 12273 } else { 12274 curElem.css( props ); 12275 } 12276 } 12277}; 12278 12279jQuery.fn.extend( { 12280 12281 // offset() relates an element's border box to the document origin 12282 offset: function( options ) { 12283 12284 // Preserve chaining for setter 12285 if ( arguments.length ) { 12286 return options === undefined ? 12287 this : 12288 this.each( function( i ) { 12289 jQuery.offset.setOffset( this, options, i ); 12290 } ); 12291 } 12292 12293 var rect, win, 12294 elem = this[ 0 ]; 12295 12296 if ( !elem ) { 12297 return; 12298 } 12299 12300 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 12301 // Support: IE <=11 only 12302 // Running getBoundingClientRect on a 12303 // disconnected node in IE throws an error 12304 if ( !elem.getClientRects().length ) { 12305 return { top: 0, left: 0 }; 12306 } 12307 12308 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 12309 rect = elem.getBoundingClientRect(); 12310 win = elem.ownerDocument.defaultView; 12311 return { 12312 top: rect.top + win.pageYOffset, 12313 left: rect.left + win.pageXOffset 12314 }; 12315 }, 12316 12317 // position() relates an element's margin box to its offset parent's padding box 12318 // This corresponds to the behavior of CSS absolute positioning 12319 position: function() { 12320 if ( !this[ 0 ] ) { 12321 return; 12322 } 12323 12324 var offsetParent, offset, doc, 12325 elem = this[ 0 ], 12326 parentOffset = { top: 0, left: 0 }; 12327 12328 // position:fixed elements are offset from the viewport, which itself always has zero offset 12329 if ( jQuery.css( elem, "position" ) === "fixed" ) { 12330 12331 // Assume position:fixed implies availability of getBoundingClientRect 12332 offset = elem.getBoundingClientRect(); 12333 12334 } else { 12335 offset = this.offset(); 12336 12337 // Account for the *real* offset parent, which can be the document or its root element 12338 // when a statically positioned element is identified 12339 doc = elem.ownerDocument; 12340 offsetParent = elem.offsetParent || doc.documentElement; 12341 while ( offsetParent && 12342 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 12343 jQuery.css( offsetParent, "position" ) === "static" ) { 12344 12345 offsetParent = offsetParent.parentNode; 12346 } 12347 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 12348 12349 // Incorporate borders into its offset, since they are outside its content origin 12350 parentOffset = jQuery( offsetParent ).offset(); 12351 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 12352 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 12353 } 12354 } 12355 12356 // Subtract parent offsets and element margins 12357 return { 12358 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 12359 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 12360 }; 12361 }, 12362 12363 // This method will return documentElement in the following cases: 12364 // 1) For the element inside the iframe without offsetParent, this method will return 12365 // documentElement of the parent window 12366 // 2) For the hidden or detached element 12367 // 3) For body or html element, i.e. in case of the html node - it will return itself 12368 // 12369 // but those exceptions were never presented as a real life use-cases 12370 // and might be considered as more preferable results. 12371 // 12372 // This logic, however, is not guaranteed and can change at any point in the future 12373 offsetParent: function() { 12374 return this.map( function() { 12375 var offsetParent = this.offsetParent; 12376 12377 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 12378 offsetParent = offsetParent.offsetParent; 12379 } 12380 12381 return offsetParent || documentElement; 12382 } ); 12383 } 12384} ); 12385 12386// Create scrollLeft and scrollTop methods 12387jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 12388 var top = "pageYOffset" === prop; 12389 12390 jQuery.fn[ method ] = function( val ) { 12391 return access( this, function( elem, method, val ) { 12392 12393 // Coalesce documents and windows 12394 var win; 12395 if ( isWindow( elem ) ) { 12396 win = elem; 12397 } else if ( elem.nodeType === 9 ) { 12398 win = elem.defaultView; 12399 } 12400 12401 if ( val === undefined ) { 12402 return win ? win[ prop ] : elem[ method ]; 12403 } 12404 12405 if ( win ) { 12406 win.scrollTo( 12407 !top ? val : win.pageXOffset, 12408 top ? val : win.pageYOffset 12409 ); 12410 12411 } else { 12412 elem[ method ] = val; 12413 } 12414 }, method, val, arguments.length ); 12415 }; 12416} ); 12417 12418// Support: Safari <=7 - 9.1, Chrome <=37 - 49 12419// Add the top/left cssHooks using jQuery.fn.position 12420// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 12421// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 12422// getComputedStyle returns percent when specified for top/left/bottom/right; 12423// rather than make the css module depend on the offset module, just check for it here 12424jQuery.each( [ "top", "left" ], function( _i, prop ) { 12425 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 12426 function( elem, computed ) { 12427 if ( computed ) { 12428 computed = curCSS( elem, prop ); 12429 12430 // If curCSS returns percentage, fallback to offset 12431 return rnumnonpx.test( computed ) ? 12432 jQuery( elem ).position()[ prop ] + "px" : 12433 computed; 12434 } 12435 } 12436 ); 12437} ); 12438 12439 12440// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 12441jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 12442 jQuery.each( { 12443 padding: "inner" + name, 12444 content: type, 12445 "": "outer" + name 12446 }, function( defaultExtra, funcName ) { 12447 12448 // Margin is only for outerHeight, outerWidth 12449 jQuery.fn[ funcName ] = function( margin, value ) { 12450 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 12451 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 12452 12453 return access( this, function( elem, type, value ) { 12454 var doc; 12455 12456 if ( isWindow( elem ) ) { 12457 12458 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 12459 return funcName.indexOf( "outer" ) === 0 ? 12460 elem[ "inner" + name ] : 12461 elem.document.documentElement[ "client" + name ]; 12462 } 12463 12464 // Get document width or height 12465 if ( elem.nodeType === 9 ) { 12466 doc = elem.documentElement; 12467 12468 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 12469 // whichever is greatest 12470 return Math.max( 12471 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 12472 elem.body[ "offset" + name ], doc[ "offset" + name ], 12473 doc[ "client" + name ] 12474 ); 12475 } 12476 12477 return value === undefined ? 12478 12479 // Get width or height on the element, requesting but not forcing parseFloat 12480 jQuery.css( elem, type, extra ) : 12481 12482 // Set width or height on the element 12483 jQuery.style( elem, type, value, extra ); 12484 }, type, chainable ? margin : undefined, chainable ); 12485 }; 12486 } ); 12487} ); 12488 12489 12490jQuery.each( [ 12491 "ajaxStart", 12492 "ajaxStop", 12493 "ajaxComplete", 12494 "ajaxError", 12495 "ajaxSuccess", 12496 "ajaxSend" 12497], function( _i, type ) { 12498 jQuery.fn[ type ] = function( fn ) { 12499 return this.on( type, fn ); 12500 }; 12501} ); 12502 12503 12504 12505 12506jQuery.fn.extend( { 12507 12508 bind: function( types, data, fn ) { 12509 return this.on( types, null, data, fn ); 12510 }, 12511 unbind: function( types, fn ) { 12512 return this.off( types, null, fn ); 12513 }, 12514 12515 delegate: function( selector, types, data, fn ) { 12516 return this.on( types, selector, data, fn ); 12517 }, 12518 undelegate: function( selector, types, fn ) { 12519 12520 // ( namespace ) or ( selector, types [, fn] ) 12521 return arguments.length === 1 ? 12522 this.off( selector, "**" ) : 12523 this.off( types, selector || "**", fn ); 12524 }, 12525 12526 hover: function( fnOver, fnOut ) { 12527 return this 12528 .on( "mouseenter", fnOver ) 12529 .on( "mouseleave", fnOut || fnOver ); 12530 } 12531} ); 12532 12533jQuery.each( 12534 ( "blur focus focusin focusout resize scroll click dblclick " + 12535 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 12536 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 12537 function( _i, name ) { 12538 12539 // Handle event binding 12540 jQuery.fn[ name ] = function( data, fn ) { 12541 return arguments.length > 0 ? 12542 this.on( name, null, data, fn ) : 12543 this.trigger( name ); 12544 }; 12545 } 12546); 12547 12548 12549 12550 12551// Support: Android <=4.0 only 12552// Make sure we trim BOM and NBSP 12553// Require that the "whitespace run" starts from a non-whitespace 12554// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. 12555var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; 12556 12557// Bind a function to a context, optionally partially applying any 12558// arguments. 12559// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 12560// However, it is not slated for removal any time soon 12561jQuery.proxy = function( fn, context ) { 12562 var tmp, args, proxy; 12563 12564 if ( typeof context === "string" ) { 12565 tmp = fn[ context ]; 12566 context = fn; 12567 fn = tmp; 12568 } 12569 12570 // Quick check to determine if target is callable, in the spec 12571 // this throws a TypeError, but we will just return undefined. 12572 if ( !isFunction( fn ) ) { 12573 return undefined; 12574 } 12575 12576 // Simulated bind 12577 args = slice.call( arguments, 2 ); 12578 proxy = function() { 12579 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 12580 }; 12581 12582 // Set the guid of unique handler to the same of original handler, so it can be removed 12583 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 12584 12585 return proxy; 12586}; 12587 12588jQuery.holdReady = function( hold ) { 12589 if ( hold ) { 12590 jQuery.readyWait++; 12591 } else { 12592 jQuery.ready( true ); 12593 } 12594}; 12595jQuery.isArray = Array.isArray; 12596jQuery.parseJSON = JSON.parse; 12597jQuery.nodeName = nodeName; 12598jQuery.isFunction = isFunction; 12599jQuery.isWindow = isWindow; 12600jQuery.camelCase = camelCase; 12601jQuery.type = toType; 12602 12603jQuery.now = Date.now; 12604 12605jQuery.isNumeric = function( obj ) { 12606 12607 // As of jQuery 3.0, isNumeric is limited to 12608 // strings and numbers (primitives or objects) 12609 // that can be coerced to finite numbers (gh-2662) 12610 var type = jQuery.type( obj ); 12611 return ( type === "number" || type === "string" ) && 12612 12613 // parseFloat NaNs numeric-cast false positives ("") 12614 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 12615 // subtraction forces infinities to NaN 12616 !isNaN( obj - parseFloat( obj ) ); 12617}; 12618 12619jQuery.trim = function( text ) { 12620 return text == null ? 12621 "" : 12622 ( text + "" ).replace( rtrim, "$1" ); 12623}; 12624 12625 12626 12627// Register as a named AMD module, since jQuery can be concatenated with other 12628// files that may use define, but not via a proper concatenation script that 12629// understands anonymous AMD modules. A named AMD is safest and most robust 12630// way to register. Lowercase jquery is used because AMD module names are 12631// derived from file names, and jQuery is normally delivered in a lowercase 12632// file name. Do this after creating the global so that if an AMD module wants 12633// to call noConflict to hide this version of jQuery, it will work. 12634 12635// Note that for maximum portability, libraries that are not jQuery should 12636// declare themselves as anonymous modules, and avoid setting a global if an 12637// AMD loader is present. jQuery is a special case. For more information, see 12638// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 12639 12640if ( true ) { 12641 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 12642 return jQuery; 12643 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 12644 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 12645} 12646 12647 12648 12649 12650var 12651 12652 // Map over jQuery in case of overwrite 12653 _jQuery = window.jQuery, 12654 12655 // Map over the $ in case of overwrite 12656 _$ = window.$; 12657 12658jQuery.noConflict = function( deep ) { 12659 if ( window.$ === jQuery ) { 12660 window.$ = _$; 12661 } 12662 12663 if ( deep && window.jQuery === jQuery ) { 12664 window.jQuery = _jQuery; 12665 } 12666 12667 return jQuery; 12668}; 12669 12670// Expose jQuery and $ identifiers, even in AMD 12671// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557) 12672// and CommonJS for browser emulators (trac-13566) 12673if ( typeof noGlobal === "undefined" ) { 12674 window.jQuery = window.$ = jQuery; 12675} 12676 12677 12678 12679 12680return jQuery; 12681} ); 12682 12683 12684/***/ }), 12685
vendor: 11,772 bytes, lines 12686-13027
12686/***/ "./node_modules/kdbush/index.js": 12687/*!**************************************!*\ 12688 !*** ./node_modules/kdbush/index.js ***! 12689 \**************************************/ 12690/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 12691 12692"use strict"; 12693__webpack_require__.r(__webpack_exports__); 12694/* harmony export */ __webpack_require__.d(__webpack_exports__, { 12695/* harmony export */ "default": () => (/* binding */ KDBush) 12696/* harmony export */ }); 12697 12698const ARRAY_TYPES = [ 12699 Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, 12700 Int32Array, Uint32Array, Float32Array, Float64Array 12701]; 12702 12703/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */ 12704 12705const VERSION = 1; // serialized format version 12706const HEADER_SIZE = 8; 12707 12708class KDBush { 12709 12710 /** 12711 * Creates an index from raw `ArrayBuffer` data. 12712 * @param {ArrayBuffer} data 12713 */ 12714 static from(data) { 12715 if (!(data instanceof ArrayBuffer)) { 12716 throw new Error('Data must be an instance of ArrayBuffer.'); 12717 } 12718 const [magic, versionAndType] = new Uint8Array(data, 0, 2); 12719 if (magic !== 0xdb) { 12720 throw new Error('Data does not appear to be in a KDBush format.'); 12721 } 12722 const version = versionAndType >> 4; 12723 if (version !== VERSION) { 12724 throw new Error(`Got v${version} data when expected v${VERSION}.`); 12725 } 12726 const ArrayType = ARRAY_TYPES[versionAndType & 0x0f]; 12727 if (!ArrayType) { 12728 throw new Error('Unrecognized array type.'); 12729 } 12730 const [nodeSize] = new Uint16Array(data, 2, 1); 12731 const [numItems] = new Uint32Array(data, 4, 1); 12732 12733 return new KDBush(numItems, nodeSize, ArrayType, data); 12734 } 12735 12736 /** 12737 * Creates an index that will hold a given number of items. 12738 * @param {number} numItems 12739 * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default). 12740 * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default). 12741 * @param {ArrayBuffer} [data] (For internal use only) 12742 */ 12743 constructor(numItems, nodeSize = 64, ArrayType = Float64Array, data) { 12744 if (isNaN(numItems) || numItems < 0) throw new Error(`Unpexpected numItems value: ${numItems}.`); 12745 12746 this.numItems = +numItems; 12747 this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535); 12748 this.ArrayType = ArrayType; 12749 this.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array; 12750 12751 const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType); 12752 const coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT; 12753 const idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT; 12754 const padCoords = (8 - idsByteSize % 8) % 8; 12755 12756 if (arrayTypeIndex < 0) { 12757 throw new Error(`Unexpected typed array class: ${ArrayType}.`); 12758 } 12759 12760 if (data && (data instanceof ArrayBuffer)) { // reconstruct an index from a buffer 12761 this.data = data; 12762 this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems); 12763 this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2); 12764 this._pos = numItems * 2; 12765 this._finished = true; 12766 } else { // initialize a new index 12767 this.data = new ArrayBuffer(HEADER_SIZE + coordsByteSize + idsByteSize + padCoords); 12768 this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems); 12769 this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2); 12770 this._pos = 0; 12771 this._finished = false; 12772 12773 // set header 12774 new Uint8Array(this.data, 0, 2).set([0xdb, (VERSION << 4) + arrayTypeIndex]); 12775 new Uint16Array(this.data, 2, 1)[0] = nodeSize; 12776 new Uint32Array(this.data, 4, 1)[0] = numItems; 12777 } 12778 } 12779 12780 /** 12781 * Add a point to the index. 12782 * @param {number} x 12783 * @param {number} y 12784 * @returns {number} An incremental index associated with the added item (starting from `0`). 12785 */ 12786 add(x, y) { 12787 const index = this._pos >> 1; 12788 this.ids[index] = index; 12789 this.coords[this._pos++] = x; 12790 this.coords[this._pos++] = y; 12791 return index; 12792 } 12793 12794 /** 12795 * Perform indexing of the added points. 12796 */ 12797 finish() { 12798 const numAdded = this._pos >> 1; 12799 if (numAdded !== this.numItems) { 12800 throw new Error(`Added ${numAdded} items when expected ${this.numItems}.`); 12801 } 12802 // kd-sort both arrays for efficient search 12803 sort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0); 12804 12805 this._finished = true; 12806 return this; 12807 } 12808 12809 /** 12810 * Search the index for items within a given bounding box. 12811 * @param {number} minX 12812 * @param {number} minY 12813 * @param {number} maxX 12814 * @param {number} maxY 12815 * @returns {number[]} An array of indices correponding to the found items. 12816 */ 12817 range(minX, minY, maxX, maxY) { 12818 if (!this._finished) throw new Error('Data not yet indexed - call index.finish().'); 12819 12820 const {ids, coords, nodeSize} = this; 12821 const stack = [0, ids.length - 1, 0]; 12822 const result = []; 12823 12824 // recursively search for items in range in the kd-sorted arrays 12825 while (stack.length) { 12826 const axis = stack.pop() || 0; 12827 const right = stack.pop() || 0; 12828 const left = stack.pop() || 0; 12829 12830 // if we reached "tree node", search linearly 12831 if (right - left <= nodeSize) { 12832 for (let i = left; i <= right; i++) { 12833 const x = coords[2 * i]; 12834 const y = coords[2 * i + 1]; 12835 if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[i]); 12836 } 12837 continue; 12838 } 12839 12840 // otherwise find the middle index 12841 const m = (left + right) >> 1; 12842 12843 // include the middle item if it's in range 12844 const x = coords[2 * m]; 12845 const y = coords[2 * m + 1]; 12846 if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]); 12847 12848 // queue search in halves that intersect the query 12849 if (axis === 0 ? minX <= x : minY <= y) { 12850 stack.push(left); 12851 stack.push(m - 1); 12852 stack.push(1 - axis); 12853 } 12854 if (axis === 0 ? maxX >= x : maxY >= y) { 12855 stack.push(m + 1); 12856 stack.push(right); 12857 stack.push(1 - axis); 12858 } 12859 } 12860 12861 return result; 12862 } 12863 12864 /** 12865 * Search the index for items within a given radius. 12866 * @param {number} qx 12867 * @param {number} qy 12868 * @param {number} r Query radius. 12869 * @returns {number[]} An array of indices correponding to the found items. 12870 */ 12871 within(qx, qy, r) { 12872 if (!this._finished) throw new Error('Data not yet indexed - call index.finish().'); 12873 12874 const {ids, coords, nodeSize} = this; 12875 const stack = [0, ids.length - 1, 0]; 12876 const result = []; 12877 const r2 = r * r; 12878 12879 // recursively search for items within radius in the kd-sorted arrays 12880 while (stack.length) { 12881 const axis = stack.pop() || 0; 12882 const right = stack.pop() || 0; 12883 const left = stack.pop() || 0; 12884 12885 // if we reached "tree node", search linearly 12886 if (right - left <= nodeSize) { 12887 for (let i = left; i <= right; i++) { 12888 if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) result.push(ids[i]); 12889 } 12890 continue; 12891 } 12892 12893 // otherwise find the middle index 12894 const m = (left + right) >> 1; 12895 12896 // include the middle item if it's in range 12897 const x = coords[2 * m]; 12898 const y = coords[2 * m + 1]; 12899 if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]); 12900 12901 // queue search in halves that intersect the query 12902 if (axis === 0 ? qx - r <= x : qy - r <= y) { 12903 stack.push(left); 12904 stack.push(m - 1); 12905 stack.push(1 - axis); 12906 } 12907 if (axis === 0 ? qx + r >= x : qy + r >= y) { 12908 stack.push(m + 1); 12909 stack.push(right); 12910 stack.push(1 - axis); 12911 } 12912 } 12913 12914 return result; 12915 } 12916} 12917 12918/** 12919 * @param {Uint16Array | Uint32Array} ids 12920 * @param {InstanceType<TypedArrayConstructor>} coords 12921 * @param {number} nodeSize 12922 * @param {number} left 12923 * @param {number} right 12924 * @param {number} axis 12925 */ 12926function sort(ids, coords, nodeSize, left, right, axis) { 12927 if (right - left <= nodeSize) return; 12928 12929 const m = (left + right) >> 1; // middle index 12930 12931 // sort ids and coords around the middle index so that the halves lie 12932 // either left/right or top/bottom correspondingly (taking turns) 12933 select(ids, coords, m, left, right, axis); 12934 12935 // recursively kd-sort first half and second half on the opposite axis 12936 sort(ids, coords, nodeSize, left, m - 1, 1 - axis); 12937 sort(ids, coords, nodeSize, m + 1, right, 1 - axis); 12938} 12939 12940/** 12941 * Custom Floyd-Rivest selection algorithm: sort ids and coords so that 12942 * [left..k-1] items are smaller than k-th item (on either x or y axis) 12943 * @param {Uint16Array | Uint32Array} ids 12944 * @param {InstanceType<TypedArrayConstructor>} coords 12945 * @param {number} k 12946 * @param {number} left 12947 * @param {number} right 12948 * @param {number} axis 12949 */ 12950function select(ids, coords, k, left, right, axis) { 12951 12952 while (right > left) { 12953 if (right - left > 600) { 12954 const n = right - left + 1; 12955 const m = k - left + 1; 12956 const z = Math.log(n); 12957 const s = 0.5 * Math.exp(2 * z / 3); 12958 const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); 12959 const newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); 12960 const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); 12961 select(ids, coords, k, newLeft, newRight, axis); 12962 } 12963 12964 const t = coords[2 * k + axis]; 12965 let i = left; 12966 let j = right; 12967 12968 swapItem(ids, coords, left, k); 12969 if (coords[2 * right + axis] > t) swapItem(ids, coords, left, right); 12970 12971 while (i < j) { 12972 swapItem(ids, coords, i, j); 12973 i++; 12974 j--; 12975 while (coords[2 * i + axis] < t) i++; 12976 while (coords[2 * j + axis] > t) j--; 12977 } 12978 12979 if (coords[2 * left + axis] === t) swapItem(ids, coords, left, j); 12980 else { 12981 j++; 12982 swapItem(ids, coords, j, right); 12983 } 12984 12985 if (j <= k) left = j + 1; 12986 if (k <= j) right = j - 1; 12987 } 12988} 12989 12990/** 12991 * @param {Uint16Array | Uint32Array} ids 12992 * @param {InstanceType<TypedArrayConstructor>} coords 12993 * @param {number} i 12994 * @param {number} j 12995 */ 12996function swapItem(ids, coords, i, j) { 12997 swap(ids, i, j); 12998 swap(coords, 2 * i, 2 * j); 12999 swap(coords, 2 * i + 1, 2 * j + 1); 13000} 13001 13002/** 13003 * @param {InstanceType<TypedArrayConstructor>} arr 13004 * @param {number} i 13005 * @param {number} j 13006 */ 13007function swap(arr, i, j) { 13008 const tmp = arr[i]; 13009 arr[i] = arr[j]; 13010 arr[j] = tmp; 13011} 13012 13013/** 13014 * @param {number} ax 13015 * @param {number} ay 13016 * @param {number} bx 13017 * @param {number} by 13018 */ 13019function sqDist(ax, ay, bx, by) { 13020 const dx = ax - bx; 13021 const dy = ay - by; 13022 return dx * dx + dy * dy; 13023} 13024 13025 13026/***/ }), 13027
vendor: 15,752 bytes, lines 13028-13466
13028/***/ "./node_modules/supercluster/index.js": 13029/*!********************************************!*\ 13030 !*** ./node_modules/supercluster/index.js ***! 13031 \********************************************/ 13032/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 13033 13034"use strict"; 13035__webpack_require__.r(__webpack_exports__); 13036/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13037/* harmony export */ "default": () => (/* binding */ Supercluster) 13038/* harmony export */ }); 13039/* harmony import */ var kdbush__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! kdbush */ "./node_modules/kdbush/index.js"); 13040 13041 13042 13043const defaultOptions = { 13044 minZoom: 0, // min zoom to generate clusters on 13045 maxZoom: 16, // max zoom level to cluster the points on 13046 minPoints: 2, // minimum points to form a cluster 13047 radius: 40, // cluster radius in pixels 13048 extent: 512, // tile extent (radius is calculated relative to it) 13049 nodeSize: 64, // size of the KD-tree leaf node, affects performance 13050 log: false, // whether to log timing info 13051 13052 // whether to generate numeric ids for input features (in vector tiles) 13053 generateId: false, 13054 13055 // a reduce function for calculating custom cluster properties 13056 reduce: null, // (accumulated, props) => { accumulated.sum += props.sum; } 13057 13058 // properties to use for individual points when running the reducer 13059 map: props => props // props => ({sum: props.my_value}) 13060}; 13061 13062const fround = Math.fround || (tmp => ((x) => { tmp[0] = +x; return tmp[0]; }))(new Float32Array(1)); 13063 13064const OFFSET_ZOOM = 2; 13065const OFFSET_ID = 3; 13066const OFFSET_PARENT = 4; 13067const OFFSET_NUM = 5; 13068const OFFSET_PROP = 6; 13069 13070class Supercluster { 13071 constructor(options) { 13072 this.options = Object.assign(Object.create(defaultOptions), options); 13073 this.trees = new Array(this.options.maxZoom + 1); 13074 this.stride = this.options.reduce ? 7 : 6; 13075 this.clusterProps = []; 13076 } 13077 13078 load(points) { 13079 const {log, minZoom, maxZoom} = this.options; 13080 13081 if (log) console.time('total time'); 13082 13083 const timerId = `prepare ${ points.length } points`; 13084 if (log) console.time(timerId); 13085 13086 this.points = points; 13087 13088 // generate a cluster object for each point and index input points into a KD-tree 13089 const data = []; 13090 13091 for (let i = 0; i < points.length; i++) { 13092 const p = points[i]; 13093 if (!p.geometry) continue; 13094 13095 const [lng, lat] = p.geometry.coordinates; 13096 const x = fround(lngX(lng)); 13097 const y = fround(latY(lat)); 13098 // store internal point/cluster data in flat numeric arrays for performance 13099 data.push( 13100 x, y, // projected point coordinates 13101 Infinity, // the last zoom the point was processed at 13102 i, // index of the source feature in the original input array 13103 -1, // parent cluster id 13104 1 // number of points in a cluster 13105 ); 13106 if (this.options.reduce) data.push(0); // noop 13107 } 13108 let tree = this.trees[maxZoom + 1] = this._createTree(data); 13109 13110 if (log) console.timeEnd(timerId); 13111 13112 // cluster points on max zoom, then cluster the results on previous zoom, etc.; 13113 // results in a cluster hierarchy across zoom levels 13114 for (let z = maxZoom; z >= minZoom; z--) { 13115 const now = +Date.now(); 13116 13117 // create a new set of clusters for the zoom and index them with a KD-tree 13118 tree = this.trees[z] = this._createTree(this._cluster(tree, z)); 13119 13120 if (log) console.log('z%d: %d clusters in %dms', z, tree.numItems, +Date.now() - now); 13121 } 13122 13123 if (log) console.timeEnd('total time'); 13124 13125 return this; 13126 } 13127 13128 getClusters(bbox, zoom) { 13129 let minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180; 13130 const minLat = Math.max(-90, Math.min(90, bbox[1])); 13131 let maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180; 13132 const maxLat = Math.max(-90, Math.min(90, bbox[3])); 13133 13134 if (bbox[2] - bbox[0] >= 360) { 13135 minLng = -180; 13136 maxLng = 180; 13137 } else if (minLng > maxLng) { 13138 const easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom); 13139 const westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom); 13140 return easternHem.concat(westernHem); 13141 } 13142 13143 const tree = this.trees[this._limitZoom(zoom)]; 13144 const ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat)); 13145 const data = tree.data; 13146 const clusters = []; 13147 for (const id of ids) { 13148 const k = this.stride * id; 13149 clusters.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]); 13150 } 13151 return clusters; 13152 } 13153 13154 getChildren(clusterId) { 13155 const originId = this._getOriginId(clusterId); 13156 const originZoom = this._getOriginZoom(clusterId); 13157 const errorMsg = 'No cluster with the specified id.'; 13158 13159 const tree = this.trees[originZoom]; 13160 if (!tree) throw new Error(errorMsg); 13161 13162 const data = tree.data; 13163 if (originId * this.stride >= data.length) throw new Error(errorMsg); 13164 13165 const r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1)); 13166 const x = data[originId * this.stride]; 13167 const y = data[originId * this.stride + 1]; 13168 const ids = tree.within(x, y, r); 13169 const children = []; 13170 for (const id of ids) { 13171 const k = id * this.stride; 13172 if (data[k + OFFSET_PARENT] === clusterId) { 13173 children.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]); 13174 } 13175 } 13176 13177 if (children.length === 0) throw new Error(errorMsg); 13178 13179 return children; 13180 } 13181 13182 getLeaves(clusterId, limit, offset) { 13183 limit = limit || 10; 13184 offset = offset || 0; 13185 13186 const leaves = []; 13187 this._appendLeaves(leaves, clusterId, limit, offset, 0); 13188 13189 return leaves; 13190 } 13191 13192 getTile(z, x, y) { 13193 const tree = this.trees[this._limitZoom(z)]; 13194 const z2 = Math.pow(2, z); 13195 const {extent, radius} = this.options; 13196 const p = radius / extent; 13197 const top = (y - p) / z2; 13198 const bottom = (y + 1 + p) / z2; 13199 13200 const tile = { 13201 features: [] 13202 }; 13203 13204 this._addTileFeatures( 13205 tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom), 13206 tree.data, x, y, z2, tile); 13207 13208 if (x === 0) { 13209 this._addTileFeatures( 13210 tree.range(1 - p / z2, top, 1, bottom), 13211 tree.data, z2, y, z2, tile); 13212 } 13213 if (x === z2 - 1) { 13214 this._addTileFeatures( 13215 tree.range(0, top, p / z2, bottom), 13216 tree.data, -1, y, z2, tile); 13217 } 13218 13219 return tile.features.length ? tile : null; 13220 } 13221 13222 getClusterExpansionZoom(clusterId) { 13223 let expansionZoom = this._getOriginZoom(clusterId) - 1; 13224 while (expansionZoom <= this.options.maxZoom) { 13225 const children = this.getChildren(clusterId); 13226 expansionZoom++; 13227 if (children.length !== 1) break; 13228 clusterId = children[0].properties.cluster_id; 13229 } 13230 return expansionZoom; 13231 } 13232 13233 _appendLeaves(result, clusterId, limit, offset, skipped) { 13234 const children = this.getChildren(clusterId); 13235 13236 for (const child of children) { 13237 const props = child.properties; 13238 13239 if (props && props.cluster) { 13240 if (skipped + props.point_count <= offset) { 13241 // skip the whole cluster 13242 skipped += props.point_count; 13243 } else { 13244 // enter the cluster 13245 skipped = this._appendLeaves(result, props.cluster_id, limit, offset, skipped); 13246 // exit the cluster 13247 } 13248 } else if (skipped < offset) { 13249 // skip a single point 13250 skipped++; 13251 } else { 13252 // add a single point 13253 result.push(child); 13254 } 13255 if (result.length === limit) break; 13256 } 13257 13258 return skipped; 13259 } 13260 13261 _createTree(data) { 13262 const tree = new kdbush__WEBPACK_IMPORTED_MODULE_0__["default"](data.length / this.stride | 0, this.options.nodeSize, Float32Array); 13263 for (let i = 0; i < data.length; i += this.stride) tree.add(data[i], data[i + 1]); 13264 tree.finish(); 13265 tree.data = data; 13266 return tree; 13267 } 13268 13269 _addTileFeatures(ids, data, x, y, z2, tile) { 13270 for (const i of ids) { 13271 const k = i * this.stride; 13272 const isCluster = data[k + OFFSET_NUM] > 1; 13273 13274 let tags, px, py; 13275 if (isCluster) { 13276 tags = getClusterProperties(data, k, this.clusterProps); 13277 px = data[k]; 13278 py = data[k + 1]; 13279 } else { 13280 const p = this.points[data[k + OFFSET_ID]]; 13281 tags = p.properties; 13282 const [lng, lat] = p.geometry.coordinates; 13283 px = lngX(lng); 13284 py = latY(lat); 13285 } 13286 13287 const f = { 13288 type: 1, 13289 geometry: [[ 13290 Math.round(this.options.extent * (px * z2 - x)), 13291 Math.round(this.options.extent * (py * z2 - y)) 13292 ]], 13293 tags 13294 }; 13295 13296 // assign id 13297 let id; 13298 if (isCluster || this.options.generateId) { 13299 // optionally generate id for points 13300 id = data[k + OFFSET_ID]; 13301 } else { 13302 // keep id if already assigned 13303 id = this.points[data[k + OFFSET_ID]].id; 13304 } 13305 13306 if (id !== undefined) f.id = id; 13307 13308 tile.features.push(f); 13309 } 13310 } 13311 13312 _limitZoom(z) { 13313 return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1)); 13314 } 13315 13316 _cluster(tree, zoom) { 13317 const {radius, extent, reduce, minPoints} = this.options; 13318 const r = radius / (extent * Math.pow(2, zoom)); 13319 const data = tree.data; 13320 const nextData = []; 13321 const stride = this.stride; 13322 13323 // loop through each point 13324 for (let i = 0; i < data.length; i += stride) { 13325 // if we've already visited the point at this zoom level, skip it 13326 if (data[i + OFFSET_ZOOM] <= zoom) continue; 13327 data[i + OFFSET_ZOOM] = zoom; 13328 13329 // find all nearby points 13330 const x = data[i]; 13331 const y = data[i + 1]; 13332 const neighborIds = tree.within(data[i], data[i + 1], r); 13333 13334 const numPointsOrigin = data[i + OFFSET_NUM]; 13335 let numPoints = numPointsOrigin; 13336 13337 // count the number of points in a potential cluster 13338 for (const neighborId of neighborIds) { 13339 const k = neighborId * stride; 13340 // filter out neighbors that are already processed 13341 if (data[k + OFFSET_ZOOM] > zoom) numPoints += data[k + OFFSET_NUM]; 13342 } 13343 13344 // if there were neighbors to merge, and there are enough points to form a cluster 13345 if (numPoints > numPointsOrigin && numPoints >= minPoints) { 13346 let wx = x * numPointsOrigin; 13347 let wy = y * numPointsOrigin; 13348 13349 let clusterProperties; 13350 let clusterPropIndex = -1; 13351 13352 // encode both zoom and point index on which the cluster originated -- offset by total length of features 13353 const id = ((i / stride | 0) << 5) + (zoom + 1) + this.points.length; 13354 13355 for (const neighborId of neighborIds) { 13356 const k = neighborId * stride; 13357 13358 if (data[k + OFFSET_ZOOM] <= zoom) continue; 13359 data[k + OFFSET_ZOOM] = zoom; // save the zoom (so it doesn't get processed twice) 13360 13361 const numPoints2 = data[k + OFFSET_NUM]; 13362 wx += data[k] * numPoints2; // accumulate coordinates for calculating weighted center 13363 wy += data[k + 1] * numPoints2; 13364 13365 data[k + OFFSET_PARENT] = id; 13366 13367 if (reduce) { 13368 if (!clusterProperties) { 13369 clusterProperties = this._map(data, i, true); 13370 clusterPropIndex = this.clusterProps.length; 13371 this.clusterProps.push(clusterProperties); 13372 } 13373 reduce(clusterProperties, this._map(data, k)); 13374 } 13375 } 13376 13377 data[i + OFFSET_PARENT] = id; 13378 nextData.push(wx / numPoints, wy / numPoints, Infinity, id, -1, numPoints); 13379 if (reduce) nextData.push(clusterPropIndex); 13380 13381 } else { // left points as unclustered 13382 for (let j = 0; j < stride; j++) nextData.push(data[i + j]); 13383 13384 if (numPoints > 1) { 13385 for (const neighborId of neighborIds) { 13386 const k = neighborId * stride; 13387 if (data[k + OFFSET_ZOOM] <= zoom) continue; 13388 data[k + OFFSET_ZOOM] = zoom; 13389 for (let j = 0; j < stride; j++) nextData.push(data[k + j]); 13390 } 13391 } 13392 } 13393 } 13394 13395 return nextData; 13396 } 13397 13398 // get index of the point from which the cluster originated 13399 _getOriginId(clusterId) { 13400 return (clusterId - this.points.length) >> 5; 13401 } 13402 13403 // get zoom of the point from which the cluster originated 13404 _getOriginZoom(clusterId) { 13405 return (clusterId - this.points.length) % 32; 13406 } 13407 13408 _map(data, i, clone) { 13409 if (data[i + OFFSET_NUM] > 1) { 13410 const props = this.clusterProps[data[i + OFFSET_PROP]]; 13411 return clone ? Object.assign({}, props) : props; 13412 } 13413 const original = this.points[data[i + OFFSET_ID]].properties; 13414 const result = this.options.map(original); 13415 return clone && result === original ? Object.assign({}, result) : result; 13416 } 13417} 13418 13419function getClusterJSON(data, i, clusterProps) { 13420 return { 13421 type: 'Feature', 13422 id: data[i + OFFSET_ID], 13423 properties: getClusterProperties(data, i, clusterProps), 13424 geometry: { 13425 type: 'Point', 13426 coordinates: [xLng(data[i]), yLat(data[i + 1])] 13427 } 13428 }; 13429} 13430 13431function getClusterProperties(data, i, clusterProps) { 13432 const count = data[i + OFFSET_NUM]; 13433 const abbrev = 13434 count >= 10000 ? `${Math.round(count / 1000) }k` : 13435 count >= 1000 ? `${Math.round(count / 100) / 10 }k` : count; 13436 const propIndex = data[i + OFFSET_PROP]; 13437 const properties = propIndex === -1 ? {} : Object.assign({}, clusterProps[propIndex]); 13438 return Object.assign(properties, { 13439 cluster: true, 13440 cluster_id: data[i + OFFSET_ID], 13441 point_count: count, 13442 point_count_abbreviated: abbrev 13443 }); 13444} 13445 13446// longitude/latitude to spherical mercator in [0..1] range 13447function lngX(lng) { 13448 return lng / 360 + 0.5; 13449} 13450function latY(lat) { 13451 const sin = Math.sin(lat * Math.PI / 180); 13452 const y = (0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI); 13453 return y < 0 ? 0 : y > 1 ? 1 : y; 13454} 13455 13456// spherical mercator to longitude/latitude 13457function xLng(x) { 13458 return (x - 0.5) * 360; 13459} 13460function yLat(y) { 13461 const y2 = (180 - y * 360) * Math.PI / 180; 13462 return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90; 13463} 13464 13465 13466/***/ })
vendor: 3,278 bytes, lines 13466-13552
13466 13467 13468/******/ }); 13469/************************************************************************/ 13470/******/ // The module cache 13471/******/ var __webpack_module_cache__ = {}; 13472/******/ 13473/******/ // The require function 13474/******/ function __webpack_require__(moduleId) { 13475/******/ // Check if module is in cache 13476/******/ var cachedModule = __webpack_module_cache__[moduleId]; 13477/******/ if (cachedModule !== undefined) { 13478/******/ return cachedModule.exports; 13479/******/ } 13480/******/ // Create a new module (and put it into the cache) 13481/******/ var module = __webpack_module_cache__[moduleId] = { 13482/******/ // no module.id needed 13483/******/ // no module.loaded needed 13484/******/ exports: {} 13485/******/ }; 13486/******/ 13487/******/ // Execute the module function 13488/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 13489/******/ 13490/******/ // Return the exports of the module 13491/******/ return module.exports; 13492/******/ } 13493/******/ 13494/************************************************************************/ 13495/******/ /* webpack/runtime/compat get default export */ 13496/******/ (() => { 13497/******/ // getDefaultExport function for compatibility with non-harmony modules 13498/******/ __webpack_require__.n = (module) => { 13499/******/ var getter = module && module.__esModule ? 13500/******/ () => (module['default']) : 13501/******/ () => (module); 13502/******/ __webpack_require__.d(getter, { a: getter }); 13503/******/ return getter; 13504/******/ }; 13505/******/ })(); 13506/******/ 13507/******/ /* webpack/runtime/define property getters */ 13508/******/ (() => { 13509/******/ // define getter functions for harmony exports 13510/******/ __webpack_require__.d = (exports, definition) => { 13511/******/ for(var key in definition) { 13512/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 13513/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 13514/******/ } 13515/******/ } 13516/******/ }; 13517/******/ })(); 13518/******/ 13519/******/ /* webpack/runtime/hasOwnProperty shorthand */ 13520/******/ (() => { 13521/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 13522/******/ })(); 13523/******/ 13524/******/ /* webpack/runtime/make namespace object */ 13525/******/ (() => { 13526/******/ // define __esModule on exports 13527/******/ __webpack_require__.r = (exports) => { 13528/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 13529/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 13530/******/ } 13531/******/ Object.defineProperty(exports, '__esModule', { value: true }); 13532/******/ }; 13533/******/ })(); 13534/******/ 13535/************************************************************************/ 13536var __webpack_exports__ = {}; 13537// This entry need to be wrapped in an IIFE because it need to be in strict mode. 13538(() => { 13539"use strict"; 13540/*!***************************!*\ 13541 !*** ./assets/js/main.js ***! 13542 \***************************/ 13543__webpack_require__.r(__webpack_exports__); 13544/* harmony import */ var _gca_event_map_code__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! .//gca_event-map-code */ "./assets/js/gca_event-map-code.js"); 13545 13546 13547 13548new _gca_event_map_code__WEBPACK_IMPORTED_MODULE_0__["default"](); 13549})(); 13550 13551/******/ })() 13552;
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.