1// source --> https://nieruchomoscipafos.pl/wp-content/plugins/essential-addons-for-elementor-lite/assets/js/load-more.js?ver=1.0 2(function($) { 3 'use strict'; 4 5 window.eaelLoadMore = function( options, settings ) { 6 7 // Default Values for Load More Js 8 var optionsValue = { 9 totalPosts: options.totalPosts, 10 loadMoreBtn: options.loadMoreBtn, 11 postContainer: $(options.postContainer), 12 postStyle: options.postStyle, // block, grid, timeline, 13 } 14 15 // Settings Values 16 var settingsValue = { 17 postType: settings.postType, 18 perPage: settings.perPage, 19 postOrder: settings.postOrder, 20 orderBy: settings.orderBy, 21 showImage: settings.showImage, 22 showTitle: settings.showTitle, 23 showExcerpt: settings.showExcerpt, 24 showMeta: settings.showMeta, 25 imageSize: settings.imageSize, 26 metaPosition: settings.metaPosition, 27 excerptLength: settings.excerptLength, 28 btnText: settings.btnText, 29 30 tax_query: settings.tax_query, 31 32 post__in: settings.post__in, 33 excludePosts: settings.exclude_posts, 34 offset: parseInt( settings.offset , 10 ), 35 grid_style: settings.grid_style || '', 36 hover_animation: settings.hover_animation, 37 hover_icon: settings.hover_icon 38 } 39 40 var offset = settingsValue.offset + settingsValue.perPage; 41 42 optionsValue.loadMoreBtn.on( 'click', function( e ) { 43 e.preventDefault(); 44 45 $(this).addClass( 'button--loading' ); 46 $(this).find( 'span' ).html( 'Loading...' ); 47 48 $.ajax( { 49 url: eaelPostGrid.ajaxurl, 50 type: 'post', 51 data: { 52 action: 'load_more', 53 post_style: optionsValue.postStyle, 54 eael_show_image : settingsValue.showImage, 55 image_size : settingsValue.imageSize, 56 eael_show_title : settingsValue.showTitle, 57 eael_show_meta : settingsValue.showMeta, 58 meta_position : settingsValue.metaPosition, 59 60 eael_show_excerpt : settingsValue.showExcerpt, 61 eael_excerpt_length : settingsValue.excerptLength, 62 63 post_type: settingsValue.postType, 64 posts_per_page : settingsValue.perPage, 65 offset : offset, 66 67 tax_query: settingsValue.tax_query, 68 69 post__not_in: settingsValue.excludePosts, 70 71 post__in: settingsValue.post__in, 72 73 orderby: settingsValue.orderBy, 74 order: settingsValue.postOrder, 75 grid_style: settingsValue.grid_style, 76 eael_post_grid_hover_animation: settingsValue.hover_animation, 77 eael_post_grid_bg_hover_icon: settingsValue.hover_icon 78 }, 79 beforeSend: function() { 80 // _this.html('<i class="fa fa-spinner fa-spin"></i> Saving Data..'); 81 }, 82 success: function( response ) { 83 var $content = $( response ); 84 if( optionsValue.postStyle === 'grid' ) { 85 setTimeout(function() { 86 optionsValue.postContainer.masonry(); 87 optionsValue.postContainer.append( $content ).masonry( 'appended', $content ); 88 optionsValue.postContainer.masonry({ 89 itemSelector: '.eael-grid-post', 90 percentPosition: true, 91 columnWidth: '.eael-post-grid-column' 92 }); 93 }, 100); 94 } else { 95 optionsValue.postContainer.append( $content ); 96 } 97 optionsValue.loadMoreBtn.removeClass( 'button--loading' ); 98 optionsValue.loadMoreBtn.find( 'span' ).html( settingsValue.btnText ); 99 100 offset = offset + settingsValue.perPage; 101 102 if( offset >= optionsValue.totalPosts ) { 103 optionsValue.loadMoreBtn.remove(); 104 } 105 106 }, 107 error: function() { 108 109 } 110 } ); 111 } ); 112 }; // end of eaelLoadMore 113 114 115})(jQuery); 116// source --> https://nieruchomoscipafos.pl/wp-content/plugins/essential-addons-for-elementor-lite/assets/social-feeds/codebird.js?ver=1.0 117"use strict"; 118 119var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); }
119 else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; })(); 120 121var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); 122 123function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } 124 125function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 126 127/** 128 * A Twitter library in JavaScript 129 * 130 * @package codebird 131 * @version 3.0.0-dev 132 * @author Jublo Solutions <[email protected]> 133 * @copyright 2010-2016 Jublo Solutions <[email protected]> 134 * @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 135 * @link https://github.com/jublonet/codebird-php 136 */ 137
138/* global window, 139 document, 140 navigator, 141 Ti, 142 ActiveXObject, 143 module, 144 define, 145 require */ 146 147(function () { 148 /** 149 * A Twitter library in JavaScript 150 * 151 * @package codebird 152 * @subpackage codebird-js 153 */ 154 155 var Codebird = (function () { 156 function Codebird() { 157 _classCallCheck(this, Codebird); 158 159 /** 160 * The OAuth consumer key of your registered app 161 */ 162 this._oauth_consumer_key = null; 163 164 /** 165 * The corresponding consumer secret 166 */ 167 this._oauth_consumer_secret = null; 168 169 /** 170 * The app-only bearer token. Used to authorize app-only requests 171 */ 172 this._oauth_bearer_token = null; 173 174 /** 175 * The API endpoint base to use 176 */ 177 this._endpoint_base = "https://api.twitter.com/"; 178 179 /** 180 * The media API endpoint base to use 181 */ 182 this._endpoint_base_media = "https://upload.twitter.com/"; 183 184 /** 185 * The API endpoint to use 186 */ 187 this._endpoint = this._endpoint_base + "1.1/"; 188 189 /** 190 * The media API endpoint to use 191 */ 192 this._endpoint_media = this._endpoint_base_media + "1.1/"; 193 194 /** 195 * The publish API endpoint to use 196 */ 197 this._endpoint_publish = "https://publish.twitter.com/"; 198 199 /** 200 * The API endpoint base to use 201 */ 202 this._endpoint_oauth = this._endpoint_base; 203 204 /** 205 * API proxy endpoint 206 */ 207 this._endpoint_proxy = "https://api.jublo.net/codebird/"; 208 209 /** 210 * Whether to access the API via a proxy that is allowed by CORS 211 * Assume that CORS is only necessary in browsers 212 */ 213 this._use_proxy = typeof navigator !== "undefined" && typeof navigator.userAgent !== "undefined"; 214 215 /** 216 * The Request or access token. Used to sign requests 217 */ 218 this._oauth_token = null; 219 220 /** 221 * The corresponding request or access token secret 222 */ 223 this._oauth_token_secret = null; 224 225 /** 226 * The current Codebird version 227 */ 228 this._version = "3.0.0-dev"; 229 230 this.b64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 231 } 232 233 /** 234 * Sets the OAuth consumer key and secret (App key) 235 * 236 * @param string key OAuth consumer key 237 * @param string secret OAuth consumer secret 238 * 239 * @return void 240 */ 241 242 _createClass(Codebird, [{ 243 key: "setConsumerKey", 244 value: function setConsumerKey(key, secret) { 245 this._oauth_consumer_key = key; 246 this._oauth_consumer_secret = secret; 247 } 248 249 /** 250 * Sets the OAuth2 app-only auth bearer token 251 * 252 * @param string token OAuth2 bearer token 253 * 254 * @return void 255 */ 256 257 }, { 258 key: "setBearerToken", 259 value: function setBearerToken(token) { 260 this._oauth_bearer_token = token; 261 } 262 263 /** 264 * Gets the current Codebird version 265 * 266 * @return string The version number 267 */ 268 269 }, { 270 key: "getVersion", 271 value: function getVersion() { 272 return this._version; 273 } 274 275 /** 276 * Sets the OAuth request or access token and secret (User key) 277 * 278 * @param string token OAuth request or access token 279 * @param string secret OAuth request or access token secret 280 * 281 * @return void 282 */ 283 284 }, { 285 key: "setToken", 286 value: function setToken(token, secret) { 287 this._oauth_token = token; 288 this._oauth_token_secret = secret; 289 } 290 291 /** 292 * Forgets the OAuth request or access token and secret (User key) 293 * 294 * @return bool 295 */ 296 297 }, { 298 key: "logout", 299 value: function logout() { 300 this._oauth_token = this._oauth_token_secret = null; 301 302 return true; 303 } 304 305 /** 306 * Enables or disables CORS proxy 307 * 308 * @param bool use_proxy Whether to use CORS proxy or not 309 * 310 * @return void 311 */ 312 313 }, { 314 key: "setUseProxy", 315 value: function setUseProxy(use_proxy) { 316 this._use_proxy = !!use_proxy; 317 } 318 319 /** 320 * Sets custom CORS proxy server 321 * 322 * @param string proxy Address of proxy server to use 323 * 324 * @return void 325 */ 326 327 }, {
328 key: "setProxy", 329 value: function setProxy(proxy) { 330 // add trailing slash if missing 331 if (!proxy.match(/\/$/)) { 332 proxy += "/"; 333 } 334 this._endpoint_proxy = proxy; 335 } 336 337 /** 338 * Signing helpers 339 */ 340 341 /** 342 * URL-encodes the given data 343 * 344 * @param mixed data 345 * 346 * @return mixed The encoded data 347 */ 348 349 }, { 350 key: "_url", 351 value: function _url(data) { 352 if (/boolean|number|string/.test(typeof data === "undefined" ? "undefined" : _typeof(data))) { 353 return encodeURIComponent(data).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A"); 354 } else { 355 return ""; 356 } 357 } 358 359 /** 360 * Gets the base64-encoded SHA1 hash for the given data 361 * 362 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined 363 * in FIPS PUB 180-1 364 * Based on version 2.1 Copyright Paul Johnston 2000 - 2002. 365 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet 366 * Distributed under the BSD License 367 * See http://pajhome.org.uk/crypt/md5 for details. 368 * 369 * @param string data The data to calculate the hash from 370 * 371 * @return string The hash 372 */ 373 374 }, { 375 key: "_sha1", 376 value: function _sha1(e) { 377 function n(e, b) { 378 e[b >> 5] |= 128 << 24 - b % 32; 379 e[(b + 64 >> 9 << 4) + 15] = b; 380 for (var c = new Array(80), a = 1732584193, d = -271733879, h = -1732584194, k = 271733878, g = -1009589776, p = 0; p < e.length; p += 16) { 381 for (var o = a, q = d, r = h, s = k, t = g, f = 0; 80 > f; f++) { 382 var m = undefined; 383 384 if (f < 16) { 385 m = e[p + f]; 386 } else { 387 m = c[f - 3] ^ c[f - 8] ^ c[f - 14] ^ c[f - 16]; 388 m = m << 1 | m >>> 31; 389 } 390 391 c[f] = m; 392 m = l(l(a << 5 | a >>> 27, 20 > f ? d & h | ~d & k : 40 > f ? d ^ h ^ k : 60 > f ? d & h | d & k | h & k : d ^ h ^ k), l(l(g, c[f]), 20 > f ? 1518500249 : 40 > f ? 1859775393 : 60 > f ? -1894007588 : -899497514)); 393 g = k; 394 k = h; 395 h = d << 30 | d >>> 2; 396 d = a; 397 a = m; 398 } 399 a = l(a, o); 400 d = l(d, q); 401 h = l(h, r); 402 k = l(k, s); 403 g = l(g, t); 404 } 405 return [a, d, h, k, g]; 406 } 407 408 function l(e, b) { 409 var c = (e & 65535) + (b & 65535); 410 return (e >> 16) + (b >> 16) + (c >> 16) << 16 | c & 65535; 411 } 412 413 function q(e) { 414 for (var b = [], c = (1 << g) - 1, a = 0; a < e.length * g; a += g) { 415 b[a >> 5] |= (e.charCodeAt(a / g) & c) << 24 - a % 32; 416 } 417 return b; 418 } 419 var g = 8; 420 421 var b = this._oauth_consumer_secret + "&" + (null !== this._oauth_token_secret ? this._oauth_token_secret : ""); 422 if (this._oauth_consumer_secret === null) { 423 throw "To generate a hash, the consumer secret must be set."; 424 } 425 var c = q(b); 426 if (c.length > 16) { 427 c = n(c, b.length * g); 428 } 429 var bb = new Array(16); 430 for (var a = new Array(16), d = 0; d < 16; d++) { 431 a[d] = c[d] ^ 909522486; 432 bb[d] = c[d] ^ 1549556828; 433 } 434 c = n(a.concat(q(e)), 512 + e.length * g); 435 bb = n(bb.concat(c), 672); 436 b = ""; 437 for (g = 0; g < 4 * bb.length; g += 3) { 438 for (d = (bb[g >> 2] >> 8 * (3 - g % 4) & 255) << 16 | (bb[g + 1 >> 2] >> 8 * (3 - (g + 1) % 4) & 255) << 8 | bb[g + 2 >> 2] >> 8 * (3 - (g + 2) % 4) & 255, e = 0; 4 > e; e++) { 439 b = 8 * g + 6 * e > 32 * bb.length ? b + "=" : b + this.b64_alphabet.charAt(d >> 6 * (3 - e) & 63); 440 } 441 } 442 return b; 443 } 444 445 /* 446 * Gets the base64 representation for the given data 447 * 448 * http://phpjs.org 449 * + original by: Tyler Akins (http://rumkin.com) 450 * + improved by: Bayron Guevara 451 * + improved by: Thunder.m 452 * + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) 453 * + bugfixed by: Pellentesque Malesuada 454 * + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) 455 * + improved by: RafaÅ Kukawski (http://kukawski.pl) 456 * 457 * @param string data The data to calculate the base64 representation from 458 * 459 * @return string The base64 representation 460 */ 461 462 }, {
463 key: "_base64_encode", 464 value: function _base64_encode(a) { 465 var d = undefined, 466 e = undefined, 467 f = undefined, 468 b = undefined, 469 g = 0, 470 h = 0, 471 i = this.b64_alphabet, 472 c = []; 473 if (!a) { 474 return a; 475 } 476 do { 477 d = a.charCodeAt(g++); 478 e = a.charCodeAt(g++); 479 f = a.charCodeAt(g++); 480 b = d << 16 | e << 8 | f; 481 d = b >> 18 & 63; 482 e = b >> 12 & 63; 483 f = b >> 6 & 63; 484 b &= 63; 485 c[h++] = i.charAt(d) + i.charAt(e) + i.charAt(f) + i.charAt(b); 486 } while (g < a.length); 487 i = c.join(""); 488 a = a.length % 3; 489 return (a ? i.slice(0, a - 3) : i) + "===".slice(a || 3); 490 } 491 492 /* 493 * Builds a HTTP query string from the given data 494 * 495 * http://phpjs.org 496 * + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) 497 * + improved by: Legaev Andrey 498 * + improved by: Michael White (http://getsprink.com) 499 * + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) 500 * + improved by: Brett Zamir (http://brett-zamir.me) 501 * + revised by: stag019 502 * + input by: Dreamer 503 * + bugfixed by: Brett Zamir (http://brett-zamir.me) 504 * + bugfixed by: MIO_KODUKI (http://mio-koduki.blogspot.com/) 505 * 506 * @param string data The data to concatenate 507 * 508 * @return string The HTTP query 509 */ 510 511 }, { 512 key: "_http_build_query", 513 value: function _http_build_query(e, f, b) { 514 function g(c, a, d) { 515 var b = undefined, 516 e = []; 517 if (a === true) { 518 a = "1"; 519 } else if (a === false) { 520 a = "0"; 521 } 522 if (null !== a) { 523 if ((typeof a === "undefined" ? "undefined" : _typeof(a)) === "object") { 524 for (b in a) { 525 if (a.hasOwnProperty(b) && a[b] !== null) { 526 e.push(g.call(this, c + "[" + b + "]", a[b], d)); 527 } 528 } 529 return e.join(d); 530 } 531 if (typeof a !== "function") { 532 return this._url(c) + "=" + this._url(a); 533 } 534 throw "There was an error processing for http_build_query()."; 535 } else { 536 return ""; 537 } 538 } 539 var d, 540 c, 541 h = []; 542 if (!b) { 543 b = "&"; 544 } 545 for (c in e) { 546 if (!e.hasOwnProperty(c)) { 547 continue; 548 } 549 d = e[c]; 550 if (f && !isNaN(c)) { 551 c = String(f) + c; 552 } 553 d = g.call(this, c, d, b); 554 if (d !== "") { 555 h.push(d); 556 } 557 } 558 return h.join(b); 559 } 560 561 /** 562 * Generates a (hopefully) unique random string 563 * 564 * @param int optional length The length of the string to generate 565 * 566 * @return string The random string 567 */ 568 569 }, { 570 key: "_nonce", 571 value: function _nonce() { 572 var length = arguments.length <= 0 || arguments[0] === undefined ? 8 : arguments[0]; 573 574 if (length < 1) { 575 throw "Invalid nonce length."; 576 } 577 var nonce = ""; 578 for (var i = 0; i < length; i++) { 579 var character = Math.floor(Math.random() * 61); 580 nonce += this.b64_alphabet.substring(character, character + 1); 581 } 582 return nonce; 583 } 584 585 /** 586 * Sort array elements by key 587 * 588 * @param array input_arr The array to sort 589 * 590 * @return array The sorted keys 591 */ 592 593 }, { 594 key: "_ksort", 595 value: function _ksort(input_arr) { 596 var keys = [], 597 sorter = undefined, 598 k = undefined; 599 600 sorter = function (a, b) { 601 var a_float = parseFloat(a), 602 b_float = parseFloat(b), 603 a_numeric = a_float + "" === a, 604 b_numeric = b_float + "" === b; 605 if (a_numeric && b_numeric) { 606 return a_float > b_float ? 1 : a_float < b_float ? -1 : 0; 607 } else if (a_numeric && !b_numeric) { 608 return 1; 609 } else if (!a_numeric && b_numeric) { 610 return -1; 611 } 612 return a > b ? 1 : a < b ? -1 : 0; 613 }; 614 615 // Make a list of key names 616 for (k in input_arr) { 617 if (input_arr.hasOwnProperty(k)) { 618 keys.push(k); 619 } 620 } 621 keys.sort(sorter); 622 return keys; 623 } 624 625 /** 626 * Clone objects 627 * 628 * @param object obj The object to clone 629 * 630 * @return object clone The cloned object 631 */ 632 633 }, {
634 key: "_clone", 635 value: function _clone(obj) { 636 var clone = {}; 637 for (var i in obj) { 638 if (_typeof(obj[i]) === "object") { 639 clone[i] = this._clone(obj[i]); 640 } else { 641 clone[i] = obj[i]; 642 } 643 } 644 return clone; 645 } 646 647 /** 648 * Gets the XML HTTP Request object, trying to load it in various ways 649 * 650 * @return object The XMLHttpRequest object instance 651 */ 652 653 }, { 654 key: "_getXmlRequestObject", 655 value: function _getXmlRequestObject() { 656 var xml = null; 657 // first, try the W3-standard object 658 if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && window && typeof window.XMLHttpRequest !== "undefined") { 659 xml = new window.XMLHttpRequest(); 660 // then, try Titanium framework object 661 } else if ((typeof Ti === "undefined" ? "undefined" : _typeof(Ti)) === "object" && Ti && typeof Ti.Network.createHTTPClient !== "undefined") { 662 xml = Ti.Network.createHTTPClient(); 663 // are we in an old Internet Explorer? 664 } else if (typeof ActiveXObject !== "undefined") { 665 try { 666 xml = new ActiveXObject("Microsoft.XMLHTTP"); 667 } catch (e) { 668 throw "ActiveXObject object not defined."; 669 } 670 // now, consider RequireJS and/or Node.js objects 671 } else if (typeof require === "function") { 672 var XMLHttpRequest; 673 // look for xmlhttprequest module 674 try { 675 XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; 676 xml = new XMLHttpRequest(); 677 } catch (e1) { 678 // or maybe the user is using xhr2 679 try { 680 XMLHttpRequest = require("xhr2"); 681 xml = new XMLHttpRequest(); 682 } catch (e2) { 683 throw "xhr2 object not defined, cancelling."; 684 } 685 } 686 } 687 return xml; 688 } 689 690 /** 691 * Parse URL-style parameters into object 692 * 693 * version: 1109.2015 694 * discuss at: http://phpjs.org/functions/parse_str 695 * + original by: Cagri Ekin 696 * + improved by: Michael White (http://getsprink.com) 697 * + tweaked by: Jack 698 * + bugfixed by: Onno Marsman 699 * + reimplemented by: stag019 700 * + bugfixed by: Brett Zamir (http://brett-zamir.me) 701 * + bugfixed by: stag019 702 * - depends on: urldecode 703 * + input by: Dreamer 704 * + bugfixed by: Brett Zamir (http://brett-zamir.me) 705 * % note 1: When no argument is specified, will put variables in global scope. 706 * 707 * @param string str String to parse 708 * @param array array to load data into 709 * 710 * @return object 711 */ 712 713 }, { 714 key: "_parse_str", 715 value: function _parse_str(str, array) { 716 var glue1 = "=", 717 glue2 = "&", 718 array2 = String(str).replace(/^&?([\s\S]*?)&?$/, "$1").split(glue2), 719 i, 720 j, 721 chr, 722 tmp, 723 key, 724 value, 725 bracket, 726 keys, 727 evalStr, 728 fixStr = function fixStr(str) { 729 return decodeURIComponent(str).replace(/([\\"'])/g, "\\$1").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); 730 }; 731 if (!array) { 732 array = this.window; 733 } 734 735 for (i = 0; i < array2.length; i++) { 736 tmp = array2[i].split(glue1); 737 if (tmp.length < 2) { 738 tmp = [tmp, ""]; 739 } 740 key = fixStr(tmp[0]); 741 value = fixStr(tmp[1]); 742 while (key.charAt(0) === " ") { 743 key = key.substr(1); 744 } 745 if (key.indexOf("\0") > -1) { 746 key = key.substr(0, key.indexOf("\0")); 747 } 748 if (key && key.charAt(0) !== "[") { 749 keys = []; 750 bracket = 0; 751 for (j = 0; j < key.length; j++) { 752 if (key.charAt(j) === "[" && !bracket) { 753 bracket = j + 1; 754 } else if (key.charAt(j) === "]") { 755 if (bracket) { 756 if (!keys.length) { 757 keys.push(key.substr(0, bracket - 1)); 758 } 759 keys.push(key.substr(bracket, j - bracket)); 760 bracket = 0; 761 if (key.charAt(j + 1) !== "[") { 762 break; 763 } 764 } 765 } 766 } 767 if (!keys.length) { 768 keys = [key]; 769 } 770 for (j = 0; j < keys[0].length; j++) {
771 chr = keys[0].charAt(j); 772 if (chr === " " || chr === "." || chr === "[") { 773 keys[0] = keys[0].substr(0, j) + "_" + keys[0].substr(j + 1); 774 } 775 if (chr === "[") { 776 break; 777 } 778 } 779 evalStr = "array"; 780 for (j = 0; j < keys.length; j++) { 781 key = keys[j]; 782 if (key !== "" && key !== " " || j === 0) { 783 key = "'" + key + "'"; 784 } else { 785 key = eval(evalStr + ".push([]);") - 1; 786 } 787 evalStr += "[" + key + "]"; 788 if (j !== keys.length - 1 && eval("typeof " + evalStr) === "undefined") { 789 eval(evalStr + " = [];"); 790 } 791 } 792 evalStr += " = '" + value + "';\n"; 793 eval(evalStr); 794 } 795 } 796 } 797 798 /** 799 * Get allowed API methods, sorted by GET or POST 800 * Watch out for multiple-method "account/settings"! 801 * 802 * @return array $apimethods 803 */ 804 805 }, { 806 key: "getApiMethods", 807 value: function getApiMethods() { 808 var httpmethods = { 809 GET: ["account/settings", "account/verify_credentials", "application/rate_limit_status", "blocks/ids", "blocks/list", "collections/entries", "collections/list", "collections/show", "direct_messages", "direct_messages/sent", "direct_messages/show", "favorites/list", "followers/ids", "followers/list", "friends/ids", "friends/list", "friendships/incoming", "friendships/lookup", "friendships/lookup", "friendships/no_retweets/ids", "friendships/outgoing", "friendships/show", "geo/id/:place_id", "geo/reverse_geocode", "geo/search", "geo/similar_places", "help/configuration", "help/languages", "help/privacy", "help/tos", "lists/list", "lists/members", "lists/members/show", "lists/memberships", "lists/ownerships", "lists/show", "lists/statuses", "lists/subscribers", "lists/subscribers/show", "lists/subscriptions", "mutes/users/ids", "mutes/users/list", "oauth/authenticate", "oauth/authorize", "saved_searches/list", "saved_searches/show/:id", "search/tweets", "site", "statuses/firehose", "statuses/home_timeline", "statuses/mentions_timeline", "statuses/oembed", "statuses/retweeters/ids", "statuses/retweets/:id", "statuses/retweets_of_me", "statuses/sample", "statuses/show/:id", "statuses/user_timeline", "trends/available", "trends/closest", "trends/place", "user", "users/contributees", "users/contributors", "users/profile_banner", "users/search", "users/show", "users/suggestions", "users/suggestions/:slug", "users/suggestions/:slug/members"], 810 POST: ["account/remove_profile_banner", "account/settings__post", "account/update_delivery_device", "account/update_profile", "account/update_profile_background_image", "account/update_profile_banner", "account/update_profile_colors", "account/update_profile_image", "blocks/create", "blocks/destroy", "collections/create", "collections/destroy", "collections/entries/add", "collections/entries/curate", "collections/entries/move", "collections/entries/remove", "collections/update", "direct_messages/destroy", "direct_messages/new", "favorites/create", "favorites/destroy", "friendships/create", "friendships/destroy", "friendships/update", "lists/create", "lists/destroy", "lists/members/create", "lists/members/create_all", "lists/members/destroy", "lists/members/destroy_all", "lists/subscribers/create", "lists/subscribers/destroy", "lists/update", "media/upload", "mutes/users/create", "mutes/users/destroy", "oauth/access_token", "oauth/request_token", "oauth2/invalidate_token", "oauth2/token", "saved_searches/create", "saved_searches/destroy/:id", "statuses/destroy/:id", "statuses/filter", "statuses/lookup", "statuses/retweet/:id", "statuses/unretweet/:id", "statuses/update", "statuses/update_with_media", // deprecated, use media/upload 811 "users/lookup", "users/report_spam"] 812 }; 813 return httpmethods; 814 } 815 816 /** 817 * Promise helpers 818 */ 819 820 /** 821 * Get a deferred object 822 */ 823 824 }, {
825 key: "_getDfd", 826 value: function _getDfd() { 827 if (typeof window !== "undefined") { 828 if (typeof window.jQuery !== "undefined" && window.jQuery.Deferred) { 829 return window.jQuery.Deferred(); 830 } 831 if (typeof window.Q !== "undefined" && window.Q.defer) { 832 return window.Q.defer(); 833 } 834 if (typeof window.RSVP !== "undefined" && window.RSVP.defer) { 835 return window.RSVP.defer(); 836 } 837 if (typeof window.when !== "undefined" && window.when.defer) { 838 return window.when.defer(); 839 } 840 } 841 if (typeof require !== "undefined") { 842 var promise_class = false; 843 try { 844 promise_class = require("jquery"); 845 } catch (e) {} 846 if (promise_class) { 847 return promise_class.Deferred(); 848 } 849 try { 850 promise_class = require("q"); 851 } catch (e) {} 852 if (!promise_class) { 853 try { 854 promise_class = require("rsvp"); 855 } catch (e) {} 856 } 857 if (!promise_class) { 858 try { 859 promise_class = require("when"); 860 } catch (e) {} 861 } 862 if (promise_class) { 863 try { 864 return promise_class.defer(); 865 } catch (e) {} 866 } 867 } 868 return false; 869 } 870 871 /** 872 * Get a promise from the dfd object 873 */ 874 875 }, { 876 key: "_getPromise", 877 value: function _getPromise(dfd) { 878 if (typeof dfd.promise === "function") { 879 return dfd.promise(); 880 } 881 return dfd.promise; // object 882 } 883 884 /** 885 * __call() helpers 886 */ 887 888 /** 889 * Parse given params, detect query-style params 890 * 891 * @param array|string params Parameters to parse 892 * 893 * @return array apiparams 894 */ 895 896 }, { 897 key: "_parseApiParams", 898 value: function _parseApiParams(params) { 899 var apiparams = {}; 900 if ((typeof params === "undefined" ? "undefined" : _typeof(params)) === "object") { 901 apiparams = params; 902 } else { 903 this._parse_str(params, apiparams); //TODO 904 } 905 906 return apiparams; 907 } 908 909 /** 910 * Replace null and boolean parameters with their string representations 911 * 912 * @param array apiparams Parameter array to replace in 913 * 914 * @return array apiparams 915 */ 916 917 }, { 918 key: "_stringifyNullBoolParams", 919 value: function _stringifyNullBoolParams(apiparams) { 920 for (var key in apiparams) { 921 if (!apiparams.hasOwnProperty(key)) { 922 continue; 923 } 924 var value = apiparams[key]; 925 if (value === null) { 926 apiparams[key] = "null"; 927 } else if (value === true || value === false) { 928 apiparams[key] = value ? "true" : "false"; 929 } 930 } 931 932 return apiparams; 933 } 934 935 /** 936 * API method mapping: Replaces _ with / character 937 * 938 * @param string fn Function called 939 * 940 * @return string API method to call 941 */ 942 943 }, { 944 key: "_mapFnInsertSlashes", 945 value: function _mapFnInsertSlashes(fn) { 946 return fn.split("_").join("/"); 947 } 948 949 /** 950 * API method mapping: Restore _ character in named parameters 951 * 952 * @param string method API method to call 953 * 954 * @return string API method with restored underscores 955 */ 956 957 }, { 958 key: "_mapFnRestoreParamUnderscores", 959 value: function _mapFnRestoreParamUnderscores(method) { 960 var url_parameters_with_underscore = ["screen_name", "place_id"]; 961 var i = undefined, 962 param = undefined, 963 replacement_was = undefined; 964 for (i = 0; i < url_parameters_with_underscore.length; i++) { 965 param = url_parameters_with_underscore[i].toUpperCase(); 966 replacement_was = param.split("_").join("/"); 967 method = method.split(replacement_was).join(param); 968 } 969 970 return method; 971 } 972 973 /**
974 * Maps called PHP magic method name to Twitter API method 975 * 976 * @param string $fn Function called 977 * @param array $apiparams byref API parameters 978 * 979 * @return string[] (string method, string method_template) 980 */ 981 982 }, { 983 key: "_mapFnToApiMethod", 984 value: function _mapFnToApiMethod(fn, apiparams) { 985 var method = "", 986 param = undefined, 987 i = undefined, 988 j = undefined; 989 990 // replace _ by / 991 method = this._mapFnInsertSlashes(fn); 992 993 // undo replacement for URL parameters 994 method = this._mapFnRestoreParamUnderscores(method); 995 996 // replace AA by URL parameters 997 var method_template = method; 998 var match = method.match(/[A-Z_]{2,}/); 999 if (match) { 1000 for (i = 0; i < match.length; i++) { 1001 param = match[i]; 1002 var param_l = param.toLowerCase(); 1003 method_template = method_template.split(param).join(":" + param_l); 1004 if (typeof apiparams[param_l] === "undefined") { 1005 for (j = 0; j < 26; j++) { 1006 method_template = method_template.split(String.fromCharCode(65 + j)).join("_" + String.fromCharCode(97 + j)); 1007 } 1008 throw "To call the templated method \"" + method_template + "\", specify the parameter value for \"" + param_l + "\"."; 1009 } 1010 method = method.split(param).join(apiparams[param_l]); 1011 delete apiparams[param_l]; 1012 } 1013 } 1014 1015 // replace A-Z by _a-z 1016 for (i = 0; i < 26; i++) { 1017 method = method.split(String.fromCharCode(65 + i)).join("_" + String.fromCharCode(97 + i)); 1018 method_template = method_template.split(String.fromCharCode(65 + i)).join("_" + String.fromCharCode(97 + i)); 1019 } 1020 1021 return [method, method_template]; 1022 } 1023 1024 /** 1025 * Detects HTTP method to use for API call 1026 * 1027 * @param string method The API method to call 1028 * @param array params The parameters to send along 1029 * 1030 * @return string The HTTP method that should be used 1031 */ 1032 1033 }, { 1034 key: "_detectMethod", 1035 value: function _detectMethod(method, params) { 1036 if (typeof params.httpmethod !== "undefined") { 1037 var httpmethod = params.httpmethod; 1038 delete params.httpmethod; 1039 return httpmethod; 1040 } 1041 1042 // multi-HTTP method endpoints 1043 switch (method) { 1044 case "account/settings": 1045 case "account/login_verification_enrollment": 1046 case "account/login_verification_request": 1047 method = Object.keys(params).length ? method + "__post" : method; 1048 break; 1049 } 1050 1051 var apimethods = this.getApiMethods(); 1052 for (var httpmethod in apimethods) { 1053 if (apimethods.hasOwnProperty(httpmethod) && apimethods[httpmethod].indexOf(method) > -1) { 1054 return httpmethod; 1055 } 1056 } 1057 throw "Can't find HTTP method to use for \"" + method + "\"."; 1058 } 1059 1060 /** 1061 * Detects if API call should use multipart/form-data 1062 * 1063 * @param string method The API method to call 1064 * 1065 * @return bool Whether the method should be sent as multipart 1066 */ 1067 1068 }, { 1069 key: "_detectMultipart", 1070 value: function _detectMultipart(method) { 1071 var multiparts = [ 1072 // Tweets 1073 "statuses/update_with_media", "media/upload", 1074 1075 // Users 1076 "account/update_profile_background_image", "account/update_profile_image", "account/update_profile_banner"]; 1077 return multiparts.indexOf(method) > -1; 1078 } 1079 1080 /** 1081 * Signature helper 1082 * 1083 * @param string httpmethod Usually either 'GET' or 'POST' or 'DELETE' 1084 * @param string method The API method to call 1085 * @param array base_params The signature base parameters 1086 * 1087 * @return string signature 1088 */ 1089 1090 }, { 1091 key: "_getSignature", 1092 value: function _getSignature(httpmethod, method, keys, base_params) { 1093 // convert params to string 1094 var base_string = "", 1095 key = undefined, 1096 value = undefined; 1097 for (var i = 0; i < keys.length; i++) { 1098 key = keys[i]; 1099 value = base_params[key]; 1100 base_string += key + "=" + this._url(value) + "&"; 1101 } 1102 base_string = base_string.substring(0, base_string.length - 1); 1103 return this._sha1(httpmethod + "&" + this._url(method) + "&" + this._url(base_string)); 1104 } 1105 1106 /** 1107 * Generates the UNIX timestamp 1108 */ 1109 1110 }, {
1111 key: "_time", 1112 value: function _time() { 1113 return Math.round(new Date().getTime() / 1000); 1114 } 1115 1116 /** 1117 * Generates an OAuth signature 1118 * 1119 * @param string httpmethod Usually either 'GET' or 'POST' or 'DELETE' 1120 * @param string method The API method to call 1121 * @param array optional params The API call parameters, associative 1122 * 1123 * @return string Authorization HTTP header 1124 */ 1125 1126 }, { 1127 key: "_sign", 1128 value: function _sign(httpmethod, method) { 1129 var params = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; 1130 1131 if (this._oauth_consumer_key === null) { 1132 throw "To generate a signature, the consumer key must be set."; 1133 } 1134 var sign_params = { 1135 consumer_key: this._oauth_consumer_key, 1136 version: "1.0", 1137 timestamp: this._time(), 1138 nonce: this._nonce(), 1139 signature_method: "HMAC-SHA1" 1140 }; 1141 var sign_base_params = {}; 1142 for (var key in sign_params) { 1143 if (!sign_params.hasOwnProperty(key)) { 1144 continue; 1145 } 1146 var value = sign_params[key]; 1147 sign_base_params["oauth_" + key] = this._url(value); 1148 } 1149 if (this._oauth_token !== null) { 1150 sign_base_params.oauth_token = this._url(this._oauth_token); 1151 } 1152 var oauth_params = this._clone(sign_base_params); 1153 for (key in params) { 1154 if (!params.hasOwnProperty(key)) { 1155 continue; 1156 } 1157 sign_base_params[key] = params[key]; 1158 } 1159 var keys = this._ksort(sign_base_params); 1160 1161 var signature = this._getSignature(httpmethod, method, keys, sign_base_params); 1162 1163 params = oauth_params; 1164 params.oauth_signature = signature; 1165 keys = this._ksort(params); 1166 var authorization = "OAuth "; 1167 for (var i = 0; i < keys.length; i++) { 1168 key = keys[i]; 1169 authorization += key + "=\"" + this._url(params[key]) + "\", "; 1170 } 1171 return authorization.substring(0, authorization.length - 2); 1172 } 1173 1174 /** 1175 * Build multipart request from upload params 1176 * 1177 * @param string method The API method to call 1178 * @param array params The parameters to send along 1179 * 1180 * @return null|string The built multipart request body 1181 */ 1182 1183 }, { 1184 key: "_buildMultipart", 1185 value: function _buildMultipart(method, params) { 1186 // well, files will only work in multipart methods 1187 if (!this._detectMultipart(method)) { 1188 return; 1189 } 1190 1191 // only check specific parameters 1192 var possible_methods = [ 1193 // Tweets 1194 "media/upload", "statuses/update_with_media", 1195 // Accounts 1196 "account/update_profile_background_image", "account/update_profile_image", "account/update_profile_banner"]; 1197 var possible_files = { 1198 // Tweets 1199 "media/upload": "media", 1200 "statuses/update_with_media": "media[]", 1201 // Accounts 1202 "account/update_profile_background_image": "image", 1203 "account/update_profile_image": "image", 1204 "account/update_profile_banner": "banner" 1205 }; 1206 // method might have files? 1207 if (possible_methods.indexOf(method) === -1) { 1208 return; 1209 } 1210 1211 // check for filenames 1212 possible_files = possible_files[method].split(" "); 1213 1214 var multipart_border = "--------------------" + this._nonce(); 1215 var multipart_request = ""; 1216 for (var key in params) { 1217 if (!params.hasOwnProperty(key)) { 1218 continue; 1219 } 1220 multipart_request += "--" + multipart_border + "\r\nContent-Disposition: form-data; name=\"" + key + "\""; 1221 if (possible_files.indexOf(key) === -1) { 1222 multipart_request += "\r\nContent-Transfer-Encoding: base64"; 1223 } 1224 multipart_request += "\r\n\r\n" + params[key] + "\r\n"; 1225 } 1226 multipart_request += "--" + multipart_border + "--"; 1227 return multipart_request; 1228 } 1229 1230 /** 1231 * Detects if API call should use media endpoint 1232 * 1233 * @param string method The API method to call 1234 * 1235 * @return bool Whether the method is defined in media API 1236 */ 1237 1238 }, {
1239 key: "_detectMedia", 1240 value: function _detectMedia(method) { 1241 var medias = ["media/upload"]; 1242 return medias.indexOf(method) > -1; 1243 } 1244 1245 /** 1246 * Detects if API call should use JSON body 1247 * 1248 * @param string method The API method to call 1249 * 1250 * @return bool Whether the method is defined as accepting JSON body 1251 */ 1252 1253 }, { 1254 key: "_detectJsonBody", 1255 value: function _detectJsonBody(method) { 1256 var json_bodies = ["collections/entries/curate"]; 1257 return json_bodies.indexOf(method) > -1; 1258 } 1259 1260 /** 1261 * Builds the complete API endpoint url 1262 * 1263 * @param string method The API method to call 1264 * 1265 * @return string The URL to send the request to 1266 */ 1267 1268 }, { 1269 key: "_getEndpoint", 1270 value: function _getEndpoint(method) { 1271 var url = undefined; 1272 if (method.substring(0, 5) === "oauth") { 1273 url = this._endpoint_oauth + method; 1274 } else if (this._detectMedia(method)) { 1275 url = this._endpoint_media + method + ".json"; 1276 } else if (method === "statuses/oembed") { 1277 url = this._endpoint_publish + "oembed"; 1278 } else { 1279 url = this._endpoint + method + ".json"; 1280 } 1281 return url; 1282 } 1283 1284 /** 1285 * Parses the API reply to encode it in the set return_format 1286 * 1287 * @param string reply The actual reply, JSON-encoded or URL-encoded 1288 * 1289 * @return array|object The parsed reply 1290 */ 1291 1292 }, { 1293 key: "_parseApiReply", 1294 value: function _parseApiReply(reply) { 1295 if (typeof reply !== "string" || reply === "") { 1296 return {}; 1297 } 1298 if (reply === "[]") { 1299 return []; 1300 } 1301 var parsed = undefined; 1302 try { 1303 parsed = JSON.parse(reply); 1304 } catch (e) { 1305 parsed = {}; 1306 // assume query format 1307 var elements = reply.split("&"); 1308 for (var i = 0; i < elements.length; i++) { 1309 var element = elements[i].split("=", 2); 1310 if (element.length > 1) { 1311 parsed[element[0]] = decodeURIComponent(element[1]); 1312 } else { 1313 parsed[element[0]] = null; 1314 } 1315 } 1316 } 1317 return parsed; 1318 } 1319 1320 /** 1321 * Uncommon API methods 1322 */ 1323 1324 /** 1325 * Gets the OAuth authenticate URL for the current request token 1326 * 1327 * @return object Promise 1328 */ 1329 1330 }, { 1331 key: "oauth_authenticate", 1332 value: function oauth_authenticate() { 1333 var params = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; 1334 var callback = arguments.length <= 1 || arguments[1] === undefined ? undefined : arguments[1]; 1335 var type = arguments.length <= 2 || arguments[2] === undefined ? "authenticate" : arguments[2]; 1336 1337 var dfd = this._getDfd(); 1338 if (typeof params.force_login === "undefined") { 1339 params.force_login = null; 1340 } 1341 if (typeof params.screen_name === "undefined") { 1342 params.screen_name = null; 1343 } 1344 if (["authenticate", "authorize"].indexOf(type) === -1) { 1345 type = "authenticate"; 1346 } 1347 if (this._oauth_token === null) { 1348 var error = "To get the " + type + " URL, the OAuth token must be set."; 1349 if (dfd) { 1350 dfd.reject({ error: error }); 1351 return this._getPromise(dfd); 1352 } 1353 throw error; 1354 } 1355 var url = this._endpoint_oauth + "oauth/" + type + "?oauth_token=" + this._url(this._oauth_token); 1356 if (params.force_login === true) { 1357 url += "&force_login=1"; 1358 } 1359 if (params.screen_name !== null) { 1360 url += "&screen_name=" + params.screen_name; 1361 } 1362 if (typeof callback === "function") { 1363 callback(url); 1364 } 1365 if (dfd) { 1366 dfd.resolve({ reply: url }); 1367 return this._getPromise(dfd); 1368 } 1369 // no promises 1370 return true; 1371 } 1372 1373 /** 1374 * Gets the OAuth authorize URL for the current request token 1375 * 1376 * @return string The OAuth authorize URL 1377 */ 1378 1379 }, {
1380 key: "oauth_authorize", 1381 value: function oauth_authorize(params, callback) { 1382 return this.oauth_authenticate(params, callback, "authorize"); 1383 } 1384 1385 /** 1386 * Gets the OAuth bearer token 1387 * 1388 * @return object Promise 1389 */ 1390 1391 }, { 1392 key: "oauth2_token", 1393 value: function oauth2_token(callback) { 1394 var _this = this; 1395 1396 var dfd = this._getDfd(); 1397 1398 if (this._oauth_consumer_key === null) { 1399 var error = "To obtain a bearer token, the consumer key must be set."; 1400 if (dfd) { 1401 dfd.reject({ error: error }); 1402 return this._getPromise(dfd); 1403 } 1404 throw error; 1405 } 1406 1407 if (!dfd && typeof callback === "undefined") { 1408 callback = function () {}; 1409 } 1410 1411 var post_fields = "grant_type=client_credentials"; 1412 var url = this._endpoint_oauth + "oauth2/token"; 1413 1414 if (this._use_proxy) { 1415 url = url.replace(this._endpoint_base, this._endpoint_proxy); 1416 } 1417 1418 var xml = this._getXmlRequestObject(); 1419 if (xml === null) { 1420 return; 1421 } 1422 xml.open("POST", url, true); 1423 xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 1424 xml.setRequestHeader((this._use_proxy ? "X-" : "") + "Authorization", "Basic " + this._base64_encode(this._oauth_consumer_key + ":" + this._oauth_consumer_secret)); 1425 1426 xml.onreadystatechange = function () { 1427 if (xml.readyState >= 4) { 1428 var httpstatus = 12027; 1429 try { 1430 httpstatus = xml.status; 1431 } catch (e) {} 1432 var response = ""; 1433 try { 1434 response = xml.responseText; 1435 } catch (e) {} 1436 var reply = _this._parseApiReply(response); 1437 reply.httpstatus = httpstatus; 1438 if (httpstatus === 200) { 1439 _this.setBearerToken(reply.access_token); 1440 } 1441 if (typeof callback === "function") { 1442 callback(reply); 1443 } 1444 if (dfd) { 1445 dfd.resolve({ reply: reply }); 1446 } 1447 } 1448 }; 1449 // function called when an error occurs, including a timeout 1450 xml.onerror = function (e) { 1451 if (typeof callback === "function") { 1452 callback(null, e); 1453 } 1454 if (dfd) { 1455 dfd.reject(e); 1456 } 1457 }; 1458 xml.timeout = 30000; // in milliseconds 1459 1460 xml.send(post_fields); 1461 if (dfd) { 1462 return this._getPromise(dfd); 1463 } 1464 } 1465 1466 /** 1467 * Calls the API using cURL 1468 * 1469 * @param string httpmethod The HTTP method to use for making the request 1470 * @param string method The API method to call 1471 * @param array optional params The parameters to send along 1472 * @param bool optional multipart Whether to use multipart/form-data 1473 * @param bool optional app_only_auth Whether to use app-only bearer authentication 1474 * @param function callback The function to call with the API call result 1475 * 1476 * @return mixed The API reply, encoded in the set return_format 1477 */ 1478 1479 }, { 1480 key: "_callApi", 1481 value: function _callApi(httpmethod, method) { 1482 var params = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; 1483 var multipart = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; 1484 1485 var _this2 = this; 1486 1487 var app_only_auth = arguments.length <= 4 || arguments[4] === undefined ? false : arguments[4]; 1488 var callback = arguments.length <= 5 || arguments[5] === undefined ? function () {} : arguments[5]; 1489 1490 var dfd = this._getDfd(); 1491 1492 var url = this._getEndpoint(method), 1493 authorization = null; 1494 1495 var xml = this._getXmlRequestObject(); 1496 if (xml === null) { 1497 return; 1498 } 1499 var post_fields = undefined; 1500 1501 if (httpmethod === "GET") { 1502 var url_with_params = url; 1503 if (JSON.stringify(params) !== "{}") { 1504 url_with_params += "?" + this._http_build_query(params); 1505 } 1506 if (!app_only_auth) { 1507 authorization = this._sign(httpmethod, url, params); 1508 } 1509 1510 if (this._use_proxy) { 1511 url_with_params = url_with_params.replace(this._endpoint_base, this._endpoint_proxy).replace(this._endpoint_base_media, this._endpoint_proxy); 1512 } 1513 xml.open(httpmethod, url_with_params, true); 1514 } else { 1515 if (multipart) { 1516 if (!app_only_auth) { 1517 authorization = this._sign(httpmethod, url, {}); 1518 } 1519 params = this._buildMultipart(method, params); 1520 } else if (this._detectJsonBody(method)) { 1521 authorization = this._sign(httpmethod, url, {}); 1522 params = JSON.stringify(params); 1523 } else { 1524 if (!app_only_auth) { 1525 authorization = this._sign(httpmethod, url, params); 1526 } 1527 params = this._http_build_query(params); 1528 } 1529 post_fields = params; 1530 if (this._use_proxy || multipart) { 1531 // force proxy for multipart base64 1532 url = url.replace(this._endpoint_base, this._endpoint_proxy).replace(this._endpoint_base_media, this._endpoint_proxy); 1533 } 1534 xml.open(httpmethod, url, true); 1535 if (multipart) { 1536 xml.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + post_fields.split("\r\n")[0].substring(2)); 1537 } else if (this._detectJsonBody(method)) { 1538 xml.setRequestHeader("Content-Type", "application/json"); 1539 } else { 1540 xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 1541 } 1542 } 1543 if (app_only_auth) { 1544 if (this._oauth_consumer_key === null && this._oauth_bearer_token === null) { 1545 var error = "To make an app-only auth API request, consumer key or bearer token must be set."; 1546 if (dfd) { 1547 dfd.reject({ error: error }); 1548 return this._getPromise(dfd); 1549 } 1550 throw error; 1551 } 1552 // automatically fetch bearer token, if necessary 1553 if (this._oauth_bearer_token === null) { 1554 if (dfd) { 1555 return this.oauth2_token().then(function () { 1556 return _this2._callApi(httpmethod, method, params, multipart, app_only_auth, callback); 1557 }); 1558 } 1559 this.oauth2_token(function () { 1560 _this2._callApi(httpmethod, method, params, multipart, app_only_auth, callback); 1561 }); 1562 return; 1563 } 1564 authorization = "Bearer " + this._oauth_bearer_token; 1565 } 1566 if (authorization !== null) { 1567 xml.setRequestHeader((this._use_proxy ? "X-" : "") + "Authorization", authorization); 1568 } 1569 xml.onreadystatechange = function () { 1570 if (xml.readyState >= 4) { 1571 var httpstatus = 12027; 1572 try { 1573 httpstatus = xml.status; 1574 } catch (e) {} 1575 var response = ""; 1576 try { 1577 response = xml.responseText; 1578 } catch (e) {} 1579 var reply = _this2._parseApiReply(response); 1580 reply.httpstatus = httpstatus; 1581 var rate = null; 1582 if (typeof xml.getResponseHeader !== "undefined" && xml.getResponseHeader("x-rate-limit-limit") !== "") { 1583 rate = { 1584 limit: xml.getResponseHeader("x-rate-limit-limit"), 1585 remaining: xml.getResponseHeader("x-rate-limit-remaining"), 1586 reset: xml.getResponseHeader("x-rate-limit-reset") 1587 }; 1588 } 1589 if (typeof callback === "function") { 1590 callback(reply, rate); 1591 } 1592 if (dfd) { 1593 dfd.resolve({ reply: reply, rate: rate }); 1594 } 1595 } 1596 }; 1597 // function called when an error occurs, including a timeout 1598 xml.onerror = function (e) { 1599 if (typeof callback === "function") { 1600 callback(null, null, e); 1601 } 1602 if (dfd) { 1603 dfd.reject(e); 1604 } 1605 }; 1606 xml.timeout = 30000; // in milliseconds 1607 1608 xml.send(httpmethod === "GET" ? null : post_fields); 1609 if (dfd) { 1610 return this._getPromise(dfd); 1611 } 1612 return true; 1613 } 1614 1615 /** 1616 * Main API handler working on any requests you issue 1617 * 1618 * @param string fn The member function you called 1619 * @param array params The parameters you sent along 1620 * @param function callback The callback to call with the reply 1621 * @param bool app_only_auth Whether to use app-only auth 1622 * 1623 * @return object Promise 1624 */ 1625 1626 }, {
1627 key: "__call", 1628 value: function __call(fn) { 1629 var params = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 1630 var callback = arguments[2]; 1631 var app_only_auth = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; 1632 1633 if (typeof callback !== "function" && typeof params === "function") { 1634 callback = params; 1635 params = {}; 1636 if (typeof callback === "boolean") { 1637 app_only_auth = callback; 1638 } 1639 } else if (typeof callback === "undefined") { 1640 callback = function () {}; 1641 } 1642 switch (fn) { 1643 case "oauth_authenticate": 1644 case "oauth_authorize": 1645 return this[fn](params, callback); 1646 1647 case "oauth2_token": 1648 return this[fn](callback); 1649 } 1650 1651 // parse parameters 1652 var apiparams = this._parseApiParams(params); 1653 1654 // stringify null and boolean parameters 1655 apiparams = this._stringifyNullBoolParams(apiparams); 1656 1657 // reset token when requesting a new token (causes 401 for signature error on 2nd+ requests) 1658 if (fn === "oauth_requestToken") { 1659 this.setToken(null, null); 1660 } 1661 1662 // map function name to API method 1663 1664 var _mapFnToApiMethod2 = this._mapFnToApiMethod(fn, apiparams); 1665 1666 var _mapFnToApiMethod3 = _slicedToArray(_mapFnToApiMethod2, 2); 1667 1668 var method = _mapFnToApiMethod3[0]; 1669 var method_template = _mapFnToApiMethod3[1]; 1670 var httpmethod = this._detectMethod(method_template, apiparams); 1671 var multipart = this._detectMultipart(method_template); 1672 1673 return this._callApi(httpmethod, method, apiparams, multipart, app_only_auth, callback); 1674 } 1675 }]); 1676 1677 return Codebird; 1678 })(); 1679 1680 ; 1681 1682 if ((typeof module === "undefined" ? "undefined" : _typeof(module)) === "object" && module && _typeof(module.exports) === "object") { 1683 // Expose codebird as module.exports in loaders that implement the Node 1684 // module pattern (including browserify). Do not create the global, since 1685 // the user will be storing it themselves locally, and globals are frowned 1686 // upon in the Node module world. 1687 module.exports = Codebird; 1688 } else { 1689 // Otherwise expose codebird to the global object as usual 1690 if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && window) { 1691 window.Codebird = Codebird; 1692 } 1693 1694 // Register as a named AMD module, since codebird can be concatenated with other 1695 // files that may use define, but not via a proper concatenation script that 1696 // understands anonymous AMD modules. A named AMD is safest and most robust 1697 // way to register. Lowercase codebird is used because AMD module names are 1698 // derived from file names, and codebird is normally delivered in a lowercase 1699 // file name. Do this after creating the global so that if an AMD module wants 1700 // to call noConflict to hide this version of codebird, it will work. 1701 if (typeof define === "function" && define.amd) { 1702 define("codebird", [], function () { 1703 return Codebird; 1704 }); 1705 } 1706 } 1707})(); 1708// source --> https://nieruchomoscipafos.pl/wp-content/plugins/essential-addons-for-elementor-lite/assets/social-feeds/doT.min.js?ver=1.0 1709/* Laura Doktorova https://github.com/olado/doT */ 1710!function(){"use strict";function e(n,t,r){return("string"==typeof t?t:t.toString()).replace(n.define||a,function(e,t,o,a){return 0===t.indexOf("def.")&&(t=t.substring(4)),t in r||(":"===o?(n.defineParams&&a.replace(n.defineParams,function(e,n,o){r[t]={arg:n,text:o}}),t in r||(r[t]=a)):new Function("def","def['"+t+"']="+a)(r)),""}).replace(n.use||a,function(t,o){n.useParams&&(o=o.replace(n.useParams,function(e,n,t,o){if(r[t]&&r[t].arg&&o){var a=(t+":"+o).replace(/'|\\/g,"_");return r.__exp=r.__exp||{},r.__exp[a]=r[t].text.replace(new RegExp("(^|[^\\w$])"+r[t].arg+"([^\\w$])","g"),"$1"+o+"$2"),n+"def.__exp['"+a+"']"}}));var a=new Function("def","return "+o)(r);return a?e(n,a,r):a})}function n(e){return e.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var t,r={engine:"doT",version:"1.1.1",templateSettings:{evaluate:/\{\{([\s\S]+?(\}?)+)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:!0,append:!0,selfcontained:!1,doNotSkipEncoded:!1},template:void 0,compile:void 0,log:!0};r.encodeHTMLSource=function(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},t=e?/[&<>
1710"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(e){return e?e.toString().replace(t,function(e){return n[e]||e}):""}},t=function(){return this||(0,eval)("this")}(),"undefined"!=typeof module&&module.exports?module.exports=r:"function"==typeof define&&define.amd?define(function(){return r}):t.doT=r;var o={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},a=/$^/;r.template=function(c,i,u){i=i||r.templateSettings;var d,s,p=i.append?o.append:o.split,l=0,f=i.use||i.define?e(i,c,u||{}):c;f=("var out='"+(i.strip?f.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):f).replace(/'|\\/g,"\\$&").replace(i.interpolate||a,function(e,t){return p.start+n(t)+p.end}).replace(i.encode||a,function(e,t){return d=!0,p.startencode+n(t)+p.end}).replace(i.conditional||a,function(e,t,r){return t?r?"';}else if("+n(r)+"){out+='":"';}else{out+='":r?"';if("+n(r)+"){out+='":"';}out+='"}).replace(i.iterate||a,function(e,t,r,o){return t?(l+=1,s=o||"i"+l,t=n(t),"';var arr"+l+"="+t+";if(arr"+l+"){var "+r+","+s+"=-1,l"+l+"=arr"+l+".length-1;while("+s+"<l"+l+"){"+r+"=arr"+l+"["+s+"+=1];out+='"):"';} } out+='"}).replace(i.evaluate||a,function(e,t){return"';"+n(t)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,""),d&&(i.selfcontained||!t||t._encodeHTML||(t._encodeHTML=r.encodeHTMLSource(i.doNotSkipEncoded)),f="var encodeHTML = typeof _encodeHTML !== 'undefined' ? _encodeHTML : ("+r.encodeHTMLSource.toString()+"("+(i.doNotSkipEncoded||"")+"));"+f);try{return new Function(i.varname,f)}catch(e){throw"undefined"!=typeof console&&console.log("Could not create a template function: "+f),e}},r.compile=function(e,n){return r.template(e,null,n)}}(); 1711// source --> https://nieruchomoscipafos.pl/wp-content/plugins/essential-addons-for-elementor-lite/assets/social-feeds/moment.js?ver=1.0 1712//! moment.js 1713//! version : 2.19.3 1714//! authors : Tim Wood, Iskren Chernev, Moment.js contributors 1715//! license : MIT 1716//! momentjs.com 1717 1718;(function (global, factory) { 1719 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 1720 typeof define === 'function' && define.amd ? define(factory) : 1721 global.moment = factory() 1722}(this, (function () { 'use strict'; 1723 1724var hookCallback; 1725 1726function hooks () { 1727 return hookCallback.apply(null, arguments); 1728} 1729 1730// This is done to register the method called with moment() 1731// without creating circular dependencies. 1732function setHookCallback (callback) { 1733 hookCallback = callback; 1734} 1735 1736function isArray(input) { 1737 return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; 1738} 1739 1740function isObject(input) { 1741 // IE8 will treat undefined and null as object if it wasn't for 1742 // input != null 1743 return input != null && Object.prototype.toString.call(input) === '[object Object]'; 1744} 1745 1746function isObjectEmpty(obj) { 1747 if (Object.getOwnPropertyNames) { 1748 return (Object.getOwnPropertyNames(obj).length === 0); 1749 } else { 1750 var k; 1751 for (k in obj) { 1752 if (obj.hasOwnProperty(k)) { 1753 return false; 1754 } 1755 } 1756 return true; 1757 } 1758} 1759 1760function isUndefined(input) { 1761 return input === void 0; 1762} 1763 1764function isNumber(input) { 1765 return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; 1766} 1767 1768function isDate(input) { 1769 return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; 1770} 1771 1772function map(arr, fn) { 1773 var res = [], i; 1774 for (i = 0; i < arr.length; ++i) { 1775 res.push(fn(arr[i], i)); 1776 } 1777 return res; 1778} 1779 1780function hasOwnProp(a, b) { 1781 return Object.prototype.hasOwnProperty.call(a, b); 1782} 1783 1784function extend(a, b) { 1785 for (var i in b) { 1786 if (hasOwnProp(b, i)) { 1787 a[i] = b[i]; 1788 } 1789 } 1790 1791 if (hasOwnProp(b, 'toString')) { 1792 a.toString = b.toString; 1793 } 1794 1795 if (hasOwnProp(b, 'valueOf')) { 1796 a.valueOf = b.valueOf; 1797 } 1798 1799 return a; 1800} 1801 1802function createUTC (input, format, locale, strict) {
vendor: 21,998 bytes, lines 1803-2631
1803 return createLocalOrUTC(input, format, locale, strict, true).utc(); 1804} 1805 1806function defaultParsingFlags() { 1807 // We need to deep clone this object. 1808 return { 1809 empty : false, 1810 unusedTokens : [], 1811 unusedInput : [], 1812 overflow : -2, 1813 charsLeftOver : 0, 1814 nullInput : false, 1815 invalidMonth : null, 1816 invalidFormat : false, 1817 userInvalidated : false, 1818 iso : false, 1819 parsedDateParts : [], 1820 meridiem : null, 1821 rfc2822 : false, 1822 weekdayMismatch : false 1823 }; 1824} 1825 1826function getParsingFlags(m) { 1827 if (m._pf == null) { 1828 m._pf = defaultParsingFlags(); 1829 } 1830 return m._pf; 1831} 1832 1833var some; 1834if (Array.prototype.some) { 1835 some = Array.prototype.some; 1836} else { 1837 some = function (fun) { 1838 var t = Object(this); 1839 var len = t.length >>> 0; 1840 1841 for (var i = 0; i < len; i++) { 1842 if (i in t && fun.call(this, t[i], i, t)) { 1843 return true; 1844 } 1845 } 1846 1847 return false; 1848 }; 1849} 1850 1851function isValid(m) { 1852 if (m._isValid == null) { 1853 var flags = getParsingFlags(m); 1854 var parsedParts = some.call(flags.parsedDateParts, function (i) { 1855 return i != null; 1856 }); 1857 var isNowValid = !isNaN(m._d.getTime()) && 1858 flags.overflow < 0 && 1859 !flags.empty && 1860 !flags.invalidMonth && 1861 !flags.invalidWeekday && 1862 !flags.weekdayMismatch && 1863 !flags.nullInput && 1864 !flags.invalidFormat && 1865 !flags.userInvalidated && 1866 (!flags.meridiem || (flags.meridiem && parsedParts)); 1867 1868 if (m._strict) { 1869 isNowValid = isNowValid && 1870 flags.charsLeftOver === 0 && 1871 flags.unusedTokens.length === 0 && 1872 flags.bigHour === undefined; 1873 } 1874 1875 if (Object.isFrozen == null || !Object.isFrozen(m)) { 1876 m._isValid = isNowValid; 1877 } 1878 else { 1879 return isNowValid; 1880 } 1881 } 1882 return m._isValid; 1883} 1884 1885function createInvalid (flags) { 1886 var m = createUTC(NaN); 1887 if (flags != null) { 1888 extend(getParsingFlags(m), flags); 1889 } 1890 else { 1891 getParsingFlags(m).userInvalidated = true; 1892 } 1893 1894 return m; 1895} 1896 1897// Plugins that add properties should also add the key here (null value), 1898// so we can properly clone ourselves. 1899var momentProperties = hooks.momentProperties = []; 1900 1901function copyConfig(to, from) { 1902 var i, prop, val; 1903 1904 if (!isUndefined(from._isAMomentObject)) { 1905 to._isAMomentObject = from._isAMomentObject; 1906 } 1907 if (!isUndefined(from._i)) { 1908 to._i = from._i; 1909 } 1910 if (!isUndefined(from._f)) { 1911 to._f = from._f; 1912 } 1913 if (!isUndefined(from._l)) { 1914 to._l = from._l; 1915 } 1916 if (!isUndefined(from._strict)) { 1917 to._strict = from._strict; 1918 } 1919 if (!isUndefined(from._tzm)) { 1920 to._tzm = from._tzm; 1921 } 1922 if (!isUndefined(from._isUTC)) { 1923 to._isUTC = from._isUTC; 1924 } 1925 if (!isUndefined(from._offset)) { 1926 to._offset = from._offset; 1927 } 1928 if (!isUndefined(from._pf)) { 1929 to._pf = getParsingFlags(from); 1930 } 1931 if (!isUndefined(from._locale)) { 1932 to._locale = from._locale; 1933 } 1934 1935 if (momentProperties.length > 0) { 1936 for (i = 0; i < momentProperties.length; i++) { 1937 prop = momentProperties[i]; 1938 val = from[prop]; 1939 if (!isUndefined(val)) { 1940 to[prop] = val; 1941 } 1942 } 1943 } 1944 1945 return to; 1946} 1947 1948var updateInProgress = false; 1949 1950// Moment prototype object 1951function Moment(config) { 1952 copyConfig(this, config); 1953 this._d = new Date(config._d != null ? config._d.getTime() : NaN); 1954 if (!this.isValid()) { 1955 this._d = new Date(NaN); 1956 } 1957 // Prevent infinite loop in case updateOffset creates new moment 1958 // objects. 1959 if (updateInProgress === false) { 1960 updateInProgress = true; 1961 hooks.updateOffset(this); 1962 updateInProgress = false; 1963 } 1964} 1965 1966function isMoment (obj) { 1967 return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); 1968} 1969 1970function absFloor (number) { 1971 if (number < 0) { 1972 // -0 -> 0 1973 return Math.ceil(number) || 0; 1974 } else { 1975 return Math.floor(number); 1976 } 1977} 1978 1979function toInt(argumentForCoercion) { 1980 var coercedNumber = +argumentForCoercion, 1981 value = 0; 1982 1983 if (coercedNumber !== 0 && isFinite(coercedNumber)) { 1984 value = absFloor(coercedNumber); 1985 } 1986 1987 return value; 1988} 1989 1990// compare two arrays, return the number of differences 1991function compareArrays(array1, array2, dontConvert) { 1992 var len = Math.min(array1.length, array2.length), 1993 lengthDiff = Math.abs(array1.length - array2.length), 1994 diffs = 0, 1995 i; 1996 for (i = 0; i < len; i++) { 1997 if ((dontConvert && array1[i] !== array2[i]) || 1998 (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { 1999 diffs++; 2000 } 2001 } 2002 return diffs + lengthDiff; 2003} 2004 2005function warn(msg) { 2006 if (hooks.suppressDeprecationWarnings === false && 2007 (typeof console !== 'undefined') && console.warn) { 2008 console.warn('Deprecation warning: ' + msg); 2009 } 2010} 2011 2012function deprecate(msg, fn) { 2013 var firstTime = true; 2014 2015 return extend(function () { 2016 if (hooks.deprecationHandler != null) { 2017 hooks.deprecationHandler(null, msg); 2018 } 2019 if (firstTime) { 2020 var args = []; 2021 var arg; 2022 for (var i = 0; i < arguments.length; i++) { 2023 arg = ''; 2024 if (typeof arguments[i] === 'object') { 2025 arg += '\n[' + i + '] '; 2026 for (var key in arguments[0]) { 2027 arg += key + ': ' + arguments[0][key] + ', '; 2028 } 2029 arg = arg.slice(0, -2); // Remove trailing comma and space 2030 } else { 2031 arg = arguments[i]; 2032 } 2033 args.push(arg); 2034 } 2035 warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack); 2036 firstTime = false; 2037 } 2038 return fn.apply(this, arguments); 2039 }, fn); 2040} 2041 2042var deprecations = {}; 2043 2044function deprecateSimple(name, msg) { 2045 if (hooks.deprecationHandler != null) { 2046 hooks.deprecationHandler(name, msg); 2047 } 2048 if (!deprecations[name]) { 2049 warn(msg); 2050 deprecations[name] = true; 2051 } 2052} 2053 2054hooks.suppressDeprecationWarnings = false; 2055hooks.deprecationHandler = null; 2056 2057function isFunction(input) { 2058 return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; 2059} 2060 2061function set (config) { 2062 var prop, i; 2063 for (i in config) { 2064 prop = config[i]; 2065 if (isFunction(prop)) { 2066 this[i] = prop; 2067 } else { 2068 this['_' + i] = prop; 2069 } 2070 } 2071 this._config = config; 2072 // Lenient ordinal parsing accepts just a number in addition to 2073 // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. 2074 // TODO: Remove "ordinalParse" fallback in next major release. 2075 this._dayOfMonthOrdinalParseLenient = new RegExp( 2076 (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + 2077 '|' + (/\d{1,2}/).source); 2078} 2079 2080function mergeConfigs(parentConfig, childConfig) { 2081 var res = extend({}, parentConfig), prop; 2082 for (prop in childConfig) { 2083 if (hasOwnProp(childConfig, prop)) { 2084 if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { 2085 res[prop] = {}; 2086 extend(res[prop], parentConfig[prop]); 2087 extend(res[prop], childConfig[prop]); 2088 } else if (childConfig[prop] != null) { 2089 res[prop] = childConfig[prop]; 2090 } else { 2091 delete res[prop]; 2092 } 2093 } 2094 } 2095 for (prop in parentConfig) { 2096 if (hasOwnProp(parentConfig, prop) && 2097 !hasOwnProp(childConfig, prop) && 2098 isObject(parentConfig[prop])) { 2099 // make sure changes to properties don't modify parent config 2100 res[prop] = extend({}, res[prop]); 2101 } 2102 } 2103 return res; 2104} 2105 2106function Locale(config) { 2107 if (config != null) { 2108 this.set(config); 2109 } 2110} 2111 2112var keys; 2113 2114if (Object.keys) { 2115 keys = Object.keys; 2116} else { 2117 keys = function (obj) { 2118 var i, res = []; 2119 for (i in obj) { 2120 if (hasOwnProp(obj, i)) { 2121 res.push(i); 2122 } 2123 } 2124 return res; 2125 }; 2126} 2127 2128var defaultCalendar = { 2129 sameDay : '[Today at] LT', 2130 nextDay : '[Tomorrow at] LT', 2131 nextWeek : 'dddd [at] LT', 2132 lastDay : '[Yesterday at] LT', 2133 lastWeek : '[Last] dddd [at] LT', 2134 sameElse : 'L' 2135}; 2136 2137function calendar (key, mom, now) { 2138 var output = this._calendar[key] || this._calendar['sameElse']; 2139 return isFunction(output) ? output.call(mom, now) : output; 2140} 2141 2142var defaultLongDateFormat = { 2143 LTS : 'h:mm:ss A', 2144 LT : 'h:mm A', 2145 L : 'MM/DD/YYYY', 2146 LL : 'MMMM D, YYYY', 2147 LLL : 'MMMM D, YYYY h:mm A', 2148 LLLL : 'dddd, MMMM D, YYYY h:mm A' 2149}; 2150 2151function longDateFormat (key) { 2152 var format = this._longDateFormat[key], 2153 formatUpper = this._longDateFormat[key.toUpperCase()]; 2154 2155 if (format || !formatUpper) { 2156 return format; 2157 } 2158 2159 this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { 2160 return val.slice(1); 2161 }); 2162 2163 return this._longDateFormat[key]; 2164} 2165 2166var defaultInvalidDate = 'Invalid date'; 2167 2168function invalidDate () { 2169 return this._invalidDate; 2170} 2171 2172var defaultOrdinal = '%d'; 2173var defaultDayOfMonthOrdinalParse = /\d{1,2}/; 2174 2175function ordinal (number) { 2176 return this._ordinal.replace('%d', number); 2177} 2178 2179var defaultRelativeTime = { 2180 future : 'in %s', 2181 past : '%s ago', 2182 s : 'a few seconds', 2183 ss : '%d seconds', 2184 m : 'a minute', 2185 mm : '%d minutes', 2186 h : 'an hour', 2187 hh : '%d hours', 2188 d : 'a day', 2189 dd : '%d days', 2190 M : 'a month', 2191 MM : '%d months', 2192 y : 'a year', 2193 yy : '%d years' 2194}; 2195 2196function relativeTime (number, withoutSuffix, string, isFuture) { 2197 var output = this._relativeTime[string]; 2198 return (isFunction(output)) ? 2199 output(number, withoutSuffix, string, isFuture) : 2200 output.replace(/%d/i, number); 2201} 2202 2203function pastFuture (diff, output) { 2204 var format = this._relativeTime[diff > 0 ? 'future' : 'past']; 2205 return isFunction(format) ? format(output) : format.replace(/%s/i, output); 2206} 2207 2208var aliases = {}; 2209 2210function addUnitAlias (unit, shorthand) { 2211 var lowerCase = unit.toLowerCase(); 2212 aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; 2213} 2214 2215function normalizeUnits(units) { 2216 return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; 2217} 2218 2219function normalizeObjectUnits(inputObject) { 2220 var normalizedInput = {}, 2221 normalizedProp, 2222 prop; 2223 2224 for (prop in inputObject) { 2225 if (hasOwnProp(inputObject, prop)) { 2226 normalizedProp = normalizeUnits(prop); 2227 if (normalizedProp) { 2228 normalizedInput[normalizedProp] = inputObject[prop]; 2229 } 2230 } 2231 } 2232 2233 return normalizedInput; 2234} 2235 2236var priorities = {}; 2237 2238function addUnitPriority(unit, priority) { 2239 priorities[unit] = priority; 2240} 2241 2242function getPrioritizedUnits(unitsObj) { 2243 var units = []; 2244 for (var u in unitsObj) { 2245 units.push({unit: u, priority: priorities[u]}); 2246 } 2247 units.sort(function (a, b) { 2248 return a.priority - b.priority; 2249 }); 2250 return units; 2251} 2252 2253function zeroFill(number, targetLength, forceSign) { 2254 var absNumber = '' + Math.abs(number), 2255 zerosToFill = targetLength - absNumber.length, 2256 sign = number >= 0; 2257 return (sign ? (forceSign ? '+' : '') : '-') + 2258 Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; 2259} 2260 2261var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; 2262 2263var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; 2264 2265var formatFunctions = {}; 2266 2267var formatTokenFunctions = {}; 2268 2269// token: 'M' 2270// padded: ['MM', 2] 2271// ordinal: 'Mo' 2272// callback: function () { this.month() + 1 } 2273function addFormatToken (token, padded, ordinal, callback) { 2274 var func = callback; 2275 if (typeof callback === 'string') { 2276 func = function () { 2277 return this[callback](); 2278 }; 2279 } 2280 if (token) { 2281 formatTokenFunctions[token] = func; 2282 } 2283 if (padded) { 2284 formatTokenFunctions[padded[0]] = function () { 2285 return zeroFill(func.apply(this, arguments), padded[1], padded[2]); 2286 }; 2287 } 2288 if (ordinal) { 2289 formatTokenFunctions[ordinal] = function () { 2290 return this.localeData().ordinal(func.apply(this, arguments), token); 2291 }; 2292 } 2293} 2294 2295function removeFormattingTokens(input) { 2296 if (input.match(/\[[\s\S]/)) { 2297 return input.replace(/^\[|\]$/g, ''); 2298 } 2299 return input.replace(/\\/g, ''); 2300} 2301 2302function makeFormatFunction(format) { 2303 var array = format.match(formattingTokens), i, length; 2304 2305 for (i = 0, length = array.length; i < length; i++) { 2306 if (formatTokenFunctions[array[i]]) { 2307 array[i] = formatTokenFunctions[array[i]]; 2308 } else { 2309 array[i] = removeFormattingTokens(array[i]); 2310 } 2311 } 2312 2313 return function (mom) { 2314 var output = '', i; 2315 for (i = 0; i < length; i++) { 2316 output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; 2317 } 2318 return output; 2319 }; 2320} 2321 2322// format date using native date object 2323function formatMoment(m, format) { 2324 if (!m.isValid()) { 2325 return m.localeData().invalidDate(); 2326 } 2327 2328 format = expandFormat(format, m.localeData()); 2329 formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); 2330 2331 return formatFunctions[format](m); 2332} 2333 2334function expandFormat(format, locale) { 2335 var i = 5; 2336 2337 function replaceLongDateFormatTokens(input) { 2338 return locale.longDateFormat(input) || input; 2339 } 2340 2341 localFormattingTokens.lastIndex = 0; 2342 while (i >= 0 && localFormattingTokens.test(format)) { 2343 format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); 2344 localFormattingTokens.lastIndex = 0; 2345 i -= 1; 2346 } 2347 2348 return format; 2349} 2350 2351var match1 = /\d/; // 0 - 9 2352var match2 = /\d\d/; // 00 - 99 2353var match3 = /\d{3}/; // 000 - 999 2354var match4 = /\d{4}/; // 0000 - 9999 2355var match6 = /[+-]?\d{6}/; // -999999 - 999999 2356var match1to2 = /\d\d?/; // 0 - 99 2357var match3to4 = /\d\d\d\d?/; // 999 - 9999 2358var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 2359var match1to3 = /\d{1,3}/; // 0 - 999 2360var match1to4 = /\d{1,4}/; // 0 - 9999 2361var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 2362 2363var matchUnsigned = /\d+/; // 0 - inf 2364var matchSigned = /[+-]?\d+/; // -inf - inf 2365 2366var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z 2367var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z 2368 2369var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 2370 2371// any word (or two) characters or numbers including two/three word month in arabic. 2372// includes scottish gaelic two word and hyphenated months 2373var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i; 2374 2375 2376var regexes = {}; 2377 2378function addRegexToken (token, regex, strictRegex) { 2379 regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { 2380 return (isStrict && strictRegex) ? strictRegex : regex; 2381 }; 2382} 2383 2384function getParseRegexForToken (token, config) { 2385 if (!hasOwnProp(regexes, token)) { 2386 return new RegExp(unescapeFormat(token)); 2387 } 2388 2389 return regexes[token](config._strict, config._locale); 2390} 2391 2392// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript 2393function unescapeFormat(s) { 2394 return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { 2395 return p1 || p2 || p3 || p4; 2396 })); 2397} 2398 2399function regexEscape(s) { 2400 return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); 2401} 2402 2403var tokens = {}; 2404 2405function addParseToken (token, callback) { 2406 var i, func = callback; 2407 if (typeof token === 'string') { 2408 token = [token]; 2409 } 2410 if (isNumber(callback)) { 2411 func = function (input, array) { 2412 array[callback] = toInt(input); 2413 }; 2414 } 2415 for (i = 0; i < token.length; i++) { 2416 tokens[token[i]] = func; 2417 } 2418} 2419 2420function addWeekParseToken (token, callback) { 2421 addParseToken(token, function (input, array, config, token) { 2422 config._w = config._w || {}; 2423 callback(input, config._w, config, token); 2424 }); 2425} 2426 2427function addTimeToArrayFromToken(token, input, config) { 2428 if (input != null && hasOwnProp(tokens, token)) { 2429 tokens[token](input, config._a, config, token); 2430 } 2431} 2432 2433var YEAR = 0; 2434var MONTH = 1; 2435var DATE = 2; 2436var HOUR = 3; 2437var MINUTE = 4; 2438var SECOND = 5; 2439var MILLISECOND = 6; 2440var WEEK = 7; 2441var WEEKDAY = 8; 2442 2443// FORMATTING 2444 2445addFormatToken('Y', 0, 0, function () { 2446 var y = this.year(); 2447 return y <= 9999 ? '' + y : '+' + y; 2448}); 2449 2450addFormatToken(0, ['YY', 2], 0, function () { 2451 return this.year() % 100; 2452}); 2453 2454addFormatToken(0, ['YYYY', 4], 0, 'year'); 2455addFormatToken(0, ['YYYYY', 5], 0, 'year'); 2456addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); 2457 2458// ALIASES 2459 2460addUnitAlias('year', 'y'); 2461 2462// PRIORITIES 2463 2464addUnitPriority('year', 1); 2465 2466// PARSING 2467 2468addRegexToken('Y', matchSigned); 2469addRegexToken('YY', match1to2, match2); 2470addRegexToken('YYYY', match1to4, match4); 2471addRegexToken('YYYYY', match1to6, match6); 2472addRegexToken('YYYYYY', match1to6, match6); 2473 2474addParseToken(['YYYYY', 'YYYYYY'], YEAR); 2475addParseToken('YYYY', function (input, array) { 2476 array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); 2477}); 2478addParseToken('YY', function (input, array) { 2479 array[YEAR] = hooks.parseTwoDigitYear(input); 2480}); 2481addParseToken('Y', function (input, array) { 2482 array[YEAR] = parseInt(input, 10); 2483}); 2484 2485// HELPERS 2486 2487function daysInYear(year) { 2488 return isLeapYear(year) ? 366 : 365; 2489} 2490 2491function isLeapYear(year) { 2492 return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; 2493} 2494 2495// HOOKS 2496 2497hooks.parseTwoDigitYear = function (input) { 2498 return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); 2499}; 2500 2501// MOMENTS 2502 2503var getSetYear = makeGetSet('FullYear', true); 2504 2505function getIsLeapYear () { 2506 return isLeapYear(this.year()); 2507} 2508 2509function makeGetSet (unit, keepTime) { 2510 return function (value) { 2511 if (value != null) { 2512 set$1(this, unit, value); 2513 hooks.updateOffset(this, keepTime); 2514 return this; 2515 } else { 2516 return get(this, unit); 2517 } 2518 }; 2519} 2520 2521function get (mom, unit) { 2522 return mom.isValid() ? 2523 mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; 2524} 2525 2526function set$1 (mom, unit, value) { 2527 if (mom.isValid() && !isNaN(value)) { 2528 if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { 2529 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month())); 2530 } 2531 else { 2532 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); 2533 } 2534 } 2535} 2536 2537// MOMENTS 2538 2539function stringGet (units) { 2540 units = normalizeUnits(units); 2541 if (isFunction(this[units])) { 2542 return this[units](); 2543 } 2544 return this; 2545} 2546 2547 2548function stringSet (units, value) { 2549 if (typeof units === 'object') { 2550 units = normalizeObjectUnits(units); 2551 var prioritized = getPrioritizedUnits(units); 2552 for (var i = 0; i < prioritized.length; i++) { 2553 this[prioritized[i].unit](units[prioritized[i].unit]); 2554 } 2555 } else { 2556 units = normalizeUnits(units); 2557 if (isFunction(this[units])) { 2558 return this[units](value); 2559 } 2560 } 2561 return this; 2562} 2563 2564function mod(n, x) { 2565 return ((n % x) + x) % x; 2566} 2567 2568var indexOf; 2569 2570if (Array.prototype.indexOf) { 2571 indexOf = Array.prototype.indexOf; 2572} else { 2573 indexOf = function (o) { 2574 // I know 2575 var i; 2576 for (i = 0; i < this.length; ++i) { 2577 if (this[i] === o) { 2578 return i; 2579 } 2580 } 2581 return -1; 2582 }; 2583} 2584 2585function daysInMonth(year, month) { 2586 if (isNaN(year) || isNaN(month)) { 2587 return NaN; 2588 } 2589 var modMonth = mod(month, 12); 2590 year += (month - modMonth) / 12; 2591 return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2); 2592} 2593 2594// FORMATTING 2595 2596addFormatToken('M', ['MM', 2], 'Mo', function () { 2597 return this.month() + 1; 2598}); 2599 2600addFormatToken('MMM', 0, 0, function (format) { 2601 return this.localeData().monthsShort(this, format); 2602}); 2603 2604addFormatToken('MMMM', 0, 0, function (format) { 2605 return this.localeData().months(this, format); 2606}); 2607 2608// ALIASES 2609 2610addUnitAlias('month', 'M'); 2611 2612// PRIORITY 2613 2614addUnitPriority('month', 8); 2615 2616// PARSING 2617 2618addRegexToken('M', match1to2); 2619addRegexToken('MM', match1to2, match2); 2620addRegexToken('MMM', function (isStrict, locale) { 2621 return locale.monthsShortRegex(isStrict); 2622}); 2623addRegexToken('MMMM', function (isStrict, locale) { 2624 return locale.monthsRegex(isStrict); 2625}); 2626 2627addParseToken(['M', 'MM'], function (input, array) { 2628 array[MONTH] = toInt(input) - 1; 2629}); 2630 2631addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
vendor: 24,092 bytes, lines 2632-3416
2632 var month = config._locale.monthsParse(input, token, config._strict); 2633 // if we didn't find a month name, mark the date as invalid. 2634 if (month != null) { 2635 array[MONTH] = month; 2636 } else { 2637 getParsingFlags(config).invalidMonth = input; 2638 } 2639}); 2640 2641// LOCALES 2642 2643var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/; 2644var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); 2645function localeMonths (m, format) { 2646 if (!m) { 2647 return isArray(this._months) ? this._months : 2648 this._months['standalone']; 2649 } 2650 return isArray(this._months) ? this._months[m.month()] : 2651 this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()]; 2652} 2653 2654var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); 2655function localeMonthsShort (m, format) { 2656 if (!m) { 2657 return isArray(this._monthsShort) ? this._monthsShort : 2658 this._monthsShort['standalone']; 2659 } 2660 return isArray(this._monthsShort) ? this._monthsShort[m.month()] : 2661 this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; 2662} 2663 2664function handleStrictParse(monthName, format, strict) { 2665 var i, ii, mom, llc = monthName.toLocaleLowerCase(); 2666 if (!this._monthsParse) { 2667 // this is not used 2668 this._monthsParse = []; 2669 this._longMonthsParse = []; 2670 this._shortMonthsParse = []; 2671 for (i = 0; i < 12; ++i) { 2672 mom = createUTC([2000, i]); 2673 this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); 2674 this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); 2675 } 2676 } 2677 2678 if (strict) { 2679 if (format === 'MMM') { 2680 ii = indexOf.call(this._shortMonthsParse, llc); 2681 return ii !== -1 ? ii : null; 2682 } else { 2683 ii = indexOf.call(this._longMonthsParse, llc); 2684 return ii !== -1 ? ii : null; 2685 } 2686 } else { 2687 if (format === 'MMM') { 2688 ii = indexOf.call(this._shortMonthsParse, llc); 2689 if (ii !== -1) { 2690 return ii; 2691 } 2692 ii = indexOf.call(this._longMonthsParse, llc); 2693 return ii !== -1 ? ii : null; 2694 } else { 2695 ii = indexOf.call(this._longMonthsParse, llc); 2696 if (ii !== -1) { 2697 return ii; 2698 } 2699 ii = indexOf.call(this._shortMonthsParse, llc); 2700 return ii !== -1 ? ii : null; 2701 } 2702 } 2703} 2704 2705function localeMonthsParse (monthName, format, strict) { 2706 var i, mom, regex; 2707 2708 if (this._monthsParseExact) { 2709 return handleStrictParse.call(this, monthName, format, strict); 2710 } 2711 2712 if (!this._monthsParse) { 2713 this._monthsParse = []; 2714 this._longMonthsParse = []; 2715 this._shortMonthsParse = []; 2716 } 2717 2718 // TODO: add sorting 2719 // Sorting makes sure if one month (or abbr) is a prefix of another 2720 // see sorting in computeMonthsParse 2721 for (i = 0; i < 12; i++) { 2722 // make the regex if we don't have it already 2723 mom = createUTC([2000, i]); 2724 if (strict && !this._longMonthsParse[i]) { 2725 this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); 2726 this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); 2727 } 2728 if (!strict && !this._monthsParse[i]) { 2729 regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); 2730 this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); 2731 } 2732 // test the regex 2733 if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { 2734 return i; 2735 } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { 2736 return i; 2737 } else if (!strict && this._monthsParse[i].test(monthName)) { 2738 return i; 2739 } 2740 } 2741} 2742 2743// MOMENTS 2744 2745function setMonth (mom, value) { 2746 var dayOfMonth; 2747 2748 if (!mom.isValid()) { 2749 // No op 2750 return mom; 2751 } 2752 2753 if (typeof value === 'string') { 2754 if (/^\d+$/.test(value)) { 2755 value = toInt(value); 2756 } else { 2757 value = mom.localeData().monthsParse(value); 2758 // TODO: Another silent failure? 2759 if (!isNumber(value)) { 2760 return mom; 2761 } 2762 } 2763 } 2764 2765 dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); 2766 mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); 2767 return mom; 2768} 2769 2770function getSetMonth (value) { 2771 if (value != null) { 2772 setMonth(this, value); 2773 hooks.updateOffset(this, true); 2774 return this; 2775 } else { 2776 return get(this, 'Month'); 2777 } 2778} 2779 2780function getDaysInMonth () { 2781 return daysInMonth(this.year(), this.month()); 2782} 2783 2784var defaultMonthsShortRegex = matchWord; 2785function monthsShortRegex (isStrict) { 2786 if (this._monthsParseExact) { 2787 if (!hasOwnProp(this, '_monthsRegex')) { 2788 computeMonthsParse.call(this); 2789 } 2790 if (isStrict) { 2791 return this._monthsShortStrictRegex; 2792 } else { 2793 return this._monthsShortRegex; 2794 } 2795 } else { 2796 if (!hasOwnProp(this, '_monthsShortRegex')) { 2797 this._monthsShortRegex = defaultMonthsShortRegex; 2798 } 2799 return this._monthsShortStrictRegex && isStrict ? 2800 this._monthsShortStrictRegex : this._monthsShortRegex; 2801 } 2802} 2803 2804var defaultMonthsRegex = matchWord; 2805function monthsRegex (isStrict) { 2806 if (this._monthsParseExact) { 2807 if (!hasOwnProp(this, '_monthsRegex')) { 2808 computeMonthsParse.call(this); 2809 } 2810 if (isStrict) { 2811 return this._monthsStrictRegex; 2812 } else { 2813 return this._monthsRegex; 2814 } 2815 } else { 2816 if (!hasOwnProp(this, '_monthsRegex')) { 2817 this._monthsRegex = defaultMonthsRegex; 2818 } 2819 return this._monthsStrictRegex && isStrict ? 2820 this._monthsStrictRegex : this._monthsRegex; 2821 } 2822} 2823 2824function computeMonthsParse () { 2825 function cmpLenRev(a, b) { 2826 return b.length - a.length; 2827 } 2828 2829 var shortPieces = [], longPieces = [], mixedPieces = [], 2830 i, mom; 2831 for (i = 0; i < 12; i++) { 2832 // make the regex if we don't have it already 2833 mom = createUTC([2000, i]); 2834 shortPieces.push(this.monthsShort(mom, '')); 2835 longPieces.push(this.months(mom, '')); 2836 mixedPieces.push(this.months(mom, '')); 2837 mixedPieces.push(this.monthsShort(mom, '')); 2838 } 2839 // Sorting makes sure if one month (or abbr) is a prefix of another it 2840 // will match the longer piece. 2841 shortPieces.sort(cmpLenRev); 2842 longPieces.sort(cmpLenRev); 2843 mixedPieces.sort(cmpLenRev); 2844 for (i = 0; i < 12; i++) { 2845 shortPieces[i] = regexEscape(shortPieces[i]); 2846 longPieces[i] = regexEscape(longPieces[i]); 2847 } 2848 for (i = 0; i < 24; i++) { 2849 mixedPieces[i] = regexEscape(mixedPieces[i]); 2850 } 2851 2852 this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 2853 this._monthsShortRegex = this._monthsRegex; 2854 this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); 2855 this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); 2856} 2857 2858function createDate (y, m, d, h, M, s, ms) { 2859 // can't just apply() to create a date: 2860 // https://stackoverflow.com/q/181348 2861 var date = new Date(y, m, d, h, M, s, ms); 2862 2863 // the date constructor remaps years 0-99 to 1900-1999 2864 if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { 2865 date.setFullYear(y); 2866 } 2867 return date; 2868} 2869 2870function createUTCDate (y) { 2871 var date = new Date(Date.UTC.apply(null, arguments)); 2872 2873 // the Date.UTC function remaps years 0-99 to 1900-1999 2874 if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { 2875 date.setUTCFullYear(y); 2876 } 2877 return date; 2878} 2879 2880// start-of-first-week - start-of-year 2881function firstWeekOffset(year, dow, doy) { 2882 var // first-week day -- which january is always in the first week (4 for iso, 1 for other) 2883 fwd = 7 + dow - doy, 2884 // first-week day local weekday -- which local weekday is fwd 2885 fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; 2886 2887 return -fwdlw + fwd - 1; 2888} 2889 2890// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday 2891function dayOfYearFromWeeks(year, week, weekday, dow, doy) { 2892 var localWeekday = (7 + weekday - dow) % 7, 2893 weekOffset = firstWeekOffset(year, dow, doy), 2894 dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, 2895 resYear, resDayOfYear; 2896 2897 if (dayOfYear <= 0) { 2898 resYear = year - 1; 2899 resDayOfYear = daysInYear(resYear) + dayOfYear; 2900 } else if (dayOfYear > daysInYear(year)) { 2901 resYear = year + 1; 2902 resDayOfYear = dayOfYear - daysInYear(year); 2903 } else { 2904 resYear = year; 2905 resDayOfYear = dayOfYear; 2906 } 2907 2908 return { 2909 year: resYear, 2910 dayOfYear: resDayOfYear 2911 }; 2912} 2913 2914function weekOfYear(mom, dow, doy) { 2915 var weekOffset = firstWeekOffset(mom.year(), dow, doy), 2916 week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, 2917 resWeek, resYear; 2918 2919 if (week < 1) { 2920 resYear = mom.year() - 1; 2921 resWeek = week + weeksInYear(resYear, dow, doy); 2922 } else if (week > weeksInYear(mom.year(), dow, doy)) { 2923 resWeek = week - weeksInYear(mom.year(), dow, doy); 2924 resYear = mom.year() + 1; 2925 } else { 2926 resYear = mom.year(); 2927 resWeek = week; 2928 } 2929 2930 return { 2931 week: resWeek, 2932 year: resYear 2933 }; 2934} 2935 2936function weeksInYear(year, dow, doy) { 2937 var weekOffset = firstWeekOffset(year, dow, doy), 2938 weekOffsetNext = firstWeekOffset(year + 1, dow, doy); 2939 return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; 2940} 2941 2942// FORMATTING 2943 2944addFormatToken('w', ['ww', 2], 'wo', 'week'); 2945addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); 2946 2947// ALIASES 2948 2949addUnitAlias('week', 'w'); 2950addUnitAlias('isoWeek', 'W'); 2951 2952// PRIORITIES 2953 2954addUnitPriority('week', 5); 2955addUnitPriority('isoWeek', 5); 2956 2957// PARSING 2958 2959addRegexToken('w', match1to2); 2960addRegexToken('ww', match1to2, match2); 2961addRegexToken('W', match1to2); 2962addRegexToken('WW', match1to2, match2); 2963 2964addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { 2965 week[token.substr(0, 1)] = toInt(input); 2966}); 2967 2968// HELPERS 2969 2970// LOCALES 2971 2972function localeWeek (mom) { 2973 return weekOfYear(mom, this._week.dow, this._week.doy).week; 2974} 2975 2976var defaultLocaleWeek = { 2977 dow : 0, // Sunday is the first day of the week. 2978 doy : 6 // The week that contains Jan 1st is the first week of the year. 2979}; 2980 2981function localeFirstDayOfWeek () { 2982 return this._week.dow; 2983} 2984 2985function localeFirstDayOfYear () { 2986 return this._week.doy; 2987} 2988 2989// MOMENTS 2990 2991function getSetWeek (input) { 2992 var week = this.localeData().week(this); 2993 return input == null ? week : this.add((input - week) * 7, 'd'); 2994} 2995 2996function getSetISOWeek (input) { 2997 var week = weekOfYear(this, 1, 4).week; 2998 return input == null ? week : this.add((input - week) * 7, 'd'); 2999} 3000 3001// FORMATTING 3002 3003addFormatToken('d', 0, 'do', 'day'); 3004 3005addFormatToken('dd', 0, 0, function (format) { 3006 return this.localeData().weekdaysMin(this, format); 3007}); 3008 3009addFormatToken('ddd', 0, 0, function (format) { 3010 return this.localeData().weekdaysShort(this, format); 3011}); 3012 3013addFormatToken('dddd', 0, 0, function (format) { 3014 return this.localeData().weekdays(this, format); 3015}); 3016 3017addFormatToken('e', 0, 0, 'weekday'); 3018addFormatToken('E', 0, 0, 'isoWeekday'); 3019 3020// ALIASES 3021 3022addUnitAlias('day', 'd'); 3023addUnitAlias('weekday', 'e'); 3024addUnitAlias('isoWeekday', 'E'); 3025 3026// PRIORITY 3027addUnitPriority('day', 11); 3028addUnitPriority('weekday', 11); 3029addUnitPriority('isoWeekday', 11); 3030 3031// PARSING 3032 3033addRegexToken('d', match1to2); 3034addRegexToken('e', match1to2); 3035addRegexToken('E', match1to2); 3036addRegexToken('dd', function (isStrict, locale) { 3037 return locale.weekdaysMinRegex(isStrict); 3038}); 3039addRegexToken('ddd', function (isStrict, locale) { 3040 return locale.weekdaysShortRegex(isStrict); 3041}); 3042addRegexToken('dddd', function (isStrict, locale) { 3043 return locale.weekdaysRegex(isStrict); 3044}); 3045 3046addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { 3047 var weekday = config._locale.weekdaysParse(input, token, config._strict); 3048 // if we didn't get a weekday name, mark the date as invalid 3049 if (weekday != null) { 3050 week.d = weekday; 3051 } else { 3052 getParsingFlags(config).invalidWeekday = input; 3053 } 3054}); 3055 3056addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { 3057 week[token] = toInt(input); 3058}); 3059 3060// HELPERS 3061 3062function parseWeekday(input, locale) { 3063 if (typeof input !== 'string') { 3064 return input; 3065 } 3066 3067 if (!isNaN(input)) { 3068 return parseInt(input, 10); 3069 } 3070 3071 input = locale.weekdaysParse(input); 3072 if (typeof input === 'number') { 3073 return input; 3074 } 3075 3076 return null; 3077} 3078 3079function parseIsoWeekday(input, locale) { 3080 if (typeof input === 'string') { 3081 return locale.weekdaysParse(input) % 7 || 7; 3082 } 3083 return isNaN(input) ? null : input; 3084} 3085 3086// LOCALES 3087 3088var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); 3089function localeWeekdays (m, format) { 3090 if (!m) { 3091 return isArray(this._weekdays) ? this._weekdays : 3092 this._weekdays['standalone']; 3093 } 3094 return isArray(this._weekdays) ? this._weekdays[m.day()] : 3095 this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; 3096} 3097 3098var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); 3099function localeWeekdaysShort (m) { 3100 return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort; 3101} 3102 3103var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); 3104function localeWeekdaysMin (m) { 3105 return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin; 3106} 3107 3108function handleStrictParse$1(weekdayName, format, strict) { 3109 var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); 3110 if (!this._weekdaysParse) { 3111 this._weekdaysParse = []; 3112 this._shortWeekdaysParse = []; 3113 this._minWeekdaysParse = []; 3114 3115 for (i = 0; i < 7; ++i) { 3116 mom = createUTC([2000, 1]).day(i); 3117 this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); 3118 this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); 3119 this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); 3120 } 3121 } 3122 3123 if (strict) { 3124 if (format === 'dddd') { 3125 ii = indexOf.call(this._weekdaysParse, llc); 3126 return ii !== -1 ? ii : null; 3127 } else if (format === 'ddd') { 3128 ii = indexOf.call(this._shortWeekdaysParse, llc); 3129 return ii !== -1 ? ii : null; 3130 } else { 3131 ii = indexOf.call(this._minWeekdaysParse, llc); 3132 return ii !== -1 ? ii : null; 3133 } 3134 } else { 3135 if (format === 'dddd') { 3136 ii = indexOf.call(this._weekdaysParse, llc); 3137 if (ii !== -1) { 3138 return ii; 3139 } 3140 ii = indexOf.call(this._shortWeekdaysParse, llc); 3141 if (ii !== -1) { 3142 return ii; 3143 } 3144 ii = indexOf.call(this._minWeekdaysParse, llc); 3145 return ii !== -1 ? ii : null; 3146 } else if (format === 'ddd') { 3147 ii = indexOf.call(this._shortWeekdaysParse, llc); 3148 if (ii !== -1) { 3149 return ii; 3150 } 3151 ii = indexOf.call(this._weekdaysParse, llc); 3152 if (ii !== -1) { 3153 return ii; 3154 } 3155 ii = indexOf.call(this._minWeekdaysParse, llc); 3156 return ii !== -1 ? ii : null; 3157 } else { 3158 ii = indexOf.call(this._minWeekdaysParse, llc); 3159 if (ii !== -1) { 3160 return ii; 3161 } 3162 ii = indexOf.call(this._weekdaysParse, llc); 3163 if (ii !== -1) { 3164 return ii; 3165 } 3166 ii = indexOf.call(this._shortWeekdaysParse, llc); 3167 return ii !== -1 ? ii : null; 3168 } 3169 } 3170} 3171 3172function localeWeekdaysParse (weekdayName, format, strict) { 3173 var i, mom, regex; 3174 3175 if (this._weekdaysParseExact) { 3176 return handleStrictParse$1.call(this, weekdayName, format, strict); 3177 } 3178 3179 if (!this._weekdaysParse) { 3180 this._weekdaysParse = []; 3181 this._minWeekdaysParse = []; 3182 this._shortWeekdaysParse = []; 3183 this._fullWeekdaysParse = []; 3184 } 3185 3186 for (i = 0; i < 7; i++) { 3187 // make the regex if we don't have it already 3188 3189 mom = createUTC([2000, 1]).day(i); 3190 if (strict && !this._fullWeekdaysParse[i]) { 3191 this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); 3192 this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); 3193 this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); 3194 } 3195 if (!this._weekdaysParse[i]) { 3196 regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); 3197 this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); 3198 } 3199 // test the regex 3200 if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { 3201 return i; 3202 } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { 3203 return i; 3204 } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { 3205 return i; 3206 } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { 3207 return i; 3208 } 3209 } 3210} 3211 3212// MOMENTS 3213 3214function getSetDayOfWeek (input) { 3215 if (!this.isValid()) { 3216 return input != null ? this : NaN; 3217 } 3218 var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); 3219 if (input != null) { 3220 input = parseWeekday(input, this.localeData()); 3221 return this.add(input - day, 'd'); 3222 } else { 3223 return day; 3224 } 3225} 3226 3227function getSetLocaleDayOfWeek (input) { 3228 if (!this.isValid()) { 3229 return input != null ? this : NaN; 3230 } 3231 var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; 3232 return input == null ? weekday : this.add(input - weekday, 'd'); 3233} 3234 3235function getSetISODayOfWeek (input) { 3236 if (!this.isValid()) { 3237 return input != null ? this : NaN; 3238 } 3239 3240 // behaves the same as moment#day except 3241 // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) 3242 // as a setter, sunday should belong to the previous week. 3243 3244 if (input != null) { 3245 var weekday = parseIsoWeekday(input, this.localeData()); 3246 return this.day(this.day() % 7 ? weekday : weekday - 7); 3247 } else { 3248 return this.day() || 7; 3249 } 3250} 3251 3252var defaultWeekdaysRegex = matchWord; 3253function weekdaysRegex (isStrict) { 3254 if (this._weekdaysParseExact) { 3255 if (!hasOwnProp(this, '_weekdaysRegex')) { 3256 computeWeekdaysParse.call(this); 3257 } 3258 if (isStrict) { 3259 return this._weekdaysStrictRegex; 3260 } else { 3261 return this._weekdaysRegex; 3262 } 3263 } else { 3264 if (!hasOwnProp(this, '_weekdaysRegex')) { 3265 this._weekdaysRegex = defaultWeekdaysRegex; 3266 } 3267 return this._weekdaysStrictRegex && isStrict ? 3268 this._weekdaysStrictRegex : this._weekdaysRegex; 3269 } 3270} 3271 3272var defaultWeekdaysShortRegex = matchWord; 3273function weekdaysShortRegex (isStrict) { 3274 if (this._weekdaysParseExact) { 3275 if (!hasOwnProp(this, '_weekdaysRegex')) { 3276 computeWeekdaysParse.call(this); 3277 } 3278 if (isStrict) { 3279 return this._weekdaysShortStrictRegex; 3280 } else { 3281 return this._weekdaysShortRegex; 3282 } 3283 } else { 3284 if (!hasOwnProp(this, '_weekdaysShortRegex')) { 3285 this._weekdaysShortRegex = defaultWeekdaysShortRegex; 3286 } 3287 return this._weekdaysShortStrictRegex && isStrict ? 3288 this._weekdaysShortStrictRegex : this._weekdaysShortRegex; 3289 } 3290} 3291 3292var defaultWeekdaysMinRegex = matchWord; 3293function weekdaysMinRegex (isStrict) { 3294 if (this._weekdaysParseExact) { 3295 if (!hasOwnProp(this, '_weekdaysRegex')) { 3296 computeWeekdaysParse.call(this); 3297 } 3298 if (isStrict) { 3299 return this._weekdaysMinStrictRegex; 3300 } else { 3301 return this._weekdaysMinRegex; 3302 } 3303 } else { 3304 if (!hasOwnProp(this, '_weekdaysMinRegex')) { 3305 this._weekdaysMinRegex = defaultWeekdaysMinRegex; 3306 } 3307 return this._weekdaysMinStrictRegex && isStrict ? 3308 this._weekdaysMinStrictRegex : this._weekdaysMinRegex; 3309 } 3310} 3311 3312 3313function computeWeekdaysParse () { 3314 function cmpLenRev(a, b) { 3315 return b.length - a.length; 3316 } 3317 3318 var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], 3319 i, mom, minp, shortp, longp; 3320 for (i = 0; i < 7; i++) { 3321 // make the regex if we don't have it already 3322 mom = createUTC([2000, 1]).day(i); 3323 minp = this.weekdaysMin(mom, ''); 3324 shortp = this.weekdaysShort(mom, ''); 3325 longp = this.weekdays(mom, ''); 3326 minPieces.push(minp); 3327 shortPieces.push(shortp); 3328 longPieces.push(longp); 3329 mixedPieces.push(minp); 3330 mixedPieces.push(shortp); 3331 mixedPieces.push(longp); 3332 } 3333 // Sorting makes sure if one weekday (or abbr) is a prefix of another it 3334 // will match the longer piece. 3335 minPieces.sort(cmpLenRev); 3336 shortPieces.sort(cmpLenRev); 3337 longPieces.sort(cmpLenRev); 3338 mixedPieces.sort(cmpLenRev); 3339 for (i = 0; i < 7; i++) { 3340 shortPieces[i] = regexEscape(shortPieces[i]); 3341 longPieces[i] = regexEscape(longPieces[i]); 3342 mixedPieces[i] = regexEscape(mixedPieces[i]); 3343 } 3344 3345 this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 3346 this._weekdaysShortRegex = this._weekdaysRegex; 3347 this._weekdaysMinRegex = this._weekdaysRegex; 3348 3349 this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); 3350 this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); 3351 this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); 3352} 3353 3354// FORMATTING 3355 3356function hFormat() { 3357 return this.hours() % 12 || 12; 3358} 3359 3360function kFormat() { 3361 return this.hours() || 24; 3362} 3363 3364addFormatToken('H', ['HH', 2], 0, 'hour'); 3365addFormatToken('h', ['hh', 2], 0, hFormat); 3366addFormatToken('k', ['kk', 2], 0, kFormat); 3367 3368addFormatToken('hmm', 0, 0, function () { 3369 return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); 3370}); 3371 3372addFormatToken('hmmss', 0, 0, function () { 3373 return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + 3374 zeroFill(this.seconds(), 2); 3375}); 3376 3377addFormatToken('Hmm', 0, 0, function () { 3378 return '' + this.hours() + zeroFill(this.minutes(), 2); 3379}); 3380 3381addFormatToken('Hmmss', 0, 0, function () { 3382 return '' + this.hours() + zeroFill(this.minutes(), 2) + 3383 zeroFill(this.seconds(), 2); 3384}); 3385 3386function meridiem (token, lowercase) { 3387 addFormatToken(token, 0, 0, function () { 3388 return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); 3389 }); 3390} 3391 3392meridiem('a', true); 3393meridiem('A', false); 3394 3395// ALIASES 3396 3397addUnitAlias('hour', 'h'); 3398 3399// PRIORITY 3400addUnitPriority('hour', 13); 3401 3402// PARSING 3403 3404function matchMeridiem (isStrict, locale) { 3405 return locale._meridiemParse; 3406} 3407 3408addRegexToken('a', matchMeridiem); 3409addRegexToken('A', matchMeridiem); 3410addRegexToken('H', match1to2); 3411addRegexToken('h', match1to2); 3412addRegexToken('k', match1to2); 3413addRegexToken('HH', match1to2, match2); 3414addRegexToken('hh', match1to2, match2); 3415addRegexToken('kk', match1to2, match2); 3416
vendor: 18,301 bytes, lines 3417-3987
3417addRegexToken('hmm', match3to4); 3418addRegexToken('hmmss', match5to6); 3419addRegexToken('Hmm', match3to4); 3420addRegexToken('Hmmss', match5to6); 3421 3422addParseToken(['H', 'HH'], HOUR); 3423addParseToken(['k', 'kk'], function (input, array, config) { 3424 var kInput = toInt(input); 3425 array[HOUR] = kInput === 24 ? 0 : kInput; 3426}); 3427addParseToken(['a', 'A'], function (input, array, config) { 3428 config._isPm = config._locale.isPM(input); 3429 config._meridiem = input; 3430}); 3431addParseToken(['h', 'hh'], function (input, array, config) { 3432 array[HOUR] = toInt(input); 3433 getParsingFlags(config).bigHour = true; 3434}); 3435addParseToken('hmm', function (input, array, config) { 3436 var pos = input.length - 2; 3437 array[HOUR] = toInt(input.substr(0, pos)); 3438 array[MINUTE] = toInt(input.substr(pos)); 3439 getParsingFlags(config).bigHour = true; 3440}); 3441addParseToken('hmmss', function (input, array, config) { 3442 var pos1 = input.length - 4; 3443 var pos2 = input.length - 2; 3444 array[HOUR] = toInt(input.substr(0, pos1)); 3445 array[MINUTE] = toInt(input.substr(pos1, 2)); 3446 array[SECOND] = toInt(input.substr(pos2)); 3447 getParsingFlags(config).bigHour = true; 3448}); 3449addParseToken('Hmm', function (input, array, config) { 3450 var pos = input.length - 2; 3451 array[HOUR] = toInt(input.substr(0, pos)); 3452 array[MINUTE] = toInt(input.substr(pos)); 3453}); 3454addParseToken('Hmmss', function (input, array, config) { 3455 var pos1 = input.length - 4; 3456 var pos2 = input.length - 2; 3457 array[HOUR] = toInt(input.substr(0, pos1)); 3458 array[MINUTE] = toInt(input.substr(pos1, 2)); 3459 array[SECOND] = toInt(input.substr(pos2)); 3460}); 3461 3462// LOCALES 3463 3464function localeIsPM (input) { 3465 // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays 3466 // Using charAt should be more compatible. 3467 return ((input + '').toLowerCase().charAt(0) === 'p'); 3468} 3469 3470var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; 3471function localeMeridiem (hours, minutes, isLower) { 3472 if (hours > 11) { 3473 return isLower ? 'pm' : 'PM'; 3474 } else { 3475 return isLower ? 'am' : 'AM'; 3476 } 3477} 3478 3479 3480// MOMENTS 3481 3482// Setting the hour should keep the time, because the user explicitly 3483// specified which hour he wants. So trying to maintain the same hour (in 3484// a new timezone) makes sense. Adding/subtracting hours does not follow 3485// this rule. 3486var getSetHour = makeGetSet('Hours', true); 3487 3488// months 3489// week 3490// weekdays 3491// meridiem 3492var baseConfig = { 3493 calendar: defaultCalendar, 3494 longDateFormat: defaultLongDateFormat, 3495 invalidDate: defaultInvalidDate, 3496 ordinal: defaultOrdinal, 3497 dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, 3498 relativeTime: defaultRelativeTime, 3499 3500 months: defaultLocaleMonths, 3501 monthsShort: defaultLocaleMonthsShort, 3502 3503 week: defaultLocaleWeek, 3504 3505 weekdays: defaultLocaleWeekdays, 3506 weekdaysMin: defaultLocaleWeekdaysMin, 3507 weekdaysShort: defaultLocaleWeekdaysShort, 3508 3509 meridiemParse: defaultLocaleMeridiemParse 3510}; 3511 3512// internal storage for locale config files 3513var locales = {}; 3514var localeFamilies = {}; 3515var globalLocale; 3516 3517function normalizeLocale(key) { 3518 return key ? key.toLowerCase().replace('_', '-') : key; 3519} 3520 3521// pick the locale from the array 3522// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each 3523// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root 3524function chooseLocale(names) { 3525 var i = 0, j, next, locale, split; 3526 3527 while (i < names.length) { 3528 split = normalizeLocale(names[i]).split('-'); 3529 j = split.length; 3530 next = normalizeLocale(names[i + 1]); 3531 next = next ? next.split('-') : null; 3532 while (j > 0) { 3533 locale = loadLocale(split.slice(0, j).join('-')); 3534 if (locale) { 3535 return locale; 3536 } 3537 if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { 3538 //the next array item is better than a shallower substring of this one 3539 break; 3540 } 3541 j--; 3542 } 3543 i++; 3544 } 3545 return null; 3546} 3547 3548function loadLocale(name) { 3549 var oldLocale = null; 3550 // TODO: Find a better way to register and load all the locales in Node 3551 if (!locales[name] && (typeof module !== 'undefined') && 3552 module && module.exports) { 3553 try { 3554 oldLocale = globalLocale._abbr; 3555 var aliasedRequire = require; 3556 aliasedRequire('./locale/' + name); 3557 getSetGlobalLocale(oldLocale); 3558 } catch (e) {} 3559 } 3560 return locales[name]; 3561} 3562 3563// This function will load locale and then set the global locale. If 3564// no arguments are passed in, it will simply return the current global 3565// locale key. 3566function getSetGlobalLocale (key, values) { 3567 var data; 3568 if (key) { 3569 if (isUndefined(values)) { 3570 data = getLocale(key); 3571 } 3572 else { 3573 data = defineLocale(key, values); 3574 } 3575 3576 if (data) { 3577 // moment.duration._locale = moment._locale = data; 3578 globalLocale = data; 3579 } 3580 } 3581 3582 return globalLocale._abbr; 3583} 3584 3585function defineLocale (name, config) { 3586 if (config !== null) { 3587 var parentConfig = baseConfig; 3588 config.abbr = name; 3589 if (locales[name] != null) { 3590 deprecateSimple('defineLocaleOverride', 3591 'use moment.updateLocale(localeName, config) to change ' + 3592 'an existing locale. moment.defineLocale(localeName, ' + 3593 'config) should only be used for creating a new locale ' + 3594 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'); 3595 parentConfig = locales[name]._config; 3596 } else if (config.parentLocale != null) { 3597 if (locales[config.parentLocale] != null) { 3598 parentConfig = locales[config.parentLocale]._config; 3599 } else { 3600 if (!localeFamilies[config.parentLocale]) { 3601 localeFamilies[config.parentLocale] = []; 3602 } 3603 localeFamilies[config.parentLocale].push({ 3604 name: name, 3605 config: config 3606 }); 3607 return null; 3608 } 3609 } 3610 locales[name] = new Locale(mergeConfigs(parentConfig, config)); 3611 3612 if (localeFamilies[name]) { 3613 localeFamilies[name].forEach(function (x) { 3614 defineLocale(x.name, x.config); 3615 }); 3616 } 3617 3618 // backwards compat for now: also set the locale 3619 // make sure we set the locale AFTER all child locales have been 3620 // created, so we won't end up with the child locale set. 3621 getSetGlobalLocale(name); 3622 3623 3624 return locales[name]; 3625 } else { 3626 // useful for testing 3627 delete locales[name]; 3628 return null; 3629 } 3630} 3631 3632function updateLocale(name, config) { 3633 if (config != null) { 3634 var locale, tmpLocale, parentConfig = baseConfig; 3635 // MERGE 3636 tmpLocale = loadLocale(name); 3637 if (tmpLocale != null) { 3638 parentConfig = tmpLocale._config; 3639 } 3640 config = mergeConfigs(parentConfig, config); 3641 locale = new Locale(config); 3642 locale.parentLocale = locales[name]; 3643 locales[name] = locale; 3644 3645 // backwards compat for now: also set the locale 3646 getSetGlobalLocale(name); 3647 } else { 3648 // pass null for config to unupdate, useful for tests 3649 if (locales[name] != null) { 3650 if (locales[name].parentLocale != null) { 3651 locales[name] = locales[name].parentLocale; 3652 } else if (locales[name] != null) { 3653 delete locales[name]; 3654 } 3655 } 3656 } 3657 return locales[name]; 3658} 3659 3660// returns locale data 3661function getLocale (key) { 3662 var locale; 3663 3664 if (key && key._locale && key._locale._abbr) { 3665 key = key._locale._abbr; 3666 } 3667 3668 if (!key) { 3669 return globalLocale; 3670 } 3671 3672 if (!isArray(key)) { 3673 //short-circuit everything else 3674 locale = loadLocale(key); 3675 if (locale) { 3676 return locale; 3677 } 3678 key = [key]; 3679 } 3680 3681 return chooseLocale(key); 3682} 3683 3684function listLocales() { 3685 return keys(locales); 3686} 3687 3688function checkOverflow (m) { 3689 var overflow; 3690 var a = m._a; 3691 3692 if (a && getParsingFlags(m).overflow === -2) { 3693 overflow = 3694 a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : 3695 a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : 3696 a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : 3697 a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : 3698 a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : 3699 a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : 3700 -1; 3701 3702 if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { 3703 overflow = DATE; 3704 } 3705 if (getParsingFlags(m)._overflowWeeks && overflow === -1) { 3706 overflow = WEEK; 3707 } 3708 if (getParsingFlags(m)._overflowWeekday && overflow === -1) { 3709 overflow = WEEKDAY; 3710 } 3711 3712 getParsingFlags(m).overflow = overflow; 3713 } 3714 3715 return m; 3716} 3717 3718// Pick the first defined of two or three arguments. 3719function defaults(a, b, c) { 3720 if (a != null) { 3721 return a; 3722 } 3723 if (b != null) { 3724 return b; 3725 } 3726 return c; 3727} 3728 3729function currentDateArray(config) { 3730 // hooks is actually the exported moment object 3731 var nowValue = new Date(hooks.now()); 3732 if (config._useUTC) { 3733 return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; 3734 } 3735 return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; 3736} 3737 3738// convert an array to a date. 3739// the array should mirror the parameters below 3740// note: all values past the year are optional and will default to the lowest possible value. 3741// [year, month, day , hour, minute, second, millisecond] 3742function configFromArray (config) { 3743 var i, date, input = [], currentDate, yearToUse; 3744 3745 if (config._d) { 3746 return; 3747 } 3748 3749 currentDate = currentDateArray(config); 3750 3751 //compute day of the year from weeks and weekdays 3752 if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { 3753 dayOfYearFromWeekInfo(config); 3754 } 3755 3756 //if the day of the year is set, figure out what it is 3757 if (config._dayOfYear != null) { 3758 yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); 3759 3760 if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { 3761 getParsingFlags(config)._overflowDayOfYear = true; 3762 } 3763 3764 date = createUTCDate(yearToUse, 0, config._dayOfYear); 3765 config._a[MONTH] = date.getUTCMonth(); 3766 config._a[DATE] = date.getUTCDate(); 3767 } 3768 3769 // Default to current date. 3770 // * if no year, month, day of month are given, default to today 3771 // * if day of month is given, default month and year 3772 // * if month is given, default only year 3773 // * if year is given, don't default anything 3774 for (i = 0; i < 3 && config._a[i] == null; ++i) { 3775 config._a[i] = input[i] = currentDate[i]; 3776 } 3777 3778 // Zero out whatever was not defaulted, including time 3779 for (; i < 7; i++) { 3780 config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; 3781 } 3782 3783 // Check for 24:00:00.000 3784 if (config._a[HOUR] === 24 && 3785 config._a[MINUTE] === 0 && 3786 config._a[SECOND] === 0 && 3787 config._a[MILLISECOND] === 0) { 3788 config._nextDay = true; 3789 config._a[HOUR] = 0; 3790 } 3791 3792 config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); 3793 // Apply timezone offset from input. The actual utcOffset can be changed 3794 // with parseZone. 3795 if (config._tzm != null) { 3796 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); 3797 } 3798 3799 if (config._nextDay) { 3800 config._a[HOUR] = 24; 3801 } 3802 3803 // check for mismatching day of week 3804 if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) { 3805 getParsingFlags(config).weekdayMismatch = true; 3806 } 3807} 3808 3809function dayOfYearFromWeekInfo(config) { 3810 var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; 3811 3812 w = config._w; 3813 if (w.GG != null || w.W != null || w.E != null) { 3814 dow = 1; 3815 doy = 4; 3816 3817 // TODO: We need to take the current isoWeekYear, but that depends on 3818 // how we interpret now (local, utc, fixed offset). So create 3819 // a now version of current config (take local/utc/offset flags, and 3820 // create now). 3821 weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year); 3822 week = defaults(w.W, 1); 3823 weekday = defaults(w.E, 1); 3824 if (weekday < 1 || weekday > 7) { 3825 weekdayOverflow = true; 3826 } 3827 } else { 3828 dow = config._locale._week.dow; 3829 doy = config._locale._week.doy; 3830 3831 var curWeek = weekOfYear(createLocal(), dow, doy); 3832 3833 weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); 3834 3835 // Default to current week. 3836 week = defaults(w.w, curWeek.week); 3837 3838 if (w.d != null) { 3839 // weekday -- low day numbers are considered next week 3840 weekday = w.d; 3841 if (weekday < 0 || weekday > 6) { 3842 weekdayOverflow = true; 3843 } 3844 } else if (w.e != null) { 3845 // local weekday -- counting starts from begining of week 3846 weekday = w.e + dow; 3847 if (w.e < 0 || w.e > 6) { 3848 weekdayOverflow = true; 3849 } 3850 } else { 3851 // default to begining of week 3852 weekday = dow; 3853 } 3854 } 3855 if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { 3856 getParsingFlags(config)._overflowWeeks = true; 3857 } else if (weekdayOverflow != null) { 3858 getParsingFlags(config)._overflowWeekday = true; 3859 } else { 3860 temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); 3861 config._a[YEAR] = temp.year; 3862 config._dayOfYear = temp.dayOfYear; 3863 } 3864} 3865 3866// iso 8601 regex 3867// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) 3868var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; 3869var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; 3870 3871var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; 3872 3873var isoDates = [ 3874 ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], 3875 ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], 3876 ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], 3877 ['GGGG-[W]WW', /\d{4}-W\d\d/, false], 3878 ['YYYY-DDD', /\d{4}-\d{3}/], 3879 ['YYYY-MM', /\d{4}-\d\d/, false], 3880 ['YYYYYYMMDD', /[+-]\d{10}/], 3881 ['YYYYMMDD', /\d{8}/], 3882 // YYYYMM is NOT allowed by the standard 3883 ['GGGG[W]WWE', /\d{4}W\d{3}/], 3884 ['GGGG[W]WW', /\d{4}W\d{2}/, false], 3885 ['YYYYDDD', /\d{7}/] 3886]; 3887 3888// iso time formats and regexes 3889var isoTimes = [ 3890 ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], 3891 ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], 3892 ['HH:mm:ss', /\d\d:\d\d:\d\d/], 3893 ['HH:mm', /\d\d:\d\d/], 3894 ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], 3895 ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], 3896 ['HHmmss', /\d\d\d\d\d\d/], 3897 ['HHmm', /\d\d\d\d/], 3898 ['HH', /\d\d/] 3899]; 3900 3901var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; 3902 3903// date from iso format 3904function configFromISO(config) { 3905 var i, l, 3906 string = config._i, 3907 match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), 3908 allowTime, dateFormat, timeFormat, tzFormat; 3909 3910 if (match) { 3911 getParsingFlags(config).iso = true; 3912 3913 for (i = 0, l = isoDates.length; i < l; i++) { 3914 if (isoDates[i][1].exec(match[1])) { 3915 dateFormat = isoDates[i][0]; 3916 allowTime = isoDates[i][2] !== false; 3917 break; 3918 } 3919 } 3920 if (dateFormat == null) { 3921 config._isValid = false; 3922 return; 3923 } 3924 if (match[3]) { 3925 for (i = 0, l = isoTimes.length; i < l; i++) { 3926 if (isoTimes[i][1].exec(match[3])) { 3927 // match[2] should be 'T' or space 3928 timeFormat = (match[2] || ' ') + isoTimes[i][0]; 3929 break; 3930 } 3931 } 3932 if (timeFormat == null) { 3933 config._isValid = false; 3934 return; 3935 } 3936 } 3937 if (!allowTime && timeFormat != null) { 3938 config._isValid = false; 3939 return; 3940 } 3941 if (match[4]) { 3942 if (tzRegex.exec(match[4])) { 3943 tzFormat = 'Z'; 3944 } else { 3945 config._isValid = false; 3946 return; 3947 } 3948 } 3949 config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); 3950 configFromStringAndFormat(config); 3951 } else { 3952 config._isValid = false; 3953 } 3954} 3955 3956// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 3957var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/; 3958 3959function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { 3960 var result = [ 3961 untruncateYear(yearStr), 3962 defaultLocaleMonthsShort.indexOf(monthStr), 3963 parseInt(dayStr, 10), 3964 parseInt(hourStr, 10), 3965 parseInt(minuteStr, 10) 3966 ]; 3967 3968 if (secondStr) { 3969 result.push(parseInt(secondStr, 10)); 3970 } 3971 3972 return result; 3973} 3974 3975function untruncateYear(yearStr) { 3976 var year = parseInt(yearStr, 10); 3977 if (year <= 49) { 3978 return 2000 + year; 3979 } else if (year <= 999) { 3980 return 1900 + year; 3981 } 3982 return year; 3983} 3984 3985function preprocessRFC2822(s) { 3986 // Remove comments and folding whitespace and replace multiple-spaces with a single space 3987 return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').trim(
vendor: 6,917 bytes, lines 3987-4216
3987); 3988} 3989 3990function checkWeekday(weekdayStr, parsedInput, config) { 3991 if (weekdayStr) { 3992 // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check. 3993 var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), 3994 weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); 3995 if (weekdayProvided !== weekdayActual) { 3996 getParsingFlags(config).weekdayMismatch = true; 3997 config._isValid = false; 3998 return false; 3999 } 4000 } 4001 return true; 4002} 4003 4004var obsOffsets = { 4005 UT: 0, 4006 GMT: 0, 4007 EDT: -4 * 60, 4008 EST: -5 * 60, 4009 CDT: -5 * 60, 4010 CST: -6 * 60, 4011 MDT: -6 * 60, 4012 MST: -7 * 60, 4013 PDT: -7 * 60, 4014 PST: -8 * 60 4015}; 4016 4017function calculateOffset(obsOffset, militaryOffset, numOffset) { 4018 if (obsOffset) { 4019 return obsOffsets[obsOffset]; 4020 } else if (militaryOffset) { 4021 // the only allowed military tz is Z 4022 return 0; 4023 } else { 4024 var hm = parseInt(numOffset, 10); 4025 var m = hm % 100, h = (hm - m) / 100; 4026 return h * 60 + m; 4027 } 4028} 4029 4030// date and time from ref 2822 format 4031function configFromRFC2822(config) { 4032 var match = rfc2822.exec(preprocessRFC2822(config._i)); 4033 if (match) { 4034 var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); 4035 if (!checkWeekday(match[1], parsedArray, config)) { 4036 return; 4037 } 4038 4039 config._a = parsedArray; 4040 config._tzm = calculateOffset(match[8], match[9], match[10]); 4041 4042 config._d = createUTCDate.apply(null, config._a); 4043 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); 4044 4045 getParsingFlags(config).rfc2822 = true; 4046 } else { 4047 config._isValid = false; 4048 } 4049} 4050 4051// date from iso format or fallback 4052function configFromString(config) { 4053 var matched = aspNetJsonRegex.exec(config._i); 4054 4055 if (matched !== null) { 4056 config._d = new Date(+matched[1]); 4057 return; 4058 } 4059 4060 configFromISO(config); 4061 if (config._isValid === false) { 4062 delete config._isValid; 4063 } else { 4064 return; 4065 } 4066 4067 configFromRFC2822(config); 4068 if (config._isValid === false) { 4069 delete config._isValid; 4070 } else { 4071 return; 4072 } 4073 4074 // Final attempt, use Input Fallback 4075 hooks.createFromInputFallback(config); 4076} 4077 4078hooks.createFromInputFallback = deprecate( 4079 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 4080 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 4081 'discouraged and will be removed in an upcoming major release. Please refer to ' + 4082 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', 4083 function (config) { 4084 config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); 4085 } 4086); 4087 4088// constant that refers to the ISO standard 4089hooks.ISO_8601 = function () {}; 4090 4091// constant that refers to the RFC 2822 form 4092hooks.RFC_2822 = function () {}; 4093 4094// date from string and format string 4095function configFromStringAndFormat(config) { 4096 // TODO: Move this to another part of the creation flow to prevent circular deps 4097 if (config._f === hooks.ISO_8601) { 4098 configFromISO(config); 4099 return; 4100 } 4101 if (config._f === hooks.RFC_2822) { 4102 configFromRFC2822(config); 4103 return; 4104 } 4105 config._a = []; 4106 getParsingFlags(config).empty = true; 4107 4108 // This array is used to make a Date, either with `new Date` or `Date.UTC` 4109 var string = '' + config._i, 4110 i, parsedInput, tokens, token, skipped, 4111 stringLength = string.length, 4112 totalParsedInputLength = 0; 4113 4114 tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; 4115 4116 for (i = 0; i < tokens.length; i++) { 4117 token = tokens[i]; 4118 parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; 4119 // console.log('token', token, 'parsedInput', parsedInput, 4120 // 'regex', getParseRegexForToken(token, config)); 4121 if (parsedInput) { 4122 skipped = string.substr(0, string.indexOf(parsedInput)); 4123 if (skipped.length > 0) { 4124 getParsingFlags(config).unusedInput.push(skipped); 4125 } 4126 string = string.slice(string.indexOf(parsedInput) + parsedInput.length); 4127 totalParsedInputLength += parsedInput.length; 4128 } 4129 // don't parse if it's not a known token 4130 if (formatTokenFunctions[token]) { 4131 if (parsedInput) { 4132 getParsingFlags(config).empty = false; 4133 } 4134 else { 4135 getParsingFlags(config).unusedTokens.push(token); 4136 } 4137 addTimeToArrayFromToken(token, parsedInput, config); 4138 } 4139 else if (config._strict && !parsedInput) { 4140 getParsingFlags(config).unusedTokens.push(token); 4141 } 4142 } 4143 4144 // add remaining unparsed input length to the string 4145 getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; 4146 if (string.length > 0) { 4147 getParsingFlags(config).unusedInput.push(string); 4148 } 4149 4150 // clear _12h flag if hour is <= 12 4151 if (config._a[HOUR] <= 12 && 4152 getParsingFlags(config).bigHour === true && 4153 config._a[HOUR] > 0) { 4154 getParsingFlags(config).bigHour = undefined; 4155 } 4156 4157 getParsingFlags(config).parsedDateParts = config._a.slice(0); 4158 getParsingFlags(config).meridiem = config._meridiem; 4159 // handle meridiem 4160 config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); 4161 4162 configFromArray(config); 4163 checkOverflow(config); 4164} 4165 4166 4167function meridiemFixWrap (locale, hour, meridiem) { 4168 var isPm; 4169 4170 if (meridiem == null) { 4171 // nothing to do 4172 return hour; 4173 } 4174 if (locale.meridiemHour != null) { 4175 return locale.meridiemHour(hour, meridiem); 4176 } else if (locale.isPM != null) { 4177 // Fallback 4178 isPm = locale.isPM(meridiem); 4179 if (isPm && hour < 12) { 4180 hour += 12; 4181 } 4182 if (!isPm && hour === 12) { 4183 hour = 0; 4184 } 4185 return hour; 4186 } else { 4187 // this is not supposed to happen 4188 return hour; 4189 } 4190} 4191 4192// date from string and array of format strings 4193function configFromStringAndArray(config) { 4194 var tempConfig, 4195 bestMoment, 4196 4197 scoreToBeat, 4198 i, 4199 currentScore; 4200 4201 if (config._f.length === 0) { 4202 getParsingFlags(config).invalidFormat = true; 4203 config._d = new Date(NaN); 4204 return; 4205 } 4206 4207 for (i = 0; i < config._f.length; i++) { 4208 currentScore = 0; 4209 tempConfig = copyConfig({}, config); 4210 if (config._useUTC != null) { 4211 tempConfig._useUTC = config._useUTC; 4212 } 4213 tempConfig._f = config._f[i]; 4214 configFromStringAndFormat(tempConfig); 4215 4216 if (!isValid
vendor: 9,914 bytes, lines 4216-4572
4216(tempConfig)) { 4217 continue; 4218 } 4219 4220 // if there is any input that was not parsed add a penalty for that format 4221 currentScore += getParsingFlags(tempConfig).charsLeftOver; 4222 4223 //or tokens 4224 currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; 4225 4226 getParsingFlags(tempConfig).score = currentScore; 4227 4228 if (scoreToBeat == null || currentScore < scoreToBeat) { 4229 scoreToBeat = currentScore; 4230 bestMoment = tempConfig; 4231 } 4232 } 4233 4234 extend(config, bestMoment || tempConfig); 4235} 4236 4237function configFromObject(config) { 4238 if (config._d) { 4239 return; 4240 } 4241 4242 var i = normalizeObjectUnits(config._i); 4243 config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { 4244 return obj && parseInt(obj, 10); 4245 }); 4246 4247 configFromArray(config); 4248} 4249 4250function createFromConfig (config) { 4251 var res = new Moment(checkOverflow(prepareConfig(config))); 4252 if (res._nextDay) { 4253 // Adding is smart enough around DST 4254 res.add(1, 'd'); 4255 res._nextDay = undefined; 4256 } 4257 4258 return res; 4259} 4260 4261function prepareConfig (config) { 4262 var input = config._i, 4263 format = config._f; 4264 4265 config._locale = config._locale || getLocale(config._l); 4266 4267 if (input === null || (format === undefined && input === '')) { 4268 return createInvalid({nullInput: true}); 4269 } 4270 4271 if (typeof input === 'string') { 4272 config._i = input = config._locale.preparse(input); 4273 } 4274 4275 if (isMoment(input)) { 4276 return new Moment(checkOverflow(input)); 4277 } else if (isDate(input)) { 4278 config._d = input; 4279 } else if (isArray(format)) { 4280 configFromStringAndArray(config); 4281 } else if (format) { 4282 configFromStringAndFormat(config); 4283 } else { 4284 configFromInput(config); 4285 } 4286 4287 if (!isValid(config)) { 4288 config._d = null; 4289 } 4290 4291 return config; 4292} 4293 4294function configFromInput(config) { 4295 var input = config._i; 4296 if (isUndefined(input)) { 4297 config._d = new Date(hooks.now()); 4298 } else if (isDate(input)) { 4299 config._d = new Date(input.valueOf()); 4300 } else if (typeof input === 'string') { 4301 configFromString(config); 4302 } else if (isArray(input)) { 4303 config._a = map(input.slice(0), function (obj) { 4304 return parseInt(obj, 10); 4305 }); 4306 configFromArray(config); 4307 } else if (isObject(input)) { 4308 configFromObject(config); 4309 } else if (isNumber(input)) { 4310 // from milliseconds 4311 config._d = new Date(input); 4312 } else { 4313 hooks.createFromInputFallback(config); 4314 } 4315} 4316 4317function createLocalOrUTC (input, format, locale, strict, isUTC) { 4318 var c = {}; 4319 4320 if (locale === true || locale === false) { 4321 strict = locale; 4322 locale = undefined; 4323 } 4324 4325 if ((isObject(input) && isObjectEmpty(input)) || 4326 (isArray(input) && input.length === 0)) { 4327 input = undefined; 4328 } 4329 // object construction must be done this way. 4330 // https://github.com/moment/moment/issues/1423 4331 c._isAMomentObject = true; 4332 c._useUTC = c._isUTC = isUTC; 4333 c._l = locale; 4334 c._i = input; 4335 c._f = format; 4336 c._strict = strict; 4337 4338 return createFromConfig(c); 4339} 4340 4341function createLocal (input, format, locale, strict) { 4342 return createLocalOrUTC(input, format, locale, strict, false); 4343} 4344 4345var prototypeMin = deprecate( 4346 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', 4347 function () { 4348 var other = createLocal.apply(null, arguments); 4349 if (this.isValid() && other.isValid()) { 4350 return other < this ? this : other; 4351 } else { 4352 return createInvalid(); 4353 } 4354 } 4355); 4356 4357var prototypeMax = deprecate( 4358 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', 4359 function () { 4360 var other = createLocal.apply(null, arguments); 4361 if (this.isValid() && other.isValid()) { 4362 return other > this ? this : other; 4363 } else { 4364 return createInvalid(); 4365 } 4366 } 4367); 4368 4369// Pick a moment m from moments so that m[fn](other) is true for all 4370// other. This relies on the function fn to be transitive. 4371// 4372// moments should either be an array of moment objects or an array, whose 4373// first element is an array of moment objects. 4374function pickBy(fn, moments) { 4375 var res, i; 4376 if (moments.length === 1 && isArray(moments[0])) { 4377 moments = moments[0]; 4378 } 4379 if (!moments.length) { 4380 return createLocal(); 4381 } 4382 res = moments[0]; 4383 for (i = 1; i < moments.length; ++i) { 4384 if (!moments[i].isValid() || moments[i][fn](res)) { 4385 res = moments[i]; 4386 } 4387 } 4388 return res; 4389} 4390 4391// TODO: Use [].sort instead? 4392function min () { 4393 var args = [].slice.call(arguments, 0); 4394 4395 return pickBy('isBefore', args); 4396} 4397 4398function max () { 4399 var args = [].slice.call(arguments, 0); 4400 4401 return pickBy('isAfter', args); 4402} 4403 4404var now = function () { 4405 return Date.now ? Date.now() : +(new Date()); 4406}; 4407 4408var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; 4409 4410function isDurationValid(m) { 4411 for (var key in m) { 4412 if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) { 4413 return false; 4414 } 4415 } 4416 4417 var unitHasDecimal = false; 4418 for (var i = 0; i < ordering.length; ++i) { 4419 if (m[ordering[i]]) { 4420 if (unitHasDecimal) { 4421 return false; // only allow non-integers for smallest unit 4422 } 4423 if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { 4424 unitHasDecimal = true; 4425 } 4426 } 4427 } 4428 4429 return true; 4430} 4431 4432function isValid$1() { 4433 return this._isValid; 4434} 4435 4436function createInvalid$1() { 4437 return createDuration(NaN); 4438} 4439 4440function Duration (duration) { 4441 var normalizedInput = normalizeObjectUnits(duration), 4442 years = normalizedInput.year || 0, 4443 quarters = normalizedInput.quarter || 0, 4444 months = normalizedInput.month || 0, 4445 weeks = normalizedInput.week || 0, 4446 days = normalizedInput.day || 0, 4447 hours = normalizedInput.hour || 0, 4448 minutes = normalizedInput.minute || 0, 4449 seconds = normalizedInput.second || 0, 4450 milliseconds = normalizedInput.millisecond || 0; 4451 4452 this._isValid = isDurationValid(normalizedInput); 4453 4454 // representation for dateAddRemove 4455 this._milliseconds = +milliseconds + 4456 seconds * 1e3 + // 1000 4457 minutes * 6e4 + // 1000 * 60 4458 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 4459 // Because of dateAddRemove treats 24 hours as different from a 4460 // day when working around DST, we need to store them separately 4461 this._days = +days + 4462 weeks * 7; 4463 // It is impossible to translate months into days without knowing 4464 // which months you are are talking about, so we have to store 4465 // it separately. 4466 this._months = +months + 4467 quarters * 3 + 4468 years * 12; 4469 4470 this._data = {}; 4471 4472 this._locale = getLocale(); 4473 4474 this._bubble(); 4475} 4476 4477function isDuration (obj) { 4478 return obj instanceof Duration; 4479} 4480 4481function absRound (number) { 4482 if (number < 0) { 4483 return Math.round(-1 * number) * -1; 4484 } else { 4485 return Math.round(number); 4486 } 4487} 4488 4489// FORMATTING 4490 4491function offset (token, separator) { 4492 addFormatToken(token, 0, 0, function () { 4493 var offset = this.utcOffset(); 4494 var sign = '+'; 4495 if (offset < 0) { 4496 offset = -offset; 4497 sign = '-'; 4498 } 4499 return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); 4500 }); 4501} 4502 4503offset('Z', ':'); 4504offset('ZZ', ''); 4505 4506// PARSING 4507 4508addRegexToken('Z', matchShortOffset); 4509addRegexToken('ZZ', matchShortOffset); 4510addParseToken(['Z', 'ZZ'], function (input, array, config) { 4511 config._useUTC = true; 4512 config._tzm = offsetFromString(matchShortOffset, input); 4513}); 4514 4515// HELPERS 4516 4517// timezone chunker 4518// '+10:00' > ['10', '00'] 4519// '-1530' > ['-15', '30'] 4520var chunkOffset = /([\+\-]|\d\d)/gi; 4521 4522function offsetFromString(matcher, string) { 4523 var matches = (string || '').match(matcher); 4524 4525 if (matches === null) { 4526 return null; 4527 } 4528 4529 var chunk = matches[matches.length - 1] || []; 4530 var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; 4531 var minutes = +(parts[1] * 60) + toInt(parts[2]); 4532 4533 return minutes === 0 ? 4534 0 : 4535 parts[0] === '+' ? minutes : -minutes; 4536} 4537 4538// Return a moment from input, that is local/utc/zone equivalent to model. 4539function cloneWithOffset(input, model) { 4540 var res, diff; 4541 if (model._isUTC) { 4542 res = model.clone(); 4543 diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); 4544 // Use low-level api, because this fn is low-level api. 4545 res._d.setTime(res._d.valueOf() + diff); 4546 hooks.updateOffset(res, false); 4547 return res; 4548 } else { 4549 return createLocal(input).local(); 4550 } 4551} 4552 4553function getDateOffset (m) { 4554 // On Firefox.24 Date#getTimezoneOffset returns a floating point. 4555 // https://github.com/moment/moment/pull/1871 4556 return -Math.round(m._d.getTimezoneOffset() / 15) * 15; 4557} 4558 4559// HOOKS 4560 4561// This function will be called whenever a moment is mutated. 4562// It is intended to keep the offset in sync with the timezone. 4563hooks.updateOffset = function () {}; 4564 4565// MOMENTS 4566 4567// keepLocalTime = true means only change the timezone, without 4568// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> 4569// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset 4570// +0200, so we adjust the time as needed, to be valid. 4571// 4572// Keeping the time actually adds/subtracts (one hour)
vendor: 19,216 bytes, lines 4573-5219
4573// from the actual represented time. That is why we call updateOffset 4574// a second time. In case it wants us to change the offset again 4575// _changeInProgress == true case, then we have to adjust, because 4576// there is no such time in the given timezone. 4577function getSetOffset (input, keepLocalTime, keepMinutes) { 4578 var offset = this._offset || 0, 4579 localAdjust; 4580 if (!this.isValid()) { 4581 return input != null ? this : NaN; 4582 } 4583 if (input != null) { 4584 if (typeof input === 'string') { 4585 input = offsetFromString(matchShortOffset, input); 4586 if (input === null) { 4587 return this; 4588 } 4589 } else if (Math.abs(input) < 16 && !keepMinutes) { 4590 input = input * 60; 4591 } 4592 if (!this._isUTC && keepLocalTime) { 4593 localAdjust = getDateOffset(this); 4594 } 4595 this._offset = input; 4596 this._isUTC = true; 4597 if (localAdjust != null) { 4598 this.add(localAdjust, 'm'); 4599 } 4600 if (offset !== input) { 4601 if (!keepLocalTime || this._changeInProgress) { 4602 addSubtract(this, createDuration(input - offset, 'm'), 1, false); 4603 } else if (!this._changeInProgress) { 4604 this._changeInProgress = true; 4605 hooks.updateOffset(this, true); 4606 this._changeInProgress = null; 4607 } 4608 } 4609 return this; 4610 } else { 4611 return this._isUTC ? offset : getDateOffset(this); 4612 } 4613} 4614 4615function getSetZone (input, keepLocalTime) { 4616 if (input != null) { 4617 if (typeof input !== 'string') { 4618 input = -input; 4619 } 4620 4621 this.utcOffset(input, keepLocalTime); 4622 4623 return this; 4624 } else { 4625 return -this.utcOffset(); 4626 } 4627} 4628 4629function setOffsetToUTC (keepLocalTime) { 4630 return this.utcOffset(0, keepLocalTime); 4631} 4632 4633function setOffsetToLocal (keepLocalTime) { 4634 if (this._isUTC) { 4635 this.utcOffset(0, keepLocalTime); 4636 this._isUTC = false; 4637 4638 if (keepLocalTime) { 4639 this.subtract(getDateOffset(this), 'm'); 4640 } 4641 } 4642 return this; 4643} 4644 4645function setOffsetToParsedOffset () { 4646 if (this._tzm != null) { 4647 this.utcOffset(this._tzm, false, true); 4648 } else if (typeof this._i === 'string') { 4649 var tZone = offsetFromString(matchOffset, this._i); 4650 if (tZone != null) { 4651 this.utcOffset(tZone); 4652 } 4653 else { 4654 this.utcOffset(0, true); 4655 } 4656 } 4657 return this; 4658} 4659 4660function hasAlignedHourOffset (input) { 4661 if (!this.isValid()) { 4662 return false; 4663 } 4664 input = input ? createLocal(input).utcOffset() : 0; 4665 4666 return (this.utcOffset() - input) % 60 === 0; 4667} 4668 4669function isDaylightSavingTime () { 4670 return ( 4671 this.utcOffset() > this.clone().month(0).utcOffset() || 4672 this.utcOffset() > this.clone().month(5).utcOffset() 4673 ); 4674} 4675 4676function isDaylightSavingTimeShifted () { 4677 if (!isUndefined(this._isDSTShifted)) { 4678 return this._isDSTShifted; 4679 } 4680 4681 var c = {}; 4682 4683 copyConfig(c, this); 4684 c = prepareConfig(c); 4685 4686 if (c._a) { 4687 var other = c._isUTC ? createUTC(c._a) : createLocal(c._a); 4688 this._isDSTShifted = this.isValid() && 4689 compareArrays(c._a, other.toArray()) > 0; 4690 } else { 4691 this._isDSTShifted = false; 4692 } 4693 4694 return this._isDSTShifted; 4695} 4696 4697function isLocal () { 4698 return this.isValid() ? !this._isUTC : false; 4699} 4700 4701function isUtcOffset () { 4702 return this.isValid() ? this._isUTC : false; 4703} 4704 4705function isUtc () { 4706 return this.isValid() ? this._isUTC && this._offset === 0 : false; 4707} 4708 4709// ASP.NET json date format regex 4710var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/; 4711 4712// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html 4713// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere 4714// and further modified to allow for strings containing both week and day 4715var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; 4716 4717function createDuration (input, key) { 4718 var duration = input, 4719 // matching against regexp is expensive, do it on demand 4720 match = null, 4721 sign, 4722 ret, 4723 diffRes; 4724 4725 if (isDuration(input)) { 4726 duration = { 4727 ms : input._milliseconds, 4728 d : input._days, 4729 M : input._months 4730 }; 4731 } else if (isNumber(input)) { 4732 duration = {}; 4733 if (key) { 4734 duration[key] = input; 4735 } else { 4736 duration.milliseconds = input; 4737 } 4738 } else if (!!(match = aspNetRegex.exec(input))) { 4739 sign = (match[1] === '-') ? -1 : 1; 4740 duration = { 4741 y : 0, 4742 d : toInt(match[DATE]) * sign, 4743 h : toInt(match[HOUR]) * sign, 4744 m : toInt(match[MINUTE]) * sign, 4745 s : toInt(match[SECOND]) * sign, 4746 ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match 4747 }; 4748 } else if (!!(match = isoRegex.exec(input))) { 4749 sign = (match[1] === '-') ? -1 : (match[1] === '+') ? 1 : 1; 4750 duration = { 4751 y : parseIso(match[2], sign), 4752 M : parseIso(match[3], sign), 4753 w : parseIso(match[4], sign), 4754 d : parseIso(match[5], sign), 4755 h : parseIso(match[6], sign), 4756 m : parseIso(match[7], sign), 4757 s : parseIso(match[8], sign) 4758 }; 4759 } else if (duration == null) {// checks for null or undefined 4760 duration = {}; 4761 } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { 4762 diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); 4763 4764 duration = {}; 4765 duration.ms = diffRes.milliseconds; 4766 duration.M = diffRes.months; 4767 } 4768 4769 ret = new Duration(duration); 4770 4771 if (isDuration(input) && hasOwnProp(input, '_locale')) { 4772 ret._locale = input._locale; 4773 } 4774 4775 return ret; 4776} 4777 4778createDuration.fn = Duration.prototype; 4779createDuration.invalid = createInvalid$1; 4780 4781function parseIso (inp, sign) { 4782 // We'd normally use ~~inp for this, but unfortunately it also 4783 // converts floats to ints. 4784 // inp may be undefined, so careful calling replace on it. 4785 var res = inp && parseFloat(inp.replace(',', '.')); 4786 // apply sign while we're at it 4787 return (isNaN(res) ? 0 : res) * sign; 4788} 4789 4790function positiveMomentsDifference(base, other) { 4791 var res = {milliseconds: 0, months: 0}; 4792 4793 res.months = other.month() - base.month() + 4794 (other.year() - base.year()) * 12; 4795 if (base.clone().add(res.months, 'M').isAfter(other)) { 4796 --res.months; 4797 } 4798 4799 res.milliseconds = +other - +(base.clone().add(res.months, 'M')); 4800 4801 return res; 4802} 4803 4804function momentsDifference(base, other) { 4805 var res; 4806 if (!(base.isValid() && other.isValid())) { 4807 return {milliseconds: 0, months: 0}; 4808 } 4809 4810 other = cloneWithOffset(other, base); 4811 if (base.isBefore(other)) { 4812 res = positiveMomentsDifference(base, other); 4813 } else { 4814 res = positiveMomentsDifference(other, base); 4815 res.milliseconds = -res.milliseconds; 4816 res.months = -res.months; 4817 } 4818 4819 return res; 4820} 4821 4822// TODO: remove 'name' arg after deprecation is removed 4823function createAdder(direction, name) { 4824 return function (val, period) { 4825 var dur, tmp; 4826 //invert the arguments, but complain about it 4827 if (period !== null && !isNaN(+period)) { 4828 deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 4829 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); 4830 tmp = val; val = period; period = tmp; 4831 } 4832 4833 val = typeof val === 'string' ? +val : val; 4834 dur = createDuration(val, period); 4835 addSubtract(this, dur, direction); 4836 return this; 4837 }; 4838} 4839 4840function addSubtract (mom, duration, isAdding, updateOffset) { 4841 var milliseconds = duration._milliseconds, 4842 days = absRound(duration._days), 4843 months = absRound(duration._months); 4844 4845 if (!mom.isValid()) { 4846 // No op 4847 return; 4848 } 4849 4850 updateOffset = updateOffset == null ? true : updateOffset; 4851 4852 if (months) { 4853 setMonth(mom, get(mom, 'Month') + months * isAdding); 4854 } 4855 if (days) { 4856 set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); 4857 } 4858 if (milliseconds) { 4859 mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); 4860 } 4861 if (updateOffset) { 4862 hooks.updateOffset(mom, days || months); 4863 } 4864} 4865 4866var add = createAdder(1, 'add'); 4867var subtract = createAdder(-1, 'subtract'); 4868 4869function getCalendarFormat(myMoment, now) { 4870 var diff = myMoment.diff(now, 'days', true); 4871 return diff < -6 ? 'sameElse' : 4872 diff < -1 ? 'lastWeek' : 4873 diff < 0 ? 'lastDay' : 4874 diff < 1 ? 'sameDay' : 4875 diff < 2 ? 'nextDay' : 4876 diff < 7 ? 'nextWeek' : 'sameElse'; 4877} 4878 4879function calendar$1 (time, formats) { 4880 // We want to compare the start of today, vs this. 4881 // Getting start-of-today depends on whether we're local/utc/offset or not. 4882 var now = time || createLocal(), 4883 sod = cloneWithOffset(now, this).startOf('day'), 4884 format = hooks.calendarFormat(this, sod) || 'sameElse'; 4885 4886 var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); 4887 4888 return this.format(output || this.localeData().calendar(format, this, createLocal(now))); 4889} 4890 4891function clone () { 4892 return new Moment(this); 4893} 4894 4895function isAfter (input, units) { 4896 var localInput = isMoment(input) ? input : createLocal(input); 4897 if (!(this.isValid() && localInput.isValid())) { 4898 return false; 4899 } 4900 units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); 4901 if (units === 'millisecond') { 4902 return this.valueOf() > localInput.valueOf(); 4903 } else { 4904 return localInput.valueOf() < this.clone().startOf(units).valueOf(); 4905 } 4906} 4907 4908function isBefore (input, units) { 4909 var localInput = isMoment(input) ? input : createLocal(input); 4910 if (!(this.isValid() && localInput.isValid())) { 4911 return false; 4912 } 4913 units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); 4914 if (units === 'millisecond') { 4915 return this.valueOf() < localInput.valueOf(); 4916 } else { 4917 return this.clone().endOf(units).valueOf() < localInput.valueOf(); 4918 } 4919} 4920 4921function isBetween (from, to, units, inclusivity) { 4922 inclusivity = inclusivity || '()'; 4923 return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) && 4924 (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units)); 4925} 4926 4927function isSame (input, units) { 4928 var localInput = isMoment(input) ? input : createLocal(input), 4929 inputMs; 4930 if (!(this.isValid() && localInput.isValid())) { 4931 return false; 4932 } 4933 units = normalizeUnits(units || 'millisecond'); 4934 if (units === 'millisecond') { 4935 return this.valueOf() === localInput.valueOf(); 4936 } else { 4937 inputMs = localInput.valueOf(); 4938 return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); 4939 } 4940} 4941 4942function isSameOrAfter (input, units) { 4943 return this.isSame(input, units) || this.isAfter(input,units); 4944} 4945 4946function isSameOrBefore (input, units) { 4947 return this.isSame(input, units) || this.isBefore(input,units); 4948} 4949 4950function diff (input, units, asFloat) { 4951 var that, 4952 zoneDelta, 4953 delta, output; 4954 4955 if (!this.isValid()) { 4956 return NaN; 4957 } 4958 4959 that = cloneWithOffset(input, this); 4960 4961 if (!that.isValid()) { 4962 return NaN; 4963 } 4964 4965 zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; 4966 4967 units = normalizeUnits(units); 4968 4969 switch (units) { 4970 case 'year': output = monthDiff(this, that) / 12; break; 4971 case 'month': output = monthDiff(this, that); break; 4972 case 'quarter': output = monthDiff(this, that) / 3; break; 4973 case 'second': output = (this - that) / 1e3; break; // 1000 4974 case 'minute': output = (this - that) / 6e4; break; // 1000 * 60 4975 case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60 4976 case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst 4977 case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst 4978 default: output = this - that; 4979 } 4980 4981 return asFloat ? output : absFloor(output); 4982} 4983 4984function monthDiff (a, b) { 4985 // difference in months 4986 var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), 4987 // b is in (anchor - 1 month, anchor + 1 month) 4988 anchor = a.clone().add(wholeMonthDiff, 'months'), 4989 anchor2, adjust; 4990 4991 if (b - anchor < 0) { 4992 anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); 4993 // linear across the month 4994 adjust = (b - anchor) / (anchor - anchor2); 4995 } else { 4996 anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); 4997 // linear across the month 4998 adjust = (b - anchor) / (anchor2 - anchor); 4999 } 5000 5001 //check for negative zero, return zero if negative zero 5002 return -(wholeMonthDiff + adjust) || 0; 5003} 5004 5005hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; 5006hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; 5007 5008function toString () { 5009 return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); 5010} 5011 5012function toISOString() { 5013 if (!this.isValid()) { 5014 return null; 5015 } 5016 var m = this.clone().utc(); 5017 if (m.year() < 0 || m.year() > 9999) { 5018 return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); 5019 } 5020 if (isFunction(Date.prototype.toISOString)) { 5021 // native implementation is ~50x faster, use it when we can 5022 return this.toDate().toISOString(); 5023 } 5024 return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); 5025} 5026 5027/** 5028 * Return a human readable representation of a moment that can 5029 * also be evaluated to get a new moment which is the same 5030 * 5031 * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects 5032 */ 5033function inspect () { 5034 if (!this.isValid()) { 5035 return 'moment.invalid(/* ' + this._i + ' */)'; 5036 } 5037 var func = 'moment'; 5038 var zone = ''; 5039 if (!this.isLocal()) { 5040 func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; 5041 zone = 'Z'; 5042 } 5043 var prefix = '[' + func + '("]'; 5044 var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY'; 5045 var datetime = '-MM-DD[T]HH:mm:ss.SSS'; 5046 var suffix = zone + '[")]'; 5047 5048 return this.format(prefix + year + datetime + suffix); 5049} 5050 5051function format (inputString) { 5052 if (!inputString) { 5053 inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; 5054 } 5055 var output = formatMoment(this, inputString); 5056 return this.localeData().postformat(output); 5057} 5058 5059function from (time, withoutSuffix) { 5060 if (this.isValid() && 5061 ((isMoment(time) && time.isValid()) || 5062 createLocal(time).isValid())) { 5063 return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); 5064 } else { 5065 return this.localeData().invalidDate(); 5066 } 5067} 5068 5069function fromNow (withoutSuffix) { 5070 return this.from(createLocal(), withoutSuffix); 5071} 5072 5073function to (time, withoutSuffix) { 5074 if (this.isValid() && 5075 ((isMoment(time) && time.isValid()) || 5076 createLocal(time).isValid())) { 5077 return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); 5078 } else { 5079 return this.localeData().invalidDate(); 5080 } 5081} 5082 5083function toNow (withoutSuffix) { 5084 return this.to(createLocal(), withoutSuffix); 5085} 5086 5087// If passed a locale key, it will set the locale for this 5088// instance. Otherwise, it will return the locale configuration 5089// variables for this instance. 5090function locale (key) { 5091 var newLocaleData; 5092 5093 if (key === undefined) { 5094 return this._locale._abbr; 5095 } else { 5096 newLocaleData = getLocale(key); 5097 if (newLocaleData != null) { 5098 this._locale = newLocaleData; 5099 } 5100 return this; 5101 } 5102} 5103 5104var lang = deprecate( 5105 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', 5106 function (key) { 5107 if (key === undefined) { 5108 return this.localeData(); 5109 } else { 5110 return this.locale(key); 5111 } 5112 } 5113); 5114 5115function localeData () { 5116 return this._locale; 5117} 5118 5119function startOf (units) { 5120 units = normalizeUnits(units); 5121 // the following switch intentionally omits break keywords 5122 // to utilize falling through the cases. 5123 switch (units) { 5124 case 'year': 5125 this.month(0); 5126 /* falls through */ 5127 case 'quarter': 5128 case 'month': 5129 this.date(1); 5130 /* falls through */ 5131 case 'week': 5132 case 'isoWeek': 5133 case 'day': 5134 case 'date': 5135 this.hours(0); 5136 /* falls through */ 5137 case 'hour': 5138 this.minutes(0); 5139 /* falls through */ 5140 case 'minute': 5141 this.seconds(0); 5142 /* falls through */ 5143 case 'second': 5144 this.milliseconds(0); 5145 } 5146 5147 // weeks are a special case 5148 if (units === 'week') { 5149 this.weekday(0); 5150 } 5151 if (units === 'isoWeek') { 5152 this.isoWeekday(1); 5153 } 5154 5155 // quarters are also special 5156 if (units === 'quarter') { 5157 this.month(Math.floor(this.month() / 3) * 3); 5158 } 5159 5160 return this; 5161} 5162 5163function endOf (units) { 5164 units = normalizeUnits(units); 5165 if (units === undefined || units === 'millisecond') { 5166 return this; 5167 } 5168 5169 // 'date' is an alias for 'day', so it should be considered as such. 5170 if (units === 'date') { 5171 units = 'day'; 5172 } 5173 5174 return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); 5175} 5176 5177function valueOf () { 5178 return this._d.valueOf() - ((this._offset || 0) * 60000); 5179} 5180 5181function unix () { 5182 return Math.floor(this.valueOf() / 1000); 5183} 5184 5185function toDate () { 5186 return new Date(this.valueOf()); 5187} 5188 5189function toArray () { 5190 var m = this; 5191 return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; 5192} 5193 5194function toObject () { 5195 var m = this; 5196 return { 5197 years: m.year(), 5198 months: m.month(), 5199 date: m.date(), 5200 hours: m.hours(), 5201 minutes: m.minutes(), 5202 seconds: m.seconds(), 5203 milliseconds: m.milliseconds() 5204 }; 5205} 5206 5207function toJSON () { 5208 // new Date(NaN).toJSON() === null 5209 return this.isValid() ? this.toISOString() : null; 5210} 5211 5212function isValid$2 () { 5213 return isValid(this); 5214} 5215 5216function parsingFlags () { 5217 return extend({}, getParsingFlags(this)); 5218} 5219
vendor: 11,965 bytes, lines 5220-5691
5220function invalidAt () { 5221 return getParsingFlags(this).overflow; 5222} 5223 5224function creationData() { 5225 return { 5226 input: this._i, 5227 format: this._f, 5228 locale: this._locale, 5229 isUTC: this._isUTC, 5230 strict: this._strict 5231 }; 5232} 5233 5234// FORMATTING 5235 5236addFormatToken(0, ['gg', 2], 0, function () { 5237 return this.weekYear() % 100; 5238}); 5239 5240addFormatToken(0, ['GG', 2], 0, function () { 5241 return this.isoWeekYear() % 100; 5242}); 5243 5244function addWeekYearFormatToken (token, getter) { 5245 addFormatToken(0, [token, token.length], 0, getter); 5246} 5247 5248addWeekYearFormatToken('gggg', 'weekYear'); 5249addWeekYearFormatToken('ggggg', 'weekYear'); 5250addWeekYearFormatToken('GGGG', 'isoWeekYear'); 5251addWeekYearFormatToken('GGGGG', 'isoWeekYear'); 5252 5253// ALIASES 5254 5255addUnitAlias('weekYear', 'gg'); 5256addUnitAlias('isoWeekYear', 'GG'); 5257 5258// PRIORITY 5259 5260addUnitPriority('weekYear', 1); 5261addUnitPriority('isoWeekYear', 1); 5262 5263 5264// PARSING 5265 5266addRegexToken('G', matchSigned); 5267addRegexToken('g', matchSigned); 5268addRegexToken('GG', match1to2, match2); 5269addRegexToken('gg', match1to2, match2); 5270addRegexToken('GGGG', match1to4, match4); 5271addRegexToken('gggg', match1to4, match4); 5272addRegexToken('GGGGG', match1to6, match6); 5273addRegexToken('ggggg', match1to6, match6); 5274 5275addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { 5276 week[token.substr(0, 2)] = toInt(input); 5277}); 5278 5279addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { 5280 week[token] = hooks.parseTwoDigitYear(input); 5281}); 5282 5283// MOMENTS 5284 5285function getSetWeekYear (input) { 5286 return getSetWeekYearHelper.call(this, 5287 input, 5288 this.week(), 5289 this.weekday(), 5290 this.localeData()._week.dow, 5291 this.localeData()._week.doy); 5292} 5293 5294function getSetISOWeekYear (input) { 5295 return getSetWeekYearHelper.call(this, 5296 input, this.isoWeek(), this.isoWeekday(), 1, 4); 5297} 5298 5299function getISOWeeksInYear () { 5300 return weeksInYear(this.year(), 1, 4); 5301} 5302 5303function getWeeksInYear () { 5304 var weekInfo = this.localeData()._week; 5305 return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); 5306} 5307 5308function getSetWeekYearHelper(input, week, weekday, dow, doy) { 5309 var weeksTarget; 5310 if (input == null) { 5311 return weekOfYear(this, dow, doy).year; 5312 } else { 5313 weeksTarget = weeksInYear(input, dow, doy); 5314 if (week > weeksTarget) { 5315 week = weeksTarget; 5316 } 5317 return setWeekAll.call(this, input, week, weekday, dow, doy); 5318 } 5319} 5320 5321function setWeekAll(weekYear, week, weekday, dow, doy) { 5322 var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), 5323 date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); 5324 5325 this.year(date.getUTCFullYear()); 5326 this.month(date.getUTCMonth()); 5327 this.date(date.getUTCDate()); 5328 return this; 5329} 5330 5331// FORMATTING 5332 5333addFormatToken('Q', 0, 'Qo', 'quarter'); 5334 5335// ALIASES 5336 5337addUnitAlias('quarter', 'Q'); 5338 5339// PRIORITY 5340 5341addUnitPriority('quarter', 7); 5342 5343// PARSING 5344 5345addRegexToken('Q', match1); 5346addParseToken('Q', function (input, array) { 5347 array[MONTH] = (toInt(input) - 1) * 3; 5348}); 5349 5350// MOMENTS 5351 5352function getSetQuarter (input) { 5353 return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); 5354} 5355 5356// FORMATTING 5357 5358addFormatToken('D', ['DD', 2], 'Do', 'date'); 5359 5360// ALIASES 5361 5362addUnitAlias('date', 'D'); 5363 5364// PRIOROITY 5365addUnitPriority('date', 9); 5366 5367// PARSING 5368 5369addRegexToken('D', match1to2); 5370addRegexToken('DD', match1to2, match2); 5371addRegexToken('Do', function (isStrict, locale) { 5372 // TODO: Remove "ordinalParse" fallback in next major release. 5373 return isStrict ? 5374 (locale._dayOfMonthOrdinalParse || locale._ordinalParse) : 5375 locale._dayOfMonthOrdinalParseLenient; 5376}); 5377 5378addParseToken(['D', 'DD'], DATE); 5379addParseToken('Do', function (input, array) { 5380 array[DATE] = toInt(input.match(match1to2)[0], 10); 5381}); 5382 5383// MOMENTS 5384 5385var getSetDayOfMonth = makeGetSet('Date', true); 5386 5387// FORMATTING 5388 5389addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); 5390 5391// ALIASES 5392 5393addUnitAlias('dayOfYear', 'DDD'); 5394 5395// PRIORITY 5396addUnitPriority('dayOfYear', 4); 5397 5398// PARSING 5399 5400addRegexToken('DDD', match1to3); 5401addRegexToken('DDDD', match3); 5402addParseToken(['DDD', 'DDDD'], function (input, array, config) { 5403 config._dayOfYear = toInt(input); 5404}); 5405 5406// HELPERS 5407 5408// MOMENTS 5409 5410function getSetDayOfYear (input) { 5411 var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; 5412 return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); 5413} 5414 5415// FORMATTING 5416 5417addFormatToken('m', ['mm', 2], 0, 'minute'); 5418 5419// ALIASES 5420 5421addUnitAlias('minute', 'm'); 5422 5423// PRIORITY 5424 5425addUnitPriority('minute', 14); 5426 5427// PARSING 5428 5429addRegexToken('m', match1to2); 5430addRegexToken('mm', match1to2, match2); 5431addParseToken(['m', 'mm'], MINUTE); 5432 5433// MOMENTS 5434 5435var getSetMinute = makeGetSet('Minutes', false); 5436 5437// FORMATTING 5438 5439addFormatToken('s', ['ss', 2], 0, 'second'); 5440 5441// ALIASES 5442 5443addUnitAlias('second', 's'); 5444 5445// PRIORITY 5446 5447addUnitPriority('second', 15); 5448 5449// PARSING 5450 5451addRegexToken('s', match1to2); 5452addRegexToken('ss', match1to2, match2); 5453addParseToken(['s', 'ss'], SECOND); 5454 5455// MOMENTS 5456 5457var getSetSecond = makeGetSet('Seconds', false); 5458 5459// FORMATTING 5460 5461addFormatToken('S', 0, 0, function () { 5462 return ~~(this.millisecond() / 100); 5463}); 5464 5465addFormatToken(0, ['SS', 2], 0, function () { 5466 return ~~(this.millisecond() / 10); 5467}); 5468 5469addFormatToken(0, ['SSS', 3], 0, 'millisecond'); 5470addFormatToken(0, ['SSSS', 4], 0, function () { 5471 return this.millisecond() * 10; 5472}); 5473addFormatToken(0, ['SSSSS', 5], 0, function () { 5474 return this.millisecond() * 100; 5475}); 5476addFormatToken(0, ['SSSSSS', 6], 0, function () { 5477 return this.millisecond() * 1000; 5478}); 5479addFormatToken(0, ['SSSSSSS', 7], 0, function () { 5480 return this.millisecond() * 10000; 5481}); 5482addFormatToken(0, ['SSSSSSSS', 8], 0, function () { 5483 return this.millisecond() * 100000; 5484}); 5485addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { 5486 return this.millisecond() * 1000000; 5487}); 5488 5489 5490// ALIASES 5491 5492addUnitAlias('millisecond', 'ms'); 5493 5494// PRIORITY 5495 5496addUnitPriority('millisecond', 16); 5497 5498// PARSING 5499 5500addRegexToken('S', match1to3, match1); 5501addRegexToken('SS', match1to3, match2); 5502addRegexToken('SSS', match1to3, match3); 5503 5504var token; 5505for (token = 'SSSS'; token.length <= 9; token += 'S') { 5506 addRegexToken(token, matchUnsigned); 5507} 5508 5509function parseMs(input, array) { 5510 array[MILLISECOND] = toInt(('0.' + input) * 1000); 5511} 5512 5513for (token = 'S'; token.length <= 9; token += 'S') { 5514 addParseToken(token, parseMs); 5515} 5516// MOMENTS 5517 5518var getSetMillisecond = makeGetSet('Milliseconds', false); 5519 5520// FORMATTING 5521 5522addFormatToken('z', 0, 0, 'zoneAbbr'); 5523addFormatToken('zz', 0, 0, 'zoneName'); 5524 5525// MOMENTS 5526 5527function getZoneAbbr () { 5528 return this._isUTC ? 'UTC' : ''; 5529} 5530 5531function getZoneName () { 5532 return this._isUTC ? 'Coordinated Universal Time' : ''; 5533} 5534 5535var proto = Moment.prototype; 5536 5537proto.add = add; 5538proto.calendar = calendar$1; 5539proto.clone = clone; 5540proto.diff = diff; 5541proto.endOf = endOf; 5542proto.format = format; 5543proto.from = from; 5544proto.fromNow = fromNow; 5545proto.to = to; 5546proto.toNow = toNow; 5547proto.get = stringGet; 5548proto.invalidAt = invalidAt; 5549proto.isAfter = isAfter; 5550proto.isBefore = isBefore; 5551proto.isBetween = isBetween; 5552proto.isSame = isSame; 5553proto.isSameOrAfter = isSameOrAfter; 5554proto.isSameOrBefore = isSameOrBefore; 5555proto.isValid = isValid$2; 5556proto.lang = lang; 5557proto.locale = locale; 5558proto.localeData = localeData; 5559proto.max = prototypeMax; 5560proto.min = prototypeMin; 5561proto.parsingFlags = parsingFlags; 5562proto.set = stringSet; 5563proto.startOf = startOf; 5564proto.subtract = subtract; 5565proto.toArray = toArray; 5566proto.toObject = toObject; 5567proto.toDate = toDate; 5568proto.toISOString = toISOString; 5569proto.inspect = inspect; 5570proto.toJSON = toJSON; 5571proto.toString = toString; 5572proto.unix = unix; 5573proto.valueOf = valueOf; 5574proto.creationData = creationData; 5575 5576// Year 5577proto.year = getSetYear; 5578proto.isLeapYear = getIsLeapYear; 5579 5580// Week Year 5581proto.weekYear = getSetWeekYear; 5582proto.isoWeekYear = getSetISOWeekYear; 5583 5584// Quarter 5585proto.quarter = proto.quarters = getSetQuarter; 5586 5587// Month 5588proto.month = getSetMonth; 5589proto.daysInMonth = getDaysInMonth; 5590 5591// Week 5592proto.week = proto.weeks = getSetWeek; 5593proto.isoWeek = proto.isoWeeks = getSetISOWeek; 5594proto.weeksInYear = getWeeksInYear; 5595proto.isoWeeksInYear = getISOWeeksInYear; 5596 5597// Day 5598proto.date = getSetDayOfMonth; 5599proto.day = proto.days = getSetDayOfWeek; 5600proto.weekday = getSetLocaleDayOfWeek; 5601proto.isoWeekday = getSetISODayOfWeek; 5602proto.dayOfYear = getSetDayOfYear; 5603 5604// Hour 5605proto.hour = proto.hours = getSetHour; 5606 5607// Minute 5608proto.minute = proto.minutes = getSetMinute; 5609 5610// Second 5611proto.second = proto.seconds = getSetSecond; 5612 5613// Millisecond 5614proto.millisecond = proto.milliseconds = getSetMillisecond; 5615 5616// Offset 5617proto.utcOffset = getSetOffset; 5618proto.utc = setOffsetToUTC; 5619proto.local = setOffsetToLocal; 5620proto.parseZone = setOffsetToParsedOffset; 5621proto.hasAlignedHourOffset = hasAlignedHourOffset; 5622proto.isDST = isDaylightSavingTime; 5623proto.isLocal = isLocal; 5624proto.isUtcOffset = isUtcOffset; 5625proto.isUtc = isUtc; 5626proto.isUTC = isUtc; 5627 5628// Timezone 5629proto.zoneAbbr = getZoneAbbr; 5630proto.zoneName = getZoneName; 5631 5632// Deprecations 5633proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); 5634proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); 5635proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); 5636proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); 5637proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); 5638 5639function createUnix (input) { 5640 return createLocal(input * 1000); 5641} 5642 5643function createInZone () { 5644 return createLocal.apply(null, arguments).parseZone(); 5645} 5646 5647function preParsePostFormat (string) { 5648 return string; 5649} 5650 5651var proto$1 = Locale.prototype; 5652 5653proto$1.calendar = calendar; 5654proto$1.longDateFormat = longDateFormat; 5655proto$1.invalidDate = invalidDate; 5656proto$1.ordinal = ordinal; 5657proto$1.preparse = preParsePostFormat; 5658proto$1.postformat = preParsePostFormat; 5659proto$1.relativeTime = relativeTime; 5660proto$1.pastFuture = pastFuture; 5661proto$1.set = set; 5662 5663// Month 5664proto$1.months = localeMonths; 5665proto$1.monthsShort = localeMonthsShort; 5666proto$1.monthsParse = localeMonthsParse; 5667proto$1.monthsRegex = monthsRegex; 5668proto$1.monthsShortRegex = monthsShortRegex; 5669 5670// Week 5671proto$1.week = localeWeek; 5672proto$1.firstDayOfYear = localeFirstDayOfYear; 5673proto$1.firstDayOfWeek = localeFirstDayOfWeek; 5674 5675// Day of Week 5676proto$1.weekdays = localeWeekdays; 5677proto$1.weekdaysMin = localeWeekdaysMin; 5678proto$1.weekdaysShort = localeWeekdaysShort; 5679proto$1.weekdaysParse = localeWeekdaysParse; 5680 5681proto$1.weekdaysRegex = weekdaysRegex; 5682proto$1.weekdaysShortRegex = weekdaysShortRegex; 5683proto$1.weekdaysMinRegex = weekdaysMinRegex; 5684 5685// Hours 5686proto$1.isPM = localeIsPM; 5687proto$1.meridiem = localeMeridiem; 5688 5689function get$1 (format, index, field, setter) { 5690 var locale = getLocale(); 5691 var utc = createUTC().set(setter, index);
vendor: 7,931 bytes, lines 5692-5984
5692 return locale[field](utc, format); 5693} 5694 5695function listMonthsImpl (format, index, field) { 5696 if (isNumber(format)) { 5697 index = format; 5698 format = undefined; 5699 } 5700 5701 format = format || ''; 5702 5703 if (index != null) { 5704 return get$1(format, index, field, 'month'); 5705 } 5706 5707 var i; 5708 var out = []; 5709 for (i = 0; i < 12; i++) { 5710 out[i] = get$1(format, i, field, 'month'); 5711 } 5712 return out; 5713} 5714 5715// () 5716// (5) 5717// (fmt, 5) 5718// (fmt) 5719// (true) 5720// (true, 5) 5721// (true, fmt, 5) 5722// (true, fmt) 5723function listWeekdaysImpl (localeSorted, format, index, field) { 5724 if (typeof localeSorted === 'boolean') { 5725 if (isNumber(format)) { 5726 index = format; 5727 format = undefined; 5728 } 5729 5730 format = format || ''; 5731 } else { 5732 format = localeSorted; 5733 index = format; 5734 localeSorted = false; 5735 5736 if (isNumber(format)) { 5737 index = format; 5738 format = undefined; 5739 } 5740 5741 format = format || ''; 5742 } 5743 5744 var locale = getLocale(), 5745 shift = localeSorted ? locale._week.dow : 0; 5746 5747 if (index != null) { 5748 return get$1(format, (index + shift) % 7, field, 'day'); 5749 } 5750 5751 var i; 5752 var out = []; 5753 for (i = 0; i < 7; i++) { 5754 out[i] = get$1(format, (i + shift) % 7, field, 'day'); 5755 } 5756 return out; 5757} 5758 5759function listMonths (format, index) { 5760 return listMonthsImpl(format, index, 'months'); 5761} 5762 5763function listMonthsShort (format, index) { 5764 return listMonthsImpl(format, index, 'monthsShort'); 5765} 5766 5767function listWeekdays (localeSorted, format, index) { 5768 return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); 5769} 5770 5771function listWeekdaysShort (localeSorted, format, index) { 5772 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); 5773} 5774 5775function listWeekdaysMin (localeSorted, format, index) { 5776 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); 5777} 5778 5779getSetGlobalLocale('en', { 5780 dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, 5781 ordinal : function (number) { 5782 var b = number % 10, 5783 output = (toInt(number % 100 / 10) === 1) ? 'th' : 5784 (b === 1) ? 'st' : 5785 (b === 2) ? 'nd' : 5786 (b === 3) ? 'rd' : 'th'; 5787 return number + output; 5788 } 5789}); 5790 5791// Side effect imports 5792hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); 5793hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); 5794 5795var mathAbs = Math.abs; 5796 5797function abs () { 5798 var data = this._data; 5799 5800 this._milliseconds = mathAbs(this._milliseconds); 5801 this._days = mathAbs(this._days); 5802 this._months = mathAbs(this._months); 5803 5804 data.milliseconds = mathAbs(data.milliseconds); 5805 data.seconds = mathAbs(data.seconds); 5806 data.minutes = mathAbs(data.minutes); 5807 data.hours = mathAbs(data.hours); 5808 data.months = mathAbs(data.months); 5809 data.years = mathAbs(data.years); 5810 5811 return this; 5812} 5813 5814function addSubtract$1 (duration, input, value, direction) { 5815 var other = createDuration(input, value); 5816 5817 duration._milliseconds += direction * other._milliseconds; 5818 duration._days += direction * other._days; 5819 duration._months += direction * other._months; 5820 5821 return duration._bubble(); 5822} 5823 5824// supports only 2.0-style add(1, 's') or add(duration) 5825function add$1 (input, value) { 5826 return addSubtract$1(this, input, value, 1); 5827} 5828 5829// supports only 2.0-style subtract(1, 's') or subtract(duration) 5830function subtract$1 (input, value) { 5831 return addSubtract$1(this, input, value, -1); 5832} 5833 5834function absCeil (number) { 5835 if (number < 0) { 5836 return Math.floor(number); 5837 } else { 5838 return Math.ceil(number); 5839 } 5840} 5841 5842function bubble () { 5843 var milliseconds = this._milliseconds; 5844 var days = this._days; 5845 var months = this._months; 5846 var data = this._data; 5847 var seconds, minutes, hours, years, monthsFromDays; 5848 5849 // if we have a mix of positive and negative values, bubble down first 5850 // check: https://github.com/moment/moment/issues/2166 5851 if (!((milliseconds >= 0 && days >= 0 && months >= 0) || 5852 (milliseconds <= 0 && days <= 0 && months <= 0))) { 5853 milliseconds += absCeil(monthsToDays(months) + days) * 864e5; 5854 days = 0; 5855 months = 0; 5856 } 5857 5858 // The following code bubbles up values, see the tests for 5859 // examples of what that means. 5860 data.milliseconds = milliseconds % 1000; 5861 5862 seconds = absFloor(milliseconds / 1000); 5863 data.seconds = seconds % 60; 5864 5865 minutes = absFloor(seconds / 60); 5866 data.minutes = minutes % 60; 5867 5868 hours = absFloor(minutes / 60); 5869 data.hours = hours % 24; 5870 5871 days += absFloor(hours / 24); 5872 5873 // convert days to months 5874 monthsFromDays = absFloor(daysToMonths(days)); 5875 months += monthsFromDays; 5876 days -= absCeil(monthsToDays(monthsFromDays)); 5877 5878 // 12 months -> 1 year 5879 years = absFloor(months / 12); 5880 months %= 12; 5881 5882 data.days = days; 5883 data.months = months; 5884 data.years = years; 5885 5886 return this; 5887} 5888 5889function daysToMonths (days) { 5890 // 400 years have 146097 days (taking into account leap year rules) 5891 // 400 years have 12 months === 4800 5892 return days * 4800 / 146097; 5893} 5894 5895function monthsToDays (months) { 5896 // the reverse of daysToMonths 5897 return months * 146097 / 4800; 5898} 5899 5900function as (units) { 5901 if (!this.isValid()) { 5902 return NaN; 5903 } 5904 var days; 5905 var months; 5906 var milliseconds = this._milliseconds; 5907 5908 units = normalizeUnits(units); 5909 5910 if (units === 'month' || units === 'year') { 5911 days = this._days + milliseconds / 864e5; 5912 months = this._months + daysToMonths(days); 5913 return units === 'month' ? months : months / 12; 5914 } else { 5915 // handle milliseconds separately because of floating point math errors (issue #1867) 5916 days = this._days + Math.round(monthsToDays(this._months)); 5917 switch (units) { 5918 case 'week' : return days / 7 + milliseconds / 6048e5; 5919 case 'day' : return days + milliseconds / 864e5; 5920 case 'hour' : return days * 24 + milliseconds / 36e5; 5921 case 'minute' : return days * 1440 + milliseconds / 6e4; 5922 case 'second' : return days * 86400 + milliseconds / 1000; 5923 // Math.floor prevents floating point math errors here 5924 case 'millisecond': return Math.floor(days * 864e5) + milliseconds; 5925 default: throw new Error('Unknown unit ' + units); 5926 } 5927 } 5928} 5929 5930// TODO: Use this.as('ms')? 5931function valueOf$1 () { 5932 if (!this.isValid()) { 5933 return NaN; 5934 } 5935 return ( 5936 this._milliseconds + 5937 this._days * 864e5 + 5938 (this._months % 12) * 2592e6 + 5939 toInt(this._months / 12) * 31536e6 5940 ); 5941} 5942 5943function makeAs (alias) { 5944 return function () { 5945 return this.as(alias); 5946 }; 5947} 5948 5949var asMilliseconds = makeAs('ms'); 5950var asSeconds = makeAs('s'); 5951var asMinutes = makeAs('m'); 5952var asHours = makeAs('h'); 5953var asDays = makeAs('d'); 5954var asWeeks = makeAs('w'); 5955var asMonths = makeAs('M'); 5956var asYears = makeAs('y'); 5957 5958function clone$1 () { 5959 return createDuration(this); 5960} 5961 5962function get$2 (units) { 5963 units = normalizeUnits(units); 5964 return this.isValid() ? this[units + 's']() : NaN; 5965} 5966 5967function makeGetter(name) { 5968 return function () { 5969 return this.isValid() ? this._data[name] : NaN; 5970 }; 5971} 5972 5973var milliseconds = makeGetter('milliseconds'); 5974var seconds = makeGetter('seconds'); 5975var minutes = makeGetter('minutes'); 5976var hours = makeGetter('hours'); 5977var days = makeGetter('days'); 5978var months = makeGetter('months'); 5979var years = makeGetter('years'); 5980 5981function weeks () { 5982 return absFloor(this.days() / 7); 5983} 5984
vendor: 6,285 bytes, lines 5985-6181
5985var round = Math.round; 5986var thresholds = { 5987 ss: 44, // a few seconds to seconds 5988 s : 45, // seconds to minute 5989 m : 45, // minutes to hour 5990 h : 22, // hours to day 5991 d : 26, // days to month 5992 M : 11 // months to year 5993}; 5994 5995// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize 5996function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { 5997 return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); 5998} 5999 6000function relativeTime$1 (posNegDuration, withoutSuffix, locale) { 6001 var duration = createDuration(posNegDuration).abs(); 6002 var seconds = round(duration.as('s')); 6003 var minutes = round(duration.as('m')); 6004 var hours = round(duration.as('h')); 6005 var days = round(duration.as('d')); 6006 var months = round(duration.as('M')); 6007 var years = round(duration.as('y')); 6008 6009 var a = seconds <= thresholds.ss && ['s', seconds] || 6010 seconds < thresholds.s && ['ss', seconds] || 6011 minutes <= 1 && ['m'] || 6012 minutes < thresholds.m && ['mm', minutes] || 6013 hours <= 1 && ['h'] || 6014 hours < thresholds.h && ['hh', hours] || 6015 days <= 1 && ['d'] || 6016 days < thresholds.d && ['dd', days] || 6017 months <= 1 && ['M'] || 6018 months < thresholds.M && ['MM', months] || 6019 years <= 1 && ['y'] || ['yy', years]; 6020 6021 a[2] = withoutSuffix; 6022 a[3] = +posNegDuration > 0; 6023 a[4] = locale; 6024 return substituteTimeAgo.apply(null, a); 6025} 6026 6027// This function allows you to set the rounding function for relative time strings 6028function getSetRelativeTimeRounding (roundingFunction) { 6029 if (roundingFunction === undefined) { 6030 return round; 6031 } 6032 if (typeof(roundingFunction) === 'function') { 6033 round = roundingFunction; 6034 return true; 6035 } 6036 return false; 6037} 6038 6039// This function allows you to set a threshold for relative time strings 6040function getSetRelativeTimeThreshold (threshold, limit) { 6041 if (thresholds[threshold] === undefined) { 6042 return false; 6043 } 6044 if (limit === undefined) { 6045 return thresholds[threshold]; 6046 } 6047 thresholds[threshold] = limit; 6048 if (threshold === 's') { 6049 thresholds.ss = limit - 1; 6050 } 6051 return true; 6052} 6053 6054function humanize (withSuffix) { 6055 if (!this.isValid()) { 6056 return this.localeData().invalidDate(); 6057 } 6058 6059 var locale = this.localeData(); 6060 var output = relativeTime$1(this, !withSuffix, locale); 6061 6062 if (withSuffix) { 6063 output = locale.pastFuture(+this, output); 6064 } 6065 6066 return locale.postformat(output); 6067} 6068 6069var abs$1 = Math.abs; 6070 6071function sign(x) { 6072 return ((x > 0) - (x < 0)) || +x; 6073} 6074 6075function toISOString$1() { 6076 // for ISO strings we do not use the normal bubbling rules: 6077 // * milliseconds bubble up until they become hours 6078 // * days do not bubble at all 6079 // * months bubble up until they become years 6080 // This is because there is no context-free conversion between hours and days 6081 // (think of clock changes) 6082 // and also not between days and months (28-31 days per month) 6083 if (!this.isValid()) { 6084 return this.localeData().invalidDate(); 6085 } 6086 6087 var seconds = abs$1(this._milliseconds) / 1000; 6088 var days = abs$1(this._days); 6089 var months = abs$1(this._months); 6090 var minutes, hours, years; 6091 6092 // 3600 seconds -> 60 minutes -> 1 hour 6093 minutes = absFloor(seconds / 60); 6094 hours = absFloor(minutes / 60); 6095 seconds %= 60; 6096 minutes %= 60; 6097 6098 // 12 months -> 1 year 6099 years = absFloor(months / 12); 6100 months %= 12; 6101 6102 6103 // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js 6104 var Y = years; 6105 var M = months; 6106 var D = days; 6107 var h = hours; 6108 var m = minutes; 6109 var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; 6110 var total = this.asSeconds(); 6111 6112 if (!total) { 6113 // this is the same as C#'s (Noda) and python (isodate)... 6114 // but not other JS (goog.date) 6115 return 'P0D'; 6116 } 6117 6118 var totalSign = total < 0 ? '-' : ''; 6119 var ymSign = sign(this._months) !== sign(total) ? '-' : ''; 6120 var daysSign = sign(this._days) !== sign(total) ? '-' : ''; 6121 var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; 6122 6123 return totalSign + 'P' + 6124 (Y ? ymSign + Y + 'Y' : '') + 6125 (M ? ymSign + M + 'M' : '') + 6126 (D ? daysSign + D + 'D' : '') + 6127 ((h || m || s) ? 'T' : '') + 6128 (h ? hmsSign + h + 'H' : '') + 6129 (m ? hmsSign + m + 'M' : '') + 6130 (s ? hmsSign + s + 'S' : ''); 6131} 6132 6133var proto$2 = Duration.prototype; 6134 6135proto$2.isValid = isValid$1; 6136proto$2.abs = abs; 6137proto$2.add = add$1; 6138proto$2.subtract = subtract$1; 6139proto$2.as = as; 6140proto$2.asMilliseconds = asMilliseconds; 6141proto$2.asSeconds = asSeconds; 6142proto$2.asMinutes = asMinutes; 6143proto$2.asHours = asHours; 6144proto$2.asDays = asDays; 6145proto$2.asWeeks = asWeeks; 6146proto$2.asMonths = asMonths; 6147proto$2.asYears = asYears; 6148proto$2.valueOf = valueOf$1; 6149proto$2._bubble = bubble; 6150proto$2.clone = clone$1; 6151proto$2.get = get$2; 6152proto$2.milliseconds = milliseconds; 6153proto$2.seconds = seconds; 6154proto$2.minutes = minutes; 6155proto$2.hours = hours; 6156proto$2.days = days; 6157proto$2.weeks = weeks; 6158proto$2.months = months; 6159proto$2.years = years; 6160proto$2.humanize = humanize; 6161proto$2.toISOString = toISOString$1; 6162proto$2.toString = toISOString$1; 6163proto$2.toJSON = toISOString$1; 6164proto$2.locale = locale; 6165proto$2.localeData = localeData; 6166 6167// Deprecations 6168proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); 6169proto$2.lang = lang; 6170 6171// Side effect imports 6172 6173// FORMATTING 6174 6175addFormatToken('X', 0, 0, 'unix'); 6176addFormatToken('x', 0, 0, 'valueOf'); 6177 6178// PARSING 6179 6180addRegexToken('x', matchSigned); 6181addRegexToken('X', matchTimestamp);
6182addParseToken('X', function (input, array, config) { 6183 config._d = new Date(parseFloat(input, 10) * 1000); 6184}); 6185addParseToken('x', function (input, array, config) { 6186 config._d = new Date(toInt(input)); 6187}); 6188 6189// Side effect imports 6190 6191 6192hooks.version = '2.19.3'; 6193 6194setHookCallback(createLocal); 6195 6196hooks.fn = proto; 6197hooks.min = min; 6198hooks.max = max; 6199hooks.now = now; 6200hooks.utc = createUTC; 6201hooks.unix = createUnix; 6202hooks.months = listMonths; 6203hooks.isDate = isDate; 6204hooks.locale = getSetGlobalLocale; 6205hooks.invalid = createInvalid; 6206hooks.duration = createDuration; 6207hooks.isMoment = isMoment; 6208hooks.weekdays = listWeekdays; 6209hooks.parseZone = createInZone; 6210hooks.localeData = getLocale; 6211hooks.isDuration = isDuration; 6212hooks.monthsShort = listMonthsShort; 6213hooks.weekdaysMin = listWeekdaysMin; 6214hooks.defineLocale = defineLocale; 6215hooks.updateLocale = updateLocale; 6216hooks.locales = listLocales; 6217hooks.weekdaysShort = listWeekdaysShort; 6218hooks.normalizeUnits = normalizeUnits; 6219hooks.relativeTimeRounding = getSetRelativeTimeRounding; 6220hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; 6221hooks.calendarFormat = getCalendarFormat; 6222hooks.prototype = proto; 6223 6224return hooks; 6225 6226}))); 6227// source --> https://nieruchomoscipafos.pl/wp-content/plugins/essential-addons-for-elementor-lite/assets/social-feeds/jquery.socialfeed.js?ver=1.0 6228if (typeof Object.create !== 'function') { 6229 Object.create = function(obj) { 6230 function F() {} 6231 F.prototype = obj; 6232 return new F(); 6233 }; 6234} 6235 6236(function($, window, document, undefined) { 6237 $.fn.socialfeed = function(_options) { 6238 6239 6240 var defaults = { 6241 plugin_folder: '', // a folder in which the plugin is located (with a slash in the end) 6242 template: 'template.html', // a path to the template file 6243 show_media: false, // show images of attachments if available 6244 media_min_width: 300, 6245 length: 500, // maximum length of post message shown 6246 date_format: 'll', 6247 date_locale: 'en' 6248 }; 6249 //--------------------------------------------------------------------------------- 6250 var options = $.extend(defaults, _options), 6251 container = $(this), 6252 template, 6253 social_networks = ['facebook', 'instagram', 'vk', 'google', 'blogspot', 'twitter', 'pinterest', 'rss'], 6254 posts_to_load_count = 0, 6255 loaded_post_count = 0; 6256 // container.empty().css('display', 'block'); 6257 //--------------------------------------------------------------------------------- 6258 6259 //--------------------------------------------------------------------------------- 6260 // This function performs consequent data loading from all of the sources by calling corresponding functions 6261 function calculatePostsToLoadCount() { 6262 social_networks.forEach(function(network) { 6263 if (options[network]) { 6264 if (options[network].accounts) { 6265 posts_to_load_count += options[network].limit * options[network].accounts.length; 6266 } else if (options[network].urls ){ 6267 posts_to_load_count += options[network].limit * options[network].urls.length; 6268 } else { 6269 posts_to_load_count += options[network].limit; 6270 } 6271 } 6272 }); 6273 } 6274 6275 calculatePostsToLoadCount(); 6276 6277 function fireCallback() { 6278 var fire = true; 6279 /*$.each(Object.keys(loaded), function() { 6280 if (loaded[this] > 0) 6281 fire = false; 6282 });*/ 6283 if (fire && options.callback) { 6284 options.callback(); 6285 } 6286 } 6287 6288 var Utility = { 6289 request: function(url, callback) { 6290 $.ajax({ 6291 url: url, 6292 dataType: 'jsonp', 6293 success: callback 6294 }); 6295 }, 6296 get_request: function(url, callback) { 6297 $.get(url, callback, 'json'); 6298 }, 6299 wrapLinks: function(string, social_network) { 6300 var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; 6301 if (social_network === 'google-plus') {
6302 string = string.replace(/(@|#)([a-z0-9_]+['])/ig, Utility.wrapGoogleplusTagTemplate); 6303 } else { 6304 string = string.replace(exp, Utility.wrapLinkTemplate); 6305 } 6306 return string; 6307 }, 6308 wrapLinkTemplate: function(string) { 6309 return '<a target="_blank" href="' + string + '">' + string + '<\/a>'; 6310 }, 6311 wrapGoogleplusTagTemplate: function(string) { 6312 return '<a target="_blank" href="https://plus.google.com/s/' + string + '" >' + string + '<\/a>'; 6313 }, 6314 shorten: function(string) { 6315 string = $.trim(string); 6316 if (string.length > options.length) { 6317 return jQuery.trim(string).substring(0, options.length).split(" ").slice(0, -1).join(" ") + "..."; 6318 } else { 6319 return string; 6320 } 6321 }, 6322 stripHTML: function(string) { 6323 if (typeof string === "undefined" || string === null) { 6324 return ''; 6325 } 6326 return string.replace(/(<([^>]+)>)|nbsp;|\s{2,}|/ig, ""); 6327 } 6328 }; 6329 6330 function SocialFeedPost(social_network, data) { 6331 this.content = data; 6332 this.content.social_network = social_network; 6333 this.content.attachment = (this.content.attachment === undefined) ? '' : this.content.attachment; 6334 this.content.time_ago = data.dt_create.locale(options.date_locale).fromNow(); 6335 this.content.date = data.dt_create.locale(options.date_locale).format(options.date_format); 6336 this.content.dt_create = this.content.dt_create.valueOf(); 6337 this.content.text = Utility.wrapLinks(Utility.shorten(data.message + ' ' + data.description), data.social_network); 6338 this.content.moderation_passed = (options.moderation) ? options.moderation(this.content) : true; 6339 6340 Feed[social_network].posts.push(this); 6341 } 6342 SocialFeedPost.prototype = { 6343 render: function() { 6344 var rendered_html = Feed.template(this.content); 6345 var data = this.content; 6346 6347 if ($(container).children('[social-feed-id=' + data.id + ']').length !== 0) { 6348 return false; 6349 } 6350 if ($(container).children().length === 0) { 6351 $(container).append(rendered_html); 6352 } else { 6353 var i = 0, 6354 insert_index = -1; 6355 $.each($(container).children(), function() { 6356 if ($(this).attr('dt-create') < data.dt_create) { 6357 insert_index = i; 6358 return false; 6359 } 6360 i++; 6361 }); 6362 $(container).append(rendered_html); 6363 if (insert_index >= 0) { 6364 insert_index++; 6365 var before = $(container).children('div:nth-child(' + insert_index + ')'), 6366 current = $(container).children('div:last-child'); 6367 $(current).insertBefore(before); 6368 } 6369 6370 } 6371 if (options.media_min_width) { 6372 6373 var query = '[social-feed-id=' + data.id + '] img.attachment'; 6374 var image = $(query); 6375 6376 // preload the image 6377 var height, width = ''; 6378 var img = new Image(); 6379 var imgSrc = image.attr("src"); 6380 6381 $(img).on('load',function() { 6382 if (img.width < options.media_min_width) { 6383 image.hide(); 6384 } 6385 // garbage collect img 6386 delete img; 6387 }).on('error', function() { 6388 // image couldnt be loaded 6389 image.hide(); 6390 6391 }).attr({ 6392 src: imgSrc 6393 }); 6394 } 6395 6396 loaded_post_count++; 6397 if (loaded_post_count == posts_to_load_count) { 6398 fireCallback(); 6399 } 6400 6401 } 6402 6403 }; 6404 6405 var Feed = { 6406 template: false, 6407 init: function() { 6408 Feed.getTemplate(function() { 6409 social_networks.forEach(function(network) { 6410 if (options[network]) { 6411 if ( options[network].accounts ) { 6412 //loaded[network] = 0; 6413 options[network].accounts.forEac
6413h(function(account) { 6414 //loaded[network]++; 6415 Feed[network].getData(account); 6416 }); 6417 } else if ( options[network].urls ) { 6418 options[network].urls.forEach(function(url) { 6419 Feed[network].getData(url); 6420 }); 6421 } else { 6422 Feed[network].getData(); 6423 } 6424 } 6425 }); 6426 }); 6427 }, 6428 getTemplate: function(callback) { 6429 if (Feed.template) 6430 return callback(); 6431 else { 6432 if (options.template_html) { 6433 Feed.template = doT.template(options.template_html); 6434 return callback(); 6435 } else { 6436 $.get(options.template, function(template_html) { 6437 Feed.template = doT.template(template_html); 6438 return callback(); 6439 }); 6440 } 6441 } 6442 }, 6443 twitter: { 6444 posts: [], 6445 loaded: false, 6446 api: 'http://api.tweecool.com/', 6447 6448 getData: function(account) { 6449 6450 var cb = new Codebird(); 6451 cb.setConsumerKey(options.twitter.consumer_key, options.twitter.consumer_secret); 6452 6453 // Allow setting your own proxy with Codebird 6454 if (options.twitter.proxy !== undefined) { 6455 cb.setProxy(options.twitter.proxy); 6456 } 6457 6458 switch (account[0]) { 6459 case '@': 6460 var userid = account.substr(1); 6461 cb.__call( 6462 "statuses_userTimeline", 6463 { 6464 "id": userid, 6465 "count": options.twitter.limit, 6466 "tweet_mode": typeof options.twitter.tweet_mode === "undefined" ? "compatibility" : options.twitter.tweet_mode 6467 }, 6468 Feed.twitter.utility.getPosts, 6469 true // this parameter required 6470 ); 6471 break; 6472 case '#': 6473 var hashtag = account.substr(1); 6474 cb.__call( 6475 "search_tweets", 6476 { 6477 "q": hashtag, 6478 "count": options.twitter.limit, 6479 "tweet_mode": typeof options.twitter.tweet_mode === "undefined" ? "compatibility" : options.twitter.tweet_mode 6480 }, 6481 function(reply) { 6482 Feed.twitter.utility.getPosts(reply.statuses); 6483 }, 6484 true // this parameter required 6485 ); 6486 break; 6487 default: 6488 } 6489 }, 6490 utility: { 6491 getPosts: function(json) { 6492 if (json) { 6493 $.each(json, function() { 6494 var element = this; 6495 var post = new SocialFeedPost('twitter', Feed.twitter.utility.unifyPostData(element)); 6496 post.render(); 6497 }); 6498 } 6499 }, 6500 unifyPostData: function(element) { 6501 var post = {}; 6502 if (element.id) { 6503 post.id = element.id_str; 6504 //prevent a moment.js console warning due to Twitter's poor date format. 6505 post.dt_create = moment(element.created_at, 'dd MMM DD HH:mm:ss ZZ YYYY'); 6506 post.author_link = 'http://twitter.com/' + element.user.screen_name; 6507 post.author_picture = element.user.profile_image_url_https; 6508 post.post_url = post.author_link + '/status/' + element.i
6508d_str; 6509 post.author_name = element.user.name; 6510 post.message = typeof element.text === "undefined" 6511 ? element.full_text.substr(element.display_text_range[0], element.display_text_range[1]) 6512 : element.text; 6513 post.description = ''; 6514 post.link = 'http://twitter.com/' + element.user.screen_name + '/status/' + element.id_str; 6515 6516 if (options.show_media === true) { 6517 if (element.entities.media && element.entities.media.length > 0) { 6518 var image_url = element.entities.media[0].media_url_https; 6519 if (image_url) { 6520 post.attachment = '<img class="attachment" src="' + image_url + '" />'; 6521 } 6522 } 6523 } 6524 } 6525 return post; 6526 } 6527 } 6528 }, 6529 facebook: { 6530 posts: [], 6531 graph: 'https://graph.facebook.com/', 6532 loaded: false, 6533 getData: function(account) { 6534 var proceed = function(request_url){ 6535 Utility.request(request_url, Feed.facebook.utility.getPosts); 6536 }; 6537 var fields = '?fields=id,from,name,message,created_time,story,description,link'; 6538 fields += (options.show_media === true)?',picture,object_id':''; 6539 var request_url, limit = '&limit=' + options.facebook.limit,
6540 query_extention = '&access_token=' + options.facebook.access_token + '&callback=?'; 6541 switch (account[0]) { 6542 case '@': 6543 var username = account.substr(1); 6544 Feed.facebook.utility.getUserId(username, function(userdata) { 6545 if (userdata.id !== '') { 6546 request_url = Feed.facebook.graph + 'v2.12/' + userdata.id + '/posts'+ fields + limit + query_extention; 6547 proceed(request_url); 6548 } 6549 }); 6550 break; 6551 case '!': 6552 var page = account.substr(1); 6553 request_url = Feed.facebook.graph + 'v2.12/' + page + '/feed'+ fields + limit + query_extention; 6554 proceed(request_url); 6555 break; 6556 default: 6557 proceed(request_url); 6558 } 6559 }, 6560 utility: { 6561 getUserId: function(username, callback) {
6562 var query_extention = '&access_token=' + options.facebook.access_token + '&callback=?'; 6563 var url = 'https://graph.facebook.com/' + username + '?' + query_extention; 6564 var result = ''; 6565 $.get(url, callback, 'json'); 6566 }, 6567 prepareAttachment: function(element) { 6568 var image_url = element.picture; 6569 if (image_url.indexOf('_b.') !== -1) { 6570 //do nothing it is already big 6571 } else if (image_url.indexOf('safe_image.php') !== -1) { 6572 image_url = Feed.facebook.utility.getExternalImageURL(image_url, 'url'); 6573 6574 } else if (image_url.indexOf('app_full_proxy.php') !== -1) { 6575 image_url = Feed.facebook.utility.getExternalImageURL(image_url, 'src'); 6576 6577 } else if (element.object_id) { 6578 image_url = Feed.facebook.graph + element.object_id + '/picture/?type=normal'; 6579 } 6580 return '<img class="attachment" src="' + image_url + '" />'; 6581 }, 6582 getExternalImageURL: function(image_url, parameter) { 6583 image_url = decodeURIComponent(image_url).split(parameter + '=')[1]; 6584 if (image_url.indexOf('fbcdn-sphotos') === -1) { 6585 return image_url.split('&')[0]; 6586 } else { 6587 return image_url; 6588 } 6589 6590 }, 6591 getPosts: function(json) { 6592 if (json['data']) { 6593 json['data'].forEach(function(element) { 6594 var post = new SocialFeedPost('facebook', Feed.facebook.utility.unifyPostData(element)); 6595 post.render(); 6596 }); 6597 } 6598 }, 6599 unifyPostData: function(element) { 6600 var post = {}, 6601 text = (element.message) ? element.message : element.story; 6602 6603 post.id = element.id; 6604 post.dt_create = moment(element.created_time); 6605 post.author_link = 'http://facebook.com/' + element.from.id; 6606 post.author_picture = Feed.facebook.graph + element.from.id + '/picture'; 6607 post.author_name = element.from.name; 6608 post.name = element.name || ""; 6609 post.message = (text) ? text : ''; 6610 post.description = (element.description) ? element.description : ''; 6611 post.link = (element.link) ? element.link : 'http://facebook.com/' + element.from.id; 6612 6613 if (options.show_media === true) { 6614 if (element.picture) { 6615 var attachment = Feed.facebook.utility.prepareAttachment(element); 6616 if (attachment) { 6617 post.attachment = attachment; 6618 } 6619 } 6620 } 6621 return post; 6622 } 6623 } 6624 }, 6625 google: { 6626 posts: [], 6627 loaded: false, 6628 api: 'https://www.googleapis.com/plus/v1/', 6629 getData: function(account) { 6630 var request_url; 6631 switch (account[0]) { 6632 case '#': 6633 var hashtag = account.substr(1); 6634 request_url = Feed.google.api + 'activities?query=' + hashtag + '&key=' + options.google.access_token + '&maxResults=' + options.google.limit; 6635 Utility.get_request(request_url, Feed.google.utility.getPosts); 6636 break; 6637 case '@': 6638 var username = account.substr(1); 6639 request_url = Feed.google.api + 'people/' + username + '/activities/public?key=' + options.google.access_token + '&maxResults=' + options.google.limit; 6640 Utility.get_request(request_url, Feed.google.utility.getPosts); 6641 break; 6642 default: 6643 } 6644 }, 6645 utility: { 6646 getPosts: function(json) { 6647 if (json.items) { 6648 $.each(json.items, function(i) { 6649 var post = new SocialFeedPost('google', Feed.google.utility.unifyPostData(json.items[i])); 6650 post.render(); 6651 }); 6652 } 6653 }, 6654 unifyPostData: function(element) { 6655 var post = {}; 6656
6657 post.id = element.id; 6658 post.attachment = ''; 6659 post.description = ''; 6660 post.dt_create = moment(element.published); 6661 post.author_link = element.actor.url; 6662 post.author_picture = element.actor.image.url; 6663 post.author_name = element.actor.displayName; 6664 6665 if (options.show_media === true) { 6666 if (element.object.attachments) { 6667 $.each(element.object.attachments, function() { 6668 var image = ''; 6669 if (this.fullImage) { 6670 image = this.fullImage.url; 6671 } else { 6672 if (this.objectType === 'album') { 6673 if (this.thumbnails && this.thumbnails.length > 0) { 6674 if (this.thumbnails[0].image) { 6675 image = this.thumbnails[0].image.url; 6676 } 6677 } 6678 } 6679 } 6680 post.attachment = '<img class="attachment" src="' + image
6680+ '"/>'; 6681 }); 6682 } 6683 } 6684 post.message = element.title; 6685 post.link = element.url; 6686 6687 return post; 6688 } 6689 } 6690 }, 6691 instagram: { 6692 posts: [], 6693 api: 'https://api.instagram.com/v1/', 6694 loaded: false, 6695 accessType: function() { 6696 // If we have both the client_id and access_token set in options, 6697 // use access_token for authentication. If client_id is not set 6698 // then use access_token. If neither are set, log an error to console. 6699 if (typeof options.instagram.access_token === 'undefined' && typeof options.instagram.client_id === 'undefined') { 6700 console.log('You need to define a client_id or access_token to authenticate with Instagram\'s API.'); 6701 return undefined; 6702 } 6703 if (options.instagram.access_token) { options.instagram.client_id = undefined; } 6704 options.instagram.access_type = (typeof options.instagram.client_id === 'undefined' ? 'access_token' : 'client_id'); 6705 return options.instagram.access_type; 6706 }, 6707 getData: function(account) { 6708 var url; 6709 6710 // API endpoint URL depends on which authentication type we're using. 6711 if (this.accessType() !== 'undefined') { 6712 var authTokenParams = options.instagram.access_type + '=' + options.instagram[options.instagram.access_type]; 6713 } 6714 6715 switch (account[0]) { 6716 case '@': 6717 var username = account.substr(1); 6718 url = Feed.instagram.api + 'users/search/?q=' + username + '&' + authTokenParams + '&count=1' + '&callback=?'; 6719 Utility.request(url, Feed.instagram.utility.getUsers); 6720 break; 6721 case '#': 6722 var hashtag = account.substr(1); 6723 url = Feed.instagram.api + 'tags/' + hashtag + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; 6724 Utility.request(url, Feed.instagram.utility.getImages); 6725 break; 6726 case '&': 6727 var id = account.substr(1); 6728 url = Feed.instagram.api + 'users/' + id + '/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; 6729 Utility.request(url, Feed.instagram.utility.getUsers); 6730 default: 6731 } 6732 }, 6733 utility: { 6734 getImages: function(json) { 6735 if (json.data) { 6736 json.data.forEach(function(element) { 6737 var post = new SocialFeedPost('instagram', Feed.instagram.utility.unifyPostData(element)); 6738 post.render(); 6739 }); 6740 } 6741 }, 6742 getUsers: function(json) { 6743 // API endpoint URL depends on which authentication type we're using. 6744 if (options.instagram.access_type !== 'undefined') { 6745 var authTokenParams = options.instagram.access_type + '=' + options.instagram[options.instagram.access_type]; 6746 } 6747 6748 if (!jQuery.isArray(json.data)) json.data = [json.data] 6749 json.data.forEach(function(user) { 6750 var url = Feed.instagram.api + 'users/' + user.id + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; 6751 Utility.request(url, Feed.instagram.utility.getImages); 6752 }); 6753 }, 6754 unifyPostData: function(element) { 6755 var post = {}; 6756
6757 post.id = element.id; 6758 post.dt_create = moment(element.created_time * 1000); 6759 post.author_link = 'http://instagram.com/' + element.user.username; 6760 post.author_picture = element.user.profile_picture; 6761 post.author_name = element.user.full_name || element.user.username; 6762 post.message = (element.caption && element.caption) ? element.caption.text : ''; 6763 post.description = ''; 6764 post.link = element.link; 6765 if (options.show_media) { 6766 post.attachment = '<img class="attachment" src="' + element.images.standard_resolution.url + '' + '" />'; 6767 } 6768 return post; 6769 } 6770 } 6771 }, 6772 vk: { 6773 posts: [], 6774 loaded: false, 6775 base: 'http://vk.com/', 6776 api: 'https://api.vk.com/method/', 6777 user_json_template: 'https://api.vk.com/method/' + 'users.get?fields=first_name,%20last_name,%20screen_name,%20photo&uid=', 6778 group_json_template: 'https://api.vk.com/method/' + 'groups.getById?fields=first_name,%20last_name,%20screen_name,%20photo&gid=', 6779 getData: function(account) { 6780 var request_url; 6781 6782 switch (account[0]) { 6783 case '@': 6784 var username = account.substr(1); 6785 request_url = Feed.vk.api + 'wall.get?owner_id=' + username + '&filter=' + options.vk.source + '&count=' + options.vk.limit + '&callback=?'; 6786 Utility.get_request(request_url, Feed.vk.utility.getPosts); 6787 break; 6788 case '#': 6789 var hashtag = account.substr(1); 6790 request_url = Feed.vk.api + 'newsfeed.search?q=' + hashtag + '&count=' + options.vk.limit + '&callback=?'; 6791 Utility.get_request(request_url, Feed.vk.utility.getPosts); 6792 break; 6793 default: 6794 } 6795 }, 6796 utility: { 6797 getPosts: function(json) { 6798 if (json.response) { 6799 $.each(json.response, function() { 6800 if (this != parseInt(this) && this.post_type === 'post') { 6801 var owner_id = (this.owner_id) ? this.owner_id : this.from_id, 6802 vk_wall_owner_url = (owner_id > 0) ? (Feed.vk.user_json_template + owner_id + '&callback=?') : (Feed.vk.group_json_template + (-1) * owner_id + '&callback=?'), 6803 element = this; 6804 Utility.get_request(vk_wall_owner_url, function(wall_owner) { 6805 Feed.vk.utility.unifyPostData(wall_owner, element, json); 6806 }); 6807 } 6808 }); 6809 } 6810 }, 6811 unifyPostData: function(wall_owner, element, json) { 6812 var post = {}; 6813 6814 post.id = element.id; 6815 post.dt_create = moment.unix(element.date); 6816 post.description = ' '; 6817 post.message = Utility.stripHTML(element.text); 6818 if (options.show_media) { 6819 if (element.attachment) { 6820 if (element.attachment.type === 'link') 6821 post.attachment = '<img class="attachment" src="' + element.attachment.link.image_src + '" />'; 6822 if (element.attachment.type === 'video') 6823 post.attachment = '<img class="attachment" src="' + element.attachment.video.image_big + '" />'; 6824 if (element.attachment.type === 'photo') 6825 post.attachment = '<img class="attachment" src="' + element.attachment.photo.src_big + '" />'; 6826 } 6827 } 6828 6829 if (element.from_id > 0) { 6830 var vk_user_json = Feed.vk.user_json_template + element.from_id + '&callback=?'; 6831 Utility.get_request(vk_user_json, function(user_json) { 6832 var vk_post = new SocialFeedPost('vk', Feed.vk.utility.getUser(user_json, post, element, json)); 6833 vk_post.render(); 6834 }); 6835 6836 } else { 6837 var vk_group_json = Feed.vk.group_json_template + (-1) * element.from_id + '&callback=?'; 6838 Utility.get_request(vk_group_json, function(user_json) { 6839 var vk_post = new SocialFeedPost('vk', Feed.vk.utility.getGroup(user_json, post, element, json)); 6840 vk_post.render(); 6841 }); 6842 } 6843 }, 6844 getUser: function(user_json, post, element, json) { 6845 post.author_name = user_json.response[0].first_name + ' ' + user_json.response[0].last_name; 6846 post.author_picture = user_json.response[0].photo; 6847 post.author_link = Feed.vk.base + user_json.response[0].screen_name; 6848 post.link = Feed.vk.base + user_json.response[0].screen_name + '?w=wall' + element.from_id + '_' + element.i
6848d; 6849 6850 return post; 6851 }, 6852 getGroup: function(user_json, post, element, json) { 6853 post.author_name = user_json.response[0].name; 6854 post.author_picture = user_json.response[0].photo; 6855 post.author_link = Feed.vk.base + user_json.response[0].screen_name; 6856 post.link = Feed.vk.base + user_json.response[0].screen_name + '?w=wall-' + user_json.response[0].gid + '_' + element.id; 6857 6858 return post; 6859 } 6860 } 6861 }, 6862 blogspot: { 6863 loaded: false, 6864 getData: function(account) { 6865 var url; 6866 6867 switch (account[0]) { 6868 case '@': 6869 var username = account.substr(1); 6870 url = 'http://' + username + '.blogspot.com/feeds/posts/default?alt=json-in-script&callback=?'; 6871 request(url, getPosts); 6872 break; 6873 default: 6874 } 6875 }, 6876 utility: { 6877 getPosts: function(json) { 6878 $.each(json.feed.entry, function() { 6879 var post = {}, 6880 element = this; 6881 post.id = element.id['$t'].replace(/[^a-z0-9]/gi, ''); 6882 post.dt_create = moment((element.published['$t'])); 6883 post.author_link = element.author[0]['uri']['$t']; 6884 post.author_picture = 'http:' + element.author[0]['gd$image']['src']; 6885 post.author_name = element.author[0]['name']['$t']; 6886 post.message = element.title['$t'] + '</br></br>' + stripHTML(element.content['$t']); 6887 post.description = ''; 6888 post.link = element.link.pop().href; 6889 6890 if (options.show_media) { 6891 if (element['media$thumbnail']) { 6892 post.attachment = '<img class="attachment" src="' + element['media$thumbnail']['url'] + '" />'; 6893 } 6894 } 6895 6896 post.render(); 6897 6898 }); 6899 } 6900 } 6901 }, 6902 pinterest: { 6903 posts: [], 6904 loaded: false, 6905 apiv1: 'https://api.pinterest.com/v1/', 6906 6907 getData: function(account) { 6908 var request_url, 6909 limit = 'limit=' + options.pinterest.limit, 6910 fields = 'fields=id,created_at,link,note,creator(url,first_name,last_name,image),image', 6911 query_extention = fields + '&access_token='
6911+ options.pinterest.access_token + '&' + limit + '&callback=?'; 6912 switch (account[0]) { 6913 case '@': 6914 var username = account.substr(1); 6915 if (username === 'me') { 6916 request_url = Feed.pinterest.apiv1 + 'me/pins/?' + query_extention; 6917 } else { 6918 request_url = Feed.pinterest.apiv1 + 'boards/' + username + '/pins?' + query_extention; 6919 } 6920 break; 6921 default: 6922 } 6923 Utility.request(request_url, Feed.pinterest.utility.getPosts); 6924 }, 6925 utility: { 6926 6927 getPosts: function(json) { 6928 json.data.forEach(function(element) { 6929 var post = new SocialFeedPost('pinterest', Feed.pinterest.utility.unifyPostData(element)); 6930 post.render(); 6931 }); 6932 }, 6933 6934 unifyPostData: function(element){ 6935 var post = {}; 6936 6937 post.id = element.id; 6938 post.dt_create= moment(element.created_at); 6939 post.author_link = element.creator.url; 6940 post.author_picture = element.creator.image['60x60' ].url; 6941 post.author_name = element.creator.first_name + element.creator.last_name; 6942 post.message = element.note; 6943 post.description = ''; 6944 post.social_network = 'pinterest'; 6945 post.link = element.link ? element.link : 'https://www.pinterest.com/pin/' + element.id; 6946 if (options.show_media) { 6947 post.attachment = '<img class="attachment" src="' + element.image['original'].url + '" />'; 6948 } 6949 return post; 6950 } 6951 } 6952 }, 6953 rss : { 6954 posts: [], 6955 loaded: false, 6956 api : 'https://query.yahooapis.com/v1/public/yql?q=', 6957 datatype: 'json', 6958 6959 getData: function(url) { 6960 var limit = options.rss.limit, 6961 yql = encodeURIComponent('select entry FROM feednormalizer where url=\'' + url + '\' AND output=\'atom_1.0\' | truncate(count=' + limit + ')' ), 6962 request_url = Feed.rss.api + yql + '&format=json&callback=?'; 6963 6964 Utility.request(request_url, Feed.rss.utility.getPosts, Feed.rss.datatype); 6965 }, 6966 utility: { 6967 6968 getPosts: function(json) { 6969 console.log(json); 6970 if (json.query.count > 0 ){ 6971 $.each(json.query.results.feed, function(index, element) { 6972 var post = new SocialFeedPost('rss', Feed.rss.utility.unifyPostData(index, element)); 6973 post.render(); 6974 }); 6975 } 6976 }, 6977 6978 unifyPostData: function(index, element){ 6979 6980 var item = element; 6981 6982 if ( element.entry !== undefined ){ 6983 item = element.entry; 6984 } 6985 var post = {}; 6986 6987 post.id = '"' + item.id + '"'; 6988 post.dt_create= moment(item.published, 'YYYY-MM-DDTHH:mm:ssZ', 'en'); 6989 6990 post.author_link = ''; 6991 post.author_picture = ''; 6992 post.author_name = ''; 6993 if( item.creator !== undefined ){ 6994 post.author_name = item.creator; 6995 } 6996 post.message = item.title; 6997 post.description = ''; 6998 if( item.summary !== undefined ){ 6999 post.description = Utility.stripHTML(item.summary.content); 7000 } 7001 post.social_network = 'rss'; 7002 post.link = item.link.href; 7003 if (options.show_media && item.thumbnail !== undefined ) { 7004 post.attachment = '<img class="attachment" src="' + item.thumbnail.url + '" />'; 7005 } 7006 return post; 7007 } 7008 } 7009 } 7010 }; 7011 7012 //make the plugin chainable 7013 return this.each(function() { 7014 // Initialization 7015 Feed.init(); 7016 if (options.update_period) { 7017 setInterval(function() { 7018 return Feed.init(); 7019 }, options.update_period); 7020 } 7021 }) 7022 }; 7023 7024})(jQuery); 7025// source --> https://nieruchomoscipafos.pl/wp-content/plugins/essential-addons-for-elementor-lite/assets/js/mixitup.min.js?ver=1.0 7026/**! 7027 * MixItUp v3.2.2 7028 * A high-performance, dependency-free library for animated filtering, sorting and more 7029 * Build 20a1a182-d7bd-4c8f-807d-b888e325e44d 7030 * 7031 * @copyright Copyright 2014-2017 KunkaLabs Limited. 7032 * @author KunkaLabs Limited. 7033 * @link https://www.kunkalabs.com/mixitup/ 7034 * 7035 * @license Commercial use requires a commercial license. 7036 * https://www.kunkalabs.com/mixitup/licenses/ 7037 * 7038 * Non-commercial use permitted under same terms as CC BY-NC 3.0 license. 7039 * http://creativecommons.org/licenses/by-nc/3.0/
vendor: 40,860 bytes, lines 7039-7042
7039 7040 */ 7041!function(t){"use strict";var e=null,n=null;!function(){var e=["webkit","moz","o","ms"],n=t.document.createElement("div"),a=-1;for(a=0;a<e.length&&!t.requestAnimationFrame;a++)t.requestAnimationFrame=t[e[a]+"RequestAnimationFrame"];"undefined"==typeof n.nextElementSibling&&Object.defineProperty(t.Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t;){if(1===t.nodeType)return t;t=t.nextSibling}return null}}),function(t){t.matches=t.matches||t.machesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector||function(t){return Array.prototype.indexOf.call(this.parentElement.querySelectorAll(t),this)>-1}}(t.Element.prototype),Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,e=!1,n=[],a=-1;return e=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=n.length,function(i){var o=[],r="",s=-1;if("object"!=typeof i&&("function"!=typeof i||null===i))throw new TypeError("Object.keys called on non-object");for(r in i)t.call(i,r)&&o.push(r);if(e)for(s=0;s<a;s++)t.call(i,n[s])&&o.push(n[s]);return o}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),"function"!=typeof Object.create&&(Object.create=function(t){var e=function(){};return function(n,a){if(n!==Object(n)&&null!==n)throw TypeError("Argument must be an object, or null");e.prototype=n||{};var i=new e;return e.prototype=null,a!==t&&Object.defineProperties(i,a),null===n&&(i.__proto__=null),i}}()),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t){var e,n,a,i;if(null===this)throw new TypeError;if(a=Object(this),i=a.length>>>0,0===i)return-1;if(e=0,arguments.length>1&&(e=Number(arguments[1]),e!==e?e=0:0!==e&&e!==1/0&&e!==-(1/0)&&(e=(e>0||-1)*Math.floor(Math.abs(e)))),e>=i)return-1;for(n=e>=0?e:Math.max(i-Math.abs(e),0);n<i;n++)if(n in a&&a[n]===t)return n;return-1}),Function.prototype.bind||(Function.prototype.bind=function(t){var e,n,a,i;if("function"!=typeof this)throw new TypeError;return e=Array.prototype.slice.call(arguments,1),n=this,a=function(){},i=function(){return n.apply(this instanceof a?this:t,e.concat(Array.prototype.slice.call(arguments)))},this.prototype&&(a.prototype=this.prototype),i.prototype=new a,i}),t.Element.prototype.dispatchEvent||(t.Element.prototype.dispatchEvent=function(t){try{return this.fireEvent("on"+t.type,t)}catch(e){}})}(),e=function(a,i,o){var r=null,s=!1,l=null,c=null,u=null,f=null,h=[],d="",m=[],g=-1;if(u=o||t.document,(s=arguments[3])&&(s="boolean"==typeof s),"string"==typeof a)m=u.querySelectorAll(a);else if(a&&"object"==typeof a&&n.isElement(a,u))m=[a];else{if(!a||"object"!=typeof a||!a.length)throw new Error(e.messages.errorFactoryInvalidContainer());m=a}if(m.length<1)throw new Error(e.messages.errorFactoryContainerNotFound());for(g=0;(r=m[g])&&(!(g>0)||s);g++)r.id?d=r.id:(d="MixItUp"+n.randomHex(),r.id=d),e.instances[d]instanceof e.Mixer?(l=e.instances[d],(!i||i&&i.debug&&i.debug.showWarnings!==!1)&&console.warn(e.messages.warningFactoryPreexistingInstance())):(l=new e.Mixer,l.attach(r,u,d,i),e.instances[d]=l),c=new e.Facade(l),i&&i.debug&&i.debug.enable?h.push(l):h.push(c);return f=s?new e.Collection(h):h[0]},e.use=function(t){e.Base.prototype.callActions.call(e,"beforeUse",arguments),"function"==typeof t&&"mixitup-extension"===t.TYPE?"undefined"==typeof e.extensions[t.NAME]&&(t(e),e.extensions[t.NAME]=t):t.fn&&t.fn.jquery&&(e.libraries.$=t),e.Base.prototype.callActions.call(e,"afterUse",arguments)},e.instances={},e.extensions={},e.libraries={},n={hasClass:function(t,e){return!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))},addClass:function(t,e){this.hasClass(t,e)||(t.className+=t.className?" "+e:e)},removeClass:function(t,e){if(this.hasClass(t,e)){var n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ").trim()}},extend:function(t,e,n,a){var i=[],o="",r=-1;n=n||!1,a=a||!1;try{if(Array.isArray(e))for(r=0;r<e.length;r++)i.push(r);else e&&(i=Object.keys(e));for(r=0;r<i.length;r++)o=i[r],!n||"object"!=typeof e[o]||this.isElement(e[o])?t[o]=e[o]:Array.isArray(e[o])?(t[o]||(t[o]=[]),this.extend(t[o],e[o],n,a)):(t[o]||(t[o]={}),this.extend(t[o],e[o],n,a))}catch(s){if(!a)throw s;this.handleExtendError(s,t)}return t},handleExtendError:function(t,n){var a=/property "?(\w*)"?[,:] object/i,i=null,o="",r="",s="",l="",c="",u=-1,f=-1;if(t instanceof TypeError&&(i=a.exec(t.message))){o=i[1];for(c in n){for(f=0;f<o.length&&o.charAt(f)===c.charAt(f);)f++;f>u&&(u=f,l=c)}throw u>1&&(s=e.messages.errorConfigInvalidPropertySuggestion({probableMatch:l})),r=e.messages.errorConfigInvalidProperty({erroneous:o,suggestion:s}),new TypeError(r)}throw t},template:function(t){for(var e=/\${([\w]*)}/g,n={},a=null;a=e.exec(t);)n[a[1]]=new RegExp("\\${"+a[1]+"}","g");return function(e){var a="",i=t;e=e||{};for(a in n)i=i.replace(n[a],"undefined"!=typeof e[a]?e[a]:"");return i}},on:function(e,n,a,i){e&&(e.addEventListener?e.addEventListener(n,a,i):e.attachEvent&&(e["e"+n+a]=a,e[n+a]=function(){e["e"+n+a](t.event)},e.attachEvent("on"+n,e[n+a])))},off:function(t,e,n){t&&(t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&(t.detachEvent("on"+e,t[e+n]),t[e+n]=null))},getCustomEvent:function(e,n,a){var i=null;return a=a||t.document,"function"==typeof t.CustomEvent?i=new t.CustomEvent(e,{detail:n,bubbles:!0,cancelable:!0}):"function"==typeof a.createEvent?(i=a.createEvent("CustomEvent"),i.initCustomEvent(e,!0,!0,n)):(i=a.createEventObject(),i.type=e,i.returnValue=!1,i.cancelBubble=!1,i.detail=n),i},getOriginalEvent:function(t){return t.touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t},index:function(t,e){for(var n=0;null!==(t=t.previousElementSibling);)e&&!t.matches(e)||++n;return n},camelCase:function(t){return t.toLowerCase().replace(/([_-][a-z])/g,function(t){return t.toUpperCase().replace(/[_-]/,"")})},pascalCase:function(t){return(t=this.camelCase(t)).charAt(0).toUpperCase()+t.slice(1)},dashCase:function(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()},isElement:function(e,n){return n=n||t.document,!!(t.HTMLElement&&e instanceof t.HTMLElement)||(!!(n.defaultView&&n.defaultView.HTMLElement&&e instanceof n.defaultView.HTMLElement)||null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)},createElement:function(e,n){var a=null,i=null;for(n=n||t.document,a=n.createDocumentFragment(),i=n.createElement("div"),i.innerHTML=e.trim();i.firstChild;)a.appendChild(i.firstChild);return a},removeWhitespace:function(t){for(var e;t&&"#text"===t.nodeName;)e=t,t=t.previousSibling,e.parentElement&&e.parentElement.removeChild(e)},isEqualArray:function(t,e){var n=t.length;if(n!==e.length)return!1;for(;n--;)if(t[n]!==e[n])return!1;return!0},deepEquals:function(t,e){var n;if("object"==typeof t&&t&&"object"==typeof e&&e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(n in t)if(!e.hasOwnProperty(n)||!this.deepEquals(t[n],e[n]))return!1}else if(t!==e)return!1;return!0},arrayShuffle:function(t){for(var e=t.slice(),n=e.length,a=n,i=-1,o=[];a--;)i=~~(Math.random()*n),o=e[a],e[a]=e[i],e[i]=o;return e},arrayFromList:function(t){var e,n;try{return Array.prototype.slice.call(t)}catch(a){for(e=[],n=0;n<t.length;n++)e.push(t[n]);return e}},debounce:function(t,e,n){var a;return function(){var i=this,o=arguments,r=n&&!a,s=null;s=function(){a=null,n||t.apply(i,o)},clearTimeout(a),a=setTimeout(s,e),r&&t.apply(i,o)}},position:function(t){for(var e=0,n=0,a=t;t;)e-=t.scrollLeft,n-=t.scrollTop,t===a&&(e+=t.offsetLeft,n+=t.offsetTop,a=t.offsetParent),t=t.parentElement;return{x:e,y:n}},getHypotenuse:function(t,e){var n=t.x-e.x,a=t.y-e.y;return n=n<0?n*-1:n,a=a<0?a*-1:a,Math.sqrt(Math.pow(n,2)+Math.pow(a,2))},getIntersectionRatio:function(t,e){var n=t.width*t.height,a=-1,i=-1,o=-1,r=-1;return a=Math.max(0,Math.min(t.left+t.width,e.left+e.width)-Math.max(t.left,e.left)),i=Math.max(0,Math.min(t.top+t.height,e.top+e.height)-Math.max(t.top,e.top)),o=i*a,r=o/n},closestParent:function(e,n,a,i){var o=e.parentNode;if(i=i||t.document,a&&e.matches(n))return e;for(;o&&o!=i.body;){if(o.matches&&o.matches(n))return o;if(!o.parentNode)return null;o=o.parentNode}return null},children:function(e,n,a){var i=[],o="";return a=a||t.doc,e&&(e.id||(o="Temp"+this.randomHexKey(),e.id=o),i=a.querySelectorAll("#"+e.id+" > "+n),o&&e.removeAttribute("id")),i},clean:function(t){var e=[],n=-1;for(n=0;n<t.length;n++)""!==t[n]&&e.push(t[n]);return e},defer:function(n){var a=null,i=null,o=null;return i=new this.Deferred,e.features.has.promises?i.promise=new Promise(function(t,e){i.resolve=t,i.reject=e}):(o=t.jQuery||n.$)&&"function"==typeof o.Deferred?(a=o.Deferred(),i.promise=a.promise(),i.resolve=a.resolve,i.reject=a.reject):t.console&&console.warn(e.messages.warningNoPromiseImplementation()),i},all:function(n,a){var i=null;return e.features.has.promises?Promise.all(n):(i=t.jQuery||a.$)&&"function"==typeof i.when?i.when.apply(i,n).done(function(){return arguments}):(t.console&&console.warn(e.messages.warningNoPromiseImplementation()),[])},getPrefix:function(t,e,a){var i=-1,o="";if(n.dashCase(e)in t.style)return"";for(i=0;o=a[i];i++)if(o+e in t.style)return o.toLowerCase();return"unsupported"},randomHex:function(){return("00000"+(16777216*Math.random()<<0).toString(16)).substr(-6).toUpperCase()},getDocumentState:function(e){return e="object"==typeof e.body?e:t.document,{scrollTop:t.pageYOffset,scrollLeft:t.pageXOffset,docHeight:e.documentElement.scrollHeight,docWidth:e.documentElement.scrollWidth,viewportHeight:e.documentElement.clientHeight,viewportWidth:e.documentElement.clientWidth}},bind:function(t,e){return function(){return e.apply(t,arguments)}},isVisible:function(e){var n=null;return!!e.offsetParent||(n=t.getComputedStyle(e),"fixed"===n.position&&"hidden"!==n.visibility&&"0"!==n.opacity)},seal:function(t){"function"==typeof Object.seal&&Object.seal(t)},freeze:function(t){"function"==typeof Object.freeze&&Object.freeze(t)},compareVersions:function(t,e){var n=t.split("."),a=e.split("."),i=-1,o=-1,r=-1;for(r=0;r<n.length;r++){if(i=parseInt(n[r].replace(/[^\d.]/g,"")),o=parseInt(a[r].replace(/[^\d.]/g,"")||0),o<i)return!1;if(o>i)return!0}return!0},Deferred:function(){this.promise=null,this.resolve=null,this.reject=null,this.id=n.randomHex()},isEmptyObject:function(t){var e="";if("function"==typeof Object.keys)return 0===Object.keys(t).length;for(e in t)if(t.hasOwnProperty(e))return!1;return!0},getClassname:function(t,e,n){var a="";return a+=t.block,a.length&&(a+=t.delineatorElement),a+=t["element"+this.pascalCase(e)],n?(a.length&&(a+=t.delineatorModifier),a+=n):a},getProperty:function(t,e){var n=e.split("."),a=null,i="",o=0;if(!e)return t;for(a=function(t){return t?t[i]:null};o<n.length;)i=n[o],t=a(t),o++;return"undefined"!=typeof t?t:null}},e.h=n,e.Base=function(){},e.Base.prototype={constructor:e.Base,callActions:function(t,e){var a=this,i=a.constructor.actions[t],o="";if(i&&!n.isEmptyObject(i))for(o in i)i[o].apply(a,e)},callFilters:function(t,e,a){var i=this,o=i.constructor.filters[t],r=e,s="";if(!o||n.isEmptyObject(o))return r;a=a||[];for(s in o)a=n.arrayFromList(a),a.unshift(r),r=o[s].apply(i,a);return r}},e.BaseStatic=function(){this.actions={},this.filters={},this.extend=function(t){n.extend(this.prototype,t)},this.registerAction=function(t,e,n){(this.actions[t]=this.actions[t]||{})[e]=n},this.registerFilter=function(t,e,n){(this.filters[t]=this.filters[t]||{})[e]=n}},e.Features=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.boxSizingPrefix="",this.transformPrefix="",this.transitionPrefix="",this.boxSizingPrefix="",this.transformProp="",this.transformRule="",this.transitionProp="",this.perspectiveProp="",this.perspectiveOriginProp="",this.has=new e.Has,this.canary=null,this.BOX_SIZING_PROP="boxSizing",this.TRANSITION_PROP="transition",this.TRANSFORM_PROP="transform",this.PERSPECTIVE_PROP="perspective",this.PERSPECTIVE_ORIGIN_PROP="perspectiveOrigin",this.VENDORS=["Webkit","moz","O","ms"],this.TWEENABLE=["opacity","width","height","marginRight","marginBottom","x","y","scale","translateX","translateY","translateZ","rotateX","rotateY","rotateZ"],this.callActions("afterConstruct")},e.BaseStatic.call(e.Features),e.Features.prototype=Object.create(e.Base.prototype),n.extend(e.Features.prototype,{constructor:e.Features,init:function(){var t=this;t.callActions("beforeInit",arguments),t.canary=document.createElement("div"),t.setPrefixes(),t.runTests(),t.callActions("beforeInit",arguments)},runTests:function(){var e=this;e.callActions("beforeRunTests",arguments),e.has.promises="function"==typeof t.Promise,e.has.transitions="unsupported"!==e.transitionPrefix,e.callActions("afterRunTests",arguments),n.freeze(e.has)},setPrefixes:function(){var t=this;t.callActions("beforeSetPrefixes",arguments),t.transitionPrefix=n.getPrefix(t.canary,"Transition",t.VENDORS),t.transformPrefix=n.getPrefix(t.canary,"Transform",t.VENDORS),t.boxSizingPrefix=n.getPrefix(t.canary,"BoxSizing",t.VENDORS),t.boxSizingProp=t.boxSizingPrefix?t.boxSizingPrefix+n.pascalCase(t.BOX_SIZING_PROP):t.BOX_SIZING_PROP,t.transitionProp=t.transitionPrefix?t.transitionPrefix+n.pascalCase(t.TRANSITION_PROP):t.TRANSITION_PROP,t.transformProp=t.transformPrefix?t.transformPrefix+n.pascalCase(t.TRANSFORM_PROP):t.TRANSFORM_PROP,t.transformRule=t.transformPrefix?"-"+t.transformPrefix+"-"+t.TRANSFORM_PROP:t.TRANSFORM_PROP,t.perspectiveProp=t.transformPrefix?t.transformPrefix+n.pascalCase(t.PERSPECTIVE_PROP):t.PERSPECTIVE_PROP,t.perspectiveOriginProp=t.transformPrefix?t.transformPrefix+n.pascalCase(t.PERSPECTIVE_ORIGIN_PROP):t.PERSPECTIVE_ORIGIN_PROP,t.callActions("afterSetPrefixes",arguments)}}),e.Has=function(){this.transitions=!1,this.promises=!1,n.seal(this)},e.features=new e.Features,e.features.init(),e.ConfigAnimation=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.enable=!0,this.effects="fade scale",this.effectsIn="",this.effectsOut="",this.duration=600,this.easing="ease",this.applyPerspective=!0,this.perspectiveDistance="3000px",this.perspectiveOrigin="50% 50%",this.queue=!0,this.queueLimit=3,this.animateResizeContainer=!0,this.animateResizeTargets=!1,this.staggerSequence=null,this.reverseOut=!1,this.nudge=!0,this.clampHeight=!0,this.clampWidth=!0,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigAnimation),e.ConfigAnimation.prototype=Object.create(e.Base.prototype),e.ConfigAnimation.prototype.constructor=e.ConfigAnimation,e.ConfigBehavior=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.liveSort=!1,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigBehavior),e.ConfigBehavior.prototype=Object.create(e.Base.prototype),e.ConfigBehavior.prototype.constructor=e.ConfigBehavior,e.ConfigCallbacks=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.onMixStart=null,this.onMixBusy=null,this.onMixEnd=null,this.onMixFail=null,this.onMixClick=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigCallbacks),e.ConfigCallbacks.prototype=Object.create(e.Base.prototype),e.ConfigCallbacks.prototype.constructor=e.ConfigCallbacks,e.ConfigControls=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.enable=!0,this.live=!1,this.scope="global",this.toggleLogic="or",this.toggleDefault="all",this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigControls),e.ConfigControls.prototype=Object.create(e.Base.prototype),e.ConfigControls.prototype.constructor=e.ConfigControls,e.ConfigClassNames=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.block="mixitup",this.elementContainer="container",this.elementFilter="control",this.elementSort="control",this.elementMultimix="control",this.elementToggle="control",this.modifierActive="active",this.modifierDisabled="disabled",this.modifierFailed="failed",this.delineatorElement="-",this.delineatorModifier="-",this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigClassNames),e.ConfigClassNames.prototype=Object.create(e.Base.prototype),e.ConfigClassNames.prototype.constructor=e.ConfigClassNames,e.ConfigData=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.uidKey="",this.dirtyCheck=!1,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigData),e.ConfigData.prototype=Object.create(e.Base.prototype),e.ConfigData.prototype.constructor=e.ConfigData,e.ConfigDebug=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.enable=!1,this.showWarnings=!0,this.fauxAsync=!1,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigDebug),e.ConfigDebug.prototype=Object.create(e.Base.prototype),e.ConfigDebug.prototype.constructor=e.ConfigDebug,e.ConfigLayout=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.allowNestedTargets=!0,this.containerClassName="",this.siblingBefore=null,this.siblingAfter=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigLayout),e.ConfigLayout.prototype=Object.create(e.Base.prototype),e.ConfigLayout.prototype.constructor=e.ConfigLayout,e.ConfigLoad=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.filter="all",this.sort="default:asc",this.dataset=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigLoad),e.ConfigLoad.prototype=Object.create(e.Base.prototype),e.ConfigLoad.prototype.constructor=e.ConfigLoad,e.ConfigSelectors=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.target=".mix",this.control="",this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigSelectors),e.ConfigSelectors.prototype=Object.create(e.Base.prototype),e.ConfigSelectors.prototype.constructor=e.ConfigSelectors,e.ConfigRender=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.target=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigRender),e.ConfigRender.prototype=Object.create(e.Base.prototype),e.ConfigRender.prototype.constructor=e.ConfigRender,e.ConfigTemplates=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.ConfigTemplates),e.ConfigTemplates.prototype=Object.create(e.Base.prototype),e.ConfigTemplates.prototype.constructor=e.ConfigTemplates,e.Config=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.animation=new e.ConfigAnimation,this.behavior=new e.ConfigBehavior,this.callbacks=new e.ConfigCallbacks,this.controls=new e.ConfigControls,this.classNames=new e.ConfigClassNames,this.data=new e.ConfigData,this.debug=new e.ConfigDebug,this.layout=new e.ConfigLayout,this.load=new e.ConfigLoad,this.selectors=new e.ConfigSelectors,this.render=new e.ConfigRender,this.templates=new e.ConfigTemplates,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.Config),e.Config.prototype=Object.create(e.Base.prototype),e.Config.prototype.constructor=e.Config,e.MixerDom=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.document=null,this.body=null,this.container=null,this.parent=null,this.targets=[],this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.MixerDom),e.MixerDom.prototype=Object.create(e.Base.prototype),e.MixerDom.prototype.constructor=e.MixerDom,e.UiClassNames=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.base="",this.active="",this.disabled="",this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.UiClassNames),e.UiClassNames.prototype=Object.create(e.Base.prototype),e.UiClassNames.prototype.constructor=e.UiClassNames,e.CommandDataset=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.dataset=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.CommandDataset),e.CommandDataset.prototype=Object.create(e.Base.prototype),e.CommandDataset.prototype.constructor=e.CommandDataset,e.CommandMultimix=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.filter=null,this.sort=null,this.insert=null,this.remove=null,this.changeLayout=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.CommandMultimix),e.CommandMultimix.prototype=Object.create(e.Base.prototype),e.CommandMultimix.prototype.constructor=e.CommandMultimix,e.CommandFilter=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.selector="",this.collection=null,this.action="show",this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.CommandFilter),e.CommandFilter.prototype=Object.create(e.Base.prototype),e.CommandFilter.prototype.constructor=e.CommandFilter,e.CommandSort=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.sortString="",this.attribute="",this.order="asc",this.collection=null,this.next=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.CommandSort),e.CommandSort.prototype=Object.create(e.Base.prototype),e.CommandSort.prototype.constructor=e.CommandSort,e.CommandInsert=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.index=0,this.collection=[],this.position="before",this.sibling=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.CommandInsert),e.CommandInsert.prototype=Object.create(e.Base.prototype),e.CommandInsert.prototype.constructor=e.CommandInsert,e.CommandRemove=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.targets=[],this.collection=[],this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.CommandRemove),e.CommandRemove.prototype=Object.create(e.Base.prototype),e.CommandRemove.prototype.constructor=e.CommandRemove,e.CommandChangeLayout=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.containerClassName="",this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.CommandChangeLayout),e.CommandChangeLayout.prototype=Object.create(e.Base.prototype),e.CommandChangeLayout.prototype.constructor=e.CommandChangeLayout,e.ControlDefinition=function(t,a,i,o){e.Base.call(this),this.callActions("beforeConstruct"),this.type=t,this.selector=a,this.live=i||!1,this.parent=o||"",this.callActions("afterConstruct"),n.freeze(this),n.seal(this)},e.BaseStatic.call(e.ControlDefinition),e.ControlDefinition.prototype=Object.create(e.Base.prototype),e.ControlDefinition.prototype.constructor=e.ControlDefinition,e.controlDefinitions=[],e.controlDefinitions.push(new e.ControlDefinition("multimix","[data-filter][data-sort]")),e.controlDefinitions.push(new e.ControlDefinition("filter","[data-filter]")),e.controlDefinitions.push(new e.ControlDefinition("sort","[data-sort]")),e.controlDefinitions.push(new e.ControlDefinition("toggle","[data-toggle]")),e.Control=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.el=null,this.selector="",this.bound=[],this.pending=-1,this.type="",this.status="inactive",this.filter="",this.sort="",this.canDisable=!1,this.handler=null,this.classNames=new e.UiClassNames,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.Control),e.Control.prototype=Object.create(e.Base.prototype),n.extend(e.Control.prototype,{constructor:e.Control,init:function(t,n,a){var i=this;if(this.callActions("beforeInit",arguments),i.el=t,i.type=n,i.selector=a,i.selector)i.status="live";else switch(i.canDisable="boolean"==typeof i.el.disable,i.type){case"filter":i.filter=i.el.getAttribute("data-filter");break;case"toggle":i.filter=i.el.getAttribute("data-toggle");break;case"sort":i.sort=i.el.getAttribute("data-sort");break;case"multimix":i.filter=i.el.getAttribute("data-filter"),i.sort=i.el.getAttribute("data-sort")}i.bindClick(),e.controls.push(i),this.callActions("afterInit",arguments)},isBound:function(t){var e=this,n=!1;return this.callActions("beforeIsBound",arguments),n=e.bound.indexOf(t)>-1,e.callFilters("afterIsBound",n,arguments)},addBinding:function(t){var e=this;this.callActions("beforeAddBinding",arguments),e.isBound()||e.bound.push(t),this.callActions("afterAddBinding",arguments)},removeBinding:function(t){var n=this,a=-1;this.callActions("beforeRemoveBinding",arguments),(a=n.bound.indexOf(t))>-1&&n.bound.splice(a,1),n.bound.length<1&&(n.unbindClick(),a=e.controls.indexOf(n),e.controls.splice(a,1),"active"===n.status&&n.renderStatus(n.el,"inactive")),this.callActions("afterRemoveBinding",arguments)},bindClick:function(){var t=this;this.callActions("beforeBindClick",arguments),t.handler=function(e){t.handleClick(e)},n.on(t.el,"click",t.handler),this.callActions("afterBindClick",arguments)},unbindClick:function(){var t=this;this.callActions("beforeUnbindClick",arguments),n.off(t.el,"click",t.handler),t.handler=null,this.callActions("afterUnbindClick",arguments)},handleClick:function(t){var a=this,i=null,o=null,r=!1,s=void 0,l={},c=null,u=[],f=-1;if(this.callActions("beforeHandleClick",arguments),this.pending=0,o=a.bound[0],i=a.selector?n.closestParent(t.target,o.config.selectors.control+a.selector,!0,o.dom.document):a.el,!i)return void a.callActions("afterHandleClick",arguments);switch(a.type){case"filter":l.filter=a.filter||i.getAttribute("data-filter");break;case"sort":l.sort=a.sort||i.getAttribute("data-sort");break;case"multimix":l.filter=a.filter||i.getAttribute("data-filter"),l.sort=a.sort||i.getAttribute("data-sort");break;case"toggle":l.filter=a.filter||i.getAttribute("data-toggle"),r="live"===a.status?n.hasClass(i,a.classNames.active):"active"===a.status}for(f=0;f<a.bound.length;f++)c=new e.CommandMultimix,n.extend(c,l),u.push(c);for(u=a.callFilters("commandsHandleClick",u,arguments),a.pending=a.bound.length,f=0;o=a.bound[f];f++)l=u[f],l&&(o.lastClicked||(o.lastClicked=i),e.events.fire("mixClick",o.dom.container,{state:o.state,instance:o,originalEvent:t,control:o.lastClicked},o.dom.document),"function"==typeof o.config.callbacks.onMixClick&&(s=o.config.callbacks.onMixClick.call(o.lastClicked,o.state,t,o),s===!1)||("toggle"===a.type?r?o.toggleOff(l.filter):o.toggleOn(l.filter):o.multimix(l)));this.callActions("afterHandleClick",arguments)},update:function(t,n){var a=this,i=new e.CommandMultimix;a.callActions("beforeUpdate",arguments),a.pending--,a.pending=Math.max(0,a.pending),a.pending>0||("live"===a.status?a.updateLive(t,n):(i.sort=a.sort,i.filter=a.filter,a.callFilters("actionsUpdate",i,arguments),a.parseStatusChange(a.el,t,i,n)),a.callActions("afterUpdate",arguments))},updateLive:function(t,n){var a=this,i=null,o=null,r=null,s=-1;if(a.callActions("beforeUpdateLive",arguments),a.el){for(i=a.el.querySelectorAll(a.selector),s=0;r=i[s];s++){switch(o=new e.CommandMultimix,a.type){case"filter":o.filter=r.getAttribute("data-filter");break;case"sort":o.sort=r.getAttribute("data-sort");break;case"multimix":o.filter=r.getAttribute("data-filter"),o.sort=r.getAttribute("data-sort");break;case"toggle":o.filter=r.getAttribute("data-toggle")}o=a.callFilters("actionsUpdateLive",o,arguments),a.parseStatusChange(r,t,o,n)}a.callActions("afterUpdateLive",arguments)}},parseStatusChange:function(t,e,n,a){var i=this,o="",r="",s=-1;switch(i.callActions("beforeParseStatusChange",arguments),i.type){case"filter":e.filter===n.filter?i.renderStatus(t,"active"):i.renderStatus(t,"inactive");break;case"multimix":e.sort===n.sort&&e.filter===n.filter?i.renderStatus(t,"active"):i.renderStatus(t,"inactive");break;case"sort":e.sort.match(/:asc/g)&&(o=e.sort.replace(/:asc/g,"")),e.sort===n.sort||o===n.sort?i.renderStatus(t,"active"):i.renderStatus(t,"inactive");break;case"toggle":for(a.length<1&&i.renderStatus(t,"inactive"),e.filter===n.filter&&i.renderStatus(t,"active"),s=0;s<a.length;s++){if(r=a[s],r===n.filter){i.renderStatus(t,"active");break}i.renderStatus(t,"inactive")}}i.callActions("afterParseStatusChange",arguments)},renderStatus:function(t,e){var a=this;switch(a.callActions("beforeRenderStatus",arguments),e){case"active":n.addClass(t,a.classNames.active),n.removeClass(t,a.classNames.disabled),a.canDisable&&(a.el.disabled=!1);break;case"inactive":n.removeClass(t,a.classNames.active),n.removeClass(t,a.classNames.disabled),a.canDisable&&(a.el.disabled=!1);break;case"disabled":a.canDisable&&(a.el.disabled=!0),n.addClass(t,a.classNames.disabled),n.removeClass(t,a.classNames.active)}"live"!==a.status&&(a.status=e),a.callActions("afterRenderStatus",arguments)}}),e.controls=[],e.StyleData=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.x=0,this.y=0,this.top=0,this.right=0,this.bottom=0,this.left=0,this.width=0,this.height=0,this.marginRight=0,this.marginBottom=0,this.opacity=0,this.scale=new e.TransformData,this.translateX=new e.TransformData,this.translateY=new e.TransformData,this.translateZ=new e.TransformData,this.rotateX=new e.TransformData,this.rotateY=new e.TransformData,this.rotateZ=new e.TransformData,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.StyleData),e.StyleData.prototype=Object.create(e.Base.prototype),e.StyleData.prototype.constructor=e.StyleData,e.TransformData=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.value=0,this.unit="",this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.TransformData),e.TransformData.prototype=Object.create(e.Base.prototype),e.TransformData.prototype.constructor=e.TransformData,e.TransformDefaults=function(){e.StyleData.apply(this),this.callActions("beforeConstruct"),this.scale.value=.01,this.scale.unit="",this.translateX.value=20,this.translateX.unit="px",this.translateY.value=20,this.translateY.unit="px",this.translateZ.value=20,this.translateZ.unit="px",this.rotateX.value=90,this.rotateX.unit="deg",this.rotateY.value=90,this.rotateY.unit="deg",this.rotateX.value=90,this.rotateX.unit="deg",this.rotateZ.value=180,this.rotateZ.unit="deg",this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.TransformDefaults),e.TransformDefaults.prototype=Object.create(e.StyleData.prototype),e.TransformDefaults.prototype.constructor=e.TransformDefaults,e.transformDefaults=new e.TransformDefaults,e.EventDetail=function(){this.state=null,this.futureState=null,this.instance=null,this.originalEvent=null},e.Events=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.mixStart=null,this.mixBusy=null,this.mixEnd=null,this.mixFail=null,this.mixClick=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.Events),e.Events.prototype=Object.create(e.Base.prototype),e.Events.prototype.constructor=e.Events,e.Events.prototype.fire=function(t,a,i,o){var r=this,s=null,l=new e.EventDetail;if(r.callActions("beforeFire",arguments),"undefined"==typeof r[t])throw new Error('Event type "'+t+'" not found.');l.state=new e.State,n.extend(l.state,i.state),i.futureState&&(l.futureState=new e.State,n.extend(l.futureState,i.futureState)),l.instance=i.instance,i.originalEvent&&(l.originalEvent=i.originalEvent),s=n.getCustomEvent(t,l,o),r.callFilters("eventFire",s,arguments),a.dispatchEvent(s)},e.events=new e.Events,e.QueueItem=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.args=[],this.instruction=null,this.triggerElement=null,this.deferred=null,this.isToggling=!1,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.QueueItem),e.QueueItem.prototype=Object.create(e.Base.prototype),e.QueueItem.prototype.constructor=e.QueueItem,e.Mixer=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.config=new e.Config,this.id="",this.isBusy=!1,this.isToggling=!1,this.incPadding=!0,this.controls=[],this.targets=[],this.origOrder=[],this.cache={},this.toggleArray=[],this.targetsMoved=0,this.targetsImmovable=0,this.targetsBound=0,this.targetsDone=0,this.staggerDuration=0,this.effectsIn=null,this.effectsOut=null,this.transformIn=[],this.transformOut=[],this.queue=[],this.state=null,this.lastOperation=null, 7042this.lastClicked=null,this.userCallback=null,this.userDeferred=null,this.dom=new e.MixerDom,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.Mixer),e.Mixer.prototype=Object.create(e.Base.prototype),n.extend(e.Mixer.prototype,{constructor:e.Mixer,attach:function(a,i,o,r){var s=this,l=null,c=-1;for(s.callActions("beforeAttach",arguments),s.id=o,r&&n.extend(s.config,r,!0,!0),s.sanitizeConfig(),s.cacheDom(a,i),s.config.layout.containerClassName&&n.addClass(s.dom.container,s.config.layout.containerClassName),e.features.has.transitions||(s.config.animation.enable=!1),"undefined"==typeof t.console&&(s.config.debug.showWarnings=!1),s.config.data.uidKey&&(s.config.controls.enable=!1),s.indexTargets(),s.state=s.getInitialState(),c=0;l=s.lastOperation.toHide[c];c++)l.hide();s.config.controls.enable&&(s.initControls(),s.buildToggleArray(null,s.state),s.updateControls({filter:s.state.activeFilter,sort:s.state.activeSort})),s.parseEffects(),s.callActions("afterAttach",arguments)},sanitizeConfig:function(){var t=this;t.callActions("beforeSanitizeConfig",arguments),t.config.controls.scope=t.config.controls.scope.toLowerCase().trim(),t.config.controls.toggleLogic=t.config.controls.toggleLogic.toLowerCase().trim(),t.config.controls.toggleDefault=t.config.controls.toggleDefault.toLowerCase().trim(),t.config.animation.effects=t.config.animation.effects.trim(),t.callActions("afterSanitizeConfig",arguments)},getInitialState:function(){var t=this,n=new e.State,a=new e.Operation;if(t.callActions("beforeGetInitialState",arguments),n.activeContainerClassName=t.config.layout.containerClassName,t.config.load.dataset){if(!t.config.data.uidKey||"string"!=typeof t.config.data.uidKey)throw new TypeError(e.messages.errorConfigDataUidKeyNotSet());a.startDataset=a.newDataset=n.activeDataset=t.config.load.dataset.slice(),a.startContainerClassName=a.newContainerClassName=n.activeContainerClassName,a.show=t.targets.slice(),n=t.callFilters("stateGetInitialState",n,arguments)}else n.activeFilter=t.parseFilterArgs([t.config.load.filter]).command,n.activeSort=t.parseSortArgs([t.config.load.sort]).command,n.totalTargets=t.targets.length,n=t.callFilters("stateGetInitialState",n,arguments),n.activeSort.collection||n.activeSort.attribute||"random"===n.activeSort.order||"desc"===n.activeSort.order?(a.newSort=n.activeSort,t.sortOperation(a),t.printSort(!1,a),t.targets=a.newOrder):a.startOrder=a.newOrder=t.targets,a.startFilter=a.newFilter=n.activeFilter,a.startSort=a.newSort=n.activeSort,a.startContainerClassName=a.newContainerClassName=n.activeContainerClassName,"all"===a.newFilter.selector?a.newFilter.selector=t.config.selectors.target:"none"===a.newFilter.selector&&(a.newFilter.selector="");return a=t.callFilters("operationGetInitialState",a,[n]),t.lastOperation=a,a.newFilter&&t.filterOperation(a),n=t.buildState(a)},cacheDom:function(t,e){var n=this;n.callActions("beforeCacheDom",arguments),n.dom.document=e,n.dom.body=n.dom.document.querySelector("body"),n.dom.container=t,n.dom.parent=t,n.callActions("afterCacheDom",arguments)},indexTargets:function(){var t=this,a=null,i=null,o=null,r=-1;if(t.callActions("beforeIndexTargets",arguments),t.dom.targets=t.config.layout.allowNestedTargets?t.dom.container.querySelectorAll(t.config.selectors.target):n.children(t.dom.container,t.config.selectors.target,t.dom.document),t.dom.targets=n.arrayFromList(t.dom.targets),t.targets=[],(o=t.config.load.dataset)&&o.length!==t.dom.targets.length)throw new Error(e.messages.errorDatasetPrerenderedMismatch());if(t.dom.targets.length){for(r=0;i=t.dom.targets[r];r++)a=new e.Target,a.init(i,t,o?o[r]:void 0),a.isInDom=!0,t.targets.push(a);t.dom.parent=t.dom.targets[0].parentElement===t.dom.container?t.dom.container:t.dom.targets[0].parentElement}t.origOrder=t.targets,t.callActions("afterIndexTargets",arguments)},initControls:function(){var t=this,n="",a=null,i=null,o=null,r=null,s=null,l=-1,c=-1;switch(t.callActions("beforeInitControls",arguments),t.config.controls.scope){case"local":o=t.dom.container;break;case"global":o=t.dom.document;break;default:throw new Error(e.messages.errorConfigInvalidControlsScope())}for(l=0;n=e.controlDefinitions[l];l++)if(t.config.controls.live||n.live){if(n.parent){if(r=t.dom[n.parent],!r||r.length<0)continue;"number"!=typeof r.length&&(r=[r])}else r=[o];for(c=0;i=r[c];c++)s=t.getControl(i,n.type,n.selector),t.controls.push(s)}else for(a=o.querySelectorAll(t.config.selectors.control+n.selector),c=0;i=a[c];c++)s=t.getControl(i,n.type,""),s&&t.controls.push(s);t.callActions("afterInitControls",arguments)},getControl:function(t,a,i){var o=this,r=null,s=-1;if(o.callActions("beforeGetControl",arguments),!i)for(s=0;r=e.controls[s];s++){if(r.el===t&&r.isBound(o))return o.callFilters("controlGetControl",null,arguments);if(r.el===t&&r.type===a&&r.selector===i)return r.addBinding(o),o.callFilters("controlGetControl",r,arguments)}return r=new e.Control,r.init(t,a,i),r.classNames.base=n.getClassname(o.config.classNames,a),r.classNames.active=n.getClassname(o.config.classNames,a,o.config.classNames.modifierActive),r.classNames.disabled=n.getClassname(o.config.classNames,a,o.config.classNames.modifierDisabled),r.addBinding(o),o.callFilters("controlGetControl",r,arguments)},getToggleSelector:function(){var t=this,e="or"===t.config.controls.toggleLogic?", ":"",a="";return t.callActions("beforeGetToggleSelector",arguments),t.toggleArray=n.clean(t.toggleArray),a=t.toggleArray.join(e),""===a&&(a=t.config.controls.toggleDefault),t.callFilters("selectorGetToggleSelector",a,arguments)},buildToggleArray:function(t,e){var a=this,i="";if(a.callActions("beforeBuildToggleArray",arguments),t&&t.filter)i=t.filter.selector.replace(/\s/g,"");else{if(!e)return;i=e.activeFilter.selector.replace(/\s/g,"")}i!==a.config.selectors.target&&"all"!==i||(i=""),"or"===a.config.controls.toggleLogic?a.toggleArray=i.split(","):a.toggleArray=a.splitCompoundSelector(i),a.toggleArray=n.clean(a.toggleArray),a.callActions("afterBuildToggleArray",arguments)},splitCompoundSelector:function(t){var e=t.split(/([\.\[])/g),n=[],a="",i=-1;for(""===e[0]&&e.shift(),i=0;i<e.length;i++)i%2===0&&(a=""),a+=e[i],i%2!==0&&n.push(a);return n},updateControls:function(t){var a=this,i=null,o=new e.CommandMultimix,r=-1;for(a.callActions("beforeUpdateControls",arguments),t.filter?o.filter=t.filter.selector:o.filter=a.state.activeFilter.selector,t.sort?o.sort=a.buildSortString(t.sort):o.sort=a.buildSortString(a.state.activeSort),o.filter===a.config.selectors.target&&(o.filter="all"),""===o.filter&&(o.filter="none"),n.freeze(o),r=0;i=a.controls[r];r++)i.update(o,a.toggleArray);a.callActions("afterUpdateControls",arguments)},buildSortString:function(t){var e=this,n="";return n+=t.sortString,t.next&&(n+=" "+e.buildSortString(t.next)),n},insertTargets:function(t,a){var i=this,o=null,r=-1,s=null,l=null,c=null,u=-1;if(i.callActions("beforeInsertTargets",arguments),"undefined"==typeof t.index&&(t.index=0),o=i.getNextSibling(t.index,t.sibling,t.position),s=i.dom.document.createDocumentFragment(),r=o?n.index(o,i.config.selectors.target):i.targets.length,t.collection){for(u=0;c=t.collection[u];u++){if(i.dom.targets.indexOf(c)>-1)throw new Error(e.messages.errorInsertPreexistingElement());c.style.display="none",s.appendChild(c),s.appendChild(i.dom.document.createTextNode(" ")),n.isElement(c,i.dom.document)&&c.matches(i.config.selectors.target)&&(l=new e.Target,l.init(c,i),l.isInDom=!0,i.targets.splice(r,0,l),r++)}i.dom.parent.insertBefore(s,o)}a.startOrder=i.origOrder=i.targets,i.callActions("afterInsertTargets",arguments)},getNextSibling:function(t,e,n){var a=this,i=null;return t=Math.max(t,0),e&&"before"===n?i=e:e&&"after"===n?i=e.nextElementSibling||null:a.targets.length>0&&"undefined"!=typeof t?i=t<a.targets.length||!a.targets.length?a.targets[t].dom.el:a.targets[a.targets.length-1].dom.el.nextElementSibling:0===a.targets.length&&a.dom.parent.children.length>0&&(a.config.layout.siblingAfter?i=a.config.layout.siblingAfter:a.config.layout.siblingBefore?i=a.config.layout.siblingBefore.nextElementSibling:a.dom.parent.children[0]),a.callFilters("elementGetNextSibling",i,arguments)},filterOperation:function(t){var e=this,n=!1,a=-1,i="",o=null,r=-1;for(e.callActions("beforeFilterOperation",arguments),i=t.newFilter.action,r=0;o=t.newOrder[r];r++)n=t.newFilter.collection?t.newFilter.collection.indexOf(o.dom.el)>-1:""!==t.newFilter.selector&&o.dom.el.matches(t.newFilter.selector),e.evaluateHideShow(n,o,i,t);if(t.toRemove.length)for(r=0;o=t.show[r];r++)t.toRemove.indexOf(o)>-1&&(t.show.splice(r,1),(a=t.toShow.indexOf(o))>-1&&t.toShow.splice(a,1),t.toHide.push(o),t.hide.push(o),r--);t.matching=t.show.slice(),0===t.show.length&&""!==t.newFilter.selector&&0!==e.targets.length&&(t.hasFailed=!0),e.callActions("afterFilterOperation",arguments)},evaluateHideShow:function(t,e,n,a){var i=this
7042;i.callActions("beforeEvaluateHideShow",arguments),t===!0&&"show"===n||t===!1&&"hide"===n?(a.show.push(e),!e.isShown&&a.toShow.push(e)):(a.hide.push(e),e.isShown&&a.toHide.push(e)),i.callActions("afterEvaluateHideShow",arguments)},sortOperation:function(t){var e=this;e.callActions("beforeSortOperation",arguments),t.startOrder=e.targets,t.newSort.collection?t.newOrder=t.newSort.collection:"random"===t.newSort.order?t.newOrder=n.arrayShuffle(t.startOrder):""===t.newSort.attribute?(t.newOrder=e.origOrder.slice(),"desc"===t.newSort.order&&t.newOrder.reverse()):(t.newOrder=t.startOrder.slice(),t.newOrder.sort(function(n,a){return e.compare(n,a,t.newSort)})),n.isEqualArray(t.newOrder,t.startOrder)&&(t.willSort=!1),e
vendor: 22,189 bytes, line 7042
7042.callActions("afterSortOperation",arguments)},compare:function(t,e,n){var a=this,i=n.order,o=a.getAttributeValue(t,n.attribute),r=a.getAttributeValue(e,n.attribute);return isNaN(1*o)||isNaN(1*r)?(o=o.toLowerCase(),r=r.toLowerCase()):(o=1*o,r=1*r),o<r?"asc"===i?-1:1:o>r?"asc"===i?1:-1:o===r&&n.next?a.compare(t,e,n.next):0},getAttributeValue:function(t,n){var a=this,i="";return i=t.dom.el.getAttribute("data-"+n),null===i&&a.config.debug.showWarnings&&console.warn(e.messages.warningInconsistentSortingAttributes({attribute:"data-"+n})),a.callFilters("valueGetAttributeValue",i||0,arguments)},printSort:function(e,a){var i=this,o=e?a.newOrder:a.startOrder,r=e?a.startOrder:a.newOrder,s=o.length?o[o.length-1].dom.el.nextElementSibling:null,l=t.document.createDocumentFragment(),c=null,u=null,f=null,h=-1;for(i.callActions("beforePrintSort",arguments),h=0;u=o[h];h++)f=u.dom.el,"absolute"!==f.style.position&&(n.removeWhitespace(f.previousSibling),f.parentElement.removeChild(f));for(c=s?s.previousSibling:i.dom.parent.lastChild,c&&"#text"===c.nodeName&&n.removeWhitespace(c),h=0;u=r[h];h++)f=u.dom.el,n.isElement(l.lastChild)&&l.appendChild(t.document.createTextNode(" ")),l.appendChild(f);i.dom.parent.firstChild&&i.dom.parent.firstChild!==s&&l.insertBefore(t.document.createTextNode(" "),l.childNodes[0]),s?(l.appendChild(t.document.createTextNode(" ")),i.dom.parent.insertBefore(l,s)):i.dom.parent.appendChild(l),i.callActions("afterPrintSort",arguments)},parseSortString:function(t,a){var i=this,o=t.split(" "),r=a,s=[],l=-1;for(l=0;l<o.length;l++){switch(s=o[l].split(":"),r.sortString=o[l],r.attribute=n.dashCase(s[0]),r.order=s[1]||"asc",r.attribute){case"default":r.attribute="";break;case"random":r.attribute="",r.order="random"}if(!r.attribute||"random"===r.order)break;l<o.length-1&&(r.next=new e.CommandSort,n.freeze(r),r=r.next)}return i.callFilters("commandsParseSort",a,arguments)},parseEffects:function(){var t=this,n="",a=t.config.animation.effectsIn||t.config.animation.effects,i=t.config.animation.effectsOut||t.config.animation.effects;t.callActions("beforeParseEffects",arguments),t.effectsIn=new e.StyleData,t.effectsOut=new e.StyleData,t.transformIn=[],t.transformOut=[],t.effectsIn.opacity=t.effectsOut.opacity=1,t.parseEffect("fade",a,t.effectsIn,t.transformIn),t.parseEffect("fade",i,t.effectsOut,t.transformOut,!0);for(n in e.transformDefaults)e.transformDefaults[n]instanceof e.TransformData&&(t.parseEffect(n,a,t.effectsIn,t.transformIn),t.parseEffect(n,i,t.effectsOut,t.transformOut,!0));t.parseEffect("stagger",a,t.effectsIn,t.transformIn),t.parseEffect("stagger",i,t.effectsOut,t.transformOut,!0),t.callActions("afterParseEffects",arguments)},parseEffect:function(t,n,a,i,o){var r=this,s=/\(([^)]+)\)/,l=-1,c="",u=[],f="",h=["%","px","em","rem","vh","vw","deg"],d="",m=-1;if(r.callActions("beforeParseEffect",arguments),"string"!=typeof n)throw new TypeError(e.messages.errorConfigInvalidAnimationEffects());if(n.indexOf(t)<0)return void("stagger"===t&&(r.staggerDuration=0));switch(l=n.indexOf(t+"("),l>-1&&(c=n.substring(l),u=s.exec(c),f=u[1]),t){case"fade":a.opacity=f?parseFloat(f):0;break;case"stagger":r.staggerDuration=f?parseFloat(f):100;break;default:if(o&&r.config.animation.reverseOut&&"scale"!==t?a[t].value=(f?parseFloat(f):e.transformDefaults[t].value)*-1:a[t].value=f?parseFloat(f):e.transformDefaults[t].value,f){for(m=0;d=h[m];m++)if(f.indexOf(d)>-1){a[t].unit=d;break}}else a[t].unit=e.transformDefaults[t].unit;i.push(t+"("+a[t].value+a[t].unit+")")}r.callActions("afterParseEffect",arguments)},buildState:function(t){var n=this,a=new e.State,i=null,o=-1;for(n.callActions("beforeBuildState",arguments),o=0;i=n.targets[o];o++)(!t.toRemove.length||t.toRemove.indexOf(i)<0)&&a.targets.push(i.dom.el);for(o=0;i=t.matching[o];o++)a.matching.push(i.dom.el);for(o=0;i=t.show[o];o++)a.show.push(i.dom.el);for(o=0;i=t.hide[o];o++)(!t.toRemove.length||t.toRemove.indexOf(i)<0)&&a.hide.push(i.dom.el);return a.id=n.id,a.container=n.dom.container,a.activeFilter=t.newFilter,a.activeSort=t.newSort,a.activeDataset=t.newDataset,a.activeContainerClassName=t.newContainerClassName,a.hasFailed=t.hasFailed,a.totalTargets=n.targets.length,a.totalShow=t.show.length,a.totalHide=t.hide.length,a.totalMatching=t.matching.length,a.triggerElement=t.triggerElement,n.callFilters("stateBuildState",a,arguments)},goMix:function(a,i){var o=this,r=null;return o.callActions("beforeGoMix",arguments),o.config.animation.duration&&o.config.animation.effects&&n.isVisible(o.dom.container)||(a=!1),i.toShow.length||i.toHide.length||i.willSort||i.willChangeLayout||(a=!1),i.startState.show.length||i.show.length||(a=!1),e.events.fire("mixStart",o.dom.container,{state:i.startState,futureState:i.newState,instance:o},o.dom.document),"function"==typeof o.config.callbacks.onMixStart&&o.config.callbacks.onMixStart.call(o.dom.container,i.startState,i.newState,o),n.removeClass(o.dom.container,n.getClassname(o.config.classNames,"container",o.config.classNames.modifierFailed)),r=o.userDeferred?o.userDeferred:o.userDeferred=n.defer(e.libraries),o.isBusy=!0,a&&e.features.has.transitions?(t.pageYOffset!==i.docState.scrollTop&&t.scrollTo(i.docState.scrollLeft,i.docState.scrollTop),o.config.animation.applyPerspective&&(o.dom.parent.style[e.features.perspectiveProp]=o.config.animation.perspectiveDistance,o.dom.parent.style[e.features.perspectiveOriginProp]=o.config.animation.perspectiveOrigin),o.config.animation.animateResizeContainer&&i.startHeight!==i.newHeight&&i.viewportDeltaY!==i.startHeight-i.newHeight&&(o.dom.parent.style.height=i.startHeight+"px"),o.config.animation.animateResizeContainer&&i.startWidth!==i.newWidth&&i.viewportDeltaX!==i.startWidth-i.newWidth&&(o.dom.parent.style.width=i.startWidth+"px"),i.startHeight===i.newHeight&&(o.dom.parent.style.height=i.startHeight+"px"),i.startWidth===i.newWidth&&(o.dom.parent.style.width=i.startWidth+"px"),i.startHeight===i.newHeight&&i.startWidth===i.newWidth&&(o.dom.parent.style.overflow="hidden"),requestAnimationFrame(function(){o.moveTargets(i)}),o.callFilters("promiseGoMix",r.promise,arguments)):(o.config.debug.fauxAsync?setTimeout(function(){o.cleanUp(i)},o.config.animation.duration):o.cleanUp(i),o.callFilters("promiseGoMix",r.promise,arguments))},getStartMixData:function(n){var a=this,i=t.getComputedStyle(a.dom.parent),o=a.dom.parent.getBoundingClientRect(),r=null,s={},l=-1,c=i[e.features.boxSizingProp];for(a.incPadding="border-box"===c,a.callActions("beforeGetStartMixData",arguments),l=0;r=n.show[l];l++)s=r.getPosData(),n.showPosData[l]={startPosData:s};for(l=0;r=n.toHide[l];l++)s=r.getPosData(),n.toHidePosData[l]={startPosData:s};n.startX=o.left,n.startY=o.top,n.startHeight=a.incPadding?o.height:o.height-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderTop)-parseFloat(i.borderBottom),n.startWidth=a.incPadding?o.width:o.width-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderLeft)-parseFloat(i.borderRight),a.callActions("afterGetStartMixData",arguments)},setInter:function(t){var e=this,a=null,i=-1;for(e.callActions("beforeSetInter",arguments),e.config.animation.clampHeight&&(e.dom.parent.style.height=t.startHeight+"px",e.dom.parent.style.overflow="hidden"),e.config.animation.clampWidth&&(e.dom.parent.style.width=t.startWidth+"px",e.dom.parent.style.overflow="hidden"),i=0;a=t.toShow[i];i++)a.show();t.willChangeLayout&&(n.removeClass(e.dom.container,t.startContainerClassName),n.addClass(e.dom.container,t.newContainerClassName)),e.callActions("afterSetInter",arguments)},getInterMixData:function(t){var e=this,n=null,a=-1;for(e.callActions("beforeGetInterMixData",arguments),a=0;n=t.show[a];a++)t.showPosData[a].interPosData=n.getPosData();for(a=0;n=t.toHide[a];a++)t.toHidePosData[a].interPosData=n.getPosData();e.callActions("afterGetInterMixData",arguments)},setFinal:function(t){var e=this,n=null,a=-1;for(e.callActions("beforeSetFinal",arguments),t.willSort&&e.printSort(!1,t),a=0;n=t.toHide[a];a++)n.hide();e.callActions("afterSetFinal",arguments)},getFinalMixData:function(e){var a=this,i=null,o=null,r=null,s=-1;for(a.callActions("beforeGetFinalMixData",arguments),s=0;r=e.show[s];s++)e.showPosData[s].finalPosData=r.getPosData();for(s=0;r=e.toHide[s];s++)e.toHidePosData[s].finalPosData=r.getPosData();for((a.config.animation.clampHeight||a.config.animation.clampWidth)&&(a.dom.parent.style.height=a.dom.parent.style.width=a.dom.parent.style.overflow=""),a.incPadding||(i=t.getComputedStyle(a.dom.parent)),o=a.dom.parent.getBoundingClientRect(),e.newX=o.left,e.newY=o.top,e.newHeight=a.incPadding?o.height:o.height-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderTop)-parseFloat(i.borderBottom),e.newWidth=a.incPadding?o.width:o.width-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderLeft)-parseFloat(i.borderRight),e.viewportDeltaX=e.docState.viewportWidth-this.dom.document.documentElement.clientWidth,e.viewportDeltaY=e.docState.viewportHeight-this.dom.document.documentElement.clientHeight,e.willSort&&a.printSort(!0,e),s=0;r=e.toShow[s];s++)r.hide();for(s=0;r=e.toHide[s];s++)r.show();e.willChangeLayout&&(n.removeClass(a.dom.container,e.newContainerClassName),n.addClass(a.dom.container,a.config.layout.containerClassName)),a.callActions("afterGetFinalMixData",arguments)},getTweenData:function(t){var n=this,a=null,i=null,o=Object.getOwnPropertyNames(n.effectsIn),r="",s=null,l=-1,c=-1,u=-1,f=-1;for(n.callActions("beforeGetTweenData",arguments),u=0;a=t.show[u];u++)for(i=t.showPosData[u],i.posIn=new e.StyleData,i.posOut=new e.StyleData,i.tweenData=new e.StyleData,a.isShown?(i.posIn.x=i.startPosData.x-i.interPosData.x,i.posIn.y=i.startPosData.y-i.interPosData.y):i.posIn.x=i.posIn.y=0,i.posOut.x=i.finalPosData.x-i.interPosData.x,i.posOut.y=i.finalPosData.y-i.interPosData.y,i.posIn.opacity=a.isShown?1:n.effectsIn.opacity,i.posOut.opacity=1,i.tweenData.opacity=i.posOut.opacity-i.posIn.opacity,a.isShown||n.config.animation.nudge||(i.posIn.x=i.posOut.x,i.posIn.y=i.posOut.y),i.tweenData.x=i.posOut.x-i.posIn.x,i.tweenData.y=i.posOut.y-i.posIn.y,n.config.animation.animateResizeTargets&&(i.posIn.width=i.startPosData.width,i.posIn.height=i.startPosData.height,l=(i.startPosData.width||i.finalPosData.width)-i.interPosData.width,i.posIn.marginRight=i.startPosData.marginRight-l,c=(i.startPosData.height||i.finalPosData.height)-i.interPosData.height,i.posIn.marginBottom=i.startPosData.marginBottom-c,i.posOut.width=i.finalPosData.width,i.posOut.height=i.finalPosData.height,l=(i.finalPosData.width||i.startPosData.width)-i.interPosData.width,i.posOut.marginRight=i.finalPosData.marginRight-l,c=(i.finalPosData.height||i.startPosData.height)-i.interPosData.height,i.posOut.marginBottom=i.finalPosData.marginBottom-c,i.tweenData.width=i.posOut.width-i.posIn.width,i.tweenData.height=i.posOut.height-i.posIn.height,i.tweenData.marginRight=i.posOut.marginRight-i.posIn.marginRight,i.tweenData.marginBottom=i.posOut.marginBottom-i.posIn.marginBottom),f=0;r=o[f];f++)s=n.effectsIn[r],s instanceof e.TransformData&&s.value&&(i.posIn[r].value=s.value,i.posOut[r].value=0,i.tweenData[r].value=i.posOut[r].value-i.posIn[r].value,i.posIn[r].unit=i.posOut[r].unit=i.tweenData[r].unit=s.unit);for(u=0;a=t.toHide[u];u++)for(i=t.toHidePosData[u],i.posIn=new e.StyleData,i.posOut=new e.StyleData,i.tweenData=new e.StyleData,i.posIn.x=a.isShown?i.startPosData.x-i.interPosData.x:0,i.posIn.y=a.isShown?i.startPosData.y-i.interPosData.y:0,i.posOut.x=n.config.animation.nudge?0:i.posIn.x,i.posOut.y=n.config.animation.nudge?0:i.posIn.y,i.tweenData.x=i.posOut.x-i.posIn.x,i.tweenData.y=i.posOut.y-i.posIn.y,n.config.animation.animateResizeTargets&&(i.posIn.width=i.startPosData.width,i.posIn.height=i.startPosData.height,l=i.startPosData.width-i.interPosData.width,i.posIn.marginRight=i.startPosData.marginRight-l,c=i.startPosData.height-i.interPosData.height,i.posIn.marginBottom=i.startPosData.marginBottom-c),i.posIn.opacity=1,i.posOut.opacity=n.effectsOut.opacity,i.tweenData.opacity=i.posOut.opacity-i.posIn.opacity,f=0;r=o[f];f++)s=n.effectsOut[r],s instanceof e.TransformData&&s.value&&(i.posIn[r].value=0,i.posOut[r].value=s.value,i.tweenData[r].value=i.posOut[r].value-i.posIn[r].value,i.posIn[r].unit=i.posOut[r].unit=i.tweenData[r].unit=s.unit);n.callActions("afterGetTweenData",arguments)},moveTargets:function(t){var a=this,i=null,o=null,r=null,s="",l=!1,c=-1,u=-1,f=a.checkProgress.bind(a);for(a.callActions("beforeMoveTargets",arguments),u=0;i=t.show[u];u++)o=new e.IMoveData,r=t.showPosData[u],s=i.isShown?"none":"show",l=a.willTransition(s,t.hasEffect,r.posIn,r.posOut),l&&c++,i.show(),o.posIn=r.posIn,o.posOut=r.posOut,o.statusChange=s,o.staggerIndex=c,o.operation=t,o.callback=l?f:null,i.move(o);for(u=0;i=t.toHide[u];u++)r=t.toHidePosData[u],o=new e.IMoveData,s="hide",l=a.willTransition(s,r.posIn,r.posOut),o.posIn=r.posIn,o.posOut=r.posOut,o.statusChange=s,o.staggerIndex=u,o.operation=t,o.callback=l?f:null,i.move(o);a.config.animation.animateResizeContainer&&(a.dom.parent.style[e.features.transitionProp]="height "+a.config.animation.duration+"ms ease, width "+a.config.animation.duration+"ms ease ",requestAnimationFrame(function(){t.startHeight!==t.newHeight&&t.viewportDeltaY!==t.startHeight-t.newHeight&&(a.dom.parent.style.height=t.newHeight+"px"),t.startWidth!==t.newWidth&&t.viewportDeltaX!==t.startWidth-t.newWidth&&(a.dom.parent.style.width=t.newWidth+"px")})),t.willChangeLayout&&(n.removeClass(a.dom.container,a.config.layout.ContainerClassName),n.addClass(a.dom.container,t.newContainerClassName)),a.callActions("afterMoveTargets",arguments)},hasEffect:function(){var t=this,e=["scale","translateX","translateY","translateZ","rotateX","rotateY","rotateZ"],n="",a=null,i=!1,o=-1,r=-1;if(1!==t.effectsIn.opacity)return t.callFilters("resultHasEffect",!0,arguments);for(r=0;n=e[r];r++)if(a=t.effectsIn[n],o="undefined"!==a.value?a.value:a,0!==o){i=!0;break}return t.callFilters("resultHasEffect",i,arguments)},willTransition:function(t,e,a,i){var o=this,r=!1;return r=!!n.isVisible(o.dom.container)&&(!!("none"!==t&&e||a.x!==i.x||a.y!==i.y)||!!o.config.animation.animateResizeTargets&&(a.width!==i.width||a.height!==i.height||a.marginRight!==i.marginRight||a.marginTop!==i.marginTop)),o.callFilters("resultWillTransition",r,arguments)},checkProgress:function(t){var e=this;e.targetsDone++,e.targetsBound===e.targetsDone&&e.cleanUp(t)},cleanUp:function(t){var a=this,i=null,o=null,r=null,s=null,l=-1;for(a.callActions("beforeCleanUp",arguments),a.targetsMoved=a.targetsImmovable=a.targetsBound=a.targetsDone=0,l=0;i=t.show[l];l++)i.cleanUp(),i.show();for(l=0;i=t.toHide[l];l++)i.cleanUp(),i.hide();if(t.willSort&&a.printSort(!1,t),a.dom.parent.style[e.features.transitionProp]=a.dom.parent.style.height=a.dom.parent.style.width=a.dom.parent.style.overflow=a.dom.parent.style[e.features.perspectiveProp]=a.dom.parent.style[e.features.perspectiveOriginProp]="",t.willChangeLayout&&(n.removeClass(a.dom.container,t.startContainerClassName),n.addClass(a.dom.container,t.newContainerClassName)),t.toRemove.length){for(l=0;i=a.targets[l];l++)t.toRemove.indexOf(i)>-1&&((o=i.dom.el.previousSibling)&&"#text"===o.nodeName&&(r=i.dom.el.nextSibling)&&"#text"===r.nodeName&&n.removeWhitespace(o),t.willSort||a.dom.parent.removeChild(i.dom.el),a.targets.splice(l,1),i.isInDom=!1,l--);a.origOrder=a.targets}t.willSort&&(a.targets=t.newOrder),a.state=t.newState,a.lastOperation=t,a.dom.targets=a.state.targets,e.events.fire("mixEnd",a.dom.container,{state:a.state,instance:a},a.dom.document),"function"==typeof a.config.callbacks.onMixEnd&&a.config.callbacks.onMixEnd.call(a.dom.container,a.state,a),t.hasFailed&&(e.events.fire("mixFail",a.dom.container,{state:a.state,instance:a},a.dom.document),"function"==typeof a.config.callbacks.onMixFail&&a.config.callbacks.onMixFail.call(a.dom.container,a.state,a),n.addClass(a.dom.container,n.getClassname(a.config.classNames,"container",a.config.classNames.modifierFailed))),"function"==typeof a.userCallback&&a.userCallback.call(a.dom.container,a.state,a),"function"==typeof a.userDeferred.resolve&&a.userDeferred.resolve(a.state),a.userCallback=null,a.userDeferred=null,a.lastClicked=null,a.isToggling=!1,a.isBusy=!1,a.queue.length&&(a.callActions("beforeReadQueueCleanUp",arguments),s=a.queue.shift(),a.userDeferred=s.deferred,a.isToggling=s.isToggling,a.lastClicked=s.triggerElement,s.instruction.command instanceof e.CommandMultimix?a.multimix.apply(a,s.args):a.dataset.apply(a,s.args)),a.callActions("afterCleanUp",arguments)},parseMultimixArgs:function(t){var a=this,i=new e.UserInstruction,o=null,r=-1;for(i.animate=a.config.animation.enable,i.command=new e.CommandMultimix,r=0;r<t.length;r++)o=t[r],null!==o&&("object"==typeof o?n.extend(i.command,o):"boolean"==typeof o?i.animate=o:"function"==typeof o&&(i.callback=o));return!i.command.insert||i.command.insert instanceof e.CommandInsert||(i.command.insert=a.parseInsertArgs([i.command.insert]).command),!i.command.remove||i.command.remove instanceof e.CommandRemove||(i.command.remove=a.parseRemoveArgs([i.command.remove]).command),!i.command.filter||i.command.filter instanceof e.CommandFilter||(i.command.filter=a.parseFilterArgs([i.command.filter]).command),!i.command.sort||i.command.sort instanceof e.CommandSort||(i.command.sort=a.parseSortArgs([i.command.sort]).command),!i.command.changeLayout||i.command.changeLayout instanceof e.CommandChangeLayout||(i.command.changeLayout=a.parseChangeLayoutArgs([i.command.changeLayout]).command),i=a.callFilters("instructionParseMultimixArgs",i,arguments),n.freeze(i),i},parseFilterArgs:function(t){var a=this,i=new e.UserInstruction,o=null,r=-1;for(i.animate=a.config.animation.enable,i.command=new e.CommandFilter,r=0;r<t.length;r++)o=t[r],"string"==typeof o?i.command.selector=o:null===o?i.command.collection=[]:"object"==typeof o&&n.isElement(o,a.dom.document)?i.command.collection=[o]:"object"==typeof o&&"undefined"!=typeof o.length?i.command.collection=n.arrayFromList(o):"object"==typeof o?n.extend(i.command,o):"boolean"==typeof o?i.animate=o:"function"==typeof o&&(i.callback=o);if(i.command.selector&&i.command.collection)throw new Error(e.messages.errorFilterInvalidArguments());return i=a.callFilters("instructionParseFilterArgs",i,arguments),n.freeze(i),i},parseSortArgs:function(t){var a=this,i=new e.UserInstruction,o=null,r="",s=-1;for(i.animate=a.config.animation.enable,i.command=new e.CommandSort,s=0;s<t.length;s++)if(o=t[s],null!==o)switch(typeof o){case"string":r=o;break;case"object":o.length&&(i.command.collection=n.arrayFromList(o));break;case"boolean":i.animate=o;break;case"function":i.callback=o}return r&&(i.command=a.parseSortString(r,i.command)),i=a.callFilters("instructionParseSortArgs",i,arguments),n.freeze(i),i},parseInsertArgs:function(t){var a=this,i=new e.UserInstruction,o=null,r=-1;for(i.animate=a.config.animation.enable,i.command=new e.CommandInsert,r=0;r<t.length;r++)o=t[r],null!==o&&("number"==typeof o?i.command.index=o:"string"==typeof o&&["before","after"].indexOf(o)>-1?i.command.position=o:"string"==typeof o?i.command.collection=n.arrayFromList(n.createElement(o).childNodes):"object"==typeof o&&n.isElement(o,a.dom.document)?i.command.collection.length?i.command.sibling=o:i.command.collection=[o]:"object"==typeof o&&o.length?i.command.collection.length?i.command.sibling=o[0]:i.command.collection=o:"object"==typeof o&&o.childNodes&&o.childNodes.length?i.command.collection.length?i.command.sibling=o.childNodes[0]:i.command.collection=n.arrayFromList(o.childNodes):"object"==typeof o?n.extend(i.command,o):"boolean"==typeof o?i.animate=o:"function"==typeof o&&(i.callback=o));if(i.command.index&&i.command.sibling)throw new Error(e.messages.errorInsertInvalidArguments());return!i.command.collection.length&&a.config.debug.showWarnings&&console.warn(e.messages.warningInsertNoElements()),i=a.callFilters("instructionParseInsertArgs",i,arguments),n.freeze(i),i},parseRemoveArgs:function(t){var a=this,i=new e.UserInstruction,o=null,r=null,s=-1;for(i.animate=a.config.animation.enable,i.command=new e.CommandRemove,s=0;s<t.length;s++)if(r=t[s],null!==r)switch(typeof r){case"number":a.targets[r]&&(i.command.targets[0]=a.targets[r]);break;case"string":i.command.collection=n.arrayFromList(a.dom.parent.querySelectorAll(r));break;case"object":r&&r.length?i.command.collection=r:n.isElement(r,a.dom.document)?i.command.collection=[r]:n.extend(i.command,r);break;case"boolean":i.animate=r;break;case"function":i.callback=r}if(i.command.collection.length)for(s=0;o=a.targets[s];s++)i.command.collection.indexOf(o.dom.el)>-1&&i.command.targets.push(o);return!i.command.targets.length&&a.config.debug.showWarnings&&console.warn(e.messages.warningRemoveNoElements()),n.freeze(i),i},parseDatasetArgs:function(t){var a=this,i=new e.UserInstruction,o=null,r=-1;for(i.animate=a.config.animation.enable,i.command=new e.CommandDataset,r=0;r<t.length;r++)if(o=t[r],null!==o)switch(typeof o){case"object":Array.isArray(o)||"number"==typeof o.length?i.command.dataset=o:n.extend(i.command,o);break;case"boolean":i.animate=o;break;case"function":i.callback=o}return n.freeze(i),i},parseChangeLayoutArgs:function(t){var a=this,i=new e.UserInstruction,o=null,r=-1;for(i.animate=a.config.animation.enable,i.command=new e.CommandChangeLayout,r=0;r<t.length;r++)if(o=t[r],null!==o)switch(typeof o){case"string":i.command.containerClassName=o;break;case"object":n.extend(i.command,o);break;case"boolean":i.animate=o;break;case"function":i.callback=o}return n.freeze(i),i},queueMix:function(t){var a=this,i=null,o="";return a.callActions("beforeQueueMix",arguments),i=n.defer(e.libraries),a.config.animation.queue&&a.queue.length<a.config.animation.queueLimit?(t.deferred=i,a.queue.push(t),a.config.controls.enable&&(a.isToggling?(a.buildToggleArray(t.instruction.command),o=a.getToggleSelector(),a.updateControls({filter:{selector:o}})):a.updateControls(t.instruction.command))):(a.config.debug.showWarnings&&console.warn(e.messages.warningMultimixInstanceQueueFull()),i.resolve(a.state),e.events.fire("mixBusy",a.dom.container,{state:a.state,instance:a},a.dom.document),"function"==typeof a.config.callbacks.onMixBusy&&a.config.callbacks.onMixBusy.call(a.dom.container,a.state,a)),
vendor: 2,526 bytes, lines 7042-7043
7042a.callFilters("promiseQueueMix",i.promise,arguments)},getDataOperation:function(t){var a=this,i=new e.Operation,o=[];if(i=a.callFilters("operationUnmappedGetDataOperation",i,arguments),a.dom.targets.length&&!(o=a.state.activeDataset||[]).length)throw new Error(e.messages.errorDatasetNotSet()); 7043return i.id=n.randomHex(),i.startState=a.state,i.startDataset=o,i.newDataset=t.slice(),a.diffDatasets(i),i.startOrder=a.targets,i.newOrder=i.show,a.config.animation.enable&&(a.getStartMixData(i),a.setInter(i),i.docState=n.getDocumentState(a.dom.document),a.getInterMixData(i),a.setFinal(i),a.getFinalMixData(i),a.parseEffects(),i.hasEffect=a.hasEffect(),a.getTweenData(i)),a.targets=i.show.slice(),i.newState=a.buildState(i),Array.prototype.push.apply(a.targets,i.toRemove),i=a.callFilters("operationMappedGetDataOperation",i,arguments)},diffDatasets:function(t){var a=this,i=[],o=[],r=[],s=null,l=null,c=null,u=null,f=null,h={},d="",m=-1;for(a.callActions("beforeDiffDatasets",arguments),m=0;s=t.newDataset[m];m++){if("undefined"==typeof(d=s[a.config.data.uidKey])||d.toString().length<1)throw new TypeError(e.messages.errorDatasetInvalidUidKey({uidKey:a.config.data.uidKey}));if(h[d])throw new Error(e.messages.errorDatasetDuplicateUid({uid:d}));h[d]=!0,(l=a.cache[d])instanceof e.Target?(a.config.data.dirtyCheck&&!n.deepEquals(s,l.data)&&(c=l.render(s),l.data=s,c!==l.dom.el&&(l.isInDom&&(l.unbindEvents(),a.dom.parent.replaceChild(c,l.dom.el)),l.isShown||(c.style.display="none"),l.dom.el=c,l.isInDom&&l.bindEvents())),c=l.dom.el):(l=new e.Target,l.init(null,a,s),l.hide()),l.isInDom?(f=l.dom.el.nextElementSibling,o.push(d),u&&(u.lastElementChild&&u.appendChild(a.dom.document.createTextNode(" ")),a.insertDatasetFrag(u,l.dom.el,r),u=null)):(u||(u=a.dom.document.createDocumentFragment()),u.lastElementChild&&u.appendChild(a.dom.document.createTextNode(" ")),u.appendChild(l.dom.el),l.isInDom=!0,l.unbindEvents(),l.bindEvents(),l.hide(),t.toShow.push(l),r.push(l)),t.show.push(l)}for(u&&(f=f||a.config.layout.siblingAfter,f&&u.appendChild(a.dom.document.createTextNode(" ")),a.insertDatasetFrag(u,f,r)),m=0;s=t.startDataset[m];m++)d=s[a.config.data.uidKey],l=a.cache[d],t.show.indexOf(l)<0?(t.hide.push(l),t.toHide.push(l),t.toRemove.push(l)):i.push(d);n.isEqualArray(i,o)||(t.willSort=!0),a.callActions("afterDiffDatasets",arguments)},insertDatasetFrag:function(t,e,n){var a=this,i=e?Array.from(a.dom.parent.children).indexOf(e):a.targets.length;for(a.dom.parent.insertBefore(t,e);n.length;)a.targets.splice(i,0,n.shift()),i
vendor: 18,870 bytes, line 7043
7043++},willSort:function(t,e){var n=this,a=!1;return a=!!(n.config.behavior.liveSort||"random"===t.order||t.attribute!==e.attribute||t.order!==e.order||t.collection!==e.collection||null===t.next&&e.next||t.next&&null===e.next)||!(!t.next||!e.next)&&n.willSort(t.next,e.next),n.callFilters("resultWillSort",a,arguments)},show:function(){var t=this;return t.filter("all")},hide:function(){var t=this;return t.filter("none")},isMixing:function(){var t=this;return t.isBusy},filter:function(){var t=this,e=t.parseFilterArgs(arguments);return t.multimix({filter:e.command},e.animate,e.callback)},toggleOn:function(){var t=this,e=t.parseFilterArgs(arguments),n=e.command.selector,a="";return t.isToggling=!0,t.toggleArray.indexOf(n)<0&&t.toggleArray.push(n),a=t.getToggleSelector(),t.multimix({filter:a},e.animate,e.callback)},toggleOff:function(){var t=this,e=t.parseFilterArgs(arguments),n=e.command.selector,a=t.toggleArray.indexOf(n),i="";return t.isToggling=!0,a>-1&&t.toggleArray.splice(a,1),i=t.getToggleSelector(),t.multimix({filter:i},e.animate,e.callback)},sort:function(){var t=this,e=t.parseSortArgs(arguments);return t.multimix({sort:e.command},e.animate,e.callback)},changeLayout:function(){var t=this,e=t.parseChangeLayoutArgs(arguments);return t.multimix({changeLayout:e.command},e.animate,e.callback)},dataset:function(){var t=this,n=t.parseDatasetArgs(arguments),a=null,i=null,o=!1;return t.callActions("beforeDataset",arguments),t.isBusy?(i=new e.QueueItem,i.args=arguments,i.instruction=n,t.queueMix(i)):(n.callback&&(t.userCallback=n.callback),o=n.animate^t.config.animation.enable?n.animate:t.config.animation.enable,a=t.getDataOperation(n.command.dataset),t.goMix(o,a))},multimix:function(){var t=this,n=null,a=!1,i=null,o=t.parseMultimixArgs(arguments);return t.callActions("beforeMultimix",arguments),t.isBusy?(i=new e.QueueItem,i.args=arguments,i.instruction=o,i.triggerElement=t.lastClicked,i.isToggling=t.isToggling,t.queueMix(i)):(n=t.getOperation(o.command),t.config.controls.enable&&(o.command.filter&&!t.isToggling&&(t.toggleArray.length=0,t.buildToggleArray(n.command)),t.queue.length<1&&t.updateControls(n.command)),o.callback&&(t.userCallback=o.callback),a=o.animate^t.config.animation.enable?o.animate:t.config.animation.enable,t.callFilters("operationMultimix",n,arguments),t.goMix(a,n))},getOperation:function(t){var a=this,i=t.sort,o=t.filter,r=t.changeLayout,s=t.remove,l=t.insert,c=new e.Operation;return c=a.callFilters("operationUnmappedGetOperation",c,arguments),c.id=n.randomHex(),c.command=t,c.startState=a.state,c.triggerElement=a.lastClicked,a.isBusy?(a.config.debug.showWarnings&&console.warn(e.messages.warningGetOperationInstanceBusy()),null):(l&&a.insertTargets(l,c),s&&(c.toRemove=s.targets),c.startSort=c.newSort=c.startState.activeSort,c.startOrder=c.newOrder=a.targets,i&&(c.startSort=c.startState.activeSort,c.newSort=i,c.willSort=a.willSort(i,c.startState.activeSort),c.willSort&&a.sortOperation(c)),c.startFilter=c.startState.activeFilter,o?c.newFilter=o:c.newFilter=n.extend(new e.CommandFilter,c.startFilter),"all"===c.newFilter.selector?c.newFilter.selector=a.config.selectors.target:"none"===c.newFilter.selector&&(c.newFilter.selector=""),a.filterOperation(c),c.startContainerClassName=c.startState.activeContainerClassName,r?(c.newContainerClassName=r.containerClassName,c.newContainerClassName!==c.startContainerClassName&&(c.willChangeLayout=!0)):c.newContainerClassName=c.startContainerClassName,a.config.animation.enable&&(a.getStartMixData(c),a.setInter(c),c.docState=n.getDocumentState(a.dom.document),a.getInterMixData(c),a.setFinal(c),a.getFinalMixData(c),a.parseEffects(),c.hasEffect=a.hasEffect(),a.getTweenData(c)),c.willSort&&(a.targets=c.newOrder),c.newState=a.buildState(c),a.callFilters("operationMappedGetOperation",c,arguments))},tween:function(t,e){var n=null,a=null,i=-1,o=-1;for(e=Math.min(e,1),e=Math.max(e,0),o=0;n=t.show[o];o++)a=t.showPosData[o],n.applyTween(a,e);for(o=0;n=t.hide[o];o++)n.isShown&&n.hide(),(i=t.toHide.indexOf(n))>-1&&(a=t.toHidePosData[i],n.isShown||n.show(),n.applyTween(a,e))},insert:function(){var t=this,e=t.parseInsertArgs(arguments);return t.multimix({insert:e.command},e.animate,e.callback)},insertBefore:function(){var t=this,e=t.parseInsertArgs(arguments);return t.insert(e.command.collection,"before",e.command.sibling,e.animate,e.callback)},insertAfter:function(){var t=this,e=t.parseInsertArgs(arguments);return t.insert(e.command.collection,"after",e.command.sibling,e.animate,e.callback)},prepend:function(){var t=this,e=t.parseInsertArgs(arguments);return t.insert(0,e.command.collection,e.animate,e.callback)},append:function(){var t=this,e=t.parseInsertArgs(arguments);return t.insert(t.state.totalTargets,e.command.collection,e.animate,e.callback)},remove:function(){var t=this,e=t.parseRemoveArgs(arguments);return t.multimix({remove:e.command},e.animate,e.callback)},getConfig:function(t){var e=this,a=null;return a=t?n.getProperty(e.config,t):e.config,e.callFilters("valueGetConfig",a,arguments)},configure:function(t){var e=this;e.callActions("beforeConfigure",arguments),n.extend(e.config,t,!0,!0),e.callActions("afterConfigure",arguments)},getState:function(){var t=this,a=null;return a=new e.State,n.extend(a,t.state),n.freeze(a),t.callFilters("stateGetState",a,arguments)},forceRefresh:function(){var t=this;t.indexTargets()},forceRender:function(){var t=this,e=null,n=null,a="";for(a in t.cache)e=t.cache[a],n=e.render(e.data),n!==e.dom.el&&(e.isInDom&&(e.unbindEvents(),t.dom.parent.replaceChild(n,e.dom.el)),e.isShown||(n.style.display="none"),e.dom.el=n,e.isInDom&&e.bindEvents());t.state=t.buildState(t.lastOperation)},destroy:function(t){var n=this,a=null,i=null,o=0;for(n.callActions("beforeDestroy",arguments),o=0;a=n.controls[o];o++)a.removeBinding(n);for(o=0;i=n.targets[o];o++)t&&i.show(),i.unbindEvents();n.dom.container.id.match(/^MixItUp/)&&n.dom.container.removeAttribute("id"),delete e.instances[n.id],n.callActions("afterDestroy",arguments)}}),e.IMoveData=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.posIn=null,this.posOut=null,this.operation=null,this.callback=null,this.statusChange="",this.duration=-1,this.staggerIndex=-1,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.IMoveData),e.IMoveData.prototype=Object.create(e.Base.prototype),e.IMoveData.prototype.constructor=e.IMoveData,e.TargetDom=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.el=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.TargetDom),e.TargetDom.prototype=Object.create(e.Base.prototype),e.TargetDom.prototype.constructor=e.TargetDom,e.Target=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.id="",this.sortString="",this.mixer=null,this.callback=null,this.isShown=!1,this.isBound=!1,this.isExcluded=!1,this.isInDom=!1,this.handler=null,this.operation=null,this.data=null,this.dom=new e.TargetDom,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.Target),e.Target.prototype=Object.create(e.Base.prototype),n.extend(e.Target.prototype,{constructor:e.Target,init:function(t,n,a){var i=this,o="";if(i.callActions("beforeInit",arguments),i.mixer=n,t||(t=i.render(a)),i.cacheDom(t),i.bindEvents(),"none"!==i.dom.el.style.display&&(i.isShown=!0),a&&n.config.data.uidKey){if("undefined"==typeof(o=a[n.config.data.uidKey])||o.toString().length<1)throw new TypeError(e.messages.errorDatasetInvalidUidKey({uidKey:n.config.data.uidKey}));i.id=o,i.data=a,n.cache[o]=i}i.callActions("afterInit",arguments)},render:function(t){var a=this,i=null,o=null,r=null,s="";if(a.callActions("beforeRender",arguments),i=a.callFilters("renderRender",a.mixer.config.render.target,arguments),"function"!=typeof i)throw new TypeError(e.messages.errorDatasetRendererNotSet());return s=i(t),s&&"object"==typeof s&&n.isElement(s)?o=s:"string"==typeof s&&(r=document.createElement("div"),r.innerHTML=s,o=r.firstElementChild),a.callFilters("elRender",o,arguments)},cacheDom:function(t){var e=this;e.callActions("beforeCacheDom",arguments),e.dom.el=t,e.callActions("afterCacheDom",arguments)},getSortString:function(t){var e=this,n=e.dom.el.getAttribute("data-"+t)||"";e.callActions("beforeGetSortString",arguments),n=isNaN(1*n)?n.toLowerCase():1*n,e.sortString=n,e.callActions("afterGetSortString",arguments)},show:function(){var t=this;t.callActions("beforeShow",arguments),t.isShown||(t.dom.el.style.display="",t.isShown=!0),t.callActions("afterShow",arguments)},hide:function(){var t=this;t.callActions("beforeHide",arguments),t.isShown&&(t.dom.el.style.display="none",t.isShown=!1),t.callActions("afterHide",arguments)},move:function(t){var e=this;e.callActions("beforeMove",arguments),e.isExcluded||e.mixer.targetsMoved++,e.applyStylesIn(t),requestAnimationFrame(function(){e.applyStylesOut(t)}),e.callActions("afterMove",arguments)},applyTween:function(t,n){var a=this,i="",o=null,r=t.posIn,s=[],l=new e.StyleData,c=-1;for(a.callActions("beforeApplyTween",arguments),l.x=r.x,l.y=r.y,0===n?a.hide():a.isShown||a.show(),c=0;i=e.features.TWEENABLE[c];c++)if(o=t.tweenData[i],"x"===i){if(!o)continue;l.x=r.x+o*n}else if("y"===i){if(!o)continue;l.y=r.y+o*n}else if(o instanceof e.TransformData){if(!o.value)continue;l[i].value=r[i].value+o.value*n,l[i].unit=o.unit,s.push(i+"("+l[i].value+o.unit+")")}else{if(!o)continue;l[i]=r[i]+o*n,a.dom.el.style[i]=l[i]}(l.x||l.y)&&s.unshift("translate("+l.x+"px, "+l.y+"px)"),s.length&&(a.dom.el.style[e.features.transformProp]=s.join(" ")),a.callActions("afterApplyTween",arguments)},applyStylesIn:function(t){var n=this,a=t.posIn,i=1!==n.mixer.effectsIn.opacity,o=[];n.callActions("beforeApplyStylesIn",arguments),o.push("translate("+a.x+"px, "+a.y+"px)"),n.mixer.config.animation.animateResizeTargets&&("show"!==t.statusChange&&(n.dom.el.style.width=a.width+"px",n.dom.el.style.height=a.height+"px"),n.dom.el.style.marginRight=a.marginRight+"px",n.dom.el.style.marginBottom=a.marginBottom+"px"),i&&(n.dom.el.style.opacity=a.opacity),"show"===t.statusChange&&(o=o.concat(n.mixer.transformIn)),n.dom.el.style[e.features.transformProp]=o.join(" "),n.callActions("afterApplyStylesIn",arguments)},applyStylesOut:function(t){var n=this,a=[],i=[],o=n.mixer.config.animation.animateResizeTargets,r="undefined"!=typeof n.mixer.effectsIn.opacity;if(n.callActions("beforeApplyStylesOut",arguments),a.push(n.writeTransitionRule(e.features.transformRule,t.staggerIndex)),"none"!==t.statusChange&&a.push(n.writeTransitionRule("opacity",t.staggerIndex,t.duration)),o&&(a.push(n.writeTransitionRule("width",t.staggerIndex,t.duration)),a.push(n.writeTransitionRule("height",t.staggerIndex,t.duration)),a.push(n.writeTransitionRule("margin",t.staggerIndex,t.duration))),!t.callback)return n.mixer.targetsImmovable++,void(n.mixer.targetsMoved===n.mixer.targetsImmovable&&n.mixer.cleanUp(t.operation));switch(n.operation=t.operation,n.callback=t.callback,!n.isExcluded&&n.mixer.targetsBound++,n.isBound=!0,n.applyTransition(a),o&&t.posOut.width>0&&t.posOut.height>0&&(n.dom.el.style.width=t.posOut.width+"px",n.dom.el.style.height=t.posOut.height+"px",n.dom.el.style.marginRight=t.posOut.marginRight+"px",n.dom.el.style.marginBottom=t.posOut.marginBottom+"px"),n.mixer.config.animation.nudge||"hide"!==t.statusChange||i.push("translate("+t.posOut.x+"px, "+t.posOut.y+"px)"),t.statusChange){case"hide":r&&(n.dom.el.style.opacity=n.mixer.effectsOut.opacity),i=i.concat(n.mixer.transformOut);break;case"show":r&&(n.dom.el.style.opacity=1)}(n.mixer.config.animation.nudge||!n.mixer.config.animation.nudge&&"hide"!==t.statusChange)&&i.push("translate("+t.posOut.x+"px, "+t.posOut.y+"px)"),n.dom.el.style[e.features.transformProp]=i.join(" "),n.callActions("afterApplyStylesOut",arguments)},writeTransitionRule:function(t,e,n){var a=this,i=a.getDelay(e),o="";return o=t+" "+(n>0?n:a.mixer.config.animation.duration)+"ms "+i+"ms "+("opacity"===t?"linear":a.mixer.config.animation.easing),a.callFilters("ruleWriteTransitionRule",o,arguments)},getDelay:function(t){var e=this,n=-1;return"function"==typeof e.mixer.config.animation.staggerSequence&&(t=e.mixer.config.animation.staggerSequence.call(e,t,e.state)),n=e.mixer.staggerDuration?t*e.mixer.staggerDuration:0,e.callFilters("delayGetDelay",n,arguments)},applyTransition:function(t){var n=this,a=t.join(", ");n.callActions("beforeApplyTransition",arguments),n.dom.el.style[e.features.transitionProp]=a,n.callActions("afterApplyTransition",arguments)},handleTransitionEnd:function(t){var e=this,n=t.propertyName,a=e.mixer.config.animation.animateResizeTargets;e.callActions("beforeHandleTransitionEnd",arguments),e.isBound&&t.target.matches(e.mixer.config.selectors.target)&&(n.indexOf("transform")>-1||n.indexOf("opacity")>-1||a&&n.indexOf("height")>-1||a&&n.indexOf("width")>-1||a&&n.indexOf("margin")>-1)&&(e.callback.call(e,e.operation),e.isBound=!1,e.callback=null,e.operation=null),e.callActions("afterHandleTransitionEnd",arguments)},eventBus:function(t){var e=this;switch(e.callActions("beforeEventBus",arguments),t.type){case"webkitTransitionEnd":case"transitionend":e.handleTransitionEnd(t)}e.callActions("afterEventBus",arguments)},unbindEvents:function(){var t=this;t.callActions("beforeUnbindEvents",arguments),n.off(t.dom.el,"webkitTransitionEnd",t.handler),n.off(t.dom.el,"transitionend",t.handler),t.callActions("afterUnbindEvents",arguments)},bindEvents:function(){var t=this,a="";t.callActions("beforeBindEvents",arguments),a="webkit"===e.features.transitionPrefix?"webkitTransitionEnd":"transitionend",t.handler=function(e){return t.eventBus(e)},n.on(t.dom.el,a,t.handler),t.callActions("afterBindEvents",arguments)},getPosData:function(n){var a=this,i={},o=null,r=new e.StyleData;return a.callActions("beforeGetPosData",arguments),r.x=a.dom.el.offsetLeft,r.y=a.dom.el.offsetTop,(a.mixer.config.animation.animateResizeTargets||n)&&(o=a.dom.el.getBoundingClientRect(),r.top=o.top,r.right=o.right,r.bottom=o.bottom,r.left=o.left,r.width=o.width,r.height=o.height),a.mixer.config.animation.animateResizeTargets&&(i=t.getComputedStyle(a.dom.el),r.marginBottom=parseFloat(i.marginBottom),r.marginRight=parseFloat(i.marginRight)),a.callFilters("posDataGetPosData",r,arguments)},cleanUp:function(){var t=this;t.callActions("beforeCleanUp",arguments),t.dom.el.style[e.features.transformProp]="",t.dom.el.style[e.features.transitionProp]="",t.dom.el.style.opacity="",t.mixer.config.animation.animateResizeTargets&&(t.dom.el.style.width="",t.dom.el.style.height="",t.dom.el.style.marginRight="",t.dom.el.style.marginBottom=""),t.callActions("afterCleanUp",arguments)}}),e.Collection=function(t){var e=null,a=-1;for(this.callActions("beforeConstruct"),a=0;e=t[a];a++)this[a]=e;this.length=t.length,this.callActions("afterConstruct"),n.freeze(this)},e.BaseStatic.call(e.Collection),e.Collection.prototype=Object.create(e.Base.prototype),n.extend(e.Collection.prototype,{constructor:e.Collection,mixitup:function(t){var a=this,i=null,o=Array.prototype.slice.call(arguments),r=[],s=-1;for(this.callActions("beforeMixitup"),o.shift(),s=0;i=a[s];s++)r.push(i[t].apply(i,o));return a.callFilters("promiseMixitup",n.all(r,e.libraries),arguments)}}),e.Operation=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.id="",this.args=[],this.command=null,this.showPosData=[],this.toHidePosData=[],this.startState=null,this.newState=null,this.docState=null,this.willSort=!1,this.willChangeLayout=!1,this.hasEffect=!1,this.hasFailed=!1,this.triggerElement=null,this.show=[],this.hide=[],this.matching=[],this.toShow=[],this.toHide=[],this.toMove=[],this.toRemove=[],this.startOrder=[],this.newOrder=[],this.startSort=null,this.newSort=null,this.startFilter=null,this.newFilter=null,this.startDataset=null,this.newDataset=null,this.viewportDeltaX=0,this.viewportDeltaY=0,this.startX=0,this.startY=0,this.startHeight=0,this.startWidth=0,this.newX=0,this.newY=0,this.newHeight=0,this.newWidth=0,this.startContainerClassName="",this.startDisplay="",this.newContainerClassName="",this.newDisplay="",this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.Operation),e.Operation.prototype=Object.create(e.Base.prototype),e.Operation.prototype.constructor=e.Operation,e.State=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.id="",this.activeFilter=null,this.activeSort=null,this.activeContainerClassName="",this.container=null,this.targets=[],this.hide=[],this.show=[],this.matching=[],this.totalTargets=-1,this.totalShow=-1,this.totalHide=-1,this.totalMatching=-1,this.hasFailed=!1,this.triggerElement=null,this.activeDataset=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.State),e.State.prototype=Object.create(e.Base.prototype),e.State.prototype.constructor=e.State,e.UserInstruction=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.command={},this.animate=!1,this.callback=null,this.callActions("afterConstruct"),n.seal(this)},e.BaseStatic.call(e.UserInstruction),e.UserInstruction.prototype=Object.create(e.Base.prototype),e.UserInstruction.prototype.constructor=e.UserInstruction,e.Messages=function(){e.Base.call(this),this.callActions("beforeConstruct"),this.ERROR_FACTORY_INVALID_CONTAINER="[MixItUp] An invalid selector or element reference was passed to the mixitup factory function",this.ERROR_FACTORY_CONTAINER_NOT_FOUND="[MixItUp] The provided selector yielded no container element",this.ERROR_CONFIG_INVALID_ANIMATION_EFFECTS="[MixItUp] Invalid value for `animation.effects`",this.ERROR_CONFIG_INVALID_CONTROLS_SCOPE="[MixItUp] Invalid value for `controls.scope`",this.ERROR_CONFIG_INVALID_PROPERTY='[MixitUp] Invalid configuration object property "${erroneous}"${suggestion}',this.ERROR_CONFIG_INVALID_PROPERTY_SUGGESTION='. Did you mean "${probableMatch}"?',this.ERROR_CONFIG_DATA_UID_KEY_NOT_SET="[MixItUp] To use the dataset API, a UID key must be specified using `data.uidKey`",this.ERROR_DATASET_INVALID_UID_KEY='[MixItUp] The specified UID key "${uidKey}" is not present on one or more dataset items',this.ERROR_DATASET_DUPLICATE_UID='[MixItUp] The UID "${uid}" was found on two or more dataset items. UIDs must be unique.',this.ERROR_INSERT_INVALID_ARGUMENTS="[MixItUp] Please provider either an index or a sibling and position to insert, not both",this.ERROR_INSERT_PREEXISTING_ELEMENT="[MixItUp] An element to be inserted already exists in the container",this.ERROR_FILTER_INVALID_ARGUMENTS="[MixItUp] Please provide either a selector or collection `.filter()`, not both",this.ERROR_DATASET_NOT_SET="[MixItUp] To use the dataset API with pre-rendered targets, a starting dataset must be set using `load.dataset`",this.ERROR_DATASET_PRERENDERED_MISMATCH="[MixItUp] `load.dataset` does not match pre-rendered targets",this.ERROR_DATASET_RENDERER_NOT_SET="[MixItUp] To insert an element via the dataset API, a target renderer function must be provided to `render.target`",this.
7043WARNING_FACTORY_PREEXISTING_INSTANCE="[MixItUp] WARNING: This element already has an active MixItUp instance. The provided configuration object will be ignored. If you wish to perform additional methods on this instance, please create a reference.",this.WARNING_INSERT_NO_ELEMENTS="[MixItUp] WARNING: No valid elements were passed to `.insert()`",this.WARNING_REMOVE_NO_ELEMENTS="[MixItUp] WARNING: No valid elements were passed to `.remove()`",this.WARNING_MULTIMIX_INSTANCE_QUEUE_FULL="[MixItUp] WARNING: An operation was requested but the MixItUp instance was busy. The operation was rejected because the queue is full or queuing is disabled.",this.WARNING_GET_OPERATION_INSTANCE_BUSY="[MixItUp] WARNING: Operations can be be created while the MixItUp instance is busy.",this.WARNING_NO_PROMISE_IMPLEMENTATION="[MixItUp] WARNING: No Promise implementations could be found. If you wish to use promises with MixItUp please install an ES6 Promise polyfill.",this.WARNING_INCONSISTENT_SORTING_ATTRIBUTES='[MixItUp] WARNING: The requested sorting data attribute "${attribute}" was not present on one or more target elements which may product unexpected sort output',this.callActions("afterConstruct"),this.compileTemplates(),n.seal(this)},e.BaseStatic.call(e.Messages),e.Messages.prototype=Object.create(e.Base.prototype),e.Messages.prototype.constructor=e.Messages,e.Messages.prototype.compileTemplates=function(){var t="",e="";
7043for(t in this)"string"==typeof(e=this[t])&&(this[n.camelCase(t)]=n.template(e))},e.messages=new e.Messages,e.Facade=function(t){e.Base.call(this),this.callActions("beforeConstruct",arguments),this.configure=t.configure.bind(t),this.show=t.show.bind(t),this.hide=t.hide.bind(t),this.filter=t.filter.bind(t),this.toggleOn=t.toggleOn.bind(t),this.toggleOff=t.toggleOff.bind(t),this.sort=t.sort.bind(t),this.changeLayout=t.changeLayout.bind(t),this.multimix=t.multimix.bind(t),this.dataset=t.dataset.bind(t),this.tween=t.tween.bind(t),this.insert=t.insert.bind(t),this.insertBefore=t.insertBefore.bind(t),this.insertAfter=t.insertAfter.bind(t),this.prepend=t.prepend.bind(t),this.append=t.append.bind(t),this.remove=t.remove.bind(t),this.destroy=t.destroy.bind(t),this.forceRefresh=t.forceRefresh.bind(t),this.forceRender=t.forceRender.bind(t),this.isMixing=t.isMixing.bind(t),this.getOperation=t.getOperation.bind(t),this.getConfig=t.getConfig.bind(t),this.getState=t.getState.bind(t),this.callActions("afterConstruct",arguments),n.freeze(this),n.seal(this)},e.BaseStatic.call(e.Facade),e.Facade.prototype=Object.create(e.Base.prototype),e.Facade.prototype.constructor=e.Facade,"object"==typeof exports&&"object"==typeof module?module.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):"undefined"!=typeof t.mixitup&&"function"==typeof t.mixitup||(t.mixitup=e),e.BaseStatic.call(e.constructor),e.NAME="mixitup",e.CORE_VERSION="3.2.2"}(window); 7044// source --> https://nieruchomoscipafos.pl/wp-content/plugins/essential-addons-for-elementor-lite/assets/js/jquery.magnific-popup.min.js?ver=1.0 7045/*! Magnific Popup - v1.1.0 - 2016-02-20 7046* http://dimsemenov.com/plugins/magnific-popup/ 7047* Copyright (c) 2016 Dmitry Semenov; */ 7048!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.
7048st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;
7048if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;
7048var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});
7048var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()}); 7049// source --> https://nieruchomoscipafos.pl/wp-content/plugins/essential-addons-for-elementor-lite/assets/js/tooltipster.bundle.min.js?ver=1.0 7050/*! tooltipster v4.2.6 */!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){function b(a){this.$container,this.constraints=null,this.__$tooltip,this.__init(a)}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c=b.attr("id"),d=c?h.window.document.getElementById(c):null;return d?d===b[0]:a.contains(h.window.document.body,b[0])}function e(){if(!g)return!1;var a=g.document.body||g.document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}var f={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},g="undefined"!=typeof window?window:null,h={hasTouchCapability:!(!g||!("ontouchstart"in g||g.DocumentTouch&&g.document instanceof g.DocumentTouch||g.navigator.maxTouchPoints)),hasTransitions:e(),IE:!1,semVer:"4.2.6
vendor: 28,893 bytes, line 7050
7050",window:g},i=function(){this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__instancesLatestArr=[],this.__plugins={},this._env=h};i.prototype={__bridge:function(b,c,d){if(!c[d]){var e=function(){};e.prototype=b;var g=new e;g.__init&&g.__init(c),a.each(b,function(a,b){0!=a.indexOf("__")&&(c[a]?f.debug&&console.log("The "+a+" method of the "+d+" plugin conflicts with another plugin or native methods"):(c[a]=function(){return g[a].apply(g,Array.prototype.slice.apply(arguments))},c[a].bridged=g))}),c[d]=g}return this},__setWindow:function(a){return h.window=a,this},_getRuler:function(a){return new b(a)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(b){var c=this;if("string"==typeof b){var d=b,e=null;return d.indexOf(".")>0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a(h.window.document.body).on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;B<m.length;B++){var C=m[B];"even"==A?(C>y&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=a(h.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=a(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.close(function(){b.destroy()})},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else if(d(c._$origin)&&d(c._$tooltip)){var e=null;if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{e=c.__geometry();var f=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var d=a(c),g=d.css("overflow-x"),h=d.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(e.origin.windowOffset.left<i.left||e.origin.windowOffset.right>i.right))return f=!0,!1;if("visible"!=h&&(e.origin.windowOffset.top<i.top||e.origin.windowOffset.bottom>i.bottom))return f=!0,!1}return"fixed"==d.css("position")?!1:void 0}),f)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var g=e.origin.offset.left-c.__Geometry.origin.offset.left,i=e.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+g,top:c.__lastPosition.coord.top+i})}}c._trigger({type:"scroll",event:b,geo:e})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c,d){var e=this,f=!0;if(e._trigger({type:"close",event:b,stop:function(){f=!1}}),f||d){c&&e.__callbacks.close.push(c),e.__callbacks.open=[],e.__timeoutsClear();var g=function(){a.each(e.__callbacks.close,function(a,c){c.call(e,e,{event:b,origin:e._$origin[0]})}),e.__callbacks.close=[]};if("closed"!=e.__state){var i=!0,j=new Date,k=j.getTime(),l=k+e.__options.animationDuration[1];if("disappearing"==e.__state&&l>e.__closingTime&&e.__options.animationDuration[1]>0&&(i=!1),i){e.__closingTime=l,"disappearing"!=e.__state&&e.__stateSet("disappearing");var m=function(){clearInterval(e.__tracker),e._trigger({type:"closing",event:b}),e._$tooltip.off("."+e.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+e.__namespace+"-triggerClose"),e.__$originParents.each(function(b,c){a(c).off("scroll."+e.__namespace+"-triggerClose")}),e.__$originParents=null,a(h.window.document.body).off("."+e.__namespace+"-triggerClose"),e._$origin.off("."+e.__namespace+"-triggerClose"),e._off("dismissable"),e.__stateSet("closed"),e._trigger({type:"after",event:b}),e.__options.functionAfter&&e.__options.functionAfter.call(e,e,{event:b,origin:e._$origin[0]}),g()};h.hasTransitions?(e._$tooltip.css({"-moz-animation-duration":e.__options.animationDuration[1]+"ms","-ms-animation-duration":e.__options.animationDuration[1]+"ms","-o-animation-duration":e.__options.animationDuration[1]+"ms","-webkit-animation-duration":e.__options.animationDuration[1]+"ms","animation-duration":e.__options.animationDuration[1]+"ms","transition-duration":e.__options.animationDuration[1]+"ms"}),e._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),e.__options.animationDuration[1]>0&&e._$tooltip.delay(e.__options.animationDuration[1]),e._$tooltip.queue(m)):e._$tooltip.stop().fadeOut(e.__options.animationDuration[1],m)}}else g()}return e},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(b){var c=a(document.activeElement);(c.is("input")||c.is("textarea"))&&a.contains(e._$tooltip[0],c[0])||e.reposition(b)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="",c=a(h.window.document.body);e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),c.on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&c.on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;if(b.__destroyed)b.__destroyError();else{"closed"!=b.__state?b.option("animationDuration",0)._close(null,null,!0):b.__timeoutsClear(),b._trigger("destroy"),b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a(h.window.document.body).off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("<div></div>").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)}return b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.__destroyed?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(h.window.document.body)},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]))
vendor: 9,700 bytes, lines 7050-7053
7050;var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"), 7051this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),b.__options.position&&(b.__options.side=b.__options.position),"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1]),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]}),"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d<e.__options.side.length;d++){var m={horizontal:0,vertical:0},n=e.__options.side[d];"top"==n||"bottom"==n?m.vertical=e.__options.distance[n]:m.horizontal=e.__options.distance[n],e.__sideChange(h,n),a.each(["natural","constrained"],function(a,d){if(l=null,e.__instance._trigger({container:k,event:b,helper:c,mode:d,results:g,satisfied:j,side:n,takeTest:function(a){l=a},type:"positionTest"}),1==l||0!=l&&0==j){var h={container:k,distance:m,fits:null,mode:d,outerSize:null,side:n,size:null,target:f[n],whole:null},o="natural"==d?i.free():i.constrain(c.geo.available[k][n].width-m.horizontal,c.geo.available[k][n].height-m.vertical),p=o.measure();if(h.size=p.size,h.outerSize={height:p.size.height+m.vertical,width:p.size.width+m.horizontal},"natural"==d?c.geo.available[k][n].width>=h.outerSize.width&&c.geo.available[k][n].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.val<this.__options.minIntersection?n.val=this.__options.minIntersection:n.val>o&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a}); 7052// source --> https://nieruchomoscipafos.pl/wp-content/plugins/essential-addons-for-elementor-lite/assets/js/loading-bar.min.js?ver=1.0 7053!function t(e,i,r){function a(n,s){if(!i[n]){if(!e[n]){var h="function"==typeof require&&require;if(!s&&h)return h(n,!0);if(l)return l(n,!0);var d=new Error("Cannot find module '"+n+"'");throw d.code="MODULE_NOT_FOUND",d}
7053var o=i[n]={exports:{}};e[n][0].call(o.exports,function(t){var i=e[n][1][t];return a(i||t)},o,o.exports,t,e,i,r)}return i[n].exports}for(var l="function"==typeof require&&require,n=0;n<r.length;n++)a(r[n]);return a}({1:[function(t,e,i){function r(t,e){var i={}.hasOwnProperty;for(var r in e)i.call(e,r)&&(t[r]=e[r]);return t}var a,l,n=[].slice,s={}.toString;a=t("presets").presets,l=function(t){return"data:image/svg+xml;base64,"+btoa(t)},function(){var t,e,i;t={head:function(t){return'<?xml version="1.0" encoding="utf-8"?>\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="'+t+'">'},gradient:function(t,e){var i,r,a,s,h,d,o,u,f,c;for(null==t&&(t=45),null==e&&(e=1),i=n.call(arguments,2),r=[this.head("0 0 100 100")],a=4*i.length+1,t=t*Math.PI/180,s=Math.pow(Math.cos(t),2),h=Math.sqrt(s-Math.pow(s,2)),t>.25*Math.PI&&(h=Math.pow(Math.sin(t),2),s=Math.sqrt(h-Math.pow(h,2))),d=100*s,o=100*h,r.push('<defs><linearGradient id="gradient" x1="0" x2="'+s+'" y1="0" y2="'+h+'">'),u=0;u<a;++u)c=100*(f=u)/(a-1),r.push('<stop offset="'+c+'%" stop-color="'+i[f%i.length]+'"/>');return r.push('</linearGradient></defs>\n<rect x="0" y="0" width="400" height="400" fill="url(#gradient)">\n<animateTransform attributeName="transform" type="translate" from="-'+d+",-"+o+'"\nto="0,0" dur="'+e+'s" repeatCount="indefinite"/></rect></svg>'),l(r.join(""))},stripe:function(t,e,i){var r,a;return null==t&&(t="#b4b4b4"),null==e&&(e="#e6e6e6"),null==i&&(i=1),r=[this.head("0 0 100 100")],r=r.concat(['<rect fill="'+e+'" width="100" height="100"/>',"<g><g>",function(){var e,i=[];for(e=0;e<13;++e)a=e,i.push('<polygon fill="'+t+'" points="'+(20*a-90)+",100 "+(20*a-100)+",100 "+(20*a-60)+",0 "+(20*a-50)+',0 "/>');return i}().join(""),'</g><animateTransform attributeName="transform" type="translate" ','from="0,0" to="20,0" dur="'+i+'s" repeatCount="indefinite"/></g></svg>'].join("")),l(r)},bubble:function(t,e,i,r,a,n){var s,h,d,o,u,f;for(null==t&&(t="#39d"),null==e&&(e="#9cf"),null==i&&(i=15),null==r&&(r=1),null==a&&(a=6),null==n&&(n=1),s=[this.head("0 0 200 200"),'<rect x="0" y="0" width="200" height="200" fill="'+t+'"/>'],h=0;h<i;++h)d=-h/i*r,o=184*Math.random()+8,u=(.7*Math.random()+.3)*a,f=r*(1+.5*Math.random()),s.push(['<circle cx="'+o+'" cy="0" r="'+u+'" fill="none" stroke="'+e+'" stroke-width="'+n+'">','<animate attributeName="cy" values="190;-10" times="0;1" ','dur="'+f+'s" begin="'+d+'s" repeatCount="indefinite"/>',"</circle>",'<circle cx="'+o+'" cy="0" r="'+u+'" fill="none" stroke="'+e+'" stroke-width="'+n+'">','<animate attributeName="cy" values="390;190" times="0;1" ','dur="'+f+'s" begin="'+d+'s" repeatCount="indefinite"/>',"</circle>"].join(""));return l(s.join("")+"</svg>")}},e={queue:{},running:!1,main:function(t){var e,i,r,a,l,n,s=this;e=!1,i=[];for(r in a=this.queue)(n=(l=a[r])(t))||i.push(l),e=e||n;for(r in a=this.queue)l=a[r],i.indexOf(l)>=0&&delete this.queue[r];return e?requestAnimationFrame(function(t){return s.main(t)}):this.running=!1},add:function(t,e){var i=this;if(this.queue[t]||(this.queue[t]=e),!this.running)return this.running=!0,requestAnimationFrame(function(t){return i.main(t)})}},window.ldBar=i=function(i,l){var n,h,d,o,u,f,c,g,p,w,m,k,b,x,v,y,M,q,A,B,C,S,_,L,N=this;if(null==l&&(l={}),n={xlink:"http://www.w3.org/1999/xlink"},(h="String"===s.call(i).slice(8,-1)?document.querySelector(i):i).ldBar)return h.ldBar;h.ldBar=this,~(d=h.getAttribute("class")||"").indexOf("ldBar")||h.setAttribute("class",d+" ldBar"),o="ldBar-"+Math.random().toString(16).substring(2),u={key:o,clip:o+"-clip",filter:o+"-filter",pattern:o+"-pattern",mask:o+"-mask",maskPath:o+"-mask-path"},f=function(t,e){var i,r;t=c(t);for(i in e)r=e[i],"attr"!==i&&t.appendChild(f(i,r||{}));return t.attrs(e.attr||{}),t},c=function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},(g=document.body.__proto__.__proto__.__proto__).text=function(t){return this.appendChild(document.createTextNode(t))},g.attrs=function(t){var e,i,r,a=[];for(e in t)i=t[e],(r=/([^:]+):([^:]+)/.exec(e))&&n[r[1]]?a.push(this.setAttributeNS(n[r[1]],e,i)):a.push(this.setAttribute(e,i));return a},g.styles=function(t){var e,i,r=[];for(e in t)i=t[e],r.push(this.style[e]=i);return r},g.append=function(t){return this.appendChild(document.createElementNS("http://www.w3.og/2000/svg",t))},g.attr=function(t,e){return null!=e?this.setAttribute(t,e):this.getAttribute(t)},(p={type:"stroke",img:"",path:"M10 10L90 10","fill-dir":"btt",fill:"#25b","fill-background":"#ddd","fill-background-extrude":3,"pattern-size":null,"stroke-dir":"normal",stroke:"#25b","stroke-width":"3","stroke-trail":"#ddd","stroke-trail-width":.5,duration:1,easing:"linear",value:0,"img-size":null,bbox:null,"
7053set-dim":!0,"aspect-ratio":"xMidYMid"}).preset=h.attr("data-preset")||l.preset,null!=p.preset&&r(p,a[p.preset]);for(w in p)(m=m=h.attr("data-"+w))&&(p[w]=m);return r(p,l),p.img&&(p.path=null),k="stroke"===p.type,b=function(e){var i,r;return i=/data:ldbar\/res,([^()]+)\(([^)]+)\)/,(r=i.exec(e))?r=t[r[1]].apply(t,r[2].split(",")):e},p.fill=b(p.fill),p.stroke=b(p.stroke),"false"===p["set-dim"]&&(p["set-dim"]=!1),x={attr:{"xmlns:xlink":"http://www.w3.org/1999/xlink",preserveAspectRatio:p["aspect-ratio"],width:"100%",height:"100%"},defs:{filter:{attr:{id:u.filter,x:-1,y:-1,width:3,height:3},feMorphology:{attr:{operator:+p["fill-background-extrude"]>=0?"dilate":"erode",radius:Math.abs(+p["fill-background-extrude"])}},feColorMatrix:{attr:{values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0",result:"cm"}}},mask:{attr:{id:u.mask},image:{attr:{"xlink:href":p.img,filter:"url(#"+u.filter+")",x:0,y:0,width:100,height:100,preserveAspectRatio:p["aspect-ratio"]}}},g:{mask:{attr:{id:u.maskPath},path:{attr:{d:p.path||"",fill:"#fff",stroke:"#fff",filter:"url(#"+u.filter+")"}}}},clipPath:{attr:{id:u.clip},rect:{attr:{class:"mask",fill:"#000"}}},pattern:{attr:{id:u.pattern,patternUnits:"userSpaceOnUse",x:0,y:0,width:300,height:300},image:{attr:{x:0,y:0,width:300,height:300}}}}},v=f("svg",x),(y=document.createElement("div")).setAttribute("class","ldBar-label"),h.appendChild(v),h.appendChild(y),M=[0,0],q=0,this.fit=function(){var t,e,i,r;if((t=p.bbox)?(e=t.split(" ").map(function(t){return+t.trim()}),e={x:e[0],y:e[1],width:e[2],height:e[3]}):e=M[1].getBBox(),e&&0!==e.width&&0!==e.height||(e={x:0,y:0,width:100,height:100}),i=1.5*Math.max.apply(null,["stroke-width","stroke-trail-width","fill-background-extrude"].map(function(t){return p[t]})),v.attrs({viewBox:[e.x-i,e.y-i,e.width+2*i,e.height+2*i].join(" ")}),p["set-dim"]&&["width","height"].map(function(t){if(!h.style[t]||N.fit[t])return h.style[t]=e[t]+2*i+"px",N.fit[t]=!0}),r=M[0].querySelector("rect"))return r.attrs({x:e.x-i,y:e.y-i,width:e.width+2*i,height:e.height+2*i})},p.path?(M[0]=k?f("g",{path:{attr:{d:p.path,fill:"none",class:"baseline"}}}):f("g",{rect:{attr:{x:0,y:0,width:100,height:100,mask:"url(#"+u.maskPath+")",fill:p["fill-background"],class:"frame"}}}),v.appendChild(M[0]),M[1]=f("g",{path:{attr:{d:p.path,class:k?"mainline":"solid","clip-path":"fill"===p.type?"url(#"+u.clip+")":""}}}),v.appendChild(M[1]),A=M[0].querySelector(k?"path":"rect"),B=M[1].querySelector("path"),k&&B.attrs({fill:"none"}),C=v.querySelector("pattern image"),(S=new Image).addEventListener("load",function(){var t,e;return t=(e=p["pattern-size"])?{width:+e,height:+e}:S.width&&S.height?{width:S.width,height:S.height}:{width:300,height:300},v.querySelector("pattern").attrs({width:t.width,height:t.height}),C.attrs({width:t.width,height:t.height})}),/.+\..+|^data:/.exec(k?p.stroke:p.fill)&&(S.src=k?p.stroke:p.fill,C.attrs({"xlink:href":S.src})),k&&(A.attrs({stroke:p["stroke-trail"],"stroke-width":p["stroke-trail-width"]}),B.attrs({"stroke-width":p["stroke-width"],stroke:/.+\..+|^data:/.exec(p.stroke)?"url(#"+u.pattern+")":p.stroke})),p.fill&&!k&&B.attrs({fill:/.+\..+|^data:/.exec(p.fill)?"url(#"+u.pattern+")":p.fill}),q=B.getTotalLength(),this.fit(),this.inited=!0):p.img&&(L=p["img-size"]?{width:+(_=p["img-size"].split(","))[0],height:+_[1]}:{width:100,height:100},M[0]=f("g",{rect:{attr:{x:0,y:0,width:100,height:100,mask:"url(#"+u.mask+")",fill:p["fill-background"]}}}),v.querySelector("mask image").attrs({width:L.width,height:L.height}),M[1]=f("g",{image:{attr:{width:L.width,height:L.height,x:0,y:0,preserveAspectRatio:p["aspect-ratio"],"clip-path":"fill"===p.type?"url(#"+u.clip+")":"","xlink:href":p.img,class:"solid"}}}),(S=new Image).addEventListener("load",function(){var t,e;return e=p["img-size"]?{width:+(t=p["img-size"].split(","))[0],height:+t[1]}:S.width&&S.height?{width:S.width,height:S.height}:{width:100,height:100},v.querySelector("mask image").attrs({width:e.width,height:e.height}),M[1].querySelector("image").attrs({width:e.width,height:e.height}),N.fit(),N.set(void 0,!1),N.inited=!0}),S.src=p.img,v.appendChild(M[0]),v.appendChild(M[1])),v.attrs({width:"100%",height:"100%"}),this.transition={value:{src:0,des:0},time:{}
7053,ease:function(t,e,i,r){return(t/=.5*r)<1?.5*i*t*t+e:(t-=1,.5*-i*(t*(t-2)-1)+e)},handler:function(t,e){var i,r,a,l,n,s,h,d,o;return null==e&&(e=!0),null==this.time.src&&(this.time.src=t),i=[this.value.des-this.value.src,.001*(t-this.time.src),+p.duration||1],r=i[0],a=i[1],l=i[2],y.textContent=n=e?Math.round(this.ease(a,this.value.src,r,l)):this.value.des,k?(s=B,h={"stroke-dasharray":"reverse"===p["stroke-dir"]?"0 "+q*(100-n)*.01+" "+q*n*.01+" 0":.01*n*q+" "+(.01*(100-n)*q+1)}):(d=M[1].getBBox(),h="btt"!==(o=p["fill-dir"])&&o?"ttb"===o?{y:d.y,height:d.height*n*.01,x:d.x,width:d.width}:"ltr"===o?{y:d.y,height:d.height,x:d.x,width:d.width*n*.01}:"rtl"===o?{y:d.y,height:d.height,x:d.x+d.width*(100-n)*.01,width:d.width*n*.01}:void 0:{y:d.y+d.height*(100-n)*.01,height:d.height*n*.01,x:d.x,width:d.width},s=v.querySelector("rect")),s.attrs(h),!(a>=l)||(delete this.time.src,!1)},start:function(t,i,r){var a,l=this;return a=this.value,a.src=t,a.des=i,h.offsetWidth||h.offsetHeight||h.getClientRects().length,r&&(h.offsetWidth||h.offsetHeight||h.getClientRects().length)?e.add(u.key,function(t){return l.handler(t)}):(this.time.src=0,void this.handler(1e3,!1))}},this.set=function(t,e){var i,r;return null==e&&(e=!0),i=this.value||0,null!=t?this.value=t:t=this.value,r=this.value,this.transition.start(i,r,e)},this.set(+p.value||0,!1),this},window.addEventListener("load",function(){var t,e,r,a,l=[];for(t=0,r=(e=document.querySelectorAll(".ldBar")).length;t<r;++t)(a=e[t]).ldBar||l.push(a.ldBar=new i(a));return l},!1)}()},{presets:2}],2:[function(t,e,i){(void 0!==i&&i||this).presets={rainbow:{type:"stroke",path:"M10 10L90 10",stroke:"data:ldbar/res,gradient(0,1,#a551df,#fd51ad,#ff7f82,#ffb874,#ffeb90)",bbox:"10 10 8
70530 10"},energy:{type:"fill",path:"M15 5L85 5A5 5 0 0 1 85 15L15 15A5 5 0 0 1 15 5",stroke:"#f00",fill:"data:ldbar/res,gradient(45,2,#4e9,#8fb,#4e9)","fill-dir":"ltr","fill-background":"#444","fill-background-extrude":1,bbox:"10 5 80 10"},stripe:{type:"fill",path:"M15 5L85 5A5 5 0 0 1 85 15L15 15A5 5 0 0 1 15 5",stroke:"#f00",fill:"data:ldbar/res,stripe(#25b,#58e,1)","fill-dir":"ltr","fill-background":"#ddd","fill-background-extrude":1,bbox:"10 5 80 10"},text:{type:"fill",img:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="70" height="20" viewBox="0 0 70 20"><text x="35" y="10" text-anchor="middle" dominant-baseline="central" font-family="arial">LOADING</text></svg>',"fill-background-extrude":1.3,"pattern-size":100,"fill-dir":"ltr","img-size":"70,20",bbox:"0 0 70 20"},line:{type:"stroke",path:"M10 10L90 10",stroke:"#25b","stroke-width":3,"stroke-trail":"#ddd","stroke-trail-width":1,bbox:"10 10 80 10"},fan:{type:"stroke",path:"M10 90A40 40 0 0 1 90 90","fill-dir":"btt",fill:"#25b","fill-background":"#ddd","fill-background-extrude":3,"stroke-dir":"normal",stroke:"#25b","stroke-width":"3","stroke-trail":"#ddd","stroke-trail-width":.5,bbox:"10 50 80 40"},circle:{type:"stroke",path:"M50 10A40 40 0 0 1 50 90A40 40 0 0 1 50 10","fill-dir":"btt",fill:"#25b","fill-background":"#ddd","fill-background-extrude":3,"stroke-dir":"normal",stroke:"#25b","stroke-width":"3","stroke-trail":"#ddd","stroke-trail-width":.5,bbox:"10 10 8
vendor: 12,793 bytes, lines 7053-7469
70530 80"},bubble:{type:"fill",path:"M50 10A40 40 0 0 1 50 90A40 40 0 0 1 50 10","fill-dir":"btt",fill:"data:ldbar/res,bubble(#39d,#cef)","pattern-size":"150","fill-background":"#ddd","fill-background-extrude":2,"stroke-dir":"normal",stroke:"#25b","stroke-width":"3","stroke-trail":"#ddd","stroke-trail-width":.5,bbox:"10 10 80 80"}}},{}]},{},[1]); 7054// source --> https://nieruchomoscipafos.pl/wp-content/plugins/modal-for-elementor/js/bootstrap.js 7055/*! 7056 * Bootstrap v3.3.6 (http://getbootstrap.com) 7057 * Copyright 2011-2015 Twitter, Inc. 7058 * Licensed under the MIT license 7059 */ 7060// Code extracted from Bootstrap and refactored for our needs 7061 7062+function ($) { 7063 'use strict'; 7064 7065 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 7066 // ============================================================ 7067 7068 function transitionEnd() { 7069 var el = document.createElement('bootstrap') 7070 7071 var transEndEventNames = { 7072 WebkitTransition : 'webkitTransitionEnd', 7073 MozTransition : 'transitionend', 7074 OTransition : 'oTransitionEnd otransitionend', 7075 transition : 'transitionend' 7076 } 7077 7078 for (var name in transEndEventNames) { 7079 if (el.style[name] !== undefined) { 7080 return { end: transEndEventNames[name] } 7081 } 7082 } 7083 7084 return false // explicit for ie8 ( ._.) 7085 } 7086 7087 // http://blog.alexmaccaw.com/css-transitions 7088 $.fn.emulateTransitionEnd = function (duration) { 7089 var called = false 7090 var $el = this 7091 $(this).one('bsTransitionEnd', function () { called = true }) 7092 var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 7093 setTimeout(callback, duration) 7094 return this 7095 } 7096 7097 $(function () { 7098 $.support.transition = transitionEnd() 7099 7100 if (!$.support.transition) return 7101 7102 $.event.special.bsTransitionEnd = { 7103 bindType: $.support.transition.end, 7104 delegateType: $.support.transition.end, 7105 handle: function (e) { 7106 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) 7107 } 7108 } 7109 }) 7110 7111}(jQuery); 7112 7113 7114+function ($) { 7115 'use strict'; 7116 7117 // MODAL CLASS DEFINITION 7118 // ====================== 7119 7120 var Modal = function (element, options) { 7121 this.options = options 7122 this.$body = $(document.body) 7123 this.$element = $(element) 7124 this.$dialog = this.$element.find('.modal-dialog') 7125 this.$backdrop = null 7126 this.isShown = null 7127 this.originalBodyPad = null 7128 this.scrollbarWidth = 0 7129 this.ignoreBackdropClick = false 7130 7131 if (this.options.remote) { 7132 this.$element 7133 .find('.modal-content') 7134 .load(this.options.remote, $.proxy(function () { 7135 this.$element.trigger('loaded.bs.modal') 7136 }, this)) 7137 } 7138 } 7139 7140 Modal.VERSION = '3.3.6' 7141 7142 Modal.TRANSITION_DURATION = 300 7143 Modal.BACKDROP_TRANSITION_DURATION = 150 7144 7145 Modal.DEFAULTS = { 7146 backdrop: true, 7147 keyboard: true, 7148 show: true 7149 } 7150 7151 Modal.prototype.toggle = function (_relatedTarget) { 7152 return this.isShown ? this.hide() : this.show(_relatedTarget) 7153 } 7154 7155 Modal.prototype.show = function (_relatedTarget) { 7156 var that = this 7157 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) 7158 7159 this.$element.trigger(e) 7160 7161 if (this.isShown || e.isDefaultPrevented()) return 7162 7163 this.isShown = true 7164 7165 this.checkScrollbar() 7166 this.setScrollbar() 7167 this.$body.addClass('modal-open') 7168 7169 this.escape() 7170 this.resize() 7171 7172 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) 7173 7174 this.$dialog.on('mousedown.dismiss.bs.modal', function () { 7175 that.$element.one('mouseup.dismiss.bs.modal', function (e) { 7176 if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true 7177 }) 7178 }) 7179 7180 this.backdrop(function () { 7181 var transition = $.support.transition && that.$element.hasClass('fade') 7182 7183 if (!that.$element.parent().length) { 7184 that.$element.appendTo(that.$body) // don't move modals dom position 7185 } 7186 7187 that.$element 7188 .show() 7189 .scrollTop(0) 7190 7191 that.adjustDialog() 7192 7193 if (transition) { 7194 that.$element[0].offsetWidth // force reflow 7195 } 7196 7197 that.$element.addClass('in') 7198 7199 that.enforceFocus() 7200 7201 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) 7202 7203 transition ? 7204 that.$dialog // wait for modal to slide in 7205 .one('bsTransitionEnd', function () { 7206 that.$element.trigger('focus').trigger(e) 7207 }) 7208 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 7209 that.$element.trigger('focus').trigger(e) 7210 }) 7211 } 7212 7213 Modal.prototype.hide = function (e) { 7214 if (e) e.preventDefault() 7215 7216 e = $.Event('hide.bs.modal') 7217 7218 this.$element.trigger(e) 7219 7220 if (!this.isShown || e.isDefaultPrevented()) return 7221 7222 this.isShown = false 7223 7224 this.escape() 7225 this.resize() 7226 7227 $(document).off('focusin.bs.modal') 7228 7229 this.$element 7230 .removeClass('in') 7231 .off('click.dismiss.bs.modal') 7232 .off('mouseup.dismiss.bs.modal') 7233 7234 this.$dialog.off('mousedown.dismiss.bs.modal') 7235 7236 $.support.transition && this.$element.hasClass('fade') ? 7237 this.$element 7238 .one('bsTransitionEnd', $.proxy(this.hideModal, this)) 7239 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 7240 this.hideModal() 7241 } 7242 7243 Modal.prototype.enforceFocus = function () { 7244 $(document) 7245 .off('focusin.bs.modal') // guard against infinite focus loop 7246 .on('focusin.bs.modal', $.proxy(function (e) { 7247 if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { 7248 this.$element.trigger('focus') 7249 } 7250 }, this)) 7251 } 7252 7253 Modal.prototype.escape = function () { 7254 if (this.isShown && this.options.keyboard) { 7255 this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { 7256 e.which == 27 && this.hide() 7257 }, this)) 7258 } else if (!this.isShown) { 7259 this.$element.off('keydown.dismiss.bs.modal') 7260 } 7261 } 7262 7263 Modal.prototype.resize = function () { 7264 if (this.isShown) { 7265 $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) 7266 } else { 7267 $(window).off('resize.bs.modal') 7268 } 7269 } 7270 7271 Modal.prototype.hideModal = function () { 7272 var that = this 7273 this.$element.hide() 7274 this.backdrop(function () { 7275 that.$body.removeClass('modal-open') 7276 that.resetAdjustments() 7277 that.resetScrollbar() 7278 that.$element.trigger('hidden.bs.modal') 7279 }) 7280 } 7281 7282 Modal.prototype.removeBackdrop = function () { 7283 this.$backdrop && this.$backdrop.remove() 7284 this.$backdrop = null 7285 } 7286 7287 Modal.prototype.backdrop = function (callback) { 7288 var that = this 7289 var animate = this.$element.hasClass('fade') ? 'fade' : '' 7290 7291 if (this.isShown && this.options.backdrop) { 7292 var doAnimate = $.support.transition && animate 7293 7294 this.$backdrop = $(document.createElement('div')) 7295 .addClass('modal-backdrop ' + animate) 7296 .appendTo(this.$body) 7297 7298 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { 7299 if (this.ignoreBackdropClick) { 7300 this.ignoreBackdropClick = false 7301 return 7302 } 7303 if (e.target !== e.currentTarget) return 7304 this.options.backdrop == 'static' 7305 ? this.$element[0].focus() 7306 : this.hide() 7307 }, this)) 7308 7309 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow 7310 7311 this.$backdrop.addClass('in') 7312 7313 if (!callback) return 7314 7315 doAnimate ? 7316 this.$backdrop 7317 .one('bsTransitionEnd', callback) 7318 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 7319 callback() 7320 7321 } else if (!this.isShown && this.$backdrop) { 7322 this.$backdrop.removeClass('in') 7323 7324 var callbackRemove = function () { 7325 that.removeBackdrop() 7326 callback && callback() 7327 } 7328 $.support.transition && this.$element.hasClass('fade') ? 7329 this.$backdrop 7330 .one('bsTransitionEnd', callbackRemove) 7331 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 7332 callbackRemove() 7333 7334 } else if (callback) { 7335 callback() 7336 } 7337 } 7338 7339 // these following methods are used to handle overflowing modals 7340 7341 Modal.prototype.handleUpdate = function () { 7342 this.adjustDialog() 7343 } 7344 7345 Modal.prototype.adjustDialog = function () { 7346 var lmmodalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight 7347 7348 this.$element.css({ 7349 paddingLeft: !this.bodyIsOverflowing && lmmodalIsOverflowing ? this.scrollbarWidth : '', 7350 paddingRight: this.bodyIsOverflowing && !lmmodalIsOverflowing ? this.scrollbarWidth : '' 7351 }) 7352 } 7353 7354 Modal.prototype.resetAdjustments = function () { 7355 this.$element.css({ 7356 paddingLeft: '', 7357 paddingRight: '' 7358 }) 7359 } 7360 7361 Modal.prototype.checkScrollbar = function () { 7362 var fullWindowWidth = window.innerWidth 7363 if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 7364 var documentElementRect = document.documentElement.getBoundingClientRect() 7365 fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) 7366 } 7367 this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth 7368 this.scrollbarWidth = this.measureScrollbar() 7369 } 7370 7371 Modal.prototype.setScrollbar = function () { 7372 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) 7373 this.originalBodyPad = document.body.style.paddingRight || '' 7374 if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) 7375 } 7376 7377 Modal.prototype.resetScrollbar = function () { 7378 this.$body.css('padding-right', this.originalBodyPad) 7379 } 7380 7381 Modal.prototype.measureScrollbar = function () { // thx walsh 7382 var scrollDiv = document.createElement('div') 7383 scrollDiv.className = 'modal-scrollbar-measure' 7384 this.$body.append(scrollDiv) 7385 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth 7386 this.$body[0].removeChild(scrollDiv) 7387 return scrollbarWidth 7388 } 7389 7390 7391 // MODAL PLUGIN DEFINITION 7392 // ======================= 7393 7394 function Plugin(option, _relatedTarget) { 7395 return this.each(function () { 7396 var $this = $(this) 7397 var data = $this.data('bs.modal') 7398 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) 7399 7400 if (!data) $this.data('bs.modal', (data = new Modal(this, options))) 7401 if (typeof option == 'string') data[option](_relatedTarget) 7402 else if (options.show) data.show(_relatedTarget) 7403 }) 7404 } 7405 7406 var old = $.fn.modal 7407 7408 $.fn.modal = Plugin 7409 $.fn.modal.Constructor = Modal 7410 7411 7412 // MODAL NO CONFLICT 7413 // ================= 7414 7415 $.fn.modal.noConflict = function () { 7416 $.fn.modal = old 7417 return this 7418 } 7419 7420 7421 // MODAL DATA-API 7422 // ============== 7423 7424 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { 7425 var $this = $(this) 7426 var href = $this.attr('href') 7427 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7 7428 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) 7429 7430 if ($this.is('a')) e.preventDefault() 7431 7432 $target.one('show.bs.modal', function (showEvent) { 7433 if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown 7434 $target.one('hidden.bs.modal', function () { 7435 $this.is(':visible') && $this.trigger('focus') 7436 }) 7437 }) 7438 Plugin.call($target, option, this) 7439 }) 7440 7441}(jQuery); 7442// source --> https://nieruchomoscipafos.pl/wp-content/plugins/modal-for-elementor/js/popup.js 7443var isMobile = { 7444 Android: function() { 7445 return navigator.userAgent.match(/Android/i); 7446 }, 7447 BlackBerry: function() { 7448 return navigator.userAgent.match(/BlackBerry/i); 7449 }, 7450 iOS: function() { 7451 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 7452 }, 7453 Opera: function() { 7454 return navigator.userAgent.match(/Opera Mini/i); 7455 }, 7456 Windows: function() { 7457 return navigator.userAgent.match(/IEMobile/i); 7458 }, 7459 any: function() { 7460 return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 7461 } 7462}; 7463jQuery(document).ready(function($){ 7464 $('.modal-popup').click(function(){ 7465 var popup_id = $(this).attr('data-target'); 7466 $(popup_id).modal('show'); 7467 $('.modal-backdrop').hide(); 7468 }); 7469});
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.