1/* 2 * ADOBE CONFIDENTIAL 3 * 4 * Copyright 2012 Adobe Systems Incorporated 5 * All Rights Reserved. 6 * 7 * NOTICE: All information contained herein is, and remains 8 * the property of Adobe Systems Incorporated and its suppliers, 9 * if any. The intellectual and technical concepts contained 10 * herein are proprietary to Adobe Systems Incorporated and its 11 * suppliers and may be covered by U.S. and Foreign Patents, 12 * patents in process, and are protected by trade secret or copyright law. 13 * Dissemination of this information or reproduction of this material 14 * is strictly forbidden unless prior written permission is obtained 15 * from Adobe Systems Incorporated. 16 * 17 */ 18 19/** 20 * The <code>_g</code> library contains all Granite component classes and utilities. 21 * @static 22 * @granite-class _g 23 */ 24window._g = window._g || {}; 25 26// namespace 27_g.shared = {}; 28 29// debug console 30if (window.console === undefined) { 31 window.console = {log:function(m){}}; 32} 33 34/* 35 * ADOBE CONFIDENTIAL 36 * 37 * Copyright 2012 Adobe Systems Incorporated 38 * All Rights Reserved. 39 *
40 * NOTICE: All information contained herein is, and remains 41 * the property of Adobe Systems Incorporated and its suppliers, 42 * if any. The intellectual and technical concepts contained 43 * herein are proprietary to Adobe Systems Incorporated and its 44 * suppliers and may be covered by U.S. and Foreign Patents, 45 * patents in process, and are protected by trade secret or copyright law. 46 * Dissemination of this information or reproduction of this material 47 * is strictly forbidden unless prior written permission is obtained 48 * from Adobe Systems Incorporated. 49 * 50 */ 51 52/** 53 * A helper class providing a set of HTTP-related utilities. 54 * @static 55 * @singleton 56 * @class CQ.shared.HTTP 57 * @deprecated use Granite.HTTP and Granite.$#ajax instead 58 */ 59_g.shared.HTTP = new function() { 60 /** 61 * Creates an empty response object. 62 * @private 63 * @static 64 * @return {Object} The response object 65 */ 66 var createResponse = function() { 67 var response = new Object(); 68 response.headers = new Object(); 69 response.body = new Object(); 70 return response; 71 }; 72 73 var getResponseFromXhr = function(request) { 74 if (!request) return null; 75 var response = createResponse(); 76 response.body = request.responseText; 77 response.headers[_g.HTTP.HEADER_STATUS] = request.status; 78 // set properties for backward compatibility (pre 5.3) 79 response.responseText = request.responseText; 80 response.status = request.status; 81 return response; 82 }; 83 84 return { 85 /** 86 * The extension for HTML files. 87 * @static 88 * @final
89 * @type String 90 */ 91 EXTENSION_HTML: ".html", 92 93 /** 94 * The extension for JSON files. 95 * @static 96 * @final 97 * @type String 98 */ 99 EXTENSION_JSON: ".json", 100 101 /** 102 * The extension for resources. 103 * @private 104 * @static 105 * @final 106 * @type String 107 */ 108 EXTENSION_RES: ".res", 109 110 /** 111 * The Status header. 112 * @static 113 * @final 114 * @type String 115 */ 116 HEADER_STATUS: "Status", 117 118 /** 119 * The Message header. 120 * @static 121 * @final 122 * @type String 123 */ 124 HEADER_MESSAGE: "Message", 125 126 /** 127 * The Location header. 128 * @static 129 * @final 130 * @type String 131 */ 132 HEADER_LOCATION: "Location", 133 134 /** 135 * The Path header. 136 * @static 137 * @final 138 * @type String 139 */ 140 HEADER_PATH: "Path", 141 142 /** 143 * The parameter name for no caching. 144 * @static 145 * @final
146 * @type String 147 */ 148 PARAM_NO_CACHE: "cq_ck", 149 150 /** 151 * Requests the specified URL from the server using GET. The request 152 * will be synchronous, unless a callback function is specified. 153 * @static 154 * @param {String} url The URL to request 155 * @param {Function} callback (optional) The callback function which is 156 * called regardless of success or failure and is passed the following 157 * parameters:<ul> 158 * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li> 159 * <li><b>success</b> : Boolean<div class="sub-desc">True if the request succeeded.</div></li> 160 * <li><b>response</b> : Object<div class="sub-desc">The response object.</div></li> 161 * </ul> 162 * @param {Object} scope The scope for the callback (optional) 163 * @param {Boolean} suppressForbiddenCheck Suppress the check if the session has timed out (optional) 164 * @return {Mixed} The response object or, if the 165 * request is asynchronous, the transaction ID 166 */ 167 get: function(url, callback, scope, suppressForbiddenCheck) { 168 url = _g.HTTP.getXhrHookedURL(_g.HTTP.externalize(url, true)); 169 170 if (callback != undefined) { 171 return _g.$.ajax({ 172 type: "GET", 173 url: url, 174 externalize: false, 175 encodePath: false, 176 hook: false, 177 complete: function(request, textStatus) { 178 var response = getResponseFromXhr(request); 179 if (!suppressForbiddenCheck) _g.HTTP.handleForbidden(response); 180 callback.call(scope || this, 181 this, 182 textStatus == "success", 183 response); 184 } 185 }); 186 } else { 187 try { 188 var request = _g.$.ajax({ 189 type: "GET", 190 url: url, 191 async: false, 192 externalize: false, 193 encodePath: false, 194 hook: false 195 }); 196 var response = getResponseFromXhr(request); 197 if (!suppressForbiddenCheck) _g.HTTP.handleForbidden(response); 198 return response; 199 } catch (e) { 200 return null; 201 } 202 } 203 }, 204 205 /** 206 * Requests the specified URL from the server using POST. The request 207 * will be synchronous, unless a callback function is specified. 208 * The returned response object looks like this: 209 * <pre><code>{ headers: { "Status": 200, ... } }</code></pre> 210 * See constants above for all supported headers. 211 * @static 212 * @param {String} url The URL to request 213 * @param {Function} callback (optional) The callback function which is 214 * called regardless of success or failure and is passed the following 215 * parameters:<ul> 216 * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li> 217 * <li><b>success</b> : Boolean<div class="sub-desc">True if the request succeeded.</div></li> 218 * <li><b>xhr</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data. 219 * See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about 220 * accessing elements of the response.</div></li> 221 * <li><b>response</b> : Object<div class="sub-desc">The response object.<br> 222 * <i>Added in CQ 5.3</i></div></li> 223 * </ul> 224 * @param {Object} params The parameters 225 * @param {Object} scope The scope for the callback 226 * @param {Boolean} suppressErrorMsg Suppress the error msg notification 227 * @param {Boolean} suppressForbiddenCheck Suppress the check if the session has timed out (optional) 228 * @return {Mixed} The response object or, if the request is 229 * asynchronous, the transaction ID 230 */ 231 post: function(url, callback, params, scope, suppressErrorMsg, suppressForbiddenCheck) { 232 url = _g.HTTP.externalize(url, true); 233 234 var hook = _g.HTTP.getXhrHook(url, "POST", params); 235 if (hook) { 236 url = hook.url; 237 params = hook.params; 238 } 239 240 if (callback != undefined) { 241 return _g.$.ajax({ 242 type: "POST", 243 url: url, 244 data: params, 245 externalize: false,
246 encodePath: false, 247 hook: false, 248 complete: function(request, textStatus) { 249 var response = _g.HTTP.buildPostResponseFromHTML(request.responseText); 250 if (!suppressForbiddenCheck) _g.HTTP.handleForbidden(request); 251 callback.call(scope || this, 252 this, 253 textStatus == "success", 254 response); 255 } 256 }); 257 } else { 258 try { 259 var request = _g.$.ajax({ 260 type: "POST", 261 url: url, 262 data: params, 263 async: false, 264 externalize: false, 265 encodePath: false, 266 hook: false 267 }); 268 var response = _g.HTTP.buildPostResponseFromHTML(request.responseText); 269 if (!suppressForbiddenCheck) _g.HTTP.handleForbidden(request); 270 return response; 271 } catch (e) { 272 return null; 273 } 274 } 275 }, 276 277 /** 278 * Returns the value of the parameter with the specified name 279 * in the URL. Only the first value will be considered. 280 * Values will be URL-decoded. 281 * @static 282 * @param {String} url The URL 283 * @param {String} name The name of the parameter 284 * @return {String} The value 285 */ 286 getParameter: function(url, name) { 287 var params = _g.HTTP.getParameters(url, name); 288 return params != null ? params[0] : null; 289 }, 290 291 /** 292 * Returns the values of the parameters with the specified name 293 * in the URL. Values will be URL-decoded. 294 * @static 295 * @param {String} url The URL 296 * @param {String} name The name of the parameter 297 * @return {String[]} The values 298 */ 299 getParameters: function(url, name) { 300 var values = []; 301 if (!name) { 302 return null; 303 } 304 name = encodeURIComponent(name); 305 if (url.indexOf("?") == -1) { 306 return null; 307 } 308 if (url.indexOf("#") != -1) { 309 url = url.substring(0, url.indexOf("#")); 310 } 311 var query = url.substring(url.indexOf("?") + 1); 312 if (query.indexOf(name) == -1) { 313 return null; 314 } 315 var queryPts = query.split("&"); 316 for (var i = 0; i < queryPts.length; i++) { 317 var paramPts = queryPts[i].split("="); 318 if (paramPts[0] == name) { 319 values.push(paramPts.length > 1 ? decodeURIComponent(paramPts[1]) : ""); 320 } 321 } 322 return values.length > 0 ? values : null; 323 }, 324 325 /** 326 * Adds a parameter to the specified URL. The parameter name and 327 * value will be URL-endcoded.
328 * @static 329 * @param {String} url The URL 330 * @param {String} name The name of the parameter 331 * @param {String/String[]} value The value of the parameter. 332 * Since 5.3, an array of strings can be passed 333 * @return {String} The URL with the new parameter 334 */ 335 addParameter: function(url, name, value) { 336 if (value && value instanceof Array) { 337 for (var i = 0; i < value.length; i++) { 338 url = _g.HTTP.addParameter(url, name, value[i]); 339 } 340 return url; 341 } 342 var separator = url.indexOf("?") == -1 ? "?" : "&"; 343 var hashIdx = url.indexOf("#"); 344 if (hashIdx < 0) { 345 return url + separator + encodeURIComponent(name) + "=" + encodeURIComponent(value); 346 } else { 347 var hash = url.substring(hashIdx); 348 url = url.substring(0, hashIdx); 349 return url + separator + encodeURIComponent(name) + "=" + encodeURIComponent(value) + hash; 350 } 351 }, 352 353 /** 354 * Overwrites a parameter in the specified URL. The parameter name 355 * and value will be URL-endcoded.
356 * @static 357 * @param {String} url The URL 358 * @param {String} name The name of the parameter 359 * @param {String} value The value of the parameter 360 * @return {String} The URL with the new parameter 361 */ 362 setParameter: function(url, name, value) { 363 url = _g.HTTP.removeParameter(url, name); 364 return _g.HTTP.addParameter(url, name, value); 365 }, 366 367 /** 368 * Removes a parameter from the specified URL. 369 * @static 370 * @param {String} url The URL 371 * @param {String} name The name of the parameter to remove 372 * @return {String} The URL without the parameter 373 */ 374 removeParameter: function(url, name) { 375 var pattern0 = "?" + encodeURIComponent(name) + "="; 376 var pattern1 = "&" + encodeURIComponent(name) + "="; 377 var pattern; 378 if (url.indexOf(pattern0) != -1) { 379 pattern = pattern0; 380 } 381 else if (url.indexOf(pattern1) != -1) { 382 pattern = pattern1; 383 } 384 else { 385 return url; 386 } 387 388 var indexCutStart = url.indexOf(pattern); 389 var begin = url.substring(0, indexCutStart); 390 391 var indexCutEnd = url.indexOf("&", indexCutStart + 1); 392 var end = ""; 393 if (indexCutEnd != -1) { 394 end = url.substring(indexCutEnd); 395 if (end.indexOf("&") == 0) { 396 end = end.replace("&", "?"); 397 } 398 } 399 return begin + end; 400 }, 401 402 /** 403 * Removes all parameter from the specified URL. 404 * @static 405 * @param {String} url The URL 406 * @return {String} The URL without parameters 407 */ 408 removeParameters: Granite.HTTP.removeParameters, 409 410 /** 411 * Adds the specified selector to an URL. 412 * @param {String} url The URL. The URL must contain a extension and 413 * must not contain a suffix (x.json/a/b). Anchor and 414 * request parameters are supported. 415 * @param {String} selector The name of the selector to insert 416 * @param {Number} index (optional) The index of the selector. If it is "-1" 417 * or bigger than the number of the existing selectors 418 * the selector will be appended. Defaults to "0". 419 * @return {String} The updated URL 420 * @since 5.3 421 */ 422 addSelector: function(url, selector, index) { 423 if (!index) index = 0; 424 425 // url: /x/y.z.json?a=1#b 426 // post: ?a=1#b 427 // path: /x 428 // main: y.z.json 429 var post = ""; // string of parameters and anchor 430 var pIndex = url.indexOf("?"); 431 if (pIndex == -1) pIndex = url.indexOf("#"); 432 if (pIndex != -1) { 433 post = url.substring(pIndex); 434 url = url.substring(0, pIndex); 435 } 436 var sIndex = url.lastIndexOf("/"); 437 var main = url.substring(sIndex); // name, selectors and extension 438 if (main.indexOf("." + selector + ".") == -1) { 439 var path = url.substring(0, sIndex); 440 var obj = main.split("."); 441 var newMain = ""; 442 var delim = ""; 443 if (index > obj.length - 2 || index == -1) { 444 // insert at last position 445 index = obj.length - 2; 446 } 447 for (var i = 0; i < obj.length; i++) { 448 newMain += delim + obj[i]; 449 delim = "."; 450 if (index == i) { 451 newMain += delim + selector; 452 } 453 } 454 return path + newMain + post; 455 } 456 else { 457 return url; 458 } 459 }, 460 461 /** 462 * Replaces the selector at the given index position. If no selector exists 463 * at the index position, no change is made to the URL. 464 * 465 * @param {String} url The URL. 466 * @param {String} selector The value with which to replace the selector. 467 * @param {Number} index The index of the selector to set/replace. 468 * @return {String} The URL with the selector replaced. 469 * @since 5.4 470 */ 471 setSelector: function(url, selector, index) { 472 473 var post = ""; 474 var pIndex = url.indexOf("?"); 475 if (pIndex == -1) pIndex = url.indexOf("#"); 476 if (pIndex != -1) { 477 post = url.substring(pIndex); 478 url = url.substring(0, pIndex); 479 } 480 481 var selectors = _g.HTTP.getSelectors(url); 482 var ext = url.substring(url.lastIndexOf(".")); 483 // cut extension 484 url = url.substring(0, url.lastIndexOf(".")); 485 // cut selectors 486 var fragment = (selectors.length > 0) ? url.replace("." + selectors.join("."), "") : url; 487 488 if (selectors.length > 0) { 489 for (var i = 0; i < selectors.length; i++) { 490 if (index == i) { 491 fragment += "." + selector; 492 } else { 493 fragment += "." + selectors[i] 494 } 495 } 496 } else { 497 fragment += "." + selector; 498 } 499 500 return fragment + ext + post; 501 }, 502 503 /** 504 * Adds the specified selectors to an URL. 505 * @param {String} url The URL. The URL must contain a extension and 506 * must not contain a suffix (x.json/a/b). Anchor and 507 * request parameters are supported. 508 * @param {String[]} selectors The name of the selectors to insert 509 * @return {String} The updated URL 510 * @since 5.5 511 */ 512 addSelectors: function(url, selectors) { 513 var res = url; 514 if( url && selectors && selectors.length) { 515 for(var i=0;i< selectors.length;i++) { 516 res = _g.HTTP.addSelector(res, selectors[i], i); 517 } 518 } 519 return res; 520 }, 521 522 /**
523 * Returns the anchor part of the URL. 524 * @static 525 * @param {String} url The URL 526 * @return {String} The anchor 527 */ 528 getAnchor: function(url) { 529 if (url.indexOf("#") != -1) { 530 return url.substring(url.indexOf("#") + 1); 531 } 532 return ""; 533 }, 534 535 /** 536 * Sets the anchor of the specified URL. 537 * @static 538 * @param {String} url The URL 539 * @param {String} anchor The anchor 540 * @return {String} The URL with anchor 541 */ 542 setAnchor: function(url, anchor) { 543 return _g.HTTP.removeAnchor(url) + "#" + anchor; 544 }, 545 546 /** 547 * Removes the anchor from the specified URL. 548 * @static 549 * @param {String} url The URL 550 * @return {String} The URL without anchor 551 */ 552 removeAnchor: Granite.HTTP.removeAnchor, 553 554 /** 555 * Prevents caching by adding a timestamp to the specified URL. 556 * @static 557 * @param {String} url The URL 558 * @return {String} The URL with timestamp 559 */ 560 noCaching: function(url) { 561 return _g.HTTP.setParameter(url, _g.HTTP.PARAM_NO_CACHE, new Date().valueOf()); 562 }, 563 564 /** 565 * Builds a response object using the specified node and its child nodes. 566 * The content of each node with an ID will be set as a response header. 567 * @private 568 * @static 569 * @param {Node} node The content document or the node to parse 570 * @param {Object} response The response object to use (optional) 571 * @return {Object} The response object 572 */ 573 buildPostResponseFromNode: function(node, response) { 574 if (!node) { 575 return null; 576 } 577 if (response == undefined) { 578 response = createResponse(); 579 } 580 581 for (var i = 0; i < node.childNodes.length; i++) { 582 var child = node.childNodes[i]; 583 if (child.tagName) { 584 if (child.id) { 585 if (child.href) { 586 response.headers[child.id] = child.href; 587 } 588 else { 589 response.headers[child.id] = child.innerHTML; 590 } 591 } 592 response = _g.HTTP.buildPostResponseFromNode(child, response); 593 } 594 } 595 return response; 596 }, 597 598 /** 599 * Builds a response object using the specified HTML string. The 600 * content of each node with an ID will be set as a response header. 601 * @private 602 * @static 603 * @param {String} html The HTML string 604 * @return {Object} The response object 605 */ 606 buildPostResponseFromHTML: function(html) { 607 var response = createResponse(); 608 try { 609 if (html.responseText != undefined) { 610 html = html.responseText; 611 } else if (typeof html != "string") { 612 html = html.toString(); 613 } 614 var div = document.createElement("div"); 615 div.innerHTML = html; 616 response = _g.HTTP.buildPostResponseFromNode(div, response); 617 div = null; 618 } catch (e) { 619 } 620 return response; 621 }, 622 623 /** 624 * Returns the value of the cookie with the specified name. 625 * @static 626 * @param {String} name The name of the cookie 627 * @return {String} The value of the cookie 628 */ 629 getCookie: function(name) { 630 var cname = encodeURIComponent(name) + "="; 631 var dc = document.cookie; 632 if (dc.length > 0) { 633 var begin = dc.indexOf(cname); 634 if (begin != -1) { 635 begin += cname.length; 636 var end = dc.indexOf(";", begin); 637 if (end == -1) end = dc.length; 638 return decodeURIComponent(dc.substring(begin, end)); 639 } 640 } 641 return null; 642 }, 643 644 /** 645 * Sets the value of the cookie with the specified name. 646 * @static 647 * @param {String} name The name of the cookie 648 * @param {String} value The value of the cookie 649 * @param {String} path (optional) The server path the cookie applies to 650 * @param {Number} days (optional) The number of days the cookie will live 651 * @param {String} domain (optional) The server domain 652 * @param {Boolean} secure (optional) True if the 653 * connection is secure 654 * @return {String} The value of the cookie 655 */
656 setCookie: function(name, value, path, days, domain, secure) { 657 if (typeof(days) != "number") days = 7; 658 var date; 659 if (days > 0) { 660 date = new Date(); 661 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 662 } else { 663 date = new Date(0); 664 } 665 document.cookie = encodeURIComponent(name) + "=" + 666 encodeURIComponent(value) + "; " + 667 (days != 0 ? "expires=" + date.toGMTString() + "; " : "") + 668 (domain ? "domain=" + domain + "; " : "") + 669 (path ? "path=" + path : "") + 670 (secure ? "; secure" : ""); 671 return value; 672 }, 673 674 /** 675 * Clears the cookie with the specified name. 676 * @static 677 * @param {String} name The name of the cookie 678 * @param {String} path (optional) The server path the cookie applies to 679 * @param {String} domain (optional) The server domain 680 * @param {Boolean} secure (optional) True if the 681 * connection is secure 682 */ 683 clearCookie : function(name, path, domain, secure) { 684 _g.HTTP.setCookie(name, "null", path || "", -1, domain || "", secure || ""); 685 }, 686 687 /** 688 * Returns the scheme and authority (user, hostname, port) part of 689 * the specified URL or an empty string if the URL does not include 690 * that part. 691 * @static 692 * @param {String} url The URL 693 * @return {String} The scheme and authority part 694 */ 695 getSchemeAndAuthority: Granite.HTTP.getSchemeAndAuthority, 696 697 /** 698 * Returns the context path used on the server. 699 * @static 700 * @return {String} The context path 701 * @since 5.3 702 */ 703 getContextPath: Granite.HTTP.getContextPath, 704 705 /** 706 * Makes sure the specified relative URL starts with the context path 707 * used on the server. If an absolute URL is passed, it will be returned 708 * as-is. 709 * @static 710 * @param {String} url The URL 711 * @param {boolean} encode true to encode the path of the URL (optional) 712 * @return {String} The externalized URL 713 * @since 5.3 714 */ 715 externalize: function(url, encode) { 716 // check if URL is already XHR_HOOKED and assume that the externalization has 717 // already been applied if so (externalizing an already hooked URL will break 718 // it in several/most cases!) 719 if ((typeof G_IS_HOOKED != "undefined") && G_IS_HOOKED(url)) { 720 return url; 721 } 722 if (encode) url = _g.HTTP.encodePathOfURI(url); 723 724 // Granite.HTTP.externalize does nor hooked check nor encoding 725 url = Granite.HTTP.externalize(url); 726 727 return url; 728 }, 729 730 /** 731 * Removes scheme, authority and context path from the specified 732 * absolute URL if it has the same scheme and authority as the 733 * specified document (or the current one). 734 * @static 735 * @param {String} url The URL 736 * @param {String} doc (optional) The document 737 * @return {String} The internalized URL 738 */ 739 internalize: Granite.HTTP.internalize, 740 741 /** 742 * Removes all parts but the path from the specified URL. 743 * <p>Examples:<pre><code> 744 /x/y.sel.html?param=abc => /x/y 745 </code></pre> 746 * <pre><code> 747 http://www.day.com/foo/bar.html => /foo/bar 748 </code></pre><p> 749 * @static 750 * @param {String} url The URL, may be empty. If empty <code>window.location.href</code> is taken. 751 * @return {String} The path 752 * @since 5.3 753 */ 754 getPath: Granite.HTTP.getPath, 755 756 /** 757 * Returns the current request suffix as provided by CQURLInfo.suffix. 758 * 759 * @static 760 * @return {String} The suffix 761 * 762 * @since 5.5 763 */ 764 getSuffix: function() {
765 if (window.CQURLInfo && CQURLInfo.suffix) { 766 return CQURLInfo.suffix; 767 } 768 return null; 769 }, 770 771 /** 772 * Returns an array with the selectors present in the given url. 773 * If no selectors are present, an empty array is returned. 774 * @static 775 * @param {String} url The URL, optional. If no url is provided, the 776 * selectors as provided by CQURLInfo.selectors 777 * are taken, with a fallback to window.location.href. 778 * @return {Array} An array containing the selectors or an empty 779 * array if none were found. 780 * @since 5.4 781 */ 782 getSelectors: function(url) { 783 784 if (!url && window.CQURLInfo) { 785 if (CQURLInfo.selectors) { 786 return CQURLInfo.selectors; 787 } 788 } 789 790 var selectors = []; 791 792 url = url || window.location.href; 793 794 url = _g.HTTP.removeParameters(url); 795 url = _g.HTTP.removeAnchor(url); 796 797 var fragment = url.substring(url.lastIndexOf("/")); 798 if (fragment) { 799 var split = fragment.split("."); 800 if (split.length > 2) { 801 for (var i = 0; i < split.length; i++) { 802 // don't add node name and extension as selectors 803 if (i > 0 && i < split.length - 1) { 804 selectors.push(split[i]); 805 } 806 } 807 } 808 } 809 810 return selectors; 811 }, 812 813 /** 814 * Returns the extension of an URL. This is the string 815 * after the last dot until the end of the url without 816 * any request parameters, anchors or suffix, for 817 * example "html". 818 * 819 * @param {String} url The URL 820 * @return {String} The URL extension (without the dot) 821 * or an empty string if no was found. 822 * @since 5.4 823 */ 824 getExtension: function(url) { 825 826 if (!url && window.CQURLInfo) { 827 if (CQURLInfo.extension) { 828 return CQURLInfo.extension; 829 } 830 } 831 832 url = url || window.location.href; 833 834 // strip things from the end 835 url = _g.HTTP.removeParameters(url); 836 url = _g.HTTP.removeAnchor(url); 837 838 // extension is everything after the last dot 839 var pos = url.lastIndexOf("."); 840 if (pos < 0) { 841 return ""; 842 } 843 844 // do not include the dot 845 url = url.substring(pos + 1); 846 847 // remove suffix if present 848 pos = url.indexOf("/"); 849 if (pos < 0) { 850 return url; 851 } 852 853 return url.substring(0, pos); 854 }, 855 856 /** 857 * Encodes the path of the specified URL if it is not already encoded. 858 * Path means the part of the URL before the first question mark or 859 * hash sign.<br> 860 * See {@link #encodePath} for details about the encoding.<br> 861 * Sample:<br> 862 * <code>/x/y+z.png?path=/x/y+z >> /x/y%2Bz.png?path=x/y+z</code><br> 863 * Note that the sample would not work because the "+" in the request 864 * parameter would be interpreted as a space. Parameters must be encoded 865 * separately. 866 * @param {String} url The URL to encoded 867 * @return {String} The encoded URL 868 * @since 5.3 869 */ 870 encodePathOfURI: Granite.HTTP.encodePathOfURI, 871 872 /** 873 * Encodes the specified path using encodeURI. Additionally <code>+</code>, 874 * <code>#</code> and <code>?</code> are encoded.<br> 875 * The following characters are not encoded:<br> 876 * <code>0-9 a-z A-Z</code><br> 877 * <code>- _ . ! ~ * ( )</code><br> 878 * <code>/ : @ & =</code><br> 879 * @param {String} path The path to encode 880 * @return {String} The encoded path 881 * @since 5.3 882 */ 883 encodePath: Granite.HTTP.encodePath, 884 885 /** 886 * Evaluates and returns the body of the specified response object. 887 * Alternatively, a URL can be specified, in which case it will be 888 * requested using a synchornous {@link #get} in order to acquire 889 * the response object. 890 * @static 891 * @param {Object/String} response The response object or URL 892 * @return {Object} The evaluated response body 893 * @since 5.3 894 */ 895 eval: Granite.HTTP.eval, 896 897 /** 898 * Checks whether the specified status code is OK. 899 * @static 900 * @param {Number} status The status code 901 * @return {Boolean} True if the status is OK, else false 902 */ 903 isOkStatus: function(status) { 904 try { 905 return (new String(status).indexOf("2") == 0); 906 } catch (e) { 907 return false;
908 } 909 }, 910 911 /** 912 * Checks if the specified response is OK. 913 * The response object is expected to look like this: 914 * <pre><code>{ headers: { "Status": 200, ... } }</code></pre> 915 * See constants above for all supported headers. 916 * @static 917 * @param {Object} response The response object 918 * @return {Boolean} True if the response is OK, else false 919 */ 920 isOk: function(response) { 921 try { 922 return _g.HTTP.isOkStatus( 923 response.headers[_g.HTTP.HEADER_STATUS]); 924 } catch (e) { 925 return false; 926 } 927 }, 928 929 /** 930 * <p>Returns if the specified response is of status 403/forbidden. If the 931 * status is 403 and <code>suppressLogin</code> is undefined the document 932 * is redirected to the login page.</p> 933 * <p>The status is expected to be found in the "status" property of the 934 * response: <code>{ "status": 403 }</code></p> 935 * @param {Object} response The response 936 * @param {Boolean} suppressLogin <code>true</code> to not redirect to the login page 937 * @return {Boolean} <code>true</code> if the status is 403 938 */ 939 handleForbidden: function(response, suppressLogin) { 940 try { 941 if (response[_g.HTTP.HEADER_STATUS.toLowerCase()] == 403) { 942 Granite.HTTP.handleLoginRedirect(); 943 return true; 944 } 945 return false; 946 } catch (e) { 947 return false; 948 } 949 }, 950 951 /** 952 * Gets the XHR hooked URL if called in a portlet context 953 * @param {String} url The URL to get 954 * @param {String} method The method to use to retrieve the XHR hooked URL 955 * @param {Object} params The parameters 956 * @return {String} The XHR hooked URL if available, the provided URL otherwise 957 */ 958 getXhrHook: Granite.HTTP.getXhrHook, 959 960 /** 961 * Gets the XHR hooked URL if called in a portlet context 962 * @param {String} url The URL to get 963 * @param {String} method The method to use to retrieve the XHR hooked URL 964 * @param {Object} params The parameters 965 * @return {String} The XHR hooked URL if available, the provided URL otherwise 966 */ 967 getXhrHookedURL: function(url, method, params) { 968 var hook = _g.HTTP.getXhrHook(url, method, params); 969 if (hook) { 970 return hook.url; 971 } 972 return url; 973 }, 974 975 /** 976 * Reloads the XHR hook (portlet context) 977 * @static 978 * @param {String} url The URL 979 * @return {String} Updated URL if reload hook function exists 980 */ 981 reloadHook: function(url) { 982 if (typeof G_RELOAD_HOOK != "undefined" && _g.$.isFunction(G_RELOAD_HOOK)) { 983 if (CQURLInfo.selectorString != "") { 984 url = _g.HTTP.addSelector(url, CQURLInfo.selectorString); 985 } 986 url = G_RELOAD_HOOK(url) || url; 987 } 988 return url; 989 } 990 991 } 992}; 993 994// shortcut 995_g.HTTP = _g.shared.HTTP; 996 997/* 998 * ADOBE CONFIDENTIAL 999 * 1000 * Copyright 2012 Adobe Systems Incorporated 1001 * All Rights Reserved. 1002 *
1003 * NOTICE: All information contained herein is, and remains 1004 * the property of Adobe Systems Incorporated and its suppliers, 1005 * if any. The intellectual and technical concepts contained 1006 * herein are proprietary to Adobe Systems Incorporated and its 1007 * suppliers and may be covered by U.S. and Foreign Patents, 1008 * patents in process, and are protected by trade secret or copyright law. 1009 * Dissemination of this information or reproduction of this material 1010 * is strictly forbidden unless prior written permission is obtained 1011 * from Adobe Systems Incorporated. 1012 * 1013 */ 1014 1015/** 1016 * A helper class providing a set of general utilities. 1017 * @static 1018 * @singleton 1019 * @class CQ.shared.Util 1020 * @granite-class _g.Util 1021 * @deprecated 1022 */ 1023_g.shared.Util = new function() { 1024 return { 1025 /** 1026 * Reloads the window or replaces its location with the specified URL. 1027 * If no window is specified, the current window will be used. 1028 * @static 1029 * @param {Window} win (optional) The window to reload 1030 * @param {String} url (optional) The URL 1031 * @param {String} preventHistory (optional) Prevent history 1032 */ 1033 reload: function(win, url, preventHistory) { 1034 if (!win) win = window; 1035 if (!url) { 1036 url = _g.HTTP.noCaching(win.location.href); 1037 } 1038 url = _g.HTTP.reloadHook(url); 1039 1040 if (preventHistory) { 1041 win.location.replace(url); 1042 } else { 1043 win.location.href = url; 1044 } 1045 }, 1046 1047 /** 1048 * Loads the specified URL in the current window. 1049 * @static 1050 * @param {String} url The URL 1051 * @param {String} preventHistory (optional) Prevent history 1052 */ 1053 load: function(url, preventHistory) { 1054 _g.Util.reload(window, url, preventHistory); 1055 }, 1056 1057 /** 1058 * Opens a new window with the specified URL. 1059 * If no window is specified, the current window will be used. 1060 * @static 1061 * @param {String} url The URL 1062 * @param {Window} win (optional) The window to reload 1063 * @param {String} name (optional) New window name 1064 * @param {String} options (optional) New window options 1065 * @return {Object} New window 1066 */ 1067 open: function(url, win, name, options) { 1068 if (!win) win = window; 1069 if (!url) { 1070 return; 1071 } 1072 url = _g.HTTP.reloadHook(url); 1073 1074 if (!name) { 1075 name = ""; 1076 } 1077 if (!options) { 1078 options = ""; 1079 } 1080 1081 return win.open(url, name, options); 1082 }, 1083 1084 /** 1085 * Converts certain characters (&, <, >, and ") to their HTML character equivalents for literal display in web pages. 1086 * @param {String} value The string to encode 1087 * @return {String} The encoded text 1088 */ 1089 htmlEncode : function(value) { 1090 return !value ? value : String(value).replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, """); 1091 }, 1092 1093 /** 1094 * Converts certain characters (&, <, >, and ") from their HTML character equivalents. 1095 * @param {String} value The string to decode 1096 * @return {String} The decoded text 1097 */ 1098 htmlDecode : function(value) { 1099 return !value ? value : String(value).replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&"); 1100 }, 1101 1102 /** 1103 * Truncates a string and add an ellipsis ('...') to the end if it exceeds the specified length 1104 * @param {String} value The string to truncate 1105 * @param {Number} length The maximum length to allow before truncating 1106 * @param {Boolean} word True to try to find a common work break 1107 * @return {String} The converted text 1108 */ 1109 ellipsis : function(value, length, word) { 1110 if (value && value.length > length) { 1111 if (word) { 1112 var vs = value.substr(0, length - 2); 1113 var index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?'), vs.lastIndexOf(';')); 1114 if (index == -1 || index < (length - 15)) { 1115 return value.substr(0, length - 3) + "..."; 1116 } else { 1117 return vs.substr(0, index) + "..."; 1118 } 1119 } else { 1120 return value.substr(0, length - 3) + "..."; 1121 } 1122 } 1123 return value; 1124 }, 1125 1126 /** 1127 * Replaces occurrences of <code>{n}</code> in the specified text with 1128 * the texts from the snippets. 1129 * <p>Example 1 (single snippet):<pre><code> 1130var text = CQ.shared.Util.patchText("{0} has signed in.", "Jack"); 1131 </code></pre>Result 1:<pre><code> 1132Jack has signed in. 1133 </code></pre></p> 1134 * <p>Example 2 (multiple snippets):<pre><code> 1135var text = "{0} {1} has signed in from {2}."; 1136text = CQ.shared.Util.patchText(text, ["Jack", "McFarland", "10.0.0.99"]); 1137 </code></pre>Result 2:<pre><code> 1138Jack McFarland has signed in from 10.0.0.99. 1139 </code></pre></p> 1140 * @static 1141 * @param {String} text The text 1142 * @param {String/String[]} snippets The text(s) replacing 1143 * <code>{n}</code> 1144 * @return {String} The patched text 1145 */ 1146 patchText: Granite.Util.patchText, 1147 1148 /** 1149 * Evaluates and returns the response text of the specified response 1150 * object. 1151 * @static 1152 * @param {Object} response The response object 1153 * @return {Object} The evaluated object 1154 * @deprecated Use {@link CQ.shared.HTTP#eval} instead 1155 */ 1156 eval: function(response) { 1157 return _g.HTTP.eval(response); 1158 }, 1159 1160 /** 1161 * Returns the top most accessible window. 1162 * @static 1163 * @return {Window} The top window 1164 * @since 5.5 1165 */ 1166 getTopWindow: Granite.Util.getTopWindow, 1167 1168 /** 1169 * Allows to define if Granite.Util is running in an iFrame and parent window is in another domain 1170 * (and optionally define what would be the top window in that case. 1171 * This is necessary to use {@link getTopWindow} in a iFrame on WebKit based browsers because 1172 * {@link getTopWindow} iterates on parent windows to find the top one which triggers a security exception 1173 * if one parent window is in a different domain. Exception cannot be caught but is not breaking the JS 1174 * execution. 1175 * @param {Object} topWindow (optional) The iFrame top window. Must be running on the same host to avoid 1176 * security exception. Defaults to window. 1177 */ 1178 setIFrameMode: Granite.Util.setIFrameMode 1179 } 1180 1181}; 1182 1183// shortcut 1184_g.Util = _g.shared.Util; 1185 1186/* 1187 * ADOBE CONFIDENTIAL 1188 * 1189 * Copyright 2012 Adobe Systems Incorporated 1190 * All Rights Reserved. 1191 *
1192 * NOTICE: All information contained herein is, and remains 1193 * the property of Adobe Systems Incorporated and its suppliers, 1194 * if any. The intellectual and technical concepts contained 1195 * herein are proprietary to Adobe Systems Incorporated and its 1196 * suppliers and may be covered by U.S. and Foreign Patents, 1197 * patents in process, and are protected by trade secret or copyright law. 1198 * Dissemination of this information or reproduction of this material 1199 * is strictly forbidden unless prior written permission is obtained 1200 * from Adobe Systems Incorporated. 1201 * 1202 */ 1203 1204/** 1205 * A helper class providing a set of Sling-related utilities. 1206 * @static 1207 * @singleton 1208 * @class CQ.Sling 1209 * @deprecated use Granite.Sling instead 1210 */ 1211_g.shared.Sling = function() { 1212 1213 return { 1214 1215 /** 1216 * The selector for infinite hierarchy depth when retrieving 1217 * repository content. 1218 * @static 1219 * @final 1220 * @type String 1221 */ 1222 SELECTOR_INFINITY: Granite.Sling.SELECTOR_INFINITY, 1223 1224 /** 1225 * The parameter name for the used character set. 1226 * @static 1227 * @final
1228 * @type String 1229 */ 1230 CHARSET: Granite.Sling.CHARSET, 1231 1232 /** 1233 * The parameter name for the status. 1234 * @static 1235 * @final 1236 * @type String 1237 */ 1238 STATUS: Granite.Sling.STATUS, 1239 1240 /** 1241 * The parameter value for the status type "browser". 1242 * @static 1243 * @final 1244 * @type String 1245 */ 1246 STATUS_BROWSER: Granite.Sling.STATUS_BROWSER, 1247 1248 /** 1249 * The parameter name for the operation. 1250 * @static 1251 * @final 1252 * @type String 1253 */ 1254 OPERATION: Granite.Sling.OPERATION, 1255 1256 /** 1257 * The parameter value for the delete operation. 1258 * @static 1259 * @final 1260 * @type String 1261 */ 1262 OPERATION_DELETE: Granite.Sling.OPERATION_DELETE, 1263 1264 /** 1265 * The parameter value for the move operation. 1266 * @static 1267 * @final 1268 * @type String 1269 */ 1270 OPERATION_MOVE: Granite.Sling.OPERATION_MOVE, 1271 1272 /** 1273 * The parameter name suffix for deleting. 1274 * @static 1275 * @final
1276 * @type String 1277 */ 1278 DELETE_SUFFIX: Granite.Sling.DELETE_SUFFIX, 1279 1280 /** 1281 * The parameter name suffix for setting a type hint. 1282 * @static 1283 * @final 1284 * @type String 1285 */ 1286 TYPEHINT_SUFFIX: Granite.Sling.TYPEHINT_SUFFIX, 1287 1288 /** 1289 * The parameter name suffix for copying. 1290 * @static 1291 * @final 1292 * @type String 1293 */ 1294 COPY_SUFFIX: Granite.Sling.COPY_SUFFIX, 1295 1296 /** 1297 * The parameter name suffix for moving. 1298 * @static 1299 * @final 1300 * @type String 1301 */ 1302 MOVE_SUFFIX: Granite.Sling.MOVE_SUFFIX, 1303 1304 /** 1305 * The parameter name for the ordering. 1306 * @static 1307 * @final 1308 * @type String 1309 */ 1310 ORDER: Granite.Sling.ORDER, 1311 1312 /** 1313 * The parameter name for the replace flag. 1314 * @static 1315 * @final 1316 * @type String 1317 */ 1318 REPLACE: Granite.Sling.REPLACE, 1319 1320 /** 1321 * The parameter name for the destination flag. 1322 * @static 1323 * @final
1324 * @type String 1325 */ 1326 DESTINATION: Granite.Sling.DESTINATION, 1327 1328 /** 1329 * The parameter name for the save parameter prefix. 1330 * @static 1331 * @final 1332 * @type String 1333 */ 1334 SAVE_PARAM_PREFIX: Granite.Sling.SAVE_PARAM_PREFIX, 1335 1336 /** 1337 * The parameter name for input fields that should 1338 * be ignored by Sling. 1339 * @static 1340 * @final 1341 * @type String 1342 */ 1343 IGNORE_PARAM: Granite.Sling.IGNORE_PARAM, 1344 1345 /** 1346 * The parameter name for login requests. 1347 * @static 1348 * @final 1349 * @type String 1350 */ 1351 REQUEST_LOGIN_PARAM: Granite.Sling.REQUEST_LOGIN_PARAM, 1352 1353 /** 1354 * Login URL 1355 * @static 1356 * @final 1357 * @type String 1358 */ 1359 LOGIN_URL: Granite.Sling.LOGIN_URL, 1360 1361 /** 1362 * Logout URL 1363 * @static 1364 * @final 1365 * @type String 1366 */ 1367 LOGOUT_URL: Granite.Sling.LOGOUT_URL, 1368 1369 /** 1370 * Detects and processes binary repository data returned by Sling 1371 * and does some preparsing on it for more easy data handling. 1372 * @static 1373 * @param {Object} value The repository data to check 1374 * @return {Object} The processed repository data 1375 */ 1376 processBinaryData: function(value) { 1377 if (value && value[":jcr:data"] != undefined) { 1378 // value is a binary 1379 var o = new Object(); 1380 o.size = value[":jcr:data"]; 1381 o.type = value["jcr:mimeType"]; 1382 o.date = value["jcr:lastModified"]; 1383 value = o; 1384 } 1385 return value; 1386 }, 1387 1388 /** 1389 * Returns the content path for the data. 1390 * @static 1391 * @param {String} relPath The relative path to resolve 1392 * @param {String} absPath The absolute path to resovle against 1393 * @param {Boolean} allowParentPaths Indicates parent paths (../) should be processed at the start of the 1394 * relative path 1395 * @return {String} The absolute path path 1396 */ 1397 getContentPath: function(relPath, absPath, allowParentPaths) { 1398 var path = absPath; 1399 if (path.lastIndexOf(".") > path.lastIndexOf("/")) { 1400 // remove selectors and extension from absPath: 1401 // /content/foo.bar.html >> /content/foo 1402 path = path.substr(0, path.indexOf(".", path.lastIndexOf("/"))); 1403 } 1404 if (relPath) { 1405 if (relPath.indexOf("/") == 0) { 1406 path = relPath; 1407 } else { 1408 if (allowParentPaths) { 1409 while (relPath.indexOf("../") == 0) { 1410 relPath = relPath.substring(3); 1411 path = path.substring(0, path.lastIndexOf("/")); 1412 } 1413 } 1414 relPath = relPath.replace("./", ""); 1415 path = path + "/" + relPath; 1416 } 1417 } 1418 return path; 1419 } 1420 }; 1421 1422}(); 1423 1424// shortcut 1425_g.Sling = _g.shared.Sling; 1426 1427/* 1428 * ADOBE CONFIDENTIAL 1429 * 1430 * Copyright 2012 Adobe Systems Incorporated 1431 * All Rights Reserved. 1432 *
1433 * NOTICE: All information contained herein is, and remains 1434 * the property of Adobe Systems Incorporated and its suppliers, 1435 * if any. The intellectual and technical concepts contained 1436 * herein are proprietary to Adobe Systems Incorporated and its 1437 * suppliers and may be covered by U.S. and Foreign Patents, 1438 * patents in process, and are protected by trade secret or copyright law. 1439 * Dissemination of this information or reproduction of this material 1440 * is strictly forbidden unless prior written permission is obtained 1441 * from Adobe Systems Incorporated. 1442 * 1443 */ 1444 1445/** 1446 * Provides static utilities for XSS management. 1447 * @static 1448 * @singleton 1449 * @since 5.4 1450 * @class CQ.shared.XSS 1451 * @granite-class _g.XSS 1452 * @deprecated 1453 */ 1454_g.shared.XSS = new function() { 1455 return { 1456 /** 1457 * Get XSS property name from a provided property name 1458 * 1459 * @static 1460 * @param {String} propertyName Property name 1461 * @return {String} XSS property name 1462 */ 1463 getXSSPropertyName: function(propertyName) { 1464 if (!propertyName) { 1465 return ''; 1466 } 1467 if (_g.XSS.KEY_REGEXP.test(propertyName)) { 1468 return propertyName; 1469 } 1470 return propertyName += _g.XSS.KEY_SUFFIX; 1471 }, 1472 1473 /** 1474 * Get XSS property value from provided property name and json record 1475 * 1476 * @static 1477 * @param {Object} rec Object containing the properties and their values 1478 * @param {String} propertyName Property name 1479 * @param {Number} ellipsisLimit Maximum number of characters 1480 * @return {String} XSS property value 1481 */ 1482 getXSSRecordPropertyValue: function(rec, propertyName, ellipsisLimit) { 1483 var value = ''; 1484 if (rec && propertyName) { 1485 var xssPropValue = rec.get(this.getXSSPropertyName(propertyName)); 1486 if (xssPropValue) { 1487 value = xssPropValue; 1488 } else { 1489 value = this.getXSSValue(rec.get(propertyName)); 1490 } 1491 1492 if (ellipsisLimit && !isNaN(ellipsisLimit)) { 1493 value = _g.Util.ellipsis(value, ellipsisLimit, true); 1494 } 1495 } 1496 return value; 1497 }, 1498 1499 /** 1500 * Get XSS property value from provided property name and table 1501 * 1502 * @static 1503 * @param {Object} table Object containing the properties and their values 1504 * @param {String} propertyName Property name 1505 * @param {Number} ellipsisLimit Maximum number of characters 1506 * @return {String} XSS property value 1507 */ 1508 getXSSTablePropertyValue: function(table, propertyName, ellipsisLimit) { 1509 var value = ''; 1510 if (table && propertyName) { 1511 var xssPropValue = table[this.getXSSPropertyName(propertyName)]; 1512 if (xssPropValue) { 1513 value = xssPropValue; 1514 } else { 1515 value = this.getXSSValue(table[propertyName]); 1516 } 1517 1518 if (ellipsisLimit && !isNaN(ellipsisLimit)) { 1519 value = _g.Util.ellipsis(value, ellipsisLimit, true); 1520 } 1521 } 1522 return value; 1523 }, 1524 1525 /** 1526 * XSS value renderer 1527 * 1528 * @static 1529 * @param {String} val Value to protect 1530 * @return {String} XSS protected value 1531 */ 1532 getXSSValue: function(val) { 1533 if (val) { 1534 // There is a value to display, which we encode 1535 return _g.Util.htmlEncode(val); 1536 } else { 1537 // There was no value to display 1538 return ''; 1539 } 1540 }, 1541 1542 /** 1543 * Update configuration object's property name if XSS is enabled for it 1544 * 1545 * @static 1546 * @param {Object} cfg Configuration object 1547 * @param {String} propertyName Property name of the provided configuration object 1548 */ 1549 updatePropertyName: function(cfg, propertyName) { 1550 if (!cfg || !propertyName || !cfg[propertyName]) { 1551 return; 1552 } 1553 if (cfg['xssProtect'] && !cfg['xssKeepPropName']) { 1554 cfg[propertyName] = this.getXSSPropertyName(cfg[propertyName]); 1555 } 1556 }, 1557 1558 /** 1559 * XSS property renderer 1560 * 1561 * @static 1562 * @param {String} val Value to display if XSS would not have been requested or is not available 1563 * @param {Object} meta Field metadata 1564 * @param {Object} cfg Field configuration 1565 * @param {Object} rec Record containing information 1566 * @return {String} XSS property value 1567 */ 1568 xssPropertyRenderer: function(val, meta, rec, cfg) { 1569 if (cfg && cfg['dataIndex'] && rec && rec.data && rec.data[this.getXSSPropertyName(cfg['dataIndex'])]) { 1570 // The record contains the XSS property equivalent 1571 val = rec.data[this.getXSSPropertyName(cfg['dataIndex'])]; 1572 if (cfg['ellipsisLimit'] && !isNaN(cfg['ellipsisLimit'])) { 1573 val = _g.Util.ellipsis(val, cfg['ellipsisLimit'], true); 1574 } 1575 return val; 1576 } else if (val) { 1577 // The record does not contain the XSS property equivalent 1578 return val; 1579 } else { 1580 // There was no value to display 1581 return ''; 1582 } 1583 } 1584 } 1585}; 1586 1587// shortcut 1588_g.XSS = _g.shared.XSS; 1589 1590/** 1591 * Key suffix for XSS property name 1592 * @static 1593 * @final
1594 * @type String 1595 */ 1596_g.XSS.KEY_SUFFIX = "_xss"; 1597 1598/** 1599 * Key regular expression to test if a property name already ends with XSS suffix 1600 * @private 1601 * @static 1602 * @final 1603 * @type Object 1604 */ 1605_g.XSS.KEY_REGEXP = new RegExp(_g.XSS.KEY_SUFFIX + "$"); 1606 1607/* 1608 * ADOBE CONFIDENTIAL 1609 * 1610 * Copyright 2012 Adobe Systems Incorporated 1611 * All Rights Reserved. 1612 * 1613 * NOTICE: All information contained herein is, and remains 1614 * the property of Adobe Systems Incorporated and its suppliers, 1615 * if any. The intellectual and technical concepts contained 1616 * herein are proprietary to Adobe Systems Incorporated and its 1617 * suppliers and may be covered by U.S. and Foreign Patents, 1618 * patents in process, and are protected by trade secret or copyright law. 1619 * Dissemination of this information or reproduction of this material 1620 * is strictly forbidden unless prior written permission is obtained 1621 * from Adobe Systems Incorporated. 1622 * 1623 */ 1624 1625/** 1626 * A helper class providing a set of utilities related to internationalization 1627 * (i18n). Note: for cq localization, make sure to use CQ.I18n.get().
1628 * @static 1629 * @singleton 1630 * @class CQ.I18n 1631 * @granite-class _g.I18n 1632 * @deprecated use Granite.I18n instead 1633 */ 1634_g.shared.I18n = Granite.I18n;//function() { 1635 1636// shortcut 1637_g.I18n = _g.shared.I18n; 1638 1639_g.shared.I18n.getMessage = Granite.I18n.get; 1640_g.shared.I18n.getVarMessage = Granite.I18n.getVar; 1641 1642/* 1643 * ADOBE CONFIDENTIAL 1644 * 1645 * Copyright 2012 Adobe Systems Incorporated 1646 * All Rights Reserved. 1647 * 1648 * NOTICE: All information contained herein is, and remains 1649 * the property of Adobe Systems Incorporated and its suppliers, 1650 * if any. The intellectual and technical concepts contained 1651 * herein are proprietary to Adobe Systems Incorporated and its 1652 * suppliers and may be covered by U.S. and Foreign Patents, 1653 * patents in process, and are protected by trade secret or copyright law. 1654 * Dissemination of this information or reproduction of this material 1655 * is strictly forbidden unless prior written permission is obtained 1656 * from Adobe Systems Incorporated. 1657 * 1658 */ 1659 1660/** 1661 * A helper class providing a set of String related utilities.
1662 * @static 1663 * @singleton 1664 * @since 5.5 1665 * @class CQ.shared.String 1666 * @granite-class _g.String 1667 * @deprecated 1668 */ 1669_g.shared.String = new function() { 1670 1671 return { 1672 1673 /** 1674 * Check to see if the the str starts with the prefix. 1675 * The comparison is case sensitive. 1676 * @static 1677 * @param {String} str The string to check. 1678 * @param {String} prefix The prefix to find. 1679 * @return {Boolean} if the str starts with the prefix 1680 * return true, otherwise false. 1681 */ 1682 startsWith: function( str, prefix ) { 1683 if (str == null || prefix == null) { 1684 return str == null && prefix == null; 1685 } 1686 1687 if (prefix.length > str.length) { 1688 return false; 1689 } 1690 1691 // ensure we are dealing with the string form of this object 1692 var sMatch = str.toString(); 1693 var sSearch = prefix.toString(); 1694 1695 return (sMatch.indexOf(sSearch) == 0); 1696 }, 1697 1698 /** 1699 * Check to see if the the str ends with the suffix. 1700 * The comparison is case sensitive. 1701 * @static 1702 * @param {String} str The string to check. 1703 * @param {String} suffix The suffix to find. 1704 * @return {Boolean} if the str ends with the suffix 1705 * return true, otherwise false. 1706 */ 1707 endsWith: function( str, suffix ) { 1708 1709 if (str == null || suffix == null) { 1710 return str == null && suffix == null; 1711 } 1712 1713 if (suffix.length > str.length) { 1714 return false; 1715 } 1716 1717 // ensure we are dealing with the string form of this object 1718 str = str.toString(); 1719 suffix = suffix.toString(); 1720 1721 return (str.lastIndexOf(suffix) == (str.length - suffix.length)); 1722 }, 1723 1724 /** 1725 * Check to see if the the str contains the searchStr. 1726 * The comparison is case sensitive. 1727 * @static 1728 * @param {String} str The string to check. 1729 * @param {String} searchStr The prefix to find. 1730 * @return {Boolean} if the str ends with the suffix 1731 * return true, otherwise false. 1732 */ 1733 contains: function( str, searchStr ) { 1734 1735 if (str == null || searchStr == null) { 1736 return false; 1737 } 1738 1739 // ensure we are dealing with the string form of this object 1740 str = str.toString(); 1741 searchStr = searchStr.toString(); 1742 1743 return (str.indexOf(searchStr) >= 0); 1744 } 1745 } 1746}; 1747 1748// shortcut 1749_g.String = _g.shared.String; 1750 1751/* 1752 * ADOBE CONFIDENTIAL 1753 * 1754 * Copyright 2012 Adobe Systems Incorporated 1755 * All Rights Reserved. 1756 *
1757 * NOTICE: All information contained herein is, and remains 1758 * the property of Adobe Systems Incorporated and its suppliers, 1759 * if any. The intellectual and technical concepts contained 1760 * herein are proprietary to Adobe Systems Incorporated and its 1761 * suppliers and may be covered by U.S. and Foreign Patents, 1762 * patents in process, and are protected by trade secret or copyright law. 1763 * Dissemination of this information or reproduction of this material 1764 * is strictly forbidden unless prior written permission is obtained 1765 * from Adobe Systems Incorporated. 1766 * 1767 */ 1768 1769/** 1770 * @class _g.shared.ClientSidePersistence 1771 * The _g.shared.ClientSidePersistence is a class providing method to persist a map of pairs (key/value). 1772 * @constructor 1773 * Creates a new ClientSidePersistence object. 1774 */ 1775_g.shared.ClientSidePersistence = function(cfg) { 1776 var session = { 1777 /** 1778 * @cfg {String} PERSISTENCE_NAME 1779 * Persistence global key name 1780 * @final 1781 * @private 1782 */ 1783 PERSISTENCE_NAME: _g.shared.ClientSidePersistence.decoratePersistenceName("ClientSidePersistence"), 1784 1785 /** 1786 * @cfg {Object} config 1787 * Default configuration of ClientSidePersistence 1788 */ 1789 config: {}, 1790 1791 /** 1792 * @property {Object} cache 1793 * Client side persistence cache object 1794 * @private 1795 */ 1796 cache: null, 1797 1798 /** 1799 * Returns current ClientSidePersistence mode 1800 * @return {Object} Current ClientSidePersistence mode (see {@link #config}) 1801 */ 1802 getMode: function() { 1803 return this.config.mode; 1804 }, 1805 1806 /** 1807 * Returns window object used by ClientSidePersistence 1808 * @return {Object} window object used by ClientSidePersistence 1809 */ 1810 getWindow: function() { 1811 return this.config['window'] || _g.shared.Util.getTopWindow(); 1812 }, 1813 1814 /** 1815 * Prints actual ClientSidePersistence content restricted to specified container name (if specified) and to used mode 1816 * @private 1817 * @return 1818 */ 1819 debug: function() { 1820 if (console) { 1821 var map = this.getMap(); 1822 var debugInfo = "[ClientSidePersistence -> mode=" + this.getMode().name + ", container=" + (this.config.container || '') + "]\n"; 1823 var count = 0; 1824 var containerRE = new RegExp('^' + this.config.container + '/'); 1825 1826 for (var idx = 0, keys = Object.keys(map).sort(), last = null; idx < keys.length; idx++) { 1827 var key = keys[idx]; 1828 1829 if (this.config.container && (typeof(key) == 'string') && !key.match(containerRE)) { 1830 continue; 1831 } 1832 1833 var value = map[key]; 1834 debugInfo += "-[" + ++count + "]->
1834 '" + key.replace(containerRE, '') + "' = '" + decodeURIComponent(value) + "'\n"; 1835 } 1836 1837 if (!count) { 1838 debugInfo += "(container is empty)"; 1839 } 1840 1841 console.log(debugInfo); 1842 } 1843 }, 1844 1845 /** 1846 * Returns user provided key with container name (if it's specified) 1847 * @param {String} key 1848 * @private 1849 * @return {String} user provided key with container name 1850 */ 1851 keyName: function(key) { 1852 return (this.config.container ? (this.config.container + '/') : '') + key; 1853 }, 1854 1855 /** 1856 * Returns the list of all the keys contained into the persistence 1857 * @return {String[]} list of the keys 1858 */ 1859 getKeys: function() { 1860 var map = this.getMap(); 1861 var keys = []; 1862 if( map ) { 1863 for ( var k in map ) { 1864 if ( this.config.container ) { 1865 if (k.indexOf(this.config.container + '/') == 0 ) { 1866 var key = k.substring( this.config.container.length + 1 ); 1867 keys.push(key); 1868 } 1869 } else { 1870 keys.push(k); 1871 } 1872 } 1873 1874 } 1875 return keys; 1876 }, 1877 1878 /** 1879 * Returns the value of the given key. 1880 * @param {String} key 1881 * @return {String} value of a given key 1882 */ 1883 get: function(key) { 1884 var value = this.getMap()[this.keyName(key)]; 1885 return value ? decodeURIComponent(value) : value; 1886 }, 1887 1888 /** 1889 * Sets the value of the given key. 1890 * @param {String} key 1891 * @param {String} value 1892 */ 1893 set: function(key, value) { 1894 key = (typeof key === 'string') ? key.replace(/:=/g, '') : ''; 1895 var eventData = {'key' : key}; 1896 key = this.keyName(key); 1897 1898 if (!key.length) { 1899 return; 1900 } 1901 1902 var result = []; 1903 var map = this.getMap(); 1904 eventData.action = map[key] ? "update": "set"; 1905 1906 if (value) { 1907 map[key] = encodeURIComponent(value); 1908 } else { 1909 eventData.action = "remove"; 1910 delete map[key]; 1911 } 1912 1913 for (var entry in map) { 1914 result.push(entry + ':=' + map[entry]); 1915 } 1916 1917 this.cache = map; 1918 this.write(result.join('|')); 1919 1920 _g.$.extend(eventData, { 1921 'value': value, 1922 'mode': this.getMode().name, 1923 'container': this.config.container 1924 }); 1925 1926 _g.$(_g.shared.ClientSidePersistence).trigger(_g.shared.ClientSidePersistence.EVENT_NAME, eventData); 1927 }, 1928 1929 /** 1930 * Returns object containing a map of key/value pairs 1931 * @private 1932 * @return {Object} map of key/value pairs 1933 */ 1934 getMap: function() { 1935 if (!this.cache || !this.config.useCache) { 1936 var data = this.read().split('|'); 1937 var result = {}; 1938 1939 for (var idx = 0; idx < data.length; idx++) { 1940 var chunks = data[idx].split(':='); 1941 var key = chunks[0]; 1942 1943 if (key && key.length) { 1944 result[key] = chunks[1] || ''; 1945 } 1946 } 1947 1948 this.cache = result; 1949 } 1950 1951 return this.cache; 1952 }, 1953 1954 /** 1955 * Removes key from the persistence 1956 * @param {String} key 1957 * @return 1958 */ 1959 remove: function(key) { 1960 this.set(key); 1961 }, 1962 1963 /** 1964 * Clears the whole content of persistence object 1965 * @return 1966 */ 1967 clearMap: function() { 1968 this.write(); 1969 }, 1970 1971 /** 1972 * Reads the whole content of persistence object 1973 * @private 1974 * @return {String} content of persistence object 1975 */ 1976 read: function() { 1977 return this.config.mode.read(this) || ''; 1978 }, 1979 1980 /** 1981 * Stores user provided data in persistence object 1982 * @param {String} data 1983 * @private 1984 * @return 1985 */ 1986 write: function(data) { 1987 this.config.mode.write(this, data || ''); 1988 } 1989 }; 1990 1991 /* applies user provided config on top of default configuration */ 1992 _g.$.extend(session.config, _g.shared.ClientSidePersistence.getDefaultConfig(), cfg); 1993 1994 if (session.config.useContainer === false) { 1995 session.config.container = null; 1996 } 1997 1998 /* check if sessionStorage is supported and switch to localStorage otherwise */ 1999 var useFallback; 2000 var testItem = 'test-' + Math.random(); 2001 2002 if (session.config.mode === _g.shared.ClientSidePersistence.MODE_SESSION) { 2003 useFallback = false;
2004 2005 try { 2006 window.sessionStorage.setItem(testItem, testItem); 2007 window.sessionStorage.removeItem(testItem); 2008 } catch (error) { 2009 useFallback = true; 2010 } 2011 2012 if (useFallback) { 2013 session.config.mode = _g.shared.ClientSidePersistence.MODE_LOCAL; 2014 } 2015 } 2016 2017 /* check if localStorage is supported and switch to window.name otherwise */ 2018 if (session.config.mode === _g.shared.ClientSidePersistence.MODE_LOCAL) { 2019 useFallback = false; 2020 2021 try { 2022 window.localStorage.setItem(testItem, testItem); 2023 window.localStorage.removeItem(testItem); 2024 } catch (error) { 2025 useFallback = true; 2026 } 2027 2028 if (useFallback) { 2029 session.config.mode = _g.shared.ClientSidePersistence.MODE_WINDOW; 2030 } 2031 } 2032 2033 return session; 2034}; 2035 2036/** 2037 * @cfg {String} EVENT_NAME 2038 * Event name triggered while setting/updating key in ClientSidePersistence 2039 * @final 2040 * @private 2041 */ 2042_g.shared.ClientSidePersistence.EVENT_NAME = 'ClientSidePersistence'; 2043 2044/** 2045 * window.sessionStorage implementation for ClientSidePersistence 2046 */ 2047_g.shared.ClientSidePersistence.MODE_SESSION = { 2048 /** 2049 * @property {String} name 2050 * Name of MODE_SESSION storage implementation 2051 */ 2052 name: 'session', 2053 2054 /** 2055 * Reads the whole content of persistence object (using window.sessionStorage) 2056 * @param {ClientSidePersistence} self 2057 * @return content of persistence object 2058 */ 2059 read: function(self) { 2060 return self.getWindow().sessionStorage.getItem(self.PERSISTENCE_NAME); 2061 }, 2062 2063 /** 2064 * Stores user provided data in persistence object (using window.sessionStorage) 2065 * @param {ClientSidePersistence} self 2066 * @param {String} value 2067 * @return 2068 */ 2069 write: function(self, value) { 2070 if (Granite.OptOutUtil.isOptedOut()) return; 2071 try { 2072 self.getWindow().sessionStorage.setItem(self.PERSISTENCE_NAME, value); 2073 } catch(error) { 2074 //could not deal with the setItem 2075 return; 2076 } 2077 } 2078}; 2079 2080/** 2081 * window.localStorage implementation for ClientSidePersistence 2082 */ 2083_g.shared.ClientSidePersistence.MODE_LOCAL = { 2084 /** 2085 * @property {String} name 2086 * Name of MODE_LOCAL storage implementation 2087 */ 2088 name: 'local', 2089 2090 /** 2091 * Reads the whole content of persistence object (using window.localStorage) 2092 * @param {ClientSidePersistence} self 2093 * @return content of persistence object 2094 */ 2095 read: function(self) { 2096 return self.getWindow().localStorage.getItem(self.PERSISTENCE_NAME); 2097 }, 2098 2099 /** 2100 * Stores user provided data in persistence object (using window.localStorage) 2101 * @param {ClientSidePersistence} self 2102 * @param {String} value 2103 * @return 2104 */ 2105 write: function(self, value) { 2106 if (Granite.OptOutUtil.isOptedOut()) return; 2107 try { 2108 self.getWindow().localStorage.setItem(self.PERSISTENCE_NAME, value); 2109 } catch(error) { 2110 //could not deal with the setItem 2111 return; 2112 } 2113 } 2114}; 2115 2116_g.shared.ClientSidePersistence.decoratePersistenceName = function(name) { 2117 return name; 2118}; 2119 2120/** 2121 * window.name implementation for ClientSidePersistence 2122 */ 2123_g.shared.ClientSidePersistence.MODE_WINDOW = { 2124 /** 2125 * @property {String} name 2126 * Name of MODE_WINDOW storage implementation 2127 */ 2128 'name': 'window', 2129 2130 /** 2131 * Reads the whole content of persistence object (using window.name) 2132 * @param {ClientSidePersistence} self 2133 * @return content of persistence object 2134 */ 2135 read: function(self) { 2136 return self.getWindow().name; 2137 }, 2138 2139 /** 2140 * Stores user provided data in persistence object (using window.name) 2141 * @param {ClientSidePersistence} self 2142 * @param {String} value 2143 * @return 2144 */ 2145 write: function(self, value) { 2146 if (Granite.OptOutUtil.isOptedOut()) return; 2147 self.getWindow().name = value; 2148 } 2149}; 2150 2151/** 2152 * document.cookie implementation for ClientSidePersistence 2153 */ 2154_g.shared.ClientSidePersistence.MODE_COOKIE = { 2155 /** 2156 * @property {String} COOKIE_NAME 2157 * Cookie key name used by MODE_COOKIE persistence mode 2158 */ 2159 COOKIE_NAME: _g.shared.ClientSidePersistence.decoratePersistenceName("SessionPersistence"), 2160 2161 /** 2162 * @property {String} name 2163 * Name of MODE_COOKIE storage implementation 2164 */ 2165 name: 'cookie', 2166 2167 /** 2168 * Reads the whole content of persistence object (using document.cookie) 2169 * @param {ClientSidePersistence} self 2170 * @return content of persistence object 2171 */ 2172 read: function(self) { 2173 return _g.shared.ClientSidePersistence.CookieHelper.read(this.COOKIE_NAME); 2174 }, 2175 2176 /** 2177 * Stores or clears user provided data in persistence object (using document.cookie) 2178 * @param {ClientSidePersistence} self 2179 * @param {String} value (optional) 2180 * @return 2181 */ 2182 write: function(self, value) { 2183 if (Granite.OptOutUtil.isOptedOut() && !Granite.OptOutUtil.maySetCookie(this.COOKIE_NAME)) return; 2184 if (!value) { 2185 _g.shared.ClientSidePersistence.CookieHelper.erase(this.COOKIE_NAME); 2186 } else { 2187 _g.shared.ClientSidePersistence.CookieHelper.set(this.COOKIE_NAME, value, 365 /* days */); 2188 } 2189 } 2190}; 2191 2192/* 2193 * ClientSidePersistence default config 2194 */ 2195_g.shared.ClientSidePersistence.getDefaultConfig = function() { 2196 return { 2197 /** 2198 * @property {Object} window 2199 * Defines which window object should be used by ClientSidePersistence 2200 */ 2201 window: _g.shared.Util.getTopWindow(), 2202 2203 /** 2204 * @property {Boolean} useCache 2205 * Determines if ClientSidePersistence should use internal
2205cache 2206 */ 2207 useCache: false, 2208 2209 /** 2210 * @property {String} container 2211 * Container name where key/values will be stored (by default it's null) 2212 */ 2213 container: null, 2214 2215 /** 2216 * @property {Object} mode 2217 * Defines which mode should be used (available modes are {@link _g.shared.ClientSidePersistence.MODE_SESSION MODE_SESSION}, 2218 * {@link _g.shared.ClientSidePersistence.MODE_LOCAL MODE_LOCAL}, {@link _g.shared.ClientSidePersistence.MODE_WINDOW MODE_WINDOW} 2219 * and {@link _g.shared.ClientSidePersistence.MODE_COOKIE MODE_COOKIE}) 2220 */ 2221 mode: _g.shared.ClientSidePersistence.MODE_LOCAL 2222 }; 2223}; 2224 2225/** 2226 * Cookie helper class. 2227 * @class _g.shared.ClientSidePersistence.CookieHelper 2228 * @singleton 2229 */ 2230_g.shared.ClientSidePersistence.CookieHelper = { 2231 /** 2232 * Sets a cookie. 2233 * @param {String} name 2234 * @param {String} value 2235 * @param {Number} days 2236 */ 2237 set: function(name, value, days) { 2238 var expires = ""; 2239 if (days) { 2240 var date = new Date(); 2241 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 2242 expires = "; expires=" + date.toGMTString(); 2243 } 2244 if (value) { 2245 value = encodeURIComponent(value); 2246 } 2247 document.cookie = name + "=" + value + expires + "; path=/"; 2248 }, 2249 2250 /** 2251 * Returns the value of the cookie of the given name. 2252 * @param {String} name 2253 * @return {String} value of a given name (can be null) 2254 */ 2255 read: function(name) { 2256 var nameEQ = name + "="; 2257 var ca = document.cookie.split(';'); 2258 for (var i = 0; i < ca.length; i++) { 2259 var c = ca[i]; 2260 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 2261 if (c.indexOf(nameEQ) == 0) { 2262 var value = c.substring(nameEQ.length, c.length); 2263 return value ? decodeURIComponent(value) : null; 2264 } 2265 } 2266 return null; 2267 }, 2268 2269 /** 2270 * Removes the cookie of the given name. 2271 * @param {String} name 2272 */
2273 erase: function(name) { 2274 _g.shared.ClientSidePersistence.CookieHelper.set(name, "", -1); 2275 } 2276}; 2277 2278/* 2279 * Clears client side persistence using all implemented modes 2280 */ 2281_g.shared.ClientSidePersistence.clearAllMaps = function() { 2282 var modes = [ 2283 _g.shared.ClientSidePersistence.MODE_COOKIE, 2284 _g.shared.ClientSidePersistence.MODE_LOCAL, 2285 _g.shared.ClientSidePersistence.MODE_SESSION, 2286 _g.shared.ClientSidePersistence.MODE_WINDOW 2287 ]; 2288 2289 _g.$.each(modes, function(id, mode) { 2290 var persistence = new _g.shared.ClientSidePersistence({'mode': mode}); 2291 persistence.clearMap(); 2292 }); 2293}; 2294 2295/* 2296 * ADOBE CONFIDENTIAL 2297 * 2298 * Copyright 2012 Adobe Systems Incorporated 2299 * All Rights Reserved. 2300 * 2301 * NOTICE: All information contained herein is, and remains 2302 * the property of Adobe Systems Incorporated and its suppliers, 2303 * if any. The intellectual and technical concepts contained 2304 * herein are proprietary to Adobe Systems Incorporated and its 2305 * suppliers and may be covered by U.S. and Foreign Patents, 2306 * patents in process, and are protected by trade secret or copyright law. 2307 * Dissemination of this information or reproduction of this material 2308 * is strictly forbidden unless prior written permission is obtained 2309 * from Adobe Systems Incorporated. 2310 * 2311 */ 2312 2313//------------------------------------------------------------------------------ 2314// Initialize the Granite shared library 2315 2316//todo: user language (not yet available) 2317//_g.I18n.init({locale: _g.User.getLanguage()}); 2318_g.I18n.init(); 2319 2320/* 2321 * Copyright 1997-2010 Day Management AG 2322 * Barfuesserplatz 6, 4001 Basel, Switzerland 2323 * All Rights Reserved. 2324 * 2325 * This software is the confidential and proprietary information of 2326 * Day Management AG, ("Confidential Information"). You shall not 2327 * disclose such Confidential Information and shall use it only in 2328 * accordance with the terms of the license agreement you entered into 2329 * with Day. 2330 */ 2331 2332 2333/* 2334 * Copyright 1997-2010 Day Management AG 2335 * Barfuesserplatz 6, 4001 Basel, Switzerland 2336 * All Rights Reserved. 2337 * 2338 * This software is the confidential and proprietary information of 2339 * Day Management AG, ("Confidential Information"). You shall not 2340 * disclose such Confidential Information and shall use it only in 2341 * accordance with the terms of the license agreement you entered into 2342 * with Day. 2343 */ 2344 2345/** 2346 * The <code>CQ</code> library contains all CQ component classes and utilities.
2347 * @static 2348 */ 2349window.CQ = window.CQ || {}; 2350 2351// map CQ.shared to Granite shared 2352CQ.shared = _g.shared; 2353 2354// shortcuts 2355CQ.Sling = CQ.shared.Sling; 2356CQ.I18n = CQ.shared.I18n; 2357 2358// map constants for portlet support 2359G_XHR_HOOK = typeof CQ_XHR_HOOK != "undefined" ? CQ_XHR_HOOK : undefined; 2360G_RELOAD_HOOK = typeof CQ_RELOAD_HOOK != "undefined" ? CQ_RELOAD_HOOK : undefined; 2361G_IS_HOOKED = typeof CQ_IS_HOOKED != "undefined" ? CQ_IS_HOOKED : undefined; 2362G_CONTENT_PATH = typeof CQ_CONTENT_PATH != "undefined" ? CQ_CONTENT_PATH : undefined; 2363 2364/** 2365 * ADOBE CONFIDENTIAL 2366 * 2367 * Copyright 2011 Adobe Systems Incorporated 2368 * All Rights Reserved. 2369 * 2370 * NOTICE: All information contained herein is, and remains 2371 * the property of Adobe Systems Incorporated and its suppliers, 2372 * if any. The intellectual and technical concepts contained 2373 * herein are proprietary to Adobe Systems Incorporated and its 2374 * suppliers and may be covered by U.S. and Foreign Patents, 2375 * patents in process, and are protected by trade secret or copyright law. 2376 * Dissemination of this information or reproduction of this material 2377 * is strictly forbidden unless prior written permission is obtained 2378 * from Adobe Systems Incorporated. 2379 * 2380 */ 2381 2382/** 2383 * A helper class providing a set of form related utilities.
2384 * @static 2385 * @singleton 2386 * @class CQ.shared.Form 2387 */ 2388CQ.shared.Form = function() { 2389 2390 /** 2391 * Returns an associative array mapping ids to label nodes. 2392 * @private 2393 * @return {Object} For instance: 2394 * { 2395 * id1: labelNode1, 2396 * id2: labelNode2, 2397 * ... 2398 * } 2399 */ 2400 var getDocumentLabelMap = function() { 2401 var contentFrame = parent.frames["ContentFrame"], 2402 doc = contentFrame !== undefined ? contentFrame.contentDocument : document; 2403 2404 var labelMap = new Object(); 2405 var labelNodes = doc.getElementsByTagName("label"); 2406 for (var i = 0; i < labelNodes.length; i++) { 2407 var forId = labelNodes[i].htmlFor; // buggy IE can't handle getAttribute("for") 2408 if (forId) { 2409 labelMap[forId] = labelNodes[i]; 2410 } 2411 } 2412 return labelMap; 2413 }; 2414 2415 /** 2416 * Given a <label> node (perhaps one containing <input> or <select> children), return the text 2417 * content (excluding any <input> or <select> content). 2418 * @private 2419 * @return {String} The text content of all non-<input> and non-<select> descendants. 2420 */ 2421 var getLabelNodeTextContent = function(node) { 2422 var text = ""; 2423 var walkTree = function(node) { 2424 if (node.nodeType == 3) { // text node 2425 text += node.nodeValue; 2426 } 2427 if (node.nodeName.toLowerCase() == "select" 2428 || node.nodeName.toLowerCase() == "input" 2429 || node.nodeName.toLowerCase() == "textarea" 2430 || node.nodeName.toLowerCase() == "button") { 2431 // don't walk into fields if they're children of the label 2432 return; 2433 } 2434 for (var i = 0; node.childNodes && i < node.childNodes.length; i++) { 2435 walkTree(node.childNodes[i]); 2436 } 2437 }; 2438 walkTree(node); 2439 return text; 2440 }; 2441 2442 /** 2443 * Given an indexed id, return the id for the parent section (the id with the index stripped off). 2444 * @private 2445 */ 2446 var getSectionIdForIndexedId = function(id) { 2447 return id.replace(/-\d+$/, ""); 2448 }; 2449 2450 /** 2451 * <p>Return the label text (as a <code>String</code>) for a particular <code>id</code>. When a label 2452 * can't be found, return the id itself as a fall-back.</p> 2453 * <p>Note: Public callers can ignore the <code>documentLabelMap</code> parameter (it's used internally 2454 * as a caching mechanism).</p> 2455 * @param {String} id The id which the target <code><label></code> refers to. 2456 * @return {String} The label text. 2457 */ 2458 var getLabelForId = function(id, documentLabelMap) { 2459 if (!documentLabelMap) { 2460 documentLabelMap = getDocumentLabelMap(); 2461 } 2462 2463 if (documentLabelMap[id]) { 2464 return getLabelNodeTextContent(documentLabelMap[id]); 2465 } 2466 return null; 2467 }; 2468 2469 /** 2470 * Locate the default values for the given node. Supported nodes 2471 * include, <code>input</code>, <code>textarea</code>, <code>option</code>. 2472 * 2473 * @private 2474 * @param {HTMLElement} node The element which to locate the default value for. 2475 * @return {String} the default value for the given node. 2476 */ 2477 var getDefaultValue = function(node) { 2478 var defaultValue; 2479 var nodeName = node.nodeName.toLowerCase(); 2480 var nodeType = hasAttribute(node, "type") ? node.getAttribute("type") : undefined; 2481 2482 if (nodeName == "input") { 2483 if (nodeType == "radio" || nodeType == "checkbox") { 2484 if (hasAttribute(node, "checked")) { 2485 defaultValue = node.getAttribute("value"); 2486 } 2487 } else if (node.type == "text") { 2488 defaultValue = node.defaultValue; 2489 // support elements like hidden, reset, submit 2490 } else { 2491 defaultValue = node.value; 2492 } 2493 } else if (nodeName == "textarea") { 2494 defaultValue = node.value; 2495 } else if (nodeName == "option" && hasAttribute(node, "selected")) { 2496 defaultValue = node.getAttribute("value"); 2497 } 2498 2499 return defaultValue; 2500 }; 2501 2502 /** 2503 * Helper function to get around IE7 not supporting hasAttribute. 2504 * @private 2505 * @param {HTMLElement} el the html element 2506 * @param {String} attr the attribute to test for. 2507 */ 2508 var hasAttribute = function(el, attr) { 2509 if (el == null) { 2510 return false;
2511 } 2512 2513 // IE8 issue with attributes being not null but empty string 2514 return ($CQ(el).attr(attr) != undefined); 2515 }; 2516 2517 return { 2518 2519 /** 2520 * Searches an array for an object with a particular property of a particular value. 2521 * @return {Object} the first object which matches, or null if no objects match. 2522 */ 2523 searchArray: function(arr, testProperty, testValue) { 2524 for (var i = 0; i < arr.length; i++) { 2525 if (arr[i][testProperty] && arr[i][testProperty] == testValue) { 2526 return arr[i]; 2527 } 2528 } 2529 return null; 2530 }, 2531 2532 /** 2533 * <p>Return the label text for an <code><input></code> or <code><select></code>. When a 2534 * label can't be found, the element's name attribute is used as a fall-back.</p> 2535 * <p>Note: Public callers can ignore the <code>documentLabelMap</code> parameter (it's used internally 2536 * as a caching mechanism).</p> 2537 * @param {HTMLElement} fieldNode The <code><input></code>, <code><select></code> or 2538 * <code><textArea></code> node. 2539 * @return {String} The label text. 2540 */ 2541 getLabelForField: function(fieldNode, documentLabelMap) { 2542 if (!documentLabelMap) { 2543 documentLabelMap = getDocumentLabelMap(); 2544 } 2545 2546 var id = fieldNode.getAttribute("id"); 2547 if (id && documentLabelMap[id]) { 2548 return getLabelNodeTextContent(documentLabelMap[id]); 2549 } 2550 2551 var parent = fieldNode.parentNode; 2552 while (parent) { 2553 if (parent.nodeName.toLowerCase() == "label") { 2554 return getLabelNodeTextContent(parent); 2555 } 2556 parent = parent.parentNode; 2557 } 2558 2559 // No label found; we'll have to live with the name: 2560 return fieldNode.getAttribute("name"); 2561 }, 2562 2563 /** 2564 * Get a list of fields in the document. 2565 * @return {Array} Each object in the array represents a field. Each field contains: 2566 * <div class="mdetail-params"><ul) 2567 * <li><code>text</code> : String<div class="sub-desc">The label to display (usually the field's caption).</div></li> 2568 * <li><code>value</code> : String<div class="sub-desc">The name of the field.</div></li> 2569 * <li><code>enumeration</code> : Array|null<div class="sub-desc">For enumerated fields, a nested array of text/value pairs.</div></li> 2570 * </ul></div> 2571 */ 2572 getFields: function() { 2573 var contentFrame = parent.frames["ContentFrame"], 2574 doc = contentFrame !== undefined ? contentFrame.contentDocument : document, 2575 documentLabelMap = getDocumentLabelMap(); 2576 2577 var fields = []; 2578 2579 var visitNamedNode = function(node, inLocalNode, selector) { 2580 var name = node.getAttribute("name"); 2581 var nodeType = node.nodeName.toLowerCase(); 2582 var field; 2583 2584 if (nodeType == "input" || nodeType == "textarea") { 2585 var controlType = hasAttribute(node, "type") ? node.getAttribute("type").toLowerCase() : "text"; 2586 if (controlType == "button" || controlType == "submit" || controlType == "reset") { 2587 return; 2588 } 2589 2590 // Fetch (or create) the field record: 2591 // 2592 field = CQ.shared.Form.searchArray(fields, "value", name); 2593 if (!field) { 2594 fields.push({ 2595 "text": CQ.shared.Form.getLabelForField(node, documentLabelMap), 2596 "value": name, // for Selection.setOptions() 2597 "name": name, // for everyone else 2598 "enumeration": undefined, 2599 "local": inLocalNode, 2600 "selector": selector, 2601 "type": nodeType, 2602 "defaultValue": getDefaultValue(node), 2603 "node": node 2604 }); 2605 field = fields[fields.length-1]; 2606 } 2607 2608 // See if we're an enumeration. Note that Sidekick-authored checkboxes are always 2609 // enumerations, even when they appear singly. 2610 // 2611 if (controlType == "radio" || (field.local && controlType == "checkbox")) { 2612 if (!field.enumeration) { 2613 // This is the first one we've found of this group; promote the label to the 2614 // section label 2615 var inputId = node.getAttribute("id"); 2616 if (inputId) { 2617 var sectionId = getSectionIdForIndexedId(inputId); 2618 var sectionLabel = getLabelForId(sectionId, documentLabelMap); 2619 field.text = (sectionLabel ? sectionLabel : name); 2620 } else { 2621 field.text = name; 2622 } 2623 field.enumeration = []; 2624 } 2625 field.enumeration.push({ 2626 "text": CQ.shared.Form.getLabelForField(node, documentLabelMap), 2627 "value": node.getAttribute("value"), 2628 "defaultValue": getDefaultValue(node), 2629 "node": node 2630 }); 2631 } 2632 } else if (nodeType == "select") { 2633 // Create the field record: 2634 // 2635 fields.push({ 2636 "text": CQ.shared.Form.getLabelForField(node, documentLabelMap), 2637 "value": name, // for Selection.setOptions() 2638 "name": name, // for everyone else 2639 "enumeration": [], 2640 "local": inLocalNode, 2641 "type": nodeType, 2642 "selector": selector, 2643 "defaultValue": undefined, // defaultValues are on the options, not select element 2644 "node": node 2645 }); 2646 field = fields[fields.length-1]; 2647 2648 // Add the options to the field's enumeration: 2649 // 2650 var optionNodes = node.getElementsByTagName("option"); 2651 for (var i = 0; i < optionNodes.length; i++) { 2652 field.enumeration.push({ 2653 "text": optionNodes[i].innerHTML, 2654 "value": optionNodes[i].getAttribute("value"), 2655 "defaultValue": getDefaultValue(optionNodes[i]), 2656 "node": optionNodes[i] 2657 }); 2658 } 2659 } 2660 }; 2661 2662 var walkTree = function(node, inLocalNode, selector) { 2663 if (node.nodeName.toLowerCase() == "div" && $CQ(node).children('.form_row').length > 0) { 2664 inLocalNode = true; 2665 selector = $CQ(node).attr('class').replace(/\s/g,'\.'); 2666 } 2667 2668 if (node.getAttribute && node.getAttribute("name")) { 2669 visitNamedNode(node, inLocalNode, selector); 2670 } 2671 2672 for (var i = 0; node.childNodes && i < node.childNodes.length; i++) { 2673 var child = node.childNodes[i]; 2674 if (child.nodeType == 1) { // if element 2675 walkTree(child, inLocalNode, selector); 2676 } 2677 } 2678 }; 2679 2680 walkTree(doc, false, undefined); 2681 return fields; 2682 } 2683 } 2684}(); 2685 2686/* 2687 * Copyright 1997-2009 Day Management AG 2688 * Barfuesserplatz 6, 4001 Basel, Switzerland 2689 * All Rights Reserved. 2690 * 2691 * This software is the confidential and proprietary information of 2692 * Day Management AG, ("Confidential Information"). You shall not 2693 * disclose such Confidential Information and shall use it only in 2694 * accordance with the terms of the license agreement you entered into 2695 * with Day. 2696 */ 2697 2698/** 2699 * A helper class providing information about a CQ user. 2700 * @class CQ.shared.User 2701 * @singleton 2702 */ 2703CQ.shared.User = function(infoData) { 2704 return { 2705 /** 2706 * @property {Object} data 2707 * The user data. 2708 * @private 2709 */ 2710 data: null, 2711 2712 /** 2713 * @property {String} language 2714 * Resolved language read from preferences 2715 * @private 2716 */ 2717 language: null, 2718 2719 /** 2720 * @property {String} userPropsPath 2721 * The path where user properties may be requested from. 2722 * @private 2723 */ 2724 userPropsPath: null, 2725 2726 /** 2727 * Assembles the url to request the user properties from. 2728 * Apply default if no path has been set. 2729 * @private 2730 */ 2731 getUserPropsUrl: function() { 2732 if(!this.userPropsPath) { 2733 this.userPropsPath = CQ.shared.User.PROXY_URI; 2734 } 2735 return this.userPropsPath; 2736 }, 2737 2738 /** 2739 * Loads the data. 2740 * @private 2741 */ 2742 load: function() { 2743 var url = this.getUserPropsUrl(); 2744 url = CQ.shared.HTTP.noCaching(url); 2745 var response = CQ.shared.HTTP.get(url); 2746 if (CQ.shared.HTTP.isOk(response)) { 2747 this.data = CQ.shared.Util.eval(response); 2748 } 2749 }, 2750 2751 /** 2752 * Instantly initializes the user via a request to server or the provided infoData if it has not already been initialized. 2753 * @param {Object} infoData (optional) Data to initialize the user with 2754 * @param {Boolean} force (otpional) True to force initialization (in case of second initialization) 2755 * @return {Object} The initialization data 2756 */ 2757 init: function(infoData, force) { 2758 if( !this.initialized || force) { 2759 if (infoData) { 2760 // this is not used yet 2761 this.data = infoData; 2762 } else { 2763 this.load(); 2764 } 2765 this.initialized = true; 2766 } 2767 return this.data; 2768 }, 2769 2770 /** 2771 * Initializes the user via a request to server only when user is used for the first time. 2772 */ 2773 lazyInit: function() { 2774 this.lazyLoad = function() { 2775 this.load(); 2776 this.initialized = true; 2777 } 2778 }, 2779 2780 /** 2781 * Returns if the user has been initialized. 2782 * @return {Boolean} True if initialized, false otherwise. 2783 */ 2784 isInitialized: function() { 2785 return this.initialized; 2786 }, 2787 2788 /** 2789 * Returns the language selected by the user. 2790 * @return {String} The language 2791 */ 2792 getLanguage: function() { 2793 if( !this.isInitialized() && this.lazyLoad ) { 2794 this.lazyLoad.call(this); 2795 } 2796 2797 this.language = this.data && 2798 this.data["preferences"] && 2799 this.data["preferences"]["language"] ? 2800 this.data["preferences"]["language"] : 2801 "en"; 2802 return this.language; 2803 } 2804 2805 } 2806 2807}(); 2808 2809/** 2810 * The URI to retrieve the user info from (defaults to <code>"/libs/cq/security/userinfo.json"</code>). 2811 * @static 2812 * @final
vendor: 4,711 bytes, lines 2813-2926
2813 * @type String 2814 */ 2815CQ.shared.User.PROXY_URI = CQ.shared.HTTP.externalize("/libs/cq/security/userinfo" + CQ.shared.HTTP.EXTENSION_JSON); 2816/* 2817 * Copyright 1997-2010 Day Management AG 2818 * Barfuesserplatz 6, 4001 Basel, Switzerland 2819 * All Rights Reserved. 2820 * 2821 * This software is the confidential and proprietary information of 2822 * Day Management AG, ("Confidential Information"). You shall not 2823 * disclose such Confidential Information and shall use it only in 2824 * accordance with the terms of the license agreement you entered into 2825 * with Day. 2826 */ 2827//------------------------------------------------------------------------------ 2828// Initialize the CQ shared library 2829 2830CQ.shared.User.lazyInit(); 2831 2832CQ.shared.I18n.init({ 2833 locale: function() { return document.documentElement.lang || CQ.shared.User.getLanguage();}, 2834 urlPrefix: "/libs/cq/i18n/dict." 2835}); 2836 2837(function (global, factory) { 2838 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 2839 typeof define === 'function' && define.amd ? define('underscore', factory) : 2840 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { 2841 var current = global._; 2842 var exports = global._ = factory(); 2843 exports.noConflict = function () { global._ = current; return exports; }; 2844 }())); 2845}(this, (function () { 2846 // Underscore.js 1.13.5 2847 // https://underscorejs.org 2848 // (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors 2849 // Underscore may be freely distributed under the MIT license. 2850 2851 // Current version. 2852 var VERSION = '1.13.5'; 2853 2854 // Establish the root object, `window` (`self`) in the browser, `global` 2855 // on the server, or `this` in some virtual machines. We use `self` 2856 // instead of `window` for `WebWorker` support. 2857 var root = (typeof self == 'object' && self.self === self && self) || 2858 (typeof global == 'object' && global.global === global && global) || 2859 Function('return this')() || 2860 {}; 2861 2862 // Save bytes in the minified (but not gzipped) version: 2863 var ArrayProto = Array.prototype, ObjProto = Object.prototype; 2864 var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; 2865 2866 // Create quick reference variables for speed access to core prototypes. 2867 var push = ArrayProto.push, 2868 slice = ArrayProto.slice, 2869 toString = ObjProto.toString, 2870 hasOwnProperty = ObjProto.hasOwnProperty; 2871 2872 // Modern feature detection. 2873 var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', 2874 supportsDataView = typeof DataView !== 'undefined'; 2875 2876 // All **ECMAScript 5+** native function implementations that we hope to use 2877 // are declared here. 2878 var nativeIsArray = Array.isArray, 2879 nativeKeys = Object.keys, 2880 nativeCreate = Object.create, 2881 nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; 2882 2883 // Create references to these builtin functions because we override them. 2884 var _isNaN = isNaN, 2885 _isFinite = isFinite; 2886 2887 // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. 2888 var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); 2889 var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', 2890 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; 2891 2892 // The largest integer that can be represented exactly. 2893 var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; 2894 2895 // Some functions take a variable number of arguments, or a few expected 2896 // arguments at the beginning and then a variable number of values to operate 2897 // on. This helper accumulates all remaining arguments past the functionâs 2898 // argument length (or an explicit `startIndex`), into an array that becomes 2899 // the last argument. Similar to ES6âs "rest parameter". 2900 function restArguments(func, startIndex) { 2901 startIndex = startIndex == null ? func.length - 1 : +startIndex; 2902 return function() { 2903 var length = Math.max(arguments.length - startIndex, 0), 2904 rest = Array(length), 2905 index = 0; 2906 for (; index < length; index++) { 2907 rest[index] = arguments[index + startIndex]; 2908 } 2909 switch (startIndex) { 2910 case 0: return func.call(this, rest); 2911 case 1: return func.call(this, arguments[0], rest); 2912 case 2: return func.call(this, arguments[0], arguments[1], rest); 2913 } 2914 var args = Array(startIndex + 1); 2915 for (index = 0; index < startIndex; index++) { 2916 args[index] = arguments[index]; 2917 } 2918 args[startIndex] = rest; 2919 return func.apply(this, args); 2920 }; 2921 } 2922 2923 // Is a given variable an object? 2924 function isObject(obj) { 2925 var type = typeof obj; 2926 return type === 'function' || (type === 'object' && !!obj)
vendor: 5,142 bytes, lines 2926-3088
2926; 2927 } 2928 2929 // Is a given value equal to null? 2930 function isNull(obj) { 2931 return obj === null; 2932 } 2933 2934 // Is a given variable undefined? 2935 function isUndefined(obj) { 2936 return obj === void 0; 2937 } 2938 2939 // Is a given value a boolean? 2940 function isBoolean(obj) { 2941 return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; 2942 } 2943 2944 // Is a given value a DOM element? 2945 function isElement(obj) { 2946 return !!(obj && obj.nodeType === 1); 2947 } 2948 2949 // Internal function for creating a `toString`-based type tester. 2950 function tagTester(name) { 2951 var tag = '[object ' + name + ']'; 2952 return function(obj) { 2953 return toString.call(obj) === tag; 2954 }; 2955 } 2956 2957 var isString = tagTester('String'); 2958 2959 var isNumber = tagTester('Number'); 2960 2961 var isDate = tagTester('Date'); 2962 2963 var isRegExp = tagTester('RegExp'); 2964 2965 var isError = tagTester('Error'); 2966 2967 var isSymbol = tagTester('Symbol'); 2968 2969 var isArrayBuffer = tagTester('ArrayBuffer'); 2970 2971 var isFunction = tagTester('Function'); 2972 2973 // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old 2974 // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). 2975 var nodelist = root.document && root.document.childNodes; 2976 if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { 2977 isFunction = function(obj) { 2978 return typeof obj == 'function' || false; 2979 }; 2980 } 2981 2982 var isFunction$1 = isFunction; 2983 2984 var hasObjectTag = tagTester('Object'); 2985 2986 // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. 2987 // In IE 11, the most common among them, this problem also applies to 2988 // `Map`, `WeakMap` and `Set`. 2989 var hasStringTagBug = ( 2990 supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8))) 2991 ), 2992 isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map)); 2993 2994 var isDataView = tagTester('DataView'); 2995 2996 // In IE 10 - Edge 13, we need a different heuristic 2997 // to determine whether an object is a `DataView`. 2998 function ie10IsDataView(obj) { 2999 return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer); 3000 } 3001 3002 var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView); 3003 3004 // Is a given value an array? 3005 // Delegates to ECMA5's native `Array.isArray`. 3006 var isArray = nativeIsArray || tagTester('Array'); 3007 3008 // Internal function to check whether `key` is an own property name of `obj`. 3009 function has$1(obj, key) { 3010 return obj != null && hasOwnProperty.call(obj, key); 3011 } 3012 3013 var isArguments = tagTester('Arguments'); 3014 3015 // Define a fallback version of the method in browsers (ahem, IE < 9), where 3016 // there isn't any inspectable "Arguments" type. 3017 (function() { 3018 if (!isArguments(arguments)) { 3019 isArguments = function(obj) { 3020 return has$1(obj, 'callee'); 3021 }; 3022 } 3023 }()); 3024 3025 var isArguments$1 = isArguments; 3026 3027 // Is a given object a finite number? 3028 function isFinite$1(obj) { 3029 return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); 3030 } 3031 3032 // Is the given value `NaN`? 3033 function isNaN$1(obj) { 3034 return isNumber(obj) && _isNaN(obj); 3035 } 3036 3037 // Predicate-generating function. Often useful outside of Underscore. 3038 function constant(value) { 3039 return function() { 3040 return value; 3041 }; 3042 } 3043 3044 // Common internal logic for `isArrayLike` and `isBufferLike`. 3045 function createSizePropertyCheck(getSizeProperty) { 3046 return function(collection) { 3047 var sizeProperty = getSizeProperty(collection); 3048 return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; 3049 } 3050 } 3051 3052 // Internal helper to generate a function to obtain property `key` from `obj`. 3053 function shallowProperty(key) { 3054 return function(obj) { 3055 return obj == null ? void 0 : obj[key]; 3056 }; 3057 } 3058 3059 // Internal helper to obtain the `byteLength` property of an object. 3060 var getByteLength = shallowProperty('byteLength'); 3061 3062 // Internal helper to determine whether we should spend extensive checks against 3063 // `ArrayBuffer` et al. 3064 var isBufferLike = createSizePropertyCheck(getByteLength); 3065 3066 // Is a given value a typed array? 3067 var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; 3068 function isTypedArray(obj) { 3069 // `ArrayBuffer.isView` is the most future-proof, so use it when available. 3070 // Otherwise, fall back on the above regular expression. 3071 return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : 3072 isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); 3073 } 3074 3075 var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); 3076 3077 // Internal helper to obtain the `length` property of an object. 3078 var getLength = shallowProperty('length'); 3079 3080 // Internal helper to create a simple lookup structure. 3081 // `collectNonEnumProps` used to depend on `_.contains`, but this led to 3082 // circular imports. `emulatedSet` is a one-off solution that only works for 3083 // arrays of strings. 3084 function emulatedSet(keys) { 3085 var hash = {}; 3086 for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; 3087 return { 3088 contains: function(key) { return hash[key]
3088 === true; }, 3089 push: function(key) { 3090 hash[key] = true; 3091 return keys.push(key); 3092 } 3093 }; 3094 } 3095 3096 // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't 3097 // be iterated by `for key in ...` and thus missed. Extends `keys` in place if 3098 // needed. 3099 function collectNonEnumProps(obj, keys) { 3100 keys = emulatedSet(keys); 3101 var nonEnumIdx = nonEnumerableProps.length; 3102 var constructor = obj.constructor; 3103 var proto = (isFunction$1(constructor) && constructor.prototype)
vendor: 40,901 bytes, lines 3103-4279
3103 || ObjProto; 3104 3105 // Constructor is a special case. 3106 var prop = 'constructor'; 3107 if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop); 3108 3109 while (nonEnumIdx--) { 3110 prop = nonEnumerableProps[nonEnumIdx]; 3111 if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { 3112 keys.push(prop); 3113 } 3114 } 3115 } 3116 3117 // Retrieve the names of an object's own properties. 3118 // Delegates to **ECMAScript 5**'s native `Object.keys`. 3119 function keys(obj) { 3120 if (!isObject(obj)) return []; 3121 if (nativeKeys) return nativeKeys(obj); 3122 var keys = []; 3123 for (var key in obj) if (has$1(obj, key)) keys.push(key); 3124 // Ahem, IE < 9. 3125 if (hasEnumBug) collectNonEnumProps(obj, keys); 3126 return keys; 3127 } 3128 3129 // Is a given array, string, or object empty? 3130 // An "empty" object has no enumerable own-properties. 3131 function isEmpty(obj) { 3132 if (obj == null) return true; 3133 // Skip the more expensive `toString`-based type checks if `obj` has no 3134 // `.length`. 3135 var length = getLength(obj); 3136 if (typeof length == 'number' && ( 3137 isArray(obj) || isString(obj) || isArguments$1(obj) 3138 )) return length === 0; 3139 return getLength(keys(obj)) === 0; 3140 } 3141 3142 // Returns whether an object has a given set of `key:value` pairs. 3143 function isMatch(object, attrs) { 3144 var _keys = keys(attrs), length = _keys.length; 3145 if (object == null) return !length; 3146 var obj = Object(object); 3147 for (var i = 0; i < length; i++) { 3148 var key = _keys[i]; 3149 if (attrs[key] !== obj[key] || !(key in obj)) return false; 3150 } 3151 return true; 3152 } 3153 3154 // If Underscore is called as a function, it returns a wrapped object that can 3155 // be used OO-style. This wrapper holds altered versions of all functions added 3156 // through `_.mixin`. Wrapped objects may be chained. 3157 function _$1(obj) { 3158 if (obj instanceof _$1) return obj; 3159 if (!(this instanceof _$1)) return new _$1(obj); 3160 this._wrapped = obj; 3161 } 3162 3163 _$1.VERSION = VERSION; 3164 3165 // Extracts the result from a wrapped and chained object. 3166 _$1.prototype.value = function() { 3167 return this._wrapped; 3168 }; 3169 3170 // Provide unwrapping proxies for some methods used in engine operations 3171 // such as arithmetic and JSON stringification. 3172 _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value; 3173 3174 _$1.prototype.toString = function() { 3175 return String(this._wrapped); 3176 }; 3177 3178 // Internal function to wrap or shallow-copy an ArrayBuffer, 3179 // typed array or DataView to a new view, reusing the buffer. 3180 function toBufferView(bufferSource) { 3181 return new Uint8Array( 3182 bufferSource.buffer || bufferSource, 3183 bufferSource.byteOffset || 0, 3184 getByteLength(bufferSource) 3185 ); 3186 } 3187 3188 // We use this string twice, so give it a name for minification. 3189 var tagDataView = '[object DataView]'; 3190 3191 // Internal recursive comparison function for `_.isEqual`. 3192 function eq(a, b, aStack, bStack) { 3193 // Identical objects are equal. `0 === -0`, but they aren't identical. 3194 // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). 3195 if (a === b) return a !== 0 || 1 / a === 1 / b; 3196 // `null` or `undefined` only equal to itself (strict comparison). 3197 if (a == null || b == null) return false; 3198 // `NaN`s are equivalent, but non-reflexive. 3199 if (a !== a) return b !== b; 3200 // Exhaust primitive checks 3201 var type = typeof a; 3202 if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; 3203 return deepEq(a, b, aStack, bStack); 3204 } 3205 3206 // Internal recursive comparison function for `_.isEqual`. 3207 function deepEq(a, b, aStack, bStack) { 3208 // Unwrap any wrapped objects. 3209 if (a instanceof _$1) a = a._wrapped; 3210 if (b instanceof _$1) b = b._wrapped; 3211 // Compare `[[Class]]` names. 3212 var className = toString.call(a); 3213 if (className !== toString.call(b)) return false; 3214 // Work around a bug in IE 10 - Edge 13. 3215 if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { 3216 if (!isDataView$1(b)) return false; 3217 className = tagDataView; 3218 } 3219 switch (className) { 3220 // These types are compared by value. 3221 case '[object RegExp]': 3222 // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') 3223 case '[object String]': 3224 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is 3225 // equivalent to `new String("5")`. 3226 return '' + a === '' + b; 3227 case '[object Number]': 3228 // `NaN`s are equivalent, but non-reflexive. 3229 // Object(NaN) is equivalent to NaN. 3230 if (+a !== +a) return +b !== +b; 3231 // An `egal` comparison is performed for other numeric values. 3232 return +a === 0 ? 1 / +a === 1 / b : +a === +b; 3233 case '[object Date]': 3234 case '[object Boolean]': 3235 // Coerce dates and booleans to numeric primitive values. Dates are compared by their 3236 // millisecond representations. Note that invalid dates with millisecond representations 3237 // of `NaN` are not equivalent. 3238 return +a === +b; 3239 case '[object Symbol]': 3240 return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); 3241 case '[object ArrayBuffer]': 3242 case tagDataView: 3243 // Coerce to typed array so we can fall through. 3244 return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); 3245 } 3246 3247 var areArrays = className === '[object Array]'; 3248 if (!areArrays && isTypedArray$1(a)) { 3249 var byteLength = getByteLength(a); 3250 if (byteLength !== getByteLength(b)) return false; 3251 if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; 3252 areArrays = true; 3253 } 3254 if (!areArrays) { 3255 if (typeof a != 'object' || typeof b != 'object') return false; 3256 3257 // Objects with different constructors are not equivalent, but `Object`s or `Array`s 3258 // from different frames are. 3259 var aCtor = a.constructor, bCtor = b.constructor; 3260 if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && 3261 isFunction$1(bCtor) && bCtor instanceof bCtor) 3262 && ('constructor' in a && 'constructor' in b)) { 3263 return false; 3264 } 3265 } 3266 // Assume equality for cyclic structures. The algorithm for detecting cyclic 3267 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. 3268 3269 // Initializing stack of traversed objects. 3270 // It's done here since we only need them for objects and arrays comparison. 3271 aStack = aStack || []; 3272 bStack = bStack || []; 3273 var length = aStack.length; 3274 while (length--) { 3275 // Linear search. Performance is inversely proportional to the number of 3276 // unique nested structures. 3277 if (aStack[length] === a) return bStack[length] === b; 3278 } 3279 3280 // Add the first object to the stack of traversed objects. 3281 aStack.push(a); 3282 bStack.push(b); 3283 3284 // Recursively compare objects and arrays. 3285 if (areArrays) { 3286 // Compare array lengths to determine if a deep comparison is necessary. 3287 length = a.length; 3288 if (length !== b.length) return false; 3289 // Deep compare the contents, ignoring non-numeric properties. 3290 while (length--) { 3291 if (!eq(a[length], b[length], aStack, bStack)) return false; 3292 } 3293 } else { 3294 // Deep compare objects. 3295 var _keys = keys(a), key; 3296 length = _keys.length; 3297 // Ensure that both objects contain the same number of properties before comparing deep equality. 3298 if (keys(b).length !== length) return false; 3299 while (length--) { 3300 // Deep compare each member 3301 key = _keys[length]; 3302 if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false; 3303 } 3304 } 3305 // Remove the first object from the stack of traversed objects. 3306 aStack.pop(); 3307 bStack.pop(); 3308 return true; 3309 } 3310 3311 // Perform a deep comparison to check if two objects are equal. 3312 function isEqual(a, b) { 3313 return eq(a, b); 3314 } 3315 3316 // Retrieve all the enumerable property names of an object. 3317 function allKeys(obj) { 3318 if (!isObject(obj)) return []; 3319 var keys = []; 3320 for (var key in obj) keys.push(key); 3321 // Ahem, IE < 9. 3322 if (hasEnumBug) collectNonEnumProps(obj, keys); 3323 return keys; 3324 } 3325 3326 // Since the regular `Object.prototype.toString` type tests don't work for 3327 // some types in IE 11, we use a fingerprinting heuristic instead, based 3328 // on the methods. It's not great, but it's the best we got. 3329 // The fingerprint method lists are defined below. 3330 function ie11fingerprint(methods) { 3331 var length = getLength(methods); 3332 return function(obj) { 3333 if (obj == null) return false; 3334 // `Map`, `WeakMap` and `Set` have no enumerable keys. 3335 var keys = allKeys(obj); 3336 if (getLength(keys)) return false; 3337 for (var i = 0; i < length; i++) { 3338 if (!isFunction$1(obj[methods[i]])) return false; 3339 } 3340 // If we are testing against `WeakMap`, we need to ensure that 3341 // `obj` doesn't have a `forEach` method in order to distinguish 3342 // it from a regular `Map`. 3343 return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); 3344 }; 3345 } 3346 3347 // In the interest of compact minification, we write 3348 // each string in the fingerprints only once. 3349 var forEachName = 'forEach', 3350 hasName = 'has', 3351 commonInit = ['clear', 'delete'], 3352 mapTail = ['get', hasName, 'set']; 3353 3354 // `Map`, `WeakMap` and `Set` each have slightly different 3355 // combinations of the above sublists. 3356 var mapMethods = commonInit.concat(forEachName, mapTail), 3357 weakMapMethods = commonInit.concat(mapTail), 3358 setMethods = ['add'].concat(commonInit, forEachName, hasName); 3359 3360 var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); 3361 3362 var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); 3363 3364 var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); 3365 3366 var isWeakSet = tagTester('WeakSet'); 3367 3368 // Retrieve the values of an object's properties. 3369 function values(obj) { 3370 var _keys = keys(obj); 3371 var length = _keys.length; 3372 var values = Array(length); 3373 for (var i = 0; i < length; i++) { 3374 values[i] = obj[_keys[i]]; 3375 } 3376 return values; 3377 } 3378 3379 // Convert an object into a list of `[key, value]` pairs. 3380 // The opposite of `_.object` with one argument. 3381 function pairs(obj) { 3382 var _keys = keys(obj); 3383 var length = _keys.length; 3384 var pairs = Array(length); 3385 for (var i = 0; i < length; i++) { 3386 pairs[i] = [_keys[i], obj[_keys[i]]]; 3387 } 3388 return pairs; 3389 } 3390 3391 // Invert the keys and values of an object. The values must be serializable. 3392 function invert(obj) { 3393 var result = {}; 3394 var _keys = keys(obj); 3395 for (var i = 0, length = _keys.length; i < length; i++) { 3396 result[obj[_keys[i]]] = _keys[i]; 3397 } 3398 return result; 3399 } 3400 3401 // Return a sorted list of the function names available on the object. 3402 function functions(obj) { 3403 var names = []; 3404 for (var key in obj) { 3405 if (isFunction$1(obj[key])) names.push(key); 3406 } 3407 return names.sort(); 3408 } 3409 3410 // An internal function for creating assigner functions. 3411 function createAssigner(keysFunc, defaults) { 3412 return function(obj) { 3413 var length = arguments.length; 3414 if (defaults) obj = Object(obj); 3415 if (length < 2 || obj == null) return obj; 3416 for (var index = 1; index < length; index++) { 3417 var source = arguments[index], 3418 keys = keysFunc(source), 3419 l = keys.length; 3420 for (var i = 0; i < l; i++) { 3421 var key = keys[i]; 3422 if (!defaults || obj[key] === void 0) obj[key] = source[key]; 3423 } 3424 } 3425 return obj; 3426 }; 3427 } 3428 3429 // Extend a given object with all the properties in passed-in object(s). 3430 var extend = createAssigner(allKeys); 3431 3432 // Assigns a given object with all the own properties in the passed-in 3433 // object(s). 3434 // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) 3435 var extendOwn = createAssigner(keys); 3436 3437 // Fill in a given object with default properties. 3438 var defaults = createAssigner(allKeys, true); 3439 3440 // Create a naked function reference for surrogate-prototype-swapping. 3441 function ctor() { 3442 return function(){}; 3443 } 3444 3445 // An internal function for creating a new object that inherits from another. 3446 function baseCreate(prototype) { 3447 if (!isObject(prototype)) return {}; 3448 if (nativeCreate) return nativeCreate(prototype); 3449 var Ctor = ctor(); 3450 Ctor.prototype = prototype; 3451 var result = new Ctor; 3452 Ctor.prototype = null; 3453 return result; 3454 } 3455 3456 // Creates an object that inherits from the given prototype object. 3457 // If additional properties are provided then they will be added to the 3458 // created object. 3459 function create(prototype, props) { 3460 var result = baseCreate(prototype); 3461 if (props) extendOwn(result, props); 3462 return result; 3463 } 3464 3465 // Create a (shallow-cloned) duplicate of an object. 3466 function clone(obj) { 3467 if (!isObject(obj)) return obj; 3468 return isArray(obj) ? obj.slice() : extend({}, obj); 3469 } 3470 3471 // Invokes `interceptor` with the `obj` and then returns `obj`. 3472 // The primary purpose of this method is to "tap into" a method chain, in 3473 // order to perform operations on intermediate results within the chain. 3474 function tap(obj, interceptor) { 3475 interceptor(obj); 3476 return obj; 3477 } 3478 3479 // Normalize a (deep) property `path` to array. 3480 // Like `_.iteratee`, this function can be customized. 3481 function toPath$1(path) { 3482 return isArray(path) ? path : [path]; 3483 } 3484 _$1.toPath = toPath$1; 3485 3486 // Internal wrapper for `_.toPath` to enable minification. 3487 // Similar to `cb` for `_.iteratee`. 3488 function toPath(path) { 3489 return _$1.toPath(path); 3490 } 3491 3492 // Internal function to obtain a nested property in `obj` along `path`. 3493 function deepGet(obj, path) { 3494 var length = path.length; 3495 for (var i = 0; i < length; i++) { 3496 if (obj == null) return void 0; 3497 obj = obj[path[i]]; 3498 } 3499 return length ? obj : void 0; 3500 } 3501 3502 // Get the value of the (deep) property on `path` from `object`. 3503 // If any property in `path` does not exist or if the value is 3504 // `undefined`, return `defaultValue` instead. 3505 // The `path` is normalized through `_.toPath`. 3506 function get(object, path, defaultValue) { 3507 var value = deepGet(object, toPath(path)); 3508 return isUndefined(value) ? defaultValue : value; 3509 } 3510 3511 // Shortcut function for checking if an object has a given property directly on 3512 // itself (in other words, not on a prototype). Unlike the internal `has` 3513 // function, this public version can also traverse nested properties. 3514 function has(obj, path) { 3515 path = toPath(path); 3516 var length = path.length; 3517 for (var i = 0; i < length; i++) { 3518 var key = path[i]; 3519 if (!has$1(obj, key)) return false; 3520 obj = obj[key]; 3521 } 3522 return !!length; 3523 } 3524 3525 // Keep the identity function around for default iteratees. 3526 function identity(value) { 3527 return value; 3528 } 3529 3530 // Returns a predicate for checking whether an object has a given set of 3531 // `key:value` pairs. 3532 function matcher(attrs) { 3533 attrs = extendOwn({}, attrs); 3534 return function(obj) { 3535 return isMatch(obj, attrs); 3536 }; 3537 } 3538 3539 // Creates a function that, when passed an object, will traverse that objectâs 3540 // properties down the given `path`, specified as an array of keys or indices. 3541 function property(path) { 3542 path = toPath(path); 3543 return function(obj) { 3544 return deepGet(obj, path); 3545 }; 3546 } 3547 3548 // Internal function that returns an efficient (for current engines) version 3549 // of the passed-in callback, to be repeatedly applied in other Underscore 3550 // functions. 3551 function optimizeCb(func, context, argCount) { 3552 if (context === void 0) return func; 3553 switch (argCount == null ? 3 : argCount) { 3554 case 1: return function(value) { 3555 return func.call(context, value); 3556 }; 3557 // The 2-argument case is omitted because weâre not using it. 3558 case 3: return function(value, index, collection) { 3559 return func.call(context, value, index, collection); 3560 }; 3561 case 4: return function(accumulator, value, index, collection) { 3562 return func.call(context, accumulator, value, index, collection); 3563 }; 3564 } 3565 return function() { 3566 return func.apply(context, arguments); 3567 }; 3568 } 3569 3570 // An internal function to generate callbacks that can be applied to each 3571 // element in a collection, returning the desired result â either `_.identity`, 3572 // an arbitrary callback, a property matcher, or a property accessor. 3573 function baseIteratee(value, context, argCount) { 3574 if (value == null) return identity; 3575 if (isFunction$1(value)) return optimizeCb(value, context, argCount); 3576 if (isObject(value) && !isArray(value)) return matcher(value); 3577 return property(value); 3578 } 3579 3580 // External wrapper for our callback generator. Users may customize 3581 // `_.iteratee` if they want additional predicate/iteratee shorthand styles. 3582 // This abstraction hides the internal-only `argCount` argument. 3583 function iteratee(value, context) { 3584 return baseIteratee(value, context, Infinity); 3585 } 3586 _$1.iteratee = iteratee; 3587 3588 // The function we call internally to generate a callback. It invokes 3589 // `_.iteratee` if overridden, otherwise `baseIteratee`. 3590 function cb(value, context, argCount) { 3591 if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context); 3592 return baseIteratee(value, context, argCount); 3593 } 3594 3595 // Returns the results of applying the `iteratee` to each element of `obj`. 3596 // In contrast to `_.map` it returns an object. 3597 function mapObject(obj, iteratee, context) { 3598 iteratee = cb(iteratee, context); 3599 var _keys = keys(obj), 3600 length = _keys.length, 3601 results = {}; 3602 for (var index = 0; index < length; index++) { 3603 var currentKey = _keys[index]; 3604 results[currentKey] = iteratee(obj[currentKey], currentKey, obj); 3605 } 3606 return results; 3607 } 3608 3609 // Predicate-generating function. Often useful outside of Underscore. 3610 function noop(){} 3611 3612 // Generates a function for a given object that returns a given property. 3613 function propertyOf(obj) { 3614 if (obj == null) return noop; 3615 return function(path) { 3616 return get(obj, path); 3617 }; 3618 } 3619 3620 // Run a function **n** times. 3621 function times(n, iteratee, context) { 3622 var accum = Array(Math.max(0, n)); 3623 iteratee = optimizeCb(iteratee, context, 1); 3624 for (var i = 0; i < n; i++) accum[i] = iteratee(i); 3625 return accum; 3626 } 3627 3628 // Return a random integer between `min` and `max` (inclusive). 3629 function random(min, max) { 3630 if (max == null) { 3631 max = min; 3632 min = 0; 3633 } 3634 return min + Math.floor(Math.random() * (max - min + 1)); 3635 } 3636 3637 // A (possibly faster) way to get the current timestamp as an integer. 3638 var now = Date.now || function() { 3639 return new Date().getTime(); 3640 }; 3641 3642 // Internal helper to generate functions for escaping and unescaping strings 3643 // to/from HTML interpolation. 3644 function createEscaper(map) { 3645 var escaper = function(match) { 3646 return map[match]; 3647 }; 3648 // Regexes for identifying a key that needs to be escaped. 3649 var source = '(?:' + keys(map).join('|') + ')'; 3650 var testRegexp = RegExp(source); 3651 var replaceRegexp = RegExp(source, 'g'); 3652 return function(string) { 3653 string = string == null ? '' : '' + string; 3654 return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; 3655 }; 3656 } 3657 3658 // Internal list of HTML entities for escaping. 3659 var escapeMap = { 3660 '&': '&', 3661 '<': '<', 3662 '>': '>', 3663 '"': '"', 3664 "'": ''', 3665 '`': '`' 3666 }; 3667 3668 // Function for escaping strings to HTML interpolation. 3669 var _escape = createEscaper(escapeMap); 3670 3671 // Internal list of HTML entities for unescaping. 3672 var unescapeMap = invert(escapeMap); 3673 3674 // Function for unescaping strings from HTML interpolation. 3675 var _unescape = createEscaper(unescapeMap); 3676 3677 // By default, Underscore uses ERB-style template delimiters. Change the 3678 // following template settings to use alternative delimiters. 3679 var templateSettings = _$1.templateSettings = { 3680 evaluate: /<%([\s\S]+?)%>/g, 3681 interpolate: /<%=([\s\S]+?)%>/g, 3682 escape: /<%-([\s\S]+?)%>/g 3683 }; 3684 3685 // When customizing `_.templateSettings`, if you don't want to define an 3686 // interpolation, evaluation or escaping regex, we need one that is 3687 // guaranteed not to match. 3688 var noMatch = /(.)^/; 3689 3690 // Certain characters need to be escaped so that they can be put into a 3691 // string literal. 3692 var escapes = { 3693 "'": "'", 3694 '\\': '\\', 3695 '\r': 'r', 3696 '\n': 'n', 3697 '\u2028': 'u2028', 3698 '\u2029': 'u2029' 3699 }; 3700 3701 var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; 3702 3703 function escapeChar(match) { 3704 return '\\' + escapes[match]; 3705 } 3706 3707 // In order to prevent third-party code injection through 3708 // `_.templateSettings.variable`, we test it against the following regular 3709 // expression. It is intentionally a bit more liberal than just matching valid 3710 // identifiers, but still prevents possible loopholes through defaults or 3711 // destructuring assignment. 3712 var bareIdentifier = /^\s*(\w|\$)+\s*$/; 3713 3714 // JavaScript micro-templating, similar to John Resig's implementation. 3715 // Underscore templating handles arbitrary delimiters, preserves whitespace, 3716 // and correctly escapes quotes within interpolated code. 3717 // NB: `oldSettings` only exists for backwards compatibility. 3718 function template(text, settings, oldSettings) { 3719 if (!settings && oldSettings) settings = oldSettings; 3720 settings = defaults({}, settings, _$1.templateSettings); 3721 3722 // Combine delimiters into one regular expression via alternation. 3723 var matcher = RegExp([ 3724 (settings.escape || noMatch).source, 3725 (settings.interpolate || noMatch).source, 3726 (settings.evaluate || noMatch).source 3727 ].join('|') + '|$', 'g'); 3728 3729 // Compile the template source, escaping string literals appropriately. 3730 var index = 0; 3731 var source = "__p+='"; 3732 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { 3733 source += text.slice(index, offset).replace(escapeRegExp, escapeChar); 3734 index = offset + match.length; 3735 3736 if (escape) { 3737 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; 3738 } else if (interpolate) { 3739 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; 3740 } else if (evaluate) { 3741 source += "';\n" + evaluate + "\n__p+='"; 3742 } 3743 3744 // Adobe VMs need the match returned to produce the correct offset. 3745 return match; 3746 }); 3747 source += "';\n"; 3748 3749 var argument = settings.variable; 3750 if (argument) { 3751 // Insure against third-party code injection. (CVE-2021-23358) 3752 if (!bareIdentifier.test(argument)) throw new Error( 3753 'variable is not a bare identifier: ' + argument 3754 ); 3755 } else { 3756 // If a variable is not specified, place data values in local scope. 3757 source = 'with(obj||{}){\n' + source + '}\n'; 3758 argument = 'obj'; 3759 } 3760 3761 source = "var __t,__p='',__j=Array.prototype.join," + 3762 "print=function(){__p+=__j.call(arguments,'');};\n" + 3763 source + 'return __p;\n'; 3764 3765 var render; 3766 try { 3767 render = new Function(argument, '_', source); 3768 } catch (e) { 3769 e.source = source; 3770 throw e; 3771 } 3772 3773 var template = function(data) { 3774 return render.call(this, data, _$1); 3775 }; 3776 3777 // Provide the compiled source as a convenience for precompilation. 3778 template.source = 'function(' + argument + '){\n' + source + '}'; 3779 3780 return template; 3781 } 3782 3783 // Traverses the children of `obj` along `path`. If a child is a function, it 3784 // is invoked with its parent as context. Returns the value of the final 3785 // child, or `fallback` if any child is undefined. 3786 function result(obj, path, fallback) { 3787 path = toPath(path); 3788 var length = path.length; 3789 if (!length) { 3790 return isFunction$1(fallback) ? fallback.call(obj) : fallback; 3791 } 3792 for (var i = 0; i < length; i++) { 3793 var prop = obj == null ? void 0 : obj[path[i]]; 3794 if (prop === void 0) { 3795 prop = fallback; 3796 i = length; // Ensure we don't continue iterating. 3797 } 3798 obj = isFunction$1(prop) ? prop.call(obj) : prop; 3799 } 3800 return obj; 3801 } 3802 3803 // Generate a unique integer id (unique within the entire client session). 3804 // Useful for temporary DOM ids. 3805 var idCounter = 0; 3806 function uniqueId(prefix) { 3807 var id = ++idCounter + ''; 3808 return prefix ? prefix + id : id; 3809 } 3810 3811 // Start chaining a wrapped Underscore object. 3812 function chain(obj) { 3813 var instance = _$1(obj); 3814 instance._chain = true; 3815 return instance; 3816 } 3817 3818 // Internal function to execute `sourceFunc` bound to `context` with optional 3819 // `args`. Determines whether to execute a function as a constructor or as a 3820 // normal function. 3821 function executeBound(sourceFunc, boundFunc, context, callingContext, args) { 3822 if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); 3823 var self = baseCreate(sourceFunc.prototype); 3824 var result = sourceFunc.apply(self, args); 3825 if (isObject(result)) return result; 3826 return self; 3827 } 3828 3829 // Partially apply a function by creating a version that has had some of its 3830 // arguments pre-filled, without changing its dynamic `this` context. `_` acts 3831 // as a placeholder by default, allowing any combination of arguments to be 3832 // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. 3833 var partial = restArguments(function(func, boundArgs) { 3834 var placeholder = partial.placeholder; 3835 var bound = function() { 3836 var position = 0, length = boundArgs.length; 3837 var args = Array(length); 3838 for (var i = 0; i < length; i++) { 3839 args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; 3840 } 3841 while (position < arguments.length) args.push(arguments[position++]); 3842 return executeBound(func, bound, this, this, args); 3843 }; 3844 return bound; 3845 }); 3846 3847 partial.placeholder = _$1; 3848 3849 // Create a function bound to a given object (assigning `this`, and arguments, 3850 // optionally). 3851 var bind = restArguments(function(func, context, args) { 3852 if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); 3853 var bound = restArguments(function(callArgs) { 3854 return executeBound(func, bound, context, this, args.concat(callArgs)); 3855 }); 3856 return bound; 3857 }); 3858 3859 // Internal helper for collection methods to determine whether a collection 3860 // should be iterated as an array or as an object. 3861 // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength 3862 // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 3863 var isArrayLike = createSizePropertyCheck(getLength); 3864 3865 // Internal implementation of a recursive `flatten` function. 3866 function flatten$1(input, depth, strict, output) { 3867 output = output || []; 3868 if (!depth && depth !== 0) { 3869 depth = Infinity; 3870 } else if (depth <= 0) { 3871 return output.concat(input); 3872 } 3873 var idx = output.length; 3874 for (var i = 0, length = getLength(input); i < length; i++) { 3875 var value = input[i]; 3876 if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { 3877 // Flatten current level of array or arguments object. 3878 if (depth > 1) { 3879 flatten$1(value, depth - 1, strict, output); 3880 idx = output.length; 3881 } else { 3882 var j = 0, len = value.length; 3883 while (j < len) output[idx++] = value[j++]; 3884 } 3885 } else if (!strict) { 3886 output[idx++] = value; 3887 } 3888 } 3889 return output; 3890 } 3891 3892 // Bind a number of an object's methods to that object. Remaining arguments 3893 // are the method names to be bound. Useful for ensuring that all callbacks 3894 // defined on an object belong to it. 3895 var bindAll = restArguments(function(obj, keys) { 3896 keys = flatten$1(keys, false, false); 3897 var index = keys.length; 3898 if (index < 1) throw new Error('bindAll must be passed function names'); 3899 while (index--) { 3900 var key = keys[index]; 3901 obj[key] = bind(obj[key], obj); 3902 } 3903 return obj; 3904 }); 3905 3906 // Memoize an expensive function by storing its results. 3907 function memoize(func, hasher) { 3908 var memoize = function(key) { 3909 var cache = memoize.cache; 3910 var address = '' + (hasher ? hasher.apply(this, arguments) : key); 3911 if (!has$1(cache, address)) cache[address] = func.apply(this, arguments); 3912 return cache[address]; 3913 }; 3914 memoize.cache = {}; 3915 return memoize; 3916 } 3917 3918 // Delays a function for the given number of milliseconds, and then calls 3919 // it with the arguments supplied. 3920 var delay = restArguments(function(func, wait, args) { 3921 return setTimeout(function() { 3922 return func.apply(null, args); 3923 }, wait); 3924 }); 3925 3926 // Defers a function, scheduling it to run after the current call stack has 3927 // cleared. 3928 var defer = partial(delay, _$1, 1); 3929 3930 // Returns a function, that, when invoked, will only be triggered at most once 3931 // during a given window of time. Normally, the throttled function will run 3932 // as much as it can, without ever going more than once per `wait` duration; 3933 // but if you'd like to disable the execution on the leading edge, pass 3934 // `{leading: false}`. To disable execution on the trailing edge, ditto. 3935 function throttle(func, wait, options) { 3936 var timeout, context, args, result; 3937 var previous = 0; 3938 if (!options) options = {}; 3939 3940 var later = function() { 3941 previous = options.leading === false ? 0 : now(); 3942 timeout = null; 3943 result = func.apply(context, args); 3944 if (!timeout) context = args = null; 3945 }; 3946 3947 var throttled = function() { 3948 var _now = now(); 3949 if (!previous && options.leading === false) previous = _now; 3950 var remaining = wait - (_now - previous); 3951 context = this; 3952 args = arguments; 3953 if (remaining <= 0 || remaining > wait) { 3954 if (timeout) { 3955 clearTimeout(timeout); 3956 timeout = null; 3957 } 3958 previous = _now; 3959 result = func.apply(context, args); 3960 if (!timeout) context = args = null; 3961 } else if (!timeout && options.trailing !== false) { 3962 timeout = setTimeout(later, remaining); 3963 } 3964 return result; 3965 }; 3966 3967 throttled.cancel = function() { 3968 clearTimeout(timeout); 3969 previous = 0; 3970 timeout = context = args = null; 3971 }; 3972 3973 return throttled; 3974 } 3975 3976 // When a sequence of calls of the returned function ends, the argument 3977 // function is triggered. The end of a sequence is defined by the `wait` 3978 // parameter. If `immediate` is passed, the argument function will be 3979 // triggered at the beginning of the sequence instead of at the end. 3980 function debounce(func, wait, immediate) { 3981 var timeout, previous, args, result, context; 3982 3983 var later = function() { 3984 var passed = now() - previous; 3985 if (wait > passed) { 3986 timeout = setTimeout(later, wait - passed); 3987 } else { 3988 timeout = null; 3989 if (!immediate) result = func.apply(context, args); 3990 // This check is needed because `func` can recursively invoke `debounced`. 3991 if (!timeout) args = context = null; 3992 } 3993 }; 3994 3995 var debounced = restArguments(function(_args) { 3996 context = this; 3997 args = _args; 3998 previous = now(); 3999 if (!timeout) { 4000 timeout = setTimeout(later, wait); 4001 if (immediate) result = func.apply(context, args); 4002 } 4003 return result; 4004 }); 4005 4006 debounced.cancel = function() { 4007 clearTimeout(timeout); 4008 timeout = args = context = null; 4009 }; 4010 4011 return debounced; 4012 } 4013 4014 // Returns the first function passed as an argument to the second, 4015 // allowing you to adjust arguments, run code before and after, and 4016 // conditionally execute the original function. 4017 function wrap(func, wrapper) { 4018 return partial(wrapper, func); 4019 } 4020 4021 // Returns a negated version of the passed-in predicate. 4022 function negate(predicate) { 4023 return function() { 4024 return !predicate.apply(this, arguments); 4025 }; 4026 } 4027 4028 // Returns a function that is the composition of a list of functions, each 4029 // consuming the return value of the function that follows. 4030 function compose() { 4031 var args = arguments; 4032 var start = args.length - 1; 4033 return function() { 4034 var i = start; 4035 var result = args[start].apply(this, arguments); 4036 while (i--) result = args[i].call(this, result); 4037 return result; 4038 }; 4039 } 4040 4041 // Returns a function that will only be executed on and after the Nth call. 4042 function after(times, func) { 4043 return function() { 4044 if (--times < 1) { 4045 return func.apply(this, arguments); 4046 } 4047 }; 4048 } 4049 4050 // Returns a function that will only be executed up to (but not including) the 4051 // Nth call. 4052 function before(times, func) { 4053 var memo; 4054 return function() { 4055 if (--times > 0) { 4056 memo = func.apply(this, arguments); 4057 } 4058 if (times <= 1) func = null; 4059 return memo; 4060 }; 4061 } 4062 4063 // Returns a function that will be executed at most one time, no matter how 4064 // often you call it. Useful for lazy initialization. 4065 var once = partial(before, 2); 4066 4067 // Returns the first key on an object that passes a truth test. 4068 function findKey(obj, predicate, context) { 4069 predicate = cb(predicate, context); 4070 var _keys = keys(obj), key; 4071 for (var i = 0, length = _keys.length; i < length; i++) { 4072 key = _keys[i]; 4073 if (predicate(obj[key], key, obj)) return key; 4074 } 4075 } 4076 4077 // Internal function to generate `_.findIndex` and `_.findLastIndex`. 4078 function createPredicateIndexFinder(dir) { 4079 return function(array, predicate, context) { 4080 predicate = cb(predicate, context); 4081 var length = getLength(array); 4082 var index = dir > 0 ? 0 : length - 1; 4083 for (; index >= 0 && index < length; index += dir) { 4084 if (predicate(array[index], index, array)) return index; 4085 } 4086 return -1; 4087 }; 4088 } 4089 4090 // Returns the first index on an array-like that passes a truth test. 4091 var findIndex = createPredicateIndexFinder(1); 4092 4093 // Returns the last index on an array-like that passes a truth test. 4094 var findLastIndex = createPredicateIndexFinder(-1); 4095 4096 // Use a comparator function to figure out the smallest index at which 4097 // an object should be inserted so as to maintain order. Uses binary search. 4098 function sortedIndex(array, obj, iteratee, context) { 4099 iteratee = cb(iteratee, context, 1); 4100 var value = iteratee(obj); 4101 var low = 0, high = getLength(array); 4102 while (low < high) { 4103 var mid = Math.floor((low + high) / 2); 4104 if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; 4105 } 4106 return low; 4107 } 4108 4109 // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. 4110 function createIndexFinder(dir, predicateFind, sortedIndex) { 4111 return function(array, item, idx) { 4112 var i = 0, length = getLength(array); 4113 if (typeof idx == 'number') { 4114 if (dir > 0) { 4115 i = idx >= 0 ? idx : Math.max(idx + length, i); 4116 } else { 4117 length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; 4118 } 4119 } else if (sortedIndex && idx && length) { 4120 idx = sortedIndex(array, item); 4121 return array[idx] === item ? idx : -1; 4122 } 4123 if (item !== item) { 4124 idx = predicateFind(slice.call(array, i, length), isNaN$1); 4125 return idx >= 0 ? idx + i : -1; 4126 } 4127 for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { 4128 if (array[idx] === item) return idx; 4129 } 4130 return -1; 4131 }; 4132 } 4133 4134 // Return the position of the first occurrence of an item in an array, 4135 // or -1 if the item is not included in the array. 4136 // If the array is large and already in sort order, pass `true` 4137 // for **isSorted** to use binary search. 4138 var indexOf = createIndexFinder(1, findIndex, sortedIndex); 4139 4140 // Return the position of the last occurrence of an item in an array, 4141 // or -1 if the item is not included in the array. 4142 var lastIndexOf = createIndexFinder(-1, findLastIndex); 4143 4144 // Return the first value which passes a truth test. 4145 function find(obj, predicate, context) { 4146 var keyFinder = isArrayLike(obj) ? findIndex : findKey; 4147 var key = keyFinder(obj, predicate, context); 4148 if (key !== void 0 && key !== -1) return obj[key]; 4149 } 4150 4151 // Convenience version of a common use case of `_.find`: getting the first 4152 // object containing specific `key:value` pairs. 4153 function findWhere(obj, attrs) { 4154 return find(obj, matcher(attrs)); 4155 } 4156 4157 // The cornerstone for collection functions, an `each` 4158 // implementation, aka `forEach`. 4159 // Handles raw objects in addition to array-likes. Treats all 4160 // sparse array-likes as if they were dense. 4161 function each(obj, iteratee, context) { 4162 iteratee = optimizeCb(iteratee, context); 4163 var i, length; 4164 if (isArrayLike(obj)) { 4165 for (i = 0, length = obj.length; i < length; i++) { 4166 iteratee(obj[i], i, obj); 4167 } 4168 } else { 4169 var _keys = keys(obj); 4170 for (i = 0, length = _keys.length; i < length; i++) { 4171 iteratee(obj[_keys[i]], _keys[i], obj); 4172 } 4173 } 4174 return obj; 4175 } 4176 4177 // Return the results of applying the iteratee to each element. 4178 function map(obj, iteratee, context) { 4179 iteratee = cb(iteratee, context); 4180 var _keys = !isArrayLike(obj) && keys(obj), 4181 length = (_keys || obj).length, 4182 results = Array(length); 4183 for (var index = 0; index < length; index++) { 4184 var currentKey = _keys ? _keys[index] : index; 4185 results[index] = iteratee(obj[currentKey], currentKey, obj); 4186 } 4187 return results; 4188 } 4189 4190 // Internal helper to create a reducing function, iterating left or right. 4191 function createReduce(dir) { 4192 // Wrap code that reassigns argument variables in a separate function than 4193 // the one that accesses `arguments.length` to avoid a perf hit. (#1991) 4194 var reducer = function(obj, iteratee, memo, initial) { 4195 var _keys = !isArrayLike(obj) && keys(obj), 4196 length = (_keys || obj).length, 4197 index = dir > 0 ? 0 : length - 1; 4198 if (!initial) { 4199 memo = obj[_keys ? _keys[index] : index]; 4200 index += dir; 4201 } 4202 for (; index >= 0 && index < length; index += dir) { 4203 var currentKey = _keys ? _keys[index] : index; 4204 memo = iteratee(memo, obj[currentKey], currentKey, obj); 4205 } 4206 return memo; 4207 }; 4208 4209 return function(obj, iteratee, memo, context) { 4210 var initial = arguments.length >= 3; 4211 return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); 4212 }; 4213 } 4214 4215 // **Reduce** builds up a single result from a list of values, aka `inject`, 4216 // or `foldl`. 4217 var reduce = createReduce(1); 4218 4219 // The right-associative version of reduce, also known as `foldr`. 4220 var reduceRight = createReduce(-1); 4221 4222 // Return all the elements that pass a truth test. 4223 function filter(obj, predicate, context) { 4224 var results = []; 4225 predicate = cb(predicate, context); 4226 each(obj, function(value, index, list) { 4227 if (predicate(value, index, list)) results.push(value); 4228 }); 4229 return results; 4230 } 4231 4232 // Return all the elements for which a truth test fails. 4233 function reject(obj, predicate, context) { 4234 return filter(obj, negate(cb(predicate)), context); 4235 } 4236 4237 // Determine whether all of the elements pass a truth test. 4238 function every(obj, predicate, context) { 4239 predicate = cb(predicate, context); 4240 var _keys = !isArrayLike(obj) && keys(obj), 4241 length = (_keys || obj).length; 4242 for (var index = 0; index < length; index++) { 4243 var currentKey = _keys ? _keys[index] : index; 4244 if (!predicate(obj[currentKey], currentKey, obj)) return false; 4245 } 4246 return true; 4247 } 4248 4249 // Determine if at least one element in the object passes a truth test. 4250 function some(obj, predicate, context) { 4251 predicate = cb(predicate, context); 4252 var _keys = !isArrayLike(obj) && keys(obj), 4253 length = (_keys || obj).length; 4254 for (var index = 0; index < length; index++) { 4255 var currentKey = _keys ? _keys[index] : index; 4256 if (predicate(obj[currentKey], currentKey, obj)) return true; 4257 } 4258 return false; 4259 } 4260 4261 // Determine if the array or object contains a given item (using `===`). 4262 function contains(obj, item, fromIndex, guard) { 4263 if (!isArrayLike(obj)) obj = values(obj); 4264 if (typeof fromIndex != 'number' || guard) fromIndex = 0; 4265 return indexOf(obj, item, fromIndex) >= 0; 4266 } 4267 4268 // Invoke a method (with arguments) on every item in a collection. 4269 var invoke = restArguments(function(obj, path, args) { 4270 var contextPath, func; 4271 if (isFunction$1(path)) { 4272 func = path; 4273 } else { 4274 path = toPath(path); 4275 contextPath = path.slice(0, -1); 4276 path = path[path.length - 1]; 4277 } 4278 return map(obj, function(context) { 4279 var method = func;
vendor: 17,988 bytes, lines 4280-4878
4280 if (!method) { 4281 if (contextPath && contextPath.length) { 4282 context = deepGet(context, contextPath); 4283 } 4284 if (context == null) return void 0; 4285 method = context[path]; 4286 } 4287 return method == null ? method : method.apply(context, args); 4288 }); 4289 }); 4290 4291 // Convenience version of a common use case of `_.map`: fetching a property. 4292 function pluck(obj, key) { 4293 return map(obj, property(key)); 4294 } 4295 4296 // Convenience version of a common use case of `_.filter`: selecting only 4297 // objects containing specific `key:value` pairs. 4298 function where(obj, attrs) { 4299 return filter(obj, matcher(attrs)); 4300 } 4301 4302 // Return the maximum element (or element-based computation). 4303 function max(obj, iteratee, context) { 4304 var result = -Infinity, lastComputed = -Infinity, 4305 value, computed; 4306 if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { 4307 obj = isArrayLike(obj) ? obj : values(obj); 4308 for (var i = 0, length = obj.length; i < length; i++) { 4309 value = obj[i]; 4310 if (value != null && value > result) { 4311 result = value; 4312 } 4313 } 4314 } else { 4315 iteratee = cb(iteratee, context); 4316 each(obj, function(v, index, list) { 4317 computed = iteratee(v, index, list); 4318 if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { 4319 result = v; 4320 lastComputed = computed; 4321 } 4322 }); 4323 } 4324 return result; 4325 } 4326 4327 // Return the minimum element (or element-based computation). 4328 function min(obj, iteratee, context) { 4329 var result = Infinity, lastComputed = Infinity, 4330 value, computed; 4331 if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { 4332 obj = isArrayLike(obj) ? obj : values(obj); 4333 for (var i = 0, length = obj.length; i < length; i++) { 4334 value = obj[i]; 4335 if (value != null && value < result) { 4336 result = value; 4337 } 4338 } 4339 } else { 4340 iteratee = cb(iteratee, context); 4341 each(obj, function(v, index, list) { 4342 computed = iteratee(v, index, list); 4343 if (computed < lastComputed || (computed === Infinity && result === Infinity)) { 4344 result = v; 4345 lastComputed = computed; 4346 } 4347 }); 4348 } 4349 return result; 4350 } 4351 4352 // Safely create a real, live array from anything iterable. 4353 var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; 4354 function toArray(obj) { 4355 if (!obj) return []; 4356 if (isArray(obj)) return slice.call(obj); 4357 if (isString(obj)) { 4358 // Keep surrogate pair characters together. 4359 return obj.match(reStrSymbol); 4360 } 4361 if (isArrayLike(obj)) return map(obj, identity); 4362 return values(obj); 4363 } 4364 4365 // Sample **n** random values from a collection using the modern version of the 4366 // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/FisherâYates_shuffle). 4367 // If **n** is not specified, returns a single random element. 4368 // The internal `guard` argument allows it to work with `_.map`. 4369 function sample(obj, n, guard) { 4370 if (n == null || guard) { 4371 if (!isArrayLike(obj)) obj = values(obj); 4372 return obj[random(obj.length - 1)]; 4373 } 4374 var sample = toArray(obj); 4375 var length = getLength(sample); 4376 n = Math.max(Math.min(n, length), 0); 4377 var last = length - 1; 4378 for (var index = 0; index < n; index++) { 4379 var rand = random(index, last); 4380 var temp = sample[index]; 4381 sample[index] = sample[rand]; 4382 sample[rand] = temp; 4383 } 4384 return sample.slice(0, n); 4385 } 4386 4387 // Shuffle a collection. 4388 function shuffle(obj) { 4389 return sample(obj, Infinity); 4390 } 4391 4392 // Sort the object's values by a criterion produced by an iteratee. 4393 function sortBy(obj, iteratee, context) { 4394 var index = 0; 4395 iteratee = cb(iteratee, context); 4396 return pluck(map(obj, function(value, key, list) { 4397 return { 4398 value: value, 4399 index: index++, 4400 criteria: iteratee(value, key, list) 4401 }; 4402 }).sort(function(left, right) { 4403 var a = left.criteria; 4404 var b = right.criteria; 4405 if (a !== b) { 4406 if (a > b || a === void 0) return 1; 4407 if (a < b || b === void 0) return -1; 4408 } 4409 return left.index - right.index; 4410 }), 'value'); 4411 } 4412 4413 // An internal function used for aggregate "group by" operations. 4414 function group(behavior, partition) { 4415 return function(obj, iteratee, context) { 4416 var result = partition ? [[], []] : {}; 4417 iteratee = cb(iteratee, context); 4418 each(obj, function(value, index) { 4419 var key = iteratee(value, index, obj); 4420 behavior(result, value, key); 4421 }); 4422 return result; 4423 }; 4424 } 4425 4426 // Groups the object's values by a criterion. Pass either a string attribute 4427 // to group by, or a function that returns the criterion. 4428 var groupBy = group(function(result, value, key) { 4429 if (has$1(result, key)) result[key].push(value); else result[key] = [value]; 4430 }); 4431 4432 // Indexes the object's values by a criterion, similar to `_.groupBy`, but for 4433 // when you know that your index values will be unique. 4434 var indexBy = group(function(result, value, key) { 4435 result[key] = value; 4436 }); 4437 4438 // Counts instances of an object that group by a certain criterion. Pass 4439 // either a string attribute to count by, or a function that returns the 4440 // criterion. 4441 var countBy = group(function(result, value, key) { 4442 if (has$1(result, key)) result[key]++; else result[key] = 1; 4443 }); 4444 4445 // Split a collection into two arrays: one whose elements all pass the given 4446 // truth test, and one whose elements all do not pass the truth test. 4447 var partition = group(function(result, value, pass) { 4448 result[pass ? 0 : 1].push(value); 4449 }, true); 4450 4451 // Return the number of elements in a collection. 4452 function size(obj) { 4453 if (obj == null) return 0; 4454 return isArrayLike(obj) ? obj.length : keys(obj).length; 4455 } 4456 4457 // Internal `_.pick` helper function to determine whether `key` is an enumerable 4458 // property name of `obj`. 4459 function keyInObj(value, key, obj) { 4460 return key in obj; 4461 } 4462 4463 // Return a copy of the object only containing the allowed properties. 4464 var pick = restArguments(function(obj, keys) { 4465 var result = {}, iteratee = keys[0]; 4466 if (obj == null) return result; 4467 if (isFunction$1(iteratee)) { 4468 if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); 4469 keys = allKeys(obj); 4470 } else { 4471 iteratee = keyInObj; 4472 keys = flatten$1(keys, false, false); 4473 obj = Object(obj); 4474 } 4475 for (var i = 0, length = keys.length; i < length; i++) { 4476 var key = keys[i]; 4477 var value = obj[key]; 4478 if (iteratee(value, key, obj)) result[key] = value; 4479 } 4480 return result; 4481 }); 4482 4483 // Return a copy of the object without the disallowed properties. 4484 var omit = restArguments(function(obj, keys) { 4485 var iteratee = keys[0], context; 4486 if (isFunction$1(iteratee)) { 4487 iteratee = negate(iteratee); 4488 if (keys.length > 1) context = keys[1]; 4489 } else { 4490 keys = map(flatten$1(keys, false, false), String); 4491 iteratee = function(value, key) { 4492 return !contains(keys, key); 4493 }; 4494 } 4495 return pick(obj, iteratee, context); 4496 }); 4497 4498 // Returns everything but the last entry of the array. Especially useful on 4499 // the arguments object. Passing **n** will return all the values in 4500 // the array, excluding the last N. 4501 function initial(array, n, guard) { 4502 return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); 4503 } 4504 4505 // Get the first element of an array. Passing **n** will return the first N 4506 // values in the array. The **guard** check allows it to work with `_.map`. 4507 function first(array, n, guard) { 4508 if (array == null || array.length < 1) return n == null || guard ? void 0 : []; 4509 if (n == null || guard) return array[0]; 4510 return initial(array, array.length - n); 4511 } 4512 4513 // Returns everything but the first entry of the `array`. Especially useful on 4514 // the `arguments` object. Passing an **n** will return the rest N values in the 4515 // `array`. 4516 function rest(array, n, guard) { 4517 return slice.call(array, n == null || guard ? 1 : n); 4518 } 4519 4520 // Get the last element of an array. Passing **n** will return the last N 4521 // values in the array. 4522 function last(array, n, guard) { 4523 if (array == null || array.length < 1) return n == null || guard ? void 0 : []; 4524 if (n == null || guard) return array[array.length - 1]; 4525 return rest(array, Math.max(0, array.length - n)); 4526 } 4527 4528 // Trim out all falsy values from an array. 4529 function compact(array) { 4530 return filter(array, Boolean); 4531 } 4532 4533 // Flatten out an array, either recursively (by default), or up to `depth`. 4534 // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. 4535 function flatten(array, depth) { 4536 return flatten$1(array, depth, false); 4537 } 4538 4539 // Take the difference between one array and a number of other arrays. 4540 // Only the elements present in just the first array will remain. 4541 var difference = restArguments(function(array, rest) { 4542 rest = flatten$1(rest, true, true); 4543 return filter(array, function(value){ 4544 return !contains(rest, value); 4545 }); 4546 }); 4547 4548 // Return a version of the array that does not contain the specified value(s). 4549 var without = restArguments(function(array, otherArrays) { 4550 return difference(array, otherArrays); 4551 }); 4552 4553 // Produce a duplicate-free version of the array. If the array has already 4554 // been sorted, you have the option of using a faster algorithm. 4555 // The faster algorithm will not work with an iteratee if the iteratee 4556 // is not a one-to-one function, so providing an iteratee will disable 4557 // the faster algorithm. 4558 function uniq(array, isSorted, iteratee, context) { 4559 if (!isBoolean(isSorted)) { 4560 context = iteratee; 4561 iteratee = isSorted; 4562 isSorted = false; 4563 } 4564 if (iteratee != null) iteratee = cb(iteratee, context); 4565 var result = []; 4566 var seen = []; 4567 for (var i = 0, length = getLength(array); i < length; i++) { 4568 var value = array[i], 4569 computed = iteratee ? iteratee(value, i, array) : value; 4570 if (isSorted && !iteratee) { 4571 if (!i || seen !== computed) result.push(value); 4572 seen = computed; 4573 } else if (iteratee) { 4574 if (!contains(seen, computed)) { 4575 seen.push(computed); 4576 result.push(value); 4577 } 4578 } else if (!contains(result, value)) { 4579 result.push(value); 4580 } 4581 } 4582 return result; 4583 } 4584 4585 // Produce an array that contains the union: each distinct element from all of 4586 // the passed-in arrays. 4587 var union = restArguments(function(arrays) { 4588 return uniq(flatten$1(arrays, true, true)); 4589 }); 4590 4591 // Produce an array that contains every item shared between all the 4592 // passed-in arrays. 4593 function intersection(array) { 4594 var result = []; 4595 var argsLength = arguments.length; 4596 for (var i = 0, length = getLength(array); i < length; i++) { 4597 var item = array[i]; 4598 if (contains(result, item)) continue; 4599 var j; 4600 for (j = 1; j < argsLength; j++) { 4601 if (!contains(arguments[j], item)) break; 4602 } 4603 if (j === argsLength) result.push(item); 4604 } 4605 return result; 4606 } 4607 4608 // Complement of zip. Unzip accepts an array of arrays and groups 4609 // each array's elements on shared indices. 4610 function unzip(array) { 4611 var length = (array && max(array, getLength).length) || 0; 4612 var result = Array(length); 4613 4614 for (var index = 0; index < length; index++) { 4615 result[index] = pluck(array, index); 4616 } 4617 return result; 4618 } 4619 4620 // Zip together multiple lists into a single array -- elements that share 4621 // an index go together. 4622 var zip = restArguments(unzip); 4623 4624 // Converts lists into objects. Pass either a single array of `[key, value]` 4625 // pairs, or two parallel arrays of the same length -- one of keys, and one of 4626 // the corresponding values. Passing by pairs is the reverse of `_.pairs`. 4627 function object(list, values) { 4628 var result = {}; 4629 for (var i = 0, length = getLength(list); i < length; i++) { 4630 if (values) { 4631 result[list[i]] = values[i]; 4632 } else { 4633 result[list[i][0]] = list[i][1]; 4634 } 4635 } 4636 return result; 4637 } 4638 4639 // Generate an integer Array containing an arithmetic progression. A port of 4640 // the native Python `range()` function. See 4641 // [the Python documentation](https://docs.python.org/library/functions.html#range). 4642 function range(start, stop, step) { 4643 if (stop == null) { 4644 stop = start || 0; 4645 start = 0; 4646 } 4647 if (!step) { 4648 step = stop < start ? -1 : 1; 4649 } 4650 4651 var length = Math.max(Math.ceil((stop - start) / step), 0); 4652 var range = Array(length); 4653 4654 for (var idx = 0; idx < length; idx++, start += step) { 4655 range[idx] = start; 4656 } 4657 4658 return range; 4659 } 4660 4661 // Chunk a single array into multiple arrays, each containing `count` or fewer 4662 // items. 4663 function chunk(array, count) { 4664 if (count == null || count < 1) return []; 4665 var result = []; 4666 var i = 0, length = array.length; 4667 while (i < length) { 4668 result.push(slice.call(array, i, i += count)); 4669 } 4670 return result; 4671 } 4672 4673 // Helper function to continue chaining intermediate results. 4674 function chainResult(instance, obj) { 4675 return instance._chain ? _$1(obj).chain() : obj; 4676 } 4677 4678 // Add your own custom functions to the Underscore object. 4679 function mixin(obj) { 4680 each(functions(obj), function(name) { 4681 var func = _$1[name] = obj[name]; 4682 _$1.prototype[name] = function() { 4683 var args = [this._wrapped]; 4684 push.apply(args, arguments); 4685 return chainResult(this, func.apply(_$1, args)); 4686 }; 4687 }); 4688 return _$1; 4689 } 4690 4691 // Add all mutator `Array` functions to the wrapper. 4692 each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { 4693 var method = ArrayProto[name]; 4694 _$1.prototype[name] = function() { 4695 var obj = this._wrapped; 4696 if (obj != null) { 4697 method.apply(obj, arguments); 4698 if ((name === 'shift' || name === 'splice') && obj.length === 0) { 4699 delete obj[0]; 4700 } 4701 } 4702 return chainResult(this, obj); 4703 }; 4704 }); 4705 4706 // Add all accessor `Array` functions to the wrapper. 4707 each(['concat', 'join', 'slice'], function(name) { 4708 var method = ArrayProto[name]; 4709 _$1.prototype[name] = function() { 4710 var obj = this._wrapped; 4711 if (obj != null) obj = method.apply(obj, arguments); 4712 return chainResult(this, obj); 4713 }; 4714 }); 4715 4716 // Named Exports 4717 4718 var allExports = { 4719 __proto__: null, 4720 VERSION: VERSION, 4721 restArguments: restArguments, 4722 isObject: isObject, 4723 isNull: isNull, 4724 isUndefined: isUndefined, 4725 isBoolean: isBoolean, 4726 isElement: isElement, 4727 isString: isString, 4728 isNumber: isNumber, 4729 isDate: isDate, 4730 isRegExp: isRegExp, 4731 isError: isError, 4732 isSymbol: isSymbol, 4733 isArrayBuffer: isArrayBuffer, 4734 isDataView: isDataView$1, 4735 isArray: isArray, 4736 isFunction: isFunction$1, 4737 isArguments: isArguments$1, 4738 isFinite: isFinite$1, 4739 isNaN: isNaN$1, 4740 isTypedArray: isTypedArray$1, 4741 isEmpty: isEmpty, 4742 isMatch: isMatch, 4743 isEqual: isEqual, 4744 isMap: isMap, 4745 isWeakMap: isWeakMap, 4746 isSet: isSet, 4747 isWeakSet: isWeakSet, 4748 keys: keys, 4749 allKeys: allKeys, 4750 values: values, 4751 pairs: pairs, 4752 invert: invert, 4753 functions: functions, 4754 methods: functions, 4755 extend: extend, 4756 extendOwn: extendOwn, 4757 assign: extendOwn, 4758 defaults: defaults, 4759 create: create, 4760 clone: clone, 4761 tap: tap, 4762 get: get, 4763 has: has, 4764 mapObject: mapObject, 4765 identity: identity, 4766 constant: constant, 4767 noop: noop, 4768 toPath: toPath$1, 4769 property: property, 4770 propertyOf: propertyOf, 4771 matcher: matcher, 4772 matches: matcher, 4773 times: times, 4774 random: random, 4775 now: now, 4776 escape: _escape, 4777 unescape: _unescape, 4778 templateSettings: templateSettings, 4779 template: template, 4780 result: result, 4781 uniqueId: uniqueId, 4782 chain: chain, 4783 iteratee: iteratee, 4784 partial: partial, 4785 bind: bind, 4786 bindAll: bindAll, 4787 memoize: memoize, 4788 delay: delay, 4789 defer: defer, 4790 throttle: throttle, 4791 debounce: debounce, 4792 wrap: wrap, 4793 negate: negate, 4794 compose: compose, 4795 after: after, 4796 before: before, 4797 once: once, 4798 findKey: findKey, 4799 findIndex: findIndex, 4800 findLastIndex: findLastIndex, 4801 sortedIndex: sortedIndex, 4802 indexOf: indexOf, 4803 lastIndexOf: lastIndexOf, 4804 find: find, 4805 detect: find, 4806 findWhere: findWhere, 4807 each: each, 4808 forEach: each, 4809 map: map, 4810 collect: map, 4811 reduce: reduce, 4812 foldl: reduce, 4813 inject: reduce, 4814 reduceRight: reduceRight, 4815 foldr: reduceRight, 4816 filter: filter, 4817 select: filter, 4818 reject: reject, 4819 every: every, 4820 all: every, 4821 some: some, 4822 any: some, 4823 contains: contains, 4824 includes: contains, 4825 include: contains, 4826 invoke: invoke, 4827 pluck: pluck, 4828 where: where, 4829 max: max, 4830 min: min, 4831 shuffle: shuffle, 4832 sample: sample, 4833 sortBy: sortBy, 4834 groupBy: groupBy, 4835 indexBy: indexBy, 4836 countBy: countBy, 4837 partition: partition, 4838 toArray: toArray, 4839 size: size, 4840 pick: pick, 4841 omit: omit, 4842 first: first, 4843 head: first, 4844 take: first, 4845 initial: initial, 4846 last: last, 4847 rest: rest, 4848 tail: rest, 4849 drop: rest, 4850 compact: compact, 4851 flatten: flatten, 4852 without: without, 4853 uniq: uniq, 4854 unique: uniq, 4855 union: union, 4856 intersection: intersection, 4857 difference: difference, 4858 unzip: unzip, 4859 transpose: unzip, 4860 zip: zip, 4861 object: object, 4862 range: range, 4863 chunk: chunk, 4864 mixin: mixin, 4865 'default': _$1 4866 }; 4867 4868 // Default Export 4869 4870 // Add all of the Underscore functions to the wrapper object. 4871 var _ = mixin(allExports); 4872 // Legacy Node.js API. 4873 _._ = _; 4874 4875 return _; 4876 4877}))); 4878//# sourceMappingURL=underscore-umd.js.map
vendor: 12,290 bytes, lines 4879-5316
4879/**! 4880 4881 @license 4882 handlebars v4.7.8 4883 4884Copyright (C) 2011-2019 by Yehuda Katz 4885 4886Permission is hereby granted, free of charge, to any person obtaining a copy 4887of this software and associated documentation files (the "Software"), to deal 4888in the Software without restriction, including without limitation the rights 4889to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 4890copies of the Software, and to permit persons to whom the Software is 4891furnished to do so, subject to the following conditions: 4892 4893The above copyright notice and this permission notice shall be included in 4894all copies or substantial portions of the Software. 4895 4896THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4897IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 4898FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 4899AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 4900LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 4901OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 4902THE SOFTWARE. 4903 4904*/ 4905(function webpackUniversalModuleDefinition(root, factory) { 4906 if(typeof exports === 'object' && typeof module === 'object') 4907 module.exports = factory(); 4908 else if(typeof define === 'function' && define.amd) 4909 define([], factory); 4910 else if(typeof exports === 'object') 4911 exports["Handlebars"] = factory(); 4912 else 4913 root["Handlebars"] = factory(); 4914})(this, function() { 4915return /******/ (function(modules) { // webpackBootstrap 4916/******/ // The module cache 4917/******/ var installedModules = {}; 4918 4919/******/ // The require function 4920/******/ function __webpack_require__(moduleId) { 4921 4922/******/ // Check if module is in cache 4923/******/ if(installedModules[moduleId]) 4924/******/ return installedModules[moduleId].exports; 4925 4926/******/ // Create a new module (and put it into the cache) 4927/******/ var module = installedModules[moduleId] = { 4928/******/ exports: {}, 4929/******/ id: moduleId, 4930/******/ loaded: false 4931/******/ }; 4932 4933/******/ // Execute the module function 4934/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 4935 4936/******/ // Flag the module as loaded 4937/******/ module.loaded = true; 4938 4939/******/ // Return the exports of the module 4940/******/ return module.exports; 4941/******/ } 4942 4943 4944/******/ // expose the modules object (__webpack_modules__) 4945/******/ __webpack_require__.m = modules; 4946 4947/******/ // expose the module cache 4948/******/ __webpack_require__.c = installedModules; 4949 4950/******/ // __webpack_public_path__ 4951/******/ __webpack_require__.p = ""; 4952 4953/******/ // Load entry module and return exports 4954/******/ return __webpack_require__(0); 4955/******/ }) 4956/************************************************************************/ 4957/******/ ([ 4958/* 0 */ 4959/***/ (function(module, exports, __webpack_require__) { 4960 4961 'use strict'; 4962 4963 var _interopRequireDefault = __webpack_require__(1)['default']; 4964 4965 exports.__esModule = true; 4966 4967 var _handlebarsRuntime = __webpack_require__(2); 4968 4969 var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime); 4970 4971 // Compiler imports 4972 4973 var _handlebarsCompilerAst = __webpack_require__(84); 4974 4975 var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst); 4976 4977 var _handlebarsCompilerBase = __webpack_require__(85); 4978 4979 var _handlebarsCompilerCompiler = __webpack_require__(90); 4980 4981 var _handlebarsCompilerJavascriptCompiler = __webpack_require__(91); 4982 4983 var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler); 4984 4985 var _handlebarsCompilerVisitor = __webpack_require__(88); 4986 4987 var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor); 4988 4989 var _handlebarsNoConflict = __webpack_require__(83); 4990 4991 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); 4992 4993 var _create = _handlebarsRuntime2['default'].create; 4994 function create() { 4995 var hb = _create(); 4996 4997 hb.compile = function (input, options) { 4998 return _handlebarsCompilerCompiler.compile(input, options, hb); 4999 }; 5000 hb.precompile = function (input, options) { 5001 return _handlebarsCompilerCompiler.precompile(input, options, hb); 5002 }; 5003 5004 hb.AST = _handlebarsCompilerAst2['default']; 5005 hb.Compiler = _handlebarsCompilerCompiler.Compiler; 5006 hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default']; 5007 hb.Parser = _handlebarsCompilerBase.parser; 5008 hb.parse = _handlebarsCompilerBase.parse; 5009 hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing; 5010 5011 return hb; 5012 } 5013 5014 var inst = create(); 5015 inst.create = create; 5016 5017 _handlebarsNoConflict2['default'](inst); 5018 5019 inst.Visitor = _handlebarsCompilerVisitor2['default']; 5020 5021 inst['default'] = inst; 5022 5023 exports['default'] = inst; 5024 module.exports = exports['default']; 5025 5026/***/ }), 5027/* 1 */ 5028/***/ (function(module, exports) { 5029 5030 "use strict"; 5031 5032 exports["default"] = function (obj) { 5033 return obj && obj.__esModule ? obj : { 5034 "default": obj 5035 }; 5036 }; 5037 5038 exports.__esModule = true; 5039 5040/***/ }), 5041/* 2 */ 5042/***/ (function(module, exports, __webpack_require__) { 5043 5044 'use strict'; 5045 5046 var _interopRequireWildcard = __webpack_require__(3)['default']; 5047 5048 var _interopRequireDefault = __webpack_require__(1)['default']; 5049 5050 exports.__esModule = true; 5051 5052 var _handlebarsBase = __webpack_require__(4); 5053 5054 var base = _interopRequireWildcard(_handlebarsBase); 5055 5056 // Each of these augment the Handlebars object. No need to setup here. 5057 // (This is done to easily share code between commonjs and browse envs) 5058 5059 var _handlebarsSafeString = __webpack_require__(77); 5060 5061 var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); 5062 5063 var _handlebarsException = __webpack_require__(6); 5064 5065 var _handlebarsException2 = _interopRequireDefault(_handlebarsException); 5066 5067 var _handlebarsUtils = __webpack_require__(5); 5068 5069 var Utils = _interopRequireWildcard(_handlebarsUtils); 5070 5071 var _handlebarsRuntime = __webpack_require__(78); 5072 5073 var runtime = _interopRequireWildcard(_handlebarsRuntime); 5074 5075 var _handlebarsNoConflict = __webpack_require__(83); 5076 5077 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); 5078 5079 // For compatibility and usage outside of module systems, make the Handlebars object a namespace 5080 function create() { 5081 var hb = new base.HandlebarsEnvironment(); 5082 5083 Utils.extend(hb, base); 5084 hb.SafeString = _handlebarsSafeString2['default']; 5085 hb.Exception = _handlebarsException2['default']; 5086 hb.Utils = Utils; 5087 hb.escapeExpression = Utils.escapeExpression; 5088 5089 hb.VM = runtime; 5090 hb.template = function (spec) { 5091 return runtime.template(spec, hb); 5092 }; 5093 5094 return hb; 5095 } 5096 5097 var inst = create(); 5098 inst.create = create; 5099 5100 _handlebarsNoConflict2['default'](inst); 5101 5102 inst['default'] = inst; 5103 5104 exports['default'] = inst; 5105 module.exports = exports['default']; 5106 5107/***/ }), 5108/* 3 */ 5109/***/ (function(module, exports) { 5110 5111 "use strict"; 5112 5113 exports["default"] = function (obj) { 5114 if (obj && obj.__esModule) { 5115 return obj; 5116 } else { 5117 var newObj = {}; 5118 5119 if (obj != null) { 5120 for (var key in obj) { 5121 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 5122 } 5123 } 5124 5125 newObj["default"] = obj; 5126 return newObj; 5127 } 5128 }; 5129 5130 exports.__esModule = true; 5131 5132/***/ }), 5133/* 4 */ 5134/***/ (function(module, exports, __webpack_require__) { 5135 5136 'use strict'; 5137 5138 var _interopRequireDefault = __webpack_require__(1)['default']; 5139 5140 exports.__esModule = true; 5141 exports.HandlebarsEnvironment = HandlebarsEnvironment; 5142 5143 var _utils = __webpack_require__(5); 5144 5145 var _exception = __webpack_require__(6); 5146 5147 var _exception2 = _interopRequireDefault(_exception); 5148 5149 var _helpers = __webpack_require__(10); 5150 5151 var _decorators = __webpack_require__(70); 5152 5153 var _logger = __webpack_require__(72); 5154 5155 var _logger2 = _interopRequireDefault(_logger); 5156 5157 var _internalProtoAccess = __webpack_require__(73); 5158 5159 var VERSION = '4.7.8'; 5160 exports.VERSION = VERSION; 5161 var COMPILER_REVISION = 8; 5162 exports.COMPILER_REVISION = COMPILER_REVISION; 5163 var LAST_COMPATIBLE_COMPILER_REVISION = 7; 5164 5165 exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION; 5166 var REVISION_CHANGES = { 5167 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it 5168 2: '== 1.0.0-rc.3', 5169 3: '== 1.0.0-rc.4', 5170 4: '== 1.x.x', 5171 5: '== 2.0.0-alpha.x', 5172 6: '>= 2.0.0-beta.1', 5173 7: '>= 4.0.0 <4.3.0', 5174 8: '>= 4.3.0' 5175 }; 5176 5177 exports.REVISION_CHANGES = REVISION_CHANGES; 5178 var objectType = '[object Object]'; 5179 5180 function HandlebarsEnvironment(helpers, partials, decorators) { 5181 this.helpers = helpers || {}; 5182 this.partials = partials || {}; 5183 this.decorators = decorators || {}; 5184 5185 _helpers.registerDefaultHelpers(this); 5186 _decorators.registerDefaultDecorators(this); 5187 } 5188 5189 HandlebarsEnvironment.prototype = { 5190 constructor: HandlebarsEnvironment, 5191 5192 logger: _logger2['default'], 5193 log: _logger2['default'].log, 5194 5195 registerHelper: function registerHelper(name, fn) { 5196 if (_utils.toString.call(name) === objectType) { 5197 if (fn) { 5198 throw new _exception2['default']('Arg not supported with multiple helpers'); 5199 } 5200 _utils.extend(this.helpers, name); 5201 } else { 5202 this.helpers[name] = fn; 5203 } 5204 }, 5205 unregisterHelper: function unregisterHelper(name) { 5206 delete this.helpers[name]; 5207 }, 5208 5209 registerPartial: function registerPartial(name, partial) { 5210 if (_utils.toString.call(name) === objectType) { 5211 _utils.extend(this.partials, name); 5212 } else { 5213 if (typeof partial === 'undefined') { 5214 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined'); 5215 } 5216 this.partials[name] = partial; 5217 } 5218 }, 5219 unregisterPartial: function unregisterPartial(name) { 5220 delete this.partials[name]; 5221 }, 5222 5223 registerDecorator: function registerDecorator(name, fn) { 5224 if (_utils.toString.call(name) === objectType) { 5225 if (fn) { 5226 throw new _exception2['default']('Arg not supported with multiple decorators'); 5227 } 5228 _utils.extend(this.decorators, name); 5229 } else { 5230 this.decorators[name] = fn; 5231 } 5232 }, 5233 unregisterDecorator: function unregisterDecorator(name) { 5234 delete this.decorators[name]; 5235 }, 5236 /** 5237 * Reset the memory of illegal property accesses that have already been logged. 5238 * @deprecated should only be used in handlebars test-cases 5239 */ 5240 resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() { 5241 _internalProtoAccess.resetLoggedProperties(); 5242 } 5243 }; 5244 5245 var log = _logger2['default'].log; 5246 5247 exports.log = log; 5248 exports.createFrame = _utils.createFrame; 5249 exports.logger = _logger2['default']; 5250 5251/***/ }), 5252/* 5 */ 5253/***/ (function(module, exports) { 5254 5255 'use strict'; 5256 5257 exports.__esModule = true; 5258 exports.extend = extend; 5259 exports.indexOf = indexOf; 5260 exports.escapeExpression = escapeExpression; 5261 exports.isEmpty = isEmpty; 5262 exports.createFrame = createFrame; 5263 exports.blockParams = blockParams; 5264 exports.appendContextPath = appendContextPath; 5265 var escape = { 5266 '&': '&', 5267 '<': '<', 5268 '>': '>', 5269 '"': '"', 5270 "'": ''', 5271 '`': '`', 5272 '=': '=' 5273 }; 5274 5275 var badChars = /[&<>"'`=]/g, 5276 possible = /[&<>"'`=]/; 5277 5278 function escapeChar(chr) { 5279 return escape[chr]; 5280 } 5281 5282 function extend(obj /* , ...source */) { 5283 for (var i = 1; i < arguments.length; i++) { 5284 for (var key in arguments[i]) { 5285 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { 5286 obj[key] = arguments[i][key]; 5287 } 5288 } 5289 } 5290 5291 return obj; 5292 } 5293 5294 var toString = Object.prototype.toString; 5295 5296 exports.toString = toString; 5297 // Sourced from lodash 5298 // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt 5299 /* eslint-disable func-style */ 5300 var isFunction = function isFunction(value) { 5301 return typeof value === 'function'; 5302 }; 5303 // fallback for older versions of Chrome and Safari 5304 /* istanbul ignore next */ 5305 if (isFunction(/x/)) { 5306 exports.isFunction = isFunction = function (value) { 5307 return typeof value === 'function' && toString.call(value) === '[object Function]'; 5308 }; 5309 } 5310 exports.isFunction = isFunction; 5311 5312 /* eslint-enable func-style */ 5313 5314 /* istanbul ignore next */ 5315 var isArray = Array.isArray || function (value) { 5316 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
vendor: 5,855 bytes, lines 5317-5536
5317 }; 5318 5319 exports.isArray = isArray; 5320 // Older IE versions do not directly support indexOf so we must implement our own, sadly. 5321 5322 function indexOf(array, value) { 5323 for (var i = 0, len = array.length; i < len; i++) { 5324 if (array[i] === value) { 5325 return i; 5326 } 5327 } 5328 return -1; 5329 } 5330 5331 function escapeExpression(string) { 5332 if (typeof string !== 'string') { 5333 // don't escape SafeStrings, since they're already safe 5334 if (string && string.toHTML) { 5335 return string.toHTML(); 5336 } else if (string == null) { 5337 return ''; 5338 } else if (!string) { 5339 return string + ''; 5340 } 5341 5342 // Force a string conversion as this will be done by the append regardless and 5343 // the regex test will do this transparently behind the scenes, causing issues if 5344 // an object's to string has escaped characters in it. 5345 string = '' + string; 5346 } 5347 5348 if (!possible.test(string)) { 5349 return string; 5350 } 5351 return string.replace(badChars, escapeChar); 5352 } 5353 5354 function isEmpty(value) { 5355 if (!value && value !== 0) { 5356 return true; 5357 } else if (isArray(value) && value.length === 0) { 5358 return true; 5359 } else { 5360 return false; 5361 } 5362 } 5363 5364 function createFrame(object) { 5365 var frame = extend({}, object); 5366 frame._parent = object; 5367 return frame; 5368 } 5369 5370 function blockParams(params, ids) { 5371 params.path = ids; 5372 return params; 5373 } 5374 5375 function appendContextPath(contextPath, id) { 5376 return (contextPath ? contextPath + '.' : '') + id; 5377 } 5378 5379/***/ }), 5380/* 6 */ 5381/***/ (function(module, exports, __webpack_require__) { 5382 5383 'use strict'; 5384 5385 var _Object$defineProperty = __webpack_require__(7)['default']; 5386 5387 exports.__esModule = true; 5388 var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack']; 5389 5390 function Exception(message, node) { 5391 var loc = node && node.loc, 5392 line = undefined, 5393 endLineNumber = undefined, 5394 column = undefined, 5395 endColumn = undefined; 5396 5397 if (loc) { 5398 line = loc.start.line; 5399 endLineNumber = loc.end.line; 5400 column = loc.start.column; 5401 endColumn = loc.end.column; 5402 5403 message += ' - ' + line + ':' + column; 5404 } 5405 5406 var tmp = Error.prototype.constructor.call(this, message); 5407 5408 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. 5409 for (var idx = 0; idx < errorProps.length; idx++) { 5410 this[errorProps[idx]] = tmp[errorProps[idx]]; 5411 } 5412 5413 /* istanbul ignore else */ 5414 if (Error.captureStackTrace) { 5415 Error.captureStackTrace(this, Exception); 5416 } 5417 5418 try { 5419 if (loc) { 5420 this.lineNumber = line; 5421 this.endLineNumber = endLineNumber; 5422 5423 // Work around issue under safari where we can't directly set the column value 5424 /* istanbul ignore next */ 5425 if (_Object$defineProperty) { 5426 Object.defineProperty(this, 'column', { 5427 value: column, 5428 enumerable: true 5429 }); 5430 Object.defineProperty(this, 'endColumn', { 5431 value: endColumn, 5432 enumerable: true 5433 }); 5434 } else { 5435 this.column = column; 5436 this.endColumn = endColumn; 5437 } 5438 } 5439 } catch (nop) { 5440 /* Ignore if the browser is very particular */ 5441 } 5442 } 5443 5444 Exception.prototype = new Error(); 5445 5446 exports['default'] = Exception; 5447 module.exports = exports['default']; 5448 5449/***/ }), 5450/* 7 */ 5451/***/ (function(module, exports, __webpack_require__) { 5452 5453 module.exports = { "default": __webpack_require__(8), __esModule: true }; 5454 5455/***/ }), 5456/* 8 */ 5457/***/ (function(module, exports, __webpack_require__) { 5458 5459 var $ = __webpack_require__(9); 5460 module.exports = function defineProperty(it, key, desc){ 5461 return $.setDesc(it, key, desc); 5462 }; 5463 5464/***/ }), 5465/* 9 */ 5466/***/ (function(module, exports) { 5467 5468 var $Object = Object; 5469 module.exports = { 5470 create: $Object.create, 5471 getProto: $Object.getPrototypeOf, 5472 isEnum: {}.propertyIsEnumerable, 5473 getDesc: $Object.getOwnPropertyDescriptor, 5474 setDesc: $Object.defineProperty, 5475 setDescs: $Object.defineProperties, 5476 getKeys: $Object.keys, 5477 getNames: $Object.getOwnPropertyNames, 5478 getSymbols: $Object.getOwnPropertySymbols, 5479 each: [].forEach 5480 }; 5481 5482/***/ }), 5483/* 10 */ 5484/***/ (function(module, exports, __webpack_require__) { 5485 5486 'use strict'; 5487 5488 var _interopRequireDefault = __webpack_require__(1)['default']; 5489 5490 exports.__esModule = true; 5491 exports.registerDefaultHelpers = registerDefaultHelpers; 5492 exports.moveHelperToHooks = moveHelperToHooks; 5493 5494 var _helpersBlockHelperMissing = __webpack_require__(11); 5495 5496 var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing); 5497 5498 var _helpersEach = __webpack_require__(12); 5499 5500 var _helpersEach2 = _interopRequireDefault(_helpersEach); 5501 5502 var _helpersHelperMissing = __webpack_require__(65); 5503 5504 var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing); 5505 5506 var _helpersIf = __webpack_require__(66); 5507 5508 var _helpersIf2 = _interopRequireDefault(_helpersIf); 5509 5510 var _helpersLog = __webpack_require__(67); 5511 5512 var _helpersLog2 = _interopRequireDefault(_helpersLog); 5513 5514 var _helpersLookup = __webpack_require__(68); 5515 5516 var _helpersLookup2 = _interopRequireDefault(_helpersLookup); 5517 5518 var _helpersWith = __webpack_require__(69); 5519 5520 var _helpersWith2 = _interopRequireDefault(_helpersWith); 5521 5522 function registerDefaultHelpers(instance) { 5523 _helpersBlockHelperMissing2['default'](instance); 5524 _helpersEach2['default'](instance); 5525 _helpersHelperMissing2['default'](instance); 5526 _helpersIf2['default'](instance); 5527 _helpersLog2['default'](instance); 5528 _helpersLookup2['default'](instance); 5529 _helpersWith2['default'](instance); 5530 } 5531 5532 function moveHelperToHooks(instance, helperName, keepHelper) { 5533 if (instance.helpers[helperName]) { 5534 instance.hooks[helperName] = instance.helpers[helperName]; 5535 if (!keepHelper) { 5536 delete instance.helpers[helperName]
vendor: 39,427 bytes, lines 5536-6922
5536; 5537 } 5538 } 5539 } 5540 5541/***/ }), 5542/* 11 */ 5543/***/ (function(module, exports, __webpack_require__) { 5544 5545 'use strict'; 5546 5547 exports.__esModule = true; 5548 5549 var _utils = __webpack_require__(5); 5550 5551 exports['default'] = function (instance) { 5552 instance.registerHelper('blockHelperMissing', function (context, options) { 5553 var inverse = options.inverse, 5554 fn = options.fn; 5555 5556 if (context === true) { 5557 return fn(this); 5558 } else if (context === false || context == null) { 5559 return inverse(this); 5560 } else if (_utils.isArray(context)) { 5561 if (context.length > 0) { 5562 if (options.ids) { 5563 options.ids = [options.name]; 5564 } 5565 5566 return instance.helpers.each(context, options); 5567 } else { 5568 return inverse(this); 5569 } 5570 } else { 5571 if (options.data && options.ids) { 5572 var data = _utils.createFrame(options.data); 5573 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); 5574 options = { data: data }; 5575 } 5576 5577 return fn(context, options); 5578 } 5579 }); 5580 }; 5581 5582 module.exports = exports['default']; 5583 5584/***/ }), 5585/* 12 */ 5586/***/ (function(module, exports, __webpack_require__) { 5587 5588 'use strict'; 5589 5590 var _Symbol = __webpack_require__(13)['default']; 5591 5592 var _Symbol$iterator = __webpack_require__(43)['default']; 5593 5594 var _getIterator = __webpack_require__(55)['default']; 5595 5596 var _Object$keys = __webpack_require__(60)['default']; 5597 5598 var _interopRequireDefault = __webpack_require__(1)['default']; 5599 5600 exports.__esModule = true; 5601 5602 var _utils = __webpack_require__(5); 5603 5604 var _exception = __webpack_require__(6); 5605 5606 var _exception2 = _interopRequireDefault(_exception); 5607 5608 exports['default'] = function (instance) { 5609 instance.registerHelper('each', function (context, options) { 5610 if (!options) { 5611 throw new _exception2['default']('Must pass iterator to #each'); 5612 } 5613 5614 var fn = options.fn, 5615 inverse = options.inverse, 5616 i = 0, 5617 ret = '', 5618 data = undefined, 5619 contextPath = undefined; 5620 5621 if (options.data && options.ids) { 5622 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; 5623 } 5624 5625 if (_utils.isFunction(context)) { 5626 context = context.call(this); 5627 } 5628 5629 if (options.data) { 5630 data = _utils.createFrame(options.data); 5631 } 5632 5633 function execIteration(field, index, last) { 5634 if (data) { 5635 data.key = field; 5636 data.index = index; 5637 data.first = index === 0; 5638 data.last = !!last; 5639 5640 if (contextPath) { 5641 data.contextPath = contextPath + field; 5642 } 5643 } 5644 5645 ret = ret + fn(context[field], { 5646 data: data, 5647 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) 5648 }); 5649 } 5650 5651 if (context && typeof context === 'object') { 5652 if (_utils.isArray(context)) { 5653 for (var j = context.length; i < j; i++) { 5654 if (i in context) { 5655 execIteration(i, i, i === context.length - 1); 5656 } 5657 } 5658 } else if (typeof _Symbol === 'function' && context[_Symbol$iterator]) { 5659 var newContext = []; 5660 var iterator = _getIterator(context); 5661 for (var it = iterator.next(); !it.done; it = iterator.next()) { 5662 newContext.push(it.value); 5663 } 5664 context = newContext; 5665 for (var j = context.length; i < j; i++) { 5666 execIteration(i, i, i === context.length - 1); 5667 } 5668 } else { 5669 (function () { 5670 var priorKey = undefined; 5671 5672 _Object$keys(context).forEach(function (key) { 5673 // We're running the iterations one step out of sync so we can detect 5674 // the last iteration without have to scan the object twice and create 5675 // an itermediate keys array. 5676 if (priorKey !== undefined) { 5677 execIteration(priorKey, i - 1); 5678 } 5679 priorKey = key; 5680 i++; 5681 }); 5682 if (priorKey !== undefined) { 5683 execIteration(priorKey, i - 1, true); 5684 } 5685 })(); 5686 } 5687 } 5688 5689 if (i === 0) { 5690 ret = inverse(this); 5691 } 5692 5693 return ret; 5694 }); 5695 }; 5696 5697 module.exports = exports['default']; 5698 5699/***/ }), 5700/* 13 */ 5701/***/ (function(module, exports, __webpack_require__) { 5702 5703 module.exports = { "default": __webpack_require__(14), __esModule: true }; 5704 5705/***/ }), 5706/* 14 */ 5707/***/ (function(module, exports, __webpack_require__) { 5708 5709 __webpack_require__(15); 5710 __webpack_require__(42); 5711 module.exports = __webpack_require__(21).Symbol; 5712 5713/***/ }), 5714/* 15 */ 5715/***/ (function(module, exports, __webpack_require__) { 5716 5717 'use strict'; 5718 // ECMAScript 6 symbols shim 5719 var $ = __webpack_require__(9) 5720 , global = __webpack_require__(16) 5721 , has = __webpack_require__(17) 5722 , DESCRIPTORS = __webpack_require__(18) 5723 , $export = __webpack_require__(20) 5724 , redefine = __webpack_require__(24) 5725 , $fails = __webpack_require__(19) 5726 , shared = __webpack_require__(27) 5727 , setToStringTag = __webpack_require__(28) 5728 , uid = __webpack_require__(30) 5729 , wks = __webpack_require__(29) 5730 , keyOf = __webpack_require__(31) 5731 , $names = __webpack_require__(36) 5732 , enumKeys = __webpack_require__(37) 5733 , isArray = __webpack_require__(38) 5734 , anObject = __webpack_require__(39) 5735 , toIObject = __webpack_require__(32) 5736 , createDesc = __webpack_require__(26) 5737 , getDesc = $.getDesc 5738 , setDesc = $.setDesc 5739 , _create = $.create 5740 , getNames = $names.get 5741 , $Symbol = global.Symbol 5742 , $JSON = global.JSON 5743 , _stringify = $JSON && $JSON.stringify 5744 , setter = false 5745 , HIDDEN = wks('_hidden') 5746 , isEnum = $.isEnum 5747 , SymbolRegistry = shared('symbol-registry') 5748 , AllSymbols = shared('symbols') 5749 , useNative = typeof $Symbol == 'function' 5750 , ObjectProto = Object.prototype; 5751 5752 // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 5753 var setSymbolDesc = DESCRIPTORS && $fails(function(){ 5754 return _create(setDesc({}, 'a', { 5755 get: function(){ return setDesc(this, 'a', {value: 7}).a; } 5756 })).a != 7; 5757 }) ? function(it, key, D){ 5758 var protoDesc = getDesc(ObjectProto, key); 5759 if(protoDesc)delete ObjectProto[key]; 5760 setDesc(it, key, D); 5761 if(protoDesc && it !== ObjectProto)setDesc(ObjectProto, key, protoDesc); 5762 } : setDesc; 5763 5764 var wrap = function(tag){ 5765 var sym = AllSymbols[tag] = _create($Symbol.prototype); 5766 sym._k = tag; 5767 DESCRIPTORS && setter && setSymbolDesc(ObjectProto, tag, { 5768 configurable: true, 5769 set: function(value){ 5770 if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; 5771 setSymbolDesc(this, tag, createDesc(1, value)); 5772 } 5773 }); 5774 return sym; 5775 }; 5776 5777 var isSymbol = function(it){ 5778 return typeof it == 'symbol'; 5779 }; 5780 5781 var $defineProperty = function defineProperty(it, key, D){ 5782 if(D && has(AllSymbols, key)){ 5783 if(!D.enumerable){ 5784 if(!has(it, HIDDEN))setDesc(it, HIDDEN, createDesc(1, {})); 5785 it[HIDDEN][key] = true; 5786 } else { 5787 if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; 5788 D = _create(D, {enumerable: createDesc(0, false)}); 5789 } return setSymbolDesc(it, key, D); 5790 } return setDesc(it, key, D); 5791 }; 5792 var $defineProperties = function defineProperties(it, P){ 5793 anObject(it); 5794 var keys = enumKeys(P = toIObject(P)) 5795 , i = 0 5796 , l = keys.length 5797 , key; 5798 while(l > i)$defineProperty(it, key = keys[i++], P[key]); 5799 return it; 5800 }; 5801 var $create = function create(it, P){ 5802 return P === undefined ? _create(it) : $defineProperties(_create(it), P); 5803 }; 5804 var $propertyIsEnumerable = function propertyIsEnumerable(key){ 5805 var E = isEnum.call(this, key); 5806 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] 5807 ? E : true; 5808 }; 5809 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ 5810 var D = getDesc(it = toIObject(it), key); 5811 if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; 5812 return D; 5813 }; 5814 var $getOwnPropertyNames = function getOwnPropertyNames(it){ 5815 var names = getNames(toIObject(it)) 5816 , result = [] 5817 , i = 0 5818 , key; 5819 while(names.length > i)if(!has(AllSymbols, key = names[i++]) && key != HIDDEN)result.push(key); 5820 return result; 5821 }; 5822 var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ 5823 var names = getNames(toIObject(it)) 5824 , result = [] 5825 , i = 0 5826 , key; 5827 while(names.length > i)if(has(AllSymbols, key = names[i++]))result.push(AllSymbols[key]); 5828 return result; 5829 }; 5830 var $stringify = function stringify(it){ 5831 if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined 5832 var args = [it] 5833 , i = 1 5834 , $$ = arguments 5835 , replacer, $replacer; 5836 while($$.length > i)args.push($$[i++]); 5837 replacer = args[1]; 5838 if(typeof replacer == 'function')$replacer = replacer; 5839 if($replacer || !isArray(replacer))replacer = function(key, value){ 5840 if($replacer)value = $replacer.call(this, key, value); 5841 if(!isSymbol(value))return value; 5842 }; 5843 args[1] = replacer; 5844 return _stringify.apply($JSON, args); 5845 }; 5846 var buggyJSON = $fails(function(){ 5847 var S = $Symbol(); 5848 // MS Edge converts symbol values to JSON as {} 5849 // WebKit converts symbol values to JSON as null 5850 // V8 throws on boxed symbols 5851 return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; 5852 }); 5853 5854 // 19.4.1.1 Symbol([description]) 5855 if(!useNative){ 5856 $Symbol = function Symbol(){ 5857 if(isSymbol(this))throw TypeError('Symbol is not a constructor'); 5858 return wrap(uid(arguments.length > 0 ? arguments[0] : undefined)); 5859 }; 5860 redefine($Symbol.prototype, 'toString', function toString(){ 5861 return this._k; 5862 }); 5863 5864 isSymbol = function(it){ 5865 return it instanceof $Symbol; 5866 }; 5867 5868 $.create = $create; 5869 $.isEnum = $propertyIsEnumerable; 5870 $.getDesc = $getOwnPropertyDescriptor; 5871 $.setDesc = $defineProperty; 5872 $.setDescs = $defineProperties; 5873 $.getNames = $names.get = $getOwnPropertyNames; 5874 $.getSymbols = $getOwnPropertySymbols; 5875 5876 if(DESCRIPTORS && !__webpack_require__(41)){ 5877 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); 5878 } 5879 } 5880 5881 var symbolStatics = { 5882 // 19.4.2.1 Symbol.for(key) 5883 'for': function(key){ 5884 return has(SymbolRegistry, key += '') 5885 ? SymbolRegistry[key] 5886 : SymbolRegistry[key] = $Symbol(key); 5887 }, 5888 // 19.4.2.5 Symbol.keyFor(sym) 5889 keyFor: function keyFor(key){ 5890 return keyOf(SymbolRegistry, key); 5891 }, 5892 useSetter: function(){ setter = true; }, 5893 useSimple: function(){ setter = false; } 5894 }; 5895 // 19.4.2.2 Symbol.hasInstance 5896 // 19.4.2.3 Symbol.isConcatSpreadable 5897 // 19.4.2.4 Symbol.iterator 5898 // 19.4.2.6 Symbol.match 5899 // 19.4.2.8 Symbol.replace 5900 // 19.4.2.9 Symbol.search 5901 // 19.4.2.10 Symbol.species 5902 // 19.4.2.11 Symbol.split 5903 // 19.4.2.12 Symbol.toPrimitive 5904 // 19.4.2.13 Symbol.toStringTag 5905 // 19.4.2.14 Symbol.unscopables 5906 $.each.call(( 5907 'hasInstance,isConcatSpreadable,iterator,match,replace,search,' + 5908 'species,split,toPrimitive,toStringTag,unscopables' 5909 ).split(','), function(it){ 5910 var sym = wks(it); 5911 symbolStatics[it] = useNative ? sym : wrap(sym); 5912 }); 5913 5914 setter = true; 5915 5916 $export($export.G + $export.W, {Symbol: $Symbol}); 5917 5918 $export($export.S, 'Symbol', symbolStatics); 5919 5920 $export($export.S + $export.F * !useNative, 'Object', { 5921 // 19.1.2.2 Object.create(O [, Properties]) 5922 create: $create, 5923 // 19.1.2.4 Object.defineProperty(O, P, Attributes) 5924 defineProperty: $defineProperty, 5925 // 19.1.2.3 Object.defineProperties(O, Properties) 5926 defineProperties: $defineProperties, 5927 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) 5928 getOwnPropertyDescriptor: $getOwnPropertyDescriptor, 5929 // 19.1.2.7 Object.getOwnPropertyNames(O) 5930 getOwnPropertyNames: $getOwnPropertyNames, 5931 // 19.1.2.8 Object.getOwnPropertySymbols(O) 5932 getOwnPropertySymbols: $getOwnPropertySymbols 5933 }); 5934 5935 // 24.3.2 JSON.stringify(value [, replacer [, space]]) 5936 $JSON && $export($export.S + $export.F * (!useNative || buggyJSON), 'JSON', {stringify: $stringify}); 5937 5938 // 19.4.3.5 Symbol.prototype[@@toStringTag] 5939 setToStringTag($Symbol, 'Symbol'); 5940 // 20.2.1.9 Math[@@toStringTag] 5941 setToStringTag(Math, 'Math', true); 5942 // 24.3.3 JSON[@@toStringTag] 5943 setToStringTag(global.JSON, 'JSON', true); 5944 5945/***/ }), 5946/* 16 */ 5947/***/ (function(module, exports) { 5948 5949 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 5950 var global = module.exports = typeof window != 'undefined' && window.Math == Math 5951 ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); 5952 if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef 5953 5954/***/ }), 5955/* 17 */ 5956/***/ (function(module, exports) { 5957 5958 var hasOwnProperty = {}.hasOwnProperty; 5959 module.exports = function(it, key){ 5960 return hasOwnProperty.call(it, key); 5961 }; 5962 5963/***/ }), 5964/* 18 */ 5965/***/ (function(module, exports, __webpack_require__) { 5966 5967 // Thank's IE8 for his funny defineProperty 5968 module.exports = !__webpack_require__(19)(function(){ 5969 return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; 5970 }); 5971 5972/***/ }), 5973/* 19 */ 5974/***/ (function(module, exports) { 5975 5976 module.exports = function(exec){ 5977 try { 5978 return !!exec(); 5979 } catch(e){ 5980 return true; 5981 } 5982 }; 5983 5984/***/ }), 5985/* 20 */ 5986/***/ (function(module, exports, __webpack_require__) { 5987 5988 var global = __webpack_require__(16) 5989 , core = __webpack_require__(21) 5990 , ctx = __webpack_require__(22) 5991 , PROTOTYPE = 'prototype'; 5992 5993 var $export = function(type, name, source){ 5994 var IS_FORCED = type & $export.F 5995 , IS_GLOBAL = type & $export.G 5996 , IS_STATIC = type & $export.S 5997 , IS_PROTO = type & $export.P 5998 , IS_BIND = type & $export.B 5999 , IS_WRAP = type & $export.W 6000 , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) 6001 , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] 6002 , key, own, out; 6003 if(IS_GLOBAL)source = name; 6004 for(key in source){ 6005 // contains in native 6006 own = !IS_FORCED && target && key in target; 6007 if(own && key in exports)continue; 6008 // export native or passed 6009 out = own ? target[key] : source[key]; 6010 // prevent global pollution for namespaces 6011 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] 6012 // bind timers to global for call from export context 6013 : IS_BIND && own ? ctx(out, global) 6014 // wrap global constructors for prevent change them in library 6015 : IS_WRAP && target[key] == out ? (function(C){ 6016 var F = function(param){ 6017 return this instanceof C ? new C(param) : C(param); 6018 }; 6019 F[PROTOTYPE] = C[PROTOTYPE]; 6020 return F; 6021 // make static versions for prototype methods 6022 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; 6023 if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out; 6024 } 6025 }; 6026 // type bitmap 6027 $export.F = 1; // forced 6028 $export.G = 2; // global 6029 $export.S = 4; // static 6030 $export.P = 8; // proto 6031 $export.B = 16; // bind 6032 $export.W = 32; // wrap 6033 module.exports = $export; 6034 6035/***/ }), 6036/* 21 */ 6037/***/ (function(module, exports) { 6038 6039 var core = module.exports = {version: '1.2.6'}; 6040 if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef 6041 6042/***/ }), 6043/* 22 */ 6044/***/ (function(module, exports, __webpack_require__) { 6045 6046 // optional / simple context binding 6047 var aFunction = __webpack_require__(23); 6048 module.exports = function(fn, that, length){ 6049 aFunction(fn); 6050 if(that === undefined)return fn; 6051 switch(length){ 6052 case 1: return function(a){ 6053 return fn.call(that, a); 6054 }; 6055 case 2: return function(a, b){ 6056 return fn.call(that, a, b); 6057 }; 6058 case 3: return function(a, b, c){ 6059 return fn.call(that, a, b, c); 6060 }; 6061 } 6062 return function(/* ...args */){ 6063 return fn.apply(that, arguments); 6064 }; 6065 }; 6066 6067/***/ }), 6068/* 23 */ 6069/***/ (function(module, exports) { 6070 6071 module.exports = function(it){ 6072 if(typeof it != 'function')throw TypeError(it + ' is not a function!'); 6073 return it; 6074 }; 6075 6076/***/ }), 6077/* 24 */ 6078/***/ (function(module, exports, __webpack_require__) { 6079 6080 module.exports = __webpack_require__(25); 6081 6082/***/ }), 6083/* 25 */ 6084/***/ (function(module, exports, __webpack_require__) { 6085 6086 var $ = __webpack_require__(9) 6087 , createDesc = __webpack_require__(26); 6088 module.exports = __webpack_require__(18) ? function(object, key, value){ 6089 return $.setDesc(object, key, createDesc(1, value)); 6090 } : function(object, key, value){ 6091 object[key] = value; 6092 return object; 6093 }; 6094 6095/***/ }), 6096/* 26 */ 6097/***/ (function(module, exports) { 6098 6099 module.exports = function(bitmap, value){ 6100 return { 6101 enumerable : !(bitmap & 1), 6102 configurable: !(bitmap & 2), 6103 writable : !(bitmap & 4), 6104 value : value 6105 }; 6106 }; 6107 6108/***/ }), 6109/* 27 */ 6110/***/ (function(module, exports, __webpack_require__) { 6111 6112 var global = __webpack_require__(16) 6113 , SHARED = '__core-js_shared__' 6114 , store = global[SHARED] || (global[SHARED] = {}); 6115 module.exports = function(key){ 6116 return store[key] || (store[key] = {}); 6117 }; 6118 6119/***/ }), 6120/* 28 */ 6121/***/ (function(module, exports, __webpack_require__) { 6122 6123 var def = __webpack_require__(9).setDesc 6124 , has = __webpack_require__(17) 6125 , TAG = __webpack_require__(29)('toStringTag'); 6126 6127 module.exports = function(it, tag, stat){ 6128 if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); 6129 }; 6130 6131/***/ }), 6132/* 29 */ 6133/***/ (function(module, exports, __webpack_require__) { 6134 6135 var store = __webpack_require__(27)('wks') 6136 , uid = __webpack_require__(30) 6137 , Symbol = __webpack_require__(16).Symbol; 6138 module.exports = function(name){ 6139 return store[name] || (store[name] = 6140 Symbol && Symbol[name] || (Symbol || uid)('Symbol.' + name)); 6141 }; 6142 6143/***/ }), 6144/* 30 */ 6145/***/ (function(module, exports) { 6146 6147 var id = 0 6148 , px = Math.random(); 6149 module.exports = function(key){ 6150 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); 6151 }; 6152 6153/***/ }), 6154/* 31 */ 6155/***/ (function(module, exports, __webpack_require__) { 6156 6157 var $ = __webpack_require__(9) 6158 , toIObject = __webpack_require__(32); 6159 module.exports = function(object, el){ 6160 var O = toIObject(object) 6161 , keys = $.getKeys(O) 6162 , length = keys.length 6163 , index = 0 6164 , key; 6165 while(length > index)if(O[key = keys[index++]] === el)return key; 6166 }; 6167 6168/***/ }), 6169/* 32 */ 6170/***/ (function(module, exports, __webpack_require__) { 6171 6172 // to indexed object, toObject with fallback for non-array-like ES3 strings 6173 var IObject = __webpack_require__(33) 6174 , defined = __webpack_require__(35); 6175 module.exports = function(it){ 6176 return IObject(defined(it)); 6177 }; 6178 6179/***/ }), 6180/* 33 */ 6181/***/ (function(module, exports, __webpack_require__) { 6182 6183 // fallback for non-array-like ES3 and non-enumerable old V8 strings 6184 var cof = __webpack_require__(34); 6185 module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ 6186 return cof(it) == 'String' ? it.split('') : Object(it); 6187 }; 6188 6189/***/ }), 6190/* 34 */ 6191/***/ (function(module, exports) { 6192 6193 var toString = {}.toString; 6194 6195 module.exports = function(it){ 6196 return toString.call(it).slice(8, -1); 6197 }; 6198 6199/***/ }), 6200/* 35 */ 6201/***/ (function(module, exports) { 6202 6203 // 7.2.1 RequireObjectCoercible(argument) 6204 module.exports = function(it){ 6205 if(it == undefined)throw TypeError("Can't call method on " + it); 6206 return it; 6207 }; 6208 6209/***/ }), 6210/* 36 */ 6211/***/ (function(module, exports, __webpack_require__) { 6212 6213 // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window 6214 var toIObject = __webpack_require__(32) 6215 , getNames = __webpack_require__(9).getNames 6216 , toString = {}.toString; 6217 6218 var windowNames = typeof window == 'object' && Object.getOwnPropertyNames 6219 ? Object.getOwnPropertyNames(window) : []; 6220 6221 var getWindowNames = function(it){ 6222 try { 6223 return getNames(it); 6224 } catch(e){ 6225 return windowNames.slice(); 6226 } 6227 }; 6228 6229 module.exports.get = function getOwnPropertyNames(it){ 6230 if(windowNames && toString.call(it) == '[object Window]')return getWindowNames(it); 6231 return getNames(toIObject(it)); 6232 }; 6233 6234/***/ }), 6235/* 37 */ 6236/***/ (function(module, exports, __webpack_require__) { 6237 6238 // all enumerable object keys, includes symbols 6239 var $ = __webpack_require__(9); 6240 module.exports = function(it){ 6241 var keys = $.getKeys(it) 6242 , getSymbols = $.getSymbols; 6243 if(getSymbols){ 6244 var symbols = getSymbols(it) 6245 , isEnum = $.isEnum 6246 , i = 0 6247 , key; 6248 while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key); 6249 } 6250 return keys; 6251 }; 6252 6253/***/ }), 6254/* 38 */ 6255/***/ (function(module, exports, __webpack_require__) { 6256 6257 // 7.2.2 IsArray(argument) 6258 var cof = __webpack_require__(34); 6259 module.exports = Array.isArray || function(arg){ 6260 return cof(arg) == 'Array'; 6261 }; 6262 6263/***/ }), 6264/* 39 */ 6265/***/ (function(module, exports, __webpack_require__) { 6266 6267 var isObject = __webpack_require__(40); 6268 module.exports = function(it){ 6269 if(!isObject(it))throw TypeError(it + ' is not an object!'); 6270 return it; 6271 }; 6272 6273/***/ }), 6274/* 40 */ 6275/***/ (function(module, exports) { 6276 6277 module.exports = function(it){ 6278 return typeof it === 'object' ? it !== null : typeof it === 'function'; 6279 }; 6280 6281/***/ }), 6282/* 41 */ 6283/***/ (function(module, exports) { 6284 6285 module.exports = true; 6286 6287/***/ }), 6288/* 42 */ 6289/***/ (function(module, exports) { 6290 6291 6292 6293/***/ }), 6294/* 43 */ 6295/***/ (function(module, exports, __webpack_require__) { 6296 6297 module.exports = { "default": __webpack_require__(44), __esModule: true }; 6298 6299/***/ }), 6300/* 44 */ 6301/***/ (function(module, exports, __webpack_require__) { 6302 6303 __webpack_require__(45); 6304 __webpack_require__(51); 6305 module.exports = __webpack_require__(29)('iterator'); 6306 6307/***/ }), 6308/* 45 */ 6309/***/ (function(module, exports, __webpack_require__) { 6310 6311 'use strict'; 6312 var $at = __webpack_require__(46)(true); 6313 6314 // 21.1.3.27 String.prototype[@@iterator]() 6315 __webpack_require__(48)(String, 'String', function(iterated){ 6316 this._t = String(iterated); // target 6317 this._i = 0; // next index 6318 // 21.1.5.2.1 %StringIteratorPrototype%.next() 6319 }, function(){ 6320 var O = this._t 6321 , index = this._i 6322 , point; 6323 if(index >= O.length)return {value: undefined, done: true}; 6324 point = $at(O, index); 6325 this._i += point.length; 6326 return {value: point, done: false}; 6327 }); 6328 6329/***/ }), 6330/* 46 */ 6331/***/ (function(module, exports, __webpack_require__) { 6332 6333 var toInteger = __webpack_require__(47) 6334 , defined = __webpack_require__(35); 6335 // true -> String#at 6336 // false -> String#codePointAt 6337 module.exports = function(TO_STRING){ 6338 return function(that, pos){ 6339 var s = String(defined(that)) 6340 , i = toInteger(pos) 6341 , l = s.length 6342 , a, b; 6343 if(i < 0 || i >= l)return TO_STRING ? '' : undefined; 6344 a = s.charCodeAt(i); 6345 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff 6346 ? TO_STRING ? s.charAt(i) : a 6347 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; 6348 }; 6349 }; 6350 6351/***/ }), 6352/* 47 */ 6353/***/ (function(module, exports) { 6354 6355 // 7.1.4 ToInteger 6356 var ceil = Math.ceil 6357 , floor = Math.floor; 6358 module.exports = function(it){ 6359 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); 6360 }; 6361 6362/***/ }), 6363/* 48 */ 6364/***/ (function(module, exports, __webpack_require__) { 6365 6366 'use strict'; 6367 var LIBRARY = __webpack_require__(41) 6368 , $export = __webpack_require__(20) 6369 , redefine = __webpack_require__(24) 6370 , hide = __webpack_require__(25) 6371 , has = __webpack_require__(17) 6372 , Iterators = __webpack_require__(49) 6373 , $iterCreate = __webpack_require__(50) 6374 , setToStringTag = __webpack_require__(28) 6375 , getProto = __webpack_require__(9).getProto 6376 , ITERATOR = __webpack_require__(29)('iterator') 6377 , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` 6378 , FF_ITERATOR = '@@iterator' 6379 , KEYS = 'keys' 6380 , VALUES = 'values'; 6381 6382 var returnThis = function(){ return this; }; 6383 6384 module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ 6385 $iterCreate(Constructor, NAME, next); 6386 var getMethod = function(kind){ 6387 if(!BUGGY && kind in proto)return proto[kind]; 6388 switch(kind){ 6389 case KEYS: return function keys(){ return new Constructor(this, kind); }; 6390 case VALUES: return function values(){ return new Constructor(this, kind); }; 6391 } return function entries(){ return new Constructor(this, kind); }; 6392 }; 6393 var TAG = NAME + ' Iterator' 6394 , DEF_VALUES = DEFAULT == VALUES 6395 , VALUES_BUG = false 6396 , proto = Base.prototype 6397 , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] 6398 , $default = $native || getMethod(DEFAULT) 6399 , methods, key; 6400 // Fix native 6401 if($native){ 6402 var IteratorPrototype = getProto($default.call(new Base)); 6403 // Set @@toStringTag to native iterators 6404 setToStringTag(IteratorPrototype, TAG, true); 6405 // FF fix 6406 if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); 6407 // fix Array#{values, @@iterator}.name in V8 / FF 6408 if(DEF_VALUES && $native.name !== VALUES){ 6409 VALUES_BUG = true; 6410 $default = function values(){ return $native.call(this); }; 6411 } 6412 } 6413 // Define iterator 6414 if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ 6415 hide(proto, ITERATOR, $default); 6416 } 6417 // Plug for library 6418 Iterators[NAME] = $default; 6419 Iterators[TAG] = returnThis; 6420 if(DEFAULT){ 6421 methods = { 6422 values: DEF_VALUES ? $default : getMethod(VALUES), 6423 keys: IS_SET ? $default : getMethod(KEYS), 6424 entries: !DEF_VALUES ? $default : getMethod('entries') 6425 }; 6426 if(FORCED)for(key in methods){ 6427 if(!(key in proto))redefine(proto, key, methods[key]); 6428 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); 6429 } 6430 return methods; 6431 }; 6432 6433/***/ }), 6434/* 49 */ 6435/***/ (function(module, exports) { 6436 6437 module.exports = {}; 6438 6439/***/ }), 6440/* 50 */ 6441/***/ (function(module, exports, __webpack_require__) { 6442 6443 'use strict'; 6444 var $ = __webpack_require__(9) 6445 , descriptor = __webpack_require__(26) 6446 , setToStringTag = __webpack_require__(28) 6447 , IteratorPrototype = {}; 6448 6449 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() 6450 __webpack_require__(25)(IteratorPrototype, __webpack_require__(29)('iterator'), function(){ return this; }); 6451 6452 module.exports = function(Constructor, NAME, next){ 6453 Constructor.prototype = $.create(IteratorPrototype, {next: descriptor(1, next)}); 6454 setToStringTag(Constructor, NAME + ' Iterator'); 6455 }; 6456 6457/***/ }), 6458/* 51 */ 6459/***/ (function(module, exports, __webpack_require__) { 6460 6461 __webpack_require__(52); 6462 var Iterators = __webpack_require__(49); 6463 Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array; 6464 6465/***/ }), 6466/* 52 */ 6467/***/ (function(module, exports, __webpack_require__) { 6468 6469 'use strict'; 6470 var addToUnscopables = __webpack_require__(53) 6471 , step = __webpack_require__(54) 6472 , Iterators = __webpack_require__(49) 6473 , toIObject = __webpack_require__(32); 6474 6475 // 22.1.3.4 Array.prototype.entries() 6476 // 22.1.3.13 Array.prototype.keys() 6477 // 22.1.3.29 Array.prototype.values() 6478 // 22.1.3.30 Array.prototype[@@iterator]() 6479 module.exports = __webpack_require__(48)(Array, 'Array', function(iterated, kind){ 6480 this._t = toIObject(iterated); // target 6481 this._i = 0; // next index 6482 this._k = kind; // kind 6483 // 22.1.5.2.1 %ArrayIteratorPrototype%.next() 6484 }, function(){ 6485 var O = this._t 6486 , kind = this._k 6487 , index = this._i++; 6488 if(!O || index >= O.length){ 6489 this._t = undefined; 6490 return step(1); 6491 } 6492 if(kind == 'keys' )return step(0, index); 6493 if(kind == 'values')return step(0, O[index]); 6494 return step(0, [index, O[index]]); 6495 }, 'values'); 6496 6497 // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) 6498 Iterators.Arguments = Iterators.Array; 6499 6500 addToUnscopables('keys'); 6501 addToUnscopables('values'); 6502 addToUnscopables('entries'); 6503 6504/***/ }), 6505/* 53 */ 6506/***/ (function(module, exports) { 6507 6508 module.exports = function(){ /* empty */ }; 6509 6510/***/ }), 6511/* 54 */ 6512/***/ (function(module, exports) { 6513 6514 module.exports = function(done, value){ 6515 return {value: value, done: !!done}; 6516 }; 6517 6518/***/ }), 6519/* 55 */ 6520/***/ (function(module, exports, __webpack_require__) { 6521 6522 module.exports = { "default": __webpack_require__(56), __esModule: true }; 6523 6524/***/ }), 6525/* 56 */ 6526/***/ (function(module, exports, __webpack_require__) { 6527 6528 __webpack_require__(51); 6529 __webpack_require__(45); 6530 module.exports = __webpack_require__(57); 6531 6532/***/ }), 6533/* 57 */ 6534/***/ (function(module, exports, __webpack_require__) { 6535 6536 var anObject = __webpack_require__(39) 6537 , get = __webpack_require__(58); 6538 module.exports = __webpack_require__(21).getIterator = function(it){ 6539 var iterFn = get(it); 6540 if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); 6541 return anObject(iterFn.call(it)); 6542 }; 6543 6544/***/ }), 6545/* 58 */ 6546/***/ (function(module, exports, __webpack_require__) { 6547 6548 var classof = __webpack_require__(59) 6549 , ITERATOR = __webpack_require__(29)('iterator') 6550 , Iterators = __webpack_require__(49); 6551 module.exports = __webpack_require__(21).getIteratorMethod = function(it){ 6552 if(it != undefined)return it[ITERATOR] 6553 || it['@@iterator'] 6554 || Iterators[classof(it)]; 6555 }; 6556 6557/***/ }), 6558/* 59 */ 6559/***/ (function(module, exports, __webpack_require__) { 6560 6561 // getting tag from 19.1.3.6 Object.prototype.toString() 6562 var cof = __webpack_require__(34) 6563 , TAG = __webpack_require__(29)('toStringTag') 6564 // ES3 wrong here 6565 , ARG = cof(function(){ return arguments; }()) == 'Arguments'; 6566 6567 module.exports = function(it){ 6568 var O, T, B; 6569 return it === undefined ? 'Undefined' : it === null ? 'Null' 6570 // @@toStringTag case 6571 : typeof (T = (O = Object(it))[TAG]) == 'string' ? T 6572 // builtinTag case 6573 : ARG ? cof(O) 6574 // ES3 arguments fallback 6575 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; 6576 }; 6577 6578/***/ }), 6579/* 60 */ 6580/***/ (function(module, exports, __webpack_require__) { 6581 6582 module.exports = { "default": __webpack_require__(61), __esModule: true }; 6583 6584/***/ }), 6585/* 61 */ 6586/***/ (function(module, exports, __webpack_require__) { 6587 6588 __webpack_require__(62); 6589 module.exports = __webpack_require__(21).Object.keys; 6590 6591/***/ }), 6592/* 62 */ 6593/***/ (function(module, exports, __webpack_require__) { 6594 6595 // 19.1.2.14 Object.keys(O) 6596 var toObject = __webpack_require__(63); 6597 6598 __webpack_require__(64)('keys', function($keys){ 6599 return function keys(it){ 6600 return $keys(toObject(it)); 6601 }; 6602 }); 6603 6604/***/ }), 6605/* 63 */ 6606/***/ (function(module, exports, __webpack_require__) { 6607 6608 // 7.1.13 ToObject(argument) 6609 var defined = __webpack_require__(35); 6610 module.exports = function(it){ 6611 return Object(defined(it)); 6612 }; 6613 6614/***/ }), 6615/* 64 */ 6616/***/ (function(module, exports, __webpack_require__) { 6617 6618 // most Object methods by ES6 should accept primitives 6619 var $export = __webpack_require__(20) 6620 , core = __webpack_require__(21) 6621 , fails = __webpack_require__(19); 6622 module.exports = function(KEY, exec){ 6623 var fn = (core.Object || {})[KEY] || Object[KEY] 6624 , exp = {}; 6625 exp[KEY] = exec(fn); 6626 $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); 6627 }; 6628 6629/***/ }), 6630/* 65 */ 6631/***/ (function(module, exports, __webpack_require__) { 6632 6633 'use strict'; 6634 6635 var _interopRequireDefault = __webpack_require__(1)['default']; 6636 6637 exports.__esModule = true; 6638 6639 var _exception = __webpack_require__(6); 6640 6641 var _exception2 = _interopRequireDefault(_exception); 6642 6643 exports['default'] = function (instance) { 6644 instance.registerHelper('helperMissing', function () /* [args, ]options */{ 6645 if (arguments.length === 1) { 6646 // A missing field in a {{foo}} construct. 6647 return undefined; 6648 } else { 6649 // Someone is actually trying to call something, blow up. 6650 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); 6651 } 6652 }); 6653 }; 6654 6655 module.exports = exports['default']; 6656 6657/***/ }), 6658/* 66 */ 6659/***/ (function(module, exports, __webpack_require__) { 6660 6661 'use strict'; 6662 6663 var _interopRequireDefault = __webpack_require__(1)['default']; 6664 6665 exports.__esModule = true; 6666 6667 var _utils = __webpack_require__(5); 6668 6669 var _exception = __webpack_require__(6); 6670 6671 var _exception2 = _interopRequireDefault(_exception); 6672 6673 exports['default'] = function (instance) { 6674 instance.registerHelper('if', function (conditional, options) { 6675 if (arguments.length != 2) { 6676 throw new _exception2['default']('#if requires exactly one argument'); 6677 } 6678 if (_utils.isFunction(conditional)) { 6679 conditional = conditional.call(this); 6680 } 6681 6682 // Default behavior is to render the positive path if the value is truthy and not empty. 6683 // The `includeZero` option may be set to treat the condtional as purely not empty based on the 6684 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. 6685 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { 6686 return options.inverse(this); 6687 } else { 6688 return options.fn(this); 6689 } 6690 }); 6691 6692 instance.registerHelper('unless', function (conditional, options) { 6693 if (arguments.length != 2) { 6694 throw new _exception2['default']('#unless requires exactly one argument'); 6695 } 6696 return instance.helpers['if'].call(this, conditional, { 6697 fn: options.inverse, 6698 inverse: options.fn, 6699 hash: options.hash 6700 }); 6701 }); 6702 }; 6703 6704 module.exports = exports['default']; 6705 6706/***/ }), 6707/* 67 */ 6708/***/ (function(module, exports) { 6709 6710 'use strict'; 6711 6712 exports.__esModule = true; 6713 6714 exports['default'] = function (instance) { 6715 instance.registerHelper('log', function () /* message, options */{ 6716 var args = [undefined], 6717 options = arguments[arguments.length - 1]; 6718 for (var i = 0; i < arguments.length - 1; i++) { 6719 args.push(arguments[i]); 6720 } 6721 6722 var level = 1; 6723 if (options.hash.level != null) { 6724 level = options.hash.level; 6725 } else if (options.data && options.data.level != null) { 6726 level = options.data.level; 6727 } 6728 args[0] = level; 6729 6730 instance.log.apply(instance, args); 6731 }); 6732 }; 6733 6734 module.exports = exports['default']; 6735 6736/***/ }), 6737/* 68 */ 6738/***/ (function(module, exports) { 6739 6740 'use strict'; 6741 6742 exports.__esModule = true; 6743 6744 exports['default'] = function (instance) { 6745 instance.registerHelper('lookup', function (obj, field, options) { 6746 if (!obj) { 6747 // Note for 5.0: Change to "obj == null" in 5.0 6748 return obj; 6749 } 6750 return options.lookupProperty(obj, field); 6751 }); 6752 }; 6753 6754 module.exports = exports['default']; 6755 6756/***/ }), 6757/* 69 */ 6758/***/ (function(module, exports, __webpack_require__) { 6759 6760 'use strict'; 6761 6762 var _interopRequireDefault = __webpack_require__(1)['default']; 6763 6764 exports.__esModule = true; 6765 6766 var _utils = __webpack_require__(5); 6767 6768 var _exception = __webpack_require__(6); 6769 6770 var _exception2 = _interopRequireDefault(_exception); 6771 6772 exports['default'] = function (instance) { 6773 instance.registerHelper('with', function (context, options) { 6774 if (arguments.length != 2) { 6775 throw new _exception2['default']('#with requires exactly one argument'); 6776 } 6777 if (_utils.isFunction(context)) { 6778 context = context.call(this); 6779 } 6780 6781 var fn = options.fn; 6782 6783 if (!_utils.isEmpty(context)) { 6784 var data = options.data; 6785 if (options.data && options.ids) { 6786 data = _utils.createFrame(options.data); 6787 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); 6788 } 6789 6790 return fn(context, { 6791 data: data, 6792 blockParams: _utils.blockParams([context], [data && data.contextPath]) 6793 }); 6794 } else { 6795 return options.inverse(this); 6796 } 6797 }); 6798 }; 6799 6800 module.exports = exports['default']; 6801 6802/***/ }), 6803/* 70 */ 6804/***/ (function(module, exports, __webpack_require__) { 6805 6806 'use strict'; 6807 6808 var _interopRequireDefault = __webpack_require__(1)['default']; 6809 6810 exports.__esModule = true; 6811 exports.registerDefaultDecorators = registerDefaultDecorators; 6812 6813 var _decoratorsInline = __webpack_require__(71); 6814 6815 var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline); 6816 6817 function registerDefaultDecorators(instance) { 6818 _decoratorsInline2['default'](instance); 6819 } 6820 6821/***/ }), 6822/* 71 */ 6823/***/ (function(module, exports, __webpack_require__) { 6824 6825 'use strict'; 6826 6827 exports.__esModule = true; 6828 6829 var _utils = __webpack_require__(5); 6830 6831 exports['default'] = function (instance) { 6832 instance.registerDecorator('inline', function (fn, props, container, options) { 6833 var ret = fn; 6834 if (!props.partials) { 6835 props.partials = {}; 6836 ret = function (context, options) { 6837 // Create a new partials stack frame prior to exec. 6838 var original = container.partials; 6839 container.partials = _utils.extend({}, original, props.partials); 6840 var ret = fn(context, options); 6841 container.partials = original; 6842 return ret; 6843 }; 6844 } 6845 6846 props.partials[options.args[0]] = options.fn; 6847 6848 return ret; 6849 }); 6850 }; 6851 6852 module.exports = exports['default']; 6853 6854/***/ }), 6855/* 72 */ 6856/***/ (function(module, exports, __webpack_require__) { 6857 6858 'use strict'; 6859 6860 exports.__esModule = true; 6861 6862 var _utils = __webpack_require__(5); 6863 6864 var logger = { 6865 methodMap: ['debug', 'info', 'warn', 'error'], 6866 level: 'info', 6867 6868 // Maps a given level value to the `methodMap` indexes above. 6869 lookupLevel: function lookupLevel(level) { 6870 if (typeof level === 'string') { 6871 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase()); 6872 if (levelMap >= 0) { 6873 level = levelMap; 6874 } else { 6875 level = parseInt(level, 10); 6876 } 6877 } 6878 6879 return level; 6880 }, 6881 6882 // Can be overridden in the host environment 6883 log: function log(level) { 6884 level = logger.lookupLevel(level); 6885 6886 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) { 6887 var method = logger.methodMap[level]; 6888 // eslint-disable-next-line no-console 6889 if (!console[method]) { 6890 method = 'log'; 6891 } 6892 6893 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 6894 message[_key - 1] = arguments[_key]; 6895 } 6896 6897 console[method].apply(console, message); // eslint-disable-line no-console 6898 } 6899 } 6900 }; 6901 6902 exports['default'] = logger; 6903 module.exports = exports['default']; 6904 6905/***/ }), 6906/* 73 */ 6907/***/ (function(module, exports, __webpack_require__) { 6908 6909 'use strict'; 6910 6911 var _Object$create = __webpack_require__(74)['default']; 6912 6913 var _Object$keys = __webpack_require__(60)['default']; 6914 6915 var _interopRequireDefault = __webpack_require__(1)['default']; 6916 6917 exports.__esModule = true; 6918 exports.createProtoAccessControl = createProtoAccessControl; 6919 exports.resultIsAllowed = resultIsAllowed; 6920 exports.resetLoggedProperties = resetLoggedProperties; 6921 6922 var _
6922createNewLookupObject = __webpack_require__(76); 6923 6924 var _logger = __webpack_require__(72); 6925 6926 var _logger2 = _interopRequireDefault(_logger); 6927 6928 var loggedProperties = _Object$create(null); 6929 6930 function createProtoAccessControl(runtimeOptions) { 6931 var defaultMethodWhiteList = _Object$create(null); 6932 defaultMethodWhiteList['constructor'] = false;
vendor: 11,824 bytes, lines 6933-7281
6933 defaultMethodWhiteList['__defineGetter__'] = false; 6934 defaultMethodWhiteList['__defineSetter__'] = false; 6935 defaultMethodWhiteList['__lookupGetter__'] = false; 6936 6937 var defaultPropertyWhiteList = _Object$create(null); 6938 // eslint-disable-next-line no-proto 6939 defaultPropertyWhiteList['__proto__'] = false; 6940 6941 return { 6942 properties: { 6943 whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties), 6944 defaultValue: runtimeOptions.allowProtoPropertiesByDefault 6945 }, 6946 methods: { 6947 whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods), 6948 defaultValue: runtimeOptions.allowProtoMethodsByDefault 6949 } 6950 }; 6951 } 6952 6953 function resultIsAllowed(result, protoAccessControl, propertyName) { 6954 if (typeof result === 'function') { 6955 return checkWhiteList(protoAccessControl.methods, propertyName); 6956 } else { 6957 return checkWhiteList(protoAccessControl.properties, propertyName); 6958 } 6959 } 6960 6961 function checkWhiteList(protoAccessControlForType, propertyName) { 6962 if (protoAccessControlForType.whitelist[propertyName] !== undefined) { 6963 return protoAccessControlForType.whitelist[propertyName] === true; 6964 } 6965 if (protoAccessControlForType.defaultValue !== undefined) { 6966 return protoAccessControlForType.defaultValue; 6967 } 6968 logUnexpecedPropertyAccessOnce(propertyName); 6969 return false; 6970 } 6971 6972 function logUnexpecedPropertyAccessOnce(propertyName) { 6973 if (loggedProperties[propertyName] !== true) { 6974 loggedProperties[propertyName] = true; 6975 _logger2['default'].log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'); 6976 } 6977 } 6978 6979 function resetLoggedProperties() { 6980 _Object$keys(loggedProperties).forEach(function (propertyName) { 6981 delete loggedProperties[propertyName]; 6982 }); 6983 } 6984 6985/***/ }), 6986/* 74 */ 6987/***/ (function(module, exports, __webpack_require__) { 6988 6989 module.exports = { "default": __webpack_require__(75), __esModule: true }; 6990 6991/***/ }), 6992/* 75 */ 6993/***/ (function(module, exports, __webpack_require__) { 6994 6995 var $ = __webpack_require__(9); 6996 module.exports = function create(P, D){ 6997 return $.create(P, D); 6998 }; 6999 7000/***/ }), 7001/* 76 */ 7002/***/ (function(module, exports, __webpack_require__) { 7003 7004 'use strict'; 7005 7006 var _Object$create = __webpack_require__(74)['default']; 7007 7008 exports.__esModule = true; 7009 exports.createNewLookupObject = createNewLookupObject; 7010 7011 var _utils = __webpack_require__(5); 7012 7013 /** 7014 * Create a new object with "null"-prototype to avoid truthy results on prototype properties. 7015 * The resulting object can be used with "object[property]" to check if a property exists 7016 * @param {...object} sources a varargs parameter of source objects that will be merged 7017 * @returns {object} 7018 */ 7019 7020 function createNewLookupObject() { 7021 for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) { 7022 sources[_key] = arguments[_key]; 7023 } 7024 7025 return _utils.extend.apply(undefined, [_Object$create(null)].concat(sources)); 7026 } 7027 7028/***/ }), 7029/* 77 */ 7030/***/ (function(module, exports) { 7031 7032 // Build out our basic SafeString type 7033 'use strict'; 7034 7035 exports.__esModule = true; 7036 function SafeString(string) { 7037 this.string = string; 7038 } 7039 7040 SafeString.prototype.toString = SafeString.prototype.toHTML = function () { 7041 return '' + this.string; 7042 }; 7043 7044 exports['default'] = SafeString; 7045 module.exports = exports['default']; 7046 7047/***/ }), 7048/* 78 */ 7049/***/ (function(module, exports, __webpack_require__) { 7050 7051 'use strict'; 7052 7053 var _Object$seal = __webpack_require__(79)['default']; 7054 7055 var _Object$keys = __webpack_require__(60)['default']; 7056 7057 var _interopRequireWildcard = __webpack_require__(3)['default']; 7058 7059 var _interopRequireDefault = __webpack_require__(1)['default']; 7060 7061 exports.__esModule = true; 7062 exports.checkRevision = checkRevision; 7063 exports.template = template; 7064 exports.wrapProgram = wrapProgram; 7065 exports.resolvePartial = resolvePartial; 7066 exports.invokePartial = invokePartial; 7067 exports.noop = noop; 7068 7069 var _utils = __webpack_require__(5); 7070 7071 var Utils = _interopRequireWildcard(_utils); 7072 7073 var _exception = __webpack_require__(6); 7074 7075 var _exception2 = _interopRequireDefault(_exception); 7076 7077 var _base = __webpack_require__(4); 7078 7079 var _helpers = __webpack_require__(10); 7080 7081 var _internalWrapHelper = __webpack_require__(82); 7082 7083 var _internalProtoAccess = __webpack_require__(73); 7084 7085 function checkRevision(compilerInfo) { 7086 var compilerRevision = compilerInfo && compilerInfo[0] || 1, 7087 currentRevision = _base.COMPILER_REVISION; 7088 7089 if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) { 7090 return; 7091 } 7092 7093 if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) { 7094 var runtimeVersions = _base.REVISION_CHANGES[currentRevision], 7095 compilerVersions = _base.REVISION_CHANGES[compilerRevision]; 7096 throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); 7097 } else { 7098 // Use the embedded version info since the runtime doesn't know about this revision yet 7099 throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); 7100 } 7101 } 7102 7103 function template(templateSpec, env) { 7104 /* istanbul ignore next */ 7105 if (!env) { 7106 throw new _exception2['default']('No environment passed to template'); 7107 } 7108 if (!templateSpec || !templateSpec.main) { 7109 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); 7110 } 7111 7112 templateSpec.main.decorator = templateSpec.main_d; 7113 7114 // Note: Using env.VM references rather than local var references throughout this section to allow 7115 // for external users to override these as pseudo-supported APIs. 7116 env.VM.checkRevision(templateSpec.compiler); 7117 7118 // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0) 7119 var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7; 7120 7121 function invokePartialWrapper(partial, context, options) { 7122 if (options.hash) { 7123 context = Utils.extend({}, context, options.hash); 7124 if (options.ids) { 7125 options.ids[0] = true; 7126 } 7127 } 7128 partial = env.VM.resolvePartial.call(this, partial, context, options); 7129 7130 var extendedOptions = Utils.extend({}, options, { 7131 hooks: this.hooks, 7132 protoAccessControl: this.protoAccessControl 7133 }); 7134 7135 var result = env.VM.invokePartial.call(this, partial, context, extendedOptions); 7136 7137 if (result == null && env.compile) { 7138 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); 7139 result = options.partials[options.name](context, extendedOptions); 7140 } 7141 if (result != null) { 7142 if (options.indent) { 7143 var lines = result.split('\n'); 7144 for (var i = 0, l = lines.length; i < l; i++) { 7145 if (!lines[i] && i + 1 === l) { 7146 break; 7147 } 7148 7149 lines[i] = options.indent + lines[i]; 7150 } 7151 result = lines.join('\n'); 7152 } 7153 return result; 7154 } else { 7155 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); 7156 } 7157 } 7158 7159 // Just add water 7160 var container = { 7161 strict: function strict(obj, name, loc) { 7162 if (!obj || !(name in obj)) { 7163 throw new _exception2['default']('"' + name + '" not defined in ' + obj, { 7164 loc: loc 7165 }); 7166 } 7167 return container.lookupProperty(obj, name); 7168 }, 7169 lookupProperty: function lookupProperty(parent, propertyName) { 7170 var result = parent[propertyName]; 7171 if (result == null) { 7172 return result; 7173 } 7174 if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { 7175 return result; 7176 } 7177 7178 if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) { 7179 return result; 7180 } 7181 return undefined; 7182 }, 7183 lookup: function lookup(depths, name) { 7184 var len = depths.length; 7185 for (var i = 0; i < len; i++) { 7186 var result = depths[i] && container.lookupProperty(depths[i], name); 7187 if (result != null) { 7188 return depths[i][name]; 7189 } 7190 } 7191 }, 7192 lambda: function lambda(current, context) { 7193 return typeof current === 'function' ? current.call(context) : current; 7194 }, 7195 7196 escapeExpression: Utils.escapeExpression, 7197 invokePartial: invokePartialWrapper, 7198 7199 fn: function fn(i) { 7200 var ret = templateSpec[i]; 7201 ret.decorator = templateSpec[i + '_d']; 7202 return ret; 7203 }, 7204 7205 programs: [], 7206 program: function program(i, data, declaredBlockParams, blockParams, depths) { 7207 var programWrapper = this.programs[i], 7208 fn = this.fn(i); 7209 if (data || depths || blockParams || declaredBlockParams) { 7210 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); 7211 } else if (!programWrapper) { 7212 programWrapper = this.programs[i] = wrapProgram(this, i, fn); 7213 } 7214 return programWrapper; 7215 }, 7216 7217 data: function data(value, depth) { 7218 while (value && depth--) { 7219 value = value._parent; 7220 } 7221 return value; 7222 }, 7223 mergeIfNeeded: function mergeIfNeeded(param, common) { 7224 var obj = param || common; 7225 7226 if (param && common && param !== common) { 7227 obj = Utils.extend({}, common, param); 7228 } 7229 7230 return obj; 7231 }, 7232 // An empty object to use as replacement for null-contexts 7233 nullContext: _Object$seal({}), 7234 7235 noop: env.VM.noop, 7236 compilerInfo: templateSpec.compiler 7237 }; 7238 7239 function ret(context) { 7240 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 7241 7242 var data = options.data; 7243 7244 ret._setup(options); 7245 if (!options.partial && templateSpec.useData) { 7246 data = initData(context, data); 7247 } 7248 var depths = undefined, 7249 blockParams = templateSpec.useBlockParams ? [] : undefined; 7250 if (templateSpec.useDepths) { 7251 if (options.depths) { 7252 depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths; 7253 } else { 7254 depths = [context]; 7255 } 7256 } 7257 7258 function main(context /*, options*/) { 7259 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths); 7260 } 7261 7262 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams); 7263 return main(context, options); 7264 } 7265 7266 ret.isTop = true; 7267 7268 ret._setup = function (options) { 7269 if (!options.partial) { 7270 var mergedHelpers = Utils.extend({}, env.helpers, options.helpers); 7271 wrapHelpersToPassLookupProperty(mergedHelpers, container); 7272 container.helpers = mergedHelpers; 7273 7274 if (templateSpec.usePartial) { 7275 // Use mergeIfNeeded here to prevent compiling global partials multiple times 7276 container.partials = container.mergeIfNeeded(options.partials, env.partials); 7277 } 7278 if (templateSpec.usePartial || templateSpec.useDecorators) { 7279 container.decorators = Utils.extend({}, env.decorators, options.decorators); 7280 } 7281
vendor: 4,565 bytes, lines 7282-7410
7282 container.hooks = {}; 7283 container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options); 7284 7285 var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7; 7286 _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers); 7287 _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers); 7288 } else { 7289 container.protoAccessControl = options.protoAccessControl; // internal option 7290 container.helpers = options.helpers; 7291 container.partials = options.partials; 7292 container.decorators = options.decorators; 7293 container.hooks = options.hooks; 7294 } 7295 }; 7296 7297 ret._child = function (i, data, blockParams, depths) { 7298 if (templateSpec.useBlockParams && !blockParams) { 7299 throw new _exception2['default']('must pass block params'); 7300 } 7301 if (templateSpec.useDepths && !depths) { 7302 throw new _exception2['default']('must pass parent depths'); 7303 } 7304 7305 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); 7306 }; 7307 return ret; 7308 } 7309 7310 function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { 7311 function prog(context) { 7312 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 7313 7314 var currentDepths = depths; 7315 if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) { 7316 currentDepths = [context].concat(depths); 7317 } 7318 7319 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths); 7320 } 7321 7322 prog = executeDecorators(fn, prog, container, depths, data, blockParams); 7323 7324 prog.program = i; 7325 prog.depth = depths ? depths.length : 0; 7326 prog.blockParams = declaredBlockParams || 0; 7327 return prog; 7328 } 7329 7330 /** 7331 * This is currently part of the official API, therefore implementation details should not be changed. 7332 */ 7333 7334 function resolvePartial(partial, context, options) { 7335 if (!partial) { 7336 if (options.name === '@partial-block') { 7337 partial = options.data['partial-block']; 7338 } else { 7339 partial = options.partials[options.name]; 7340 } 7341 } else if (!partial.call && !options.name) { 7342 // This is a dynamic partial that returned a string 7343 options.name = partial; 7344 partial = options.partials[partial]; 7345 } 7346 return partial; 7347 } 7348 7349 function invokePartial(partial, context, options) { 7350 // Use the current closure context to save the partial-block if this partial 7351 var currentPartialBlock = options.data && options.data['partial-block']; 7352 options.partial = true; 7353 if (options.ids) { 7354 options.data.contextPath = options.ids[0] || options.data.contextPath; 7355 } 7356 7357 var partialBlock = undefined; 7358 if (options.fn && options.fn !== noop) { 7359 (function () { 7360 options.data = _base.createFrame(options.data); 7361 // Wrapper function to get access to currentPartialBlock from the closure 7362 var fn = options.fn; 7363 partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) { 7364 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 7365 7366 // Restore the partial-block from the closure for the execution of the block 7367 // i.e. the part inside the block of the partial call. 7368 options.data = _base.createFrame(options.data); 7369 options.data['partial-block'] = currentPartialBlock; 7370 return fn(context, options); 7371 }; 7372 if (fn.partials) { 7373 options.partials = Utils.extend({}, options.partials, fn.partials); 7374 } 7375 })(); 7376 } 7377 7378 if (partial === undefined && partialBlock) { 7379 partial = partialBlock; 7380 } 7381 7382 if (partial === undefined) { 7383 throw new _exception2['default']('The partial ' + options.name + ' could not be found'); 7384 } else if (partial instanceof Function) { 7385 return partial(context, options); 7386 } 7387 } 7388 7389 function noop() { 7390 return ''; 7391 } 7392 7393 function initData(context, data) { 7394 if (!data || !('root' in data)) { 7395 data = data ? _base.createFrame(data) : {}; 7396 data.root = context; 7397 } 7398 return data; 7399 } 7400 7401 function executeDecorators(fn, prog, container, depths, data, blockParams) { 7402 if (fn.decorator) { 7403 var props = {}; 7404 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths); 7405 Utils.extend(prog, props); 7406 } 7407 return prog; 7408 } 7409 7410 function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
vendor: 9,825 bytes, lines 7411-7646
7411 _Object$keys(mergedHelpers).forEach(function (helperName) { 7412 var helper = mergedHelpers[helperName]; 7413 mergedHelpers[helperName] = passLookupPropertyOption(helper, container); 7414 }); 7415 } 7416 7417 function passLookupPropertyOption(helper, container) { 7418 var lookupProperty = container.lookupProperty; 7419 return _internalWrapHelper.wrapHelper(helper, function (options) { 7420 return Utils.extend({ lookupProperty: lookupProperty }, options); 7421 }); 7422 } 7423 7424/***/ }), 7425/* 79 */ 7426/***/ (function(module, exports, __webpack_require__) { 7427 7428 module.exports = { "default": __webpack_require__(80), __esModule: true }; 7429 7430/***/ }), 7431/* 80 */ 7432/***/ (function(module, exports, __webpack_require__) { 7433 7434 __webpack_require__(81); 7435 module.exports = __webpack_require__(21).Object.seal; 7436 7437/***/ }), 7438/* 81 */ 7439/***/ (function(module, exports, __webpack_require__) { 7440 7441 // 19.1.2.17 Object.seal(O) 7442 var isObject = __webpack_require__(40); 7443 7444 __webpack_require__(64)('seal', function($seal){ 7445 return function seal(it){ 7446 return $seal && isObject(it) ? $seal(it) : it; 7447 }; 7448 }); 7449 7450/***/ }), 7451/* 82 */ 7452/***/ (function(module, exports) { 7453 7454 'use strict'; 7455 7456 exports.__esModule = true; 7457 exports.wrapHelper = wrapHelper; 7458 7459 function wrapHelper(helper, transformOptionsFn) { 7460 if (typeof helper !== 'function') { 7461 // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639 7462 // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function. 7463 return helper; 7464 } 7465 var wrapper = function wrapper() /* dynamic arguments */{ 7466 var options = arguments[arguments.length - 1]; 7467 arguments[arguments.length - 1] = transformOptionsFn(options); 7468 return helper.apply(this, arguments); 7469 }; 7470 return wrapper; 7471 } 7472 7473/***/ }), 7474/* 83 */ 7475/***/ (function(module, exports) { 7476 7477 /* global globalThis */ 7478 'use strict'; 7479 7480 exports.__esModule = true; 7481 7482 exports['default'] = function (Handlebars) { 7483 /* istanbul ignore next */ 7484 // https://mathiasbynens.be/notes/globalthis 7485 (function () { 7486 if (typeof globalThis === 'object') return; 7487 Object.prototype.__defineGetter__('__magic__', function () { 7488 return this; 7489 }); 7490 __magic__.globalThis = __magic__; // eslint-disable-line no-undef 7491 delete Object.prototype.__magic__; 7492 })(); 7493 7494 var $Handlebars = globalThis.Handlebars; 7495 7496 /* istanbul ignore next */ 7497 Handlebars.noConflict = function () { 7498 if (globalThis.Handlebars === Handlebars) { 7499 globalThis.Handlebars = $Handlebars; 7500 } 7501 return Handlebars; 7502 }; 7503 }; 7504 7505 module.exports = exports['default']; 7506 7507/***/ }), 7508/* 84 */ 7509/***/ (function(module, exports) { 7510 7511 'use strict'; 7512 7513 exports.__esModule = true; 7514 var AST = { 7515 // Public API used to evaluate derived attributes regarding AST nodes 7516 helpers: { 7517 // a mustache is definitely a helper if: 7518 // * it is an eligible helper, and 7519 // * it has at least one parameter or hash segment 7520 helperExpression: function helperExpression(node) { 7521 return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash); 7522 }, 7523 7524 scopedId: function scopedId(path) { 7525 return (/^\.|this\b/.test(path.original) 7526 ); 7527 }, 7528 7529 // an ID is simple if it only has one part, and that part is not 7530 // `..` or `this`. 7531 simpleId: function simpleId(path) { 7532 return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth; 7533 } 7534 } 7535 }; 7536 7537 // Must be exported as an object rather than the root of the module as the jison lexer 7538 // must modify the object to operate properly. 7539 exports['default'] = AST; 7540 module.exports = exports['default']; 7541 7542/***/ }), 7543/* 85 */ 7544/***/ (function(module, exports, __webpack_require__) { 7545 7546 'use strict'; 7547 7548 var _interopRequireDefault = __webpack_require__(1)['default']; 7549 7550 var _interopRequireWildcard = __webpack_require__(3)['default']; 7551 7552 exports.__esModule = true; 7553 exports.parseWithoutProcessing = parseWithoutProcessing; 7554 exports.parse = parse; 7555 7556 var _parser = __webpack_require__(86); 7557 7558 var _parser2 = _interopRequireDefault(_parser); 7559 7560 var _whitespaceControl = __webpack_require__(87); 7561 7562 var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl); 7563 7564 var _helpers = __webpack_require__(89); 7565 7566 var Helpers = _interopRequireWildcard(_helpers); 7567 7568 var _utils = __webpack_require__(5); 7569 7570 exports.parser = _parser2['default']; 7571 7572 var yy = {}; 7573 _utils.extend(yy, Helpers); 7574 7575 function parseWithoutProcessing(input, options) { 7576 // Just return if an already-compiled AST was passed in. 7577 if (input.type === 'Program') { 7578 return input; 7579 } 7580 7581 _parser2['default'].yy = yy; 7582 7583 // Altering the shared object here, but this is ok as parser is a sync operation 7584 yy.locInfo = function (locInfo) { 7585 return new yy.SourceLocation(options && options.srcName, locInfo); 7586 }; 7587 7588 var ast = _parser2['default'].parse(input); 7589 7590 return ast; 7591 } 7592 7593 function parse(input, options) { 7594 var ast = parseWithoutProcessing(input, options); 7595 var strip = new _whitespaceControl2['default'](options); 7596 7597 return strip.accept(ast); 7598 } 7599 7600/***/ }), 7601/* 86 */ 7602/***/ (function(module, exports) { 7603 7604 // File ignored in coverage tests via setting in .istanbul.yml 7605 /* Jison generated parser */ 7606 "use strict"; 7607 7608 exports.__esModule = true; 7609 var handlebars = (function () { 7610 var parser = { trace: function trace() {}, 7611 yy: {}, 7612 symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 }, 7613 terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" }, 7614 productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]], 7615 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { 7616 7617 var $0 = $$.length - 1; 7618 switch (yystate) { 7619 case 1: 7620 return $$[$0 - 1]; 7621 break; 7622 case 2: 7623 this.$ = yy.prepareProgram($$[$0]); 7624 break; 7625 case 3: 7626 this.$ = $$[$0]; 7627 break; 7628 case 4: 7629 this.$ = $$[$0]; 7630 break; 7631 case 5: 7632 this.$ = $$[$0]; 7633 break; 7634 case 6: 7635 this.$ = $$[$0]; 7636 break; 7637 case 7: 7638 this.$ = $$[$0]; 7639 break; 7640 case 8: 7641 this.$ = $$[$0]; 7642 break; 7643 case 9: 7644 this.$ = { 7645 type: 'CommentStatement', 7646 value: yy.stripComment($$[$0]),
vendor: 8,910 bytes, lines 7647-7867
7647 strip: yy.stripFlags($$[$0], $$[$0]), 7648 loc: yy.locInfo(this._$) 7649 }; 7650 7651 break; 7652 case 10: 7653 this.$ = { 7654 type: 'ContentStatement', 7655 original: $$[$0], 7656 value: $$[$0], 7657 loc: yy.locInfo(this._$) 7658 }; 7659 7660 break; 7661 case 11: 7662 this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 7663 break; 7664 case 12: 7665 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] }; 7666 break; 7667 case 13: 7668 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$); 7669 break; 7670 case 14: 7671 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$); 7672 break; 7673 case 15: 7674 this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 7675 break; 7676 case 16: 7677 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 7678 break; 7679 case 17: 7680 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 7681 break; 7682 case 18: 7683 this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] }; 7684 break; 7685 case 19: 7686 var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$), 7687 program = yy.prepareProgram([inverse], $$[$0 - 1].loc); 7688 program.chained = true; 7689 7690 this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true }; 7691 7692 break; 7693 case 20: 7694 this.$ = $$[$0]; 7695 break; 7696 case 21: 7697 this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) }; 7698 break; 7699 case 22: 7700 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 7701 break; 7702 case 23: 7703 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 7704 break; 7705 case 24: 7706 this.$ = { 7707 type: 'PartialStatement', 7708 name: $$[$0 - 3], 7709 params: $$[$0 - 2], 7710 hash: $$[$0 - 1], 7711 indent: '', 7712 strip: yy.stripFlags($$[$0 - 4], $$[$0]), 7713 loc: yy.locInfo(this._$) 7714 }; 7715 7716 break; 7717 case 25: 7718 this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 7719 break; 7720 case 26: 7721 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) }; 7722 break; 7723 case 27: 7724 this.$ = $$[$0]; 7725 break; 7726 case 28: 7727 this.$ = $$[$0]; 7728 break; 7729 case 29: 7730 this.$ = { 7731 type: 'SubExpression', 7732 path: $$[$0 - 3], 7733 params: $$[$0 - 2], 7734 hash: $$[$0 - 1], 7735 loc: yy.locInfo(this._$) 7736 }; 7737 7738 break; 7739 case 30: 7740 this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) }; 7741 break; 7742 case 31: 7743 this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) }; 7744 break; 7745 case 32: 7746 this.$ = yy.id($$[$0 - 1]); 7747 break; 7748 case 33: 7749 this.$ = $$[$0]; 7750 break; 7751 case 34: 7752 this.$ = $$[$0]; 7753 break; 7754 case 35: 7755 this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) }; 7756 break; 7757 case 36: 7758 this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) }; 7759 break; 7760 case 37: 7761 this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) }; 7762 break; 7763 case 38: 7764 this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) }; 7765 break; 7766 case 39: 7767 this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) }; 7768 break; 7769 case 40: 7770 this.$ = $$[$0]; 7771 break; 7772 case 41: 7773 this.$ = $$[$0]; 7774 break; 7775 case 42: 7776 this.$ = yy.preparePath(true, $$[$0], this._$); 7777 break; 7778 case 43: 7779 this.$ = yy.preparePath(false, $$[$0], this._$); 7780 break; 7781 case 44: 7782 $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2]; 7783 break; 7784 case 45: 7785 this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }]; 7786 break; 7787 case 46: 7788 this.$ = []; 7789 break; 7790 case 47: 7791 $$[$0 - 1].push($$[$0]); 7792 break; 7793 case 48: 7794 this.$ = []; 7795 break; 7796 case 49: 7797 $$[$0 - 1].push($$[$0]); 7798 break; 7799 case 50: 7800 this.$ = []; 7801 break; 7802 case 51: 7803 $$[$0 - 1].push($$[$0]); 7804 break; 7805 case 58: 7806 this.$ = []; 7807 break; 7808 case 59: 7809 $$[$0 - 1].push($$[$0]); 7810 break; 7811 case 64: 7812 this.$ = []; 7813 break; 7814 case 65: 7815 $$[$0 - 1].push($$[$0]); 7816 break; 7817 case 70: 7818 this.$ = []; 7819 break; 7820 case 71: 7821 $$[$0 - 1].push($$[$0]); 7822 break; 7823 case 78: 7824 this.$ = []; 7825 break; 7826 case 79: 7827 $$[$0 - 1].push($$[$0]); 7828 break; 7829 case 82: 7830 this.$ = []; 7831 break; 7832 case 83: 7833 $$[$0 - 1].push($$[$0]); 7834 break; 7835 case 86: 7836 this.$ = []; 7837 break; 7838 case 87: 7839 $$[$0 - 1].push($$[$0]); 7840 break; 7841 case 90: 7842 this.$ = []; 7843 break; 7844 case 91: 7845 $$[$0 - 1].push($$[$0]); 7846 break; 7847 case 94: 7848 this.$ = []; 7849 break; 7850 case 95: 7851 $$[$0 - 1].push($$[$0]); 7852 break; 7853 case 98: 7854 this.$ = [$$[$0]]; 7855 break; 7856 case 99: 7857 $$[$0 - 1].push($$[$0]); 7858 break; 7859 case 100: 7860 this.$ = [$$[$0]]; 7861 break; 7862 case 101: 7863 $$[$0 - 1].push($$[$0]); 7864 break; 7865 } 7866 }, 7867
vendor: 11,456 bytes, line 7867
7867 table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 85, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 86, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }
vendor: 22,841 bytes, lines 7867-8329
7867, { 33: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }], 7868 defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] }, 7869 parseError: function parseError(str, hash) { 7870 throw new Error(str); 7871 }, 7872 parse: function parse(input) { 7873 var self = this, 7874 stack = [0], 7875 vstack = [null], 7876 lstack = [], 7877 table = this.table, 7878 yytext = "", 7879 yylineno = 0, 7880 yyleng = 0, 7881 recovering = 0, 7882 TERROR = 2, 7883 EOF = 1; 7884 this.lexer.setInput(input); 7885 this.lexer.yy = this.yy; 7886 this.yy.lexer = this.lexer; 7887 this.yy.parser = this; 7888 if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {}; 7889 var yyloc = this.lexer.yylloc; 7890 lstack.push(yyloc); 7891 var ranges = this.lexer.options && this.lexer.options.ranges; 7892 if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError; 7893 function popStack(n) { 7894 stack.length = stack.length - 2 * n; 7895 vstack.length = vstack.length - n; 7896 lstack.length = lstack.length - n; 7897 } 7898 function lex() { 7899 var token; 7900 token = self.lexer.lex() || 1; 7901 if (typeof token !== "number") { 7902 token = self.symbols_[token] || token; 7903 } 7904 return token; 7905 } 7906 var symbol, 7907 preErrorSymbol, 7908 state, 7909 action, 7910 a, 7911 r, 7912 yyval = {}, 7913 p, 7914 len, 7915 newState, 7916 expected; 7917 while (true) { 7918 state = stack[stack.length - 1]; 7919 if (this.defaultActions[state]) { 7920 action = this.defaultActions[state]; 7921 } else { 7922 if (symbol === null || typeof symbol == "undefined") { 7923 symbol = lex(); 7924 } 7925 action = table[state] && table[state][symbol]; 7926 } 7927 if (typeof action === "undefined" || !action.length || !action[0]) { 7928 var errStr = ""; 7929 if (!recovering) { 7930 expected = []; 7931 for (p in table[state]) if (this.terminals_[p] && p > 2) { 7932 expected.push("'" + this.terminals_[p] + "'"); 7933 } 7934 if (this.lexer.showPosition) { 7935 errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; 7936 } else { 7937 errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); 7938 } 7939 this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected }); 7940 } 7941 } 7942 if (action[0] instanceof Array && action.length > 1) { 7943 throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); 7944 } 7945 switch (action[0]) { 7946 case 1: 7947 stack.push(symbol); 7948 vstack.push(this.lexer.yytext); 7949 lstack.push(this.lexer.yylloc); 7950 stack.push(action[1]); 7951 symbol = null; 7952 if (!preErrorSymbol) { 7953 yyleng = this.lexer.yyleng; 7954 yytext = this.lexer.yytext; 7955 yylineno = this.lexer.yylineno; 7956 yyloc = this.lexer.yylloc; 7957 if (recovering > 0) recovering--; 7958 } else { 7959 symbol = preErrorSymbol; 7960 preErrorSymbol = null; 7961 } 7962 break; 7963 case 2: 7964 len = this.productions_[action[1]][1]; 7965 yyval.$ = vstack[vstack.length - len]; 7966 yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; 7967 if (ranges) { 7968 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; 7969 } 7970 r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); 7971 if (typeof r !== "undefined") { 7972 return r; 7973 } 7974 if (len) { 7975 stack = stack.slice(0, -1 * len * 2); 7976 vstack = vstack.slice(0, -1 * len); 7977 lstack = lstack.slice(0, -1 * len); 7978 } 7979 stack.push(this.productions_[action[1]][0]); 7980 vstack.push(yyval.$); 7981 lstack.push(yyval._$); 7982 newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; 7983 stack.push(newState); 7984 break; 7985 case 3: 7986 return true; 7987 } 7988 } 7989 return true; 7990 } 7991 }; 7992 /* Jison generated lexer */ 7993 var lexer = (function () { 7994 var lexer = { EOF: 1, 7995 parseError: function parseError(str, hash) { 7996 if (this.yy.parser) { 7997 this.yy.parser.parseError(str, hash); 7998 } else { 7999 throw new Error(str); 8000 } 8001 }, 8002 setInput: function setInput(input) { 8003 this._input = input; 8004 this._more = this._less = this.done = false; 8005 this.yylineno = this.yyleng = 0; 8006 this.yytext = this.matched = this.match = ''; 8007 this.conditionStack = ['INITIAL']; 8008 this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; 8009 if (this.options.ranges) this.yylloc.range = [0, 0]; 8010 this.offset = 0; 8011 return this; 8012 }, 8013 input: function input() { 8014 var ch = this._input[0]; 8015 this.yytext += ch; 8016 this.yyleng++; 8017 this.offset++; 8018 this.match += ch; 8019 this.matched += ch; 8020 var lines = ch.match(/(?:\r\n?|\n).*/g); 8021 if (lines) { 8022 this.yylineno++; 8023 this.yylloc.last_line++; 8024 } else { 8025 this.yylloc.last_column++; 8026 } 8027 if (this.options.ranges) this.yylloc.range[1]++; 8028 8029 this._input = this._input.slice(1); 8030 return ch; 8031 }, 8032 unput: function unput(ch) { 8033 var len = ch.length; 8034 var lines = ch.split(/(?:\r\n?|\n)/g); 8035 8036 this._input = ch + this._input; 8037 this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); 8038 //this.yyleng -= len; 8039 this.offset -= len; 8040 var oldLines = this.match.split(/(?:\r\n?|\n)/g); 8041 this.match = this.match.substr(0, this.match.length - 1); 8042 this.matched = this.matched.substr(0, this.matched.length - 1); 8043 8044 if (lines.length - 1) this.yylineno -= lines.length - 1; 8045 var r = this.yylloc.range; 8046 8047 this.yylloc = { first_line: this.yylloc.first_line, 8048 last_line: this.yylineno + 1, 8049 first_column: this.yylloc.first_column, 8050 last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len 8051 }; 8052 8053 if (this.options.ranges) { 8054 this.yylloc.range = [r[0], r[0] + this.yyleng - len]; 8055 } 8056 return this; 8057 }, 8058 more: function more() { 8059 this._more = true; 8060 return this; 8061 }, 8062 less: function less(n) { 8063 this.unput(this.match.slice(n)); 8064 }, 8065 pastInput: function pastInput() { 8066 var past = this.matched.substr(0, this.matched.length - this.match.length); 8067 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, ""); 8068 }, 8069 upcomingInput: function upcomingInput() { 8070 var next = this.match; 8071 if (next.length < 20) { 8072 next += this._input.substr(0, 20 - next.length); 8073 } 8074 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); 8075 }, 8076 showPosition: function showPosition() { 8077 var pre = this.pastInput(); 8078 var c = new Array(pre.length + 1).join("-"); 8079 return pre + this.upcomingInput() + "\n" + c + "^"; 8080 }, 8081 next: function next() { 8082 if (this.done) { 8083 return this.EOF; 8084 } 8085 if (!this._input) this.done = true; 8086 8087 var token, match, tempMatch, index, col, lines; 8088 if (!this._more) { 8089 this.yytext = ''; 8090 this.match = ''; 8091 } 8092 var rules = this._currentRules(); 8093 for (var i = 0; i < rules.length; i++) { 8094 tempMatch = this._input.match(this.rules[rules[i]]); 8095 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { 8096 match = tempMatch; 8097 index = i; 8098 if (!this.options.flex) break; 8099 } 8100 } 8101 if (match) { 8102 lines = match[0].match(/(?:\r\n?|\n).*/g); 8103 if (lines) this.yylineno += lines.length; 8104 this.yylloc = { first_line: this.yylloc.last_line, 8105 last_line: this.yylineno + 1, 8106 first_column: this.yylloc.last_column, 8107 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; 8108 this.yytext += match[0]; 8109 this.match += match[0]; 8110 this.matches = match; 8111 this.yyleng = this.yytext.length; 8112 if (this.options.ranges) { 8113 this.yylloc.range = [this.offset, this.offset += this.yyleng]; 8114 } 8115 this._more = false; 8116 this._input = this._input.slice(match[0].length); 8117 this.matched += match[0]; 8118 token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]); 8119 if (this.done && this._input) this.done = false; 8120 if (token) return token;else return; 8121 } 8122 if (this._input === "") { 8123 return this.EOF; 8124 } else { 8125 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); 8126 } 8127 }, 8128 lex: function lex() { 8129 var r = this.next(); 8130 if (typeof r !== 'undefined') { 8131 return r; 8132 } else { 8133 return this.lex(); 8134 } 8135 }, 8136 begin: function begin(condition) { 8137 this.conditionStack.push(condition); 8138 }, 8139 popState: function popState() { 8140 return this.conditionStack.pop(); 8141 }, 8142 _currentRules: function _currentRules() { 8143 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; 8144 }, 8145 topState: function topState() { 8146 return this.conditionStack[this.conditionStack.length - 2]; 8147 }, 8148 pushState: function begin(condition) { 8149 this.begin(condition); 8150 } }; 8151 lexer.options = {}; 8152 lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { 8153 8154 function strip(start, end) { 8155 return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start); 8156 } 8157 8158 var YYSTATE = YY_START; 8159 switch ($avoiding_name_collisions) { 8160 case 0: 8161 if (yy_.yytext.slice(-2) === "\\\\") { 8162 strip(0, 1); 8163 this.begin("mu"); 8164 } else if (yy_.yytext.slice(-1) === "\\") { 8165 strip(0, 1); 8166 this.begin("emu"); 8167 } else { 8168 this.begin("mu"); 8169 } 8170 if (yy_.yytext) return 15; 8171 8172 break; 8173 case 1: 8174 return 15; 8175 break; 8176 case 2: 8177 this.popState(); 8178 return 15; 8179 8180 break; 8181 case 3: 8182 this.begin('raw');return 15; 8183 break; 8184 case 4: 8185 this.popState(); 8186 // Should be using `this.topState()` below, but it currently 8187 // returns the second top instead of the first top. Opened an 8188 // issue about it at https://github.com/zaach/jison/issues/291 8189 if (this.conditionStack[this.conditionStack.length - 1] === 'raw') { 8190 return 15; 8191 } else { 8192 strip(5, 9); 8193 return 'END_RAW_BLOCK'; 8194 } 8195 8196 break; 8197 case 5: 8198 return 15; 8199 break; 8200 case 6: 8201 this.popState(); 8202 return 14; 8203 8204 break; 8205 case 7: 8206 return 65; 8207 break; 8208 case 8: 8209 return 68; 8210 break; 8211 case 9: 8212 return 19; 8213 break; 8214 case 10: 8215 this.popState(); 8216 this.begin('raw'); 8217 return 23; 8218 8219 break; 8220 case 11: 8221 return 55; 8222 break; 8223 case 12: 8224 return 60; 8225 break; 8226 case 13: 8227 return 29; 8228 break; 8229 case 14: 8230 return 47; 8231 break; 8232 case 15: 8233 this.popState();return 44; 8234 break; 8235 case 16: 8236 this.popState();return 44; 8237 break; 8238 case 17: 8239 return 34; 8240 break; 8241 case 18: 8242 return 39; 8243 break; 8244 case 19: 8245 return 51; 8246 break; 8247 case 20: 8248 return 48; 8249 break; 8250 case 21: 8251 this.unput(yy_.yytext); 8252 this.popState(); 8253 this.begin('com'); 8254 8255 break; 8256 case 22: 8257 this.popState(); 8258 return 14; 8259 8260 break; 8261 case 23: 8262 return 48; 8263 break; 8264 case 24: 8265 return 73; 8266 break; 8267 case 25: 8268 return 72; 8269 break; 8270 case 26: 8271 return 72; 8272 break; 8273 case 27: 8274 return 87; 8275 break; 8276 case 28: 8277 // ignore whitespace 8278 break; 8279 case 29: 8280 this.popState();return 54; 8281 break; 8282 case 30: 8283 this.popState();return 33; 8284 break; 8285 case 31: 8286 yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80; 8287 break; 8288 case 32: 8289 yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80; 8290 break; 8291 case 33: 8292 return 85; 8293 break; 8294 case 34: 8295 return 82; 8296 break; 8297 case 35: 8298 return 82; 8299 break; 8300 case 36: 8301 return 83; 8302 break; 8303 case 37: 8304 return 84; 8305 break; 8306 case 38: 8307 return 81; 8308 break; 8309 case 39: 8310 return 75; 8311 break; 8312 case 40: 8313 return 77; 8314 break; 8315 case 41: 8316 return 72; 8317 break; 8318 case 42: 8319 yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72; 8320 break; 8321 case 43: 8322 return 'INVALID'; 8323 break; 8324 case 44: 8325 return 5; 8326 break; 8327 } 8328 }; 8329 lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^
8329/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/]; 8330 lexer.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } }; 8331 return lexer;
vendor: 10,902 bytes, lines 8332-8709
8332 })(); 8333 parser.lexer = lexer; 8334 function Parser() { 8335 this.yy = {}; 8336 }Parser.prototype = parser;parser.Parser = Parser; 8337 return new Parser(); 8338 })();exports["default"] = handlebars; 8339 module.exports = exports["default"]; 8340 8341/***/ }), 8342/* 87 */ 8343/***/ (function(module, exports, __webpack_require__) { 8344 8345 'use strict'; 8346 8347 var _interopRequireDefault = __webpack_require__(1)['default']; 8348 8349 exports.__esModule = true; 8350 8351 var _visitor = __webpack_require__(88); 8352 8353 var _visitor2 = _interopRequireDefault(_visitor); 8354 8355 function WhitespaceControl() { 8356 var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; 8357 8358 this.options = options; 8359 } 8360 WhitespaceControl.prototype = new _visitor2['default'](); 8361 8362 WhitespaceControl.prototype.Program = function (program) { 8363 var doStandalone = !this.options.ignoreStandalone; 8364 8365 var isRoot = !this.isRootSeen; 8366 this.isRootSeen = true; 8367 8368 var body = program.body; 8369 for (var i = 0, l = body.length; i < l; i++) { 8370 var current = body[i], 8371 strip = this.accept(current); 8372 8373 if (!strip) { 8374 continue; 8375 } 8376 8377 var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), 8378 _isNextWhitespace = isNextWhitespace(body, i, isRoot), 8379 openStandalone = strip.openStandalone && _isPrevWhitespace, 8380 closeStandalone = strip.closeStandalone && _isNextWhitespace, 8381 inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; 8382 8383 if (strip.close) { 8384 omitRight(body, i, true); 8385 } 8386 if (strip.open) { 8387 omitLeft(body, i, true); 8388 } 8389 8390 if (doStandalone && inlineStandalone) { 8391 omitRight(body, i); 8392 8393 if (omitLeft(body, i)) { 8394 // If we are on a standalone node, save the indent info for partials 8395 if (current.type === 'PartialStatement') { 8396 // Pull out the whitespace from the final line 8397 current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]; 8398 } 8399 } 8400 } 8401 if (doStandalone && openStandalone) { 8402 omitRight((current.program || current.inverse).body); 8403 8404 // Strip out the previous content node if it's whitespace only 8405 omitLeft(body, i); 8406 } 8407 if (doStandalone && closeStandalone) { 8408 // Always strip the next node 8409 omitRight(body, i); 8410 8411 omitLeft((current.inverse || current.program).body); 8412 } 8413 } 8414 8415 return program; 8416 }; 8417 8418 WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) { 8419 this.accept(block.program); 8420 this.accept(block.inverse); 8421 8422 // Find the inverse program that is involed with whitespace stripping. 8423 var program = block.program || block.inverse, 8424 inverse = block.program && block.inverse, 8425 firstInverse = inverse, 8426 lastInverse = inverse; 8427 8428 if (inverse && inverse.chained) { 8429 firstInverse = inverse.body[0].program; 8430 8431 // Walk the inverse chain to find the last inverse that is actually in the chain. 8432 while (lastInverse.chained) { 8433 lastInverse = lastInverse.body[lastInverse.body.length - 1].program; 8434 } 8435 } 8436 8437 var strip = { 8438 open: block.openStrip.open, 8439 close: block.closeStrip.close, 8440 8441 // Determine the standalone candiacy. Basically flag our content as being possibly standalone 8442 // so our parent can determine if we actually are standalone 8443 openStandalone: isNextWhitespace(program.body), 8444 closeStandalone: isPrevWhitespace((firstInverse || program).body) 8445 }; 8446 8447 if (block.openStrip.close) { 8448 omitRight(program.body, null, true); 8449 } 8450 8451 if (inverse) { 8452 var inverseStrip = block.inverseStrip; 8453 8454 if (inverseStrip.open) { 8455 omitLeft(program.body, null, true); 8456 } 8457 8458 if (inverseStrip.close) { 8459 omitRight(firstInverse.body, null, true); 8460 } 8461 if (block.closeStrip.open) { 8462 omitLeft(lastInverse.body, null, true); 8463 } 8464 8465 // Find standalone else statments 8466 if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) { 8467 omitLeft(program.body); 8468 omitRight(firstInverse.body); 8469 } 8470 } else if (block.closeStrip.open) { 8471 omitLeft(program.body, null, true); 8472 } 8473 8474 return strip; 8475 }; 8476 8477 WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) { 8478 return mustache.strip; 8479 }; 8480 8481 WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) { 8482 /* istanbul ignore next */ 8483 var strip = node.strip || {}; 8484 return { 8485 inlineStandalone: true, 8486 open: strip.open, 8487 close: strip.close 8488 }; 8489 }; 8490 8491 function isPrevWhitespace(body, i, isRoot) { 8492 if (i === undefined) { 8493 i = body.length; 8494 } 8495 8496 // Nodes that end with newlines are considered whitespace (but are special 8497 // cased for strip operations) 8498 var prev = body[i - 1], 8499 sibling = body[i - 2]; 8500 if (!prev) { 8501 return isRoot; 8502 } 8503 8504 if (prev.type === 'ContentStatement') { 8505 return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original); 8506 } 8507 } 8508 function isNextWhitespace(body, i, isRoot) { 8509 if (i === undefined) { 8510 i = -1; 8511 } 8512 8513 var next = body[i + 1], 8514 sibling = body[i + 2]; 8515 if (!next) { 8516 return isRoot; 8517 } 8518 8519 if (next.type === 'ContentStatement') { 8520 return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original); 8521 } 8522 } 8523 8524 // Marks the node to the right of the position as omitted. 8525 // I.e. {{foo}}' ' will mark the ' ' node as omitted. 8526 // 8527 // If i is undefined, then the first child will be marked as such. 8528 // 8529 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 8530 // content is met. 8531 function omitRight(body, i, multiple) { 8532 var current = body[i == null ? 0 : i + 1]; 8533 if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) { 8534 return; 8535 } 8536 8537 var original = current.value; 8538 current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, ''); 8539 current.rightStripped = current.value !== original; 8540 } 8541 8542 // Marks the node to the left of the position as omitted. 8543 // I.e. ' '{{foo}} will mark the ' ' node as omitted. 8544 // 8545 // If i is undefined then the last child will be marked as such. 8546 // 8547 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 8548 // content is met. 8549 function omitLeft(body, i, multiple) { 8550 var current = body[i == null ? body.length - 1 : i - 1]; 8551 if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) { 8552 return; 8553 } 8554 8555 // We omit the last node if it's whitespace only and not preceded by a non-content node. 8556 var original = current.value; 8557 current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, ''); 8558 current.leftStripped = current.value !== original; 8559 return current.leftStripped; 8560 } 8561 8562 exports['default'] = WhitespaceControl; 8563 module.exports = exports['default']; 8564 8565/***/ }), 8566/* 88 */ 8567/***/ (function(module, exports, __webpack_require__) { 8568 8569 'use strict'; 8570 8571 var _interopRequireDefault = __webpack_require__(1)['default']; 8572 8573 exports.__esModule = true; 8574 8575 var _exception = __webpack_require__(6); 8576 8577 var _exception2 = _interopRequireDefault(_exception); 8578 8579 function Visitor() { 8580 this.parents = []; 8581 } 8582 8583 Visitor.prototype = { 8584 constructor: Visitor, 8585 mutating: false, 8586 8587 // Visits a given value. If mutating, will replace the value if necessary. 8588 acceptKey: function acceptKey(node, name) { 8589 var value = this.accept(node[name]); 8590 if (this.mutating) { 8591 // Hacky sanity check: This may have a few false positives for type for the helper 8592 // methods but will generally do the right thing without a lot of overhead. 8593 if (value && !Visitor.prototype[value.type]) { 8594 throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); 8595 } 8596 node[name] = value; 8597 } 8598 }, 8599 8600 // Performs an accept operation with added sanity check to ensure 8601 // required keys are not removed. 8602 acceptRequired: function acceptRequired(node, name) { 8603 this.acceptKey(node, name); 8604 8605 if (!node[name]) { 8606 throw new _exception2['default'](node.type + ' requires ' + name); 8607 } 8608 }, 8609 8610 // Traverses a given array. If mutating, empty respnses will be removed 8611 // for child elements. 8612 acceptArray: function acceptArray(array) { 8613 for (var i = 0, l = array.length; i < l; i++) { 8614 this.acceptKey(array, i); 8615 8616 if (!array[i]) { 8617 array.splice(i, 1); 8618 i--; 8619 l--; 8620 } 8621 } 8622 }, 8623 8624 accept: function accept(object) { 8625 if (!object) { 8626 return; 8627 } 8628 8629 /* istanbul ignore next: Sanity code */ 8630 if (!this[object.type]) { 8631 throw new _exception2['default']('Unknown type: ' + object.type, object); 8632 } 8633 8634 if (this.current) { 8635 this.parents.unshift(this.current); 8636 } 8637 this.current = object; 8638 8639 var ret = this[object.type](object); 8640 8641 this.current = this.parents.shift(); 8642 8643 if (!this.mutating || ret) { 8644 return ret; 8645 } else if (ret !== false) { 8646 return object; 8647 } 8648 }, 8649 8650 Program: function Program(program) { 8651 this.acceptArray(program.body); 8652 }, 8653 8654 MustacheStatement: visitSubExpression, 8655 Decorator: visitSubExpression, 8656 8657 BlockStatement: visitBlock, 8658 DecoratorBlock: visitBlock, 8659 8660 PartialStatement: visitPartial, 8661 PartialBlockStatement: function PartialBlockStatement(partial) { 8662 visitPartial.call(this, partial); 8663 8664 this.acceptKey(partial, 'program'); 8665 }, 8666 8667 ContentStatement: function ContentStatement() /* content */{}, 8668 CommentStatement: function CommentStatement() /* comment */{}, 8669 8670 SubExpression: visitSubExpression, 8671 8672 PathExpression: function PathExpression() /* path */{}, 8673 8674 StringLiteral: function StringLiteral() /* string */{}, 8675 NumberLiteral: function NumberLiteral() /* number */{}, 8676 BooleanLiteral: function BooleanLiteral() /* bool */{}, 8677 UndefinedLiteral: function UndefinedLiteral() /* literal */{}, 8678 NullLiteral: function NullLiteral() /* literal */{}, 8679 8680 Hash: function Hash(hash) { 8681 this.acceptArray(hash.pairs); 8682 }, 8683 HashPair: function HashPair(pair) { 8684 this.acceptRequired(pair, 'value'); 8685 } 8686 }; 8687 8688 function visitSubExpression(mustache) { 8689 this.acceptRequired(mustache, 'path'); 8690 this.acceptArray(mustache.params); 8691 this.acceptKey(mustache, 'hash'); 8692 } 8693 function visitBlock(block) { 8694 visitSubExpression.call(this, block); 8695 8696 this.acceptKey(block, 'program'); 8697 this.acceptKey(block, 'inverse'); 8698 } 8699 function visitPartial(partial) { 8700 this.acceptRequired(partial, 'name'); 8701 this.acceptArray(partial.params); 8702 this.acceptKey(partial, 'hash'); 8703 } 8704 8705 exports['default'] = Visitor; 8706 module.exports = exports['default']; 8707 8708/***/ }), 8709/* 89
vendor: 5,593 bytes, lines 8709-8940
8709 */ 8710/***/ (function(module, exports, __webpack_require__) { 8711 8712 'use strict'; 8713 8714 var _interopRequireDefault = __webpack_require__(1)['default']; 8715 8716 exports.__esModule = true; 8717 exports.SourceLocation = SourceLocation; 8718 exports.id = id; 8719 exports.stripFlags = stripFlags; 8720 exports.stripComment = stripComment; 8721 exports.preparePath = preparePath; 8722 exports.prepareMustache = prepareMustache; 8723 exports.prepareRawBlock = prepareRawBlock; 8724 exports.prepareBlock = prepareBlock; 8725 exports.prepareProgram = prepareProgram; 8726 exports.preparePartialBlock = preparePartialBlock; 8727 8728 var _exception = __webpack_require__(6); 8729 8730 var _exception2 = _interopRequireDefault(_exception); 8731 8732 function validateClose(open, close) { 8733 close = close.path ? close.path.original : close; 8734 8735 if (open.path.original !== close) { 8736 var errorNode = { loc: open.path.loc }; 8737 8738 throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode); 8739 } 8740 } 8741 8742 function SourceLocation(source, locInfo) { 8743 this.source = source; 8744 this.start = { 8745 line: locInfo.first_line, 8746 column: locInfo.first_column 8747 }; 8748 this.end = { 8749 line: locInfo.last_line, 8750 column: locInfo.last_column 8751 }; 8752 } 8753 8754 function id(token) { 8755 if (/^\[.*\]$/.test(token)) { 8756 return token.substring(1, token.length - 1); 8757 } else { 8758 return token; 8759 } 8760 } 8761 8762 function stripFlags(open, close) { 8763 return { 8764 open: open.charAt(2) === '~', 8765 close: close.charAt(close.length - 3) === '~' 8766 }; 8767 } 8768 8769 function stripComment(comment) { 8770 return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, ''); 8771 } 8772 8773 function preparePath(data, parts, loc) { 8774 loc = this.locInfo(loc); 8775 8776 var original = data ? '@' : '', 8777 dig = [], 8778 depth = 0; 8779 8780 for (var i = 0, l = parts.length; i < l; i++) { 8781 var part = parts[i].part, 8782 8783 // If we have [] syntax then we do not treat path references as operators, 8784 // i.e. foo.[this] resolves to approximately context.foo['this'] 8785 isLiteral = parts[i].original !== part; 8786 original += (parts[i].separator || '') + part; 8787 8788 if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { 8789 if (dig.length > 0) { 8790 throw new _exception2['default']('Invalid path: ' + original, { loc: loc }); 8791 } else if (part === '..') { 8792 depth++; 8793 } 8794 } else { 8795 dig.push(part); 8796 } 8797 } 8798 8799 return { 8800 type: 'PathExpression', 8801 data: data, 8802 depth: depth, 8803 parts: dig, 8804 original: original, 8805 loc: loc 8806 }; 8807 } 8808 8809 function prepareMustache(path, params, hash, open, strip, locInfo) { 8810 // Must use charAt to support IE pre-10 8811 var escapeFlag = open.charAt(3) || open.charAt(2), 8812 escaped = escapeFlag !== '{' && escapeFlag !== '&'; 8813 8814 var decorator = /\*/.test(open); 8815 return { 8816 type: decorator ? 'Decorator' : 'MustacheStatement', 8817 path: path, 8818 params: params, 8819 hash: hash, 8820 escaped: escaped, 8821 strip: strip, 8822 loc: this.locInfo(locInfo) 8823 }; 8824 } 8825 8826 function prepareRawBlock(openRawBlock, contents, close, locInfo) { 8827 validateClose(openRawBlock, close); 8828 8829 locInfo = this.locInfo(locInfo); 8830 var program = { 8831 type: 'Program', 8832 body: contents, 8833 strip: {}, 8834 loc: locInfo 8835 }; 8836 8837 return { 8838 type: 'BlockStatement', 8839 path: openRawBlock.path, 8840 params: openRawBlock.params, 8841 hash: openRawBlock.hash, 8842 program: program, 8843 openStrip: {}, 8844 inverseStrip: {}, 8845 closeStrip: {}, 8846 loc: locInfo 8847 }; 8848 } 8849 8850 function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { 8851 if (close && close.path) { 8852 validateClose(openBlock, close); 8853 } 8854 8855 var decorator = /\*/.test(openBlock.open); 8856 8857 program.blockParams = openBlock.blockParams; 8858 8859 var inverse = undefined, 8860 inverseStrip = undefined; 8861 8862 if (inverseAndProgram) { 8863 if (decorator) { 8864 throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram); 8865 } 8866 8867 if (inverseAndProgram.chain) { 8868 inverseAndProgram.program.body[0].closeStrip = close.strip; 8869 } 8870 8871 inverseStrip = inverseAndProgram.strip; 8872 inverse = inverseAndProgram.program; 8873 } 8874 8875 if (inverted) { 8876 inverted = inverse; 8877 inverse = program; 8878 program = inverted; 8879 } 8880 8881 return { 8882 type: decorator ? 'DecoratorBlock' : 'BlockStatement', 8883 path: openBlock.path, 8884 params: openBlock.params, 8885 hash: openBlock.hash, 8886 program: program, 8887 inverse: inverse, 8888 openStrip: openBlock.strip, 8889 inverseStrip: inverseStrip, 8890 closeStrip: close && close.strip, 8891 loc: this.locInfo(locInfo) 8892 }; 8893 } 8894 8895 function prepareProgram(statements, loc) { 8896 if (!loc && statements.length) { 8897 var firstLoc = statements[0].loc, 8898 lastLoc = statements[statements.length - 1].loc; 8899 8900 /* istanbul ignore else */ 8901 if (firstLoc && lastLoc) { 8902 loc = { 8903 source: firstLoc.source, 8904 start: { 8905 line: firstLoc.start.line, 8906 column: firstLoc.start.column 8907 }, 8908 end: { 8909 line: lastLoc.end.line, 8910 column: lastLoc.end.column 8911 } 8912 }; 8913 } 8914 } 8915 8916 return { 8917 type: 'Program', 8918 body: statements, 8919 strip: {}, 8920 loc: loc 8921 }; 8922 } 8923 8924 function preparePartialBlock(open, program, close, locInfo) { 8925 validateClose(open, close); 8926 8927 return { 8928 type: 'PartialBlockStatement', 8929 name: open.path, 8930 params: open.params, 8931 hash: open.hash, 8932 program: program, 8933 openStrip: open.strip, 8934 closeStrip: close && close.strip, 8935 loc: this.locInfo(locInfo) 8936 }; 8937 } 8938 8939/***/ }), 8940/*
vendor: 2,262 bytes, lines 8940-9024
894090 */ 8941/***/ (function(module, exports, __webpack_require__) { 8942 8943 /* eslint-disable new-cap */ 8944 8945 'use strict'; 8946 8947 var _Object$create = __webpack_require__(74)['default']; 8948 8949 var _interopRequireDefault = __webpack_require__(1)['default']; 8950 8951 exports.__esModule = true; 8952 exports.Compiler = Compiler; 8953 exports.precompile = precompile; 8954 exports.compile = compile; 8955 8956 var _exception = __webpack_require__(6); 8957 8958 var _exception2 = _interopRequireDefault(_exception); 8959 8960 var _utils = __webpack_require__(5); 8961 8962 var _ast = __webpack_require__(84); 8963 8964 var _ast2 = _interopRequireDefault(_ast); 8965 8966 var slice = [].slice; 8967 8968 function Compiler() {} 8969 8970 // the foundHelper register will disambiguate helper lookup from finding a 8971 // function in a context. This is necessary for mustache compatibility, which 8972 // requires that context functions in blocks are evaluated by blockHelperMissing, 8973 // and then proceed as if the resulting value was provided to blockHelperMissing. 8974 8975 Compiler.prototype = { 8976 compiler: Compiler, 8977 8978 equals: function equals(other) { 8979 var len = this.opcodes.length; 8980 if (other.opcodes.length !== len) { 8981 return false; 8982 } 8983 8984 for (var i = 0; i < len; i++) { 8985 var opcode = this.opcodes[i], 8986 otherOpcode = other.opcodes[i]; 8987 if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { 8988 return false; 8989 } 8990 } 8991 8992 // We know that length is the same between the two arrays because they are directly tied 8993 // to the opcode behavior above. 8994 len = this.children.length; 8995 for (var i = 0; i < len; i++) { 8996 if (!this.children[i].equals(other.children[i])) { 8997 return false; 8998 } 8999 } 9000 9001 return true; 9002 }, 9003 9004 guid: 0, 9005 9006 compile: function compile(program, options) { 9007 this.sourceNode = []; 9008 this.opcodes = []; 9009 this.children = []; 9010 this.options = options; 9011 this.stringParams = options.stringParams; 9012 this.trackIds = options.trackIds; 9013 9014 options.blockParams = options.blockParams || []; 9015 9016 options.knownHelpers = _utils.extend(_Object$create(null), { 9017 helperMissing: true, 9018 blockHelperMissing: true, 9019 each: true, 9020 'if': true, 9021 unless: true, 9022 'with': true, 9023 log: true, 9024 lookup
vendor: 6,900 bytes, lines 9024-9252
9024: true 9025 }, options.knownHelpers); 9026 9027 return this.accept(program); 9028 }, 9029 9030 compileProgram: function compileProgram(program) { 9031 var childCompiler = new this.compiler(), 9032 // eslint-disable-line new-cap 9033 result = childCompiler.compile(program, this.options), 9034 guid = this.guid++; 9035 9036 this.usePartial = this.usePartial || result.usePartial; 9037 9038 this.children[guid] = result; 9039 this.useDepths = this.useDepths || result.useDepths; 9040 9041 return guid; 9042 }, 9043 9044 accept: function accept(node) { 9045 /* istanbul ignore next: Sanity code */ 9046 if (!this[node.type]) { 9047 throw new _exception2['default']('Unknown type: ' + node.type, node); 9048 } 9049 9050 this.sourceNode.unshift(node); 9051 var ret = this[node.type](node); 9052 this.sourceNode.shift(); 9053 return ret; 9054 }, 9055 9056 Program: function Program(program) { 9057 this.options.blockParams.unshift(program.blockParams); 9058 9059 var body = program.body, 9060 bodyLength = body.length; 9061 for (var i = 0; i < bodyLength; i++) { 9062 this.accept(body[i]); 9063 } 9064 9065 this.options.blockParams.shift(); 9066 9067 this.isSimple = bodyLength === 1; 9068 this.blockParams = program.blockParams ? program.blockParams.length : 0; 9069 9070 return this; 9071 }, 9072 9073 BlockStatement: function BlockStatement(block) { 9074 transformLiteralToPath(block); 9075 9076 var program = block.program, 9077 inverse = block.inverse; 9078 9079 program = program && this.compileProgram(program); 9080 inverse = inverse && this.compileProgram(inverse); 9081 9082 var type = this.classifySexpr(block); 9083 9084 if (type === 'helper') { 9085 this.helperSexpr(block, program, inverse); 9086 } else if (type === 'simple') { 9087 this.simpleSexpr(block); 9088 9089 // now that the simple mustache is resolved, we need to 9090 // evaluate it by executing `blockHelperMissing` 9091 this.opcode('pushProgram', program); 9092 this.opcode('pushProgram', inverse); 9093 this.opcode('emptyHash'); 9094 this.opcode('blockValue', block.path.original); 9095 } else { 9096 this.ambiguousSexpr(block, program, inverse); 9097 9098 // now that the simple mustache is resolved, we need to 9099 // evaluate it by executing `blockHelperMissing` 9100 this.opcode('pushProgram', program); 9101 this.opcode('pushProgram', inverse); 9102 this.opcode('emptyHash'); 9103 this.opcode('ambiguousBlockValue'); 9104 } 9105 9106 this.opcode('append'); 9107 }, 9108 9109 DecoratorBlock: function DecoratorBlock(decorator) { 9110 var program = decorator.program && this.compileProgram(decorator.program); 9111 var params = this.setupFullMustacheParams(decorator, program, undefined), 9112 path = decorator.path; 9113 9114 this.useDecorators = true; 9115 this.opcode('registerDecorator', params.length, path.original); 9116 }, 9117 9118 PartialStatement: function PartialStatement(partial) { 9119 this.usePartial = true; 9120 9121 var program = partial.program; 9122 if (program) { 9123 program = this.compileProgram(partial.program); 9124 } 9125 9126 var params = partial.params; 9127 if (params.length > 1) { 9128 throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial); 9129 } else if (!params.length) { 9130 if (this.options.explicitPartialContext) { 9131 this.opcode('pushLiteral', 'undefined'); 9132 } else { 9133 params.push({ type: 'PathExpression', parts: [], depth: 0 }); 9134 } 9135 } 9136 9137 var partialName = partial.name.original, 9138 isDynamic = partial.name.type === 'SubExpression'; 9139 if (isDynamic) { 9140 this.accept(partial.name); 9141 } 9142 9143 this.setupFullMustacheParams(partial, program, undefined, true); 9144 9145 var indent = partial.indent || ''; 9146 if (this.options.preventIndent && indent) { 9147 this.opcode('appendContent', indent); 9148 indent = ''; 9149 } 9150 9151 this.opcode('invokePartial', isDynamic, partialName, indent); 9152 this.opcode('append'); 9153 }, 9154 PartialBlockStatement: function PartialBlockStatement(partialBlock) { 9155 this.PartialStatement(partialBlock); 9156 }, 9157 9158 MustacheStatement: function MustacheStatement(mustache) { 9159 this.SubExpression(mustache); 9160 9161 if (mustache.escaped && !this.options.noEscape) { 9162 this.opcode('appendEscaped'); 9163 } else { 9164 this.opcode('append'); 9165 } 9166 }, 9167 Decorator: function Decorator(decorator) { 9168 this.DecoratorBlock(decorator); 9169 }, 9170 9171 ContentStatement: function ContentStatement(content) { 9172 if (content.value) { 9173 this.opcode('appendContent', content.value); 9174 } 9175 }, 9176 9177 CommentStatement: function CommentStatement() {}, 9178 9179 SubExpression: function SubExpression(sexpr) { 9180 transformLiteralToPath(sexpr); 9181 var type = this.classifySexpr(sexpr); 9182 9183 if (type === 'simple') { 9184 this.simpleSexpr(sexpr); 9185 } else if (type === 'helper') { 9186 this.helperSexpr(sexpr); 9187 } else { 9188 this.ambiguousSexpr(sexpr); 9189 } 9190 }, 9191 ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) { 9192 var path = sexpr.path, 9193 name = path.parts[0], 9194 isBlock = program != null || inverse != null; 9195 9196 this.opcode('getContext', path.depth); 9197 9198 this.opcode('pushProgram', program); 9199 this.opcode('pushProgram', inverse); 9200 9201 path.strict = true; 9202 this.accept(path); 9203 9204 this.opcode('invokeAmbiguous', name, isBlock); 9205 }, 9206 9207 simpleSexpr: function simpleSexpr(sexpr) { 9208 var path = sexpr.path; 9209 path.strict = true; 9210 this.accept(path); 9211 this.opcode('resolvePossibleLambda'); 9212 }, 9213 9214 helperSexpr: function helperSexpr(sexpr, program, inverse) { 9215 var params = this.setupFullMustacheParams(sexpr, program, inverse), 9216 path = sexpr.path, 9217 name = path.parts[0]; 9218 9219 if (this.options.knownHelpers[name]) { 9220 this.opcode('invokeKnownHelper', params.length, name); 9221 } else if (this.options.knownHelpersOnly) { 9222 throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); 9223 } else { 9224 path.strict = true; 9225 path.falsy = true; 9226 9227 this.accept(path); 9228 this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path)); 9229 } 9230 }, 9231 9232 PathExpression: function PathExpression(path) { 9233 this.addDepth(path.depth); 9234 this.opcode('getContext', path.depth); 9235 9236 var name = path.parts[0], 9237 scoped = _ast2['default'].helpers.scopedId(path), 9238 blockParamId = !path.depth && !scoped && this.blockParamIndex(name); 9239 9240 if (blockParamId) { 9241 this.opcode('lookupBlockParam', blockParamId, path.parts); 9242 } else if (!name) { 9243 // Context reference, i.e. `{{foo .}}` or `{{foo ..}}` 9244 this.opcode('pushContext'); 9245 } else if (path.data) { 9246 this.options.data = true; 9247 this.opcode('lookupData', path.depth, path.parts, path.strict); 9248 } else { 9249 this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped); 9250 } 9251 }, 9252
vendor: 7,256 bytes, lines 9253-9511
9253 StringLiteral: function StringLiteral(string) { 9254 this.opcode('pushString', string.value); 9255 }, 9256 9257 NumberLiteral: function NumberLiteral(number) { 9258 this.opcode('pushLiteral', number.value); 9259 }, 9260 9261 BooleanLiteral: function BooleanLiteral(bool) { 9262 this.opcode('pushLiteral', bool.value); 9263 }, 9264 9265 UndefinedLiteral: function UndefinedLiteral() { 9266 this.opcode('pushLiteral', 'undefined'); 9267 }, 9268 9269 NullLiteral: function NullLiteral() { 9270 this.opcode('pushLiteral', 'null'); 9271 }, 9272 9273 Hash: function Hash(hash) { 9274 var pairs = hash.pairs, 9275 i = 0, 9276 l = pairs.length; 9277 9278 this.opcode('pushHash'); 9279 9280 for (; i < l; i++) { 9281 this.pushParam(pairs[i].value); 9282 } 9283 while (i--) { 9284 this.opcode('assignToHash', pairs[i].key); 9285 } 9286 this.opcode('popHash'); 9287 }, 9288 9289 // HELPERS 9290 opcode: function opcode(name) { 9291 this.opcodes.push({ 9292 opcode: name, 9293 args: slice.call(arguments, 1), 9294 loc: this.sourceNode[0].loc 9295 }); 9296 }, 9297 9298 addDepth: function addDepth(depth) { 9299 if (!depth) { 9300 return; 9301 } 9302 9303 this.useDepths = true; 9304 }, 9305 9306 classifySexpr: function classifySexpr(sexpr) { 9307 var isSimple = _ast2['default'].helpers.simpleId(sexpr.path); 9308 9309 var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); 9310 9311 // a mustache is an eligible helper if: 9312 // * its id is simple (a single part, not `this` or `..`) 9313 var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr); 9314 9315 // if a mustache is an eligible helper but not a definite 9316 // helper, it is ambiguous, and will be resolved in a later 9317 // pass or at runtime. 9318 var isEligible = !isBlockParam && (isHelper || isSimple); 9319 9320 // if ambiguous, we can possibly resolve the ambiguity now 9321 // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc. 9322 if (isEligible && !isHelper) { 9323 var _name = sexpr.path.parts[0], 9324 options = this.options; 9325 if (options.knownHelpers[_name]) { 9326 isHelper = true; 9327 } else if (options.knownHelpersOnly) { 9328 isEligible = false; 9329 } 9330 } 9331 9332 if (isHelper) { 9333 return 'helper'; 9334 } else if (isEligible) { 9335 return 'ambiguous'; 9336 } else { 9337 return 'simple'; 9338 } 9339 }, 9340 9341 pushParams: function pushParams(params) { 9342 for (var i = 0, l = params.length; i < l; i++) { 9343 this.pushParam(params[i]); 9344 } 9345 }, 9346 9347 pushParam: function pushParam(val) { 9348 var value = val.value != null ? val.value : val.original || ''; 9349 9350 if (this.stringParams) { 9351 if (value.replace) { 9352 value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.'); 9353 } 9354 9355 if (val.depth) { 9356 this.addDepth(val.depth); 9357 } 9358 this.opcode('getContext', val.depth || 0); 9359 this.opcode('pushStringParam', value, val.type); 9360 9361 if (val.type === 'SubExpression') { 9362 // SubExpressions get evaluated and passed in 9363 // in string params mode. 9364 this.accept(val); 9365 } 9366 } else { 9367 if (this.trackIds) { 9368 var blockParamIndex = undefined; 9369 if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) { 9370 blockParamIndex = this.blockParamIndex(val.parts[0]); 9371 } 9372 if (blockParamIndex) { 9373 var blockParamChild = val.parts.slice(1).join('.'); 9374 this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild); 9375 } else { 9376 value = val.original || value; 9377 if (value.replace) { 9378 value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, ''); 9379 } 9380 9381 this.opcode('pushId', val.type, value); 9382 } 9383 } 9384 this.accept(val); 9385 } 9386 }, 9387 9388 setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) { 9389 var params = sexpr.params; 9390 this.pushParams(params); 9391 9392 this.opcode('pushProgram', program); 9393 this.opcode('pushProgram', inverse); 9394 9395 if (sexpr.hash) { 9396 this.accept(sexpr.hash); 9397 } else { 9398 this.opcode('emptyHash', omitEmpty); 9399 } 9400 9401 return params; 9402 }, 9403 9404 blockParamIndex: function blockParamIndex(name) { 9405 for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) { 9406 var blockParams = this.options.blockParams[depth], 9407 param = blockParams && _utils.indexOf(blockParams, name); 9408 if (blockParams && param >= 0) { 9409 return [depth, param]; 9410 } 9411 } 9412 } 9413 }; 9414 9415 function precompile(input, options, env) { 9416 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 9417 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); 9418 } 9419 9420 options = options || {}; 9421 if (!('data' in options)) { 9422 options.data = true; 9423 } 9424 if (options.compat) { 9425 options.useDepths = true; 9426 } 9427 9428 var ast = env.parse(input, options), 9429 environment = new env.Compiler().compile(ast, options); 9430 return new env.JavaScriptCompiler().compile(environment, options); 9431 } 9432 9433 function compile(input, options, env) { 9434 if (options === undefined) options = {}; 9435 9436 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 9437 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); 9438 } 9439 9440 options = _utils.extend({}, options); 9441 if (!('data' in options)) { 9442 options.data = true; 9443 } 9444 if (options.compat) { 9445 options.useDepths = true; 9446 } 9447 9448 var compiled = undefined; 9449 9450 function compileInput() { 9451 var ast = env.parse(input, options), 9452 environment = new env.Compiler().compile(ast, options), 9453 templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); 9454 return env.template(templateSpec); 9455 } 9456 9457 // Template is only compiled on first use and cached after that point. 9458 function ret(context, execOptions) { 9459 if (!compiled) { 9460 compiled = compileInput(); 9461 } 9462 return compiled.call(this, context, execOptions); 9463 } 9464 ret._setup = function (setupOptions) { 9465 if (!compiled) { 9466 compiled = compileInput(); 9467 } 9468 return compiled._setup(setupOptions); 9469 }; 9470 ret._child = function (i, data, blockParams, depths) { 9471 if (!compiled) { 9472 compiled = compileInput(); 9473 } 9474 return compiled._child(i, data, blockParams, depths); 9475 }; 9476 return ret; 9477 } 9478 9479 function argEquals(a, b) { 9480 if (a === b) { 9481 return true; 9482 } 9483 9484 if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) { 9485 for (var i = 0; i < a.length; i++) { 9486 if (!argEquals(a[i], b[i])) { 9487 return false; 9488 } 9489 } 9490 return true; 9491 } 9492 } 9493 9494 function transformLiteralToPath(sexpr) { 9495 if (!sexpr.path.parts) { 9496 var literal = sexpr.path; 9497 // Casting to string here to make false and 0 literal values play nicely with the rest 9498 // of the system. 9499 sexpr.path = { 9500 type: 'PathExpression', 9501 data: false, 9502 depth: 0, 9503 parts: [literal.original + ''], 9504 original: literal.original + '', 9505 loc: literal.loc 9506 }; 9507 } 9508 } 9509 9510/***/ }), 9511/* 9
vendor: 5,335 bytes, lines 9511-9680
95111 */ 9512/***/ (function(module, exports, __webpack_require__) { 9513 9514 'use strict'; 9515 9516 var _Object$keys = __webpack_require__(60)['default']; 9517 9518 var _interopRequireDefault = __webpack_require__(1)['default']; 9519 9520 exports.__esModule = true; 9521 9522 var _base = __webpack_require__(4); 9523 9524 var _exception = __webpack_require__(6); 9525 9526 var _exception2 = _interopRequireDefault(_exception); 9527 9528 var _utils = __webpack_require__(5); 9529 9530 var _codeGen = __webpack_require__(92); 9531 9532 var _codeGen2 = _interopRequireDefault(_codeGen); 9533 9534 function Literal(value) { 9535 this.value = value; 9536 } 9537 9538 function JavaScriptCompiler() {} 9539 9540 JavaScriptCompiler.prototype = { 9541 // PUBLIC API: You can override these methods in a subclass to provide 9542 // alternative compiled forms for name lookup and buffering semantics 9543 nameLookup: function nameLookup(parent, name /*, type */) { 9544 return this.internalNameLookup(parent, name); 9545 }, 9546 depthedLookup: function depthedLookup(name) { 9547 return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')']; 9548 }, 9549 9550 compilerInfo: function compilerInfo() { 9551 var revision = _base.COMPILER_REVISION, 9552 versions = _base.REVISION_CHANGES[revision]; 9553 return [revision, versions]; 9554 }, 9555 9556 appendToBuffer: function appendToBuffer(source, location, explicit) { 9557 // Force a source as this simplifies the merge logic. 9558 if (!_utils.isArray(source)) { 9559 source = [source]; 9560 } 9561 source = this.source.wrap(source, location); 9562 9563 if (this.environment.isSimple) { 9564 return ['return ', source, ';']; 9565 } else if (explicit) { 9566 // This is a case where the buffer operation occurs as a child of another 9567 // construct, generally braces. We have to explicitly output these buffer 9568 // operations to ensure that the emitted code goes in the correct location. 9569 return ['buffer += ', source, ';']; 9570 } else { 9571 source.appendToBuffer = true; 9572 return source; 9573 } 9574 }, 9575 9576 initializeBuffer: function initializeBuffer() { 9577 return this.quotedString(''); 9578 }, 9579 // END PUBLIC API 9580 internalNameLookup: function internalNameLookup(parent, name) { 9581 this.lookupPropertyFunctionIsUsed = true; 9582 return ['lookupProperty(', parent, ',', JSON.stringify(name), ')']; 9583 }, 9584 9585 lookupPropertyFunctionIsUsed: false, 9586 9587 compile: function compile(environment, options, context, asObject) { 9588 this.environment = environment; 9589 this.options = options; 9590 this.stringParams = this.options.stringParams; 9591 this.trackIds = this.options.trackIds; 9592 this.precompile = !asObject; 9593 9594 this.name = this.environment.name; 9595 this.isChild = !!context; 9596 this.context = context || { 9597 decorators: [], 9598 programs: [], 9599 environments: [] 9600 }; 9601 9602 this.preamble(); 9603 9604 this.stackSlot = 0; 9605 this.stackVars = []; 9606 this.aliases = {}; 9607 this.registers = { list: [] }; 9608 this.hashes = []; 9609 this.compileStack = []; 9610 this.inlineStack = []; 9611 this.blockParams = []; 9612 9613 this.compileChildren(environment, options); 9614 9615 this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat; 9616 this.useBlockParams = this.useBlockParams || environment.useBlockParams; 9617 9618 var opcodes = environment.opcodes, 9619 opcode = undefined, 9620 firstLoc = undefined, 9621 i = undefined, 9622 l = undefined; 9623 9624 for (i = 0, l = opcodes.length; i < l; i++) { 9625 opcode = opcodes[i]; 9626 9627 this.source.currentLocation = opcode.loc; 9628 firstLoc = firstLoc || opcode.loc; 9629 this[opcode.opcode].apply(this, opcode.args); 9630 } 9631 9632 // Flush any trailing content that might be pending. 9633 this.source.currentLocation = firstLoc; 9634 this.pushSource(''); 9635 9636 /* istanbul ignore next */ 9637 if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { 9638 throw new _exception2['default']('Compile completed with content left on stack'); 9639 } 9640 9641 if (!this.decorators.isEmpty()) { 9642 this.useDecorators = true; 9643 9644 this.decorators.prepend(['var decorators = container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']); 9645 this.decorators.push('return fn;'); 9646 9647 if (asObject) { 9648 this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]); 9649 } else { 9650 this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n'); 9651 this.decorators.push('}\n'); 9652 this.decorators = this.decorators.merge(); 9653 } 9654 } else { 9655 this.decorators = undefined; 9656 } 9657 9658 var fn = this.createFunctionContext(asObject); 9659 if (!this.isChild) { 9660 var ret = { 9661 compiler: this.compilerInfo(), 9662 main: fn 9663 }; 9664 9665 if (this.decorators) { 9666 ret.main_d = this.decorators; // eslint-disable-line camelcase 9667 ret.useDecorators = true; 9668 } 9669 9670 var _context = this.context; 9671 var programs = _context.programs; 9672 var decorators = _context.decorators; 9673 9674 for (i = 0, l = programs.length; i < l; i++) { 9675 if (programs[i]) { 9676 ret[i] = programs[i]; 9677 if (decorators[i]) { 9678 ret[i + '_d'] = decorators[i]; 9679 ret.useDecorators = true; 9680 }
vendor: 10,178 bytes, lines 9680-10006
9680 9681 } 9682 } 9683 9684 if (this.environment.usePartial) { 9685 ret.usePartial = true; 9686 } 9687 if (this.options.data) { 9688 ret.useData = true; 9689 } 9690 if (this.useDepths) { 9691 ret.useDepths = true; 9692 } 9693 if (this.useBlockParams) { 9694 ret.useBlockParams = true; 9695 } 9696 if (this.options.compat) { 9697 ret.compat = true; 9698 } 9699 9700 if (!asObject) { 9701 ret.compiler = JSON.stringify(ret.compiler); 9702 9703 this.source.currentLocation = { start: { line: 1, column: 0 } }; 9704 ret = this.objectLiteral(ret); 9705 9706 if (options.srcName) { 9707 ret = ret.toStringWithSourceMap({ file: options.destName }); 9708 ret.map = ret.map && ret.map.toString(); 9709 } else { 9710 ret = ret.toString(); 9711 } 9712 } else { 9713 ret.compilerOptions = this.options; 9714 } 9715 9716 return ret; 9717 } else { 9718 return fn; 9719 } 9720 }, 9721 9722 preamble: function preamble() { 9723 // track the last context pushed into place to allow skipping the 9724 // getContext opcode when it would be a noop 9725 this.lastContext = 0; 9726 this.source = new _codeGen2['default'](this.options.srcName); 9727 this.decorators = new _codeGen2['default'](this.options.srcName); 9728 }, 9729 9730 createFunctionContext: function createFunctionContext(asObject) { 9731 // istanbul ignore next 9732 9733 var _this = this; 9734 9735 var varDeclarations = ''; 9736 9737 var locals = this.stackVars.concat(this.registers.list); 9738 if (locals.length > 0) { 9739 varDeclarations += ', ' + locals.join(', '); 9740 } 9741 9742 // Generate minimizer alias mappings 9743 // 9744 // When using true SourceNodes, this will update all references to the given alias 9745 // as the source nodes are reused in situ. For the non-source node compilation mode, 9746 // aliases will not be used, but this case is already being run on the client and 9747 // we aren't concern about minimizing the template size. 9748 var aliasCount = 0; 9749 _Object$keys(this.aliases).forEach(function (alias) { 9750 var node = _this.aliases[alias]; 9751 if (node.children && node.referenceCount > 1) { 9752 varDeclarations += ', alias' + ++aliasCount + '=' + alias; 9753 node.children[0] = 'alias' + aliasCount; 9754 } 9755 }); 9756 9757 if (this.lookupPropertyFunctionIsUsed) { 9758 varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration(); 9759 } 9760 9761 var params = ['container', 'depth0', 'helpers', 'partials', 'data']; 9762 9763 if (this.useBlockParams || this.useDepths) { 9764 params.push('blockParams'); 9765 } 9766 if (this.useDepths) { 9767 params.push('depths'); 9768 } 9769 9770 // Perform a second pass over the output to merge content when possible 9771 var source = this.mergeSource(varDeclarations); 9772 9773 if (asObject) { 9774 params.push(source); 9775 9776 return Function.apply(this, params); 9777 } else { 9778 return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); 9779 } 9780 }, 9781 mergeSource: function mergeSource(varDeclarations) { 9782 var isSimple = this.environment.isSimple, 9783 appendOnly = !this.forceBuffer, 9784 appendFirst = undefined, 9785 sourceSeen = undefined, 9786 bufferStart = undefined, 9787 bufferEnd = undefined; 9788 this.source.each(function (line) { 9789 if (line.appendToBuffer) { 9790 if (bufferStart) { 9791 line.prepend(' + '); 9792 } else { 9793 bufferStart = line; 9794 } 9795 bufferEnd = line; 9796 } else { 9797 if (bufferStart) { 9798 if (!sourceSeen) { 9799 appendFirst = true; 9800 } else { 9801 bufferStart.prepend('buffer += '); 9802 } 9803 bufferEnd.add(';'); 9804 bufferStart = bufferEnd = undefined; 9805 } 9806 9807 sourceSeen = true; 9808 if (!isSimple) { 9809 appendOnly = false; 9810 } 9811 } 9812 }); 9813 9814 if (appendOnly) { 9815 if (bufferStart) { 9816 bufferStart.prepend('return '); 9817 bufferEnd.add(';'); 9818 } else if (!sourceSeen) { 9819 this.source.push('return "";'); 9820 } 9821 } else { 9822 varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); 9823 9824 if (bufferStart) { 9825 bufferStart.prepend('return buffer + '); 9826 bufferEnd.add(';'); 9827 } else { 9828 this.source.push('return buffer;'); 9829 } 9830 } 9831 9832 if (varDeclarations) { 9833 this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); 9834 } 9835 9836 return this.source.merge(); 9837 }, 9838 9839 lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() { 9840 return '\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n '.trim(); 9841 }, 9842 9843 // [blockValue] 9844 // 9845 // On stack, before: hash, inverse, program, value 9846 // On stack, after: return value of blockHelperMissing 9847 // 9848 // The purpose of this opcode is to take a block of the form 9849 // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and 9850 // replace it on the stack with the result of properly 9851 // invoking blockHelperMissing. 9852 blockValue: function blockValue(name) { 9853 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'), 9854 params = [this.contextName(0)]; 9855 this.setupHelperArgs(name, 0, params); 9856 9857 var blockName = this.popStack(); 9858 params.splice(1, 0, blockName); 9859 9860 this.push(this.source.functionCall(blockHelperMissing, 'call', params)); 9861 }, 9862 9863 // [ambiguousBlockValue] 9864 // 9865 // On stack, before: hash, inverse, program, value 9866 // Compiler value, before: lastHelper=value of last found helper, if any 9867 // On stack, after, if no lastHelper: same as [blockValue] 9868 // On stack, after, if lastHelper: value 9869 ambiguousBlockValue: function ambiguousBlockValue() { 9870 // We're being a bit cheeky and reusing the options value from the prior exec 9871 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'), 9872 params = [this.contextName(0)]; 9873 this.setupHelperArgs('', 0, params, true); 9874 9875 this.flushInline(); 9876 9877 var current = this.topStack(); 9878 params.splice(1, 0, current); 9879 9880 this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']); 9881 }, 9882 9883 // [appendContent] 9884 // 9885 // On stack, before: ... 9886 // On stack, after: ... 9887 // 9888 // Appends the string value of `content` to the current buffer 9889 appendContent: function appendContent(content) { 9890 if (this.pendingContent) { 9891 content = this.pendingContent + content; 9892 } else { 9893 this.pendingLocation = this.source.currentLocation; 9894 } 9895 9896 this.pendingContent = content; 9897 }, 9898 9899 // [append] 9900 // 9901 // On stack, before: value, ... 9902 // On stack, after: ... 9903 // 9904 // Coerces `value` to a String and appends it to the current buffer. 9905 // 9906 // If `value` is truthy, or 0, it is coerced into a string and appended 9907 // Otherwise, the empty string is appended 9908 append: function append() { 9909 if (this.isInline()) { 9910 this.replaceStack(function (current) { 9911 return [' != null ? ', current, ' : ""']; 9912 }); 9913 9914 this.pushSource(this.appendToBuffer(this.popStack())); 9915 } else { 9916 var local = this.popStack(); 9917 this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); 9918 if (this.environment.isSimple) { 9919 this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']); 9920 } 9921 } 9922 }, 9923 9924 // [appendEscaped] 9925 // 9926 // On stack, before: value, ... 9927 // On stack, after: ... 9928 // 9929 // Escape `value` and append it to the buffer 9930 appendEscaped: function appendEscaped() { 9931 this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')'])); 9932 }, 9933 9934 // [getContext] 9935 // 9936 // On stack, before: ... 9937 // On stack, after: ... 9938 // Compiler value, after: lastContext=depth 9939 // 9940 // Set the value of the `lastContext` compiler value to the depth 9941 getContext: function getContext(depth) { 9942 this.lastContext = depth; 9943 }, 9944 9945 // [pushContext] 9946 // 9947 // On stack, before: ... 9948 // On stack, after: currentContext, ... 9949 // 9950 // Pushes the value of the current context onto the stack. 9951 pushContext: function pushContext() { 9952 this.pushStackLiteral(this.contextName(this.lastContext)); 9953 }, 9954 9955 // [lookupOnContext] 9956 // 9957 // On stack, before: ... 9958 // On stack, after: currentContext[name], ... 9959 // 9960 // Looks up the value of `name` on the current context and pushes 9961 // it onto the stack. 9962 lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) { 9963 var i = 0; 9964 9965 if (!scoped && this.options.compat && !this.lastContext) { 9966 // The depthed query is expected to handle the undefined logic for the root level that 9967 // is implemented below, so we evaluate that directly in compat mode 9968 this.push(this.depthedLookup(parts[i++])); 9969 } else { 9970 this.pushContext(); 9971 } 9972 9973 this.resolvePath('context', parts, i, falsy, strict); 9974 }, 9975 9976 // [lookupBlockParam] 9977 // 9978 // On stack, before: ... 9979 // On stack, after: blockParam[name], ... 9980 // 9981 // Looks up the value of `parts` on the given block param and pushes 9982 // it onto the stack. 9983 lookupBlockParam: function lookupBlockParam(blockParamId, parts) { 9984 this.useBlockParams = true; 9985 9986 this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); 9987 this.resolvePath('context', parts, 1); 9988 }, 9989 9990 // [lookupData] 9991 // 9992 // On stack, before: ... 9993 // On stack, after: data, ... 9994 // 9995 // Push the data lookup operator 9996 lookupData: function lookupData(depth, parts, strict) { 9997 if (!depth) { 9998 this.pushStackLiteral('data'); 9999 } else { 10000 this.pushStackLiteral('container.data(data, ' + depth + ')'); 10001 } 10002 10003 this.resolvePath('data', parts, 0, true, strict); 10004 }, 10005 10006 resolvePath: function resolvePath(type, parts,
10006i, falsy, strict) { 10007 // istanbul ignore next 10008 10009 var _this2 = this; 10010 10011 if (this.options.strict || this.options.assumeObjects) { 10012 this.push(strictLookup(this.options.strict && strict, this, parts, i
vendor: 14,801 bytes, lines 10012-10491
10012, type)); 10013 return; 10014 } 10015 10016 var len = parts.length; 10017 for (; i < len; i++) { 10018 /* eslint-disable no-loop-func */ 10019 this.replaceStack(function (current) { 10020 var lookup = _this2.nameLookup(current, parts[i], type); 10021 // We want to ensure that zero and false are handled properly if the context (falsy flag) 10022 // needs to have the special handling for these values. 10023 if (!falsy) { 10024 return [' != null ? ', lookup, ' : ', current]; 10025 } else { 10026 // Otherwise we can use generic falsy handling 10027 return [' && ', lookup]; 10028 } 10029 }); 10030 /* eslint-enable no-loop-func */ 10031 } 10032 }, 10033 10034 // [resolvePossibleLambda] 10035 // 10036 // On stack, before: value, ... 10037 // On stack, after: resolved value, ... 10038 // 10039 // If the `value` is a lambda, replace it on the stack by 10040 // the return value of the lambda 10041 resolvePossibleLambda: function resolvePossibleLambda() { 10042 this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); 10043 }, 10044 10045 // [pushStringParam] 10046 // 10047 // On stack, before: ... 10048 // On stack, after: string, currentContext, ... 10049 // 10050 // This opcode is designed for use in string mode, which 10051 // provides the string value of a parameter along with its 10052 // depth rather than resolving it immediately. 10053 pushStringParam: function pushStringParam(string, type) { 10054 this.pushContext(); 10055 this.pushString(type); 10056 10057 // If it's a subexpression, the string result 10058 // will be pushed after this opcode. 10059 if (type !== 'SubExpression') { 10060 if (typeof string === 'string') { 10061 this.pushString(string); 10062 } else { 10063 this.pushStackLiteral(string); 10064 } 10065 } 10066 }, 10067 10068 emptyHash: function emptyHash(omitEmpty) { 10069 if (this.trackIds) { 10070 this.push('{}'); // hashIds 10071 } 10072 if (this.stringParams) { 10073 this.push('{}'); // hashContexts 10074 this.push('{}'); // hashTypes 10075 } 10076 this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); 10077 }, 10078 pushHash: function pushHash() { 10079 if (this.hash) { 10080 this.hashes.push(this.hash); 10081 } 10082 this.hash = { values: {}, types: [], contexts: [], ids: [] }; 10083 }, 10084 popHash: function popHash() { 10085 var hash = this.hash; 10086 this.hash = this.hashes.pop(); 10087 10088 if (this.trackIds) { 10089 this.push(this.objectLiteral(hash.ids)); 10090 } 10091 if (this.stringParams) { 10092 this.push(this.objectLiteral(hash.contexts)); 10093 this.push(this.objectLiteral(hash.types)); 10094 } 10095 10096 this.push(this.objectLiteral(hash.values)); 10097 }, 10098 10099 // [pushString] 10100 // 10101 // On stack, before: ... 10102 // On stack, after: quotedString(string), ... 10103 // 10104 // Push a quoted version of `string` onto the stack 10105 pushString: function pushString(string) { 10106 this.pushStackLiteral(this.quotedString(string)); 10107 }, 10108 10109 // [pushLiteral] 10110 // 10111 // On stack, before: ... 10112 // On stack, after: value, ... 10113 // 10114 // Pushes a value onto the stack. This operation prevents 10115 // the compiler from creating a temporary variable to hold 10116 // it. 10117 pushLiteral: function pushLiteral(value) { 10118 this.pushStackLiteral(value); 10119 }, 10120 10121 // [pushProgram] 10122 // 10123 // On stack, before: ... 10124 // On stack, after: program(guid), ... 10125 // 10126 // Push a program expression onto the stack. This takes 10127 // a compile-time guid and converts it into a runtime-accessible 10128 // expression. 10129 pushProgram: function pushProgram(guid) { 10130 if (guid != null) { 10131 this.pushStackLiteral(this.programExpression(guid)); 10132 } else { 10133 this.pushStackLiteral(null); 10134 } 10135 }, 10136 10137 // [registerDecorator] 10138 // 10139 // On stack, before: hash, program, params..., ... 10140 // On stack, after: ... 10141 // 10142 // Pops off the decorator's parameters, invokes the decorator, 10143 // and inserts the decorator into the decorators list. 10144 registerDecorator: function registerDecorator(paramSize, name) { 10145 var foundDecorator = this.nameLookup('decorators', name, 'decorator'), 10146 options = this.setupHelperArgs(name, paramSize); 10147 10148 this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']); 10149 }, 10150 10151 // [invokeHelper] 10152 // 10153 // On stack, before: hash, inverse, program, params..., ... 10154 // On stack, after: result of helper invocation 10155 // 10156 // Pops off the helper's parameters, invokes the helper, 10157 // and pushes the helper's return value onto the stack. 10158 // 10159 // If the helper is not found, `helperMissing` is called. 10160 invokeHelper: function invokeHelper(paramSize, name, isSimple) { 10161 var nonHelper = this.popStack(), 10162 helper = this.setupHelper(paramSize, name); 10163 10164 var possibleFunctionCalls = []; 10165 10166 if (isSimple) { 10167 // direct call to helper 10168 possibleFunctionCalls.push(helper.name); 10169 } 10170 // call a function from the input object 10171 possibleFunctionCalls.push(nonHelper); 10172 if (!this.options.strict) { 10173 possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing')); 10174 } 10175 10176 var functionLookupCode = ['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')']; 10177 var functionCall = this.source.functionCall(functionLookupCode, 'call', helper.callParams); 10178 this.push(functionCall); 10179 }, 10180 10181 itemsSeparatedBy: function itemsSeparatedBy(items, separator) { 10182 var result = []; 10183 result.push(items[0]); 10184 for (var i = 1; i < items.length; i++) { 10185 result.push(separator, items[i]); 10186 } 10187 return result; 10188 }, 10189 // [invokeKnownHelper] 10190 // 10191 // On stack, before: hash, inverse, program, params..., ... 10192 // On stack, after: result of helper invocation 10193 // 10194 // This operation is used when the helper is known to exist, 10195 // so a `helperMissing` fallback is not required. 10196 invokeKnownHelper: function invokeKnownHelper(paramSize, name) { 10197 var helper = this.setupHelper(paramSize, name); 10198 this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); 10199 }, 10200 10201 // [invokeAmbiguous] 10202 // 10203 // On stack, before: hash, inverse, program, params..., ... 10204 // On stack, after: result of disambiguation 10205 // 10206 // This operation is used when an expression like `{{foo}}` 10207 // is provided, but we don't know at compile-time whether it 10208 // is a helper or a path. 10209 // 10210 // This operation emits more code than the other options, 10211 // and can be avoided by passing the `knownHelpers` and 10212 // `knownHelpersOnly` flags at compile-time. 10213 invokeAmbiguous: function invokeAmbiguous(name, helperCall) { 10214 this.useRegister('helper'); 10215 10216 var nonHelper = this.popStack(); 10217 10218 this.emptyHash(); 10219 var helper = this.setupHelper(0, name, helperCall); 10220 10221 var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); 10222 10223 var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; 10224 if (!this.options.strict) { 10225 lookup[0] = '(helper = '; 10226 lookup.push(' != null ? helper : ', this.aliasable('container.hooks.helperMissing')); 10227 } 10228 10229 this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']); 10230 }, 10231 10232 // [invokePartial] 10233 // 10234 // On stack, before: context, ... 10235 // On stack after: result of partial invocation 10236 // 10237 // This operation pops off a context, invokes a partial with that context, 10238 // and pushes the result of the invocation back. 10239 invokePartial: function invokePartial(isDynamic, name, indent) { 10240 var params = [], 10241 options = this.setupParams(name, 1, params); 10242 10243 if (isDynamic) { 10244 name = this.popStack(); 10245 delete options.name; 10246 } 10247 10248 if (indent) { 10249 options.indent = JSON.stringify(indent); 10250 } 10251 options.helpers = 'helpers'; 10252 options.partials = 'partials'; 10253 options.decorators = 'container.decorators'; 10254 10255 if (!isDynamic) { 10256 params.unshift(this.nameLookup('partials', name, 'partial')); 10257 } else { 10258 params.unshift(name); 10259 } 10260 10261 if (this.options.compat) { 10262 options.depths = 'depths'; 10263 } 10264 options = this.objectLiteral(options); 10265 params.push(options); 10266 10267 this.push(this.source.functionCall('container.invokePartial', '', params)); 10268 }, 10269 10270 // [assignToHash] 10271 // 10272 // On stack, before: value, ..., hash, ... 10273 // On stack, after: ..., hash, ... 10274 // 10275 // Pops a value off the stack and assigns it to the current hash 10276 assignToHash: function assignToHash(key) { 10277 var value = this.popStack(), 10278 context = undefined, 10279 type = undefined, 10280 id = undefined; 10281 10282 if (this.trackIds) { 10283 id = this.popStack(); 10284 } 10285 if (this.stringParams) { 10286 type = this.popStack(); 10287 context = this.popStack(); 10288 } 10289 10290 var hash = this.hash; 10291 if (context) { 10292 hash.contexts[key] = context; 10293 } 10294 if (type) { 10295 hash.types[key] = type; 10296 } 10297 if (id) { 10298 hash.ids[key] = id; 10299 } 10300 hash.values[key] = value; 10301 }, 10302 10303 pushId: function pushId(type, name, child) { 10304 if (type === 'BlockParam') { 10305 this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : '')); 10306 } else if (type === 'PathExpression') { 10307 this.pushString(name); 10308 } else if (type === 'SubExpression') { 10309 this.pushStackLiteral('true'); 10310 } else { 10311 this.pushStackLiteral('null'); 10312 } 10313 }, 10314 10315 // HELPERS 10316 10317 compiler: JavaScriptCompiler, 10318 10319 compileChildren: function compileChildren(environment, options) { 10320 var children = environment.children, 10321 child = undefined, 10322 compiler = undefined; 10323 10324 for (var i = 0, l = children.length; i < l; i++) { 10325 child = children[i]; 10326 compiler = new this.compiler(); // eslint-disable-line new-cap 10327 10328 var existing = this.matchExistingProgram(child); 10329 10330 if (existing == null) { 10331 this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children 10332 var index = this.context.programs.length; 10333 child.index = index; 10334 child.name = 'program' + index; 10335 this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile); 10336 this.context.decorators[index] = compiler.decorators; 10337 this.context.environments[index] = child; 10338 10339 this.useDepths = this.useDepths || compiler.useDepths; 10340 this.useBlockParams = this.useBlockParams || compiler.useBlockParams; 10341 child.useDepths = this.useDepths; 10342 child.useBlockParams = this.useBlockParams; 10343 } else { 10344 child.index = existing.index; 10345 child.name = 'program' + existing.index; 10346 10347 this.useDepths = this.useDepths || existing.useDepths; 10348 this.useBlockParams = this.useBlockParams || existing.useBlockParams; 10349 } 10350 } 10351 }, 10352 matchExistingProgram: function matchExistingProgram(child) { 10353 for (var i = 0, len = this.context.environments.length; i < len; i++) { 10354 var environment = this.context.environments[i]; 10355 if (environment && environment.equals(child)) { 10356 return environment; 10357 } 10358 } 10359 }, 10360 10361 programExpression: function programExpression(guid) { 10362 var child = this.environment.children[guid], 10363 programParams = [child.index, 'data', child.blockParams]; 10364 10365 if (this.useBlockParams || this.useDepths) { 10366 programParams.push('blockParams'); 10367 } 10368 if (this.useDepths) { 10369 programParams.push('depths'); 10370 } 10371 10372 return 'container.program(' + programParams.join(', ') + ')'; 10373 }, 10374 10375 useRegister: function useRegister(name) { 10376 if (!this.registers[name]) { 10377 this.registers[name] = true; 10378 this.registers.list.push(name); 10379 } 10380 }, 10381 10382 push: function push(expr) { 10383 if (!(expr instanceof Literal)) { 10384 expr = this.source.wrap(expr); 10385 } 10386 10387 this.inlineStack.push(expr); 10388 return expr; 10389 }, 10390 10391 pushStackLiteral: function pushStackLiteral(item) { 10392 this.push(new Literal(item)); 10393 }, 10394 10395 pushSource: function pushSource(source) { 10396 if (this.pendingContent) { 10397 this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)); 10398 this.pendingContent = undefined; 10399 } 10400 10401 if (source) { 10402 this.source.push(source); 10403 } 10404 }, 10405 10406 replaceStack: function replaceStack(callback) { 10407 var prefix = ['('], 10408 stack = undefined, 10409 createdStack = undefined, 10410 usedLiteral = undefined; 10411 10412 /* istanbul ignore next */ 10413 if (!this.isInline()) { 10414 throw new _exception2['default']('replaceStack on non-inline'); 10415 } 10416 10417 // We want to merge the inline statement into the replacement statement via ',' 10418 var top = this.popStack(true); 10419 10420 if (top instanceof Literal) { 10421 // Literals do not need to be inlined 10422 stack = [top.value]; 10423 prefix = ['(', stack]; 10424 usedLiteral = true; 10425 } else { 10426 // Get or create the current stack name for use by the inline 10427 createdStack = true; 10428 var _name = this.incrStack(); 10429 10430 prefix = ['((', this.push(_name), ' = ', top, ')']; 10431 stack = this.topStack(); 10432 } 10433 10434 var item = callback.call(this, stack); 10435 10436 if (!usedLiteral) { 10437 this.popStack(); 10438 } 10439 if (createdStack) { 10440 this.stackSlot--; 10441 } 10442 this.push(prefix.concat(item, ')')); 10443 }, 10444 10445 incrStack: function incrStack() { 10446 this.stackSlot++; 10447 if (this.stackSlot > this.stackVars.length) { 10448 this.stackVars.push('stack' + this.stackSlot); 10449 } 10450 return this.topStackName(); 10451 }, 10452 topStackName: function topStackName() { 10453 return 'stack' + this.stackSlot; 10454 }, 10455 flushInline: function flushInline() { 10456 var inlineStack = this.inlineStack; 10457 this.inlineStack = []; 10458 for (var i = 0, len = inlineStack.length; i < len; i++) { 10459 var entry = inlineStack[i]; 10460 /* istanbul ignore if */ 10461 if (entry instanceof Literal) { 10462 this.compileStack.push(entry); 10463 } else { 10464 var stack = this.incrStack(); 10465 this.pushSource([stack, ' = ', entry, ';']); 10466 this.compileStack.push(stack); 10467 } 10468 } 10469 }, 10470 isInline: function isInline() { 10471 return this.inlineStack.length; 10472 }, 10473 10474 popStack: function popStack(wrapped) { 10475 var inline = this.isInline(), 10476 item = (inline ? this.inlineStack : this.compileStack).pop(); 10477 10478 if (!wrapped && item instanceof Literal) { 10479 return item.value; 10480 } else { 10481 if (!inline) { 10482 /* istanbul ignore next */ 10483 if (!this.stackSlot) { 10484 throw new _exception2['default']('Invalid stack pop'); 10485 } 10486 this.stackSlot--; 10487 } 10488 return item; 10489 } 10490 }, 10491
vendor: 4,876 bytes, lines 10492-10652
10492 topStack: function topStack() { 10493 var stack = this.isInline() ? this.inlineStack : this.compileStack, 10494 item = stack[stack.length - 1]; 10495 10496 /* istanbul ignore if */ 10497 if (item instanceof Literal) { 10498 return item.value; 10499 } else { 10500 return item; 10501 } 10502 }, 10503 10504 contextName: function contextName(context) { 10505 if (this.useDepths && context) { 10506 return 'depths[' + context + ']'; 10507 } else { 10508 return 'depth' + context; 10509 } 10510 }, 10511 10512 quotedString: function quotedString(str) { 10513 return this.source.quotedString(str); 10514 }, 10515 10516 objectLiteral: function objectLiteral(obj) { 10517 return this.source.objectLiteral(obj); 10518 }, 10519 10520 aliasable: function aliasable(name) { 10521 var ret = this.aliases[name]; 10522 if (ret) { 10523 ret.referenceCount++; 10524 return ret; 10525 } 10526 10527 ret = this.aliases[name] = this.source.wrap(name); 10528 ret.aliasable = true; 10529 ret.referenceCount = 1; 10530 10531 return ret; 10532 }, 10533 10534 setupHelper: function setupHelper(paramSize, name, blockHelper) { 10535 var params = [], 10536 paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); 10537 var foundHelper = this.nameLookup('helpers', name, 'helper'), 10538 callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})'); 10539 10540 return { 10541 params: params, 10542 paramsInit: paramsInit, 10543 name: foundHelper, 10544 callParams: [callContext].concat(params) 10545 }; 10546 }, 10547 10548 setupParams: function setupParams(helper, paramSize, params) { 10549 var options = {}, 10550 contexts = [], 10551 types = [], 10552 ids = [], 10553 objectArgs = !params, 10554 param = undefined; 10555 10556 if (objectArgs) { 10557 params = []; 10558 } 10559 10560 options.name = this.quotedString(helper); 10561 options.hash = this.popStack(); 10562 10563 if (this.trackIds) { 10564 options.hashIds = this.popStack(); 10565 } 10566 if (this.stringParams) { 10567 options.hashTypes = this.popStack(); 10568 options.hashContexts = this.popStack(); 10569 } 10570 10571 var inverse = this.popStack(), 10572 program = this.popStack(); 10573 10574 // Avoid setting fn and inverse if neither are set. This allows 10575 // helpers to do a check for `if (options.fn)` 10576 if (program || inverse) { 10577 options.fn = program || 'container.noop'; 10578 options.inverse = inverse || 'container.noop'; 10579 } 10580 10581 // The parameters go on to the stack in order (making sure that they are evaluated in order) 10582 // so we need to pop them off the stack in reverse order 10583 var i = paramSize; 10584 while (i--) { 10585 param = this.popStack(); 10586 params[i] = param; 10587 10588 if (this.trackIds) { 10589 ids[i] = this.popStack(); 10590 } 10591 if (this.stringParams) { 10592 types[i] = this.popStack(); 10593 contexts[i] = this.popStack(); 10594 } 10595 } 10596 10597 if (objectArgs) { 10598 options.args = this.source.generateArray(params); 10599 } 10600 10601 if (this.trackIds) { 10602 options.ids = this.source.generateArray(ids); 10603 } 10604 if (this.stringParams) { 10605 options.types = this.source.generateArray(types); 10606 options.contexts = this.source.generateArray(contexts); 10607 } 10608 10609 if (this.options.data) { 10610 options.data = 'data'; 10611 } 10612 if (this.useBlockParams) { 10613 options.blockParams = 'blockParams'; 10614 } 10615 return options; 10616 }, 10617 10618 setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) { 10619 var options = this.setupParams(helper, paramSize, params); 10620 options.loc = JSON.stringify(this.source.currentLocation); 10621 options = this.objectLiteral(options); 10622 if (useRegister) { 10623 this.useRegister('options'); 10624 params.push('options'); 10625 return ['options=', options]; 10626 } else if (params) { 10627 params.push(options); 10628 return ''; 10629 } else { 10630 return options; 10631 } 10632 } 10633 }; 10634 10635 (function () { 10636 var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' '); 10637 10638 var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; 10639 10640 for (var i = 0, l = reservedWords.length; i < l; i++) { 10641 compilerWords[reservedWords[i]] = true; 10642 } 10643 })(); 10644 10645 /** 10646 * @deprecated May be removed in the next major version 10647 */ 10648 JavaScriptCompiler.isValidJavaScriptVariableName = function (name) { 10649 return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name); 10650 }; 10651 10652 function strictLookup(requireTerminal, compiler, parts,
vendor: 4,006 bytes, lines 10652-10800
10652i, type) { 10653 var stack = compiler.popStack(), 10654 len = parts.length; 10655 if (requireTerminal) { 10656 len--; 10657 } 10658 10659 for (; i < len; i++) { 10660 stack = compiler.nameLookup(stack, parts[i], type); 10661 } 10662 10663 if (requireTerminal) { 10664 return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ' )']; 10665 } else { 10666 return stack; 10667 } 10668 } 10669 10670 exports['default'] = JavaScriptCompiler; 10671 module.exports = exports['default']; 10672 10673/***/ }), 10674/* 92 */ 10675/***/ (function(module, exports, __webpack_require__) { 10676 10677 /* global define, require */ 10678 'use strict'; 10679 10680 var _Object$keys = __webpack_require__(60)['default']; 10681 10682 exports.__esModule = true; 10683 10684 var _utils = __webpack_require__(5); 10685 10686 var SourceNode = undefined; 10687 10688 try { 10689 /* istanbul ignore next */ 10690 if (false) { 10691 // We don't support this in AMD environments. For these environments, we assume that 10692 // they are running on the browser and thus have no need for the source-map library. 10693 var SourceMap = require('source-map'); 10694 SourceNode = SourceMap.SourceNode; 10695 } 10696 } catch (err) {} 10697 /* NOP */ 10698 10699 /* istanbul ignore if: tested but not covered in istanbul due to dist build */ 10700 if (!SourceNode) { 10701 SourceNode = function (line, column, srcFile, chunks) { 10702 this.src = ''; 10703 if (chunks) { 10704 this.add(chunks); 10705 } 10706 }; 10707 /* istanbul ignore next */ 10708 SourceNode.prototype = { 10709 add: function add(chunks) { 10710 if (_utils.isArray(chunks)) { 10711 chunks = chunks.join(''); 10712 } 10713 this.src += chunks; 10714 }, 10715 prepend: function prepend(chunks) { 10716 if (_utils.isArray(chunks)) { 10717 chunks = chunks.join(''); 10718 } 10719 this.src = chunks + this.src; 10720 }, 10721 toStringWithSourceMap: function toStringWithSourceMap() { 10722 return { code: this.toString() }; 10723 }, 10724 toString: function toString() { 10725 return this.src; 10726 } 10727 }; 10728 } 10729 10730 function castChunk(chunk, codeGen, loc) { 10731 if (_utils.isArray(chunk)) { 10732 var ret = []; 10733 10734 for (var i = 0, len = chunk.length; i < len; i++) { 10735 ret.push(codeGen.wrap(chunk[i], loc)); 10736 } 10737 return ret; 10738 } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { 10739 // Handle primitives that the SourceNode will throw up on 10740 return chunk + ''; 10741 } 10742 return chunk; 10743 } 10744 10745 function CodeGen(srcFile) { 10746 this.srcFile = srcFile; 10747 this.source = []; 10748 } 10749 10750 CodeGen.prototype = { 10751 isEmpty: function isEmpty() { 10752 return !this.source.length; 10753 }, 10754 prepend: function prepend(source, loc) { 10755 this.source.unshift(this.wrap(source, loc)); 10756 }, 10757 push: function push(source, loc) { 10758 this.source.push(this.wrap(source, loc)); 10759 }, 10760 10761 merge: function merge() { 10762 var source = this.empty(); 10763 this.each(function (line) { 10764 source.add([' ', line, '\n']); 10765 }); 10766 return source; 10767 }, 10768 10769 each: function each(iter) { 10770 for (var i = 0, len = this.source.length; i < len; i++) { 10771 iter(this.source[i]); 10772 } 10773 }, 10774 10775 empty: function empty() { 10776 var loc = this.currentLocation || { start: {} }; 10777 return new SourceNode(loc.start.line, loc.start.column, this.srcFile); 10778 }, 10779 wrap: function wrap(chunk) { 10780 var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; 10781 10782 if (chunk instanceof SourceNode) { 10783 return chunk; 10784 } 10785 10786 chunk = castChunk(chunk, this, loc); 10787 10788 return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); 10789 }, 10790 10791 functionCall: function functionCall(fn, type, params) { 10792 params = this.generateList(params); 10793 return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); 10794 }, 10795 10796 quotedString: function quotedString(str) { 10797 return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 10798 .replace(/\u2029/g, '\\u2029') + '"'; 10799 }, 10800
10801 objectLiteral: function objectLiteral(obj) { 10802 // istanbul ignore next 10803 10804 var _this = this; 10805 10806 var pairs = []; 10807 10808 _Object$keys(obj).forEach(function (key) { 10809 var value = castChunk(obj[key], _this); 10810 if (value !== 'undefined') { 10811 pairs.push([_this.quotedString(key), ':', value]); 10812 } 10813 }); 10814 10815 var ret = this.generateList(pairs); 10816 ret.prepend('{'); 10817 ret.add('}'); 10818 return ret; 10819 }, 10820 10821 generateList: function generateList(entries) { 10822 var ret = this.empty(); 10823 10824 for (var i = 0, len = entries.length; i < len; i++) { 10825 if (i) { 10826 ret.add(','); 10827 } 10828 10829 ret.add(castChunk(entries[i], this)); 10830 } 10831 10832 return ret; 10833 }, 10834 10835 generateArray: function generateArray(entries) { 10836 var ret = this.generateList(entries); 10837 ret.prepend('['); 10838 ret.add(']'); 10839 10840 return ret; 10841 } 10842 }; 10843 10844 exports['default'] = CodeGen; 10845 module.exports = exports['default']; 10846 10847/***/ }) 10848/******/ ]) 10849}); 10850; 10851// Backbone.js 1.0.0 10852 10853// (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc. 10854// Backbone may be freely distributed under the MIT license. 10855// For all details and documentation: 10856// http://backbonejs.org 10857 10858(function(){ 10859 10860 // Initial Setup 10861 // ------------- 10862 10863 // Save a reference to the global object (`window` in the browser, `exports` 10864 // on the server). 10865 var root = this; 10866 10867 // Save the previous value of the `Backbone` variable, so that it can be 10868 // restored later on, if `noConflict` is used. 10869 var previousBackbone = root.Backbone; 10870 10871 // Create local references to array methods we'll want to use later. 10872 var array = []; 10873 var push = array.push; 10874 var slice = array.slice; 10875 var splice = array.splice; 10876 10877 // The top-level namespace. All public Backbone classes and modules will 10878 // be attached to this. Exported for both the browser and the server. 10879 var Backbone; 10880 if (typeof exports !== 'undefined') { 10881 Backbone = exports; 10882 } else { 10883 Backbone = root.Backbone = {}; 10884 } 10885 10886 // Current version of the library. Keep in sync with `package.json`. 10887 Backbone.VERSION = '1.0.0'; 10888 10889 // Require Underscore, if we're on the server, and it's not already present. 10890 var _ = root._; 10891 if (!_ && (typeof require !== 'undefined')) _ = require('underscore'); 10892 10893 // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns 10894 // the `$` variable. 10895 Backbone.$ = root.jQuery || root.Zepto || root.ender || root.$; 10896 10897 // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable 10898 // to its previous owner. Returns a reference to this Backbone object. 10899 Backbone.noConflict = function() { 10900 root.Backbone = previousBackbone; 10901 return this; 10902 }; 10903 10904 // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option 10905 // will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and 10906 // set a `X-Http-Method-Override` header. 10907 Backbone.emulateHTTP = false;
10908 10909 // Turn on `emulateJSON` to support legacy servers that can't deal with direct 10910 // `application/json` requests ... will encode the body as 10911 // `application/x-www-form-urlencoded` instead and will send the model in a 10912 // form param named `model`. 10913 Backbone.emulateJSON = false; 10914 10915 // Backbone.Events 10916 // --------------- 10917 10918 // A module that can be mixed in to *any object* in order to provide it with 10919 // custom events. You may bind with `on` or remove with `off` callback 10920 // functions to an event; `trigger`-ing an event fires all callbacks in 10921 // succession. 10922 // 10923 // var object = {}; 10924 // _.extend(object, Backbone.Events); 10925 // object.on('expand', function(){ alert('expanded'); }); 10926 // object.trigger('expand'); 10927 // 10928 var Events = Backbone.Events = { 10929 10930 // Bind an event to a `callback` function. Passing `"all"` will bind 10931 // the callback to all events fired. 10932 on: function(name, callback, context) { 10933 if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; 10934 this._events || (this._events = {}); 10935 var events = this._events[name] || (this._events[name] = []); 10936 events.push({callback: callback, context: context, ctx: context || this}); 10937 return this; 10938 }, 10939 10940 // Bind an event to only be triggered a single time. After the first time 10941 // the callback is invoked, it will be removed. 10942 once: function(name, callback, context) { 10943 if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; 10944 var self = this; 10945 var once = _.once(function() { 10946 self.off(name, once); 10947 callback.apply(this, arguments); 10948 }); 10949 once._callback = callback; 10950 return this.on(name, once, context); 10951 }, 10952 10953 // Remove one or many callbacks. If `context` is null, removes all 10954 // callbacks with that function. If `callback` is null, removes all 10955 // callbacks for the event. If `name` is null, removes all bound 10956 // callbacks for all events. 10957 off: function(name, callback, context) { 10958 var retain, ev, events, names, i, l, j, k; 10959 if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; 10960 if (!name && !callback && !context) { 10961 this._events = {}; 10962 return this; 10963 } 10964 10965 names = name ? [name] : _.keys(this._events); 10966 for (i = 0, l = names.length; i < l; i++) { 10967 name = names[i]; 10968 if (events = this._events[name]) { 10969 this._events[name] = retain = []; 10970 if (callback || context) { 10971 for (j = 0, k = events.length; j < k; j++) { 10972 ev = events[j]; 10973 if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || 10974 (context && context !== ev.context)) { 10975 retain.push(ev); 10976 } 10977 } 10978 } 10979 if (!retain.length) delete this._events[name]; 10980 } 10981 } 10982 10983 return this; 10984 }, 10985 10986 // Trigger one or many events, firing all bound callbacks. Callbacks are 10987 // passed the same arguments as `trigger` is, apart from the event name 10988 // (unless you're listening on `"all"`, which will cause your callback to 10989 // receive the true name of the event as the first argument). 10990 trigger: function(name) { 10991 if (!this._events) return this; 10992 var args = slice.call(arguments, 1); 10993 if (!eventsApi(this, 'trigger', name, args)) return this; 10994 var events = this._events[name]; 10995 var allEvents = this._events.all; 10996 if (events) triggerEvents(events, args); 10997 if (allEvents) triggerEvents(allEvents, arguments); 10998 return this; 10999 }, 11000 11001 // Tell this object to stop listening to either specific events ... or 11002 // to every object it's currently listening to. 11003 stopListening: function(obj, name, callback) { 11004 var listeners = this._listeners; 11005 if (!listeners) return this; 11006 var deleteListener = !name && !callback; 11007 if (typeof name === 'object') callback = this; 11008 if (obj) (listeners = {})[obj._listenerId] = obj; 11009 for (var id in listeners) { 11010 listeners[id].off(name, callback, this); 11011 if (deleteListener) delete this._listeners[id]; 11012 } 11013 return this; 11014 } 11015 11016 }; 11017 11018 // Regular expression used to split event strings. 11019 var eventSplitter = /\s+/; 11020 11021 // Implement fancy features of the Events API such as multiple event 11022 // names `"change blur"` and jQuery-style event maps `{change: action}` 11023 // in terms of the existing API. 11024 var eventsApi = function(obj, action, name, rest) { 11025 if (!name) return true; 11026 11027 // Handle event maps. 11028 if (typeof name === 'object') { 11029 for (var key in name) { 11030 obj[action].apply(obj, [key, name[key]].concat(rest)); 11031 } 11032 return false;
11033 } 11034 11035 // Handle space separated event names. 11036 if (eventSplitter.test(name)) { 11037 var names = name.split(eventSplitter); 11038 for (var i = 0, l = names.length; i < l; i++) { 11039 obj[action].apply(obj, [names[i]].concat(rest)); 11040 } 11041 return false; 11042 } 11043 11044 return true; 11045 }; 11046 11047 // A difficult-to-believe, but optimized internal dispatch function for 11048 // triggering events. Tries to keep the usual cases speedy (most internal 11049 // Backbone events have 3 arguments). 11050 var triggerEvents = function(events, args) { 11051 var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; 11052 switch (args.length) { 11053 case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; 11054 case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; 11055 case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; 11056 case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; 11057 default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); 11058 } 11059 }; 11060 11061 var listenMethods = {listenTo: 'on', listenToOnce: 'once'}; 11062 11063 // Inversion-of-control versions of `on` and `once`. Tell *this* object to 11064 // listen to an event in another object ... keeping track of what it's 11065 // listening to. 11066 _.each(listenMethods, function(implementation, method) { 11067 Events[method] = function(obj, name, callback) { 11068 var listeners = this._listeners || (this._listeners = {}); 11069 var id = obj._listenerId || (obj._listenerId = _.uniqueId('l')); 11070 listeners[id] = obj; 11071 if (typeof name === 'object') callback = this; 11072 obj[implementation](name, callback, this); 11073 return this; 11074 }; 11075 }); 11076 11077 // Aliases for backwards compatibility. 11078 Events.bind = Events.on; 11079 Events.unbind = Events.off; 11080 11081 // Allow the `Backbone` object to serve as a global event bus, for folks who 11082 // want global "pubsub" in a convenient place. 11083 _.extend(Backbone, Events); 11084 11085 // Backbone.Model 11086 // -------------- 11087 11088 // Backbone **Models** are the basic data object in the framework -- 11089 // frequently representing a row in a table in a database on your server. 11090 // A discrete chunk of data and a bunch of useful, related methods for 11091 // performing computations and transformations on that data. 11092 11093 // Create a new model with the specified attributes. A client id (`cid`) 11094 // is automatically generated and assigned for you. 11095 var Model = Backbone.Model = function(attributes, options) { 11096 var defaults; 11097 var attrs = attributes || {}; 11098 options || (options = {}); 11099 this.cid = _.uniqueId('c'); 11100 this.attributes = {}; 11101 _.extend(this, _.pick(options, modelOptions)); 11102 if (options.parse) attrs = this.parse(attrs, options) || {}; 11103 if (defaults = _.result(this, 'defaults')) { 11104 attrs = _.defaults({}, attrs, defaults); 11105 } 11106 this.set(attrs, options); 11107 this.changed = {}; 11108 this.initialize.apply(this, arguments); 11109 }; 11110 11111 // A list of options to be attached directly to the model, if provided. 11112 var modelOptions = ['url', 'urlRoot', 'collection']; 11113 11114 // Attach all inheritable methods to the Model prototype. 11115 _.extend(Model.prototype, Events, { 11116 11117 // A hash of attributes whose current and previous value differ. 11118 changed: null, 11119 11120 // The value returned during the last failed validation. 11121 validationError: null, 11122 11123 // The default name for the JSON `id` attribute is `"id"`. MongoDB and 11124 // CouchDB users may want to set this to `"_id"`. 11125 idAttribute: 'id', 11126 11127 // Initialize is an empty function by default. Override it with your own 11128 // initialization logic. 11129 initialize: function(){}, 11130 11131 // Return a copy of the model's `attributes` object. 11132 toJSON: function(options) { 11133 return _.clone(this.attributes); 11134 }, 11135 11136 // Proxy `Backbone.sync` by default -- but override this if you need 11137 // custom syncing semantics for *this* particular model. 11138 sync: function() { 11139 return Backbone.sync.apply(this, arguments); 11140 }, 11141 11142 // Get the value of an attribute. 11143 get: function(attr) { 11144 return this.attributes[attr]; 11145 }, 11146 11147 // Get the HTML-escaped value of an attribute. 11148 escape: function(attr) { 11149 return _.escape(this.get(attr)); 11150 }, 11151 11152 // Returns `true` if the attribute contains a value that is not null 11153 // or undefined. 11154 has: function(attr) { 11155 return this.get(attr) != null; 11156 }, 11157 11158 // Set a hash of model attributes on the object, firing `"change"`. This is 11159 // the core primitive operation of a model, updating the data and notifying 11160 // anyone who needs to know about the change in state. The heart of the beast. 11161 set: function(key, val, options) { 11162 var attr, attrs, unset, changes, silent, changing, prev, current; 11163 if (key == null) return this; 11164 11165 // Handle both `"key", value` and `{key: value}` -style arguments. 11166 if (typeof key === 'object') { 11167 attrs = key; 11168 options = val; 11169 } else { 11170 (attrs = {})[key] = val; 11171 } 11172
11173 options || (options = {}); 11174 11175 // Run validation. 11176 if (!this._validate(attrs, options)) return false; 11177 11178 // Extract attributes and options. 11179 unset = options.unset; 11180 silent = options.silent; 11181 changes = []; 11182 changing = this._changing; 11183 this._changing = true; 11184 11185 if (!changing) { 11186 this._previousAttributes = _.clone(this.attributes); 11187 this.changed = {}; 11188 } 11189 current = this.attributes, prev = this._previousAttributes; 11190 11191 // Check for changes of `id`. 11192 if (this.idAttribute in attrs) this.id = attrs[this.idAttribute]; 11193 11194 // For each `set` attribute, update or delete the current value. 11195 for (attr in attrs) { 11196 val = attrs[attr]; 11197 if (!_.isEqual(current[attr], val)) changes.push(attr); 11198 if (!_.isEqual(prev[attr], val)) { 11199 this.changed[attr] = val; 11200 } else { 11201 delete this.changed[attr]; 11202 } 11203 unset ? delete current[attr] : current[attr] = val; 11204 } 11205 11206 // Trigger all relevant attribute changes. 11207 if (!silent) { 11208 if (changes.length) this._pending = true; 11209 for (var i = 0, l = changes.length; i < l; i++) { 11210 this.trigger('change:' + changes[i], this, current[changes[i]], options); 11211 } 11212 } 11213 11214 // You might be wondering why there's a `while` loop here. Changes can 11215 // be recursively nested within `"change"` events. 11216 if (changing) return this; 11217 if (!silent) { 11218 while (this._pending) { 11219 this._pending = false; 11220 this.trigger('change', this, options); 11221 } 11222 } 11223 this._pending = false; 11224 this._changing = false; 11225 return this; 11226 }, 11227 11228 // Remove an attribute from the model, firing `"change"`. `unset` is a noop 11229 // if the attribute doesn't exist. 11230 unset: function(attr, options) { 11231 return this.set(attr, void 0, _.extend({}, options, {unset: true})); 11232 }, 11233 11234 // Clear all attributes on the model, firing `"change"`. 11235 clear: function(options) { 11236 var attrs = {}; 11237 for (var key in this.attributes) attrs[key] = void 0; 11238 return this.set(attrs, _.extend({}, options, {unset: true})); 11239 }, 11240 11241 // Determine if the model has changed since the last `"change"` event. 11242 // If you specify an attribute name, determine if that attribute has changed. 11243 hasChanged: function(attr) { 11244 if (attr == null) return !_.isEmpty(this.changed); 11245 return _.has(this.changed, attr); 11246 }, 11247
11248 // Return an object containing all the attributes that have changed, or 11249 // false if there are no changed attributes. Useful for determining what 11250 // parts of a view need to be updated and/or what attributes need to be 11251 // persisted to the server. Unset attributes will be set to undefined. 11252 // You can also pass an attributes object to diff against the model, 11253 // determining if there *would be* a change. 11254 changedAttributes: function(diff) { 11255 if (!diff) return this.hasChanged() ? _.clone(this.changed) : false; 11256 var val, changed = false; 11257 var old = this._changing ? this._previousAttributes : this.attributes; 11258 for (var attr in diff) { 11259 if (_.isEqual(old[attr], (val = diff[attr]))) continue; 11260 (changed || (changed = {}))[attr] = val; 11261 } 11262 return changed; 11263 }, 11264 11265 // Get the previous value of an attribute, recorded at the time the last 11266 // `"change"` event was fired. 11267 previous: function(attr) { 11268 if (attr == null || !this._previousAttributes) return null; 11269 return this._previousAttributes[attr]; 11270 }, 11271 11272 // Get all of the attributes of the model at the time of the previous 11273 // `"change"` event. 11274 previousAttributes: function() { 11275 return _.clone(this._previousAttributes); 11276 }, 11277 11278 // Fetch the model from the server. If the server's representation of the 11279 // model differs from its current attributes, they will be overridden, 11280 // triggering a `"change"` event. 11281 fetch: function(options) { 11282 options = options ? _.clone(options) : {}; 11283 if (options.parse === void 0) options.parse = true; 11284 var model = this; 11285 var success = options.success; 11286 options.success = function(resp) { 11287 if (!model.set(model.parse(resp, options), options)) return false; 11288 if (success) success(model, resp, options); 11289 model.trigger('sync', model, resp, options); 11290 }; 11291 wrapError(this, options); 11292 return this.sync('read', this, options); 11293 }, 11294 11295 // Set a hash of model attributes, and sync the model to the server. 11296 // If the server returns an attributes hash that differs, the model's 11297 // state will be `set` again. 11298 save: function(key, val, options) { 11299 var attrs, method, xhr, attributes = this.attributes; 11300 11301 // Handle both `"key", value` and `{key: value}` -style arguments. 11302 if (key == null || typeof key === 'object') { 11303 attrs = key; 11304 options = val; 11305 } else { 11306 (attrs = {})[key] = val; 11307 } 11308 11309 // If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`. 11310 if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false; 11311 11312 options = _.extend({validate: true}, options); 11313 11314 // Do not persist invalid models. 11315 if (!this._validate(attrs, options)) return false; 11316 11317 // Set temporary attributes if `{wait: true}`. 11318 if (attrs && options.wait) { 11319 this.attributes = _.extend({}, attributes, attrs); 11320 } 11321 11322 // After a successful server-side save, the client is (optionally) 11323 // updated with the server-side state. 11324 if (options.parse === void 0) options.parse = true; 11325 var model = this; 11326 var success = options.success; 11327 options.success = function(resp) { 11328 // Ensure attributes are restored during synchronous saves. 11329 model.attributes = attributes; 11330 var serverAttrs = model.parse(resp, options); 11331 if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs); 11332 if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) { 11333 return false; 11334 } 11335 if (success) success(model, resp, options); 11336 model.trigger('sync', model, resp, options); 11337 }; 11338 wrapError(this, options); 11339 11340 method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update'); 11341 if (method === 'patch') options.attrs = attrs; 11342 xhr = this.sync(method, this, options); 11343 11344 // Restore attributes. 11345 if (attrs && options.wait) this.attributes = attributes; 11346 11347 return xhr; 11348 }, 11349 11350 // Destroy this model on the server if it was already persisted. 11351 // Optimistically removes the model from its collection, if it has one. 11352 // If `wait: true` is passed, waits for the server to respond before removal. 11353 destroy: function(options) { 11354 options = options ? _.clone(options) : {}; 11355 var model = this; 11356 var success = options.success; 11357 11358 var destroy = function() { 11359 model.trigger('destroy', model, model.collection, options); 11360 }; 11361 11362 options.success = function(resp) { 11363 if (options.wait || model.isNew()) destroy(); 11364 if (success) success(model, resp, options); 11365 if (!model.isNew()) model.trigger('sync', model, resp, options); 11366 }; 11367 11368 if (this.isNew()) { 11369 options.success(); 11370 return false;
11371 } 11372 wrapError(this, options); 11373 11374 var xhr = this.sync('delete', this, options); 11375 if (!options.wait) destroy(); 11376 return xhr; 11377 }, 11378 11379 // Default URL for the model's representation on the server -- if you're 11380 // using Backbone's restful methods, override this to change the endpoint 11381 // that will be called. 11382 url: function() { 11383 var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError(); 11384 if (this.isNew()) return base; 11385 return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id); 11386 }, 11387 11388 // **parse** converts a response into the hash of attributes to be `set` on 11389 // the model. The default implementation is just to pass the response along. 11390 parse: function(resp, options) { 11391 return resp; 11392 }, 11393 11394 // Create a new model with identical attributes to this one. 11395 clone: function() { 11396 return new this.constructor(this.attributes); 11397 }, 11398 11399 // A model is new if it has never been saved to the server, and lacks an id. 11400 isNew: function() { 11401 return this.id == null; 11402 }, 11403 11404 // Check if the model is currently in a valid state. 11405 isValid: function(options) { 11406 return this._validate({}, _.extend(options || {}, { validate: true })); 11407 }, 11408 11409 // Run validation against the next complete set of model attributes, 11410 // returning `true` if all is well. Otherwise, fire an `"invalid"` event. 11411 _validate: function(attrs, options) { 11412 if (!options.validate || !this.validate) return true; 11413 attrs = _.extend({}, this.attributes, attrs); 11414 var error = this.validationError = this.validate(attrs, options) || null; 11415 if (!error) return true; 11416 this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error})); 11417 return false; 11418 } 11419 11420 }); 11421 11422 // Underscore methods that we want to implement on the Model. 11423 var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit']; 11424 11425 // Mix in each Underscore method as a proxy to `Model#attributes`. 11426 _.each(modelMethods, function(method) { 11427 Model.prototype[method] = function() { 11428 var args = slice.call(arguments); 11429 args.unshift(this.attributes); 11430 return _[method].apply(_, args); 11431 }; 11432 }); 11433 11434 // Backbone.Collection 11435 // ------------------- 11436 11437 // If models tend to represent a single row of data, a Backbone Collection is 11438 // more analagous to a table full of data ... or a small slice or page of that 11439 // table, or a collection of rows that belong together for a particular reason 11440 // -- all of the messages in this particular folder, all of the documents
11441 // belonging to this particular author, and so on. Collections maintain 11442 // indexes of their models, both in order, and for lookup by `id`. 11443 11444 // Create a new **Collection**, perhaps to contain a specific type of `model`. 11445 // If a `comparator` is specified, the Collection will maintain 11446 // its models in sort order, as they're added and removed. 11447 var Collection = Backbone.Collection = function(models, options) { 11448 options || (options = {}); 11449 if (options.url) this.url = options.url; 11450 if (options.model) this.model = options.model; 11451 if (options.comparator !== void 0) this.comparator = options.comparator; 11452 this._reset(); 11453 this.initialize.apply(this, arguments); 11454 if (models) this.reset(models, _.extend({silent: true}, options)); 11455 }; 11456 11457 // Default options for `Collection#set`. 11458 var setOptions = {add: true, remove: true, merge: true}; 11459 var addOptions = {add: true, merge: false, remove: false}; 11460 11461 // Define the Collection's inheritable methods. 11462 _.extend(Collection.prototype, Events, { 11463 11464 // The default model for a collection is just a **Backbone.Model**. 11465 // This should be overridden in most cases. 11466 model: Model, 11467 11468 // Initialize is an empty function by default. Override it with your own 11469 // initialization logic. 11470 initialize: function(){}, 11471 11472 // The JSON representation of a Collection is an array of the 11473 // models' attributes. 11474 toJSON: function(options) { 11475 return this.map(function(model){ return model.toJSON(options); }); 11476 }, 11477 11478 // Proxy `Backbone.sync` by default. 11479 sync: function() { 11480 return Backbone.sync.apply(this, arguments); 11481 }, 11482 11483 // Add a model, or list of models to the set. 11484 add: function(models, options) { 11485 return this.set(models, _.defaults(options || {}, addOptions)); 11486 }, 11487 11488 // Remove a model, or a list of models from the set. 11489 remove: function(models, options) { 11490 models = _.isArray(models) ? models.slice() : [models]; 11491 options || (options = {}); 11492 var i, l, index, model; 11493 for (i = 0, l = models.length; i < l; i++) { 11494 model = this.get(models[i]); 11495 if (!model) continue; 11496 delete this._byId[model.id]; 11497 delete this._byId[model.cid]; 11498 index = this.indexOf(model); 11499 this.models.splice(index, 1); 11500 this.length--; 11501 if (!options.silent) { 11502 options.index = index; 11503 model.trigger('remove', model, this, options); 11504 } 11505 this._removeReference(model); 11506 } 11507 return this; 11508 }, 11509 11510 // Update a collection by `set`-ing a new list of models, adding new ones, 11511 // removing models that are no longer present, and merging models that 11512 // already exist in the collection, as necessary. Similar to **Model#set**, 11513 // the core operation for updating the data contained by the collection. 11514 set: function(models, options) { 11515 options = _.defaults(options || {}, setOptions); 11516 if (options.parse) models = this.parse(models, options); 11517 if (!_.isArray(models)) models = models ? [models] : []; 11518 var i, l, model, attrs, existing, sort; 11519 var at = options.at; 11520 var sortable = this.comparator && (at == null) && options.sort !== false; 11521 var sortAttr = _.isString(this.comparator) ? this.comparator : null; 11522 var toAdd = [], toRemove = [], modelMap = {}; 11523 11524 // Turn bare objects into model references, and prevent invalid models 11525 // from being added. 11526 for (i = 0, l = models.length; i < l; i++) { 11527 if (!(model = this._prepareModel(models[i], options))) continue; 11528 11529 // If a duplicate is found, prevent it from being added and 11530 // optionally merge it into the existing model. 11531 if (existing = this.get(model)) { 11532 if (options.remove) modelMap[existing.cid] = true; 11533 if (options.merge) { 11534 existing.set(model.attributes, options); 11535 if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true; 11536 } 11537 11538 // This is a new model, push it to the `toAdd` list. 11539 } else if (options.add) { 11540 toAdd.push(model); 11541 11542 // Listen to added models' events, and index models for lookup by 11543 // `id` and by `cid`. 11544 model.on('all', this._onModelEvent, this); 11545 this._byId[model.cid] = model; 11546 if (model.id != null) this._byId[model.id] = model; 11547 } 11548 } 11549 11550 // Remove nonexistent models if appropriate. 11551 if (options.remove) { 11552 for (i = 0, l = this.length; i < l; ++i) { 11553 if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model); 11554 } 11555 if (toRemove.length) this.remove(toRemove, options); 11556 } 11557 11558 // See if sorting is needed, update `length` and splice in new models. 11559 if (toAdd.length) { 11560 if (sortable) sort = true; 11561 this.length += toAdd.length; 11562 if (at != null) {
11563 splice.apply(this.models, [at, 0].concat(toAdd)); 11564 } else { 11565 push.apply(this.models, toAdd); 11566 } 11567 } 11568 11569 // Silently sort the collection if appropriate. 11570 if (sort) this.sort({silent: true}); 11571 11572 if (options.silent) return this; 11573 11574 // Trigger `add` events. 11575 for (i = 0, l = toAdd.length; i < l; i++) { 11576 (model = toAdd[i]).trigger('add', model, this, options); 11577 } 11578 11579 // Trigger `sort` if the collection was sorted. 11580 if (sort) this.trigger('sort', this, options); 11581 return this; 11582 }, 11583 11584 // When you have more items than you want to add or remove individually, 11585 // you can reset the entire set with a new list of models, without firing 11586 // any granular `add` or `remove` events. Fires `reset` when finished. 11587 // Useful for bulk operations and optimizations. 11588 reset: function(models, options) { 11589 options || (options = {}); 11590 for (var i = 0, l = this.models.length; i < l; i++) { 11591 this._removeReference(this.models[i]); 11592 } 11593 options.previousModels = this.models; 11594 this._reset(); 11595 this.add(models, _.extend({silent: true}, options)); 11596 if (!options.silent) this.trigger('reset', this, options); 11597 return this; 11598 }, 11599 11600 // Add a model to the end of the collection. 11601 push: function(model, options) { 11602 model = this._prepareModel(model, options); 11603 this.add(model, _.extend({at: this.length}, options)); 11604 return model; 11605 }, 11606 11607 // Remove a model from the end of the collection. 11608 pop: function(options) { 11609 var model = this.at(this.length - 1); 11610 this.remove(model, options); 11611 return model; 11612 }, 11613 11614 // Add a model to the beginning of the collection. 11615 unshift: function(model, options) { 11616 model = this._prepareModel(model, options); 11617 this.add(model, _.extend({at: 0}, options)); 11618 return model; 11619 }, 11620 11621 // Remove a model from the beginning of the collection. 11622 shift: function(options) { 11623 var model = this.at(0); 11624 this.remove(model, options); 11625 return model; 11626 }, 11627 11628 // Slice out a sub-array of models from the collection. 11629 slice: function(begin, end) { 11630 return this.models.slice(begin, end); 11631 }, 11632 11633 // Get a model from the set by id. 11634 get: function(obj) { 11635 if (obj == null) return void 0; 11636 return this._byId[obj.id != null ? obj.id : obj.cid || obj]; 11637 }, 11638 11639 // Get the model at the given index. 11640 at: function(index) { 11641 return this.models[index]; 11642 }, 11643 11644 // Return models with matching attributes. Useful for simple cases of 11645 // `filter`. 11646 where: function(attrs, first) { 11647 if (_.isEmpty(attrs)) return first ? void 0 : []; 11648 return this[first ? 'find' : 'filter'](function(model) { 11649 for (var key in attrs) { 11650 if (attrs[key] !== model.get(key)) return false; 11651 } 11652 return true; 11653 }); 11654 }, 11655 11656 // Return the first model with matching attributes. Useful for simple cases 11657 // of `find`. 11658 findWhere: function(attrs) { 11659 return this.where(attrs, true); 11660 }, 11661 11662 // Force the collection to re-sort itself. You don't need to call this under 11663 // normal circumstances, as the set will maintain sort order as each item 11664 // is added. 11665 sort: function(options) { 11666 if (!this.comparator) throw new Error('Cannot sort a set without a comparator'); 11667 options || (options = {}); 11668 11669 // Run sort based on type of `comparator`. 11670 if (_.isString(this.comparator) || this.comparator.length === 1) { 11671 this.models = this.sortBy(this.comparator, this); 11672 } else { 11673 this.models.sort(_.bind(this.comparator, this)); 11674 } 11675 11676 if (!options.silent) this.trigger('sort', this, options); 11677 return this; 11678 }, 11679 11680 // Figure out the smallest index at which a model should be inserted so as 11681 // to maintain order. 11682 sortedIndex: function(model, value, context) { 11683 value || (value = this.comparator); 11684 var iterator = _.isFunction(value) ? value : function(model) { 11685 return model.get(value); 11686 }; 11687 return _.sortedIndex(this.models, model, iterator, context); 11688 }, 11689 11690 // Pluck an attribute from each model in the collection. 11691 pluck: function(attr) { 11692 return _.invoke(this.models, 'get', attr); 11693 }, 11694 11695 // Fetch the default set of models for this collection, resetting the 11696 // collection when they arrive. If `reset: true` is passed, the response 11697 // data will be passed through the `reset` method instead of `set`. 11698 fetch: function(options) { 11699 options = options ? _.clone(options) : {}; 11700 if (options.parse === void 0) options.parse = true; 11701 var success = options.success; 11702 var collection = this; 11703 options.success = function(resp) { 11704 var method = options.reset ? 'reset' : 'set'; 11705 collection[method](resp, options); 11706 if (success) success(collection, resp, options); 11707 collection.trigger('sync', collection, resp, options); 11708 }; 11709 wrapError(this, options); 11710 return this.sync('read', this, options); 11711 }, 11712 11713 // Create a new instance of a model in this collection. Add the model to the 11714 // collection immediately, unless `wait: true` is passed, in which case we 11715 // wait for the server to agree. 11716 create: function(model, options) { 11717 options = options ? _.clone(options) : {}; 11718 if (!(model = this._prepareModel(model, options))) return false;
11719 if (!options.wait) this.add(model, options); 11720 var collection = this; 11721 var success = options.success; 11722 options.success = function(resp) { 11723 if (options.wait) collection.add(model, options); 11724 if (success) success(model, resp, options); 11725 }; 11726 model.save(null, options); 11727 return model; 11728 }, 11729 11730 // **parse** converts a response into a list of models to be added to the 11731 // collection. The default implementation is just to pass it through. 11732 parse: function(resp, options) { 11733 return resp; 11734 }, 11735 11736 // Create a new collection with an identical list of models as this one. 11737 clone: function() { 11738 return new this.constructor(this.models); 11739 }, 11740 11741 // Private method to reset all internal state. Called when the collection 11742 // is first initialized or reset. 11743 _reset: function() { 11744 this.length = 0; 11745 this.models = []; 11746 this._byId = {}; 11747 }, 11748 11749 // Prepare a hash of attributes (or other model) to be added to this 11750 // collection. 11751 _prepareModel: function(attrs, options) { 11752 if (attrs instanceof Model) { 11753 if (!attrs.collection) attrs.collection = this; 11754 return attrs; 11755 } 11756 options || (options = {}); 11757 options.collection = this; 11758 var model = new this.model(attrs, options); 11759 if (!model._validate(attrs, options)) { 11760 this.trigger('invalid', this, attrs, options); 11761 return false; 11762 } 11763 return model; 11764 }, 11765 11766 // Internal method to sever a model's ties to a collection. 11767 _removeReference: function(model) { 11768 if (this === model.collection) delete model.collection; 11769 model.off('all', this._onModelEvent, this); 11770 }, 11771 11772 // Internal method called every time a model in the set fires an event. 11773 // Sets need to update their indexes when models change ids. All other 11774 // events simply proxy through. "add" and "remove" events that originate 11775 // in other collections are ignored. 11776 _onModelEvent: function(event, model, collection, options) { 11777 if ((event === 'add' || event === 'remove') && collection !== this) return; 11778 if (event === 'destroy') this.remove(model, options); 11779 if (model && event === 'change:' + model.idAttribute) { 11780 delete this._byId[model.previous(model.idAttribute)]; 11781 if (model.id != null) this._byId[model.id] = model; 11782 } 11783 this.trigger.apply(this, arguments); 11784 } 11785 11786 }); 11787 11788 // Underscore methods that we want to implement on the Collection. 11789 // 90% of the core usefulness of Backbone Collections is actually implemented 11790 // right here: 11791 var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl', 11792 'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select', 11793 'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke', 11794 'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest', 11795 'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf', 11796 'isEmpty', 'chain']; 11797 11798 // Mix in each Underscore method as a proxy to `Collection#models`. 11799 _.each(methods, function(method) { 11800 Collection.prototype[method] = function() { 11801 var args = slice.call(arguments); 11802 args.unshift(this.models); 11803 return _[method].apply(_, args); 11804 }; 11805 }); 11806 11807 // Underscore methods that take a property name as an argument. 11808 var attributeMethods = ['groupBy', 'countBy', 'sortBy']; 11809 11810 // Use attributes instead of properties. 11811 _.each(attributeMethods, function(method) { 11812 Collection.prototype[method] = function(value, context) { 11813 var iterator = _.isFunction(value) ? value : function(model) { 11814 return model.get(value); 11815 }; 11816 return _[method](this.models, iterator, context); 11817 }; 11818 }); 11819 11820 // Backbone.View 11821 // ------------- 11822 11823 // Backbone Views are almost more convention than they are actual code. A View 11824 // is simply a JavaScript object that represents a logical chunk of UI in the 11825 // DOM. This might be a single item, an entire list, a sidebar or panel, or 11826 // even the surrounding frame which wraps your whole app. Defining a chunk of 11827 // UI as a **View** allows you to define your DOM events declaratively, without 11828 // having to worry about render order ... and makes it easy for the view to 11829 // react to specific changes in the state of your models. 11830 11831 // Creating a Backbone.View creates its initial element outside of the DOM,
11832 // if an existing element is not provided... 11833 var View = Backbone.View = function(options) { 11834 this.cid = _.uniqueId('view'); 11835 this._configure(options || {}); 11836 this._ensureElement(); 11837 this.initialize.apply(this, arguments); 11838 this.delegateEvents(); 11839 }; 11840 11841 // Cached regex to split keys for `delegate`. 11842 var delegateEventSplitter = /^(\S+)\s*(.*)$/; 11843 11844 // List of view options to be merged as properties. 11845 var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events']; 11846 11847 // Set up all inheritable **Backbone.View** properties and methods. 11848 _.extend(View.prototype, Events, { 11849 11850 // The default `tagName` of a View's element is `"div"`. 11851 tagName: 'div', 11852 11853 // jQuery delegate for element lookup, scoped to DOM elements within the 11854 // current view. This should be prefered to global lookups where possible. 11855 $: function(selector) { 11856 return this.$el.find(selector); 11857 }, 11858 11859 // Initialize is an empty function by default. Override it with your own 11860 // initialization logic. 11861 initialize: function(){}, 11862 11863 // **render** is the core function that your view should override, in order 11864 // to populate its element (`this.el`), with the appropriate HTML. The 11865 // convention is for **render** to always return `this`. 11866 render: function() { 11867 return this; 11868 }, 11869 11870 // Remove this view by taking the element out of the DOM, and removing any 11871 // applicable Backbone.Events listeners. 11872 remove: function() { 11873 this.$el.remove(); 11874 this.stopListening(); 11875 return this; 11876 }, 11877 11878 // Change the view's element (`this.el` property), including event 11879 // re-delegation. 11880 setElement: function(element, delegate) { 11881 if (this.$el) this.undelegateEvents(); 11882 this.$el = element instanceof Backbone.$ ? element : Backbone.$(element); 11883 this.el = this.$el[0]; 11884 if (delegate !== false) this.delegateEvents(); 11885 return this; 11886 }, 11887 11888 // Set callbacks, where `this.events` is a hash of 11889 // 11890 // *{"event selector": "callback"}* 11891 // 11892 // { 11893 // 'mousedown .title': 'edit', 11894 // 'click .button': 'save' 11895 // 'click .open': function(e) { ... } 11896 // } 11897 // 11898 // pairs. Callbacks will be bound to the view, with `this` set properly. 11899 // Uses event delegation for efficiency. 11900 // Omitting the selector binds the event to `this.el`. 11901 // This only works for delegate-able events: not `focus`, `blur`, and 11902 // not `change`, `submit`, and `reset` in Internet Explorer. 11903 delegateEvents: function(events) { 11904 if (!(events || (events = _.result(this, 'events')))) return this; 11905 this.undelegateEvents(); 11906 for (var key in events) { 11907 var method = events[key]; 11908 if (!_.isFunction(method)) method = this[events[key]]; 11909 if (!method) continue; 11910 11911 var match = key.match(delegateEventSplitter); 11912 var eventName = match[1], selector = match[2]; 11913 method = _.bind(method, this); 11914 eventName += '.delegateEvents' + this.cid; 11915 if (selector === '') { 11916 this.$el.on(eventName, method); 11917 } else { 11918 this.$el.on(eventName, selector, method); 11919 } 11920 } 11921 return this; 11922 }, 11923 11924 // Clears all callbacks previously bound to the view with `delegateEvents`. 11925 // You usually don't need to use this, but may wish to if you have multiple 11926 // Backbone views attached to the same DOM element. 11927 undelegateEvents: function() { 11928 this.$el.off('.delegateEvents' + this.cid); 11929 return this; 11930 }, 11931 11932 // Performs the initial configuration of a View with a set of options. 11933 // Keys with special meaning *(e.g. model, collection, id, className)* are 11934 // attached directly to the view. See `viewOptions` for an exhaustive 11935 // list. 11936 _configure: function(options) { 11937 if (this.options) options = _.extend({}, _.result(this, 'options'), options); 11938 _.extend(this, _.pick(options, viewOptions)); 11939 this.options = options; 11940 }, 11941 11942 // Ensure that the View has a DOM element to render into. 11943 // If `this.el` is a string, pass it through `$()`, take the first 11944 // matching element, and re-assign it to `el`. Otherwise, create 11945 // an element from the `id`, `className` and `tagName` properties. 11946 _ensureElement: function() { 11947 if (!this.el) { 11948 var attrs = _.extend({}, _.result(this, 'attributes'));
11949 if (this.id) attrs.id = _.result(this, 'id'); 11950 if (this.className) attrs['class'] = _.result(this, 'className'); 11951 var $el = Backbone.$('<' + _.result(this, 'tagName') + '/>').attr(attrs); 11952 this.setElement($el, false); 11953 } else { 11954 this.setElement(_.result(this, 'el'), false); 11955 } 11956 } 11957 11958 }); 11959 11960 // Backbone.sync 11961 // ------------- 11962 11963 // Override this function to change the manner in which Backbone persists 11964 // models to the server. You will be passed the type of request, and the 11965 // model in question. By default, makes a RESTful Ajax request 11966 // to the model's `url()`. Some possible customizations could be: 11967 // 11968 // * Use `setTimeout` to batch rapid-fire updates into a single request. 11969 // * Send up the models as XML instead of JSON. 11970 // * Persist models via WebSockets instead of Ajax. 11971 // 11972 // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests 11973 // as `POST`, with a `_method` parameter containing the true HTTP method, 11974 // as well as all requests with the body as `application/x-www-form-urlencoded` 11975 // instead of `application/json` with the model in a param named `model`. 11976 // Useful when interfacing with server-side languages like **PHP** that make 11977 // it difficult to read the body of `PUT` requests. 11978 Backbone.sync = function(method, model, options) { 11979 var type = methodMap[method]; 11980 11981 // Default options, unless specified. 11982 _.defaults(options || (options = {}), { 11983 emulateHTTP: Backbone.emulateHTTP, 11984 emulateJSON: Backbone.emulateJSON 11985 }); 11986 11987 // Default JSON-request options. 11988 var params = {type: type, dataType: 'json'}; 11989 11990 // Ensure that we have a URL. 11991 if (!options.url) { 11992 params.url = _.result(model, 'url') || urlError(); 11993 } 11994 11995 // Ensure that we have the appropriate request data. 11996 if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) { 11997 params.contentType = 'application/json'; 11998 params.data = JSON.stringify(options.attrs || model.toJSON(options)); 11999 } 12000 12001 // For older servers, emulate JSON by encoding the request into an HTML-form. 12002 if (options.emulateJSON) { 12003 params.contentType = 'application/x-www-form-urlencoded'; 12004 params.data = params.data ? {model: params.data} : {}; 12005 } 12006 12007 // For older servers, emulate HTTP by mimicking the HTTP method with `_method` 12008 // And an `X-HTTP-Method-Override` header. 12009 if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) { 12010 params.type = 'POST'; 12011 if (options.emulateJSON) params.data._method = type; 12012 var beforeSend = options.beforeSend; 12013 options.beforeSend = function(xhr) { 12014 xhr.setRequestHeader('X-HTTP-Method-Override', type); 12015 if (beforeSend) return beforeSend.apply(this, arguments); 12016 }; 12017 } 12018 12019 // Don't process data on a non-GET request. 12020 if (params.type !== 'GET' && !options.emulateJSON) { 12021 params.processData = false; 12022 } 12023 12024 // If we're sending a `PATCH` request, and we're in an old Internet Explorer 12025 // that still has ActiveX enabled by default, override jQuery to use that 12026 // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8. 12027 if (params.type === 'PATCH' && window.ActiveXObject && 12028 !(window.external && window.external.msActiveXFilteringEnabled)) { 12029 params.xhr = function() { 12030 return new ActiveXObject("Microsoft.XMLHTTP"); 12031 }; 12032 } 12033 12034 // Make the request, allowing the user to override any Ajax options. 12035 var xhr = options.xhr = Backbone.ajax(_.extend(params, options)); 12036 model.trigger('request', model, xhr, options); 12037 return xhr; 12038 }; 12039 12040 // Map from CRUD to HTTP for our default `Backbone.sync` implementation. 12041 var methodMap = { 12042 'create': 'POST', 12043 'update': 'PUT', 12044 'patch': 'PATCH', 12045 'delete': 'DELETE', 12046 'read': 'GET' 12047 }; 12048 12049 // Set the default implementation of `Backbone.ajax` to proxy through to `$`. 12050 // Override this if you'd like to use a different library. 12051 Backbone.ajax = function() { 12052 return Backbone.$.ajax.apply(Backbone.$, arguments); 12053 }; 12054 12055 // Backbone.Router 12056 // --------------- 12057 12058 // Routers map faux-URLs to actions, and fire events when routes are 12059 // matched. Creating a new one sets its `routes` hash, if not set statically. 12060 var Router = Backbone.Router = function(options) {
12061 options || (options = {}); 12062 if (options.routes) this.routes = options.routes; 12063 this._bindRoutes(); 12064 this.initialize.apply(this, arguments); 12065 }; 12066 12067 // Cached regular expressions for matching named param parts and splatted 12068 // parts of route strings. 12069 var optionalParam = /\((.*?)\)/g; 12070 var namedParam = /(\(\?)?:\w+/g; 12071 var splatParam = /\*\w+/g; 12072 var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; 12073 12074 // Set up all inheritable **Backbone.Router** properties and methods. 12075 _.extend(Router.prototype, Events, { 12076 12077 // Initialize is an empty function by default. Override it with your own 12078 // initialization logic. 12079 initialize: function(){}, 12080 12081 // Manually bind a single named route to a callback. For example: 12082 // 12083 // this.route('search/:query/p:num', 'search', function(query, num) { 12084 // ... 12085 // }); 12086 // 12087 route: function(route, name, callback) { 12088 if (!_.isRegExp(route)) route = this._routeToRegExp(route); 12089 if (_.isFunction(name)) { 12090 callback = name; 12091 name = ''; 12092 } 12093 if (!callback) callback = this[name]; 12094 var router = this; 12095 Backbone.history.route(route, function(fragment) { 12096 var args = router._extractParameters(route, fragment); 12097 callback && callback.apply(router, args); 12098 router.trigger.apply(router, ['route:' + name].concat(args)); 12099 router.trigger('route', name, args); 12100 Backbone.history.trigger('route', router, name, args); 12101 }); 12102 return this; 12103 }, 12104 12105 // Simple proxy to `Backbone.history` to save a fragment into the history. 12106 navigate: function(fragment, options) { 12107 Backbone.history.navigate(fragment, options); 12108 return this; 12109 }, 12110 12111 // Bind all defined routes to `Backbone.history`. We have to reverse the 12112 // order of the routes here to support behavior where the most general 12113 // routes can be defined at the bottom of the route map. 12114 _bindRoutes: function() { 12115 if (!this.routes) return; 12116 this.routes = _.result(this, 'routes'); 12117 var route, routes = _.keys(this.routes); 12118 while ((route = routes.pop()) != null) { 12119 this.route(route, this.routes[route]); 12120 } 12121 }, 12122 12123 // Convert a route string into a regular expression, suitable for matching 12124 // against the current location hash. 12125 _routeToRegExp: function(route) { 12126 route = route.replace(escapeRegExp, '\\$&') 12127 .replace(optionalParam, '(?:$1)?') 12128 .replace(namedParam, function(match, optional){ 12129 return optional ? match : '([^\/]+)'; 12130 }) 12131 .replace(splatParam, '(.*?)'); 12132 return new RegExp('^' + route + '$'); 12133 }, 12134 12135 // Given a route, and a URL fragment that it matches, return the array of 12136 // extracted decoded parameters. Empty or unmatched parameters will be 12137 // treated as `null` to normalize cross-browser behavior. 12138 _extractParameters: function(route, fragment) { 12139 var params = route.exec(fragment).slice(1); 12140 return _.map(params, function(param) { 12141 return param ? decodeURIComponent(param) : null; 12142 }); 12143 } 12144 12145 }); 12146 12147 // Backbone.History 12148 // ---------------- 12149 12150 // Handles cross-browser history management, based on either 12151 // [pushState](http://diveintohtml5.info/history.html) and real URLs, or 12152 // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) 12153 // and URL fragments. If the browser supports neither (old IE, natch), 12154 // falls back to polling. 12155 var History = Backbone.History = function() { 12156 this.handlers = []; 12157 _.bindAll(this, 'checkUrl'); 12158 12159 // Ensure that `History` can be used outside of the browser. 12160 if (typeof window !== 'undefined') { 12161 this.location = window.location; 12162 this.history = window.history; 12163 } 12164 }; 12165 12166 // Cached regex for stripping a leading hash/slash and trailing space. 12167 var routeStripper = /^[#\/]|\s+$/g; 12168 12169 // Cached regex for stripping leading and trailing slashes. 12170 var rootStripper = /^\/+|\/+$/g; 12171 12172 // Cached regex for detecting MSIE. 12173 var isExplorer = /msie [\w.]+/; 12174 12175 // Cached regex for removing a trailing slash. 12176 var trailingSlash = /\/$/; 12177 12178 // Has the history handling already been started? 12179 History.started = false;
12180 12181 // Set up all inheritable **Backbone.History** properties and methods. 12182 _.extend(History.prototype, Events, { 12183 12184 // The default interval to poll for hash changes, if necessary, is 12185 // twenty times a second. 12186 interval: 50, 12187 12188 // Gets the true hash value. Cannot use location.hash directly due to bug 12189 // in Firefox where location.hash will always be decoded. 12190 getHash: function(window) { 12191 var match = (window || this).location.href.match(/#(.*)$/); 12192 return match ? match[1] : ''; 12193 }, 12194 12195 // Get the cross-browser normalized URL fragment, either from the URL, 12196 // the hash, or the override. 12197 getFragment: function(fragment, forcePushState) { 12198 if (fragment == null) { 12199 if (this._hasPushState || !this._wantsHashChange || forcePushState) { 12200 fragment = this.location.pathname; 12201 var root = this.root.replace(trailingSlash, ''); 12202 if (!fragment.indexOf(root)) fragment = fragment.substr(root.length); 12203 } else { 12204 fragment = this.getHash(); 12205 } 12206 } 12207 return fragment.replace(routeStripper, ''); 12208 }, 12209 12210 // Start the hash change handling, returning `true` if the current URL matches 12211 // an existing route, and `false` otherwise. 12212 start: function(options) { 12213 if (History.started) throw new Error("Backbone.history has already been started"); 12214 History.started = true; 12215 12216 // Figure out the initial configuration. Do we need an iframe? 12217 // Is pushState desired ... is it available? 12218 this.options = _.extend({}, {root: '/'}, this.options, options); 12219 this.root = this.options.root; 12220 this._wantsHashChange = this.options.hashChange !== false; 12221 this._wantsPushState = !!this.options.pushState; 12222 this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); 12223 var fragment = this.getFragment(); 12224 var docMode = document.documentMode; 12225 var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7)); 12226 12227 // Normalize root to always include a leading and trailing slash. 12228 this.root = ('/' + this.root + '/').replace(rootStripper, '/'); 12229 12230 if (oldIE && this._wantsHashChange) { 12231 this.iframe = Backbone.$('<iframe src="javascript:0" tabindex="-1" ></iframe>').hide().appendTo('body')[0].contentWindow; 12232 this.navigate(fragment); 12233 } 12234 12235 // Depending on whether we're using pushState or hashes, and whether 12236 // 'onhashchange' is supported, determine how we check the URL state. 12237 if (this._hasPushState) { 12238 Backbone.$(window).on('popstate', this.checkUrl); 12239 } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) { 12240 Backbone.$(window).on('hashchange', this.checkUrl); 12241 } else if (this._wantsHashChange) { 12242 this._checkUrlInterval = setInterval(this.checkUrl, this.interval); 12243 } 12244 12245 // Determine if we need to change the base url, for a pushState link 12246 // opened by a non-pushState browser. 12247 this.fragment = fragment; 12248 var loc = this.location; 12249 var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root; 12250 12251 // If we've started off with a route from a `pushState`-enabled browser, 12252 // but we're currently in a browser that doesn't support it... 12253 if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) { 12254 this.fragment = this.getFragment(null, true); 12255 this.location.replace(this.root + this.location.search + '#' + this.fragment); 12256 // Return immediately as browser will do redirect to new url 12257 return true; 12258 12259 // Or if we've started out with a hash-based route, but we're currently 12260 // in a browser where it could be `pushState`-based instead... 12261 } else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) { 12262 this.fragment = this.getHash().replace(routeStripper, ''); 12263 this.history.replaceState({}, document.title, this.root + this.fragment + loc.search); 12264 } 12265 12266 if (!this.options.silent) return this.loadUrl(); 12267 }, 12268 12269 // Disable Backbone.history, perhaps temporarily. Not useful in a real app, 12270 // but possibly useful for unit testing Routers. 12271 stop: function() { 12272 Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl); 12273 clearInterval(this._checkUrlInterval); 12274 History.started = false;
12275 }, 12276 12277 // Add a route to be tested when the fragment changes. Routes added later 12278 // may override previous routes. 12279 route: function(route, callback) { 12280 this.handlers.unshift({route: route, callback: callback}); 12281 }, 12282 12283 // Checks the current URL to see if it has changed, and if it has, 12284 // calls `loadUrl`, normalizing across the hidden iframe. 12285 checkUrl: function(e) { 12286 var current = this.getFragment(); 12287 if (current === this.fragment && this.iframe) { 12288 current = this.getFragment(this.getHash(this.iframe)); 12289 } 12290 if (current === this.fragment) return false; 12291 if (this.iframe) this.navigate(current); 12292 this.loadUrl() || this.loadUrl(this.getHash()); 12293 }, 12294 12295 // Attempt to load the current URL fragment. If a route succeeds with a 12296 // match, returns `true`. If no defined routes matches the fragment, 12297 // returns `false`. 12298 loadUrl: function(fragmentOverride) { 12299 var fragment = this.fragment = this.getFragment(fragmentOverride); 12300 var matched = _.any(this.handlers, function(handler) { 12301 if (handler.route.test(fragment)) { 12302 handler.callback(fragment); 12303 return true; 12304 } 12305 }); 12306 return matched; 12307 }, 12308 12309 // Save a fragment into the hash history, or replace the URL state if the 12310 // 'replace' option is passed. You are responsible for properly URL-encoding 12311 // the fragment in advance. 12312 // 12313 // The options object can contain `trigger: true` if you wish to have the 12314 // route callback be fired (not usually desirable), or `replace: true`, if 12315 // you wish to modify the current URL without adding an entry to the history. 12316 navigate: function(fragment, options) { 12317 if (!History.started) return false; 12318 if (!options || options === true) options = {trigger: options}; 12319 fragment = this.getFragment(fragment || ''); 12320 if (this.fragment === fragment) return; 12321 this.fragment = fragment; 12322 var url = this.root + fragment; 12323 12324 // If pushState is available, we use it to set the fragment as a real URL. 12325 if (this._hasPushState) { 12326 this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); 12327 12328 // If hash changes haven't been explicitly disabled, update the hash 12329 // fragment to store history. 12330 } else if (this._wantsHashChange) { 12331 this._updateHash(this.location, fragment, options.replace); 12332 if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) { 12333 // Opening and closing the iframe tricks IE7 and earlier to push a 12334 // history entry on hash-tag change. When replace is true, we don't 12335 // want this. 12336 if(!options.replace) this.iframe.document.open().close(); 12337 this._updateHash(this.iframe.location, fragment, options.replace); 12338 } 12339 12340 // If you've told us that you explicitly don't want fallback hashchange- 12341 // based history, then `navigate` becomes a page refresh. 12342 } else { 12343 return this.location.assign(url); 12344 } 12345 if (options.trigger) this.loadUrl(fragment); 12346 }, 12347 12348 // Update the hash location, either replacing the current entry, or adding 12349 // a new one to the browser history. 12350 _updateHash: function(location, fragment, replace) { 12351 if (replace) { 12352 var href = location.href.replace(/(javascript:|#).*$/, ''); 12353 location.replace(href + '#' + fragment); 12354 } else { 12355 // Some browsers require that `hash` contains a leading #. 12356 location.hash = '#' + fragment; 12357 } 12358 } 12359 12360 }); 12361 12362 // Create the default Backbone.history. 12363 Backbone.history = new History; 12364 12365 // Helpers 12366 // ------- 12367 12368 // Helper function to correctly set up the prototype chain, for subclasses. 12369 // Similar to `goog.inherits`, but uses a hash of prototype properties and 12370 // class properties to be extended. 12371 var extend = function(protoProps, staticProps) { 12372 var parent = this; 12373 var child; 12374 12375 // The constructor function for the new subclass is either defined by you 12376 // (the "constructor" property in your `extend` definition), or defaulted 12377 // by us to simply call the parent's constructor. 12378 if (protoProps && _.has(protoProps, 'constructor')) { 12379 child = protoProps.constructor; 12380 } else { 12381 child = function(){ return parent.apply(this, arguments); }; 12382 } 12383 12384 // Add static properties to the constructor function, if supplied.
12385 _.extend(child, parent, staticProps); 12386 12387 // Set the prototype chain to inherit from `parent`, without calling 12388 // `parent`'s constructor function. 12389 var Surrogate = function(){ this.constructor = child; }; 12390 Surrogate.prototype = parent.prototype; 12391 child.prototype = new Surrogate; 12392 12393 // Add prototype properties (instance properties) to the subclass, 12394 // if supplied. 12395 if (protoProps) _.extend(child.prototype, protoProps); 12396 12397 // Set a convenience property in case the parent's prototype is needed 12398 // later. 12399 child.__super__ = parent.prototype; 12400 12401 return child; 12402 }; 12403 12404 // Set up inheritance for the model, collection, router, view and history. 12405 Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend; 12406 12407 // Throw an error when a URL is needed, and none is supplied. 12408 var urlError = function() { 12409 throw new Error('A "url" property or function must be specified'); 12410 }; 12411 12412 // Wrap an optional error callback with a fallback error event. 12413 var wrapError = function (model, options) { 12414 var error = options.error; 12415 options.error = function(resp) { 12416 if (error) error(model, resp, options); 12417 model.trigger('error', model, resp, options); 12418 }; 12419 }; 12420 12421}).call(this); 12422 12423//! moment.js 12424//! version : 2.29.4 12425//! authors : Tim Wood, Iskren Chernev, Moment.js contributors 12426//! license : MIT 12427//! momentjs.com 12428 12429;(function (global, factory) { 12430 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 12431 typeof define === 'function' && define.amd ? define(factory) : 12432 global.moment = factory() 12433}(this, (function () { 'use strict'; 12434 12435 var hookCallback; 12436 12437 function hooks() { 12438 return hookCallback.apply(null, arguments); 12439 } 12440 12441 // This is done to register the method called with moment() 12442 // without creating circular dependencies. 12443 function setHookCallback(callback) { 12444 hookCallback = callback; 12445 } 12446 12447 function isArray(input) { 12448 return ( 12449 input instanceof Array || 12450 Object.prototype.toString.call(input) === '[object Array]' 12451 ); 12452 } 12453 12454 function isObject(input) { 12455 // IE8 will treat undefined and null as object if it wasn't for 12456 // input != null 12457 return ( 12458 input != null && 12459 Object.prototype.toString.call(input) === '[object Object]' 12460 ); 12461 } 12462 12463 function hasOwnProp(a, b) { 12464 return Object.prototype.hasOwnProperty.call(a, b); 12465 } 12466 12467 function isObjectEmpty(obj) { 12468 if (Object.getOwnPropertyNames) { 12469 return Object.getOwnPropertyNames(obj).length === 0; 12470 } else { 12471 var k; 12472 for (k in obj) { 12473 if (hasOwnProp(obj, k)) { 12474 return false; 12475 } 12476 } 12477 return true; 12478 } 12479 } 12480 12481 function isUndefined(input) { 12482 return input === void 0; 12483 } 12484 12485 function isNumber(input) { 12486 return ( 12487 typeof input === 'number' || 12488 Object.prototype.toString.call(input) === '[object Number]' 12489 ); 12490 } 12491 12492 function isDate(input) { 12493 return ( 12494 input instanceof Date || 12495 Object.prototype.toString.call(input) === '[object Date]' 12496 ); 12497 } 12498 12499 function map(arr, fn) { 12500 var res = [], 12501 i, 12502 arrLen = arr.length; 12503 for (i = 0; i < arrLen; ++i) { 12504 res.push(fn(arr[i], i)); 12505 } 12506 return res; 12507 } 12508 12509 function extend(a, b) { 12510 for (var i in b) { 12511 if (hasOwnProp(b, i)) { 12512 a[i] = b[i]; 12513 } 12514 } 12515 12516 if (hasOwnProp(b, 'toString')) { 12517 a.toString = b.toString; 12518 } 12519 12520 if (hasOwnProp(b, 'valueOf')) { 12521 a.valueOf = b.valueOf; 12522 } 12523 12524 return a; 12525 } 12526 12527 function createUTC(input, format, locale, strict) { 12528 return createLocalOrUTC(input, format, locale, strict, true).utc(); 12529 } 12530 12531 function defaultParsingFlags() { 12532 // We need to deep clone this object. 12533 return { 12534 empty: false, 12535 unusedTokens: [], 12536 unusedInput: [], 12537 overflow: -2, 12538 charsLeftOver: 0, 12539 nullInput: false, 12540 invalidEra: null, 12541 invalidMonth: null, 12542 invalidFormat: false, 12543 userInvalidated: false, 12544 iso: false, 12545 parsedDateParts: [], 12546 era: null, 12547 meridiem: null, 12548 rfc2822: false, 12549 weekdayMismatch: false, 12550 }; 12551 } 12552 12553 function getParsingFlags(m) { 12554 if (m._pf == null) { 12555 m._pf = defaultParsingFlags(); 12556 } 12557 return m._pf; 12558 } 12559 12560 var some; 12561 if (Array.prototype.some) { 12562 some = Array.prototype.some; 12563 } else { 12564 some = function (fun) { 12565 var t = Object(this), 12566 len = t.length >>> 0, 12567 i; 12568 12569 for (i = 0; i < len; i++) { 12570 if (i in t && fun.call(this, t[i], i, t)) { 12571 return true; 12572 } 12573 } 12574 12575 return false;
vendor: 23,269 bytes, lines 12576-13367
12576 }; 12577 } 12578 12579 function isValid(m) { 12580 if (m._isValid == null) { 12581 var flags = getParsingFlags(m), 12582 parsedParts = some.call(flags.parsedDateParts, function (i) { 12583 return i != null; 12584 }), 12585 isNowValid = 12586 !isNaN(m._d.getTime()) && 12587 flags.overflow < 0 && 12588 !flags.empty && 12589 !flags.invalidEra && 12590 !flags.invalidMonth && 12591 !flags.invalidWeekday && 12592 !flags.weekdayMismatch && 12593 !flags.nullInput && 12594 !flags.invalidFormat && 12595 !flags.userInvalidated && 12596 (!flags.meridiem || (flags.meridiem && parsedParts)); 12597 12598 if (m._strict) { 12599 isNowValid = 12600 isNowValid && 12601 flags.charsLeftOver === 0 && 12602 flags.unusedTokens.length === 0 && 12603 flags.bigHour === undefined; 12604 } 12605 12606 if (Object.isFrozen == null || !Object.isFrozen(m)) { 12607 m._isValid = isNowValid; 12608 } else { 12609 return isNowValid; 12610 } 12611 } 12612 return m._isValid; 12613 } 12614 12615 function createInvalid(flags) { 12616 var m = createUTC(NaN); 12617 if (flags != null) { 12618 extend(getParsingFlags(m), flags); 12619 } else { 12620 getParsingFlags(m).userInvalidated = true; 12621 } 12622 12623 return m; 12624 } 12625 12626 // Plugins that add properties should also add the key here (null value), 12627 // so we can properly clone ourselves. 12628 var momentProperties = (hooks.momentProperties = []), 12629 updateInProgress = false; 12630 12631 function copyConfig(to, from) { 12632 var i, 12633 prop, 12634 val, 12635 momentPropertiesLen = momentProperties.length; 12636 12637 if (!isUndefined(from._isAMomentObject)) { 12638 to._isAMomentObject = from._isAMomentObject; 12639 } 12640 if (!isUndefined(from._i)) { 12641 to._i = from._i; 12642 } 12643 if (!isUndefined(from._f)) { 12644 to._f = from._f; 12645 } 12646 if (!isUndefined(from._l)) { 12647 to._l = from._l; 12648 } 12649 if (!isUndefined(from._strict)) { 12650 to._strict = from._strict; 12651 } 12652 if (!isUndefined(from._tzm)) { 12653 to._tzm = from._tzm; 12654 } 12655 if (!isUndefined(from._isUTC)) { 12656 to._isUTC = from._isUTC; 12657 } 12658 if (!isUndefined(from._offset)) { 12659 to._offset = from._offset; 12660 } 12661 if (!isUndefined(from._pf)) { 12662 to._pf = getParsingFlags(from); 12663 } 12664 if (!isUndefined(from._locale)) { 12665 to._locale = from._locale; 12666 } 12667 12668 if (momentPropertiesLen > 0) { 12669 for (i = 0; i < momentPropertiesLen; i++) { 12670 prop = momentProperties[i]; 12671 val = from[prop]; 12672 if (!isUndefined(val)) { 12673 to[prop] = val; 12674 } 12675 } 12676 } 12677 12678 return to; 12679 } 12680 12681 // Moment prototype object 12682 function Moment(config) { 12683 copyConfig(this, config); 12684 this._d = new Date(config._d != null ? config._d.getTime() : NaN); 12685 if (!this.isValid()) { 12686 this._d = new Date(NaN); 12687 } 12688 // Prevent infinite loop in case updateOffset creates new moment 12689 // objects. 12690 if (updateInProgress === false) { 12691 updateInProgress = true; 12692 hooks.updateOffset(this); 12693 updateInProgress = false; 12694 } 12695 } 12696 12697 function isMoment(obj) { 12698 return ( 12699 obj instanceof Moment || (obj != null && obj._isAMomentObject != null) 12700 ); 12701 } 12702 12703 function warn(msg) { 12704 if ( 12705 hooks.suppressDeprecationWarnings === false && 12706 typeof console !== 'undefined' && 12707 console.warn 12708 ) { 12709 console.warn('Deprecation warning: ' + msg); 12710 } 12711 } 12712 12713 function deprecate(msg, fn) { 12714 var firstTime = true; 12715 12716 return extend(function () { 12717 if (hooks.deprecationHandler != null) { 12718 hooks.deprecationHandler(null, msg); 12719 } 12720 if (firstTime) { 12721 var args = [], 12722 arg, 12723 i, 12724 key, 12725 argLen = arguments.length; 12726 for (i = 0; i < argLen; i++) { 12727 arg = ''; 12728 if (typeof arguments[i] === 'object') { 12729 arg += '\n[' + i + '] '; 12730 for (key in arguments[0]) { 12731 if (hasOwnProp(arguments[0], key)) { 12732 arg += key + ': ' + arguments[0][key] + ', '; 12733 } 12734 } 12735 arg = arg.slice(0, -2); // Remove trailing comma and space 12736 } else { 12737 arg = arguments[i]; 12738 } 12739 args.push(arg); 12740 } 12741 warn( 12742 msg + 12743 '\nArguments: ' + 12744 Array.prototype.slice.call(args).join('') + 12745 '\n' + 12746 new Error().stack 12747 ); 12748 firstTime = false; 12749 } 12750 return fn.apply(this, arguments); 12751 }, fn); 12752 } 12753 12754 var deprecations = {}; 12755 12756 function deprecateSimple(name, msg) { 12757 if (hooks.deprecationHandler != null) { 12758 hooks.deprecationHandler(name, msg); 12759 } 12760 if (!deprecations[name]) { 12761 warn(msg); 12762 deprecations[name] = true; 12763 } 12764 } 12765 12766 hooks.suppressDeprecationWarnings = false; 12767 hooks.deprecationHandler = null; 12768 12769 function isFunction(input) { 12770 return ( 12771 (typeof Function !== 'undefined' && input instanceof Function) || 12772 Object.prototype.toString.call(input) === '[object Function]' 12773 ); 12774 } 12775 12776 function set(config) { 12777 var prop, i; 12778 for (i in config) { 12779 if (hasOwnProp(config, i)) { 12780 prop = config[i]; 12781 if (isFunction(prop)) { 12782 this[i] = prop; 12783 } else { 12784 this['_' + i] = prop; 12785 } 12786 } 12787 } 12788 this._config = config; 12789 // Lenient ordinal parsing accepts just a number in addition to 12790 // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. 12791 // TODO: Remove "ordinalParse" fallback in next major release. 12792 this._dayOfMonthOrdinalParseLenient = new RegExp( 12793 (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + 12794 '|' + 12795 /\d{1,2}/.source 12796 ); 12797 } 12798 12799 function mergeConfigs(parentConfig, childConfig) { 12800 var res = extend({}, parentConfig), 12801 prop; 12802 for (prop in childConfig) { 12803 if (hasOwnProp(childConfig, prop)) { 12804 if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { 12805 res[prop] = {}; 12806 extend(res[prop], parentConfig[prop]); 12807 extend(res[prop], childConfig[prop]); 12808 } else if (childConfig[prop] != null) { 12809 res[prop] = childConfig[prop]; 12810 } else { 12811 delete res[prop]; 12812 } 12813 } 12814 } 12815 for (prop in parentConfig) { 12816 if ( 12817 hasOwnProp(parentConfig, prop) && 12818 !hasOwnProp(childConfig, prop) && 12819 isObject(parentConfig[prop]) 12820 ) { 12821 // make sure changes to properties don't modify parent config 12822 res[prop] = extend({}, res[prop]); 12823 } 12824 } 12825 return res; 12826 } 12827 12828 function Locale(config) { 12829 if (config != null) { 12830 this.set(config); 12831 } 12832 } 12833 12834 var keys; 12835 12836 if (Object.keys) { 12837 keys = Object.keys; 12838 } else { 12839 keys = function (obj) { 12840 var i, 12841 res = []; 12842 for (i in obj) { 12843 if (hasOwnProp(obj, i)) { 12844 res.push(i); 12845 } 12846 } 12847 return res; 12848 }; 12849 } 12850 12851 var defaultCalendar = { 12852 sameDay: '[Today at] LT', 12853 nextDay: '[Tomorrow at] LT', 12854 nextWeek: 'dddd [at] LT', 12855 lastDay: '[Yesterday at] LT', 12856 lastWeek: '[Last] dddd [at] LT', 12857 sameElse: 'L', 12858 }; 12859 12860 function calendar(key, mom, now) { 12861 var output = this._calendar[key] || this._calendar['sameElse']; 12862 return isFunction(output) ? output.call(mom, now) : output; 12863 } 12864 12865 function zeroFill(number, targetLength, forceSign) { 12866 var absNumber = '' + Math.abs(number), 12867 zerosToFill = targetLength - absNumber.length, 12868 sign = number >= 0; 12869 return ( 12870 (sign ? (forceSign ? '+' : '') : '-') + 12871 Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + 12872 absNumber 12873 ); 12874 } 12875 12876 var formattingTokens = 12877 /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, 12878 localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, 12879 formatFunctions = {}, 12880 formatTokenFunctions = {}; 12881 12882 // token: 'M' 12883 // padded: ['MM', 2] 12884 // ordinal: 'Mo' 12885 // callback: function () { this.month() + 1 } 12886 function addFormatToken(token, padded, ordinal, callback) { 12887 var func = callback; 12888 if (typeof callback === 'string') { 12889 func = function () { 12890 return this[callback](); 12891 }; 12892 } 12893 if (token) { 12894 formatTokenFunctions[token] = func; 12895 } 12896 if (padded) { 12897 formatTokenFunctions[padded[0]] = function () { 12898 return zeroFill(func.apply(this, arguments), padded[1], padded[2]); 12899 }; 12900 } 12901 if (ordinal) { 12902 formatTokenFunctions[ordinal] = function () { 12903 return this.localeData().ordinal( 12904 func.apply(this, arguments), 12905 token 12906 ); 12907 }; 12908 } 12909 } 12910 12911 function removeFormattingTokens(input) { 12912 if (input.match(/\[[\s\S]/)) { 12913 return input.replace(/^\[|\]$/g, ''); 12914 } 12915 return input.replace(/\\/g, ''); 12916 } 12917 12918 function makeFormatFunction(format) { 12919 var array = format.match(formattingTokens), 12920 i, 12921 length; 12922 12923 for (i = 0, length = array.length; i < length; i++) { 12924 if (formatTokenFunctions[array[i]]) { 12925 array[i] = formatTokenFunctions[array[i]]; 12926 } else { 12927 array[i] = removeFormattingTokens(array[i]); 12928 } 12929 } 12930 12931 return function (mom) { 12932 var output = '', 12933 i; 12934 for (i = 0; i < length; i++) { 12935 output += isFunction(array[i]) 12936 ? array[i].call(mom, format) 12937 : array[i]; 12938 } 12939 return output; 12940 }; 12941 } 12942 12943 // format date using native date object 12944 function formatMoment(m, format) { 12945 if (!m.isValid()) { 12946 return m.localeData().invalidDate(); 12947 } 12948 12949 format = expandFormat(format, m.localeData()); 12950 formatFunctions[format] = 12951 formatFunctions[format] || makeFormatFunction(format); 12952 12953 return formatFunctions[format](m); 12954 } 12955 12956 function expandFormat(format, locale) { 12957 var i = 5; 12958 12959 function replaceLongDateFormatTokens(input) { 12960 return locale.longDateFormat(input) || input; 12961 } 12962 12963 localFormattingTokens.lastIndex = 0; 12964 while (i >= 0 && localFormattingTokens.test(format)) { 12965 format = format.replace( 12966 localFormattingTokens, 12967 replaceLongDateFormatTokens 12968 ); 12969 localFormattingTokens.lastIndex = 0; 12970 i -= 1; 12971 } 12972 12973 return format; 12974 } 12975 12976 var defaultLongDateFormat = { 12977 LTS: 'h:mm:ss A', 12978 LT: 'h:mm A', 12979 L: 'MM/DD/YYYY', 12980 LL: 'MMMM D, YYYY', 12981 LLL: 'MMMM D, YYYY h:mm A', 12982 LLLL: 'dddd, MMMM D, YYYY h:mm A', 12983 }; 12984 12985 function longDateFormat(key) { 12986 var format = this._longDateFormat[key], 12987 formatUpper = this._longDateFormat[key.toUpperCase()]; 12988 12989 if (format || !formatUpper) { 12990 return format; 12991 } 12992 12993 this._longDateFormat[key] = formatUpper 12994 .match(formattingTokens) 12995 .map(function (tok) { 12996 if ( 12997 tok === 'MMMM' || 12998 tok === 'MM' || 12999 tok === 'DD' || 13000 tok === 'dddd' 13001 ) { 13002 return tok.slice(1); 13003 } 13004 return tok; 13005 }) 13006 .join(''); 13007 13008 return this._longDateFormat[key]; 13009 } 13010 13011 var defaultInvalidDate = 'Invalid date'; 13012 13013 function invalidDate() { 13014 return this._invalidDate; 13015 } 13016 13017 var defaultOrdinal = '%d', 13018 defaultDayOfMonthOrdinalParse = /\d{1,2}/; 13019 13020 function ordinal(number) { 13021 return this._ordinal.replace('%d', number); 13022 } 13023 13024 var defaultRelativeTime = { 13025 future: 'in %s', 13026 past: '%s ago', 13027 s: 'a few seconds', 13028 ss: '%d seconds', 13029 m: 'a minute', 13030 mm: '%d minutes', 13031 h: 'an hour', 13032 hh: '%d hours', 13033 d: 'a day', 13034 dd: '%d days', 13035 w: 'a week', 13036 ww: '%d weeks', 13037 M: 'a month', 13038 MM: '%d months', 13039 y: 'a year', 13040 yy: '%d years', 13041 }; 13042 13043 function relativeTime(number, withoutSuffix, string, isFuture) { 13044 var output = this._relativeTime[string]; 13045 return isFunction(output) 13046 ? output(number, withoutSuffix, string, isFuture) 13047 : output.replace(/%d/i, number); 13048 } 13049 13050 function pastFuture(diff, output) { 13051 var format = this._relativeTime[diff > 0 ? 'future' : 'past']; 13052 return isFunction(format) ? format(output) : format.replace(/%s/i, output); 13053 } 13054 13055 var aliases = {}; 13056 13057 function addUnitAlias(unit, shorthand) { 13058 var lowerCase = unit.toLowerCase(); 13059 aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; 13060 } 13061 13062 function normalizeUnits(units) { 13063 return typeof units === 'string' 13064 ? aliases[units] || aliases[units.toLowerCase()] 13065 : undefined; 13066 } 13067 13068 function normalizeObjectUnits(inputObject) { 13069 var normalizedInput = {}, 13070 normalizedProp, 13071 prop; 13072 13073 for (prop in inputObject) { 13074 if (hasOwnProp(inputObject, prop)) { 13075 normalizedProp = normalizeUnits(prop); 13076 if (normalizedProp) { 13077 normalizedInput[normalizedProp] = inputObject[prop]; 13078 } 13079 } 13080 } 13081 13082 return normalizedInput; 13083 } 13084 13085 var priorities = {}; 13086 13087 function addUnitPriority(unit, priority) { 13088 priorities[unit] = priority; 13089 } 13090 13091 function getPrioritizedUnits(unitsObj) { 13092 var units = [], 13093 u; 13094 for (u in unitsObj) { 13095 if (hasOwnProp(unitsObj, u)) { 13096 units.push({ unit: u, priority: priorities[u] }); 13097 } 13098 } 13099 units.sort(function (a, b) { 13100 return a.priority - b.priority; 13101 }); 13102 return units; 13103 } 13104 13105 function isLeapYear(year) { 13106 return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; 13107 } 13108 13109 function absFloor(number) { 13110 if (number < 0) { 13111 // -0 -> 0 13112 return Math.ceil(number) || 0; 13113 } else { 13114 return Math.floor(number); 13115 } 13116 } 13117 13118 function toInt(argumentForCoercion) { 13119 var coercedNumber = +argumentForCoercion, 13120 value = 0; 13121 13122 if (coercedNumber !== 0 && isFinite(coercedNumber)) { 13123 value = absFloor(coercedNumber); 13124 } 13125 13126 return value; 13127 } 13128 13129 function makeGetSet(unit, keepTime) { 13130 return function (value) { 13131 if (value != null) { 13132 set$1(this, unit, value); 13133 hooks.updateOffset(this, keepTime); 13134 return this; 13135 } else { 13136 return get(this, unit); 13137 } 13138 }; 13139 } 13140 13141 function get(mom, unit) { 13142 return mom.isValid() 13143 ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() 13144 : NaN; 13145 } 13146 13147 function set$1(mom, unit, value) { 13148 if (mom.isValid() && !isNaN(value)) { 13149 if ( 13150 unit === 'FullYear' && 13151 isLeapYear(mom.year()) && 13152 mom.month() === 1 && 13153 mom.date() === 29 13154 ) { 13155 value = toInt(value); 13156 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit]( 13157 value, 13158 mom.month(), 13159 daysInMonth(value, mom.month()) 13160 ); 13161 } else { 13162 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); 13163 } 13164 } 13165 } 13166 13167 // MOMENTS 13168 13169 function stringGet(units) { 13170 units = normalizeUnits(units); 13171 if (isFunction(this[units])) { 13172 return this[units](); 13173 } 13174 return this; 13175 } 13176 13177 function stringSet(units, value) { 13178 if (typeof units === 'object') { 13179 units = normalizeObjectUnits(units); 13180 var prioritized = getPrioritizedUnits(units), 13181 i, 13182 prioritizedLen = prioritized.length; 13183 for (i = 0; i < prioritizedLen; i++) { 13184 this[prioritized[i].unit](units[prioritized[i].unit]); 13185 } 13186 } else { 13187 units = normalizeUnits(units); 13188 if (isFunction(this[units])) { 13189 return this[units](value); 13190 } 13191 } 13192 return this; 13193 } 13194 13195 var match1 = /\d/, // 0 - 9 13196 match2 = /\d\d/, // 00 - 99 13197 match3 = /\d{3}/, // 000 - 999 13198 match4 = /\d{4}/, // 0000 - 9999 13199 match6 = /[+-]?\d{6}/, // -999999 - 999999 13200 match1to2 = /\d\d?/, // 0 - 99 13201 match3to4 = /\d\d\d\d?/, // 999 - 9999 13202 match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999 13203 match1to3 = /\d{1,3}/, // 0 - 999 13204 match1to4 = /\d{1,4}/, // 0 - 9999 13205 match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999 13206 matchUnsigned = /\d+/, // 0 - inf 13207 matchSigned = /[+-]?\d+/, // -inf - inf 13208 matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z 13209 matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z 13210 matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 13211 // any word (or two) characters or numbers including two/three word month in arabic. 13212 // includes scottish gaelic two word and hyphenated months 13213 matchWord = 13214 /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, 13215 regexes; 13216 13217 regexes = {}; 13218 13219 function addRegexToken(token, regex, strictRegex) { 13220 regexes[token] = isFunction(regex) 13221 ? regex 13222 : function (isStrict, localeData) { 13223 return isStrict && strictRegex ? strictRegex : regex; 13224 }; 13225 } 13226 13227 function getParseRegexForToken(token, config) { 13228 if (!hasOwnProp(regexes, token)) { 13229 return new RegExp(unescapeFormat(token)); 13230 } 13231 13232 return regexes[token](config._strict, config._locale); 13233 } 13234 13235 // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript 13236 function unescapeFormat(s) { 13237 return regexEscape( 13238 s 13239 .replace('\\', '') 13240 .replace( 13241 /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, 13242 function (matched, p1, p2, p3, p4) { 13243 return p1 || p2 || p3 || p4; 13244 } 13245 ) 13246 ); 13247 } 13248 13249 function regexEscape(s) { 13250 return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); 13251 } 13252 13253 var tokens = {}; 13254 13255 function addParseToken(token, callback) { 13256 var i, 13257 func = callback, 13258 tokenLen; 13259 if (typeof token === 'string') { 13260 token = [token]; 13261 } 13262 if (isNumber(callback)) { 13263 func = function (input, array) { 13264 array[callback] = toInt(input); 13265 }; 13266 } 13267 tokenLen = token.length; 13268 for (i = 0; i < tokenLen; i++) { 13269 tokens[token[i]] = func; 13270 } 13271 } 13272 13273 function addWeekParseToken(token, callback) { 13274 addParseToken(token, function (input, array, config, token) { 13275 config._w = config._w || {}; 13276 callback(input, config._w, config, token); 13277 }); 13278 } 13279 13280 function addTimeToArrayFromToken(token, input, config) { 13281 if (input != null && hasOwnProp(tokens, token)) { 13282 tokens[token](input, config._a, config, token); 13283 } 13284 } 13285 13286 var YEAR = 0, 13287 MONTH = 1, 13288 DATE = 2, 13289 HOUR = 3, 13290 MINUTE = 4, 13291 SECOND = 5, 13292 MILLISECOND = 6, 13293 WEEK = 7, 13294 WEEKDAY = 8; 13295 13296 function mod(n, x) { 13297 return ((n % x) + x) % x; 13298 } 13299 13300 var indexOf; 13301 13302 if (Array.prototype.indexOf) { 13303 indexOf = Array.prototype.indexOf; 13304 } else { 13305 indexOf = function (o) { 13306 // I know 13307 var i; 13308 for (i = 0; i < this.length; ++i) { 13309 if (this[i] === o) { 13310 return i; 13311 } 13312 } 13313 return -1; 13314 }; 13315 } 13316 13317 function daysInMonth(year, month) { 13318 if (isNaN(year) || isNaN(month)) { 13319 return NaN; 13320 } 13321 var modMonth = mod(month, 12); 13322 year += (month - modMonth) / 12; 13323 return modMonth === 1 13324 ? isLeapYear(year) 13325 ? 29 13326 : 28 13327 : 31 - ((modMonth % 7) % 2); 13328 } 13329 13330 // FORMATTING 13331 13332 addFormatToken('M', ['MM', 2], 'Mo', function () { 13333 return this.month() + 1; 13334 }); 13335 13336 addFormatToken('MMM', 0, 0, function (format) { 13337 return this.localeData().monthsShort(this, format); 13338 }); 13339 13340 addFormatToken('MMMM', 0, 0, function (format) { 13341 return this.localeData().months(this, format); 13342 }); 13343 13344 // ALIASES 13345 13346 addUnitAlias('month', 'M'); 13347 13348 // PRIORITY 13349 13350 addUnitPriority('month', 8); 13351 13352 // PARSING 13353 13354 addRegexToken('M', match1to2); 13355 addRegexToken('MM', match1to2, match2); 13356 addRegexToken('MMM', function (isStrict, locale) { 13357 return locale.monthsShortRegex(isStrict); 13358 }); 13359 addRegexToken('MMMM', function (isStrict, locale) { 13360 return locale.monthsRegex(isStrict); 13361 }); 13362 13363 addParseToken(['M', 'MM'], function (input, array) { 13364 array[MONTH] = toInt(input) - 1; 13365 }); 13366 13367 addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
13368 var month = config._locale.monthsParse(input, token, config._strict); 13369 // if we didn't find a month name, mark the date as invalid. 13370 if (month != null) { 13371 array[MONTH] = month; 13372 } else { 13373 getParsingFlags(config).invalidMonth = input; 13374 } 13375 }); 13376 13377 // LOCALES 13378 13379 var defaultLocaleMonths = 13380 'January_February_March_April_May_June_July_August_September_October_November_December'.split( 13381 '_' 13382 ), 13383 defaultLocaleMonthsShort = 13384 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'
vendor: 13,773 bytes, lines 13384-13826
13384), 13385 MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, 13386 defaultMonthsShortRegex = matchWord, 13387 defaultMonthsRegex = matchWord; 13388 13389 function localeMonths(m, format) { 13390 if (!m) { 13391 return isArray(this._months) 13392 ? this._months 13393 : this._months['standalone']; 13394 } 13395 return isArray(this._months) 13396 ? this._months[m.month()] 13397 : this._months[ 13398 (this._months.isFormat || MONTHS_IN_FORMAT).test(format) 13399 ? 'format' 13400 : 'standalone' 13401 ][m.month()]; 13402 } 13403 13404 function localeMonthsShort(m, format) { 13405 if (!m) { 13406 return isArray(this._monthsShort) 13407 ? this._monthsShort 13408 : this._monthsShort['standalone']; 13409 } 13410 return isArray(this._monthsShort) 13411 ? this._monthsShort[m.month()] 13412 : this._monthsShort[ 13413 MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone' 13414 ][m.month()]; 13415 } 13416 13417 function handleStrictParse(monthName, format, strict) { 13418 var i, 13419 ii, 13420 mom, 13421 llc = monthName.toLocaleLowerCase(); 13422 if (!this._monthsParse) { 13423 // this is not used 13424 this._monthsParse = []; 13425 this._longMonthsParse = []; 13426 this._shortMonthsParse = []; 13427 for (i = 0; i < 12; ++i) { 13428 mom = createUTC([2000, i]); 13429 this._shortMonthsParse[i] = this.monthsShort( 13430 mom, 13431 '' 13432 ).toLocaleLowerCase(); 13433 this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); 13434 } 13435 } 13436 13437 if (strict) { 13438 if (format === 'MMM') { 13439 ii = indexOf.call(this._shortMonthsParse, llc); 13440 return ii !== -1 ? ii : null; 13441 } else { 13442 ii = indexOf.call(this._longMonthsParse, llc); 13443 return ii !== -1 ? ii : null; 13444 } 13445 } else { 13446 if (format === 'MMM') { 13447 ii = indexOf.call(this._shortMonthsParse, llc); 13448 if (ii !== -1) { 13449 return ii; 13450 } 13451 ii = indexOf.call(this._longMonthsParse, llc); 13452 return ii !== -1 ? ii : null; 13453 } else { 13454 ii = indexOf.call(this._longMonthsParse, llc); 13455 if (ii !== -1) { 13456 return ii; 13457 } 13458 ii = indexOf.call(this._shortMonthsParse, llc); 13459 return ii !== -1 ? ii : null; 13460 } 13461 } 13462 } 13463 13464 function localeMonthsParse(monthName, format, strict) { 13465 var i, mom, regex; 13466 13467 if (this._monthsParseExact) { 13468 return handleStrictParse.call(this, monthName, format, strict); 13469 } 13470 13471 if (!this._monthsParse) { 13472 this._monthsParse = []; 13473 this._longMonthsParse = []; 13474 this._shortMonthsParse = []; 13475 } 13476 13477 // TODO: add sorting 13478 // Sorting makes sure if one month (or abbr) is a prefix of another 13479 // see sorting in computeMonthsParse 13480 for (i = 0; i < 12; i++) { 13481 // make the regex if we don't have it already 13482 mom = createUTC([2000, i]); 13483 if (strict && !this._longMonthsParse[i]) { 13484 this._longMonthsParse[i] = new RegExp( 13485 '^' + this.months(mom, '').replace('.', '') + '$', 13486 'i' 13487 ); 13488 this._shortMonthsParse[i] = new RegExp( 13489 '^' + this.monthsShort(mom, '').replace('.', '') + '$', 13490 'i' 13491 ); 13492 } 13493 if (!strict && !this._monthsParse[i]) { 13494 regex = 13495 '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); 13496 this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); 13497 } 13498 // test the regex 13499 if ( 13500 strict && 13501 format === 'MMMM' && 13502 this._longMonthsParse[i].test(monthName) 13503 ) { 13504 return i; 13505 } else if ( 13506 strict && 13507 format === 'MMM' && 13508 this._shortMonthsParse[i].test(monthName) 13509 ) { 13510 return i; 13511 } else if (!strict && this._monthsParse[i].test(monthName)) { 13512 return i; 13513 } 13514 } 13515 } 13516 13517 // MOMENTS 13518 13519 function setMonth(mom, value) { 13520 var dayOfMonth; 13521 13522 if (!mom.isValid()) { 13523 // No op 13524 return mom; 13525 } 13526 13527 if (typeof value === 'string') { 13528 if (/^\d+$/.test(value)) { 13529 value = toInt(value); 13530 } else { 13531 value = mom.localeData().monthsParse(value); 13532 // TODO: Another silent failure? 13533 if (!isNumber(value)) { 13534 return mom; 13535 } 13536 } 13537 } 13538 13539 dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); 13540 mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); 13541 return mom; 13542 } 13543 13544 function getSetMonth(value) { 13545 if (value != null) { 13546 setMonth(this, value); 13547 hooks.updateOffset(this, true); 13548 return this; 13549 } else { 13550 return get(this, 'Month'); 13551 } 13552 } 13553 13554 function getDaysInMonth() { 13555 return daysInMonth(this.year(), this.month()); 13556 } 13557 13558 function monthsShortRegex(isStrict) { 13559 if (this._monthsParseExact) { 13560 if (!hasOwnProp(this, '_monthsRegex')) { 13561 computeMonthsParse.call(this); 13562 } 13563 if (isStrict) { 13564 return this._monthsShortStrictRegex; 13565 } else { 13566 return this._monthsShortRegex; 13567 } 13568 } else { 13569 if (!hasOwnProp(this, '_monthsShortRegex')) { 13570 this._monthsShortRegex = defaultMonthsShortRegex; 13571 } 13572 return this._monthsShortStrictRegex && isStrict 13573 ? this._monthsShortStrictRegex 13574 : this._monthsShortRegex; 13575 } 13576 } 13577 13578 function monthsRegex(isStrict) { 13579 if (this._monthsParseExact) { 13580 if (!hasOwnProp(this, '_monthsRegex')) { 13581 computeMonthsParse.call(this); 13582 } 13583 if (isStrict) { 13584 return this._monthsStrictRegex; 13585 } else { 13586 return this._monthsRegex; 13587 } 13588 } else { 13589 if (!hasOwnProp(this, '_monthsRegex')) { 13590 this._monthsRegex = defaultMonthsRegex; 13591 } 13592 return this._monthsStrictRegex && isStrict 13593 ? this._monthsStrictRegex 13594 : this._monthsRegex; 13595 } 13596 } 13597 13598 function computeMonthsParse() { 13599 function cmpLenRev(a, b) { 13600 return b.length - a.length; 13601 } 13602 13603 var shortPieces = [], 13604 longPieces = [], 13605 mixedPieces = [], 13606 i, 13607 mom; 13608 for (i = 0; i < 12; i++) { 13609 // make the regex if we don't have it already 13610 mom = createUTC([2000, i]); 13611 shortPieces.push(this.monthsShort(mom, '')); 13612 longPieces.push(this.months(mom, '')); 13613 mixedPieces.push(this.months(mom, '')); 13614 mixedPieces.push(this.monthsShort(mom, '')); 13615 } 13616 // Sorting makes sure if one month (or abbr) is a prefix of another it 13617 // will match the longer piece. 13618 shortPieces.sort(cmpLenRev); 13619 longPieces.sort(cmpLenRev); 13620 mixedPieces.sort(cmpLenRev); 13621 for (i = 0; i < 12; i++) { 13622 shortPieces[i] = regexEscape(shortPieces[i]); 13623 longPieces[i] = regexEscape(longPieces[i]); 13624 } 13625 for (i = 0; i < 24; i++) { 13626 mixedPieces[i] = regexEscape(mixedPieces[i]); 13627 } 13628 13629 this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 13630 this._monthsShortRegex = this._monthsRegex; 13631 this._monthsStrictRegex = new RegExp( 13632 '^(' + longPieces.join('|') + ')', 13633 'i' 13634 ); 13635 this._monthsShortStrictRegex = new RegExp( 13636 '^(' + shortPieces.join('|') + ')', 13637 'i' 13638 ); 13639 } 13640 13641 // FORMATTING 13642 13643 addFormatToken('Y', 0, 0, function () { 13644 var y = this.year(); 13645 return y <= 9999 ? zeroFill(y, 4) : '+' + y; 13646 }); 13647 13648 addFormatToken(0, ['YY', 2], 0, function () { 13649 return this.year() % 100; 13650 }); 13651 13652 addFormatToken(0, ['YYYY', 4], 0, 'year'); 13653 addFormatToken(0, ['YYYYY', 5], 0, 'year'); 13654 addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); 13655 13656 // ALIASES 13657 13658 addUnitAlias('year', 'y'); 13659 13660 // PRIORITIES 13661 13662 addUnitPriority('year', 1); 13663 13664 // PARSING 13665 13666 addRegexToken('Y', matchSigned); 13667 addRegexToken('YY', match1to2, match2); 13668 addRegexToken('YYYY', match1to4, match4); 13669 addRegexToken('YYYYY', match1to6, match6); 13670 addRegexToken('YYYYYY', match1to6, match6); 13671 13672 addParseToken(['YYYYY', 'YYYYYY'], YEAR); 13673 addParseToken('YYYY', function (input, array) { 13674 array[YEAR] = 13675 input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); 13676 }); 13677 addParseToken('YY', function (input, array) { 13678 array[YEAR] = hooks.parseTwoDigitYear(input); 13679 }); 13680 addParseToken('Y', function (input, array) { 13681 array[YEAR] = parseInt(input, 10); 13682 }); 13683 13684 // HELPERS 13685 13686 function daysInYear(year) { 13687 return isLeapYear(year) ? 366 : 365; 13688 } 13689 13690 // HOOKS 13691 13692 hooks.parseTwoDigitYear = function (input) { 13693 return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); 13694 }; 13695 13696 // MOMENTS 13697 13698 var getSetYear = makeGetSet('FullYear', true); 13699 13700 function getIsLeapYear() { 13701 return isLeapYear(this.year()); 13702 } 13703 13704 function createDate(y, m, d, h, M, s, ms) { 13705 // can't just apply() to create a date: 13706 // https://stackoverflow.com/q/181348 13707 var date; 13708 // the date constructor remaps years 0-99 to 1900-1999 13709 if (y < 100 && y >= 0) { 13710 // preserve leap years using a full 400 year cycle, then reset 13711 date = new Date(y + 400, m, d, h, M, s, ms); 13712 if (isFinite(date.getFullYear())) { 13713 date.setFullYear(y); 13714 } 13715 } else { 13716 date = new Date(y, m, d, h, M, s, ms); 13717 } 13718 13719 return date; 13720 } 13721 13722 function createUTCDate(y) { 13723 var date, args; 13724 // the Date.UTC function remaps years 0-99 to 1900-1999 13725 if (y < 100 && y >= 0) { 13726 args = Array.prototype.slice.call(arguments); 13727 // preserve leap years using a full 400 year cycle, then reset 13728 args[0] = y + 400; 13729 date = new Date(Date.UTC.apply(null, args)); 13730 if (isFinite(date.getUTCFullYear())) { 13731 date.setUTCFullYear(y); 13732 } 13733 } else { 13734 date = new Date(Date.UTC.apply(null, arguments)); 13735 } 13736 13737 return date; 13738 } 13739 13740 // start-of-first-week - start-of-year 13741 function firstWeekOffset(year, dow, doy) { 13742 var // first-week day -- which january is always in the first week (4 for iso, 1 for other) 13743 fwd = 7 + dow - doy, 13744 // first-week day local weekday -- which local weekday is fwd 13745 fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; 13746 13747 return -fwdlw + fwd - 1; 13748 } 13749 13750 // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday 13751 function dayOfYearFromWeeks(year, week, weekday, dow, doy) { 13752 var localWeekday = (7 + weekday - dow) % 7, 13753 weekOffset = firstWeekOffset(year, dow, doy), 13754 dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, 13755 resYear, 13756 resDayOfYear; 13757 13758 if (dayOfYear <= 0) { 13759 resYear = year - 1; 13760 resDayOfYear = daysInYear(resYear) + dayOfYear; 13761 } else if (dayOfYear > daysInYear(year)) { 13762 resYear = year + 1; 13763 resDayOfYear = dayOfYear - daysInYear(year); 13764 } else { 13765 resYear = year; 13766 resDayOfYear = dayOfYear; 13767 } 13768 13769 return { 13770 year: resYear, 13771 dayOfYear: resDayOfYear, 13772 }; 13773 } 13774 13775 function weekOfYear(mom, dow, doy) { 13776 var weekOffset = firstWeekOffset(mom.year(), dow, doy), 13777 week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, 13778 resWeek, 13779 resYear; 13780 13781 if (week < 1) { 13782 resYear = mom.year() - 1; 13783 resWeek = week + weeksInYear(resYear, dow, doy); 13784 } else if (week > weeksInYear(mom.year(), dow, doy)) { 13785 resWeek = week - weeksInYear(mom.year(), dow, doy); 13786 resYear = mom.year() + 1; 13787 } else { 13788 resYear = mom.year(); 13789 resWeek = week; 13790 } 13791 13792 return { 13793 week: resWeek, 13794 year: resYear, 13795 }; 13796 } 13797 13798 function weeksInYear(year, dow, doy) { 13799 var weekOffset = firstWeekOffset(year, dow, doy), 13800 weekOffsetNext = firstWeekOffset(year + 1, dow, doy); 13801 return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; 13802 } 13803 13804 // FORMATTING 13805 13806 addFormatToken('w', ['ww', 2], 'wo', 'week'); 13807 addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); 13808 13809 // ALIASES 13810 13811 addUnitAlias('week', 'w'); 13812 addUnitAlias('isoWeek', 'W'); 13813 13814 // PRIORITIES 13815 13816 addUnitPriority('week', 5); 13817 addUnitPriority('isoWeek', 5); 13818 13819 // PARSING 13820 13821 addRegexToken('w', match1to2); 13822 addRegexToken('ww', match1to2, match2); 13823 addRegexToken('W', match1to2); 13824 addRegexToken('WW', match1to2, match2); 13825 13826 addWeekParseToken(
vendor: 3,487 bytes, lines 13826-13957
13826 13827 ['w', 'ww', 'W', 'WW'], 13828 function (input, week, config, token) { 13829 week[token.substr(0, 1)] = toInt(input); 13830 } 13831 ); 13832 13833 // HELPERS 13834 13835 // LOCALES 13836 13837 function localeWeek(mom) { 13838 return weekOfYear(mom, this._week.dow, this._week.doy).week; 13839 } 13840 13841 var defaultLocaleWeek = { 13842 dow: 0, // Sunday is the first day of the week. 13843 doy: 6, // The week that contains Jan 6th is the first week of the year. 13844 }; 13845 13846 function localeFirstDayOfWeek() { 13847 return this._week.dow; 13848 } 13849 13850 function localeFirstDayOfYear() { 13851 return this._week.doy; 13852 } 13853 13854 // MOMENTS 13855 13856 function getSetWeek(input) { 13857 var week = this.localeData().week(this); 13858 return input == null ? week : this.add((input - week) * 7, 'd'); 13859 } 13860 13861 function getSetISOWeek(input) { 13862 var week = weekOfYear(this, 1, 4).week; 13863 return input == null ? week : this.add((input - week) * 7, 'd'); 13864 } 13865 13866 // FORMATTING 13867 13868 addFormatToken('d', 0, 'do', 'day'); 13869 13870 addFormatToken('dd', 0, 0, function (format) { 13871 return this.localeData().weekdaysMin(this, format); 13872 }); 13873 13874 addFormatToken('ddd', 0, 0, function (format) { 13875 return this.localeData().weekdaysShort(this, format); 13876 }); 13877 13878 addFormatToken('dddd', 0, 0, function (format) { 13879 return this.localeData().weekdays(this, format); 13880 }); 13881 13882 addFormatToken('e', 0, 0, 'weekday'); 13883 addFormatToken('E', 0, 0, 'isoWeekday'); 13884 13885 // ALIASES 13886 13887 addUnitAlias('day', 'd'); 13888 addUnitAlias('weekday', 'e'); 13889 addUnitAlias('isoWeekday', 'E'); 13890 13891 // PRIORITY 13892 addUnitPriority('day', 11); 13893 addUnitPriority('weekday', 11); 13894 addUnitPriority('isoWeekday', 11); 13895 13896 // PARSING 13897 13898 addRegexToken('d', match1to2); 13899 addRegexToken('e', match1to2); 13900 addRegexToken('E', match1to2); 13901 addRegexToken('dd', function (isStrict, locale) { 13902 return locale.weekdaysMinRegex(isStrict); 13903 }); 13904 addRegexToken('ddd', function (isStrict, locale) { 13905 return locale.weekdaysShortRegex(isStrict); 13906 }); 13907 addRegexToken('dddd', function (isStrict, locale) { 13908 return locale.weekdaysRegex(isStrict); 13909 }); 13910 13911 addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { 13912 var weekday = config._locale.weekdaysParse(input, token, config._strict); 13913 // if we didn't get a weekday name, mark the date as invalid 13914 if (weekday != null) { 13915 week.d = weekday; 13916 } else { 13917 getParsingFlags(config).invalidWeekday = input; 13918 } 13919 }); 13920 13921 addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { 13922 week[token] = toInt(input); 13923 }); 13924 13925 // HELPERS 13926 13927 function parseWeekday(input, locale) { 13928 if (typeof input !== 'string') { 13929 return input; 13930 } 13931 13932 if (!isNaN(input)) { 13933 return parseInt(input, 10); 13934 } 13935 13936 input = locale.weekdaysParse(input); 13937 if (typeof input === 'number') { 13938 return input; 13939 } 13940 13941 return null; 13942 } 13943 13944 function parseIsoWeekday(input, locale) { 13945 if (typeof input === 'string') { 13946 return locale.weekdaysParse(input) % 7 || 7; 13947 } 13948 return isNaN(input) ? null : input; 13949 } 13950 13951 // LOCALES 13952 function shiftWeekdays(ws, n) { 13953 return ws.slice(n, 7).concat(ws.slice(0, n)); 13954 } 13955 13956 var defaultLocaleWeekdays = 13957 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'
vendor: 17,864 bytes, lines 13957-14505
13957), 13958 defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), 13959 defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), 13960 defaultWeekdaysRegex = matchWord, 13961 defaultWeekdaysShortRegex = matchWord, 13962 defaultWeekdaysMinRegex = matchWord; 13963 13964 function localeWeekdays(m, format) { 13965 var weekdays = isArray(this._weekdays) 13966 ? this._weekdays 13967 : this._weekdays[ 13968 m && m !== true && this._weekdays.isFormat.test(format) 13969 ? 'format' 13970 : 'standalone' 13971 ]; 13972 return m === true 13973 ? shiftWeekdays(weekdays, this._week.dow) 13974 : m 13975 ? weekdays[m.day()] 13976 : weekdays; 13977 } 13978 13979 function localeWeekdaysShort(m) { 13980 return m === true 13981 ? shiftWeekdays(this._weekdaysShort, this._week.dow) 13982 : m 13983 ? this._weekdaysShort[m.day()] 13984 : this._weekdaysShort; 13985 } 13986 13987 function localeWeekdaysMin(m) { 13988 return m === true 13989 ? shiftWeekdays(this._weekdaysMin, this._week.dow) 13990 : m 13991 ? this._weekdaysMin[m.day()] 13992 : this._weekdaysMin; 13993 } 13994 13995 function handleStrictParse$1(weekdayName, format, strict) { 13996 var i, 13997 ii, 13998 mom, 13999 llc = weekdayName.toLocaleLowerCase(); 14000 if (!this._weekdaysParse) { 14001 this._weekdaysParse = []; 14002 this._shortWeekdaysParse = []; 14003 this._minWeekdaysParse = []; 14004 14005 for (i = 0; i < 7; ++i) { 14006 mom = createUTC([2000, 1]).day(i); 14007 this._minWeekdaysParse[i] = this.weekdaysMin( 14008 mom, 14009 '' 14010 ).toLocaleLowerCase(); 14011 this._shortWeekdaysParse[i] = this.weekdaysShort( 14012 mom, 14013 '' 14014 ).toLocaleLowerCase(); 14015 this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); 14016 } 14017 } 14018 14019 if (strict) { 14020 if (format === 'dddd') { 14021 ii = indexOf.call(this._weekdaysParse, llc); 14022 return ii !== -1 ? ii : null; 14023 } else if (format === 'ddd') { 14024 ii = indexOf.call(this._shortWeekdaysParse, llc); 14025 return ii !== -1 ? ii : null; 14026 } else { 14027 ii = indexOf.call(this._minWeekdaysParse, llc); 14028 return ii !== -1 ? ii : null; 14029 } 14030 } else { 14031 if (format === 'dddd') { 14032 ii = indexOf.call(this._weekdaysParse, llc); 14033 if (ii !== -1) { 14034 return ii; 14035 } 14036 ii = indexOf.call(this._shortWeekdaysParse, llc); 14037 if (ii !== -1) { 14038 return ii; 14039 } 14040 ii = indexOf.call(this._minWeekdaysParse, llc); 14041 return ii !== -1 ? ii : null; 14042 } else if (format === 'ddd') { 14043 ii = indexOf.call(this._shortWeekdaysParse, llc); 14044 if (ii !== -1) { 14045 return ii; 14046 } 14047 ii = indexOf.call(this._weekdaysParse, llc); 14048 if (ii !== -1) { 14049 return ii; 14050 } 14051 ii = indexOf.call(this._minWeekdaysParse, llc); 14052 return ii !== -1 ? ii : null; 14053 } else { 14054 ii = indexOf.call(this._minWeekdaysParse, llc); 14055 if (ii !== -1) { 14056 return ii; 14057 } 14058 ii = indexOf.call(this._weekdaysParse, llc); 14059 if (ii !== -1) { 14060 return ii; 14061 } 14062 ii = indexOf.call(this._shortWeekdaysParse, llc); 14063 return ii !== -1 ? ii : null; 14064 } 14065 } 14066 } 14067 14068 function localeWeekdaysParse(weekdayName, format, strict) { 14069 var i, mom, regex; 14070 14071 if (this._weekdaysParseExact) { 14072 return handleStrictParse$1.call(this, weekdayName, format, strict); 14073 } 14074 14075 if (!this._weekdaysParse) { 14076 this._weekdaysParse = []; 14077 this._minWeekdaysParse = []; 14078 this._shortWeekdaysParse = []; 14079 this._fullWeekdaysParse = []; 14080 } 14081 14082 for (i = 0; i < 7; i++) { 14083 // make the regex if we don't have it already 14084 14085 mom = createUTC([2000, 1]).day(i); 14086 if (strict && !this._fullWeekdaysParse[i]) { 14087 this._fullWeekdaysParse[i] = new RegExp( 14088 '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 14089 'i' 14090 ); 14091 this._shortWeekdaysParse[i] = new RegExp( 14092 '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 14093 'i' 14094 ); 14095 this._minWeekdaysParse[i] = new RegExp( 14096 '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 14097 'i' 14098 ); 14099 } 14100 if (!this._weekdaysParse[i]) { 14101 regex = 14102 '^' + 14103 this.weekdays(mom, '') + 14104 '|^' + 14105 this.weekdaysShort(mom, '') + 14106 '|^' + 14107 this.weekdaysMin(mom, ''); 14108 this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); 14109 } 14110 // test the regex 14111 if ( 14112 strict && 14113 format === 'dddd' && 14114 this._fullWeekdaysParse[i].test(weekdayName) 14115 ) { 14116 return i; 14117 } else if ( 14118 strict && 14119 format === 'ddd' && 14120 this._shortWeekdaysParse[i].test(weekdayName) 14121 ) { 14122 return i; 14123 } else if ( 14124 strict && 14125 format === 'dd' && 14126 this._minWeekdaysParse[i].test(weekdayName) 14127 ) { 14128 return i; 14129 } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { 14130 return i; 14131 } 14132 } 14133 } 14134 14135 // MOMENTS 14136 14137 function getSetDayOfWeek(input) { 14138 if (!this.isValid()) { 14139 return input != null ? this : NaN; 14140 } 14141 var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); 14142 if (input != null) { 14143 input = parseWeekday(input, this.localeData()); 14144 return this.add(input - day, 'd'); 14145 } else { 14146 return day; 14147 } 14148 } 14149 14150 function getSetLocaleDayOfWeek(input) { 14151 if (!this.isValid()) { 14152 return input != null ? this : NaN; 14153 } 14154 var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; 14155 return input == null ? weekday : this.add(input - weekday, 'd'); 14156 } 14157 14158 function getSetISODayOfWeek(input) { 14159 if (!this.isValid()) { 14160 return input != null ? this : NaN; 14161 } 14162 14163 // behaves the same as moment#day except 14164 // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) 14165 // as a setter, sunday should belong to the previous week. 14166 14167 if (input != null) { 14168 var weekday = parseIsoWeekday(input, this.localeData()); 14169 return this.day(this.day() % 7 ? weekday : weekday - 7); 14170 } else { 14171 return this.day() || 7; 14172 } 14173 } 14174 14175 function weekdaysRegex(isStrict) { 14176 if (this._weekdaysParseExact) { 14177 if (!hasOwnProp(this, '_weekdaysRegex')) { 14178 computeWeekdaysParse.call(this); 14179 } 14180 if (isStrict) { 14181 return this._weekdaysStrictRegex; 14182 } else { 14183 return this._weekdaysRegex; 14184 } 14185 } else { 14186 if (!hasOwnProp(this, '_weekdaysRegex')) { 14187 this._weekdaysRegex = defaultWeekdaysRegex; 14188 } 14189 return this._weekdaysStrictRegex && isStrict 14190 ? this._weekdaysStrictRegex 14191 : this._weekdaysRegex; 14192 } 14193 } 14194 14195 function weekdaysShortRegex(isStrict) { 14196 if (this._weekdaysParseExact) { 14197 if (!hasOwnProp(this, '_weekdaysRegex')) { 14198 computeWeekdaysParse.call(this); 14199 } 14200 if (isStrict) { 14201 return this._weekdaysShortStrictRegex; 14202 } else { 14203 return this._weekdaysShortRegex; 14204 } 14205 } else { 14206 if (!hasOwnProp(this, '_weekdaysShortRegex')) { 14207 this._weekdaysShortRegex = defaultWeekdaysShortRegex; 14208 } 14209 return this._weekdaysShortStrictRegex && isStrict 14210 ? this._weekdaysShortStrictRegex 14211 : this._weekdaysShortRegex; 14212 } 14213 } 14214 14215 function weekdaysMinRegex(isStrict) { 14216 if (this._weekdaysParseExact) { 14217 if (!hasOwnProp(this, '_weekdaysRegex')) { 14218 computeWeekdaysParse.call(this); 14219 } 14220 if (isStrict) { 14221 return this._weekdaysMinStrictRegex; 14222 } else { 14223 return this._weekdaysMinRegex; 14224 } 14225 } else { 14226 if (!hasOwnProp(this, '_weekdaysMinRegex')) { 14227 this._weekdaysMinRegex = defaultWeekdaysMinRegex; 14228 } 14229 return this._weekdaysMinStrictRegex && isStrict 14230 ? this._weekdaysMinStrictRegex 14231 : this._weekdaysMinRegex; 14232 } 14233 } 14234 14235 function computeWeekdaysParse() { 14236 function cmpLenRev(a, b) { 14237 return b.length - a.length; 14238 } 14239 14240 var minPieces = [], 14241 shortPieces = [], 14242 longPieces = [], 14243 mixedPieces = [], 14244 i, 14245 mom, 14246 minp, 14247 shortp, 14248 longp; 14249 for (i = 0; i < 7; i++) { 14250 // make the regex if we don't have it already 14251 mom = createUTC([2000, 1]).day(i); 14252 minp = regexEscape(this.weekdaysMin(mom, '')); 14253 shortp = regexEscape(this.weekdaysShort(mom, '')); 14254 longp = regexEscape(this.weekdays(mom, '')); 14255 minPieces.push(minp); 14256 shortPieces.push(shortp); 14257 longPieces.push(longp); 14258 mixedPieces.push(minp); 14259 mixedPieces.push(shortp); 14260 mixedPieces.push(longp); 14261 } 14262 // Sorting makes sure if one weekday (or abbr) is a prefix of another it 14263 // will match the longer piece. 14264 minPieces.sort(cmpLenRev); 14265 shortPieces.sort(cmpLenRev); 14266 longPieces.sort(cmpLenRev); 14267 mixedPieces.sort(cmpLenRev); 14268 14269 this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 14270 this._weekdaysShortRegex = this._weekdaysRegex; 14271 this._weekdaysMinRegex = this._weekdaysRegex; 14272 14273 this._weekdaysStrictRegex = new RegExp( 14274 '^(' + longPieces.join('|') + ')', 14275 'i' 14276 ); 14277 this._weekdaysShortStrictRegex = new RegExp( 14278 '^(' + shortPieces.join('|') + ')', 14279 'i' 14280 ); 14281 this._weekdaysMinStrictRegex = new RegExp( 14282 '^(' + minPieces.join('|') + ')', 14283 'i' 14284 ); 14285 } 14286 14287 // FORMATTING 14288 14289 function hFormat() { 14290 return this.hours() % 12 || 12; 14291 } 14292 14293 function kFormat() { 14294 return this.hours() || 24; 14295 } 14296 14297 addFormatToken('H', ['HH', 2], 0, 'hour'); 14298 addFormatToken('h', ['hh', 2], 0, hFormat); 14299 addFormatToken('k', ['kk', 2], 0, kFormat); 14300 14301 addFormatToken('hmm', 0, 0, function () { 14302 return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); 14303 }); 14304 14305 addFormatToken('hmmss', 0, 0, function () { 14306 return ( 14307 '' + 14308 hFormat.apply(this) + 14309 zeroFill(this.minutes(), 2) + 14310 zeroFill(this.seconds(), 2) 14311 ); 14312 }); 14313 14314 addFormatToken('Hmm', 0, 0, function () { 14315 return '' + this.hours() + zeroFill(this.minutes(), 2); 14316 }); 14317 14318 addFormatToken('Hmmss', 0, 0, function () { 14319 return ( 14320 '' + 14321 this.hours() + 14322 zeroFill(this.minutes(), 2) + 14323 zeroFill(this.seconds(), 2) 14324 ); 14325 }); 14326 14327 function meridiem(token, lowercase) { 14328 addFormatToken(token, 0, 0, function () { 14329 return this.localeData().meridiem( 14330 this.hours(), 14331 this.minutes(), 14332 lowercase 14333 ); 14334 }); 14335 } 14336 14337 meridiem('a', true); 14338 meridiem('A', false); 14339 14340 // ALIASES 14341 14342 addUnitAlias('hour', 'h'); 14343 14344 // PRIORITY 14345 addUnitPriority('hour', 13); 14346 14347 // PARSING 14348 14349 function matchMeridiem(isStrict, locale) { 14350 return locale._meridiemParse; 14351 } 14352 14353 addRegexToken('a', matchMeridiem); 14354 addRegexToken('A', matchMeridiem); 14355 addRegexToken('H', match1to2); 14356 addRegexToken('h', match1to2); 14357 addRegexToken('k', match1to2); 14358 addRegexToken('HH', match1to2, match2); 14359 addRegexToken('hh', match1to2, match2); 14360 addRegexToken('kk', match1to2, match2); 14361 14362 addRegexToken('hmm', match3to4); 14363 addRegexToken('hmmss', match5to6); 14364 addRegexToken('Hmm', match3to4); 14365 addRegexToken('Hmmss', match5to6); 14366 14367 addParseToken(['H', 'HH'], HOUR); 14368 addParseToken(['k', 'kk'], function (input, array, config) { 14369 var kInput = toInt(input); 14370 array[HOUR] = kInput === 24 ? 0 : kInput; 14371 }); 14372 addParseToken(['a', 'A'], function (input, array, config) { 14373 config._isPm = config._locale.isPM(input); 14374 config._meridiem = input; 14375 }); 14376 addParseToken(['h', 'hh'], function (input, array, config) { 14377 array[HOUR] = toInt(input); 14378 getParsingFlags(config).bigHour = true; 14379 }); 14380 addParseToken('hmm', function (input, array, config) { 14381 var pos = input.length - 2; 14382 array[HOUR] = toInt(input.substr(0, pos)); 14383 array[MINUTE] = toInt(input.substr(pos)); 14384 getParsingFlags(config).bigHour = true; 14385 }); 14386 addParseToken('hmmss', function (input, array, config) { 14387 var pos1 = input.length - 4, 14388 pos2 = input.length - 2; 14389 array[HOUR] = toInt(input.substr(0, pos1)); 14390 array[MINUTE] = toInt(input.substr(pos1, 2)); 14391 array[SECOND] = toInt(input.substr(pos2)); 14392 getParsingFlags(config).bigHour = true; 14393 }); 14394 addParseToken('Hmm', function (input, array, config) { 14395 var pos = input.length - 2; 14396 array[HOUR] = toInt(input.substr(0, pos)); 14397 array[MINUTE] = toInt(input.substr(pos)); 14398 }); 14399 addParseToken('Hmmss', function (input, array, config) { 14400 var pos1 = input.length - 4, 14401 pos2 = input.length - 2; 14402 array[HOUR] = toInt(input.substr(0, pos1)); 14403 array[MINUTE] = toInt(input.substr(pos1, 2)); 14404 array[SECOND] = toInt(input.substr(pos2)); 14405 }); 14406 14407 // LOCALES 14408 14409 function localeIsPM(input) { 14410 // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays 14411 // Using charAt should be more compatible. 14412 return (input + '').toLowerCase().charAt(0) === 'p'; 14413 } 14414 14415 var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, 14416 // Setting the hour should keep the time, because the user explicitly 14417 // specified which hour they want. So trying to maintain the same hour (in 14418 // a new timezone) makes sense. Adding/subtracting hours does not follow 14419 // this rule. 14420 getSetHour = makeGetSet('Hours', true); 14421 14422 function localeMeridiem(hours, minutes, isLower) { 14423 if (hours > 11) { 14424 return isLower ? 'pm' : 'PM'; 14425 } else { 14426 return isLower ? 'am' : 'AM'; 14427 } 14428 } 14429 14430 var baseConfig = { 14431 calendar: defaultCalendar, 14432 longDateFormat: defaultLongDateFormat, 14433 invalidDate: defaultInvalidDate, 14434 ordinal: defaultOrdinal, 14435 dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, 14436 relativeTime: defaultRelativeTime, 14437 14438 months: defaultLocaleMonths, 14439 monthsShort: defaultLocaleMonthsShort, 14440 14441 week: defaultLocaleWeek, 14442 14443 weekdays: defaultLocaleWeekdays, 14444 weekdaysMin: defaultLocaleWeekdaysMin, 14445 weekdaysShort: defaultLocaleWeekdaysShort, 14446 14447 meridiemParse: defaultLocaleMeridiemParse, 14448 }; 14449 14450 // internal storage for locale config files 14451 var locales = {}, 14452 localeFamilies = {}, 14453 globalLocale; 14454 14455 function commonPrefix(arr1, arr2) { 14456 var i, 14457 minl = Math.min(arr1.length, arr2.length); 14458 for (i = 0; i < minl; i += 1) { 14459 if (arr1[i] !== arr2[i]) { 14460 return i; 14461 } 14462 } 14463 return minl; 14464 } 14465 14466 function normalizeLocale(key) { 14467 return key ? key.toLowerCase().replace('_', '-') : key; 14468 } 14469 14470 // pick the locale from the array 14471 // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each 14472 // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root 14473 function chooseLocale(names) { 14474 var i = 0, 14475 j, 14476 next, 14477 locale, 14478 split; 14479 14480 while (i < names.length) { 14481 split = normalizeLocale(names[i]).split('-'); 14482 j = split.length; 14483 next = normalizeLocale(names[i + 1]); 14484 next = next ? next.split('-') : null; 14485 while (j > 0) { 14486 locale = loadLocale(split.slice(0, j).join('-')); 14487 if (locale) { 14488 return locale; 14489 } 14490 if ( 14491 next && 14492 next.length >= j && 14493 commonPrefix(split, next) >= j - 1 14494 ) { 14495 //the next array item is better than a shallower substring of this one 14496 break; 14497 } 14498 j--; 14499 } 14500 i++; 14501 } 14502 return globalLocale; 14503 } 14504 14505 function
vendor: 7,449 bytes, lines 14505-14712
14505isLocaleNameSane(name) { 14506 // Prevent names that look like filesystem paths, i.e contain '/' or '\' 14507 return name.match('^[^/\\\\]*$') != null; 14508 } 14509 14510 function loadLocale(name) { 14511 var oldLocale = null, 14512 aliasedRequire; 14513 // TODO: Find a better way to register and load all the locales in Node 14514 if ( 14515 locales[name] === undefined && 14516 typeof module !== 'undefined' && 14517 module && 14518 module.exports && 14519 isLocaleNameSane(name) 14520 ) { 14521 try { 14522 oldLocale = globalLocale._abbr; 14523 aliasedRequire = require; 14524 aliasedRequire('./locale/' + name); 14525 getSetGlobalLocale(oldLocale); 14526 } catch (e) { 14527 // mark as not found to avoid repeating expensive file require call causing high CPU 14528 // when trying to find en-US, en_US, en-us for every format call 14529 locales[name] = null; // null means not found 14530 } 14531 } 14532 return locales[name]; 14533 } 14534 14535 // This function will load locale and then set the global locale. If 14536 // no arguments are passed in, it will simply return the current global 14537 // locale key. 14538 function getSetGlobalLocale(key, values) { 14539 var data; 14540 if (key) { 14541 if (isUndefined(values)) { 14542 data = getLocale(key); 14543 } else { 14544 data = defineLocale(key, values); 14545 } 14546 14547 if (data) { 14548 // moment.duration._locale = moment._locale = data; 14549 globalLocale = data; 14550 } else { 14551 if (typeof console !== 'undefined' && console.warn) { 14552 //warn user if arguments are passed but the locale could not be set 14553 console.warn( 14554 'Locale ' + key + ' not found. Did you forget to load it?' 14555 ); 14556 } 14557 } 14558 } 14559 14560 return globalLocale._abbr; 14561 } 14562 14563 function defineLocale(name, config) { 14564 if (config !== null) { 14565 var locale, 14566 parentConfig = baseConfig; 14567 config.abbr = name; 14568 if (locales[name] != null) { 14569 deprecateSimple( 14570 'defineLocaleOverride', 14571 'use moment.updateLocale(localeName, config) to change ' + 14572 'an existing locale. moment.defineLocale(localeName, ' + 14573 'config) should only be used for creating a new locale ' + 14574 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.' 14575 ); 14576 parentConfig = locales[name]._config; 14577 } else if (config.parentLocale != null) { 14578 if (locales[config.parentLocale] != null) { 14579 parentConfig = locales[config.parentLocale]._config; 14580 } else { 14581 locale = loadLocale(config.parentLocale); 14582 if (locale != null) { 14583 parentConfig = locale._config; 14584 } else { 14585 if (!localeFamilies[config.parentLocale]) { 14586 localeFamilies[config.parentLocale] = []; 14587 } 14588 localeFamilies[config.parentLocale].push({ 14589 name: name, 14590 config: config, 14591 }); 14592 return null; 14593 } 14594 } 14595 } 14596 locales[name] = new Locale(mergeConfigs(parentConfig, config)); 14597 14598 if (localeFamilies[name]) { 14599 localeFamilies[name].forEach(function (x) { 14600 defineLocale(x.name, x.config); 14601 }); 14602 } 14603 14604 // backwards compat for now: also set the locale 14605 // make sure we set the locale AFTER all child locales have been 14606 // created, so we won't end up with the child locale set. 14607 getSetGlobalLocale(name); 14608 14609 return locales[name]; 14610 } else { 14611 // useful for testing 14612 delete locales[name]; 14613 return null; 14614 } 14615 } 14616 14617 function updateLocale(name, config) { 14618 if (config != null) { 14619 var locale, 14620 tmpLocale, 14621 parentConfig = baseConfig; 14622 14623 if (locales[name] != null && locales[name].parentLocale != null) { 14624 // Update existing child locale in-place to avoid memory-leaks 14625 locales[name].set(mergeConfigs(locales[name]._config, config)); 14626 } else { 14627 // MERGE 14628 tmpLocale = loadLocale(name); 14629 if (tmpLocale != null) { 14630 parentConfig = tmpLocale._config; 14631 } 14632 config = mergeConfigs(parentConfig, config); 14633 if (tmpLocale == null) { 14634 // updateLocale is called for creating a new locale 14635 // Set abbr so it will have a name (getters return 14636 // undefined otherwise). 14637 config.abbr = name; 14638 } 14639 locale = new Locale(config); 14640 locale.parentLocale = locales[name]; 14641 locales[name] = locale; 14642 } 14643 14644 // backwards compat for now: also set the locale 14645 getSetGlobalLocale(name); 14646 } else { 14647 // pass null for config to unupdate, useful for tests 14648 if (locales[name] != null) { 14649 if (locales[name].parentLocale != null) { 14650 locales[name] = locales[name].parentLocale; 14651 if (name === getSetGlobalLocale()) { 14652 getSetGlobalLocale(name); 14653 } 14654 } else if (locales[name] != null) { 14655 delete locales[name]; 14656 } 14657 } 14658 } 14659 return locales[name]; 14660 } 14661 14662 // returns locale data 14663 function getLocale(key) { 14664 var locale; 14665 14666 if (key && key._locale && key._locale._abbr) { 14667 key = key._locale._abbr; 14668 } 14669 14670 if (!key) { 14671 return globalLocale; 14672 } 14673 14674 if (!isArray(key)) { 14675 //short-circuit everything else 14676 locale = loadLocale(key); 14677 if (locale) { 14678 return locale; 14679 } 14680 key = [key]; 14681 } 14682 14683 return chooseLocale(key); 14684 } 14685 14686 function listLocales() { 14687 return keys(locales); 14688 } 14689 14690 function checkOverflow(m) { 14691 var overflow, 14692 a = m._a; 14693 14694 if (a && getParsingFlags(m).overflow === -2) { 14695 overflow = 14696 a[MONTH] < 0 || a[MONTH] > 11 14697 ? MONTH 14698 : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) 14699 ? DATE 14700 : a[HOUR] < 0 || 14701 a[HOUR] > 24 || 14702 (a[HOUR] === 24 && 14703 (a[MINUTE] !== 0 || 14704 a[SECOND] !== 0 || 14705 a[MILLISECOND] !== 0)) 14706 ? HOUR 14707 : a[MINUTE] < 0 || a[MINUTE] > 59 14708 ? MINUTE 14709 : a[SECOND] < 0 || a[SECOND] > 59 14710 ? SECOND 14711 : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 14712 ? MILLISECOND
vendor: 9,346 bytes, lines 14713-14996
14713 : -1; 14714 14715 if ( 14716 getParsingFlags(m)._overflowDayOfYear && 14717 (overflow < YEAR || overflow > DATE) 14718 ) { 14719 overflow = DATE; 14720 } 14721 if (getParsingFlags(m)._overflowWeeks && overflow === -1) { 14722 overflow = WEEK; 14723 } 14724 if (getParsingFlags(m)._overflowWeekday && overflow === -1) { 14725 overflow = WEEKDAY; 14726 } 14727 14728 getParsingFlags(m).overflow = overflow; 14729 } 14730 14731 return m; 14732 } 14733 14734 // iso 8601 regex 14735 // 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) 14736 var extendedIsoRegex = 14737 /^\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)?)?$/, 14738 basicIsoRegex = 14739 /^\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)?)?$/, 14740 tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, 14741 isoDates = [ 14742 ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], 14743 ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], 14744 ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], 14745 ['GGGG-[W]WW', /\d{4}-W\d\d/, false], 14746 ['YYYY-DDD', /\d{4}-\d{3}/], 14747 ['YYYY-MM', /\d{4}-\d\d/, false], 14748 ['YYYYYYMMDD', /[+-]\d{10}/], 14749 ['YYYYMMDD', /\d{8}/], 14750 ['GGGG[W]WWE', /\d{4}W\d{3}/], 14751 ['GGGG[W]WW', /\d{4}W\d{2}/, false], 14752 ['YYYYDDD', /\d{7}/], 14753 ['YYYYMM', /\d{6}/, false], 14754 ['YYYY', /\d{4}/, false], 14755 ], 14756 // iso time formats and regexes 14757 isoTimes = [ 14758 ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], 14759 ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], 14760 ['HH:mm:ss', /\d\d:\d\d:\d\d/], 14761 ['HH:mm', /\d\d:\d\d/], 14762 ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], 14763 ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], 14764 ['HHmmss', /\d\d\d\d\d\d/], 14765 ['HHmm', /\d\d\d\d/], 14766 ['HH', /\d\d/], 14767 ], 14768 aspNetJsonRegex = /^\/?Date\((-?\d+)/i, 14769 // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 14770 rfc2822 = 14771 /^(?:(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}))$/, 14772 obsOffsets = { 14773 UT: 0, 14774 GMT: 0, 14775 EDT: -4 * 60, 14776 EST: -5 * 60, 14777 CDT: -5 * 60, 14778 CST: -6 * 60, 14779 MDT: -6 * 60, 14780 MST: -7 * 60, 14781 PDT: -7 * 60, 14782 PST: -8 * 60, 14783 }; 14784 14785 // date from iso format 14786 function configFromISO(config) { 14787 var i, 14788 l, 14789 string = config._i, 14790 match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), 14791 allowTime, 14792 dateFormat, 14793 timeFormat, 14794 tzFormat, 14795 isoDatesLen = isoDates.length, 14796 isoTimesLen = isoTimes.length; 14797 14798 if (match) { 14799 getParsingFlags(config).iso = true; 14800 for (i = 0, l = isoDatesLen; i < l; i++) { 14801 if (isoDates[i][1].exec(match[1])) { 14802 dateFormat = isoDates[i][0]; 14803 allowTime = isoDates[i][2] !== false; 14804 break; 14805 } 14806 } 14807 if (dateFormat == null) { 14808 config._isValid = false; 14809 return; 14810 } 14811 if (match[3]) { 14812 for (i = 0, l = isoTimesLen; i < l; i++) { 14813 if (isoTimes[i][1].exec(match[3])) { 14814 // match[2] should be 'T' or space 14815 timeFormat = (match[2] || ' ') + isoTimes[i][0]; 14816 break; 14817 } 14818 } 14819 if (timeFormat == null) { 14820 config._isValid = false; 14821 return; 14822 } 14823 } 14824 if (!allowTime && timeFormat != null) { 14825 config._isValid = false; 14826 return; 14827 } 14828 if (match[4]) { 14829 if (tzRegex.exec(match[4])) { 14830 tzFormat = 'Z'; 14831 } else { 14832 config._isValid = false; 14833 return; 14834 } 14835 } 14836 config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); 14837 configFromStringAndFormat(config); 14838 } else { 14839 config._isValid = false; 14840 } 14841 } 14842 14843 function extractFromRFC2822Strings( 14844 yearStr, 14845 monthStr, 14846 dayStr, 14847 hourStr, 14848 minuteStr, 14849 secondStr 14850 ) { 14851 var result = [ 14852 untruncateYear(yearStr), 14853 defaultLocaleMonthsShort.indexOf(monthStr), 14854 parseInt(dayStr, 10), 14855 parseInt(hourStr, 10), 14856 parseInt(minuteStr, 10), 14857 ]; 14858 14859 if (secondStr) { 14860 result.push(parseInt(secondStr, 10)); 14861 } 14862 14863 return result; 14864 } 14865 14866 function untruncateYear(yearStr) { 14867 var year = parseInt(yearStr, 10); 14868 if (year <= 49) { 14869 return 2000 + year; 14870 } else if (year <= 999) { 14871 return 1900 + year; 14872 } 14873 return year; 14874 } 14875 14876 function preprocessRFC2822(s) { 14877 // Remove comments and folding whitespace and replace multiple-spaces with a single space 14878 return s 14879 .replace(/\([^()]*\)|[\n\t]/g, ' ') 14880 .replace(/(\s\s+)/g, ' ') 14881 .replace(/^\s\s*/, '') 14882 .replace(/\s\s*$/, ''); 14883 } 14884 14885 function checkWeekday(weekdayStr, parsedInput, config) { 14886 if (weekdayStr) { 14887 // TODO: Replace the vanilla JS Date object with an independent day-of-week check. 14888 var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), 14889 weekdayActual = new Date( 14890 parsedInput[0], 14891 parsedInput[1], 14892 parsedInput[2] 14893 ).getDay(); 14894 if (weekdayProvided !== weekdayActual) { 14895 getParsingFlags(config).weekdayMismatch = true; 14896 config._isValid = false; 14897 return false; 14898 } 14899 } 14900 return true; 14901 } 14902 14903 function calculateOffset(obsOffset, militaryOffset, numOffset) { 14904 if (obsOffset) { 14905 return obsOffsets[obsOffset]; 14906 } else if (militaryOffset) { 14907 // the only allowed military tz is Z 14908 return 0; 14909 } else { 14910 var hm = parseInt(numOffset, 10), 14911 m = hm % 100, 14912 h = (hm - m) / 100; 14913 return h * 60 + m; 14914 } 14915 } 14916 14917 // date and time from ref 2822 format 14918 function configFromRFC2822(config) { 14919 var match = rfc2822.exec(preprocessRFC2822(config._i)), 14920 parsedArray; 14921 if (match) { 14922 parsedArray = extractFromRFC2822Strings( 14923 match[4], 14924 match[3], 14925 match[2], 14926 match[5], 14927 match[6], 14928 match[7] 14929 ); 14930 if (!checkWeekday(match[1], parsedArray, config)) { 14931 return; 14932 } 14933 14934 config._a = parsedArray; 14935 config._tzm = calculateOffset(match[8], match[9], match[10]); 14936 14937 config._d = createUTCDate.apply(null, config._a); 14938 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); 14939 14940 getParsingFlags(config).rfc2822 = true; 14941 } else { 14942 config._isValid = false; 14943 } 14944 } 14945 14946 // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict 14947 function configFromString(config) { 14948 var matched = aspNetJsonRegex.exec(config._i); 14949 if (matched !== null) { 14950 config._d = new Date(+matched[1]); 14951 return; 14952 } 14953 14954 configFromISO(config); 14955 if (config._isValid === false) { 14956 delete config._isValid; 14957 } else { 14958 return; 14959 } 14960 14961 configFromRFC2822(config); 14962 if (config._isValid === false) { 14963 delete config._isValid; 14964 } else { 14965 return; 14966 } 14967 14968 if (config._strict) { 14969 config._isValid = false; 14970 } else { 14971 // Final attempt, use Input Fallback 14972 hooks.createFromInputFallback(config); 14973 } 14974 } 14975 14976 hooks.createFromInputFallback = deprecate( 14977 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 14978 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 14979 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', 14980 function (config) { 14981 config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); 14982 } 14983 ); 14984 14985 // Pick the first defined of two or three arguments. 14986 function defaults(a, b, c) { 14987 if (a != null) { 14988 return a; 14989 } 14990 if (b != null) { 14991 return b; 14992 } 14993 return c; 14994 } 14995 14996 function currentDateArray(config
vendor: 17,694 bytes, lines 14996-15557
14996) { 14997 // hooks is actually the exported moment object 14998 var nowValue = new Date(hooks.now()); 14999 if (config._useUTC) { 15000 return [ 15001 nowValue.getUTCFullYear(), 15002 nowValue.getUTCMonth(), 15003 nowValue.getUTCDate(), 15004 ]; 15005 } 15006 return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; 15007 } 15008 15009 // convert an array to a date. 15010 // the array should mirror the parameters below 15011 // note: all values past the year are optional and will default to the lowest possible value. 15012 // [year, month, day , hour, minute, second, millisecond] 15013 function configFromArray(config) { 15014 var i, 15015 date, 15016 input = [], 15017 currentDate, 15018 expectedWeekday, 15019 yearToUse; 15020 15021 if (config._d) { 15022 return; 15023 } 15024 15025 currentDate = currentDateArray(config); 15026 15027 //compute day of the year from weeks and weekdays 15028 if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { 15029 dayOfYearFromWeekInfo(config); 15030 } 15031 15032 //if the day of the year is set, figure out what it is 15033 if (config._dayOfYear != null) { 15034 yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); 15035 15036 if ( 15037 config._dayOfYear > daysInYear(yearToUse) || 15038 config._dayOfYear === 0 15039 ) { 15040 getParsingFlags(config)._overflowDayOfYear = true; 15041 } 15042 15043 date = createUTCDate(yearToUse, 0, config._dayOfYear); 15044 config._a[MONTH] = date.getUTCMonth(); 15045 config._a[DATE] = date.getUTCDate(); 15046 } 15047 15048 // Default to current date. 15049 // * if no year, month, day of month are given, default to today 15050 // * if day of month is given, default month and year 15051 // * if month is given, default only year 15052 // * if year is given, don't default anything 15053 for (i = 0; i < 3 && config._a[i] == null; ++i) { 15054 config._a[i] = input[i] = currentDate[i]; 15055 } 15056 15057 // Zero out whatever was not defaulted, including time 15058 for (; i < 7; i++) { 15059 config._a[i] = input[i] = 15060 config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i]; 15061 } 15062 15063 // Check for 24:00:00.000 15064 if ( 15065 config._a[HOUR] === 24 && 15066 config._a[MINUTE] === 0 && 15067 config._a[SECOND] === 0 && 15068 config._a[MILLISECOND] === 0 15069 ) { 15070 config._nextDay = true; 15071 config._a[HOUR] = 0; 15072 } 15073 15074 config._d = (config._useUTC ? createUTCDate : createDate).apply( 15075 null, 15076 input 15077 ); 15078 expectedWeekday = config._useUTC 15079 ? config._d.getUTCDay() 15080 : config._d.getDay(); 15081 15082 // Apply timezone offset from input. The actual utcOffset can be changed 15083 // with parseZone. 15084 if (config._tzm != null) { 15085 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); 15086 } 15087 15088 if (config._nextDay) { 15089 config._a[HOUR] = 24; 15090 } 15091 15092 // check for mismatching day of week 15093 if ( 15094 config._w && 15095 typeof config._w.d !== 'undefined' && 15096 config._w.d !== expectedWeekday 15097 ) { 15098 getParsingFlags(config).weekdayMismatch = true; 15099 } 15100 } 15101 15102 function dayOfYearFromWeekInfo(config) { 15103 var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; 15104 15105 w = config._w; 15106 if (w.GG != null || w.W != null || w.E != null) { 15107 dow = 1; 15108 doy = 4; 15109 15110 // TODO: We need to take the current isoWeekYear, but that depends on 15111 // how we interpret now (local, utc, fixed offset). So create 15112 // a now version of current config (take local/utc/offset flags, and 15113 // create now). 15114 weekYear = defaults( 15115 w.GG, 15116 config._a[YEAR], 15117 weekOfYear(createLocal(), 1, 4).year 15118 ); 15119 week = defaults(w.W, 1); 15120 weekday = defaults(w.E, 1); 15121 if (weekday < 1 || weekday > 7) { 15122 weekdayOverflow = true; 15123 } 15124 } else { 15125 dow = config._locale._week.dow; 15126 doy = config._locale._week.doy; 15127 15128 curWeek = weekOfYear(createLocal(), dow, doy); 15129 15130 weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); 15131 15132 // Default to current week. 15133 week = defaults(w.w, curWeek.week); 15134 15135 if (w.d != null) { 15136 // weekday -- low day numbers are considered next week 15137 weekday = w.d; 15138 if (weekday < 0 || weekday > 6) { 15139 weekdayOverflow = true; 15140 } 15141 } else if (w.e != null) { 15142 // local weekday -- counting starts from beginning of week 15143 weekday = w.e + dow; 15144 if (w.e < 0 || w.e > 6) { 15145 weekdayOverflow = true; 15146 } 15147 } else { 15148 // default to beginning of week 15149 weekday = dow; 15150 } 15151 } 15152 if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { 15153 getParsingFlags(config)._overflowWeeks = true; 15154 } else if (weekdayOverflow != null) { 15155 getParsingFlags(config)._overflowWeekday = true; 15156 } else { 15157 temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); 15158 config._a[YEAR] = temp.year; 15159 config._dayOfYear = temp.dayOfYear; 15160 } 15161 } 15162 15163 // constant that refers to the ISO standard 15164 hooks.ISO_8601 = function () {}; 15165 15166 // constant that refers to the RFC 2822 form 15167 hooks.RFC_2822 = function () {}; 15168 15169 // date from string and format string 15170 function configFromStringAndFormat(config) { 15171 // TODO: Move this to another part of the creation flow to prevent circular deps 15172 if (config._f === hooks.ISO_8601) { 15173 configFromISO(config); 15174 return; 15175 } 15176 if (config._f === hooks.RFC_2822) { 15177 configFromRFC2822(config); 15178 return; 15179 } 15180 config._a = []; 15181 getParsingFlags(config).empty = true; 15182 15183 // This array is used to make a Date, either with `new Date` or `Date.UTC` 15184 var string = '' + config._i, 15185 i, 15186 parsedInput, 15187 tokens, 15188 token, 15189 skipped, 15190 stringLength = string.length, 15191 totalParsedInputLength = 0, 15192 era, 15193 tokenLen; 15194 15195 tokens = 15196 expandFormat(config._f, config._locale).match(formattingTokens) || []; 15197 tokenLen = tokens.length; 15198 for (i = 0; i < tokenLen; i++) { 15199 token = tokens[i]; 15200 parsedInput = (string.match(getParseRegexForToken(token, config)) || 15201 [])[0]; 15202 if (parsedInput) { 15203 skipped = string.substr(0, string.indexOf(parsedInput)); 15204 if (skipped.length > 0) { 15205 getParsingFlags(config).unusedInput.push(skipped); 15206 } 15207 string = string.slice( 15208 string.indexOf(parsedInput) + parsedInput.length 15209 ); 15210 totalParsedInputLength += parsedInput.length; 15211 } 15212 // don't parse if it's not a known token 15213 if (formatTokenFunctions[token]) { 15214 if (parsedInput) { 15215 getParsingFlags(config).empty = false; 15216 } else { 15217 getParsingFlags(config).unusedTokens.push(token); 15218 } 15219 addTimeToArrayFromToken(token, parsedInput, config); 15220 } else if (config._strict && !parsedInput) { 15221 getParsingFlags(config).unusedTokens.push(token); 15222 } 15223 } 15224 15225 // add remaining unparsed input length to the string 15226 getParsingFlags(config).charsLeftOver = 15227 stringLength - totalParsedInputLength; 15228 if (string.length > 0) { 15229 getParsingFlags(config).unusedInput.push(string); 15230 } 15231 15232 // clear _12h flag if hour is <= 12 15233 if ( 15234 config._a[HOUR] <= 12 && 15235 getParsingFlags(config).bigHour === true && 15236 config._a[HOUR] > 0 15237 ) { 15238 getParsingFlags(config).bigHour = undefined; 15239 } 15240 15241 getParsingFlags(config).parsedDateParts = config._a.slice(0); 15242 getParsingFlags(config).meridiem = config._meridiem; 15243 // handle meridiem 15244 config._a[HOUR] = meridiemFixWrap( 15245 config._locale, 15246 config._a[HOUR], 15247 config._meridiem 15248 ); 15249 15250 // handle era 15251 era = getParsingFlags(config).era; 15252 if (era !== null) { 15253 config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); 15254 } 15255 15256 configFromArray(config); 15257 checkOverflow(config); 15258 } 15259 15260 function meridiemFixWrap(locale, hour, meridiem) { 15261 var isPm; 15262 15263 if (meridiem == null) { 15264 // nothing to do 15265 return hour; 15266 } 15267 if (locale.meridiemHour != null) { 15268 return locale.meridiemHour(hour, meridiem); 15269 } else if (locale.isPM != null) { 15270 // Fallback 15271 isPm = locale.isPM(meridiem); 15272 if (isPm && hour < 12) { 15273 hour += 12; 15274 } 15275 if (!isPm && hour === 12) { 15276 hour = 0; 15277 } 15278 return hour; 15279 } else { 15280 // this is not supposed to happen 15281 return hour; 15282 } 15283 } 15284 15285 // date from string and array of format strings 15286 function configFromStringAndArray(config) { 15287 var tempConfig, 15288 bestMoment, 15289 scoreToBeat, 15290 i, 15291 currentScore, 15292 validFormatFound, 15293 bestFormatIsValid = false, 15294 configfLen = config._f.length; 15295 15296 if (configfLen === 0) { 15297 getParsingFlags(config).invalidFormat = true; 15298 config._d = new Date(NaN); 15299 return; 15300 } 15301 15302 for (i = 0; i < configfLen; i++) { 15303 currentScore = 0; 15304 validFormatFound = false; 15305 tempConfig = copyConfig({}, config); 15306 if (config._useUTC != null) { 15307 tempConfig._useUTC = config._useUTC; 15308 } 15309 tempConfig._f = config._f[i]; 15310 configFromStringAndFormat(tempConfig); 15311 15312 if (isValid(tempConfig)) { 15313 validFormatFound = true; 15314 } 15315 15316 // if there is any input that was not parsed add a penalty for that format 15317 currentScore += getParsingFlags(tempConfig).charsLeftOver; 15318 15319 //or tokens 15320 currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; 15321 15322 getParsingFlags(tempConfig).score = currentScore; 15323 15324 if (!bestFormatIsValid) { 15325 if ( 15326 scoreToBeat == null || 15327 currentScore < scoreToBeat || 15328 validFormatFound 15329 ) { 15330 scoreToBeat = currentScore; 15331 bestMoment = tempConfig; 15332 if (validFormatFound) { 15333 bestFormatIsValid = true; 15334 } 15335 } 15336 } else { 15337 if (currentScore < scoreToBeat) { 15338 scoreToBeat = currentScore; 15339 bestMoment = tempConfig; 15340 } 15341 } 15342 } 15343 15344 extend(config, bestMoment || tempConfig); 15345 } 15346 15347 function configFromObject(config) { 15348 if (config._d) { 15349 return; 15350 } 15351 15352 var i = normalizeObjectUnits(config._i), 15353 dayOrDate = i.day === undefined ? i.date : i.day; 15354 config._a = map( 15355 [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], 15356 function (obj) { 15357 return obj && parseInt(obj, 10); 15358 } 15359 ); 15360 15361 configFromArray(config); 15362 } 15363 15364 function createFromConfig(config) { 15365 var res = new Moment(checkOverflow(prepareConfig(config))); 15366 if (res._nextDay) { 15367 // Adding is smart enough around DST 15368 res.add(1, 'd'); 15369 res._nextDay = undefined; 15370 } 15371 15372 return res; 15373 } 15374 15375 function prepareConfig(config) { 15376 var input = config._i, 15377 format = config._f; 15378 15379 config._locale = config._locale || getLocale(config._l); 15380 15381 if (input === null || (format === undefined && input === '')) { 15382 return createInvalid({ nullInput: true }); 15383 } 15384 15385 if (typeof input === 'string') { 15386 config._i = input = config._locale.preparse(input); 15387 } 15388 15389 if (isMoment(input)) { 15390 return new Moment(checkOverflow(input)); 15391 } else if (isDate(input)) { 15392 config._d = input; 15393 } else if (isArray(format)) { 15394 configFromStringAndArray(config); 15395 } else if (format) { 15396 configFromStringAndFormat(config); 15397 } else { 15398 configFromInput(config); 15399 } 15400 15401 if (!isValid(config)) { 15402 config._d = null; 15403 } 15404 15405 return config; 15406 } 15407 15408 function configFromInput(config) { 15409 var input = config._i; 15410 if (isUndefined(input)) { 15411 config._d = new Date(hooks.now()); 15412 } else if (isDate(input)) { 15413 config._d = new Date(input.valueOf()); 15414 } else if (typeof input === 'string') { 15415 configFromString(config); 15416 } else if (isArray(input)) { 15417 config._a = map(input.slice(0), function (obj) { 15418 return parseInt(obj, 10); 15419 }); 15420 configFromArray(config); 15421 } else if (isObject(input)) { 15422 configFromObject(config); 15423 } else if (isNumber(input)) { 15424 // from milliseconds 15425 config._d = new Date(input); 15426 } else { 15427 hooks.createFromInputFallback(config); 15428 } 15429 } 15430 15431 function createLocalOrUTC(input, format, locale, strict, isUTC) { 15432 var c = {}; 15433 15434 if (format === true || format === false) { 15435 strict = format; 15436 format = undefined; 15437 } 15438 15439 if (locale === true || locale === false) { 15440 strict = locale; 15441 locale = undefined; 15442 } 15443 15444 if ( 15445 (isObject(input) && isObjectEmpty(input)) || 15446 (isArray(input) && input.length === 0) 15447 ) { 15448 input = undefined; 15449 } 15450 // object construction must be done this way. 15451 // https://github.com/moment/moment/issues/1423 15452 c._isAMomentObject = true; 15453 c._useUTC = c._isUTC = isUTC; 15454 c._l = locale; 15455 c._i = input; 15456 c._f = format; 15457 c._strict = strict; 15458 15459 return createFromConfig(c); 15460 } 15461 15462 function createLocal(input, format, locale, strict) { 15463 return createLocalOrUTC(input, format, locale, strict, false); 15464 } 15465 15466 var prototypeMin = deprecate( 15467 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', 15468 function () { 15469 var other = createLocal.apply(null, arguments); 15470 if (this.isValid() && other.isValid()) { 15471 return other < this ? this : other; 15472 } else { 15473 return createInvalid(); 15474 } 15475 } 15476 ), 15477 prototypeMax = deprecate( 15478 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', 15479 function () { 15480 var other = createLocal.apply(null, arguments); 15481 if (this.isValid() && other.isValid()) { 15482 return other > this ? this : other; 15483 } else { 15484 return createInvalid(); 15485 } 15486 } 15487 ); 15488 15489 // Pick a moment m from moments so that m[fn](other) is true for all 15490 // other. This relies on the function fn to be transitive. 15491 // 15492 // moments should either be an array of moment objects or an array, whose 15493 // first element is an array of moment objects. 15494 function pickBy(fn, moments) { 15495 var res, i; 15496 if (moments.length === 1 && isArray(moments[0])) { 15497 moments = moments[0]; 15498 } 15499 if (!moments.length) { 15500 return createLocal(); 15501 } 15502 res = moments[0]; 15503 for (i = 1; i < moments.length; ++i) { 15504 if (!moments[i].isValid() || moments[i][fn](res)) { 15505 res = moments[i]; 15506 } 15507 } 15508 return res; 15509 } 15510 15511 // TODO: Use [].sort instead? 15512 function min() { 15513 var args = [].slice.call(arguments, 0); 15514 15515 return pickBy('isBefore', args); 15516 } 15517 15518 function max() { 15519 var args = [].slice.call(arguments, 0); 15520 15521 return pickBy('isAfter', args); 15522 } 15523 15524 var now = function () { 15525 return Date.now ? Date.now() : +new Date(); 15526 }; 15527 15528 var ordering = [ 15529 'year', 15530 'quarter', 15531 'month', 15532 'week', 15533 'day', 15534 'hour', 15535 'minute', 15536 'second', 15537 'millisecond', 15538 ]; 15539 15540 function isDurationValid(m) { 15541 var key, 15542 unitHasDecimal = false, 15543 i, 15544 orderLen = ordering.length; 15545 for (key in m) { 15546 if ( 15547 hasOwnProp(m, key) && 15548 !( 15549 indexOf.call(ordering, key) !== -1 && 15550 (m[key] == null || !isNaN(m[key])) 15551 ) 15552 ) { 15553 return false; 15554 } 15555 } 15556 15557 for (i = 0; i < orderLen
vendor: 10,251 bytes, lines 15557-15882
15557; ++i) { 15558 if (m[ordering[i]]) { 15559 if (unitHasDecimal) { 15560 return false; // only allow non-integers for smallest unit 15561 } 15562 if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { 15563 unitHasDecimal = true; 15564 } 15565 } 15566 } 15567 15568 return true; 15569 } 15570 15571 function isValid$1() { 15572 return this._isValid; 15573 } 15574 15575 function createInvalid$1() { 15576 return createDuration(NaN); 15577 } 15578 15579 function Duration(duration) { 15580 var normalizedInput = normalizeObjectUnits(duration), 15581 years = normalizedInput.year || 0, 15582 quarters = normalizedInput.quarter || 0, 15583 months = normalizedInput.month || 0, 15584 weeks = normalizedInput.week || normalizedInput.isoWeek || 0, 15585 days = normalizedInput.day || 0, 15586 hours = normalizedInput.hour || 0, 15587 minutes = normalizedInput.minute || 0, 15588 seconds = normalizedInput.second || 0, 15589 milliseconds = normalizedInput.millisecond || 0; 15590 15591 this._isValid = isDurationValid(normalizedInput); 15592 15593 // representation for dateAddRemove 15594 this._milliseconds = 15595 +milliseconds + 15596 seconds * 1e3 + // 1000 15597 minutes * 6e4 + // 1000 * 60 15598 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 15599 // Because of dateAddRemove treats 24 hours as different from a 15600 // day when working around DST, we need to store them separately 15601 this._days = +days + weeks * 7; 15602 // It is impossible to translate months into days without knowing 15603 // which months you are are talking about, so we have to store 15604 // it separately. 15605 this._months = +months + quarters * 3 + years * 12; 15606 15607 this._data = {}; 15608 15609 this._locale = getLocale(); 15610 15611 this._bubble(); 15612 } 15613 15614 function isDuration(obj) { 15615 return obj instanceof Duration; 15616 } 15617 15618 function absRound(number) { 15619 if (number < 0) { 15620 return Math.round(-1 * number) * -1; 15621 } else { 15622 return Math.round(number); 15623 } 15624 } 15625 15626 // compare two arrays, return the number of differences 15627 function compareArrays(array1, array2, dontConvert) { 15628 var len = Math.min(array1.length, array2.length), 15629 lengthDiff = Math.abs(array1.length - array2.length), 15630 diffs = 0, 15631 i; 15632 for (i = 0; i < len; i++) { 15633 if ( 15634 (dontConvert && array1[i] !== array2[i]) || 15635 (!dontConvert && toInt(array1[i]) !== toInt(array2[i])) 15636 ) { 15637 diffs++; 15638 } 15639 } 15640 return diffs + lengthDiff; 15641 } 15642 15643 // FORMATTING 15644 15645 function offset(token, separator) { 15646 addFormatToken(token, 0, 0, function () { 15647 var offset = this.utcOffset(), 15648 sign = '+'; 15649 if (offset < 0) { 15650 offset = -offset; 15651 sign = '-'; 15652 } 15653 return ( 15654 sign + 15655 zeroFill(~~(offset / 60), 2) + 15656 separator + 15657 zeroFill(~~offset % 60, 2) 15658 ); 15659 }); 15660 } 15661 15662 offset('Z', ':'); 15663 offset('ZZ', ''); 15664 15665 // PARSING 15666 15667 addRegexToken('Z', matchShortOffset); 15668 addRegexToken('ZZ', matchShortOffset); 15669 addParseToken(['Z', 'ZZ'], function (input, array, config) { 15670 config._useUTC = true; 15671 config._tzm = offsetFromString(matchShortOffset, input); 15672 }); 15673 15674 // HELPERS 15675 15676 // timezone chunker 15677 // '+10:00' > ['10', '00'] 15678 // '-1530' > ['-15', '30'] 15679 var chunkOffset = /([\+\-]|\d\d)/gi; 15680 15681 function offsetFromString(matcher, string) { 15682 var matches = (string || '').match(matcher), 15683 chunk, 15684 parts, 15685 minutes; 15686 15687 if (matches === null) { 15688 return null; 15689 } 15690 15691 chunk = matches[matches.length - 1] || []; 15692 parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; 15693 minutes = +(parts[1] * 60) + toInt(parts[2]); 15694 15695 return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; 15696 } 15697 15698 // Return a moment from input, that is local/utc/zone equivalent to model. 15699 function cloneWithOffset(input, model) { 15700 var res, diff; 15701 if (model._isUTC) { 15702 res = model.clone(); 15703 diff = 15704 (isMoment(input) || isDate(input) 15705 ? input.valueOf() 15706 : createLocal(input).valueOf()) - res.valueOf(); 15707 // Use low-level api, because this fn is low-level api. 15708 res._d.setTime(res._d.valueOf() + diff); 15709 hooks.updateOffset(res, false); 15710 return res; 15711 } else { 15712 return createLocal(input).local(); 15713 } 15714 } 15715 15716 function getDateOffset(m) { 15717 // On Firefox.24 Date#getTimezoneOffset returns a floating point. 15718 // https://github.com/moment/moment/pull/1871 15719 return -Math.round(m._d.getTimezoneOffset()); 15720 } 15721 15722 // HOOKS 15723 15724 // This function will be called whenever a moment is mutated. 15725 // It is intended to keep the offset in sync with the timezone. 15726 hooks.updateOffset = function () {}; 15727 15728 // MOMENTS 15729 15730 // keepLocalTime = true means only change the timezone, without 15731 // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> 15732 // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset 15733 // +0200, so we adjust the time as needed, to be valid. 15734 // 15735 // Keeping the time actually adds/subtracts (one hour) 15736 // from the actual represented time. That is why we call updateOffset 15737 // a second time. In case it wants us to change the offset again 15738 // _changeInProgress == true case, then we have to adjust, because 15739 // there is no such time in the given timezone. 15740 function getSetOffset(input, keepLocalTime, keepMinutes) { 15741 var offset = this._offset || 0, 15742 localAdjust; 15743 if (!this.isValid()) { 15744 return input != null ? this : NaN; 15745 } 15746 if (input != null) { 15747 if (typeof input === 'string') { 15748 input = offsetFromString(matchShortOffset, input); 15749 if (input === null) { 15750 return this; 15751 } 15752 } else if (Math.abs(input) < 16 && !keepMinutes) { 15753 input = input * 60; 15754 } 15755 if (!this._isUTC && keepLocalTime) { 15756 localAdjust = getDateOffset(this); 15757 } 15758 this._offset = input; 15759 this._isUTC = true; 15760 if (localAdjust != null) { 15761 this.add(localAdjust, 'm'); 15762 } 15763 if (offset !== input) { 15764 if (!keepLocalTime || this._changeInProgress) { 15765 addSubtract( 15766 this, 15767 createDuration(input - offset, 'm'), 15768 1, 15769 false 15770 ); 15771 } else if (!this._changeInProgress) { 15772 this._changeInProgress = true; 15773 hooks.updateOffset(this, true); 15774 this._changeInProgress = null; 15775 } 15776 } 15777 return this; 15778 } else { 15779 return this._isUTC ? offset : getDateOffset(this); 15780 } 15781 } 15782 15783 function getSetZone(input, keepLocalTime) { 15784 if (input != null) { 15785 if (typeof input !== 'string') { 15786 input = -input; 15787 } 15788 15789 this.utcOffset(input, keepLocalTime); 15790 15791 return this; 15792 } else { 15793 return -this.utcOffset(); 15794 } 15795 } 15796 15797 function setOffsetToUTC(keepLocalTime) { 15798 return this.utcOffset(0, keepLocalTime); 15799 } 15800 15801 function setOffsetToLocal(keepLocalTime) { 15802 if (this._isUTC) { 15803 this.utcOffset(0, keepLocalTime); 15804 this._isUTC = false; 15805 15806 if (keepLocalTime) { 15807 this.subtract(getDateOffset(this), 'm'); 15808 } 15809 } 15810 return this; 15811 } 15812 15813 function setOffsetToParsedOffset() { 15814 if (this._tzm != null) { 15815 this.utcOffset(this._tzm, false, true); 15816 } else if (typeof this._i === 'string') { 15817 var tZone = offsetFromString(matchOffset, this._i); 15818 if (tZone != null) { 15819 this.utcOffset(tZone); 15820 } else { 15821 this.utcOffset(0, true); 15822 } 15823 } 15824 return this; 15825 } 15826 15827 function hasAlignedHourOffset(input) { 15828 if (!this.isValid()) { 15829 return false; 15830 } 15831 input = input ? createLocal(input).utcOffset() : 0; 15832 15833 return (this.utcOffset() - input) % 60 === 0; 15834 } 15835 15836 function isDaylightSavingTime() { 15837 return ( 15838 this.utcOffset() > this.clone().month(0).utcOffset() || 15839 this.utcOffset() > this.clone().month(5).utcOffset() 15840 ); 15841 } 15842 15843 function isDaylightSavingTimeShifted() { 15844 if (!isUndefined(this._isDSTShifted)) { 15845 return this._isDSTShifted; 15846 } 15847 15848 var c = {}, 15849 other; 15850 15851 copyConfig(c, this); 15852 c = prepareConfig(c); 15853 15854 if (c._a) { 15855 other = c._isUTC ? createUTC(c._a) : createLocal(c._a); 15856 this._isDSTShifted = 15857 this.isValid() && compareArrays(c._a, other.toArray()) > 0; 15858 } else { 15859 this._isDSTShifted = false; 15860 } 15861 15862 return this._isDSTShifted; 15863 } 15864 15865 function isLocal() { 15866 return this.isValid() ? !this._isUTC : false; 15867 } 15868 15869 function isUtcOffset() { 15870 return this.isValid() ? this._isUTC : false; 15871 } 15872 15873 function isUtc() { 15874 return this.isValid() ? this._isUTC && this._offset === 0 : false; 15875 } 15876 15877 // ASP.NET json date format regex 15878 var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, 15879 // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html 15880 // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere 15881 // and further modified to allow for strings containing both week and day 15882 isoRegex =
vendor: 9,021 bytes, lines 15882-16172
15882 15883 /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; 15884 15885 function createDuration(input, key) { 15886 var duration = input, 15887 // matching against regexp is expensive, do it on demand 15888 match = null, 15889 sign, 15890 ret, 15891 diffRes; 15892 15893 if (isDuration(input)) { 15894 duration = { 15895 ms: input._milliseconds, 15896 d: input._days, 15897 M: input._months, 15898 }; 15899 } else if (isNumber(input) || !isNaN(+input)) { 15900 duration = {}; 15901 if (key) { 15902 duration[key] = +input; 15903 } else { 15904 duration.milliseconds = +input; 15905 } 15906 } else if ((match = aspNetRegex.exec(input))) { 15907 sign = match[1] === '-' ? -1 : 1; 15908 duration = { 15909 y: 0, 15910 d: toInt(match[DATE]) * sign, 15911 h: toInt(match[HOUR]) * sign, 15912 m: toInt(match[MINUTE]) * sign, 15913 s: toInt(match[SECOND]) * sign, 15914 ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match 15915 }; 15916 } else if ((match = isoRegex.exec(input))) { 15917 sign = match[1] === '-' ? -1 : 1; 15918 duration = { 15919 y: parseIso(match[2], sign), 15920 M: parseIso(match[3], sign), 15921 w: parseIso(match[4], sign), 15922 d: parseIso(match[5], sign), 15923 h: parseIso(match[6], sign), 15924 m: parseIso(match[7], sign), 15925 s: parseIso(match[8], sign), 15926 }; 15927 } else if (duration == null) { 15928 // checks for null or undefined 15929 duration = {}; 15930 } else if ( 15931 typeof duration === 'object' && 15932 ('from' in duration || 'to' in duration) 15933 ) { 15934 diffRes = momentsDifference( 15935 createLocal(duration.from), 15936 createLocal(duration.to) 15937 ); 15938 15939 duration = {}; 15940 duration.ms = diffRes.milliseconds; 15941 duration.M = diffRes.months; 15942 } 15943 15944 ret = new Duration(duration); 15945 15946 if (isDuration(input) && hasOwnProp(input, '_locale')) { 15947 ret._locale = input._locale; 15948 } 15949 15950 if (isDuration(input) && hasOwnProp(input, '_isValid')) { 15951 ret._isValid = input._isValid; 15952 } 15953 15954 return ret; 15955 } 15956 15957 createDuration.fn = Duration.prototype; 15958 createDuration.invalid = createInvalid$1; 15959 15960 function parseIso(inp, sign) { 15961 // We'd normally use ~~inp for this, but unfortunately it also 15962 // converts floats to ints. 15963 // inp may be undefined, so careful calling replace on it. 15964 var res = inp && parseFloat(inp.replace(',', '.')); 15965 // apply sign while we're at it 15966 return (isNaN(res) ? 0 : res) * sign; 15967 } 15968 15969 function positiveMomentsDifference(base, other) { 15970 var res = {}; 15971 15972 res.months = 15973 other.month() - base.month() + (other.year() - base.year()) * 12; 15974 if (base.clone().add(res.months, 'M').isAfter(other)) { 15975 --res.months; 15976 } 15977 15978 res.milliseconds = +other - +base.clone().add(res.months, 'M'); 15979 15980 return res; 15981 } 15982 15983 function momentsDifference(base, other) { 15984 var res; 15985 if (!(base.isValid() && other.isValid())) { 15986 return { milliseconds: 0, months: 0 }; 15987 } 15988 15989 other = cloneWithOffset(other, base); 15990 if (base.isBefore(other)) { 15991 res = positiveMomentsDifference(base, other); 15992 } else { 15993 res = positiveMomentsDifference(other, base); 15994 res.milliseconds = -res.milliseconds; 15995 res.months = -res.months; 15996 } 15997 15998 return res; 15999 } 16000 16001 // TODO: remove 'name' arg after deprecation is removed 16002 function createAdder(direction, name) { 16003 return function (val, period) { 16004 var dur, tmp; 16005 //invert the arguments, but complain about it 16006 if (period !== null && !isNaN(+period)) { 16007 deprecateSimple( 16008 name, 16009 'moment().' + 16010 name + 16011 '(period, number) is deprecated. Please use moment().' + 16012 name + 16013 '(number, period). ' + 16014 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.' 16015 ); 16016 tmp = val; 16017 val = period; 16018 period = tmp; 16019 } 16020 16021 dur = createDuration(val, period); 16022 addSubtract(this, dur, direction); 16023 return this; 16024 }; 16025 } 16026 16027 function addSubtract(mom, duration, isAdding, updateOffset) { 16028 var milliseconds = duration._milliseconds, 16029 days = absRound(duration._days), 16030 months = absRound(duration._months); 16031 16032 if (!mom.isValid()) { 16033 // No op 16034 return; 16035 } 16036 16037 updateOffset = updateOffset == null ? true : updateOffset; 16038 16039 if (months) { 16040 setMonth(mom, get(mom, 'Month') + months * isAdding); 16041 } 16042 if (days) { 16043 set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); 16044 } 16045 if (milliseconds) { 16046 mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); 16047 } 16048 if (updateOffset) { 16049 hooks.updateOffset(mom, days || months); 16050 } 16051 } 16052 16053 var add = createAdder(1, 'add'), 16054 subtract = createAdder(-1, 'subtract'); 16055 16056 function isString(input) { 16057 return typeof input === 'string' || input instanceof String; 16058 } 16059 16060 // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined 16061 function isMomentInput(input) { 16062 return ( 16063 isMoment(input) || 16064 isDate(input) || 16065 isString(input) || 16066 isNumber(input) || 16067 isNumberOrStringArray(input) || 16068 isMomentInputObject(input) || 16069 input === null || 16070 input === undefined 16071 ); 16072 } 16073 16074 function isMomentInputObject(input) { 16075 var objectTest = isObject(input) && !isObjectEmpty(input), 16076 propertyTest = false, 16077 properties = [ 16078 'years', 16079 'year', 16080 'y', 16081 'months', 16082 'month', 16083 'M', 16084 'days', 16085 'day', 16086 'd', 16087 'dates', 16088 'date', 16089 'D', 16090 'hours', 16091 'hour', 16092 'h', 16093 'minutes', 16094 'minute', 16095 'm', 16096 'seconds', 16097 'second', 16098 's', 16099 'milliseconds', 16100 'millisecond', 16101 'ms', 16102 ], 16103 i, 16104 property, 16105 propertyLen = properties.length; 16106 16107 for (i = 0; i < propertyLen; i += 1) { 16108 property = properties[i]; 16109 propertyTest = propertyTest || hasOwnProp(input, property); 16110 } 16111 16112 return objectTest && propertyTest; 16113 } 16114 16115 function isNumberOrStringArray(input) { 16116 var arrayTest = isArray(input), 16117 dataTypeTest = false; 16118 if (arrayTest) { 16119 dataTypeTest = 16120 input.filter(function (item) { 16121 return !isNumber(item) && isString(input); 16122 }).length === 0; 16123 } 16124 return arrayTest && dataTypeTest; 16125 } 16126 16127 function isCalendarSpec(input) { 16128 var objectTest = isObject(input) && !isObjectEmpty(input), 16129 propertyTest = false, 16130 properties = [ 16131 'sameDay', 16132 'nextDay', 16133 'lastDay', 16134 'nextWeek', 16135 'lastWeek', 16136 'sameElse', 16137 ], 16138 i, 16139 property; 16140 16141 for (i = 0; i < properties.length; i += 1) { 16142 property = properties[i]; 16143 propertyTest = propertyTest || hasOwnProp(input, property); 16144 } 16145 16146 return objectTest && propertyTest; 16147 } 16148 16149 function getCalendarFormat(myMoment, now) { 16150 var diff = myMoment.diff(now, 'days', true); 16151 return diff < -6 16152 ? 'sameElse' 16153 : diff < -1 16154 ? 'lastWeek' 16155 : diff < 0 16156 ? 'lastDay' 16157 : diff < 1 16158 ? 'sameDay' 16159 : diff < 2 16160 ? 'nextDay' 16161 : diff < 7 16162 ? 'nextWeek' 16163 : 'sameElse'; 16164 } 16165 16166 function calendar$1(time, formats) { 16167 // Support for single parameter, formats only overload to the calendar function 16168 if (arguments.length === 1) { 16169 if (!arguments[0]) { 16170 time = undefined; 16171 formats = undefined; 16172 } else
vendor: 17,627 bytes, lines 16172-16730
16172 if (isMomentInput(arguments[0])) { 16173 time = arguments[0]; 16174 formats = undefined; 16175 } else if (isCalendarSpec(arguments[0])) { 16176 formats = arguments[0]; 16177 time = undefined; 16178 } 16179 } 16180 // We want to compare the start of today, vs this. 16181 // Getting start-of-today depends on whether we're local/utc/offset or not. 16182 var now = time || createLocal(), 16183 sod = cloneWithOffset(now, this).startOf('day'), 16184 format = hooks.calendarFormat(this, sod) || 'sameElse', 16185 output = 16186 formats && 16187 (isFunction(formats[format]) 16188 ? formats[format].call(this, now) 16189 : formats[format]); 16190 16191 return this.format( 16192 output || this.localeData().calendar(format, this, createLocal(now)) 16193 ); 16194 } 16195 16196 function clone() { 16197 return new Moment(this); 16198 } 16199 16200 function isAfter(input, units) { 16201 var localInput = isMoment(input) ? input : createLocal(input); 16202 if (!(this.isValid() && localInput.isValid())) { 16203 return false; 16204 } 16205 units = normalizeUnits(units) || 'millisecond'; 16206 if (units === 'millisecond') { 16207 return this.valueOf() > localInput.valueOf(); 16208 } else { 16209 return localInput.valueOf() < this.clone().startOf(units).valueOf(); 16210 } 16211 } 16212 16213 function isBefore(input, units) { 16214 var localInput = isMoment(input) ? input : createLocal(input); 16215 if (!(this.isValid() && localInput.isValid())) { 16216 return false; 16217 } 16218 units = normalizeUnits(units) || 'millisecond'; 16219 if (units === 'millisecond') { 16220 return this.valueOf() < localInput.valueOf(); 16221 } else { 16222 return this.clone().endOf(units).valueOf() < localInput.valueOf(); 16223 } 16224 } 16225 16226 function isBetween(from, to, units, inclusivity) { 16227 var localFrom = isMoment(from) ? from : createLocal(from), 16228 localTo = isMoment(to) ? to : createLocal(to); 16229 if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { 16230 return false; 16231 } 16232 inclusivity = inclusivity || '()'; 16233 return ( 16234 (inclusivity[0] === '(' 16235 ? this.isAfter(localFrom, units) 16236 : !this.isBefore(localFrom, units)) && 16237 (inclusivity[1] === ')' 16238 ? this.isBefore(localTo, units) 16239 : !this.isAfter(localTo, units)) 16240 ); 16241 } 16242 16243 function isSame(input, units) { 16244 var localInput = isMoment(input) ? input : createLocal(input), 16245 inputMs; 16246 if (!(this.isValid() && localInput.isValid())) { 16247 return false; 16248 } 16249 units = normalizeUnits(units) || 'millisecond'; 16250 if (units === 'millisecond') { 16251 return this.valueOf() === localInput.valueOf(); 16252 } else { 16253 inputMs = localInput.valueOf(); 16254 return ( 16255 this.clone().startOf(units).valueOf() <= inputMs && 16256 inputMs <= this.clone().endOf(units).valueOf() 16257 ); 16258 } 16259 } 16260 16261 function isSameOrAfter(input, units) { 16262 return this.isSame(input, units) || this.isAfter(input, units); 16263 } 16264 16265 function isSameOrBefore(input, units) { 16266 return this.isSame(input, units) || this.isBefore(input, units); 16267 } 16268 16269 function diff(input, units, asFloat) { 16270 var that, zoneDelta, output; 16271 16272 if (!this.isValid()) { 16273 return NaN; 16274 } 16275 16276 that = cloneWithOffset(input, this); 16277 16278 if (!that.isValid()) { 16279 return NaN; 16280 } 16281 16282 zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; 16283 16284 units = normalizeUnits(units); 16285 16286 switch (units) { 16287 case 'year': 16288 output = monthDiff(this, that) / 12; 16289 break; 16290 case 'month': 16291 output = monthDiff(this, that); 16292 break; 16293 case 'quarter': 16294 output = monthDiff(this, that) / 3; 16295 break; 16296 case 'second': 16297 output = (this - that) / 1e3; 16298 break; // 1000 16299 case 'minute': 16300 output = (this - that) / 6e4; 16301 break; // 1000 * 60 16302 case 'hour': 16303 output = (this - that) / 36e5; 16304 break; // 1000 * 60 * 60 16305 case 'day': 16306 output = (this - that - zoneDelta) / 864e5; 16307 break; // 1000 * 60 * 60 * 24, negate dst 16308 case 'week': 16309 output = (this - that - zoneDelta) / 6048e5; 16310 break; // 1000 * 60 * 60 * 24 * 7, negate dst 16311 default: 16312 output = this - that; 16313 } 16314 16315 return asFloat ? output : absFloor(output); 16316 } 16317 16318 function monthDiff(a, b) { 16319 if (a.date() < b.date()) { 16320 // end-of-month calculations work correct when the start month has more 16321 // days than the end month. 16322 return -monthDiff(b, a); 16323 } 16324 // difference in months 16325 var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), 16326 // b is in (anchor - 1 month, anchor + 1 month) 16327 anchor = a.clone().add(wholeMonthDiff, 'months'), 16328 anchor2, 16329 adjust; 16330 16331 if (b - anchor < 0) { 16332 anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); 16333 // linear across the month 16334 adjust = (b - anchor) / (anchor - anchor2); 16335 } else { 16336 anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); 16337 // linear across the month 16338 adjust = (b - anchor) / (anchor2 - anchor); 16339 } 16340 16341 //check for negative zero, return zero if negative zero 16342 return -(wholeMonthDiff + adjust) || 0; 16343 } 16344 16345 hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; 16346 hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; 16347 16348 function toString() { 16349 return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); 16350 } 16351 16352 function toISOString(keepOffset) { 16353 if (!this.isValid()) { 16354 return null; 16355 } 16356 var utc = keepOffset !== true, 16357 m = utc ? this.clone().utc() : this; 16358 if (m.year() < 0 || m.year() > 9999) { 16359 return formatMoment( 16360 m, 16361 utc 16362 ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' 16363 : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ' 16364 ); 16365 } 16366 if (isFunction(Date.prototype.toISOString)) { 16367 // native implementation is ~50x faster, use it when we can 16368 if (utc) { 16369 return this.toDate().toISOString(); 16370 } else { 16371 return new Date(this.valueOf() + this.utcOffset() * 60 * 1000) 16372 .toISOString() 16373 .replace('Z', formatMoment(m, 'Z')); 16374 } 16375 } 16376 return formatMoment( 16377 m, 16378 utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ' 16379 ); 16380 } 16381 16382 /** 16383 * Return a human readable representation of a moment that can 16384 * also be evaluated to get a new moment which is the same 16385 * 16386 * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects 16387 */ 16388 function inspect() { 16389 if (!this.isValid()) { 16390 return 'moment.invalid(/* ' + this._i + ' */)'; 16391 } 16392 var func = 'moment', 16393 zone = '', 16394 prefix, 16395 year, 16396 datetime, 16397 suffix; 16398 if (!this.isLocal()) { 16399 func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; 16400 zone = 'Z'; 16401 } 16402 prefix = '[' + func + '("]'; 16403 year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; 16404 datetime = '-MM-DD[T]HH:mm:ss.SSS'; 16405 suffix = zone + '[")]'; 16406 16407 return this.format(prefix + year + datetime + suffix); 16408 } 16409 16410 function format(inputString) { 16411 if (!inputString) { 16412 inputString = this.isUtc() 16413 ? hooks.defaultFormatUtc 16414 : hooks.defaultFormat; 16415 } 16416 var output = formatMoment(this, inputString); 16417 return this.localeData().postformat(output); 16418 } 16419 16420 function from(time, withoutSuffix) { 16421 if ( 16422 this.isValid() && 16423 ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) 16424 ) { 16425 return createDuration({ to: this, from: time }) 16426 .locale(this.locale()) 16427 .humanize(!withoutSuffix); 16428 } else { 16429 return this.localeData().invalidDate(); 16430 } 16431 } 16432 16433 function fromNow(withoutSuffix) { 16434 return this.from(createLocal(), withoutSuffix); 16435 } 16436 16437 function to(time, withoutSuffix) { 16438 if ( 16439 this.isValid() && 16440 ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) 16441 ) { 16442 return createDuration({ from: this, to: time }) 16443 .locale(this.locale()) 16444 .humanize(!withoutSuffix); 16445 } else { 16446 return this.localeData().invalidDate(); 16447 } 16448 } 16449 16450 function toNow(withoutSuffix) { 16451 return this.to(createLocal(), withoutSuffix); 16452 } 16453 16454 // If passed a locale key, it will set the locale for this 16455 // instance. Otherwise, it will return the locale configuration 16456 // variables for this instance. 16457 function locale(key) { 16458 var newLocaleData; 16459 16460 if (key === undefined) { 16461 return this._locale._abbr; 16462 } else { 16463 newLocaleData = getLocale(key); 16464 if (newLocaleData != null) { 16465 this._locale = newLocaleData; 16466 } 16467 return this; 16468 } 16469 } 16470 16471 var lang = deprecate( 16472 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', 16473 function (key) { 16474 if (key === undefined) { 16475 return this.localeData(); 16476 } else { 16477 return this.locale(key); 16478 } 16479 } 16480 ); 16481 16482 function localeData() { 16483 return this._locale; 16484 } 16485 16486 var MS_PER_SECOND = 1000, 16487 MS_PER_MINUTE = 60 * MS_PER_SECOND, 16488 MS_PER_HOUR = 60 * MS_PER_MINUTE, 16489 MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; 16490 16491 // actual modulo - handles negative numbers (for dates before 1970): 16492 function mod$1(dividend, divisor) { 16493 return ((dividend % divisor) + divisor) % divisor; 16494 } 16495 16496 function localStartOfDate(y, m, d) { 16497 // the date constructor remaps years 0-99 to 1900-1999 16498 if (y < 100 && y >= 0) { 16499 // preserve leap years using a full 400 year cycle, then reset 16500 return new Date(y + 400, m, d) - MS_PER_400_YEARS; 16501 } else { 16502 return new Date(y, m, d).valueOf(); 16503 } 16504 } 16505 16506 function utcStartOfDate(y, m, d) { 16507 // Date.UTC remaps years 0-99 to 1900-1999 16508 if (y < 100 && y >= 0) { 16509 // preserve leap years using a full 400 year cycle, then reset 16510 return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; 16511 } else { 16512 return Date.UTC(y, m, d); 16513 } 16514 } 16515 16516 function startOf(units) { 16517 var time, startOfDate; 16518 units = normalizeUnits(units); 16519 if (units === undefined || units === 'millisecond' || !this.isValid()) { 16520 return this; 16521 } 16522 16523 startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; 16524 16525 switch (units) { 16526 case 'year': 16527 time = startOfDate(this.year(), 0, 1); 16528 break; 16529 case 'quarter': 16530 time = startOfDate( 16531 this.year(), 16532 this.month() - (this.month() % 3), 16533 1 16534 ); 16535 break; 16536 case 'month': 16537 time = startOfDate(this.year(), this.month(), 1); 16538 break; 16539 case 'week': 16540 time = startOfDate( 16541 this.year(), 16542 this.month(), 16543 this.date() - this.weekday() 16544 ); 16545 break; 16546 case 'isoWeek': 16547 time = startOfDate( 16548 this.year(), 16549 this.month(), 16550 this.date() - (this.isoWeekday() - 1) 16551 ); 16552 break; 16553 case 'day': 16554 case 'date': 16555 time = startOfDate(this.year(), this.month(), this.date()); 16556 break; 16557 case 'hour': 16558 time = this._d.valueOf(); 16559 time -= mod$1( 16560 time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), 16561 MS_PER_HOUR 16562 ); 16563 break; 16564 case 'minute': 16565 time = this._d.valueOf(); 16566 time -= mod$1(time, MS_PER_MINUTE); 16567 break; 16568 case 'second': 16569 time = this._d.valueOf(); 16570 time -= mod$1(time, MS_PER_SECOND); 16571 break; 16572 } 16573 16574 this._d.setTime(time); 16575 hooks.updateOffset(this, true); 16576 return this; 16577 } 16578 16579 function endOf(units) { 16580 var time, startOfDate; 16581 units = normalizeUnits(units); 16582 if (units === undefined || units === 'millisecond' || !this.isValid()) { 16583 return this; 16584 } 16585 16586 startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; 16587 16588 switch (units) { 16589 case 'year': 16590 time = startOfDate(this.year() + 1, 0, 1) - 1; 16591 break; 16592 case 'quarter': 16593 time = 16594 startOfDate( 16595 this.year(), 16596 this.month() - (this.month() % 3) + 3, 16597 1 16598 ) - 1; 16599 break; 16600 case 'month': 16601 time = startOfDate(this.year(), this.month() + 1, 1) - 1; 16602 break; 16603 case 'week': 16604 time = 16605 startOfDate( 16606 this.year(), 16607 this.month(), 16608 this.date() - this.weekday() + 7 16609 ) - 1; 16610 break; 16611 case 'isoWeek': 16612 time = 16613 startOfDate( 16614 this.year(), 16615 this.month(), 16616 this.date() - (this.isoWeekday() - 1) + 7 16617 ) - 1; 16618 break; 16619 case 'day': 16620 case 'date': 16621 time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; 16622 break; 16623 case 'hour': 16624 time = this._d.valueOf(); 16625 time += 16626 MS_PER_HOUR - 16627 mod$1( 16628 time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), 16629 MS_PER_HOUR 16630 ) - 16631 1; 16632 break; 16633 case 'minute': 16634 time = this._d.valueOf(); 16635 time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; 16636 break; 16637 case 'second': 16638 time = this._d.valueOf(); 16639 time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; 16640 break; 16641 } 16642 16643 this._d.setTime(time); 16644 hooks.updateOffset(this, true); 16645 return this; 16646 } 16647 16648 function valueOf() { 16649 return this._d.valueOf() - (this._offset || 0) * 60000; 16650 } 16651 16652 function unix() { 16653 return Math.floor(this.valueOf() / 1000); 16654 } 16655 16656 function toDate() { 16657 return new Date(this.valueOf()); 16658 } 16659 16660 function toArray() { 16661 var m = this; 16662 return [ 16663 m.year(), 16664 m.month(), 16665 m.date(), 16666 m.hour(), 16667 m.minute(), 16668 m.second(), 16669 m.millisecond(), 16670 ]; 16671 } 16672 16673 function toObject() { 16674 var m = this; 16675 return { 16676 years: m.year(), 16677 months: m.month(), 16678 date: m.date(), 16679 hours: m.hours(), 16680 minutes: m.minutes(), 16681 seconds: m.seconds(), 16682 milliseconds: m.milliseconds(), 16683 }; 16684 } 16685 16686 function toJSON() { 16687 // new Date(NaN).toJSON() === null 16688 return this.isValid() ? this.toISOString() : null; 16689 } 16690 16691 function isValid$2() { 16692 return isValid(this); 16693 } 16694 16695 function parsingFlags() { 16696 return extend({}, getParsingFlags(this)); 16697 } 16698 16699 function invalidAt() { 16700 return getParsingFlags(this).overflow; 16701 } 16702 16703 function creationData() { 16704 return { 16705 input: this._i, 16706 format: this._f, 16707 locale: this._locale, 16708 isUTC: this._isUTC, 16709 strict: this._strict, 16710 }; 16711 } 16712 16713 addFormatToken('N', 0, 0, 'eraAbbr'); 16714 addFormatToken('NN', 0, 0, 'eraAbbr'); 16715 addFormatToken('NNN', 0, 0, 'eraAbbr'); 16716 addFormatToken('NNNN', 0, 0, 'eraName'); 16717 addFormatToken('NNNNN', 0, 0, 'eraNarrow'); 16718 16719 addFormatToken('y', ['y', 1], 'yo', 'eraYear'); 16720 addFormatToken('y', ['yy', 2], 0, 'eraYear'); 16721 addFormatToken('y', ['yyy', 3], 0, 'eraYear'); 16722 addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); 16723 16724 addRegexToken('N', matchEraAbbr); 16725 addRegexToken('NN', matchEraAbbr); 16726 addRegexToken('NNN', matchEraAbbr); 16727 addRegexToken('NNNN', matchEraName); 16728 addRegexToken('NNNNN', matchEraNarrow); 16729 16730 addParseToken(
vendor: 8,145 bytes, lines 16730-17005
16730 16731 ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], 16732 function (input, array, config, token) { 16733 var era = config._locale.erasParse(input, token, config._strict); 16734 if (era) { 16735 getParsingFlags(config).era = era; 16736 } else { 16737 getParsingFlags(config).invalidEra = input; 16738 } 16739 } 16740 ); 16741 16742 addRegexToken('y', matchUnsigned); 16743 addRegexToken('yy', matchUnsigned); 16744 addRegexToken('yyy', matchUnsigned); 16745 addRegexToken('yyyy', matchUnsigned); 16746 addRegexToken('yo', matchEraYearOrdinal); 16747 16748 addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); 16749 addParseToken(['yo'], function (input, array, config, token) { 16750 var match; 16751 if (config._locale._eraYearOrdinalRegex) { 16752 match = input.match(config._locale._eraYearOrdinalRegex); 16753 } 16754 16755 if (config._locale.eraYearOrdinalParse) { 16756 array[YEAR] = config._locale.eraYearOrdinalParse(input, match); 16757 } else { 16758 array[YEAR] = parseInt(input, 10); 16759 } 16760 }); 16761 16762 function localeEras(m, format) { 16763 var i, 16764 l, 16765 date, 16766 eras = this._eras || getLocale('en')._eras; 16767 for (i = 0, l = eras.length; i < l; ++i) { 16768 switch (typeof eras[i].since) { 16769 case 'string': 16770 // truncate time 16771 date = hooks(eras[i].since).startOf('day'); 16772 eras[i].since = date.valueOf(); 16773 break; 16774 } 16775 16776 switch (typeof eras[i].until) { 16777 case 'undefined': 16778 eras[i].until = +Infinity; 16779 break; 16780 case 'string': 16781 // truncate time 16782 date = hooks(eras[i].until).startOf('day').valueOf(); 16783 eras[i].until = date.valueOf(); 16784 break; 16785 } 16786 } 16787 return eras; 16788 } 16789 16790 function localeErasParse(eraName, format, strict) { 16791 var i, 16792 l, 16793 eras = this.eras(), 16794 name, 16795 abbr, 16796 narrow; 16797 eraName = eraName.toUpperCase(); 16798 16799 for (i = 0, l = eras.length; i < l; ++i) { 16800 name = eras[i].name.toUpperCase(); 16801 abbr = eras[i].abbr.toUpperCase(); 16802 narrow = eras[i].narrow.toUpperCase(); 16803 16804 if (strict) { 16805 switch (format) { 16806 case 'N': 16807 case 'NN': 16808 case 'NNN': 16809 if (abbr === eraName) { 16810 return eras[i]; 16811 } 16812 break; 16813 16814 case 'NNNN': 16815 if (name === eraName) { 16816 return eras[i]; 16817 } 16818 break; 16819 16820 case 'NNNNN': 16821 if (narrow === eraName) { 16822 return eras[i]; 16823 } 16824 break; 16825 } 16826 } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { 16827 return eras[i]; 16828 } 16829 } 16830 } 16831 16832 function localeErasConvertYear(era, year) { 16833 var dir = era.since <= era.until ? +1 : -1; 16834 if (year === undefined) { 16835 return hooks(era.since).year(); 16836 } else { 16837 return hooks(era.since).year() + (year - era.offset) * dir; 16838 } 16839 } 16840 16841 function getEraName() { 16842 var i, 16843 l, 16844 val, 16845 eras = this.localeData().eras(); 16846 for (i = 0, l = eras.length; i < l; ++i) { 16847 // truncate time 16848 val = this.clone().startOf('day').valueOf(); 16849 16850 if (eras[i].since <= val && val <= eras[i].until) { 16851 return eras[i].name; 16852 } 16853 if (eras[i].until <= val && val <= eras[i].since) { 16854 return eras[i].name; 16855 } 16856 } 16857 16858 return ''; 16859 } 16860 16861 function getEraNarrow() { 16862 var i, 16863 l, 16864 val, 16865 eras = this.localeData().eras(); 16866 for (i = 0, l = eras.length; i < l; ++i) { 16867 // truncate time 16868 val = this.clone().startOf('day').valueOf(); 16869 16870 if (eras[i].since <= val && val <= eras[i].until) { 16871 return eras[i].narrow; 16872 } 16873 if (eras[i].until <= val && val <= eras[i].since) { 16874 return eras[i].narrow; 16875 } 16876 } 16877 16878 return ''; 16879 } 16880 16881 function getEraAbbr() { 16882 var i, 16883 l, 16884 val, 16885 eras = this.localeData().eras(); 16886 for (i = 0, l = eras.length; i < l; ++i) { 16887 // truncate time 16888 val = this.clone().startOf('day').valueOf(); 16889 16890 if (eras[i].since <= val && val <= eras[i].until) { 16891 return eras[i].abbr; 16892 } 16893 if (eras[i].until <= val && val <= eras[i].since) { 16894 return eras[i].abbr; 16895 } 16896 } 16897 16898 return ''; 16899 } 16900 16901 function getEraYear() { 16902 var i, 16903 l, 16904 dir, 16905 val, 16906 eras = this.localeData().eras(); 16907 for (i = 0, l = eras.length; i < l; ++i) { 16908 dir = eras[i].since <= eras[i].until ? +1 : -1; 16909 16910 // truncate time 16911 val = this.clone().startOf('day').valueOf(); 16912 16913 if ( 16914 (eras[i].since <= val && val <= eras[i].until) || 16915 (eras[i].until <= val && val <= eras[i].since) 16916 ) { 16917 return ( 16918 (this.year() - hooks(eras[i].since).year()) * dir + 16919 eras[i].offset 16920 ); 16921 } 16922 } 16923 16924 return this.year(); 16925 } 16926 16927 function erasNameRegex(isStrict) { 16928 if (!hasOwnProp(this, '_erasNameRegex')) { 16929 computeErasParse.call(this); 16930 } 16931 return isStrict ? this._erasNameRegex : this._erasRegex; 16932 } 16933 16934 function erasAbbrRegex(isStrict) { 16935 if (!hasOwnProp(this, '_erasAbbrRegex')) { 16936 computeErasParse.call(this); 16937 } 16938 return isStrict ? this._erasAbbrRegex : this._erasRegex; 16939 } 16940 16941 function erasNarrowRegex(isStrict) { 16942 if (!hasOwnProp(this, '_erasNarrowRegex')) { 16943 computeErasParse.call(this); 16944 } 16945 return isStrict ? this._erasNarrowRegex : this._erasRegex; 16946 } 16947 16948 function matchEraAbbr(isStrict, locale) { 16949 return locale.erasAbbrRegex(isStrict); 16950 } 16951 16952 function matchEraName(isStrict, locale) { 16953 return locale.erasNameRegex(isStrict); 16954 } 16955 16956 function matchEraNarrow(isStrict, locale) { 16957 return locale.erasNarrowRegex(isStrict); 16958 } 16959 16960 function matchEraYearOrdinal(isStrict, locale) { 16961 return locale._eraYearOrdinalRegex || matchUnsigned; 16962 } 16963 16964 function computeErasParse() { 16965 var abbrPieces = [], 16966 namePieces = [], 16967 narrowPieces = [], 16968 mixedPieces = [], 16969 i, 16970 l, 16971 eras = this.eras(); 16972 16973 for (i = 0, l = eras.length; i < l; ++i) { 16974 namePieces.push(regexEscape(eras[i].name)); 16975 abbrPieces.push(regexEscape(eras[i].abbr)); 16976 narrowPieces.push(regexEscape(eras[i].narrow)); 16977 16978 mixedPieces.push(regexEscape(eras[i].name)); 16979 mixedPieces.push(regexEscape(eras[i].abbr)); 16980 mixedPieces.push(regexEscape(eras[i].narrow)); 16981 } 16982 16983 this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 16984 this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); 16985 this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); 16986 this._erasNarrowRegex = new RegExp( 16987 '^(' + narrowPieces.join('|') + ')', 16988 'i' 16989 ); 16990 } 16991 16992 // FORMATTING 16993 16994 addFormatToken(0, ['gg', 2], 0, function () { 16995 return this.weekYear() % 100; 16996 }); 16997 16998 addFormatToken(0, ['GG', 2], 0, function () { 16999 return this.isoWeekYear() % 100; 17000 }); 17001 17002 function addWeekYearFormatToken(token, getter) { 17003 addFormatToken(0, [token, token.length], 0, getter); 17004 } 17005
17006 addWeekYearFormatToken('gggg', 'weekYear'); 17007 addWeekYearFormatToken('ggggg', 'weekYear'); 17008 addWeekYearFormatToken('GGGG', 'isoWeekYear'); 17009 addWeekYearFormatToken('GGGGG', 'isoWeekYear'); 17010 17011 // ALIASES 17012 17013 addUnitAlias('weekYear', 'gg'); 17014 addUnitAlias('isoWeekYear', 'GG'); 17015 17016 // PRIORITY 17017 17018 addUnitPriority('weekYear', 1); 17019 addUnitPriority('isoWeekYear', 1); 17020 17021 // PARSING 17022 17023 addRegexToken('G', matchSigned); 17024 addRegexToken('g', matchSigned); 17025 addRegexToken('GG', match1to2, match2); 17026 addRegexToken('gg', match1to2, match2); 17027 addRegexToken('GGGG', match1to4, match4); 17028 addRegexToken('gggg', match1to4, match4); 17029 addRegexToken('GGGGG', match1to6, match6); 17030 addRegexToken('ggggg', match1to6, match6); 17031 17032 addWeekParseToken( 17033 ['gggg', 'ggggg', 'GGGG', 'GGGGG'], 17034 function (input, week, config, token) { 17035 week[token.substr(0, 2)] = toInt(input); 17036 } 17037
vendor: 29,543 bytes, lines 17037-18060
17037); 17038 17039 addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { 17040 week[token] = hooks.parseTwoDigitYear(input); 17041 }); 17042 17043 // MOMENTS 17044 17045 function getSetWeekYear(input) { 17046 return getSetWeekYearHelper.call( 17047 this, 17048 input, 17049 this.week(), 17050 this.weekday(), 17051 this.localeData()._week.dow, 17052 this.localeData()._week.doy 17053 ); 17054 } 17055 17056 function getSetISOWeekYear(input) { 17057 return getSetWeekYearHelper.call( 17058 this, 17059 input, 17060 this.isoWeek(), 17061 this.isoWeekday(), 17062 1, 17063 4 17064 ); 17065 } 17066 17067 function getISOWeeksInYear() { 17068 return weeksInYear(this.year(), 1, 4); 17069 } 17070 17071 function getISOWeeksInISOWeekYear() { 17072 return weeksInYear(this.isoWeekYear(), 1, 4); 17073 } 17074 17075 function getWeeksInYear() { 17076 var weekInfo = this.localeData()._week; 17077 return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); 17078 } 17079 17080 function getWeeksInWeekYear() { 17081 var weekInfo = this.localeData()._week; 17082 return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); 17083 } 17084 17085 function getSetWeekYearHelper(input, week, weekday, dow, doy) { 17086 var weeksTarget; 17087 if (input == null) { 17088 return weekOfYear(this, dow, doy).year; 17089 } else { 17090 weeksTarget = weeksInYear(input, dow, doy); 17091 if (week > weeksTarget) { 17092 week = weeksTarget; 17093 } 17094 return setWeekAll.call(this, input, week, weekday, dow, doy); 17095 } 17096 } 17097 17098 function setWeekAll(weekYear, week, weekday, dow, doy) { 17099 var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), 17100 date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); 17101 17102 this.year(date.getUTCFullYear()); 17103 this.month(date.getUTCMonth()); 17104 this.date(date.getUTCDate()); 17105 return this; 17106 } 17107 17108 // FORMATTING 17109 17110 addFormatToken('Q', 0, 'Qo', 'quarter'); 17111 17112 // ALIASES 17113 17114 addUnitAlias('quarter', 'Q'); 17115 17116 // PRIORITY 17117 17118 addUnitPriority('quarter', 7); 17119 17120 // PARSING 17121 17122 addRegexToken('Q', match1); 17123 addParseToken('Q', function (input, array) { 17124 array[MONTH] = (toInt(input) - 1) * 3; 17125 }); 17126 17127 // MOMENTS 17128 17129 function getSetQuarter(input) { 17130 return input == null 17131 ? Math.ceil((this.month() + 1) / 3) 17132 : this.month((input - 1) * 3 + (this.month() % 3)); 17133 } 17134 17135 // FORMATTING 17136 17137 addFormatToken('D', ['DD', 2], 'Do', 'date'); 17138 17139 // ALIASES 17140 17141 addUnitAlias('date', 'D'); 17142 17143 // PRIORITY 17144 addUnitPriority('date', 9); 17145 17146 // PARSING 17147 17148 addRegexToken('D', match1to2); 17149 addRegexToken('DD', match1to2, match2); 17150 addRegexToken('Do', function (isStrict, locale) { 17151 // TODO: Remove "ordinalParse" fallback in next major release. 17152 return isStrict 17153 ? locale._dayOfMonthOrdinalParse || locale._ordinalParse 17154 : locale._dayOfMonthOrdinalParseLenient; 17155 }); 17156 17157 addParseToken(['D', 'DD'], DATE); 17158 addParseToken('Do', function (input, array) { 17159 array[DATE] = toInt(input.match(match1to2)[0]); 17160 }); 17161 17162 // MOMENTS 17163 17164 var getSetDayOfMonth = makeGetSet('Date', true); 17165 17166 // FORMATTING 17167 17168 addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); 17169 17170 // ALIASES 17171 17172 addUnitAlias('dayOfYear', 'DDD'); 17173 17174 // PRIORITY 17175 addUnitPriority('dayOfYear', 4); 17176 17177 // PARSING 17178 17179 addRegexToken('DDD', match1to3); 17180 addRegexToken('DDDD', match3); 17181 addParseToken(['DDD', 'DDDD'], function (input, array, config) { 17182 config._dayOfYear = toInt(input); 17183 }); 17184 17185 // HELPERS 17186 17187 // MOMENTS 17188 17189 function getSetDayOfYear(input) { 17190 var dayOfYear = 17191 Math.round( 17192 (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 17193 ) + 1; 17194 return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); 17195 } 17196 17197 // FORMATTING 17198 17199 addFormatToken('m', ['mm', 2], 0, 'minute'); 17200 17201 // ALIASES 17202 17203 addUnitAlias('minute', 'm'); 17204 17205 // PRIORITY 17206 17207 addUnitPriority('minute', 14); 17208 17209 // PARSING 17210 17211 addRegexToken('m', match1to2); 17212 addRegexToken('mm', match1to2, match2); 17213 addParseToken(['m', 'mm'], MINUTE); 17214 17215 // MOMENTS 17216 17217 var getSetMinute = makeGetSet('Minutes', false); 17218 17219 // FORMATTING 17220 17221 addFormatToken('s', ['ss', 2], 0, 'second'); 17222 17223 // ALIASES 17224 17225 addUnitAlias('second', 's'); 17226 17227 // PRIORITY 17228 17229 addUnitPriority('second', 15); 17230 17231 // PARSING 17232 17233 addRegexToken('s', match1to2); 17234 addRegexToken('ss', match1to2, match2); 17235 addParseToken(['s', 'ss'], SECOND); 17236 17237 // MOMENTS 17238 17239 var getSetSecond = makeGetSet('Seconds', false); 17240 17241 // FORMATTING 17242 17243 addFormatToken('S', 0, 0, function () { 17244 return ~~(this.millisecond() / 100); 17245 }); 17246 17247 addFormatToken(0, ['SS', 2], 0, function () { 17248 return ~~(this.millisecond() / 10); 17249 }); 17250 17251 addFormatToken(0, ['SSS', 3], 0, 'millisecond'); 17252 addFormatToken(0, ['SSSS', 4], 0, function () { 17253 return this.millisecond() * 10; 17254 }); 17255 addFormatToken(0, ['SSSSS', 5], 0, function () { 17256 return this.millisecond() * 100; 17257 }); 17258 addFormatToken(0, ['SSSSSS', 6], 0, function () { 17259 return this.millisecond() * 1000; 17260 }); 17261 addFormatToken(0, ['SSSSSSS', 7], 0, function () { 17262 return this.millisecond() * 10000; 17263 }); 17264 addFormatToken(0, ['SSSSSSSS', 8], 0, function () { 17265 return this.millisecond() * 100000; 17266 }); 17267 addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { 17268 return this.millisecond() * 1000000; 17269 }); 17270 17271 // ALIASES 17272 17273 addUnitAlias('millisecond', 'ms'); 17274 17275 // PRIORITY 17276 17277 addUnitPriority('millisecond', 16); 17278 17279 // PARSING 17280 17281 addRegexToken('S', match1to3, match1); 17282 addRegexToken('SS', match1to3, match2); 17283 addRegexToken('SSS', match1to3, match3); 17284 17285 var token, getSetMillisecond; 17286 for (token = 'SSSS'; token.length <= 9; token += 'S') { 17287 addRegexToken(token, matchUnsigned); 17288 } 17289 17290 function parseMs(input, array) { 17291 array[MILLISECOND] = toInt(('0.' + input) * 1000); 17292 } 17293 17294 for (token = 'S'; token.length <= 9; token += 'S') { 17295 addParseToken(token, parseMs); 17296 } 17297 17298 getSetMillisecond = makeGetSet('Milliseconds', false); 17299 17300 // FORMATTING 17301 17302 addFormatToken('z', 0, 0, 'zoneAbbr'); 17303 addFormatToken('zz', 0, 0, 'zoneName'); 17304 17305 // MOMENTS 17306 17307 function getZoneAbbr() { 17308 return this._isUTC ? 'UTC' : ''; 17309 } 17310 17311 function getZoneName() { 17312 return this._isUTC ? 'Coordinated Universal Time' : ''; 17313 } 17314 17315 var proto = Moment.prototype; 17316 17317 proto.add = add; 17318 proto.calendar = calendar$1; 17319 proto.clone = clone; 17320 proto.diff = diff; 17321 proto.endOf = endOf; 17322 proto.format = format; 17323 proto.from = from; 17324 proto.fromNow = fromNow; 17325 proto.to = to; 17326 proto.toNow = toNow; 17327 proto.get = stringGet; 17328 proto.invalidAt = invalidAt; 17329 proto.isAfter = isAfter; 17330 proto.isBefore = isBefore; 17331 proto.isBetween = isBetween; 17332 proto.isSame = isSame; 17333 proto.isSameOrAfter = isSameOrAfter; 17334 proto.isSameOrBefore = isSameOrBefore; 17335 proto.isValid = isValid$2; 17336 proto.lang = lang; 17337 proto.locale = locale; 17338 proto.localeData = localeData; 17339 proto.max = prototypeMax; 17340 proto.min = prototypeMin; 17341 proto.parsingFlags = parsingFlags; 17342 proto.set = stringSet; 17343 proto.startOf = startOf; 17344 proto.subtract = subtract; 17345 proto.toArray = toArray; 17346 proto.toObject = toObject; 17347 proto.toDate = toDate; 17348 proto.toISOString = toISOString; 17349 proto.inspect = inspect; 17350 if (typeof Symbol !== 'undefined' && Symbol.for != null) { 17351 proto[Symbol.for('nodejs.util.inspect.custom')] = function () { 17352 return 'Moment<' + this.format() + '>'; 17353 }; 17354 } 17355 proto.toJSON = toJSON; 17356 proto.toString = toString; 17357 proto.unix = unix; 17358 proto.valueOf = valueOf; 17359 proto.creationData = creationData; 17360 proto.eraName = getEraName; 17361 proto.eraNarrow = getEraNarrow; 17362 proto.eraAbbr = getEraAbbr; 17363 proto.eraYear = getEraYear; 17364 proto.year = getSetYear; 17365 proto.isLeapYear = getIsLeapYear; 17366 proto.weekYear = getSetWeekYear; 17367 proto.isoWeekYear = getSetISOWeekYear; 17368 proto.quarter = proto.quarters = getSetQuarter; 17369 proto.month = getSetMonth; 17370 proto.daysInMonth = getDaysInMonth; 17371 proto.week = proto.weeks = getSetWeek; 17372 proto.isoWeek = proto.isoWeeks = getSetISOWeek; 17373 proto.weeksInYear = getWeeksInYear; 17374 proto.weeksInWeekYear = getWeeksInWeekYear; 17375 proto.isoWeeksInYear = getISOWeeksInYear; 17376 proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; 17377 proto.date = getSetDayOfMonth; 17378 proto.day = proto.days = getSetDayOfWeek; 17379 proto.weekday = getSetLocaleDayOfWeek; 17380 proto.isoWeekday = getSetISODayOfWeek; 17381 proto.dayOfYear = getSetDayOfYear; 17382 proto.hour = proto.hours = getSetHour; 17383 proto.minute = proto.minutes = getSetMinute; 17384 proto.second = proto.seconds = getSetSecond; 17385 proto.millisecond = proto.milliseconds = getSetMillisecond; 17386 proto.utcOffset = getSetOffset; 17387 proto.utc = setOffsetToUTC; 17388 proto.local = setOffsetToLocal; 17389 proto.parseZone = setOffsetToParsedOffset; 17390 proto.hasAlignedHourOffset = hasAlignedHourOffset; 17391 proto.isDST = isDaylightSavingTime; 17392 proto.isLocal = isLocal; 17393 proto.isUtcOffset = isUtcOffset; 17394 proto.isUtc = isUtc; 17395 proto.isUTC = isUtc; 17396 proto.zoneAbbr = getZoneAbbr; 17397 proto.zoneName = getZoneName; 17398 proto.dates = deprecate( 17399 'dates accessor is deprecated. Use date instead.', 17400 getSetDayOfMonth 17401 ); 17402 proto.months = deprecate( 17403 'months accessor is deprecated. Use month instead', 17404 getSetMonth 17405 ); 17406 proto.years = deprecate( 17407 'years accessor is deprecated. Use year instead', 17408 getSetYear 17409 ); 17410 proto.zone = deprecate( 17411 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', 17412 getSetZone 17413 ); 17414 proto.isDSTShifted = deprecate( 17415 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', 17416 isDaylightSavingTimeShifted 17417 ); 17418 17419 function createUnix(input) { 17420 return createLocal(input * 1000); 17421 } 17422 17423 function createInZone() { 17424 return createLocal.apply(null, arguments).parseZone(); 17425 } 17426 17427 function preParsePostFormat(string) { 17428 return string; 17429 } 17430 17431 var proto$1 = Locale.prototype; 17432 17433 proto$1.calendar = calendar; 17434 proto$1.longDateFormat = longDateFormat; 17435 proto$1.invalidDate = invalidDate; 17436 proto$1.ordinal = ordinal; 17437 proto$1.preparse = preParsePostFormat; 17438 proto$1.postformat = preParsePostFormat; 17439 proto$1.relativeTime = relativeTime; 17440 proto$1.pastFuture = pastFuture; 17441 proto$1.set = set; 17442 proto$1.eras = localeEras; 17443 proto$1.erasParse = localeErasParse; 17444 proto$1.erasConvertYear = localeErasConvertYear; 17445 proto$1.erasAbbrRegex = erasAbbrRegex; 17446 proto$1.erasNameRegex = erasNameRegex; 17447 proto$1.erasNarrowRegex = erasNarrowRegex; 17448 17449 proto$1.months = localeMonths; 17450 proto$1.monthsShort = localeMonthsShort; 17451 proto$1.monthsParse = localeMonthsParse; 17452 proto$1.monthsRegex = monthsRegex; 17453 proto$1.monthsShortRegex = monthsShortRegex; 17454 proto$1.week = localeWeek; 17455 proto$1.firstDayOfYear = localeFirstDayOfYear; 17456 proto$1.firstDayOfWeek = localeFirstDayOfWeek; 17457 17458 proto$1.weekdays = localeWeekdays; 17459 proto$1.weekdaysMin = localeWeekdaysMin; 17460 proto$1.weekdaysShort = localeWeekdaysShort; 17461 proto$1.weekdaysParse = localeWeekdaysParse; 17462 17463 proto$1.weekdaysRegex = weekdaysRegex; 17464 proto$1.weekdaysShortRegex = weekdaysShortRegex; 17465 proto$1.weekdaysMinRegex = weekdaysMinRegex; 17466 17467 proto$1.isPM = localeIsPM; 17468 proto$1.meridiem = localeMeridiem; 17469 17470 function get$1(format, index, field, setter) { 17471 var locale = getLocale(), 17472 utc = createUTC().set(setter, index); 17473 return locale[field](utc, format); 17474 } 17475 17476 function listMonthsImpl(format, index, field) { 17477 if (isNumber(format)) { 17478 index = format; 17479 format = undefined; 17480 } 17481 17482 format = format || ''; 17483 17484 if (index != null) { 17485 return get$1(format, index, field, 'month'); 17486 } 17487 17488 var i, 17489 out = []; 17490 for (i = 0; i < 12; i++) { 17491 out[i] = get$1(format, i, field, 'month'); 17492 } 17493 return out; 17494 } 17495 17496 // () 17497 // (5) 17498 // (fmt, 5) 17499 // (fmt) 17500 // (true) 17501 // (true, 5) 17502 // (true, fmt, 5) 17503 // (true, fmt) 17504 function listWeekdaysImpl(localeSorted, format, index, field) { 17505 if (typeof localeSorted === 'boolean') { 17506 if (isNumber(format)) { 17507 index = format; 17508 format = undefined; 17509 } 17510 17511 format = format || ''; 17512 } else { 17513 format = localeSorted; 17514 index = format; 17515 localeSorted = false; 17516 17517 if (isNumber(format)) { 17518 index = format; 17519 format = undefined; 17520 } 17521 17522 format = format || ''; 17523 } 17524 17525 var locale = getLocale(), 17526 shift = localeSorted ? locale._week.dow : 0, 17527 i, 17528 out = []; 17529 17530 if (index != null) { 17531 return get$1(format, (index + shift) % 7, field, 'day'); 17532 } 17533 17534 for (i = 0; i < 7; i++) { 17535 out[i] = get$1(format, (i + shift) % 7, field, 'day'); 17536 } 17537 return out; 17538 } 17539 17540 function listMonths(format, index) { 17541 return listMonthsImpl(format, index, 'months'); 17542 } 17543 17544 function listMonthsShort(format, index) { 17545 return listMonthsImpl(format, index, 'monthsShort'); 17546 } 17547 17548 function listWeekdays(localeSorted, format, index) { 17549 return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); 17550 } 17551 17552 function listWeekdaysShort(localeSorted, format, index) { 17553 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); 17554 } 17555 17556 function listWeekdaysMin(localeSorted, format, index) { 17557 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); 17558 } 17559 17560 getSetGlobalLocale('en', { 17561 eras: [ 17562 { 17563 since: '0001-01-01', 17564 until: +Infinity, 17565 offset: 1, 17566 name: 'Anno Domini', 17567 narrow: 'AD', 17568 abbr: 'AD', 17569 }, 17570 { 17571 since: '0000-12-31', 17572 until: -Infinity, 17573 offset: 1, 17574 name: 'Before Christ', 17575 narrow: 'BC', 17576 abbr: 'BC', 17577 }, 17578 ], 17579 dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, 17580 ordinal: function (number) { 17581 var b = number % 10, 17582 output = 17583 toInt((number % 100) / 10) === 1 17584 ? 'th' 17585 : b === 1 17586 ? 'st' 17587 : b === 2 17588 ? 'nd' 17589 : b === 3 17590 ? 'rd' 17591 : 'th'; 17592 return number + output; 17593 }, 17594 }); 17595 17596 // Side effect imports 17597 17598 hooks.lang = deprecate( 17599 'moment.lang is deprecated. Use moment.locale instead.', 17600 getSetGlobalLocale 17601 ); 17602 hooks.langData = deprecate( 17603 'moment.langData is deprecated. Use moment.localeData instead.', 17604 getLocale 17605 ); 17606 17607 var mathAbs = Math.abs; 17608 17609 function abs() { 17610 var data = this._data; 17611 17612 this._milliseconds = mathAbs(this._milliseconds); 17613 this._days = mathAbs(this._days); 17614 this._months = mathAbs(this._months); 17615 17616 data.milliseconds = mathAbs(data.milliseconds); 17617 data.seconds = mathAbs(data.seconds); 17618 data.minutes = mathAbs(data.minutes); 17619 data.hours = mathAbs(data.hours); 17620 data.months = mathAbs(data.months); 17621 data.years = mathAbs(data.years); 17622 17623 return this; 17624 } 17625 17626 function addSubtract$1(duration, input, value, direction) { 17627 var other = createDuration(input, value); 17628 17629 duration._milliseconds += direction * other._milliseconds; 17630 duration._days += direction * other._days; 17631 duration._months += direction * other._months; 17632 17633 return duration._bubble(); 17634 } 17635 17636 // supports only 2.0-style add(1, 's') or add(duration) 17637 function add$1(input, value) { 17638 return addSubtract$1(this, input, value, 1); 17639 } 17640 17641 // supports only 2.0-style subtract(1, 's') or subtract(duration) 17642 function subtract$1(input, value) { 17643 return addSubtract$1(this, input, value, -1); 17644 } 17645 17646 function absCeil(number) { 17647 if (number < 0) { 17648 return Math.floor(number); 17649 } else { 17650 return Math.ceil(number); 17651 } 17652 } 17653 17654 function bubble() { 17655 var milliseconds = this._milliseconds, 17656 days = this._days, 17657 months = this._months, 17658 data = this._data, 17659 seconds, 17660 minutes, 17661 hours, 17662 years, 17663 monthsFromDays; 17664 17665 // if we have a mix of positive and negative values, bubble down first 17666 // check: https://github.com/moment/moment/issues/2166 17667 if ( 17668 !( 17669 (milliseconds >= 0 && days >= 0 && months >= 0) || 17670 (milliseconds <= 0 && days <= 0 && months <= 0) 17671 ) 17672 ) { 17673 milliseconds += absCeil(monthsToDays(months) + days) * 864e5; 17674 days = 0; 17675 months = 0; 17676 } 17677 17678 // The following code bubbles up values, see the tests for 17679 // examples of what that means. 17680 data.milliseconds = milliseconds % 1000; 17681 17682 seconds = absFloor(milliseconds / 1000); 17683 data.seconds = seconds % 60; 17684 17685 minutes = absFloor(seconds / 60); 17686 data.minutes = minutes % 60; 17687 17688 hours = absFloor(minutes / 60); 17689 data.hours = hours % 24; 17690 17691 days += absFloor(hours / 24); 17692 17693 // convert days to months 17694 monthsFromDays = absFloor(daysToMonths(days)); 17695 months += monthsFromDays; 17696 days -= absCeil(monthsToDays(monthsFromDays)); 17697 17698 // 12 months -> 1 year 17699 years = absFloor(months / 12); 17700 months %= 12; 17701 17702 data.days = days; 17703 data.months = months; 17704 data.years = years; 17705 17706 return this; 17707 } 17708 17709 function daysToMonths(days) { 17710 // 400 years have 146097 days (taking into account leap year rules) 17711 // 400 years have 12 months === 4800 17712 return (days * 4800) / 146097; 17713 } 17714 17715 function monthsToDays(months) { 17716 // the reverse of daysToMonths 17717 return (months * 146097) / 4800; 17718 } 17719 17720 function as(units) { 17721 if (!this.isValid()) { 17722 return NaN; 17723 } 17724 var days, 17725 months, 17726 milliseconds = this._milliseconds; 17727 17728 units = normalizeUnits(units); 17729 17730 if (units === 'month' || units === 'quarter' || units === 'year') { 17731 days = this._days + milliseconds / 864e5; 17732 months = this._months + daysToMonths(days); 17733 switch (units) { 17734 case 'month': 17735 return months; 17736 case 'quarter': 17737 return months / 3; 17738 case 'year': 17739 return months / 12; 17740 } 17741 } else { 17742 // handle milliseconds separately because of floating point math errors (issue #1867) 17743 days = this._days + Math.round(monthsToDays(this._months)); 17744 switch (units) { 17745 case 'week': 17746 return days / 7 + milliseconds / 6048e5; 17747 case 'day': 17748 return days + milliseconds / 864e5; 17749 case 'hour': 17750 return days * 24 + milliseconds / 36e5; 17751 case 'minute': 17752 return days * 1440 + milliseconds / 6e4; 17753 case 'second': 17754 return days * 86400 + milliseconds / 1000; 17755 // Math.floor prevents floating point math errors here 17756 case 'millisecond': 17757 return Math.floor(days * 864e5) + milliseconds; 17758 default: 17759 throw new Error('Unknown unit ' + units); 17760 } 17761 } 17762 } 17763 17764 // TODO: Use this.as('ms')? 17765 function valueOf$1() { 17766 if (!this.isValid()) { 17767 return NaN; 17768 } 17769 return ( 17770 this._milliseconds + 17771 this._days * 864e5 + 17772 (this._months % 12) * 2592e6 + 17773 toInt(this._months / 12) * 31536e6 17774 ); 17775 } 17776 17777 function makeAs(alias) { 17778 return function () { 17779 return this.as(alias); 17780 }; 17781 } 17782 17783 var asMilliseconds = makeAs('ms'), 17784 asSeconds = makeAs('s'), 17785 asMinutes = makeAs('m'), 17786 asHours = makeAs('h'), 17787 asDays = makeAs('d'), 17788 asWeeks = makeAs('w'), 17789 asMonths = makeAs('M'), 17790 asQuarters = makeAs('Q'), 17791 asYears = makeAs('y'); 17792 17793 function clone$1() { 17794 return createDuration(this); 17795 } 17796 17797 function get$2(units) { 17798 units = normalizeUnits(units); 17799 return this.isValid() ? this[units + 's']() : NaN; 17800 } 17801 17802 function makeGetter(name) { 17803 return function () { 17804 return this.isValid() ? this._data[name] : NaN; 17805 }; 17806 } 17807 17808 var milliseconds = makeGetter('milliseconds'), 17809 seconds = makeGetter('seconds'), 17810 minutes = makeGetter('minutes'), 17811 hours = makeGetter('hours'), 17812 days = makeGetter('days'), 17813 months = makeGetter('months'), 17814 years = makeGetter('years'); 17815 17816 function weeks() { 17817 return absFloor(this.days() / 7); 17818 } 17819 17820 var round = Math.round, 17821 thresholds = { 17822 ss: 44, // a few seconds to seconds 17823 s: 45, // seconds to minute 17824 m: 45, // minutes to hour 17825 h: 22, // hours to day 17826 d: 26, // days to month/week 17827 w: null, // weeks to month 17828 M: 11, // months to year 17829 }; 17830 17831 // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize 17832 function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { 17833 return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); 17834 } 17835 17836 function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { 17837 var duration = createDuration(posNegDuration).abs(), 17838 seconds = round(duration.as('s')), 17839 minutes = round(duration.as('m')), 17840 hours = round(duration.as('h')), 17841 days = round(duration.as('d')), 17842 months = round(duration.as('M')), 17843 weeks = round(duration.as('w')), 17844 years = round(duration.as('y')), 17845 a = 17846 (seconds <= thresholds.ss && ['s', seconds]) || 17847 (seconds < thresholds.s && ['ss', seconds]) || 17848 (minutes <= 1 && ['m']) || 17849 (minutes < thresholds.m && ['mm', minutes]) || 17850 (hours <= 1 && ['h']) || 17851 (hours < thresholds.h && ['hh', hours]) || 17852 (days <= 1 && ['d']) || 17853 (days < thresholds.d && ['dd', days]); 17854 17855 if (thresholds.w != null) { 17856 a = 17857 a || 17858 (weeks <= 1 && ['w']) || 17859 (weeks < thresholds.w && ['ww', weeks]); 17860 } 17861 a = a || 17862 (months <= 1 && ['M']) || 17863 (months < thresholds.M && ['MM', months]) || 17864 (years <= 1 && ['y']) || ['yy', years]; 17865 17866 a[2] = withoutSuffix; 17867 a[3] = +posNegDuration > 0; 17868 a[4] = locale; 17869 return substituteTimeAgo.apply(null, a); 17870 } 17871 17872 // This function allows you to set the rounding function for relative time strings 17873 function getSetRelativeTimeRounding(roundingFunction) { 17874 if (roundingFunction === undefined) { 17875 return round; 17876 } 17877 if (typeof roundingFunction === 'function') { 17878 round = roundingFunction; 17879 return true; 17880 } 17881 return false; 17882 } 17883 17884 // This function allows you to set a threshold for relative time strings 17885 function getSetRelativeTimeThreshold(threshold, limit) { 17886 if (thresholds[threshold] === undefined) { 17887 return false; 17888 } 17889 if (limit === undefined) { 17890 return thresholds[threshold]; 17891 } 17892 thresholds[threshold] = limit; 17893 if (threshold === 's') { 17894 thresholds.ss = limit - 1; 17895 } 17896 return true; 17897 } 17898 17899 function humanize(argWithSuffix, argThresholds) { 17900 if (!this.isValid()) { 17901 return this.localeData().invalidDate(); 17902 } 17903 17904 var withSuffix = false, 17905 th = thresholds, 17906 locale, 17907 output; 17908 17909 if (typeof argWithSuffix === 'object') { 17910 argThresholds = argWithSuffix; 17911 argWithSuffix = false; 17912 } 17913 if (typeof argWithSuffix === 'boolean') { 17914 withSuffix = argWithSuffix; 17915 } 17916 if (typeof argThresholds === 'object') { 17917 th = Object.assign({}, thresholds, argThresholds); 17918 if (argThresholds.s != null && argThresholds.ss == null) { 17919 th.ss = argThresholds.s - 1; 17920 } 17921 } 17922 17923 locale = this.localeData(); 17924 output = relativeTime$1(this, !withSuffix, th, locale); 17925 17926 if (withSuffix) { 17927 output = locale.pastFuture(+this, output); 17928 } 17929 17930 return locale.postformat(output); 17931 } 17932 17933 var abs$1 = Math.abs; 17934 17935 function sign(x) { 17936 return (x > 0) - (x < 0) || +x; 17937 } 17938 17939 function toISOString$1() { 17940 // for ISO strings we do not use the normal bubbling rules: 17941 // * milliseconds bubble up until they become hours 17942 // * days do not bubble at all 17943 // * months bubble up until they become years 17944 // This is because there is no context-free conversion between hours and days 17945 // (think of clock changes) 17946 // and also not between days and months (28-31 days per month) 17947 if (!this.isValid()) { 17948 return this.localeData().invalidDate(); 17949 } 17950 17951 var seconds = abs$1(this._milliseconds) / 1000, 17952 days = abs$1(this._days), 17953 months = abs$1(this._months), 17954 minutes, 17955 hours, 17956 years, 17957 s, 17958 total = this.asSeconds(), 17959 totalSign, 17960 ymSign, 17961 daysSign, 17962 hmsSign; 17963 17964 if (!total) { 17965 // this is the same as C#'s (Noda) and python (isodate)... 17966 // but not other JS (goog.date) 17967 return 'P0D'; 17968 } 17969 17970 // 3600 seconds -> 60 minutes -> 1 hour 17971 minutes = absFloor(seconds / 60); 17972 hours = absFloor(minutes / 60); 17973 seconds %= 60; 17974 minutes %= 60; 17975 17976 // 12 months -> 1 year 17977 years = absFloor(months / 12); 17978 months %= 12; 17979 17980 // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js 17981 s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; 17982 17983 totalSign = total < 0 ? '-' : ''; 17984 ymSign = sign(this._months) !== sign(total) ? '-' : ''; 17985 daysSign = sign(this._days) !== sign(total) ? '-' : ''; 17986 hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; 17987 17988 return ( 17989 totalSign + 17990 'P' + 17991 (years ? ymSign + years + 'Y' : '') + 17992 (months ? ymSign + months + 'M' : '') + 17993 (days ? daysSign + days + 'D' : '') + 17994 (hours || minutes || seconds ? 'T' : '') + 17995 (hours ? hmsSign + hours + 'H' : '') + 17996 (minutes ? hmsSign + minutes + 'M' : '') + 17997 (seconds ? hmsSign + s + 'S' : '') 17998 ); 17999 } 18000 18001 var proto$2 = Duration.prototype; 18002 18003 proto$2.isValid = isValid$1; 18004 proto$2.abs = abs; 18005 proto$2.add = add$1; 18006 proto$2.subtract = subtract$1; 18007 proto$2.as = as; 18008 proto$2.asMilliseconds = asMilliseconds; 18009 proto$2.asSeconds = asSeconds; 18010 proto$2.asMinutes = asMinutes; 18011 proto$2.asHours = asHours; 18012 proto$2.asDays = asDays; 18013 proto$2.asWeeks = asWeeks; 18014 proto$2.asMonths = asMonths; 18015 proto$2.asQuarters = asQuarters; 18016 proto$2.asYears = asYears; 18017 proto$2.valueOf = valueOf$1; 18018 proto$2._bubble = bubble; 18019 proto$2.clone = clone$1; 18020 proto$2.get = get$2; 18021 proto$2.milliseconds = milliseconds; 18022 proto$2.seconds = seconds; 18023 proto$2.minutes = minutes; 18024 proto$2.hours = hours; 18025 proto$2.days = days; 18026 proto$2.weeks = weeks; 18027 proto$2.months = months; 18028 proto$2.years = years; 18029 proto$2.humanize = humanize; 18030 proto$2.toISOString = toISOString$1; 18031 proto$2.toString = toISOString$1; 18032 proto$2.toJSON = toISOString$1; 18033 proto$2.locale = locale; 18034 proto$2.localeData = localeData; 18035 18036 proto$2.toIsoString = deprecate( 18037 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', 18038 toISOString$1 18039 ); 18040 proto$2.lang = lang; 18041 18042 // FORMATTING 18043 18044 addFormatToken('X', 0, 0, 'unix'); 18045 addFormatToken('x', 0, 0, 'valueOf'); 18046 18047 // PARSING 18048 18049 addRegexToken('x', matchSigned); 18050 addRegexToken('X', matchTimestamp); 18051 addParseToken('X', function (input, array, config) { 18052 config._d = new Date(parseFloat(input) * 1000); 18053 }); 18054 addParseToken('x', function (input, array, config) { 18055 config._d = new Date(toInt(input)); 18056 }); 18057 18058 //! moment.js 18059 18060 hooks.version = '2.2
180609.4'; 18061 18062 setHookCallback(createLocal); 18063 18064 hooks.fn = proto; 18065 hooks.min = min; 18066 hooks.max = max; 18067 hooks.now = now; 18068 hooks.utc = createUTC; 18069 hooks.unix = createUnix; 18070 hooks.months = listMonths; 18071 hooks.isDate = isDate; 18072 hooks.locale = getSetGlobalLocale; 18073 hooks.invalid = createInvalid; 18074 hooks.duration = createDuration; 18075 hooks.isMoment = isMoment; 18076 hooks.weekdays = listWeekdays; 18077 hooks.parseZone = createInZone; 18078 hooks.localeData = getLocale; 18079 hooks.isDuration = isDuration; 18080 hooks.monthsShort = listMonthsShort; 18081 hooks.weekdaysMin = listWeekdaysMin; 18082 hooks.defineLocale = defineLocale; 18083 hooks.updateLocale = updateLocale; 18084 hooks.locales = listLocales; 18085 hooks.weekdaysShort = listWeekdaysShort; 18086 hooks.normalizeUnits = normalizeUnits; 18087 hooks.relativeTimeRounding = getSetRelativeTimeRounding; 18088 hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; 18089 hooks.calendarFormat = getCalendarFormat; 18090 hooks.prototype = proto; 18091 18092 // currently HTML5 input type only supports 24-hour formats 18093 hooks.HTML5_FMT = { 18094 DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" /> 18095 DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" /> 18096 DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" /> 18097 DATE: 'YYYY-MM-DD', // <input type="date" /> 18098 TIME: 'HH:mm', // <input type="time" /> 18099 TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" /> 18100 TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" /> 18101 WEEK: 'GGGG-[W]WW', // <input type="week" /> 18102 MONTH: 'YYYY-MM', // <input type="month" /> 18103 }; 18104 18105 return hooks; 18106 18107}))); 18108 18109/* 18110 * ADOBE CONFIDENTIAL 18111 * 18112 * Copyright 2017 Adobe Systems Incorporated 18113 * All Rights Reserved. 18114 *
18115 * NOTICE: All information contained herein is, and remains 18116 * the property of Adobe Systems Incorporated and its suppliers, 18117 * if any. The intellectual and technical concepts contained 18118 * herein are proprietary to Adobe Systems Incorporated and its 18119 * suppliers and may be covered by U.S. and Foreign Patents, 18120 * patents in process, and are protected by trade secret or copyright law. 18121 * Dissemination of this information or reproduction of this material 18122 * is strictly forbidden unless prior written permission is obtained 18123 * from Adobe Systems Incorporated. 18124 * 18125 */ 18126(function(root, factory) { 18127 "use strict"; 18128 18129 if (typeof module === "object" && module.exports) { 18130 module.exports = factory(require("moment")); 18131 } else { 18132 factory(root.moment); 18133 } 18134}(this, function(moment) { 18135 "use strict"; 18136 18137 function normalizeType(type) { 18138 switch (type) { 18139 case "date": 18140 case "time": 18141 case "datetime": 18142 return type; 18143 default: 18144 return "date"; 18145 } 18146 } 18147 18148 function normalizeFormat(format) { 18149 switch (format) { 18150 case "short": 18151 case "medium": 18152 case "long": 18153 case "full": 18154 return format; 18155 default: 18156 return "medium"; 18157 } 18158 } 18159 18160 moment.fn.formatWithPreset = function(type, format) { 18161 var localeData = this.localeData(); 18162 var actualFormat = localeData._presets[normalizeType(type)][normalizeFormat(format)]; 18163 18164 if (typeof actualFormat === "function") { 18165 actualFormat = actualFormat(this); 18166 } 18167 18168 return this.format(actualFormat); 18169 }; 18170 18171 return moment; 18172})); 18173 18174//! moment.js locale configuration 18175 18176;(function (global, factory) { 18177 typeof exports === 'object' && typeof module !== 'undefined' 18178 && typeof require === 'function' ? factory(require('../moment')) : 18179 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 18180 factory(global.moment) 18181}(this, (function (moment) { 'use strict'; 18182 18183 18184 function processRelativeTime$2(number, withoutSuffix, key, isFuture) { 18185 var format = { 18186 m: ['eine Minute', 'einer Minute'], 18187 h: ['eine Stunde', 'einer Stunde'], 18188 d: ['ein Tag', 'einem Tag'], 18189 dd: [number + ' Tage', number + ' Tagen'], 18190 w: ['eine Woche', 'einer Woche'], 18191 M: ['ein Monat', 'einem Monat'], 18192 MM: [number + ' Monate', number + ' Monaten'], 18193 y: ['ein Jahr', 'einem Jahr'], 18194 yy: [number + ' Jahre', number + ' Jahren'], 18195 }; 18196 return withoutSuffix ? format[key][0] : format[key][1]; 18197 } 18198 18199 var de = moment.defineLocale('de', { 18200 months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), 18201 monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'), 18202 monthsParseExact : true, 18203 weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), 18204 weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), 18205 weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), 18206 weekdaysParseExact : true, 18207 longDateFormat : { 18208 LT: 'HH:mm', 18209 LTS: 'HH:mm:ss', 18210 L : 'DD.MM.YYYY', 18211 LL : 'D. MMMM YYYY', 18212 LLL : 'D. MMMM YYYY HH:mm', 18213 LLLL : 'dddd, D. MMMM YYYY HH:mm' 18214 }, 18215 calendar : { 18216 sameDay: '[heute um] LT [Uhr]', 18217 sameElse: 'L', 18218 nextDay: '[morgen um] LT [Uhr]', 18219 nextWeek: 'dddd [um] LT [Uhr]', 18220 lastDay: '[gestern um] LT [Uhr]', 18221 lastWeek: '[letzten] dddd [um] LT [Uhr]' 18222 }, 18223 relativeTime : { 18224 future: 'in %s', 18225 past: 'vor %s', 18226 s: 'ein paar Sekunden', 18227 ss: '%d Sekunden', 18228 m: processRelativeTime$2, 18229 mm: '%d Minuten', 18230 h: processRelativeTime$2, 18231 hh: '%d Stunden', 18232 d: processRelativeTime$2, 18233 dd: processRelativeTime$2, 18234 w: processRelativeTime$2, 18235 ww: '%d Wochen', 18236 M: processRelativeTime$2, 18237 MM: processRelativeTime$2, 18238 y: processRelativeTime$2, 18239 yy: processRelativeTime$2, 18240 }, 18241 dayOfMonthOrdinalParse: /\d{1,2}\./, 18242 ordinal : '%d.', 18243 week : { 18244 dow : 1, // Monday is the first day of the week. 18245 doy : 4 // The week that contains Jan 4th is the first week of the year. 18246 } 18247 }); 18248 18249 return de; 18250 18251}))); 18252 18253//! moment.js locale configuration 18254 18255;(function (global, factory) { 18256 typeof exports === 'object' && typeof module !== 'undefined' 18257 && typeof require === 'function' ? factory(require('../moment')) : 18258 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 18259 factory(global.moment) 18260}(this, (function (moment) { 'use strict'; 18261 18262 18263 var monthsShortDot$3 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), 18264 monthsShort$4 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); 18265 18266 var monthsParse$5 = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i]; 18267 var monthsRegex$6 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; 18268 18269 var es = moment.defineLocale('es', { 18270 months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( 18271 '_' 18272 ), 18273 monthsShort: function (m, format) { 18274 if (!m) { 18275 return monthsShortDot$3; 18276 } else if (/-MMM-/.test(format)) { 18277 return monthsShort$4[m.month()]; 18278 } else { 18279 return monthsShortDot$3[m.month()]; 18280 } 18281 }, 18282 monthsRegex: monthsRegex$6, 18283 monthsShortRegex: monthsRegex$6, 18284 monthsStrictRegex: 18285 /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, 18286 monthsShortStrictRegex: 18287 /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, 18288 monthsParse: monthsParse$5, 18289 longMonthsParse: monthsParse$5, 18290 shortMonthsParse: monthsParse$5, 18291 weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), 18292 weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), 18293 weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), 18294 weekdaysParseExact: true, 18295 longDateFormat: { 18296 LT: 'H:mm', 18297 LTS: 'H:mm:ss', 18298 L: 'DD/MM/YYYY', 18299 LL: 'D [de] MMMM [de] YYYY', 18300 LLL: 'D [de] MMMM [de] YYYY H:mm', 18301 LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm', 18302 }, 18303 calendar: { 18304 sameDay: function () { 18305 return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; 18306 }, 18307 nextDay: function () { 18308 return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; 18309 }, 18310 nextWeek: function () { 18311 return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; 18312 }, 18313 lastDay: function () { 18314 return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; 18315 }, 18316 lastWeek: function () { 18317 return ( 18318 '[el] dddd [pasado a la' + 18319 (this.hours() !== 1 ? 's' : '') + 18320 '] LT' 18321 ); 18322 }, 18323 sameElse: 'L', 18324 }, 18325 relativeTime: { 18326 future: 'en %s', 18327 past: 'hace %s', 18328 s: 'unos segundos', 18329 ss: '%d segundos', 18330 m: 'un minuto', 18331 mm: '%d minutos', 18332 h: 'una hora', 18333 hh: '%d horas', 18334 d: 'un dÃa', 18335 dd: '%d dÃas', 18336 w: 'una semana', 18337 ww: '%d semanas', 18338 M: 'un mes', 18339 MM: '%d meses', 18340 y: 'un año', 18341 yy: '%d años', 18342 }, 18343 dayOfMonthOrdinalParse: /\d{1,2}º/, 18344 ordinal: '%dº', 18345 week: { 18346 dow: 1, // Monday is the first day of the week. 18347 doy: 4, // The week that contains Jan 4th is the first week of the year. 18348 }, 18349 invalidDate: 'Fecha inválida', 18350 }); 18351 return es; 18352}))); 18353 18354//! moment.js locale configuration 18355 18356;(function (global, factory) { 18357 typeof exports === 'object' && typeof module !== 'undefined' 18358 && typeof require === 'function' ? factory(require('../moment')) : 18359 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 18360 factory(global.moment) 18361}(this, (function (moment) { 'use strict'; 18362 18363 var monthsStrictRegex$1 = 18364 /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, 18365 monthsShortStrictRegex$1 = 18366 /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,
18367 monthsRegex$7 = 18368 /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, 18369 monthsParse$6 = [ 18370 /^janv/i, 18371 /^févr/i, 18372 /^mars/i, 18373 /^avr/i, 18374 /^mai/i, 18375 /^juin/i, 18376 /^juil/i, 18377 /^août/i, 18378 /^sept/i, 18379 /^oct/i, 18380 /^nov/i, 18381 /^déc/i, 18382 ]; 18383 18384 var fr = moment.defineLocale('fr', { 18385 months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split( 18386 '_' 18387 ), 18388 monthsShort: 18389 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split( 18390 '_' 18391 ), 18392 monthsRegex: monthsRegex$7, 18393 monthsShortRegex: monthsRegex$7, 18394 monthsStrictRegex: monthsStrictRegex$1, 18395 monthsShortStrictRegex: monthsShortStrictRegex$1, 18396 monthsParse: monthsParse$6, 18397 longMonthsParse: monthsParse$6, 18398 shortMonthsParse: monthsParse$6, 18399 weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), 18400 weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), 18401 weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), 18402 weekdaysParseExact: true, 18403 longDateFormat: { 18404 LT: 'HH:mm', 18405 LTS: 'HH:mm:ss', 18406 L: 'DD/MM/YYYY', 18407 LL: 'D MMMM YYYY', 18408 LLL: 'D MMMM YYYY HH:mm', 18409 LLLL: 'dddd D MMMM YYYY HH:mm', 18410 }, 18411 calendar: { 18412 sameDay: '[Aujourdâhui à ] LT', 18413 nextDay: '[Demain à ] LT', 18414 nextWeek: 'dddd [à ] LT', 18415 lastDay: '[Hier à ] LT', 18416 lastWeek: 'dddd [dernier à ] LT', 18417 sameElse: 'L', 18418 }, 18419 relativeTime: { 18420 future: 'dans %s', 18421 past: 'il y a %s', 18422 s: 'quelques secondes', 18423 ss: '%d secondes', 18424 m: 'une minute', 18425 mm: '%d minutes', 18426 h: 'une heure', 18427 hh: '%d heures', 18428 d: 'un jour', 18429 dd: '%d jours', 18430 w: 'une semaine', 18431 ww: '%d semaines', 18432 M: 'un mois', 18433 MM: '%d mois', 18434 y: 'un an', 18435 yy: '%d ans', 18436 }, 18437 dayOfMonthOrdinalParse: /\d{1,2}(er|)/, 18438 ordinal: function (number, period) { 18439 switch (period) { 18440 // TODO: Return 'e' when day of month > 1. Move this case inside 18441 // block for masculine words below. 18442 // See https://github.com/moment/moment/issues/3375 18443 case 'D': 18444 return number + (number === 1 ? 'er' : ''); 18445 18446 // Words with masculine grammatical gender: mois, trimestre, jour 18447 default: 18448 case 'M': 18449 case 'Q': 18450 case 'DDD': 18451 case 'd': 18452 return number + (number === 1 ? 'er' : 'e'); 18453 18454 // Words with feminine grammatical gender: semaine 18455 case 'w': 18456 case 'W': 18457 return number + (number === 1 ? 're' : 'e'); 18458 } 18459 }, 18460 week: { 18461 dow: 1, // Monday is the first day of the week. 18462 doy: 4, // The week that contains Jan 4th is the first week of the year. 18463 }, 18464 }); 18465 18466 return fr; 18467 18468}))); 18469 18470//! moment.js locale configuration 18471 18472;(function (global, factory) { 18473 typeof exports === 'object' && typeof module !== 'undefined' 18474 && typeof require === 'function' ? factory(require('../moment')) : 18475 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 18476 factory(global.moment) 18477}(this, (function (moment) { 'use strict'; 18478 18479 18480 var it = moment.defineLocale('it', { 18481 months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split( 18482 '_' 18483 ), 18484 monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), 18485 weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split( 18486 '_' 18487 ), 18488 weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'), 18489 weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'), 18490 longDateFormat: { 18491 LT: 'HH:mm', 18492 LTS: 'HH:mm:ss', 18493 L: 'DD/MM/YYYY', 18494 LL: 'D MMMM YYYY', 18495 LLL: 'D MMMM YYYY HH:mm', 18496 LLLL: 'dddd D MMMM YYYY HH:mm', 18497 }, 18498 calendar: { 18499 sameDay: function () { 18500 return ( 18501 '[Oggi a' + 18502 (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + 18503 ']LT' 18504 ); 18505 }, 18506 nextDay: function () { 18507 return ( 18508 '[Domani a' + 18509 (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + 18510 ']LT' 18511 ); 18512 }, 18513 nextWeek: function () { 18514 return ( 18515 'dddd [a' + 18516 (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + 18517 ']LT' 18518 ); 18519 }, 18520 lastDay: function () { 18521 return ( 18522 '[Ieri a' + 18523 (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + 18524 ']LT' 18525 ); 18526 }, 18527 lastWeek: function () { 18528 switch (this.day()) { 18529 case 0: 18530 return ( 18531 '[La scorsa] dddd [a' + 18532 (this.hours() > 1 18533 ? 'lle ' 18534 : this.hours() === 0 18535 ? ' ' 18536 : "ll'") + 18537 ']LT' 18538 ); 18539 default: 18540 return ( 18541 '[Lo scorso] dddd [a' + 18542 (this.hours() > 1 18543 ? 'lle ' 18544 : this.hours() === 0 18545 ? ' ' 18546 : "ll'") + 18547 ']LT' 18548 ); 18549 } 18550 }, 18551 sameElse: 'L', 18552 }, 18553 relativeTime: { 18554 future: 'tra %s', 18555 past: '%s fa', 18556 s: 'alcuni secondi', 18557 ss: '%d secondi', 18558 m: 'un minuto', 18559 mm: '%d minuti', 18560 h: "un'ora", 18561 hh: '%d ore', 18562 d: 'un giorno', 18563 dd: '%d giorni', 18564 w: 'una settimana', 18565 ww: '%d settimane', 18566 M: 'un mese', 18567 MM: '%d mesi', 18568 y: 'un anno', 18569 yy: '%d anni', 18570 }, 18571 dayOfMonthOrdinalParse: /\d{1,2}º/, 18572 ordinal: '%dº', 18573 week: { 18574 dow: 1, // Monday is the first day of the week. 18575 doy: 4, // The week that contains Jan 4th is the first week of the year. 18576 }, 18577 }); 18578 18579 return it; 18580 18581}))); 18582 18583//! moment.js locale configuration 18584 18585;(function (global, factory) { 18586 typeof exports === 'object' && typeof module !== 'undefined' 18587 && typeof require === 'function' ? factory(require('../moment')) : 18588 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 18589 factory(global.moment) 18590}(this, (function (moment) { 'use strict'; 18591 18592 18593 var ptBr = moment.defineLocale('pt-br', { 18594 months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split( 18595 '_' 18596 ), 18597 monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'), 18598 weekdays: 18599 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split( 18600 '_' 18601 ), 18602 weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'), 18603 weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'), 18604 weekdaysParseExact: true, 18605 longDateFormat: { 18606 LT: 'HH:mm', 18607 LTS: 'HH:mm:ss', 18608 L: 'DD/MM/YYYY', 18609 LL: 'D [de] MMMM [de] YYYY', 18610 LLL: 'D [de] MMMM [de] YYYY [à s] HH:mm', 18611 LLLL: 'dddd, D [de] MMMM [de] YYYY [à s] HH:mm', 18612 }, 18613 calendar: { 18614 sameDay: '[Hoje à s] LT', 18615 nextDay: '[Amanhã à s] LT', 18616 nextWeek: 'dddd [à s] LT', 18617 lastDay: '[Ontem à s] LT', 18618 lastWeek: function () { 18619 return this.day() === 0 || this.day() === 6 18620 ? '[Ãltimo] dddd [à s] LT' // Saturday + Sunday 18621 : '[Ãltima] dddd [à s] LT'; // Monday - Friday 18622 }, 18623 sameElse: 'L', 18624 }, 18625 relativeTime: { 18626 future: 'em %s', 18627 past: 'há %s', 18628 s: 'poucos segundos', 18629 ss: '%d segundos', 18630 m: 'um minuto', 18631 mm: '%d minutos', 18632 h: 'uma hora', 18633 hh: '%d horas', 18634 d: 'um dia', 18635 dd: '%d dias', 18636 M: 'um mês', 18637 MM: '%d meses', 18638 y: 'um ano', 18639 yy: '%d anos', 18640 }, 18641 dayOfMonthOrdinalParse: /\d{1,2}º/, 18642 ordinal: '%dº', 18643 invalidDate: 'Data inválida', 18644 }); 18645 18646 return ptBr; 18647 18648}))); 18649 18650//! moment.js locale configuration 18651 18652;(function (global, factory) { 18653 typeof exports === 'object' && typeof module !== 'undefined' 18654 && typeof require === 'function' ? factory(require('../moment')) : 18655 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 18656 factory(global.moment) 18657}(this, (function (moment) { 'use strict'; 18658 18659 18660 var zhCn = moment.defineLocale('zh-cn', { 18661 months: '䏿_äºæ_䏿_åæ_äºæ_å æ_䏿_å «æ_乿_åæ_å䏿_åäºæ'.split( 18662 '_' 18663 ), 18664 monthsShort: '1æ_2æ_3æ_4æ_5æ_6æ_7æ_8æ_9æ_10æ_11æ_12æ'.split( 18665 '_' 18666 ), 18667 weekdays: 'æææ¥_ææä¸_ææäº_ææä¸_ææå_ææäº_ææå '.split('_'), 18668 weekdaysShort: '卿¥_å¨ä¸_å¨äº_å¨ä¸_å¨å_å¨äº_å¨å '.split('_'), 18669 weekdaysMin: 'æ¥_ä¸_äº_ä¸_å_äº_å '.split('_'), 18670 longDateFormat: { 18671 LT: 'HH:mm', 18672 LTS: 'HH:mm:ss', 18673 L: 'YYYY/MM/DD', 18674 LL: 'YYYYå¹´MæDæ¥', 18675 LLL: 'YYYYå¹´MæDæ¥Ahç¹mmå', 18676 LLLL: 'YYYYå¹´MæDæ¥ddddAhç¹mmå', 18677 l: 'YYYY/M/D', 18678 ll: 'YYYYå¹´MæDæ¥', 18679 lll: 'YYYYå¹´MæDæ¥ HH:mm', 18680 llll: 'YYYYå¹´MæDæ¥dddd HH:mm', 18681 }, 18682 meridiemParse: /忍|æ©ä¸|ä¸å|ä¸å|ä¸å|æä¸/, 18683 meridiemHour: function (hour, meridiem) { 18684 if (hour === 12) { 18685 hour = 0; 18686 } 18687 if (meridiem === '忍' || meridiem === 'æ©ä¸' || meridiem === 'ä¸å') { 18688 return hour; 18689 } else if (meridiem === 'ä¸å' || meridiem === 'æä¸') { 18690 return hour + 12; 18691 } else { 18692 // 'ä¸å' 18693 return hour >= 11 ? hour : hour + 12; 18694 } 18695 }, 18696 meridiem: function (hour, minute, isLower) { 18697 var hm = hour * 100 + minute; 18698 if (hm < 600) { 18699 return '忍'; 18700 } else if (hm < 900) { 18701 return 'æ©ä¸'; 18702 } else if (hm < 1130) { 18703 return 'ä¸å'; 18704 } else if (hm < 1230) { 18705 return 'ä¸å'; 18706 } else if (hm < 1800) { 18707 return 'ä¸å'; 18708 } else { 18709 return 'æä¸'; 18710 } 18711 }, 18712 calendar: { 18713 sameDay: '[ä»å¤©]LT', 18714 nextDay: '[æå¤©]LT', 18715 nextWeek: function (now) { 18716 if (now.week() !== this.week()) { 18717 return '[ä¸]dddLT'; 18718 } else { 18719 return '[æ¬]dddLT'; 18720 } 18721 }, 18722 lastDay: '[æ¨å¤©]LT', 18723 lastWeek: function (now) { 18724 if (this.week() !== now.week()) { 18725 return '[ä¸]dddLT'; 18726 } else { 18727 return '[æ¬]dddLT'; 18728 } 18729 }, 18730 sameElse: 'L', 18731 }, 18732 dayOfMonthOrdinalParse: /\d{1,2}(æ¥|æ|å¨)/, 18733 ordinal: function (number, period) { 18734 switch (period) { 18735 case 'd': 18736 case 'D': 18737 case 'DDD': 18738 return number + 'æ¥'; 18739 case 'M': 18740 return number + 'æ'; 18741 case 'w': 18742 case 'W': 18743 return number + 'å¨'; 18744 default: 18745 return number; 18746 } 18747 }, 18748 relativeTime: { 18749 future: '%så', 18750 past: '%så', 18751 s: 'å ç§', 18752 ss: '%d ç§', 18753 m: '1 åé', 18754 mm: '%d åé', 18755 h: '1 å°æ¶', 18756 hh: '%d å°æ¶', 18757 d: '1 天', 18758 dd: '%d 天', 18759 w: '1 å¨', 18760 ww: '%d å¨', 18761 M: '1 个æ', 18762 MM: '%d 个æ', 18763 y: '1 å¹´', 18764 yy: '%d å¹´', 18765 }, 18766 week: { 18767 // GB/T 7408-1994ãæ°æ®å åäº¤æ¢æ ¼å¼Â·ä¿¡æ¯äº¤æ¢Â·æ¥æåæ¶é´è¡¨ç¤ºæ³ãä¸ISO 8601:1988çæ 18768 dow: 1, // Monday is the first day of the week. 18769 doy: 4, // The week that contains Jan 4th is the first week of the year. 18770 }, 18771 }); 18772 18773 return zhCn; 18774 18775}))); 18776 18777//! moment.js locale configuration 18778 18779;(function (global, factory) { 18780 typeof exports === 'object' && typeof module !== 'undefined' 18781 && typeof require === 'function' ? factory(require('../moment')) : 18782 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 18783 factory(global.moment) 18784}(this, (function (moment) { 'use strict'; 18785 18786 18787 var zhTw = moment.defineLocale('zh-tw', { 18788 months: '䏿_äºæ_䏿_åæ_äºæ_å æ_䏿_å «æ_乿_åæ_å䏿_åäºæ'.split( 18789 '_' 18790 ), 18791 monthsShort: '1æ_2æ_3æ_4æ_5æ_6æ_7æ_8æ_9æ_10æ_11æ_12æ'.split( 18792 '_' 18793 ), 18794 weekdays: 'æææ¥_ææä¸_ææäº_ææä¸_ææå_ææäº_ææå '.split('_'), 18795 weekdaysShort: '鱿¥_é±ä¸_é±äº_é±ä¸_é±å_é±äº_é±å '.split('_'), 18796 weekdaysMin: 'æ¥_ä¸_äº_ä¸_å_äº_å '.split('_'), 18797 longDateFormat: { 18798 LT: 'HH:mm', 18799 LTS: 'HH:mm:ss', 18800 L: 'YYYY/MM/DD', 18801 LL: 'YYYYå¹´MæDæ¥', 18802 LLL: 'YYYYå¹´MæDæ¥ HH:mm', 18803 LLLL: 'YYYYå¹´MæDæ¥dddd HH:mm', 18804 l: 'YYYY/M/D', 18805 ll: 'YYYYå¹´MæDæ¥', 18806 lll: 'YYYYå¹´MæDæ¥ HH:mm', 18807 llll: 'YYYYå¹´MæDæ¥dddd HH:mm', 18808 }, 18809 meridiemParse: /忍|æ©ä¸|ä¸å|ä¸å|ä¸å|æä¸/, 18810 meridiemHour: function (hour, meridiem) { 18811 if (hour === 12) { 18812 hour = 0; 18813 } 18814 if (meridiem === '忍' || meridiem === 'æ©ä¸' || meridiem === 'ä¸å') { 18815 return hour; 18816 } else if (meridiem === 'ä¸å') { 18817 return hour >= 11 ? hour : hour + 12; 18818 } else if (meridiem === 'ä¸å' || meridiem === 'æä¸') { 18819 return hour + 12; 18820 } 18821 }, 18822 meridiem: function (hour, minute, isLower) { 18823 var hm = hour * 100 + minute; 18824 if (hm < 600) { 18825 return '忍'; 18826 } else if (hm < 900) { 18827 return 'æ©ä¸'; 18828 } else if (hm < 1130) { 18829 return 'ä¸å'; 18830 } else if (hm < 1230) { 18831 return 'ä¸å'; 18832 } else if (hm < 1800) { 18833 return 'ä¸å'; 18834 } else { 18835 return 'æä¸'; 18836 } 18837 }, 18838 calendar: { 18839 sameDay: '[ä»å¤©] LT', 18840 nextDay: '[æå¤©] LT', 18841 nextWeek: '[ä¸]dddd LT', 18842 lastDay: '[æ¨å¤©] LT', 18843 lastWeek: '[ä¸]dddd LT', 18844 sameElse: 'L
vendor: 5,442 bytes, lines 18844-19024
18844', 18845 }, 18846 dayOfMonthOrdinalParse: /\d{1,2}(æ¥|æ|é±)/, 18847 ordinal: function (number, period) { 18848 switch (period) { 18849 case 'd': 18850 case 'D': 18851 case 'DDD': 18852 return number + 'æ¥'; 18853 case 'M': 18854 return number + 'æ'; 18855 case 'w': 18856 case 'W': 18857 return number + 'é±'; 18858 default: 18859 return number; 18860 } 18861 }, 18862 relativeTime: { 18863 future: '%så¾', 18864 past: '%så', 18865 s: 'å¹¾ç§', 18866 ss: '%d ç§', 18867 m: '1 åé', 18868 mm: '%d åé', 18869 h: '1 å°æ', 18870 hh: '%d å°æ', 18871 d: '1 天', 18872 dd: '%d 天', 18873 M: '1 åæ', 18874 MM: '%d åæ', 18875 y: '1 å¹´', 18876 yy: '%d å¹´', 18877 }, 18878 }); 18879 18880 return zhTw; 18881 18882}))); 18883 18884//! moment.js locale configuration 18885 18886;(function (global, factory) { 18887 typeof exports === 'object' && typeof module !== 'undefined' 18888 && typeof require === 'function' ? factory(require('../moment')) : 18889 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 18890 factory(global.moment) 18891}(this, (function (moment) { 'use strict'; 18892 18893 18894 var ja = moment.defineLocale('ja', { 18895 eras: [ 18896 { 18897 since: '2019-05-01', 18898 offset: 1, 18899 name: '令å', 18900 narrow: 'ã¿', 18901 abbr: 'R', 18902 }, 18903 { 18904 since: '1989-01-08', 18905 until: '2019-04-30', 18906 offset: 1, 18907 name: 'å¹³æ', 18908 narrow: 'ã»', 18909 abbr: 'H', 18910 }, 18911 { 18912 since: '1926-12-25', 18913 until: '1989-01-07', 18914 offset: 1, 18915 name: 'æå', 18916 narrow: 'ã¼', 18917 abbr: 'S', 18918 }, 18919 { 18920 since: '1912-07-30', 18921 until: '1926-12-24', 18922 offset: 1, 18923 name: '大æ£', 18924 narrow: 'ã½', 18925 abbr: 'T', 18926 }, 18927 { 18928 since: '1873-01-01', 18929 until: '1912-07-29', 18930 offset: 6, 18931 name: 'ææ²»', 18932 narrow: 'ã¾', 18933 abbr: 'M', 18934 }, 18935 { 18936 since: '0001-01-01', 18937 until: '1873-12-31', 18938 offset: 1, 18939 name: '西æ¦', 18940 narrow: 'AD', 18941 abbr: 'AD', 18942 }, 18943 { 18944 since: '0000-12-31', 18945 until: -Infinity, 18946 offset: 1, 18947 name: 'ç´å å', 18948 narrow: 'BC', 18949 abbr: 'BC', 18950 }, 18951 ], 18952 eraYearOrdinalRegex: /(å |\d+)å¹´/, 18953 eraYearOrdinalParse: function (input, match) { 18954 return match[1] === 'å ' ? 1 : parseInt(match[1] || input, 10); 18955 }, 18956 months: '1æ_2æ_3æ_4æ_5æ_6æ_7æ_8æ_9æ_10æ_11æ_12æ'.split('_'), 18957 monthsShort: '1æ_2æ_3æ_4æ_5æ_6æ_7æ_8æ_9æ_10æ_11æ_12æ'.split( 18958 '_' 18959 ), 18960 weekdays: 'æ¥ææ¥_æææ¥_ç«ææ¥_æ°´ææ¥_æ¨ææ¥_éææ¥_åææ¥'.split('_'), 18961 weekdaysShort: 'æ¥_æ_ç«_æ°´_æ¨_é_å'.split('_'), 18962 weekdaysMin: 'æ¥_æ_ç«_æ°´_æ¨_é_å'.split('_'), 18963 longDateFormat: { 18964 LT: 'HH:mm', 18965 LTS: 'HH:mm:ss', 18966 L: 'YYYY/MM/DD', 18967 LL: 'YYYYå¹´MæDæ¥', 18968 LLL: 'YYYYå¹´MæDæ¥ HH:mm', 18969 LLLL: 'YYYYå¹´MæDæ¥ dddd HH:mm', 18970 l: 'YYYY/MM/DD', 18971 ll: 'YYYYå¹´MæDæ¥', 18972 lll: 'YYYYå¹´MæDæ¥ HH:mm', 18973 llll: 'YYYYå¹´MæDæ¥(ddd) HH:mm', 18974 }, 18975 meridiemParse: /åå|åå¾/i, 18976 isPM: function (input) { 18977 return input === 'åå¾'; 18978 }, 18979 meridiem: function (hour, minute, isLower) { 18980 if (hour < 12) { 18981 return 'åå'; 18982 } else { 18983 return 'åå¾'; 18984 } 18985 }, 18986 calendar: { 18987 sameDay: '[仿¥] LT', 18988 nextDay: '[ææ¥] LT', 18989 nextWeek: function (now) { 18990 if (now.week() !== this.week()) { 18991 return '[æ¥é±]dddd LT'; 18992 } else { 18993 return 'dddd LT'; 18994 } 18995 }, 18996 lastDay: '[æ¨æ¥] LT', 18997 lastWeek: function (now) { 18998 if (this.week() !== now.week()) { 18999 return '[å é±]dddd LT'; 19000 } else { 19001 return 'dddd LT'; 19002 } 19003 }, 19004 sameElse: 'L', 19005 }, 19006 dayOfMonthOrdinalParse: /\d{1,2}æ¥/, 19007 ordinal: function (number, period) { 19008 switch (period) { 19009 case 'y': 19010 return number === 1 ? 'å å¹´' : number + 'å¹´'; 19011 case 'd': 19012 case 'D': 19013 case 'DDD': 19014 return number + 'æ¥'; 19015 default: 19016 return number; 19017 } 19018 }, 19019 relativeTime: { 19020 future: '%så¾', 19021 past: '%så', 19022 s: 'æ°ç§', 19023 ss: '%dç§', 19024 m: '1å',
19025 mm: '%då', 19026 h: '1æé', 19027 hh: '%dæé', 19028 d: '1æ¥', 19029 dd: '%dæ¥', 19030 M: '1ã¶æ', 19031 MM: '%dã¶æ', 19032 y: '1å¹´', 19033 yy: '%då¹´', 19034 }, 19035 }); 19036 19037 return ja; 19038 19039}))); 19040 19041//! moment.js locale configuration 19042 19043;(function (global, factory) { 19044 typeof exports === 'object' && typeof module !== 'undefined' 19045 && typeof require === 'function' ? factory(require('../moment')) : 19046 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 19047 factory(global.moment) 19048}(this, (function (moment) { 'use strict'; 19049 19050 19051 var ko = moment.defineLocale('ko', { 19052 months: '1ì_2ì_3ì_4ì_5ì_6ì_7ì_8ì_9ì_10ì_11ì_12ì'.split('_'), 19053 monthsShort: '1ì_2ì_3ì_4ì_5ì_6ì_7ì_8ì_9ì_10ì_11ì_12ì'.split( 19054 '_' 19055 ), 19056 weekdays: 'ì¼ìì¼_ììì¼_íìì¼_ììì¼_목ìì¼_ê¸ìì¼_í ìì¼'.split('_'), 19057 weekdaysShort: 'ì¼_ì_í_ì_목_ê¸_í '.split('_'), 19058 weekdaysMin: 'ì¼_ì_í_ì_목_ê¸_í '.split('_'), 19059 longDateFormat: { 19060 LT: 'A h:mm', 19061 LTS: 'A h:mm:ss', 19062 L: 'YYYY.MM.DD.', 19063 LL: 'YYYYë MMMM Dì¼', 19064 LLL: 'YYYYë MMMM Dì¼ A h:mm', 19065 LLLL: 'YYYYë MMMM Dì¼ dddd A h:mm', 19066 l: 'YYYY.MM.DD.', 19067 ll: 'YYYYë MMMM Dì¼', 19068 lll: 'YYYYë MMMM Dì¼ A h:mm', 19069 llll: 'YYYYë MMMM Dì¼ dddd A h:mm', 19070 }, 19071 calendar: { 19072 sameDay: 'ì¤ë LT', 19073 nextDay: 'ë´ì¼ LT', 19074 nextWeek: 'dddd LT', 19075 lastDay: 'ì´ì LT', 19076 lastWeek: 'ì§ë주 dddd LT', 19077 sameElse: 'L', 19078 }, 19079 relativeTime: { 19080 future: '%s í', 19081 past: '%s ì ', 19082 s: 'ëª ì´', 19083 ss: '%dì´', 19084 m: '1ë¶', 19085 mm: '%dë¶', 19086 h: 'í ìê°', 19087 hh: '%dìê°', 19088 d: 'í루', 19089 dd: '%dì¼', 19090 M: 'í ë¬', 19091 MM: '%dë¬', 19092 y: 'ì¼ ë ', 19093 yy: '%dë ', 19094 }, 19095 dayOfMonthOrdinalParse: /\d{1,2}(ì¼|ì|주)/, 19096 ordinal: function (number, period) { 19097 switch (period) { 19098 case 'd': 19099 case 'D': 19100 case 'DDD': 19101 return number + 'ì¼'; 19102 case 'M': 19103 return number + 'ì'; 19104 case 'w': 19105 case 'W': 19106 return number + '주'; 19107 default: 19108 return number; 19109 } 19110 }, 19111 meridiemParse: /ì¤ì |ì¤í/, 19112 isPM: function (token) { 19113 return token === 'ì¤í'; 19114 }, 19115 meridiem: function (hour, minute, isUpper) { 19116 return hour < 12 ? 'ì¤ì ' : 'ì¤í'; 19117 }, 19118 }); 19119 19120 return ko; 19121 19122}))); 19123 19124/* 19125 * ADOBE CONFIDENTIAL 19126 * 19127 * Copyright 2017 Adobe Systems Incorporated 19128 * All Rights Reserved. 19129 *
19130 * NOTICE: All information contained herein is, and remains 19131 * the property of Adobe Systems Incorporated and its suppliers, 19132 * if any. The intellectual and technical concepts contained 19133 * herein are proprietary to Adobe Systems Incorporated and its 19134 * suppliers and may be covered by U.S. and Foreign Patents, 19135 * patents in process, and are protected by trade secret or copyright law. 19136 * Dissemination of this information or reproduction of this material 19137 * is strictly forbidden unless prior written permission is obtained 19138 * from Adobe Systems Incorporated. 19139 */ 19140(function(root, factory) { 19141 "use strict"; 19142 19143 if (typeof module === "object" && module.exports) { 19144 module.exports = factory(require("moment")); 19145 } else { 19146 factory(root.moment); 19147 } 19148}(this, function(moment) { 19149 "use strict"; 19150 19151 var shortTimeZoneFormat = new Intl.DateTimeFormat("de", { year: "2-digit", timeZoneName: "short" }); 19152 var longTimeZoneFormat = new Intl.DateTimeFormat("de", { year: "2-digit", timeZoneName: "long" }); 19153 19154 function getShortTimeZone(date) { 19155 var v = shortTimeZoneFormat.format(date); 19156 return v.substring(v.indexOf(" ") + 1); 19157 } 19158 19159 function getLongTimeZone(date) { 19160 var v = longTimeZoneFormat.format(date); 19161 return v.substring(v.indexOf(" ") + 1); 19162 } 19163 19164 // See https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/de/ca-gregorian.json 19165 moment.updateLocale("de", { 19166 presets: { 19167 date: { 19168 short: "DD.MM.YY", 19169 medium: "DD.MM.Y", 19170 long: "D. MMMM Y", 19171 full: "dddd, D. MMMM Y" 19172 }, 19173 time: { 19174 short: "HH:mm", 19175 medium: "HH:mm:ss", 19176 long: function(moment) { 19177 return "HH:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19178 }, 19179 full: function(moment) { 19180 return "HH:mm:ss [" + getLongTimeZone(moment.toDate()) + "]"; 19181 } 19182 }, 19183 datetime: { 19184 short: "DD.MM.YY, HH:mm", 19185 medium: "DD.MM.Y, HH:mm:ss", 19186 long: function(moment) { 19187 return "D. MMMM Y [um] HH:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19188 }, 19189 full: function(moment) { 19190 return "dddd, D. MMMM Y [um] HH:mm:ss [" + getLongTimeZone(moment.toDate()) + "]"; 19191 } 19192 } 19193 } 19194 }); 19195})); 19196 19197/* 19198 * ADOBE CONFIDENTIAL 19199 * 19200 * Copyright 2017 Adobe Systems Incorporated 19201 * All Rights Reserved. 19202 *
19203 * NOTICE: All information contained herein is, and remains 19204 * the property of Adobe Systems Incorporated and its suppliers, 19205 * if any. The intellectual and technical concepts contained 19206 * herein are proprietary to Adobe Systems Incorporated and its 19207 * suppliers and may be covered by U.S. and Foreign Patents, 19208 * patents in process, and are protected by trade secret or copyright law. 19209 * Dissemination of this information or reproduction of this material 19210 * is strictly forbidden unless prior written permission is obtained 19211 * from Adobe Systems Incorporated. 19212 */ 19213(function(root, factory) { 19214 "use strict"; 19215 19216 if (typeof module === "object" && module.exports) { 19217 module.exports = factory(require("moment")); 19218 } else { 19219 factory(root.moment); 19220 } 19221}(this, function(moment) { 19222 "use strict"; 19223 19224 var shortTimeZoneFormat = new Intl.DateTimeFormat("es", { year: "2-digit", timeZoneName: "short" }); 19225 var longTimeZoneFormat = new Intl.DateTimeFormat("es", { year: "2-digit", timeZoneName: "long" }); 19226 19227 function getShortTimeZone(date) { 19228 var v = shortTimeZoneFormat.format(date); 19229 return v.substring(v.indexOf(" ") + 1); 19230 } 19231 19232 function getLongTimeZone(date) { 19233 var v = longTimeZoneFormat.format(date); 19234 return v.substring(v.indexOf(" ") + 1); 19235 } 19236 19237 // See https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/es/ca-gregorian.json 19238 moment.updateLocale("es", { 19239 presets: { 19240 date: { 19241 short: "D/M/YY", 19242 medium: "D MMM Y", 19243 long: "D [de] MMMM [de] Y", 19244 full: "dddd, D [de] MMMM [de] Y" 19245 }, 19246 time: { 19247 short: "H:mm", 19248 medium: "H:mm:ss", 19249 long: function(moment) { 19250 return "H:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19251 }, 19252 full: function(moment) { 19253 return "H:mm:ss [(" + getLongTimeZone(moment.toDate()) + ")]"; 19254 } 19255 }, 19256 datetime: { 19257 short: "D/M/YY H:mm", 19258 medium: "D MMM Y H:mm:ss", 19259 long: function(moment) { 19260 return "D [de] MMMM [de] Y, H:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19261 }, 19262 full: function(moment) { 19263 return "dddd, D [de] MMMM [de] Y, H:mm:ss [(" + getLongTimeZone(moment.toDate()) + ")]"; 19264 } 19265 } 19266 } 19267 }); 19268})); 19269 19270/* 19271 * ADOBE CONFIDENTIAL 19272 * 19273 * Copyright 2017 Adobe Systems Incorporated 19274 * All Rights Reserved. 19275 *
19276 * NOTICE: All information contained herein is, and remains 19277 * the property of Adobe Systems Incorporated and its suppliers, 19278 * if any. The intellectual and technical concepts contained 19279 * herein are proprietary to Adobe Systems Incorporated and its 19280 * suppliers and may be covered by U.S. and Foreign Patents, 19281 * patents in process, and are protected by trade secret or copyright law. 19282 * Dissemination of this information or reproduction of this material 19283 * is strictly forbidden unless prior written permission is obtained 19284 * from Adobe Systems Incorporated. 19285 */ 19286(function(root, factory) { 19287 "use strict"; 19288 19289 if (typeof module === "object" && module.exports) { 19290 module.exports = factory(require("moment")); 19291 } else { 19292 factory(root.moment); 19293 } 19294}(this, function(moment) { 19295 "use strict"; 19296 19297 var shortTimeZoneFormat = new Intl.DateTimeFormat("fr", { year: "2-digit", timeZoneName: "short" }); 19298 var longTimeZoneFormat = new Intl.DateTimeFormat("fr", { year: "2-digit", timeZoneName: "long" }); 19299 19300 function getShortTimeZone(date) { 19301 var v = shortTimeZoneFormat.format(date); 19302 return v.substring(v.indexOf(" ") + 1); 19303 } 19304 19305 function getLongTimeZone(date) { 19306 var v = longTimeZoneFormat.format(date); 19307 return v.substring(v.indexOf(" ") + 1); 19308 } 19309 19310 moment.updateLocale("fr", { 19311 presets: { 19312 date: { 19313 short: "DD/MM/Y", 19314 medium: "D MMM Y", 19315 long: "D MMMM Y", 19316 full: "dddd D MMMM Y" 19317 }, 19318 time: { 19319 short: "HH:mm", 19320 medium: "HH:mm:ss", 19321 long: function(moment) { 19322 return "HH:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19323 }, 19324 full: function(moment) { 19325 return "HH:mm:ss [" + getLongTimeZone(moment.toDate()) + "]"; 19326 } 19327 }, 19328 datetime: { 19329 short: "DD/MM/Y HH:mm", 19330 medium: "D MMM Y Ã HH:mm:ss", 19331 long: function(moment) { 19332 return "D MMMM Y Ã HH:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19333 }, 19334 full: function(moment) { 19335 return "dddd D MMMM Y Ã HH:mm:ss [" + getLongTimeZone(moment.toDate()) + "]"; 19336 } 19337 } 19338 } 19339 }); 19340})); 19341 19342/* 19343 * ADOBE CONFIDENTIAL 19344 * 19345 * Copyright 2017 Adobe Systems Incorporated 19346 * All Rights Reserved. 19347 *
19348 * NOTICE: All information contained herein is, and remains 19349 * the property of Adobe Systems Incorporated and its suppliers, 19350 * if any. The intellectual and technical concepts contained 19351 * herein are proprietary to Adobe Systems Incorporated and its 19352 * suppliers and may be covered by U.S. and Foreign Patents, 19353 * patents in process, and are protected by trade secret or copyright law. 19354 * Dissemination of this information or reproduction of this material 19355 * is strictly forbidden unless prior written permission is obtained 19356 * from Adobe Systems Incorporated. 19357 */ 19358(function(root, factory) { 19359 "use strict"; 19360 19361 if (typeof module === "object" && module.exports) { 19362 module.exports = factory(require("moment")); 19363 } else { 19364 factory(root.moment); 19365 } 19366}(this, function(moment) { 19367 "use strict"; 19368 19369 var shortTimeZoneFormat = new Intl.DateTimeFormat("it", { year: "2-digit", timeZoneName: "short" }); 19370 var longTimeZoneFormat = new Intl.DateTimeFormat("it", { year: "2-digit", timeZoneName: "long" }); 19371 19372 function getShortTimeZone(date) { 19373 var v = shortTimeZoneFormat.format(date); 19374 return v.substring(v.indexOf(" ") + 1); 19375 } 19376 19377 function getLongTimeZone(date) { 19378 var v = longTimeZoneFormat.format(date); 19379 return v.substring(v.indexOf(" ") + 1); 19380 } 19381 19382 // See https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/it/ca-gregorian.json 19383 moment.updateLocale("it", { 19384 presets: { 19385 date: { 19386 short: "DD/MM/YY", 19387 medium: "DD MMM Y", 19388 long: "D MMMM Y", 19389 full: "dddd D MMMM Y" 19390 }, 19391 time: { 19392 short: "HH:mm", 19393 medium: "HH:mm:ss", 19394 long: function(moment) { 19395 return "HH:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19396 }, 19397 full: function(moment) { 19398 return "HH:mm:ss [" + getLongTimeZone(moment.toDate()) + "]"; 19399 } 19400 }, 19401 datetime: { 19402 short: "DD/MM/YY, HH:mm", 19403 medium: "DD MMM Y, HH:mm:ss", 19404 long: function(moment) { 19405 return "D MMMM Y HH:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19406 }, 19407 full: function(moment) { 19408 return "dddd D MMMM Y HH:mm:ss [" + getLongTimeZone(moment.toDate()) + "]"; 19409 } 19410 } 19411 } 19412 }); 19413})); 19414 19415/* 19416 * ADOBE CONFIDENTIAL 19417 * 19418 * Copyright 2017 Adobe Systems Incorporated 19419 * All Rights Reserved. 19420 *
19421 * NOTICE: All information contained herein is, and remains 19422 * the property of Adobe Systems Incorporated and its suppliers, 19423 * if any. The intellectual and technical concepts contained 19424 * herein are proprietary to Adobe Systems Incorporated and its 19425 * suppliers and may be covered by U.S. and Foreign Patents, 19426 * patents in process, and are protected by trade secret or copyright law. 19427 * Dissemination of this information or reproduction of this material 19428 * is strictly forbidden unless prior written permission is obtained 19429 * from Adobe Systems Incorporated. 19430 */ 19431(function(root, factory) { 19432 "use strict"; 19433 19434 if (typeof module === "object" && module.exports) { 19435 module.exports = factory(require("moment")); 19436 } else { 19437 factory(root.moment); 19438 } 19439}(this, function(moment) { 19440 "use strict"; 19441 19442 var shortTimeZoneFormat = new Intl.DateTimeFormat("pt-br", { year: "2-digit", timeZoneName: "short" }); 19443 var longTimeZoneFormat = new Intl.DateTimeFormat("pt-br", { year: "2-digit", timeZoneName: "long" }); 19444 19445 function getShortTimeZone(date) { 19446 var v = shortTimeZoneFormat.format(date); 19447 return v.substring(v.indexOf(" ") + 1); 19448 } 19449 19450 function getLongTimeZone(date) { 19451 var v = longTimeZoneFormat.format(date); 19452 return v.substring(v.indexOf(" ") + 1); 19453 } 19454 19455 // See https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/pt/ca-gregorian.json 19456 moment.updateLocale("pt-br", { 19457 presets: { 19458 date: { 19459 short: "DD/MM/Y", 19460 medium: "D [de] MMM [de] Y", 19461 long: "D [de] MMMM [de] Y", 19462 full: "dddd, D [de] MMMM [de] Y" 19463 }, 19464 time: { 19465 short: "HH:mm", 19466 medium: "HH:mm:ss", 19467 long: function(moment) { 19468 return "HH:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19469 }, 19470 full: function(moment) { 19471 return "HH:mm:ss [" + getLongTimeZone(moment.toDate()) + "]"; 19472 } 19473 }, 19474 datetime: { 19475 short: "DD/MM/Y HH:mm", 19476 medium: "D [de] MMM [de] Y HH:mm:ss", 19477 long: function(moment) { 19478 return "D [de] MMMM [de] Y HH:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19479 }, 19480 full: function(moment) { 19481 return "dddd, D [de] MMMM [de] Y HH:mm:ss [" + getLongTimeZone(moment.toDate()) + "]"; 19482 } 19483 } 19484 } 19485 }); 19486})); 19487 19488/* 19489 * ADOBE CONFIDENTIAL 19490 * 19491 * Copyright 2017 Adobe Systems Incorporated 19492 * All Rights Reserved. 19493 *
19494 * NOTICE: All information contained herein is, and remains 19495 * the property of Adobe Systems Incorporated and its suppliers, 19496 * if any. The intellectual and technical concepts contained 19497 * herein are proprietary to Adobe Systems Incorporated and its 19498 * suppliers and may be covered by U.S. and Foreign Patents, 19499 * patents in process, and are protected by trade secret or copyright law. 19500 * Dissemination of this information or reproduction of this material 19501 * is strictly forbidden unless prior written permission is obtained 19502 * from Adobe Systems Incorporated. 19503 */ 19504(function(root, factory) { 19505 "use strict"; 19506 19507 if (typeof module === "object" && module.exports) { 19508 module.exports = factory(require("moment")); 19509 } else { 19510 factory(root.moment); 19511 } 19512}(this, function(moment) { 19513 "use strict"; 19514 19515 var shortTimeZoneFormat = new Intl.DateTimeFormat("zh-cn", { year: "2-digit", timeZoneName: "short" }); 19516 var longTimeZoneFormat = new Intl.DateTimeFormat("zh-cn", { year: "2-digit", timeZoneName: "long" }); 19517 19518 function getShortTimeZone(date) { 19519 var v = shortTimeZoneFormat.format(date); 19520 return v.substring(v.indexOf(" ") + 1); 19521 } 19522 19523 function getLongTimeZone(date) { 19524 var v = longTimeZoneFormat.format(date); 19525 return v.substring(v.indexOf(" ") + 1); 19526 } 19527 19528 // See https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/zh/ca-gregorian.json 19529 moment.updateLocale("zh-cn", { 19530 presets: { 19531 date: { 19532 short: "Y/M/D", 19533 medium: "Yå¹´MæDæ¥", 19534 long: "Yå¹´MæDæ¥", 19535 full: "Yå¹´MæDæ¥dddd" 19536 }, 19537 time: { 19538 short: "ah:mm", 19539 medium: "ah:mm:ss", 19540 long: function(moment) { 19541 return "[" + getShortTimeZone(moment.toDate()) + "] ah:mm:ss"; 19542 }, 19543 full: function(moment) { 19544 return "[" + getLongTimeZone(moment.toDate()) + "] ah:mm:ss"; 19545 } 19546 }, 19547 datetime: { 19548 short: "Y/M/D ah:mm", 19549 medium: "Yå¹´MæDæ¥ ah:mm:ss", 19550 long: function(moment) { 19551 return "Yå¹´MæDæ¥ [" + getShortTimeZone(moment.toDate()) + "] ah:mm:ss"; 19552 }, 19553 full: function(moment) { 19554 return "Yå¹´MæDæ¥dddd [" + getLongTimeZone(moment.toDate()) + "] ah:mm:ss"; 19555 } 19556 } 19557 } 19558 }); 19559})); 19560 19561/* 19562 * ADOBE CONFIDENTIAL 19563 * 19564 * Copyright 2017 Adobe Systems Incorporated 19565 * All Rights Reserved. 19566 *
19567 * NOTICE: All information contained herein is, and remains 19568 * the property of Adobe Systems Incorporated and its suppliers, 19569 * if any. The intellectual and technical concepts contained 19570 * herein are proprietary to Adobe Systems Incorporated and its 19571 * suppliers and may be covered by U.S. and Foreign Patents, 19572 * patents in process, and are protected by trade secret or copyright law. 19573 * Dissemination of this information or reproduction of this material 19574 * is strictly forbidden unless prior written permission is obtained 19575 * from Adobe Systems Incorporated. 19576 */ 19577(function(root, factory) { 19578 "use strict"; 19579 19580 if (typeof module === "object" && module.exports) { 19581 module.exports = factory(require("moment")); 19582 } else { 19583 factory(root.moment); 19584 } 19585}(this, function(moment) { 19586 "use strict"; 19587 19588 var shortTimeZoneFormat = new Intl.DateTimeFormat("zh-tw", { year: "2-digit", timeZoneName: "short" }); 19589 var longTimeZoneFormat = new Intl.DateTimeFormat("zh-tw", { year: "2-digit", timeZoneName: "long" }); 19590 19591 function getShortTimeZone(date) { 19592 var v = shortTimeZoneFormat.format(date); 19593 return v.substring(v.indexOf(" ") + 1); 19594 } 19595 19596 function getLongTimeZone(date) { 19597 var v = longTimeZoneFormat.format(date); 19598 return v.substring(v.indexOf(" ") + 1); 19599 } 19600 19601 // See https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/zh-Hant/ca-gregorian.json 19602 moment.updateLocale("zh-tw", { 19603 presets: { 19604 date: { 19605 short: "Y/M/D", 19606 medium: "Yå¹´MæDæ¥", 19607 long: "Yå¹´MæDæ¥", 19608 full: "Yå¹´MæDæ¥ dddd" 19609 }, 19610 time: { 19611 short: "ah:mm", 19612 medium: "ah:mm:ss", 19613 long: function(moment) { 19614 return "ah:mm:ss [[" + getShortTimeZone(moment.toDate()) + "]]"; 19615 }, 19616 full: function(moment) { 19617 return "ah:mm:ss [[" + getLongTimeZone(moment.toDate()) + "]]"; 19618 } 19619 }, 19620 datetime: { 19621 short: "Y/M/D ah:mm", 19622 medium: "Yå¹´MæDæ¥ ah:mm:ss", 19623 long: function(moment) { 19624 return "Yå¹´MæDæ¥ ah:mm:ss [[" + getShortTimeZone(moment.toDate()) + "]]"; 19625 }, 19626 full: function(moment) { 19627 return "Yå¹´MæDæ¥ dddd ah:mm:ss [[" + getLongTimeZone(moment.toDate()) + "]]"; 19628 } 19629 } 19630 } 19631 }); 19632})); 19633 19634/* 19635 * ADOBE CONFIDENTIAL 19636 * 19637 * Copyright 2017 Adobe Systems Incorporated 19638 * All Rights Reserved. 19639 *
19640 * NOTICE: All information contained herein is, and remains 19641 * the property of Adobe Systems Incorporated and its suppliers, 19642 * if any. The intellectual and technical concepts contained 19643 * herein are proprietary to Adobe Systems Incorporated and its 19644 * suppliers and may be covered by U.S. and Foreign Patents, 19645 * patents in process, and are protected by trade secret or copyright law. 19646 * Dissemination of this information or reproduction of this material 19647 * is strictly forbidden unless prior written permission is obtained 19648 * from Adobe Systems Incorporated. 19649 */ 19650(function(root, factory) { 19651 "use strict"; 19652 19653 if (typeof module === "object" && module.exports) { 19654 module.exports = factory(require("moment")); 19655 } else { 19656 factory(root.moment); 19657 } 19658}(this, function(moment) { 19659 "use strict"; 19660 19661 var shortTimeZoneFormat = new Intl.DateTimeFormat("ja", { year: "2-digit", timeZoneName: "short" }); 19662 var longTimeZoneFormat = new Intl.DateTimeFormat("ja", { year: "2-digit", timeZoneName: "long" }); 19663 19664 function getShortTimeZone(date) { 19665 var v = shortTimeZoneFormat.format(date); 19666 return v.substring(v.indexOf(" ") + 1); 19667 } 19668 19669 function getLongTimeZone(date) { 19670 var v = longTimeZoneFormat.format(date); 19671 return v.substring(v.indexOf(" ") + 1); 19672 } 19673 19674 // See https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/ja/ca-gregorian.json 19675 moment.updateLocale("ja", { 19676 presets: { 19677 date: { 19678 short: "Y/MM/DD", 19679 medium: "Y/MM/DD", 19680 long: "Yå¹´MæDæ¥", 19681 full: "Yå¹´MæDæ¥dddd" 19682 }, 19683 time: { 19684 short: "H:mm", 19685 medium: "H:mm:ss", 19686 long: function(moment) { 19687 return "H:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19688 }, 19689 full: function(moment) { 19690 return "Hæmmåssç§ [" + getLongTimeZone(moment.toDate()) + "]"; 19691 } 19692 }, 19693 datetime: { 19694 short: " Y/MM/DD H:mm", 19695 medium: "Y/MM/DD H:mm:ss", 19696 long: function(moment) { 19697 return "Yå¹´MæDæ¥ H:mm:ss [" + getShortTimeZone(moment.toDate()) + "]"; 19698 }, 19699 full: function(moment) { 19700 return "Yå¹´MæDæ¥dddd Hæmmåssç§ [" + getLongTimeZone(moment.toDate()) + "]"; 19701 } 19702 } 19703 } 19704 }); 19705})); 19706 19707/* 19708 * ADOBE CONFIDENTIAL 19709 * 19710 * Copyright 2017 Adobe Systems Incorporated 19711 * All Rights Reserved. 19712 *
19713 * NOTICE: All information contained herein is, and remains 19714 * the property of Adobe Systems Incorporated and its suppliers, 19715 * if any. The intellectual and technical concepts contained 19716 * herein are proprietary to Adobe Systems Incorporated and its 19717 * suppliers and may be covered by U.S. and Foreign Patents, 19718 * patents in process, and are protected by trade secret or copyright law. 19719 * Dissemination of this information or reproduction of this material 19720 * is strictly forbidden unless prior written permission is obtained 19721 * from Adobe Systems Incorporated. 19722 */ 19723(function(root, factory) { 19724 "use strict"; 19725 19726 if (typeof module === "object" && module.exports) { 19727 module.exports = factory(require("moment")); 19728 } else { 19729 factory(root.moment); 19730 } 19731}(this, function(moment) { 19732 "use strict"; 19733 19734 var shortTimeZoneFormat = new Intl.DateTimeFormat("ko", { year: "2-digit", timeZoneName: "short" }); 19735 var longTimeZoneFormat = new Intl.DateTimeFormat("ko", { year: "2-digit", timeZoneName: "long" }); 19736 19737 function getShortTimeZone(date) { 19738 var v = shortTimeZoneFormat.format(date); 19739 return v.substring(v.indexOf(" ") + 1); 19740 } 19741 19742 function getLongTimeZone(date) { 19743 var v = longTimeZoneFormat.format(date); 19744 return v.substring(v.indexOf(" ") + 1); 19745 } 19746 19747 // See https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/ko/ca-gregorian.json 19748 moment.updateLocale("ko", { 19749 presets: { 19750 date: { 19751 short: "YY. M. D.", 19752 medium: "Y. M. D.", 19753 long: "Yë Mì Dì¼", 19754 full: "Yë Mì Dì¼ dddd" 19755 }, 19756 time: { 19757 short: "a h:mm", 19758 medium: "a h:mm:ss", 19759 long: function(moment) { 19760 return "a hì më¶ sì´ [" + getShortTimeZone(moment.toDate()) + "]"; 19761 }, 19762 full: function(moment) { 19763 return "a hì më¶ sì´ [" + getLongTimeZone(moment.toDate()) + "]"; 19764 } 19765 }, 19766 datetime: { 19767 short: "YY. M. D. a h:mm", 19768 medium: "Y. M. D. a h:mm:ss", 19769 long: function(moment) { 19770 return "Yë Mì Dì¼ a hì më¶ sì´ [" + getShortTimeZone(moment.toDate()) + "]"; 19771 }, 19772 full: function(moment) { 19773 return "Yë Mì Dì¼ dddd a hì më¶ sì´ [" + getLongTimeZone(moment.toDate()) + "]"; 19774 } 19775 } 19776 } 19777 }); 19778})); 19779 19780/* 19781 * ADOBE CONFIDENTIAL 19782 * 19783 * Copyright 2017 Adobe Systems Incorporated 19784 * All Rights Reserved. 19785 *
19786 * NOTICE: All information contained herein is, and remains 19787 * the property of Adobe Systems Incorporated and its suppliers, 19788 * if any. The intellectual and technical concepts contained 19789 * herein are proprietary to Adobe Systems Incorporated and its 19790 * suppliers and may be covered by U.S. and Foreign Patents, 19791 * patents in process, and are protected by trade secret or copyright law. 19792 * Dissemination of this information or reproduction of this material 19793 * is strictly forbidden unless prior written permission is obtained 19794 * from Adobe Systems Incorporated. 19795 */ 19796(function(root, factory) { 19797 "use strict"; 19798 19799 if (typeof module === "object" && module.exports) { 19800 module.exports = factory(require("moment")); 19801 } else { 19802 factory(root.moment); 19803 } 19804}(this, function(moment) { 19805 "use strict"; 19806 19807 var shortTimeZoneFormat = new Intl.DateTimeFormat("en", { year: "2-digit", timeZoneName: "short" }); 19808 var longTimeZoneFormat = new Intl.DateTimeFormat("en", { year: "2-digit", timeZoneName: "long" }); 19809 19810 function getShortTimeZone(date) { 19811 var v = shortTimeZoneFormat.format(date); 19812 return v.substring(v.indexOf(" ") + 1); 19813 } 19814 19815 function getLongTimeZone(date) { 19816 var v = longTimeZoneFormat.format(date); 19817 return v.substring(v.indexOf(" ") + 1); 19818 } 19819 19820 // See https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/en/ca-gregorian.json 19821 moment.updateLocale("en", { 19822 presets: { 19823 date: { 19824 short: "M/D/YY", 19825 medium: "MMM D, Y", 19826 long: "MMMM D, Y", 19827 full: "dddd, MMMM D, Y" 19828 }, 19829 time: { 19830 short: "h:mm A", 19831 medium: "h:mm:ss A", 19832 long: function(moment) { 19833 return "h:mm:ss A [" + getShortTimeZone(moment.toDate()) + "]"; 19834 }, 19835 full: function(moment) { 19836 return "h:mm:ss A [" + getLongTimeZone(moment.toDate()) + "]"; 19837 } 19838 }, 19839 datetime: { 19840 short: "M/D/YY, h:mm A", 19841 medium: "MMM D, Y, h:mm:ss A", 19842 long: function(moment) { 19843 return "MMMM D, Y [at] h:mm:ss A [" + getShortTimeZone(moment.toDate()) + "]"; 19844 }, 19845 full: function(moment) { 19846 return "dddd, MMMM D, Y [at] h:mm:ss A [" + getLongTimeZone(moment.toDate()) + "]"; 19847 } 19848 } 19849 } 19850 }); 19851})); 19852 19853/* 19854 * 19855 * ADOBE CONFIDENTIAL 19856 * __________________ 19857 * 19858 * Copyright 2012 Adobe Systems Incorporated 19859 * All Rights Reserved. 19860 *
19861 * NOTICE: All information contained herein is, and remains 19862 * the property of Adobe Systems Incorporated and its suppliers, 19863 * if any. The intellectual and technical concepts contained 19864 * herein are proprietary to Adobe Systems Incorporated and its 19865 * suppliers and are protected by trade secret or copyright law. 19866 * Dissemination of this information or reproduction of this material 19867 * is strictly forbidden unless prior written permission is obtained 19868 * from Adobe Systems Incorporated. 19869 */ 19870(function(Backbone, $CQ, _, Handlebars) { 19871 "use strict"; 19872 var SCF = { 19873 VERSION: "0.0.1", 19874 Views: {}, 19875 Models: {}, 19876 Collections: {}, 19877 config: { 19878 urlRoot: "" 19879 }, 19880 constants: { 19881 SOCIAL_SELECTOR: ".social", 19882 JSON_EXT: ".json", 19883 URL_EXT: ".social.json", 19884 TRANSLATE_URL_EXT: ".social.translate.json", 19885 ANALYTICS_BASE_RESOURCE_TYPE: "social/commons/components/analyticsbase" 19886 }, 19887 Components: {}, 19888 loadedComponents: {}, 19889 templates: {}, 19890 fieldManagers: {}, 19891 DEBUG: 1, 19892 INFO: 2, 19893 WARN: 3, 19894 ERROR: 4 19895 }; 19896 SCF.LOG_LEVEL = SCF.INFO; 19897 var _logger = { 19898 debug: function() { 19899 if (SCF.LOG_LEVEL <= SCF.DEBUG) { 19900 window.console.debug.apply(window.console, arguments); 19901 } 19902 }, 19903 info: function() { 19904 if (SCF.LOG_LEVEL <= SCF.INFO) { 19905 window.console.info.apply(window.console, arguments); 19906 } 19907 }, 19908 warn: function() { 19909 if (SCF.LOG_LEVEL <= SCF.WARN) { 19910 window.console.warn.apply(window.console, arguments); 19911 } 19912 }, 19913 error: function() { 19914 if (SCF.LOG_LEVEL <= SCF.ERROR) { 19915 window.console.error.apply(window.console, arguments); 19916 } 19917 } 19918 }; 19919 var deepCommentSearch = function(node, regex) { 19920 var child = node.firstChild; 19921 var foundNode = null; 19922 while (child) { 19923 switch (child.nodeType) { 19924 case 1: 19925 foundNode = deepCommentSearch(child, regex); 19926 break; 19927 case 8: 19928 if (child.nodeValue.match(regex)) { 19929 return child; 19930 } 19931 break; 19932 } 19933 if (foundNode !== null) { 19934 break; 19935 } 19936 child = child.nextSibling; 19937 } 19938 return foundNode; 19939 }; 19940 SCF.Router = new Backbone.Router(); 19941 if (!Backbone.History.started) { 19942 Backbone.history.start({ 19943 pushState: true, 19944 hashChange: false 19945 }); 19946 } 19947 SCF.View = Backbone.View.extend({ 19948 initialize: function() { 19949 this._rendered = false; 19950 this._childViews = {}; 19951 this._parentView = undefined; 19952 this._modelReady = false; 19953 this._sessionReady = false; 19954 this._renderedChildren = []; 19955 this._replacementTarget = null; 19956 this._destroyed = false; 19957 if (this.$el.html() !== "") { 19958 this.bindView(); 19959 this._rendered = true; 19960 } 19961 this.listenTo(this.model, "model:loaded", function() { 19962 this._modelReady = true; 19963 this.render(); 19964 }); 19965 this.listenTo(this.model, "model:cacheFixed", function() { 19966 this.render(); 19967 }); 19968 if (this.requiresSession && !SCF.Session.isReady()) { 19969 //SCF.log.debug("%s waiting for session to be ready.", this.cid); 19970 this.listenTo(SCF.Session, "model:loaded", function(data) { 19971 if (!this._sessionReady) { 19972 //SCF.log.debug("View: %s got Session ready.", this.cid); 19973 this._sessionReady = true; 19974 this.render(); 19975 } 19976 }); 19977 } 19978 this._sessionReady = SCF.Session.isReady(); 19979 if (_.isFunction(this.init)) { 19980 this.init.apply(this, arguments); 19981 } 19982 if (SCF.Session.isReady()) { 19983 this.initContext(); 19984 } else { 19985 SCF.Session.on("model:loaded", _.bind(this.initContext, this)); 19986 } 19987 }, 19988 initContext: function() { 19989 if (_.isUndefined(SCF.Context)) { 19990 SCF.Context = {}; 19991 var groupNavbarSel = ".scf-js-group-navbar"; 19992 19993 // get site path to be written into SCF.Context and recorded for analytics 19994 var sitePath = $(".scf-js-site-title").attr("href"); 19995 sitePath = _.isUndefined(sitePath) ? "" : sitePath.substring(0, sitePath.lastIndexOf(".html")); 19996 this.sitePath = sitePath; 19997 /* 19998 * Populate page level component information into SCF.Context 19999 * to be sent with analytics calls. It is particularly important 20000 * for events such as post (SCFCreate) or votes (SCFVote) originated 20001 * in nested coments or replies (not top level) that do not have 20002 * direct access to this information 20003 */ 20004 SCF.Context.siteTitle = $(".scf-js-site-title").length !== 0 ? $(".scf-js-site-title").text() : ""; 20005 SCF.Context.sitePath = this.sitePath; 20006 SCF.Context.groupTitle = $(groupNavbarSel).length !== 0 && !_.isUndefined($(groupNavbarSel).attr("data-group-title")) ? $(groupNavbarSel).data("group-title") : ""; 20007 SCF.Context.groupPath = $(groupNavbarSel).length !== 0 && !_.isUndefined($(groupNavbarSel).attr("data-group-path")) ? $(groupNavbarSel).data("group-
20007path") : ""; 20008 SCF.Context.user = SCF.Session.get("authorizableId"); 20009 } 20010 if (_.isFunction(this.initAnalytics)) { 20011 this.initAnalytics.apply(this, arguments); 20012 } 20013 }, 20014 getContextForTemplate: function() { 20015 var context = (this.model !== undefined) ? this.model.toJSON() : this.context; 20016 return this.getMergedContexts(context); 20017 }, 20018 getMergedContexts: function(context) { 20019 if (!_.isObject(context)) { 20020 context = {}; 20021 } 20022 context.loggedInUser = SCF.Session.toJSON(); 20023 context.environment = {}; 20024 context.environment.client = true; 20025 return context; 20026 }, 20027 appendTo: function(parentElement) { 20028 if (!this._rendered) { 20029 this.render(); 20030 } 20031 $CQ(parentElement).append(this.el); 20032 this.trigger("view:ready", { 20033 view: this 20034 }); 20035 }, 20036 replaceElement: function(replacedElement) { 20037 if (!this._rendered) { 20038 this.render(); 20039 } 20040 if (this._rendered) { 20041 $CQ(replacedElement).replaceWith(this.$el); 20042 this._replacementTarget = null; 20043 this.trigger("view:ready", { 20044 view: this 20045 }); 20046 } else { 20047 //SCF.log.debug("Attaching replacementTarget: %s", this.cid); 20048 this._replacementTarget = replacedElement; 20049 } 20050 }, 20051 render: function() { 20052 if (this._destroyed) { 20053 return; 20054 } 20055 var that = this; 20056 if (!(this._modelReady || this.model._isReady) || (this.requiresSession && !this._sessionReady)) { 20057 /* 20058 if (!(this._modelReady || this.model._isReady)) { 20059 SCF.log.debug("Skipping render due to Model not ready %s : %s", this.cid, this.model.attributes.resourceType); 20060 } 20061 if (this.requiresSession && !this._sessionReady) { 20062 SCF.log.debug("Skipping render due to Session not ready %s : %s", this.cid, this.model.attributes.resourceType); 20063 } 20064 */ 20065 return this; 20066 } 20067 //SCF.log.debug("Rendering %s : %s", this.cid, this.model.attributes.resourceType); 20068 this.unbindDataFields(); 20069 for (var viewName in this._childViews) { 20070 this._childViews[viewName].destroy(); 20071 delete this._childViews[viewName]; 20072 } 20073 this._renderedChildren = []; 20074 var element = $CQ(this.template(this.getContextForTemplate(), { 20075 data: { 20076 parentView: this 20077 } 20078 })); 20079 //Check if its attached to DOM or rendered 20080 if (this._rendered || this.$el.parent().length > 0) { 20081 this.$el.html(element.html()); 20082 } else { 20083 this.setElement(element); 20084 } 20085 //render children 20086 _.each(this._childViews, function(child) { 20087 that.renderChildView(child); 20088 }); 20089 20090 var finishRendering = _.bind(function() { 20091 this.bindView(); 20092 this._rendered = true; 20093 if (this.afterRender) { 20094 this.afterRender(); 20095 } 20096 this.trigger("view:rendered", { 20097 view: this 20098 }); 20099 20100 }, this); 20101 //wait for children to finish rendering and then complete binding the view 20102 $CQ.when(this._renderedChildren).done(finishRendering); 20103 if (this._replacementTarget !== null) { 20104 this.replaceElement(this._replacementTarget); 20105 } 20106 return this; 20107 }, 20108 bindView: function() { 20109 var that = this; 20110 this.unbindDataFields(); 20111 this.$("[evt]").not(this.$("[data-scf-component] [evt]")).each(function(idx, trigger) { 20112 SCF.View.bindEvents(that, $CQ(trigger)); 20113 }); 20114 this.$("[data-attrib]").not(this.$("[data-scf-component] [data-attrib]")).each(function(idx, element) { 20115 SCF.View.bindDataFields(that, $CQ(element)); 20116 }); 20117 this.$("[data-form]").not(this.$("[data-scf-component] [data-form]")).each(function(idx, element) { 20118 SCF.View.bindDataForms(that, $CQ(element)); 20119 }); 20120 }, 20121 addChildView: function(childView) {
20122 //SCF.log.debug("Adding Child View: %s", childView.cid); 20123 this._childViews[childView.cid] = childView; 20124 var deferred = $CQ.Deferred(); 20125 this._renderedChildren[childView.cid] = deferred.promise(); 20126 this.listenTo(childView, "view:rendered", function() { 20127 deferred.resolve(); 20128 }); 20129 this.listenTo(childView, "view:destroyed", function(event) { 20130 //SCF.log.debug("Parent getting destory command for child view: %s", event.view.cid); 20131 this.removeChildView(event.view.cid); 20132 }); 20133 return this; 20134 }, 20135 getChildView: function(childViewID) { 20136 return this._childViews[childViewID]; 20137 }, 20138 removeChildView: function(childViewID) { 20139 if (this._renderedChildren.hasOwnProperty(childViewID)) { 20140 this._renderedChildren[childViewID].fail(); 20141 } 20142 if (this._childViews.hasOwnProperty(childViewID)) { 20143 var childView = this._childViews[childViewID]; 20144 childView.stopListening(); 20145 this.stopListening(childView, "view:rendered"); 20146 this._childViews[childViewID] = undefined; 20147 delete this._childViews[childViewID]; 20148 } 20149 return this; 20150 }, 20151 getChildViews: function() { 20152 return this._childViews; 20153 }, 20154 setParent: function(parentView) { 20155 this._parentView = parentView; 20156 parentView.addChildView(this); 20157 return this; 20158 }, 20159 renderChildView: function(view) { 20160 //SCF.log.debug("Rendering child view: %s", view.cid); 20161 view.render(); 20162 var parent = this; 20163 if (parent.el === null) { 20164 return; 20165 } 20166 var el = null; 20167 var currentNode = null; 20168 var targetView = new RegExp("\s*?data-view='" + view.cid + "'"); 20169 if (document.createNodeIterator && NodeFilter && NodeFilter.SHOW_COMMENT) { 20170 var iter = document.createNodeIterator(parent.el, NodeFilter.SHOW_COMMENT, 20171 function(node) { 20172 if (node.data.match(targetView)) { 20173 return NodeFilter.FILTER_ACCEPT; 20174 } 20175 }, 20176 false 20177 ); 20178 currentNode = iter.nextNode(); 20179 while (currentNode !== null) { 20180 el = currentNode; 20181 currentNode = iter.nextNode(); 20182 break; 20183 } 20184 view.replaceElement(el); 20185 } else { 20186 el = deepCommentSearch(parent.el, targetView); 20187 view.replaceElement(el); 20188 } 20189 }, 20190 getField: function(field) { 20191 var element = this._fields[field]; 20192 if (element) { 20193 return element.val(); 20194 } 20195 return ""; 20196 }, 20197 setField: function(field, data) { 20198 var element = this._fields[field]; 20199 if (!element) { 20200 return; 20201 } 20202 element.val(data); 20203 }, 20204 focus: function(field) { 20205 var element = this._fields[field]; 20206 if (!element) { 20207 return; 20208 } 20209 element.focus(); 20210 }, 20211 getForm: function(form) { 20212 if (typeof this._forms === 'undefined') { 20213 return null; 20214 } else { 20215 return this._forms[form]; 20216 } 20217 }, 20218 destroy: function() { 20219 this.undelegateEvents(); 20220 this.unbindDataFields(); 20221 this.stopListening(); 20222 this.trigger("view:destroyed", { 20223 view: this 20224 }); 20225 this._destroyed = true; 20226 //SCF.log.debug("DESTORYING %s : %s", this.cid, this.model.attributes.resourceType); 20227 }, 20228 unbindDataFields: function() { 20229 for (var prop in this._fields) { 20230 if (this._fields.hasOwnProperty(prop)) { 20231 if (_.isFunction(this._fields[prop].destroy)) { 20232 this._fields[prop].destroy(); 20233 } 20234 } 20235 } 20236 this._fields = {}; 20237 }, 20238 log: _logger 20239 }); 20240 SCF.View.extend = function() { 20241 var child = Backbone.View.extend.apply(this, arguments); 20242 var viewName = arguments[0].viewName; 20243 SCF.Views[viewName] = child; 20244 return child; 20245 }; 20246 20247 SCF.Model = Backbone.Model.extend({ 20248 _cachedModels: {}, 20249 _hasLoadedChildren: false, 20250 parse: function(response) { 20251 this._parseRelations(response); 20252 return response; 20253 }, 20254 addEncoding: function(data) { 20255 if ((window.FormData) && (data instanceof window.FormData)) { 20256 data.append("_charset_", "UTF-8"); 20257 } 20258 if (!data.hasOwnProperty("_charset_")) { 20259 data._charset_ = "UTF-8"; 20260 } 20261 return data; 20262 }, 20263 reload: function(callback) { 20264 this._isReady = false;
20265 var url = ""; 20266 var urlFn; 20267 if (_.isFunction(this.url)) { 20268 //Need to do this since model.clear will clear the id that is used to construct the url 20269 url = this.url(); 20270 urlFn = this.url; 20271 } else { 20272 //seen code that sets the param as a hardcoded string 20273 url = this.url; 20274 } 20275 this.clear(); 20276 //This.clear clears the id resulting in bad URL so setting the URL for fetch to happen 20277 if (!_.isEmpty(url)) { 20278 this.url = url; 20279 } 20280 var that = this; 20281 this.fetch({ 20282 dataType: "json", 20283 cache: false, 20284 xhrFields: { 20285 withCredentials: true 20286 }, 20287 error: function(model, response) { 20288 SCF.log.error("Error fetching model"); 20289 SCF.log.error(response); 20290 model.clear(); 20291 model._isReady = true; 20292 model.trigger("model:loaded", model); 20293 if (callback && typeof(callback.error) === "function") { 20294 callback.error(); 20295 } 20296 }, 20297 success: function(model) { 20298 if (urlFn !== undefined) { 20299 //resetting the url back to function 20300 model.url = urlFn; 20301 } 20302 model._isReady = true; 20303 model.trigger("model:loaded", model); 20304 if (callback && typeof(callback.success) === "function") { 20305 callback.success(); 20306 } 20307 } 20308 }); 20309 }, 20310 reset: function(attributes, options) { 20311 this.clear().set(_.clone(this.defaults)); 20312 var attr = this._parseRelations(attributes); 20313 this.set(attr, options); 20314 return this; 20315 }, 20316 initialize: function(attributes) { 20317 this.listenTo(SCF.Session, "logout:success", function() { 20318 this.reload(); 20319 }); 20320 this.listenTo(SCF.Session, "login:success", function() { 20321 this.reload(); 20322 }); 20323 }, 20324 constructor: function(attributes, options) { 20325 if(typeof(attributes) !== "object") { 20326 attributes = JSON.parse(attributes); 20327 } 20328 var attr = this._parseRelations(attributes); 20329 Backbone.Model.apply(this, [attr, options]); 20330 }, 20331 url: function() { 20332 var u; 20333 if (this.urlRoot) { 20334 u = this.urlRoot + this.id + SCF.constants.URL_EXT; 20335 } else if (SCF.config.urlRoot) { 20336 u = SCF.config.urlRoot + this.id + SCF.constants.URL_EXT; 20337 } else { 20338 u = this.id + SCF.constants.URL_EXT; 20339 } 20340 return u; 20341 }, 20342 _parseRelations: function(attributes) { 20343 if(typeof(attributes) !== "object") { 20344 attributes = JSON.parse(attributes); 20345 } 20346 var makeRelation = _.bind(function(data, key) { 20347 if (!attributes[key] && !data.path) { 20348 attributes[key] = []; 20349 } 20350 if (attributes[key] || data.path) { 20351 var relative = attributes[key]; 20352 var ModelKlass, model; 20353 if (_.isArray(relative)) { 20354 var modelArray = [], 20355 idArray = []; 20356 _.each(relative, function(rel) { 20357 if (_.isObject(rel)) { 20358 ModelKlass = !_.isUndefined(SCF.Models[data.model]) ? SCF.Models[data.model] : SCF.Components[rel.resourceType].Model; 20359 model = ModelKlass.findLocal(rel.id); 20360 if (!model) { 20361 model = ModelKlass.createLocally(rel); 20362 } else { 20363 model.reset(rel); 20364 } 20365 modelArray.push(model); 20366 } else if (!_.isEmpty(rel)) { 20367 var idFromUrl = rel.substr(SCF.config.urlRoot.length); 20368 idFromUrl = idFromUrl.substr(0, idFromUrl.lastIndexOf(SCF.constants.URL_EXT)); 20369 ModelKlass = SCF.Models[data.model]; 20370 model = ModelKlass.findLocal("idFromUrl"); 20371 if (!model) { 20372 model = data.autofetch ? ModelKlass.find(idFromUrl) : new ModelKlass({ 20373 url: rel 20374 }); 20375 } 20376 ModelKlass.prototype._cachedModels[idFromUrl] = model; 20377 modelArray.push(model); 20378 } 20379 }); 20380 var CollectionKlass = SCF.Collections[data.collection] || Backbone.Collection; 20381 var collection = new CollectionKlass(); 20382 collection.model = ModelKlass; 20383 collection.parent = this; 20384 collection.set(modelArray, { 20385 silent: true 20386 }); 20387 attributes[key] = collection; 20388 } else if (_.isObject(relative)) { 20389 if (_.isUndefined(SCF.Models[data.model]) && _.isUndefined(SCF.Components[relative.resourceType])) { 20390 this.log.error("A relation key %s requested model %s but it is not available nor is the component type: %s", key, data.model, relative.resourceType); 20391 return; 20392 } 20393 ModelKlass = SCF.Models[data.model] || SCF.Components[relative.resourceType].Model; 20394 model = ModelKlass.findLocal(relative.id) || ModelKlass.createLocally(relative); 20395 attributes[key] = model; 20396 } else { 20397 var url = relative; 20398 if (!url) { 20399 if (data.path) { 20400 if (data.path.substr(0, 1) === "/") { 20401 url = data.path; 20402 } else { 20403 url = SCF.config.urlRoot + attributes.id + "/" + data.path + SCF.constants.URL_EXT; 20404 } 20405 } else { 20406 return; 20407 } 20408 } 20409 ModelKlass = SCF.Models[data.model]; 20410 if (data.autofetch) { 20411 model = ModelKlass.find(url, undefined, true); 20412 } else { 20413 model = ModelKlass.findLocal(url, true) || new ModelKlass({ 20414 "url": url 20415 }); 20416 } 20417 attributes[key] = model; 20418 } 20419 } 20420 }, this); 20421 _.each(this.relationships, makeRelation); 20422 return attributes; 20423 }, 20424 toJSON: function() { 20425 var json = Backbone.Model.prototype.toJSON.apply(this); 20426 _.each(this.relationships, function(config, relation) { 20427 20428 var relative = json[relation]; 20429 if (relative.length <= 0) { 20430 delete json[relation]; 20431 return; 20432 } 20433 if (_.isArray(relative)) { 20434 var jsonArray = []; 20435 _.each(relative, function(rel) { 20436 if (rel instanceof Backbone.Model) 20437 jsonArray.push(rel.toJSON()); 20438 else 20439 jsonArray.push(rel); 20440 }); 20441 json[relation] = jsonArray; 20442 } else if (relative instanceof Backbone.Collection) { 20443 json[relation] = relative.toJSON(); 20444 } else if (relative instanceof Backbone.Model) { 20445 json[relation] = relative.toJSON(); 20446 } 20447 20448 }); 20449 return json; 20450 }, 20451 log: _logger 20452 }); 20453 SCF.Model.extend = function() { 20454 var child = Backbone.Model.extend.apply(this, arguments); 20455 var modelName = arguments[0].modelName; 20456 SCF.Models[modelName] = child; 20457 return child; 20458 }; 20459 SCF.View.bindEvents = function(view, eventTrigger) { 20460 var eventString = eventTrigger.attr("evt"); 20461 _.each(eventString.split(","), function(value) { 20462 var parts = value.split("="); 20463 var evt = $CQ.trim(parts[0]); 20464 var func = $CQ.trim(parts[1]); 20465 if (view[func]) { 20466 var eventHandler = _.bind(view[func], view); 20467 eventTrigger.off(evt); 20468 eventTrigger.on(evt, eventHandler); 20469 } 20470 }); 20471 }; 20472 SCF.View.bindDataFields = function(view, element) { 20473 var field = element.attr("data-attrib"); 20474 if (!view._fields) { 20475 view._fields = {}; 20476 } 20477 if (!_.isUndefined(view._fields[field])) { 20478 return; 20479 } 20480 var fieldType = element.attr("data-field-type"); 20481 var ManagerKlass = (_.isUndefined(SCF.fieldManagers[fieldType])) ? DefaultFieldType : SCF.fieldManagers[fieldType]; 20482 var manager = new ManagerKlass(element, {}, view.model); 20483 view._fields[field] = (function() { 20484 return { 20485 val: function() { 20486 if (arguments.length === 0) 20487 return manager.getValue(); 20488 else 20489 return manager.setValue(arguments[0]); 20490 }, 20491 focus: function() { 20492 return manager.focus(); 20493 }, 20494 destroy: function() { 20495 if (_.isFunction(manager.destroy)) { 20496 manager.destroy(); 20497 } 20498 } 20499 }; 20500 })(); 20501 }; 20502 SCF.View.bindDataForms = function(view, element) { 20503 var form = element.attr("data-form"); 20504 if (!view._forms) { 20505 view._forms = {}; 20506 } 20507 view._forms[form] = new SCFValidator($(element), false); 20508 }; 20509 SCF.Model.findLocal = function(mid, isUrl) { 20510 var id = isUrl ? mid.substr(SCF.config.urlRoot.length) : mid; 20511 if (this.prototype._cachedModels && this.prototype._cachedModels[id]) { 20512 return this.prototype._cachedModels[id]; 20513 } 20514 }; 20515 SCF.Model.createLocally = function(attributes) { 20516 var modelObj = new this.prototype.constructor(attributes); 20517 modelObj._isReady = true; 20518 this.prototype._cachedModels[modelObj.get("id")] = modelObj; 20519 return modelObj; 20520 }; 20521 SCF.Model.prototype.load = function(mid) { 20522 if (mid) { 20523 this.set({ 20524 "id": mid 20525 }, { 20526 silent: true 20527 }); 20528 } 20529 this.fetch({ 20530 success: function(model) { 20531 model._isReady = true; 20532 model.trigger("model:loaded", model); 20533 }, 20534 xhrFields: { 20535 withCredentials: true 20536 } 20537 }); 20538 }; 20539 SCF.Model.prototype.getConfigValue = function(key) { 20540 var config = this.get("configuration"); 20541 if (!_.isEmpty(config)) { 20542 return config[key]; 20543 } 20544 return null; 20545 }; 20546 SCF.Model.prototype.destroy = function(options) { 20547 var model = this; 20548 this.constructor.prototype._cachedModels[model.get("id")] = undefined; 20549 model.trigger("destroy", model, model.collection, options); 20550 }; 20551 20552 SCF.Model.prototype.parseServerError = function(jqxhr, text, error) { 20553 var errorDetails = $CQ.parseJSON(jqxhr.responseText); 20554 if (errorDetails.hasOwnProperty("status.code")) { 20555 errorDetails.status = errorDetails.status || {}; 20556 errorDetails.status.code = errorDetails["status.code"]; 20557 delete errorDetails["status.code"]; 20558 } 20559 if (errorDetails.hasOwnProperty("status.message")) { 20560 errorDetails.status = errorDetails.status || {}; 20561 errorDetails.status.message = errorDetails["status.message"]; 20562 delete errorDetails["status.message"]; 20563 } 20564 return { 20565 "error": error, 20566 "details": errorDetails 20567 }; 20568 }; 20569 20570 SCF.Model.find = function(mid, callback, isUrl) { 20571 var that = this; 20572 if (this.prototype._cachedModels && this.prototype._cachedModels[mid]) { 20573 var model = this.prototype._cachedModels[mid]; 20574 if (_.isFunction(callback)) { 20575 callback(model); 20576 } 20577 return model; 20578 } else { 20579 var newModel = new this.prototype.constructor({ 20580 id: mid 20581 }); 20582 if (isUrl) { 20583 newModel.url = mid; 20584 } 20585 //TODO figure out caching mechanism 20586 this.prototype._cachedModels[mid] = newModel; 20587 newModel.fetch({ 20588 dataType: "json", 20589 xhrFields: { 20590 withCredentials: true 20591 }, 20592 error: function(model, response) { 20593 if (response.status === 204 || response.status === 404) { 20594 SCF.log.debug("non existing resource"); 20595 model._isReady = true; 20596 model.trigger("model:loaded", model); 20597 if (_.isFunction(callback)) { 20598 callback(model); 20599 } 20600 } else { 20601 SCF.log.error("Error fetching model"); 20602 SCF.log.error(response); 20603 that.prototype._cachedModels[mid] = undefined; 20604 } 20605 20606 }, 20607 success: function(model) { 20608 model._isReady = true; 20609 model.trigger("model:loaded", model); 20610 if (_.isFunction(callback)) { 20611 callback(model); 20612 } 20613 } 20614 }); 20615 return newModel; 20616 } 20617 }; 20618 SCF.Collection = Backbone.Collection.extend({}); 20619 SCF.Collection.extend = function() { 20620 var child = Backbone.Collection.extend.apply(this, arguments); 20621 var collectioName = arguments[0].collectioName; 20622 SCF.Collections[collectioName] = child; 20623 return child; 20624 }; 20625 20626 SCF.registerComponent = function(componentName, modelKlass, viewKlass) { 20627 SCF.Components[componentName] = { 20628 Model: modelKlass, 20629 View: viewKlass, 20630 name: componentName 20631 }; 20632 }; 20633 20634 SCF.addLoadedComponent = function(resourceType, model, view) { 20635 if (!SCF.Components[resourceType]) { 20636 return; 20637 } 20638 if (!SCF.loadedComponents[resourceType]) { 20639 SCF.loadedComponents[resourceType] = {}; 20640 } 20641 SCF.loadedComponents[resourceType][model.id] = { 20642 "model": model, 20643 "view": view 20644 }; 20645 return SCF.loadedComponents[resourceType][model.id]; 20646 }; 20647 SCF.findTemplate = function(resourceId, templateName, resourceType) { 20648 if (arguments.length == 2) { 20649 resourceType = templateName; 20650 templateName = ""; 20651 }
20652 var templateKey = resourceType + "/" + templateName; 20653 if (SCF.templates[templateKey]) { 20654 return SCF.templates[templateKey]; 20655 } 20656 var template; 20657 $CQ.ajax({ 20658 async: false, 20659 // xhrFields: { 20660 // withCredentials: true 20661 // }, 20662 url: SCF.config.urlRoot + "/services/social/templates" + "?resourceType=" + resourceType + "&ext=hbs&selector=" + templateName 20663 }).done(function(data, status) { 20664 if (status == "success") { 20665 template = Handlebars.compile(data); 20666 SCF.templates[templateKey] = template; 20667 } 20668 }); 20669 return template; 20670 }; 20671 20672 SCF.log = _logger; 20673 20674 SCF.registerFieldType = function(fieldType, fieldTypeManager) { 20675 if (!(_.isFunction(fieldTypeManager.prototype.setValue))) { 20676 this.log.error("%s does not implement required method, \"setValue\"", fieldType); 20677 return; 20678 } 20679 if (!(_.isFunction(fieldTypeManager.prototype.getValue))) { 20680 this.log.error("%s does not implement required method, \"getValue\"", fieldType); 20681 return; 20682 } 20683 if (!(_.isFunction(fieldTypeManager.prototype.focus))) { 20684 this.log.error("%s does not implement required method, \"focus\"", fieldType); 20685 return; 20686 } 20687 if (!(_.isFunction(fieldTypeManager.prototype.destroy))) { 20688 this.log.error("%s does not implement required method, \"destroy\"", fieldType); 20689 return; 20690 } 20691 this.fieldManagers[fieldType] = fieldTypeManager; 20692 }; 20693 20694 var DefaultFieldType = function(element, config, model) { 20695 this.$el = element; 20696 }; 20697 20698 DefaultFieldType.prototype.setValue = function(val) { 20699 return this.$el.val(val); 20700 }; 20701 DefaultFieldType.prototype.getValue = function() { 20702 return this.$el.val(); 20703 }; 20704 DefaultFieldType.prototype.focus = function() { 20705 this.$el.focus(); 20706 }; 20707 DefaultFieldType.prototype.destroy = function() {}; 20708 20709 SCF.View.prototype.launchModal = function(element, header, closeCallBack) { 20710 var modalScreen = $CQ("<div class=\"scf scf-modal-screen\"></div>"); 20711 var modalDialog = $CQ("<div class=\"scf scf-modal-dialog\" style=\"display:none;\">" + 20712 "<h2 class=\"scf-modal-header\">" + header + 20713 "</h2><div class=\"scf-modal-close\" tabindex=\"0\" role=\"button\" aria-pressed=\"false\">X</div></div>"); 20714 var el = element; 20715 var parent = el.parent(); 20716 modalDialog.append(el); 20717 el.show(); 20718 var close = function(e) { 20719 if (SCF.Util.mayCall(e, "preventDefault")) { 20720 e.preventDefault(); 20721 } 20722 el.hide(); 20723 parent.append(el); 20724 modalScreen.remove(); 20725 modalDialog.remove(); 20726 if (_.isFunction(closeCallBack)) { 20727 closeCallBack(); 20728 } 20729 }; 20730 20731 var closeByEnter = function(e) { 20732 if(e.which == 13) { 20733 if (SCF.Util.mayCall(e, "preventDefault")) { 20734 e.preventDefault(); 20735 } 20736 el.hide(); 20737 parent.append(el); 20738 modalScreen.remove(); 20739 modalDialog.remove(); 20740 if (_.isFunction(closeCallBack)) { 20741 closeCallBack(); 20742 } 20743 } 20744 }; 20745 20746 modalDialog.find(".scf-modal-close").keypress(closeByEnter); 20747 modalDialog.find(".scf-modal-close").click(close); 20748 modalDialog.find(".scf-js-modal-close").click(close); 20749 20750 $CQ("body").append(modalScreen); 20751 $CQ("body").append(modalDialog); 20752 var width = (window.innerWidth - modalDialog.innerWidth()) / 2; 20753 var height = (window.innerHeight - modalDialog.innerHeight()) / 2; 20754 modalDialog.css({ 20755 "top": height, 20756 "left": width 20757 }); 20758 modalDialog.show(); 20759 SCF.Util.addTabbingInDialog(modalDialog) ; 20760 return close; 20761 }; 20762 20763 SCF.View.prototype.overlayTemplate = "<div class=\"scf-overlay\">" + 20764 "<div class=\"scf-overlay-header btn-toolbar\">" + 20765 "<button class=\"btn btn-primary scf-ovelay-back-button\" title=\"{{i18n \"Back\"}}\">" + 20766 "<span class=\"scf-icon-left\"></span>" + 20767 "</button>" + 20768 "<h3>{{header}}</h3>" + 20769 "</div>" + 20770 "</div>"; 20771 SCF.View.prototype.loadOverlay = function(element, parent, header, closeCallback) { 20772 var template = Handlebars.compile(this.overlayTemplate);
20773 var overlay = $CQ(template({ 20774 'header': header 20775 })); 20776 var close = function() { 20777 overlay.remove(); 20778 parent.find(".scf-is-overlay-hidden").each(function() { 20779 $CQ(this).removeClass("scf-is-overlay-hidden"); 20780 }); 20781 if (closeCallback && _.isFunction(closeCallBack)) { 20782 closeCallBack(); 20783 } 20784 }; 20785 parent.children().each(function() { 20786 $CQ(this).addClass("scf-is-overlay-hidden"); 20787 }); 20788 overlay.append(element); 20789 parent.append(overlay); 20790 overlay.find(".scf-ovelay-back-button").click(close); 20791 return close; 20792 }; 20793 SCF.View.prototype.errorTemplate = "<h3>{{details.status.message}}</h3>"; 20794 SCF.View.prototype.addErrorMessage = function(element, error) { 20795 var template = Handlebars.compile(this.errorTemplate); 20796 var $el = $CQ(element); 20797 var $errorElement = $CQ(template(error)); 20798 $errorElement.addClass("scf-js-error-message"); 20799 $el.before($errorElement); 20800 }; 20801 SCF.View.prototype.compileTemplate = function(hbsMarkup) { 20802 return Handlebars.compile(hbsMarkup); 20803 }; 20804 SCF.View.prototype.clearErrorMessages = function(element, error) { 20805 this.$el.find(".scf-js-error-message").remove(); 20806 this.$el.find(".scf-error").removeClass("scf-error"); 20807 }; 20808 20809 SCF.ChildView = SCF.View.extend({ 20810 bindView: function() {}, 20811 bindDataForms: function() {}, 20812 bindDataFields: function() {}, 20813 bindEvents: function() {}, 20814 viewName: "ChildView" 20815 }); 20816 20817 SCF.Util = { 20818 // Allows you to pass in an object and see if the funcName is avaiable ot be called, 20819 // this only does a shallow check for now. 20820 "mayCall": function(obj, funcName) { 20821 if (_.isUndefined(obj) || _.isNull(obj)) { 20822 return false; 20823 } 20824 return (obj.hasOwnProperty(funcName) || obj[funcName] !== null) && _.isFunction(obj[funcName]); 20825 }, 20826 "announce": function(channel, data) { 20827 $CQ(document).trigger(channel, data); 20828 }, 20829 "listenTo": function(channel, listener) { 20830 $CQ(document).on(channel, function(e, data) { 20831 listener(data); 20832 e.stopImmediatePropagation(); 20833 }); 20834 }, 20835 "startsWith": function(sourceString, searchString) { 20836 return sourceString.substr(0, searchString.length) === searchString; 20837 }, 20838 "getContextPath": function() { 20839 var URL = CQ.shared.HTTP.getPath(); 20840 var pageExtension = CQ.shared.HTTP.getExtension(); 20841 var urlSplit = URL.split(pageExtension); 20842 if (urlSplit && urlSplit !== undefined) { 20843 if (urlSplit.length > 1) { 20844 return urlSplit[1]; 20845 } else { 20846 return urlSplit[0]; 20847 } 20848 } 20849 return ""; 20850 }, 20851 "addTabbingInDialog": function(e) { 20852 var inputs = e.find('select, input, textarea, button, a,div').filter(':visible'); 20853 var firstInput = inputs.first(); 20854 var lastInput = inputs.last(); 20855 firstInput.focus(); 20856 lastInput.on('keydown', function(e) { 20857 if ((e.which === 9 && !e.shiftKey)) { 20858 e.preventDefault(); 20859 firstInput.focus(); 20860 } 20861 }); 20862 /*redirect first shift+tab to last input*/ 20863 firstInput.on('keydown', function(e) { 20864 if ((e.which === 9 && e.shiftKey)) { 20865 e.preventDefault(); 20866 lastInput.focus(); 20867 } 20868 }); 20869 return close; 20870 } 20871 }; 20872 window.SCF = SCF; 20873 20874})(Backbone, $CQ, _, Handlebars); 20875 20876/* 20877 * 20878 * ADOBE CONFIDENTIAL 20879 * __________________ 20880 * 20881 * Copyright 2012 Adobe Systems Incorporated 20882 * All Rights Reserved. 20883 *
20884 * NOTICE: All information contained herein is, and remains 20885 * the property of Adobe Systems Incorporated and its suppliers, 20886 * if any. The intellectual and technical concepts contained 20887 * herein are proprietary to Adobe Systems Incorporated and its 20888 * suppliers and are protected by trade secret or copyright law. 20889 * Dissemination of this information or reproduction of this material 20890 * is strictly forbidden unless prior written permission is obtained 20891 * from Adobe Systems Incorporated. 20892 */ 20893(function(Handlebars, moment, SCF, $CQ, _, CQ) { 20894 "use strict"; 20895 20896 var slingInclude = function(path, templateName, resourceType) { 20897 var html = ""; 20898 var params = { 20899 resourcePath: path 20900 }; 20901 if (resourceType) { 20902 SCF.log.warn("Forcing resource type is not supported when sling including on the client side"); 20903 } 20904 if (templateName) { 20905 params.selector = templateName; 20906 } 20907 var urlToFetch = SCF.config.urlRoot + path; 20908 urlToFetch += templateName ? "." + templateName + ".html" : ".html"; 20909 $CQ.ajax({ 20910 async: false, 20911 // xhrFields: { 20912 // withCredentials: true 20913 // }, 20914 url: urlToFetch 20915 }).done(function(data, status) { 20916 if (status == "success") { 20917 html = data; 20918 } 20919 }); 20920 return new Handlebars.SafeString(html); 20921 }; 20922 Handlebars.registerHelper("include", function(context, options) { 20923 20924 20925 if (arguments.length === 1) { 20926 options = context; 20927 context = undefined; 20928 } 20929 var parentView = options.data.parentView; 20930 var getModelName = function(viewName) { 20931 if (!viewName) { 20932 return undefined; 20933 } 20934 var idx = viewName.lastIndexOf("View"); 20935 if (idx !== -1) { 20936 return viewName.substr(0, idx) + "Model"; 20937 } else { 20938 return viewName + "Model"; 20939 } 20940 }; 20941 var bindModelView = _.isUndefined(options.hash.bind) ? true : options.hash.bind; 20942 var viewName = options.hash.view; 20943 var templateName = options.hash.template; 20944 var resourceType = options.hash.resourceType; 20945 var path = options.hash.path; 20946 var modelName = options.hash.model || getModelName(viewName); 20947 var viewObj, modelObj, ViewKlass, ModelKlass, id, component; 20948 20949 20950 if (_.isObject(context)) { 20951 resourceType = resourceType || context.resourceType; 20952 component = SCF.Components[resourceType]; 20953 if ((_.isUndefined(component)) && (resourceType.match(/^(\/apps)|(\/libs)/))) { 20954 var baseType = resourceType.substring(6); 20955 component = SCF.Components[baseType]; 20956 } 20957 var cTemplate; 20958 20959 id = context.id; 20960 if (!id) { 20961 var url = context.url; 20962 if (!url) { 20963 SCF.log.warn("No resource id found for context: "); 20964 SCF.log.warn(context); 20965 } 20966 var idFromUrl = url.substr(SCF.config.urlRoot.length); 20967 idFromUrl = idFromUrl.substr(0, idFromUrl.lastIndexOf(SCF.constants.URL_EXT)); 20968 id = idFromUrl; 20969 } 20970 20971 if (templateName) { 20972 cTemplate = SCF.findTemplate(id, templateName, resourceType); 20973 } else { 20974 cTemplate = SCF.findTemplate(id, resourceType); 20975 } 20976 20977 var getViewKlass = function() { 20978 //use an SCF.ChildView if the template being included belongs to the same component and rendering the same resource 20979 if (parentView.model.get("resourceType") === resourceType && parentView.model.id === id) { 20980 return SCF.ChildView; 20981 } 20982 return component ? component.View : undefined; 20983 }; 20984 20985 ViewKlass = viewName ? SCF.Views[viewName] : getViewKlass(); 20986 ViewKlass = bindModelView ? ViewKlass : undefined; 20987 ModelKlass = modelName ? SCF.Models[modelName] : component ? component.Model : undefined; 20988 ModelKlass = bindModelView ? ModelKlass : undefined; 20989 20990 if (!ViewKlass && !cTemplate) { 20991 if (id) { 20992 return slingInclude(id, templateName, resourceType); 20993 } 20994 SCF.log.error("No view or template found for " + resourceType + " and template " + templateName); 20995 return ""; 20996 } 20997 20998 20999 if (!ViewKlass && cTemplate) { 21000 return new Handlebars.SafeString(cTemplate(SCF.View.prototype.getMergedContexts(context))); 21001 } 21002 21003 21004 if (ViewKlass && !cTemplate) { 21005 SCF.log.error("No template found for " + resourceType + " and template " + templateName); 21006 return ""; 21007 } 21008 21009 if (!ModelKlass || !id) { 21010 viewObj = new ViewKlass({ 21011 "context": context 21012 }); 21013 } else { 21014 modelObj = ModelKlass.findLocal(id); 21015 if (!modelObj) { 21016 modelObj = ModelKlass.createLocally(context); 21017 } 21018 if (modelObj.isNew()) { 21019 modelObj.load(id); 21020 } 21021 viewObj = new ViewKlass({ 21022 model: modelObj 21023 }); 21024 21025 } 21026 if (templateName && cTemplate) { 21027 viewObj.template = cTemplate; 21028 } else if (cTemplate) { 21029 ViewKlass.prototype.template = cTemplate; 21030 } 21031 21032 } else { 21033 21034 var isPathAbsolute = path ? path.slice(0, 1) === "/" : false;
21035 if (!context && !isPathAbsolute) { 21036 SCF.log.error("Must provide context path when including " + resourceType); 21037 return ""; 21038 } 21039 21040 id = isPathAbsolute ? path : context + "/" + path; 21041 21042 if (resourceType) { 21043 component = SCF.Components[resourceType]; 21044 } 21045 if (bindModelView && (component || (viewName && modelName))) { 21046 ViewKlass = !component ? SCF.Views[viewName] : component.View; 21047 ModelKlass = !component ? SCF.Models[modelName] : component.Model; 21048 } 21049 21050 if (ViewKlass && ModelKlass) { 21051 var isUrl = id.indexOf("http://") === 0; 21052 modelObj = ModelKlass.find(id, undefined, isUrl); 21053 viewObj = new ViewKlass({ 21054 "model": modelObj 21055 }); 21056 if (templateName) { 21057 viewObj.template = SCF.findTemplate(id, templateName, resourceType); 21058 } else if (typeof viewObj.template === "undefined") { 21059 SCF.log.info("Getting default template for " + resourceType); 21060 viewObj.template = SCF.findTemplate(id, resourceType, resourceType); 21061 } 21062 } else { 21063 return slingInclude(id, templateName, resourceType); 21064 } 21065 } 21066 viewObj.setParent(parentView); 21067 if (!ViewKlass.prototype.template && viewObj.template && ViewKlass != SCF.ChildView) { 21068 ViewKlass.prototype.template = SCF.findTemplate(modelObj.get("id"), resourceType); 21069 21070 } 21071 viewObj.templateName = templateName || "default"; 21072 viewObj.resource = id; 21073 return new Handlebars.SafeString("<!-- data-view='" + viewObj.cid + "'-->"); 21074 }); 21075 21076 Handlebars.registerHelper("equals", function(lvalue, rvalue, options) { 21077 if (arguments.length < 3) 21078 throw new Error("Handlebars Helper equal needs 2 parameters"); 21079 if (lvalue != rvalue) { 21080 return options.inverse(this); 21081 } else { 21082 return options.fn(this); 21083 } 21084 }); 21085 21086 Handlebars.registerHelper('lt', function(a, b) { 21087 var next = arguments[arguments.length - 1]; 21088 return (a < b) ? next.fn(this) : next.inverse(this); 21089 }); 21090 21091 Handlebars.registerHelper("lastPath", function(context, options) { 21092 var idx = context.lastIndexOf("/"); 21093 return context.slice(idx + 1); 21094 }); 21095 21096 Handlebars.registerHelper("getComponentName", function(context, options) { 21097 return context.split('/')[1]; 21098 }); 21099 21100 Handlebars.registerHelper("pretty-time", function(context, options) { 21101 if (!context) { 21102 return ""; 21103 } 21104 var time = new Date(context); 21105 var now = new Date(); 21106 var diff = now.getTime() - time.getTime(); 21107 var second = 1000; 21108 var minute = second * 60; 21109 var hour = minute * 60; 21110 var day = hour * 24; 21111 moment.locale(CQ.shared.I18n.getLocale()); 21112 // max days ago before switching to actual date. If not passed in then hardcoding as 60. 21113 var days_cutoff = options.hash.daysCutoff ? options.hash.daysCutoff : 60; 21114 if (diff < minute) { 21115 time = Math.round(diff / second) + ""; 21116 if (time == 1) { 21117 return new Handlebars.SafeString(CQ.I18n.get("{0} second ago", time)); 21118 } 21119 return new Handlebars.SafeString(CQ.I18n.get("{0} seconds ago", time)); 21120 } else if (diff < hour) { 21121 time = Math.round(diff / minute); 21122 if (time == 1) { 21123 return new Handlebars.SafeString(CQ.I18n.get("{0} minute ago", time)); 21124 } 21125 return new Handlebars.SafeString(CQ.I18n.get("{0} minutes ago", time)); 21126 } else if (diff < day) { 21127 time = Math.round(diff / hour); 21128 if (time == 1) { 21129 return new Handlebars.SafeString(CQ.I18n.get("{0} hour ago", time)); 21130 } 21131 return new Handlebars.SafeString(CQ.I18n.get("{0} hours ago", time)); 21132 } else if (diff < day * days_cutoff) { 21133 time = Math.round(diff / day); 21134 if (time == 1) {
21135 return new Handlebars.SafeString(CQ.I18n.get("{0} day ago", time)); 21136 } 21137 return new Handlebars.SafeString(CQ.I18n.get("{0} days ago", time)); 21138 } else { 21139 return new Handlebars.SafeString(moment(time).format(CQ.I18n.get("MMM DD YYYY, h:mm A", null, "moment.js, communities moderation"))); 21140 } 21141 }); 21142 21143 Handlebars.registerHelper("pages", function(context, options) { 21144 var pageInfo = context; 21145 21146 if (pageInfo.hasOwnProperty("selectedPage") && pageInfo.hasOwnProperty("totalPages") && pageInfo.hasOwnProperty("pageSize") && pageInfo.hasOwnProperty("basePageURL")) { 21147 var output = ""; 21148 if (pageInfo.totalPages <= 1) { 21149 return output; 21150 } 21151 var pageSize = Math.abs(pageInfo.pageSize); 21152 var pageSign = (pageInfo.orderReversed) ? "-" : ""; 21153 var currentPage = pageInfo.selectedPage; 21154 21155 var leftLimit = currentPage; 21156 if ((leftLimit - 2) > 0 && pageInfo.totalPages > 5) { 21157 leftLimit = leftLimit - 2; 21158 } else if (leftLimit == 2 && pageInfo.totalPages > 5) { 21159 //for https://jira.corp.adobe.com/browse/NPR-30827 21160 leftLimit = 1; 21161 } 21162 21163 if (pageInfo.totalPages <= 5) { 21164 leftLimit = 1; 21165 } else { 21166 if (pageInfo.totalPages - currentPage < 2) { 21167 leftLimit = pageInfo.totalPages - 4; 21168 } 21169 } 21170 var rightLimit = leftLimit + 5; 21171 if (rightLimit > pageInfo.totalPages) { 21172 rightLimit = pageInfo.totalPages + 1; 21173 } 21174 21175 for (var i = leftLimit; i < rightLimit; i++) { 21176 pageInfo.pageNumber = i; 21177 pageInfo.currentPageUrl = pageInfo.basePageURL + "." + ((i - 1) * pageSize) + "." + pageSign + pageSize + ".html"; 21178 pageInfo.currentPage = i == pageInfo.selectedPage; 21179 pageInfo.suffix = ((i - 1) * pageSize) + "." + pageSign + pageSize; 21180 output += options.fn(pageInfo); 21181 } 21182 return output; 21183 } else { 21184 return ""; 21185 } 21186 }); 21187 21188 Handlebars.registerHelper("loadmore", function(context, options) { 21189 var pageInfo = context.pageInfo; 21190 var items = context.items; 21191 if (!context.totalSize || !pageInfo) { 21192 return ""; 21193 } 21194 if (!(!_.isUndefined(pageInfo.selectedPage) && context.totalSize && pageInfo.pageSize)) { 21195 return ""; 21196 } 21197 if (context.totalSize <= 0) { 21198 return ""; 21199 } 21200 var info = {}; 21201 info.suffix = pageInfo.nextSuffix; 21202 var remaining = this.totalSize; 21203 if (!_.isUndefined(items)) { 21204 remaining = remaining - items.length; 21205 } 21206 if (remaining === 0) { 21207 return ""; 21208 } 21209 var url = pageInfo.nextPageURL; 21210 if (!_.isUndefined(url) && url.indexOf(".json", url.length - 5) !== -1) { 21211 url = url.substr(0, url.length - 5); 21212 url += ".html"; 21213 } 21214 info.remaining = remaining; 21215 info.moreURL = url; 21216 return options.fn(info); 21217 }); 21218 21219 Handlebars.registerHelper("dateUtil", function(context, options) { 21220 var date = context; 21221 var format = options.hash.format; 21222 var timezone = options.hash.timezone; 21223 if (!date || typeof date != "number") { 21224 date = new Date().getTime(); 21225 } else { 21226 date = new Date(date); 21227 } 21228 format = format.replace(/y/g, "Y"); // replace java "yyyy" with moment "YYYY" 21229 format = format.replace(/\bdd\b/gi, "DD"); // replace java "dd" with moment "DD" 21230 format = format.replace(/\bd\b/gi, "D"); // replace java "d" with moment "D" 21231 format = format.replace(/\bEEEE\b/gi, "dddd"); 21232 moment.locale(CQ.shared.I18n.getLocale()); 21233 21234 if (timezone && moment.tz) { 21235 return new Handlebars.SafeString(moment.tz(date, timezone).format(format)); 21236 } 21237 21238 return new Handlebars.SafeString(moment(date).format(format)); 21239 }); 21240 21241 Handlebars.registerHelper("i18n", function(context, options) { 21242 if (arguments.length > 1) { 21243 var i18nArgs = _.rest(arguments); 21244 return CQ.I18n.get(context, i18nArgs); 21245 } else { 21246 return CQ.I18n.get(context); 21247 } 21248 }); 21249 21250 Handlebars.registerHelper("xss-htmlAttr", function(context, options) { 21251 //encodeForHTMLAttr 21252 var $div = $CQ("div"); 21253 $div.attr("data-xss", context); 21254 var cleaned = $div.attr("data-xss"); 21255 return CQ.shared.XSS.getXSSValue(cleaned); 21256 // if (!context) { 21257 // return ""; 21258 // } 21259 // return new Handlebars.SafeString(context.toString().replace(/\./g, '-')); 21260 }); 21261 Handlebars.registerHelper("xss-jsString", function(context, options) { 21262 //encodeForJSString 21263 return CQ.shared.XSS.getXSSValue(context); 21264 }); 21265 Handlebars.registerHelper("xss-html", function(context, options) { 21266 //encodeForHTML 21267 return $CQ("<div></div>").text(context).html(); 21268 }); 21269 Handlebars.registerHelper("xss-validHref", function(context, options) { 21270 //getValidHref 21271 return encodeURI(context); 21272 }); 21273 Handlebars.registerHelper("dom-id", function(context, options) { 21274 if (!context) { 21275 return ""; 21276 } 21277 var domId = $CQ.trim(context); 21278 domId = domId.replace(/\./g, "-"); 21279 domId = domId.replace(/\//g, "-"); 21280 domId = domId.replace(/:/g, "-"); 21281 return domId; 21282 }); 21283 Handlebars.registerHelper("abbreviate", function(context, options) { 21284 21285 if (!context) { 21286 return ""; 21287 } 21288 var maxWords = options.hash.maxWords; 21289 var maxLength = options.hash.maxLength; 21290 var safeString = options.hash.safeString; 21291 var ctx = $CQ.trim(context); 21292 var initialLength = ctx.length; 21293 21294 var words = ctx.substring(0, maxLength).split(" "); 21295 var abb = words.slice(0, words.length > maxWords ? maxWords : words.length).join(" "); 21296 var abbContent = initialLength != abb.length && options.fn ? options.fn(this) : ""; 21297 if (safeString) { 21298 return new Handlebars.SafeString(abb) + abbContent; 21299 } 21300 return abb + abbContent; 21301 }); 21302 21303 Handlebars.registerHelper("includeClientLib", function(context, options) { 21304 // This helper only works on the server side. 21305 return ""; 21306 }); 21307 21308 Handlebars.registerHelper("if-wcm-mode", function(context, options) { 21309 // This helper only works on the server side. 21310 return ""; 21311 }); 21312 21313 Handlebars.registerHelper("getContextPath", function(context, options) { 21314 var contextPath = ""; 21315 if (Granite && Granite.HTTP.getContextPath()) { 21316 contextPath = Granite.HTTP.getContextPath(); 21317 } 21318 return contextPath; 21319 }); 21320 21321})(Handlebars, moment, SCF, $CQ, _, CQ); 21322 21323/* 21324 * 21325 * ADOBE CONFIDENTIAL 21326 * __________________ 21327 * 21328 * Copyright 2012 Adobe Systems Incorporated 21329 * All Rights Reserved. 21330 *
21331 * NOTICE: All information contained herein is, and remains 21332 * the property of Adobe Systems Incorporated and its suppliers, 21333 * if any. The intellectual and technical concepts contained 21334 * herein are proprietary to Adobe Systems Incorporated and its 21335 * suppliers and are protected by trade secret or copyright law. 21336 * Dissemination of this information or reproduction of this material 21337 * is strictly forbidden unless prior written permission is obtained 21338 * from Adobe Systems Incorporated. 21339 */ 21340(function($CQ, SCF, _, CQ, Granite) { 21341 "use strict"; 21342 var LoginView = SCF.View.extend({ 21343 viewName: "Login", 21344 tagName: "div", 21345 className: "scf-login", 21346 init: function() { 21347 this._isReady = false; 21348 this.listenTo(this.model, this.model.events.LOGGED_IN_SUCCESS, this.render); 21349 this.listenTo(this.model, this.model.events.LOGGED_OUT, this.render); 21350 }, 21351 loginAction: function() { 21352 if (this.model.get("loggedIn")) { 21353 this.$el.children(".login-dialog").hide(); 21354 this.logout(); 21355 } else { 21356 var loginDialog = this.$el.children(".login-dialog").toggle(); 21357 loginDialog.find("input:first").focus(); 21358 } 21359 }, 21360 logout: function() { 21361 this.model.logout(); 21362 }, 21363 login: function() { 21364 var username = this.getField("username"); 21365 var password = this.getField("password"); 21366 if (username === "" || password === "") { 21367 return; 21368 } 21369 this.model.login(username, password); 21370 } 21371 }); 21372 var LoginModel = SCF.Model.extend({ 21373 moderatorCheckAttribute: "moderatorCheck", 21374 events: { 21375 LOGGED_IN_SUCCESS: "login:success", 21376 LOGGED_IN_FAIL: "login:failed", 21377 LOGGED_OUT: "logout:success" 21378 }, 21379 initialize: function(attributes, options) { 21380 this._isReady = false; 21381 if (CQ.shared.User.data === undefined || CQ.shared.User.data === null) { 21382 //Dont call the currentuser.json if data is available 21383 this.initUser(options); 21384 } else { 21385 this.getLoggedInUser(options); 21386 } 21387 }, 21388 defaults: { 21389 "loggedIn": false 21390 }, 21391 isReady: function() { 21392 return this._isReady; 21393 }, 21394 checkIfModeratorFor: function(resource) { 21395 var componentList = this.attributes.hasOwnProperty(this.moderatorCheckAttribute) ? 21396 this.attributes[this.moderatorCheckAttribute] : []; 21397 return this.attributes.loggedIn && _.contains(componentList, resource); 21398 }, 21399 checkIfUserCanPost: function(resource) { 21400 var componentList = this.attributes.hasOwnProperty("mayPost") ? 21401 this.attributes.mayPost : []; 21402 return this.attributes.loggedIn && _.contains(componentList, resource); 21403 }, 21404 setLanguage: function(data) { 21405 var langFromPreferences = data.preferences && 21406 data.preferences.language ? 21407 data.preferences.language : 21408 "en"; 21409 var language = document.documentElement.lang || langFromPreferences; 21410 CQ.shared.I18n.setLocale(language); 21411 }, 21412 initUser: function(options) { 21413 var CURRENT_USER_URL = CQ.shared.HTTP.externalize("/libs/granite/security/currentuser" + CQ.shared.HTTP.EXTENSION_JSON + "?props=preferences/language"); 21414 CURRENT_USER_URL = CQ.shared.HTTP.noCaching(CURRENT_USER_URL); 21415 var that = this; 21416 $CQ.ajax({ 21417 url: CURRENT_USER_URL, 21418 type: "GET", 21419 success: function(result) { 21420 that.getLoggedInUser(options, result.home); 21421 that.setLanguage(result); 21422 }, 21423 async: false 21424 }); 21425 }, 21426 getLoggedInUser: function(options, userPath) { 21427 var that = this; 21428 var moderationCheckParameter; 21429 if (options.hasOwnProperty(LoginModel.moderatorCheckAttribute)) { 21430 moderationCheckParameter = "?" + LoginModel.moderatorCheckAttribute + "="; 21431 _.each(options[LoginModel.moderatorCheckAttribute], function(item) { 21432 moderationCheckParameter += item + ","; 21433 }); 21434 moderationCheckParameter = moderationCheckParameter.substring(0, moderationCheckParameter.length - 1); 21435 } 21436 var userHomePath = ""; 21437 if (userPath !== undefined) { 21438 userHomePath = userPath; 21439 } else if (CQ.shared.User.initialized) { 21440 userHomePath = CQ.shared.User.data.home; 21441 } else { 21442 // AEM user not initialized force it: 21443 var f = CQ.shared.User.init(); 21444 userHomePath = CQ.shared.User.data.home; 21445 } 21446 21447 $CQ.ajax({ 21448 url: SCF.config.urlRoot + "/services/social/getLoggedInUser" + moderationCheckParameter + "&h=" + userHomePath, 21449 xhrFields: { 21450 withCredentials: true 21451 }, 21452 type: "GET" 21453 }).done(function(user) { 21454 if (user.name) { 21455 that.set({ 21456 "loggedIn": true 21457 }); 21458 that.set(user); 21459 } 21460 that._isReady = true; 21461 if (typeof options !== "undefined" && options.silent) { 21462 that.trigger("model:loaded", { 21463 model: that, 21464 silent: true 21465 }); 21466 } else { 21467 that.trigger("model:loaded", { 21468 model: that, 21469 silent: false 21470 }); 21471 } 21472 }); 21473 }, 21474 logout: function() { 21475 var that = this; 21476 $CQ.ajax({ 21477 url: SCF.config.urlRoot + "/services/social/logout", 21478 xhrFields: { 21479 withCredentials: true 21480 }, 21481 type: "GET" 21482 }).always(function() { 21483 that.clear(); 21484 that.trigger(that.events.LOGGED_OUT); 21485 }); 21486 }, 21487 login: function(username, password) { 21488 var that = this; 21489 $CQ.ajax({ 21490 url: SCF.config.urlRoot + "/libs/login.html/j_security_check", 21491 xhrFields: { 21492 withCredentials: true 21493 }, 21494 data: { 21495 j_username: username, 21496 j_password: password, 21497 j_validate: "true" 21498 }, 21499 type: "POST" 21500 }).success(function(loginResult, textStatus, jqXHR, id) { 21501 var amIAuthenticated = jqXHR.getResponseHeader("Set-Cookie")
21501=== null || jqXHR.getResponseHeader("Set-Cookie") !== ""; 21502 if (!amIAuthenticated) { 21503 this.trigger(this.events.LOGGED_IN_FAIL, { 21504 "user": username 21505 }); 21506 } else { 21507 that.getLoggedInUser(); 21508 that.trigger(that.events.LOGGED_IN_SUCCESS, { 21509 "user": username 21510 }); 21511 } 21512 }); 21513 } 21514 }); 21515 LoginModel.moderatorCheckAttribute = "moderatorCheck"; 21516 SCF.LoginView = LoginView; 21517 SCF.LoginModel = LoginModel; 21518 21519 SCF.registerComponent("login", SCF.LoginModel, SCF.LoginView); 21520 21521})($CQ, SCF, _, CQ, Granite); 21522 21523/* 21524 * 21525 * ADOBE CONFIDENTIAL 21526 * __________________ 21527 * 21528 * Copyright 2012 Adobe Systems Incorporated 21529 * All Rights Reserved. 21530 * 21531 * NOTICE: All information contained herein is, and remains 21532 * the property of Adobe Systems Incorporated and its suppliers, 21533 * if any. The intellectual and technical concepts contained 21534 * herein are proprietary to Adobe Systems Incorporated and its 21535 * suppliers and are protected by trade secret or copyright law. 21536 * Dissemination of this information or reproduction of this material 21537 * is strictly forbidden unless prior written permission is obtained 21538 * from Adobe Systems Incorporated. 21539 */ 21540//file: bootstrap.js 21541(function(_, $CQ, Backbone, Handlebars, SCF) { 21542 "use strict"; 21543 var contextPath = CQ.shared.HTTP.getContextPath(); 21544 SCF.events = SCF.events || {}; 21545 SCF.events.BOOTSTRAP_REQUEST = "scf-bootstrap-request"; 21546 21547 SCF.config.urlRoot = window.location.protocol + "//" + window.location.host; 21548 if (contextPath !== null && contextPath.length > 0) { 21549 SCF.config.urlRoot += contextPath; 21550 } 21551 var addView = function(component) { 21552 var model = component.model; 21553 //If the component type isn't registered do nothing 21554 if (SCF.Components[component.type]) { 21555 var templateUsed = component.template ? 21556 SCF.findTemplate(component.id, component.template, component.type) : 21557 SCF.findTemplate(component.id, component.type); 21558 var view = new SCF.Components[component.type].View({ 21559 "model": model, 21560 el: component.el 21561 }); 21562 if (component.template) { 21563 view.template = templateUsed; 21564 } else { 21565 SCF.Components[component.type].View.prototype.template = templateUsed; 21566 } 21567 view.templateName = component.template || "default"; 21568 view.resource = component.id; 21569 // Bootstrap was not determining parent views at all which broke updates 21570 _.each(SCF.loadedComponents, function(typeObject) { 21571 _.each(typeObject, function(type, id) { 21572 if (model.attributes.hasOwnProperty("parentId")) { 21573 if (id === model.attributes.parentId) { 21574 view.setParent(type.view); 21575 } 21576 } else if (view._parentView === undefined || view._parentView === null) { 21577 // If there isn't a parent ID in the data wire it up via the dom 21578 // Search for a parent to this el that is an SCF component, meaning it has 21579 // both and ID and a resource type. 21580 var $parentEl = view.$el.parents("[data-component-id][data-scf-component]"); 21581 if ($parentEl && $parentEl.length === 1) { 21582 var domParentId = $parentEl.attr("data-component-id"); 21583 var resourceType = $parentEl.attr("data-scf-component"); 21584 var parentSCFComponentByResource = SCF.loadedComponents[resourceType]; 21585 // Check to make sure a component is registered for this type. 21586 if (parentSCFComponentByResource !== undefined) { 21587 var parentSCFComponent = parentSCFComponentByResource[domParentId]; 21588 // Make sure the id is registered and it really does have a view. 21589 if (parentSCFComponent !== undefined && parentSCFComponent.hasOwnProperty("view")) { 21590 view.setParent(parentSCFComponent.view); 21591 } 21592 } 21593 } 21594 } 21595 }); 21596 }); 21597 if (model.cacheFixed) { 21598 view.render(); 21599 } 21600 component.view = view; 21601 } 21602 }; 21603 21604 var addModel = function(component) {
21605 //If the component type isn't registered do nothing 21606 if (SCF.Components[component.type]) { 21607 var model; 21608 var modelHolder = component.modelHolder; 21609 var ModelKlass = SCF.Components[component.type].Model; 21610 if (modelHolder.length > 0) { 21611 var modelText = $CQ(modelHolder[0]).text(); 21612 if (modelText === "") { 21613 modelText = modelHolder[0].text; 21614 } 21615 var modelJSON = $CQ.parseJSON(modelText); 21616 component.id = modelJSON.id; 21617 model = ModelKlass.findLocal(component.id); 21618 if (!model) { 21619 model = SCF.Components[component.type].Model.createLocally(modelJSON); 21620 } 21621 } else { 21622 model = ModelKlass.findLocal(component.id); 21623 if (!model) { 21624 // if we didn't find the model load it based on the ID which is the path to the component. 21625 model = SCF.Components[component.type].Model.find(component.id); 21626 } 21627 } 21628 component.model = model; 21629 } 21630 }; 21631 21632 // Creates a component based on the scf ID the resource type and an optional template. 21633 var createComponent = function(id, type, template, $el) { 21634 // Find the json model on the page. 21635 var modelHolder = $CQ("script[type='application/json'][id='" + id + "']"); 21636 var component = { 21637 id: id, 21638 type: type, 21639 template: template, 21640 modelHolder: modelHolder, 21641 el: $el 21642 }; 21643 var model = addModel(component); 21644 var view = addView(component); 21645 return SCF.addLoadedComponent(type, model, view); 21646 }; 21647 // A helper method for inspecting a scf component piece of markup and extract some data from it. 21648 var extractComponentFromElement = function($el) { 21649 var component = { 21650 id: $el.attr("data-component-id"), 21651 type: $el.data("scf-component"), 21652 template: $el.data("scf-template"), 21653 modelHolder: $CQ("script[type='application/json'][id='" + $el.attr("data-component-id") + "']"), 21654 el: $el 21655 }; 21656 21657 return component; 21658 }; 21659 21660 var fullBootstrap = function() { 21661 var $CQcomponents = $CQ("[data-scf-component]"); 21662 var allComponents = [], 21663 componentsToBoostrap = []; 21664 // for each component on the page get the meta data. 21665 $CQcomponents.each(function(idx, el) { 21666 var component = extractComponentFromElement($(el)); 21667 if (!SCF.loadedComponents[component.type] || !SCF.loadedComponents[component.type][component.id]) { 21668 componentsToBoostrap.push(component); 21669 } 21670 allComponents.push(component); 21671 }); 21672 21673 // If there were components startup the user model. This gives the user model a bit of head start and reduces flicker on the screen. 21674 // Allow newly added components to reinvoke the Session model for all the components to ensure 21675 // The session has alll the component's moderator attributes set correctly. (even thought they 21676 // live at a page level.) 21677 if (componentsToBoostrap.length > 0) { 21678 var options = {}; 21679 options.silent = true; 21680 options[SCF.LoginModel.moderatorCheckAttribute] = _.map(allComponents, function(item) { 21681 var dataObj; 21682 if (item.id.indexOf("/content/usergenerated") === -1) { 21683 // If the component itself isn't in usergenerated then we should check it for moderators 21684 return item.id; 21685 } 21686 try { 21687 dataObj = JSON.parse(item.modelHolder.text()); 21688 } catch (e) { 21689 // If the component's data can't be turned in JSON just skip it, something 21690 // is probably wrong if this is happening. 21691 return false; 21692 } 21693 if (!(dataObj.hasOwnProperty("sourceComponentId"))) { 21694 // If the component doesn't have a sourceComponentId then it's not moderatable, 21695 // any tallies for example. 21696 return false;
21697 } 21698 if (dataObj.sourceComponentId.indexOf("/content/usergenerated") !== -1) { 21699 // If the source component is also in user generated then we shouldn't need to check it as the 21700 // content parent is where configuration for moderation lives. 21701 return false; 21702 } 21703 return dataObj.sourceComponentId; 21704 21705 }); 21706 options[SCF.LoginModel.moderatorCheckAttribute] = _.compact(options[SCF.LoginModel.moderatorCheckAttribute]); 21707 if (SCF.Session) { 21708 SCF.Session.getLoggedInUser(options, undefined); 21709 } else { 21710 var log = new SCF.LoginModel({}, options); 21711 SCF.Session = log; 21712 } 21713 } 21714 21715 21716 _.each(componentsToBoostrap, function(component) { 21717 addModel(component); 21718 }); 21719 _.each(componentsToBoostrap, function(component) { 21720 addView(component); 21721 SCF.addLoadedComponent(component.type, component.model, component.view); 21722 }); 21723 }; 21724 21725 $CQ(document).ready(fullBootstrap); 21726 //Sometimes this script could be loaded multiple times 21727 if (!Backbone.History.started) { 21728 Backbone.history.start({ 21729 pushState: true, 21730 hasChange: false 21731 }); 21732 } 21733 $(document).on(SCF.events.BOOTSTRAP_REQUEST, fullBootstrap); 21734 SCF.addComponent = function(el) { 21735 var $el = $(el); 21736 if ($el.length === 0) { 21737 throw "Could not find requested element on page."; 21738 } 21739 var component = extractComponentFromElement($el); 21740 if (component === null) { 21741 throw "Component is already loaded."; 21742 } 21743 if (!component.id) { 21744 throw "Component does not have a data-component-id attribute, which is required"; 21745 } 21746 if (!component.type) { 21747 throw "Component does not have a data-scf-component attribute, which is required."; 21748 } 21749 return createComponent(component.id, component.type, component.template, component.el); 21750 }; 21751 21752 SCF.unloadComponent = function(id, type) { 21753 var typeList = SCF.loadedComponents[type]; 21754 if (typeList === null) { 21755 throw "Type " + type + " is not registered with SCF."; 21756 } 21757 var component = SCF.loadedComponents[type][id]; 21758 if (component === null || component === undefined) { 21759 throw "Could not find component with ID: " + id; 21760 } 21761 component.view.destroy(); 21762 component.model = null; 21763 delete SCF.loadedComponents[type][id]; 21764 }; 21765})(_, $CQ, Backbone, Handlebars, SCF); 21766 21767/* 21768 * 21769 * ADOBE CONFIDENTIAL 21770 * __________________ 21771 * 21772 * Copyright 2012 Adobe Systems Incorporated 21773 * All Rights Reserved. 21774 *
21775 * NOTICE: All information contained herein is, and remains 21776 * the property of Adobe Systems Incorporated and its suppliers, 21777 * if any. The intellectual and technical concepts contained 21778 * herein are proprietary to Adobe Systems Incorporated and its 21779 * suppliers and are protected by trade secret or copyright law. 21780 * Dissemination of this information or reproduction of this material 21781 * is strictly forbidden unless prior written permission is obtained 21782 * from Adobe Systems Incorporated. 21783 */ 21784(function(Backbone, $CQ, _, Handlebars) { 21785 "use strict"; 21786 21787 var CKRte = function(element, config, model, view) { 21788 var rteConfig = {}; 21789 rteConfig = _.extend(config, rteConfig); 21790 rteConfig = _.extend(this.config, rteConfig); 21791 var el = element.get()[0]; 21792 if (_.isUndefined(window.CKEDITOR)) { 21793 SCF.log.error("Rich text editor requested but unable to find CKEDITOR please include client library category: \"%s\" or disable RTE", "ckeditor"); 21794 return; 21795 } 21796 this.$el = element; 21797 var height = this.$el.data("editorheight"); 21798 var uploadUrl = SCF.config.urlRoot + model.get("id") + SCF.constants.URL_EXT; 21799 var modelConfigAttachmentAllowed = model.get("configuration"); 21800 modelConfigAttachmentAllowed = modelConfigAttachmentAllowed && modelConfigAttachmentAllowed.isAttachmentAllowed; 21801 21802 21803 if (rteConfig.extraPlugins === undefined) { 21804 rteConfig.extraPlugins = (window.CKEDITOR.config.extraPlugins) ? window.CKEDITOR.config.extraPlugins + 21805 "," : undefined; 21806 } 21807 21808 // Mentions support 21809 // We have embedded the mentions plugin in ckeditor - so no need to add it as an extra plugin (will be beneficial for performance) 21810 // Just check here if mentions is enabled for the component and then make the necessary configuration for the mentions support 21811 if (model.attributes && model.attributes.configuration && model.attributes.configuration.enableMentions) { 21812 21813 rteConfig.extraAllowedContent = 'a[*]'; // This is to enable hyperlinks to mentioned user's profiles in ckeditor 21814 21815 // This defines how you will see the users in the mentions drop down list 21816 var mentionsDropDownTemplate = '<li data-id="{id}"><img src="{avatarUrl}" alt="{name}">{name}</li>'; 21817 21818 // This defines how the mentioned user will look once we select them while writing the post . 21819 // Howeer when viewing the published post/comment mentions user will be dsiplayed as defined by UIMentionsPattern design property for that component 21820 var mentionsOutputTemplate = '<a href = "{friendlyUrl}" class = "social-mention" data-social-mention-authorizableid = "{authorizableId}">{name}</a>'; 21821 21822 var minCharsToTriggerMentionsFeed = 4; //should we make this configurable via a design property ? OR would it be an overkill ? 21823 21824 var maxLimitForMentionsDropDown = 20; //same thought ? should we make this configurable via a design property ? OR would it be an overkill ? 21825 21826 rteConfig.mentions = [{feed: function(options, callback) { 21827 var searchFor = options.query; 21828 var userListNodePath = model.attributes.sourceComponentId ? model.attributes.sourceComponentId : model.attributes.id; 21829 var dataUrl = window.location.origin + userListNodePath + '/userlist.social.0.20.json' + 21830 '?type=users&filter=[{"operation":"CONTAINS","./@rep:principalName":"' + 21831 searchFor + '"},{"operation":"CONTAINS","./@rep:principalName":"' + 21832 searchFor + "*" + '"},{"operation":"CONTAINS","profile/@givenName":"' + 21833 searchFor + "*" + '"},{"operation":"CONTAINS","profile/@familyName":"' + 21834 searchFor + "*" + '"}]&fromPublisher=true&_charset_=utf-8'; 21835 $.ajax({ 21836 async: false, 21837 url: Granite.HTTP.externalize(dataUrl), 21838 type: 'GET', 21839 success: function(resp) { 21840 if(resp.items != undefined) { 21841 callback(JSON.parse(JSON.stringify(resp.items))); 21842 } 21843 } 21844 }); 21845 },minChars: minCharsToTriggerMentionsFeed,itemsLimit: maxLimitForMentionsDropDown,itemTemplate: mentionsDropDownTemplate, outputTemplate: mentionsOutputTemplate}]; 21846 } 21847 21848 var toolbarArr = rteConfig.toolbar[0].items; 21849 var index; 21850 // Add oEmbed plugin by default for Blogs Articles and Calendar Events 21851 if (model.get("resourceType") === "social/journal/components/hbs/journal" || 21852 model.get("resourceType") === "social/calendar/components/hbs/calendar" || 21853 model.get("resourceType") === "social/ideation/components/hbs/ideation" || 21854 model.get("resourceType") === "social/ideation/components/hbs/idea" || 21855 (model.get("resourceType") === "social/calendar/components/hbs/event" || 21856 model.get("resourceType") === "social/journal/components/hbs/entry_topic") && 21857 element[0].dataset.rteType !== 'comment') { 21858 21859 // Add the oembed Icon to toolbar 21860 index = toolbarArr.indexOf("oembed"); 21861 if (index === -1) { 21862 rteConfig.toolbar[0].items.push("oembed"); 21863 } 21864 21865 if (rteConfig.extraPlugins === undefined) { 21866 rteConfig.extraPlugins = "oembed"; 21867 } else if (rteConfig.extraPlugins.length > 0 && rteConfig.extraPlugins.indexOf("oembed") === -1) { 21868 rteConfig.extraPlugins = rteConfig.extraPlugins.concat(",oembed"); 21869 } 21870 } else { // Need to remove the oembed plugin for the Blog Comment 21871 index = toolbarArr.indexOf("oembed"); 21872 if (index > 0) { 21873 toolbarArr.splice(index, 1); 21874 } 21875 } 21876 21877 if (modelConfigAttachmentAllowed) { 21878 rteConfig.filebrowserUploadUrl = uploadUrl; 21879 rteConfig.uploadUrl = uploadUrl; 21880 21881 // Add the Image Icon to toolbar 21882 index = toolbarArr.indexOf("Image"); 21883 if (index === -1) { 21884 rteConfig.toolbar[0].items.push("Image"); 21885 } 21886 21887 if (rteConfig.extraPlugins === undefined) { 21888 rteConfig.extraPlugins = "image2,uploadimage"; 21889 } else if (rteConfig.extraPlugins.length > 0 && rteConfig.extraPlugins.indexOf("image2,uploadimage") === -1) { 21890 rteConfig.extraPlugins = rteConfig.extraPlugins.concat(",image2,uploadimage"); 21891 } 21892 } else { 21893 // Add the Image Icon to toolbar 21894 index = toolbarArr.indexOf("Image"); 21895 if (index === -1) { 21896 rteConfig.toolbar[0].items.push("Image"); 21897 } 21898 21899 if (rteConfig.extraPlugins === undefined) { 21900 rteConfig.extraPlugins = "image2"; 21901 } else if (rteConfig.extraPlugins.length > 0 && rteConfig.extraPlugins.indexOf("image2") === -1) { 21902 rteConfig.extraPlugins = rteConfig.extraPlugins.concat(",image2"); 21903 } 21904 } 21905 21906 var domElementName = $CQ(el).attr("name"); 21907 if (_.isEmpty(domElementName)) { 21908 var modelId = model.get("id"); 21909 var idx = modelId.lastIndexOf("/"); 21910 modelId = modelId.slice(idx + 1); 21911 var attribName = $CQ(el).data("attrib"); 21912 modelId = attribName + "-" + modelId; 21913 $CQ(el).attr("name", modelId); 21914 domElementName = modelId; 21915 } 21916 var resizeEnabled = this.$el.data("editorresize"); 21917 if (resizeEnabled) { 21918 rteConfig.resize_enabled = true; 21919 } 21920 21921 if (_.isNumber(height)) { 21922 rteConfig.height = height; 21923 } 21924 21925 if (!window.CKEDITOR.instances[domElementName]) { 21926 this.editor = window.CKEDITOR.replace(el, rteConfig); 21927 } else { 21928 if (this.editor === undefined) { 21929 this.editor = window.CKEDITOR.instances[domElementName]; 21930 } 21931 } 21932 /*if (_.isNumber(height)) { 21933 delete this.config.height; 21934 } 21935 if (resizeEnabled) { 21936 delete this.config.resize_enabled; 21937 }*/ 21938 this.model = model; 21939 if (modelConfigAttachmentAllowed) { 21940 this.editor.on("fileUploadRequest", this.attachFileFromDragAndDrop); 21941 this.editor.on("fileUploadResponse", this.handleFileUploadResponse); 21942 this.changeImagePluginDialog(); 21943 } 21944 }; 21945 21946 CKRte.prototype.destroy = function() { 21947 if (this.editor) { 21948 try { 21949 if (this.editor.filter && this.editor.window && this.editor.window.getFrame()) { 21950 this.editor.destroy(true); 21951 this.editor.removeAllListeners(); 21952 } else { 21953 this.editor.removeAllListeners(); 21954 window.CKEDITOR.remove(this.editor); 21955 window.CKEDITOR.fire("instanceDestroyed", null, this.editor); 21956 } 21957 } catch (e) { 21958 SCF.log.error("Couldn't destroy editor: %o", e); 21959 } 21960 } 21961 delete this.editor; 21962 return; 21963 }; 21964 21965 21966 CKRte.prototype.getFileIFrameFromDialog = function(definition) { 21967 var dialogDefinition = definition; 21968 var contents = dialogDefinition.contents; 21969 for (var i = 0; i < contents.length; i++) { 21970 var contentObject = contents[i]; 21971 var contentObjectId = contentObject.id; 21972 // Code specific to image plugin. They have give the ID as Upload 21973 if (contentObjectId == "Upload") { 21974 var elements = contentObject.elements; 21975 for (var j = 0; j < elements.length; j++) { 21976 var element = elements[j];
21977 var elementId = element.id; 21978 if (elementId == "uploadButton") { 21979 // set the custom Function 21980 element.onClick = this.setCustomFileButtonClick; 21981 element["for"] = ["Upload", "file"]; 21982 } 21983 if (elementId == "upload") { 21984 element.id = "file"; 21985 } 21986 } 21987 } 21988 } 21989 }; 21990 21991 CKRte.prototype.setCustomFileButtonClick = function(evt) { 21992 var target = evt.sender["for"]; 21993 var dialog = evt.data.dialog; 21994 var fileElement = dialog.getContentElement(target[0], target[1]); 21995 var fileIframe = $CQ("#" + fileElement.domId + " iframe"); 21996 //set additional parameters for the upload to happen 21997 var fileIframeForm = fileIframe.contents().find("form"); 21998 var success = _.bind(function(response) { 21999 var responseObj; 22000 if(typeof(response.response) !== "object") { 22001 responseObj = JSON.parse(response.response); 22002 } else { 22003 responseObj = response.response; 22004 } 22005 var location = responseObj.url; 22006 location = CQ.shared.HTTP.encodePath(location); 22007 dialog.getContentElement("info", "src").setValue(location); 22008 dialog.selectPage("info"); 22009 if ($CQ(".cke_dialog_ui_input_text").length !== 0) { 22010 $CQ(".cke_dialog_ui_input_text").focus(); 22011 } 22012 }, this); 22013 var error = _.bind(function(response) { 22014 SCF.log.error("Failed to upload file" + response); 22015 alert("Failed to upload file " + response.responseJSON.error.message); 22016 }, this); 22017 var postData; 22018 var formFiles = fileIframeForm.find("input:file"); 22019 var files = formFiles[0].files; 22020 var hasAttachment = (typeof files != "undefined"); 22021 if (hasAttachment) { 22022 // Create a formdata object and add the files 22023 var url = fileIframeForm.attr("action"); 22024 CKRte.prototype.attachFile.call(this, files, url, success, error); 22025 } 22026 evt.stop(); 22027 return false; 22028 }; 22029 22030 CKRte.prototype.handleFileUploadResponse = function(evt) { 22031 evt.stop(); 22032 var data = evt.data; 22033 var xhr = data.fileLoader.xhr; 22034 var response = xhr.responseText; 22035 response = JSON.parse(response); 22036 if(typeof(response.response) !== "object") { 22037 response.response = JSON.parse(response.response); 22038 } 22039 if (xhr.status == 200) { 22040 data.uploaded = 1; 22041 data.url = CQ.shared.HTTP.encodePath(response.response.url); 22042 data.name = response.response.properties.name; 22043 } 22044 }; 22045 22046 CKRte.prototype.attachFileFromDragAndDrop = function(evt) { 22047 var fileLoader = evt.data.fileLoader; 22048 var xhr = fileLoader.xhr; 22049 var postData; 22050 if (window.FormData) { 22051 postData = new FormData(); 22052 } 22053 if (postData) { 22054 postData.append("file", fileLoader.file); 22055 postData.append("id", "nobot"); 22056 postData.append(":operation", "social:uploadImage"); 22057 postData.append("_charset_", "UTF-8"); 22058 xhr.open("POST", fileLoader.uploadUrl, true); 22059 xhr.setRequestHeader("Accept", "application/json"); 22060 xhr.withCredentials = true; 22061 xhr.send(postData); 22062 } 22063 evt.stop(); 22064 }; 22065 22066 CKRte.prototype.attachFile = function(files, url, success, error) { 22067 var postData; 22068 if (window.FormData) { 22069 postData = new FormData(); 22070 } 22071 if (postData) { 22072 $CQ.each(files, function(key, value) { 22073 postData.append("file", value); 22074 }); 22075 postData.append("id", "nobot"); 22076 postData.append(":operation", "social:uploadImage"); 22077 postData.append("_charset_", "UTF-8"); 22078 $CQ.ajax(url, { 22079 dataType: "json", 22080 type: "POST", 22081 processData: false, 22082 contentType: false, 22083 xhrFields: { 22084 withCredentials: true 22085 }, 22086 data: postData, 22087 "success": success, 22088 "error": error 22089 }); 22090 } 22091 }; 22092 CKRte.prototype.changeImagePluginDialog = function() { 22093 // List of things being done 22094 // Get the dialog defintion of the image2 plugin 22095 // Setting a custom onClick function to the file input button in the dialog 22096 // Getting the iframe that loads the server response after an image is uploaded 22097 // Set addition params specific to upload operation 22098 // Add an onload event listener to the iframe 22099 // The iframe onload event listener updates the field that has image URL 22100 if (!CKRte.isImageDialogDefinitionChanged) { 22101 CKRte.isImageDialogDefinitionChanged = true; 22102 var that = this; 22103 window.CKEDITOR.on("dialogDefinition", function(ev) { 22104 var dialogName = ev.data.name; 22105 if (dialogName == "image2") { 22106 that.getFileIFrameFromDialog(ev.data.definition); 22107 } 22108 }); 22109 } 22110 }; 22111 22112 CKRte.prototype.config = { 22113 toolbar: [{ 22114 name: "basicstyles", 22115 items: ["Bold", "Italic", "Underline", "NumberedList", "BulletedList", "Outdent", "Indent", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock", "TextColor"] 22116 }], 22117 autoParagraph: false, 22118 autoUpdateElement: false, 22119 removePlugins: "elementspath", 22120 resize_enabled: false 22121 }; 22122 CKRte.prototype.setValue = function(val) { 22123 this.editor.setData(val); 22124 }; 22125 CKRte.prototype.getValue = function() { 22126 return this.editor.getData(); 22127 };
22128 CKRte.prototype.focus = function() { 22129 return this.editor.focus(); 22130 }; 22131 22132 CKRte.isImageDialogDefinitionChanged = false; 22133 22134 SCF.registerFieldType("ckeditor", CKRte); 22135 SCF.registerFieldType("rte", CKRte); 22136})(Backbone, $CQ, _, Handlebars); 22137 22138/* 22139 * 22140 * ADOBE CONFIDENTIAL 22141 * __________________ 22142 * 22143 * Copyright 2012 Adobe Systems Incorporated 22144 * All Rights Reserved. 22145 * 22146 * NOTICE: All information contained herein is, and remains 22147 * the property of Adobe Systems Incorporated and its suppliers, 22148 * if any. The intellectual and technical concepts contained 22149 * herein are proprietary to Adobe Systems Incorporated and its 22150 * suppliers and are protected by trade secret or copyright law. 22151 * Dissemination of this information or reproduction of this material 22152 * is strictly forbidden unless prior written permission is obtained 22153 * from Adobe Systems Incorporated. 22154 */ 22155(function(_, $CQ, Backbone, Handlebars, SCF) { 22156 "use strict"; 22157 22158 var SmartTagManager = function(tagField, config, model) { 22159 this.containerEl = tagField; 22160 var filterVal = $CQ(tagField).data("tag-filter"); 22161 var filterLimit = $CQ(tagField).data("tag-limit"); 22162 $CQ(tagField).tagit({ 22163 fieldName: name, 22164 allowSpaces: false, 22165 placeholderText: CQ.I18n.getMessage("Add a tag"), 22166 animate: false, 22167 minLength: 2, 22168 removeConfirmation: true, 22169 showAutocompleteOnFocus: false, 22170 tagSource: function(request, response) { 22171 $CQ.ajax({ 22172 url: SCF.config.urlRoot + "/services/tagfilter", 22173 data: { 22174 term: request.term, 22175 tagfilter: filterVal, 22176 tagFilterLimit: filterLimit, 22177 pagePath: CQ.shared.HTTP.getPath(), 22178 _charset_: "UTF-8" 22179 }, 22180 dataType: "json", 22181 success: function(data) { 22182 response($CQ.map(data, function(item) { 22183 return { 22184 label: item.label, 22185 value: item.value, 22186 id: item.tagid 22187 }; 22188 })); 22189 } 22190 }); 22191 } 22192 }); 22193 22194 if (!_.isEmpty(model.get("tags"))) { 22195 $CQ.each(model.get("tags"), function(index, item) { 22196 $CQ(tagField).tagit("createTag", item.title, item.tagId, item.value); 22197 22198 }); 22199 } 22200 }; 22201 SmartTagManager.prototype.getValue = function() { 22202 var tags = []; 22203 22204 $CQ(this.containerEl).find('li').each(function() { 22205 var _liObj = $(this); 22206 var _value = _liObj.find("input").attr("value"); 22207 if (!_.isEmpty(_value)) { 22208 tags.push(_value); 22209 } 22210 }); 22211 22212 return tags; 22213 }; 22214 SmartTagManager.prototype.setValue = function() {}; 22215 SmartTagManager.prototype.focus = function() { 22216 $CQ(this.el).focus(); 22217 }; 22218 SmartTagManager.prototype.destroy = function() {}; 22219 22220 22221 22222 var TagManager = function(tagField, config, model) { 22223 var compileTemplates = function(sourceMap) { 22224 var compiledTemplates = {}; 22225 for (var key in sourceMap) { 22226 compiledTemplates[key] = Handlebars.compile(sourceMap[key]); 22227 } 22228 return compiledTemplates; 22229 }; 22230 this.modelTags = model.get("tags"); 22231 this.templatesSource = this.defaultTemplates; 22232 if (config && config.hasOwnProperty("templates")) { 22233 this.templatesSource = _.extend(this.defaultTemplates, config.templates); 22234 } 22235 this.compiledTemplates = compileTemplates(this.templatesSource); 22236 var el = tagField.get()[0]; 22237 var filterVal = $CQ(el).data("tag-filter"); 22238 var filterLimit = $CQ(el).data("tag-limit"); 22239 var tags = TagManager.tagsByFilterVal[filterVal]; 22240 if (!tags) { 22241 var that = this; 22242 $CQ.ajax({ 22243 url: SCF.config.urlRoot + "/services/tagfilter", 22244 data: { 22245 tagfilter: filterVal, 22246 tagFilterLimit: filterLimit
22247 }, 22248 // xhrFields: { 22249 // withCredentials: true 22250 // }, 22251 dataType: "json", 22252 async: false, 22253 success: function(data) { 22254 tags = data; 22255 TagManager.tagsByFilterVal[filterVal] = tags; 22256 that.initTagFields(tags, el); 22257 } 22258 }); 22259 } else { 22260 this.initTagFields(tags, el); 22261 } 22262 }; 22263 22264 TagManager.prototype.initTagFields = function(tags, field) { 22265 var tagSelector = $CQ(this.compiledTemplates.inputField(tags)); 22266 this.selectedTags = {}; 22267 var that = this; 22268 var $field = $CQ(field); 22269 $field.after(tagSelector); 22270 var attributes = $field.prop("attributes"); 22271 $CQ.each(attributes, function() { 22272 tagSelector.attr(this.name, this.value); 22273 }); 22274 tagSelector.removeAttr("data-attrib"); 22275 var selectedTags = $CQ(this.compiledTemplates.tagsContainer(this.modelTags)); 22276 22277 if (!_.isUndefined(this.modelTags) && this.modelTags !== null && this.modelTags.hasOwnProperty("length")) { 22278 for (var i = 0; i < this.modelTags.length; i++) { 22279 this.selectedTags[this.modelTags[i].tagId] = this.modelTags[i]; 22280 } 22281 } 22282 tagSelector.after(selectedTags); 22283 selectedTags.find(".scf-js-remove-tag").click(function(e) { 22284 var targetTag = $CQ(e.target).closest("[data-attrib]"); 22285 delete that.selectedTags[targetTag.attr("data-attrib")]; 22286 targetTag.remove(); 22287 }); 22288 $field.remove(); 22289 tagSelector.change(function() { 22290 $CQ(tagSelector).find("option:selected").each(function() { 22291 var tag = $CQ(this).text(); 22292 var tagId = $CQ(this).val(); 22293 $CQ(this).removeAttr("selected"); 22294 if (tagId in that.selectedTags) { 22295 return; 22296 } 22297 var selectedTag = $CQ(that.compiledTemplates.tag({ 22298 "tagid": tagId, 22299 "label": tag 22300 })); 22301 selectedTags.append(selectedTag); 22302 that.selectedTags[tagId] = tag; 22303 selectedTag.find(".scf-js-remove-tag").click(function() { 22304 selectedTag.remove(); 22305 delete that.selectedTags[tagId]; 22306 }); 22307 }); 22308 $CQ($CQ(this).find("option[disabled]")[0]).removeAttr("disabled").attr("selected", "selected").attr("disabled", "disabled"); 22309 }); 22310 }; 22311 22312 TagManager.prototype.getValue = function() { 22313 var tags = []; 22314 for (var tagId in this.selectedTags) { 22315 tags.push(tagId); 22316 } 22317 return tags; 22318 }; 22319 TagManager.prototype.setValue = function() { 22320 if (tags instanceof Array) { 22321 for (var i; i < tags.length; i++) { 22322 var tag = tags[i]; 22323 this.selectedTags[tag.tagId] = tag.title; 22324 } 22325 } 22326 }; 22327 TagManager.prototype.focus = function() { 22328 $CQ(this.el).focus(); 22329 }; 22330 TagManager.prototype.destroy = function() {}; 22331 22332 TagManager.prototype.defaultTemplates = { 22333 "inputField": "<select size=\"1\"><option disabled selected>add a tag</option>{{#each this}}<option value=\"{{tagid}}\">{{label}}</option>{{/each}}</select>", 22334 "tagsContainer": "<ul class=\"scf-horizontal-tag-list\">{{#each this}}<li class=\"scf-selected-tag \" data-attrib=\"{{tagId}}\"><span class=\"scf-js-remove-tag scf-remove-tag\"></span> {{title}}</li>{{/each}}</div>", 22335 "tag": "<li class=\"scf-selected-tag \"><span class=\"scf-js-remove-tag scf-remove-tag\"></span> {{label}}</li>" 22336 }; 22337 22338 TagManager.tagsByFilterVal = {}; 22339 22340 SCF.registerFieldType("tags", TagManager); 22341 SCF.registerFieldType("smarttags", SmartTagManager); 22342 // Maybe this export can be removed when we transition over totally to SCF 22343 SCF.TagManager = TagManager; 22344 SCF.SmartTagManager = SmartTagManager; 22345 22346})(_, $CQ, Backbone, Handlebars, SCF); 22347 22348/* 22349 * 22350 * ADOBE CONFIDENTIAL 22351 * __________________ 22352 * 22353 * Copyright 2012 Adobe Systems Incorporated 22354 * All Rights Reserved. 22355 *
22356 * NOTICE: All information contained herein is, and remains 22357 * the property of Adobe Systems Incorporated and its suppliers, 22358 * if any. The intellectual and technical concepts contained 22359 * herein are proprietary to Adobe Systems Incorporated and its 22360 * suppliers and are protected by trade secret or copyright law. 22361 * Dissemination of this information or reproduction of this material 22362 * is strictly forbidden unless prior written permission is obtained 22363 * from Adobe Systems Incorporated. 22364 */ 22365(function(_, $CQ, Backbone, Handlebars, SCF) { 22366 "use strict"; 22367 22368 // select user 22369 var initUserSelector = function(el_selector, path, dropDown) { 22370 var $el = $CQ(el_selector); 22371 // userlist node needs to be next to ugc node 22372 var base_url = path; 22373 $el.autocomplete({ 22374 source: function(request, response) { 22375 var searchString = $CQ(el_selector).val(); 22376 var filterObject = { 22377 "operation": "CONTAINS", 22378 "./@rep:principalName": searchString 22379 }; 22380 filterObject = [filterObject]; 22381 var filterGivenName = { 22382 "operation": "like", 22383 "profile/@givenName": searchString 22384 }; 22385 filterObject.push(filterGivenName); 22386 var filterFamilyName = { 22387 "operation": "like", 22388 "profile/@familyName": searchString 22389 }; 22390 filterObject.push(filterFamilyName); 22391 filterObject = JSON.stringify(filterObject); 22392 22393 var sitePath = SCF.Context.sitePath + "/configuration.social.0.20.json"; 22394 $CQ.ajax({ 22395 url: sitePath, 22396 type: "GET", 22397 success: function(siteJson) { 22398 var url = base_url + ".social.0.20.json"; 22399 url = CQ.shared.HTTP.addParameter(url, "filter", filterObject); 22400 url = CQ.shared.HTTP.addParameter(url, "type", "users"); 22401 url = CQ.shared.HTTP.addParameter(url, "fromPublisher", "true"); 22402 url = CQ.shared.HTTP.addParameter(url, "_charset_", "utf-8"); 22403 url = CQ.shared.HTTP.addParameter(url, "groupId", "community-" + siteJson.siteId + "-members"); 22404 $.get(url, function(data) { 22405 var users = data.items; 22406 $el.data("lastQueryResult", users); 22407 response(users); 22408 }); 22409 } 22410 }); 22411 }, 22412 minLength: 3, 22413 change: function(event, ui) { 22414 dropDown.model.set("composedForValid", dropDown.validateUser($el.val())); 22415 }, 22416 select: function(event, ui) { 22417 dropDown.model.set("composedForValid", true); 22418 $CQ(this).val(ui.item.authorizableId); 22419 return false; 22420 }, 22421 setvalue: function(value) { 22422 this.element.val(value); 22423 this.input.val(value); 22424 $CQ(this).val(value); 22425 } 22426 }).data("uiAutocomplete")._renderItem = function(ul, item) { 22427 if (item.avatarUrl) { 22428 return $CQ("<li></li>").append( 22429 "<a><img src='" + item.avatarUrl + "' width='30' height='30'/> " + item.name + "</a>") 22430 .data("item.autocomplete", item).appendTo(ul); 22431 } else { 22432 return $CQ("<li></li>").append("<a>" + item.name + "</a>").data("item.autocomplete", item).appendTo(ul); 22433 } 22434 }; 22435 }; 22436 22437 var UserDropDown = function(inputEl, config, model) { 22438 this.$el = $CQ(inputEl); 22439 this.model = model; 22440 this.config = config; 22441 this.modelId = this.model.get("forumId"); 22442 if (_.isEmpty(this.modelId)) { 22443 this.modelId = this.model.get("id"); 22444 } 22445 initUserSelector($CQ(inputEl), this.modelId + "/userlist", this); 22446 }; 22447 22448 var isUserInList = function(userList, userName) { 22449 for (var user in userList) { 22450 if (userList[user].authorizableId === userName) { 22451 return true; 22452 } 22453 } 22454 return false;
22455 }; 22456 22457 UserDropDown.prototype.validateUser = function(userName) { 22458 var isValid = false; 22459 22460 // Check to see if the user is blank 22461 if (userName.trim().length === 0) 22462 return true; 22463 22464 // First, check last (cached) search, if it exists 22465 if (this.$el.data("lastQueryResult")) { 22466 if (isUserInList(this.$el.data("lastQueryResult"), userName)) { 22467 isValid = true; 22468 } 22469 } 22470 // Next, perform a query and check to see if we find a match 22471 if (!isValid) { 22472 var users = this.searchUsers(userName); 22473 isValid = isUserInList(users, userName); 22474 } 22475 return isValid; 22476 }; 22477 22478 UserDropDown.prototype.searchUsers = function(userName) { 22479 var base_url = this.modelId + "/userlist"; 22480 var url = base_url + ".social.0.20.json?search=" + userName + "&showUsers=true"; 22481 var users; 22482 $.get(url, function(data) { 22483 users = data.items; 22484 }); 22485 users = users || []; 22486 return users; 22487 }; 22488 22489 UserDropDown.prototype.getValue = function() { 22490 return this.$el.val(); 22491 }; 22492 22493 UserDropDown.prototype.setValue = function() { 22494 // Some model prop 22495 this.$el.autocomplete().setValue(this.model.get("author").id); 22496 }; 22497 22498 UserDropDown.prototype.focus = function() { 22499 $CQ(this.el).focus(); 22500 }; 22501 22502 UserDropDown.prototype.destroy = function() { 22503 if (this.$el.data('autocomplete') || this.$el.data('lastQueryResult')) { 22504 this.$el.autocomplete("destroy"); 22505 } 22506 }; 22507 22508 SCF.registerFieldType("userdropdown", UserDropDown); 22509 SCF.UserDropDown = UserDropDown; 22510})(_, $CQ, Backbone, Handlebars, SCF); 22511 22512/* 22513 * jQuery Templating Plugin 22514 * Copyright 2010, John Resig 22515 * Dual licensed under the MIT or GPL Version 2 licenses. 22516 */ 22517(function(jQuery, $) { 22518(function( jQuery, undefined ){ 22519 var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /, 22520 newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = []; 22521 22522 function newTmplItem( options, parentItem, fn, data ) { 22523 // Returns a template item data structure for a new rendered instance of a template (a 'template item'). 22524 // The content field is a hierarchical array of strings and nested items (to be 22525 // removed and replaced by nodes field of dom elements, once inserted in DOM). 22526 var newItem = { 22527 data: data || (parentItem ? parentItem.data : {}), 22528 _wrap: parentItem ? parentItem._wrap : null, 22529 tmpl: null, 22530 parent: parentItem || null, 22531 nodes: [], 22532 calls: tiCalls, 22533 nest: tiNest, 22534 wrap: tiWrap, 22535 html: tiHtml, 22536 update: tiUpdate 22537 }; 22538 if ( options ) { 22539 jQuery.extend( newItem, options, { nodes: [], parent: parentItem } ); 22540 } 22541 if ( fn ) { 22542 // Build the hierarchical content to be used during insertion into DOM 22543 newItem.tmpl = fn; 22544 newItem._ctnt = newItem._ctnt || newItem.tmpl( jQuery, newItem ); 22545 newItem.key = ++itemKey; 22546 // Keep track of new template item, until it is stored as jQuery Data on DOM element 22547 (stack.length ? wrappedItems : newTmplItems)[itemKey] = newItem; 22548 } 22549 return newItem; 22550 } 22551 22552 // Override appendTo etc., in order to provide support for targeting multiple elements. (This code would disappear if integrated in jquery core). 22553 jQuery.each({ 22554 appendTo: "append", 22555 prependTo: "prepend", 22556 insertBefore: "before", 22557 insertAfter: "after", 22558 replaceAll: "replaceWith" 22559 }, function( name, original ) { 22560 jQuery.fn[ name ] = function( selector ) { 22561 var ret = [], insert = jQuery( selector ), elems, i, l, tmplItems, 22562 parent = this.length === 1 && this[0].parentNode; 22563 22564 appendToTmplItems = newTmplItems || {}; 22565 if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { 22566 insert[ original ]( this[0] ); 22567 ret = this; 22568 } else { 22569 for ( i = 0, l = insert.length; i < l; i++ ) { 22570 cloneIndex = i; 22571 elems = (i > 0 ? this.clone(true) : this).get(); 22572 jQuery.fn[ original ].apply( jQuery(insert[i]), elems ); 22573 ret = ret.concat( elems ); 22574 } 22575 cloneIndex = 0; 22576 ret = this.pushStack( ret, name, insert.selector ); 22577 } 22578 tmplItems = appendToTmplItems; 22579 appendToTmplItems = null; 22580 jQuery.tmpl.complete( tmplItems ); 22581 return ret; 22582 }; 22583 }); 22584 22585 jQuery.fn.extend({ 22586 // Use first wrapped element as template markup. 22587 // Return wrapped set of template items, obtained by rendering template against data. 22588 tmpl: function( data, options, parentItem ) { 22589 return jQuery.tmpl( this[0], data, options, parentItem ); 22590 }, 22591 22592 // Find which rendered template item the first wrapped DOM element belongs to 22593 tmplItem: function() { 22594 return jQuery.tmplItem( this[0] ); 22595 }, 22596 22597 // Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template. 22598 template: function( name ) { 22599 return jQuery.template( name, this[0] ); 22600 }, 22601 22602 domManip: function( args, table, callback, options ) { 22603 // This appears to be a bug in the appendTo, etc. implementation 22604 // it should be doing .call() instead of .apply(). See #6227 22605 if ( args[0] && args[0].nodeType ) { 22606 var dmArgs = jQuery.makeArray( arguments ), argsLength = args.length, i = 0, tmplItem; 22607 while ( i < argsLength && !(tmplItem = jQuery.data( args[i++], "tmplItem" ))) {} 22608 if ( argsLength > 1 ) { 22609 dmArgs[0] = [jQuery.makeArray( args )]; 22610 } 22611 if ( tmplItem && cloneIndex ) { 22612 dmArgs[2] = function( fragClone ) { 22613 // Handler called by oldManip when rendered template has been inserted into DOM. 22614 jQuery.tmpl.afterManip( this, fragClone, callback ); 22615 }; 22616 } 22617 oldManip.apply( this, dmArgs ); 22618 } else { 22619 oldManip.apply( this, arguments ); 22620 } 22621 cloneIndex = 0; 22622 if ( !appendToTmplItems ) { 22623 jQuery.tmpl.complete( newTmplItems ); 22624 } 22625 return this; 22626 } 22627 }); 22628 22629 jQuery.extend({ 22630 // Return wrapped set of template items, obtained by rendering template against data. 22631 tmpl: function( tmpl, data, options, parentItem ) { 22632 var ret, topLevel = !parentItem; 22633 if ( topLevel ) { 22634 // This is a top-level tmpl call (not from a nested template using {{tmpl}}) 22635 parentItem = topTmplItem; 22636 tmpl = jQuery.template[tmpl] || jQuery.template( null, tmpl ); 22637 wrappedItems = {}; // Any wrapped items will be rebuilt, since this is top level 22638 } else if ( !tmpl ) { 22639 // The template item is already associated with DOM - this is a refresh. 22640 // Re-evaluate rendered template for the parentItem 22641 tmpl = parentItem.tmpl; 22642 newTmplItems[parentItem.key] = parentItem; 22643 parentItem.nodes = []; 22644 if ( parentItem.wrapped ) { 22645 updateWrapped( parentItem, parentItem.wrapped ); 22646 } 22647 // Rebuild, without creating a new template item 22648 return jQuery( build( parentItem, null, parentItem.tmpl( jQuery, parentItem ) )); 22649 } 22650 if ( !tmpl ) { 22651 return []; // Could throw... 22652 } 22653 if ( typeof data === "function" ) { 22654 data = data.call( parentItem || {} ); 22655 } 22656 if ( options && options.wrapped ) { 22657 updateWrapped( options, options.wrapped ); 22658 } 22659 ret = jQuery.isArray( data ) ? 22660 jQuery.map( data, function( dataItem ) { 22661 return dataItem ? newTmplItem( options, parentItem, tmpl, dataItem ) : null; 22662 }) : 22663 [ newTmplItem( options, parentItem, tmpl, data ) ]; 22664 return topLevel ? jQuery( build( parentItem, null, ret ) ) : ret; 22665 }, 22666 22667 // Return rendered template item for an element. 22668 tmplItem: function( elem ) { 22669 var tmplItem; 22670 if ( elem instanceof jQuery ) { 22671 elem = elem[0]; 22672 } 22673 while ( elem && elem.nodeType === 1 && !(tmplItem = jQuery.data( elem, "tmplItem" )) && (elem = elem.parentNode) ) {} 22674 return tmplItem || topTmplItem; 22675 }, 22676 22677 // Set: 22678 // Use $.template( name, tmpl ) to cache a named template, 22679 // where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc. 22680 // Use $( "selector" ).template( name ) to provide access by name to a script block template declaration. 22681 22682 // Get: 22683 // Use $.template( name ) to access a cached template. 22684 // Also $( selectorToScriptBlock ).template(), or $.template( null, templateString ) 22685 // will return the compiled template, without adding a name reference. 22686 // If templateString includes at least one HTML tag, $.template( templateString )
vendor: 12,491 bytes, lines 22686-23003
22686is equivalent 22687 // to $.template( null, templateString ) 22688 template: function( name, tmpl ) { 22689 if (tmpl) { 22690 // Compile template and associate with name 22691 if ( typeof tmpl === "string" ) { 22692 // This is an HTML string being passed directly in. 22693 tmpl = buildTmplFn( tmpl ) 22694 } else if ( tmpl instanceof jQuery ) { 22695 tmpl = tmpl[0] || {}; 22696 } 22697 if ( tmpl.nodeType ) { 22698 // If this is a template block, use cached copy, or generate tmpl function and cache. 22699 tmpl = jQuery.data( tmpl, "tmpl" ) || jQuery.data( tmpl, "tmpl", buildTmplFn( tmpl.innerHTML )); 22700 } 22701 return typeof name === "string" ? (jQuery.template[name] = tmpl) : tmpl; 22702 } 22703 // Return named compiled template 22704 return name ? (typeof name !== "string" ? jQuery.template( null, name ): 22705 (jQuery.template[name] || 22706 // If not in map, treat as a selector. (If integrated with core, use quickExpr.exec) 22707 jQuery.template( null, htmlExpr.test( name ) ? name : jQuery( name )))) : null; 22708 }, 22709 22710 encode: function( text ) { 22711 // Do HTML encoding replacing < > & and ' and " by corresponding entities. 22712 return ("" + text).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'"); 22713 } 22714 }); 22715 22716 jQuery.extend( jQuery.tmpl, { 22717 tag: { 22718 "tmpl": { 22719 _default: { $2: "null" }, 22720 open: "if($notnull_1){_=_.concat($item.nest($1,$2));}" 22721 // tmpl target parameter can be of type function, so use $1, not $1a (so not auto detection of functions) 22722 // This means that {{tmpl foo}} treats foo as a template (which IS a function). 22723 // Explicit parens can be used if foo is a function that returns a template: {{tmpl foo()}}. 22724 }, 22725 "wrap": { 22726 _default: { $2: "null" }, 22727 open: "$item.calls(_,$1,$2);_=[];", 22728 close: "call=$item.calls();_=call._.concat($item.wrap(call,_));" 22729 }, 22730 "each": { 22731 _default: { $2: "$index, $value" }, 22732 open: "if($notnull_1){$.each($1a,function($2){with(this){", 22733 close: "}});}" 22734 }, 22735 "if": { 22736 open: "if(($notnull_1) && $1a){", 22737 close: "}" 22738 }, 22739 "else": { 22740 _default: { $1: "true" }, 22741 open: "}else if(($notnull_1) && $1a){" 22742 }, 22743 "html": { 22744 // Unecoded expression evaluation. 22745 open: "if($notnull_1){_.push($1a);}" 22746 }, 22747 "=": { 22748 // Encoded expression evaluation. Abbreviated form is ${}. 22749 _default: { $1: "$data" }, 22750 open: "if($notnull_1){_.push($.encode($1a));}" 22751 }, 22752 "!": { 22753 // Comment tag. Skipped by parser 22754 open: "" 22755 } 22756 }, 22757 22758 // This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events 22759 complete: function( items ) { 22760 newTmplItems = {}; 22761 }, 22762 22763 // Call this from code which overrides domManip, or equivalent 22764 // Manage cloning/storing template items etc. 22765 afterManip: function afterManip( elem, fragClone, callback ) { 22766 // Provides cloned fragment ready for fixup prior to and after insertion into DOM 22767 var content = fragClone.nodeType === 11 ? 22768 jQuery.makeArray(fragClone.childNodes) : 22769 fragClone.nodeType === 1 ? [fragClone] : []; 22770 22771 // Return fragment to original caller (e.g. append) for DOM insertion 22772 callback.call( elem, fragClone ); 22773 22774 // Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data. 22775 storeTmplItems( content ); 22776 cloneIndex++; 22777 } 22778 }); 22779 22780 //========================== Private helper functions, used by code above ========================== 22781 22782 function build( tmplItem, nested, content ) { 22783 // Convert hierarchical content into flat string array 22784 // and finally return array of fragments ready for DOM insertion 22785 var frag, ret = content ? jQuery.map( content, function( item ) { 22786 return (typeof item === "string") ? 22787 // Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM. 22788 (tmplItem.key ? item.replace( /(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2" ) : item) : 22789 // This is a child template item. Build nested template. 22790 build( item, tmplItem, item._ctnt ); 22791 }) : 22792 // If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}. 22793 tmplItem; 22794 if ( nested ) { 22795 return ret; 22796 } 22797 22798 // top-level template 22799 ret = ret.join(""); 22800 22801 // Support templates which have initial or final text nodes, or consist only of text 22802 // Also support HTML entities within the HTML markup. 22803 ret.replace( /^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function( all, before, middle, after) { 22804 frag = jQuery( middle ).get(); 22805 22806 storeTmplItems( frag ); 22807 if ( before ) { 22808 frag = unencode( before ).concat(frag); 22809 } 22810 if ( after ) { 22811 frag = frag.concat(unencode( after )); 22812 } 22813 }); 22814 return frag ? frag : unencode( ret ); 22815 } 22816 22817 function unencode( text ) { 22818 // Use createElement, since createTextNode will not render HTML entities correctly 22819 var el = document.createElement( "div" ); 22820 el.innerHTML = text; 22821 return jQuery.makeArray(el.childNodes); 22822 } 22823 22824 // Generate a reusable function that will serve to render a template against data 22825 function buildTmplFn( markup ) { 22826 return new Function("jQuery","$item", 22827 "var $=jQuery,call,_=[],$data=$item.data;" + 22828 22829 // Introduce the data as local variables using with(){} 22830 "with($data){_.push('" + 22831 22832 // Convert the template into pure JavaScript 22833 jQuery.trim(markup) 22834 .replace( /([\\'])/g, "\\$1" ) 22835 .replace( /[\r\t\n]/g, " " ) 22836 .replace( /\$\{([^\}]*)\}/g, "{{= $1}}" ) 22837 .replace( /\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g, 22838 function( all, slash, type, fnargs, target, parens, args ) { 22839 var tag = jQuery.tmpl.tag[ type ], def, expr, exprAutoFnDetect; 22840 if ( !tag ) { 22841 throw "Template command not found: " + type; 22842 } 22843 def = tag._default || []; 22844 if ( parens && !/\w$/.test(target)) { 22845 target += parens; 22846 parens = ""; 22847 } 22848 if ( target ) { 22849 target = unescape( target ); 22850 args = args ? ("," + unescape( args ) + ")") : (parens ? ")" : ""); 22851 // Support for target being things like a.toLowerCase(); 22852 // In that case don't call with template item as 'this' pointer. Just evaluate... 22853 expr = parens ? (target.indexOf(".") > -1 ? target + parens : ("(" + target + ").call($item" + args)) : target; 22854 exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))"; 22855 } else { 22856 exprAutoFnDetect = expr = def.$1 || "null"; 22857 } 22858 fnargs = unescape( fnargs ); 22859 return "');" + 22860 tag[ slash ? "close" : "open" ] 22861 .split( "$notnull_1" ).join( target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true" ) 22862 .split( "$1a" ).join( exprAutoFnDetect ) 22863 .split( "$1" ).join( expr ) 22864 .split( "$2" ).join( fnargs ? 22865 fnargs.replace( /\s*([^\(]+)\s*(\((.*?)\))?/g, function( all, name, parens, params ) { 22866 params = params ? ("," + params + ")") : (parens ? ")" : ""); 22867 return params ? ("(" + name + ").call($item" + params) : all; 22868 }) 22869 : (def.$2||"") 22870 ) + 22871 "_.push('"; 22872 }) + 22873 "');}return _;" 22874 ); 22875 } 22876 function updateWrapped( options, wrapped ) { 22877 // Build the wrapped content. 22878 options._wrap = build( options, true, 22879 // Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string. 22880 jQuery.isArray( wrapped ) ? wrapped : [htmlExpr.test( wrapped ) ? wrapped : jQuery( wrapped ).html()] 22881 ).join(""); 22882 } 22883 22884 function unescape( args ) { 22885 return args ? args.replace( /\\'/g, "'").replace(/\\\\/g, "\\" ) : null; 22886 } 22887 function outerHtml( elem ) { 22888 var div = document.createElement("div"); 22889 div.appendChild( elem.cloneNode(true) ); 22890 return div.innerHTML; 22891 } 22892 22893 // Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance. 22894 function storeTmplItems( content ) { 22895 var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m; 22896 for ( i = 0, l = content.length; i < l; i++ ) { 22897 if ( (elem = content[i]).nodeType !== 1 ) { 22898 continue; 22899 } 22900 elems = elem.getElementsByTagName("*"); 22901 for ( m = elems.length - 1; m >= 0; m-- ) { 22902 processItemKey( elems[m] ); 22903 } 22904 processItemKey( elem ); 22905 } 22906 function processItemKey( el ) { 22907 var pntKey, pntNode = el, pntItem, tmplItem, key; 22908 // Ensure that each rendered template inserted into the DOM has its own template item, 22909 if ( (key = el.getAttribute( tmplItmAtt ))) { 22910 while ( pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute( tmplItmAtt ))) { } 22911 if ( pntKey !== key ) { 22912 // The next ancestor with a _tmplitem expando is on a different key than this one. 22913 // So this is a top-level element within this template item 22914 // Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment. 22915 pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute( tmplItmAtt ) || 0)) : 0; 22916 if ( !(tmplItem = newTmplItems[key]) ) { 22917 // The item is for wrapped content, and was copied from the temporary parent wrappedItem. 22918 tmplItem = wrappedItems[key]; 22919 tmplItem = newTmplItem( tmplItem, newTmplItems[pntNode]||wrappedItems[pntNode], null, true ); 22920 tmplItem.key = ++itemKey; 22921 newTmplItems[itemKey] = tmplItem; 22922 } 22923 if ( cloneIndex ) { 22924 cloneTmplItem( key ); 22925 } 22926 } 22927 el.removeAttribute( tmplItmAtt ); 22928 } else if ( cloneIndex && (tmplItem = jQuery.data( el, "tmplItem" )) ) { 22929 // This was a rendered element, cloned during append or appendTo etc. 22930 // TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem. 22931 cloneTmplItem( tmplItem.key ); 22932 newTmplItems[tmplItem.key] = tmplItem; 22933 pntNode = jQuery.data( el.parentNode, "tmplItem" ); 22934 pntNode = pntNode ? pntNode.key : 0; 22935 } 22936 if ( tmplItem ) { 22937 pntItem = tmplItem; 22938 // Find the template item of the parent element. 22939 // (Using !=, not !==, since pntItem.key is number, and pntNode may be a string) 22940 while ( pntItem && pntItem.key != pntNode ) { 22941 // Add this element as a top-level node for this rendered template item, as well as for any 22942 // ancestor items between this item and the item of its parent element 22943 pntItem.nodes.push( el ); 22944 pntItem = pntItem.parent; 22945 } 22946 // Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering... 22947 delete tmplItem._ctnt; 22948 delete tmplItem._wrap; 22949 // Store template item as jQuery data on the element 22950 jQuery.data( el, "tmplItem", tmplItem ); 22951 } 22952 function cloneTmplItem( key ) { 22953 key = key + keySuffix; 22954 tmplItem = newClonedItems[key] = 22955 (newClonedItems[key] || newTmplItem( tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent, null, true )); 22956 } 22957 } 22958 } 22959 22960 //---- Helper functions for template item ---- 22961 22962 function tiCalls( content, tmpl, data, options ) { 22963 if ( !content ) { 22964 return stack.pop(); 22965 } 22966 stack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options }); 22967 } 22968 22969 function tiNest( tmpl, data, options ) { 22970 // nested template, using {{tmpl}} tag 22971 return jQuery.tmpl( jQuery.template( tmpl ), data, options, this ); 22972 } 22973 22974 function tiWrap( call, wrapped ) { 22975 // nested template, using {{wrap}} tag 22976 var options = call.options || {}; 22977 options.wrapped = wrapped; 22978 // Apply the template, which may incorporate wrapped content, 22979 return jQuery.tmpl( jQuery.template( call.tmpl ), call.data, options, call.item ); 22980 } 22981 22982 function tiHtml( filter, textOnly ) { 22983 var wrapped = this._wrap; 22984 return jQuery.map( 22985 jQuery( jQuery.isArray( wrapped ) ? wrapped.join("") : wrapped ).filter( filter || "*" ), 22986 function(e) { 22987 return textOnly ? 22988 e.innerText || e.textContent : 22989 e.outerHTML || outerHtml(e); 22990 }); 22991 } 22992 22993 function tiUpdate() { 22994 var coll = this.nodes; 22995 jQuery.tmpl( null, null, null, this).insertBefore( coll[0] ); 22996 jQuery( coll ).remove(); 22997 } 22998})( jQuery ); 22999})(window.$CQ || window.$ || function() { throw new Error("jQuery is not defined") }(), window.$CQ || window.$); 23000/******************************************************************************* 23001 * Copyright 2017 Adobe 23002 * 23003 * Licensed under the Apache License, Version 2.0 (the "License");
23004 * you may not use this file except in compliance with the License. 23005 * You may obtain a copy of the License at 23006 * 23007 * http://www.apache.org/licenses/LICENSE-2.0 23008 * 23009 * Unless required by applicable law or agreed to in writing, software 23010 * distributed under the License is distributed on an "AS IS" BASIS, 23011 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23012 * See the License for the specific language governing permissions and 23013 * limitations under the License. 23014 ******************************************************************************/ 23015if (window.Element && !Element.prototype.closest) { 23016 // eslint valid-jsdoc: "off" 23017 Element.prototype.closest = 23018 function(s) { 23019 "use strict"; 23020 var matches = (this.document || this.ownerDocument).querySelectorAll(s); 23021 var el = this; 23022 var i; 23023 do { 23024 i = matches.length; 23025 while (--i >= 0 && matches.item(i) !== el) { 23026 // continue 23027 } 23028 } while ((i < 0) && (el = el.parentElement)); 23029 return el; 23030 }; 23031} 23032 23033if (window.Element && !Element.prototype.matches) { 23034 Element.prototype.matches = 23035 Element.prototype.matchesSelector || 23036 Element.prototype.mozMatchesSelector || 23037 Element.prototype.msMatchesSelector || 23038 Element.prototype.oMatchesSelector || 23039 Element.prototype.webkitMatchesSelector || 23040 function(s) { 23041 "use strict"; 23042 var matches = (this.document || this.ownerDocument).querySelectorAll(s); 23043 var i = matches.length; 23044 while (--i >= 0 && matches.item(i) !== this) { 23045 // continue 23046 } 23047 return i > -1; 23048 }; 23049} 23050 23051if (!Object.assign) { 23052 Object.assign = function(target, varArgs) { // .length of function is 2 23053 "use strict"; 23054 if (target === null) { 23055 throw new TypeError("Cannot convert undefined or null to object"); 23056 } 23057 23058 var to = Object(target); 23059 23060 for (var index = 1; index < arguments.length; index++) { 23061 var nextSource = arguments[index]; 23062 23063 if (nextSource !== null) { 23064 for (var nextKey in nextSource) { 23065 if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { 23066 to[nextKey] = nextSource[nextKey]; 23067 } 23068 } 23069 } 23070 } 23071 return to; 23072 }; 23073} 23074 23075(function(arr) { 23076 "use strict"; 23077 arr.forEach(function(item) { 23078 if (Object.prototype.hasOwnProperty.call(item, "remove")) { 23079 return; 23080 } 23081 Object.defineProperty(item, "remove", { 23082 configurable: true, 23083 enumerable: true, 23084 writable: true, 23085 value: function remove() { 23086 this.parentNode.removeChild(this); 23087 } 23088 }); 23089 }); 23090})([Element.prototype, CharacterData.prototype, DocumentType.prototype]); 23091 23092/******************************************************************************* 23093 * Copyright 2022 Adobe 23094 * 23095 * Licensed under the Apache License, Version 2.0 (the "License"); 23096 * you may not use this file except in compliance with the License. 23097 * You may obtain a copy of the License at 23098 * 23099 * http://www.apache.org/licenses/LICENSE-2.0 23100 * 23101 * Unless required by applicable law or agreed to in writing, software 23102 * distributed under the License is distributed on an "AS IS" BASIS, 23103 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23104 * See the License for the specific language governing permissions and 23105 * limitations under the License. 23106 ******************************************************************************/ 23107(function(document) { 23108 "use strict"; 23109 23110 window.CMP = window.CMP || {}; 23111 window.CMP.utils = (function() { 23112 var NS = "cmp"; 23113 23114 /** 23115 * Reads options data from the Component wrapper element, defined via {@code data-cmp-*} data attributes 23116 * 23117 * @param {HTMLElement} element The component element to read options data from 23118 * @param {String} is The component identifier 23119 * @returns {String[]} The options read from the component data attributes 23120 */ 23121 var readData = function(element, is) { 23122 var data = element.dataset; 23123 var options = []; 23124 var capitalized = is; 23125 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 23126 var reserved = ["is", "hook" + capitalized]; 23127 23128 for (var key in data) { 23129 if (Object.prototype.hasOwnProperty.call(data, key)) { 23130 var value = data[key]; 23131 23132 if (key.indexOf(NS) === 0) { 23133 key = key.slice(NS.length); 23134 key = key.charAt(0).toLowerCase() + key.substring(1); 23135 23136 if (reserved.indexOf(key) === -1) { 23137 options[key] = value; 23138 } 23139 } 23140 } 23141 } 23142 return options; 23143 }; 23144 23145 /** 23146 * Set up the final properties of a component by evaluating the transform function or fall back to the default value on demand 23147 * @param {String[]} options the options to transform 23148 * @param {Object} properties object of properties of property functions 23149 * @returns {Object} transformed properties 23150 */ 23151 var setupProperties = function(options, properties) { 23152 var transformedProperties = {}; 23153 23154 for (var key in properties) { 23155 if (Object.prototype.hasOwnProperty.call(properties, key)) { 23156 var property = properties[key]; 23157 if (options && options[key] != null) { 23158 if (property && typeof property.transform === "function") { 23159 transformedProperties[key] = property.transform(options[key]); 23160 } else { 23161 transformedProperties[key] = options[key]; 23162 } 23163 } else { 23164 transformedProperties[key] = properties[key]["default"]; 23165 } 23166 } 23167 } 23168 return transformedProperties; 23169 }; 23170 23171 23172 return { 23173 readData: readData, 23174 setupProperties: setupProperties 23175 }; 23176 }()); 23177}(window.document)); 23178 23179/******************************************************************************* 23180 * Copyright 2022 Adobe 23181 * 23182 * Licensed under the Apache License, Version 2.0 (the "License");
23183 * you may not use this file except in compliance with the License. 23184 * You may obtain a copy of the License at 23185 * 23186 * http://www.apache.org/licenses/LICENSE-2.0 23187 * 23188 * Unless required by applicable law or agreed to in writing, software 23189 * distributed under the License is distributed on an "AS IS" BASIS, 23190 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23191 * See the License for the specific language governing permissions and 23192 * limitations under the License. 23193 ******************************************************************************/ 23194(function(document) { 23195 "use strict"; 23196 23197 window.CMP = window.CMP || {}; 23198 window.CMP.image = window.CMP.image || {}; 23199 window.CMP.image.dynamicMedia = (function() { 23200 var autoSmartCrops = {}; 23201 var SRC_URI_TEMPLATE_WIDTH_VAR = "{.width}"; 23202 var SRC_URI_TEMPLATE_DPR_VAR = "{dpr}"; 23203 var SRC_URI_DPR_OFF = "dpr=off"; 23204 var SRC_URI_DPR_ON = "dpr=on,{dpr}"; 23205 var dpr = window.devicePixelRatio || 1; 23206 var config = { 23207 minWidth: 20 23208 }; 23209 23210 /** 23211 * get auto smart crops from dm 23212 * @param {String} src the src uri 23213 * @returns {{}} the smart crop json object 23214 */ 23215 var getAutoSmartCrops = function(src) { 23216 var request = new XMLHttpRequest(); 23217 var url = src.split(SRC_URI_TEMPLATE_WIDTH_VAR)[0] + "?req=set,json"; 23218 request.open("GET", url, false); 23219 request.onload = function() { 23220 if (request.status >= 200 && request.status < 400) { 23221 // success status 23222 var responseText = request.responseText; 23223 var rePayload = new RegExp(/^(?:\/\*jsonp\*\/)?\s*([^()]+)\(([\s\S]+),\s*"[0-9]*"\);?$/gmi); 23224 var rePayloadJSON = new RegExp(/^{[\s\S]*}$/gmi); 23225 var resPayload = rePayload.exec(responseText); 23226 var payload; 23227 if (resPayload) { 23228 var payloadStr = resPayload[2]; 23229 if (rePayloadJSON.test(payloadStr)) { 23230 payload = JSON.parse(payloadStr); 23231 } 23232 23233 } 23234 // check "relation" - only in case of smartcrop preset 23235 if (payload && payload.set.relation && payload.set.relation.length > 0) { 23236 for (var i = 0; i < payload.set.relation.length; i++) { 23237 autoSmartCrops[parseInt(payload.set.relation[i].userdata.SmartCropWidth)] = 23238 ":" + payload.set.relation[i].userdata.SmartCropDef; 23239 } 23240 } 23241 } else { 23242 // error status 23243 } 23244 }; 23245 request.send(); 23246 return autoSmartCrops; 23247 }; 23248 23249 /** 23250 * Build and return the srcset value based on the available auto smart crops 23251 * @param {String} src the src uri 23252 * @param {Object} smartCrops the smart crops object 23253 * @returns {String} the srcset 23254 */ 23255 var getSrcSet = function(src, smartCrops) { 23256 var srcset; 23257 var keys = Object.keys(smartCrops); 23258 if (keys.length > 0) { 23259 srcset = []; 23260 for (var key in autoSmartCrops) { 23261 srcset.push(src.replace(SRC_URI_TEMPLATE_WIDTH_VAR, smartCrops[key]) + " " + key + "w"); 23262 } 23263 } 23264 return srcset.join(","); 23265 }; 23266 23267 /** 23268 * Get the optimal width based on the available sizes 23269 * @param {[Number]} sizes the available sizes 23270 * @param {Number} width the element width 23271 * @returns {String} the optimal width 23272 */ 23273 function getOptimalWidth(sizes, width) { 23274 var len = sizes.length; 23275 var key = 0; 23276 23277 while ((key < len - 1) && (sizes[key] < width)) { 23278 key++; 23279 } 23280 23281 return sizes[key] !== undefined ? sizes[key].toString() : width; 23282 } 23283 23284 /** 23285 * Get the width of an element or parent element if the width is smaller than the minimum width 23286 * @param {HTMLElement} component the image component 23287 * @param {HTMLElement | Node} parent the parent element 23288 * @returns {Number} the width of the element 23289 */ 23290 var getWidth = function(component, parent) { 23291 var width = component.offsetWidth; 23292 while (width < config.minWidth && parent && !component._autoWidth) { 23293 width = parent.offsetWidth; 23294 parent = parent.parentNode; 23295 } 23296 return width; 23297 }; 23298 23299 /** 23300 * Set the src and srcset attribute for a Dynamic Media Image which auto smart crops enabled. 23301 * @param {HTMLElement} component the image component 23302 * @param {{}} properties the component properties 23303 */ 23304 var setDMAttributes = function(component, properties) { 23305 // for v3 we first have to turn the dpr on
23306 var src = properties.src.replace(SRC_URI_DPR_OFF, SRC_URI_DPR_ON); 23307 src = src.replace(SRC_URI_TEMPLATE_DPR_VAR, dpr); 23308 var smartCrops = {}; 23309 var width; 23310 if (properties["smartcroprendition"] === "SmartCrop:Auto") { 23311 smartCrops = getAutoSmartCrops(src); 23312 } 23313 var hasWidths = (properties.widths && properties.widths.length > 0) || Object.keys(smartCrops).length > 0; 23314 if (hasWidths) { 23315 var image = component.querySelector("img"); 23316 var elemWidth = getWidth(component, component.parentNode); 23317 if (properties["smartcroprendition"] === "SmartCrop:Auto") { 23318 image.setAttribute("srcset", CMP.image.dynamicMedia.getSrcSet(src, smartCrops)); 23319 width = getOptimalWidth(Object.keys(smartCrops, elemWidth)); 23320 image.setAttribute("src", CMP.image.dynamicMedia.getSrc(src, smartCrops[width])); 23321 } else { 23322 width = getOptimalWidth(properties.widths, elemWidth); 23323 image.setAttribute("src", CMP.image.dynamicMedia.getSrc(src, width)); 23324 } 23325 } 23326 }; 23327 23328 /** 23329 * Get the src attribute based on the optimal width 23330 * @param {String} src the src uri 23331 * @param {String} width the element width 23332 * @returns {String} the final src attribute 23333 */ 23334 var getSrc = function(src, width) { 23335 if (src.indexOf(SRC_URI_TEMPLATE_WIDTH_VAR) > -1) { 23336 src = src.replace(SRC_URI_TEMPLATE_WIDTH_VAR, width); 23337 } 23338 return src; 23339 }; 23340 23341 23342 return { 23343 getAutoSmartCrops: getAutoSmartCrops, 23344 getSrcSet: getSrcSet, 23345 getSrc: getSrc, 23346 setDMAttributes: setDMAttributes, 23347 getWidth: getWidth 23348 }; 23349 }()); 23350 document.dispatchEvent(new CustomEvent("core.wcm.components.commons.site.image.dynamic-media.loaded")); 23351}(window.document)); 23352 23353/******************************************************************************* 23354 * Copyright 2016 Adobe 23355 * 23356 * Licensed under the Apache License, Version 2.0 (the "License"); 23357 * you may not use this file except in compliance with the License. 23358 * You may obtain a copy of the License at 23359 * 23360 * http://www.apache.org/licenses/LICENSE-2.0 23361 * 23362 * Unless required by applicable law or agreed to in writing, software 23363 * distributed under the License is distributed on an "AS IS" BASIS, 23364 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23365 * See the License for the specific language governing permissions and 23366 * limitations under the License. 23367 ******************************************************************************/ 23368(function() { 23369 "use strict"; 23370 23371 var NS = "cmp"; 23372 var IS = "image"; 23373 23374 var EMPTY_PIXEL = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"; 23375 var LAZY_THRESHOLD_DEFAULT = 0; 23376 var SRC_URI_TEMPLATE_WIDTH_VAR = "{.width}"; 23377 var SRC_URI_TEMPLATE_WIDTH_VAR_ASSET_DELIVERY = "width={width}"; 23378 var SRC_URI_TEMPLATE_DPR_VAR = "{dpr}"; 23379 23380 var selectors = { 23381 self: "[data-" + NS + '-is="' + IS + '"]', 23382 image: '[data-cmp-hook-image="image"]', 23383 map: '[data-cmp-hook-image="map"]', 23384 area: '[data-cmp-hook-image="area"]' 23385 }; 23386 23387 var lazyLoader = { 23388 "cssClass": "cmp-image__image--is-loading", 23389 "style": { 23390 "height": 0, 23391 "padding-bottom": "" // will be replaced with % ratio 23392 } 23393 }; 23394 23395 var properties = { 23396 /** 23397 * An array of alternative image widths (in pixels). 23398 * Used to replace a {.width} variable in the src property with an optimal width if a URI template is provided. 23399 * 23400 * @memberof Image 23401 * @type {Number[]} 23402 * @default [] 23403 */ 23404 "widths": { 23405 "default": [], 23406 "transform": function(value) { 23407 var widths = []; 23408 value.split(",").forEach(function(item) { 23409 item = parseFloat(item); 23410 if (!isNaN(item)) { 23411 widths.push(item); 23412 } 23413 }); 23414 return widths; 23415 } 23416 }, 23417 /** 23418 * Indicates whether the image should be rendered lazily. 23419 * 23420 * @memberof Image 23421 * @type {Boolean} 23422 * @default false 23423 */ 23424 "lazy": { 23425 "default": false, 23426 "transform": function(value) { 23427 return !(value === null || typeof value === "undefined"); 23428 } 23429 }, 23430 /** 23431 * Indicates image is DynamicMedia image. 23432 * 23433 * @memberof Image 23434 * @type {Boolean} 23435 * @default false 23436 */ 23437 "dmimage": { 23438 "default": false, 23439 "transform": function(value) { 23440 return !(value === null || typeof value === "undefined"); 23441 } 23442 }, 23443 /** 23444 * The lazy threshold. 23445 * This is the number of pixels, in advance of becoming visible, when an lazy-loading image should begin 23446 * to load. 23447 * 23448 * @memberof Image 23449 * @type {Number} 23450 * @default 0 23451 */ 23452 "lazythreshold": { 23453 "default": 0, 23454 "transform": function(value) { 23455 var val = parseInt(value); 23456 if (isNaN(val)) { 23457 return LAZY_THRESHOLD_DEFAULT; 23458 } 23459 return val; 23460 } 23461 }, 23462 /** 23463 * The image source. 23464 * 23465 * Can be a simple image source, or a URI template representation that 23466 * can be variable expanded - useful for building an image configuration with an alternative width. 23467 * e.g. '/path/image.coreimg{.width}.jpeg/1506620954214.jpeg' 23468 * 23469 * @memberof Image 23470 * @type {String} 23471 */ 23472 "src": { 23473 "transform": function(value) { 23474 return decodeURIComponent(value); 23475 } 23476 } 23477 }; 23478 23479 var devicePixelRatio = window.devicePixelRatio || 1; 23480 23481 function Image(config) { 23482 var that = this; 23483 23484 var smartCrops = {}; 23485 23486 var useAssetDelivery = false;
23487 var srcUriTemplateWidthVar = SRC_URI_TEMPLATE_WIDTH_VAR; 23488 23489 function init(config) { 23490 // prevents multiple initialization 23491 config.element.removeAttribute("data-" + NS + "-is"); 23492 23493 // check if asset delivery is used 23494 if (config.options.src && config.options.src.indexOf(SRC_URI_TEMPLATE_WIDTH_VAR_ASSET_DELIVERY) >= 0) { 23495 useAssetDelivery = true; 23496 srcUriTemplateWidthVar = SRC_URI_TEMPLATE_WIDTH_VAR_ASSET_DELIVERY; 23497 } 23498 23499 that._properties = CMP.utils.setupProperties(config.options, properties); 23500 cacheElements(config.element); 23501 // check image is DM asset; if true try to make req=set 23502 if (config.options.src && Object.prototype.hasOwnProperty.call(config.options, "dmimage") && (config.options["smartcroprendition"] === "SmartCrop:Auto")) { 23503 smartCrops = CMP.image.dynamicMedia.getAutoSmartCrops(config.options.src); 23504 } 23505 23506 if (!that._elements.noscript) { 23507 return; 23508 } 23509 23510 that._elements.container = that._elements.link ? that._elements.link : that._elements.self; 23511 23512 unwrapNoScript(); 23513 23514 if (that._properties.lazy) { 23515 addLazyLoader(); 23516 } 23517 23518 if (that._elements.map) { 23519 that._elements.image.addEventListener("load", onLoad); 23520 } 23521 23522 window.addEventListener("resize", onWindowResize); 23523 ["focus", "click", "load", "transitionend", "animationend", "scroll"].forEach(function(name) { 23524 document.addEventListener(name, that.update); 23525 }); 23526 23527 that._elements.image.addEventListener("cmp-image-redraw", that.update); 23528 23529 that._interSectionObserver = new IntersectionObserver(function(entries, interSectionObserver) { 23530 entries.forEach(function(entry) { 23531 if (entry.intersectionRatio > 0) { 23532 that.update(); 23533 } 23534 }); 23535 }); 23536 that._interSectionObserver.observe(that._elements.self); 23537 23538 that.update(); 23539 } 23540 23541 function loadImage() { 23542 var hasWidths = (that._properties.widths && that._properties.widths.length > 0) || Object.keys(smartCrops).length > 0; 23543 var replacement; 23544 if (Object.keys(smartCrops).length > 0) { 23545 var optimalWidth = getOptimalWidth(Object.keys(smartCrops), false); 23546 replacement = smartCrops[optimalWidth]; 23547 } else { 23548 replacement = hasWidths ? (that._properties.dmimage ? "" : ".") + getOptimalWidth(that._properties.widths, true) : ""; 23549 } 23550 if (useAssetDelivery) { 23551 replacement = replacement !== "" ? ("width=" + replacement.substring(1)) : ""; 23552 } 23553 var url = that._properties.src.replace(srcUriTemplateWidthVar, replacement); 23554 url = url.replace(SRC_URI_TEMPLATE_DPR_VAR, devicePixelRatio); 23555 23556 var imgSrcAttribute = that._elements.image.getAttribute("src"); 23557 23558 if (url !== imgSrcAttribute) { 23559 if (imgSrcAttribute === null || imgSrcAttribute === EMPTY_PIXEL) { 23560 that._elements.image.setAttribute("src", url); 23561 } else { 23562 var urlTemplateParts = that._properties.src.split(srcUriTemplateWidthVar); 23563 // check if image src was dynamically swapped meanwhile (e.g. by Target) 23564 var isImageRefSame = imgSrcAttribute.startsWith(urlTemplateParts[0]); 23565 if (isImageRefSame && urlTemplateParts.length > 1) { 23566 isImageRefSame = imgSrcAttribute.endsWith(urlTemplateParts[urlTemplateParts.length - 1]); 23567 } 23568 if (isImageRefSame) { 23569 that._elements.image.setAttribute("src", url); 23570 if (!hasWidths) { 23571 window.removeEventListener("scroll", that.update); 23572 } 23573 } 23574 } 23575 } 23576 if (that._lazyLoaderShowing) { 23577 that._elements.image.addEventListener("load", removeLazyLoader); 23578 } 23579 that._interSectionObserver.unobserve(that._elements.self); 23580 } 23581 23582 function getOptimalWidth(widths, useDevicePixelRatio) { 23583 var container = that._elements.self; 23584 var containerWidth = container.clientWidth; 23585 while (containerWidth === 0 && container.parentNode) { 23586 container = container.parentNode; 23587 containerWidth = container.clientWidth; 23588 } 23589 23590 var dpr = useDevicePixelRatio ? devicePixelRatio : 1; 23591 var optimalWidth = containerWidth * dpr; 23592 var len = widths.length; 23593 var key = 0; 23594 23595 while ((key < len - 1) && (widths[key] < optimalWidth)) { 23596 key++; 23597 } 23598 23599 return widths[key].toString(); 23600 } 23601 23602 function addLazyLoader() { 23603 var width = that._elements.image.getAttribute("width"); 23604 var height = that._elements.image.getAttribute("height"); 23605 23606 if (width && height) { 23607 var ratio = (height / width) * 100; 23608 var styles = lazyLoader.style; 23609 23610 styles["padding-bottom"] = ratio + "%"; 23611 23612 for (var s in styles) { 23613 if (Object.prototype.hasOwnProperty.call(styles, s)) { 23614 that._elements.image.style[s] = styles[s]; 23615 } 23616 } 23617 } 23618 that._elements.image.setAttribute("src", EMPTY_PIXEL); 23619 that._elements.image.classList.add(lazyLoader.cssClass); 23620 that._lazyLoaderShowing = true; 23621 } 23622 23623 function unwrapNoScript() { 23624 var markup = decodeNoscript(that._elements.noscript.textContent.trim()); 23625 var parser = new DOMParser(); 23626 23627 // temporary document avoids requesting the image before removing its src 23628 var temporaryDocument = parser.parseFromString(markup, "text/html"); 23629 var imageElement = temporaryDocument.querySelector(selectors.image); 23630 imageElement.removeAttribute("src"); 23631 that._elements.container.insertBefore(imageElement, that._elements.noscript); 23632 23633 var mapElement = temporaryDocument.querySelector(selectors.map); 23634 if (mapElement) { 23635 that._elements.container.insertBefore(mapElement, that._elements.noscript); 23636 } 23637 23638 that._elements.noscript.parentNode.removeChild(that._elements.noscript); 23639 if (that._elements.container.matches(selectors.image)) { 23640 that._elements.image = that._elements.container; 23641 } else { 23642 that._elements.image = that._elements.container.querySelector(selectors.image); 23643 } 23644 23645 that._elements.map = that._elements.container.querySelector(selectors.map); 23646 that._elements.areas = that._elements.container.querySelectorAll(selectors.area); 23647 } 23648 23649 function removeLazyLoader() { 23650 that._elements.image.classList.remove(lazyLoader.cssClass); 23651 for (var property in lazyLoader.style) { 23652 if (Object.prototype.hasOwnProperty.call(lazyLoader.style, property)) { 23653 that._elements.image.style[property] = ""; 23654 } 23655 } 23656 that._elements.image.removeEventListener("load", removeLazyLoader); 23657 that._lazyLoaderShowing = false;
23658 } 23659 23660 function isLazyVisible() { 23661 if (that._elements.container.offsetParent === null) { 23662 return false; 23663 } 23664 23665 var wt = window.pageYOffset; 23666 var wb = wt + document.documentElement.clientHeight; 23667 var et = that._elements.container.getBoundingClientRect().top + wt; 23668 var eb = et + that._elements.container.clientHeight; 23669 23670 return eb >= wt - that._properties.lazythreshold && et <= wb + that._properties.lazythreshold; 23671 } 23672 23673 function resizeAreas() { 23674 if (that._elements.areas && that._elements.areas.length > 0) { 23675 for (var i = 0; i < that._elements.areas.length; i++) { 23676 var width = that._elements.image.width; 23677 var height = that._elements.image.height; 23678 23679 if (width && height) { 23680 var relcoords = that._elements.areas[i].dataset.cmpRelcoords; 23681 if (relcoords) { 23682 var relativeCoordinates = relcoords.split(","); 23683 var coordinates = new Array(relativeCoordinates.length); 23684 23685 for (var j = 0; j < coordinates.length; j++) { 23686 if (j % 2 === 0) { 23687 coordinates[j] = parseInt(relativeCoordinates[j] * width); 23688 } else { 23689 coordinates[j] = parseInt(relativeCoordinates[j] * height); 23690 } 23691 } 23692 23693 that._elements.areas[i].coords = coordinates; 23694 } 23695 } 23696 } 23697 } 23698 } 23699 23700 function cacheElements(wrapper) { 23701 that._elements = {}; 23702 that._elements.self = wrapper; 23703 var hooks = that._elements.self.querySelectorAll("[data-" + NS + "-hook-" + IS + "]"); 23704 23705 for (var i = 0; i < hooks.length; i++) { 23706 var hook = hooks[i]; 23707 var capitalized = IS; 23708 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 23709 var key = hook.dataset[NS + "Hook" + capitalized]; 23710 that._elements[key] = hook; 23711 } 23712 } 23713 23714 function onWindowResize() { 23715 that.update(); 23716 resizeAreas(); 23717 } 23718 23719 function onLoad() { 23720 resizeAreas(); 23721 } 23722 23723 that.update = function() { 23724 if (that._properties.lazy) { 23725 if (isLazyVisible()) { 23726 loadImage(); 23727 } 23728 } else { 23729 loadImage(); 23730 } 23731 }; 23732 23733 if (config && config.element) { 23734 init(config); 23735 } 23736 } 23737 23738 function onDocumentReady() { 23739 var elements = document.querySelectorAll(selectors.self); 23740 for (var i = 0; i < elements.length; i++) { 23741 new Image({ element: elements[i], options: CMP.utils.readData(elements[i], IS) }); 23742 } 23743 23744 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 23745 var body = document.querySelector("body"); 23746 var observer = new MutationObserver(function(mutations) { 23747 mutations.forEach(function(mutation) { 23748 // needed for IE 23749 var nodesArray = [].slice.call(mutation.addedNodes); 23750 if (nodesArray.length > 0) { 23751 nodesArray.forEach(function(addedNode) { 23752 if (addedNode.querySelectorAll) { 23753 var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self)); 23754 elementsArray.forEach(function(element) { 23755 new Image({ element: element, options: CMP.utils.readData(element, IS) }); 23756 }); 23757 } 23758 }); 23759 } 23760 }); 23761 }); 23762 23763 observer.observe(body, { 23764 subtree: true, 23765 childList: true, 23766 characterData: true 23767 }); 23768 } 23769 23770 var documentReady = document.readyState !== "loading" ? Promise.resolve() : new Promise(function(resolve) { 23771 document.addEventListener("DOMContentLoaded", resolve); 23772 }); 23773 23774 Promise.all([documentReady]).then(onDocumentReady); 23775 /* 23776 on drag & drop of the component into a parsys, noscript's content will be escaped multiple times by the editor which creates 23777 the DOM for editing; the HTML parser cannot be used here due to the multiple escaping 23778 */ 23779 function decodeNoscript(text) { 23780 text = text.replace(/&(amp;)*lt;/g, "<"); 23781 text = text.replace(/&(amp;)*gt;/g, ">"); 23782 return text; 23783 } 23784 23785})(); 23786 23787/* 23788 * 23789 * ADOBE CONFIDENTIAL 23790 * __________________ 23791 * 23792 * Copyright 2014 Adobe Systems Incorporated 23793 * All Rights Reserved. 23794 *
23795 * NOTICE: All information contained herein is, and remains 23796 * the property of Adobe Systems Incorporated and its suppliers, 23797 * if any. The intellectual and technical concepts contained 23798 * herein are proprietary to Adobe Systems Incorporated and its 23799 * suppliers and are protected by trade secret or copyright law. 23800 * Dissemination of this information or reproduction of this material 23801 * is strictly forbidden unless prior written permission is obtained 23802 * from Adobe Systems Incorporated. 23803 */ 23804$CQ(document).ready(function() { 23805 var initQuicksearch = function(el_selector) { 23806 var $el = $(el_selector); 23807 $el.autocomplete({ 23808 source: function(request, response) { 23809 $.get(getUrl("*" + $CQ(el_selector).val() + "*"), function(data) { 23810 var results = data.items; 23811 response(results); 23812 }); 23813 }, 23814 minLength: 3, 23815 appendTo: ".scf-quicksearch-form-group", 23816 position: { 23817 my: "right top", 23818 at: "right bottom" 23819 }, 23820 focus: function(event, ui) { 23821 event.preventDefault(); 23822 $(this).val(getTitle(ui.item)); 23823 }, 23824 change: function(event, ui) {}, 23825 select: function(event, ui) { 23826 var keycode = (event.keyCode ? event.keyCode : event.which); 23827 if (keycode === 13) { 23828 window.location.replace(ui.item.friendlyUrl); 23829 } 23830 }, 23831 setvalue: function(value) {} 23832 }).data("uiAutocomplete")._renderItem = function(ul, item) { 23833 return $CQ("<li class='scf-quicksearch-item-container'></li>"). 23834 append("" + 23835 "<a href='" + item.friendlyUrl + "'>" + 23836 "<span class='glyphicon scf-icon-" + getIconClassName(item.resourceType) + "' aria-hidden='true'></span>" + 23837 "<span class='scf-quicksearch-item'>" + CQ.shared.XSS.getXSSValue(getTitle(item)) + "</span>" + 23838 "<span class='small scf-quicksearch-item-url'>" + encodeURI(item.friendlyUrl) + "</span>" + 23839 "</a>"). 23840 data("item.autocomplete", item). 23841 appendTo(ul); 23842 }; 23843 $("#scf-js-quicksearch-input-inline").keypress(function(event) { 23844 var keycode = (event.keyCode ? event.keyCode : event.which); 23845 if (keycode === 13) { 23846 event.preventDefault(); 23847 var currentPage = window.location.href; 23848 // Add current url to backbone history without navigating - to aid proper functioning of browser's back button. 23849 SCF.Router.navigate(currentPage, { 23850 trigger: false 23851 }); 23852 var form = $("#form-search-input-inline"); 23853 var resultPage = form.find(".scf-js-seach-resultPage").val(); 23854 var filter = getFilter($CQ(this).val(), true); 23855 var contextPath = CQ.shared.HTTP.getContextPath(); 23856 var url = resultPage + ".html?tzOffset=" + (new Date().getTimezoneOffset()) + "&" + filter; 23857 window.location.replace(url); 23858 } 23859 }); 23860 }; 23861 var getTitle = function(itemObj) { 23862 /* 23863 * Most resource types have their title stored in subject property. 23864 * Folder has it in name property. 23865 * Replies, comments, answers don't have title - for now display last of resource type. 23866 */ 23867 var title = (itemObj.subject && itemObj.subject.length > 0) ? itemObj.subject : (itemObj.name && itemObj.name.length > 0) ? itemObj.name : itemObj.resourceType.split("/")[itemObj.resourceType.split("/").length - 1]; 23868 return title; 23869 }; 23870 var getIconClassName = function(str) { 23871 return str.replace(/\//g, "-"); 23872 }; 23873 var getUrl = function(value) { 23874 var url = $CQ(".scf-js-search-endpoint").val() + ".social.json?" + getFilter(value); 23875 return url; 23876 }; 23877 var getFilter = function(value, isRegularSearch) { 23878 var filter = ""; 23879 var paths = $CQ(".scf-js-searchform").data("paths"); 23880 var searchPaths; 23881 if (typeof(paths) !== 'undefined' && paths !== null && paths.length > 0) { 23882 paths = paths.substring(1, paths.length - 1); // remove '[' and ']' 23883 searchPaths = paths.split(','); 23884 } 23885 value = value.trim(); 23886 //value = value.replace(/,/gi, '\\,'); 23887 //value = value.replace('*', '\\*'); 23888 if (value && value.length > 0) { 23889 filter = "filter=jcr:title like '" + encodeURIComponent(value) + "'"; 23890 filter += (filter.length > 0) ? ", " : "filter="; 23891 filter += "author_display_name like '" + encodeURIComponent(value) + "'"; 23892
23893 // when focusing in search filed and pressing Enter (not quikcsearch mode) 23894 // need to also search on tag and description 23895 if (isRegularSearch) { 23896 filter += ", jcr:description like '" + encodeURIComponent(value) + "'"; 23897 filter += ", tag like '" + encodeURIComponent(value) + "'"; 23898 } 23899 filter += "&expLanguage=" + "default"; 23900 filter += "&searchText=" + encodeURIComponent(value); 23901 } 23902 if (typeof(searchPaths) != 'undefined') { 23903 for (i = 0; i < searchPaths.length; i++) { 23904 filter += "&path=" + searchPaths[i].trim(); 23905 } 23906 } 23907 var contextPath = CQ.shared.HTTP.getContextPath(); 23908 contextPath = (contextPath !== null && contextPath.length > 0) ? contextPath : CQ.shared.HTTP.getPath(); 23909 filter += "&_charset_=utf-8"; 23910 return filter; 23911 }; 23912 if ($CQ("#scf-js-quicksearch-input-inline").length !== 0) { 23913 initQuicksearch($CQ("#scf-js-quicksearch-input-inline")); 23914 } 23915}); 23916 23917/******************************************************************************* 23918 * Copyright 2016 Adobe 23919 * 23920 * Licensed under the Apache License, Version 2.0 (the "License"); 23921 * you may not use this file except in compliance with the License. 23922 * You may obtain a copy of the License at 23923 * 23924 * http://www.apache.org/licenses/LICENSE-2.0 23925 * 23926 * Unless required by applicable law or agreed to in writing, software 23927 * distributed under the License is distributed on an "AS IS" BASIS, 23928 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23929 * See the License for the specific language governing permissions and 23930 * limitations under the License. 23931 ******************************************************************************/ 23932(function() { 23933 "use strict"; 23934 23935 var NS = "cmp"; 23936 var IS = "formText"; 23937 var IS_DASH = "form-text"; 23938 var SELF_SELECTOR = "[data-" + NS + '-is="' + IS + '"]'; 23939 23940 var selectors = { 23941 self: SELF_SELECTOR, 23942 validationMessage: SELF_SELECTOR + " .cmp-form-text__validation-message" 23943 }; 23944 23945 var displayValidationMessage = false; 23946 23947 var properties = { 23948 /** 23949 * A validation message to display if there is a type mismatch between the user input and expected input. 23950 * 23951 * @type {String} 23952 */ 23953 constraintMessage: "", 23954 /** 23955 * A validation message to display if no input is supplied, but input is expected for the field. 23956 * 23957 * @type {String} 23958 */ 23959 requiredMessage: "" 23960 }; 23961 23962 function readData(element) { 23963 var data = element.dataset; 23964 var options = []; 23965 var capitalized = IS; 23966 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 23967 var reserved = ["is", "hook" + capitalized]; 23968 23969 for (var key in data) { 23970 if (Object.prototype.hasOwnProperty.call(data, key)) { 23971 var value = data[key]; 23972 23973 if (key.indexOf(NS) === 0) { 23974 key = key.slice(NS.length); 23975 key = key.charAt(0).toLowerCase() + key.substring(1); 23976 23977 if (reserved.indexOf(key) === -1) { 23978 options[key] = value; 23979 } 23980 } 23981 } 23982 } 23983 23984 return options; 23985 } 23986 23987 function FormText(config) { 23988 if (config.element) { 23989 // prevents multiple initialization 23990 config.element.removeAttribute("data-" + NS + "-is"); 23991 } 23992 23993 this._cacheElements(config.element); 23994 this._setupProperties(config.options); 23995 23996 this._elements.input.addEventListener("invalid", this._onInvalid.bind(this)); 23997 this._elements.input.addEventListener("input", this._onInput.bind(this)); 23998 if (displayValidationMessage) { 23999 this._elements.input.checkValidity(); 24000 } 24001 } 24002 24003 FormText.prototype._onInvalid = function(event) { 24004 event.target.setCustomValidity(""); 24005 if (event.target.validity.typeMismatch) { 24006 if (this._properties.constraintMessage) { 24007 event.target.setCustomValidity(this._properties.constraintMessage); 24008 } 24009 } else if (event.target.validity.valueMissing) { 24010 if (this._properties.requiredMessage) { 24011 event.target.setCustomValidity(this._properties.requiredMessage); 24012 } 24013 } 24014 if (displayValidationMessage) {
24015 var validationMessage = event.target.parentElement.querySelector(".cmp-form-text__validation-message"); 24016 if (validationMessage) { 24017 validationMessage.innerText = event.target.validationMessage; 24018 } 24019 } 24020 }; 24021 24022 FormText.prototype._onInput = function(event) { 24023 event.target.setCustomValidity(""); 24024 if (displayValidationMessage) { 24025 event.target.checkValidity(); 24026 } 24027 }; 24028 24029 FormText.prototype._cacheElements = function(wrapper) { 24030 this._elements = {}; 24031 this._elements.self = wrapper; 24032 var hooks = this._elements.self.querySelectorAll("[data-" + NS + "-hook-" + IS_DASH + "]"); 24033 for (var i = 0; i < hooks.length; i++) { 24034 var hook = hooks[i]; 24035 var capitalized = IS; 24036 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 24037 var key = hook.dataset[NS + "Hook" + capitalized]; 24038 this._elements[key] = hook; 24039 } 24040 }; 24041 24042 FormText.prototype._setupProperties = function(options) { 24043 this._properties = {}; 24044 24045 for (var key in properties) { 24046 if (Object.prototype.hasOwnProperty.call(properties, key)) { 24047 var property = properties[key]; 24048 if (options && options[key] != null) { 24049 if (property && typeof property.transform === "function") { 24050 this._properties[key] = property.transform(options[key]); 24051 } else { 24052 this._properties[key] = options[key]; 24053 } 24054 } else { 24055 this._properties[key] = properties[key]["default"]; 24056 } 24057 } 24058 } 24059 }; 24060 24061 function onDocumentReady() { 24062 var validationMessages = document.querySelectorAll(selectors.validationMessage); 24063 if (validationMessages && validationMessages.length > 0) { 24064 displayValidationMessage = true; 24065 } 24066 24067 var elements = document.querySelectorAll(selectors.self); 24068 for (var i = 0; i < elements.length; i++) { 24069 new FormText({ element: elements[i], options: readData(elements[i]) }); 24070 } 24071 24072 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 24073 var body = document.querySelector("body"); 24074 var observer = new MutationObserver(function(mutations) { 24075 mutations.forEach(function(mutation) { 24076 // needed for IE 24077 var nodesArray = [].slice.call(mutation.addedNodes); 24078 if (nodesArray.length > 0) { 24079 nodesArray.forEach(function(addedNode) { 24080 if (addedNode.querySelectorAll) { 24081 var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self)); 24082 elementsArray.forEach(function(element) { 24083 new FormText({ element: element, options: readData(element) }); 24084 }); 24085 } 24086 }); 24087 } 24088 }); 24089 }); 24090 24091 observer.observe(body, { 24092 subtree: true, 24093 childList: true, 24094 characterData: true 24095 }); 24096 } 24097 24098 if (document.readyState !== "loading") { 24099 onDocumentReady(); 24100 } else { 24101 document.addEventListener("DOMContentLoaded", onDocumentReady); 24102 } 24103 24104})(); 24105 24106/**! 24107 * @fileOverview Kickass library to create and place poppers near their reference elements. 24108 * @version 1.16.1 24109 * @license 24110 * Copyright (c) 2016 Federico Zivolo and contributors 24111 * 24112 * Permission is hereby granted, free of charge, to any person obtaining a copy 24113 * of this software and associated documentation files (the "Software"), to deal 24114 * in the Software without restriction, including without limitation the rights 24115 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 24116 * copies of the Software, and to permit persons to whom the Software is 24117 * furnished to do so, subject to the following conditions: 24118 * 24119 * The above copyright notice and this permission notice shall be included in all 24120 * copies or substantial portions of the Software. 24121 * 24122 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24123 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24124 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24125 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24126 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24127 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24128 * SOFTWARE. 24129 */ 24130(function (global, factory) { 24131 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 24132 typeof define === 'function' && define.amd ? define(factory) : 24133 (global.Popper = factory()); 24134}(this, (function () { 'use strict'; 24135 24136var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 24137 24138var timeoutDuration = function () { 24139 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 24140 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 24141 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 24142 return 1; 24143 } 24144 } 24145 return 0; 24146}(); 24147 24148function microtaskDebounce(fn) { 24149 var called = false;
vendor: 3,141 bytes, lines 24150-24275
24150 return function () { 24151 if (called) { 24152 return; 24153 } 24154 called = true; 24155 window.Promise.resolve().then(function () { 24156 called = false; 24157 fn(); 24158 }); 24159 }; 24160} 24161 24162function taskDebounce(fn) { 24163 var scheduled = false; 24164 return function () { 24165 if (!scheduled) { 24166 scheduled = true; 24167 setTimeout(function () { 24168 scheduled = false; 24169 fn(); 24170 }, timeoutDuration); 24171 } 24172 }; 24173} 24174 24175var supportsMicroTasks = isBrowser && window.Promise; 24176 24177/** 24178* Create a debounced version of a method, that's asynchronously deferred 24179* but called in the minimum time possible. 24180* 24181* @method 24182* @memberof Popper.Utils 24183* @argument {Function} fn 24184* @returns {Function} 24185*/ 24186var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 24187 24188/** 24189 * Check if the given variable is a function 24190 * @method 24191 * @memberof Popper.Utils 24192 * @argument {Any} functionToCheck - variable to check 24193 * @returns {Boolean} answer to: is a function? 24194 */ 24195function isFunction(functionToCheck) { 24196 var getType = {}; 24197 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 24198} 24199 24200/** 24201 * Get CSS computed property of the given element 24202 * @method 24203 * @memberof Popper.Utils 24204 * @argument {Eement} element 24205 * @argument {String} property 24206 */ 24207function getStyleComputedProperty(element, property) { 24208 if (element.nodeType !== 1) { 24209 return []; 24210 } 24211 // NOTE: 1 DOM access here 24212 var window = element.ownerDocument.defaultView; 24213 var css = window.getComputedStyle(element, null); 24214 return property ? css[property] : css; 24215} 24216 24217/** 24218 * Returns the parentNode or the host of the element 24219 * @method 24220 * @memberof Popper.Utils 24221 * @argument {Element} element 24222 * @returns {Element} parent 24223 */ 24224function getParentNode(element) { 24225 if (element.nodeName === 'HTML') { 24226 return element; 24227 } 24228 return element.parentNode || element.host; 24229} 24230 24231/** 24232 * Returns the scrolling parent of the given element 24233 * @method 24234 * @memberof Popper.Utils 24235 * @argument {Element} element 24236 * @returns {Element} scroll parent 24237 */ 24238function getScrollParent(element) { 24239 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 24240 if (!element) { 24241 return document.body; 24242 } 24243 24244 switch (element.nodeName) { 24245 case 'HTML': 24246 case 'BODY': 24247 return element.ownerDocument.body; 24248 case '#document': 24249 return element.body; 24250 } 24251 24252 // Firefox want us to check `-x` and `-y` variations as well 24253 24254 var _getStyleComputedProp = getStyleComputedProperty(element), 24255 overflow = _getStyleComputedProp.overflow, 24256 overflowX = _getStyleComputedProp.overflowX, 24257 overflowY = _getStyleComputedProp.overflowY; 24258 24259 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 24260 return element; 24261 } 24262 24263 return getScrollParent(getParentNode(element)); 24264} 24265 24266/** 24267 * Returns the reference node of the reference object, or the reference object itself. 24268 * @method 24269 * @memberof Popper.Utils 24270 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 24271 * @returns {Element} parent 24272 */ 24273function getReferenceNode(reference) { 24274 return reference && reference.referenceNode ? reference.referenceNode : reference; 24275}
vendor: 3,047 bytes, lines 24275-24381
24275 24276 24277var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 24278var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 24279 24280/** 24281 * Determines if the browser is Internet Explorer 24282 * @method 24283 * @memberof Popper.Utils 24284 * @param {Number} version to check 24285 * @returns {Boolean} isIE 24286 */ 24287function isIE(version) { 24288 if (version === 11) { 24289 return isIE11; 24290 } 24291 if (version === 10) { 24292 return isIE10; 24293 } 24294 return isIE11 || isIE10; 24295} 24296 24297/** 24298 * Returns the offset parent of the given element 24299 * @method 24300 * @memberof Popper.Utils 24301 * @argument {Element} element 24302 * @returns {Element} offset parent 24303 */ 24304function getOffsetParent(element) { 24305 if (!element) { 24306 return document.documentElement; 24307 } 24308 24309 var noOffsetParent = isIE(10) ? document.body : null; 24310 24311 // NOTE: 1 DOM access here 24312 var offsetParent = element.offsetParent || null; 24313 // Skip hidden elements which don't have an offsetParent 24314 while (offsetParent === noOffsetParent && element.nextElementSibling) { 24315 offsetParent = (element = element.nextElementSibling).offsetParent; 24316 } 24317 24318 var nodeName = offsetParent && offsetParent.nodeName; 24319 24320 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 24321 return element ? element.ownerDocument.documentElement : document.documentElement; 24322 } 24323 24324 // .offsetParent will return the closest TH, TD or TABLE in case 24325 // no offsetParent is present, I hate this job... 24326 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 24327 return getOffsetParent(offsetParent); 24328 } 24329 24330 return offsetParent; 24331} 24332 24333function isOffsetContainer(element) { 24334 var nodeName = element.nodeName; 24335 24336 if (nodeName === 'BODY') { 24337 return false; 24338 } 24339 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 24340} 24341 24342/** 24343 * Finds the root node (document, shadowDOM root) of the given element 24344 * @method 24345 * @memberof Popper.Utils 24346 * @argument {Element} node 24347 * @returns {Element} root node 24348 */ 24349function getRoot(node) { 24350 if (node.parentNode !== null) { 24351 return getRoot(node.parentNode); 24352 } 24353 24354 return node; 24355} 24356 24357/** 24358 * Finds the offset parent common to the two provided nodes 24359 * @method 24360 * @memberof Popper.Utils 24361 * @argument {Element} element1 24362 * @argument {Element} element2 24363 * @returns {Element} common offset parent 24364 */ 24365function findCommonOffsetParent(element1, element2) { 24366 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 24367 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 24368 return document.documentElement; 24369 } 24370 24371 // Here we make sure to give as "start" the element that comes first in the DOM 24372 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 24373 var start = order ? element1 : element2; 24374 var end = order ? element2 : element1; 24375 24376 // Get common ancestor container 24377 var range = document.createRange(); 24378 range.setStart(start, 0); 24379 range.setEnd(end, 0); 24380 var commonAncestorContainer = range.commonAncestorContainer; 24381
vendor: 5,354 bytes, lines 24382-24559
24382 // Both nodes are inside #document 24383 24384 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 24385 if (isOffsetContainer(commonAncestorContainer)) { 24386 return commonAncestorContainer; 24387 } 24388 24389 return getOffsetParent(commonAncestorContainer); 24390 } 24391 24392 // one of the nodes is inside shadowDOM, find which one 24393 var element1root = getRoot(element1); 24394 if (element1root.host) { 24395 return findCommonOffsetParent(element1root.host, element2); 24396 } else { 24397 return findCommonOffsetParent(element1, getRoot(element2).host); 24398 } 24399} 24400 24401/** 24402 * Gets the scroll value of the given element in the given side (top and left) 24403 * @method 24404 * @memberof Popper.Utils 24405 * @argument {Element} element 24406 * @argument {String} side `top` or `left` 24407 * @returns {number} amount of scrolled pixels 24408 */ 24409function getScroll(element) { 24410 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 24411 24412 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 24413 var nodeName = element.nodeName; 24414 24415 if (nodeName === 'BODY' || nodeName === 'HTML') { 24416 var html = element.ownerDocument.documentElement; 24417 var scrollingElement = element.ownerDocument.scrollingElement || html; 24418 return scrollingElement[upperSide]; 24419 } 24420 24421 return element[upperSide]; 24422} 24423 24424/* 24425 * Sum or subtract the element scroll values (left and top) from a given rect object 24426 * @method 24427 * @memberof Popper.Utils 24428 * @param {Object} rect - Rect object you want to change 24429 * @param {HTMLElement} element - The element from the function reads the scroll values 24430 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 24431 * @return {Object} rect - The modifier rect object 24432 */ 24433function includeScroll(rect, element) { 24434 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 24435 24436 var scrollTop = getScroll(element, 'top'); 24437 var scrollLeft = getScroll(element, 'left'); 24438 var modifier = subtract ? -1 : 1; 24439 rect.top += scrollTop * modifier; 24440 rect.bottom += scrollTop * modifier; 24441 rect.left += scrollLeft * modifier; 24442 rect.right += scrollLeft * modifier; 24443 return rect; 24444} 24445 24446/* 24447 * Helper to detect borders of a given element 24448 * @method 24449 * @memberof Popper.Utils 24450 * @param {CSSStyleDeclaration} styles 24451 * Result of `getStyleComputedProperty` on the given element 24452 * @param {String} axis - `x` or `y` 24453 * @return {number} borders - The borders size of the given axis 24454 */ 24455 24456function getBordersSize(styles, axis) { 24457 var sideA = axis === 'x' ? 'Left' : 'Top'; 24458 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 24459 24460 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 24461} 24462 24463function getSize(axis, body, html, computedStyle) { 24464 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 24465} 24466 24467function getWindowSizes(document) { 24468 var body = document.body; 24469 var html = document.documentElement; 24470 var computedStyle = isIE(10) && getComputedStyle(html); 24471 24472 return { 24473 height: getSize('Height', body, html, computedStyle), 24474 width: getSize('Width', body, html, computedStyle) 24475 }; 24476} 24477 24478var classCallCheck = function (instance, Constructor) { 24479 if (!(instance instanceof Constructor)) { 24480 throw new TypeError("Cannot call a class as a function"); 24481 } 24482}; 24483 24484var createClass = function () { 24485 function defineProperties(target, props) { 24486 for (var i = 0; i < props.length; i++) { 24487 var descriptor = props[i]; 24488 descriptor.enumerable = descriptor.enumerable || false; 24489 descriptor.configurable = true; 24490 if ("value" in descriptor) descriptor.writable = true; 24491 Object.defineProperty(target, descriptor.key, descriptor); 24492 } 24493 } 24494 24495 return function (Constructor, protoProps, staticProps) { 24496 if (protoProps) defineProperties(Constructor.prototype, protoProps); 24497 if (staticProps) defineProperties(Constructor, staticProps); 24498 return Constructor; 24499 }; 24500}(); 24501 24502 24503 24504 24505 24506var defineProperty = function (obj, key, value) { 24507 if (key in obj) { 24508 Object.defineProperty(obj, key, { 24509 value: value, 24510 enumerable: true, 24511 configurable: true, 24512 writable: true 24513 }); 24514 } else { 24515 obj[key] = value; 24516 } 24517 24518 return obj; 24519}; 24520 24521var _extends = Object.assign || function (target) { 24522 for (var i = 1; i < arguments.length; i++) { 24523 var source = arguments[i]; 24524 24525 for (var key in source) { 24526 if (Object.prototype.hasOwnProperty.call(source, key)) { 24527 target[key] = source[key]; 24528 } 24529 } 24530 } 24531 24532 return target; 24533}; 24534 24535/** 24536 * Given element offsets, generate an output similar to getBoundingClientRect 24537 * @method 24538 * @memberof Popper.Utils 24539 * @argument {Object} offsets 24540 * @returns {Object} ClientRect like output 24541 */ 24542function getClientRect(offsets) { 24543 return _extends({}, offsets, { 24544 right: offsets.left + offsets.width, 24545 bottom: offsets.top + offsets.height 24546 }); 24547} 24548 24549/** 24550 * Get bounding client rect of given element 24551 * @method 24552 * @memberof Popper.Utils 24553 * @param {HTMLElement} element 24554 * @return {Object} client rect 24555 */ 24556function getBoundingClientRect(element) { 24557 var rect = {}; 24558 24559 // IE10 10 FIX: Please, don't ask, the element isn't
vendor: 4,625 bytes, lines 24560-24689
24560 // considered in DOM in some circumstances... 24561 // This isn't reproducible in IE10 compatibility mode of IE11 24562 try { 24563 if (isIE(10)) { 24564 rect = element.getBoundingClientRect(); 24565 var scrollTop = getScroll(element, 'top'); 24566 var scrollLeft = getScroll(element, 'left'); 24567 rect.top += scrollTop; 24568 rect.left += scrollLeft; 24569 rect.bottom += scrollTop; 24570 rect.right += scrollLeft; 24571 } else { 24572 rect = element.getBoundingClientRect(); 24573 } 24574 } catch (e) {} 24575 24576 var result = { 24577 left: rect.left, 24578 top: rect.top, 24579 width: rect.right - rect.left, 24580 height: rect.bottom - rect.top 24581 }; 24582 24583 // subtract scrollbar size from sizes 24584 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 24585 var width = sizes.width || element.clientWidth || result.width; 24586 var height = sizes.height || element.clientHeight || result.height; 24587 24588 var horizScrollbar = element.offsetWidth - width; 24589 var vertScrollbar = element.offsetHeight - height; 24590 24591 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 24592 // we make this check conditional for performance reasons 24593 if (horizScrollbar || vertScrollbar) { 24594 var styles = getStyleComputedProperty(element); 24595 horizScrollbar -= getBordersSize(styles, 'x'); 24596 vertScrollbar -= getBordersSize(styles, 'y'); 24597 24598 result.width -= horizScrollbar; 24599 result.height -= vertScrollbar; 24600 } 24601 24602 return getClientRect(result); 24603} 24604 24605function getOffsetRectRelativeToArbitraryNode(children, parent) { 24606 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 24607 24608 var isIE10 = isIE(10); 24609 var isHTML = parent.nodeName === 'HTML'; 24610 var childrenRect = getBoundingClientRect(children); 24611 var parentRect = getBoundingClientRect(parent); 24612 var scrollParent = getScrollParent(children); 24613 24614 var styles = getStyleComputedProperty(parent); 24615 var borderTopWidth = parseFloat(styles.borderTopWidth); 24616 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 24617 24618 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 24619 if (fixedPosition && isHTML) { 24620 parentRect.top = Math.max(parentRect.top, 0); 24621 parentRect.left = Math.max(parentRect.left, 0); 24622 } 24623 var offsets = getClientRect({ 24624 top: childrenRect.top - parentRect.top - borderTopWidth, 24625 left: childrenRect.left - parentRect.left - borderLeftWidth, 24626 width: childrenRect.width, 24627 height: childrenRect.height 24628 }); 24629 offsets.marginTop = 0; 24630 offsets.marginLeft = 0; 24631 24632 // Subtract margins of documentElement in case it's being used as parent 24633 // we do this only on HTML because it's the only element that behaves 24634 // differently when margins are applied to it. The margins are included in 24635 // the box of the documentElement, in the other cases not. 24636 if (!isIE10 && isHTML) { 24637 var marginTop = parseFloat(styles.marginTop); 24638 var marginLeft = parseFloat(styles.marginLeft); 24639 24640 offsets.top -= borderTopWidth - marginTop; 24641 offsets.bottom -= borderTopWidth - marginTop; 24642 offsets.left -= borderLeftWidth - marginLeft; 24643 offsets.right -= borderLeftWidth - marginLeft; 24644 24645 // Attach marginTop and marginLeft because in some circumstances we may need them 24646 offsets.marginTop = marginTop; 24647 offsets.marginLeft = marginLeft; 24648 } 24649 24650 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 24651 offsets = includeScroll(offsets, parent); 24652 } 24653 24654 return offsets; 24655} 24656 24657function getViewportOffsetRectRelativeToArtbitraryNode(element) { 24658 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 24659 24660 var html = element.ownerDocument.documentElement; 24661 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 24662 var width = Math.max(html.clientWidth, window.innerWidth || 0); 24663 var height = Math.max(html.clientHeight, window.innerHeight || 0); 24664 24665 var scrollTop = !excludeScroll ? getScroll(html) : 0; 24666 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 24667 24668 var offset = { 24669 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 24670 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 24671 width: width, 24672 height: height 24673 }; 24674 24675 return getClientRect(offset); 24676} 24677 24678/** 24679 * Check if the given element is fixed or is inside a fixed parent 24680 * @method 24681 * @memberof Popper.Utils 24682 * @argument {Element} element 24683 * @argument {Element} customContainer 24684 * @returns {Boolean} answer to "isFixed?" 24685 */ 24686function isFixed(element) { 24687 var nodeName = element.nodeName; 24688 if (nodeName === 'BODY' || nodeName === 'HTML') { 24689 return false;
vendor: 16,186 bytes, lines 24690-25199
24690 } 24691 if (getStyleComputedProperty(element, 'position') === 'fixed') { 24692 return true; 24693 } 24694 var parentNode = getParentNode(element); 24695 if (!parentNode) { 24696 return false; 24697 } 24698 return isFixed(parentNode); 24699} 24700 24701/** 24702 * Finds the first parent of an element that has a transformed property defined 24703 * @method 24704 * @memberof Popper.Utils 24705 * @argument {Element} element 24706 * @returns {Element} first transformed parent or documentElement 24707 */ 24708 24709function getFixedPositionOffsetParent(element) { 24710 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 24711 if (!element || !element.parentElement || isIE()) { 24712 return document.documentElement; 24713 } 24714 var el = element.parentElement; 24715 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 24716 el = el.parentElement; 24717 } 24718 return el || document.documentElement; 24719} 24720 24721/** 24722 * Computed the boundaries limits and return them 24723 * @method 24724 * @memberof Popper.Utils 24725 * @param {HTMLElement} popper 24726 * @param {HTMLElement} reference 24727 * @param {number} padding 24728 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 24729 * @param {Boolean} fixedPosition - Is in fixed position mode 24730 * @returns {Object} Coordinates of the boundaries 24731 */ 24732function getBoundaries(popper, reference, padding, boundariesElement) { 24733 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 24734 24735 // NOTE: 1 DOM access here 24736 24737 var boundaries = { top: 0, left: 0 }; 24738 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 24739 24740 // Handle viewport case 24741 if (boundariesElement === 'viewport') { 24742 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 24743 } else { 24744 // Handle other cases based on DOM element used as boundaries 24745 var boundariesNode = void 0; 24746 if (boundariesElement === 'scrollParent') { 24747 boundariesNode = getScrollParent(getParentNode(reference)); 24748 if (boundariesNode.nodeName === 'BODY') { 24749 boundariesNode = popper.ownerDocument.documentElement; 24750 } 24751 } else if (boundariesElement === 'window') { 24752 boundariesNode = popper.ownerDocument.documentElement; 24753 } else { 24754 boundariesNode = boundariesElement; 24755 } 24756 24757 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 24758 24759 // In case of HTML, we need a different computation 24760 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 24761 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 24762 height = _getWindowSizes.height, 24763 width = _getWindowSizes.width; 24764 24765 boundaries.top += offsets.top - offsets.marginTop; 24766 boundaries.bottom = height + offsets.top; 24767 boundaries.left += offsets.left - offsets.marginLeft; 24768 boundaries.right = width + offsets.left; 24769 } else { 24770 // for all the other DOM elements, this one is good 24771 boundaries = offsets; 24772 } 24773 } 24774 24775 // Add paddings 24776 padding = padding || 0; 24777 var isPaddingNumber = typeof padding === 'number'; 24778 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 24779 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 24780 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 24781 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 24782 24783 return boundaries; 24784} 24785 24786function getArea(_ref) { 24787 var width = _ref.width, 24788 height = _ref.height; 24789 24790 return width * height; 24791} 24792 24793/** 24794 * Utility used to transform the `auto` placement to the placement with more 24795 * available space. 24796 * @method 24797 * @memberof Popper.Utils 24798 * @argument {Object} data - The data object generated by update method 24799 * @argument {Object} options - Modifiers configuration and options 24800 * @returns {Object} The data object, properly modified 24801 */ 24802function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 24803 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 24804 24805 if (placement.indexOf('auto') === -1) { 24806 return placement; 24807 } 24808 24809 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 24810 24811 var rects = { 24812 top: { 24813 width: boundaries.width, 24814 height: refRect.top - boundaries.top 24815 }, 24816 right: { 24817 width: boundaries.right - refRect.right, 24818 height: boundaries.height 24819 }, 24820 bottom: { 24821 width: boundaries.width, 24822 height: boundaries.bottom - refRect.bottom 24823 }, 24824 left: { 24825 width: refRect.left - boundaries.left, 24826 height: boundaries.height 24827 } 24828 }; 24829 24830 var sortedAreas = Object.keys(rects).map(function (key) { 24831 return _extends({ 24832 key: key 24833 }, rects[key], { 24834 area: getArea(rects[key]) 24835 }); 24836 }).sort(function (a, b) { 24837 return b.area - a.area; 24838 }); 24839 24840 var filteredAreas = sortedAreas.filter(function (_ref2) { 24841 var width = _ref2.width, 24842 height = _ref2.height; 24843 return width >= popper.clientWidth && height >= popper.clientHeight; 24844 }); 24845 24846 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 24847 24848 var variation = placement.split('-')[1]; 24849 24850 return computedPlacement + (variation ? '-' + variation : ''); 24851} 24852 24853/** 24854 * Get offsets to the reference element 24855 * @method 24856 * @memberof Popper.Utils 24857 * @param {Object} state 24858 * @param {Element} popper - the popper element 24859 * @param {Element} reference - the reference element (the popper will be relative to this) 24860 * @param {Element} fixedPosition - is in fixed position mode 24861 * @returns {Object} An object containing the offsets which will be applied to the popper 24862 */ 24863function getReferenceOffsets(state, popper, reference) { 24864 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 24865 24866 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 24867 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 24868} 24869 24870/** 24871 * Get the outer sizes of the given element (offset size + margins) 24872 * @method 24873 * @memberof Popper.Utils 24874 * @argument {Element} element 24875 * @returns {Object} object containing width and height properties 24876 */ 24877function getOuterSizes(element) { 24878 var window = element.ownerDocument.defaultView; 24879 var styles = window.getComputedStyle(element); 24880 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 24881 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 24882 var result = { 24883 width: element.offsetWidth + y, 24884 height: element.offsetHeight + x 24885 }; 24886 return result; 24887} 24888 24889/** 24890 * Get the opposite placement of the given one 24891 * @method 24892 * @memberof Popper.Utils 24893 * @argument {String} placement 24894 * @returns {String} flipped placement 24895 */ 24896function getOppositePlacement(placement) { 24897 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 24898 return placement.replace(/left|right|bottom|top/g, function (matched) { 24899 return hash[matched]; 24900 }); 24901} 24902 24903/** 24904 * Get offsets to the popper 24905 * @method 24906 * @memberof Popper.Utils 24907 * @param {Object} position - CSS position the Popper will get applied 24908 * @param {HTMLElement} popper - the popper element 24909 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 24910 * @param {String} placement - one of the valid placement options 24911 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 24912 */ 24913function getPopperOffsets(popper, referenceOffsets, placement) { 24914 placement = placement.split('-')[0]; 24915 24916 // Get popper node sizes 24917 var popperRect = getOuterSizes(popper); 24918 24919 // Add position, width and height to our offsets object 24920 var popperOffsets = { 24921 width: popperRect.width, 24922 height: popperRect.height 24923 }; 24924 24925 // depending by the popper placement we have to compute its offsets slightly differently 24926 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 24927 var mainSide = isHoriz ? 'top' : 'left'; 24928 var secondarySide = isHoriz ? 'left' : 'top'; 24929 var measurement = isHoriz ? 'height' : 'width'; 24930 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 24931 24932 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 24933 if (placement === secondarySide) { 24934 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 24935 } else { 24936 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 24937 } 24938 24939 return popperOffsets; 24940} 24941 24942/** 24943 * Mimics the `find` method of Array 24944 * @method 24945 * @memberof Popper.Utils 24946 * @argument {Array} arr 24947 * @argument prop 24948 * @argument value 24949 * @returns index or -1 24950 */ 24951function find(arr, check) { 24952 // use native find if supported 24953 if (Array.prototype.find) { 24954 return arr.find(check); 24955 } 24956 24957 // use `filter` to obtain the same behavior of `find` 24958 return arr.filter(check)[0]; 24959} 24960 24961/** 24962 * Return the index of the matching object 24963 * @method 24964 * @memberof Popper.Utils 24965 * @argument {Array} arr 24966 * @argument prop 24967 * @argument value 24968 * @returns index or -1 24969 */ 24970function findIndex(arr, prop, value) { 24971 // use native findIndex if supported 24972 if (Array.prototype.findIndex) { 24973 return arr.findIndex(function (cur) { 24974 return cur[prop] === value; 24975 }); 24976 } 24977 24978 // use `find` + `indexOf` if `findIndex` isn't supported 24979 var match = find(arr, function (obj) { 24980 return obj[prop] === value; 24981 }); 24982 return arr.indexOf(match); 24983} 24984 24985/** 24986 * Loop trough the list of modifiers and run them in order, 24987 * each of them will then edit the data object. 24988 * @method 24989 * @memberof Popper.Utils 24990 * @param {dataObject} data 24991 * @param {Array} modifiers 24992 * @param {String} ends - Optional modifier name used as stopper 24993 * @returns {dataObject} 24994 */ 24995function runModifiers(modifiers, data, ends) { 24996 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 24997 24998 modifiersToRun.forEach(function (modifier) { 24999 if (modifier['function']) { 25000 // eslint-disable-line dot-notation 25001 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 25002 } 25003 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 25004 if (modifier.enabled && isFunction(fn)) { 25005 // Add properties to offsets to make them a complete clientRect object 25006 // we do this before each modifier to make sure the previous one doesn't 25007 // mess with these values 25008 data.offsets.popper = getClientRect(data.offsets.popper); 25009 data.offsets.reference = getClientRect(data.offsets.reference); 25010 25011 data = fn(data, modifier); 25012 } 25013 }); 25014 25015 return data; 25016} 25017 25018/** 25019 * Updates the position of the popper, computing the new offsets and applying 25020 * the new style.<br /> 25021 * Prefer `scheduleUpdate` over `update` because of performance reasons. 25022 * @method 25023 * @memberof Popper 25024 */ 25025function update() { 25026 // if popper is destroyed, don't perform any further update 25027 if (this.state.isDestroyed) { 25028 return; 25029 } 25030 25031 var data = { 25032 instance: this, 25033 styles: {}, 25034 arrowStyles: {}, 25035 attributes: {}, 25036 flipped: false, 25037 offsets: {} 25038 }; 25039 25040 // compute reference element offsets 25041 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 25042 25043 // compute auto placement, store placement inside the data object, 25044 // modifiers will be able to edit `placement` if needed 25045 // and refer to originalPlacement to know the original value 25046 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 25047 25048 // store the computed placement inside `originalPlacement` 25049 data.originalPlacement = data.placement; 25050 25051 data.positionFixed = this.options.positionFixed; 25052 25053 // compute the popper offsets 25054 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 25055 25056 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 25057 25058 // run the modifiers 25059 data = runModifiers(this.modifiers, data); 25060 25061 // the first `update` will call `onCreate` callback 25062 // the other ones will call `onUpdate` callback 25063 if (!this.state.isCreated) { 25064 this.state.isCreated = true; 25065 this.options.onCreate(data); 25066 } else { 25067 this.options.onUpdate(data); 25068 } 25069} 25070 25071/** 25072 * Helper used to know if the given modifier is enabled. 25073 * @method 25074 * @memberof Popper.Utils 25075 * @returns {Boolean} 25076 */ 25077function isModifierEnabled(modifiers, modifierName) { 25078 return modifiers.some(function (_ref) { 25079 var name = _ref.name, 25080 enabled = _ref.enabled; 25081 return enabled && name === modifierName; 25082 }); 25083} 25084 25085/** 25086 * Get the prefixed supported property name 25087 * @method 25088 * @memberof Popper.Utils 25089 * @argument {String} property (camelCase) 25090 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 25091 */ 25092function getSupportedPropertyName(property) { 25093 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 25094 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 25095 25096 for (var i = 0; i < prefixes.length; i++) { 25097 var prefix = prefixes[i]; 25098 var toCheck = prefix ? '' + prefix + upperProp : property; 25099 if (typeof document.body.style[toCheck] !== 'undefined') { 25100 return toCheck; 25101 } 25102 } 25103 return null; 25104} 25105 25106/** 25107 * Destroys the popper. 25108 * @method 25109 * @memberof Popper 25110 */ 25111function destroy() { 25112 this.state.isDestroyed = true; 25113 25114 // touch DOM only if `applyStyle` modifier is enabled 25115 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 25116 this.popper.removeAttribute('x-placement'); 25117 this.popper.style.position = ''; 25118 this.popper.style.top = ''; 25119 this.popper.style.left = ''; 25120 this.popper.style.right = ''; 25121 this.popper.style.bottom = ''; 25122 this.popper.style.willChange = ''; 25123 this.popper.style[getSupportedPropertyName('transform')] = ''; 25124 } 25125 25126 this.disableEventListeners(); 25127 25128 // remove the popper if user explicitly asked for the deletion on destroy 25129 // do not use `remove` because IE11 doesn't support it 25130 if (this.options.removeOnDestroy) { 25131 this.popper.parentNode.removeChild(this.popper); 25132 } 25133 return this; 25134} 25135 25136/** 25137 * Get the window associated with the element 25138 * @argument {Element} element 25139 * @returns {Window} 25140 */ 25141function getWindow(element) { 25142 var ownerDocument = element.ownerDocument; 25143 return ownerDocument ? ownerDocument.defaultView : window; 25144} 25145 25146function attachToScrollParents(scrollParent, event, callback, scrollParents) { 25147 var isBody = scrollParent.nodeName === 'BODY'; 25148 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 25149 target.addEventListener(event, callback, { passive: true }); 25150 25151 if (!isBody) { 25152 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 25153 } 25154 scrollParents.push(target); 25155} 25156 25157/** 25158 * Setup needed event listeners used to update the popper position 25159 * @method 25160 * @memberof Popper.Utils 25161 * @private 25162 */ 25163function setupEventListeners(reference, options, state, updateBound) { 25164 // Resize event listener on window 25165 state.updateBound = updateBound; 25166 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 25167 25168 // Scroll event listener on scroll parents 25169 var scrollElement = getScrollParent(reference); 25170 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 25171 state.scrollElement = scrollElement; 25172 state.eventsEnabled = true; 25173 25174 return state; 25175} 25176 25177/** 25178 * It will add resize/scroll events and start recalculating 25179 * position of the popper element when they are triggered. 25180 * @method 25181 * @memberof Popper 25182 */ 25183function enableEventListeners() { 25184 if (!this.state.eventsEnabled) { 25185 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 25186 } 25187} 25188 25189/** 25190 * Remove event listeners used to update the popper position 25191 * @method 25192 * @memberof Popper.Utils 25193 * @private 25194 */ 25195function removeEventListeners(reference, state) { 25196 // Remove resize event listener on window 25197 getWindow(reference).removeEventListener('resize', state.updateBound); 25198 25199 // Remove scroll event listener on scroll parents
vendor: 12,824 bytes, lines 25200-25561
25200 state.scrollParents.forEach(function (target) { 25201 target.removeEventListener('scroll', state.updateBound); 25202 }); 25203 25204 // Reset state 25205 state.updateBound = null; 25206 state.scrollParents = []; 25207 state.scrollElement = null; 25208 state.eventsEnabled = false; 25209 return state; 25210} 25211 25212/** 25213 * It will remove resize/scroll events and won't recalculate popper position 25214 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 25215 * unless you call `update` method manually. 25216 * @method 25217 * @memberof Popper 25218 */ 25219function disableEventListeners() { 25220 if (this.state.eventsEnabled) { 25221 cancelAnimationFrame(this.scheduleUpdate); 25222 this.state = removeEventListeners(this.reference, this.state); 25223 } 25224} 25225 25226/** 25227 * Tells if a given input is a number 25228 * @method 25229 * @memberof Popper.Utils 25230 * @param {*} input to check 25231 * @return {Boolean} 25232 */ 25233function isNumeric(n) { 25234 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 25235} 25236 25237/** 25238 * Set the style to the given popper 25239 * @method 25240 * @memberof Popper.Utils 25241 * @argument {Element} element - Element to apply the style to 25242 * @argument {Object} styles 25243 * Object with a list of properties and values which will be applied to the element 25244 */ 25245function setStyles(element, styles) { 25246 Object.keys(styles).forEach(function (prop) { 25247 var unit = ''; 25248 // add unit if the value is numeric and is one of the following 25249 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 25250 unit = 'px'; 25251 } 25252 element.style[prop] = styles[prop] + unit; 25253 }); 25254} 25255 25256/** 25257 * Set the attributes to the given popper 25258 * @method 25259 * @memberof Popper.Utils 25260 * @argument {Element} element - Element to apply the attributes to 25261 * @argument {Object} styles 25262 * Object with a list of properties and values which will be applied to the element 25263 */ 25264function setAttributes(element, attributes) { 25265 Object.keys(attributes).forEach(function (prop) { 25266 var value = attributes[prop]; 25267 if (value !== false) { 25268 element.setAttribute(prop, attributes[prop]); 25269 } else { 25270 element.removeAttribute(prop); 25271 } 25272 }); 25273} 25274 25275/** 25276 * @function 25277 * @memberof Modifiers 25278 * @argument {Object} data - The data object generated by `update` method 25279 * @argument {Object} data.styles - List of style properties - values to apply to popper element 25280 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 25281 * @argument {Object} options - Modifiers configuration and options 25282 * @returns {Object} The same data object 25283 */ 25284function applyStyle(data) { 25285 // any property present in `data.styles` will be applied to the popper, 25286 // in this way we can make the 3rd party modifiers add custom styles to it 25287 // Be aware, modifiers could override the properties defined in the previous 25288 // lines of this modifier! 25289 setStyles(data.instance.popper, data.styles); 25290 25291 // any property present in `data.attributes` will be applied to the popper, 25292 // they will be set as HTML attributes of the element 25293 setAttributes(data.instance.popper, data.attributes); 25294 25295 // if arrowElement is defined and arrowStyles has some properties 25296 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 25297 setStyles(data.arrowElement, data.arrowStyles); 25298 } 25299 25300 return data; 25301} 25302 25303/** 25304 * Set the x-placement attribute before everything else because it could be used 25305 * to add margins to the popper margins needs to be calculated to get the 25306 * correct popper offsets. 25307 * @method 25308 * @memberof Popper.modifiers 25309 * @param {HTMLElement} reference - The reference element used to position the popper 25310 * @param {HTMLElement} popper - The HTML element used as popper 25311 * @param {Object} options - Popper.js options 25312 */ 25313function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 25314 // compute reference element offsets 25315 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 25316 25317 // compute auto placement, store placement inside the data object, 25318 // modifiers will be able to edit `placement` if needed 25319 // and refer to originalPlacement to know the original value 25320 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 25321 25322 popper.setAttribute('x-placement', placement); 25323 25324 // Apply `position` to popper before anything else because 25325 // without the position applied we can't guarantee correct computations 25326 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 25327 25328 return options; 25329} 25330 25331/** 25332 * @function 25333 * @memberof Popper.Utils 25334 * @argument {Object} data - The data object generated by `update` method 25335 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 25336 * @returns {Object} The popper's position offsets rounded 25337 * 25338 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 25339 * good as it can be within reason. 25340 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 25341 * 25342 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 25343 * as well on High DPI screens). 25344 * 25345 * Firefox prefers no rounding for positioning and does not have blurriness on 25346 * high DPI screens. 25347 * 25348 * Only horizontal placement and left/right values need to be considered. 25349 */ 25350function getRoundedOffsets(data, shouldRound) { 25351 var _data$offsets = data.offsets, 25352 popper = _data$offsets.popper, 25353 reference = _data$offsets.reference; 25354 var round = Math.round, 25355 floor = Math.floor; 25356 25357 var noRound = function noRound(v) { 25358 return v; 25359 }; 25360 25361 var referenceWidth = round(reference.width); 25362 var popperWidth = round(popper.width); 25363 25364 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 25365 var isVariation = data.placement.indexOf('-') !== -1; 25366 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 25367 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 25368 25369 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 25370 var verticalToInteger = !shouldRound ? noRound : round; 25371 25372 return { 25373 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 25374 top: verticalToInteger(popper.top), 25375 bottom: verticalToInteger(popper.bottom), 25376 right: horizontalToInteger(popper.right) 25377 }; 25378} 25379 25380var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 25381 25382/** 25383 * @function 25384 * @memberof Modifiers 25385 * @argument {Object} data - The data object generated by `update` method 25386 * @argument {Object} options - Modifiers configuration and options 25387 * @returns {Object} The data object, properly modified 25388 */ 25389function computeStyle(data, options) { 25390 var x = options.x, 25391 y = options.y; 25392 var popper = data.offsets.popper; 25393 25394 // Remove this legacy support in Popper.js v2 25395 25396 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 25397 return modifier.name === 'applyStyle'; 25398 }).gpuAcceleration; 25399 if (legacyGpuAccelerationOption !== undefined) { 25400 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 25401 } 25402 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 25403 25404 var offsetParent = getOffsetParent(data.instance.popper); 25405 var offsetParentRect = getBoundingClientRect(offsetParent); 25406 25407 // Styles 25408 var styles = { 25409 position: popper.position 25410 }; 25411 25412 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 25413 25414 var sideA = x === 'bottom' ? 'top' : 'bottom'; 25415 var sideB = y === 'right' ? 'left' : 'right'; 25416 25417 // if gpuAcceleration is set to `true` and transform is supported, 25418 // we use `translate3d` to apply the position to the popper we 25419 // automatically use the supported prefixed version if needed 25420 var prefixedProperty = getSupportedPropertyName('transform'); 25421 25422 // now, let's make a step back and look at this code closely (wtf?) 25423 // If the content of the popper grows once it's been positioned, it 25424 // may happen that the popper gets misplaced because of the new content 25425 // overflowing its reference element 25426 // To avoid this problem, we provide two options (x and y), which allow 25427 // the consumer to define the offset origin. 25428 // If we position a popper on top of a reference element, we can set 25429 // `x` to `top` to make the popper grow towards its top instead of 25430 // its bottom. 25431 var left = void 0, 25432 top = void 0; 25433 if (sideA === 'bottom') { 25434 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 25435 // and not the bottom of the html element 25436 if (offsetParent.nodeName === 'HTML') { 25437 top = -offsetParent.clientHeight + offsets.bottom; 25438 } else { 25439 top = -offsetParentRect.height + offsets.bottom; 25440 } 25441 } else { 25442 top = offsets.top; 25443 } 25444 if (sideB === 'right') { 25445 if (offsetParent.nodeName === 'HTML') { 25446 left = -offsetParent.clientWidth + offsets.right; 25447 } else { 25448 left = -offsetParentRect.width + offsets.right; 25449 } 25450 } else { 25451 left = offsets.left; 25452 } 25453 if (gpuAcceleration && prefixedProperty) { 25454 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 25455 styles[sideA] = 0; 25456 styles[sideB] = 0; 25457 styles.willChange = 'transform'; 25458 } else { 25459 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 25460 var invertTop = sideA === 'bottom' ? -1 : 1; 25461 var invertLeft = sideB === 'right' ? -1 : 1; 25462 styles[sideA] = top * invertTop; 25463 styles[sideB] = left * invertLeft; 25464 styles.willChange = sideA + ', ' + sideB; 25465 } 25466 25467 // Attributes 25468 var attributes = { 25469 'x-placement': data.placement 25470 }; 25471 25472 // Update `data` attributes, styles and arrowStyles 25473 data.attributes = _extends({}, attributes, data.attributes); 25474 data.styles = _extends({}, styles, data.styles); 25475 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 25476 25477 return data; 25478} 25479 25480/** 25481 * Helper used to know if the given modifier depends from another one.<br /> 25482 * It checks if the needed modifier is listed and enabled. 25483 * @method 25484 * @memberof Popper.Utils 25485 * @param {Array} modifiers - list of modifiers 25486 * @param {String} requestingName - name of requesting modifier 25487 * @param {String} requestedName - name of requested modifier 25488 * @returns {Boolean} 25489 */ 25490function isModifierRequired(modifiers, requestingName, requestedName) { 25491 var requesting = find(modifiers, function (_ref) { 25492 var name = _ref.name; 25493 return name === requestingName; 25494 }); 25495 25496 var isRequired = !!requesting && modifiers.some(function (modifier) { 25497 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 25498 }); 25499 25500 if (!isRequired) { 25501 var _requesting = '`' + requestingName + '`'; 25502 var requested = '`' + requestedName + '`'; 25503 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 25504 } 25505 return isRequired; 25506} 25507 25508/** 25509 * @function 25510 * @memberof Modifiers 25511 * @argument {Object} data - The data object generated by update method 25512 * @argument {Object} options - Modifiers configuration and options 25513 * @returns {Object} The data object, properly modified 25514 */ 25515function arrow(data, options) { 25516 var _data$offsets$arrow; 25517 25518 // arrow depends on keepTogether in order to work 25519 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 25520 return data; 25521 } 25522 25523 var arrowElement = options.element; 25524 25525 // if arrowElement is a string, suppose it's a CSS selector 25526 if (typeof arrowElement === 'string') { 25527 arrowElement = data.instance.popper.querySelector(arrowElement); 25528 25529 // if arrowElement is not found, don't run the modifier 25530 if (!arrowElement) { 25531 return data; 25532 } 25533 } else { 25534 // if the arrowElement isn't a query selector we must check that the 25535 // provided DOM node is child of its popper node 25536 if (!data.instance.popper.contains(arrowElement)) { 25537 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 25538 return data; 25539 } 25540 } 25541 25542 var placement = data.placement.split('-')[0]; 25543 var _data$offsets = data.offsets, 25544 popper = _data$offsets.popper, 25545 reference = _data$offsets.reference; 25546 25547 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 25548 25549 var len = isVertical ? 'height' : 'width'; 25550 var sideCapitalized = isVertical ? 'Top' : 'Left'; 25551 var side = sideCapitalized.toLowerCase(); 25552 var altSide = isVertical ? 'left' : 'top'; 25553 var opSide = isVertical ? 'bottom' : 'right'; 25554 var arrowElementSize = getOuterSizes(arrowElement)[len]; 25555 25556 // 25557 // extends keepTogether behavior making sure the popper and its 25558 // reference have enough pixels in conjunction 25559 // 25560 25561 // top/left side
vendor: 5,392 bytes, lines 25562-25717
25562 if (reference[opSide] - arrowElementSize < popper[side]) { 25563 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 25564 } 25565 // bottom/right side 25566 if (reference[side] + arrowElementSize > popper[opSide]) { 25567 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 25568 } 25569 data.offsets.popper = getClientRect(data.offsets.popper); 25570 25571 // compute center of the popper 25572 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 25573 25574 // Compute the sideValue using the updated popper offsets 25575 // take popper margin in account because we don't have this info available 25576 var css = getStyleComputedProperty(data.instance.popper); 25577 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 25578 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 25579 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 25580 25581 // prevent arrowElement from being placed not contiguously to its popper 25582 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 25583 25584 data.arrowElement = arrowElement; 25585 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 25586 25587 return data; 25588} 25589 25590/** 25591 * Get the opposite placement variation of the given one 25592 * @method 25593 * @memberof Popper.Utils 25594 * @argument {String} placement variation 25595 * @returns {String} flipped placement variation 25596 */ 25597function getOppositeVariation(variation) { 25598 if (variation === 'end') { 25599 return 'start'; 25600 } else if (variation === 'start') { 25601 return 'end'; 25602 } 25603 return variation; 25604} 25605 25606/** 25607 * List of accepted placements to use as values of the `placement` option.<br /> 25608 * Valid placements are: 25609 * - `auto` 25610 * - `top` 25611 * - `right` 25612 * - `bottom` 25613 * - `left` 25614 * 25615 * Each placement can have a variation from this list: 25616 * - `-start` 25617 * - `-end` 25618 * 25619 * Variations are interpreted easily if you think of them as the left to right 25620 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 25621 * is right.<br /> 25622 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 25623 * 25624 * Some valid examples are: 25625 * - `top-end` (on top of reference, right aligned) 25626 * - `right-start` (on right of reference, top aligned) 25627 * - `bottom` (on bottom, centered) 25628 * - `auto-end` (on the side with more space available, alignment depends by placement) 25629 * 25630 * @static 25631 * @type {Array} 25632 * @enum {String} 25633 * @readonly 25634 * @method placements 25635 * @memberof Popper 25636 */ 25637var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 25638 25639// Get rid of `auto` `auto-start` and `auto-end` 25640var validPlacements = placements.slice(3); 25641 25642/** 25643 * Given an initial placement, returns all the subsequent placements 25644 * clockwise (or counter-clockwise). 25645 * 25646 * @method 25647 * @memberof Popper.Utils 25648 * @argument {String} placement - A valid placement (it accepts variations) 25649 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 25650 * @returns {Array} placements including their variations 25651 */ 25652function clockwise(placement) { 25653 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 25654 25655 var index = validPlacements.indexOf(placement); 25656 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 25657 return counter ? arr.reverse() : arr; 25658} 25659 25660var BEHAVIORS = { 25661 FLIP: 'flip', 25662 CLOCKWISE: 'clockwise', 25663 COUNTERCLOCKWISE: 'counterclockwise' 25664}; 25665 25666/** 25667 * @function 25668 * @memberof Modifiers 25669 * @argument {Object} data - The data object generated by update method 25670 * @argument {Object} options - Modifiers configuration and options 25671 * @returns {Object} The data object, properly modified 25672 */ 25673function flip(data, options) { 25674 // if `inner` modifier is enabled, we can't use the `flip` modifier 25675 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 25676 return data; 25677 } 25678 25679 if (data.flipped && data.placement === data.originalPlacement) { 25680 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 25681 return data; 25682 } 25683 25684 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 25685 25686 var placement = data.placement.split('-')[0]; 25687 var placementOpposite = getOppositePlacement(placement); 25688 var variation = data.placement.split('-')[1] || ''; 25689 25690 var flipOrder = []; 25691 25692 switch (options.behavior) { 25693 case BEHAVIORS.FLIP: 25694 flipOrder = [placement, placementOpposite]; 25695 break; 25696 case BEHAVIORS.CLOCKWISE: 25697 flipOrder = clockwise(placement); 25698 break; 25699 case BEHAVIORS.COUNTERCLOCKWISE: 25700 flipOrder = clockwise(placement, true); 25701 break; 25702 default: 25703 flipOrder = options.behavior; 25704 } 25705 25706 flipOrder.forEach(function (step, index) { 25707 if (placement !== step || flipOrder.length === index + 1) { 25708 return data; 25709 } 25710 25711 placement = data.placement.split('-')[0]; 25712 placementOpposite = getOppositePlacement(placement); 25713 25714 var popperOffsets = data.offsets.popper; 25715 var refOffsets = data.offsets.reference; 25716 25717 // using floor because the reference offsets may contain decimals we are not going to consider here
vendor: 36,189 bytes, lines 25718-26729
25718 var floor = Math.floor; 25719 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 25720 25721 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 25722 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 25723 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 25724 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 25725 25726 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 25727 25728 // flip the variation if required 25729 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 25730 25731 // flips variation if reference element overflows boundaries 25732 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 25733 25734 // flips variation if popper content overflows boundaries 25735 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 25736 25737 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 25738 25739 if (overlapsRef || overflowsBoundaries || flippedVariation) { 25740 // this boolean to detect any flip loop 25741 data.flipped = true; 25742 25743 if (overlapsRef || overflowsBoundaries) { 25744 placement = flipOrder[index + 1]; 25745 } 25746 25747 if (flippedVariation) { 25748 variation = getOppositeVariation(variation); 25749 } 25750 25751 data.placement = placement + (variation ? '-' + variation : ''); 25752 25753 // this object contains `position`, we want to preserve it along with 25754 // any additional property we may add in the future 25755 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 25756 25757 data = runModifiers(data.instance.modifiers, data, 'flip'); 25758 } 25759 }); 25760 return data; 25761} 25762 25763/** 25764 * @function 25765 * @memberof Modifiers 25766 * @argument {Object} data - The data object generated by update method 25767 * @argument {Object} options - Modifiers configuration and options 25768 * @returns {Object} The data object, properly modified 25769 */ 25770function keepTogether(data) { 25771 var _data$offsets = data.offsets, 25772 popper = _data$offsets.popper, 25773 reference = _data$offsets.reference; 25774 25775 var placement = data.placement.split('-')[0]; 25776 var floor = Math.floor; 25777 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 25778 var side = isVertical ? 'right' : 'bottom'; 25779 var opSide = isVertical ? 'left' : 'top'; 25780 var measurement = isVertical ? 'width' : 'height'; 25781 25782 if (popper[side] < floor(reference[opSide])) { 25783 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 25784 } 25785 if (popper[opSide] > floor(reference[side])) { 25786 data.offsets.popper[opSide] = floor(reference[side]); 25787 } 25788 25789 return data; 25790} 25791 25792/** 25793 * Converts a string containing value + unit into a px value number 25794 * @function 25795 * @memberof {modifiers~offset} 25796 * @private 25797 * @argument {String} str - Value + unit string 25798 * @argument {String} measurement - `height` or `width` 25799 * @argument {Object} popperOffsets 25800 * @argument {Object} referenceOffsets 25801 * @returns {Number|String} 25802 * Value in pixels, or original string if no values were extracted 25803 */ 25804function toValue(str, measurement, popperOffsets, referenceOffsets) { 25805 // separate value from unit 25806 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 25807 var value = +split[1]; 25808 var unit = split[2]; 25809 25810 // If it's not a number it's an operator, I guess 25811 if (!value) { 25812 return str; 25813 } 25814 25815 if (unit.indexOf('%') === 0) { 25816 var element = void 0; 25817 switch (unit) { 25818 case '%p': 25819 element = popperOffsets; 25820 break; 25821 case '%': 25822 case '%r': 25823 default: 25824 element = referenceOffsets; 25825 } 25826 25827 var rect = getClientRect(element); 25828 return rect[measurement] / 100 * value; 25829 } else if (unit === 'vh' || unit === 'vw') { 25830 // if is a vh or vw, we calculate the size based on the viewport 25831 var size = void 0; 25832 if (unit === 'vh') { 25833 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 25834 } else { 25835 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 25836 } 25837 return size / 100 * value; 25838 } else { 25839 // if is an explicit pixel unit, we get rid of the unit and keep the value 25840 // if is an implicit unit, it's px, and we return just the value 25841 return value; 25842 } 25843} 25844 25845/** 25846 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 25847 * @function 25848 * @memberof {modifiers~offset} 25849 * @private 25850 * @argument {String} offset 25851 * @argument {Object} popperOffsets 25852 * @argument {Object} referenceOffsets 25853 * @argument {String} basePlacement 25854 * @returns {Array} a two cells array with x and y offsets in numbers 25855 */ 25856function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 25857 var offsets = [0, 0]; 25858 25859 // Use height if placement is left or right and index is 0 otherwise use width 25860 // in this way the first offset will use an axis and the second one 25861 // will use the other one 25862 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 25863 25864 // Split the offset string to obtain a list of values and operands 25865 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 25866 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 25867 return frag.trim(); 25868 }); 25869 25870 // Detect if the offset string contains a pair of values or a single one 25871 // they could be separated by comma or space 25872 var divider = fragments.indexOf(find(fragments, function (frag) { 25873 return frag.search(/,|\s/) !== -1; 25874 })); 25875 25876 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 25877 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 25878 } 25879 25880 // If divider is found, we divide the list of values and operands to divide 25881 // them by ofset X and Y. 25882 var splitRegex = /\s*,\s*|\s+/; 25883 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 25884 25885 // Convert the values with units to absolute pixels to allow our computations 25886 ops = ops.map(function (op, index) { 25887 // Most of the units rely on the orientation of the popper 25888 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 25889 var mergeWithPrevious = false; 25890 return op 25891 // This aggregates any `+` or `-` sign that aren't considered operators 25892 // e.g.: 10 + +5 => [10, +, +5] 25893 .reduce(function (a, b) { 25894 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 25895 a[a.length - 1] = b; 25896 mergeWithPrevious = true; 25897 return a; 25898 } else if (mergeWithPrevious) { 25899 a[a.length - 1] += b; 25900 mergeWithPrevious = false; 25901 return a; 25902 } else { 25903 return a.concat(b); 25904 } 25905 }, []) 25906 // Here we convert the string values into number values (in px) 25907 .map(function (str) { 25908 return toValue(str, measurement, popperOffsets, referenceOffsets); 25909 }); 25910 }); 25911 25912 // Loop trough the offsets arrays and execute the operations 25913 ops.forEach(function (op, index) { 25914 op.forEach(function (frag, index2) { 25915 if (isNumeric(frag)) { 25916 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 25917 } 25918 }); 25919 }); 25920 return offsets; 25921} 25922 25923/** 25924 * @function 25925 * @memberof Modifiers 25926 * @argument {Object} data - The data object generated by update method 25927 * @argument {Object} options - Modifiers configuration and options 25928 * @argument {Number|String} options.offset=0 25929 * The offset value as described in the modifier description 25930 * @returns {Object} The data object, properly modified 25931 */ 25932function offset(data, _ref) { 25933 var offset = _ref.offset; 25934 var placement = data.placement, 25935 _data$offsets = data.offsets, 25936 popper = _data$offsets.popper, 25937 reference = _data$offsets.reference; 25938 25939 var basePlacement = placement.split('-')[0]; 25940 25941 var offsets = void 0; 25942 if (isNumeric(+offset)) { 25943 offsets = [+offset, 0]; 25944 } else { 25945 offsets = parseOffset(offset, popper, reference, basePlacement); 25946 } 25947 25948 if (basePlacement === 'left') { 25949 popper.top += offsets[0]; 25950 popper.left -= offsets[1]; 25951 } else if (basePlacement === 'right') { 25952 popper.top += offsets[0]; 25953 popper.left += offsets[1]; 25954 } else if (basePlacement === 'top') { 25955 popper.left += offsets[0]; 25956 popper.top -= offsets[1]; 25957 } else if (basePlacement === 'bottom') { 25958 popper.left += offsets[0]; 25959 popper.top += offsets[1]; 25960 } 25961 25962 data.popper = popper; 25963 return data; 25964} 25965 25966/** 25967 * @function 25968 * @memberof Modifiers 25969 * @argument {Object} data - The data object generated by `update` method 25970 * @argument {Object} options - Modifiers configuration and options 25971 * @returns {Object} The data object, properly modified 25972 */ 25973function preventOverflow(data, options) { 25974 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 25975 25976 // If offsetParent is the reference element, we really want to 25977 // go one step up and use the next offsetParent as reference to 25978 // avoid to make this modifier completely useless and look like broken 25979 if (data.instance.reference === boundariesElement) { 25980 boundariesElement = getOffsetParent(boundariesElement); 25981 } 25982 25983 // NOTE: DOM access here 25984 // resets the popper's position so that the document size can be calculated excluding 25985 // the size of the popper element itself 25986 var transformProp = getSupportedPropertyName('transform'); 25987 var popperStyles = data.instance.popper.style; // assignment to help minification 25988 var top = popperStyles.top, 25989 left = popperStyles.left, 25990 transform = popperStyles[transformProp]; 25991 25992 popperStyles.top = ''; 25993 popperStyles.left = ''; 25994 popperStyles[transformProp] = ''; 25995 25996 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 25997 25998 // NOTE: DOM access here 25999 // restores the original style properties after the offsets have been computed 26000 popperStyles.top = top; 26001 popperStyles.left = left; 26002 popperStyles[transformProp] = transform; 26003 26004 options.boundaries = boundaries; 26005 26006 var order = options.priority; 26007 var popper = data.offsets.popper; 26008 26009 var check = { 26010 primary: function primary(placement) { 26011 var value = popper[placement]; 26012 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 26013 value = Math.max(popper[placement], boundaries[placement]); 26014 } 26015 return defineProperty({}, placement, value); 26016 }, 26017 secondary: function secondary(placement) { 26018 var mainSide = placement === 'right' ? 'left' : 'top'; 26019 var value = popper[mainSide]; 26020 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 26021 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 26022 } 26023 return defineProperty({}, mainSide, value); 26024 } 26025 }; 26026 26027 order.forEach(function (placement) { 26028 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 26029 popper = _extends({}, popper, check[side](placement)); 26030 }); 26031 26032 data.offsets.popper = popper; 26033 26034 return data; 26035} 26036 26037/** 26038 * @function 26039 * @memberof Modifiers 26040 * @argument {Object} data - The data object generated by `update` method 26041 * @argument {Object} options - Modifiers configuration and options 26042 * @returns {Object} The data object, properly modified 26043 */ 26044function shift(data) { 26045 var placement = data.placement; 26046 var basePlacement = placement.split('-')[0]; 26047 var shiftvariation = placement.split('-')[1]; 26048 26049 // if shift shiftvariation is specified, run the modifier 26050 if (shiftvariation) { 26051 var _data$offsets = data.offsets, 26052 reference = _data$offsets.reference, 26053 popper = _data$offsets.popper; 26054 26055 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 26056 var side = isVertical ? 'left' : 'top'; 26057 var measurement = isVertical ? 'width' : 'height'; 26058 26059 var shiftOffsets = { 26060 start: defineProperty({}, side, reference[side]), 26061 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 26062 }; 26063 26064 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 26065 } 26066 26067 return data; 26068} 26069 26070/** 26071 * @function 26072 * @memberof Modifiers 26073 * @argument {Object} data - The data object generated by update method 26074 * @argument {Object} options - Modifiers configuration and options 26075 * @returns {Object} The data object, properly modified 26076 */ 26077function hide(data) { 26078 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 26079 return data; 26080 } 26081 26082 var refRect = data.offsets.reference; 26083 var bound = find(data.instance.modifiers, function (modifier) { 26084 return modifier.name === 'preventOverflow'; 26085 }).boundaries; 26086 26087 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 26088 // Avoid unnecessary DOM access if visibility hasn't changed 26089 if (data.hide === true) { 26090 return data; 26091 } 26092 26093 data.hide = true; 26094 data.attributes['x-out-of-boundaries'] = ''; 26095 } else { 26096 // Avoid unnecessary DOM access if visibility hasn't changed 26097 if (data.hide === false) { 26098 return data; 26099 } 26100 26101 data.hide = false; 26102 data.attributes['x-out-of-boundaries'] = false; 26103 } 26104 26105 return data; 26106} 26107 26108/** 26109 * @function 26110 * @memberof Modifiers 26111 * @argument {Object} data - The data object generated by `update` method 26112 * @argument {Object} options - Modifiers configuration and options 26113 * @returns {Object} The data object, properly modified 26114 */ 26115function inner(data) { 26116 var placement = data.placement; 26117 var basePlacement = placement.split('-')[0]; 26118 var _data$offsets = data.offsets, 26119 popper = _data$offsets.popper, 26120 reference = _data$offsets.reference; 26121 26122 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 26123 26124 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 26125 26126 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 26127 26128 data.placement = getOppositePlacement(placement); 26129 data.offsets.popper = getClientRect(popper); 26130 26131 return data; 26132} 26133 26134/** 26135 * Modifier function, each modifier can have a function of this type assigned 26136 * to its `fn` property.<br /> 26137 * These functions will be called on each update, this means that you must 26138 * make sure they are performant enough to avoid performance bottlenecks. 26139 * 26140 * @function ModifierFn 26141 * @argument {dataObject} data - The data object generated by `update` method 26142 * @argument {Object} options - Modifiers configuration and options 26143 * @returns {dataObject} The data object, properly modified 26144 */ 26145 26146/** 26147 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 26148 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 26149 * needed by the library. 26150 * 26151 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 26152 * All the other properties are configurations that could be tweaked. 26153 * @namespace modifiers 26154 */ 26155var modifiers = { 26156 /** 26157 * Modifier used to shift the popper on the start or end of its reference 26158 * element.<br /> 26159 * It will read the variation of the `placement` property.<br /> 26160 * It can be one either `-end` or `-start`. 26161 * @memberof modifiers 26162 * @inner 26163 */ 26164 shift: { 26165 /** @prop {number} order=100 - Index used to define the order of execution */ 26166 order: 100, 26167 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 26168 enabled: true, 26169 /** @prop {ModifierFn} */ 26170 fn: shift 26171 }, 26172 26173 /** 26174 * The `offset` modifier can shift your popper on both its axis. 26175 * 26176 * It accepts the following units: 26177 * - `px` or unit-less, interpreted as pixels 26178 * - `%` or `%r`, percentage relative to the length of the reference element 26179 * - `%p`, percentage relative to the length of the popper element 26180 * - `vw`, CSS viewport width unit 26181 * - `vh`, CSS viewport height unit 26182 * 26183 * For length is intended the main axis relative to the placement of the popper.<br /> 26184 * This means that if the placement is `top` or `bottom`, the length will be the 26185 * `width`. In case of `left` or `right`, it will be the `height`. 26186 * 26187 * You can provide a single value (as `Number` or `String`), or a pair of values 26188 * as `String` divided by a comma or one (or more) white spaces.<br /> 26189 * The latter is a deprecated method because it leads to confusion and will be 26190 * removed in v2.<br /> 26191 * Additionally, it accepts additions and subtractions between different units. 26192 * Note that multiplications and divisions aren't supported. 26193 * 26194 * Valid examples are: 26195 * ``` 26196 * 10 26197 * '10%' 26198 * '10, 10' 26199 * '10%, 10' 26200 * '10 + 10%' 26201 * '10 - 5vh + 3%' 26202 * '-10px + 5vh, 5px - 6%' 26203 * ``` 26204 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 26205 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 26206 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 26207 * 26208 * @memberof modifiers 26209 * @inner 26210 */ 26211 offset: { 26212 /** @prop {number} order=200 - Index used to define the order of execution */ 26213 order: 200, 26214 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 26215 enabled: true, 26216 /** @prop {ModifierFn} */ 26217 fn: offset, 26218 /** @prop {Number|String} offset=0 26219 * The offset value as described in the modifier description 26220 */ 26221 offset: 0 26222 }, 26223 26224 /** 26225 * Modifier used to prevent the popper from being positioned outside the boundary. 26226 * 26227 * A scenario exists where the reference itself is not within the boundaries.<br /> 26228 * We can say it has "escaped the boundaries" â or just "escaped".<br /> 26229 * In this case we need to decide whether the popper should either: 26230 * 26231 * - detach from the reference and remain "trapped" in the boundaries, or 26232 * - if it should ignore the boundary and "escape with its reference" 26233 * 26234 * When `escapeWithReference` is set to`true` and reference is completely 26235 * outside its boundaries, the popper will overflow (or completely leave) 26236 * the boundaries in order to remain attached to the edge of the reference. 26237 * 26238 * @memberof modifiers 26239 * @inner 26240 */ 26241 preventOverflow: { 26242 /** @prop {number} order=300 - Index used to define the order of execution */ 26243 order: 300, 26244 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 26245 enabled: true, 26246 /** @prop {ModifierFn} */ 26247 fn: preventOverflow, 26248 /** 26249 * @prop {Array} [priority=['left','right','top','bottom']] 26250 * Popper will try to prevent overflow following these priorities by default, 26251 * then, it could overflow on the left and on top of the `boundariesElement` 26252 */ 26253 priority: ['left', 'right', 'top', 'bottom'], 26254 /** 26255 * @prop {number} padding=5 26256 * Amount of pixel used to define a minimum distance between the boundaries 26257 * and the popper. This makes sure the popper always has a little padding 26258 * between the edges of its container 26259 */ 26260 padding: 5, 26261 /** 26262 * @prop {String|HTMLElement} boundariesElement='scrollParent' 26263 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 26264 * `viewport` or any DOM element. 26265 */ 26266 boundariesElement: 'scrollParent' 26267 }, 26268 26269 /** 26270 * Modifier used to make sure the reference and its popper stay near each other 26271 * without leaving any gap between the two. Especially useful when the arrow is 26272 * enabled and you want to ensure that it points to its reference element. 26273 * It cares only about the first axis. You can still have poppers with margin 26274 * between the popper and its reference element. 26275 * @memberof modifiers 26276 * @inner 26277 */ 26278 keepTogether: { 26279 /** @prop {number} order=400 - Index used to define the order of execution */ 26280 order: 400, 26281 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 26282 enabled: true, 26283 /** @prop {ModifierFn} */ 26284 fn: keepTogether 26285 }, 26286 26287 /** 26288 * This modifier is used to move the `arrowElement` of the popper to make 26289 * sure it is positioned between the reference element and its popper element. 26290 * It will read the outer size of the `arrowElement` node to detect how many 26291 * pixels of conjunction are needed. 26292 * 26293 * It has no effect if no `arrowElement` is provided. 26294 * @memberof modifiers 26295 * @inner 26296 */ 26297 arrow: { 26298 /** @prop {number} order=500 - Index used to define the order of execution */ 26299 order: 500, 26300 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 26301 enabled: true, 26302 /** @prop {ModifierFn} */ 26303 fn: arrow, 26304 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 26305 element: '[x-arrow]' 26306 }, 26307 26308 /** 26309 * Modifier used to flip the popper's placement when it starts to overlap its 26310 * reference element. 26311 * 26312 * Requires the `preventOverflow` modifier before it in order to work. 26313 * 26314 * **NOTE:** this modifier will interrupt the current update cycle and will 26315 * restart it if it detects the need to flip the placement. 26316 * @memberof modifiers 26317 * @inner 26318 */ 26319 flip: { 26320 /** @prop {number} order=600 - Index used to define the order of execution */ 26321 order: 600, 26322 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 26323 enabled: true, 26324 /** @prop {ModifierFn} */ 26325 fn: flip, 26326 /** 26327 * @prop {String|Array} behavior='flip' 26328 * The behavior used to change the popper's placement. It can be one of 26329 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 26330 * placements (with optional variations) 26331 */ 26332 behavior: 'flip', 26333 /** 26334 * @prop {number} padding=5 26335 * The popper will flip if it hits the edges of the `boundariesElement` 26336 */ 26337 padding: 5, 26338 /** 26339 * @prop {String|HTMLElement} boundariesElement='viewport' 26340 * The element which will define the boundaries of the popper position. 26341 * The popper will never be placed outside of the defined boundaries 26342 * (except if `keepTogether` is enabled) 26343 */ 26344 boundariesElement: 'viewport', 26345 /** 26346 * @prop {Boolean} flipVariations=false 26347 * The popper will switch placement variation between `-start` and `-end` when 26348 * the reference element overlaps its boundaries. 26349 * 26350 * The original placement should have a set variation. 26351 */ 26352 flipVariations: false, 26353 /** 26354 * @prop {Boolean} flipVariationsByContent=false 26355 * The popper will switch placement variation between `-start` and `-end` when 26356 * the popper element overlaps its reference boundaries. 26357 * 26358 * The original placement should have a set variation. 26359 */ 26360 flipVariationsByContent: false 26361 }, 26362 26363 /** 26364 * Modifier used to make the popper flow toward the inner of the reference element. 26365 * By default, when this modifier is disabled, the popper will be placed outside 26366 * the reference element. 26367 * @memberof modifiers 26368 * @inner 26369 */ 26370 inner: { 26371 /** @prop {number} order=700 - Index used to define the order of execution */ 26372 order: 700, 26373 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 26374 enabled: false, 26375 /** @prop {ModifierFn} */ 26376 fn: inner 26377 }, 26378 26379 /** 26380 * Modifier used to hide the popper when its reference element is outside of the 26381 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 26382 * be used to hide with a CSS selector the popper when its reference is 26383 * out of boundaries. 26384 * 26385 * Requires the `preventOverflow` modifier before it in order to work. 26386 * @memberof modifiers 26387 * @inner 26388 */ 26389 hide: { 26390 /** @prop {number} order=800 - Index used to define the order of execution */ 26391 order: 800, 26392 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 26393 enabled: true, 26394 /** @prop {ModifierFn} */ 26395 fn: hide 26396 }, 26397 26398 /** 26399 * Computes the style that will be applied to the popper element to gets 26400 * properly positioned. 26401 * 26402 * Note that this modifier will not touch the DOM, it just prepares the styles 26403 * so that `applyStyle` modifier can apply it. This separation is useful 26404 * in case you need to replace `applyStyle` with a custom implementation. 26405 * 26406 * This modifier has `850` as `order` value to maintain backward compatibility 26407 * with previous versions of Popper.js. Expect the modifiers ordering method 26408 * to change in future major versions of the library. 26409 * 26410 * @memberof modifiers 26411 * @inner 26412 */ 26413 computeStyle: { 26414 /** @prop {number} order=850 - Index used to define the order of execution */ 26415 order: 850, 26416 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 26417 enabled: true, 26418 /** @prop {ModifierFn} */ 26419 fn: computeStyle, 26420 /** 26421 * @prop {Boolean} gpuAcceleration=true 26422 * If true, it uses the CSS 3D transformation to position the popper. 26423 * Otherwise, it will use the `top` and `left` properties 26424 */ 26425 gpuAcceleration: true, 26426 /** 26427 * @prop {string} [x='bottom'] 26428 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 26429 * Change this if your popper should grow in a direction different from `bottom` 26430 */ 26431 x: 'bottom', 26432 /** 26433 * @prop {string} [x='left'] 26434 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 26435 * Change this if your popper should grow in a direction different from `right` 26436 */ 26437 y: 'right' 26438 }, 26439 26440 /** 26441 * Applies the computed styles to the popper element. 26442 * 26443 * All the DOM manipulations are limited to this modifier. This is useful in case 26444 * you want to integrate Popper.js inside a framework or view library and you 26445 * want to delegate all the DOM manipulations to it. 26446 * 26447 * Note that if you disable this modifier, you must make sure the popper element 26448 * has its position set to `absolute` before Popper.js can do its work! 26449 * 26450 * Just disable this modifier and define your own to achieve the desired effect. 26451 * 26452 * @memberof modifiers 26453 * @inner 26454 */ 26455 applyStyle: { 26456 /** @prop {number} order=900 - Index used to define the order of execution */ 26457 order: 900, 26458 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 26459 enabled: true, 26460 /** @prop {ModifierFn} */ 26461 fn: applyStyle, 26462 /** @prop {Function} */ 26463 onLoad: applyStyleOnLoad, 26464 /** 26465 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 26466 * @prop {Boolean} gpuAcceleration=true 26467 * If true, it uses the CSS 3D transformation to position the popper. 26468 * Otherwise, it will use the `top` and `left` properties 26469 */ 26470 gpuAcceleration: undefined 26471 } 26472}; 26473 26474/** 26475 * The `dataObject` is an object containing all the information used by Popper.js. 26476 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 26477 * @name dataObject 26478 * @property {Object} data.instance The Popper.js instance 26479 * @property {String} data.placement Placement applied to popper 26480 * @property {String} data.originalPlacement Placement originally defined on init 26481 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 26482 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 26483 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 26484 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 26485 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 26486 * @property {Object} data.boundaries Offsets of the popper boundaries 26487 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 26488 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 26489 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 26490 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 26491 */ 26492 26493/** 26494 * Default options provided to Popper.js constructor.<br /> 26495 * These can be overridden using the `options` argument of Popper.js.<br /> 26496 * To override an option, simply pass an object with the same 26497 * structure of the `options` object, as the 3rd argument. For example: 26498 * ``` 26499 * new Popper(ref, pop, { 26500 * modifiers: { 26501 * preventOverflow: { enabled: false } 26502 * } 26503 * }) 26504 * ``` 26505 * @type {Object} 26506 * @static 26507 * @memberof Popper 26508 */ 26509var Defaults = { 26510 /** 26511 * Popper's placement. 26512 * @prop {Popper.placements} placement='bottom' 26513 */ 26514 placement: 'bottom', 26515 26516 /** 26517 * Set this to true if you want popper to position it self in 'fixed' mode 26518 * @prop {Boolean} positionFixed=false 26519 */ 26520 positionFixed: false, 26521 26522 /** 26523 * Whether events (resize, scroll) are initially enabled. 26524 * @prop {Boolean} eventsEnabled=true 26525 */ 26526 eventsEnabled: true, 26527 26528 /** 26529 * Set to true if you want to automatically remove the popper when 26530 * you call the `destroy` method. 26531 * @prop {Boolean} removeOnDestroy=false 26532 */ 26533 removeOnDestroy: false, 26534 26535 /** 26536 * Callback called when the popper is created.<br /> 26537 * By default, it is set to no-op.<br /> 26538 * Access Popper.js instance with `data.instance`. 26539 * @prop {onCreate} 26540 */ 26541 onCreate: function onCreate() {}, 26542 26543 /** 26544 * Callback called when the popper is updated. This callback is not called 26545 * on the initialization/creation of the popper, but only on subsequent 26546 * updates.<br /> 26547 * By default, it is set to no-op.<br /> 26548 * Access Popper.js instance with `data.instance`. 26549 * @prop {onUpdate} 26550 */ 26551 onUpdate: function onUpdate() {}, 26552 26553 /** 26554 * List of modifiers used to modify the offsets before they are applied to the popper. 26555 * They provide most of the functionalities of Popper.js. 26556 * @prop {modifiers} 26557 */ 26558 modifiers: modifiers 26559}; 26560 26561/** 26562 * @callback onCreate 26563 * @param {dataObject} data 26564 */ 26565 26566/** 26567 * @callback onUpdate 26568 * @param {dataObject} data 26569 */ 26570 26571// Utils 26572// Methods 26573var Popper = function () { 26574 /** 26575 * Creates a new Popper.js instance. 26576 * @class Popper 26577 * @param {Element|referenceObject} reference - The reference element used to position the popper 26578 * @param {Element} popper - The HTML / XML element used as the popper 26579 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 26580 * @return {Object} instance - The generated Popper.js instance 26581 */ 26582 function Popper(reference, popper) { 26583 var _this = this; 26584 26585 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 26586 classCallCheck(this, Popper); 26587 26588 this.scheduleUpdate = function () { 26589 return requestAnimationFrame(_this.update); 26590 }; 26591 26592 // make update() debounced, so that it only runs at most once-per-tick 26593 this.update = debounce(this.update.bind(this)); 26594 26595 // with {} we create a new object with the options inside it 26596 this.options = _extends({}, Popper.Defaults, options); 26597 26598 // init state 26599 this.state = { 26600 isDestroyed: false, 26601 isCreated: false, 26602 scrollParents: [] 26603 }; 26604 26605 // get reference and popper elements (allow jQuery wrappers) 26606 this.reference = reference && reference.jquery ? reference[0] : reference; 26607 this.popper = popper && popper.jquery ? popper[0] : popper; 26608 26609 // Deep merge modifiers options 26610 this.options.modifiers = {}; 26611 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 26612 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 26613 }); 26614 26615 // Refactoring modifiers' list (Object => Array) 26616 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 26617 return _extends({ 26618 name: name 26619 }, _this.options.modifiers[name]); 26620 }) 26621 // sort the modifiers by order 26622 .sort(function (a, b) { 26623 return a.order - b.order; 26624 }); 26625 26626 // modifiers have the ability to execute arbitrary code when Popper.js get inited 26627 // such code is executed in the same order of its modifier 26628 // they could add new properties to their options configuration 26629 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 26630 this.modifiers.forEach(function (modifierOptions) { 26631 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 26632 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 26633 } 26634 }); 26635 26636 // fire the first update to position the popper in the right place 26637 this.update(); 26638 26639 var eventsEnabled = this.options.eventsEnabled; 26640 if (eventsEnabled) { 26641 // setup event listeners, they will take care of update the position in specific situations 26642 this.enableEventListeners(); 26643 } 26644 26645 this.state.eventsEnabled = eventsEnabled; 26646 } 26647 26648 // We can't use class properties because they don't get listed in the 26649 // class prototype and break stuff like Sinon stubs 26650 26651 26652 createClass(Popper, [{ 26653 key: 'update', 26654 value: function update$$1() { 26655 return update.call(this); 26656 } 26657 }, { 26658 key: 'destroy', 26659 value: function destroy$$1() { 26660 return destroy.call(this); 26661 } 26662 }, { 26663 key: 'enableEventListeners', 26664 value: function enableEventListeners$$1() { 26665 return enableEventListeners.call(this); 26666 } 26667 }, { 26668 key: 'disableEventListeners', 26669 value: function disableEventListeners$$1() { 26670 return disableEventListeners.call(this); 26671 } 26672 26673 /** 26674 * Schedules an update. It will run on the next UI update available. 26675 * @method scheduleUpdate 26676 * @memberof Popper 26677 */ 26678 26679 26680 /** 26681 * Collection of utilities useful when writing custom modifiers. 26682 * Starting from version 1.7, this method is available only if you 26683 * include `popper-utils.js` before `popper.js`. 26684 * 26685 * **DEPRECATION**: This way to access PopperUtils is deprecated 26686 * and will be removed in v2! Use the PopperUtils module directly instead. 26687 * Due to the high instability of the methods contained in Utils, we can't 26688 * guarantee them to follow semver. Use them at your own risk! 26689 * @static 26690 * @private 26691 * @type {Object} 26692 * @deprecated since version 1.8 26693 * @member Utils 26694 * @memberof Popper 26695 */ 26696 26697 }]); 26698 return Popper; 26699}(); 26700 26701/** 26702 * The `referenceObject` is an object that provides an interface compatible with Popper.js 26703 * and lets you use it as replacement of a real DOM node.<br /> 26704 * You can use this method to position a popper relatively to a set of coordinates 26705 * in case you don't have a DOM node to use as reference. 26706 * 26707 * ``` 26708 * new Popper(referenceObject, popperNode); 26709 * ``` 26710 * 26711 * NB: This feature isn't supported in Internet Explorer 10. 26712 * @name referenceObject 26713 * @property {Function} data.getBoundingClientRect 26714 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 26715 * @property {number} data.clientWidth 26716 * An ES6 getter that will return the width of the virtual reference element. 26717 * @property {number} data.clientHeight 26718 * An ES6 getter that will return the height of the virtual reference element. 26719 */ 26720 26721 26722Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 26723Popper.placements = placements; 26724Popper.Defaults = Defaults; 26725 26726return Popper; 26727 26728}))); 26729//# sourceMappingURL=popper.js.map
26730/*! 26731 * Bootstrap v4.3.1 (https://getbootstrap.com/) 26732 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 26733 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 26734 */ 26735!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(t){var e,n,i;e=o,i=r[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return o}g=g&&g.hasOwnProperty("default")?g.default:g,u=u&&u.hasOwnProperty("default")?u.default:u;var e="transitionend";function n(t){var e=this,n=!1;return g(this).one(_.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||_.triggerTransitionEnd(e)},t),this}var _={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=g(t).css("transition-duration"),n=g(t).css("transition-delay"),i=parseFloat(e),o=parseFloat(n);return i||o?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){g(t).trigger(e)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&_.isElement(r)?"element":(a=r,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?_.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null}};g.fn.emulateTransitionEnd=n,g.event.special[_.TRANSITION_END]={bindType:e,delegateType:e,handle:function(t){if(g(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var o="alert",r="bs.alert",a="."+r,c=g.fn[o],h={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+".data-api"},f="alert",d="fade",m="show",p=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function(){g.removeData(this._element,r),this._element=null},t._getRootElement=function(t){var e=_.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=g(t).closest("."+f)[0]),n},t._triggerCloseEvent=function(t){var e=g.Event(h.CLOSE);return g(t).trigger(e),e},t._removeElement=function(e){var n=this;if(g(e).removeClass(m),g(e).hasClass(d)){var t=_.getTransitionDurationFromElement(e);g(e).one(_.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){g(t).detach().trigger(h.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(r);e||(e=new i(this),t.data(r,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();
26735g(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),g.fn[o]=p._jQueryInterface,g.fn[o].Constructor=p,g.fn[o].noConflict=function(){return g.fn[o]=c,p._jQueryInterface};var v="button",y="bs.button",E="."+y,C=".data-api",T=g.fn[v],S="active",b="btn",I="focus",D='[data-toggle^="button"]',w='[data-toggle="buttons"]',A='input:not([type="hidden"])',N=".active",O=".btn",k={CLICK_DATA_API:"click"+E+C,FOCUS_BLUR_DATA_API:"focus"+E+C+" blur"+E+C},P=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(w)[0];if(n){var i=this._element.querySelector(A);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(S))t=!1;else{var o=n.querySelector(N);o&&g(o).removeClass(S)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!this._element.classList.contains(S),g(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(S)),t&&g(this._element).toggleClass(S)},t.dispose=function(){g.removeData(this._element,y),this._element=null},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(y);t||(t=new n(this),g(this).data(y,t)),"toggle"===e&&t[e]()})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),n}();g(document).on(k.CLICK_DATA_API,D,function(t){t.preventDefault();var e=t.target;g(e).hasClass(b)||(e=g(e).closest(O)),P._jQueryInterface.call(g(e),"toggle")}).on(k.FOCUS_BLUR_DATA_API,D,function(t){var e=g(t.target).closest(O)[0];g(e).toggleClass(I,/^focus(in)?$/.test(t.type))}),g.fn[v]=P._jQueryInterface,g.fn[v].Constructor=P,g.fn[v].noConflict=function(){return g.fn[v]=T,P._jQueryInterface};var L="carousel",j="bs.carousel",H="."+j,R=".data-api",x=g.fn[L],F={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},U={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},W="next",q="prev",M="left",K="right",Q={SLIDE:"slide"+H,SLID:"slid"+H,KEYDOWN:"keydown"+H,MOUSEENTER:"mouseenter"+H,MOUSELEAVE:"mouseleave"+H,TOUCHSTART:"touchstart"+H,TOUCHMOVE:"touchmove"+H,TOUCHEND:"touchend"+H,POINTERDOWN:"pointerdown"+H,POINTERUP:"pointerup"+H,DRAG_START:"dragstart"+H,LOAD_DATA_API:"load"+H+R,CLICK_DATA_API:"click"+H+R},B="carousel",V="active",Y="slide",z="carousel-item-right",X="carousel-item-left",$="carousel-item-next",G="carousel-item-prev",J="pointer-event",Z=".active",tt=".active.carousel-item",et=".carousel-item",nt=".carousel-item img",it=".carousel-item-next, .carousel-item-prev",ot=".carousel-indicators",rt="[data-slide], [data-slide-to]",st='[data-ride="carousel"]',at={TOUCH:"touch",PEN:"pen"},lt=function(){function r(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(ot),this._touchSupported="ontouchstart"in document.documentElement||0<navigator.maxTouchPoints,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var t=r.prototype;return t.next=function(){this._isSliding||this._slide(W)},t.nextWhenVisible=function(){!document.hidden&&g(this._element).is(":visible")&&"hidden"!==g(this._element).css("visibility")&&this.next()},t.prev=function(){this._isSliding||this._slide(q)},t.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(it)&&(_.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},t.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},t.to=function(t){var e=this;this._activeElement=this._element.querySelector(tt);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=n<t?W:q;this._slide(i,this._items[t])}},t.dispose=function(){g(this._element).off(H),g.removeData(this._element,j),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},t._getConfig=function(t){return t=l({},F,t),_.typeCheckConfig(L,t,U),t},t._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;0<e&&this.prev(),e<0&&this.next()}},t._addEventListeners=function(){var e=this;this._config.keyboard&&g(this._element).on(Q.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&g(this._element).on(Q.MOUSEENTER,function(t){return e.pause(t)}).on(Q.MOUSELEAVE,function(t){return e.cycle(t)}),this._config.touch&&this._addTouchEventListeners()},t._addTouchEventListeners=function(){var n=this;if(this._touchSupported){var e=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]?n.touchStartX=t.originalEvent.clientX:n._pointerEvent||(n.touchStartX=t.originalEvent.touches[0].clientX)},i=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]&&(n.touchDeltaX=t.originalEvent.clientX-n.touchStartX),n._handleSwipe(),"hover"===n._config.pause&&(n.pause(),n.touchTimeout&&clearTimeout(n.touchTimeout),n.touchTimeout=setTimeout(function(t){return n.cycle(t)},500+n._config.interval))};g(this._element.querySelectorAll(nt)).on(Q.DRAG_START,function(t){return t.preventDefault()}),this._pointerEvent?(g(this._element).on(Q.POINTERDOWN,function(t){return e(t)}),g(this._element).on(Q.POINTERUP,function(t){return i(t)}),this._element.classList.add(J)):(g(this._element).on(Q.TOUCHSTART,function(t){return e(t)}),g(this._element).on(Q.TOUCHMOVE,function(t){var e;(e=t).originalEvent.touches&&1<e.originalEvent.touches.length?n.touchDeltaX=0:n.touchDeltaX=e.originalEvent.touches[0].clientX-n.touchStartX}),g(this._element).on(Q.TOUCHEND,function(t){return i(t)}))}},t._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},t._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(et)):[],this._items.indexOf(t)},t._getItemByDirection=function(t,e){var n=t===W,i=t===q,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===q?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},t._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(this._element.querySelector(tt)),o=g.Event(Q.SLIDE,{relatedTarget:t,direction:e,from:i,to:n});return g(this._element).trigger(o),o},t._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(Z));g(e).removeClass(V);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&g(n).addClass(V)}},t._slide=function(t,e){var n,i,o,r=this,s=this._element.querySelector(tt),a=this._getItemIndex(s),l=e||s&&this._getItemByDirection(t,s),c=this._getItemIndex(l),h=Boolean(this._interval);if(o=t===W?(n=X,i=$,M):(n=z,i=G,K),l&&g(l).hasClass(V))this._isSliding=!1;else if(!this._triggerSlideEvent(l,o).isDefaultPrevented()&&s&&l){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(l);var u=g.Event(Q.SLID,{relatedTarget:l,direction:o,from:a,to:c});if(g(this._element).hasClass(Y)){g(l).addClass(i),_.reflow(l),g(s).addClass(n),g(l).addClass(n);var f=parseInt(l.getAttribute("data-interval"),10);this._config.interval=f?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,f):this._config.defaultInterval||this._config.interval;var d=_.getTransitionDurationFromElement(s);g(s).one(_.TRANSITION_END,function(){g(l).removeClass(n+" "+i).addClass(V),g(s).removeClass(V+" "+i+" "+n),r._isSliding=!1,setTimeout(function(){return g(r._element).trigger(u)},0)}).emulateTransitionEnd(d)}else g(s).removeClass(V),g(l).addClass(V),this._isSliding=!1,g(this._element).trigger(u);h&&this.cycle()}},r._jQueryInterface=function(i){return this.each(function(){var t=g(this).data(j),e=l({},F,g(this).data());"object"==typeof i&&(e=l({},e,i));var n="string"==typeof i?i:e.slide;if(t||(t=new r(this,e),g(this).data(j,t)),"number"==typeof i)t.to(i);else if("string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method n
26735amed "'+n+'"');t[n]()}else e.interval&&e.ride&&(t.pause(),t.cycle())})},r._dataApiClickHandler=function(t){var e=_.getSelectorFromElement(this);if(e){var n=g(e)[0];if(n&&g(n).hasClass(B)){var i=l({},g(n).data(),g(this).data()),o=this.getAttribute("data-slide-to");o&&(i.interval=!1),r._jQueryInterface.call(g(n),i),o&&g(n).data(j).to(o),t.preventDefault()}}},s(r,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return F}}]),r}();g(document).on(Q.CLICK_DATA_API,rt,lt._dataApiClickHandler),g(window).on(Q.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(st)),e=0,n=t.length;e<n;e++){var i=g(t[e]);lt._jQueryInterface.call(i,i.data())}}),g.fn[L]=lt._jQueryInterface,g.fn[L].Constructor=lt,g.fn[L].noConflict=function(){return g.fn[L]=x,lt._jQueryInterface};var ct="collapse",ht="bs.collapse",ut="."+ht,ft=g.fn[ct],dt={toggle:!0,parent:""},gt={toggle:"boolean",parent:"(string|element)"},_t={SHOW:"show"+ut,SHOWN:"shown"+ut,HIDE:"hide"+ut,HIDDEN:"hidden"+ut,CLICK_DATA_API:"click"+ut+".data-api"},mt="show",pt="collapse",vt="collapsing",yt="collapsed",Et="width",Ct="height",Tt=".show, .collapsing",St='[data-toggle="collapse"]',bt=function(){function a(e,t){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(t),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var n=[].slice.call(document.querySelectorAll(St)),i=0,o=n.length;i<o;i++){var r=n[i],s=_.getSelectorFromElement(r),a=[].slice.call(document.querySelectorAll(s)).filter(function(t){return t===e});null!==s&&0<a.length&&(this._selector=s,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var t=a.prototype;return t.toggle=function(){g(this._element).hasClass(mt)?this.hide():this.show()},t.show=function(){var t,e,n=this;if(!this._isTransitioning&&!g(this._element).hasClass(mt)&&(this._parent&&0===(t=[].slice.call(this._parent.querySelectorAll(Tt)).filter(function(t){return"string"==typeof n._config.parent?t.getAttribute("data-parent")===n._config.parent:t.classList.contains(pt)})).length&&(t=null),!(t&&(e=g(t).not(this._selector).data(ht))&&e._isTransitioning))){var i=g.Event(_t.SHOW);if(g(this._element).trigger(i),!i.isDefaultPrevented()){t&&(a._jQueryInterface.call(g(t).not(this._selector),"hide"),e||g(t).data(ht,null));var o=this._getDimension();g(this._element).removeClass(pt).addClass(vt),this._element.style[o]=0,this._triggerArray.length&&g(this._triggerArray).removeClass(yt).attr("aria-expanded",!0),this.setTransitioning(!0);var r="scroll"+(o[0].toUpperCase()+o.slice(1)),s=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){g(n._element).removeClass(vt).addClass(pt).addClass(mt),n._element.style[o]="",n.setTransitioning(!1),g(n._element).trigger(_t.SHOWN)}).emulateTransitionEnd(s),this._element.style[o]=this._element[r]+"px"}}},t.hide=function(){var t=this;if(!this._isTransitioning&&g(this._element).hasClass(mt)){var e=g.Event(_t.HIDE);if(g(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",_.reflow(this._element),g(this._element).addClass(vt).removeClass(pt).removeClass(mt);var i=this._triggerArray.length;if(0<i)for(var o=0;o<i;o++){var r=this._triggerArray[o],s=_.getSelectorFromElement(r);if(null!==s)g([].slice.call(document.querySelectorAll(s))).hasClass(mt)||g(r).addClass(yt).attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[n]="";var a=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){t.setTransitioning(!1),g(t._element).removeClass(vt).addClass(pt).trigger(_t.HIDDEN)}).emulateTransitionEnd(a)}}},t.setTransitioning=function(t){this._isTransitioning=t},t.dispose=function(){g.removeData(this._element,ht),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},t._getConfig=function(t){return(t=l({},dt,t)).toggle=Boolean(t.toggle),_.typeCheckConfig(ct,t,gt),t},t._getDimension=function(){return g(this._element).hasClass(Et)?Et:Ct},t._getParent=function(){var t,n=this;_.isElement(this._config.parent)?(t=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(t=this._config.parent[0])):t=document.querySelector(this._config.parent);var e='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',i=[].slice.call(t.querySelectorAll(e));return g(i).each(function(t,e){n._addAriaAndCollapsedClass(a._getTargetFromElement(e),[e])}),t},t._addAriaAndCollapsedClass=function(t,e){var n=g(t).hasClass(mt);e.length&&g(e).toggleClass(yt,!n).attr("aria-expanded",n)},a._getTargetFromElement=function(t){var e=_.getSelectorFromElement(t);return e?document.querySelector(e):null},a._jQueryInterface=function(i){return this.each(function(){var t=g(this),e=t.data(ht),n=l({},dt,t.data(),"object"==typeof i&&i?i:{});if(!e&&n.toggle&&/show|hide/.test(i)&&(n.toggle=!1),e||(e=new a(this,n),t.data(ht,e)),"string"==typeof i){if("undefined"==typeof e[i])throw new TypeError('No method n
26735amed "'+i+'"');e[i]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return dt}}]),a}();g(document).on(_t.CLICK_DATA_API,St,function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=g(this),e=_.getSelectorFromElement(this),i=[].slice.call(document.querySelectorAll(e));g(i).each(function(){var t=g(this),e=t.data(ht)?"toggle":n.data();bt._jQueryInterface.call(t,e)})}),g.fn[ct]=bt._jQueryInterface,g.fn[ct].Constructor=bt,g.fn[ct].noConflict=function(){return g.fn[ct]=ft,bt._jQueryInterface};var It="dropdown",Dt="bs.dropdown",wt="."+Dt,At=".data-api",Nt=g.fn[It],Ot=new RegExp("38|40|27"),kt={HIDE:"hide"+wt,HIDDEN:"hidden"+wt,SHOW:"show"+wt,SHOWN:"shown"+wt,CLICK:"click"+wt,CLICK_DATA_API:"click"+wt+At,KEYDOWN_DATA_API:"keydown"+wt+At,KEYUP_DATA_API:"keyup"+wt+At},Pt="disabled",Lt="show",jt="dropup",Ht="dropright",Rt="dropleft",xt="dropdown-menu-right",Ft="position-static",Ut='[data-toggle="dropdown"]',Wt=".dropdown form",qt=".dropdown-menu",Mt=".navbar-nav",Kt=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Qt="top-start",Bt="top-end",Vt="bottom-start",Yt="bottom-end",zt="right-start",Xt="left-start",$t={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic"},Gt={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string"},Jt=function(){function c(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var t=c.prototype;return t.toggle=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)){var t=c._getParentFromElement(this._element),e=g(this._menu).hasClass(Lt);if(c._clearMenus(),!e){var n={relatedTarget:this._element},i=g.Event(kt.SHOW,n);if(g(t).trigger(i),!i.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof u)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var o=this._element;"parent"===this._config.reference?o=t:_.isElement(this._config.reference)&&(o=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(o=this._config.reference[0])),"scrollParent"!==this._config.boundary&&g(t).addClass(Ft),this._popper=new u(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===g(t).closest(Mt).length&&g(document.body).children().on("mouseover",null,g.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),g(this._menu).toggleClass(Lt),g(t).toggleClass(Lt).trigger(g.Event(kt.SHOWN,n))}}}},t.show=function(){if(!(this._element.disabled||g(this._element).hasClass(Pt)||g(this._menu).hasClass(Lt))){var t={relatedTarget:this._element},e=g.Event(kt.SHOW,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.SHOWN,t)))}},t.hide=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)&&g(this._menu).hasClass(Lt)){var t={relatedTarget:this._element},e=g.Event(kt.HIDE,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.HIDDEN,t)))}},t.dispose=function(){g.removeData(this._element,Dt),g(this._element).off(wt),this._element=null,(this._menu=null)!==this._popper&&(this._popper.destroy(),this._popper=null)},t.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},t._addEventListeners=function(){var e=this;g(this._element).on(kt.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},t._getConfig=function(t){return t=l({},this.constructor.Default,g(this._element).data(),t),_.typeCheckConfig(It,t,this.constructor.DefaultType),t},t._getMenuElement=function(){if(!this._menu){var t=c._getParentFromElement(this._element);t&&(this._menu=t.querySelector(qt))}return this._menu},t._getPlacement=function(){var t=g(this._element.parentNode),e=Vt;return t.hasClass(jt)?(e=Qt,g(this._menu).hasClass(xt)&&(e=Bt)):t.hasClass(Ht)?e=zt:t.hasClass(Rt)?e=Xt:g(this._menu).hasClass(xt)&&(e=Yt),e},t._detectNavbar=function(){return 0<g(this._element).closest(".
26735navbar").length},t._getOffset=function(){var e=this,t={};return"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e._config.offset(t.offsets,e._element)||{}),t}:t.offset=this._config.offset,t},t._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),t},c._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(Dt);if(t||(t=new c(this,"object"==typeof e?e:null),g(this).data(Dt,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},c._clearMenus=function(t){if(!t||3!==t.which&&("keyup"!==t.type||9===t.which))for(var e=[].slice.call(document.querySelectorAll(Ut)),n=0,i=e.length;n<i;n++){var o=c._getParentFromElement(e[n]),r=g(e[n]).data(Dt),s={relatedTarget:e[n]};if(t&&"click"===t.type&&(s.clickEvent=t),r){var a=r._menu;if(g(o).hasClass(Lt)&&!(t&&("click"===t.type&&/input|textarea/i.test(t.target.tagName)||"keyup"===t.type&&9===t.which)&&g.contains(o,t.target))){var l=g.Event(kt.HIDE,s);g(o).trigger(l),l.isDefaultPrevented()||("ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),e[n].setAttribute("aria-expanded","false"),g(a).removeClass(Lt),g(o).removeClass(Lt).trigger(g.Event(kt.HIDDEN,s)))}}}},c._getParentFromElement=function(t){var e,n=_.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},c._dataApiKeydownHandler=function(t){if((/input|textarea/i.test(t.target.tagName)?!(32===t.which||27!==t.which&&(40!==t.which&&38!==t.which||g(t.target).closest(qt).length)):Ot.test(t.which))&&(t.preventDefault(),t.stopPropagation(),!this.disabled&&!g(this).hasClass(Pt))){var e=c._getParentFromElement(this),n=g(e).hasClass(Lt);if(n&&(!n||27!==t.which&&32!==t.which)){var i=[].slice.call(e.querySelectorAll(Kt));if(0!==i.length){var o=i.indexOf(t.target);38===t.which&&0<o&&o--,40===t.which&&o<i.length-1&&o++,o<0&&(o=0),i[o].focus()}}else{if(27===t.which){var r=e.querySelector(Ut);g(r).trigger("focus")}g(this).trigger("click")}}},s(c,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return $t}},{key:"DefaultType",get:function(){return Gt}}]),c}();g(document).on(kt.KEYDOWN_DATA_API,Ut,Jt._dataApiKeydownHandler).on(kt.KEYDOWN_DATA_API,qt,Jt._dataApiKeydownHandler).on(kt.CLICK_DATA_API+" "+kt.KEYUP_DATA_API,Jt._clearMenus).on(kt.CLICK_DATA_API,Ut,function(t){t.preventDefault(),t.stopPropagation(),Jt._jQueryInterface.call(g(this),"toggle")}).on(kt.CLICK_DATA_API,Wt,function(t){t.stopPropagation()}),g.fn[It]=Jt._jQueryInterface,g.fn[It].Constructor=Jt,g.fn[It].noConflict=function(){return g.fn[It]=Nt,Jt._jQueryInterface};var Zt="modal",te="bs.modal",ee="."+te,ne=g.fn[Zt],ie={backdrop:!0,keyboard:!0,focus:!0,show:!0},oe={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},re={HIDE:"hide"+ee,HIDDEN:"hidden"+ee,SHOW:"show"+ee,SHOWN:"shown"+ee,FOCUSIN:"focusin"+ee,RESIZE:"resize"+ee,CLICK_DISMISS:"click.dismiss"+ee,KEYDOWN_DISMISS:"keydown.dismiss"+ee,MOUSEUP_DISMISS:"mouseup.dismiss"+ee,MOUSEDOWN_DISMISS:"mousedown.dismiss"+ee,CLICK_DATA_API:"click"+ee+".data-api"},se="modal-dialog-scrollable",ae="modal-scrollbar-measure",le="modal-backdrop",ce="modal-open",he="fade",ue="show",fe=".modal-dialog",de=".modal-body",ge='[data-toggle="modal"]',_e='[data-dismiss="modal"]',me=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",pe=".sticky-top",ve=function(){function o(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(fe),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var t=o.prototype;return t.toggle=function(t){return this._isShown?this.hide():this.show(t)},t.show=function(t){var e=this;if(!this._isShown&&!this._isTransitioning){g(this._element).hasClass(he)&&(this._isTransitioning=!0);var n=g.Event(re.SHOW,{relatedTarget:t});g(this._element).trigger(n),this._isShown||n.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),g(this._element).on(re.CLICK_DISMISS,_e,function(t){return e.hide(t)}),g(this._dialog).on(re.MOUSEDOWN_DISMISS,function(){g(e._element).one(re.MOUSEUP_DISMISS,function(t){g(t.target).is(e._element)&&(e._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return e._showElement(t)}))}},t.hide=function(t){var e=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var n=g.Event(re.HIDE);if(g(this._element).trigger(n),this._isShown&&!n.isDefaultPrevented()){this._isShown=!1;var i=g(this._element).hasClass(he);if(i&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),g(document).off(re.FOCUSIN),g(this._element).removeClass(ue),g(this._element).off(re.CLICK_DISMISS),g(this._dialog).off(re.MOUSEDOWN_DISMISS),i){var o=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(t){return e._hideModal(t)}).emulateTransitionEnd(o)}else this._hideModal()}}},t.dispose=function(){[window,this._element,this._dialog].forEach(function(t){return g(t).off(ee)}),g(document).off(re.FOCUSIN),g.removeData(this._element,te),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},t.handleUpdate=function(){this._adjustDialog()},t._getConfig=function(t){return t=l({},ie,t),_.typeCheckConfig(Zt,t,oe),t},t._showElement=function(t){var e=this,n=g(this._element).hasClass(he);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),g(this._dialog).hasClass(se)?this._dialog.querySelector(de).scrollTop=0:this._element.scrollTop=0,n&&_.reflow(this._element),g(this._element).addClass(ue),this._config.focus&&this._enforceFocus();
26735var i=g.Event(re.SHOWN,{relatedTarget:t}),o=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,g(e._element).trigger(i)};if(n){var r=_.getTransitionDurationFromElement(this._dialog);g(this._dialog).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()},t._enforceFocus=function(){var e=this;g(document).off(re.FOCUSIN).on(re.FOCUSIN,function(t){document!==t.target&&e._element!==t.target&&0===g(e._element).has(t.target).length&&e._element.focus()})},t._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?g(this._element).on(re.KEYDOWN_DISMISS,function(t){27===t.which&&(t.preventDefault(),e.hide())}):this._isShown||g(this._element).off(re.KEYDOWN_DISMISS)},t._setResizeEvent=function(){var e=this;this._isShown?g(window).on(re.RESIZE,function(t){return e.handleUpdate(t)}):g(window).off(re.RESIZE)},t._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop(function(){g(document.body).removeClass(ce),t._resetAdjustments(),t._resetScrollbar(),g(t._element).trigger(re.HIDDEN)})},t._removeBackdrop=function(){this._backdrop&&(g(this._backdrop).remove(),this._backdrop=null)},t._showBackdrop=function(t){var e=this,n=g(this._element).hasClass(he)?he:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className=le,n&&this._backdrop.classList.add(n),g(this._backdrop).appendTo(document.body),g(this._element).on(re.CLICK_DISMISS,function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._element.focus():e.hide())}),n&&_.reflow(this._backdrop),g(this._backdrop).addClass(ue),!t)return;if(!n)return void t();var i=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,t).emulateTransitionEnd(i)}else if(!this._isShown&&this._backdrop){g(this._backdrop).removeClass(ue);var o=function(){e._removeBackdrop(),t&&t()};if(g(this._element).hasClass(he)){var r=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()}else t&&t()},t._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},t._setScrollbar=function(){var o=this;if(this._isBodyOverflowing){var t=[].slice.call(document.querySelectorAll(me)),e=[].slice.call(document.querySelectorAll(pe));g(t).each(function(t,e){var n=e.style.paddingRight,i=g(e).css("padding-right");g(e).data("padding-right",n).css("padding-right",parseFloat(i)+o._scrollbarWidth+"px")}),g(e).each(function(t,e){var n=e.style.marginRight,i=g(e).css("margin-right");g(e).data("margin-right",n).css("margin-right",parseFloat(i)-o._scrollbarWidth+"px")});var n=document.body.style.paddingRight,i=g(document.body).css("padding-right");g(document.body).data("padding-right",n).css("padding-right",parseFloat(i)+this._scrollbarWidth+"px")}g(document.body).addClass(ce)},t._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(me));g(t).each(function(t,e){var n=g(e).data("padding-right");g(e).removeData("padding-right"),e.style.paddingRight=n||""});var e=[].slice.call(document.querySelectorAll(""+pe));g(e).each(function(t,e){var n=g(e).data("margin-right");"undefined"!=typeof n&&g(e).css("margin-right",n).removeData("margin-right")});var n=g(document.body).data("padding-right");g(document.body).removeData("padding-right"),document.body.style.paddingRight=n||""},t._getScrollbarWidth=function(){var t=document.createElement("div");t.className=ae,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},o._jQueryInterface=function(n,i){return this.each(function(){var t=g(this).data(te),e=l({},ie,g(this).data(),"object"==typeof n&&n?n:{});if(t||(t=new o(this,e),g(this).data(te,t)),"string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method n
26735amed "'+n+'"');t[n](i)}else e.show&&t.show(i)})},s(o,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return ie}}]),o}();g(document).on(re.CLICK_DATA_API,ge,function(t){var e,n=this,i=_.getSelectorFromElement(this);i&&(e=document.querySelector(i));var o=g(e).data(te)?"toggle":l({},g(e).data(),g(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var r=g(e).one(re.SHOW,function(t){t.isDefaultPrevented()||r.one(re.HIDDEN,function(){g(n).is(":visible")&&n.focus()})});ve._jQueryInterface.call(g(e),o,this)}),g.fn[Zt]=ve._jQueryInterface,g.fn[Zt].Constructor=ve,g.fn[Zt].noConflict=function(){return g.fn[Zt]=ne,ve._jQueryInterface};var ye=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],Ee={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ce=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,Te=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function Se(t,s,e){if(0===t.length)return t;if(e&&"function"==typeof e)return e(t);for(var n=(new window.DOMParser).parseFromString(t,"text/html"),a=Object.keys(s),l=[].slice.call(n.body.querySelectorAll("*")),i=function(t,e){var n=l[t],i=n.nodeName.toLowerCase();if(-1===a.indexOf(n.nodeName.toLowerCase()))return n.parentNode.removeChild(n),"continue";var o=[].slice.call(n.attributes),r=[].concat(s["*"]||[],s[i]||[]);o.forEach(function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===ye.indexOf(n)||Boolean(t.nodeValue.match(Ce)||t.nodeValue.match(Te));for(var i=e.filter(function(t){return t instanceof RegExp}),o=0,r=i.length;o<r;o++)if(n.match(i[o]))return!0;return!1})(t,r)||n.removeAttribute(t.nodeName)})},o=0,r=l.length;o<r;o++)i(o);return n.body.innerHTML}var be="tooltip",Ie="bs.tooltip",De="."+Ie,we=g.fn[be],Ae="bs-tooltip",Ne=new RegExp("(^|\\s)"+Ae+"\\S+","g"),Oe=["sanitize","whiteList","sanitizeFn"],ke={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object"},Pe={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},Le={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We}
26735,preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method n
26735amed "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0<e.length&&t.removeClass(e.join(""))},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ye),e="object"==typeof n?n:null;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ye,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Je}},{key:"NAME",get:function(){return Ve}},{key:"DATA_KEY",get:function(){return Ye}},{key:"Event",get:function(){return rn}},{key:"EVENT_KEY",get:function(){return ze}},{key:"DefaultType",get:function(){return Ze}}]),i}(Be);g.fn[Ve]=sn._jQueryInterface,g.fn[Ve].Constructor=sn,g.fn[Ve].noConflict=function(){return g.fn[Ve]=Xe,sn._jQueryInterface};var an="scrollspy",ln="bs.scrollspy",cn="."+ln,hn=g.fn[an],un={offset:10,method:"auto",target:""},fn={offset:"number",method:"string",target:"(string|element)"},dn={ACTIVATE:"activate"+cn,SCROLL:"scroll"+cn,LOAD_DATA_API:"load"+cn+".data-api"},gn="dropdown-item",_n="active",mn='[data-spy="scroll"]',pn=".nav, .list-group",vn=".nav-link",yn=".nav-item",En=".list-group-item",Cn=".dropdown",Tn=".dropdown-item",Sn=".dropdown-toggle",bn="offset",In="position",Dn=function(){function n(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" "+vn+","+this._config.target+" "+En+","+this._config.target+" "+Tn,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,g(this._scrollElement).on(dn.SCROLL,function(t){return n._process(t)}),this.refresh(),this._process()}var t=n.prototype;return t.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?bn:In,o="auto"===this._config.method?t:this._config.method,r=o===In?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(t){var e,n=_.getSelectorFromElement(t);if(n&&(e=document.querySelector(n)),e){var i=e.getBoundingClientRect();if(i.width||i.height)return[g(e)[o]().top+r,n]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}
26735).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},t.dispose=function(){g.removeData(this._element,ln),g(this._scrollElement).off(cn),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},t._getConfig=function(t){if("string"!=typeof(t=l({},un,"object"==typeof t&&t?t:{})).target){var e=g(t.target).attr("id");e||(e=_.getUID(an),g(t.target).attr("id",e)),t.target="#"+e}return _.typeCheckConfig(an,t,fn),t},t._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},t._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},t._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),n<=t){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&0<this._offsets[0])return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},t._activate=function(e){this._activeTarget=e,this._clear();var t=this._selector.split(",").map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'}),n=g([].slice.call(document.querySelectorAll(t.join(","))));n.hasClass(gn)?(n.closest(Cn).find(Sn).addClass(_n),n.addClass(_n)):(n.addClass(_n),n.parents(pn).prev(vn+", "+En).addClass(_n),n.parents(pn).prev(yn).children(vn).addClass(_n)),g(this._scrollElement).trigger(dn.ACTIVATE,{relatedTarget:e})},t._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(t){return t.classList.contains(_n)}).forEach(function(t){return t.classList.remove(_n)})},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(ln);if(t||(t=new n(this,"object"==typeof e&&e),g(this).data(ln,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return un}}]),n}();g(window).on(dn.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(mn)),e=t.length;e--;){var n=g(t[e]);Dn._jQueryInterface.call(n,n.data())}}),g.fn[an]=Dn._jQueryInterface,g.fn[an].Constructor=Dn,g.fn[an].noConflict=function(){return g.fn[an]=hn,Dn._jQueryInterface};var wn="bs.tab",An="."+wn,Nn=g.fn.tab,On={HIDE:"hide"+An,HIDDEN:"hidden"+An,SHOW:"show"+An,SHOWN:"shown"+An,CLICK_DATA_API:"click"+An+".data-api"},kn="dropdown-menu",Pn="active",Ln="disabled",jn="fade",Hn="show",Rn=".dropdown",xn=".nav, .list-group",Fn=".active",Un="> li > .active",Wn='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',qn=".dropdown-toggle",Mn="> .dropdown-menu .active",Kn=function(){function i(t){this._element=t}var t=i.prototype;return t.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&g(this._element).hasClass(Pn)||g(this._element).hasClass(Ln))){var t,i,e=g(this._element).closest(xn)[0],o=_.getSelectorFromElement(this._element);if(e){var r="UL"===e.nodeName||"OL"===e.nodeName?Un:Fn;i=(i=g.makeArray(g(e).find(r)))[i.length-1]}var s=g.Event(On.HIDE,{relatedTarget:this._element}),a=g.Event(On.SHOW,{relatedTarget:i});if(i&&g(i).trigger(s),g(this._element).trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){o&&(t=document.querySelector(o)),this._activate(this._element,e);var l=function(){var t=g.Event(On.HIDDEN,{relatedTarget:n._element}),e=g.Event(On.SHOWN,{relatedTarget:i});g(i).trigger(t),g(n._element).trigger(e)};t?this._activate(t,t.parentNode,l):l()}}},t.dispose=function(){g.removeData(this._element,wn),this._element=null},t._activate=function(t,e,n){var i=this,o=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?g(e).children(Fn):g(e).find(Un))[0],r=n&&o&&g(o).hasClass(jn),s=function(){return i._transitionComplete(t,o,n)};if(o&&r){var a=_.getTransitionDurationFromElement(o);g(o).removeClass(Hn).one(_.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},t._transitionComplete=function(t,e,n){if(e){g(e).removeClass(Pn);var i=g(e.parentNode).find(Mn)[0];i&&g(i).removeClass(Pn),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(g(t).addClass(Pn),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),_.reflow(t),t.classList.contains(jn)&&t.classList.add(Hn),t.parentNode&&g(t.parentNode).hasClass(kn)){var o=g(t).closest(Rn)[0];if(o){var r=[].slice.call(o.querySelectorAll(qn));g(r).addClass(Pn)}t.setAttribute("aria-expanded",!0)}n&&n()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(wn);if(e||(e=new i(this),t.data(wn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method n
vendor: 14,875 bytes, lines 26735-27270
26735amed "'+n+'"');e[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();g(document).on(On.CLICK_DATA_API,Wn,function(t){t.preventDefault(),Kn._jQueryInterface.call(g(this),"show")}),g.fn.tab=Kn._jQueryInterface,g.fn.tab.Constructor=Kn,g.fn.tab.noConflict=function(){return g.fn.tab=Nn,Kn._jQueryInterface};var Qn="toast",Bn="bs.toast",Vn="."+Bn,Yn=g.fn[Qn],zn={CLICK_DISMISS:"click.dismiss"+Vn,HIDE:"hide"+Vn,HIDDEN:"hidden"+Vn,SHOW:"show"+Vn,SHOWN:"shown"+Vn},Xn="fade",$n="hide",Gn="show",Jn="showing",Zn={animation:"boolean",autohide:"boolean",delay:"number"},ti={animation:!0,autohide:!0,delay:500},ei='[data-dismiss="toast"]',ni=function(){function i(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var t=i.prototype;return t.show=function(){var t=this;g(this._element).trigger(zn.SHOW),this._config.animation&&this._element.classList.add(Xn);var e=function(){t._element.classList.remove(Jn),t._element.classList.add(Gn),g(t._element).trigger(zn.SHOWN),t._config.autohide&&t.hide()};if(this._element.classList.remove($n),this._element.classList.add(Jn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},t.hide=function(t){var e=this;this._element.classList.contains(Gn)&&(g(this._element).trigger(zn.HIDE),t?this._close():this._timeout=setTimeout(function(){e._close()},this._config.delay))},t.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains(Gn)&&this._element.classList.remove(Gn),g(this._element).off(zn.CLICK_DISMISS),g.removeData(this._element,Bn),this._element=null,this._config=null},t._getConfig=function(t){return t=l({},ti,g(this._element).data(),"object"==typeof t&&t?t:{}),_.typeCheckConfig(Qn,t,this.constructor.DefaultType),t},t._setListeners=function(){var t=this;g(this._element).on(zn.CLICK_DISMISS,ei,function(){return t.hide(!0)})},t._close=function(){var t=this,e=function(){t._element.classList.add($n),g(t._element).trigger(zn.HIDDEN)};if(this._element.classList.remove(Gn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(Bn);if(e||(e=new i(this,"object"==typeof n&&n),t.data(Bn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n](this)}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"DefaultType",get:function(){return Zn}},{key:"Default",get:function(){return ti}}]),i}();g.fn[Qn]=ni._jQueryInterface,g.fn[Qn].Constructor=ni,g.fn[Qn].noConflict=function(){return g.fn[Qn]=Yn,ni._jQueryInterface},function(){if("undefined"==typeof g)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=g.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||4<=t[0])throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),t.Util=_,t.Alert=p,t.Button=P,t.Carousel=lt,t.Collapse=bt,t.Dropdown=Jt,t.Modal=ve,t.Popover=sn,t.Scrollspy=Dn,t.Tab=Kn,t.Toast=ni,t.Tooltip=Be,Object.defineProperty(t,"__esModule",{value:!0})}); 26736//# sourceMappingURL=bootstrap.min.js.map 26737/*! 26738 * Vue.js v2.5.17 26739 * (c) 2014-2018 Evan You 26740 * Released under the MIT License. 26741 */ 26742(function (global, factory) { 26743 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 26744 typeof define === 'function' && define.amd ? define(factory) : 26745 (global.Vue = factory()); 26746}(this, (function () { 'use strict'; 26747 26748/* */ 26749 26750var emptyObject = Object.freeze({}); 26751 26752// these helpers produces better vm code in JS engines due to their 26753// explicitness and function inlining 26754function isUndef (v) { 26755 return v === undefined || v === null 26756} 26757 26758function isDef (v) { 26759 return v !== undefined && v !== null 26760} 26761 26762function isTrue (v) { 26763 return v === true 26764} 26765 26766function isFalse (v) { 26767 return v === false 26768} 26769 26770/** 26771 * Check if value is primitive 26772 */ 26773function isPrimitive (value) { 26774 return ( 26775 typeof value === 'string' || 26776 typeof value === 'number' || 26777 // $flow-disable-line 26778 typeof value === 'symbol' || 26779 typeof value === 'boolean' 26780 ) 26781} 26782 26783/** 26784 * Quick object check - this is primarily used to tell 26785 * Objects from primitive values when we know the value 26786 * is a JSON-compliant type. 26787 */ 26788function isObject (obj) { 26789 return obj !== null && typeof obj === 'object' 26790} 26791 26792/** 26793 * Get the raw type string of a value e.g. [object Object] 26794 */ 26795var _toString = Object.prototype.toString; 26796 26797function toRawType (value) { 26798 return _toString.call(value).slice(8, -1) 26799} 26800 26801/** 26802 * Strict object type check. Only returns true 26803 * for plain JavaScript objects. 26804 */ 26805function isPlainObject (obj) { 26806 return _toString.call(obj) === '[object Object]' 26807} 26808 26809function isRegExp (v) { 26810 return _toString.call(v) === '[object RegExp]' 26811} 26812 26813/** 26814 * Check if val is a valid array index. 26815 */ 26816function isValidArrayIndex (val) { 26817 var n = parseFloat(String(val)); 26818 return n >= 0 && Math.floor(n) === n && isFinite(val) 26819} 26820 26821/** 26822 * Convert a value to a string that is actually rendered. 26823 */ 26824function toString (val) { 26825 return val == null 26826 ? '' 26827 : typeof val === 'object' 26828 ? JSON.stringify(val, null, 2) 26829 : String(val) 26830} 26831 26832/** 26833 * Convert a input value to a number for persistence. 26834 * If the conversion fails, return original string. 26835 */ 26836function toNumber (val) { 26837 var n = parseFloat(val); 26838 return isNaN(n) ? val : n 26839} 26840 26841/** 26842 * Make a map and return a function for checking if a key 26843 * is in that map. 26844 */ 26845function makeMap ( 26846 str, 26847 expectsLowerCase 26848) { 26849 var map = Object.create(null); 26850 var list = str.split(','); 26851 for (var i = 0; i < list.length; i++) { 26852 map[list[i]] = true; 26853 } 26854 return expectsLowerCase 26855 ? function (val) { return map[val.toLowerCase()]; } 26856 : function (val) { return map[val]; } 26857} 26858 26859/** 26860 * Check if a tag is a built-in tag. 26861 */ 26862var isBuiltInTag = makeMap('slot,component', true); 26863 26864/** 26865 * Check if a attribute is a reserved attribute. 26866 */ 26867var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); 26868 26869/** 26870 * Remove an item from an array 26871 */ 26872function remove (arr, item) { 26873 if (arr.length) { 26874 var index = arr.indexOf(item); 26875 if (index > -1) { 26876 return arr.splice(index, 1) 26877 } 26878 } 26879} 26880 26881/** 26882 * Check whether the object has the property. 26883 */ 26884var hasOwnProperty = Object.prototype.hasOwnProperty; 26885function hasOwn (obj, key) { 26886 return hasOwnProperty.call(obj, key) 26887} 26888 26889/** 26890 * Create a cached version of a pure function. 26891 */ 26892function cached (fn) { 26893 var cache = Object.create(null); 26894 return (function cachedFn (str) { 26895 var hit = cache[str]; 26896 return hit || (cache[str] = fn(str)) 26897 }) 26898} 26899 26900/** 26901 * Camelize a hyphen-delimited string. 26902 */ 26903var camelizeRE = /-(\w)/g; 26904var camelize = cached(function (str) { 26905 return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) 26906}); 26907 26908/** 26909 * Capitalize a string. 26910 */ 26911var capitalize = cached(function (str) { 26912 return str.charAt(0).toUpperCase() + str.slice(1) 26913}); 26914 26915/** 26916 * Hyphenate a camelCase string. 26917 */ 26918var hyphenateRE = /\B([A-Z])/g; 26919var hyphenate = cached(function (str) { 26920 return str.replace(hyphenateRE, '-$1').toLowerCase() 26921}); 26922 26923/** 26924 * Simple bind polyfill for environments that do not support it... e.g. 26925 * PhantomJS 1.x. Technically we don't need this anymore since native bind is 26926 * now more performant in most browsers, but removing it would be breaking for 26927 * code that was able to run in PhantomJS 1.x, so this must be kept for 26928 * backwards compatibility. 26929 */ 26930 26931/* istanbul ignore next */ 26932function polyfillBind (fn, ctx) { 26933 function boundFn (a) { 26934 var l = arguments.length; 26935 return l 26936 ? l > 1 26937 ? fn.apply(ctx, arguments) 26938 : fn.call(ctx, a) 26939 : fn.call(ctx) 26940 } 26941 26942 boundFn._length = fn.length; 26943 return boundFn 26944} 26945 26946function nativeBind (fn, ctx) { 26947 return fn.bind(ctx) 26948} 26949 26950var bind = Function.prototype.bind 26951 ? nativeBind 26952 : polyfillBind; 26953 26954/** 26955 * Convert an Array-like object to a real Array. 26956 */ 26957function toArray (list, start) { 26958 start = start || 0; 26959 var i = list.length - start; 26960 var ret = new Array(i); 26961 while (i--) { 26962 ret[i] = list[i + start]; 26963 } 26964 return ret 26965} 26966 26967/** 26968 * Mix properties into target object. 26969 */ 26970function extend (to, _from) { 26971 for (var key in _from) { 26972 to[key] = _from[key]; 26973 } 26974 return to 26975} 26976 26977/** 26978 * Merge an Array of Objects into a single Object. 26979 */ 26980function toObject (arr) { 26981 var res = {}; 26982 for (var i = 0; i < arr.length; i++) { 26983 if (arr[i]) { 26984 extend(res, arr[i]); 26985 } 26986 } 26987 return res 26988} 26989 26990/** 26991 * Perform no operation. 26992 * Stubbing args to make Flow happy without leaving useless transpiled code 26993 * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/) 26994 */ 26995function noop (a, b, c) {} 26996 26997/** 26998 * Always return false. 26999 */ 27000var no = function (a, b, c) { return false; }; 27001 27002/** 27003 * Return same value 27004 */ 27005var identity = function (_) { return _; }; 27006 27007/** 27008 * Generate a static keys string from compiler modules. 27009 */ 27010function genStaticKeys (modules) { 27011 return modules.reduce(function (keys, m) { 27012 return keys.concat(m.staticKeys || []) 27013 }, []).join(',') 27014} 27015 27016/** 27017 * Check if two values are loosely equal - that is, 27018 * if they are plain objects, do they have the same shape? 27019 */ 27020function looseEqual (a, b) { 27021 if (a === b) { return true } 27022 var isObjectA = isObject(a); 27023 var isObjectB = isObject(b); 27024 if (isObjectA && isObjectB) { 27025 try { 27026 var isArrayA = Array.isArray(a); 27027 var isArrayB = Array.isArray(b); 27028 if (isArrayA && isArrayB) { 27029 return a.length === b.length && a.every(function (e, i) { 27030 return looseEqual(e, b[i]) 27031 }) 27032 } else if (!isArrayA && !isArrayB) { 27033 var keysA = Object.keys(a); 27034 var keysB = Object.keys(b); 27035 return keysA.length === keysB.length && keysA.every(function (key) { 27036 return looseEqual(a[key], b[key]) 27037 }) 27038 } else { 27039 /* istanbul ignore next */ 27040 return false 27041 } 27042 } catch (e) { 27043 /* istanbul ignore next */ 27044 return false 27045 } 27046 } else if (!isObjectA && !isObjectB) { 27047 return String(a) === String(b) 27048 } else { 27049 return false 27050 } 27051} 27052 27053function looseIndexOf (arr, val) { 27054 for (var i = 0; i < arr.length; i++) { 27055 if (looseEqual(arr[i], val)) { return i } 27056 } 27057 return -1 27058} 27059 27060/** 27061 * Ensure a function is called only once. 27062 */ 27063function once (fn) { 27064 var called = false; 27065 return function () { 27066 if (!called) { 27067 called = true; 27068 fn.apply(this, arguments); 27069 } 27070 } 27071} 27072 27073var SSR_ATTR = 'data-server-rendered'; 27074 27075var ASSET_TYPES = [ 27076 'component', 27077 'directive', 27078 'filter' 27079]; 27080 27081var LIFECYCLE_HOOKS = [ 27082 'beforeCreate', 27083 'created', 27084 'beforeMount', 27085 'mounted', 27086 'beforeUpdate', 27087 'updated', 27088 'beforeDestroy', 27089 'destroyed', 27090 'activated', 27091 'deactivated', 27092 'errorCaptured' 27093]; 27094 27095/* */ 27096 27097var config = ({ 27098 /** 27099 * Option merge strategies (used in core/util/options) 27100 */ 27101 // $flow-disable-line 27102 optionMergeStrategies: Object.create(null), 27103 27104 /** 27105 * Whether to suppress warnings. 27106 */ 27107 silent: false, 27108 27109 /** 27110 * Show production mode tip message on boot? 27111 */ 27112 productionTip: "development" !== 'production', 27113 27114 /** 27115 * Whether to enable devtools 27116 */ 27117 devtools: "development" !== 'production', 27118 27119 /** 27120 * Whether to record perf 27121 */ 27122 performance: false, 27123 27124 /** 27125 * Error handler for watcher errors 27126 */ 27127 errorHandler: null, 27128 27129 /** 27130 * Warn handler for watcher warns 27131 */ 27132 warnHandler: null, 27133 27134 /** 27135 * Ignore certain custom elements 27136 */ 27137 ignoredElements: [], 27138 27139 /** 27140 * Custom user key aliases for v-on 27141 */ 27142 // $flow-disable-line 27143 keyCodes: Object.create(null), 27144 27145 /** 27146 * Check if a tag is reserved so that it cannot be registered as a 27147 * component. This is platform-dependent and may be overwritten. 27148 */ 27149 isReservedTag: no, 27150 27151 /** 27152 * Check if an attribute is reserved so that it cannot be used as a component 27153 * prop. This is platform-dependent and may be overwritten. 27154 */ 27155 isReservedAttr: no, 27156 27157 /** 27158 * Check if a tag is an unknown element. 27159 * Platform-dependent. 27160 */ 27161 isUnknownElement: no, 27162 27163 /** 27164 * Get the namespace of an element 27165 */ 27166 getTagNamespace: noop, 27167 27168 /** 27169 * Parse the real tag name for the specific platform. 27170 */ 27171 parsePlatformTagName: identity, 27172 27173 /** 27174 * Check if an attribute must be bound using property, e.g. value 27175 * Platform-dependent. 27176 */ 27177 mustUseProp: no, 27178 27179 /** 27180 * Exposed for legacy reasons 27181 */ 27182 _lifecycleHooks: LIFECYCLE_HOOKS 27183}) 27184 27185/* */ 27186 27187/** 27188 * Check if a string starts with $ or _ 27189 */ 27190function isReserved (str) { 27191 var c = (str + '').charCodeAt(0); 27192 return c === 0x24 || c === 0x5F 27193} 27194 27195/** 27196 * Define a property. 27197 */ 27198function def (obj, key, val, enumerable) { 27199 Object.defineProperty(obj, key, { 27200 value: val, 27201 enumerable: !!enumerable, 27202 writable: true, 27203 configurable: true 27204 }); 27205} 27206 27207/** 27208 * Parse simple path. 27209 */ 27210var bailRE = /[^\w.$]/; 27211function parsePath (path) { 27212 if (bailRE.test(path)) { 27213 return 27214 } 27215 var segments = path.split('.'); 27216 return function (obj) { 27217 for (var i = 0; i < segments.length; i++) { 27218 if (!obj) { return } 27219 obj = obj[segments[i]]; 27220 } 27221 return obj 27222 } 27223} 27224 27225/* */ 27226 27227// can we use __proto__? 27228var hasProto = '__proto__' in {}; 27229 27230// Browser environment sniffing 27231var inBrowser = typeof window !== 'undefined'; 27232var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; 27233var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); 27234var UA = inBrowser && window.navigator.userAgent.toLowerCase(); 27235var isIE = UA && /msie|trident/.test(UA); 27236var isIE9 = UA && UA.indexOf('msie 9.0') > 0; 27237var isEdge = UA && UA.indexOf('edge/') > 0; 27238var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); 27239var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); 27240var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; 27241 27242// Firefox has a "watch" function on Object.prototype... 27243var nativeWatch = ({}).watch; 27244 27245var supportsPassive = false; 27246if (inBrowser) { 27247 try { 27248 var opts = {}; 27249 Object.defineProperty(opts, 'passive', ({ 27250 get: function get () { 27251 /* istanbul ignore next */ 27252 supportsPassive = true; 27253 } 27254 })); // https://github.com/facebook/flow/issues/285 27255 window.addEventListener('test-passive', null, opts); 27256 } catch (e) {} 27257} 27258 27259// this needs to be lazy-evaled because vue may be required before 27260// vue-server-renderer can set VUE_ENV 27261var _isServer; 27262var isServerRendering = function () { 27263 if (_isServer === undefined) { 27264 /* istanbul ignore if */ 27265 if (!inBrowser && !inWeex && typeof global !== 'undefined') { 27266 // detect presence of vue-server-renderer and avoid 27267 // Webpack shimming the process 27268 _isServer = global['process'].env.VUE_ENV === 'server'; 27269 } else { 27270 _isServer = false;
vendor: 3,992 bytes, lines 27271-27428
27271 } 27272 } 27273 return _isServer 27274}; 27275 27276// detect devtools 27277var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; 27278 27279/* istanbul ignore next */ 27280function isNative (Ctor) { 27281 return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) 27282} 27283 27284var hasSymbol = 27285 typeof Symbol !== 'undefined' && isNative(Symbol) && 27286 typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); 27287 27288var _Set; 27289/* istanbul ignore if */ // $flow-disable-line 27290if (typeof Set !== 'undefined' && isNative(Set)) { 27291 // use native Set when available. 27292 _Set = Set; 27293} else { 27294 // a non-standard Set polyfill that only works with primitive keys. 27295 _Set = (function () { 27296 function Set () { 27297 this.set = Object.create(null); 27298 } 27299 Set.prototype.has = function has (key) { 27300 return this.set[key] === true 27301 }; 27302 Set.prototype.add = function add (key) { 27303 this.set[key] = true; 27304 }; 27305 Set.prototype.clear = function clear () { 27306 this.set = Object.create(null); 27307 }; 27308 27309 return Set; 27310 }()); 27311} 27312 27313/* */ 27314 27315var warn = noop; 27316var tip = noop; 27317var generateComponentTrace = (noop); // work around flow check 27318var formatComponentName = (noop); 27319 27320{ 27321 var hasConsole = typeof console !== 'undefined'; 27322 var classifyRE = /(?:^|[-_])(\w)/g; 27323 var classify = function (str) { return str 27324 .replace(classifyRE, function (c) { return c.toUpperCase(); }) 27325 .replace(/[-_]/g, ''); }; 27326 27327 warn = function (msg, vm) { 27328 var trace = vm ? generateComponentTrace(vm) : ''; 27329 27330 if (config.warnHandler) { 27331 config.warnHandler.call(null, msg, vm, trace); 27332 } else if (hasConsole && (!config.silent)) { 27333 console.error(("[Vue warn]: " + msg + trace)); 27334 } 27335 }; 27336 27337 tip = function (msg, vm) { 27338 if (hasConsole && (!config.silent)) { 27339 console.warn("[Vue tip]: " + msg + ( 27340 vm ? generateComponentTrace(vm) : '' 27341 )); 27342 } 27343 }; 27344 27345 formatComponentName = function (vm, includeFile) { 27346 if (vm.$root === vm) { 27347 return '<Root>' 27348 } 27349 var options = typeof vm === 'function' && vm.cid != null 27350 ? vm.options 27351 : vm._isVue 27352 ? vm.$options || vm.constructor.options 27353 : vm || {}; 27354 var name = options.name || options._componentTag; 27355 var file = options.__file; 27356 if (!name && file) { 27357 var match = file.match(/([^/\\]+)\.vue$/); 27358 name = match && match[1]; 27359 } 27360 27361 return ( 27362 (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") + 27363 (file && includeFile !== false ? (" at " + file) : '') 27364 ) 27365 }; 27366 27367 var repeat = function (str, n) { 27368 var res = ''; 27369 while (n) { 27370 if (n % 2 === 1) { res += str; } 27371 if (n > 1) { str += str; } 27372 n >>= 1; 27373 } 27374 return res 27375 }; 27376 27377 generateComponentTrace = function (vm) { 27378 if (vm._isVue && vm.$parent) { 27379 var tree = []; 27380 var currentRecursiveSequence = 0; 27381 while (vm) { 27382 if (tree.length > 0) { 27383 var last = tree[tree.length - 1]; 27384 if (last.constructor === vm.constructor) { 27385 currentRecursiveSequence++; 27386 vm = vm.$parent; 27387 continue 27388 } else if (currentRecursiveSequence > 0) { 27389 tree[tree.length - 1] = [last, currentRecursiveSequence]; 27390 currentRecursiveSequence = 0; 27391 } 27392 } 27393 tree.push(vm); 27394 vm = vm.$parent; 27395 } 27396 return '\n\nfound in\n\n' + tree 27397 .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) 27398 ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") 27399 : formatComponentName(vm))); }) 27400 .join('\n') 27401 } else { 27402 return ("\n\n(found in " + (formatComponentName(vm)) + ")") 27403 } 27404 }; 27405} 27406 27407/* */ 27408 27409 27410var uid = 0; 27411 27412/** 27413 * A dep is an observable that can have multiple 27414 * directives subscribing to it. 27415 */ 27416var Dep = function Dep () { 27417 this.id = uid++; 27418 this.subs = []; 27419}; 27420 27421Dep.prototype.addSub = function addSub (sub) { 27422 this.subs.push(sub); 27423}; 27424 27425Dep.prototype.removeSub = function removeSub (sub) { 27426 remove(this.subs, sub); 27427}; 27428
vendor: 5,416 bytes, lines 27429-27665
27429Dep.prototype.depend = function depend () { 27430 if (Dep.target) { 27431 Dep.target.addDep(this); 27432 } 27433}; 27434 27435Dep.prototype.notify = function notify () { 27436 // stabilize the subscriber list first 27437 var subs = this.subs.slice(); 27438 for (var i = 0, l = subs.length; i < l; i++) { 27439 subs[i].update(); 27440 } 27441}; 27442 27443// the current target watcher being evaluated. 27444// this is globally unique because there could be only one 27445// watcher being evaluated at any time. 27446Dep.target = null; 27447var targetStack = []; 27448 27449function pushTarget (_target) { 27450 if (Dep.target) { targetStack.push(Dep.target); } 27451 Dep.target = _target; 27452} 27453 27454function popTarget () { 27455 Dep.target = targetStack.pop(); 27456} 27457 27458/* */ 27459 27460var VNode = function VNode ( 27461 tag, 27462 data, 27463 children, 27464 text, 27465 elm, 27466 context, 27467 componentOptions, 27468 asyncFactory 27469) { 27470 this.tag = tag; 27471 this.data = data; 27472 this.children = children; 27473 this.text = text; 27474 this.elm = elm; 27475 this.ns = undefined; 27476 this.context = context; 27477 this.fnContext = undefined; 27478 this.fnOptions = undefined; 27479 this.fnScopeId = undefined; 27480 this.key = data && data.key; 27481 this.componentOptions = componentOptions; 27482 this.componentInstance = undefined; 27483 this.parent = undefined; 27484 this.raw = false; 27485 this.isStatic = false; 27486 this.isRootInsert = true; 27487 this.isComment = false; 27488 this.isCloned = false; 27489 this.isOnce = false; 27490 this.asyncFactory = asyncFactory; 27491 this.asyncMeta = undefined; 27492 this.isAsyncPlaceholder = false; 27493}; 27494 27495var prototypeAccessors = { child: { configurable: true } }; 27496 27497// DEPRECATED: alias for componentInstance for backwards compat. 27498/* istanbul ignore next */ 27499prototypeAccessors.child.get = function () { 27500 return this.componentInstance 27501}; 27502 27503Object.defineProperties( VNode.prototype, prototypeAccessors ); 27504 27505var createEmptyVNode = function (text) { 27506 if ( text === void 0 ) text = ''; 27507 27508 var node = new VNode(); 27509 node.text = text; 27510 node.isComment = true; 27511 return node 27512}; 27513 27514function createTextVNode (val) { 27515 return new VNode(undefined, undefined, undefined, String(val)) 27516} 27517 27518// optimized shallow clone 27519// used for static nodes and slot nodes because they may be reused across 27520// multiple renders, cloning them avoids errors when DOM manipulations rely 27521// on their elm reference. 27522function cloneVNode (vnode) { 27523 var cloned = new VNode( 27524 vnode.tag, 27525 vnode.data, 27526 vnode.children, 27527 vnode.text, 27528 vnode.elm, 27529 vnode.context, 27530 vnode.componentOptions, 27531 vnode.asyncFactory 27532 ); 27533 cloned.ns = vnode.ns; 27534 cloned.isStatic = vnode.isStatic; 27535 cloned.key = vnode.key; 27536 cloned.isComment = vnode.isComment; 27537 cloned.fnContext = vnode.fnContext; 27538 cloned.fnOptions = vnode.fnOptions; 27539 cloned.fnScopeId = vnode.fnScopeId; 27540 cloned.isCloned = true; 27541 return cloned 27542} 27543 27544/* 27545 * not type checking this file because flow doesn't play well with 27546 * dynamically accessing methods on Array prototype 27547 */ 27548 27549var arrayProto = Array.prototype; 27550var arrayMethods = Object.create(arrayProto); 27551 27552var methodsToPatch = [ 27553 'push', 27554 'pop', 27555 'shift', 27556 'unshift', 27557 'splice', 27558 'sort', 27559 'reverse' 27560]; 27561 27562/** 27563 * Intercept mutating methods and emit events 27564 */ 27565methodsToPatch.forEach(function (method) { 27566 // cache original method 27567 var original = arrayProto[method]; 27568 def(arrayMethods, method, function mutator () { 27569 var args = [], len = arguments.length; 27570 while ( len-- ) args[ len ] = arguments[ len ]; 27571 27572 var result = original.apply(this, args); 27573 var ob = this.__ob__; 27574 var inserted; 27575 switch (method) { 27576 case 'push': 27577 case 'unshift': 27578 inserted = args; 27579 break 27580 case 'splice': 27581 inserted = args.slice(2); 27582 break 27583 } 27584 if (inserted) { ob.observeArray(inserted); } 27585 // notify change 27586 ob.dep.notify(); 27587 return result 27588 }); 27589}); 27590 27591/* */ 27592 27593var arrayKeys = Object.getOwnPropertyNames(arrayMethods); 27594 27595/** 27596 * In some cases we may want to disable observation inside a component's 27597 * update computation. 27598 */ 27599var shouldObserve = true; 27600 27601function toggleObserving (value) { 27602 shouldObserve = value; 27603} 27604 27605/** 27606 * Observer class that is attached to each observed 27607 * object. Once attached, the observer converts the target 27608 * object's property keys into getter/setters that 27609 * collect dependencies and dispatch updates. 27610 */ 27611var Observer = function Observer (value) { 27612 this.value = value; 27613 this.dep = new Dep(); 27614 this.vmCount = 0; 27615 def(value, '__ob__', this); 27616 if (Array.isArray(value)) { 27617 var augment = hasProto 27618 ? protoAugment 27619 : copyAugment; 27620 augment(value, arrayMethods, arrayKeys); 27621 this.observeArray(value); 27622 } else { 27623 this.walk(value); 27624 } 27625}; 27626 27627/** 27628 * Walk through each property and convert them into 27629 * getter/setters. This method should only be called when 27630 * value type is Object. 27631 */ 27632Observer.prototype.walk = function walk (obj) { 27633 var keys = Object.keys(obj); 27634 for (var i = 0; i < keys.length; i++) { 27635 defineReactive(obj, keys[i]); 27636 } 27637}; 27638 27639/** 27640 * Observe a list of Array items. 27641 */ 27642Observer.prototype.observeArray = function observeArray (items) { 27643 for (var i = 0, l = items.length; i < l; i++) { 27644 observe(items[i]); 27645 } 27646}; 27647 27648// helpers 27649 27650/** 27651 * Augment an target Object or Array by intercepting 27652 * the prototype chain using __proto__ 27653 */ 27654function protoAugment (target, src, keys) { 27655 /* eslint-disable no-proto */ 27656 target.__proto__ = src; 27657 /* eslint-enable no-proto */ 27658} 27659 27660/** 27661 * Augment an target Object or Array by defining 27662 * hidden properties. 27663 */ 27664/* istanbul ignore next */ 27665function copyAugment (target, src, keys) {
27666 for (var i = 0, l = keys.length; i < l; i++) { 27667 var key = keys[i]; 27668 def(target, key, src[key]); 27669 } 27670} 27671 27672/** 27673 * Attempt to create an observer instance for a value, 27674 * returns the new observer if successfully observed, 27675 * or the existing observer if the value already has one. 27676 */ 27677function observe (value, asRootData) { 27678 if (!isObject(value) || value instanceof VNode) { 27679 return 27680 } 27681 var ob; 27682 if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { 27683 ob = value.__ob__; 27684 } else if ( 27685 shouldObserve && 27686 !isServerRendering() && 27687 (Array.isArray(value) || isPlainObject(value)) && 27688 Object.isExtensible(value) && 27689 !value._isVue 27690 ) { 27691 ob = new Observer(value); 27692 } 27693 if (asRootData && ob) { 27694 ob.vmCount++; 27695 } 27696 return ob 27697} 27698 27699/** 27700 * Define a reactive property on an Object. 27701 */ 27702function defineReactive ( 27703 obj, 27704 key, 27705 val, 27706 customSetter, 27707 shallow 27708) { 27709 var dep = new Dep(); 27710 27711 var property = Object.getOwnPropertyDescriptor(obj, key); 27712 if (property && property.configurable === false) { 27713 return 27714 } 27715 27716 // cater for pre-defined getter/setters 27717 var getter = property && property.get; 27718 if (!getter && arguments.length === 2) { 27719 val = obj[key]; 27720 } 27721 var setter = property && property.set; 27722 27723 var childOb = !shallow && observe(val); 27724 Object.defineProperty(obj, key, { 27725 enumerable: true, 27726 configurable: true, 27727 get: function reactiveGetter () { 27728 var value = getter ? getter.call(obj) : val; 27729 if (Dep.target) { 27730 dep.depend(); 27731 if (childOb) { 27732 childOb.dep.depend(); 27733 if (Array.isArray(value)) { 27734 dependArray(value); 27735 } 27736 } 27737 } 27738 return value 27739 }, 27740 set: function reactiveSetter (newVal) { 27741 var value = getter ? getter.call(obj) : val; 27742 /* eslint-disable no-self-compare */ 27743 if (newVal === value || (newVal !== newVal && value !== value)) { 27744 return 27745 } 27746 /* eslint-enable no-self-compare */ 27747 if ("development" !== 'production' && customSetter) { 27748 customSetter(); 27749 } 27750 if (setter) { 27751 setter.call(obj, newVal); 27752 } else { 27753 val = newVal; 27754 } 27755 childOb = !shallow && observe(newVal); 27756 dep.notify(); 27757 } 27758 }); 27759} 27760 27761/** 27762 * Set a property on an object. Adds the new property and 27763 * triggers change notification if the property doesn't 27764 * already exist. 27765 */ 27766function set (target, key, val) { 27767 if ("development" !== 'production' && 27768 (isUndef(target) || isPrimitive(target)) 27769 ) { 27770 warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); 27771 } 27772 if (Array.isArray(target) && isValidArrayIndex(key)) { 27773 target.length = Math.max(target.length, key); 27774 target.splice(key, 1, val); 27775 return val 27776 } 27777 if (key in target && !(key in Object.prototype)) { 27778 target[key] = val; 27779 return val 27780 } 27781 var ob = (target).__ob__; 27782 if (target._isVue || (ob && ob.vmCount)) { 27783 "development" !== 'production' && warn( 27784 'Avoid adding reactive properties to a Vue instance or its root $data ' + 27785 'at runtime - declare it upfront in the data option.' 27786 ); 27787 return val 27788 } 27789 if (!ob) { 27790 target[key] = val; 27791 return val 27792 } 27793 defineReactive(ob.value, key, val); 27794 ob.dep.notify(); 27795 return val 27796} 27797 27798/** 27799 * Delete a property and trigger change if necessary. 27800 */ 27801function del (target, key) { 27802 if ("development" !== 'production' && 27803 (isUndef(target) || isPrimitive(target)) 27804 ) { 27805 warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); 27806 } 27807 if (Array.isArray(target) && isValidArrayIndex(key)) { 27808 target.splice(key, 1); 27809 return 27810 } 27811 var ob = (target).__ob__; 27812 if (target._isVue || (ob && ob.vmCount)) { 27813 "development" !== 'production' && warn( 27814 'Avoid deleting properties on a Vue instance or its root $data ' + 27815 '- just set it to null.' 27816 ); 27817 return 27818 } 27819 if (!hasOwn(target, key)) { 27820 return 27821 } 27822 delete target[key]; 27823 if (!ob) { 27824 return 27825 } 27826 ob.dep.notify(); 27827} 27828 27829/** 27830 * Collect dependencies on array elements when the array is touched, since 27831 * we cannot intercept array element access like property getters. 27832 */ 27833function dependArray (value) { 27834 for (var e = (void 0), i = 0, l = value.length; i < l; i++) { 27835 e = value[i]; 27836 e && e.__ob__ && e.__ob__.dep.depend(); 27837 if (Array.isArray(e)) { 27838 dependArray(e); 27839 } 27840 } 27841} 27842 27843/* */ 27844 27845/** 27846 * Option overwriting strategies are functions that handle 27847 * how to merge a parent option value and a child option 27848 * value into the final value. 27849 */ 27850var strats = config.optionMergeStrategies; 27851 27852/** 27853 * Options with restrictions 27854 */ 27855{ 27856 strats.el = strats.propsData = function (parent, child, vm, key) { 27857 if (!vm) { 27858 warn( 27859 "option \"" + key + "\" can only be used during instance " + 27860 'creation with the `new` keyword.' 27861 ); 27862 } 27863 return defaultStrat(parent, child) 27864 }; 27865} 27866 27867/** 27868 * Helper that recursively merges two data objects together. 27869 */ 27870function mergeData (to, from) { 27871 if (!from) { return to } 27872 var key, toVal, fromVal; 27873 var keys = Object.keys(from); 27874 for (var i = 0; i < keys.length; i++) { 27875 key = keys[i]; 27876 toVal = to[key]; 27877 fromVal = from[key]; 27878 if (!hasOwn(to, key)) { 27879 set(to, key, fromVal); 27880 } else if (isPlainObject(toVal) && isPlainObject(fromVal)) { 27881 mergeData(toVal, fromVal); 27882 } 27883 } 27884 return to 27885} 27886 27887/** 27888 * Data 27889 */ 27890function mergeDataOrFn ( 27891 parentVal, 27892 childVal, 27893 vm 27894) { 27895 if (!vm) {
vendor: 4,039 bytes, lines 27896-28077
27896 // in a Vue.extend merge, both should be functions 27897 if (!childVal) { 27898 return parentVal 27899 } 27900 if (!parentVal) { 27901 return childVal 27902 } 27903 // when parentVal & childVal are both present, 27904 // we need to return a function that returns the 27905 // merged result of both functions... no need to 27906 // check if parentVal is a function here because 27907 // it has to be a function to pass previous merges. 27908 return function mergedDataFn () { 27909 return mergeData( 27910 typeof childVal === 'function' ? childVal.call(this, this) : childVal, 27911 typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal 27912 ) 27913 } 27914 } else { 27915 return function mergedInstanceDataFn () { 27916 // instance merge 27917 var instanceData = typeof childVal === 'function' 27918 ? childVal.call(vm, vm) 27919 : childVal; 27920 var defaultData = typeof parentVal === 'function' 27921 ? parentVal.call(vm, vm) 27922 : parentVal; 27923 if (instanceData) { 27924 return mergeData(instanceData, defaultData) 27925 } else { 27926 return defaultData 27927 } 27928 } 27929 } 27930} 27931 27932strats.data = function ( 27933 parentVal, 27934 childVal, 27935 vm 27936) { 27937 if (!vm) { 27938 if (childVal && typeof childVal !== 'function') { 27939 "development" !== 'production' && warn( 27940 'The "data" option should be a function ' + 27941 'that returns a per-instance value in component ' + 27942 'definitions.', 27943 vm 27944 ); 27945 27946 return parentVal 27947 } 27948 return mergeDataOrFn(parentVal, childVal) 27949 } 27950 27951 return mergeDataOrFn(parentVal, childVal, vm) 27952}; 27953 27954/** 27955 * Hooks and props are merged as arrays. 27956 */ 27957function mergeHook ( 27958 parentVal, 27959 childVal 27960) { 27961 return childVal 27962 ? parentVal 27963 ? parentVal.concat(childVal) 27964 : Array.isArray(childVal) 27965 ? childVal 27966 : [childVal] 27967 : parentVal 27968} 27969 27970LIFECYCLE_HOOKS.forEach(function (hook) { 27971 strats[hook] = mergeHook; 27972}); 27973 27974/** 27975 * Assets 27976 * 27977 * When a vm is present (instance creation), we need to do 27978 * a three-way merge between constructor options, instance 27979 * options and parent options. 27980 */ 27981function mergeAssets ( 27982 parentVal, 27983 childVal, 27984 vm, 27985 key 27986) { 27987 var res = Object.create(parentVal || null); 27988 if (childVal) { 27989 "development" !== 'production' && assertObjectType(key, childVal, vm); 27990 return extend(res, childVal) 27991 } else { 27992 return res 27993 } 27994} 27995 27996ASSET_TYPES.forEach(function (type) { 27997 strats[type + 's'] = mergeAssets; 27998}); 27999 28000/** 28001 * Watchers. 28002 * 28003 * Watchers hashes should not overwrite one 28004 * another, so we merge them as arrays. 28005 */ 28006strats.watch = function ( 28007 parentVal, 28008 childVal, 28009 vm, 28010 key 28011) { 28012 // work around Firefox's Object.prototype.watch... 28013 if (parentVal === nativeWatch) { parentVal = undefined; } 28014 if (childVal === nativeWatch) { childVal = undefined; } 28015 /* istanbul ignore if */ 28016 if (!childVal) { return Object.create(parentVal || null) } 28017 { 28018 assertObjectType(key, childVal, vm); 28019 } 28020 if (!parentVal) { return childVal } 28021 var ret = {}; 28022 extend(ret, parentVal); 28023 for (var key$1 in childVal) { 28024 var parent = ret[key$1]; 28025 var child = childVal[key$1]; 28026 if (parent && !Array.isArray(parent)) { 28027 parent = [parent]; 28028 } 28029 ret[key$1] = parent 28030 ? parent.concat(child) 28031 : Array.isArray(child) ? child : [child]; 28032 } 28033 return ret 28034}; 28035 28036/** 28037 * Other object hashes. 28038 */ 28039strats.props = 28040strats.methods = 28041strats.inject = 28042strats.computed = function ( 28043 parentVal, 28044 childVal, 28045 vm, 28046 key 28047) { 28048 if (childVal && "development" !== 'production') { 28049 assertObjectType(key, childVal, vm); 28050 } 28051 if (!parentVal) { return childVal } 28052 var ret = Object.create(null); 28053 extend(ret, parentVal); 28054 if (childVal) { extend(ret, childVal); } 28055 return ret 28056}; 28057strats.provide = mergeDataOrFn; 28058 28059/** 28060 * Default strategy. 28061 */ 28062var defaultStrat = function (parentVal, childVal) { 28063 return childVal === undefined 28064 ? parentVal 28065 : childVal 28066}; 28067 28068/** 28069 * Validate component names 28070 */ 28071function checkComponents (options) { 28072 for (var key in options.components) { 28073 validateComponentName(key); 28074 } 28075} 28076 28077function validateComponentName (name) {
28078 if (!/^[a-zA-Z][\w-]*$/.test(name)) { 28079 warn( 28080 'Invalid component name: "' + name + '". Component names ' + 28081 'can only contain alphanumeric characters and the hyphen, ' + 28082 'and must start with a letter.' 28083 ); 28084 } 28085 if (isBuiltInTag(name) || config.isReservedTag(name)) { 28086 warn( 28087 'Do not use built-in or reserved HTML elements as component ' + 28088 'id: ' + name 28089 ); 28090 } 28091} 28092 28093/** 28094 * Ensure all props option syntax are normalized into the 28095 * Object-based format. 28096 */ 28097function normalizeProps (options, vm) { 28098 var props = options.props; 28099 if (!props) { return } 28100 var res = {}; 28101 var i, val, name; 28102 if (Array.isArray(props)) { 28103 i = props.length; 28104 while (i--) { 28105 val = props[i]; 28106 if (typeof val === 'string') { 28107 name = camelize(val); 28108 res[name] = { type: null }; 28109 } else { 28110 warn('props must be strings when using array syntax.'); 28111 } 28112 } 28113 } else if (isPlainObject(props)) { 28114 for (var key in props) { 28115 val = props[key]; 28116 name = camelize(key); 28117 res[name] = isPlainObject(val) 28118 ? val 28119 : { type: val }; 28120 } 28121 } else { 28122 warn( 28123 "Invalid value for option \"props\": expected an Array or an Object, " + 28124 "but got " + (toRawType(props)) + ".", 28125 vm 28126 ); 28127 } 28128 options.props = res; 28129} 28130 28131/** 28132 * Normalize all injections into Object-based format 28133 */ 28134function normalizeInject (options, vm) { 28135 var inject = options.inject; 28136 if (!inject) { return } 28137 var normalized = options.inject = {}; 28138 if (Array.isArray(inject)) { 28139 for (var i = 0; i < inject.length; i++) { 28140 normalized[inject[i]] = { from: inject[i] }; 28141 } 28142 } else if (isPlainObject(inject)) { 28143 for (var key in inject) { 28144 var val = inject[key]; 28145 normalized[key] = isPlainObject(val) 28146 ? extend({ from: key }, val) 28147 : { from: val }; 28148 } 28149 } else { 28150 warn( 28151 "Invalid value for option \"inject\": expected an Array or an Object, " + 28152 "but got " + (toRawType(inject)) + ".", 28153 vm 28154 ); 28155 } 28156} 28157 28158/** 28159 * Normalize raw function directives into object format. 28160 */ 28161function normalizeDirectives (options) { 28162 var dirs = options.directives; 28163 if (dirs) { 28164 for (var key in dirs) { 28165 var def = dirs[key]; 28166 if (typeof def === 'function') { 28167 dirs[key] = { bind: def, update: def }; 28168 } 28169 } 28170 } 28171} 28172 28173function assertObjectType (name, value, vm) { 28174 if (!isPlainObject(value)) { 28175 warn( 28176 "Invalid value for option \"" + name + "\": expected an Object, " + 28177 "but got " + (toRawType(value)) + ".", 28178 vm 28179 ); 28180 } 28181} 28182 28183/** 28184 * Merge two option objects into a new one. 28185 * Core utility used in both instantiation and inheritance. 28186 */ 28187function mergeOptions ( 28188 parent, 28189 child, 28190 vm 28191) { 28192 { 28193 checkComponents(child); 28194 } 28195 28196 if (typeof child === 'function') { 28197 child = child.options; 28198 } 28199 28200 normalizeProps(child, vm); 28201 normalizeInject(child, vm); 28202 normalizeDirectives(child); 28203 var extendsFrom = child.extends; 28204 if (extendsFrom) { 28205 parent = mergeOptions(parent, extendsFrom, vm); 28206 } 28207 if (child.mixins) { 28208 for (var i = 0, l = child.mixins.length; i < l; i++) { 28209 parent = mergeOptions(parent, child.mixins[i], vm); 28210 } 28211 } 28212 var options = {}; 28213 var key; 28214 for (key in parent) { 28215 mergeField(key); 28216 } 28217 for (key in child) { 28218 if (!hasOwn(parent, key)) { 28219 mergeField(key); 28220 } 28221 } 28222 function mergeField (key) { 28223 var strat = strats[key] || defaultStrat; 28224 options[key] = strat(parent[key], child[key], vm, key); 28225 } 28226 return options 28227} 28228 28229/** 28230 * Resolve an asset. 28231 * This function is used because child instances need access 28232 * to assets defined in its ancestor chain. 28233 */ 28234function resolveAsset ( 28235 options, 28236 type, 28237 id, 28238 warnMissing 28239) { 28240 /* istanbul ignore if */ 28241 if (typeof id !== 'string') { 28242 return 28243 } 28244 var assets = options[type]; 28245 // check local registration variations first 28246 if (hasOwn(assets, id)) { return assets[id] } 28247 var camelizedId = camelize(id); 28248 if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } 28249 var PascalCaseId = capitalize(camelizedId); 28250 if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } 28251 // fallback to prototype chain 28252 var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; 28253 if ("development" !== 'production' && warnMissing && !res) { 28254 warn( 28255 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, 28256 options 28257 ); 28258 } 28259 return res 28260} 28261 28262/* */ 28263 28264function validateProp ( 28265 key, 28266 propOptions, 28267 propsData, 28268 vm 28269) { 28270 var prop = propOptions[key]; 28271 var absent = !hasOwn(propsData, key); 28272 var value = propsData[key]; 28273 // boolean casting 28274 var booleanIndex = getTypeIndex(Boolean, prop.type); 28275 if (booleanIndex > -1) { 28276 if (absent && !hasOwn(prop, 'default')) { 28277 value = false;
28278 } else if (value === '' || value === hyphenate(key)) { 28279 // only cast empty string / same name to boolean if 28280 // boolean has higher priority 28281 var stringIndex = getTypeIndex(String, prop.type); 28282 if (stringIndex < 0 || booleanIndex < stringIndex) { 28283 value = true; 28284 } 28285 } 28286 } 28287 // check default value 28288 if (value === undefined) { 28289 value = getPropDefaultValue(vm, prop, key); 28290 // since the default value is a fresh copy, 28291 // make sure to observe it. 28292 var prevShouldObserve = shouldObserve; 28293 toggleObserving(true); 28294 observe(value); 28295 toggleObserving(prevShouldObserve); 28296 } 28297 { 28298 assertProp(prop, key, value, vm, absent); 28299 } 28300 return value 28301} 28302 28303/** 28304 * Get the default value of a prop. 28305 */ 28306function getPropDefaultValue (vm, prop, key) { 28307 // no default, return undefined 28308 if (!hasOwn(prop, 'default')) { 28309 return undefined 28310 } 28311 var def = prop.default; 28312 // warn against non-factory defaults for Object & Array 28313 if ("development" !== 'production' && isObject(def)) { 28314 warn( 28315 'Invalid default value for prop "' + key + '": ' + 28316 'Props with type Object/Array must use a factory function ' + 28317 'to return the default value.', 28318 vm 28319 ); 28320 } 28321 // the raw prop value was also undefined from previous render, 28322 // return previous default value to avoid unnecessary watcher trigger 28323 if (vm && vm.$options.propsData && 28324 vm.$options.propsData[key] === undefined && 28325 vm._props[key] !== undefined 28326 ) { 28327 return vm._props[key] 28328 } 28329 // call factory function for non-Function types 28330 // a value is Function if its prototype is function even across different execution context 28331 return typeof def === 'function' && getType(prop.type) !== 'Function' 28332 ? def.call(vm) 28333 : def 28334} 28335 28336/** 28337 * Assert whether a prop is valid. 28338 */ 28339function assertProp ( 28340 prop, 28341 name, 28342 value, 28343 vm, 28344 absent 28345) { 28346 if (prop.required && absent) { 28347 warn( 28348 'Missing required prop: "' + name + '"', 28349 vm 28350 ); 28351 return 28352 } 28353 if (value == null && !prop.required) { 28354 return 28355 } 28356 var type = prop.type; 28357 var valid = !type || type === true; 28358 var expectedTypes = []; 28359 if (type) { 28360 if (!Array.isArray(type)) { 28361 type = [type]; 28362 } 28363 for (var i = 0; i < type.length && !valid; i++) { 28364 var assertedType = assertType(value, type[i]); 28365 expectedTypes.push(assertedType.expectedType || ''); 28366 valid = assertedType.valid; 28367 } 28368 } 28369 if (!valid) { 28370 warn( 28371 "Invalid prop: type check failed for prop \"" + name + "\"." + 28372 " Expected " + (expectedTypes.map(capitalize).join(', ')) + 28373 ", got " + (toRawType(value)) + ".", 28374 vm 28375 ); 28376 return 28377 }
28378 var validator = prop.validator; 28379 if (validator) { 28380 if (!validator(value)) { 28381 warn( 28382 'Invalid prop: custom validator check failed for prop "' + name + '".', 28383 vm 28384 ); 28385 } 28386 } 28387} 28388 28389var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; 28390 28391function assertType (value, type) { 28392 var valid; 28393 var expectedType = getType(type); 28394 if (simpleCheckRE.test(expectedType)) { 28395 var t = typeof value; 28396 valid = t === expectedType.toLowerCase(); 28397 // for primitive wrapper objects 28398 if (!valid && t === 'object') { 28399 valid = value instanceof type; 28400 } 28401 } else if (expectedType === 'Object') { 28402 valid = isPlainObject(value); 28403 } else if (expectedType === 'Array') { 28404 valid = Array.isArray(value); 28405 } else { 28406 valid = value instanceof type; 28407 } 28408 return { 28409 valid: valid, 28410 expectedType: expectedType 28411 } 28412} 28413 28414/** 28415 * Use function string name to check built-in types, 28416 * because a simple equality check will fail when running 28417 * across different vms / iframes. 28418 */ 28419function getType (fn) { 28420 var match = fn && fn.toString().match(/^\s*function (\w+)/); 28421 return match ? match[1] : '' 28422} 28423 28424function isSameType (a, b) { 28425 return getType(a) === getType(b) 28426} 28427 28428function getTypeIndex (type, expectedTypes) { 28429 if (!Array.isArray(expectedTypes)) { 28430 return isSameType(expectedTypes, type) ? 0 : -1 28431 } 28432 for (var i = 0, len = expectedTypes.length; i < len; i++) { 28433 if (isSameType(expectedTypes[i], type)) { 28434 return i 28435 } 28436 } 28437 return -1 28438} 28439 28440/* */ 28441 28442function handleError (err, vm, info) { 28443 if (vm) { 28444 var cur = vm; 28445 while ((cur = cur.$parent)) { 28446 var hooks = cur.$options.errorCaptured; 28447 if (hooks) { 28448 for (var i = 0; i < hooks.length; i++) { 28449 try { 28450 var capture = hooks[i].call(cur, err, vm, info) === false; 28451 if (capture) { return } 28452 } catch (e) { 28453 globalHandleError(e, cur, 'errorCaptured hook'); 28454 } 28455 } 28456 } 28457 } 28458 } 28459 globalHandleError(err, vm, info); 28460} 28461 28462function globalHandleError (err, vm, info) { 28463 if (config.errorHandler) { 28464 try { 28465 return config.errorHandler.call(null, err, vm, info) 28466 } catch (e) { 28467 logError(e, null, 'config.errorHandler'); 28468 } 28469 } 28470 logError(err, vm, info); 28471} 28472 28473function logError (err, vm, info) { 28474 { 28475 warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); 28476 } 28477 /* istanbul ignore else */ 28478 if ((inBrowser || inWeex) && typeof console !== 'undefined') { 28479 console.error(err); 28480 } else { 28481 throw err 28482 } 28483} 28484 28485/* */ 28486/* globals MessageChannel */ 28487 28488var callbacks = []; 28489var pending = false; 28490 28491function flushCallbacks () { 28492 pending = false; 28493 var copies = callbacks.slice(0); 28494 callbacks.length = 0; 28495 for (var i = 0; i < copies.length; i++) { 28496 copies[i](); 28497 } 28498} 28499 28500// Here we have async deferring wrappers using both microtasks and (macro) tasks. 28501// In < 2.4 we used microtasks everywhere, but there are some scenarios where 28502// microtasks have too high a priority and fire in between supposedly 28503// sequential events (e.g. #4521, #6690) or even between bubbling of the same 28504// event (#6566). However, using (macro) tasks everywhere also has subtle problems 28505// when state is changed right before repaint (e.g. #6813, out-in transitions). 28506// Here we use microtask by default, but expose a way to force (macro) task when 28507// needed (e.g. in event handlers attached by v-on). 28508var microTimerFunc; 28509var macroTimerFunc; 28510var useMacroTask = false; 28511 28512// Determine (macro) task defer implementation. 28513// Technically setImmediate should be the ideal choice, but it's only available 28514// in IE. The only polyfill that consistently queues the callback after all DOM 28515// events triggered in the same loop is by using MessageChannel. 28516/* istanbul ignore if */ 28517if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { 28518 macroTimerFunc = function () { 28519 setImmediate(flushCallbacks); 28520 }; 28521} else if (typeof MessageChannel !== 'undefined' && ( 28522 isNative(MessageChannel) || 28523 // PhantomJS 28524 MessageChannel.toString() === '[object MessageChannelConstructor]' 28525)) { 28526 var channel = new MessageChannel(); 28527 var port = channel.port2; 28528 channel.port1.onmessage = flushCallbacks;
28529 macroTimerFunc = function () { 28530 port.postMessage(1); 28531 }; 28532} else { 28533 /* istanbul ignore next */ 28534 macroTimerFunc = function () { 28535 setTimeout(flushCallbacks, 0); 28536 }; 28537} 28538 28539// Determine microtask defer implementation. 28540/* istanbul ignore next, $flow-disable-line */ 28541if (typeof Promise !== 'undefined' && isNative(Promise)) { 28542 var p = Promise.resolve(); 28543 microTimerFunc = function () { 28544 p.then(flushCallbacks); 28545 // in problematic UIWebViews, Promise.then doesn't completely break, but 28546 // it can get stuck in a weird state where callbacks are pushed into the 28547 // microtask queue but the queue isn't being flushed, until the browser 28548 // needs to do some other work, e.g. handle a timer. Therefore we can 28549 // "force" the microtask queue to be flushed by adding an empty timer. 28550 if (isIOS) { setTimeout(noop); } 28551 }; 28552} else { 28553 // fallback to macro 28554 microTimerFunc = macroTimerFunc; 28555} 28556 28557/** 28558 * Wrap a function so that if any code inside triggers state change, 28559 * the changes are queued using a (macro) task instead of a microtask. 28560 */ 28561function withMacroTask (fn) { 28562 return fn._withTask || (fn._withTask = function () { 28563 useMacroTask = true; 28564 var res = fn.apply(null, arguments); 28565 useMacroTask = false; 28566 return res 28567 }) 28568} 28569 28570function nextTick (cb, ctx) { 28571 var _resolve; 28572 callbacks.push(function () { 28573 if (cb) { 28574 try { 28575 cb.call(ctx); 28576 } catch (e) { 28577 handleError(e, ctx, 'nextTick'); 28578 } 28579 } else if (_resolve) { 28580 _resolve(ctx); 28581 } 28582 }); 28583 if (!pending) { 28584 pending = true; 28585 if (useMacroTask) { 28586 macroTimerFunc(); 28587 } else { 28588 microTimerFunc(); 28589 } 28590 } 28591 // $flow-disable-line 28592 if (!cb && typeof Promise !== 'undefined') { 28593 return new Promise(function (resolve) { 28594 _resolve = resolve; 28595 }) 28596 } 28597} 28598 28599/* */ 28600 28601var mark; 28602var measure; 28603 28604{ 28605 var perf = inBrowser && window.performance; 28606 /* istanbul ignore if */ 28607 if ( 28608 perf && 28609 perf.mark && 28610 perf.measure && 28611 perf.clearMarks && 28612 perf.clearMeasures 28613 ) { 28614 mark = function (tag) { return perf.mark(tag); }; 28615 measure = function (name, startTag, endTag) { 28616 perf.measure(name, startTag, endTag); 28617 perf.clearMarks(startTag); 28618 perf.clearMarks(endTag); 28619 perf.clearMeasures(name); 28620 }; 28621 } 28622} 28623 28624/* not type checking this file because flow doesn't play well with Proxy */ 28625 28626var initProxy; 28627 28628{ 28629 var allowedGlobals = makeMap( 28630 'Infinity,undefined,NaN,isFinite,isNaN,' + 28631 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + 28632 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + 28633 'require' // for Webpack/Browserify 28634 ); 28635 28636 var warnNonPresent = function (target, key) { 28637 warn( 28638 "Property or method \"" + key + "\" is not defined on the instance but " + 28639 'referenced during render. Make sure that this property is reactive, ' + 28640 'either in the data option, or for class-based components, by ' + 28641 'initializing the property. ' + 28642 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', 28643 target 28644 ); 28645 }; 28646 28647 var hasProxy = 28648 typeof Proxy !== 'undefined' && isNative(Proxy); 28649 28650 if (hasProxy) { 28651 var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); 28652 config.keyCodes = new Proxy(config.keyCodes, { 28653 set: function set (target, key, value) { 28654 if (isBuiltInModifier(key)) { 28655 warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); 28656 return false 28657 } else { 28658 target[key] = value; 28659 return true 28660 } 28661 } 28662 }); 28663 } 28664 28665 var hasHandler = { 28666 has: function has (target, key) { 28667 var has = key in target; 28668 var isAllowed = allowedGlobals(key) || key.charAt(0) === '_'; 28669 if (!has && !isAllowed) { 28670 warnNonPresent(target, key); 28671 } 28672 return has || !isAllowed 28673 } 28674 }; 28675 28676 var getHandler = { 28677 get: function get (target, key) { 28678 if (typeof key === 'string' && !(key in target)) { 28679 warnNonPresent(target, key); 28680 } 28681 return target[key] 28682 } 28683 }; 28684 28685 initProxy = function initProxy (vm) { 28686 if (hasProxy) { 28687 // determine which proxy handler to use 28688 var options = vm.$options; 28689 var handlers = options.render && options.render._withStripped 28690 ? getHandler 28691 : hasHandler; 28692 vm._renderProxy = new Proxy(vm, handlers); 28693 } else { 28694 vm._renderProxy = vm; 28695 } 28696 }; 28697} 28698 28699/* */ 28700 28701var seenObjects = new _Set(); 28702 28703/** 28704 * Recursively traverse an object to evoke all converted 28705 * getters, so that every nested property inside the object 28706 * is collected as a "deep" dependency. 28707 */ 28708function traverse (val) { 28709 _traverse(val, seenObjects); 28710 seenObjects.clear(); 28711} 28712 28713function _traverse (val, seen) { 28714 var i, keys; 28715 var isA = Array.isArray(val); 28716 if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) { 28717 return 28718 } 28719 if (val.__ob__) { 28720 var depId = val.__ob__.dep.id; 28721 if (seen.has(depId)) { 28722 return 28723 } 28724 seen.add(depId); 28725 } 28726 if (isA) { 28727 i = val.length; 28728 while (i--) { _traverse(val[i], seen); } 28729 } else { 28730 keys = Object.keys(val); 28731 i = keys.length; 28732 while (i--) { _traverse(val[keys[i]], seen); } 28733 } 28734} 28735 28736/* */ 28737 28738var normalizeEvent = cached(function (name) { 28739 var passive = name.charAt(0) === '&'; 28740 name = passive ? name.slice(1) : name; 28741 var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first 28742 name = once$$1 ? name.slice(1) : name; 28743 var capture = name.charAt(0) === '!'; 28744 name = capture ? name.slice(1) : name; 28745 return { 28746 name: name, 28747 once: once$$1, 28748 capture: capture, 28749 passive: passive 28750 } 28751}); 28752 28753function createFnInvoker (fns) { 28754 function invoker () { 28755 var arguments$1 = arguments; 28756 28757 var fns = invoker.fns; 28758 if (Array.isArray(fns)) { 28759 var cloned = fns.slice(); 28760 for (var i = 0; i < cloned.length; i++) { 28761 cloned[i].apply(null, arguments$1); 28762 } 28763 } else { 28764 // return handler return value for single handlers 28765 return fns.apply(null, arguments) 28766 } 28767 } 28768 invoker.fns = fns; 28769 return invoker 28770} 28771 28772function updateListeners ( 28773 on, 28774 oldOn, 28775 add, 28776 remove$$1, 28777 vm 28778) { 28779 var name, def, cur, old, event; 28780 for (name in on) { 28781 def = cur = on[name]; 28782 old = oldOn[name]; 28783 event = normalizeEvent(name); 28784 /* istanbul ignore if */ 28785 if (isUndef(cur)) { 28786 "development" !== 'production' && warn( 28787 "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), 28788 vm 28789 ); 28790 } else if (isUndef(old)) { 28791 if (isUndef(cur.fns)) { 28792 cur = on[name] = createFnInvoker(cur); 28793 } 28794 add(event.name, cur, event.once, event.capture, event.passive, event.params); 28795 } else if (cur !== old) { 28796 old.fns = cur; 28797 on[name] = old; 28798 } 28799 } 28800 for (name in oldOn) { 28801 if (isUndef(on[name])) { 28802 event = normalizeEvent(name); 28803 remove$$1(event.name, oldOn[name], event.capture); 28804 } 28805 } 28806} 28807 28808/* */ 28809 28810function mergeVNodeHook (def, hookKey, hook) { 28811 if (def instanceof VNode) { 28812 def = def.data.hook || (def.data.hook = {}); 28813 } 28814 var invoker; 28815 var oldHook = def[hookKey]; 28816 28817 function wrappedHook () { 28818 hook.apply(this, arguments); 28819 // important: remove merged hook to ensure it's called only once 28820 // and prevent memory leak 28821 remove(invoker.fns, wrappedHook); 28822 } 28823 28824 if (isUndef(oldHook)) { 28825 // no existing hook 28826 invoker = createFnInvoker([wrappedHook]); 28827 } else { 28828 /* istanbul ignore if */ 28829 if (isDef(oldHook.fns) && isTrue(oldHook.merged)) { 28830 // already a merged invoker 28831 invoker = oldHook; 28832 invoker.fns.push(wrappedHook); 28833 } else { 28834 // existing plain hook 28835 invoker = createFnInvoker([oldHook, wrappedHook]); 28836 } 28837 } 28838 28839 invoker.merged = true; 28840 def[hookKey] = invoker; 28841} 28842 28843/* */ 28844 28845function extractPropsFromVNodeData ( 28846 data, 28847 Ctor, 28848 tag 28849) { 28850 // we are only extracting raw values here. 28851 // validation and default values are handled in the child 28852 // component itself. 28853 var propOptions = Ctor.options.props; 28854 if (isUndef(propOptions)) { 28855 return 28856 } 28857 var res = {}; 28858 var attrs = data.attrs; 28859 var props = data.props; 28860 if (isDef(attrs) || isDef(props)) { 28861 for (var key in propOptions) { 28862 var altKey = hyphenate(key); 28863 { 28864 var keyInLowerCase = key.toLowerCase(); 28865 if ( 28866 key !== keyInLowerCase && 28867 attrs && hasOwn(attrs, keyInLowerCase) 28868 ) { 28869 tip( 28870 "Prop \"" + keyInLowerCase + "\" is passed to component " + 28871 (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + 28872 " \"" + key + "\". " + 28873 "Note that HTML attributes are case-insensitive and camelCased " + 28874 "props need to use their kebab-case equivalents when using in-DOM " + 28875 "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." 28876 ); 28877 } 28878 } 28879 checkProp(res, props, key, altKey, true) || 28880 checkProp(res, attrs, key, altKey, false); 28881 } 28882 } 28883 return res 28884} 28885 28886function checkProp ( 28887 res, 28888 hash, 28889 key, 28890 altKey, 28891 preserve 28892) {
vendor: 5,221 bytes, lines 28893-29077
28893 if (isDef(hash)) { 28894 if (hasOwn(hash, key)) { 28895 res[key] = hash[key]; 28896 if (!preserve) { 28897 delete hash[key]; 28898 } 28899 return true 28900 } else if (hasOwn(hash, altKey)) { 28901 res[key] = hash[altKey]; 28902 if (!preserve) { 28903 delete hash[altKey]; 28904 } 28905 return true 28906 } 28907 } 28908 return false 28909} 28910 28911/* */ 28912 28913// The template compiler attempts to minimize the need for normalization by 28914// statically analyzing the template at compile time. 28915// 28916// For plain HTML markup, normalization can be completely skipped because the 28917// generated render function is guaranteed to return Array<VNode>. There are 28918// two cases where extra normalization is needed: 28919 28920// 1. When the children contains components - because a functional component 28921// may return an Array instead of a single root. In this case, just a simple 28922// normalization is needed - if any child is an Array, we flatten the whole 28923// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep 28924// because functional components already normalize their own children. 28925function simpleNormalizeChildren (children) { 28926 for (var i = 0; i < children.length; i++) { 28927 if (Array.isArray(children[i])) { 28928 return Array.prototype.concat.apply([], children) 28929 } 28930 } 28931 return children 28932} 28933 28934// 2. When the children contains constructs that always generated nested Arrays, 28935// e.g. <template>, <slot>, v-for, or when the children is provided by user 28936// with hand-written render functions / JSX. In such cases a full normalization 28937// is needed to cater to all possible types of children values. 28938function normalizeChildren (children) { 28939 return isPrimitive(children) 28940 ? [createTextVNode(children)] 28941 : Array.isArray(children) 28942 ? normalizeArrayChildren(children) 28943 : undefined 28944} 28945 28946function isTextNode (node) { 28947 return isDef(node) && isDef(node.text) && isFalse(node.isComment) 28948} 28949 28950function normalizeArrayChildren (children, nestedIndex) { 28951 var res = []; 28952 var i, c, lastIndex, last; 28953 for (i = 0; i < children.length; i++) { 28954 c = children[i]; 28955 if (isUndef(c) || typeof c === 'boolean') { continue } 28956 lastIndex = res.length - 1; 28957 last = res[lastIndex]; 28958 // nested 28959 if (Array.isArray(c)) { 28960 if (c.length > 0) { 28961 c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)); 28962 // merge adjacent text nodes 28963 if (isTextNode(c[0]) && isTextNode(last)) { 28964 res[lastIndex] = createTextVNode(last.text + (c[0]).text); 28965 c.shift(); 28966 } 28967 res.push.apply(res, c); 28968 } 28969 } else if (isPrimitive(c)) { 28970 if (isTextNode(last)) { 28971 // merge adjacent text nodes 28972 // this is necessary for SSR hydration because text nodes are 28973 // essentially merged when rendered to HTML strings 28974 res[lastIndex] = createTextVNode(last.text + c); 28975 } else if (c !== '') { 28976 // convert primitive to vnode 28977 res.push(createTextVNode(c)); 28978 } 28979 } else { 28980 if (isTextNode(c) && isTextNode(last)) { 28981 // merge adjacent text nodes 28982 res[lastIndex] = createTextVNode(last.text + c.text); 28983 } else { 28984 // default key for nested array children (likely generated by v-for) 28985 if (isTrue(children._isVList) && 28986 isDef(c.tag) && 28987 isUndef(c.key) && 28988 isDef(nestedIndex)) { 28989 c.key = "__vlist" + nestedIndex + "_" + i + "__"; 28990 } 28991 res.push(c); 28992 } 28993 } 28994 } 28995 return res 28996} 28997 28998/* */ 28999 29000function ensureCtor (comp, base) { 29001 if ( 29002 comp.__esModule || 29003 (hasSymbol && comp[Symbol.toStringTag] === 'Module') 29004 ) { 29005 comp = comp.default; 29006 } 29007 return isObject(comp) 29008 ? base.extend(comp) 29009 : comp 29010} 29011 29012function createAsyncPlaceholder ( 29013 factory, 29014 data, 29015 context, 29016 children, 29017 tag 29018) { 29019 var node = createEmptyVNode(); 29020 node.asyncFactory = factory; 29021 node.asyncMeta = { data: data, context: context, children: children, tag: tag }; 29022 return node 29023} 29024 29025function resolveAsyncComponent ( 29026 factory, 29027 baseCtor, 29028 context 29029) { 29030 if (isTrue(factory.error) && isDef(factory.errorComp)) { 29031 return factory.errorComp 29032 } 29033 29034 if (isDef(factory.resolved)) { 29035 return factory.resolved 29036 } 29037 29038 if (isTrue(factory.loading) && isDef(factory.loadingComp)) { 29039 return factory.loadingComp 29040 } 29041 29042 if (isDef(factory.contexts)) { 29043 // already pending 29044 factory.contexts.push(context); 29045 } else { 29046 var contexts = factory.contexts = [context]; 29047 var sync = true; 29048 29049 var forceRender = function () { 29050 for (var i = 0, l = contexts.length; i < l; i++) { 29051 contexts[i].$forceUpdate(); 29052 } 29053 }; 29054 29055 var resolve = once(function (res) { 29056 // cache resolved 29057 factory.resolved = ensureCtor(res, baseCtor); 29058 // invoke callbacks only if this is not a synchronous resolve 29059 // (async resolves are shimmed as synchronous during SSR) 29060 if (!sync) { 29061 forceRender(); 29062 } 29063 }); 29064 29065 var reject = once(function (reason) { 29066 "development" !== 'production' && warn( 29067 "Failed to resolve async component: " + (String(factory)) + 29068 (reason ? ("\nReason: " + reason) : '') 29069 ); 29070 if (isDef(factory.errorComp)) { 29071 factory.error = true; 29072 forceRender(); 29073 } 29074 }); 29075 29076 var res = factory(resolve, reject); 29077
29078 if (isObject(res)) { 29079 if (typeof res.then === 'function') { 29080 // () => Promise 29081 if (isUndef(factory.resolved)) { 29082 res.then(resolve, reject); 29083 } 29084 } else if (isDef(res.component) && typeof res.component.then === 'function') { 29085 res.component.then(resolve, reject); 29086 29087 if (isDef(res.error)) { 29088 factory.errorComp = ensureCtor(res.error, baseCtor); 29089 } 29090 29091 if (isDef(res.loading)) { 29092 factory.loadingComp = ensureCtor(res.loading, baseCtor); 29093 if (res.delay === 0) { 29094 factory.loading = true; 29095 } else { 29096 setTimeout(function () { 29097 if (isUndef(factory.resolved) && isUndef(factory.error)) { 29098 factory.loading = true; 29099 forceRender(); 29100 } 29101 }, res.delay || 200); 29102 } 29103 } 29104 29105 if (isDef(res.timeout)) { 29106 setTimeout(function () { 29107 if (isUndef(factory.resolved)) { 29108 reject( 29109 "timeout (" + (res.timeout) + "ms)" 29110 ); 29111 } 29112 }, res.timeout); 29113 } 29114 } 29115 } 29116 29117 sync = false; 29118 // return in case resolved synchronously 29119 return factory.loading 29120 ? factory.loadingComp 29121 : factory.resolved 29122 } 29123} 29124 29125/* */ 29126 29127function isAsyncPlaceholder (node) { 29128 return node.isComment && node.asyncFactory 29129} 29130 29131/* */ 29132 29133function getFirstComponentChild (children) { 29134 if (Array.isArray(children)) { 29135 for (var i = 0; i < children.length; i++) { 29136 var c = children[i]; 29137 if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) { 29138 return c 29139 } 29140 } 29141 } 29142} 29143 29144/* */ 29145 29146/* */ 29147 29148function initEvents (vm) { 29149 vm._events = Object.create(null); 29150 vm._hasHookEvent = false; 29151 // init parent attached events 29152 var listeners = vm.$options._parentListeners; 29153 if (listeners) { 29154 updateComponentListeners(vm, listeners); 29155 } 29156} 29157 29158var target; 29159 29160function add (event, fn, once) { 29161 if (once) { 29162 target.$once(event, fn); 29163 } else { 29164 target.$on(event, fn); 29165 } 29166} 29167 29168function remove$1 (event, fn) { 29169 target.$off(event, fn); 29170} 29171 29172function updateComponentListeners ( 29173 vm, 29174 listeners, 29175 oldListeners 29176) { 29177 target = vm; 29178 updateListeners(listeners, oldListeners || {}, add, remove$1, vm); 29179 target = undefined; 29180} 29181 29182function eventsMixin (Vue) { 29183 var hookRE = /^hook:/; 29184 Vue.prototype.$on = function (event, fn) { 29185 var this$1 = this; 29186 29187 var vm = this; 29188 if (Array.isArray(event)) { 29189 for (var i = 0, l = event.length; i < l; i++) { 29190 this$1.$on(event[i], fn); 29191 } 29192 } else { 29193 (vm._events[event] || (vm._events[event] = [])).push(fn); 29194 // optimize hook:event cost by using a boolean flag marked at registration 29195 // instead of a hash lookup 29196 if (hookRE.test(event)) { 29197 vm._hasHookEvent = true; 29198 } 29199 } 29200 return vm 29201 }; 29202 29203 Vue.prototype.$once = function (event, fn) { 29204 var vm = this; 29205 function on () { 29206 vm.$off(event, on); 29207 fn.apply(vm, arguments); 29208 } 29209 on.fn = fn; 29210 vm.$on(event, on); 29211 return vm 29212 }; 29213 29214 Vue.prototype.$off = function (event, fn) { 29215 var this$1 = this; 29216 29217 var vm = this; 29218 // all 29219 if (!arguments.length) { 29220 vm._events = Object.create(null); 29221 return vm 29222 } 29223 // array of events 29224 if (Array.isArray(event)) { 29225 for (var i = 0, l = event.length; i < l; i++) { 29226 this$1.$off(event[i], fn); 29227 } 29228 return vm 29229 } 29230 // specific event 29231 var cbs = vm._events[event]; 29232 if (!cbs) { 29233 return vm 29234 } 29235 if (!fn) { 29236 vm._events[event] = null; 29237 return vm 29238 } 29239 if (fn) { 29240 // specific handler 29241 var cb; 29242 var i$1 = cbs.length; 29243 while (i$1--) { 29244 cb = cbs[i$1]; 29245 if (cb === fn || cb.fn === fn) { 29246 cbs.splice(i$1, 1); 29247 break 29248 } 29249 } 29250 } 29251 return vm 29252 }; 29253 29254 Vue.prototype.$emit = function (event) { 29255 var vm = this; 29256 { 29257 var lowerCaseEvent = event.toLowerCase(); 29258 if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) { 29259 tip( 29260 "Event \"" + lowerCaseEvent + "\" is emitted in component " + 29261 (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
29262 "Note that HTML attributes are case-insensitive and you cannot use " + 29263 "v-on to listen to camelCase events when using in-DOM templates. " + 29264 "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"." 29265 ); 29266 } 29267 } 29268 var cbs = vm._events[event]; 29269 if (cbs) { 29270 cbs = cbs.length > 1 ? toArray(cbs) : cbs; 29271 var args = toArray(arguments, 1); 29272 for (var i = 0, l = cbs.length; i < l; i++) { 29273 try { 29274 cbs[i].apply(vm, args); 29275 } catch (e) { 29276 handleError(e, vm, ("event handler for \"" + event + "\"")); 29277 } 29278 } 29279 } 29280 return vm 29281 }; 29282} 29283 29284/* */ 29285 29286 29287 29288/** 29289 * Runtime helper for resolving raw children VNodes into a slot object. 29290 */ 29291function resolveSlots ( 29292 children, 29293 context 29294) { 29295 var slots = {}; 29296 if (!children) { 29297 return slots 29298 } 29299 for (var i = 0, l = children.length; i < l; i++) { 29300 var child = children[i]; 29301 var data = child.data; 29302 // remove slot attribute if the node is resolved as a Vue slot node 29303 if (data && data.attrs && data.attrs.slot) { 29304 delete data.attrs.slot; 29305 } 29306 // named slots should only be respected if the vnode was rendered in the 29307 // same context. 29308 if ((child.context === context || child.fnContext === context) && 29309 data && data.slot != null 29310 ) { 29311 var name = data.slot; 29312 var slot = (slots[name] || (slots[name] = [])); 29313 if (child.tag === 'template') { 29314 slot.push.apply(slot, child.children || []); 29315 } else { 29316 slot.push(child); 29317 } 29318 } else { 29319 (slots.default || (slots.default = [])).push(child); 29320 } 29321 } 29322 // ignore slots that contains only whitespace 29323 for (var name$1 in slots) { 29324 if (slots[name$1].every(isWhitespace)) { 29325 delete slots[name$1]; 29326 } 29327 } 29328 return slots 29329} 29330 29331function isWhitespace (node) { 29332 return (node.isComment && !node.asyncFactory) || node.text === ' ' 29333} 29334 29335function resolveScopedSlots ( 29336 fns, // see flow/vnode 29337 res 29338) { 29339 res = res || {}; 29340 for (var i = 0; i < fns.length; i++) { 29341 if (Array.isArray(fns[i])) { 29342 resolveScopedSlots(fns[i], res); 29343 } else { 29344 res[fns[i].key] = fns[i].fn; 29345 } 29346 } 29347 return res 29348} 29349 29350/* */ 29351 29352var activeInstance = null; 29353var isUpdatingChildComponent = false; 29354 29355function initLifecycle (vm) { 29356 var options = vm.$options; 29357 29358 // locate first non-abstract parent 29359 var parent = options.parent; 29360 if (parent && !options.abstract) { 29361 while (parent.$options.abstract && parent.$parent) { 29362 parent = parent.$parent; 29363 } 29364 parent.$children.push(vm); 29365 } 29366 29367 vm.$parent = parent; 29368 vm.$root = parent ? parent.$root : vm; 29369 29370 vm.$children = []; 29371 vm.$refs = {}; 29372 29373 vm._watcher = null; 29374 vm._inactive = null; 29375 vm._directInactive = false; 29376 vm._isMounted = false; 29377 vm._isDestroyed = false; 29378 vm._isBeingDestroyed = false; 29379} 29380 29381function lifecycleMixin (Vue) { 29382 Vue.prototype._update = function (vnode, hydrating) { 29383 var vm = this; 29384 if (vm._isMounted) { 29385 callHook(vm, 'beforeUpdate'); 29386 } 29387 var prevEl = vm.$el; 29388 var prevVnode = vm._vnode; 29389 var prevActiveInstance = activeInstance; 29390 activeInstance = vm; 29391 vm._vnode = vnode; 29392 // Vue.prototype.__patch__ is injected in entry points 29393 // based on the rendering backend used. 29394 if (!prevVnode) { 29395 // initial render 29396 vm.$el = vm.__patch__( 29397 vm.$el, vnode, hydrating, false /* removeOnly */, 29398 vm.$options._parentElm, 29399 vm.$options._refElm 29400 ); 29401 // no need for the ref nodes after initial patch 29402 // this prevents keeping a detached DOM tree in memory (#5851) 29403 vm.$options._parentElm = vm.$options._refElm = null; 29404 } else { 29405 // updates 29406 vm.$el = vm.__patch__(prevVnode, vnode); 29407 } 29408 activeInstance = prevActiveInstance; 29409 // update __vue__ reference 29410 if (prevEl) { 29411 prevEl.__vue__ = null; 29412 } 29413 if (vm.$el) { 29414 vm.$el.__vue__ = vm; 29415 } 29416 // if parent is an HOC, update its $el as well 29417 if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) { 29418 vm.$parent.$el = vm.$el; 29419 } 29420 // updated hook is called by the scheduler to ensure that children are 29421 // updated in a parent's updated hook. 29422 }; 29423 29424 Vue.prototype.$forceUpdate = function () { 29425 var vm = this; 29426 if (vm._watcher) {
29427 vm._watcher.update(); 29428 } 29429 }; 29430 29431 Vue.prototype.$destroy = function () { 29432 var vm = this; 29433 if (vm._isBeingDestroyed) { 29434 return 29435 } 29436 callHook(vm, 'beforeDestroy'); 29437 vm._isBeingDestroyed = true; 29438 // remove self from parent 29439 var parent = vm.$parent; 29440 if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) { 29441 remove(parent.$children, vm); 29442 } 29443 // teardown watchers 29444 if (vm._watcher) { 29445 vm._watcher.teardown(); 29446 } 29447 var i = vm._watchers.length; 29448 while (i--) { 29449 vm._watchers[i].teardown(); 29450 } 29451 // remove reference from data ob 29452 // frozen object may not have observer. 29453 if (vm._data.__ob__) { 29454 vm._data.__ob__.vmCount--; 29455 } 29456 // call the last hook... 29457 vm._isDestroyed = true; 29458 // invoke destroy hooks on current rendered tree 29459 vm.__patch__(vm._vnode, null); 29460 // fire destroyed hook 29461 callHook(vm, 'destroyed'); 29462 // turn off all instance listeners. 29463 vm.$off(); 29464 // remove __vue__ reference 29465 if (vm.$el) { 29466 vm.$el.__vue__ = null; 29467 } 29468 // release circular reference (#6759) 29469 if (vm.$vnode) { 29470 vm.$vnode.parent = null; 29471 } 29472 }; 29473} 29474 29475function mountComponent ( 29476 vm, 29477 el, 29478 hydrating 29479) { 29480 vm.$el = el; 29481 if (!vm.$options.render) { 29482 vm.$options.render = createEmptyVNode; 29483 { 29484 /* istanbul ignore if */ 29485 if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || 29486 vm.$options.el || el) { 29487 warn( 29488 'You are using the runtime-only build of Vue where the template ' + 29489 'compiler is not available. Either pre-compile the templates into ' + 29490 'render functions, or use the compiler-included build.', 29491 vm 29492 ); 29493 } else { 29494 warn( 29495 'Failed to mount component: template or render function not defined.', 29496 vm 29497 ); 29498 } 29499 } 29500 } 29501 callHook(vm, 'beforeMount'); 29502 29503 var updateComponent; 29504 /* istanbul ignore if */ 29505 if ("development" !== 'production' && config.performance && mark) { 29506 updateComponent = function () { 29507 var name = vm._name; 29508 var id = vm._uid; 29509 var startTag = "vue-perf-start:" + id; 29510 var endTag = "vue-perf-end:" + id; 29511 29512 mark(startTag); 29513 var vnode = vm._render(); 29514 mark(endTag); 29515 measure(("vue " + name + " render"), startTag, endTag); 29516 29517 mark(startTag); 29518 vm._update(vnode, hydrating); 29519 mark(endTag); 29520 measure(("vue " + name + " patch"), startTag, endTag); 29521 }; 29522 } else { 29523 updateComponent = function () { 29524 vm._update(vm._render(), hydrating); 29525 }; 29526 } 29527 29528 // we set this to vm._watcher inside the watcher's constructor 29529 // since the watcher's initial patch may call $forceUpdate (e.g. inside child 29530 // component's mounted hook), which relies on vm._watcher being already defined 29531 new Watcher(vm, updateComponent, noop, null, true /* isRenderWatcher */); 29532 hydrating = false; 29533 29534 // manually mounted instance, call mounted on self 29535 // mounted is called for render-created child components in its inserted hook 29536 if (vm.$vnode == null) { 29537 vm._isMounted = true; 29538 callHook(vm, 'mounted'); 29539 } 29540 return vm 29541} 29542 29543function updateChildComponent ( 29544 vm, 29545 propsData, 29546 listeners, 29547 parentVnode, 29548 renderChildren 29549) { 29550 { 29551 isUpdatingChildComponent = true; 29552 } 29553 29554 // determine whether component has slot children 29555 // we need to do this before overwriting $options._renderChildren 29556 var hasChildren = !!( 29557 renderChildren || // has new static slots 29558 vm.$options._renderChildren || // has old static slots 29559 parentVnode.data.scopedSlots || // has new scoped slots 29560 vm.$scopedSlots !== emptyObject // has old scoped slots 29561 ); 29562 29563 vm.$options._parentVnode = parentVnode; 29564 vm.$vnode = parentVnode; // update vm's placeholder node without re-render 29565 29566 if (vm._vnode) { // update child tree's parent 29567 vm._vnode.parent = parentVnode; 29568 } 29569 vm.$options._renderChildren = renderChildren; 29570 29571 // update $attrs and $listeners hash 29572 // these are also reactive so they may trigger child update if the child 29573 // used them during render 29574 vm.$attrs = parentVnode.data.attrs || emptyObject; 29575 vm.$listeners = listeners || emptyObject; 29576 29577 // update props 29578 if (propsData && vm.$options.props) { 29579 toggleObserving(false); 29580 var props = vm._props; 29581 var propKeys = vm.$options._propKeys || []; 29582 for (var i = 0; i < propKeys.length; i++) { 29583 var key = propKeys[i]; 29584 var propOptions = vm.$options.props; // wtf flow? 29585 props[key] = validateProp(key, propOptions, propsData, vm); 29586 } 29587 toggleObserving(true); 29588 // keep a copy of raw propsData 29589 vm.$options.propsData = propsData; 29590 } 29591 29592 // update listeners 29593 listeners = listeners || emptyObject; 29594 var oldListeners = vm.$options._parentListeners; 29595 vm.$options._parentListeners = listeners; 29596 updateComponentListeners(vm, listeners, oldListeners); 29597 29598 // resolve slots + force update if has children 29599 if (hasChildren) { 29600 vm.$slots = resolveSlots(renderChildren, parentVnode.context); 29601 vm.$forceUpdate(); 29602 } 29603 29604 { 29605 isUpdatingChildComponent = false;
vendor: 8,929 bytes, lines 29606-29984
29606 } 29607} 29608 29609function isInInactiveTree (vm) { 29610 while (vm && (vm = vm.$parent)) { 29611 if (vm._inactive) { return true } 29612 } 29613 return false 29614} 29615 29616function activateChildComponent (vm, direct) { 29617 if (direct) { 29618 vm._directInactive = false; 29619 if (isInInactiveTree(vm)) { 29620 return 29621 } 29622 } else if (vm._directInactive) { 29623 return 29624 } 29625 if (vm._inactive || vm._inactive === null) { 29626 vm._inactive = false; 29627 for (var i = 0; i < vm.$children.length; i++) { 29628 activateChildComponent(vm.$children[i]); 29629 } 29630 callHook(vm, 'activated'); 29631 } 29632} 29633 29634function deactivateChildComponent (vm, direct) { 29635 if (direct) { 29636 vm._directInactive = true; 29637 if (isInInactiveTree(vm)) { 29638 return 29639 } 29640 } 29641 if (!vm._inactive) { 29642 vm._inactive = true; 29643 for (var i = 0; i < vm.$children.length; i++) { 29644 deactivateChildComponent(vm.$children[i]); 29645 } 29646 callHook(vm, 'deactivated'); 29647 } 29648} 29649 29650function callHook (vm, hook) { 29651 // #7573 disable dep collection when invoking lifecycle hooks 29652 pushTarget(); 29653 var handlers = vm.$options[hook]; 29654 if (handlers) { 29655 for (var i = 0, j = handlers.length; i < j; i++) { 29656 try { 29657 handlers[i].call(vm); 29658 } catch (e) { 29659 handleError(e, vm, (hook + " hook")); 29660 } 29661 } 29662 } 29663 if (vm._hasHookEvent) { 29664 vm.$emit('hook:' + hook); 29665 } 29666 popTarget(); 29667} 29668 29669/* */ 29670 29671 29672var MAX_UPDATE_COUNT = 100; 29673 29674var queue = []; 29675var activatedChildren = []; 29676var has = {}; 29677var circular = {}; 29678var waiting = false; 29679var flushing = false; 29680var index = 0; 29681 29682/** 29683 * Reset the scheduler's state. 29684 */ 29685function resetSchedulerState () { 29686 index = queue.length = activatedChildren.length = 0; 29687 has = {}; 29688 { 29689 circular = {}; 29690 } 29691 waiting = flushing = false; 29692} 29693 29694/** 29695 * Flush both queues and run the watchers. 29696 */ 29697function flushSchedulerQueue () { 29698 flushing = true; 29699 var watcher, id; 29700 29701 // Sort queue before flush. 29702 // This ensures that: 29703 // 1. Components are updated from parent to child. (because parent is always 29704 // created before the child) 29705 // 2. A component's user watchers are run before its render watcher (because 29706 // user watchers are created before the render watcher) 29707 // 3. If a component is destroyed during a parent component's watcher run, 29708 // its watchers can be skipped. 29709 queue.sort(function (a, b) { return a.id - b.id; }); 29710 29711 // do not cache length because more watchers might be pushed 29712 // as we run existing watchers 29713 for (index = 0; index < queue.length; index++) { 29714 watcher = queue[index]; 29715 id = watcher.id; 29716 has[id] = null; 29717 watcher.run(); 29718 // in dev build, check and stop circular updates. 29719 if ("development" !== 'production' && has[id] != null) { 29720 circular[id] = (circular[id] || 0) + 1; 29721 if (circular[id] > MAX_UPDATE_COUNT) { 29722 warn( 29723 'You may have an infinite update loop ' + ( 29724 watcher.user 29725 ? ("in watcher with expression \"" + (watcher.expression) + "\"") 29726 : "in a component render function." 29727 ), 29728 watcher.vm 29729 ); 29730 break 29731 } 29732 } 29733 } 29734 29735 // keep copies of post queues before resetting state 29736 var activatedQueue = activatedChildren.slice(); 29737 var updatedQueue = queue.slice(); 29738 29739 resetSchedulerState(); 29740 29741 // call component updated and activated hooks 29742 callActivatedHooks(activatedQueue); 29743 callUpdatedHooks(updatedQueue); 29744 29745 // devtool hook 29746 /* istanbul ignore if */ 29747 if (devtools && config.devtools) { 29748 devtools.emit('flush'); 29749 } 29750} 29751 29752function callUpdatedHooks (queue) { 29753 var i = queue.length; 29754 while (i--) { 29755 var watcher = queue[i]; 29756 var vm = watcher.vm; 29757 if (vm._watcher === watcher && vm._isMounted) { 29758 callHook(vm, 'updated'); 29759 } 29760 } 29761} 29762 29763/** 29764 * Queue a kept-alive component that was activated during patch. 29765 * The queue will be processed after the entire tree has been patched. 29766 */ 29767function queueActivatedComponent (vm) { 29768 // setting _inactive to false here so that a render function can 29769 // rely on checking whether it's in an inactive tree (e.g. router-view) 29770 vm._inactive = false; 29771 activatedChildren.push(vm); 29772} 29773 29774function callActivatedHooks (queue) { 29775 for (var i = 0; i < queue.length; i++) { 29776 queue[i]._inactive = true; 29777 activateChildComponent(queue[i], true /* true */); 29778 } 29779} 29780 29781/** 29782 * Push a watcher into the watcher queue. 29783 * Jobs with duplicate IDs will be skipped unless it's 29784 * pushed when the queue is being flushed. 29785 */ 29786function queueWatcher (watcher) { 29787 var id = watcher.id; 29788 if (has[id] == null) { 29789 has[id] = true; 29790 if (!flushing) { 29791 queue.push(watcher); 29792 } else { 29793 // if already flushing, splice the watcher based on its id 29794 // if already past its id, it will be run next immediately. 29795 var i = queue.length - 1; 29796 while (i > index && queue[i].id > watcher.id) { 29797 i--; 29798 } 29799 queue.splice(i + 1, 0, watcher); 29800 } 29801 // queue the flush 29802 if (!waiting) { 29803 waiting = true; 29804 nextTick(flushSchedulerQueue); 29805 } 29806 } 29807} 29808 29809/* */ 29810 29811var uid$1 = 0; 29812 29813/** 29814 * A watcher parses an expression, collects dependencies, 29815 * and fires callback when the expression value changes. 29816 * This is used for both the $watch() api and directives. 29817 */ 29818var Watcher = function Watcher ( 29819 vm, 29820 expOrFn, 29821 cb, 29822 options, 29823 isRenderWatcher 29824) { 29825 this.vm = vm; 29826 if (isRenderWatcher) { 29827 vm._watcher = this; 29828 } 29829 vm._watchers.push(this); 29830 // options 29831 if (options) { 29832 this.deep = !!options.deep; 29833 this.user = !!options.user; 29834 this.lazy = !!options.lazy; 29835 this.sync = !!options.sync; 29836 } else { 29837 this.deep = this.user = this.lazy = this.sync = false; 29838 } 29839 this.cb = cb; 29840 this.id = ++uid$1; // uid for batching 29841 this.active = true; 29842 this.dirty = this.lazy; // for lazy watchers 29843 this.deps = []; 29844 this.newDeps = []; 29845 this.depIds = new _Set(); 29846 this.newDepIds = new _Set(); 29847 this.expression = expOrFn.toString(); 29848 // parse expression for getter 29849 if (typeof expOrFn === 'function') { 29850 this.getter = expOrFn; 29851 } else { 29852 this.getter = parsePath(expOrFn); 29853 if (!this.getter) { 29854 this.getter = function () {}; 29855 "development" !== 'production' && warn( 29856 "Failed watching path: \"" + expOrFn + "\" " + 29857 'Watcher only accepts simple dot-delimited paths. ' + 29858 'For full control, use a function instead.', 29859 vm 29860 ); 29861 } 29862 } 29863 this.value = this.lazy 29864 ? undefined 29865 : this.get(); 29866}; 29867 29868/** 29869 * Evaluate the getter, and re-collect dependencies. 29870 */ 29871Watcher.prototype.get = function get () { 29872 pushTarget(this); 29873 var value; 29874 var vm = this.vm; 29875 try { 29876 value = this.getter.call(vm, vm); 29877 } catch (e) { 29878 if (this.user) { 29879 handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\"")); 29880 } else { 29881 throw e 29882 } 29883 } finally { 29884 // "touch" every property so they are all tracked as 29885 // dependencies for deep watching 29886 if (this.deep) { 29887 traverse(value); 29888 } 29889 popTarget(); 29890 this.cleanupDeps(); 29891 } 29892 return value 29893}; 29894 29895/** 29896 * Add a dependency to this directive. 29897 */ 29898Watcher.prototype.addDep = function addDep (dep) { 29899 var id = dep.id; 29900 if (!this.newDepIds.has(id)) { 29901 this.newDepIds.add(id); 29902 this.newDeps.push(dep); 29903 if (!this.depIds.has(id)) { 29904 dep.addSub(this); 29905 } 29906 } 29907}; 29908 29909/** 29910 * Clean up for dependency collection. 29911 */ 29912Watcher.prototype.cleanupDeps = function cleanupDeps () { 29913 var this$1 = this; 29914 29915 var i = this.deps.length; 29916 while (i--) { 29917 var dep = this$1.deps[i]; 29918 if (!this$1.newDepIds.has(dep.id)) { 29919 dep.removeSub(this$1); 29920 } 29921 } 29922 var tmp = this.depIds; 29923 this.depIds = this.newDepIds; 29924 this.newDepIds = tmp; 29925 this.newDepIds.clear(); 29926 tmp = this.deps; 29927 this.deps = this.newDeps; 29928 this.newDeps = tmp; 29929 this.newDeps.length = 0; 29930}; 29931 29932/** 29933 * Subscriber interface. 29934 * Will be called when a dependency changes. 29935 */ 29936Watcher.prototype.update = function update () { 29937 /* istanbul ignore else */ 29938 if (this.lazy) { 29939 this.dirty = true; 29940 } else if (this.sync) { 29941 this.run(); 29942 } else { 29943 queueWatcher(this); 29944 } 29945}; 29946 29947/** 29948 * Scheduler job interface. 29949 * Will be called by the scheduler. 29950 */ 29951Watcher.prototype.run = function run () { 29952 if (this.active) { 29953 var value = this.get(); 29954 if ( 29955 value !== this.value || 29956 // Deep watchers and watchers on Object/Arrays should fire even 29957 // when the value is the same, because the value may 29958 // have mutated. 29959 isObject(value) || 29960 this.deep 29961 ) { 29962 // set new value 29963 var oldValue = this.value; 29964 this.value = value; 29965 if (this.user) { 29966 try { 29967 this.cb.call(this.vm, value, oldValue); 29968 } catch (e) { 29969 handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\"")); 29970 } 29971 } else { 29972 this.cb.call(this.vm, value, oldValue); 29973 } 29974 } 29975 } 29976}; 29977 29978/** 29979 * Evaluate the value of the watcher. 29980 * This only gets called for lazy watchers. 29981 */ 29982Watcher.prototype.evaluate = function evaluate () { 29983 this.value = this.get(); 29984 this.dirty = false;
29985}; 29986 29987/** 29988 * Depend on all deps collected by this watcher. 29989 */ 29990Watcher.prototype.depend = function depend () { 29991 var this$1 = this; 29992 29993 var i = this.deps.length; 29994 while (i--) { 29995 this$1.deps[i].depend(); 29996 } 29997}; 29998 29999/** 30000 * Remove self from all dependencies' subscriber list. 30001 */ 30002Watcher.prototype.teardown = function teardown () { 30003 var this$1 = this; 30004 30005 if (this.active) { 30006 // remove self from vm's watcher list 30007 // this is a somewhat expensive operation so we skip it 30008 // if the vm is being destroyed. 30009 if (!this.vm._isBeingDestroyed) { 30010 remove(this.vm._watchers, this); 30011 } 30012 var i = this.deps.length; 30013 while (i--) { 30014 this$1.deps[i].removeSub(this$1); 30015 } 30016 this.active = false; 30017 } 30018}; 30019 30020/* */ 30021 30022var sharedPropertyDefinition = { 30023 enumerable: true, 30024 configurable: true, 30025 get: noop, 30026 set: noop 30027}; 30028 30029function proxy (target, sourceKey, key) { 30030 sharedPropertyDefinition.get = function proxyGetter () { 30031 return this[sourceKey][key] 30032 }; 30033 sharedPropertyDefinition.set = function proxySetter (val) { 30034 this[sourceKey][key] = val; 30035 }; 30036 Object.defineProperty(target, key, sharedPropertyDefinition); 30037} 30038 30039function initState (vm) { 30040 vm._watchers = []; 30041 var opts = vm.$options; 30042 if (opts.props) { initProps(vm, opts.props); } 30043 if (opts.methods) { initMethods(vm, opts.methods); } 30044 if (opts.data) { 30045 initData(vm); 30046 } else { 30047 observe(vm._data = {}, true /* asRootData */); 30048 } 30049 if (opts.computed) { initComputed(vm, opts.computed); } 30050 if (opts.watch && opts.watch !== nativeWatch) { 30051 initWatch(vm, opts.watch); 30052 } 30053} 30054 30055function initProps (vm, propsOptions) { 30056 var propsData = vm.$options.propsData || {}; 30057 var props = vm._props = {}; 30058 // cache prop keys so that future props updates can iterate using Array 30059 // instead of dynamic object key enumeration. 30060 var keys = vm.$options._propKeys = []; 30061 var isRoot = !vm.$parent; 30062 // root instance props should be converted 30063 if (!isRoot) { 30064 toggleObserving(false); 30065 } 30066 var loop = function ( key ) { 30067 keys.push(key); 30068 var value = validateProp(key, propsOptions, propsData, vm); 30069 /* istanbul ignore else */ 30070 { 30071 var hyphenatedKey = hyphenate(key); 30072 if (isReservedAttribute(hyphenatedKey) || 30073 config.isReservedAttr(hyphenatedKey)) { 30074 warn( 30075 ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."), 30076 vm 30077 ); 30078 } 30079 defineReactive(props, key, value, function () { 30080 if (vm.$parent && !isUpdatingChildComponent) { 30081 warn( 30082 "Avoid mutating a prop directly since the value will be " + 30083 "overwritten whenever the parent component re-renders. " + 30084 "Instead, use a data or computed property based on the prop's " + 30085 "value. Prop being mutated: \"" + key + "\"", 30086 vm 30087 ); 30088 } 30089 }); 30090 } 30091 // static props are already proxied on the component's prototype 30092 // during Vue.extend(). We only need to proxy props defined at 30093 // instantiation here. 30094 if (!(key in vm)) { 30095 proxy(vm, "_props", key); 30096 } 30097 }; 30098 30099 for (var key in propsOptions) loop( key ); 30100 toggleObserving(true); 30101} 30102 30103function initData (vm) { 30104 var data = vm.$options.data; 30105 data = vm._data = typeof data === 'function' 30106 ? getData(data, vm) 30107 : data || {}; 30108 if (!isPlainObject(data)) { 30109 data = {}; 30110 "development" !== 'production' && warn( 30111 'data functions should return an object:\n' + 30112 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', 30113 vm 30114 ); 30115 } 30116 // proxy data on instance 30117 var keys = Object.keys(data); 30118 var props = vm.$options.props; 30119 var methods = vm.$options.methods; 30120 var i = keys.length; 30121 while (i--) { 30122 var key = keys[i]; 30123 { 30124 if (methods && hasOwn(methods, key)) { 30125 warn( 30126 ("Method \"" + key + "\" has already been defined as a data property."), 30127 vm 30128 ); 30129 } 30130 } 30131 if (props && hasOwn(props, key)) { 30132 "development" !== 'production' && warn( 30133 "The data property \"" + key + "\" is already declared as a prop. " + 30134 "Use prop default value instead.", 30135 vm 30136 ); 30137 } else if (!isReserved(key)) { 30138 proxy(vm, "_data", key); 30139 } 30140 } 30141 // observe data 30142 observe(data, true /* asRootData */); 30143} 30144 30145function getData (data, vm) { 30146 // #7573 disable dep collection when invoking data getters 30147 pushTarget(); 30148 try { 30149 return data.call(vm, vm) 30150 } catch (e) { 30151 handleError(e, vm, "data()"); 30152 return {} 30153 } finally { 30154 popTarget(); 30155 } 30156} 30157 30158var computedWatcherOptions = { lazy: true }; 30159 30160function initComputed (vm, computed) { 30161 // $flow-disable-line 30162 var watchers = vm._computedWatchers = Object.create(null); 30163 // computed properties are just getters during SSR 30164 var isSSR = isServerRendering(); 30165 30166 for (var key in computed) { 30167 var userDef = computed[key]; 30168 var getter = typeof userDef === 'function' ? userDef : userDef.get; 30169 if ("development" !== 'production' && getter == null) { 30170 warn( 30171 ("Getter is missing for computed property \"" + key + "\"."), 30172 vm 30173 ); 30174 } 30175 30176 if (!isSSR) { 30177 // create internal watcher for the computed property. 30178 watchers[key] = new Watcher( 30179 vm, 30180 getter || noop, 30181 noop, 30182 computedWatcherOptions 30183 ); 30184 } 30185 30186 // component-defined computed properties are already defined on the 30187 // component prototype. We only need to define computed properties defined 30188 // at instantiation here. 30189 if (!(key in vm)) { 30190 defineComputed(vm, key, userDef); 30191 } else { 30192 if (key in vm.$data) { 30193 warn(("The computed property \"" + key + "\" is already defined in data."), vm); 30194 } else if (vm.$options.props && key in vm.$options.props) { 30195 warn(("The computed property \"" + key + "\" is already defined as a prop."), vm); 30196 } 30197 } 30198 } 30199} 30200 30201function defineComputed ( 30202 target, 30203 key, 30204 userDef 30205) { 30206 var shouldCache = !isServerRendering(); 30207 if (typeof userDef === 'function') { 30208 sharedPropertyDefinition.get = shouldCache 30209 ? createComputedGetter(key) 30210 : userDef; 30211 sharedPropertyDefinition.set = noop; 30212 } else { 30213 sharedPropertyDefinition.get = userDef.get 30214 ? shouldCache && userDef.cache !== false 30215 ? createComputedGetter(key) 30216 : userDef.get 30217 : noop; 30218 sharedPropertyDefinition.set = userDef.set 30219 ? userDef.set 30220 : noop; 30221 } 30222 if ("development" !== 'production' && 30223 sharedPropertyDefinition.set === noop) { 30224 sharedPropertyDefinition.set = function () { 30225 warn( 30226 ("Computed property \"" + key + "\" was assigned to but it has no setter."), 30227 this 30228 ); 30229 }; 30230 } 30231 Object.defineProperty(target, key, sharedPropertyDefinition); 30232} 30233 30234function createComputedGetter (key) { 30235 return function computedGetter () { 30236 var watcher = this._computedWatchers && this._computedWatchers[key]; 30237 if (watcher) { 30238 if (watcher.dirty) { 30239 watcher.evaluate(); 30240 } 30241 if (Dep.target) {
30242 watcher.depend(); 30243 } 30244 return watcher.value 30245 } 30246 } 30247} 30248 30249function initMethods (vm, methods) { 30250 var props = vm.$options.props; 30251 for (var key in methods) { 30252 { 30253 if (methods[key] == null) { 30254 warn( 30255 "Method \"" + key + "\" has an undefined value in the component definition. " + 30256 "Did you reference the function correctly?", 30257 vm 30258 ); 30259 } 30260 if (props && hasOwn(props, key)) { 30261 warn( 30262 ("Method \"" + key + "\" has already been defined as a prop."), 30263 vm 30264 ); 30265 } 30266 if ((key in vm) && isReserved(key)) { 30267 warn( 30268 "Method \"" + key + "\" conflicts with an existing Vue instance method. " + 30269 "Avoid defining component methods that start with _ or $." 30270 ); 30271 } 30272 } 30273 vm[key] = methods[key] == null ? noop : bind(methods[key], vm); 30274 } 30275} 30276 30277function initWatch (vm, watch) { 30278 for (var key in watch) { 30279 var handler = watch[key]; 30280 if (Array.isArray(handler)) { 30281 for (var i = 0; i < handler.length; i++) { 30282 createWatcher(vm, key, handler[i]); 30283 } 30284 } else { 30285 createWatcher(vm, key, handler); 30286 } 30287 } 30288} 30289 30290function createWatcher ( 30291 vm, 30292 expOrFn, 30293 handler, 30294 options 30295) { 30296 if (isPlainObject(handler)) { 30297 options = handler; 30298 handler = handler.handler; 30299 } 30300 if (typeof handler === 'string') { 30301 handler = vm[handler]; 30302 } 30303 return vm.$watch(expOrFn, handler, options) 30304} 30305 30306function stateMixin (Vue) { 30307 // flow somehow has problems with directly declared definition object 30308 // when using Object.defineProperty, so we have to procedurally build up 30309 // the object here. 30310 var dataDef = {}; 30311 dataDef.get = function () { return this._data }; 30312 var propsDef = {}; 30313 propsDef.get = function () { return this._props }; 30314 { 30315 dataDef.set = function (newData) { 30316 warn( 30317 'Avoid replacing instance root $data. ' + 30318 'Use nested data properties instead.', 30319 this 30320 ); 30321 }; 30322 propsDef.set = function () { 30323 warn("$props is readonly.", this); 30324 }; 30325 } 30326 Object.defineProperty(Vue.prototype, '$data', dataDef); 30327 Object.defineProperty(Vue.prototype, '$props', propsDef); 30328 30329 Vue.prototype.$set = set; 30330 Vue.prototype.$delete = del; 30331 30332 Vue.prototype.$watch = function ( 30333 expOrFn, 30334 cb, 30335 options 30336 ) { 30337 var vm = this; 30338 if (isPlainObject(cb)) { 30339 return createWatcher(vm, expOrFn, cb, options) 30340 } 30341 options = options || {}; 30342 options.user = true; 30343 var watcher = new Watcher(vm, expOrFn, cb, options); 30344 if (options.immediate) { 30345 cb.call(vm, watcher.value); 30346 } 30347 return function unwatchFn () { 30348 watcher.teardown(); 30349 } 30350 }; 30351} 30352 30353/* */ 30354 30355function initProvide (vm) { 30356 var provide = vm.$options.provide; 30357 if (provide) { 30358 vm._provided = typeof provide === 'function' 30359 ? provide.call(vm) 30360 : provide; 30361 } 30362} 30363 30364function initInjections (vm) { 30365 var result = resolveInject(vm.$options.inject, vm); 30366 if (result) { 30367 toggleObserving(false); 30368 Object.keys(result).forEach(function (key) { 30369 /* istanbul ignore else */ 30370 { 30371 defineReactive(vm, key, result[key], function () { 30372 warn( 30373 "Avoid mutating an injected value directly since the changes will be " + 30374 "overwritten whenever the provided component re-renders. " + 30375 "injection being mutated: \"" + key + "\"", 30376 vm 30377 ); 30378 }); 30379 } 30380 }); 30381 toggleObserving(true); 30382 } 30383} 30384 30385function resolveInject (inject, vm) { 30386 if (inject) { 30387 // inject is :any because flow is not smart enough to figure out cached 30388 var result = Object.create(null); 30389 var keys = hasSymbol 30390 ? Reflect.ownKeys(inject).filter(function (key) { 30391 /* istanbul ignore next */ 30392 return Object.getOwnPropertyDescriptor(inject, key).enumerable 30393 }) 30394 : Object.keys(inject); 30395 30396 for (var i = 0; i < keys.length; i++) { 30397 var key = keys[i]; 30398 var provideKey = inject[key].from; 30399 var source = vm; 30400 while (source) { 30401 if (source._provided && hasOwn(source._provided, provideKey)) { 30402 result[key] = source._provided[provideKey]; 30403 break 30404 } 30405 source = source.$parent; 30406 } 30407 if (!source) { 30408 if ('default' in inject[key]) { 30409 var provideDefault = inject[key].default; 30410 result[key] = typeof provideDefault === 'function' 30411 ? provideDefault.call(vm) 30412 : provideDefault; 30413 } else { 30414 warn(("Injection \"" + key + "\" not found"), vm); 30415 } 30416 } 30417 } 30418 return result 30419 } 30420} 30421 30422/* */ 30423 30424/** 30425 * Runtime helper for rendering v-for lists. 30426 */ 30427function renderList ( 30428 val, 30429 render 30430) { 30431 var ret, i, l, keys, key; 30432 if (Array.isArray(val) || typeof val === 'string') { 30433 ret = new Array(val.length); 30434 for (i = 0, l = val.length; i < l; i++) { 30435 ret[i] = render(val[i], i); 30436 } 30437 } else if (typeof val === 'number') { 30438 ret = new Array(val); 30439 for (i = 0; i < val; i++) { 30440 ret[i] = render(i + 1, i); 30441 } 30442 } else if (isObject(val)) { 30443 keys = Object.keys(val); 30444 ret = new Array(keys.length);
30445 for (i = 0, l = keys.length; i < l; i++) { 30446 key = keys[i]; 30447 ret[i] = render(val[key], key, i); 30448 } 30449 } 30450 if (isDef(ret)) { 30451 (ret)._isVList = true; 30452 } 30453 return ret 30454} 30455 30456/* */ 30457 30458/** 30459 * Runtime helper for rendering <slot> 30460 */ 30461function renderSlot ( 30462 name, 30463 fallback, 30464 props, 30465 bindObject 30466) { 30467 var scopedSlotFn = this.$scopedSlots[name]; 30468 var nodes; 30469 if (scopedSlotFn) { // scoped slot 30470 props = props || {}; 30471 if (bindObject) { 30472 if ("development" !== 'production' && !isObject(bindObject)) { 30473 warn( 30474 'slot v-bind without argument expects an Object', 30475 this 30476 ); 30477 } 30478 props = extend(extend({}, bindObject), props); 30479 } 30480 nodes = scopedSlotFn(props) || fallback; 30481 } else { 30482 var slotNodes = this.$slots[name]; 30483 // warn duplicate slot usage 30484 if (slotNodes) { 30485 if ("development" !== 'production' && slotNodes._rendered) { 30486 warn( 30487 "Duplicate presence of slot \"" + name + "\" found in the same render tree " + 30488 "- this will likely cause render errors.", 30489 this 30490 ); 30491 } 30492 slotNodes._rendered = true; 30493 } 30494 nodes = slotNodes || fallback; 30495 } 30496 30497 var target = props && props.slot; 30498 if (target) { 30499 return this.$createElement('template', { slot: target }, nodes) 30500 } else { 30501 return nodes 30502 } 30503} 30504 30505/* */ 30506 30507/** 30508 * Runtime helper for resolving filters 30509 */ 30510function resolveFilter (id) { 30511 return resolveAsset(this.$options, 'filters', id, true) || identity 30512} 30513 30514/* */ 30515 30516function isKeyNotMatch (expect, actual) { 30517 if (Array.isArray(expect)) { 30518 return expect.indexOf(actual) === -1 30519 } else { 30520 return expect !== actual 30521 } 30522} 30523 30524/** 30525 * Runtime helper for checking keyCodes from config. 30526 * exposed as Vue.prototype._k 30527 * passing in eventKeyName as last argument separately for backwards compat 30528 */ 30529function checkKeyCodes ( 30530 eventKeyCode, 30531 key, 30532 builtInKeyCode, 30533 eventKeyName, 30534 builtInKeyName 30535) { 30536 var mappedKeyCode = config.keyCodes[key] || builtInKeyCode; 30537 if (builtInKeyName && eventKeyName && !config.keyCodes[key]) { 30538 return isKeyNotMatch(builtInKeyName, eventKeyName) 30539 } else if (mappedKeyCode) { 30540 return isKeyNotMatch(mappedKeyCode, eventKeyCode) 30541 } else if (eventKeyName) { 30542 return hyphenate(eventKeyName) !== key 30543 } 30544} 30545 30546/* */ 30547 30548/** 30549 * Runtime helper for merging v-bind="object" into a VNode's data. 30550 */ 30551function bindObjectProps ( 30552 data, 30553 tag, 30554 value, 30555 asProp, 30556 isSync 30557) { 30558 if (value) { 30559 if (!isObject(value)) { 30560 "development" !== 'production' && warn( 30561 'v-bind without argument expects an Object or Array value', 30562 this 30563 ); 30564 } else { 30565 if (Array.isArray(value)) { 30566 value = toObject(value); 30567 } 30568 var hash; 30569 var loop = function ( key ) { 30570 if ( 30571 key === 'class' || 30572 key === 'style' || 30573 isReservedAttribute(key) 30574 ) { 30575 hash = data; 30576 } else { 30577 var type = data.attrs && data.attrs.type; 30578 hash = asProp || config.mustUseProp(tag, type, key) 30579 ? data.domProps || (data.domProps = {}) 30580 : data.attrs || (data.attrs = {}); 30581 } 30582 if (!(key in hash)) { 30583 hash[key] = value[key]; 30584 30585 if (isSync) { 30586 var on = data.on || (data.on = {}); 30587 on[("update:" + key)] = function ($event) { 30588 value[key] = $event; 30589 }; 30590 } 30591 } 30592 }; 30593 30594 for (var key in value) loop( key ); 30595 } 30596 } 30597 return data 30598} 30599 30600/* */ 30601 30602/** 30603 * Runtime helper for rendering static trees. 30604 */
vendor: 5,197 bytes, lines 30605-30805
30605function renderStatic ( 30606 index, 30607 isInFor 30608) { 30609 var cached = this._staticTrees || (this._staticTrees = []); 30610 var tree = cached[index]; 30611 // if has already-rendered static tree and not inside v-for, 30612 // we can reuse the same tree. 30613 if (tree && !isInFor) { 30614 return tree 30615 } 30616 // otherwise, render a fresh tree. 30617 tree = cached[index] = this.$options.staticRenderFns[index].call( 30618 this._renderProxy, 30619 null, 30620 this // for render fns generated for functional component templates 30621 ); 30622 markStatic(tree, ("__static__" + index), false); 30623 return tree 30624} 30625 30626/** 30627 * Runtime helper for v-once. 30628 * Effectively it means marking the node as static with a unique key. 30629 */ 30630function markOnce ( 30631 tree, 30632 index, 30633 key 30634) { 30635 markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); 30636 return tree 30637} 30638 30639function markStatic ( 30640 tree, 30641 key, 30642 isOnce 30643) { 30644 if (Array.isArray(tree)) { 30645 for (var i = 0; i < tree.length; i++) { 30646 if (tree[i] && typeof tree[i] !== 'string') { 30647 markStaticNode(tree[i], (key + "_" + i), isOnce); 30648 } 30649 } 30650 } else { 30651 markStaticNode(tree, key, isOnce); 30652 } 30653} 30654 30655function markStaticNode (node, key, isOnce) { 30656 node.isStatic = true; 30657 node.key = key; 30658 node.isOnce = isOnce; 30659} 30660 30661/* */ 30662 30663function bindObjectListeners (data, value) { 30664 if (value) { 30665 if (!isPlainObject(value)) { 30666 "development" !== 'production' && warn( 30667 'v-on without argument expects an Object value', 30668 this 30669 ); 30670 } else { 30671 var on = data.on = data.on ? extend({}, data.on) : {}; 30672 for (var key in value) { 30673 var existing = on[key]; 30674 var ours = value[key]; 30675 on[key] = existing ? [].concat(existing, ours) : ours; 30676 } 30677 } 30678 } 30679 return data 30680} 30681 30682/* */ 30683 30684function installRenderHelpers (target) { 30685 target._o = markOnce; 30686 target._n = toNumber; 30687 target._s = toString; 30688 target._l = renderList; 30689 target._t = renderSlot; 30690 target._q = looseEqual; 30691 target._i = looseIndexOf; 30692 target._m = renderStatic; 30693 target._f = resolveFilter; 30694 target._k = checkKeyCodes; 30695 target._b = bindObjectProps; 30696 target._v = createTextVNode; 30697 target._e = createEmptyVNode; 30698 target._u = resolveScopedSlots; 30699 target._g = bindObjectListeners; 30700} 30701 30702/* */ 30703 30704function FunctionalRenderContext ( 30705 data, 30706 props, 30707 children, 30708 parent, 30709 Ctor 30710) { 30711 var options = Ctor.options; 30712 // ensure the createElement function in functional components 30713 // gets a unique context - this is necessary for correct named slot check 30714 var contextVm; 30715 if (hasOwn(parent, '_uid')) { 30716 contextVm = Object.create(parent); 30717 // $flow-disable-line 30718 contextVm._original = parent; 30719 } else { 30720 // the context vm passed in is a functional context as well. 30721 // in this case we want to make sure we are able to get a hold to the 30722 // real context instance. 30723 contextVm = parent; 30724 // $flow-disable-line 30725 parent = parent._original; 30726 } 30727 var isCompiled = isTrue(options._compiled); 30728 var needNormalization = !isCompiled; 30729 30730 this.data = data; 30731 this.props = props; 30732 this.children = children; 30733 this.parent = parent; 30734 this.listeners = data.on || emptyObject; 30735 this.injections = resolveInject(options.inject, parent); 30736 this.slots = function () { return resolveSlots(children, parent); }; 30737 30738 // support for compiled functional template 30739 if (isCompiled) { 30740 // exposing $options for renderStatic() 30741 this.$options = options; 30742 // pre-resolve slots for renderSlot() 30743 this.$slots = this.slots(); 30744 this.$scopedSlots = data.scopedSlots || emptyObject; 30745 } 30746 30747 if (options._scopeId) { 30748 this._c = function (a, b, c, d) { 30749 var vnode = createElement(contextVm, a, b, c, d, needNormalization); 30750 if (vnode && !Array.isArray(vnode)) { 30751 vnode.fnScopeId = options._scopeId; 30752 vnode.fnContext = parent; 30753 } 30754 return vnode 30755 }; 30756 } else { 30757 this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); }; 30758 } 30759} 30760 30761installRenderHelpers(FunctionalRenderContext.prototype); 30762 30763function createFunctionalComponent ( 30764 Ctor, 30765 propsData, 30766 data, 30767 contextVm, 30768 children 30769) { 30770 var options = Ctor.options; 30771 var props = {}; 30772 var propOptions = options.props; 30773 if (isDef(propOptions)) { 30774 for (var key in propOptions) { 30775 props[key] = validateProp(key, propOptions, propsData || emptyObject); 30776 } 30777 } else { 30778 if (isDef(data.attrs)) { mergeProps(props, data.attrs); } 30779 if (isDef(data.props)) { mergeProps(props, data.props); } 30780 } 30781 30782 var renderContext = new FunctionalRenderContext( 30783 data, 30784 props, 30785 children, 30786 contextVm, 30787 Ctor 30788 ); 30789 30790 var vnode = options.render.call(null, renderContext._c, renderContext); 30791 30792 if (vnode instanceof VNode) { 30793 return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options) 30794 } else if (Array.isArray(vnode)) { 30795 var vnodes = normalizeChildren(vnode) || []; 30796 var res = new Array(vnodes.length); 30797 for (var i = 0; i < vnodes.length; i++) { 30798 res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options); 30799 } 30800 return res 30801 } 30802} 30803 30804function cloneAndMarkFunctionalResult (vnode, data, contextVm, options) { 30805 // #7817 clone node before setting fnContext, otherwise if the node is reused
vendor: 5,113 bytes, lines 30806-31001
30806 // (e.g. it was from a cached normal slot) the fnContext causes named slots 30807 // that should not be matched to match. 30808 var clone = cloneVNode(vnode); 30809 clone.fnContext = contextVm; 30810 clone.fnOptions = options; 30811 if (data.slot) { 30812 (clone.data || (clone.data = {})).slot = data.slot; 30813 } 30814 return clone 30815} 30816 30817function mergeProps (to, from) { 30818 for (var key in from) { 30819 to[camelize(key)] = from[key]; 30820 } 30821} 30822 30823/* */ 30824 30825 30826 30827 30828// Register the component hook to weex native render engine. 30829// The hook will be triggered by native, not javascript. 30830 30831 30832// Updates the state of the component to weex native render engine. 30833 30834/* */ 30835 30836// https://github.com/Hanks10100/weex-native-directive/tree/master/component 30837 30838// listening on native callback 30839 30840/* */ 30841 30842/* */ 30843 30844// inline hooks to be invoked on component VNodes during patch 30845var componentVNodeHooks = { 30846 init: function init ( 30847 vnode, 30848 hydrating, 30849 parentElm, 30850 refElm 30851 ) { 30852 if ( 30853 vnode.componentInstance && 30854 !vnode.componentInstance._isDestroyed && 30855 vnode.data.keepAlive 30856 ) { 30857 // kept-alive components, treat as a patch 30858 var mountedNode = vnode; // work around flow 30859 componentVNodeHooks.prepatch(mountedNode, mountedNode); 30860 } else { 30861 var child = vnode.componentInstance = createComponentInstanceForVnode( 30862 vnode, 30863 activeInstance, 30864 parentElm, 30865 refElm 30866 ); 30867 child.$mount(hydrating ? vnode.elm : undefined, hydrating); 30868 } 30869 }, 30870 30871 prepatch: function prepatch (oldVnode, vnode) { 30872 var options = vnode.componentOptions; 30873 var child = vnode.componentInstance = oldVnode.componentInstance; 30874 updateChildComponent( 30875 child, 30876 options.propsData, // updated props 30877 options.listeners, // updated listeners 30878 vnode, // new parent vnode 30879 options.children // new children 30880 ); 30881 }, 30882 30883 insert: function insert (vnode) { 30884 var context = vnode.context; 30885 var componentInstance = vnode.componentInstance; 30886 if (!componentInstance._isMounted) { 30887 componentInstance._isMounted = true; 30888 callHook(componentInstance, 'mounted'); 30889 } 30890 if (vnode.data.keepAlive) { 30891 if (context._isMounted) { 30892 // vue-router#1212 30893 // During updates, a kept-alive component's child components may 30894 // change, so directly walking the tree here may call activated hooks 30895 // on incorrect children. Instead we push them into a queue which will 30896 // be processed after the whole patch process ended. 30897 queueActivatedComponent(componentInstance); 30898 } else { 30899 activateChildComponent(componentInstance, true /* direct */); 30900 } 30901 } 30902 }, 30903 30904 destroy: function destroy (vnode) { 30905 var componentInstance = vnode.componentInstance; 30906 if (!componentInstance._isDestroyed) { 30907 if (!vnode.data.keepAlive) { 30908 componentInstance.$destroy(); 30909 } else { 30910 deactivateChildComponent(componentInstance, true /* direct */); 30911 } 30912 } 30913 } 30914}; 30915 30916var hooksToMerge = Object.keys(componentVNodeHooks); 30917 30918function createComponent ( 30919 Ctor, 30920 data, 30921 context, 30922 children, 30923 tag 30924) { 30925 if (isUndef(Ctor)) { 30926 return 30927 } 30928 30929 var baseCtor = context.$options._base; 30930 30931 // plain options object: turn it into a constructor 30932 if (isObject(Ctor)) { 30933 Ctor = baseCtor.extend(Ctor); 30934 } 30935 30936 // if at this stage it's not a constructor or an async component factory, 30937 // reject. 30938 if (typeof Ctor !== 'function') { 30939 { 30940 warn(("Invalid Component definition: " + (String(Ctor))), context); 30941 } 30942 return 30943 } 30944 30945 // async component 30946 var asyncFactory; 30947 if (isUndef(Ctor.cid)) { 30948 asyncFactory = Ctor; 30949 Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context); 30950 if (Ctor === undefined) { 30951 // return a placeholder node for async component, which is rendered 30952 // as a comment node but preserves all the raw information for the node. 30953 // the information will be used for async server-rendering and hydration. 30954 return createAsyncPlaceholder( 30955 asyncFactory, 30956 data, 30957 context, 30958 children, 30959 tag 30960 ) 30961 } 30962 } 30963 30964 data = data || {}; 30965 30966 // resolve constructor options in case global mixins are applied after 30967 // component constructor creation 30968 resolveConstructorOptions(Ctor); 30969 30970 // transform component v-model data into props & events 30971 if (isDef(data.model)) { 30972 transformModel(Ctor.options, data); 30973 } 30974 30975 // extract props 30976 var propsData = extractPropsFromVNodeData(data, Ctor, tag); 30977 30978 // functional component 30979 if (isTrue(Ctor.options.functional)) { 30980 return createFunctionalComponent(Ctor, propsData, data, context, children) 30981 } 30982 30983 // extract listeners, since these needs to be treated as 30984 // child component listeners instead of DOM listeners 30985 var listeners = data.on; 30986 // replace with listeners with .native modifier 30987 // so it gets processed during parent component patch. 30988 data.on = data.nativeOn; 30989 30990 if (isTrue(Ctor.options.abstract)) { 30991 // abstract components do not keep anything 30992 // other than props & listeners & slot 30993 30994 // work around flow 30995 var slot = data.slot; 30996 data = {}; 30997 if (slot) { 30998 data.slot = slot; 30999 } 31000 } 31001
31002 // install component management hooks onto the placeholder node 31003 installComponentHooks(data); 31004 31005 // return a placeholder vnode 31006 var name = Ctor.options.name || tag; 31007 var vnode = new VNode( 31008 ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')), 31009 data, undefined, undefined, undefined, context, 31010 { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, 31011 asyncFactory 31012 ); 31013 31014 // Weex specific: invoke recycle-list optimized @render function for 31015 // extracting cell-slot template. 31016 // https://github.com/Hanks10100/weex-native-directive/tree/master/component 31017 /* istanbul ignore if */ 31018 return vnode 31019} 31020 31021function createComponentInstanceForVnode ( 31022 vnode, // we know it's MountedComponentVNode but flow doesn't 31023 parent, // activeInstance in lifecycle state 31024 parentElm, 31025 refElm 31026) { 31027 var options = { 31028 _isComponent: true, 31029 parent: parent, 31030 _parentVnode: vnode, 31031 _parentElm: parentElm || null, 31032 _refElm: refElm || null 31033 }; 31034 // check inline-template render functions 31035 var inlineTemplate = vnode.data.inlineTemplate; 31036 if (isDef(inlineTemplate)) { 31037 options.render = inlineTemplate.render; 31038 options.staticRenderFns = inlineTemplate.staticRenderFns; 31039 } 31040 return new vnode.componentOptions.Ctor(options) 31041} 31042 31043function installComponentHooks (data) { 31044 var hooks = data.hook || (data.hook = {}); 31045 for (var i = 0; i < hooksToMerge.length; i++) { 31046 var key = hooksToMerge[i]; 31047 hooks[key] = componentVNodeHooks[key]; 31048 } 31049} 31050 31051// transform component v-model info (value and callback) into 31052// prop and event handler respectively. 31053function transformModel (options, data) { 31054 var prop = (options.model && options.model.prop) || 'value'; 31055 var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value; 31056 var on = data.on || (data.on = {}); 31057 if (isDef(on[event])) { 31058 on[event] = [data.model.callback].concat(on[event]); 31059 } else { 31060 on[event] = data.model.callback; 31061 } 31062} 31063 31064/* */ 31065 31066var SIMPLE_NORMALIZE = 1; 31067var ALWAYS_NORMALIZE = 2; 31068 31069// wrapper function for providing a more flexible interface 31070// without getting yelled at by flow 31071function createElement ( 31072 context, 31073 tag, 31074 data, 31075 children, 31076 normalizationType, 31077 alwaysNormalize 31078) { 31079 if (Array.isArray(data) || isPrimitive(data)) { 31080 normalizationType = children; 31081 children = data; 31082 data = undefined; 31083 } 31084 if (isTrue(alwaysNormalize)) { 31085 normalizationType = ALWAYS_NORMALIZE; 31086 } 31087 return _createElement(context, tag, data, children, normalizationType) 31088} 31089 31090function _createElement ( 31091 context, 31092 tag, 31093 data, 31094 children, 31095 normalizationType 31096) { 31097 if (isDef(data) && isDef((data).__ob__)) { 31098 "development" !== 'production' && warn( 31099 "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + 31100 'Always create fresh vnode data objects in each render!', 31101 context 31102 ); 31103 return createEmptyVNode() 31104 } 31105 // object syntax in v-bind 31106 if (isDef(data) && isDef(data.is)) { 31107 tag = data.is; 31108 } 31109 if (!tag) { 31110 // in case of component :is set to falsy value 31111 return createEmptyVNode() 31112 } 31113 // warn against non-primitive key 31114 if ("development" !== 'production' && 31115 isDef(data) && isDef(data.key) && !isPrimitive(data.key) 31116 ) { 31117 { 31118 warn( 31119 'Avoid using non-primitive value as key, ' + 31120 'use string/number value instead.', 31121 context 31122 ); 31123 } 31124 } 31125 // support single function children as default scoped slot 31126 if (Array.isArray(children) && 31127 typeof children[0] === 'function' 31128 ) { 31129 data = data || {}; 31130 data.scopedSlots = { default: children[0] }; 31131 children.length = 0; 31132 } 31133 if (normalizationType === ALWAYS_NORMALIZE) { 31134 children = normalizeChildren(children); 31135 } else if (normalizationType === SIMPLE_NORMALIZE) { 31136 children = simpleNormalizeChildren(children); 31137 } 31138 var vnode, ns; 31139 if (typeof tag === 'string') { 31140 var Ctor; 31141 ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); 31142 if (config.isReservedTag(tag)) { 31143 // platform built-in elements 31144 vnode = new VNode( 31145 config.parsePlatformTagName(tag), data, children,
vendor: 1,038 bytes, lines 31146-31181
31146 undefined, undefined, context 31147 ); 31148 } else if (isDef(Ctor = resolveAsset(context.$options, 'components', tag))) { 31149 // component 31150 vnode = createComponent(Ctor, data, context, children, tag); 31151 } else { 31152 // unknown or unlisted namespaced elements 31153 // check at runtime because it may get assigned a namespace when its 31154 // parent normalizes children 31155 vnode = new VNode( 31156 tag, data, children, 31157 undefined, undefined, context 31158 ); 31159 } 31160 } else { 31161 // direct component options / constructor 31162 vnode = createComponent(tag, data, context, children); 31163 } 31164 if (Array.isArray(vnode)) { 31165 return vnode 31166 } else if (isDef(vnode)) { 31167 if (isDef(ns)) { applyNS(vnode, ns); } 31168 if (isDef(data)) { registerDeepBindings(data); } 31169 return vnode 31170 } else { 31171 return createEmptyVNode() 31172 } 31173} 31174 31175function applyNS (vnode, ns, force) { 31176 vnode.ns = ns; 31177 if (vnode.tag === 'foreignObject') { 31178 // use default namespace inside foreignObject 31179 ns = undefined; 31180 force = true; 31181 }
31182 if (isDef(vnode.children)) { 31183 for (var i = 0, l = vnode.children.length; i < l; i++) { 31184 var child = vnode.children[i]; 31185 if (isDef(child.tag) && ( 31186 isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) { 31187 applyNS(child, ns, force); 31188 } 31189 } 31190 } 31191} 31192 31193// ref #5318 31194// necessary to ensure parent re-render when deep bindings like :style and 31195// :class are used on slot nodes 31196function registerDeepBindings (data) { 31197 if (isObject(data.style)) { 31198 traverse(data.style); 31199 } 31200 if (isObject(data.class)) { 31201 traverse(data.class); 31202 } 31203} 31204 31205/* */ 31206 31207function initRender (vm) { 31208 vm._vnode = null; // the root of the child tree 31209 vm._staticTrees = null; // v-once cached trees 31210 var options = vm.$options; 31211 var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree 31212 var renderContext = parentVnode && parentVnode.context; 31213 vm.$slots = resolveSlots(options._renderChildren, renderContext); 31214 vm.$scopedSlots = emptyObject; 31215 // bind the createElement fn to this instance 31216 // so that we get proper render context inside it. 31217 // args order: tag, data, children, normalizationType, alwaysNormalize 31218 // internal version is used by render functions compiled from templates 31219 vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); }; 31220 // normalization is always applied for the public version, used in 31221 // user-written render functions. 31222 vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }; 31223 31224 // $attrs & $listeners are exposed for easier HOC creation. 31225 // they need to be reactive so that HOCs using them are always updated 31226 var parentData = parentVnode && parentVnode.data; 31227 31228 /* istanbul ignore else */ 31229 { 31230 defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { 31231 !isUpdatingChildComponent && warn("$attrs is readonly.", vm); 31232 }, true); 31233 defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () { 31234 !isUpdatingChildComponent && warn("$listeners is readonly.", vm); 31235 }, true); 31236 } 31237} 31238 31239function renderMixin (Vue) { 31240 // install runtime convenience helpers 31241 installRenderHelpers(Vue.prototype); 31242 31243 Vue.prototype.$nextTick = function (fn) { 31244 return nextTick(fn, this) 31245 }; 31246 31247 Vue.prototype._render = function () { 31248 var vm = this; 31249 var ref = vm.$options; 31250 var render = ref.render; 31251 var _parentVnode = ref._parentVnode; 31252 31253 // reset _rendered flag on slots for duplicate slot check 31254 { 31255 for (var key in vm.$slots) { 31256 // $flow-disable-line 31257 vm.$slots[key]._rendered = false; 31258 } 31259 } 31260 31261 if (_parentVnode) { 31262 vm.$scopedSlots = _parentVnode.data.scopedSlots || emptyObject; 31263 } 31264 31265 // set parent vnode. this allows render functions to have access 31266 // to the data on the placeholder node. 31267 vm.$vnode = _parentVnode; 31268 // render self 31269 var vnode; 31270 try { 31271 vnode = render.call(vm._renderProxy, vm.$createElement); 31272 } catch (e) { 31273 handleError(e, vm, "render"); 31274 // return error render result, 31275 // or previous vnode to prevent render error causing blank component 31276 /* istanbul ignore else */ 31277 { 31278 if (vm.$options.renderError) { 31279 try { 31280 vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e); 31281 } catch (e) { 31282 handleError(e, vm, "renderError"); 31283 vnode = vm._vnode; 31284 } 31285 } else { 31286 vnode = vm._vnode; 31287 } 31288 } 31289 } 31290 // return empty vnode in case the render function errored out 31291 if (!(vnode instanceof VNode)) { 31292 if ("development" !== 'production' && Array.isArray(vnode)) { 31293 warn( 31294 'Multiple root nodes returned from render function. Render function ' + 31295 'should return a single root node.', 31296 vm 31297 ); 31298 } 31299 vnode = createEmptyVNode(); 31300 } 31301 // set parent 31302 vnode.parent = _parentVnode; 31303 return vnode 31304 }; 31305} 31306 31307/* */ 31308 31309var uid$3 = 0; 31310 31311function initMixin (Vue) { 31312 Vue.prototype._init = function (options) { 31313 var vm = this; 31314 // a uid 31315 vm._uid = uid$3++; 31316 31317 var startTag, endTag; 31318 /* istanbul ignore if */ 31319 if ("development" !== 'production' && config.performance && mark) { 31320 startTag = "vue-perf-start:" + (vm._uid); 31321 endTag = "vue-perf-end:" + (vm._uid); 31322 mark(startTag); 31323 } 31324 31325 // a flag to avoid this being observed 31326 vm._isVue = true; 31327 // merge options 31328 if (options && options._isComponent) {
vendor: 4,355 bytes, lines 31329-31475
31329 // optimize internal component instantiation 31330 // since dynamic options merging is pretty slow, and none of the 31331 // internal component options needs special treatment. 31332 initInternalComponent(vm, options); 31333 } else { 31334 vm.$options = mergeOptions( 31335 resolveConstructorOptions(vm.constructor), 31336 options || {}, 31337 vm 31338 ); 31339 } 31340 /* istanbul ignore else */ 31341 { 31342 initProxy(vm); 31343 } 31344 // expose real self 31345 vm._self = vm; 31346 initLifecycle(vm); 31347 initEvents(vm); 31348 initRender(vm); 31349 callHook(vm, 'beforeCreate'); 31350 initInjections(vm); // resolve injections before data/props 31351 initState(vm); 31352 initProvide(vm); // resolve provide after data/props 31353 callHook(vm, 'created'); 31354 31355 /* istanbul ignore if */ 31356 if ("development" !== 'production' && config.performance && mark) { 31357 vm._name = formatComponentName(vm, false); 31358 mark(endTag); 31359 measure(("vue " + (vm._name) + " init"), startTag, endTag); 31360 } 31361 31362 if (vm.$options.el) { 31363 vm.$mount(vm.$options.el); 31364 } 31365 }; 31366} 31367 31368function initInternalComponent (vm, options) { 31369 var opts = vm.$options = Object.create(vm.constructor.options); 31370 // doing this because it's faster than dynamic enumeration. 31371 var parentVnode = options._parentVnode; 31372 opts.parent = options.parent; 31373 opts._parentVnode = parentVnode; 31374 opts._parentElm = options._parentElm; 31375 opts._refElm = options._refElm; 31376 31377 var vnodeComponentOptions = parentVnode.componentOptions; 31378 opts.propsData = vnodeComponentOptions.propsData; 31379 opts._parentListeners = vnodeComponentOptions.listeners; 31380 opts._renderChildren = vnodeComponentOptions.children; 31381 opts._componentTag = vnodeComponentOptions.tag; 31382 31383 if (options.render) { 31384 opts.render = options.render; 31385 opts.staticRenderFns = options.staticRenderFns; 31386 } 31387} 31388 31389function resolveConstructorOptions (Ctor) { 31390 var options = Ctor.options; 31391 if (Ctor.super) { 31392 var superOptions = resolveConstructorOptions(Ctor.super); 31393 var cachedSuperOptions = Ctor.superOptions; 31394 if (superOptions !== cachedSuperOptions) { 31395 // super option changed, 31396 // need to resolve new options. 31397 Ctor.superOptions = superOptions; 31398 // check if there are any late-modified/attached options (#4976) 31399 var modifiedOptions = resolveModifiedOptions(Ctor); 31400 // update base extend options 31401 if (modifiedOptions) { 31402 extend(Ctor.extendOptions, modifiedOptions); 31403 } 31404 options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions); 31405 if (options.name) { 31406 options.components[options.name] = Ctor; 31407 } 31408 } 31409 } 31410 return options 31411} 31412 31413function resolveModifiedOptions (Ctor) { 31414 var modified; 31415 var latest = Ctor.options; 31416 var extended = Ctor.extendOptions; 31417 var sealed = Ctor.sealedOptions; 31418 for (var key in latest) { 31419 if (latest[key] !== sealed[key]) { 31420 if (!modified) { modified = {}; } 31421 modified[key] = dedupe(latest[key], extended[key], sealed[key]); 31422 } 31423 } 31424 return modified 31425} 31426 31427function dedupe (latest, extended, sealed) { 31428 // compare latest and sealed to ensure lifecycle hooks won't be duplicated 31429 // between merges 31430 if (Array.isArray(latest)) { 31431 var res = []; 31432 sealed = Array.isArray(sealed) ? sealed : [sealed]; 31433 extended = Array.isArray(extended) ? extended : [extended]; 31434 for (var i = 0; i < latest.length; i++) { 31435 // push original options and not sealed options to exclude duplicated options 31436 if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) { 31437 res.push(latest[i]); 31438 } 31439 } 31440 return res 31441 } else { 31442 return latest 31443 } 31444} 31445 31446function Vue (options) { 31447 if ("development" !== 'production' && 31448 !(this instanceof Vue) 31449 ) { 31450 warn('Vue is a constructor and should be called with the `new` keyword'); 31451 } 31452 this._init(options); 31453} 31454 31455initMixin(Vue); 31456stateMixin(Vue); 31457eventsMixin(Vue); 31458lifecycleMixin(Vue); 31459renderMixin(Vue); 31460 31461/* */ 31462 31463function initUse (Vue) { 31464 Vue.use = function (plugin) { 31465 var installedPlugins = (this._installedPlugins || (this._installedPlugins = [])); 31466 if (installedPlugins.indexOf(plugin) > -1) { 31467 return this 31468 } 31469 31470 // additional parameters 31471 var args = toArray(arguments, 1); 31472 args.unshift(this); 31473 if (typeof plugin.install === 'function') { 31474 plugin.install.apply(plugin, args); 31475 } else if (typeof plugin === 'function') {
vendor: 2,293 bytes, lines 31476-31563
31476 plugin.apply(null, args); 31477 } 31478 installedPlugins.push(plugin); 31479 return this 31480 }; 31481} 31482 31483/* */ 31484 31485function initMixin$1 (Vue) { 31486 Vue.mixin = function (mixin) { 31487 this.options = mergeOptions(this.options, mixin); 31488 return this 31489 }; 31490} 31491 31492/* */ 31493 31494function initExtend (Vue) { 31495 /** 31496 * Each instance constructor, including Vue, has a unique 31497 * cid. This enables us to create wrapped "child 31498 * constructors" for prototypal inheritance and cache them. 31499 */ 31500 Vue.cid = 0; 31501 var cid = 1; 31502 31503 /** 31504 * Class inheritance 31505 */ 31506 Vue.extend = function (extendOptions) { 31507 extendOptions = extendOptions || {}; 31508 var Super = this; 31509 var SuperId = Super.cid; 31510 var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {}); 31511 if (cachedCtors[SuperId]) { 31512 return cachedCtors[SuperId] 31513 } 31514 31515 var name = extendOptions.name || Super.options.name; 31516 if ("development" !== 'production' && name) { 31517 validateComponentName(name); 31518 } 31519 31520 var Sub = function VueComponent (options) { 31521 this._init(options); 31522 }; 31523 Sub.prototype = Object.create(Super.prototype); 31524 Sub.prototype.constructor = Sub; 31525 Sub.cid = cid++; 31526 Sub.options = mergeOptions( 31527 Super.options, 31528 extendOptions 31529 ); 31530 Sub['super'] = Super; 31531 31532 // For props and computed properties, we define the proxy getters on 31533 // the Vue instances at extension time, on the extended prototype. This 31534 // avoids Object.defineProperty calls for each instance created. 31535 if (Sub.options.props) { 31536 initProps$1(Sub); 31537 } 31538 if (Sub.options.computed) { 31539 initComputed$1(Sub); 31540 } 31541 31542 // allow further extension/mixin/plugin usage 31543 Sub.extend = Super.extend; 31544 Sub.mixin = Super.mixin; 31545 Sub.use = Super.use; 31546 31547 // create asset registers, so extended classes 31548 // can have their private assets too. 31549 ASSET_TYPES.forEach(function (type) { 31550 Sub[type] = Super[type]; 31551 }); 31552 // enable recursive self-lookup 31553 if (name) { 31554 Sub.options.components[name] = Sub; 31555 } 31556 31557 // keep a reference to the super options at extension time. 31558 // later at instantiation we can check if Super's options have 31559 // been updated. 31560 Sub.superOptions = Super.options; 31561 Sub.extendOptions = extendOptions; 31562 Sub.sealedOptions = extend({}, Sub.options); 31563
vendor: 17,370 bytes, lines 31564-32267
31564 // cache constructor 31565 cachedCtors[SuperId] = Sub; 31566 return Sub 31567 }; 31568} 31569 31570function initProps$1 (Comp) { 31571 var props = Comp.options.props; 31572 for (var key in props) { 31573 proxy(Comp.prototype, "_props", key); 31574 } 31575} 31576 31577function initComputed$1 (Comp) { 31578 var computed = Comp.options.computed; 31579 for (var key in computed) { 31580 defineComputed(Comp.prototype, key, computed[key]); 31581 } 31582} 31583 31584/* */ 31585 31586function initAssetRegisters (Vue) { 31587 /** 31588 * Create asset registration methods. 31589 */ 31590 ASSET_TYPES.forEach(function (type) { 31591 Vue[type] = function ( 31592 id, 31593 definition 31594 ) { 31595 if (!definition) { 31596 return this.options[type + 's'][id] 31597 } else { 31598 /* istanbul ignore if */ 31599 if ("development" !== 'production' && type === 'component') { 31600 validateComponentName(id); 31601 } 31602 if (type === 'component' && isPlainObject(definition)) { 31603 definition.name = definition.name || id; 31604 definition = this.options._base.extend(definition); 31605 } 31606 if (type === 'directive' && typeof definition === 'function') { 31607 definition = { bind: definition, update: definition }; 31608 } 31609 this.options[type + 's'][id] = definition; 31610 return definition 31611 } 31612 }; 31613 }); 31614} 31615 31616/* */ 31617 31618function getComponentName (opts) { 31619 return opts && (opts.Ctor.options.name || opts.tag) 31620} 31621 31622function matches (pattern, name) { 31623 if (Array.isArray(pattern)) { 31624 return pattern.indexOf(name) > -1 31625 } else if (typeof pattern === 'string') { 31626 return pattern.split(',').indexOf(name) > -1 31627 } else if (isRegExp(pattern)) { 31628 return pattern.test(name) 31629 } 31630 /* istanbul ignore next */ 31631 return false 31632} 31633 31634function pruneCache (keepAliveInstance, filter) { 31635 var cache = keepAliveInstance.cache; 31636 var keys = keepAliveInstance.keys; 31637 var _vnode = keepAliveInstance._vnode; 31638 for (var key in cache) { 31639 var cachedNode = cache[key]; 31640 if (cachedNode) { 31641 var name = getComponentName(cachedNode.componentOptions); 31642 if (name && !filter(name)) { 31643 pruneCacheEntry(cache, key, keys, _vnode); 31644 } 31645 } 31646 } 31647} 31648 31649function pruneCacheEntry ( 31650 cache, 31651 key, 31652 keys, 31653 current 31654) { 31655 var cached$$1 = cache[key]; 31656 if (cached$$1 && (!current || cached$$1.tag !== current.tag)) { 31657 cached$$1.componentInstance.$destroy(); 31658 } 31659 cache[key] = null; 31660 remove(keys, key); 31661} 31662 31663var patternTypes = [String, RegExp, Array]; 31664 31665var KeepAlive = { 31666 name: 'keep-alive', 31667 abstract: true, 31668 31669 props: { 31670 include: patternTypes, 31671 exclude: patternTypes, 31672 max: [String, Number] 31673 }, 31674 31675 created: function created () { 31676 this.cache = Object.create(null); 31677 this.keys = []; 31678 }, 31679 31680 destroyed: function destroyed () { 31681 var this$1 = this; 31682 31683 for (var key in this$1.cache) { 31684 pruneCacheEntry(this$1.cache, key, this$1.keys); 31685 } 31686 }, 31687 31688 mounted: function mounted () { 31689 var this$1 = this; 31690 31691 this.$watch('include', function (val) { 31692 pruneCache(this$1, function (name) { return matches(val, name); }); 31693 }); 31694 this.$watch('exclude', function (val) { 31695 pruneCache(this$1, function (name) { return !matches(val, name); }); 31696 }); 31697 }, 31698 31699 render: function render () { 31700 var slot = this.$slots.default; 31701 var vnode = getFirstComponentChild(slot); 31702 var componentOptions = vnode && vnode.componentOptions; 31703 if (componentOptions) { 31704 // check pattern 31705 var name = getComponentName(componentOptions); 31706 var ref = this; 31707 var include = ref.include; 31708 var exclude = ref.exclude; 31709 if ( 31710 // not included 31711 (include && (!name || !matches(include, name))) || 31712 // excluded 31713 (exclude && name && matches(exclude, name)) 31714 ) { 31715 return vnode 31716 } 31717 31718 var ref$1 = this; 31719 var cache = ref$1.cache; 31720 var keys = ref$1.keys; 31721 var key = vnode.key == null 31722 // same constructor may get registered as different local components 31723 // so cid alone is not enough (#3269) 31724 ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '') 31725 : vnode.key; 31726 if (cache[key]) { 31727 vnode.componentInstance = cache[key].componentInstance; 31728 // make current key freshest 31729 remove(keys, key); 31730 keys.push(key); 31731 } else { 31732 cache[key] = vnode; 31733 keys.push(key); 31734 // prune oldest entry 31735 if (this.max && keys.length > parseInt(this.max)) { 31736 pruneCacheEntry(cache, keys[0], keys, this._vnode); 31737 } 31738 } 31739 31740 vnode.data.keepAlive = true; 31741 } 31742 return vnode || (slot && slot[0]) 31743 } 31744} 31745 31746var builtInComponents = { 31747 KeepAlive: KeepAlive 31748} 31749 31750/* */ 31751 31752function initGlobalAPI (Vue) { 31753 // config 31754 var configDef = {}; 31755 configDef.get = function () { return config; }; 31756 { 31757 configDef.set = function () { 31758 warn( 31759 'Do not replace the Vue.config object, set individual fields instead.' 31760 ); 31761 }; 31762 } 31763 Object.defineProperty(Vue, 'config', configDef); 31764 31765 // exposed util methods. 31766 // NOTE: these are not considered part of the public API - avoid relying on 31767 // them unless you are aware of the risk. 31768 Vue.util = { 31769 warn: warn, 31770 extend: extend, 31771 mergeOptions: mergeOptions, 31772 defineReactive: defineReactive 31773 }; 31774 31775 Vue.set = set; 31776 Vue.delete = del; 31777 Vue.nextTick = nextTick; 31778 31779 Vue.options = Object.create(null); 31780 ASSET_TYPES.forEach(function (type) { 31781 Vue.options[type + 's'] = Object.create(null); 31782 }); 31783 31784 // this is used to identify the "base" constructor to extend all plain-object 31785 // components with in Weex's multi-instance scenarios. 31786 Vue.options._base = Vue; 31787 31788 extend(Vue.options.components, builtInComponents); 31789 31790 initUse(Vue); 31791 initMixin$1(Vue); 31792 initExtend(Vue); 31793 initAssetRegisters(Vue); 31794} 31795 31796initGlobalAPI(Vue); 31797 31798Object.defineProperty(Vue.prototype, '$isServer', { 31799 get: isServerRendering 31800}); 31801 31802Object.defineProperty(Vue.prototype, '$ssrContext', { 31803 get: function get () { 31804 /* istanbul ignore next */ 31805 return this.$vnode && this.$vnode.ssrContext 31806 } 31807}); 31808 31809// expose FunctionalRenderContext for ssr runtime helper installation 31810Object.defineProperty(Vue, 'FunctionalRenderContext', { 31811 value: FunctionalRenderContext 31812}); 31813 31814Vue.version = '2.5.17'; 31815 31816/* */ 31817 31818// these are reserved for web because they are directly compiled away 31819// during template compilation 31820var isReservedAttr = makeMap('style,class'); 31821 31822// attributes that should be using props for binding 31823var acceptValue = makeMap('input,textarea,option,select,progress'); 31824var mustUseProp = function (tag, type, attr) { 31825 return ( 31826 (attr === 'value' && acceptValue(tag)) && type !== 'button' || 31827 (attr === 'selected' && tag === 'option') || 31828 (attr === 'checked' && tag === 'input') || 31829 (attr === 'muted' && tag === 'video') 31830 ) 31831}; 31832 31833var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck'); 31834 31835var isBooleanAttr = makeMap( 31836 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' + 31837 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' + 31838 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' + 31839 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' + 31840 'required,reversed,scoped,seamless,selected,sortable,translate,' + 31841 'truespeed,typemustmatch,visible' 31842); 31843 31844var xlinkNS = 'http://www.w3.org/1999/xlink'; 31845 31846var isXlink = function (name) { 31847 return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink' 31848}; 31849 31850var getXlinkProp = function (name) { 31851 return isXlink(name) ? name.slice(6, name.length) : '' 31852}; 31853 31854var isFalsyAttrValue = function (val) { 31855 return val == null || val === false 31856}; 31857 31858/* */ 31859 31860function genClassForVnode (vnode) { 31861 var data = vnode.data; 31862 var parentNode = vnode; 31863 var childNode = vnode; 31864 while (isDef(childNode.componentInstance)) { 31865 childNode = childNode.componentInstance._vnode; 31866 if (childNode && childNode.data) { 31867 data = mergeClassData(childNode.data, data); 31868 } 31869 } 31870 while (isDef(parentNode = parentNode.parent)) { 31871 if (parentNode && parentNode.data) { 31872 data = mergeClassData(data, parentNode.data); 31873 } 31874 } 31875 return renderClass(data.staticClass, data.class) 31876} 31877 31878function mergeClassData (child, parent) { 31879 return { 31880 staticClass: concat(child.staticClass, parent.staticClass), 31881 class: isDef(child.class) 31882 ? [child.class, parent.class] 31883 : parent.class 31884 } 31885} 31886 31887function renderClass ( 31888 staticClass, 31889 dynamicClass 31890) { 31891 if (isDef(staticClass) || isDef(dynamicClass)) { 31892 return concat(staticClass, stringifyClass(dynamicClass)) 31893 } 31894 /* istanbul ignore next */ 31895 return '' 31896} 31897 31898function concat (a, b) { 31899 return a ? b ? (a + ' ' + b) : a : (b || '') 31900} 31901 31902function stringifyClass (value) { 31903 if (Array.isArray(value)) { 31904 return stringifyArray(value) 31905 } 31906 if (isObject(value)) { 31907 return stringifyObject(value) 31908 } 31909 if (typeof value === 'string') { 31910 return value 31911 } 31912 /* istanbul ignore next */ 31913 return '' 31914} 31915 31916function stringifyArray (value) { 31917 var res = ''; 31918 var stringified; 31919 for (var i = 0, l = value.length; i < l; i++) { 31920 if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') { 31921 if (res) { res += ' '; } 31922 res += stringified; 31923 } 31924 } 31925 return res 31926} 31927 31928function stringifyObject (value) { 31929 var res = ''; 31930 for (var key in value) { 31931 if (value[key]) { 31932 if (res) { res += ' '; } 31933 res += key; 31934 } 31935 } 31936 return res 31937} 31938 31939/* */ 31940 31941var namespaceMap = { 31942 svg: 'http://www.w3.org/2000/svg', 31943 math: 'http://www.w3.org/1998/Math/MathML' 31944}; 31945 31946var isHTMLTag = makeMap( 31947 'html,body,base,head,link,meta,style,title,' + 31948 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' + 31949 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' + 31950 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' + 31951 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' + 31952 'embed,object,param,source,canvas,script,noscript,del,ins,' + 31953 'caption,col,colgroup,table,thead,tbody,td,th,tr,' + 31954 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' + 31955 'output,progress,select,textarea,' + 31956 'details,dialog,menu,menuitem,summary,' + 31957 'content,element,shadow,template,blockquote,iframe,tfoot' 31958); 31959 31960// this map is intentionally selective, only covering SVG elements that may 31961// contain child elements. 31962var isSVG = makeMap( 31963 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' + 31964 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 31965 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', 31966 true 31967); 31968 31969var isPreTag = function (tag) { return tag === 'pre'; }; 31970 31971var isReservedTag = function (tag) { 31972 return isHTMLTag(tag) || isSVG(tag) 31973}; 31974 31975function getTagNamespace (tag) { 31976 if (isSVG(tag)) { 31977 return 'svg' 31978 } 31979 // basic support for MathML 31980 // note it doesn't support other MathML elements being component roots 31981 if (tag === 'math') { 31982 return 'math' 31983 } 31984} 31985 31986var unknownElementCache = Object.create(null); 31987function isUnknownElement (tag) { 31988 /* istanbul ignore if */ 31989 if (!inBrowser) { 31990 return true 31991 } 31992 if (isReservedTag(tag)) { 31993 return false 31994 } 31995 tag = tag.toLowerCase(); 31996 /* istanbul ignore if */ 31997 if (unknownElementCache[tag] != null) { 31998 return unknownElementCache[tag] 31999 } 32000 var el = document.createElement(tag); 32001 if (tag.indexOf('-') > -1) { 32002 // http://stackoverflow.com/a/28210364/1070244 32003 return (unknownElementCache[tag] = ( 32004 el.constructor === window.HTMLUnknownElement || 32005 el.constructor === window.HTMLElement 32006 )) 32007 } else { 32008 return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString())) 32009 } 32010} 32011 32012var isTextInputType = makeMap('text,number,password,search,email,tel,url'); 32013 32014/* */ 32015 32016/** 32017 * Query an element selector if it's not an element already. 32018 */ 32019function query (el) { 32020 if (typeof el === 'string') { 32021 var selected = document.querySelector(el); 32022 if (!selected) { 32023 "development" !== 'production' && warn( 32024 'Cannot find element: ' + el 32025 ); 32026 return document.createElement('div') 32027 } 32028 return selected 32029 } else { 32030 return el 32031 } 32032} 32033 32034/* */ 32035 32036function createElement$1 (tagName, vnode) { 32037 var elm = document.createElement(tagName); 32038 if (tagName !== 'select') { 32039 return elm 32040 } 32041 // false or null will remove the attribute but undefined will not 32042 if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) { 32043 elm.setAttribute('multiple', 'multiple'); 32044 } 32045 return elm 32046} 32047 32048function createElementNS (namespace, tagName) { 32049 return document.createElementNS(namespaceMap[namespace], tagName) 32050} 32051 32052function createTextNode (text) { 32053 return document.createTextNode(text) 32054} 32055 32056function createComment (text) { 32057 return document.createComment(text) 32058} 32059 32060function insertBefore (parentNode, newNode, referenceNode) { 32061 parentNode.insertBefore(newNode, referenceNode); 32062} 32063 32064function removeChild (node, child) { 32065 node.removeChild(child); 32066} 32067 32068function appendChild (node, child) { 32069 node.appendChild(child); 32070} 32071 32072function parentNode (node) { 32073 return node.parentNode 32074} 32075 32076function nextSibling (node) { 32077 return node.nextSibling 32078} 32079 32080function tagName (node) { 32081 return node.tagName 32082} 32083 32084function setTextContent (node, text) { 32085 node.textContent = text; 32086} 32087 32088function setStyleScope (node, scopeId) { 32089 node.setAttribute(scopeId, ''); 32090} 32091 32092 32093var nodeOps = Object.freeze({ 32094 createElement: createElement$1, 32095 createElementNS: createElementNS, 32096 createTextNode: createTextNode, 32097 createComment: createComment, 32098 insertBefore: insertBefore, 32099 removeChild: removeChild, 32100 appendChild: appendChild, 32101 parentNode: parentNode, 32102 nextSibling: nextSibling, 32103 tagName: tagName, 32104 setTextContent: setTextContent, 32105 setStyleScope: setStyleScope 32106}); 32107 32108/* */ 32109 32110var ref = { 32111 create: function create (_, vnode) { 32112 registerRef(vnode); 32113 }, 32114 update: function update (oldVnode, vnode) { 32115 if (oldVnode.data.ref !== vnode.data.ref) { 32116 registerRef(oldVnode, true); 32117 registerRef(vnode); 32118 } 32119 }, 32120 destroy: function destroy (vnode) { 32121 registerRef(vnode, true); 32122 } 32123} 32124 32125function registerRef (vnode, isRemoval) { 32126 var key = vnode.data.ref; 32127 if (!isDef(key)) { return } 32128 32129 var vm = vnode.context; 32130 var ref = vnode.componentInstance || vnode.elm; 32131 var refs = vm.$refs; 32132 if (isRemoval) { 32133 if (Array.isArray(refs[key])) { 32134 remove(refs[key], ref); 32135 } else if (refs[key] === ref) { 32136 refs[key] = undefined; 32137 } 32138 } else { 32139 if (vnode.data.refInFor) { 32140 if (!Array.isArray(refs[key])) { 32141 refs[key] = [ref]; 32142 } else if (refs[key].indexOf(ref) < 0) { 32143 // $flow-disable-line 32144 refs[key].push(ref); 32145 } 32146 } else { 32147 refs[key] = ref; 32148 } 32149 } 32150} 32151 32152/** 32153 * Virtual DOM patching algorithm based on Snabbdom by 32154 * Simon Friis Vindum (@paldepind) 32155 * Licensed under the MIT License 32156 * https://github.com/paldepind/snabbdom/blob/master/LICENSE 32157 * 32158 * modified by Evan You (@yyx990803) 32159 * 32160 * Not type-checking this because this file is perf-critical and the cost 32161 * of making flow understand it is not worth it. 32162 */ 32163 32164var emptyNode = new VNode('', {}, []); 32165 32166var hooks = ['create', 'activate', 'update', 'remove', 'destroy']; 32167 32168function sameVnode (a, b) { 32169 return ( 32170 a.key === b.key && ( 32171 ( 32172 a.tag === b.tag && 32173 a.isComment === b.isComment && 32174 isDef(a.data) === isDef(b.data) && 32175 sameInputType(a, b) 32176 ) || ( 32177 isTrue(a.isAsyncPlaceholder) && 32178 a.asyncFactory === b.asyncFactory && 32179 isUndef(b.asyncFactory.error) 32180 ) 32181 ) 32182 ) 32183} 32184 32185function sameInputType (a, b) { 32186 if (a.tag !== 'input') { return true } 32187 var i; 32188 var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type; 32189 var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type; 32190 return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB) 32191} 32192 32193function createKeyToOldIdx (children, beginIdx, endIdx) { 32194 var i, key; 32195 var map = {}; 32196 for (i = beginIdx; i <= endIdx; ++i) { 32197 key = children[i].key; 32198 if (isDef(key)) { map[key] = i; } 32199 } 32200 return map 32201} 32202 32203function createPatchFunction (backend) { 32204 var i, j; 32205 var cbs = {}; 32206 32207 var modules = backend.modules; 32208 var nodeOps = backend.nodeOps; 32209 32210 for (i = 0; i < hooks.length; ++i) { 32211 cbs[hooks[i]] = []; 32212 for (j = 0; j < modules.length; ++j) { 32213 if (isDef(modules[j][hooks[i]])) { 32214 cbs[hooks[i]].push(modules[j][hooks[i]]); 32215 } 32216 } 32217 } 32218 32219 function emptyNodeAt (elm) { 32220 return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm) 32221 } 32222 32223 function createRmCb (childElm, listeners) { 32224 function remove () { 32225 if (--remove.listeners === 0) { 32226 removeNode(childElm); 32227 } 32228 } 32229 remove.listeners = listeners; 32230 return remove 32231 } 32232 32233 function removeNode (el) { 32234 var parent = nodeOps.parentNode(el); 32235 // element may have already been removed due to v-html / v-text 32236 if (isDef(parent)) { 32237 nodeOps.removeChild(parent, el); 32238 } 32239 } 32240 32241 function isUnknownElement$$1 (vnode, inVPre) { 32242 return ( 32243 !inVPre && 32244 !vnode.ns && 32245 !( 32246 config.ignoredElements.length && 32247 config.ignoredElements.some(function (ignore) { 32248 return isRegExp(ignore) 32249 ? ignore.test(vnode.tag) 32250 : ignore === vnode.tag 32251 }) 32252 ) && 32253 config.isUnknownElement(vnode.tag) 32254 ) 32255 } 32256 32257 var creatingElmInVPre = 0; 32258 32259 function createElm ( 32260 vnode, 32261 insertedVnodeQueue, 32262 parentElm, 32263 refElm, 32264 nested, 32265 ownerArray, 32266 index 32267 ) {
32268 if (isDef(vnode.elm) && isDef(ownerArray)) { 32269 // This vnode was used in a previous render! 32270 // now it's used as a new node, overwriting its elm would cause 32271 // potential patch errors down the road when it's used as an insertion 32272 // reference node. Instead, we clone the node on-demand before creating 32273 // associated DOM element for it. 32274 vnode = ownerArray[index] = cloneVNode(vnode); 32275 } 32276 32277 vnode.isRootInsert = !nested; // for transition enter check 32278 if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) { 32279 return 32280 } 32281 32282 var data = vnode.data; 32283 var children = vnode.children; 32284 var tag = vnode.tag; 32285 if (isDef(tag)) { 32286 { 32287 if (data && data.pre) { 32288 creatingElmInVPre++; 32289 } 32290 if (isUnknownElement$$1(vnode, creatingElmInVPre)) { 32291 warn( 32292 'Unknown custom element: <' + tag + '> - did you ' + 32293 'register the component correctly? For recursive components, ' + 32294 'make sure to provide the "name" option.', 32295 vnode.context 32296 ); 32297 } 32298 } 32299 32300 vnode.elm = vnode.ns 32301 ? nodeOps.createElementNS(vnode.ns, tag) 32302 : nodeOps.createElement(tag, vnode); 32303 setScope(vnode); 32304 32305 /* istanbul ignore if */ 32306 { 32307 createChildren(vnode, children, insertedVnodeQueue); 32308 if (isDef(data)) { 32309 invokeCreateHooks(vnode, insertedVnodeQueue); 32310 } 32311 insert(parentElm, vnode.elm, refElm); 32312 } 32313 32314 if ("development" !== 'production' && data && data.pre) { 32315 creatingElmInVPre--; 32316 } 32317 } else if (isTrue(vnode.isComment)) { 32318 vnode.elm = nodeOps.createComment(vnode.text); 32319 insert(parentElm, vnode.elm, refElm); 32320 } else { 32321 vnode.elm = nodeOps.createTextNode(vnode.text); 32322 insert(parentElm, vnode.elm, refElm); 32323 } 32324 } 32325 32326 function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) { 32327 var i = vnode.data; 32328 if (isDef(i)) { 32329 var isReactivated = isDef(vnode.componentInstance) && i.keepAlive; 32330 if (isDef(i = i.hook) && isDef(i = i.init)) { 32331 i(vnode, false /* hydrating */, parentElm, refElm); 32332 } 32333 // after calling the init hook, if the vnode is a child component 32334 // it should've created a child instance and mounted it. the child 32335 // component also has set the placeholder vnode's elm. 32336 // in that case we can just return the element and be done.
vendor: 14,539 bytes, lines 32337-32749
32337 if (isDef(vnode.componentInstance)) { 32338 initComponent(vnode, insertedVnodeQueue); 32339 if (isTrue(isReactivated)) { 32340 reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm); 32341 } 32342 return true 32343 } 32344 } 32345 } 32346 32347 function initComponent (vnode, insertedVnodeQueue) { 32348 if (isDef(vnode.data.pendingInsert)) { 32349 insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert); 32350 vnode.data.pendingInsert = null; 32351 } 32352 vnode.elm = vnode.componentInstance.$el; 32353 if (isPatchable(vnode)) { 32354 invokeCreateHooks(vnode, insertedVnodeQueue); 32355 setScope(vnode); 32356 } else { 32357 // empty component root. 32358 // skip all element-related modules except for ref (#3455) 32359 registerRef(vnode); 32360 // make sure to invoke the insert hook 32361 insertedVnodeQueue.push(vnode); 32362 } 32363 } 32364 32365 function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) { 32366 var i; 32367 // hack for #4339: a reactivated component with inner transition 32368 // does not trigger because the inner node's created hooks are not called 32369 // again. It's not ideal to involve module-specific logic in here but 32370 // there doesn't seem to be a better way to do it. 32371 var innerNode = vnode; 32372 while (innerNode.componentInstance) { 32373 innerNode = innerNode.componentInstance._vnode; 32374 if (isDef(i = innerNode.data) && isDef(i = i.transition)) { 32375 for (i = 0; i < cbs.activate.length; ++i) { 32376 cbs.activate[i](emptyNode, innerNode); 32377 } 32378 insertedVnodeQueue.push(innerNode); 32379 break 32380 } 32381 } 32382 // unlike a newly created component, 32383 // a reactivated keep-alive component doesn't insert itself 32384 insert(parentElm, vnode.elm, refElm); 32385 } 32386 32387 function insert (parent, elm, ref$$1) { 32388 if (isDef(parent)) { 32389 if (isDef(ref$$1)) { 32390 if (ref$$1.parentNode === parent) { 32391 nodeOps.insertBefore(parent, elm, ref$$1); 32392 } 32393 } else { 32394 nodeOps.appendChild(parent, elm); 32395 } 32396 } 32397 } 32398 32399 function createChildren (vnode, children, insertedVnodeQueue) { 32400 if (Array.isArray(children)) { 32401 { 32402 checkDuplicateKeys(children); 32403 } 32404 for (var i = 0; i < children.length; ++i) { 32405 createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i); 32406 } 32407 } else if (isPrimitive(vnode.text)) { 32408 nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text))); 32409 } 32410 } 32411 32412 function isPatchable (vnode) { 32413 while (vnode.componentInstance) { 32414 vnode = vnode.componentInstance._vnode; 32415 } 32416 return isDef(vnode.tag) 32417 } 32418 32419 function invokeCreateHooks (vnode, insertedVnodeQueue) { 32420 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { 32421 cbs.create[i$1](emptyNode, vnode); 32422 } 32423 i = vnode.data.hook; // Reuse variable 32424 if (isDef(i)) { 32425 if (isDef(i.create)) { i.create(emptyNode, vnode); } 32426 if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); } 32427 } 32428 } 32429 32430 // set scope id attribute for scoped CSS. 32431 // this is implemented as a special case to avoid the overhead 32432 // of going through the normal attribute patching process. 32433 function setScope (vnode) { 32434 var i; 32435 if (isDef(i = vnode.fnScopeId)) { 32436 nodeOps.setStyleScope(vnode.elm, i); 32437 } else { 32438 var ancestor = vnode; 32439 while (ancestor) { 32440 if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) { 32441 nodeOps.setStyleScope(vnode.elm, i); 32442 } 32443 ancestor = ancestor.parent; 32444 } 32445 } 32446 // for slot content they should also get the scopeId from the host instance. 32447 if (isDef(i = activeInstance) && 32448 i !== vnode.context && 32449 i !== vnode.fnContext && 32450 isDef(i = i.$options._scopeId) 32451 ) { 32452 nodeOps.setStyleScope(vnode.elm, i); 32453 } 32454 } 32455 32456 function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) { 32457 for (; startIdx <= endIdx; ++startIdx) { 32458 createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx); 32459 } 32460 } 32461 32462 function invokeDestroyHook (vnode) { 32463 var i, j; 32464 var data = vnode.data; 32465 if (isDef(data)) { 32466 if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); } 32467 for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); } 32468 } 32469 if (isDef(i = vnode.children)) { 32470 for (j = 0; j < vnode.children.length; ++j) { 32471 invokeDestroyHook(vnode.children[j]); 32472 } 32473 } 32474 } 32475 32476 function removeVnodes (parentElm, vnodes, startIdx, endIdx) { 32477 for (; startIdx <= endIdx; ++startIdx) { 32478 var ch = vnodes[startIdx]; 32479 if (isDef(ch)) { 32480 if (isDef(ch.tag)) { 32481 removeAndInvokeRemoveHook(ch); 32482 invokeDestroyHook(ch); 32483 } else { // Text node 32484 removeNode(ch.elm); 32485 } 32486 } 32487 } 32488 } 32489 32490 function removeAndInvokeRemoveHook (vnode, rm) { 32491 if (isDef(rm) || isDef(vnode.data)) { 32492 var i; 32493 var listeners = cbs.remove.length + 1; 32494 if (isDef(rm)) { 32495 // we have a recursively passed down rm callback 32496 // increase the listeners count 32497 rm.listeners += listeners; 32498 } else { 32499 // directly removing 32500 rm = createRmCb(vnode.elm, listeners); 32501 } 32502 // recursively invoke hooks on child component root node 32503 if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { 32504 removeAndInvokeRemoveHook(i, rm); 32505 } 32506 for (i = 0; i < cbs.remove.length; ++i) { 32507 cbs.remove[i](vnode, rm); 32508 } 32509 if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) { 32510 i(vnode, rm); 32511 } else { 32512 rm(); 32513 } 32514 } else { 32515 removeNode(vnode.elm); 32516 } 32517 } 32518 32519 function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) { 32520 var oldStartIdx = 0; 32521 var newStartIdx = 0; 32522 var oldEndIdx = oldCh.length - 1; 32523 var oldStartVnode = oldCh[0]; 32524 var oldEndVnode = oldCh[oldEndIdx]; 32525 var newEndIdx = newCh.length - 1; 32526 var newStartVnode = newCh[0]; 32527 var newEndVnode = newCh[newEndIdx]; 32528 var oldKeyToIdx, idxInOld, vnodeToMove, refElm; 32529 32530 // removeOnly is a special flag used only by <transition-group> 32531 // to ensure removed elements stay in correct relative positions 32532 // during leaving transitions 32533 var canMove = !removeOnly; 32534 32535 { 32536 checkDuplicateKeys(newCh); 32537 } 32538 32539 while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { 32540 if (isUndef(oldStartVnode)) { 32541 oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left 32542 } else if (isUndef(oldEndVnode)) { 32543 oldEndVnode = oldCh[--oldEndIdx]; 32544 } else if (sameVnode(oldStartVnode, newStartVnode)) { 32545 patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue); 32546 oldStartVnode = oldCh[++oldStartIdx]; 32547 newStartVnode = newCh[++newStartIdx]; 32548 } else if (sameVnode(oldEndVnode, newEndVnode)) { 32549 patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue); 32550 oldEndVnode = oldCh[--oldEndIdx]; 32551 newEndVnode = newCh[--newEndIdx]; 32552 } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right 32553 patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue); 32554 canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm)); 32555 oldStartVnode = oldCh[++oldStartIdx]; 32556 newEndVnode = newCh[--newEndIdx]; 32557 } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left 32558 patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue); 32559 canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); 32560 oldEndVnode = oldCh[--oldEndIdx]; 32561 newStartVnode = newCh[++newStartIdx]; 32562 } else { 32563 if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); } 32564 idxInOld = isDef(newStartVnode.key) 32565 ? oldKeyToIdx[newStartVnode.key] 32566 : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx); 32567 if (isUndef(idxInOld)) { // New element 32568 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); 32569 } else { 32570 vnodeToMove = oldCh[idxInOld]; 32571 if (sameVnode(vnodeToMove, newStartVnode)) { 32572 patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue); 32573 oldCh[idxInOld] = undefined; 32574 canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm); 32575 } else { 32576 // same key but different element. treat as new element 32577 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); 32578 } 32579 } 32580 newStartVnode = newCh[++newStartIdx]; 32581 } 32582 } 32583 if (oldStartIdx > oldEndIdx) { 32584 refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; 32585 addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); 32586 } else if (newStartIdx > newEndIdx) { 32587 removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); 32588 } 32589 } 32590 32591 function checkDuplicateKeys (children) { 32592 var seenKeys = {}; 32593 for (var i = 0; i < children.length; i++) { 32594 var vnode = children[i]; 32595 var key = vnode.key; 32596 if (isDef(key)) { 32597 if (seenKeys[key]) { 32598 warn( 32599 ("Duplicate keys detected: '" + key + "'. This may cause an update error."), 32600 vnode.context 32601 ); 32602 } else { 32603 seenKeys[key] = true; 32604 } 32605 } 32606 } 32607 } 32608 32609 function findIdxInOld (node, oldCh, start, end) { 32610 for (var i = start; i < end; i++) { 32611 var c = oldCh[i]; 32612 if (isDef(c) && sameVnode(node, c)) { return i } 32613 } 32614 } 32615 32616 function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) { 32617 if (oldVnode === vnode) { 32618 return 32619 } 32620 32621 var elm = vnode.elm = oldVnode.elm; 32622 32623 if (isTrue(oldVnode.isAsyncPlaceholder)) { 32624 if (isDef(vnode.asyncFactory.resolved)) { 32625 hydrate(oldVnode.elm, vnode, insertedVnodeQueue); 32626 } else { 32627 vnode.isAsyncPlaceholder = true; 32628 } 32629 return 32630 } 32631 32632 // reuse element for static trees. 32633 // note we only do this if the vnode is cloned - 32634 // if the new node is not cloned it means the render functions have been 32635 // reset by the hot-reload-api and we need to do a proper re-render. 32636 if (isTrue(vnode.isStatic) && 32637 isTrue(oldVnode.isStatic) && 32638 vnode.key === oldVnode.key && 32639 (isTrue(vnode.isCloned) || isTrue(vnode.isOnce)) 32640 ) { 32641 vnode.componentInstance = oldVnode.componentInstance; 32642 return 32643 } 32644 32645 var i; 32646 var data = vnode.data; 32647 if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) { 32648 i(oldVnode, vnode); 32649 } 32650 32651 var oldCh = oldVnode.children; 32652 var ch = vnode.children; 32653 if (isDef(data) && isPatchable(vnode)) { 32654 for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); } 32655 if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); } 32656 } 32657 if (isUndef(vnode.text)) { 32658 if (isDef(oldCh) && isDef(ch)) { 32659 if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); } 32660 } else if (isDef(ch)) { 32661 if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } 32662 addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); 32663 } else if (isDef(oldCh)) { 32664 removeVnodes(elm, oldCh, 0, oldCh.length - 1); 32665 } else if (isDef(oldVnode.text)) { 32666 nodeOps.setTextContent(elm, ''); 32667 } 32668 } else if (oldVnode.text !== vnode.text) { 32669 nodeOps.setTextContent(elm, vnode.text); 32670 } 32671 if (isDef(data)) { 32672 if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); } 32673 } 32674 } 32675 32676 function invokeInsertHook (vnode, queue, initial) { 32677 // delay insert hooks for component root nodes, invoke them after the 32678 // element is really inserted 32679 if (isTrue(initial) && isDef(vnode.parent)) { 32680 vnode.parent.data.pendingInsert = queue; 32681 } else { 32682 for (var i = 0; i < queue.length; ++i) { 32683 queue[i].data.hook.insert(queue[i]); 32684 } 32685 } 32686 } 32687 32688 var hydrationBailed = false; 32689 // list of modules that can skip create hook during hydration because they 32690 // are already rendered on the client or has no need for initialization 32691 // Note: style is excluded because it relies on initial clone for future 32692 // deep updates (#7063). 32693 var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key'); 32694 32695 // Note: this is a browser-only function so we can assume elms are DOM nodes. 32696 function hydrate (elm, vnode, insertedVnodeQueue, inVPre) { 32697 var i; 32698 var tag = vnode.tag; 32699 var data = vnode.data; 32700 var children = vnode.children; 32701 inVPre = inVPre || (data && data.pre); 32702 vnode.elm = elm; 32703 32704 if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) { 32705 vnode.isAsyncPlaceholder = true; 32706 return true 32707 } 32708 // assert node match 32709 { 32710 if (!assertNodeMatch(elm, vnode, inVPre)) { 32711 return false 32712 } 32713 } 32714 if (isDef(data)) { 32715 if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); } 32716 if (isDef(i = vnode.componentInstance)) { 32717 // child component. it should have hydrated its own tree. 32718 initComponent(vnode, insertedVnodeQueue); 32719 return true 32720 } 32721 } 32722 if (isDef(tag)) { 32723 if (isDef(children)) { 32724 // empty element, allow client to pick up and populate children 32725 if (!elm.hasChildNodes()) { 32726 createChildren(vnode, children, insertedVnodeQueue); 32727 } else { 32728 // v-html and domProps: innerHTML 32729 if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) { 32730 if (i !== elm.innerHTML) { 32731 /* istanbul ignore if */ 32732 if ("development" !== 'production' && 32733 typeof console !== 'undefined' && 32734 !hydrationBailed 32735 ) { 32736 hydrationBailed = true; 32737 console.warn('Parent: ', elm); 32738 console.warn('server innerHTML: ', i); 32739 console.warn('client innerHTML: ', elm.innerHTML); 32740 } 32741 return false 32742 } 32743 } else { 32744 // iterate and compare children lists 32745 var childrenMatch = true; 32746 var childNode = elm.firstChild; 32747 for (var i$1 = 0; i$1 < children.length; i$1++) { 32748 if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) { 32749 childrenMatch = false;
32750 break 32751 } 32752 childNode = childNode.nextSibling; 32753 } 32754 // if childNode is not null, it means the actual childNodes list is 32755 // longer than the virtual children list. 32756 if (!childrenMatch || childNode) { 32757 /* istanbul ignore if */ 32758 if ("development" !== 'production' && 32759 typeof console !== 'undefined' && 32760 !hydrationBailed 32761 ) { 32762 hydrationBailed = true; 32763 console.warn('Parent: ', elm); 32764 console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children); 32765 } 32766 return false 32767 } 32768 } 32769 } 32770 } 32771 if (isDef(data)) { 32772 var fullInvoke = false; 32773 for (var key in data) { 32774 if (!isRenderedModule(key)) { 32775 fullInvoke = true; 32776 invokeCreateHooks(vnode, insertedVnodeQueue); 32777 break 32778 } 32779 } 32780 if (!fullInvoke && data['class']) { 32781 // ensure collecting deps for deep class bindings for future updates 32782 traverse(data['class']); 32783 } 32784 } 32785 } else if (elm.data !== vnode.text) { 32786 elm.data = vnode.text; 32787 } 32788 return true 32789 } 32790 32791 function assertNodeMatch (node, vnode, inVPre) {
32792 if (isDef(vnode.tag)) { 32793 return vnode.tag.indexOf('vue-component') === 0 || ( 32794 !isUnknownElement$$1(vnode, inVPre) && 32795 vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase()) 32796 ) 32797 } else { 32798 return node.nodeType === (vnode.isComment ? 8 : 3) 32799 } 32800 } 32801 32802 return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) { 32803 if (isUndef(vnode)) { 32804 if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); } 32805 return 32806 } 32807 32808 var isInitialPatch = false; 32809 var insertedVnodeQueue = []; 32810 32811 if (isUndef(oldVnode)) { 32812 // empty mount (likely as component), create new root element 32813 isInitialPatch = true; 32814 createElm(vnode, insertedVnodeQueue, parentElm, refElm); 32815 } else { 32816 var isRealElement = isDef(oldVnode.nodeType); 32817 if (!isRealElement && sameVnode(oldVnode, vnode)) { 32818 // patch existing root node 32819 patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly); 32820 } else { 32821 if (isRealElement) { 32822 // mounting to a real element 32823 // check if this is server-rendered content and if we can perform 32824 // a successful hydration. 32825 if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) { 32826 oldVnode.removeAttribute(SSR_ATTR); 32827 hydrating = true; 32828 } 32829 if (isTrue(hydrating)) { 32830 if (hydrate(oldVnode, vnode, insertedVnodeQueue)) { 32831 invokeInsertHook(vnode, insertedVnodeQueue, true); 32832 return oldVnode 32833 } else { 32834 warn( 32835 'The client-side rendered virtual DOM tree is not matching ' + 32836 'server-rendered content. This is likely caused by incorrect ' + 32837 'HTML markup, for example nesting block-level elements inside ' + 32838 '<p>, or missing <tbody>. Bailing hydration and performing ' + 32839 'full client-side render.' 32840 ); 32841 } 32842 } 32843 // either not server-rendered, or hydration failed. 32844 // create an empty node and replace it 32845 oldVnode = emptyNodeAt(oldVnode); 32846 } 32847 32848 // replacing existing element 32849 var oldElm = oldVnode.elm; 32850 var parentElm$1 = nodeOps.parentNode(oldElm); 32851 32852 // create new node 32853 createElm( 32854 vnode, 32855 insertedVnodeQueue, 32856 // extremely rare edge case: do not insert if old element is in a 32857 // leaving transition. Only happens when combining transition + 32858 // keep-alive + HOCs. (#4590) 32859 oldElm._leaveCb ? null : parentElm$1, 32860 nodeOps.nextSibling(oldElm) 32861 ); 32862 32863 // update parent placeholder node element, recursively
vendor: 6,016 bytes, lines 32864-33083
32864 if (isDef(vnode.parent)) { 32865 var ancestor = vnode.parent; 32866 var patchable = isPatchable(vnode); 32867 while (ancestor) { 32868 for (var i = 0; i < cbs.destroy.length; ++i) { 32869 cbs.destroy[i](ancestor); 32870 } 32871 ancestor.elm = vnode.elm; 32872 if (patchable) { 32873 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { 32874 cbs.create[i$1](emptyNode, ancestor); 32875 } 32876 // #6513 32877 // invoke insert hooks that may have been merged by create hooks. 32878 // e.g. for directives that uses the "inserted" hook. 32879 var insert = ancestor.data.hook.insert; 32880 if (insert.merged) { 32881 // start at index 1 to avoid re-invoking component mounted hook 32882 for (var i$2 = 1; i$2 < insert.fns.length; i$2++) { 32883 insert.fns[i$2](); 32884 } 32885 } 32886 } else { 32887 registerRef(ancestor); 32888 } 32889 ancestor = ancestor.parent; 32890 } 32891 } 32892 32893 // destroy old node 32894 if (isDef(parentElm$1)) { 32895 removeVnodes(parentElm$1, [oldVnode], 0, 0); 32896 } else if (isDef(oldVnode.tag)) { 32897 invokeDestroyHook(oldVnode); 32898 } 32899 } 32900 } 32901 32902 invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch); 32903 return vnode.elm 32904 } 32905} 32906 32907/* */ 32908 32909var directives = { 32910 create: updateDirectives, 32911 update: updateDirectives, 32912 destroy: function unbindDirectives (vnode) { 32913 updateDirectives(vnode, emptyNode); 32914 } 32915} 32916 32917function updateDirectives (oldVnode, vnode) { 32918 if (oldVnode.data.directives || vnode.data.directives) { 32919 _update(oldVnode, vnode); 32920 } 32921} 32922 32923function _update (oldVnode, vnode) { 32924 var isCreate = oldVnode === emptyNode; 32925 var isDestroy = vnode === emptyNode; 32926 var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context); 32927 var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context); 32928 32929 var dirsWithInsert = []; 32930 var dirsWithPostpatch = []; 32931 32932 var key, oldDir, dir; 32933 for (key in newDirs) { 32934 oldDir = oldDirs[key]; 32935 dir = newDirs[key]; 32936 if (!oldDir) { 32937 // new directive, bind 32938 callHook$1(dir, 'bind', vnode, oldVnode); 32939 if (dir.def && dir.def.inserted) { 32940 dirsWithInsert.push(dir); 32941 } 32942 } else { 32943 // existing directive, update 32944 dir.oldValue = oldDir.value; 32945 callHook$1(dir, 'update', vnode, oldVnode); 32946 if (dir.def && dir.def.componentUpdated) { 32947 dirsWithPostpatch.push(dir); 32948 } 32949 } 32950 } 32951 32952 if (dirsWithInsert.length) { 32953 var callInsert = function () { 32954 for (var i = 0; i < dirsWithInsert.length; i++) { 32955 callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode); 32956 } 32957 }; 32958 if (isCreate) { 32959 mergeVNodeHook(vnode, 'insert', callInsert); 32960 } else { 32961 callInsert(); 32962 } 32963 } 32964 32965 if (dirsWithPostpatch.length) { 32966 mergeVNodeHook(vnode, 'postpatch', function () { 32967 for (var i = 0; i < dirsWithPostpatch.length; i++) { 32968 callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode); 32969 } 32970 }); 32971 } 32972 32973 if (!isCreate) { 32974 for (key in oldDirs) { 32975 if (!newDirs[key]) { 32976 // no longer present, unbind 32977 callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy); 32978 } 32979 } 32980 } 32981} 32982 32983var emptyModifiers = Object.create(null); 32984 32985function normalizeDirectives$1 ( 32986 dirs, 32987 vm 32988) { 32989 var res = Object.create(null); 32990 if (!dirs) { 32991 // $flow-disable-line 32992 return res 32993 } 32994 var i, dir; 32995 for (i = 0; i < dirs.length; i++) { 32996 dir = dirs[i]; 32997 if (!dir.modifiers) { 32998 // $flow-disable-line 32999 dir.modifiers = emptyModifiers; 33000 } 33001 res[getRawDirName(dir)] = dir; 33002 dir.def = resolveAsset(vm.$options, 'directives', dir.name, true); 33003 } 33004 // $flow-disable-line 33005 return res 33006} 33007 33008function getRawDirName (dir) { 33009 return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.'))) 33010} 33011 33012function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) { 33013 var fn = dir.def && dir.def[hook]; 33014 if (fn) { 33015 try { 33016 fn(vnode.elm, dir, vnode, oldVnode, isDestroy); 33017 } catch (e) { 33018 handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook")); 33019 } 33020 } 33021} 33022 33023var baseModules = [ 33024 ref, 33025 directives 33026] 33027 33028/* */ 33029 33030function updateAttrs (oldVnode, vnode) { 33031 var opts = vnode.componentOptions; 33032 if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) { 33033 return 33034 } 33035 if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) { 33036 return 33037 } 33038 var key, cur, old; 33039 var elm = vnode.elm; 33040 var oldAttrs = oldVnode.data.attrs || {}; 33041 var attrs = vnode.data.attrs || {}; 33042 // clone observed objects, as the user probably wants to mutate it 33043 if (isDef(attrs.__ob__)) { 33044 attrs = vnode.data.attrs = extend({}, attrs); 33045 } 33046 33047 for (key in attrs) { 33048 cur = attrs[key]; 33049 old = oldAttrs[key]; 33050 if (old !== cur) { 33051 setAttr(elm, key, cur); 33052 } 33053 } 33054 // #4391: in IE9, setting type can reset value for input[type=radio] 33055 // #6666: IE/Edge forces progress value down to 1 before setting a max 33056 /* istanbul ignore if */ 33057 if ((isIE || isEdge) && attrs.value !== oldAttrs.value) { 33058 setAttr(elm, 'value', attrs.value); 33059 } 33060 for (key in oldAttrs) { 33061 if (isUndef(attrs[key])) { 33062 if (isXlink(key)) { 33063 elm.removeAttributeNS(xlinkNS, getXlinkProp(key)); 33064 } else if (!isEnumeratedAttr(key)) { 33065 elm.removeAttribute(key); 33066 } 33067 } 33068 } 33069} 33070 33071function setAttr (el, key, value) { 33072 if (el.tagName.indexOf('-') > -1) { 33073 baseSetAttr(el, key, value); 33074 } else if (isBooleanAttr(key)) { 33075 // set attribute for blank value 33076 // e.g. <option disabled>Select one</option> 33077 if (isFalsyAttrValue(value)) { 33078 el.removeAttribute(key); 33079 } else { 33080 // technically allowfullscreen is a boolean attribute for <iframe>, 33081 // but Flash expects a value of "true" when used on <embed> tag 33082 value = key === 'allowfullscreen' && el.tagName === 'EMBED' 33083 ? 'true'
33084 : key; 33085 el.setAttribute(key, value); 33086 } 33087 } else if (isEnumeratedAttr(key)) { 33088 el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true'); 33089 } else if (isXlink(key)) { 33090 if (isFalsyAttrValue(value)) { 33091 el.removeAttributeNS(xlinkNS, getXlinkProp(key)); 33092 } else { 33093 el.setAttributeNS(xlinkNS, key, value); 33094 } 33095 } else { 33096 baseSetAttr(el, key, value); 33097 } 33098} 33099 33100function baseSetAttr (el, key, value) { 33101 if (isFalsyAttrValue(value)) { 33102 el.removeAttribute(key); 33103 } else { 33104 // #7138: IE10 & 11 fires input event when setting placeholder on 33105 // <textarea>... block the first input event and remove the blocker 33106 // immediately. 33107 /* istanbul ignore if */ 33108 if ( 33109 isIE && !isIE9 && 33110 el.tagName === 'TEXTAREA' && 33111 key === 'placeholder' && !el.__ieph 33112 ) { 33113 var blocker = function (e) { 33114 e.stopImmediatePropagation(); 33115 el.removeEventListener('input', blocker); 33116 }; 33117 el.addEventListener('input', blocker); 33118 // $flow-disable-line 33119 el.__ieph = true; /* IE placeholder patched */ 33120 } 33121 el.setAttribute(key, value); 33122 } 33123} 33124 33125var attrs = { 33126 create: updateAttrs, 33127 update: updateAttrs 33128} 33129 33130/* */ 33131 33132function updateClass (oldVnode, vnode) { 33133 var el = vnode.elm; 33134 var data = vnode.data; 33135 var oldData = oldVnode.data; 33136 if ( 33137 isUndef(data.staticClass) && 33138 isUndef(data.class) && ( 33139 isUndef(oldData) || ( 33140 isUndef(oldData.staticClass) && 33141 isUndef(oldData.class) 33142 ) 33143 ) 33144 ) { 33145 return 33146 } 33147 33148 var cls = genClassForVnode(vnode); 33149 33150 // handle transition classes 33151 var transitionClass = el._transitionClasses; 33152 if (isDef(transitionClass)) { 33153 cls = concat(cls, stringifyClass(transitionClass)); 33154 } 33155 33156 // set the class 33157 if (cls !== el._prevClass) { 33158 el.setAttribute('class', cls); 33159 el._prevClass = cls; 33160 } 33161} 33162 33163var klass = { 33164 create: updateClass, 33165 update: updateClass 33166} 33167 33168/* */ 33169 33170var validDivisionCharRE = /[\w).+\-_$\]]/; 33171 33172function parseFilters (exp) { 33173 var inSingle = false; 33174 var inDouble = false; 33175 var inTemplateString = false; 33176 var inRegex = false; 33177 var curly = 0; 33178 var square = 0; 33179 var paren = 0; 33180 var lastFilterIndex = 0; 33181 var c, prev, i, expression, filters; 33182 33183 for (i = 0; i < exp.length; i++) { 33184 prev = c; 33185 c = exp.charCodeAt(i); 33186 if (inSingle) { 33187 if (c === 0x27 && prev !== 0x5C) { inSingle = false; } 33188 } else if (inDouble) { 33189 if (c === 0x22 && prev !== 0x5C) { inDouble = false; } 33190 } else if (inTemplateString) { 33191 if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; } 33192 } else if (inRegex) { 33193 if (c === 0x2f && prev !== 0x5C) { inRegex = false; } 33194 } else if ( 33195 c === 0x7C && // pipe 33196 exp.charCodeAt(i + 1) !== 0x7C && 33197 exp.charCodeAt(i - 1) !== 0x7C && 33198 !curly && !square && !paren 33199 ) { 33200 if (expression === undefined) { 33201 // first filter, end of expression 33202 lastFilterIndex = i + 1; 33203 expression = exp.slice(0, i).trim(); 33204 } else { 33205 pushFilter(); 33206 } 33207 } else { 33208 switch (c) { 33209 case 0x22: inDouble = true; break // " 33210 case 0x27: inSingle = true; break // ' 33211 case 0x60: inTemplateString = true; break // ` 33212 case 0x28: paren++; break // ( 33213 case 0x29: paren--; break // ) 33214 case 0x5B: square++; break // [ 33215 case 0x5D: square--; break // ] 33216 case 0x7B: curly++; break // { 33217 case 0x7D: curly--; break // } 33218 } 33219 if (c === 0x2f) { // / 33220 var j = i - 1; 33221 var p = (void 0); 33222 // find first non-whitespace prev char 33223 for (; j >= 0; j--) { 33224 p = exp.charAt(j); 33225 if (p !== ' ') { break } 33226 } 33227 if (!p || !validDivisionCharRE.test(p)) { 33228 inRegex = true; 33229 } 33230 } 33231 } 33232 } 33233 33234 if (expression === undefined) { 33235 expression = exp.slice(0, i).trim(); 33236 } else if (lastFilterIndex !== 0) { 33237 pushFilter(); 33238 } 33239 33240 function pushFilter () { 33241 (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim()); 33242 lastFilterIndex = i + 1; 33243 } 33244 33245 if (filters) { 33246 for (i = 0; i < filters.length; i++) { 33247 expression = wrapFilter(expression, filters[i]); 33248 } 33249 } 33250 33251 return expression 33252}
33252 33253 33254function wrapFilter (exp, filter) { 33255 var i = filter.indexOf('('); 33256 if (i < 0) { 33257 // _f: resolveFilter 33258 return ("_f(\"" + filter + "\")(" + exp + ")") 33259 } else { 33260 var name = filter.slice(0, i); 33261 var args = filter.slice(i + 1); 33262 return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args)) 33263 } 33264} 33265 33266/* */ 33267 33268function baseWarn (msg) { 33269 console.error(("[Vue compiler]: " + msg)); 33270} 33271 33272function pluckModuleFunction ( 33273 modules, 33274 key 33275) { 33276 return modules 33277 ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; }) 33278 : [] 33279} 33280 33281function addProp (el, name, value) { 33282 (el.props || (el.props = [])).push({ name: name, value: value }); 33283 el.plain = false; 33284} 33285 33286function addAttr (el, name, value) { 33287 (el.attrs || (el.attrs = [])).push({ name: name, value: value }); 33288 el.plain = false; 33289} 33290 33291// add a raw attr (use this in preTransforms) 33292function addRawAttr (el, name, value) { 33293 el.attrsMap[name] = value; 33294 el.attrsList.push({ name: name, value: value }); 33295} 33296 33297function addDirective ( 33298 el, 33299 name, 33300 rawName, 33301 value, 33302 arg, 33303 modifiers 33304) { 33305 (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers }); 33306 el.plain = false; 33307} 33308 33309function addHandler ( 33310 el, 33311 name, 33312 value, 33313 modifiers, 33314 important, 33315 warn 33316) { 33317 modifiers = modifiers || emptyObject; 33318 // warn prevent and passive modifier 33319 /* istanbul ignore if */ 33320 if ( 33321 "development" !== 'production' && warn && 33322 modifiers.prevent && modifiers.passive 33323 ) { 33324 warn( 33325 'passive and prevent can\'t be used together. ' + 33326 'Passive handler can\'t prevent default event.' 33327 ); 33328 } 33329 33330 // check capture modifier 33331 if (modifiers.capture) { 33332 delete modifiers.capture; 33333 name = '!' + name; // mark the event as captured 33334 } 33335 if (modifiers.once) { 33336 delete modifiers.once; 33337 name = '~' + name; // mark the event as once 33338 } 33339 /* istanbul ignore if */ 33340 if (modifiers.passive) { 33341 delete modifiers.passive; 33342 name = '&' + name; // mark the event as passive 33343 } 33344 33345 // normalize click.right and click.middle since they don't actually fire 33346 // this is technically browser-specific, but at least for now browsers are 33347 // the only target envs that have right/middle clicks. 33348 if (name === 'click') { 33349 if (modifiers.right) { 33350 name = 'contextmenu'; 33351 delete modifiers.right; 33352 } else if (modifiers.middle) { 33353 name = 'mouseup'; 33354 } 33355 } 33356 33357 var events; 33358 if (modifiers.native) { 33359 delete modifiers.native; 33360 events = el.nativeEvents || (el.nativeEvents = {}); 33361 } else { 33362 events = el.events || (el.events = {}); 33363 } 33364 33365 var newHandler = { 33366 value: value.trim() 33367 }; 33368 if (modifiers !== emptyObject) { 33369 newHandler.modifiers = modifiers; 33370 } 33371 33372 var handlers = events[name]; 33373 /* istanbul ignore if */ 33374 if (Array.isArray(handlers)) { 33375 important ? handlers.unshift(newHandler) : handlers.push(newHandler); 33376 } else if (handlers) { 33377 events[name] = important ? [newHandler, handlers] : [handlers, newHandler]; 33378 } else { 33379 events[name] = newHandler; 33380 } 33381 33382 el.plain = false; 33383} 33384 33385function getBindingAttr ( 33386 el, 33387 name, 33388 getStatic 33389) { 33390 var dynamicValue = 33391 getAndRemoveAttr(el, ':' + name) || 33392 getAndRemoveAttr(el, 'v-bind:' + name); 33393 if (dynamicValue != null) { 33394 return parseFilters(dynamicValue) 33395 } else if (getStatic !== false) { 33396 var staticValue = getAndRemoveAttr(el, name); 33397 if (staticValue != null) { 33398 return JSON.stringify(staticValue) 33399 } 33400 } 33401} 33402 33403// note: this only removes the attr from the Array (attrsList) so that it 33404// doesn't get processed by processAttrs. 33405// By default it does NOT remove it from the map (attrsMap) because the map is 33406// needed during codegen. 33407function getAndRemoveAttr ( 33408 el, 33409 name, 33410 removeFromMap 33411) { 33412 var val; 33413 if ((val = el.attrsMap[name]) != null) { 33414 var list = el.attrsList; 33415 for (var i = 0, l = list.length; i < l; i++) { 33416 if (list[i].name === name) { 33417 list.splice(i, 1); 33418 break 33419 } 33420 } 33421 } 33422 if (removeFromMap) { 33423 delete el.attrsMap[name]; 33424 } 33425 return val 33426} 33427 33428/* */ 33429 33430/** 33431 * Cross-platform code generation for component v-model 33432 */ 33433function genComponentModel ( 33434 el, 33435 value, 33436 modifiers 33437) { 33438 var ref = modifiers || {}; 33439 var number = ref.number; 33440 var trim = ref.trim; 33441 33442 var baseValueExpression = '$$v'; 33443 var valueExpression = baseValueExpression; 33444 if (trim) { 33445 valueExpression = 33446 "(typeof " + baseValueExpression + " === 'string'" + 33447 "? " + baseValueExpression + ".trim()" + 33448 ": " + baseValueExpression + ")"; 33449 } 33450 if (number) { 33451 valueExpression = "_n(" + valueExpression + ")"; 33452 }
33453 var assignment = genAssignmentCode(value, valueExpression); 33454 33455 el.model = { 33456 value: ("(" + value + ")"), 33457 expression: ("\"" + value + "\""), 33458 callback: ("function (" + baseValueExpression + ") {" + assignment + "}") 33459 }; 33460} 33461 33462/** 33463 * Cross-platform codegen helper for generating v-model value assignment code. 33464 */ 33465function genAssignmentCode ( 33466 value, 33467 assignment 33468) { 33469 var res = parseModel(value); 33470 if (res.key === null) { 33471 return (value + "=" + assignment) 33472 } else { 33473 return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")") 33474 } 33475} 33476 33477/** 33478 * Parse a v-model expression into a base path and a final key segment. 33479 * Handles both dot-path and possible square brackets. 33480 * 33481 * Possible cases: 33482 * 33483 * - test 33484 * - test[key] 33485 * - test[test1[key]] 33486 * - test["a"][key] 33487 * - xxx.test[a[a].test1[key]] 33488 * - test.xxx.a["asa"][test1[key]] 33489 * 33490 */ 33491 33492var len; 33493var str; 33494var chr; 33495var index$1; 33496var expressionPos; 33497var expressionEndPos; 33498 33499 33500 33501function parseModel (val) { 33502 // Fix https://github.com/vuejs/vue/pull/7730 33503 // allow v-model="obj.val " (trailing whitespace) 33504 val = val.trim(); 33505 len = val.length; 33506 33507 if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) { 33508 index$1 = val.lastIndexOf('.'); 33509 if (index$1 > -1) { 33510 return { 33511 exp: val.slice(0, index$1), 33512 key: '"' + val.slice(index$1 + 1) + '"' 33513 } 33514 } else { 33515 return { 33516 exp: val, 33517 key: null 33518 } 33519 } 33520 } 33521 33522 str = val; 33523 index$1 = expressionPos = expressionEndPos = 0; 33524 33525 while (!eof()) { 33526 chr = next(); 33527 /* istanbul ignore if */ 33528 if (isStringStart(chr)) { 33529 parseString(chr); 33530 } else if (chr === 0x5B) { 33531 parseBracket(chr); 33532 } 33533 } 33534 33535 return { 33536 exp: val.slice(0, expressionPos), 33537 key: val.slice(expressionPos + 1, expressionEndPos) 33538 } 33539} 33540 33541function next () { 33542 return str.charCodeAt(++index$1) 33543} 33544 33545function eof () { 33546 return index$1 >= len 33547} 33548 33549function isStringStart (chr) { 33550 return chr === 0x22 || chr === 0x27 33551} 33552 33553function parseBracket (chr) { 33554 var inBracket = 1; 33555 expressionPos = index$1; 33556 while (!eof()) { 33557 chr = next(); 33558 if (isStringStart(chr)) { 33559 parseString(chr); 33560 continue 33561 } 33562 if (chr === 0x5B) { inBracket++; } 33563 if (chr === 0x5D) { inBracket--; } 33564 if (inBracket === 0) { 33565 expressionEndPos = index$1; 33566 break 33567 } 33568 } 33569} 33570 33571function parseString (chr) { 33572 var stringQuote = chr; 33573 while (!eof()) { 33574 chr = next(); 33575 if (chr === stringQuote) { 33576 break 33577 } 33578 } 33579} 33580 33581/* */ 33582 33583var warn$1; 33584 33585// in some cases, the event used has to be determined at runtime 33586// so we used some reserved tokens during compile. 33587var RANGE_TOKEN = '__r'; 33588var CHECKBOX_RADIO_TOKEN = '__c'; 33589 33590function model ( 33591 el, 33592 dir, 33593 _warn 33594) { 33595 warn$1 = _warn; 33596 var value = dir.value; 33597 var modifiers = dir.modifiers; 33598 var tag = el.tag; 33599 var type = el.attrsMap.type; 33600 33601 { 33602 // inputs with type="file" are read only and setting the input's 33603 // value will throw an error. 33604 if (tag === 'input' && type === 'file') { 33605 warn$1( 33606 "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" + 33607 "File inputs are read only. Use a v-on:change listener instead." 33608 ); 33609 } 33610 } 33611 33612 if (el.component) { 33613 genComponentModel(el, value, modifiers); 33614 // component v-model doesn't need extra runtime 33615 return false 33616 } else if (tag === 'select') { 33617 genSelect(el, value, modifiers); 33618 } else if (tag === 'input' && type === 'checkbox') { 33619 genCheckboxModel(el, value, modifiers); 33620 } else if (tag === 'input' && type === 'radio') { 33621 genRadioModel(el, value, modifiers); 33622 } else if (tag === 'input' || tag === 'textarea') { 33623 genDefaultModel(el, value, modifiers); 33624 } else if (!config.isReservedTag(tag)) { 33625 genComponentModel(el, value, modifiers); 33626 // component v-model doesn't need extra runtime 33627 return false 33628 } else { 33629 warn$1( 33630 "<" + (el.tag) + " v-model=\"" + value + "\">: " + 33631 "v-model is not supported on this element type. " + 33632 'If you are working with contenteditable, it\'s recommended to ' + 33633 'wrap a library dedicated for that purpose inside a custom component.' 33634 ); 33635 } 33636 33637 // ensure runtime directive metadata 33638 return true 33639} 33640
33641function genCheckboxModel ( 33642 el, 33643 value, 33644 modifiers 33645) { 33646 var number = modifiers && modifiers.number; 33647 var valueBinding = getBindingAttr(el, 'value') || 'null'; 33648 var trueValueBinding = getBindingAttr(el, 'true-value') || 'true'; 33649 var falseValueBinding = getBindingAttr(el, 'false-value') || 'false'; 33650 addProp(el, 'checked', 33651 "Array.isArray(" + value + ")" + 33652 "?_i(" + value + "," + valueBinding + ")>-1" + ( 33653 trueValueBinding === 'true' 33654 ? (":(" + value + ")") 33655 : (":_q(" + value + "," + trueValueBinding + ")") 33656 ) 33657 ); 33658 addHandler(el, 'change', 33659 "var $$a=" + value + "," + 33660 '$$el=$event.target,' + 33661 "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + 33662 'if(Array.isArray($$a)){' + 33663 "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," + 33664 '$$i=_i($$a,$$v);' + 33665 "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" + 33666 "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" + 33667 "}else{" + (genAssignmentCode(value, '$$c')) + "}", 33668 null, true 33669 ); 33670} 33671 33672function genRadioModel ( 33673 el, 33674 value, 33675 modifiers 33676) { 33677 var number = modifiers && modifiers.number; 33678 var valueBinding = getBindingAttr(el, 'value') || 'null'; 33679 valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding; 33680 addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")")); 33681 addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true); 33682} 33683 33684function genSelect ( 33685 el, 33686 value, 33687 modifiers 33688) { 33689 var number = modifiers && modifiers.number; 33690 var selectedVal = "Array.prototype.filter" + 33691 ".call($event.target.options,function(o){return o.selected})" + 33692 ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" + 33693 "return " + (number ? '_n(val)' : 'val') + "})"; 33694 33695 var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'; 33696 var code = "var $$selectedVal = " + selectedVal + ";"; 33697 code = code + " " + (genAssignmentCode(value, assignment)); 33698 addHandler(el, 'change', code, null, true); 33699} 33700 33701function genDefaultModel ( 33702 el, 33703 value, 33704 modifiers 33705) { 33706 var type = el.attrsMap.type; 33707 33708 // warn if v-bind:value conflicts with v-model 33709 // except for inputs with v-bind:type 33710 { 33711 var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value']; 33712 var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type']; 33713 if (value$1 && !typeBinding) { 33714 var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value'; 33715 warn$1( 33716 binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " + 33717 'because the latter already expands to a value binding internally' 33718 ); 33719 } 33720 } 33721 33722 var ref = modifiers || {}; 33723 var lazy = ref.lazy; 33724 var number = ref.number; 33725 var trim = ref.trim; 33726 var needCompositionGuard = !lazy && type !== 'range'; 33727 var event = lazy 33728 ? 'change' 33729 : type === 'range' 33730 ? RANGE_TOKEN 33731 : 'input'; 33732 33733 var valueExpression = '$event.target.value'; 33734 if (trim) { 33735 valueExpression = "$event.target.value.trim()"; 33736 } 33737 if (number) { 33738 valueExpression = "_n(" + valueExpression + ")"; 33739 } 33740 33741 var code = genAssignmentCode(value, valueExpression); 33742 if (needCompositionGuard) { 33743 code = "if($event.target.composing)return;" + code; 33744 } 33745 33746 addProp(el, 'value', ("(" + value + ")")); 33747 addHandler(el, event, code, null, true); 33748 if (trim || number) { 33749 addHandler(el, 'blur', '$forceUpdate()'); 33750 } 33751} 33752 33753/* */ 33754 33755// normalize v-model event tokens that can only be determined at runtime. 33756// it's important to place the event as the first in the array because 33757// the whole point is ensuring the v-model callback gets called before 33758// user-attached handlers. 33759function normalizeEvents (on) { 33760 /* istanbul ignore if */ 33761 if (isDef(on[RANGE_TOKEN])) { 33762 // IE input[type=range] only supports `change` event 33763 var event = isIE ? 'change' : 'input'; 33764 on[event] = [].concat(on[RANGE_TOKEN], on[event] || []); 33765 delete on[RANGE_TOKEN]; 33766 } 33767 // This was originally intended to fix #4521 but no longer necessary 33768 // after 2.5. Keeping it for backwards compat with generated code from < 2.4 33769 /* istanbul ignore if */ 33770 if (isDef(on[CHECKBOX_RADIO_TOKEN])) { 33771 on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []); 33772 delete on[CHECKBOX_RADIO_TOKEN]; 33773 } 33774} 33775 33776var target$1; 33777 33778function createOnceHandler (handler, event, capture) { 33779 var _target = target$1; // save current target element in closure 33780 return function onceHandler () { 33781 var res = handler.apply(null, arguments); 33782 if (res !== null) { 33783 remove$2(event, onceHandler, capture, _target); 33784 } 33785 } 33786} 33787 33788function add$1 ( 33789 event, 33790 handler, 33791 once$$1, 33792 capture, 33793 passive 33794) { 33795 handler = withMacroTask(handler); 33796 if (once$$1) { handler = createOnceHandler(handler, event, capture); } 33797 target$1.addEventListener( 33798 event, 33799 handler, 33800 supportsPassive 33801 ? { capture: capture, passive: passive } 33802 : capture 33803 ); 33804} 33805 33806function remove$2 ( 33807 event, 33808 handler, 33809 capture, 33810 _target 33811) { 33812 (_target || target$1).removeEventListener( 33813 event, 33814 handler._withTask || handler, 33815 capture 33816 ); 33817} 33818 33819function updateDOMListeners (oldVnode, vnode) { 33820 if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) { 33821 return 33822 } 33823 var on = vnode.data.on || {}; 33824 var oldOn = oldVnode.data.on || {}; 33825 target$1 = vnode.elm; 33826 normalizeEvents(on); 33827 updateListeners(on, oldOn, add$1, remove$2, vnode.context); 33828 target$1 = undefined; 33829} 33830 33831var events = { 33832 create: updateDOMListeners, 33833 update: updateDOMListeners 33834} 33835 33836/* */ 33837 33838function updateDOMProps (oldVnode, vnode) { 33839 if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) { 33840 return 33841 } 33842 var key, cur; 33843 var elm = vnode.elm; 33844 var oldProps = oldVnode.data.domProps || {}; 33845 var props = vnode.data.domProps || {}; 33846 // clone observed objects, as the user probably wants to mutate it 33847 if (isDef(props.__ob__)) { 33848 props = vnode.data.domProps = extend({}, props); 33849 } 33850 33851 for (key in oldProps) { 33852 if (isUndef(props[key])) { 33853 elm[key] = ''; 33854 } 33855 } 33856 for (key in props) { 33857 cur = props[key]; 33858 // ignore children if the node has textContent or innerHTML, 33859 // as these will throw away existing DOM nodes and cause removal errors 33860 // on subsequent patches (#3360) 33861 if (key === 'textContent' || key === 'innerHTML') { 33862 if (vnode.children) { vnode.children.length = 0; } 33863 if (cur === oldProps[key]) { continue } 33864 // #6601 work around Chrome version <= 55 bug where single textNode 33865 // replaced by innerHTML/textContent retains its parentNode property 33866 if (elm.childNodes.length === 1) { 33867 elm.removeChild(elm.childNodes[0]); 33868 } 33869 } 33870 33871 if (key === 'value') { 33872 // store value as _value as well since 33873 // non-string values will be stringified 33874 elm._value = cur; 33875 // avoid resetting cursor position when value is the same 33876 var strCur = isUndef(cur) ? '' : String(cur); 33877 if (shouldUpdateValue(elm, strCur)) { 33878 elm.value = strCur; 33879 } 33880 } else { 33881 elm[key] = cur; 33882 } 33883 } 33884} 33885 33886// check platforms/web/util/attrs.js acceptValue 33887 33888 33889function shouldUpdateValue (elm, checkVal) { 33890 return (!elm.composing && ( 33891 elm.tagName === 'OPTION' || 33892 isNotInFocusAndDirty(elm, checkVal) || 33893 isDirtyWithModifiers(elm, checkVal) 33894 )) 33895} 33896 33897function isNotInFocusAndDirty (elm, checkVal) { 33898 // return true when textbox (.number and .trim) loses focus and its value is 33899 // not equal to the updated value 33900 var notInFocus = true; 33901 // #6157 33902 // work around IE bug when accessing document.activeElement in an iframe 33903 try { notInFocus = document.activeElement !== elm; } catch (e) {} 33904 return notInFocus && elm.value !== checkVal 33905} 33906 33907function isDirtyWithModifiers (elm, newVal) { 33908 var value = elm.value; 33909 var modifiers = elm._vModifiers; // injected by v-model runtime 33910 if (isDef(modifiers)) { 33911 if (modifiers.lazy) { 33912 // inputs with lazy should only be updated when not in focus 33913 return false 33914 } 33915 if (modifiers.number) { 33916 return toNumber(value) !== toNumber(newVal) 33917 } 33918 if (modifiers.trim) { 33919 return value.trim() !== newVal.trim() 33920 } 33921 } 33922 return value !== newVal 33923} 33924 33925var domProps = { 33926 create: updateDOMProps, 33927 update: updateDOMProps 33928} 33929 33930/* */ 33931 33932var parseStyleText = cached(function (cssText) { 33933 var res = {}; 33934 var listDelimiter = /;(?![^(]*\))/g; 33935 var propertyDelimiter = /:(.+)/; 33936 cssText.split(listDelimiter).forEach(function (item) { 33937 if (item) { 33938 var tmp = item.split(propertyDelimiter); 33939 tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()); 33940 } 33941 }); 33942 return res 33943}
vendor: 31,176 bytes, lines 33943-35105
33943); 33944 33945// merge static and dynamic style data on the same vnode 33946function normalizeStyleData (data) { 33947 var style = normalizeStyleBinding(data.style); 33948 // static style is pre-processed into an object during compilation 33949 // and is always a fresh object, so it's safe to merge into it 33950 return data.staticStyle 33951 ? extend(data.staticStyle, style) 33952 : style 33953} 33954 33955// normalize possible array / string values into Object 33956function normalizeStyleBinding (bindingStyle) { 33957 if (Array.isArray(bindingStyle)) { 33958 return toObject(bindingStyle) 33959 } 33960 if (typeof bindingStyle === 'string') { 33961 return parseStyleText(bindingStyle) 33962 } 33963 return bindingStyle 33964} 33965 33966/** 33967 * parent component style should be after child's 33968 * so that parent component's style could override it 33969 */ 33970function getStyle (vnode, checkChild) { 33971 var res = {}; 33972 var styleData; 33973 33974 if (checkChild) { 33975 var childNode = vnode; 33976 while (childNode.componentInstance) { 33977 childNode = childNode.componentInstance._vnode; 33978 if ( 33979 childNode && childNode.data && 33980 (styleData = normalizeStyleData(childNode.data)) 33981 ) { 33982 extend(res, styleData); 33983 } 33984 } 33985 } 33986 33987 if ((styleData = normalizeStyleData(vnode.data))) { 33988 extend(res, styleData); 33989 } 33990 33991 var parentNode = vnode; 33992 while ((parentNode = parentNode.parent)) { 33993 if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) { 33994 extend(res, styleData); 33995 } 33996 } 33997 return res 33998} 33999 34000/* */ 34001 34002var cssVarRE = /^--/; 34003var importantRE = /\s*!important$/; 34004var setProp = function (el, name, val) { 34005 /* istanbul ignore if */ 34006 if (cssVarRE.test(name)) { 34007 el.style.setProperty(name, val); 34008 } else if (importantRE.test(val)) { 34009 el.style.setProperty(name, val.replace(importantRE, ''), 'important'); 34010 } else { 34011 var normalizedName = normalize(name); 34012 if (Array.isArray(val)) { 34013 // Support values array created by autoprefixer, e.g. 34014 // {display: ["-webkit-box", "-ms-flexbox", "flex"]} 34015 // Set them one by one, and the browser will only set those it can recognize 34016 for (var i = 0, len = val.length; i < len; i++) { 34017 el.style[normalizedName] = val[i]; 34018 } 34019 } else { 34020 el.style[normalizedName] = val; 34021 } 34022 } 34023}; 34024 34025var vendorNames = ['Webkit', 'Moz', 'ms']; 34026 34027var emptyStyle; 34028var normalize = cached(function (prop) { 34029 emptyStyle = emptyStyle || document.createElement('div').style; 34030 prop = camelize(prop); 34031 if (prop !== 'filter' && (prop in emptyStyle)) { 34032 return prop 34033 } 34034 var capName = prop.charAt(0).toUpperCase() + prop.slice(1); 34035 for (var i = 0; i < vendorNames.length; i++) { 34036 var name = vendorNames[i] + capName; 34037 if (name in emptyStyle) { 34038 return name 34039 } 34040 } 34041}); 34042 34043function updateStyle (oldVnode, vnode) { 34044 var data = vnode.data; 34045 var oldData = oldVnode.data; 34046 34047 if (isUndef(data.staticStyle) && isUndef(data.style) && 34048 isUndef(oldData.staticStyle) && isUndef(oldData.style) 34049 ) { 34050 return 34051 } 34052 34053 var cur, name; 34054 var el = vnode.elm; 34055 var oldStaticStyle = oldData.staticStyle; 34056 var oldStyleBinding = oldData.normalizedStyle || oldData.style || {}; 34057 34058 // if static style exists, stylebinding already merged into it when doing normalizeStyleData 34059 var oldStyle = oldStaticStyle || oldStyleBinding; 34060 34061 var style = normalizeStyleBinding(vnode.data.style) || {}; 34062 34063 // store normalized style under a different key for next diff 34064 // make sure to clone it if it's reactive, since the user likely wants 34065 // to mutate it. 34066 vnode.data.normalizedStyle = isDef(style.__ob__) 34067 ? extend({}, style) 34068 : style; 34069 34070 var newStyle = getStyle(vnode, true); 34071 34072 for (name in oldStyle) { 34073 if (isUndef(newStyle[name])) { 34074 setProp(el, name, ''); 34075 } 34076 } 34077 for (name in newStyle) { 34078 cur = newStyle[name]; 34079 if (cur !== oldStyle[name]) { 34080 // ie9 setting to null has no effect, must use empty string 34081 setProp(el, name, cur == null ? '' : cur); 34082 } 34083 } 34084} 34085 34086var style = { 34087 create: updateStyle, 34088 update: updateStyle 34089} 34090 34091/* */ 34092 34093/** 34094 * Add class with compatibility for SVG since classList is not supported on 34095 * SVG elements in IE 34096 */ 34097function addClass (el, cls) { 34098 /* istanbul ignore if */ 34099 if (!cls || !(cls = cls.trim())) { 34100 return 34101 } 34102 34103 /* istanbul ignore else */ 34104 if (el.classList) { 34105 if (cls.indexOf(' ') > -1) { 34106 cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); }); 34107 } else { 34108 el.classList.add(cls); 34109 } 34110 } else { 34111 var cur = " " + (el.getAttribute('class') || '') + " "; 34112 if (cur.indexOf(' ' + cls + ' ') < 0) { 34113 el.setAttribute('class', (cur + cls).trim()); 34114 } 34115 } 34116} 34117 34118/** 34119 * Remove class with compatibility for SVG since classList is not supported on 34120 * SVG elements in IE 34121 */ 34122function removeClass (el, cls) { 34123 /* istanbul ignore if */ 34124 if (!cls || !(cls = cls.trim())) { 34125 return 34126 } 34127 34128 /* istanbul ignore else */ 34129 if (el.classList) { 34130 if (cls.indexOf(' ') > -1) { 34131 cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); }); 34132 } else { 34133 el.classList.remove(cls); 34134 } 34135 if (!el.classList.length) { 34136 el.removeAttribute('class'); 34137 } 34138 } else { 34139 var cur = " " + (el.getAttribute('class') || '') + " "; 34140 var tar = ' ' + cls + ' '; 34141 while (cur.indexOf(tar) >= 0) { 34142 cur = cur.replace(tar, ' '); 34143 } 34144 cur = cur.trim(); 34145 if (cur) { 34146 el.setAttribute('class', cur); 34147 } else { 34148 el.removeAttribute('class'); 34149 } 34150 } 34151} 34152 34153/* */ 34154 34155function resolveTransition (def) { 34156 if (!def) { 34157 return 34158 } 34159 /* istanbul ignore else */ 34160 if (typeof def === 'object') { 34161 var res = {}; 34162 if (def.css !== false) { 34163 extend(res, autoCssTransition(def.name || 'v')); 34164 } 34165 extend(res, def); 34166 return res 34167 } else if (typeof def === 'string') { 34168 return autoCssTransition(def) 34169 } 34170} 34171 34172var autoCssTransition = cached(function (name) { 34173 return { 34174 enterClass: (name + "-enter"), 34175 enterToClass: (name + "-enter-to"), 34176 enterActiveClass: (name + "-enter-active"), 34177 leaveClass: (name + "-leave"), 34178 leaveToClass: (name + "-leave-to"), 34179 leaveActiveClass: (name + "-leave-active") 34180 } 34181}); 34182 34183var hasTransition = inBrowser && !isIE9; 34184var TRANSITION = 'transition'; 34185var ANIMATION = 'animation'; 34186 34187// Transition property/event sniffing 34188var transitionProp = 'transition'; 34189var transitionEndEvent = 'transitionend'; 34190var animationProp = 'animation'; 34191var animationEndEvent = 'animationend'; 34192if (hasTransition) { 34193 /* istanbul ignore if */ 34194 if (window.ontransitionend === undefined && 34195 window.onwebkittransitionend !== undefined 34196 ) { 34197 transitionProp = 'WebkitTransition'; 34198 transitionEndEvent = 'webkitTransitionEnd'; 34199 } 34200 if (window.onanimationend === undefined && 34201 window.onwebkitanimationend !== undefined 34202 ) { 34203 animationProp = 'WebkitAnimation'; 34204 animationEndEvent = 'webkitAnimationEnd'; 34205 } 34206} 34207 34208// binding to window is necessary to make hot reload work in IE in strict mode 34209var raf = inBrowser 34210 ? window.requestAnimationFrame 34211 ? window.requestAnimationFrame.bind(window) 34212 : setTimeout 34213 : /* istanbul ignore next */ function (fn) { return fn(); }; 34214 34215function nextFrame (fn) { 34216 raf(function () { 34217 raf(fn); 34218 }); 34219} 34220 34221function addTransitionClass (el, cls) { 34222 var transitionClasses = el._transitionClasses || (el._transitionClasses = []); 34223 if (transitionClasses.indexOf(cls) < 0) { 34224 transitionClasses.push(cls); 34225 addClass(el, cls); 34226 } 34227} 34228 34229function removeTransitionClass (el, cls) { 34230 if (el._transitionClasses) { 34231 remove(el._transitionClasses, cls); 34232 } 34233 removeClass(el, cls); 34234} 34235 34236function whenTransitionEnds ( 34237 el, 34238 expectedType, 34239 cb 34240) { 34241 var ref = getTransitionInfo(el, expectedType); 34242 var type = ref.type; 34243 var timeout = ref.timeout; 34244 var propCount = ref.propCount; 34245 if (!type) { return cb() } 34246 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent; 34247 var ended = 0; 34248 var end = function () { 34249 el.removeEventListener(event, onEnd); 34250 cb(); 34251 }; 34252 var onEnd = function (e) { 34253 if (e.target === el) { 34254 if (++ended >= propCount) { 34255 end(); 34256 } 34257 } 34258 }; 34259 setTimeout(function () { 34260 if (ended < propCount) { 34261 end(); 34262 } 34263 }, timeout + 1); 34264 el.addEventListener(event, onEnd); 34265} 34266 34267var transformRE = /\b(transform|all)(,|$)/; 34268 34269function getTransitionInfo (el, expectedType) { 34270 var styles = window.getComputedStyle(el); 34271 var transitionDelays = styles[transitionProp + 'Delay'].split(', '); 34272 var transitionDurations = styles[transitionProp + 'Duration'].split(', '); 34273 var transitionTimeout = getTimeout(transitionDelays, transitionDurations); 34274 var animationDelays = styles[animationProp + 'Delay'].split(', '); 34275 var animationDurations = styles[animationProp + 'Duration'].split(', '); 34276 var animationTimeout = getTimeout(animationDelays, animationDurations); 34277 34278 var type; 34279 var timeout = 0; 34280 var propCount = 0; 34281 /* istanbul ignore if */ 34282 if (expectedType === TRANSITION) { 34283 if (transitionTimeout > 0) { 34284 type = TRANSITION; 34285 timeout = transitionTimeout; 34286 propCount = transitionDurations.length; 34287 } 34288 } else if (expectedType === ANIMATION) { 34289 if (animationTimeout > 0) { 34290 type = ANIMATION; 34291 timeout = animationTimeout; 34292 propCount = animationDurations.length; 34293 } 34294 } else { 34295 timeout = Math.max(transitionTimeout, animationTimeout); 34296 type = timeout > 0 34297 ? transitionTimeout > animationTimeout 34298 ? TRANSITION 34299 : ANIMATION 34300 : null; 34301 propCount = type 34302 ? type === TRANSITION 34303 ? transitionDurations.length 34304 : animationDurations.length 34305 : 0; 34306 } 34307 var hasTransform = 34308 type === TRANSITION && 34309 transformRE.test(styles[transitionProp + 'Property']); 34310 return { 34311 type: type, 34312 timeout: timeout, 34313 propCount: propCount, 34314 hasTransform: hasTransform 34315 } 34316} 34317 34318function getTimeout (delays, durations) { 34319 /* istanbul ignore next */ 34320 while (delays.length < durations.length) { 34321 delays = delays.concat(delays); 34322 } 34323 34324 return Math.max.apply(null, durations.map(function (d, i) { 34325 return toMs(d) + toMs(delays[i]) 34326 })) 34327} 34328 34329function toMs (s) { 34330 return Number(s.slice(0, -1)) * 1000 34331} 34332 34333/* */ 34334 34335function enter (vnode, toggleDisplay) { 34336 var el = vnode.elm; 34337 34338 // call leave callback now 34339 if (isDef(el._leaveCb)) { 34340 el._leaveCb.cancelled = true; 34341 el._leaveCb(); 34342 } 34343 34344 var data = resolveTransition(vnode.data.transition); 34345 if (isUndef(data)) { 34346 return 34347 } 34348 34349 /* istanbul ignore if */ 34350 if (isDef(el._enterCb) || el.nodeType !== 1) { 34351 return 34352 } 34353 34354 var css = data.css; 34355 var type = data.type; 34356 var enterClass = data.enterClass; 34357 var enterToClass = data.enterToClass; 34358 var enterActiveClass = data.enterActiveClass; 34359 var appearClass = data.appearClass; 34360 var appearToClass = data.appearToClass; 34361 var appearActiveClass = data.appearActiveClass; 34362 var beforeEnter = data.beforeEnter; 34363 var enter = data.enter; 34364 var afterEnter = data.afterEnter; 34365 var enterCancelled = data.enterCancelled; 34366 var beforeAppear = data.beforeAppear; 34367 var appear = data.appear; 34368 var afterAppear = data.afterAppear; 34369 var appearCancelled = data.appearCancelled; 34370 var duration = data.duration; 34371 34372 // activeInstance will always be the <transition> component managing this 34373 // transition. One edge case to check is when the <transition> is placed 34374 // as the root node of a child component. In that case we need to check 34375 // <transition>'s parent for appear check. 34376 var context = activeInstance; 34377 var transitionNode = activeInstance.$vnode; 34378 while (transitionNode && transitionNode.parent) { 34379 transitionNode = transitionNode.parent; 34380 context = transitionNode.context; 34381 } 34382 34383 var isAppear = !context._isMounted || !vnode.isRootInsert; 34384 34385 if (isAppear && !appear && appear !== '') { 34386 return 34387 } 34388 34389 var startClass = isAppear && appearClass 34390 ? appearClass 34391 : enterClass; 34392 var activeClass = isAppear && appearActiveClass 34393 ? appearActiveClass 34394 : enterActiveClass; 34395 var toClass = isAppear && appearToClass 34396 ? appearToClass 34397 : enterToClass; 34398 34399 var beforeEnterHook = isAppear 34400 ? (beforeAppear || beforeEnter) 34401 : beforeEnter; 34402 var enterHook = isAppear 34403 ? (typeof appear === 'function' ? appear : enter) 34404 : enter; 34405 var afterEnterHook = isAppear 34406 ? (afterAppear || afterEnter) 34407 : afterEnter; 34408 var enterCancelledHook = isAppear 34409 ? (appearCancelled || enterCancelled) 34410 : enterCancelled; 34411 34412 var explicitEnterDuration = toNumber( 34413 isObject(duration) 34414 ? duration.enter 34415 : duration 34416 ); 34417 34418 if ("development" !== 'production' && explicitEnterDuration != null) { 34419 checkDuration(explicitEnterDuration, 'enter', vnode); 34420 } 34421 34422 var expectsCSS = css !== false && !isIE9; 34423 var userWantsControl = getHookArgumentsLength(enterHook); 34424 34425 var cb = el._enterCb = once(function () { 34426 if (expectsCSS) { 34427 removeTransitionClass(el, toClass); 34428 removeTransitionClass(el, activeClass); 34429 } 34430 if (cb.cancelled) { 34431 if (expectsCSS) { 34432 removeTransitionClass(el, startClass); 34433 } 34434 enterCancelledHook && enterCancelledHook(el); 34435 } else { 34436 afterEnterHook && afterEnterHook(el); 34437 } 34438 el._enterCb = null; 34439 }); 34440 34441 if (!vnode.data.show) { 34442 // remove pending leave element on enter by injecting an insert hook 34443 mergeVNodeHook(vnode, 'insert', function () { 34444 var parent = el.parentNode; 34445 var pendingNode = parent && parent._pending && parent._pending[vnode.key]; 34446 if (pendingNode && 34447 pendingNode.tag === vnode.tag && 34448 pendingNode.elm._leaveCb 34449 ) { 34450 pendingNode.elm._leaveCb(); 34451 } 34452 enterHook && enterHook(el, cb); 34453 }); 34454 } 34455 34456 // start enter transition 34457 beforeEnterHook && beforeEnterHook(el); 34458 if (expectsCSS) { 34459 addTransitionClass(el, startClass); 34460 addTransitionClass(el, activeClass); 34461 nextFrame(function () { 34462 removeTransitionClass(el, startClass); 34463 if (!cb.cancelled) { 34464 addTransitionClass(el, toClass); 34465 if (!userWantsControl) { 34466 if (isValidDuration(explicitEnterDuration)) { 34467 setTimeout(cb, explicitEnterDuration); 34468 } else { 34469 whenTransitionEnds(el, type, cb); 34470 } 34471 } 34472 } 34473 }); 34474 } 34475 34476 if (vnode.data.show) { 34477 toggleDisplay && toggleDisplay(); 34478 enterHook && enterHook(el, cb); 34479 } 34480 34481 if (!expectsCSS && !userWantsControl) { 34482 cb(); 34483 } 34484} 34485 34486function leave (vnode, rm) { 34487 var el = vnode.elm; 34488 34489 // call enter callback now 34490 if (isDef(el._enterCb)) { 34491 el._enterCb.cancelled = true; 34492 el._enterCb(); 34493 } 34494 34495 var data = resolveTransition(vnode.data.transition); 34496 if (isUndef(data) || el.nodeType !== 1) { 34497 return rm() 34498 } 34499 34500 /* istanbul ignore if */ 34501 if (isDef(el._leaveCb)) { 34502 return 34503 } 34504 34505 var css = data.css; 34506 var type = data.type; 34507 var leaveClass = data.leaveClass; 34508 var leaveToClass = data.leaveToClass; 34509 var leaveActiveClass = data.leaveActiveClass; 34510 var beforeLeave = data.beforeLeave; 34511 var leave = data.leave; 34512 var afterLeave = data.afterLeave; 34513 var leaveCancelled = data.leaveCancelled; 34514 var delayLeave = data.delayLeave; 34515 var duration = data.duration; 34516 34517 var expectsCSS = css !== false && !isIE9; 34518 var userWantsControl = getHookArgumentsLength(leave); 34519 34520 var explicitLeaveDuration = toNumber( 34521 isObject(duration) 34522 ? duration.leave 34523 : duration 34524 ); 34525 34526 if ("development" !== 'production' && isDef(explicitLeaveDuration)) { 34527 checkDuration(explicitLeaveDuration, 'leave', vnode); 34528 } 34529 34530 var cb = el._leaveCb = once(function () { 34531 if (el.parentNode && el.parentNode._pending) { 34532 el.parentNode._pending[vnode.key] = null; 34533 } 34534 if (expectsCSS) { 34535 removeTransitionClass(el, leaveToClass); 34536 removeTransitionClass(el, leaveActiveClass); 34537 } 34538 if (cb.cancelled) { 34539 if (expectsCSS) { 34540 removeTransitionClass(el, leaveClass); 34541 } 34542 leaveCancelled && leaveCancelled(el); 34543 } else { 34544 rm(); 34545 afterLeave && afterLeave(el); 34546 } 34547 el._leaveCb = null; 34548 }); 34549 34550 if (delayLeave) { 34551 delayLeave(performLeave); 34552 } else { 34553 performLeave(); 34554 } 34555 34556 function performLeave () { 34557 // the delayed leave may have already been cancelled 34558 if (cb.cancelled) { 34559 return 34560 } 34561 // record leaving element 34562 if (!vnode.data.show) { 34563 (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode; 34564 } 34565 beforeLeave && beforeLeave(el); 34566 if (expectsCSS) { 34567 addTransitionClass(el, leaveClass); 34568 addTransitionClass(el, leaveActiveClass); 34569 nextFrame(function () { 34570 removeTransitionClass(el, leaveClass); 34571 if (!cb.cancelled) { 34572 addTransitionClass(el, leaveToClass); 34573 if (!userWantsControl) { 34574 if (isValidDuration(explicitLeaveDuration)) { 34575 setTimeout(cb, explicitLeaveDuration); 34576 } else { 34577 whenTransitionEnds(el, type, cb); 34578 } 34579 } 34580 } 34581 }); 34582 } 34583 leave && leave(el, cb); 34584 if (!expectsCSS && !userWantsControl) { 34585 cb(); 34586 } 34587 } 34588} 34589 34590// only used in dev mode 34591function checkDuration (val, name, vnode) { 34592 if (typeof val !== 'number') { 34593 warn( 34594 "<transition> explicit " + name + " duration is not a valid number - " + 34595 "got " + (JSON.stringify(val)) + ".", 34596 vnode.context 34597 ); 34598 } else if (isNaN(val)) { 34599 warn( 34600 "<transition> explicit " + name + " duration is NaN - " + 34601 'the duration expression might be incorrect.', 34602 vnode.context 34603 ); 34604 } 34605} 34606 34607function isValidDuration (val) { 34608 return typeof val === 'number' && !isNaN(val) 34609} 34610 34611/** 34612 * Normalize a transition hook's argument length. The hook may be: 34613 * - a merged hook (invoker) with the original in .fns 34614 * - a wrapped component method (check ._length) 34615 * - a plain function (.length) 34616 */ 34617function getHookArgumentsLength (fn) { 34618 if (isUndef(fn)) { 34619 return false 34620 } 34621 var invokerFns = fn.fns; 34622 if (isDef(invokerFns)) { 34623 // invoker 34624 return getHookArgumentsLength( 34625 Array.isArray(invokerFns) 34626 ? invokerFns[0] 34627 : invokerFns 34628 ) 34629 } else { 34630 return (fn._length || fn.length) > 1 34631 } 34632} 34633 34634function _enter (_, vnode) { 34635 if (vnode.data.show !== true) { 34636 enter(vnode); 34637 } 34638} 34639 34640var transition = inBrowser ? { 34641 create: _enter, 34642 activate: _enter, 34643 remove: function remove$$1 (vnode, rm) { 34644 /* istanbul ignore else */ 34645 if (vnode.data.show !== true) { 34646 leave(vnode, rm); 34647 } else { 34648 rm(); 34649 } 34650 } 34651} : {} 34652 34653var platformModules = [ 34654 attrs, 34655 klass, 34656 events, 34657 domProps, 34658 style, 34659 transition 34660] 34661 34662/* */ 34663 34664// the directive module should be applied last, after all 34665// built-in modules have been applied. 34666var modules = platformModules.concat(baseModules); 34667 34668var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules }); 34669 34670/** 34671 * Not type checking this file because flow doesn't like attaching 34672 * properties to Elements. 34673 */ 34674 34675/* istanbul ignore if */ 34676if (isIE9) { 34677 // http://www.matts411.com/post/internet-explorer-9-oninput/ 34678 document.addEventListener('selectionchange', function () { 34679 var el = document.activeElement; 34680 if (el && el.vmodel) { 34681 trigger(el, 'input'); 34682 } 34683 }); 34684} 34685 34686var directive = { 34687 inserted: function inserted (el, binding, vnode, oldVnode) { 34688 if (vnode.tag === 'select') { 34689 // #6903 34690 if (oldVnode.elm && !oldVnode.elm._vOptions) { 34691 mergeVNodeHook(vnode, 'postpatch', function () { 34692 directive.componentUpdated(el, binding, vnode); 34693 }); 34694 } else { 34695 setSelected(el, binding, vnode.context); 34696 } 34697 el._vOptions = [].map.call(el.options, getValue); 34698 } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) { 34699 el._vModifiers = binding.modifiers; 34700 if (!binding.modifiers.lazy) { 34701 el.addEventListener('compositionstart', onCompositionStart); 34702 el.addEventListener('compositionend', onCompositionEnd); 34703 // Safari < 10.2 & UIWebView doesn't fire compositionend when 34704 // switching focus before confirming composition choice 34705 // this also fixes the issue where some browsers e.g. iOS Chrome 34706 // fires "change" instead of "input" on autocomplete. 34707 el.addEventListener('change', onCompositionEnd); 34708 /* istanbul ignore if */ 34709 if (isIE9) { 34710 el.vmodel = true; 34711 } 34712 } 34713 } 34714 }, 34715 34716 componentUpdated: function componentUpdated (el, binding, vnode) { 34717 if (vnode.tag === 'select') { 34718 setSelected(el, binding, vnode.context); 34719 // in case the options rendered by v-for have changed, 34720 // it's possible that the value is out-of-sync with the rendered options. 34721 // detect such cases and filter out values that no longer has a matching 34722 // option in the DOM. 34723 var prevOptions = el._vOptions; 34724 var curOptions = el._vOptions = [].map.call(el.options, getValue); 34725 if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) { 34726 // trigger change event if 34727 // no matching option found for at least one value 34728 var needReset = el.multiple 34729 ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); }) 34730 : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions); 34731 if (needReset) { 34732 trigger(el, 'change'); 34733 } 34734 } 34735 } 34736 } 34737}; 34738 34739function setSelected (el, binding, vm) { 34740 actuallySetSelected(el, binding, vm); 34741 /* istanbul ignore if */ 34742 if (isIE || isEdge) { 34743 setTimeout(function () { 34744 actuallySetSelected(el, binding, vm); 34745 }, 0); 34746 } 34747} 34748 34749function actuallySetSelected (el, binding, vm) { 34750 var value = binding.value; 34751 var isMultiple = el.multiple; 34752 if (isMultiple && !Array.isArray(value)) { 34753 "development" !== 'production' && warn( 34754 "<select multiple v-model=\"" + (binding.expression) + "\"> " + 34755 "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)), 34756 vm 34757 ); 34758 return 34759 } 34760 var selected, option; 34761 for (var i = 0, l = el.options.length; i < l; i++) { 34762 option = el.options[i]; 34763 if (isMultiple) { 34764 selected = looseIndexOf(value, getValue(option)) > -1; 34765 if (option.selected !== selected) { 34766 option.selected = selected; 34767 } 34768 } else { 34769 if (looseEqual(getValue(option), value)) { 34770 if (el.selectedIndex !== i) { 34771 el.selectedIndex = i; 34772 } 34773 return 34774 } 34775 } 34776 } 34777 if (!isMultiple) { 34778 el.selectedIndex = -1; 34779 } 34780} 34781 34782function hasNoMatchingOption (value, options) { 34783 return options.every(function (o) { return !looseEqual(o, value); }) 34784} 34785 34786function getValue (option) { 34787 return '_value' in option 34788 ? option._value 34789 : option.value 34790} 34791 34792function onCompositionStart (e) { 34793 e.target.composing = true; 34794} 34795 34796function onCompositionEnd (e) { 34797 // prevent triggering an input event for no reason 34798 if (!e.target.composing) { return } 34799 e.target.composing = false; 34800 trigger(e.target, 'input'); 34801} 34802 34803function trigger (el, type) { 34804 var e = document.createEvent('HTMLEvents'); 34805 e.initEvent(type, true, true); 34806 el.dispatchEvent(e); 34807} 34808 34809/* */ 34810 34811// recursively search for possible transition defined inside the component root 34812function locateNode (vnode) { 34813 return vnode.componentInstance && (!vnode.data || !vnode.data.transition) 34814 ? locateNode(vnode.componentInstance._vnode) 34815 : vnode 34816} 34817 34818var show = { 34819 bind: function bind (el, ref, vnode) { 34820 var value = ref.value; 34821 34822 vnode = locateNode(vnode); 34823 var transition$$1 = vnode.data && vnode.data.transition; 34824 var originalDisplay = el.__vOriginalDisplay = 34825 el.style.display === 'none' ? '' : el.style.display; 34826 if (value && transition$$1) { 34827 vnode.data.show = true; 34828 enter(vnode, function () { 34829 el.style.display = originalDisplay; 34830 }); 34831 } else { 34832 el.style.display = value ? originalDisplay : 'none'; 34833 } 34834 }, 34835 34836 update: function update (el, ref, vnode) { 34837 var value = ref.value; 34838 var oldValue = ref.oldValue; 34839 34840 /* istanbul ignore if */ 34841 if (!value === !oldValue) { return } 34842 vnode = locateNode(vnode); 34843 var transition$$1 = vnode.data && vnode.data.transition; 34844 if (transition$$1) { 34845 vnode.data.show = true; 34846 if (value) { 34847 enter(vnode, function () { 34848 el.style.display = el.__vOriginalDisplay; 34849 }); 34850 } else { 34851 leave(vnode, function () { 34852 el.style.display = 'none'; 34853 }); 34854 } 34855 } else { 34856 el.style.display = value ? el.__vOriginalDisplay : 'none'; 34857 } 34858 }, 34859 34860 unbind: function unbind ( 34861 el, 34862 binding, 34863 vnode, 34864 oldVnode, 34865 isDestroy 34866 ) { 34867 if (!isDestroy) { 34868 el.style.display = el.__vOriginalDisplay; 34869 } 34870 } 34871} 34872 34873var platformDirectives = { 34874 model: directive, 34875 show: show 34876} 34877 34878/* */ 34879 34880// Provides transition support for a single element/component. 34881// supports transition mode (out-in / in-out) 34882 34883var transitionProps = { 34884 name: String, 34885 appear: Boolean, 34886 css: Boolean, 34887 mode: String, 34888 type: String, 34889 enterClass: String, 34890 leaveClass: String, 34891 enterToClass: String, 34892 leaveToClass: String, 34893 enterActiveClass: String, 34894 leaveActiveClass: String, 34895 appearClass: String, 34896 appearActiveClass: String, 34897 appearToClass: String, 34898 duration: [Number, String, Object] 34899}; 34900 34901// in case the child is also an abstract component, e.g. <keep-alive> 34902// we want to recursively retrieve the real component to be rendered 34903function getRealChild (vnode) { 34904 var compOptions = vnode && vnode.componentOptions; 34905 if (compOptions && compOptions.Ctor.options.abstract) { 34906 return getRealChild(getFirstComponentChild(compOptions.children)) 34907 } else { 34908 return vnode 34909 } 34910} 34911 34912function extractTransitionData (comp) { 34913 var data = {}; 34914 var options = comp.$options; 34915 // props 34916 for (var key in options.propsData) { 34917 data[key] = comp[key]; 34918 } 34919 // events. 34920 // extract listeners and pass them directly to the transition methods 34921 var listeners = options._parentListeners; 34922 for (var key$1 in listeners) { 34923 data[camelize(key$1)] = listeners[key$1]; 34924 } 34925 return data 34926} 34927 34928function placeholder (h, rawChild) { 34929 if (/\d-keep-alive$/.test(rawChild.tag)) { 34930 return h('keep-alive', { 34931 props: rawChild.componentOptions.propsData 34932 }) 34933 } 34934} 34935 34936function hasParentTransition (vnode) { 34937 while ((vnode = vnode.parent)) { 34938 if (vnode.data.transition) { 34939 return true 34940 } 34941 } 34942} 34943 34944function isSameChild (child, oldChild) { 34945 return oldChild.key === child.key && oldChild.tag === child.tag 34946} 34947 34948var Transition = { 34949 name: 'transition', 34950 props: transitionProps, 34951 abstract: true, 34952 34953 render: function render (h) { 34954 var this$1 = this; 34955 34956 var children = this.$slots.default; 34957 if (!children) { 34958 return 34959 } 34960 34961 // filter out text nodes (possible whitespaces) 34962 children = children.filter(function (c) { return c.tag || isAsyncPlaceholder(c); }); 34963 /* istanbul ignore if */ 34964 if (!children.length) { 34965 return 34966 } 34967 34968 // warn multiple elements 34969 if ("development" !== 'production' && children.length > 1) { 34970 warn( 34971 '<transition> can only be used on a single element. Use ' + 34972 '<transition-group> for lists.', 34973 this.$parent 34974 ); 34975 } 34976 34977 var mode = this.mode; 34978 34979 // warn invalid mode 34980 if ("development" !== 'production' && 34981 mode && mode !== 'in-out' && mode !== 'out-in' 34982 ) { 34983 warn( 34984 'invalid <transition> mode: ' + mode, 34985 this.$parent 34986 ); 34987 } 34988 34989 var rawChild = children[0]; 34990 34991 // if this is a component root node and the component's 34992 // parent container node also has transition, skip. 34993 if (hasParentTransition(this.$vnode)) { 34994 return rawChild 34995 } 34996 34997 // apply transition data to child 34998 // use getRealChild() to ignore abstract components e.g. keep-alive 34999 var child = getRealChild(rawChild); 35000 /* istanbul ignore if */ 35001 if (!child) { 35002 return rawChild 35003 } 35004 35005 if (this._leaving) { 35006 return placeholder(h, rawChild) 35007 } 35008 35009 // ensure a key that is unique to the vnode type and to this transition 35010 // component instance. This key will be used to remove pending leaving nodes 35011 // during entering. 35012 var id = "__transition-" + (this._uid) + "-"; 35013 child.key = child.key == null 35014 ? child.isComment 35015 ? id + 'comment' 35016 : id + child.tag 35017 : isPrimitive(child.key) 35018 ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key) 35019 : child.key; 35020 35021 var data = (child.data || (child.data = {})).transition = extractTransitionData(this); 35022 var oldRawChild = this._vnode; 35023 var oldChild = getRealChild(oldRawChild); 35024 35025 // mark v-show 35026 // so that the transition module can hand over the control to the directive 35027 if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) { 35028 child.data.show = true; 35029 } 35030 35031 if ( 35032 oldChild && 35033 oldChild.data && 35034 !isSameChild(child, oldChild) && 35035 !isAsyncPlaceholder(oldChild) && 35036 // #6687 component root is a comment node 35037 !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment) 35038 ) { 35039 // replace old child transition data with fresh one 35040 // important for dynamic transitions! 35041 var oldData = oldChild.data.transition = extend({}, data); 35042 // handle transition mode 35043 if (mode === 'out-in') { 35044 // return placeholder node and queue update when leave finishes 35045 this._leaving = true; 35046 mergeVNodeHook(oldData, 'afterLeave', function () { 35047 this$1._leaving = false; 35048 this$1.$forceUpdate(); 35049 }); 35050 return placeholder(h, rawChild) 35051 } else if (mode === 'in-out') { 35052 if (isAsyncPlaceholder(child)) { 35053 return oldRawChild 35054 } 35055 var delayedLeave; 35056 var performLeave = function () { delayedLeave(); }; 35057 mergeVNodeHook(data, 'afterEnter', performLeave); 35058 mergeVNodeHook(data, 'enterCancelled', performLeave); 35059 mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; }); 35060 } 35061 } 35062 35063 return rawChild 35064 } 35065} 35066 35067/* */ 35068 35069// Provides transition support for list items. 35070// supports move transitions using the FLIP technique. 35071 35072// Because the vdom's children update algorithm is "unstable" - i.e. 35073// it doesn't guarantee the relative positioning of removed elements, 35074// we force transition-group to update its children into two passes: 35075// in the first pass, we remove all nodes that need to be removed, 35076// triggering their leaving transition; in the second pass, we insert/move 35077// into the final desired state. This way in the second pass removed 35078// nodes will remain where they should be. 35079 35080var props = extend({ 35081 tag: String, 35082 moveClass: String 35083}, transitionProps); 35084 35085delete props.mode; 35086 35087var TransitionGroup = { 35088 props: props, 35089 35090 render: function render (h) { 35091 var tag = this.tag || this.$vnode.data.tag || 'span'; 35092 var map = Object.create(null); 35093 var prevChildren = this.prevChildren = this.children; 35094 var rawChildren = this.$slots.default || []; 35095 var children = this.children = []; 35096 var transitionData = extractTransitionData(this); 35097 35098 for (var i = 0; i < rawChildren.length; i++) { 35099 var c = rawChildren[i]; 35100 if (c.tag) { 35101 if (c.key != null && String(c.key).indexOf('__vlist') !== 0) { 35102 children.push(c); 35103 map[c.key] = c 35104 ;(c.data || (c.data = {})).transition = transitionData; 35105 } else {
35106 var opts = c.componentOptions; 35107 var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag; 35108 warn(("<transition-group> children must be keyed: <" + name + ">")); 35109 } 35110 } 35111 } 35112 35113 if (prevChildren) { 35114 var kept = []; 35115 var removed = []; 35116 for (var i$1 = 0; i$1 < prevChildren.length; i$1++) { 35117 var c$1 = prevChildren[i$1]; 35118 c$1.data.transition = transitionData; 35119 c$1.data.pos = c$1.elm.getBoundingClientRect(); 35120 if (map[c$1.key]) { 35121 kept.push(c$1); 35122 } else { 35123 removed.push(c$1); 35124 } 35125 } 35126 this.kept = h(tag, null, kept); 35127 this.removed = removed; 35128 } 35129 35130 return h(tag, null, children) 35131 }, 35132 35133 beforeUpdate: function beforeUpdate () { 35134 // force removing pass 35135 this.__patch__( 35136 this._vnode, 35137 this.kept, 35138 false, // hydrating 35139 true // removeOnly (!important, avoids unnecessary moves) 35140 ); 35141 this._vnode = this.kept; 35142 }, 35143 35144 updated: function updated () { 35145 var children = this.prevChildren; 35146 var moveClass = this.moveClass || ((this.name || 'v') + '-move'); 35147 if (!children.length || !this.hasMove(children[0].elm, moveClass)) { 35148 return 35149 } 35150 35151 // we divide the work into three loops to avoid mixing DOM reads and writes 35152 // in each iteration - which helps prevent layout thrashing. 35153 children.forEach(callPendingCbs); 35154 children.forEach(recordPosition); 35155 children.forEach(applyTranslation); 35156 35157 // force reflow to put everything in position 35158 // assign to this to avoid being removed in tree-shaking 35159 // $flow-disable-line 35160 this._reflow = document.body.offsetHeight; 35161 35162 children.forEach(function (c) { 35163 if (c.data.moved) { 35164 var el = c.elm; 35165 var s = el.style; 35166 addTransitionClass(el, moveClass); 35167 s.transform = s.WebkitTransform = s.transitionDuration = ''; 35168 el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) { 35169 if (!e || /transform$/.test(e.propertyName)) { 35170 el.removeEventListener(transitionEndEvent, cb); 35171 el._moveCb = null; 35172 removeTransitionClass(el, moveClass); 35173 } 35174 }); 35175 } 35176 }); 35177 }, 35178 35179 methods: { 35180 hasMove: function hasMove (el, moveClass) { 35181 /* istanbul ignore if */ 35182 if (!hasTransition) { 35183 return false 35184 } 35185 /* istanbul ignore if */ 35186 if (this._hasMove) { 35187 return this._hasMove 35188 } 35189 // Detect whether an element with the move class applied has 35190 // CSS transitions. Since the element may be inside an entering 35191 // transition at this very moment, we make a clone of it and remove 35192 // all other transition classes applied to ensure only the move class 35193 // is applied. 35194 var clone = el.cloneNode(); 35195 if (el._transitionClasses) { 35196 el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); }); 35197 } 35198 addClass(clone, moveClass); 35199 clone.style.display = 'none'; 35200 this.$el.appendChild(clone); 35201 var info = getTransitionInfo(clone); 35202 this.$el.removeChild(clone); 35203 return (this._hasMove = info.hasTransform) 35204 } 35205 } 35206} 35207 35208function callPendingCbs (c) { 35209 /* istanbul ignore if */ 35210 if (c.elm._moveCb) { 35211 c.elm._moveCb(); 35212 } 35213 /* istanbul ignore if */ 35214 if (c.elm._enterCb) { 35215 c.elm._enterCb(); 35216 } 35217} 35218 35219function recordPosition (c) { 35220 c.data.newPos = c.elm.getBoundingClientRect(); 35221} 35222 35223function applyTranslation (c) { 35224 var oldPos = c.data.pos; 35225 var newPos = c.data.newPos; 35226 var dx = oldPos.left - newPos.left; 35227 var dy = oldPos.top - newPos.top; 35228 if (dx || dy) { 35229 c.data.moved = true; 35230 var s = c.elm.style; 35231 s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)"; 35232 s.transitionDuration = '0s'; 35233 } 35234} 35235 35236var platformComponents = { 35237 Transition: Transition, 35238 TransitionGroup: TransitionGroup 35239} 35240 35241/* */ 35242 35243// install platform specific utils 35244Vue.config.mustUseProp = mustUseProp; 35245Vue.config.isReservedTag = isReservedTag; 35246Vue.config.isReservedAttr = isReservedAttr; 35247Vue.config.getTagNamespace = getTagNamespace; 35248Vue.config.isUnknownElement = isUnknownElement; 35249 35250// install platform runtime directives & components 35251extend(Vue.options.directives, platformDirectives); 35252extend(Vue.options.components, platformComponents); 35253 35254// install platform patch function 35255Vue.prototype.__patch__ = inBrowser ? patch : noop; 35256 35257// public mount method 35258Vue.prototype.$mount = function ( 35259 el, 35260 hydrating 35261) { 35262 el = el && inBrowser ? query(el) : undefined; 35263 return mountComponent(this, el, hydrating) 35264}; 35265 35266// devtools global hook 35267/* istanbul ignore next */ 35268if (inBrowser) { 35269 setTimeout(function () { 35270 if (config.devtools) { 35271 if (devtools) { 35272 devtools.emit('init', Vue); 35273 } else if ( 35274 "development" !== 'production' && 35275 "development" !== 'test' && 35276 isChrome 35277 ) { 35278 console[console.info ? 'info' : 'log']( 35279 'Download the Vue Devtools extension for a better development experience:\n' + 35280 'https://github.com/vuejs/vue-devtools' 35281 ); 35282 } 35283 } 35284 if ("development" !== 'production' && 35285 "development" !== 'test' && 35286 config.productionTip !== false && 35287 typeof console !== 'undefined' 35288 ) { 35289 console[console.info ? 'info' : 'log']( 35290 "You are running Vue in development mode.\n" + 35291 "Make sure to turn on production mode when deploying for production.\n" + 35292 "See more tips at https://vuejs.org/guide/deployment.html" 35293 ); 35294 } 35295 }, 0); 35296} 35297 35298/* */ 35299 35300var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g; 35301var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g; 35302 35303var buildRegex = cached(function (delimiters) { 35304 var open = delimiters[0].replace(regexEscapeRE, '\\$&'); 35305 var close = delimiters[1].replace(regexEscapeRE, '\\$&'); 35306 return new RegExp(open + '((?:.|\\n)+?)' + close, 'g') 35307}); 35308 35309 35310 35311function parseText ( 35312 text, 35313 delimiters 35314) { 35315 var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE; 35316 if (!tagRE.test(text)) { 35317 return 35318 } 35319 var tokens = []; 35320 var rawTokens = []; 35321 var lastIndex = tagRE.lastIndex = 0; 35322 var match, index, tokenValue; 35323 while ((match = tagRE.exec(text))) { 35324 index = match.index; 35325 // push text token 35326 if (index > lastIndex) { 35327 rawTokens.push(tokenValue = text.slice(lastIndex, index)); 35328 tokens.push(JSON.stringify(tokenValue)); 35329 } 35330 // tag token 35331 var exp = parseFilters(match[1].trim()); 35332 tokens.push(("_s(" + exp + ")")); 35333 rawTokens.push({ '@binding': exp }); 35334 lastIndex = index + match[0].length; 35335 } 35336 if (lastIndex < text.length) { 35337 rawTokens.push(tokenValue = text.slice(lastIndex)); 35338 tokens.push(JSON.stringify(tokenValue)); 35339 } 35340 return { 35341 expression: tokens.join('+'), 35342 tokens: rawTokens 35343 } 35344} 35345 35346/* */ 35347 35348function transformNode (el, options) { 35349 var warn = options.warn || baseWarn; 35350 var staticClass = getAndRemoveAttr(el, 'class'); 35351 if ("development" !== 'production' && staticClass) { 35352 var res = parseText(staticClass, options.delimiters); 35353 if (res) { 35354 warn( 35355 "class=\"" + staticClass + "\": " + 35356 'Interpolation inside attributes has been removed. ' + 35357 'Use v-bind or the colon shorthand instead. For example, ' + 35358 'instead of <div class="{{ val }}">, use <div :class="val">.' 35359 ); 35360 } 35361 } 35362 if (staticClass) { 35363 el.staticClass = JSON.stringify(staticClass); 35364 } 35365 var classBinding = getBindingAttr(el, 'class', false /* getStatic */); 35366 if (classBinding) { 35367 el.classBinding = classBinding; 35368 } 35369} 35370 35371function genData (el) { 35372 var data = ''; 35373 if (el.staticClass) { 35374 data += "staticClass:" + (el.staticClass) + ","; 35375 } 35376 if (el.classBinding) { 35377 data += "class:" + (el.classBinding) + ","; 35378 } 35379 return data 35380} 35381 35382var klass$1 = { 35383 staticKeys: ['staticClass'], 35384 transformNode: transformNode, 35385 genData: genData 35386} 35387 35388/* */ 35389 35390function transformNode$1 (el, options) { 35391 var warn = options.warn || baseWarn; 35392 var staticStyle = getAndRemoveAttr(el, 'style'); 35393 if (staticStyle) { 35394 /* istanbul ignore if */ 35395 { 35396 var res = parseText(staticStyle, options.delimiters); 35397 if (res) { 35398 warn( 35399 "style=\"" + staticStyle + "\": " + 35400 'Interpolation inside attributes has been removed. ' + 35401 'Use v-bind or the colon shorthand instead. For example, ' + 35402 'instead of <div style="{{ val }}">, use <div :style="val">.' 35403 ); 35404 } 35405 } 35406 el.staticStyle = JSON.stringify(parseStyleText(staticStyle)); 35407 } 35408 35409 var styleBinding = getBindingAttr(el, 'style', false /* getStatic */); 35410 if (styleBinding) { 35411 el.styleBinding = styleBinding; 35412 } 35413} 35414 35415function genData$1 (el) { 35416 var data = ''; 35417 if (el.staticStyle) { 35418 data += "staticStyle:" + (el.staticStyle) + ","; 35419 } 35420 if (el.styleBinding) { 35421 data += "style:(" + (el.styleBinding) + "),"; 35422 } 35423 return data 35424} 35425 35426var style$1 = { 35427 staticKeys: ['staticStyle'], 35428 transformNode: transformNode$1, 35429 genData: genData$1 35430} 35431 35432/* */ 35433 35434var decoder; 35435 35436var he = { 35437 decode: function decode (html) { 35438 decoder = decoder || document.createElement('div'); 35439 decoder.innerHTML = html; 35440 return decoder.textContent 35441 } 35442} 35443 35444/* */ 35445 35446var isUnaryTag = makeMap( 35447 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' + 35448 'link,meta,param,source,track,wbr' 35449); 35450 35451// Elements that you can, intentionally, leave open 35452// (and which close themselves) 35453var canBeLeftOpenTag = makeMap( 35454 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source' 35455); 35456 35457// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3 35458// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content 35459var isNonPhrasingTag = makeMap( 35460 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' + 35461 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' + 35462 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' + 35463 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' + 35464 'title,tr,track' 35465); 35466 35467/** 35468 * Not type-checking this file because it's mostly vendor code. 35469 */ 35470 35471/*! 35472 * HTML Parser By John Resig (ejohn.org) 35473 * Modified by Juriy "kangax" Zaytsev
35474 * Original code by Erik Arvidsson, Mozilla Public License 35475 * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js 35476 */ 35477 35478// Regular Expressions for parsing tags and attributes 35479var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; 35480// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName 35481// but for Vue templates we can enforce a simple charset 35482var ncname = '[a-zA-Z_][\\w\\-\\.]*'; 35483var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")"; 35484var startTagOpen = new RegExp(("^<" + qnameCapture)); 35485var startTagClose = /^\s*(\/?)>/; 35486var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); 35487var doctype = /^<!DOCTYPE [^>]+>/i; 35488// #7298: escape - to avoid being pased as HTML comment when inlined in page 35489var comment = /^<!\--/; 35490var conditionalComment = /^<!\[/; 35491 35492var IS_REGEX_CAPTURING_BROKEN = false; 35493'x'.replace(/x(.)?/g, function (m, g) { 35494 IS_REGEX_CAPTURING_BROKEN = g === ''; 35495}); 35496 35497// Special Elements (can contain anything) 35498var isPlainTextElement = makeMap('script,style,textarea', true); 35499var reCache = {}; 35500 35501var decodingMap = { 35502 '<': '<', 35503 '>': '>', 35504 '"': '"', 35505 '&': '&', 35506 ' ': '\n', 35507 '	': '\t' 35508}; 35509var encodedAttr = /&(?:lt|gt|quot|amp);/g; 35510var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10|#9);/g; 35511 35512// #5992 35513var isIgnoreNewlineTag = makeMap('pre,textarea', true); 35514var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; }; 35515 35516function decodeAttr (value, shouldDecodeNewlines) { 35517 var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr; 35518 return value.replace(re, function (match) { return decodingMap[match]; }) 35519} 35520 35521function parseHTML (html, options) { 35522 var stack = []; 35523 var expectHTML = options.expectHTML; 35524 var isUnaryTag$$1 = options.isUnaryTag || no; 35525 var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no; 35526 var index = 0; 35527 var last, lastTag; 35528 while (html) { 35529 last = html; 35530 // Make sure we're not in a plaintext content element like script/style 35531 if (!lastTag || !isPlainTextElement(lastTag)) { 35532 var textEnd = html.indexOf('<'); 35533 if (textEnd === 0) { 35534 // Comment: 35535 if (comment.test(html)) { 35536 var commentEnd = html.indexOf('-->'); 35537 35538 if (commentEnd >= 0) { 35539 if (options.shouldKeepComment) { 35540 options.comment(html.substring(4, commentEnd)); 35541 } 35542 advance(commentEnd + 3); 35543 continue 35544 } 35545 } 35546 35547 // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment 35548 if (conditionalComment.test(html)) { 35549 var conditionalEnd = html.indexOf(']>'); 35550 35551 if (conditionalEnd >= 0) { 35552 advance(conditionalEnd + 2); 35553 continue 35554 } 35555 } 35556 35557 // Doctype: 35558 var doctypeMatch = html.match(doctype); 35559 if (doctypeMatch) { 35560 advance(doctypeMatch[0].length); 35561 continue 35562 } 35563 35564 // End tag: 35565 var endTagMatch = html.match(endTag); 35566 if (endTagMatch) { 35567 var curIndex = index; 35568 advance(endTagMatch[0].length); 35569 parseEndTag(endTagMatch[1], curIndex, index); 35570 continue 35571 } 35572 35573 // Start tag: 35574 var startTagMatch = parseStartTag(); 35575 if (startTagMatch) { 35576 handleStartTag(startTagMatch); 35577 if (shouldIgnoreFirstNewline(lastTag, html)) { 35578 advance(1); 35579 } 35580 continue 35581 } 35582 } 35583 35584 var text = (void 0), rest = (void 0), next = (void 0); 35585 if (textEnd >= 0) { 35586 rest = html.slice(textEnd); 35587 while ( 35588 !endTag.test(rest) && 35589 !startTagOpen.test(rest) && 35590 !comment.test(rest) && 35591 !conditionalComment.test(rest) 35592 ) { 35593 // < in plain text, be forgiving and treat it as text 35594 next = rest.indexOf('<', 1); 35595 if (next < 0) { break } 35596 textEnd += next; 35597 rest = html.slice(textEnd); 35598 } 35599 text = html.substring(0, textEnd); 35600 advance(textEnd); 35601 } 35602 35603 if (textEnd < 0) { 35604 text = html; 35605 html = ''; 35606 } 35607 35608 if (options.chars && text) { 35609 options.chars(text); 35610 } 35611 } else { 35612 var endTagLength = 0; 35613 var stackedTag = lastTag.toLowerCase(); 35614 var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i')); 35615 var rest$1 = html.replace(reStackedTag, function (all, text, endTag) { 35616 endTagLength = endTag.length; 35617 if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') { 35618 text = text 35619 .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298 35620 .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1'); 35621 } 35622 if (shouldIgnoreFirstNewline(stackedTag, text)) { 35623 text = text.slice(1); 35624 } 35625 if (options.chars) { 35626 options.chars(text); 35627 } 35628 return '' 35629 }); 35630 index += html.length - rest$1.length; 35631 html = rest$1; 35632 parseEndTag(stackedTag, index - endTagLength, index); 35633 } 35634 35635 if (html === last) { 35636 options.chars && options.chars(html); 35637 if ("development" !== 'production' && !stack.length && options.warn) { 35638 options.warn(("Mal-formatted tag at end of template: \"" + html + "\"")); 35639 } 35640 break 35641 } 35642 } 35643 35644 // Clean up any remaining tags 35645 parseEndTag(); 35646 35647 function advance (n) { 35648 index += n; 35649 html = html.substring(n); 35650 } 35651 35652 function parseStartTag () { 35653 var start = html.match(startTagOpen); 35654 if (start) { 35655 var match = { 35656 tagName: start[1], 35657 attrs: [], 35658 start: index 35659 }; 35660 advance(start[0].length); 35661 var end, attr; 35662 while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) { 35663 advance(attr[0].length); 35664 match.attrs.push(attr); 35665 } 35666 if (end) { 35667 match.unarySlash = end[1]; 35668 advance(end[0].length); 35669 match.end = index; 35670 return match 35671 } 35672 } 35673 } 35674 35675 function handleStartTag (match) { 35676 var tagName = match.tagName; 35677 var unarySlash = match.unarySlash; 35678 35679 if (expectHTML) { 35680 if (lastTag === 'p' && isNonPhrasingTag(tagName)) { 35681 parseEndTag(lastTag); 35682 } 35683 if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) { 35684 parseEndTag(tagName); 35685 } 35686 } 35687 35688 var unary = isUnaryTag$$1(tagName) || !!unarySlash; 35689 35690 var l = match.attrs.length; 35691 var attrs = new Array(l); 35692 for (var i = 0; i < l; i++) { 35693 var args = match.attrs[i]; 35694 // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778 35695 if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) { 35696 if (args[3] === '') { delete args[3]; } 35697 if (args[4] === '') { delete args[4]; } 35698 if (args[5] === '') { delete args[5]; } 35699 } 35700 var value = args[3] || args[4] || args[5] || ''; 35701 var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href' 35702 ? options.shouldDecodeNewlinesForHref 35703 : options.shouldDecodeNewlines; 35704 attrs[i] = { 35705 name: args[1], 35706 value: decodeAttr(value, shouldDecodeNewlines) 35707 }; 35708 } 35709 35710 if (!unary) { 35711 stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs }); 35712 lastTag = tagName; 35713 } 35714 35715 if (options.start) { 35716 options.start(tagName, attrs, unary, match.start, match.end); 35717 } 35718 } 35719 35720 function parseEndTag (tagName, start, end) { 35721 var pos, lowerCasedTagName; 35722 if (start == null) { start = index; } 35723 if (end == null) { end = index; } 35724 35725 if (tagName) { 35726 lowerCasedTagName = tagName.toLowerCase(); 35727 } 35728 35729 // Find the closest opened tag of the same type 35730 if (tagName) { 35731 for (pos = stack.length - 1; pos >= 0; pos--) { 35732 if (stack[pos].lowerCasedTag === lowerCasedTagName) { 35733 break 35734 } 35735 } 35736 } else { 35737 // If no tag name is provided, clean shop 35738 pos = 0; 35739 } 35740 35741 if (pos >= 0) { 35742 // Close all the open elements, up the stack 35743 for (var i = stack.length - 1; i >= pos; i--) { 35744 if ("development" !== 'production' && 35745 (i > pos || !tagName) && 35746 options.warn 35747 ) { 35748 options.warn( 35749 ("tag <" + (stack[i].tag) + "> has no matching end tag.") 35750 ); 35751 } 35752 if (options.end) { 35753 options.end(stack[i].tag, start, end); 35754 } 35755 } 35756 35757 // Remove the open elements from the stack 35758 stack.length = pos; 35759 lastTag = pos && stack[pos - 1].tag; 35760 } else if (lowerCasedTagName === 'br') { 35761 if (options.start) { 35762 options.start(tagName, [], true, start, end); 35763 } 35764 } else if (lowerCasedTagName === 'p') { 35765 if (options.start) { 35766 options.start(tagName, [], false, start, end); 35767 } 35768 if (options.end) { 35769 options.end(tagName, start, end); 35770 } 35771 } 35772 } 35773} 35774 35775/* */ 35776 35777var onRE = /^@|^v-on:/; 35778var dirRE = /^v-|^@|^:/; 35779var forAliasRE = /([^]*?)\s+(?:in|of)\s+([^]*)/; 35780var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; 35781var stripParensRE = /^\(|\)$/g; 35782 35783var argRE = /:(.*)$/; 35784var bindRE = /^:|^v-bind:/; 35785var modifierRE = /\.[^.]+/g; 35786
35787var decodeHTMLCached = cached(he.decode); 35788 35789// configurable state 35790var warn$2; 35791var delimiters; 35792var transforms; 35793var preTransforms; 35794var postTransforms; 35795var platformIsPreTag; 35796var platformMustUseProp; 35797var platformGetTagNamespace; 35798 35799 35800 35801function createASTElement ( 35802 tag, 35803 attrs, 35804 parent 35805) { 35806 return { 35807 type: 1, 35808 tag: tag, 35809 attrsList: attrs, 35810 attrsMap: makeAttrsMap(attrs), 35811 parent: parent, 35812 children: [] 35813 } 35814} 35815 35816/** 35817 * Convert HTML string to AST. 35818 */ 35819function parse ( 35820 template, 35821 options 35822) { 35823 warn$2 = options.warn || baseWarn; 35824 35825 platformIsPreTag = options.isPreTag || no; 35826 platformMustUseProp = options.mustUseProp || no; 35827 platformGetTagNamespace = options.getTagNamespace || no; 35828 35829 transforms = pluckModuleFunction(options.modules, 'transformNode'); 35830 preTransforms = pluckModuleFunction(options.modules, 'preTransformNode'); 35831 postTransforms = pluckModuleFunction(options.modules, 'postTransformNode'); 35832 35833 delimiters = options.delimiters; 35834 35835 var stack = []; 35836 var preserveWhitespace = options.preserveWhitespace !== false; 35837 var root; 35838 var currentParent; 35839 var inVPre = false; 35840 var inPre = false; 35841 var warned = false; 35842 35843 function warnOnce (msg) { 35844 if (!warned) { 35845 warned = true; 35846 warn$2(msg); 35847 } 35848 } 35849 35850 function closeElement (element) { 35851 // check pre state 35852 if (element.pre) { 35853 inVPre = false; 35854 } 35855 if (platformIsPreTag(element.tag)) { 35856 inPre = false; 35857 } 35858 // apply post-transforms 35859 for (var i = 0; i < postTransforms.length; i++) { 35860 postTransforms[i](element, options); 35861 } 35862 } 35863 35864 parseHTML(template, { 35865 warn: warn$2, 35866 expectHTML: options.expectHTML, 35867 isUnaryTag: options.isUnaryTag, 35868 canBeLeftOpenTag: options.canBeLeftOpenTag, 35869 shouldDecodeNewlines: options.shouldDecodeNewlines, 35870 shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref, 35871 shouldKeepComment: options.comments, 35872 start: function start (tag, attrs, unary) { 35873 // check namespace. 35874 // inherit parent ns if there is one 35875 var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag); 35876 35877 // handle IE svg bug 35878 /* istanbul ignore if */ 35879 if (isIE && ns === 'svg') { 35880 attrs = guardIESVGBug(attrs); 35881 } 35882 35883 var element = createASTElement(tag, attrs, currentParent); 35884 if (ns) { 35885 element.ns = ns; 35886 } 35887 35888 if (isForbiddenTag(element) && !isServerRendering()) { 35889 element.forbidden = true; 35890 "development" !== 'production' && warn$2( 35891 'Templates should only be responsible for mapping the state to the ' + 35892 'UI. Avoid placing tags with side-effects in your templates, such as ' + 35893 "<" + tag + ">" + ', as they will not be parsed.' 35894 ); 35895 } 35896 35897 // apply pre-transforms 35898 for (var i = 0; i < preTransforms.length; i++) { 35899 element = preTransforms[i](element, options) || element; 35900 } 35901 35902 if (!inVPre) { 35903 processPre(element); 35904 if (element.pre) { 35905 inVPre = true; 35906 } 35907 } 35908 if (platformIsPreTag(element.tag)) { 35909 inPre = true; 35910 } 35911 if (inVPre) { 35912 processRawAttrs(element); 35913 } else if (!element.processed) { 35914 // structural directives 35915 processFor(element); 35916 processIf(element); 35917 processOnce(element); 35918 // element-scope stuff 35919 processElement(element, options); 35920 } 35921 35922 function checkRootConstraints (el) { 35923 { 35924 if (el.tag === 'slot' || el.tag === 'template') { 35925 warnOnce( 35926 "Cannot use <" + (el.tag) + "> as component root element because it may " + 35927 'contain multiple nodes.' 35928 ); 35929 } 35930 if (el.attrsMap.hasOwnProperty('v-for')) { 35931 warnOnce( 35932 'Cannot use v-for on stateful component root element because ' + 35933 'it renders multiple elements.' 35934 ); 35935 } 35936 } 35937 } 35938 35939 // tree management 35940 if (!root) { 35941 root = element; 35942 checkRootConstraints(root); 35943 } else if (!stack.length) { 35944 // allow root elements with v-if, v-else-if and v-else 35945 if (root.if && (element.elseif || element.else)) { 35946 checkRootConstraints(element); 35947 addIfCondition(root, { 35948 exp: element.elseif, 35949 block: element 35950 }); 35951 } else { 35952 warnOnce( 35953 "Component template should contain exactly one root element. " + 35954 "If you are using v-if on multiple elements, " + 35955 "use v-else-if to chain them instead." 35956 ); 35957 } 35958 } 35959 if (currentParent && !element.forbidden) { 35960 if (element.elseif || element.else) { 35961 processIfConditions(element, currentParent); 35962 } else if (element.slotScope) { // scoped slot 35963 currentParent.plain = false;
35964 var name = element.slotTarget || '"default"';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element; 35965 } else { 35966 currentParent.children.push(element); 35967 element.parent = currentParent; 35968 } 35969 } 35970 if (!unary) { 35971 currentParent = element; 35972 stack.push(element); 35973 } else { 35974 closeElement(element); 35975 } 35976 }, 35977 35978 end: function end () { 35979 // remove trailing whitespace 35980 var element = stack[stack.length - 1]; 35981 var lastNode = element.children[element.children.length - 1]; 35982 if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) { 35983 element.children.pop(); 35984 } 35985 // pop stack 35986 stack.length -= 1; 35987 currentParent = stack[stack.length - 1]; 35988 closeElement(element); 35989 }, 35990 35991 chars: function chars (text) { 35992 if (!currentParent) { 35993 { 35994 if (text === template) { 35995 warnOnce( 35996 'Component template requires a root element, rather than just text.' 35997 ); 35998 } else if ((text = text.trim())) { 35999 warnOnce( 36000 ("text \"" + text + "\" outside root element will be ignored.") 36001 ); 36002 } 36003 } 36004 return 36005 } 36006 // IE textarea placeholder bug 36007 /* istanbul ignore if */ 36008 if (isIE && 36009 currentParent.tag === 'textarea' && 36010 currentParent.attrsMap.placeholder === text 36011 ) { 36012 return 36013 } 36014 var children = currentParent.children; 36015 text = inPre || text.trim() 36016 ? isTextTag(currentParent) ? text : decodeHTMLCached(text) 36017 // only preserve whitespace if its not right after a starting tag 36018 : preserveWhitespace && children.length ? ' ' : ''; 36019 if (text) { 36020 var res; 36021 if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) { 36022 children.push({ 36023 type: 2, 36024 expression: res.expression, 36025 tokens: res.tokens, 36026 text: text 36027 }); 36028 } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') { 36029 children.push({ 36030 type: 3, 36031 text: text 36032 }); 36033 } 36034 } 36035 }, 36036 comment: function comment (text) { 36037 currentParent.children.push({ 36038 type: 3, 36039 text: text, 36040 isComment: true 36041 }); 36042 } 36043 }); 36044 return root 36045} 36046 36047function processPre (el) { 36048 if (getAndRemoveAttr(el, 'v-pre') != null) { 36049 el.pre = true; 36050 } 36051} 36052 36053function processRawAttrs (el) { 36054 var l = el.attrsList.length; 36055 if (l) { 36056 var attrs = el.attrs = new Array(l); 36057 for (var i = 0; i < l; i++) { 36058 attrs[i] = { 36059 name: el.attrsList[i].name, 36060 value: JSON.stringify(el.attrsList[i].value) 36061 }; 36062 } 36063 } else if (!el.pre) { 36064 // non root node in pre blocks with no attributes 36065 el.plain = true; 36066 } 36067} 36068 36069function processElement (element, options) { 36070 processKey(element); 36071 36072 // determine whether this is a plain element after 36073 // removing structural attributes 36074 element.plain = !element.key && !element.attrsList.length; 36075 36076 processRef(element); 36077 processSlot(element); 36078 processComponent(element); 36079 for (var i = 0; i < transforms.length; i++) { 36080 element = transforms[i](element, options) || element; 36081 } 36082 processAttrs(element); 36083} 36084 36085function processKey (el) { 36086 var exp = getBindingAttr(el, 'key'); 36087 if (exp) { 36088 if ("development" !== 'production' && el.tag === 'template') { 36089 warn$2("<template> cannot be keyed. Place the key on real elements instead."); 36090 } 36091 el.key = exp; 36092 } 36093} 36094 36095function processRef (el) { 36096 var ref = getBindingAttr(el, 'ref'); 36097 if (ref) { 36098 el.ref = ref; 36099 el.refInFor = checkInFor(el); 36100 } 36101} 36102 36103function processFor (el) { 36104 var exp; 36105 if ((exp = getAndRemoveAttr(el, 'v-for'))) { 36106 var res = parseFor(exp); 36107 if (res) { 36108 extend(el, res); 36109 } else { 36110 warn$2( 36111 ("Invalid v-for expression: " + exp) 36112 ); 36113 } 36114 } 36115} 36116 36117 36118 36119function parseFor (exp) { 36120 var inMatch = exp.match(forAliasRE); 36121 if (!inMatch) { return } 36122 var res = {}; 36123 res.for = inMatch[2].trim(); 36124 var alias = inMatch[1].trim().replace(stripParensRE, ''); 36125 var iteratorMatch = alias.match(forIteratorRE); 36126 if (iteratorMatch) { 36127 res.alias = alias.replace(forIteratorRE, ''); 36128 res.iterator1 = iteratorMatch[1].trim(); 36129 if (iteratorMatch[2]) { 36130 res.iterator2 = iteratorMatch[2].trim(); 36131 } 36132 } else { 36133 res.alias = alias; 36134 } 36135 return res 36136} 36137 36138function processIf (el) { 36139 var exp = getAndRemoveAttr(el, 'v-if'); 36140 if (exp) { 36141 el.if = exp; 36142 addIfCondition(el, { 36143 exp: exp, 36144 block: el 36145 }); 36146 } else { 36147 if (getAndRemoveAttr(el, 'v-else') != null) { 36148 el.else = true; 36149 } 36150 var elseif = getAndRemoveAttr(el, 'v-else-if'); 36151 if (elseif) { 36152 el.elseif = elseif; 36153 } 36154 } 36155} 36156 36157function processIfConditions (el, parent) { 36158 var prev = findPrevElement(parent.children); 36159 if (prev && prev.if) { 36160 addIfCondition(prev, { 36161 exp: el.elseif, 36162 block: el 36163 }); 36164 } else { 36165 warn$2( 36166 "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " + 36167 "used on element <" + (el.tag) + "> without corresponding v-if." 36168 ); 36169 } 36170} 36171 36172function findPrevElement (children) { 36173 var i = children.length; 36174 while (i--) { 36175 if (children[i].type === 1) { 36176 return children[i] 36177 } else { 36178 if ("development" !== 'production' && children[i].text !== ' ') { 36179 warn$2( 36180 "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " + 36181 "will be ignored." 36182 ); 36183 } 36184 children.pop(); 36185 } 36186 } 36187} 36188 36189function addIfCondition (el, condition) { 36190 if (!el.ifConditions) { 36191 el.ifConditions = []; 36192 } 36193 el.ifConditions.push(condition); 36194} 36195 36196function processOnce (el) { 36197 var once$$1 = getAndRemoveAttr(el, 'v-once'); 36198 if (once$$1 != null) { 36199 el.once = true; 36200 } 36201} 36202 36203function processSlot (el) { 36204 if (el.tag === 'slot') { 36205 el.slotName = getBindingAttr(el, 'name'); 36206 if ("development" !== 'production' && el.key) { 36207 warn$2( 36208 "`key` does not work on <slot> because slots are abstract outlets " + 36209 "and can possibly expand into multiple elements. " + 36210 "Use the key on a wrapping element instead." 36211 ); 36212 } 36213 } else { 36214 var slotScope; 36215 if (el.tag === 'template') { 36216 slotScope = getAndRemoveAttr(el, 'scope'); 36217 /* istanbul ignore if */ 36218 if ("development" !== 'production' && slotScope) { 36219 warn$2( 36220 "the \"scope\" attribute for scoped slots have been deprecated and " + 36221 "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " + 36222 "can also be used on plain elements in addition to <template> to " + 36223 "denote scoped slots.", 36224 true 36225 ); 36226 } 36227 el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); 36228 } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { 36229 /* istanbul ignore if */ 36230 if ("development" !== 'production' && el.attrsMap['v-for']) { 36231 warn$2( 36232 "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " + 36233 "(v-for takes higher priority). Use a wrapper <template> for the " + 36234 "scoped slot to make it clearer.", 36235 true 36236 ); 36237 } 36238 el.slotScope = slotScope; 36239 } 36240 var slotTarget = getBindingAttr(el, 'slot'); 36241 if (slotTarget) { 36242 el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget; 36243 // preserve slot as an attribute for native shadow DOM compat 36244 // only for non-scoped slots. 36245 if (el.tag !== 'template' && !el.slotScope) { 36246 addAttr(el, 'slot', slotTarget); 36247 } 36248 } 36249 } 36250} 36251 36252function processComponent (el) { 36253 var binding; 36254 if ((binding = getBindingAttr(el, 'is'))) { 36255 el.component = binding; 36256 } 36257 if (getAndRemoveAttr(el, 'inline-template') != null) { 36258 el.inlineTemplate = true; 36259 } 36260} 36261 36262function processAttrs (el) { 36263 var list = el.attrsList; 36264 var i, l, name, rawName, value, modifiers, isProp; 36265 for (i = 0, l = list.length; i < l; i++) { 36266 name = rawName = list[i].name; 36267 value = list[i].value; 36268 if (dirRE.test(name)) { 36269 // mark element as dynamic 36270 el.hasBindings = true; 36271 // modifiers 36272 modifiers = parseModifiers(name); 36273 if (modifiers) { 36274 name = name.replace(modifierRE, ''); 36275 } 36276 if (bindRE.test(name)) { // v-bind 36277 name = name.replace(bindRE, ''); 36278 value = parseFilters(value); 36279 isProp = false;
36280 if (modifiers) { 36281 if (modifiers.prop) { 36282 isProp = true; 36283 name = camelize(name); 36284 if (name === 'innerHtml') { name = 'innerHTML'; } 36285 } 36286 if (modifiers.camel) { 36287 name = camelize(name); 36288 } 36289 if (modifiers.sync) { 36290 addHandler( 36291 el, 36292 ("update:" + (camelize(name))), 36293 genAssignmentCode(value, "$event") 36294 ); 36295 } 36296 } 36297 if (isProp || ( 36298 !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name) 36299 )) { 36300 addProp(el, name, value); 36301 } else { 36302 addAttr(el, name, value); 36303 } 36304 } else if (onRE.test(name)) { // v-on 36305 name = name.replace(onRE, ''); 36306 addHandler(el, name, value, modifiers, false, warn$2); 36307 } else { // normal directives 36308 name = name.replace(dirRE, ''); 36309 // parse arg 36310 var argMatch = name.match(argRE); 36311 var arg = argMatch && argMatch[1]; 36312 if (arg) { 36313 name = name.slice(0, -(arg.length + 1)); 36314 } 36315 addDirective(el, name, rawName, value, arg, modifiers); 36316 if ("development" !== 'production' && name === 'model') { 36317 checkForAliasModel(el, value); 36318 } 36319 } 36320 } else { 36321 // literal attribute 36322 { 36323 var res = parseText(value, delimiters); 36324 if (res) { 36325 warn$2( 36326 name + "=\"" + value + "\": " + 36327 'Interpolation inside attributes has been removed. ' + 36328 'Use v-bind or the colon shorthand instead. For example, ' + 36329 'instead of <div id="{{ val }}">, use <div :id="val">.' 36330 ); 36331 } 36332 } 36333 addAttr(el, name, JSON.stringify(value)); 36334 // #6887 firefox doesn't update muted state if set via attribute 36335 // even immediately after element creation 36336 if (!el.component && 36337 name === 'muted' && 36338 platformMustUseProp(el.tag, el.attrsMap.type, name)) { 36339 addProp(el, name, 'true'); 36340 } 36341 } 36342 } 36343} 36344 36345function checkInFor (el) { 36346 var parent = el; 36347 while (parent) { 36348 if (parent.for !== undefined) { 36349 return true 36350 } 36351 parent = parent.parent; 36352 } 36353 return false 36354} 36355 36356function parseModifiers (name) { 36357 var match = name.match(modifierRE); 36358 if (match) { 36359 var ret = {}; 36360 match.forEach(function (m) { ret[m.slice(1)] = true; }); 36361 return ret 36362 } 36363} 36364 36365function makeAttrsMap (attrs) { 36366 var map = {}; 36367 for (var i = 0, l = attrs.length; i < l; i++) { 36368 if ( 36369 "development" !== 'production' && 36370 map[attrs[i].name] && !isIE && !isEdge 36371 ) { 36372 warn$2('duplicate attribute: ' + attrs[i].name); 36373 } 36374 map[attrs[i].name] = attrs[i].value; 36375 } 36376 return map 36377} 36378 36379// for script (e.g. type="x/template") or style, do not decode content 36380function isTextTag (el) { 36381 return el.tag === 'script' || el.tag === 'style' 36382} 36383 36384function isForbiddenTag (el) { 36385 return ( 36386 el.tag === 'style' || 36387 (el.tag === 'script' && ( 36388 !el.attrsMap.type || 36389 el.attrsMap.type === 'text/javascript' 36390 )) 36391 ) 36392} 36393 36394var ieNSBug = /^xmlns:NS\d+/; 36395var ieNSPrefix = /^NS\d+:/; 36396 36397/* istanbul ignore next */ 36398function guardIESVGBug (attrs) { 36399 var res = []; 36400 for (var i = 0; i < attrs.length; i++) { 36401 var attr = attrs[i]; 36402 if (!ieNSBug.test(attr.name)) { 36403 attr.name = attr.name.replace(ieNSPrefix, ''); 36404 res.push(attr); 36405 } 36406 } 36407 return res 36408} 36409 36410function checkForAliasModel (el, value) { 36411 var _el = el; 36412 while (_el) { 36413 if (_el.for && _el.alias === value) { 36414 warn$2( 36415 "<" + (el.tag) + " v-model=\"" + value + "\">: " + 36416 "You are binding v-model directly to a v-for iteration alias. " + 36417 "This will not be able to modify the v-for source array because " + 36418 "writing to the alias is like modifying a function local variable. " + 36419 "Consider using an array of objects and use v-model on an object property instead." 36420 ); 36421 } 36422 _el = _el.parent; 36423 } 36424} 36425 36426/* */ 36427 36428/** 36429 * Expand input[v-model] with dyanmic type bindings into v-if-else chains 36430 * Turn this: 36431 * <input v-model="data[type]" :type="type"> 36432 * into this: 36433 * <input v-if="type === 'checkbox'" type="checkbox" v-model="data[type]"> 36434 * <input v-else-if="type === 'radio'" type="radio" v-model="data[type]"> 36435 * <input v-else :type="type" v-model="data[type]"> 36436 */ 36437 36438function preTransformNode (el, options) { 36439 if (el.tag === 'input') { 36440 var map = el.attrsMap; 36441 if (!map['v-model']) { 36442 return 36443 } 36444 36445 var typeBinding; 36446 if (map[':type'] || map['v-bind:type']) { 36447 typeBinding = getBindingAttr(el, 'type'); 36448 } 36449 if (!map.type && !typeBinding && map['v-bind']) { 36450 typeBinding = "(" + (map['v-bind']) + ").type"; 36451 } 36452 36453 if (typeBinding) { 36454 var ifCondition = getAndRemoveAttr(el, 'v-if', true); 36455 var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : ""; 36456 var hasElse = getAndRemoveAttr(el, 'v-else', true) != null; 36457 var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true); 36458 // 1. checkbox 36459 var branch0 = cloneASTElement(el); 36460 // process for on the main node 36461 processFor(branch0); 36462 addRawAttr(branch0, 'type', 'checkbox'); 36463 processElement(branch0, options); 36464 branch0.processed = true; // prevent it from double-processed 36465 branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra; 36466 addIfCondition(branch0, { 36467 exp: branch0.if, 36468 block: branch0 36469 }); 36470 // 2. add radio else-if condition 36471 var branch1 = cloneASTElement(el); 36472 getAndRemoveAttr(branch1, 'v-for', true); 36473 addRawAttr(branch1, 'type', 'radio'); 36474 processElement(branch1, options); 36475 addIfCondition(branch0, { 36476 exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra, 36477 block: branch1 36478 }); 36479 // 3. other 36480 var branch2 = cloneASTElement(el); 36481 getAndRemoveAttr(branch2, 'v-for', true); 36482 addRawAttr(branch2, ':type', typeBinding); 36483 processElement(branch2, options); 36484 addIfCondition(branch0, { 36485 exp: ifCondition, 36486 block: branch2 36487 }); 36488 36489 if (hasElse) { 36490 branch0.else = true; 36491 } else if (elseIfCondition) { 36492 branch0.elseif = elseIfCondition; 36493 } 36494 36495 return branch0 36496 } 36497 } 36498} 36499 36500function cloneASTElement (el) { 36501 return createASTElement(el.tag, el.attrsList.slice(), el.parent) 36502} 36503 36504var model$2 = { 36505 preTransformNode: preTransformNode 36506} 36507 36508var modules$1 = [ 36509 klass$1, 36510 style$1, 36511 model$2 36512] 36513
36514/* */ 36515 36516function text (el, dir) { 36517 if (dir.value) { 36518 addProp(el, 'textContent', ("_s(" + (dir.value) + ")")); 36519 } 36520} 36521 36522/* */ 36523 36524function html (el, dir) { 36525 if (dir.value) { 36526 addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")")); 36527 } 36528} 36529 36530var directives$1 = { 36531 model: model, 36532 text: text, 36533 html: html 36534} 36535 36536/* */ 36537 36538var baseOptions = { 36539 expectHTML: true, 36540 modules: modules$1, 36541 directives: directives$1, 36542 isPreTag: isPreTag, 36543 isUnaryTag: isUnaryTag, 36544 mustUseProp: mustUseProp, 36545 canBeLeftOpenTag: canBeLeftOpenTag, 36546 isReservedTag: isReservedTag, 36547 getTagNamespace: getTagNamespace, 36548 staticKeys: genStaticKeys(modules$1) 36549}; 36550 36551/* */ 36552 36553var isStaticKey; 36554var isPlatformReservedTag; 36555 36556var genStaticKeysCached = cached(genStaticKeys$1); 36557 36558/** 36559 * Goal of the optimizer: walk the generated template AST tree 36560 * and detect sub-trees that are purely static, i.e. parts of 36561 * the DOM that never needs to change. 36562 * 36563 * Once we detect these sub-trees, we can: 36564 * 36565 * 1. Hoist them into constants, so that we no longer need to 36566 * create fresh nodes for them on each re-render; 36567 * 2. Completely skip them in the patching process. 36568 */ 36569function optimize (root, options) { 36570 if (!root) { return } 36571 isStaticKey = genStaticKeysCached(options.staticKeys || ''); 36572 isPlatformReservedTag = options.isReservedTag || no; 36573 // first pass: mark all non-static nodes. 36574 markStatic$1(root); 36575 // second pass: mark static roots. 36576 markStaticRoots(root, false); 36577} 36578 36579function genStaticKeys$1 (keys) { 36580 return makeMap( 36581 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' + 36582 (keys ? ',' + keys : '') 36583 ) 36584} 36585 36586function markStatic$1 (node) { 36587 node.static = isStatic(node); 36588 if (node.type === 1) { 36589 // do not make component slot content static. this avoids 36590 // 1. components not able to mutate slot nodes 36591 // 2. static slot content fails for hot-reloading 36592 if ( 36593 !isPlatformReservedTag(node.tag) && 36594 node.tag !== 'slot' && 36595 node.attrsMap['inline-template'] == null 36596 ) { 36597 return 36598 } 36599 for (var i = 0, l = node.children.length; i < l; i++) { 36600 var child = node.children[i]; 36601 markStatic$1(child); 36602 if (!child.static) { 36603 node.static = false; 36604 } 36605 } 36606 if (node.ifConditions) { 36607 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { 36608 var block = node.ifConditions[i$1].block; 36609 markStatic$1(block); 36610 if (!block.static) { 36611 node.static = false; 36612 } 36613 } 36614 } 36615 } 36616} 36617 36618function markStaticRoots (node, isInFor) { 36619 if (node.type === 1) { 36620 if (node.static || node.once) { 36621 node.staticInFor = isInFor; 36622 } 36623 // For a node to qualify as a static root, it should have children that 36624 // are not just static text. Otherwise the cost of hoisting out will 36625 // outweigh the benefits and it's better off to just always render it fresh. 36626 if (node.static && node.children.length && !( 36627 node.children.length === 1 && 36628 node.children[0].type === 3 36629 )) { 36630 node.staticRoot = true; 36631 return 36632 } else { 36633 node.staticRoot = false; 36634 } 36635 if (node.children) { 36636 for (var i = 0, l = node.children.length; i < l; i++) { 36637 markStaticRoots(node.children[i], isInFor || !!node.for); 36638 } 36639 } 36640 if (node.ifConditions) { 36641 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { 36642 markStaticRoots(node.ifConditions[i$1].block, isInFor); 36643 } 36644 } 36645 } 36646} 36647 36648function isStatic (node) { 36649 if (node.type === 2) { // expression 36650 return false 36651 } 36652 if (node.type === 3) { // text 36653 return true 36654 } 36655 return !!(node.pre || ( 36656 !node.hasBindings && // no dynamic bindings 36657 !node.if && !node.for && // not v-if or v-for or v-else 36658 !isBuiltInTag(node.tag) && // not a built-in 36659 isPlatformReservedTag(node.tag) && // not a component 36660 !isDirectChildOfTemplateFor(node) && 36661 Object.keys(node).every(isStaticKey) 36662 )) 36663} 36664 36665function isDirectChildOfTemplateFor (node) { 36666 while (node.parent) { 36667 node = node.parent; 36668 if (node.tag !== 'template') { 36669 return false 36670 } 36671 if (node.for) { 36672 return true 36673 } 36674 } 36675 return false 36676} 36677 36678/* */ 36679 36680var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/; 36681var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; 36682 36683// KeyboardEvent.keyCode aliases 36684var keyCodes = { 36685 esc: 27, 36686 tab: 9,
36687 enter: 13, 36688 space: 32, 36689 up: 38, 36690 left: 37, 36691 right: 39, 36692 down: 40, 36693 'delete': [8, 46] 36694}; 36695 36696// KeyboardEvent.key aliases 36697var keyNames = { 36698 esc: 'Escape', 36699 tab: 'Tab', 36700 enter: 'Enter', 36701 space: ' ', 36702 // #7806: IE11 uses key names without `Arrow` prefix for arrow keys. 36703 up: ['Up', 'ArrowUp'], 36704 left: ['Left', 'ArrowLeft'], 36705 right: ['Right', 'ArrowRight'], 36706 down: ['Down', 'ArrowDown'], 36707 'delete': ['Backspace', 'Delete'] 36708}; 36709 36710// #4868: modifiers that prevent the execution of the listener 36711// need to explicitly return null so that we can determine whether to remove 36712// the listener for .once 36713var genGuard = function (condition) { return ("if(" + condition + ")return null;"); }; 36714 36715var modifierCode = { 36716 stop: '$event.stopPropagation();', 36717 prevent: '$event.preventDefault();', 36718 self: genGuard("$event.target !== $event.currentTarget"), 36719 ctrl: genGuard("!$event.ctrlKey"), 36720 shift: genGuard("!$event.shiftKey"), 36721 alt: genGuard("!$event.altKey"), 36722 meta: genGuard("!$event.metaKey"), 36723 left: genGuard("'button' in $event && $event.button !== 0"), 36724 middle: genGuard("'button' in $event && $event.button !== 1"), 36725 right: genGuard("'button' in $event && $event.button !== 2") 36726}; 36727 36728function genHandlers ( 36729 events, 36730 isNative, 36731 warn 36732) { 36733 var res = isNative ? 'nativeOn:{' : 'on:{'; 36734 for (var name in events) { 36735 res += "\"" + name + "\":" + (genHandler(name, events[name])) + ","; 36736 } 36737 return res.slice(0, -1) + '}' 36738} 36739 36740function genHandler ( 36741 name, 36742 handler 36743) { 36744 if (!handler) { 36745 return 'function(){}' 36746 } 36747 36748 if (Array.isArray(handler)) { 36749 return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]") 36750 } 36751 36752 var isMethodPath = simplePathRE.test(handler.value); 36753 var isFunctionExpression = fnExpRE.test(handler.value); 36754 36755 if (!handler.modifiers) { 36756 if (isMethodPath || isFunctionExpression) { 36757 return handler.value 36758 } 36759 /* istanbul ignore if */ 36760 return ("function($event){" + (handler.value) + "}") // inline statement 36761 } else { 36762 var code = ''; 36763 var genModifierCode = ''; 36764 var keys = []; 36765 for (var key in handler.modifiers) { 36766 if (modifierCode[key]) { 36767 genModifierCode += modifierCode[key]; 36768 // left/right 36769 if (keyCodes[key]) { 36770 keys.push(key); 36771 } 36772 } else if (key === 'exact') { 36773 var modifiers = (handler.modifiers); 36774 genModifierCode += genGuard( 36775 ['ctrl', 'shift', 'alt', 'meta'] 36776 .filter(function (keyModifier) { return !modifiers[keyModifier]; }) 36777 .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); }) 36778 .join('||') 36779 ); 36780 } else { 36781 keys.push(key); 36782 } 36783 } 36784 if (keys.length) { 36785 code += genKeyFilter(keys); 36786 } 36787 // Make sure modifiers like prevent and stop get executed after key filtering 36788 if (genModifierCode) { 36789 code += genModifierCode; 36790 } 36791 var handlerCode = isMethodPath 36792 ? ("return " + (handler.value) + "($event)") 36793 : isFunctionExpression 36794 ? ("return (" + (handler.value) + ")($event)") 36795 : handler.value; 36796 /* istanbul ignore if */ 36797 return ("function($event){" + code + handlerCode + "}") 36798 } 36799} 36800 36801function genKeyFilter (keys) { 36802 return ("if(!('button' in $event)&&" + (keys.map(genFilterCode).join('&&')) + ")return null;") 36803} 36804 36805function genFilterCode (key) { 36806 var keyVal = parseInt(key, 10); 36807 if (keyVal) { 36808 return ("$event.keyCode!==" + keyVal) 36809 } 36810 var keyCode = keyCodes[key]; 36811 var keyName = keyNames[key]; 36812 return ( 36813 "_k($event.keyCode," + 36814 (JSON.stringify(key)) + "," + 36815 (JSON.stringify(keyCode)) + "," + 36816 "$event.key," + 36817 "" + (JSON.stringify(keyName)) + 36818 ")" 36819 ) 36820} 36821 36822/* */ 36823 36824function on (el, dir) { 36825 if ("development" !== 'production' && dir.modifiers) { 36826 warn("v-on without argument does not support modifiers."); 36827 } 36828 el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); }; 36829} 36830 36831/* */ 36832 36833function bind$1 (el, dir) { 36834 el.wrapData = function (code) { 36835 return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")") 36836 }; 36837} 36838 36839/* */ 36840 36841var baseDirectives = { 36842 on: on, 36843 bind: bind$1, 36844 cloak: noop 36845} 36846 36847/* */ 36848 36849var CodegenState = function CodegenState (options) { 36850 this.options = options; 36851 this.warn = options.warn || baseWarn; 36852 this.transforms = pluckModuleFunction(options.modules, 'transformCode'); 36853 this.dataGenFns = pluckModuleFunction(options.modules, 'genData'); 36854 this.directives = extend(extend({}, baseDirectives), options.directives); 36855 var isReservedTag = options.isReservedTag || no; 36856 this.maybeComponent = function (el) { return !isReservedTag(el.tag); }; 36857 this.onceId = 0; 36858 this.staticRenderFns = []; 36859}; 36860 36861 36862 36863function generate ( 36864 ast, 36865 options 36866) { 36867 var state = new CodegenState(options); 36868 var code = ast ? genElement(ast, state) : '_c("div")'; 36869 return { 36870 render: ("with(this){return " + code + "}"), 36871 staticRenderFns: state.staticRenderFns 36872 } 36873} 36874 36875function genElement (el, state) { 36876 if (el.staticRoot && !el.staticProcessed) { 36877 return genStatic(el, state) 36878 } else if (el.once && !el.onceProcessed) { 36879 return genOnce(el, state) 36880 } else if (el.for && !el.forProcessed) { 36881 return genFor(el, state) 36882 } else if (el.if && !el.ifProcessed) { 36883 return genIf(el, state) 36884 } else if (el.tag === 'template' && !el.slotTarget) { 36885 return genChildren(el, state) || 'void 0' 36886 } else if (el.tag === 'slot') { 36887 return genSlot(el, state) 36888 } else { 36889 // component or element 36890 var code; 36891 if (el.component) { 36892 code = genComponent(el.component, el, state); 36893 } else { 36894 var data = el.plain ? undefined : genData$2(el, state); 36895 36896 var children = el.inlineTemplate ? null : genChildren(el, state, true);
36897 code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")"; 36898 } 36899 // module transforms 36900 for (var i = 0; i < state.transforms.length; i++) { 36901 code = state.transforms[i](el, code); 36902 } 36903 return code 36904 } 36905} 36906 36907// hoist static sub-trees out 36908function genStatic (el, state) { 36909 el.staticProcessed = true; 36910 state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}")); 36911 return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")") 36912} 36913 36914// v-once 36915function genOnce (el, state) { 36916 el.onceProcessed = true; 36917 if (el.if && !el.ifProcessed) { 36918 return genIf(el, state) 36919 } else if (el.staticInFor) { 36920 var key = ''; 36921 var parent = el.parent; 36922 while (parent) { 36923 if (parent.for) { 36924 key = parent.key; 36925 break 36926 } 36927 parent = parent.parent; 36928 } 36929 if (!key) { 36930 "development" !== 'production' && state.warn( 36931 "v-once can only be used inside v-for that is keyed. " 36932 ); 36933 return genElement(el, state) 36934 } 36935 return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")") 36936 } else { 36937 return genStatic(el, state) 36938 } 36939} 36940 36941function genIf ( 36942 el, 36943 state, 36944 altGen, 36945 altEmpty 36946) { 36947 el.ifProcessed = true; // avoid recursion 36948 return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty) 36949} 36950 36951function genIfConditions ( 36952 conditions, 36953 state, 36954 altGen, 36955 altEmpty 36956) { 36957 if (!conditions.length) { 36958 return altEmpty || '_e()' 36959 } 36960 36961 var condition = conditions.shift(); 36962 if (condition.exp) { 36963 return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty))) 36964 } else { 36965 return ("" + (genTernaryExp(condition.block))) 36966 } 36967 36968 // v-if with v-once should generate code like (a)?_m(0):_m(1) 36969 function genTernaryExp (el) { 36970 return altGen 36971 ? altGen(el, state) 36972 : el.once 36973 ? genOnce(el, state) 36974 : genElement(el, state) 36975 } 36976} 36977 36978function genFor ( 36979 el, 36980 state, 36981 altGen, 36982 altHelper 36983) { 36984 var exp = el.for; 36985 var alias = el.alias; 36986 var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : ''; 36987 var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : ''; 36988 36989 if ("development" !== 'production' && 36990 state.maybeComponent(el) && 36991 el.tag !== 'slot' && 36992 el.tag !== 'template' && 36993 !el.key 36994 ) { 36995 state.warn( 36996 "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " + 36997 "v-for should have explicit keys. " + 36998 "See https://vuejs.org/guide/list.html#key for more info.", 36999 true /* tip */ 37000 ); 37001 } 37002 37003 el.forProcessed = true; // avoid recursion 37004 return (altHelper || '_l') + "((" + exp + ")," + 37005 "function(" + alias + iterator1 + iterator2 + "){" + 37006 "return " + ((altGen || genElement)(el, state)) + 37007 '})' 37008} 37009 37010function genData$2 (el, state) { 37011 var data = '{'; 37012 37013 // directives first. 37014 // directives may mutate the el's other properties before they are generated. 37015 var dirs = genDirectives(el, state); 37016 if (dirs) { data += dirs + ','; } 37017 37018 // key 37019 if (el.key) { 37020 data += "key:" + (el.key) + ","; 37021 } 37022 // ref 37023 if (el.ref) { 37024 data += "ref:" + (el.ref) + ","; 37025 } 37026 if (el.refInFor) { 37027 data += "refInFor:true,"; 37028 } 37029 // pre 37030 if (el.pre) { 37031 data += "pre:true,"; 37032 } 37033 // record original tag name for components using "is" attribute 37034 if (el.component) { 37035 data += "tag:\"" + (el.tag) + "\","; 37036 } 37037 // module data generation functions 37038 for (var i = 0; i < state.dataGenFns.length; i++) { 37039 data += state.dataGenFns[i](el); 37040 } 37041 // attributes 37042 if (el.attrs) { 37043 data += "attrs:{" + (genProps(el.attrs)) + "},"; 37044 } 37045 // DOM props 37046 if (el.props) { 37047 data += "domProps:{" + (genProps(el.props)) + "},"; 37048 } 37049 // event handlers 37050 if (el.events) { 37051 data += (genHandlers(el.events, false, state.warn)) + ","; 37052 } 37053 if (el.nativeEvents) { 37054 data += (genHandlers(el.nativeEvents, true, state.warn)) + ","; 37055 } 37056 // slot target 37057 // only for non-scoped slots 37058 if (el.slotTarget && !el.slotScope) { 37059 data += "slot:" + (el.slotTarget) + ","; 37060 } 37061 // scoped slots 37062 if (el.scopedSlots) { 37063 data += (genScopedSlots(el.scopedSlots, state)) + ","; 37064 } 37065 // component v-model 37066 if (el.model) { 37067 data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},"; 37068 } 37069 // inline-template 37070 if (el.inlineTemplate) { 37071 var inlineTemplate = genInlineTemplate(el, state); 37072 if (inlineTemplate) { 37073 data += inlineTemplate + ","; 37074 } 37075 } 37076 data = data.replace(/,$/, '') + '}'; 37077 // v-bind data wrap 37078 if (el.wrapData) { 37079 data = el.wrapData(data); 37080 } 37081 // v-on data wrap 37082 if (el.wrapListeners) { 37083 data = el.wrapListeners(data); 37084 } 37085 return data 37086} 37087 37088function genDirectives (el, state) { 37089 var dirs = el.directives; 37090 if (!dirs) { return } 37091 var res = 'directives:['; 37092 var hasRuntime = false;
37093 var i, l, dir, needRuntime; 37094 for (i = 0, l = dirs.length; i < l; i++) { 37095 dir = dirs[i]; 37096 needRuntime = true; 37097 var gen = state.directives[dir.name]; 37098 if (gen) { 37099 // compile-time directive that manipulates AST. 37100 // returns true if it also needs a runtime counterpart. 37101 needRuntime = !!gen(el, dir, state.warn); 37102 } 37103 if (needRuntime) { 37104 hasRuntime = true; 37105 res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},"; 37106 } 37107 } 37108 if (hasRuntime) { 37109 return res.slice(0, -1) + ']' 37110 } 37111} 37112 37113function genInlineTemplate (el, state) { 37114 var ast = el.children[0]; 37115 if ("development" !== 'production' && ( 37116 el.children.length !== 1 || ast.type !== 1 37117 )) { 37118 state.warn('Inline-template components must have exactly one child element.'); 37119 } 37120 if (ast.type === 1) { 37121 var inlineRenderFns = generate(ast, state.options); 37122 return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}") 37123 } 37124} 37125 37126function genScopedSlots ( 37127 slots, 37128 state 37129) { 37130 return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) { 37131 return genScopedSlot(key, slots[key], state) 37132 }).join(',')) + "])") 37133} 37134 37135function genScopedSlot ( 37136 key, 37137 el, 37138 state 37139) { 37140 if (el.for && !el.forProcessed) { 37141 return genForScopedSlot(key, el, state) 37142 } 37143 var fn = "function(" + (String(el.slotScope)) + "){" + 37144 "return " + (el.tag === 'template' 37145 ? el.if 37146 ? ((el.if) + "?" + (genChildren(el, state) || 'undefined') + ":undefined") 37147 : genChildren(el, state) || 'undefined' 37148 : genElement(el, state)) + "}"; 37149 return ("{key:" + key + ",fn:" + fn + "}") 37150} 37151 37152function genForScopedSlot ( 37153 key, 37154 el, 37155 state 37156) { 37157 var exp = el.for; 37158 var alias = el.alias; 37159 var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : ''; 37160 var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : ''; 37161 el.forProcessed = true; // avoid recursion 37162 return "_l((" + exp + ")," + 37163 "function(" + alias + iterator1 + iterator2 + "){" + 37164 "return " + (genScopedSlot(key, el, state)) + 37165 '})' 37166} 37167 37168function genChildren ( 37169 el, 37170 state, 37171 checkSkip, 37172 altGenElement, 37173 altGenNode 37174) { 37175 var children = el.children; 37176 if (children.length) { 37177 var el$1 = children[0]; 37178 // optimize single v-for 37179 if (children.length === 1 && 37180 el$1.for && 37181 el$1.tag !== 'template' && 37182 el$1.tag !== 'slot' 37183 ) { 37184 return (altGenElement || genElement)(el$1, state) 37185 } 37186 var normalizationType = checkSkip 37187 ? getNormalizationType(children, state.maybeComponent) 37188 : 0; 37189 var gen = altGenNode || genNode; 37190 return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType ? ("," + normalizationType) : '')) 37191 } 37192} 37193 37194// determine the normalization needed for the children array. 37195// 0: no normalization needed 37196// 1: simple normalization needed (possible 1-level deep nested array) 37197// 2: full normalization needed 37198function getNormalizationType ( 37199 children, 37200 maybeComponent 37201) { 37202 var res = 0; 37203 for (var i = 0; i < children.length; i++) { 37204 var el = children[i]; 37205 if (el.type !== 1) { 37206 continue 37207 } 37208 if (needsNormalization(el) || 37209 (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { 37210 res = 2; 37211 break 37212 } 37213 if (maybeComponent(el) || 37214 (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) { 37215 res = 1; 37216 } 37217 } 37218 return res 37219} 37220 37221function needsNormalization (el) { 37222 return el.for !== undefined || el.tag === 'template' || el.tag === 'slot' 37223} 37224 37225function genNode (node, state) { 37226 if (node.type === 1) { 37227 return genElement(node, state) 37228 } if (node.type === 3 && node.isComment) { 37229 return genComment(node) 37230 } else { 37231 return genText(node) 37232 } 37233} 37234 37235function genText (text) { 37236 return ("_v(" + (text.type === 2 37237 ? text.expression // no need for () because already wrapped in _s() 37238 : transformSpecialNewlines(JSON.stringify(text.text))) + ")") 37239} 37240 37241function genComment (comment) { 37242 return ("_e(" + (JSON.stringify(comment.text)) + ")") 37243} 37244 37245function genSlot (el, state) { 37246 var slotName = el.slotName || '"default"'; 37247 var children = genChildren(el, state); 37248 var res = "_t(" + slotName + (children ? ("," + children) : ''); 37249 var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}"); 37250 var bind$$1 = el.attrsMap['v-bind']; 37251 if ((attrs || bind$$1) && !children) { 37252 res += ",null"; 37253 } 37254 if (attrs) { 37255 res += "," + attrs; 37256 } 37257 if (bind$$1) { 37258 res += (attrs ? '' : ',null') + "," + bind$$1; 37259 } 37260 return res + ')' 37261} 37262 37263// componentName is el.component, take it as argument to shun flow's pessimistic refinement 37264function genComponent ( 37265 componentName, 37266 el, 37267 state 37268) { 37269 var children = el.inlineTemplate ? null : genChildren(el, state, true); 37270 return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")") 37271} 37272 37273function genProps (props) { 37274 var res = ''; 37275 for (var i = 0; i < props.length; i++) { 37276 var prop = props[i]; 37277 /* istanbul ignore if */ 37278 { 37279 res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ","; 37280 } 37281 } 37282 return res.slice(0, -1) 37283} 37284 37285// #3895, #4268 37286function transformSpecialNewlines (text) { 37287 return text 37288 .replace(/\u2028/g, '\\u2028') 37289 .replace(/\u2029/g, '\\u2029') 37290} 37291 37292/* */ 37293 37294// these keywords should not appear inside expressions, but operators like 37295// typeof, instanceof and in are allowed 37296var prohibitedKeywordRE = new RegExp('\\b' + ( 37297 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' + 37298 'super,throw,while,yield,delete,export,import,return,switch,default,' + 37299 'extends,finally,continue,debugger,function,arguments' 37300).split(',').join('\\b|\\b') + '\\b'); 37301 37302// these unary operators should not be used as property/method names 37303var unaryOperatorsRE = new RegExp('\\b' + ( 37304 'delete,typeof,void' 37305).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); 37306 37307// strip strings in expressions 37308var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; 37309 37310// detect problematic expressions in a template 37311function detectErrors (ast) { 37312 var errors = []; 37313 if (ast) { 37314 checkNode(ast, errors); 37315 } 37316 return errors 37317} 37318 37319function checkNode (node, errors) { 37320 if (node.type === 1) { 37321 for (var name in node.attrsMap) { 37322 if (dirRE.test(name)) { 37323 var value = node.attrsMap[name]; 37324 if (value) { 37325 if (name === 'v-for') { 37326 checkFor(node, ("v-for=\"" + value + "\""), errors); 37327 } else if (onRE.test(name)) { 37328 checkEvent(value, (name + "=\"" + value + "\""), errors); 37329 } else { 37330 checkExpression(value, (name + "=\"" + value + "\""), errors); 37331 } 37332 } 37333 } 37334 } 37335 if (node.children) { 37336 for (var i = 0; i < node.children.length; i++) { 37337 checkNode(node.children[i], errors); 37338 } 37339 } 37340 } else if (node.type === 2) { 37341 checkExpression(node.expression, node.text, errors); 37342 } 37343} 37344 37345function checkEvent (exp, text, errors) { 37346 var stipped = exp.replace(stripStringRE, ''); 37347 var keywordMatch = stipped.match(unaryOperatorsRE); 37348 if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { 37349 errors.push( 37350 "avoid using JavaScript unary operator as property name: " + 37351 "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()) 37352 ); 37353 } 37354 checkExpression(exp, text, errors); 37355} 37356 37357function checkFor (node, text, errors) { 37358 checkExpression(node.for || '', text, errors); 37359 checkIdentifier(node.alias, 'v-for alias', text, errors); 37360 checkIdentifier(node.iterator1, 'v-for iterator', text, errors); 37361 checkIdentifier(node.iterator2, 'v-for iterator', text, errors); 37362} 37363 37364function checkIdentifier ( 37365 ident, 37366 type, 37367 text, 37368 errors 37369) { 37370 if (typeof ident === 'string') { 37371 try { 37372 new Function(("var " + ident + "=_")); 37373 } catch (e) { 37374 errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim()))); 37375 } 37376 } 37377} 37378 37379function checkExpression (exp, text, errors) { 37380 try { 37381 new Function(("return " + exp)); 37382 } catch (e) { 37383 var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE); 37384 if (keywordMatch) { 37385 errors.push( 37386 "avoid using JavaScript keyword as property name: " + 37387 "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()) 37388 ); 37389 } else { 37390 errors.push( 37391 "invalid expression: " + (e.message) + " in\n\n" + 37392 " " + exp + "\n\n" + 37393 " Raw expression: " + (text.trim()) + "\n" 37394 ); 37395 } 37396 } 37397} 37398 37399/* */ 37400 37401function createFunction (code, errors) { 37402 try { 37403 return new Function(code) 37404 } catch (err) { 37405 errors.push({ err: err, code: code }); 37406 return noop 37407 } 37408} 37409 37410function createCompileToFunctionFn (compile) { 37411 var cache = Object.create(null); 37412 37413 return function compileToFunctions ( 37414 template, 37415 options, 37416 vm 37417 ) { 37418 options = extend({}, options); 37419 var warn$$1 = options.warn || warn; 37420 delete options.warn; 37421 37422 /* istanbul ignore if */ 37423 { 37424 // detect possible CSP restriction
37425 try { 37426 new Function('return 1'); 37427 } catch (e) { 37428 if (e.toString().match(/unsafe-eval|CSP/)) { 37429 warn$$1( 37430 'It seems you are using the standalone build of Vue.js in an ' + 37431 'environment with Content Security Policy that prohibits unsafe-eval. ' + 37432 'The template compiler cannot work in this environment. Consider ' + 37433 'relaxing the policy to allow unsafe-eval or pre-compiling your ' + 37434 'templates into render functions.' 37435 ); 37436 } 37437 } 37438 } 37439 37440 // check cache 37441 var key = options.delimiters 37442 ? String(options.delimiters) + template 37443 : template; 37444 if (cache[key]) { 37445 return cache[key] 37446 } 37447 37448 // compile 37449 var compiled = compile(template, options); 37450 37451 // check compilation errors/tips 37452 { 37453 if (compiled.errors && compiled.errors.length) { 37454 warn$$1( 37455 "Error compiling template:\n\n" + template + "\n\n" + 37456 compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n', 37457 vm 37458 ); 37459 } 37460 if (compiled.tips && compiled.tips.length) { 37461 compiled.tips.forEach(function (msg) { return tip(msg, vm); }); 37462 } 37463 } 37464 37465 // turn code into functions 37466 var res = {}; 37467 var fnGenErrors = []; 37468 res.render = createFunction(compiled.render, fnGenErrors); 37469 res.staticRenderFns = compiled.staticRenderFns.map(function (code) { 37470 return createFunction(code, fnGenErrors) 37471 }); 37472 37473 // check function generation errors. 37474 // this should only happen if there is a bug in the compiler itself. 37475 // mostly for codegen development use 37476 /* istanbul ignore if */ 37477 { 37478 if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) { 37479 warn$$1( 37480 "Failed to generate render function:\n\n" + 37481 fnGenErrors.map(function (ref) { 37482 var err = ref.err; 37483 var code = ref.code; 37484 37485 return ((err.toString()) + " in\n\n" + code + "\n"); 37486 }).join('\n'), 37487 vm 37488 ); 37489 } 37490 } 37491 37492 return (cache[key] = res) 37493 } 37494} 37495 37496/* */ 37497 37498function createCompilerCreator (baseCompile) { 37499 return function createCompiler (baseOptions) { 37500 function compile ( 37501 template, 37502 options 37503 ) { 37504 var finalOptions = Object.create(baseOptions); 37505 var errors = []; 37506 var tips = []; 37507 finalOptions.warn = function (msg, tip) { 37508 (tip ? tips : errors).push(msg); 37509 }; 37510 37511 if (options) { 37512 // merge custom modules 37513 if (options.modules) { 37514 finalOptions.modules = 37515 (baseOptions.modules || []).concat(options.modules); 37516 } 37517 // merge custom directives 37518 if (options.directives) { 37519 finalOptions.directives = extend( 37520 Object.create(baseOptions.directives || null), 37521 options.directives 37522 ); 37523 } 37524 // copy other options 37525 for (var key in options) { 37526 if (key !== 'modules' && key !== 'directives') { 37527 finalOptions[key] = options[key]; 37528 } 37529 } 37530 } 37531 37532 var compiled = baseCompile(template, finalOptions); 37533 { 37534 errors.push.apply(errors, detectErrors(compiled.ast)); 37535 } 37536 compiled.errors = errors; 37537 compiled.tips = tips; 37538 return compiled 37539 } 37540 37541 return { 37542 compile: compile, 37543 compileToFunctions: createCompileToFunctionFn(compile) 37544 } 37545 } 37546} 37547 37548/* */ 37549 37550// `createCompilerCreator` allows creating compilers that use alternative 37551// parser/optimizer/codegen, e.g the SSR optimizing compiler. 37552// Here we just export a default compiler using the default parts. 37553var createCompiler = createCompilerCreator(function baseCompile ( 37554 template, 37555 options 37556) { 37557 var ast = parse(template.trim(), options); 37558 if (options.optimize !== false) { 37559 optimize(ast, options); 37560 } 37561 var code = generate(ast, options); 37562 return { 37563 ast: ast, 37564 render: code.render, 37565 staticRenderFns: code.staticRenderFns 37566 } 37567}); 37568 37569/* */ 37570 37571var ref$1 = createCompiler(baseOptions); 37572var compileToFunctions = ref$1.compileToFunctions; 37573 37574/* */ 37575 37576// check whether current browser encodes a char inside attribute values 37577var div; 37578function getShouldDecode (href) { 37579 div = div || document.createElement('div'); 37580 div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>"; 37581 return div.innerHTML.indexOf(' ') > 0 37582} 37583 37584// #3663: IE encodes newlines inside attribute values while other browsers don't 37585var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
37586// #6828: chrome encodes content in a[href] 37587var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false; 37588 37589/* */ 37590 37591var idToTemplate = cached(function (id) { 37592 var el = query(id); 37593 return el && el.innerHTML 37594}); 37595 37596var mount = Vue.prototype.$mount; 37597Vue.prototype.$mount = function ( 37598 el, 37599 hydrating 37600) { 37601 el = el && query(el); 37602 37603 /* istanbul ignore if */ 37604 if (el === document.body || el === document.documentElement) { 37605 "development" !== 'production' && warn( 37606 "Do not mount Vue to <html> or <body> - mount to normal elements instead." 37607 ); 37608 return this 37609 } 37610 37611 var options = this.$options; 37612 // resolve template/el and convert to render function 37613 if (!options.render) { 37614 var template = options.template; 37615 if (template) { 37616 if (typeof template === 'string') { 37617 if (template.charAt(0) === '#') { 37618 template = idToTemplate(template); 37619 /* istanbul ignore if */ 37620 if ("development" !== 'production' && !template) { 37621 warn( 37622 ("Template element not found or is empty: " + (options.template)), 37623 this 37624 ); 37625 } 37626 } 37627 } else if (template.nodeType) { 37628 template = template.innerHTML; 37629 } else { 37630 { 37631 warn('invalid template option:' + template, this); 37632 } 37633 return this 37634 } 37635 } else if (el) { 37636 template = getOuterHTML(el); 37637 } 37638 if (template) { 37639 /* istanbul ignore if */ 37640 if ("development" !== 'production' && config.performance && mark) { 37641 mark('compile'); 37642 } 37643 37644 var ref = compileToFunctions(template, { 37645 shouldDecodeNewlines: shouldDecodeNewlines, 37646 shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref, 37647 delimiters: options.delimiters, 37648 comments: options.comments 37649 }, this); 37650 var render = ref.render; 37651 var staticRenderFns = ref.staticRenderFns; 37652 options.render = render; 37653 options.staticRenderFns = staticRenderFns; 37654 37655 /* istanbul ignore if */ 37656 if ("development" !== 'production' && config.performance && mark) { 37657 mark('compile end'); 37658 measure(("vue " + (this._name) + " compile"), 'compile', 'compile end'); 37659 } 37660 } 37661 } 37662 return mount.call(this, el, hydrating) 37663}; 37664 37665/** 37666 * Get outerHTML of elements, taking care 37667 * of SVG elements in IE as well. 37668 */ 37669function getOuterHTML (el) { 37670 if (el.outerHTML) { 37671 return el.outerHTML 37672 } else { 37673 var container = document.createElement('div'); 37674 container.appendChild(el.cloneNode(true)); 37675 return container.innerHTML 37676 } 37677} 37678 37679Vue.compile = compileToFunctions; 37680 37681return Vue; 37682 37683}))); 37684 37685// mobile navigation // 37686(function() { 37687 if (!document.getElementsByClassName('lite-header-navigation')[0]) { 37688 return 37689 } 37690 37691 var dupontNavigationTools = document.getElementsByClassName('lite-header-navigation'); 37692 37693 37694 var ln_sel = function(selector) { 37695 return document.querySelector(selector); 37696 }; 37697 37698 var ln_navigationEl = ln_sel('.lite-header-navigation'), 37699 ln_hamburger = ln_sel('.lite-header-navigation .hamburger'), 37700 ln_backbutton = ln_sel('.lite-header-navigation .back'), 37701 ln_menuholder = ln_sel('.lite-header-navigation .lite-header-navigation--items'), 37702 ln_rootmenu = ln_sel('.lite-header-navigation .lite-header-navigation--items-top'), 37703 ln_rootbottom = ln_sel('.lite-header-navigation .lite-header-navigation--items-bottom'), 37704 ln_logo = ln_sel('.lite-header-navigation .lite-header-navigation--logo'), 37705 ln_navigationItem = ln_sel('.lite-header-navigation .navigation-item-contain > .delay-1') ; 37706 37707 37708 // helper. vanilla js for .parents('selector'); 37709 var ln_getClosest = function(elem, selector) { 37710 37711 // Element.matches() polyfill 37712 if (!Element.prototype.matches) { 37713 Element.prototype.matches = 37714 Element.prototype.matchesSelector || 37715 Element.prototype.mozMatchesSelector || 37716 Element.prototype.msMatchesSelector || 37717 Element.prototype.oMatchesSelector || 37718 Element.prototype.webkitMatchesSelector || 37719 function(s) { 37720 var matches = (this.document || this.ownerDocument).querySelectorAll(s), 37721 i = matches.length; 37722 while (--i >= 0 && matches.item(i) !== this) {} 37723 return i > -1; 37724 }; 37725 } 37726 37727 // Get the closest matching element 37728 for (; elem && elem !== document; elem = elem.parentNode) { 37729 if (elem.matches(selector)) return elem; 37730 } 37731 return null; 37732 37733 }; 37734 37735 // toggle mobile nav 37736 var ln_toggleNavigation = function(ev) { 37737 37738 if (ln_navigationEl.classList.contains('open')) { 37739 ln_navigationEl.classList.remove('open'); 37740 ln_hamburger.classList.remove('open'); 37741 ln_clearNavigation(); 37742 } else { 37743 ln_navigationEl.classList.add('open'); 37744 ln_hamburger.classList.add('open'); 37745 } 37746 37747 }; 37748 37749 var ln_clearClosedSubmenus = function(index) { 37750 Array.from(document.querySelectorAll('.subnav-list[data-level]')).forEac
37750h(function(item) { 37751 var c = item.getAttribute('data-level'); 37752 if (c > index) { 37753 item.parentElement.removeChild(item); 37754 } 37755 }); 37756 } 37757 37758 // clean up nav 37759 var ln_clearNavigation = function() { 37760 ln_navigationEl.classList.remove('open'); 37761 ln_rootbottom.classList.remove('out'); 37762 ln_rootmenu.classList.remove('outleft'); 37763 ln_backbutton.setAttribute('data-level', 0); 37764 ln_menuholder.style.height = ''; 37765 Array.from(document.querySelectorAll('.subnav-list')).forEach(function(item) { 37766 item.remove(); 37767 }); 37768 37769 ln_sel('.hamburger > input').checked = false; 37770 }; 37771 37772 var ln_closeSubNav = function(ev) { 37773 levelToCLose = ln_backbutton.getAttribute('data-level'); 37774 levelToOpen = ((levelToCLose - 1) > 0) ? (levelToCLose - 1) : 0; 37775 var elToClose = document.querySelector('.subnav-list-' + levelToCLose); 37776 var elToOpen = (levelToOpen > 0) ? document.querySelector('.subnav-list-' + levelToOpen) : ln_rootmenu; 37777 37778 // close current menu 37779 elToClose.classList.add('outright'); 37780 37781 // open next 37782 elToOpen.classList.remove('outleft'); 37783 37784 ln_backbutton.setAttribute('data-level', (levelToCLose - 1)); 37785 37786 if (levelToOpen === 0) { 37787 ln_menuholder.style.height = ''; 37788 ln_rootbottom.classList.remove('out'); 37789 } else { 37790 ln_menuholder.style.height = (elToOpen.clientHeight + 100) + 'px'; 37791 } 37792 }; 37793 37794 var ln_openSubNav = function(subnavEl) { 37795 var existinglists = document.querySelectorAll('.lite-header-navigation .subnav-list'), 37796 existinglistslen = existinglists.length || 0, 37797 nextlevel = (existinglistslen + 1); 37798 37799 37800 ln_backbutton.setAttribute('data-level', nextlevel); 37801 37802 // // close/disable any existing sub navs that are on the screen 37803 if (existinglistslen > 0) { 37804 Array.from(existinglists).forEach(function(item) { 37805 item.classList.add('outleft'); 37806 }); 37807 } 37808 37809 // build the sub nav 37810 var ln_subnavitems = subnavEl.children, 37811 ln_subnavitemslen = ln_subnavitems.length, 37812 ln_subnavitemsmulti = (ln_subnavitemslen > 1) ? true : false; 37813 37814 var ln_listItems = ln_getSubnavItems(ln_subnavitems); 37815 37816 var ln_sublist = document.createElement('ul'); 37817 ln_sublist.classList.add('subnav-list'); 37818 ln_sublist.classList.add('subnav-list-' + nextlevel); 37819 ln_sublist.classList.add('outright'); 37820 ln_sublist.setAttribute('data-level', nextlevel); 37821 ln_sublist.style.visibility = 'hidden'; 37822 37823 ln_sublist.innerHTML = ln_listItems.join(''); 37824 37825 ln_menuholder.appendChild(ln_sublist, ln_subnavitemsmulti); 37826 37827 ln_sublist.style.visibility = 'visible'; 37828 setTimeout(function() { 37829 ln_menuholder.style.height = (ln_sublist.clientHeight + 100) + 'px'; 37830 ln_sublist.classList.remove('outright'); 37831 }, 100); 37832 }; 37833 37834 var ln_getSubnavItems = function(navs, ismulti) { 37835 var arr = []; 37836 Array.from(navs).forEach(function(item) { 37837 var items = Array.from(item.children); 37838 items.forEach(function(li) { 37839 if (li.nodeName.toLowerCase() === 'li') { 37840 if (ismulti) { 37841 arr.push(li.innerHTML); 37842 } else { 37843 arr.push('<li>' + li.innerHTML + '</li>'); 37844 } 37845 } 37846 }); 37847 }); 37848 37849 return arr; 37850 }; 37851 37852 // nav item clicks 37853 var ln_navItemClick = function(el, event) { 37854 var subnav = el.parentElement.getElementsByClassName('nav-sub-items'); 37855 var hassubnav = (subnav) ? subnav.length : 0; 37856 if (hassubnav > 0) { 37857 37858 var isRootMenu = (ln_getClosest(el, '.lite-header-navigation--items-top')) ? true : false; 37859 var menuLevelClicked = 0; 37860 37861 if (!isRootMenu) { 37862 var parentMenu = ln_getClosest(el, '.subnav-list'); 37863 if (parentMenu) { 37864 menuLevelClicked = parentMenu.getAttribute('data-level'); 37865 } 37866 } 37867 37868 // dispose of higher level submenus before opening a nav 37869 ln_clearClosedSubmenus(menuLevelClicked); 37870 37871 ln_rootmenu.classList.add('outleft'); 37872 ln_rootbottom.classList.add('out'); 37873 37874 ln_openSubNav(subnav[0]); 37875 event.preventDefault(); 37876 } 37877 }; 37878 37879 37880 // event listeners 37881 ln_hamburger.addEventListener('click', ln_toggleNavigation); 37882 //ln_backbutton.addEventListener('click', ln_closeSubNav); 37883 ln_navigationEl.addEventListener('click', function(ev) { 37884 if (ln_navigationEl.classList.contains('open')) { 37885 var el = ev.target; 37886 if (el.classList.contains('navigation-item') || el.classList.contains('navigation-item-sm')) { 37887 ln_navItemClick(el, ev); 37888 } 37889 } 37890 }); 37891 37892 37893 var ln_setCountryList = function(){ 37894 var conDDEl = ln_sel('.global-logo .country-dd'); 37895 ln_setContryDDPos(conDDEl); 37896 $(window).resize(function(){ 37897 ln_setContryDDPos(conDDEl); 37898 }); 37899 37900 if(conDDEl){ 37901 var conDD = conDDEl.querySelectorAll('a'); 37902 var currPage = window.location.href; 37903 var matchedCountryTitle = ''; 37904 var currPagePath = window.location.pathname; 37905 /* if(currPagePath.startsWith('/fr/')){ 37906 currPagePath = "/"+(currPagePath.split('/fr/'))[1]; 37907 } 37908 if(currPagePath.startsWith('/nl/')){ 37909 currPagePath = "/"+(currPagePath.split('/nl/'))[1]; 37910 } 37911 if(currPagePath.startsWith('/en/')){ 37912 currPagePath = "/"+(currPagePath.split('/en/'))[1]; 37913 } */ 37914 37915 if(conDD.length<=6){ 37916 $(ln_sel('.global-logo .country-dd')).addClass('colm-1'); 37917 } 37918 /*if(conDD.length>32){ 37919 $(ln_sel('.global-logo .country-dd')).addClass('colm-5'); 37920 } 37921 else if(conDD.length>24){ 37922 $(ln_sel('.global-logo .country-dd')).addClass('colm-4'); 37923 } 37924 else if(conDD.length>16){ 37925 $(ln_sel('.global-logo .country-dd')).addClass('colm-3'); 37926 } 37927 else if(conDD.length>8){ 37928 $(ln_sel('.global-logo .country-dd')).addClass('colm-2'); 37929 } */ 37930 37931 $.each(conDD, function(i,v){ 37932 37933 if(currPage.indexOf($(v).attr('href'))>-1){ 37934 matchedCountryTitle = $(v).text(); 37935 } 37936 //var href = $(v).attr('href'); 37937 /*if(href.lastIndexOf('/') == href.length-1){ 37938 href = href.substr(0,href.length-1); 37939 }*/ 37940 37941 //$(v).attr('href',href+currPagePath+window.location.search); 37942 // $(v).attr('href',href); 37943 }); 37944 if(!matchedCountryTitle && conDD.length>0){ 37945 //matchedCountryTitle = $(conDD[0]).text(); 37946 // matchedCountryTitle = "Select a country"; 37947 } 37948 if(matchedCountryTitle){ 37949 $(ln_sel('.global-logo .con-title')).text(matchedCountryTitle); 37950 } 37951 37952 $(ln_sel('.global-logo')).on('click',function(){ 37953 $(ln_sel('.global-logo .country-dd')).toggle(); 37954 }); 37955 }else{ 37956 37957 $(ln_sel('.global-logo')).hide(); 37958 } 37959 }; 37960 37961 var ln_setContryDDPos = function(conDDEl){ 37962 if(conDDEl){ 37963 var ddwidth = ln_logo.offsetWidth; 37964 if($(ln_sel('.global-logo')).siblings('.nav-user-icon').length > 0){ 37965 conDDEl.style.left = -ddwidth+90+"px"; 37966 }else{ 37967 conDDEl.style.left = -ddwidth+50+"px"; 37968 } 37969 37970 } 37971 37972 }; 37973 37974 var ln_setNavLinks = function(){ 37975 try{ 37976 var ln_isLocalStorage = $(ln_navigationEl).attr("data-attr-lclStorage"); 37977 37978 if(ln_isLocalStorage == "true"){ 37979 var x = 0; 37980 var lsInterval = setInterval(function(){ 37981 x++ ; 37982 var mappingObj = localStorage.getItem("sf-dfp"); 37983 37984 if(mappingObj){ 37985 clearInterval(lsInterval); 37986 mappingObj = JSON.parse(mappingObj); 37987 if(mappingObj['homeLabel']){
37988 $(ln_navigationItem).text(mappingObj['homeLabel']); 37989 } 37990 if(mappingObj['homeUrl']){ 37991 $(ln_navigationItem).attr('href', mappingObj['homeUrl']); 37992 } 37993 if(mappingObj['rcUrl']){ 37994 $(ln_navigationEl).find("#rcenter").attr('href',mappingObj['rcUrl']); 37995 } 37996 if(mappingObj['sfUrl']){ 37997 $(ln_navigationEl).find("#sfinder").attr('href',mappingObj['sfUrl']); 37998 } 37999 38000 38001 }else if(x == 30){ 38002 clearInterval(lsInterval); 38003 } 38004 38005 },500) 38006 38007 } 38008 38009 console.log("ln_isLocalStorage",ln_isLocalStorage) 38010 }catch(e){ 38011 console.log("error in lite header",e); 38012 } 38013 38014 38015 }; 38016 38017 38018 if(dupontNavigationTools.length>0){ 38019 ln_setNavLinks(); 38020 ln_setCountryList(); 38021 38022 }; 38023 38024 38025 // nav cleanup to handle if browser was resized while nav open 38026 window.addEventListener('resize', function() { 38027 if (window.innerWidth >= 1024) { 38028 ln_clearNavigation(); 38029 } 38030 }); 38031 38032})(); 38033 38034 38035$(document).ready(function () { 38036 $.getJSON('/content/dam/dupont/global/content-fragments/copyrightfragment/jcr:content/data/master.json', function(data, status) { 38037 if(data){ 38038 //var text = JSON.parse(JSON.stringify(dataa)); 38039 var country= digitalData.page.pageLocation.split(" ").join("").toLowerCase(); 38040 var language= digitalData.page.pageLanguage.toLowerCase(); 38041 var copytext= data[country+language]; 38042 $(".copyrightinfo").html(copytext); 38043 38044 } 38045 }); 38046}); 38047function ListComponent(elm) { 38048 this.elm = elm; 38049 this.init(); 38050} 38051ListComponent.prototype.hover = function (elm) { 38052 if (!elm.hasClass("hover-click")) { 38053 this.elm.removeClass("hover-click"); 38054 } 38055 if (elm.find('.card-text .desc').html() == "") { 38056 return false; 38057 } else { 38058 elm.toggleClass("hover-click"); 38059 } 38060 38061}; 38062ListComponent.prototype.init = function () { 38063 var self = this; 38064 this.elm.on("click", function () { 38065 if (!isTouchDevice()) { 38066 return; 38067 } 38068 var elm = $(this); 38069 self.hover(elm); 38070 }); 38071 this.elm.hover(function () { 38072 if (isTouchDevice()) { 38073 return; 38074 } 38075 var elm = $(this); 38076 self.hover(elm); 38077 }); 38078}; 38079$(function () { 38080 new ListComponent($(".list-item")); 38081}) 38082 38083$(document).ready(function () { 38084 $('.list-showmore a.cta').click(function () { 38085 $(this).closest('.dupont-list').addClass('list-show-all'); 38086 $(this).closest('.list-showmore').hide(); 38087 }); 38088 $('.dupont-list .list-full[data-viewmorenotrequired="true"]').parents('.dupont-list').addClass('list-show-all'); 38089}); 38090 $(document).ready(function () { 38091 // Add minus icon for collapse element which is open by default 38092 $(".collapse.show").each(function(){ 38093 //debugger; 38094 $(this).prev(".card-header").find(".fa").addClass("fa-minus").removeClass("fa-plus"); 38095 }); 38096 // Toggle plus minus icon on show hide of collapse element 38097 $(".collapse").on('show.bs.collapse', function () { 38098 38099 $(this).prev(".card-header").find(".fa").removeClass("fa-plus").addClass("fa-minus"); 38100 }).on('hide.bs.collapse', function () { 38101 $(this).prev(".card-header").find(".fa").removeClass("fa-minus").addClass("fa-plus"); 38102 }); 38103 }); 38104 38105$(document).ready(function(){ 38106 if($(window).width() < 768){ 38107 $('.TI_SubGrid .TI_Grid-title').click(function(){ 38108 $(this).next('.TI-GridContent').toggle('show'); 38109 $(this).find('.img-toggle').toggle(); 38110 38111 }) 38112 } 38113}) 38114 38115 38116/** $('.TIapplAccordion').click(function(){ 38117 $(".TIAppContent").slideUp('500') 38118 $(this).find('.img-toggle i').addClass("fa-minus") 38119 $(this).find('.img-toggle i').removeClass("fa-plus"); 38120 $(this).closest('.listComponent-Element').find('.TIAppContent').slideDown('500'); 38121 $('.TIapplAccordion').not(this).find('.img-toggle i').addClass("fa-plus"); 38122 }) 38123 38124**/ 38125 38126 38127 $('.TIapplAccordion').click(function(){ 38128 $(this).closest('.listComponent-Element').find('.TIAppContent').fadeToggle( "slow", "linear" ); 38129 $(this).find('.img-toggle').toggle(); 38130 }) 38131 38132 38133$(document).ready(function() { 38134 $('.gs-list-view .card').matchHeight(); 38135 if ($(".dupont-list.featured-news").length < 1) { 38136 $('.gs-list-view.carousel-yes .card-carousel .card-row').slick({ 38137 arrows: true, 38138 slidesToShow: 4, 38139 infinite: false, 38140 slidesToScroll: 1, 38141 variableWidth: true, 38142 responsive: [{ 38143 breakpoint: 1200, 38144 settings: { 38145 slidesToShow: 3, 38146 slidesToScroll: 3 38147 } 38148 }, 38149 { 38150 breakpoint: 992, 38151 settings: { 38152 slidesToShow: 2, 38153 slidesToScroll: 2 38154 } 38155 }, 38156 { 38157 breakpoint: 768, 38158 settings: "unslick" 38159 } 38160 ] 38161 }); 38162 38163 $(window).on('resize', function() { 38164 $('.gs-list-view.carousel-yes .card-carousel .card-row').slick('resize'); 38165 }); 38166 } else { 38167 if (window.innerWidth > 768) { 38168 $('.gs-list-view.carousel-yes .card-carousel .card-row').append('<div class="card-column wow"></div>'); 38169 } 38170 $('.gs-list-view.carousel-yes .card-carousel .card-row').slick({ 38171 arrows: true, 38172 slidesToShow: 5, 38173 infinite: false, 38174 slidesToScroll: 1, 38175 variableWidth: true, 38176 speed: 300, 38177 responsive: [{ 38178 breakpoint: 1200, 38179 settings: { 38180 slidesToShow: 4, 38181 slidesToScroll: 1 38182 } 38183 }, 38184 { 38185 breakpoint: 992, 38186 settings: { 38187 slidesToShow: 3, 38188 slidesToScroll: 1 38189 } 38190 }, 38191 { 38192 breakpoint: 769, 38193 settings: { 38194 slidesToShow: 2, 38195 slidesToScroll: 1,
38196 arrows: false, 38197 dots: true, 38198 } 38199 } 38200 ] 38201 }); 38202 } 38203 38204}); 38205function ListWithIconandImage(elem){ 38206 this.elem = elem; 38207 38208 $(this.elem).find('.list_item').each(function(i,elem){ 38209 38210 if(i%2 === 0){ 38211 $(this).addClass('even'); 38212 }else{ 38213 $(this).addClass('odd'); 38214 } 38215 }) 38216 38217} 38218 38219$('.list__icon_image').each(function(i,e){ 38220 new ListWithIconandImage(e); 38221}); 38222 38223$(function(){ 38224 if($(".left-image-with-text").length){ 38225 $(".list-showmore-cta a.cta").click(function (event) { 38226 event.preventDefault(); 38227 $(this).closest('.left-image-with-text').addClass('list-show-all'); 38228 $(this).closest('.list-showmore-cta').hide(); 38229 }) 38230 } 38231 38232}) 38233$(function() { 38234 /*WebRotate Viewer component*/ 38235 var wrViewerComponent = function(compId) { 38236 38237 this.wrViewerComp = $($('.' + compId)[0]); 38238 38239 if (this.wrViewerComp.length > 0) { 38240 this.wrViewerContainer = this.wrViewerComp.find('.wr-container'); 38241 this.htmlPagePath = this.wrViewerContainer.attr('data-page-path'); 38242 this.multiFieldLists = JSON.parse(this.wrViewerContainer.attr('data-multiFieldsList-obj')); 38243 this.hsMappingList = this.multiFieldLists.hsMappingsList; 38244 this.xmlPath = this.wrViewerContainer.attr('data-xml-path'); 38245 this.cssFiles = this.multiFieldLists.cssFiles; 38246 this.jsfiles = this.multiFieldLists.jsFiles; 38247 this.bgImages = this.multiFieldLists.bgImages; 38248 this.rootDirPath = this.htmlPagePath.substr(0, this.htmlPagePath.lastIndexOf('/')); 38249 this.hsFragmentsObj = {}; 38250 38251 } 38252 38253 38254 }; 38255 38256 38257 wrViewerComponent.prototype.init = function() { 38258 38259 if (this.wrViewerComp.length > 0) { 38260 if (this.htmlPagePath != "null" && this.htmlPagePath != null && this.htmlPagePath != undefined) { 38261 this.removeData(); 38262 this.bindEvents(); 38263 this.setBGImages(); 38264 this.loadData(); 38265 38266 38267 } 38268 38269 } 38270 38271 }; 38272 38273 wrViewerComponent.prototype.bindEvents = function() { 38274 38275 this.wrViewerComp.on('click', '.close-btn', $.proxy(this.closeBtnClickHandler, this)); 38276 38277 }; 38278 38279 38280 wrViewerComponent.prototype.removeData = function() { 38281 38282 this.wrViewerContainer.removeAttr('data-page-path'); 38283 this.wrViewerContainer.removeAttr('data-xml-path'); 38284 this.wrViewerContainer.removeAttr('data-multiFieldsList-obj'); 38285 38286 }; 38287 38288 38289 wrViewerComponent.prototype.closeBtnClickHandler = function() { 38290 this.wrViewerComp.find('#hs-slideout-wrapper').hide(); 38291 this.wrViewerComp.find('.close-btn').hide(); 38292 this.wrViewerComp.find("#hs-slideout-wrapper .so-loader").hide(); 38293 this.wrViewerComp.find('#hs-slideout-wrapper .hs-slideout').removeClass('animate').html(''); 38294 $('body').css('overflow-y','auto'); 38295 38296 }; 38297 38298 wrViewerComponent.prototype.setBGImages = function() { 38299 var self = this; 38300 var html = ''; 38301 var imgWrapperWidth = this.wrViewerComp.find('.bg-image-wrapper').width(); 38302 var css = '<style>@keyframes bgfade {'; 38303 38304 try{ 38305 38306 if(this.bgImages && this.bgImages[0] != undefined){ 38307 this.wrViewerComp.find('.bg-image-wrapper').css('background-image','url(' + encodeURI(this.bgImages[0]) + ')'); 38308 } 38309 38310 $.each(this.bgImages, function(i, v) { 38311 var imgcount = self.bgImages.length; 38312 var prcntg = i * Math.ceil(100 / imgcount); 38313 css += prcntg + '% {background-image: url(' + encodeURI(v) + ');}' ; 38314 html += '<img src="' + encodeURI(v) + '" width="0" height="0"></img>' ; 38315 }); 38316 38317 $('body').append(html); 38318 css += '100% {background-image: url(' + encodeURI(self.bgImages[0]) + ');} }</style>'; 38319 $('body').append(css); 38320 this.wrViewerComp.find('.bg-image-wrapper').css('animation','bgfade ' + self.bgImages.length * 4 + 's infinite;') 38321 }catch(e){ 38322 console.log(e) 38323 } 38324 }; 38325 38326 /*To load web rotate html, scripts and css files*/ 38327 38328 wrViewerComponent.prototype.loadData = function() { 38329 try { 38330 var self = this; 38331 38332 for (var i = 0; i < this.cssFiles.length; i++) { 38333 var css = '<link type="text/css" rel="stylesheet" href="' + this.cssFiles[i] + '"></link>'; 38334 $('head').append(css); 38335 } 38336 38337 for (var j = 0; j < this.jsfiles.length; j++) { 38338 var js = '<script type="text/javascript" src="' + this.jsfiles[j] + '" ></script>'; 38339 $('body').append(js); 38340 } 38341 38342 38343 $.get(this.htmlPagePath, function(data) { 38344 38345 var pageHtml = $.parseHTML(data); 38346 var plyrID = $(pageHtml).find('.wr360_player').attr('id'); 38347 self.wrViewerContainer.append(pageHtml); 38348 38349 38350 $('#' + plyrID).rotator({ 38351 licenseFileURL: self.rootDirPath + '/license.lic', 38352 configFileURL: self.xmlPath, 38353 graphicsPath: self.rootDirPath + '/imagerotator/html/img/retina', 38354 googleEventTracking: false, 38355 apiReadyCallback: function(api, isFullScreen) { 38356 self.wrViewerComp.find('.bg-image-wrapper').fadeOut(); 38357 $('.wr-viewer').css({ 38358 height: 'auto' 38359 }); 38360 38361 self.wrViewerContainer.css('visibility', 'visible').hide().fadeIn(1500); 38362 // clearInterval(self.bgInterval); 38363 38364 var hotspotsObjList = api.hotspots.getDynamicHotspots(); 38365 38366 for (var i = 0; i < hotspotsObjList.length; i++) { 38367 hotspotsObjList[i].index = (i + 1); 38368 }; 38369 38370 api.hotspots.onAction(function(hotspotConfig) { 38371 38372 // return true to override default action. 38373 return true; 38374 }); 38375 38376 $.each(self.hsMappingList, function(i, v) { 38377 38378 var hsID = v.hsId; 38379 if (hsID >= 0) { 38380 var hsHtmlID = ($.grep(hotspotsObjList, function(obj) { 38381 return obj.index == (hsID); 38382 })[0]).hotspotHtmlId; 38383 38384 var coClass = "spot" + hsHtmlID + "_rollover"; 38385 38386 $('#' + hsHtmlID).on('mouseover', function(evnt) { 38387 38388 var left = evnt.pageX + 10; 38389 var top = evnt.pageY + 10; 38390 var hoverEl = self.wrViewerComp.find('.hover-popup'); 38391 if(left + 220 > window.innerWidth){ 38392 left = left - 220 ; 38393 } 38394 $("." + coClass + ">div").hide(); 38395 if(v.hoverText){ 38396 hoverEl.css({'left':left+"px", top:top+"px"}); 38397 hoverEl.html(v.hoverText).show(); 38398 } 38399 }); 38400 38401 $('#' + hsHtmlID).on('mouseout', function(evnt) { 38402 38403 var hoverEl = self.wrViewerComp.find('.hover-popup'); 38404 hoverEl.hide(); 38405 }); 38406 38407 38408 $('#' + hsHtmlID).on('click touchend', function(evnt) { 38409 evnt.preventDefault(); 38410 38411 $("#hs-slideout-wrapper").show(); 38412 $("#hs-slideout-wrapper .hs-slideout").addClass('animate'); 38413 $('body').css('overflow-y','hidden'); 38414 setTimeout(function(){ 38415 $("#hs-slideout-wrapper .so-loader").show(); 38416 self.wrViewerComp.find('.close-btn').show(); 38417 $("#hs-slideout-wrapper .hs-slideout").css('width','0p
38417x').html('<iframe id="hs_iframe" src='+v.xfPath + '.html?wcmmode=disabled></iframe>'); 38418 $('#hs_iframe').on('load', function(x,y) { 38419 var iframeDoc = $(document.getElementById('hs_iframe').contentWindow.document); 38420 iframeDoc.find('body').css({'overflow-x':'hidden','padding-top':'25px'}); 38421 iframeDoc.find('body').append("<style>.image-zoom-round--image img{border-radius:0px;} .image-zoom-round--thumbnail img{border-radius:0px;} </style>"); 38422 iframeDoc.on('click','a', function(evnt){ 38423 var el = $(evnt.currentTarget); 38424 var linkUrl = el.attr('href'); 38425 var dataType = el.attr('data-type'); 38426 var downloadAttr = el.attr('download') ; 38427 var target = el.attr('target'); 38428 if(target == undefined || target.trim() == ""){ 38429 target = "_self"; 38430 } 38431 if(linkUrl && linkUrl.trim() != "" && (dataType != "audio") && (dataType != "video") && (downloadAttr == undefined)){ 38432 evnt.preventDefault(); 38433 38434 window.open(linkUrl, target); 38435 } 38436 38437 }); 38438 $("#hs-slideout-wrapper .so-loader").hide(); 38439 38440 38441 }); 38442 },500); 38443 38444 38445 /*$.ajax({ 38446 url: v.xfPath + ".html?wcmmode=disabled", 38447 cache: true, 38448 success: function(response) { 38449 var body = $.parseHTML(response,document, false); 38450 console.log('body',body) 38451 // $("#hs-slideout-wrapper .hs-slideout").html(response); 38452 38453 // $("body").append(response); 38454 }, 38455 error: function(e) { 38456 console.log("Error in fetching fragment", e); 38457 } 38458 });*/ 38459 evnt.stopPropagation(); 38460 38461 }); 38462 38463 38464 } 38465 }) 38466 38467 if (self.wrViewerContainer.hasClass('editmode')) { 38468 38469 api.toolbar.playbackStart(50); 38470 setInterval(function() { 38471 var hs = $('#' + plyrID).find('.hotspot_indicator'); 38472 38473 $.each(hs, function(i, v) { 38474 var hsId = $(v).attr('id'); 38475 var id = ($.grep(hotspotsObjList, function(obj) { 38476 return obj.hotspotHtmlId == (hsId); 38477 })[0]).index; 38478 38479 $(v).html('<div style="color:#000; font-weight:bold; text-align:center;border:1px solid #000; background:#fff; margin-top:-25px;">' + id + '</div>'); 38480 }); 38481 38482 }, 1000); 38483 } 38484 38485 }, 38486 38487 }); 38488 38489 38490 }); 38491 } catch (e) { 38492 console.log("Exception", e); 38493 } 38494 38495 }; 38496 38497 38498 38499 $.each($('.web-rotate-viewer'), function(i, v) { 38500 $(v).addClass("wrv-" + i); 38501 (new wrViewerComponent("wrv-" + i)).init(); 38502 38503 }); 38504 38505 38506}); 38507 38508"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e=e||self).Plyr=t()}(this,function(){"use strict";!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,i;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i=n.preventDefault,n.preventDefault=function(){i.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}();var e="object"==typeof window&&window&&window.Math==Math?window:"object"==typeof self&&self&&self.Math==Math?self:Function("return this")(),t={}.hasOwnProperty,n=function(e,n){return t.call(e,n)},i=function(e){try{return!!e()}catch(e){return!0}},r=!i(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),a={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,s={f:o&&!a.call({1:2},1)?function(e){var t=o(this,e);return!!t&&t.enumerable}:a},l=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},c={}.toString,u=function(e){return c.call(e).slice(8,-1)},h="".split,f=i(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==u(e)?h.call(e,""):Object(e)}:Object,d=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},p=function(e){return f(d(e))},m=function(e){return"object"==typeof e?null!==e:"function"==typeof e},g=function(e,t){if(!m(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!m(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!m(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!m(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},v=e.document,y=m(v)&&m(v.createElement),b=function(e){return y?v.createElement(e):{}},w=!r&&!i(function(){return 7!=Object.defineProperty(b("div"),"a",{get:function(){return 7}}).a}),k=Object.getOwnPropertyDescriptor,T={f:r?k:function(e,t){if(e=p(e),t=g(t,!0),w)try{return k(e,t)}catch(e){}if(n(e,t))return l(!s.f.call(e,t),e[t])}},S=function(e){if(!m(e))throw TypeError(String(e)+" is not an object");return e},E=Object.defineProperty,A={f:r?E:function(e,t,n){if(S(e),t=g(t,!0),S(n),w)try{return E(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},P=r?function(e,t,n){return A.f(e,t,l(1,n))}:function(e,t,n){return e[t]=n,e},C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function x(e,t){return e(t={exports:{}},t.exports),t.exports}var L,I,M,N=function(t,n){try{P(e,t,n)}catch(i){e[t]=n}return n},j=x(function(t){var n=e["__core-js_shared__"]||N("__core-js_shared__",{});(t.exports=function(e,t){return n[e]||(n[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.0.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),O=j("native-function-to-string",Function.toString),R=e.WeakMap,_="function"==typeof R&&/native code/.test(O.call(R)),U=0,F=Math.random(),q=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++U+F).toString(36))},D=j("keys"),B=function(e){return D[e]||(D[e]=q(e))},H={},V=e.WeakMap;if(_){var z=new V,W=z.get,K=z.has,Y=z.set;L=function(e,t){return Y.call(z,e,t),t},I=function(e){return W.call(z,e)||{}},M=function(e){return K.call(z,e)}}else{var $=B("state");H[$]=!0,L=function(e,t){return P(e,$,t),t},I=function(e){return n(e,$)?e[$]:{}},M=function(e){return n(e,$)}}var G={set:L,get:I,has:M,enforce:function(e){return M(e)?I(e):L(e,{})},getterFor:function(e){return function(t){var n;if(!m(t)||(n=I(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},Q=x(function(t){var i=G.get,r=G.enforce,a=String(O).split("toString");j("inspectSource",function(e){return O.call(e)}),(t.exports=function(t,i,o,s){var l=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,u=!!s&&!!s.noTargetGet;"function"==typeof o&&("string"!=typeof i||n(o,"name")||P(o,"name",i),r(o).source=a.join("string"==typeof i?i:"")),t!==e?(l?!u&&t[i]&&(c=!0):delete t[i],c?t[i]=o:P(t,i,o)):c?t[i]=o:N(i,o)})(Function.prototype,"toString",function(){return"function"==typeof this&&i(this).source||O.call(this)})}),X=Math.ceil,J=Math.floor,Z=function(e){return isNaN(e=+e)?0:(e>0?J:X)(e)},ee=Math.min,te=function(e){return e>0?ee(Z(e),9007199254740991):0},ne=Math.max,ie=Math.min,re=function(e,t){var n=Z(e);return n<0?ne(n+t,0):ie(n,t)},ae=function(e){return function(t,n,i){var r,a=p(t),o=te(a.length),s=re(i,o);if(e&&n!=n){for(;o>s;)if((r=a[s++])!=r)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===n)return e||s||0;return!e&&-1}},oe=ae(!1),se=function(e,t){var i,r=p(e),a=0,o=[];for(i in r)!n(H,i)&&n(r,i)&&o.push(i);for(;t.length>a;)n(r,i=t[a++])&&(~oe(o,i)||o.push(i));return o},le=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleStr
38508ing","toString","valueOf"],ce=le.concat("length","prototype"),ue={f:Object.getOwnPropertyNames||function(e){return se(e,ce)}},he={f:Object.getOwnPropertySymbols},fe=e.Reflect,de=fe&&fe.ownKeys||function(e){var t=ue.f(S(e)),n=he.f;return n?t.concat(n(e)):t},pe=function(e,t){for(var i=de(t),r=A.f,a=T.f,o=0;o<i.length;o++){var s=i[o];n(e,s)||r(e,s,a(t,s))}},me=/#|\.prototype\./,ge=function(e,t){var n=ye[ve(e)];return n==we||n!=be&&("function"==typeof t?i(t):!!t)},ve=ge.normalize=function(e){return String(e).replace(me,".").toLowerCase()},ye=ge.data={},be=ge.NATIVE="N",we=ge.POLYFILL="P",ke=ge,Te=T.f,Se=function(t,n){var i,r,a,o,s,l=t.target,c=t.global,u=t.stat;if(i=c?e:u?e[l]||N(l,{}):(e[l]||{}).prototype)for(r in n){if(o=n[r],a=t.noTargetGet?(s=Te(i,r))&&s.value:i[r],!ke(c?r:l+(u?".":"#")+r,t.forced)&&void 0!==a){if(typeof o==typeof a)continue;pe(o,a)}(t.sham||a&&a.sham)&&P(o,"sham",!0),Q(i,r,o,t)}},Ee=!i(function(){return!String(Symbol())}),Ae=j("wks"),Pe=e.Symbol,Ce=function(e){return Ae[e]||(Ae[e]=Ee&&Pe[e]||(Ee?Pe:q)("Symbol."+e))},xe=A.f,Le=Ce("toStringTag"),Ie=function(e,t,i){e&&!n(e=i?e:e.prototype,Le)&&xe(e,Le,{configurable:!0,value:t})},Me={f:Ce},Ne=e,je=A.f,Oe=function(e){var t=Ne.Symbol||(Ne.Symbol={});n(t,e)||je(t,e,{value:Me.f(e)})},Re=Object.keys||function(e){return se(e,le)},_e=Array.isArray||function(e){return"Array"==u(e)},Ue=r?Object.defineProperties:function(e,t){S(e);for(var n,i=Re(t),r=i.length,a=0;r>a;)A.f(e,n=i[a++],t[n]);return e},Fe=e.document,qe=Fe&&Fe.documentElement,De=B("IE_PROTO"),Be=function(){},He=function(){var e,t=b("iframe"),n=le.length;for(t.style.display="none",qe.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),He=e.F;n--;)delete He.prototype[le[n]];return He()},Ve=Object.create||function(e,t){var n;return null!==e?(Be.prototype=S(e),n=new Be,Be.prototype=null,n[De]=e):n=He(),void 0===t?n:Ue(n,t)};H[De]=!0;var ze=ue.f,We={}.toString,Ke="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ye={f:function(e){return Ke&&"[object Window]"==We.call(e)?function(e){try{return ze(e)}catch(e){return Ke.slice()}}(e):ze(p(e))}},$e=B("hidden"),Ge=G.set,Qe=G.getterFor("Symbol"),Xe=T.f,Je=A.f,Ze=Ye.f,et=e.Symbol,tt=e.JSON,nt=tt&&tt.stringify,it=Ce("toPrimitive"),rt=s.f,at=j("symbol-registry"),ot=j("symbols"),st=j("op-symbols"),lt=j("wks"),ct=Object.prototype,ut=e.QObject,ht=!ut||!ut.prototype||!ut.prototype.findChild,ft=r&&i(function(){return 7!=Ve(Je({},"a",{get:function(){return Je(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=Xe(ct,t);i&&delete ct[t],Je(e,t,n),i&&e!==ct&&Je(ct,t,i)}:Je,dt=function(e,t){var n=ot[e]=Ve(et.prototype);return Ge(n,{type:"Symbol",tag:e,description:t}),r||(n.description=t),n},pt=Ee&&"symbol"==typeof et.iterator?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof et},mt=function(e,t,i){return e===ct&&mt(st,t,i),S(e),t=g(t,!0),S(i),n(ot,t)?(i.enumerable?(n(e,$e)&&e[$e][t]&&(e[$e][t]=!1),i=Ve(i,{enumerable:l(0,!1)})):(n(e,$e)||Je(e,$e,l(1,{})),e[$e][t]=!0),ft(e,t,i)):Je(e,t,i)},gt=function(e,t){S(e);for(var n,i=function(e){var t=Re(e),n=he.f;if(n)for(var i,r=n(e),a=s.f,o=0;r.length>o;)a.call(e,i=r[o++])&&t.push(i);return t}(t=p(t)),r=0,a=i.length;a>r;)mt(e,n=i[r++],t[n]);return e},vt=function(e){var t=rt.call(this,e=g(e,!0));return!(this===ct&&n(ot,e)&&!n(st,e))&&(!(t||!n(this,e)||!n(ot,e)||n(this,$e)&&this[$e][e])||t)},yt=function(e,t){if(e=p(e),t=g(t,!0),e!==ct||!n(ot,t)||n(st,t)){var i=Xe(e,t);return!i||!n(ot,t)||n(e,$e)&&e[$e][t]||(i.enumerable=!0),i}},bt=function(e){for(var t,i=Ze(p(e)),r=[],a=0;i.length>a;)n(ot,t=i[a++])||n(H,t)||r.push(t);return r},wt=function(e){for(var t,i=e===ct,r=Ze(i?st:p(e)),a=[],o=0;r.length>o;)!n(ot,t=r[o++])||i&&!n(ct,t)||a.push(ot[t]);return a};Ee||(Q((et=function(){if(this instanceof et)throw TypeError("Symbol is not a constructor");var e=void 0===arguments[0]?void 0:String(arguments[0]),t=q(e),i=function(e){this===ct&&i.call(st,e),n(this,$e)&&n(this[$e],t)&&(this[$e][t]=!1),ft(this,t,l(1,e))};return r&&ht&&ft(ct,t,{configurable:!0,set:i}),dt(t,e)}).prototype,"toString",function(){return Qe(this).tag}),s.f=vt,A.f=mt,T.f=yt,ue.f=Ye.f=bt,he.f=wt,r&&(Je(et.prototype,"description",{configurable:!0,get:function(){return Qe(this).description}}),Q(ct,"propertyIsEnumerable",vt,{unsafe:!0})),Me.f=function(e){return dt(Ce(e),e)}),Se({global:!0,wrap:!0,forced:!Ee,sham:!Ee},{Symbol:et});for(var kt=Re(lt),Tt=0;kt.length>Tt;)Oe(kt[Tt++]);Se({target:"Symbol",stat:!0,forced:!Ee},{for:function(e){return n(at,e+="")?at[e]:at[e]=et(e)},keyFor:function(e){if(!pt(e))throw TypeError(e+" is not a symbol");for(var t in at)if(at[t]===e)return t},useSetter:function(){ht=!0},useSimple:function(){ht=!1}}),Se({target:"Object",stat:!0,forced:!Ee,sham:!r},{create:function(e,t){return void 0===t?Ve(e):gt(Ve(e),t)},defineProperty:mt,defineProperties:gt,getOwnPropertyDescriptor:yt}),Se({target:"Object",stat:!0,forced:!Ee},{getOwnPropertyNames:bt,getOwnPropertySymbols:wt}),tt&&Se({target:"JSON",stat:!0,forced:!Ee||i(function(){var e=et();return"[null]"!=nt([e])||"{}"!=nt({a:e})||"{}"!=nt(Object(e))})},{stringify:function(e){for(var t,n,i=[e],r=1;arguments.length>r;)i.push(arguments[r++]);if(n=t=i[1],(m(t)||void 0!==e)&&!pt(e))return _e(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!pt(t))return t}),i[1]=t,nt.apply(tt,i)}}),et.prototype[it]||P(et.prototype,it,et.prototype.valueOf),Ie(et,"Symbol"),H[$e]=!0;var St=A.f,Et=e.Symbol;if(r&&"function"==typeof Et&&(!("description"in Et.prototype)||void 0!==Et().description)){var At={},Pt=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Pt?new Et(e):void 0===e?Et():Et(e);return""===e&&(At[t]=!0),t};pe(Pt,Et);var Ct=Pt.prototype=Et.prototype;Ct.constructor=Pt;
38508var xt=Ct.toString,Lt="Symbol(test)"==String(Et("test")),It=/^Symbol\((.*)\)[^)]+$/;St(Ct,"description",{configurable:!0,get:function(){var e=m(this)?this.valueOf():this,t=xt.call(e);if(n(At,e))return"";var i=Lt?t.slice(7,-1):t.replace(It,"$1");return""===i?void 0:i}}),Se({global:!0,forced:!0},{Symbol:Pt})}Oe("iterator");var Mt=Ce("unscopables"),Nt=Array.prototype;null==Nt[Mt]&&P(Nt,Mt,Ve(null));var jt,Ot,Rt,_t=function(e){Nt[Mt][e]=!0},Ut={},Ft=function(e){return Object(d(e))},qt=!i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Dt=B("IE_PROTO"),Bt=Object.prototype,Ht=qt?Object.getPrototypeOf:function(e){return e=Ft(e),n(e,Dt)?e[Dt]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Bt:null},Vt=Ce("iterator"),zt=!1;[].keys&&("next"in(Rt=[].keys())?(Ot=Ht(Ht(Rt)))!==Object.prototype&&(jt=Ot):zt=!0),null==jt&&(jt={}),n(jt,Vt)||P(jt,Vt,function(){return this});var Wt={IteratorPrototype:jt,BUGGY_SAFARI_ITERATORS:zt},Kt=Wt.IteratorPrototype,Yt=function(){return this},$t=function(e,t,n){var i=t+" Iterator";return e.prototype=Ve(Kt,{next:l(1,n)}),Ie(e,i,!1),Ut[i]=Yt,e},Gt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return function(e,t){if(S(e),!m(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(n,i),t?e.call(n,i):n.__proto__=i,n}}():void 0),Qt=Ce("iterator"),Xt=Wt.IteratorPrototype,Jt=Wt.BUGGY_SAFARI_ITERATORS,Zt=function(){return this},en=function(e,t,n,i,r,a,o){$t(n,t,i);var s,l,c,u=function(e){if(e===r&&m)return m;if(!Jt&&e in d)return d[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",f=!1,d=e.prototype,p=d[Qt]||d["@@iterator"]||r&&d[r],m=!Jt&&p||u(r),g="Array"==t&&d.entries||p;if(g&&(s=Ht(g.call(new e)),Xt!==Object.prototype&&s.next&&(Ht(s)!==Xt&&(Gt?Gt(s,Xt):"function"!=typeof s[Qt]&&P(s,Qt,Zt)),Ie(s,h,!0))),"values"==r&&p&&"values"!==p.name&&(f=!0,m=function(){return p.call(this)}),d[Qt]!==m&&P(d,Qt,m),Ut[t]=m,r)if(l={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},o)for(c in l)!Jt&&!f&&c in d||Q(d,c,l[c]);else Se({target:t,proto:!0,forced:Jt||f},l);return l},tn=G.set,nn=G.getterFor("Array Iterator"),rn=en(Array,"Array",function(e,t){tn(this,{type:"Array Iterator",target:p(e),index:0,kind:t})},function(){var e=nn(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}},"values");Ut.Arguments=Ut.Array,_t("keys"),_t("values"),_t("entries");var an=function(e,t){var n=[][e];return!n||!i(function(){n.call(null,t||function(){throw 1},1)})},on=[].join,sn=f!=Object,ln=an("join",",");Se({target:"Array",proto:!0,forced:sn||ln},{join:function(e){return on.call(p(this),void 0===e?",":e)}});var cn=function(e,t,n){var i=g(t);i in e?A.f(e,i,l(0,n)):e[i]=n},un=Ce("species"),hn=function(e){return!i(function(){var t=[];return(t.constructor={})[un]=function(){return{foo:1}},1!==t[e](Boolean).foo})},fn=Ce("species"),dn=[].slice,pn=Math.max,mn=hn("slice");Se({target:"Array",proto:!0,forced:!mn},{slice:function(e,t){var n,i,r,a=p(this),o=te(a.length),s=re(e,o),l=re(void 0===t?o:t,o);if(_e(a)&&("function"!=typeof(n=a.constructor)||n!==Array&&!_e(n.prototype)?m(n)&&null===(n=n[fn])&&(n=void 0):n=void 0,n===Array||void 0===n))return dn.call(a,s,l);for(i=new(void 0===n?Array:n)(pn(l-s,0)),r=0;s<l;s++,r++)s in a&&cn(i,r,a[s]);return i.length=r,i}});var gn=Ce("toStringTag"),vn="Arguments"==u(function(){return arguments}()),yn=function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),gn))?n:vn?u(t):"Object"==(i=u(t))&&"function"==typeof t.callee?"Arguments":i},bn={};bn[Ce("toStringTag")]="z";var wn="[object z]"!==String(bn)?function(){return"[object "+yn(this)+"]"}:bn.toString,kn=Object.prototype;wn!==kn.toString&&Q(kn,"toString",wn,{unsafe:!0});var Tn=function(){var e=S(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Sn=/./.toString,En=i(function(){return"/a/b"!=Sn.call({source:"a",flags:"b"})}),An="toString"!=Sn.name;(En||An)&&Q(RegExp.prototype,"toString",function(){var e=S(this);return"/".concat(e.source,"/","flags"in e?e.flags:!r&&e instanceof RegExp?Tn.call(e):void 0)},{unsafe:!0});var Pn=function(e,t,n){var i,r,a=String(d(e)),o=Z(t),s=a.length;return o<0||o>
vendor: 17,993 bytes, line 38508
38508=s?n?"":void 0:(i=a.charCodeAt(o))<55296||i>56319||o+1===s||(r=a.charCodeAt(o+1))<56320||r>57343?n?a.charAt(o):i:n?a.slice(o,o+2):r-56320+(i-55296<<10)+65536},Cn=G.set,xn=G.getterFor("String Iterator");en(String,"String",function(e){Cn(this,{type:"String Iterator",string:String(e),index:0})},function(){var e,t=xn(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=Pn(n,i,!0),t.index+=e.length,{value:e,done:!1})});var Ln=function(e,t,n){return t+(n?Pn(e,t,!0).length:1)},In=RegExp.prototype.exec,Mn=String.prototype.replace,Nn=In,jn=function(){var e=/a/,t=/b*/g;return In.call(e,"a"),In.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),On=void 0!==/()??/.exec("")[1];(jn||On)&&(Nn=function(e){var t,n,i,r,a=this;return On&&(n=new RegExp("^"+a.source+"$(?!\\s)",Tn.call(a))),jn&&(t=a.lastIndex),i=In.call(a,e),jn&&i&&(a.lastIndex=a.global?i.index+i[0].length:t),On&&i&&i.length>1&&Mn.call(i[0],n,function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(i[r]=void 0)}),i});var Rn=Nn,_n=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==u(e))throw TypeError("RegExp#exec called on incompatible receiver");return Rn.call(e,t)},Un=Ce("species"),Fn=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),qn=!i(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}),Dn=function(e,t,n,r){var a=Ce(e),o=!i(function(){var t={};return t[a]=function(){return 7},7!=""[e](t)}),s=o&&!i(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[Un]=function(){return n}),n[a](""),!t});if(!o||!s||"replace"===e&&!Fn||"split"===e&&!qn){var l=/./[a],c=n(a,""[e],function(e,t,n,i,r){return t.exec===Rn?o&&!r?{done:!0,value:l.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}),u=c[0],h=c[1];Q(String.prototype,e,u),Q(RegExp.prototype,a,2==t?function(e,t){return h.call(e,this,t)}:function(e){return h.call(e,this)}),r&&P(RegExp.prototype[a],"sham",!0)}},Bn=Math.max,Hn=Math.min,Vn=Math.floor,zn=/\$([$&`']|\d\d?|<[^>]*>)/g,Wn=/\$([$&`']|\d\d?)/g;Dn("replace",2,function(e,t,n){return[function(n,i){var r=d(this),a=null==n?void 0:n[e];return void 0!==a?a.call(n,r,i):t.call(String(r),n,i)},function(e,r){var a=n(t,e,this,r);if(a.done)return a.value;var o=S(e),s=String(this),l="function"==typeof r;l||(r=String(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var f=_n(o,s);if(null===f)break;if(h.push(f),!c)break;""===String(f[0])&&(o.lastIndex=Ln(s,te(o.lastIndex),u))}for(var d,p="",m=0,g=0;g<h.length;g++){f=h[g];for(var v=String(f[0]),y=Bn(Hn(Z(f.index),s.length),0),b=[],w=1;w<f.length;w++)b.push(void 0===(d=f[w])?d:String(d));var k=f.groups;if(l){var T=[v].concat(b,y,s);void 0!==k&&T.push(k);var E=String(r.apply(void 0,T))}else E=i(v,s,y,b,k,r);y>=m&&(p+=s.slice(m,y)+E,m=y+v.length)}return p+s.slice(m)}];function i(e,n,i,r,a,o){var s=i+e.length,l=r.length,c=Wn;return void 0!==a&&(a=Ft(a),c=zn),t.call(o,c,function(t,o){var c;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,i);case"'":return n.slice(s);case"<":c=a[o.slice(1,-1)];break;default:var u=+o;if(0===u)return t;if(u>l){var h=Vn(u/10);return 0===h?t:h<=l?void 0===r[h-1]?o.charAt(1):r[h-1]+o.charAt(1):t}c=r[u-1]}return void 0===c?"":c})}});var Kn=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};Dn("search",1,function(e,t,n){return[function(t){var n=d(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,e,this);if(i.done)return i.value;var r=S(e),a=String(this),o=r.lastIndex;Kn(o,0)||(r.lastIndex=0);var s=_n(r,a);return Kn(r.lastIndex,o)||(r.lastIndex=o),null===s?-1:s.index}]});var Yn=Ce("match"),$n=function(e){var t;return m(e)&&(void 0!==(t=e[Yn])?!!t:"RegExp"==u(e))},Gn=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Qn=Ce("species"),Xn=function(e,t){var n,i=S(e).constructor;return void 0===i||null==(n=S(i)[Qn])?t:Gn(n)},Jn=[].push,Zn=Math.min,ei=!i(function(){return!RegExp(4294967295,"y")});Dn("split",2,function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=String(d(this)),r=void 0===n?4294967295:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!$n(e))return t.call(i,e,r);for(var a,o,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,h=new RegExp(e.source,c+"g");(a=Rn.call(h,i))&&!((o=h.lastIndex)>u&&(l.push(i.slice(u,a.index)),a.length>1&&a.index<i.length&&Jn.apply(l,a.slice(1)),s=a[0].length,u=o,l.length>=r));)h.lastIndex===a.index&&h.lastIndex++;return u===i.length?!s&&h.test("")||l.push(""):l.push(i.slice(u)),l.length>r?l.slice(0,r):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var r=d(this),a=null==t?void 0:t[e];return void 0!==a?a.call(t,r,n):i.call(String(r),t,n)},function(e,r){var a=n(i,e,this,r,i!==t);if(a.done)return a.value;var o=S(e),s=String(this),l=Xn(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(ei?"y":"g"),h=new l(ei?o:"^(?:"+o.source+")",u),f=void 0===r?4294967295:r>>>0;if(0===f)return[];if(0===s.length)return null===_n(h,s)?[s]:[];for(var d=0,p=0,m=[];p<s.length;){h.lastIndex=ei?p:0;var g,v=_n(h,ei?s:s.slice(p));if(null===v||(g=Zn(te(h.lastIndex+(ei?0:p)),s.length))===d)p=Ln(s,p,c);else{if(m.push(s.slice(d,p)),m.length===f)return m;for(var y=1;y<=v.length-1;y++)if(m.push(v[y]),m.length===f)return m;p=d=g}}return m.push(s.slice(d)),m}]},!ei);var ti={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},ni=function(e,t,n){if(Gn(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}},ii=Ce("species"),ri=function(e,t){var n;return _e(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!_e(n.prototype)?m(n)&&null===(n=n[ii])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},ai=function(e,t){var n=1==e,i=2==e,r=3==e,a=4==e,o=6==e,s=5==e||o,l=t||ri;return function(t,c,u){for(var h,d,p=Ft(t),m=f(p),g=ni(c,u,3),v=te(m.length),y=0,b=n?l(t,v):i?l(t,0):void 0;v>y;y++)if((s||y in m)&&(d=g(h=m[y],y,p),e))if(n)b[y]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:b.push(h)}else if(a)return!1;return o?-1:r||a?a:b}},oi=[].forEach,si=ai(0),li=an("forEach")?function(e){return si(this,e,arguments[1])}:oi;for(var ci in ti){var ui=e[ci],hi=ui&&ui.prototype;if(hi&&hi.forEach!==li)try{P(hi,"forEach",li)}catch(e){hi.forEach=li}}var fi=Ce("iterator"),di=Ce("toStringTag"),pi=rn.values;for(var mi in ti){var gi=e[mi],vi=gi&&gi.prototype;if(vi){if(vi[fi]!==pi)try{P(vi,fi,pi)}catch(e){vi[fi]=pi}if(vi[di]||P(vi,di,mi),ti[mi])for(var yi in rn)if(vi[yi]!==rn[yi])try{P(vi,yi,rn[yi])}catch(e){vi[yi]=rn[yi]}}}var bi=Ce("iterator"),wi=!i(function(){var e=new URL("b?e=1","http://a"),t=e.searchParams;return e.pathname="c%20d",!t.sort||"http://a/c%20d?e=1"!==e.href||"1"!==t.get("e")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[bi]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://ÑеÑÑ").host||"#%D0%B1"!==new URL("http://a#б").hash}),ki=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Ti=Object.assign,Si=!Ti||i(function(){var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),7!=Ti({},e)[n]||"abcdefghijklmnopqrst"!=Re(Ti({},t)).join("")})?function(e,t){for(var n=Ft(e),i=arguments.length,r=1,a=he.f,o=s.f;i>r;)for(var l,c=f(arguments[r++]),u=a?Re(c).concat(a(c)):Re(c),h=u.length,d=0;h>d;)o.call(c,l=u[d++])&&(n[l]=c[l]);return n}:Ti,Ei=function(e,t,n,i){try{return i?t(S(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&S(r.call(e)),t}},Ai=Ce("iterator"),Pi=Array.prototype,Ci=function(e){return void 0!==e&&(Ut.Array===e||Pi[Ai]===e)},xi=Ce("iterator"),Li=function(e){if(null!=e)return e[xi]||e["@@iterator"]||Ut[yn(e)]},Ii=function(e){var t,n,i,r,a=Ft(e),o="function"==typeof this?this:Array,s=arguments.length,l=s>1?arguments[1]:void 0,c=void 0!==l,u=0,h=Li(a);if(c&&(l=ni(l,s>2?arguments[2]:void 0,2)),null==h||o==Array&&Ci(h))for(n=new o(t=te(a.length));t>u;u++)cn(n,u,c?l(a[u],u):a[u]);else for(r=h.call(a),n=new o;!(i=r.next()).done;u++)cn(n,u,c?Ei(r,l,[i.value,u],!0):i.value);return n.length=u,n},Mi=/[^\0-\u007E]/,Ni=/[\u002E\u3002\uFF0E\uFF61]/g,ji="Overflow: input needs wider integers to process",Oi=Math.floor,Ri=String.fromCharCode,_i=function(e){return e+22+75*(e<26)},Ui=function(e,t,n){var i=0;for(e=n?Oi(e/700):e>>1,e+=Oi(e/t);e>455;i+=36)e=Oi(e/35);return Oi(i+36*e/(e+38))},Fi=function(e){var t,n,i=[],r=(e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&r)<<10)+(1023&a)+65536):(t.push(r),n--)}else t.push(r)}return t}(e)).length,a=128,o=0,s=72;for(t=0;t<e.length;t++)(n=e[t])<128&&i.push(Ri(n));var l=i.length,c=l;for(l&&i.push("-");c<r;){var u=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=a&&n<u&&(u=n);var h=c+1;if(u-a>Oi((2147483647-o)/h))throw RangeError(ji);for(o+=(u-a)*h,a=u,t=0;t<e.length;t++){if((n=e[t])<a&&++o>2147483647)throw RangeError(ji);if(n==a){for(var f=o,d=36;;d+=36){var p=d<=s?1:d>=s+26?26:d-s;if(f<p)break;var m=f-p,g=36-p;i.push(Ri(_i(p+m%g))),f=Oi(m/g)}i.push(Ri(_i(f))),s=Ui(o,h,c==l),o=0,++c}}++o,++a}return i.join("")},qi=function(e,t,n){for(var i in t)Q(e,i,t[i],n);return e},Di=function(e){var t=Li(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return S(t.call(e))},Bi=Ce("iterator"),Hi=G.set,Vi=G.getterFor("URLSearchParams"),zi=G.getterFor("URLSearchParamsIterator"),Wi=/\+/g,Ki=Array(4),Yi=function(e){return Ki[e-1]||(Ki[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},$i=function(e){try{return decodeURIComponent(e)}catch(t){return e}},Gi=function(e){for(var t=e.replace(Wi," "),n=4;n;)t=t.replace(Yi(n--),$i);return t},Qi=/[!'()~]|%20/g,Xi={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Ji=function(e){return Xi[e]},Zi=function(e){return encodeURIComponent(e).replace(Qi,Ji)},er=function(e,t){if(t)for(var n,i,r=t.split("&"),a=0;a<r.length;)(n=r[a++]).length&&(i=n.split("="),e.push({key:Gi(i.shift()),value:Gi(i.join("="))}));return e},tr=function(e){this.entries.length=0,er(this.entries,e)},nr=function(e,t){if(e<t)throw TypeError("Not enough arguments")},ir=$t(function(e,t){Hi(this,{type:"URLSearchParamsIterator",iterator:Di(Vi(e).entries),kind:t})},"Iterator",function(){var e=zi(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),rr=function(){ki(this,rr,"URLSearchParams");var e,t,i,r,a,o,s,l=arguments.length>0?arguments[0]:void 0,c=[];if(Hi(this,{type:"URLSearchParams",entries:c,updateURL:null,updateSearchParams:tr}),void 0!==l)if(m(l))if("function"==typeof(e=Li(l)))for(t=e.call(l);!(i=t.next()).done;){if((a=(r=Di(S(i.value))).next()).done||(o=r.next()).done||!r.next().done)throw TypeError("Expected sequence with length 2");c.push({key:a.value+"",value:o.value+""})}else for(s in l)n(l,s)&&c.push({key:s,value:l[s]+""});else er(c,"string"==typeof l?"?"===l.charAt(0)?l.slice(1):l:l+"")},ar=rr.prototype;qi(ar,{append:function(e,t){nr(arguments.length,2);var n=Vi(this);n.entries.push({key:e+"",value:t+""}),n.updateURL&&n.updateURL()},delete:function(e){nr(arguments.length,1);for(var t=Vi(this),n=t.entries,i=e+"",r=0;r<n.length;)n[r].key===i?n.splice(r,1):r++;t.updateURL&&t.updateURL()},get:function(e){nr(arguments.length,1);for(var t=Vi(this).entries,n=e+"",i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){nr(arguments.length,1);for(var t=Vi(this).entries,n=e+"",i=[],r=0;r<t.length;r++)t[r].key===n&&i.push(t[r].value);return i},has:function(e){nr(arguments.length,1);for(var t=Vi(this).entries,n=e+"",i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){nr(arguments.length,1);for(var n,i=Vi(this),r=i.entries,a=!1,o=e+"",s=t+"",l=0;l<r.length;l++)(n=r[l]).key===o&&(a?r.splice(l--,1):(a=!0,n.value=s));a||r.push({key:o,value:s}),i.updateURL&&i.updateURL()},sort:function(){var e,t,n,i=Vi(this),r=i.entries,a=r.slice();for(r.length=0,t=0;t<a.length;t++){for(e=a[t],n=0;n<t;n++)if(r[n].key>e.key){r.splice(n,0,e);break}n===t&&r.push(e)}i.updateURL&&i.updateURL()},forEach:function(e){for(var t,n=Vi(this).entries,i=ni(e,arguments.length>1?arguments[1]:void 0,3),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new ir(this,"keys")},values:function(){return new ir(this,"values")},entries:function(){return new ir(this,"entries")}},{enumerable:!0}),Q(ar,Bi,ar.entries),Q(ar,"toString",function(){for(var e,t=Vi(this).entries,n=[],i=0;i<t.length;)e=t[i++],n.push(Zi(e.key)+"="+Zi(e.value));return n.join("&")},{enumerable:!0}),Ie(rr,"URLSearchParams"),Se({global:!0,forced:!wi},{URLSearchParams:rr});var or,sr={URLSearchParams:rr,getState:Vi},lr=e.URL,cr=sr.URLSearchParams,ur=sr.getState,hr=G.set,fr=G.getterFor("URL"),dr=Math.pow,pr=/[a-zA-Z]/,mr=/[a-zA-Z0-9+\-.]/,gr=/\d/,vr=/^(0x|0X)/,yr=/^[0-7]+$/,br=/^\d+$/,wr=/^[0-9A-Fa-f]+$/,kr=/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/,Tr=/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/,Sr=/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,Er=/\u0009|\u000A|\u000D/g,Ar=function(e,t){var n,i,r;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=Cr(t.slice(1,-1))))return"Invalid host";e.host=n}else if(Rr(e)){if(t=function(e){var t,n,i=[],r=e.toLowerCase().replace(Ni,".").split(".");for(t=0;t<r.length;t++)n=r[t],i.push(Mi.test(n)?"xn--"+Fi(n):n);return i.join(".")}(t),kr.test(t))return"Invalid host";if(null===(n=Pr(t)))return"Invalid host";e.host=n}else{if(Tr.test(t))return"Invalid host";for(n="",i=Ii(t),r=0;r<i.length;r++)n+=jr(i[r],Lr);e.host=n}},Pr=function(e){var t,n,i,r,a,o,s,l=e.split(".");if(""==l[l.length-1]&&l.length&&l.pop(),(t=l.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=l[i]))return e;if(a=10,r.length>1&&"0"==r.charAt(0)&&(a=vr.test(r)?16:8,r=r.slice(8==a?1:2)),""===r)o=0;else{if(!(10==a?br:8==a?yr:wr).test(r))return e;o=parseInt(r,a)}n.push(o)}for(i=0;i<t;i++)if(o=n[i],i==t-1){if(o>=dr(256,5-t))return null}else if(o>255)return null;for(s=n.pop(),i=0;i<n.length;i++)s+=n[i]*dr(256,3-i);return s},Cr=function(e){var t,n,i,r,a,o,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,f=function(){return e.charAt(h)};if(":"==f()){if(":"!=e.charAt(1))return;h+=2,u=++c}for(;f();){if(8==c)return;if(":"!=f()){for(t=n=0;n<4&&wr.test(f());)t=16*t+parseInt(f(),16),h++,n++;if("."==f()){if(0==n)return;if(h-=n,c>6)return;for(i=0;f();){if(r=null,i>0){if(!("."==f()&&i<4))return;h++}if(!gr.test(f()))return;for(;gr.test(f());){if(a=parseInt(f(),10),null===r)r=a;else{if(0==r)return;r=10*r+a}if(r>255)return;h++}l[c]=256*l[c]+r,2!=++i&&4!=i||c++}if(4!=i)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(o=c-u,c=7;0!=c&&o>0;)s=l[c],l[c--]=l[u+o-1],l[u+--o]=s;else if(8!=c)return;return l},xr=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=Math.floor(e/256);return t.join(".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,a=0;a<8;a++)0!==e[a]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=a),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},Lr={},Ir=Si({},Lr,{" ":1,'"':1,"<":1,">":1,"`":1}),Mr=Si({},Ir,{"#":1,"?":1,"{":1,"}":1}),Nr=Si({},Mr,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),jr=function(e,t){var i=Pn(e,0);return i>32&&i<127&&!n(t,e)?e:encodeURIComponent(e)},Or={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443},Rr=function(e){return n(Or,e.scheme)},_r=function(e){return""!=e.username||""!=e.password},Ur=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Fr=function(e,t){var n;return 2==e.length&&pr.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},qr=function(e){var t;return e.length>1&&Fr(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},Dr=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&Fr(t[0],!0)||t.pop()},Br=function(e){return"."===e||"%2e"===e.toLowerCase()},Hr={},Vr={},zr={},Wr={},Kr={},Yr={},$r={},Gr={},Qr={},Xr={},Jr={},Zr={},ea={},ta={},na={},ia={},ra={},aa={},oa={},sa={},la={},ca=function(e,t,i,r){var a,o,s,l,c,u=i||Hr,h=0,f="",d=!1,p=!1,m=!1;for(i||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(Sr,"")),t=t.replace(Er,""),a=Ii(t);h<=a.length;){switch(o=a[h],u){case Hr:if(!o||!pr.test(o)){if(i)return"Invalid scheme";u=zr;continue}f+=o.toLowerCase(),u=Vr;break;case Vr:if(o&&(mr.test(o)||"+"==o||"-"==o||"."==o))f+=o.toLowerCase();
vendor: 5,480 bytes, line 38508
38508else{if(":"!=o){if(i)return"Invalid scheme";f="",u=zr,h=0;continue}if(i&&(Rr(e)!=n(Or,f)||"file"==f&&(_r(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=f,i)return void(Rr(e)&&Or[e.scheme]==e.port&&(e.port=null));f="","file"==e.scheme?u=ta:Rr(e)&&r&&r.scheme==e.scheme?u=Wr:Rr(e)?u=Gr:"/"==a[h+1]?(u=Kr,h++):(e.cannotBeABaseURL=!0,e.path.push(""),u=oa)}break;case zr:if(!r||r.cannotBeABaseURL&&"#"!=o)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==o){e.scheme=r.scheme,e.path=r.path.slice(),e.query=r.query,e.fragment="",e.cannotBeABaseURL=!0,u=la;break}u="file"==r.scheme?ta:Yr;continue;case Wr:if("/"!=o||"/"!=a[h+1]){u=Yr;continue}u=Qr,h++;break;case Kr:if("/"==o){u=Xr;break}u=aa;continue;case Yr:if(e.scheme=r.scheme,o==or)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query;else if("/"==o||"\\"==o&&Rr(e))u=$r;else if("?"==o)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query="",u=sa;else{if("#"!=o){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.path.pop(),u=aa;continue}e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query,e.fragment="",u=la}break;case $r:if(!Rr(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,u=aa;continue}u=Xr}else u=Qr;break;case Gr:if(u=Qr,"/"!=o||"/"!=f.charAt(h+1))continue;h++;break;case Qr:if("/"!=o&&"\\"!=o){u=Xr;continue}break;case Xr:if("@"==o){d&&(f="%40"+f),d=!0,s=Ii(f);for(var g=0;g<s.length;g++){var v=s[g];if(":"!=v||m){var y=jr(v,Nr);m?e.password+=y:e.username+=y}else m=!0}f=""}else if(o==or||"/"==o||"?"==o||"#"==o||"\\"==o&&Rr(e)){if(d&&""==f)return"Invalid authority";h-=Ii(f).length+1,f="",u=Jr}else f+=o;break;case Jr:case Zr:if(i&&"file"==e.scheme){u=ia;continue}if(":"!=o||p){if(o==or||"/"==o||"?"==o||"#"==o||"\\"==o&&Rr(e)){if(Rr(e)&&""==f)return"Invalid host";if(i&&""==f&&(_r(e)||null!==e.port))return;if(l=Ar(e,f))return l;if(f="",u=ra,i)return;continue}"["==o?p=!0:"]"==o&&(p=!1),f+=o}else{if(""==f)return"Invalid host";if(l=Ar(e,f))return l;if(f="",u=ea,i==Zr)return}break;case ea:if(!gr.test(o)){if(o==or||"/"==o||"?"==o||"#"==o||"\\"==o&&Rr(e)||i){if(""!=f){var b=parseInt(f,10);if(b>65535)return"Invalid port";e.port=Rr(e)&&b===Or[e.scheme]?null:b,f=""}if(i)return;u=ra;continue}return"Invalid port"}f+=o;break;case ta:if(e.scheme="file","/"==o||"\\"==o)u=na;else{if(!r||"file"!=r.scheme){u=aa;continue}if(o==or)e.host=r.host,e.path=r.path.slice(),e.query=r.query;else if("?"==o)e.host=r.host,e.path=r.path.slice(),e.query="",u=sa;else{if("#"!=o){qr(a.slice(h).join(""))||(e.host=r.host,e.path=r.path.slice(),Dr(e)),u=aa;continue}e.host=r.host,e.path=r.path.slice(),e.query=r.query,e.fragment="",u=la}}break;case na:if("/"==o||"\\"==o){u=ia;break}r&&"file"==r.scheme&&!qr(a.slice(h).join(""))&&(Fr(r.path[0],!0)?e.path.push(r.path[0]):e.host=r.host),u=aa;continue;case ia:if(o==or||"/"==o||"\\"==o||"?"==o||"#"==o){if(!i&&Fr(f))u=aa;else if(""==f){if(e.host="",i)return;u=ra}else{if(l=Ar(e,f))return l;if("localhost"==e.host&&(e.host=""),i)return;f="",u=ra}continue}f+=o;break;case ra:if(Rr(e)){if(u=aa,"/"!=o&&"\\"!=o)continue}else if(i||"?"!=o)if(i||"#"!=o){if(o!=or&&(u=aa,"/"!=o))continue}else e.fragment="",u=la;else e.query="",u=sa;break;case aa:if(o==or||"/"==o||"\\"==o&&Rr(e)||!i&&("?"==o||"#"==o)){if(".."===(c=(c=f).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(Dr(e),"/"==o||"\\"==o&&Rr(e)||e.path.push("")):Br(f)?"/"==o||"\\"==o&&Rr(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&Fr(f)&&(e.host&&(e.host=""),f=f.charAt(0)+":"),e.path.push(f)),f="","file"==e.scheme&&(o==or||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",u=sa):"#"==o&&(e.fragment="",u=la)}else f+=jr(o,Mr);break;case oa:"?"==o?(e.query="",u=sa):"#"==o?(e.fragment="",u=la):o!=or&&(e.path[0]+=jr(o,Lr));break;case sa:i||"#"!=o?o!=or&&("'"==o&&Rr(e)?e.query+="%27":e.query+="#"==o?"%23":jr(o,Lr)):(e.fragment="",u=la);break;case la:o!=or&&(e.fragment+=jr(o,Ir))}h++}},ua=function(e){var t,n,i=ki(this,ua,"URL"),a=arguments.length>1?arguments[1]:void 0,o=String(e),s=hr(i,{type:"URL"});if(void 0!==a)if(a instanceof ua)t=fr(a);else if(n=ca(t={},String(a)))throw TypeError(n);if(n=ca(s,o,null,t))throw TypeError(n);var l=s.searchParams=new cr,c=ur(l);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(l)||null},r||(i.href=fa.call(i),i.origin=da.call(i),i.protocol=pa.call(i),i.username=ma.call(i),i.password=ga.call(i),i.host=va.call(i),i.hostname=ya.call(i),i.port=ba.call(i),i.pathname=wa.call(i),i.search=ka.call(i),i.searchParams=Ta.call(i),i.hash=Sa.call(i))},ha=ua.prototype,fa=function(){var e=fr(this),t=e.scheme,n=e.username,i=e.password,r=e.host,a=e.port,o=e.path,s=e.query,l=e.fragment,c=t+":";return null!==r?(c+="//",_r(e)&&(c+=n+(i?":"+i:"")+"@"),c+=xr(r),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},da=function(){var e=fr(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Rr(e)?t+"://"+xr(e.host)+(null!==n?":"+n:""):"null"},pa=function(){return fr(this).scheme+":"},ma=function(){return fr(this).username},ga=function(){return fr(this).password},va=function(){var e=fr(this),t=e.host,n=e.port;
38508return null===t?"":null===n?xr(t):xr(t)+":"+n},ya=function(){var e=fr(this).host;return null===e?"":xr(e)},ba=function(){var e=fr(this).port;return null===e?"":String(e)},wa=function(){var e=fr(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},ka=function(){var e=fr(this).query;return e?"?"+e:""},Ta=function(){return fr(this).searchParams},Sa=function(){var e=fr(this).fragment;return e?"#"+e:""},Ea=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(r&&Ue(ha,{href:Ea(fa,function(e){var t=fr(this),n=String(e),i=ca(t,n);if(i)throw TypeError(i);ur(t.searchParams).updateSearchParams(t.query)}),origin:Ea(da),protocol:Ea(pa,function(e){var t=fr(this);ca(t,String(e)+":",Hr)}),username:Ea(ma,function(e){var t=fr(this),n=Ii(String(e));if(!Ur(t)){t.username="";for(var i=0;i<n.length;i++)t.username+=jr(n[i],Nr)}}),password:Ea(ga,function(e){var t=fr(this),n=Ii(String(e));if(!Ur(t)){t.password="";for(var i=0;i<n.length;i++)t.password+=jr(n[i],Nr)}}),host:Ea(va,function(e){var t=fr(this);t.cannotBeABaseURL||ca(t,String(e),Jr)}),hostname:Ea(ya,function(e){var t=fr(this);t.cannotBeABaseURL||ca(t,String(e),Zr)}),port:Ea(ba,function(e){var t=fr(this);Ur(t)||(""==(e=String(e))?t.port=null:ca(t,e,ea))}),pathname:Ea(wa,function(e){var t=fr(this);t.cannotBeABaseURL||(t.path=[],ca(t,e+"",ra))}),search:Ea(ka,function(e){var t=fr(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",ca(t,e,sa)),ur(t.searchParams).updateSearchParams(t.query)}),searchParams:Ea(Ta),hash:Ea(Sa,function(e){var t=fr(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",ca(t,e,la)):t.fragment=null})}),Q(ha,"toJSON",function(){return fa.call(this)},{enumerable:!0}),Q(ha,"toString",function(){return fa.call(this)},{enumerable:!0}),lr){var Aa=lr.createObjectURL,Pa=lr.revokeObjectURL;Aa&&Q(ua,"createObjectURL",function(e){return Aa.apply(lr,arguments)}),Pa&&Q(ua,"revokeObjectURL",function(e){return Pa.apply(lr,arguments)})}function Ca(e){return(Ca="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function La(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ia(e,t,n){return t&&La(e.prototype,t),n&&La(e,n),e}function Ma(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Na(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ja(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Ie(ua,"URL"),Se({global:!0,forced:!wi,sham:!r},{URL:ua}),function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),n=function(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(n[Symbol.iterator]=function(){return n}),n},i=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},r=function(e){return decodeURIComponent(String(e).replace(/\+/g," "))};"URLSearchParams"in e&&"a=1"===new e.URLSearchParams("?a=1").toString()||function(){var r=function e(t){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var n=Ca(t);if("undefined"===n);else if("string"===n)""!==t&&this._fromString(t);else if(t instanceof e){var i=this;t.forEach(function(e,t){i.append(t,e)})}else{if(null===t||"object"!==n)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(t))for(var r=0;r<t.length;r++){var a=t[r];if("[object Array]"!==Object.prototype.toString.call(a)&&2===a.length)throw new TypeError("Expected [string, any] as entry at index "+r+" of URLSearchParams's input");this.append(a[0],a[1])}else for(var o in t)t.hasOwnProperty(o)&&this.append(o,t[o])}},a=r.prototype;a.append=function(e,t){e in this._entries?this._entries[e].push(String(t)):this._entries[e]=[String(t)]},a.delete=function(e){delete this._entries[e]},a.get=function(e){return e in this._entries?this._entries[e][0]:null},a.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},a.has=function(e){return e in this._entries},a.set=function(e,t){this._entries[e]=[String(t)]},a.forEach=function(e,t){var n;for(var i in this._entries)if(this._entries.hasOwnProperty(i)){n=this._entries[i];for(var r=0;r<n.length;r++)e.call(t,n[r],i,this)}},a.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),n(e)},a.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},a.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),n(e)},t&&(a[Symbol.iterator]=a.entries),a.toString=function(){var e=[];return this.forEach(function(t,n){e.push(i(n)+"="+i(t))}),e.join("&")},e.URLSearchParams=r}();var a=e.URLSearchParams.prototype;"function"!=typeof a.sort&&(a.sort=function(){var e=this,t=[];this.forEach(function(n,i){t.push([i,n]),e._entries||e.delete(i)}),t.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}),e._entries&&(e._entries={});for(var n=0;n<t.length;n++)this.append(t[n][0],t[n][1])}),"function"!=typeof a._fromString&&Object.defineProperty(a,"_fromString",{enumerable:!1,
38508configurable:!1,writable:!1,value:function(e){if(this._entries)this._entries={};else{var t=[];this.forEach(function(e,n){t.push(n)});for(var n=0;n<t.length;n++)this.delete(t[n])}var i,a=(e=e.replace(/^\?/,"")).split("&");for(n=0;n<a.length;n++)i=a[n].split("="),this.append(r(i[0]),i.length>1?r(i[1]):"")}})}(void 0!==C?C:"undefined"!=typeof window?window:"undefined"!=typeof self?self:C),function(e){var t,n,i;if(function(){try{var t=new e.URL("b","http://a");return t.pathname="c%20d","http://a/c%20d"===t.href&&t.searchParams}catch(e){return!1}}()||(t=e.URL,i=(n=function(t,n){"string"!=typeof t&&(t=String(t));var i,r=document;if(n&&(void 0===e.location||n!==e.location.href)){(i=(r=document.implementation.createHTMLDocument("")).createElement("base")).href=n,r.head.appendChild(i);try{if(0!==i.href.indexOf(n))throw new Error(i.href)}catch(e){throw new Error("URL unable to set base "+n+" due to "+e)}}var a=r.createElement("a");if(a.href=t,i&&(r.body.appendChild(a),a.href=a.href),":"===a.protocol||!/:/.test(a.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:a});var o=new e.URLSearchParams(this.search),s=!0,l=!0,c=this;["append","delete","set"].forEach(function(e){var t=o[e];o[e]=function(){t.apply(o,arguments),s&&(l=!1,c.search=o.toString(),l=!0)}}),Object.defineProperty(this,"searchParams",{value:o,enumerable:!0});var u=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==u&&(u=this.search,l&&(s=!1,this.searchParams._fromString(this.search),s=!0))}})}).prototype,["hash","host","hostname","port","protocol"].forEach(function(e){!function(e){Object.defineProperty(i,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)}),Object.defineProperty(i,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(i,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0}}),n.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},n.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=n),void 0!==e.location&&!("origin"in e.location)){var r=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:r,enumerable:!0})}catch(t){setInterval(function(){e.location.origin=r()},100)}}}(void 0!==C?C:"undefined"!=typeof window?window:"undefined"!=typeof self?self:C);var Oa=Ce("isConcatSpreadable"),Ra=!i(function(){var e=[];return e[Oa]=!1,e.concat()[0]!==e}),_a=hn("concat"),Ua=function(e){if(!m(e))return!1;var t=e[Oa];return void 0!==t?!!t:_e(e)};Se({target:"Array",proto:!0,forced:!Ra||!_a},{concat:function(e){var t,n,i,r,a,o=Ft(this),s=ri(o,0),l=0;for(t=-1,i=arguments.length;t<i;t++)if(a=-1===t?o:arguments[t],Ua(a)){if(l+(r=te(a.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<r;n++,l++)n in a&&cn(s,l,a[n])}else{if(l>=9007199254740991)throw TypeError("Maximum allowed index exceeded");cn(s,l++,a)}return s.length=l,s}});var Fa=ai(2),qa=hn("filter");Se({target:"Array",proto:!0,forced:!qa},{filter:function(e){return Fa(this,e,arguments[1])}});var Da=ai(5),Ba=!0;"find"in[]&&Array(1).find(function(){Ba=!1}),Se({target:"Array",proto:!0,forced:Ba},{find:function(e){return Da(this,e,arguments.length>1?arguments[1]:void 0)}}),_t("find");var Ha=Ce("iterator"),Va=!1;try{var za=0;({next:function(){return{done:!!za++}},return:function(){Va=!0}})[Ha]=function(){return this}}catch(e){}var Wa=function(e,t){if(!t&&!Va)return!1;var n=!1;try{var i={};i[Ha]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},Ka=!Wa(function(e){});Se({target:"Array",stat:!0,forced:Ka},{from:Ii});var Ya=ae(!0);Se({target:"Array",proto:!0},{includes:function(e){return Ya(this,e,arguments.length>1?arguments[1]:void 0)}}),_t("includes");var $a=ai(1),Ga=hn("map");Se({target:"Array",proto:!0,forced:!Ga},{map:function(e){return $a(this,e,arguments[1])}});var Qa=function(e,t,n){var i,r=t.constructor;return r!==n&&"function"==typeof r&&(i=r.prototype)!==n.prototype&&m(i)&&Gt&&Gt(e,i),e},Xa="\t\n\v\f\r  áââââââ
ââââââ¯âã\u2028\u2029\ufeff",Ja="["+Xa+"]",Za=RegExp("^"+Ja+Ja+"*"),eo=RegExp(Ja+Ja+"*$"),to=function(e,t){return e=String(d(e)),1&t&&(e=e.replace(Za,"")),2&t&&(e=e.replace(eo,"")),e},no=ue.f,io=T.f,ro=A.f,ao=e.Number,oo=ao.prototype,so="Number"==u(Ve(oo)),lo="trim"in String.prototype,co=function(e){var t,n,i,r,a,o,s,l,c=g(e,!1);if("string"==typeof c&&c.length>
385082)if(43===(t=(c=lo?c.trim():to(c,3)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+c}for(o=(a=c.slice(2)).length,s=0;s<o;s++)if((l=a.charCodeAt(s))<48||l>r)return NaN;return parseInt(a,i)}return+c};if(ke("Number",!ao(" 0o1")||!ao("0b1")||ao("+0x1"))){for(var uo,ho=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof ho&&(so?i(function(){oo.valueOf.call(n)}):"Number"!=u(n))?Qa(new ao(co(t)),n,ho):co(t)},fo=r?no(ao):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),po=0;fo.length>po;po++)n(ao,uo=fo[po])&&!n(ho,uo)&&ro(ho,uo,io(ao,uo));ho.prototype=oo,oo.constructor=ho,Q(e,"Number",ho)}var mo=i(function(){Re(1)});Se({target:"Object",stat:!0,forced:mo},{keys:function(e){return Re(Ft(e))}});var go=function(e,t,n){if($n(t))throw TypeError("String.prototype."+n+" doesn't accept regex");return String(d(e))},vo=Ce("match"),yo=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[vo]=!1,"/./"[e](t)}catch(e){}}return!1},bo=yo("includes");Se({target:"String",proto:!0,forced:!bo},{includes:function(e){return!!~go(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}});var wo=!i(function(){return Object.isExtensible(Object.preventExtensions({}))}),ko=x(function(e){var t=q("meta"),i=A.f,r=0,a=Object.isExtensible||function(){return!0},o=function(e){i(e,t,{value:{objectID:"O"+ ++r,weakData:{}}})},s=e.exports={REQUIRED:!1,fastKey:function(e,i){if(!m(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!n(e,t)){if(!a(e))return"F";if(!i)return"E";o(e)}return e[t].objectID},getWeakData:function(e,i){if(!n(e,t)){if(!a(e))return!0;if(!i)return!1;o(e)}return e[t].weakData},onFreeze:function(e){return wo&&s.REQUIRED&&a(e)&&!n(e,t)&&o(e),e}};H[t]=!0}),To=(ko.REQUIRED,ko.fastKey,ko.getWeakData,ko.onFreeze,x(function(e){var t={};(e.exports=function(e,n,i,r,a){var o,s,l,c,u,h=ni(n,i,r?2:1);if(a)o=e;else{if("function"!=typeof(s=Li(e)))throw TypeError("Target is not iterable");if(Ci(s)){for(l=0,c=te(e.length);c>l;l++)if((r?h(S(u=e[l])[0],u[1]):h(e[l]))===t)return t;return}o=s.call(e)}for(;!(u=o.next()).done;)if(Ei(o,h,u.value,r)===t)return t}).BREAK=t})),So=ko.getWeakData,Eo=G.set,Ao=G.getterFor,Po=ai(5),Co=ai(6),xo=0,Lo=function(e){return e.frozen||(e.frozen=new Io)},Io=function(){this.entries=[]},Mo=function(e,t){return Po(e.entries,function(e){return e[0]===t})};Io.prototype={get:function(e){var t=Mo(this,e);if(t)return t[1]},has:function(e){return!!Mo(this,e)},set:function(e,t){var n=Mo(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=Co(this.entries,function(t){return t[0]===e});return~t&&this.entries.splice(t,1),!!~t}};var No={getConstructor:function(e,t,i,r){var a=e(function(e,n){ki(e,a,t),Eo(e,{type:t,id:xo++,frozen:void 0}),null!=n&&To(n,e[r],e,i)}),o=Ao(t),s=function(e,t,n){var i=o(e),r=So(S(t),!0);return!0===r?Lo(i).set(t,n):r[i.id]=n,e};return qi(a.prototype,{delete:function(e){var t=o(this);if(!m(e))return!1;var i=So(e);return!0===i?Lo(t).delete(e):i&&n(i,t.id)&&delete i[t.id]},has:function(e){var t=o(this);if(!m(e))return!1;var i=So(e);return!0===i?Lo(t).has(e):i&&n(i,t.id)}}),qi(a.prototype,i?{get:function(e){var t=o(this);if(m(e)){var n=So(e);return!0===n?Lo(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),a}};x(function(t){var n,r=G.enforce,a=!e.ActiveXObject&&"ActiveXObject"in e,o=Object.isExtensible,s=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},l=t.exports=function(t,n,r,a,o){var s=e[t],l=s&&s.prototype,c=s,u=a?"set":"add",h={},f=function(e){var t=l[e];Q(l,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(o&&!m(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return o&&!m(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(o&&!m(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(ke(t,"function"!=typeof s||!(o||l.forEach&&!i(function(){(new s).entr
38508ies().next()}))))c=r.getConstructor(n,t,a,u),ko.REQUIRED=!0;else if(ke(t,!0)){var d=new c,p=d[u](o?{}:-0,1)!=d,g=i(function(){d.has(1)}),v=Wa(function(e){new s(e)}),y=!o&&i(function(){for(var e=new s,t=5;t--;)e[u](t,t);return!e.has(-0)});v||((c=n(function(e,n){ki(e,c,t);var i=Qa(new s,e,c);return null!=n&&To(n,i[u],i,a),i})).prototype=l,l.constructor=c),(g||y)&&(f("delete"),f("has"),a&&f("get")),(y||p)&&f(u),o&&l.clear&&delete l.clear}return h[t]=c,Se({global:!0,forced:c!=s},h),Ie(c,t),o||r.setStrong(c,t,a),c}("WeakMap",s,No,!0,!0);if(_&&a){n=No.getConstructor(s,"WeakMap",!0),ko.REQUIRED=!0;var c=l.prototype,u=c.delete,h=c.has,f=c.get,d=c.set;qi(c,{delete:function(e){if(m(e)&&!o(e)){var t=r(this);return t.frozen||(t.frozen=new n),u.call(this,e)||t.frozen.delete(e)}return u.call(this,e)},has:function(e){if(m(e)&&!o(e)){var t=r(this);return t.frozen||(t.frozen=new n),h.call(this,e)||t.frozen.has(e)}return h.call(this,e)},get:function(e){if(m(e)&&!o(e)){var t=r(this);return t.frozen||(t.frozen=new n),h.call(this,e)?f.call(this,e):t.frozen.get(e)}return f.call(this,e)},set:function(e,t){if(m(e)&&!o(e)){var i=r(this);i.frozen||(i.frozen=new n),h.call(this,e)?d.call(this,e,t):i.frozen.set(e,t)}else d.call(this,e,t);return this}})}});Se({target:"Object",stat:!0,forced:Object.assign!==Si},{assign:Si});var jo=function(e){return i(function(){return!!Xa[e]()||"âÂ
á "!="âÂ
á "[e]()||Xa[e].name!==e})}("trim");Se({target:"String",proto:!0,forced:jo},{trim:function(){return to(this,3)}});var Oo="".repeat||function(e){var t=String(d(this)),n="",i=Z(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},Ro=1..toFixed,_o=Math.floor,Uo=[0,0,0,0,0,0],Fo=function(e,t){for(var n=-1,i=t;++n<6;)i+=e*Uo[n],Uo[n]=i%1e7,i=_o(i/1e7)},qo=function(e){for(var t=6,n=0;--t>=0;)n+=Uo[t],Uo[t]=_o(n/e),n=n%e*1e7},Do=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==Uo[e]){var n=String(Uo[e]);t=""===t?n:t+Oo.call("0",7-n.length)+n}return t},Bo=function(e,t,n){return 0===t?n:t%2==1?Bo(e,t-1,n*e):Bo(e*e,t/2,n)};Se({target:"Number",proto:!0,forced:Ro&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!i(function(){Ro.call({})})},{toFixed:function(e){var t,n,i,r,a=function(e){if("number"!=typeof e&&"Number"!=u(e))throw TypeError("Incorrect invocation");return+e}(this),o=Z(e),s="",l="0";if(o<0||o>20)throw RangeError("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return String(a);if(a<0&&(s="-",a=-a),a>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(a*Bo(2,69,1))-69)<0?a*Bo(2,-t,1):a/Bo(2,t,1),n*=4503599627370496,(t=52-t)>0){for(Fo(0,n),i=o;i>=7;)Fo(1e7,0),i-=7;for(Fo(Bo(10,i,1),0),i=t-1;i>=23;)qo(1<<23),i-=23;qo(1<<i),Fo(1,1),qo(2),l=Do()}else Fo(0,n),Fo(1<<-t,0),l=Do()+Oo.call("0",o);return l=o>0?s+((r=l.length)<=o?"0."+Oo.call("0",o-r)+l:l.slice(0,r-o)+"."+l.slice(r-o)):s+l}});var Ho=s.f,Vo=function(e,t){for(var n,i=p(e),r=Re(i),a=r.length,o=0,s=[];a>o;)Ho.call(i,n=r[o++])&&s.push(t?[n,i[n]]:i[n]);return s};Se({target:"Object",stat:!0},{entries:function(e){return Vo(e,!0)}}),Se({target:"Object",stat:!0},{values:function(e){return Vo(e)}});var zo={addCSS:!0,thumbWidth:15,watch:!0};Se({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Wo=function(e){return null!=e?e.constructor:null},Ko=function(e,t){return Boolean(e&&t&&e instanceof t)},Yo=function(e){return null==e},$o=function(e){return Wo(e)===Object},Go=function(e){return Wo(e)===String},Qo=function(e){return Array.isArray(e)},Xo=function(e){return Ko(e,NodeList)},Jo={nullOrUndefined:Yo,object:$o,number:function(e){return Wo(e)===Number&&!Number.isNaN(e)},string:Go,boolean:function(e){return Wo(e)===Boolean},function:function(e){return Wo(e)===Function},array:Qo,nodeList:Xo,element:function(e){return Ko(e,Element)},event:function(e){return Ko(e,Event)},empty:function(e){return Yo(e)||(Go(e)||Qo(e)||Xo(e))&&!e.length||$o(e)&&!Object.keys(e).length}};function Zo(e,t){if(t<1){var n=(i="".concat(t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/))?Math.max(0,(i[1]?i[1].length:0)-(i[2]?+i[2]:0)):0;return parseFloat(e.toFixed(n))}var i;return Math.round(e/t)*t}Dn("match",1,function(e,t,n){return[function(t){var n=d(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,e,this);if(i.done)return i.value;var r=S(e),a=String(this);if(!r.global)return _n(r,a);var o=r.unicode;r.lastIndex=0;for(var s,l=[],c=0;null!==(s=_n(r,a));){var u=String(s[0]);l[c]=u,""===u&&(r.lastIndex=Ln(a,te(r.lastIndex),o)),c++}return 0===c?null:l}]});var es,ts,ns,is=function(){function e(t,n){xa(this,e),Jo.element
38508(t)?this.element=t:Jo.string(t)&&(this.element=document.querySelector(t)),Jo.element(this.element)&&Jo.empty(this.element.rangeTouch)&&(this.config=Object.assign({},zo,n),this.init())}return Ia(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,n=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(e){t.element[n](e,function(e){return t.set(e)},!1)})}},{key:"get",value:function(t){if(!e.enabled||!Jo.event(t))return null;var n,i=t.target,r=t.changedTouches[0],a=parseFloat(i.getAttribute("min"))||0,o=parseFloat(i.getAttribute("max"))||100,s=parseFloat(i.getAttribute("step"))||1,l=o-a,c=i.getBoundingClientRect(),u=100/c.width*(this.config.thumbWidth/2)/100;return(n=100/c.width*(r.clientX-c.left))<0?n=0:n>100&&(n=100),n<50?n-=(100-2*n)*u:n>50&&(n+=2*(n-50)*u),a+Zo(l*(n/100),s)}},{key:"set",value:function(t){e.enabled&&Jo.event(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var n=new Event(t);e.dispatchEvent(n)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;if(Jo.empty(t)||Jo.string(t)?i=Array.from(document.querySelectorAll(Jo.string(t)?t:'input[type="range"]')):Jo.element(t)?i=[t]:Jo.nodeList(t)?i=Array.from(t):Jo.array(t)&&(i=t.filter(Jo.element)),Jo.empty(i))return null;var r=Object.assign({},zo,n);Jo.string(t)&&r.watch&&new MutationObserver(function(n){Array.from(n).forEach(function(n){Array.from(n.addedNodes).forEach(function(n){if(Jo.element(n)&&function(){return Array.from(document.querySelectorAll(i)).includes(this)}.call(n,i=t)){var i;new e(n,r)}})})}).observe(document.body,{childList:!0,subtree:!0});return i.map(function(t){return new e(t,n)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}(),rs=e.setImmediate,as=e.clearImmediate,os=e.process,ss=e.MessageChannel,ls=e.Dispatch,cs=0,us={},hs=function(){var e=+this;if(us.hasOwnProperty(e)){var t=us[e];delete us[e],t()}},fs=function(e){hs.call(e.data)};rs&&as||(rs=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return us[++cs]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},es(cs),cs},as=function(e){delete us[e]},"process"==u(os)?es=function(e){os.nextTick(ni(hs,e,1))}:ls&&ls.now?es=function(e){ls.now(ni(hs,e,1))}:ss?(ns=(ts=new ss).port2,ts.port1.onmessage=fs,es=ni(ns.postMessage,ns,1)):e.addEventListener&&"function"==typeof postMessage&&!e.importScripts?(es=function(t){e.postMessage(t+"","*")},e.addEventListener("message",fs,!1)):es="onreadystatechange"in b("script")?function(e){qe.appendChild(b("script")).onreadystatechange=function(){qe.removeChild(this),hs.call(e)}}:function(e){setTimeout(ni(hs,e,1),0)});var ds,ps,ms,gs,vs,ys,bs,ws={set:rs,clear:as},ks=e.navigator,Ts=ks&&ks.userAgent||"",Ss=T.f,Es=ws.set,As=e.MutationObserver||e.WebKitMutationObserver,Ps=e.process,Cs=e.Promise,xs="process"==u(Ps),Ls=Ss(e,"queueMicrotask"),Is=Ls&&Ls.value;Is||(ds=function(){var e,t;for(xs&&(e=Ps.domain)&&e.exit();ps;){t=ps.fn,ps=ps.next;try{t()}catch(e){throw ps?gs():ms=void 0,e}}ms=void 0,e&&e.enter()},xs?gs=function(){Ps.nextTick(ds)}:As&&!/(iPhone|iPod|iPad).*AppleWebKit/i.test(Ts)?(vs=!0,ys=document.createTextNode(""),new As(ds).observe(ys,{characterData:!0}),gs=function(){ys.data=vs=!vs}):Cs&&Cs.resolve?(bs=Cs.resolve(void 0),gs=function(){bs.then(ds)}):gs=function(){Es.call(e,ds)});var Ms,Ns,js,Os=Is||function(e){var t={fn:e,next:void 0};ms&&(ms.next=t),ps||(ps=t,gs()),ms=t},Rs=function(e){var t,n;this.promise=new e(function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i}),this.resolve=Gn(t),this.reject=Gn(n)},_s={f:function(e){return new Rs(e)}},Us=function(e,t){if(S(e),m(t)&&t.constructor===e)return t;var n=_s.f(e);return(0,n.resolve)(t),n.promise},Fs=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},qs=function(e){return"function"==typeof e?e:void 0},Ds=Ce("species"),Bs=function(t){var n=function(t,n){return arguments.length<2?qs(Ne[t])||qs(e[t]):Ne[t]&&Ne[t][n]||e[t]&&e[t][n]}(t),i=A.f;r&&n&&!n[Ds]&&i(n,Ds,{configurable:!0,get:function(){return this}})},Hs="Promise",Vs=ws.set,zs=Ce("species"),Ws=G.get,Ks=G.set,Ys=G.getterFor(Hs),$s=e.Promise,Gs=e.TypeError,Qs=e.document,Xs=e.process,Js=e.fetch,Zs=Xs&&Xs.versions,el=Zs&&Zs.v8||"",tl=_s.f,nl=tl,il="process"==u(Xs),rl=!!(Qs&&Qs.createEvent&&e.dispatchEvent),al=ke(Hs,function(){var e=$s.resolve(1),t=function(){},n=(e.constructor={})[zs]=function(e){e(t,t)};return!((il||"function"==typeof PromiseRejectionEvent)&&e.then(t)instanceof n&&0!==el.indexOf("6.6")&&-1===Ts.indexOf("Chrome/66"))}),ol=al||!Wa(function(e){$s.all(e).catch(function(){})}),sl=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},ll=function(e,t,n){if(!t.notified){t.notified=!0;var i=t.reactions;Os(function(){for(var r=t.value,a=1==t.state,o=0,s=function(n){var i,o,s,l=a?n.ok:n.fail,c=n.resolve,u=n.reject,h=n.domain;try{l?(a||(2===t.rejection&&fl(e,t),t.rejection=1),!0===l?i=r:(h&&h.enter(),i=l(r),h&&(h.exit(),s=!0)),i===n.promise?u(Gs("Promise-chain cycle")):(o=sl(i))?o.call(i,c,u):c(i)):u(r)}catch(e){h&&!s&&h.exit(),u(e)}};i.length>o;)s(i[o++]);t.reactions=[],t.notified=!1,n&&!t.rejection&&ul(e,t)})}},cl=function(t,n,i){var r,a;rl?((r=Qs.createEvent("Event")).promise=n,r.reason=i,r.initEvent(t,!1,!0),e.dispatchEvent(r)):r={promise:n,reason:i},(a=e["on"+t])?a(r):"unhandledrejection"===t&&function(t,n){var i=e.console;i&&i.error&&(1===arguments.length?i.error(t):i.error(t,n))}("Unhandled promise rejection",i)},ul=function(t,n){Vs.call(e,function(){var e,i=n.value;if(hl(n)&&(e=Fs(function(){il?Xs.emit("unhandledRejection",i,t):cl("unhandledrejection",t,i)}),n.rejection=il||hl(n)?2:1,e.error))throw e.value})},hl=function(e){return 1!==e.rejection&&!e.parent},fl=function(t,n){Vs.call(e,function(){il?Xs.emit("rejectionHandled",t):cl("rejectionhandled",t,n.value)})},dl=function(e,t,n,i){return function(r){e(t,n,r,i)}},pl=function(e,t,n,i){t.done||(t.done=!0,i&&(t=i),t.value=n,t.state=2,ll(e,t,!0))},ml=function(e,t,n,i){if(!t.done){t.done=!0,i&&(t=i);
38508try{if(e===n)throw Gs("Promise can't be resolved itself");var r=sl(n);r?Os(function(){var i={done:!1};try{r.call(n,dl(ml,e,i,t),dl(pl,e,i,t))}catch(n){pl(e,i,n,t)}}):(t.value=n,t.state=1,ll(e,t,!1))}catch(n){pl(e,{done:!1},n,t)}}};al&&($s=function(e){ki(this,$s,Hs),Gn(e),Ms.call(this);var t=Ws(this);try{e(dl(ml,this,t),dl(pl,this,t))}catch(e){pl(this,t,e)}},(Ms=function(e){Ks(this,{type:Hs,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=qi($s.prototype,{then:function(e,t){var n=Ys(this),i=tl(Xn(this,$s));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=il?Xs.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&ll(this,n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),Ns=function(){var e=new Ms,t=Ws(e);this.promise=e,this.resolve=dl(ml,e,t),this.reject=dl(pl,e,t)},_s.f=tl=function(e){return e===$s||e===js?new Ns(e):nl(e)},"function"==typeof Js&&Se({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Us($s,Js.apply(e,arguments))}})),Se({global:!0,wrap:!0,forced:al},{Promise:$s}),Ie($s,Hs,!1),Bs(Hs),js=Ne.Promise,Se({target:Hs,stat:!0,forced:al},{reject:function(e){var t=tl(this);return t.reject.call(void 0,e),t.promise}}),Se({target:Hs,stat:!0,forced:al},{resolve:function(e){return Us(this,e)}}),Se({target:Hs,stat:!0,forced:ol},{all:function(e){var t=this,n=tl(t),i=n.resolve,r=n.reject,a=Fs(function(){var n=[],a=0,o=1;To(e,function(e){var s=a++,l=!1;n.push(void 0),o++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--o||i(n))},r)}),--o||i(n)});return a.error&&r(a.value),n.promise},race:function(e){var t=this,n=tl(t),i=n.reject,r=Fs(function(){To(e,function(e){t.resolve(e).then(n.resolve,i)})});return r.error&&i(r.value),n.promise}});var gl=yo("startsWith"),vl="".startsWith;Se({target:"String",proto:!0,forced:!gl},{startsWith:function(e){var t=go(this,e,"startsWith"),n=te(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),i=String(e);return vl?vl.call(t,i,n):t.slice(n,n+i.length)===i}});var yl=function(e){return null!=e?e.constructor:null},bl=function(e,t){return Boolean(e&&t&&e instanceof t)},wl=function(e){return null==e},kl=function(e){return yl(e)===Object},Tl=function(e){return yl(e)===String},Sl=function(e){return Array.isArray(e)},El=function(e){return bl(e,NodeList)},Al=function(e){return wl(e)||(Tl(e)||Sl(e)||El(e))&&!e.length||kl(e)&&!Object.keys(e).length},Pl={nullOrUndefined:wl,object:kl,number:function(e){return yl(e)===Number&&!Number.isNaN(e)},string:Tl,boolean:function(e){return yl(e)===Boolean},function:function(e){return yl(e)===Function},array:Sl,weakMap:function(e){return bl(e,WeakMap)},nodeList:El,element:function(e){return bl(e,Element)},textNode:function(e){return yl(e)===Text},event:function(e){return bl(e,Event)},keyboardEvent:function(e){return bl(e,KeyboardEvent)},cue:function(e){return bl(e,window.TextTrackCue)||bl(e,window.VTTCue)},track:function(e){return bl(e,TextTrack)||!wl(e)&&Tl(e.kind)},promise:function(e){return bl(e,Promise)},url:function(e){if(bl(e,window.URL))return!0;if(!Tl(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));
38508try{return!Al(new URL(t).hostname)}catch(e){return!1}},empty:Al},Cl=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function xl(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!Pl.empty(t)&&Pl.function(n)){var s=t.split(" "),l=o;Cl&&(l={passive:a,capture:o}),s.forEach(function(t){i&&i.eventListeners&&r&&i.eventListeners.push({element:e,type:t,callback:n,options:l}),e[r?"addEventListener":"removeEventListener"](t,n,l)})}}function Ll(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];xl.call(this,e,t,n,!0,i,r)}function Il(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];xl.call(this,e,t,n,!1,i,r)}function Ml(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];xl.call(this,e,n,function o(){Il(e,n,o,r,a);for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];i.apply(t,l)},!0,r,a)}function Nl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Pl.element(e)&&!Pl.empty(t)){var r=new CustomEvent(t,{bubbles:n,detail:Object.assign({},i,{plyr:this})});e.dispatchEvent(r)}}function jl(e,t){var n=e.length?e:[e];Array.from(n).reverse().forEach(function(e,n){var i=n>0?t.cloneNode(!0):t,r=e.parentNode,a=e.nextSibling;i.appendChild(e),a?r.insertBefore(i,a):r.appendChild(i)})}function Ol(e,t){Pl.element(e)&&!Pl.empty(t)&&Object.entries(t).filter(function(e){var t=Na(e,2)[1];return!Pl.nullOrUndefined(t)}).forEach(function(t){var n=Na(t,2),i=n[0],r=n[1];return e.setAttribute(i,r)})}function Rl(e,t,n){var i=document.createElement(e);return Pl.object(t)&&Ol(i,t),Pl.string(n)&&(i.innerText=n),i}
38508function _l(e,t,n,i){Pl.element(t)&&t.appendChild(Rl(e,n,i))}function Ul(e){Pl.nodeList(e)||Pl.array(e)?Array.from(e).forEach(Ul):Pl.element(e)&&Pl.element(e.parentNode)&&e.parentNode.removeChild(e)}function Fl(e){if(Pl.element(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function ql(e,t){return Pl.element(t)&&Pl.element(t.parentNode)&&Pl.element(e)?(t.parentNode.replaceChild(e,t),e):null}function Dl(e,t){if(!Pl.string(e)||Pl.empty(e))return{};var n={},i=t;return e.split(",").forEach(function(e){var t=e.trim(),r=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),o=a[0],s=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":Pl.object(i)&&Pl.string(i.class)&&(i.class+=" ".concat(r)),n.class=r;break;case"#":n.id=t.replace("#","");break;case"[":n[o]=s}}),n}function Bl(e,t){if(Pl.element(e)){var n=t;Pl.boolean(n)||(n=!e.hidden),n?e.setAttribute("hidden",""):e.removeAttribute("hidden")}}function Hl(e,t,n){if(Pl.nodeList(e))return Array.from(e).map(function(e){return Hl(e,t,n)});if(Pl.element(e)){var i="toggle";return void 0!==n&&(i=n?"add":"remove"),e.classList[i](t),e.classList.contains(t)}return!1}function Vl(e,t){return Pl.element(e)&&e.classList.contains(t)}function zl(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}function Wl(e){return this.elements.container.querySelectorAll(e)}function Kl(e){return this.elements.container.querySelector(e)}function Yl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Pl.element(e)&&(e.focus({preventScroll:!0}),t&&Hl(e,this.config.classNames.tabFocus))}var $l,Gl,Ql,Xl=($l=document.createElement("span"),Gl={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},Ql=Object.keys(Gl).find(function(e){return void 0!==$l.style[e]}),!!Pl.string(Ql)&&Gl[Ql]);function Jl(e){setTimeout(function(){try{Bl(e,!0),e.offsetHeight,Bl(e,!1)}catch(e){}},0)}var Zl,ec={isIE:!!document.documentMode,isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)},tc={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},nc={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,n){var i=ec.isIPhone&&n&&nc.playsinline,r=nc[e]||"html5"!==t;return{api:r,ui:r&&nc.rangeInput&&("video"!==e||!ec.isIPhone||i)}},pip:!(ec.isIPhone||!Pl.function(Rl("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||Rl("video").disablePictureInPicture)),airplay:Pl.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(Pl.empty(e))return!1;var t=Na(e.split("/"),1)[0],n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(tc).includes(n)&&(n+='; codecs="'.concat(tc[e],'"'));try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(Zl=document.createElement("input"),Zl.type="range","range"===Zl.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==Xl,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches};function ic(e){return!!(Pl.array(e)||Pl.string(e)&&e.includes(":"))&&(Pl.array(e)?e:e.split(":")).map(Number).every(Pl.number)}function rc(e){var t=function(e){return ic(e)?e.split(":").map(Number):null},n=t(e);return null===n&&(n=t(this.config.ratio)),null===n&&!Pl.empty(this.embed)&&Pl.string(this.embed.ratio)&&(n=t(this.embed.ratio)),n}function ac(e){if(!this.isVideo)return{};var t=rc.call(this,e),n=Na(Pl.array(t)?t:[0,0],2),i=100/n[0]*n[1];if(this.elements.wrapper.style.paddingBottom="".concat(i,"%"),this.isVimeo&&this.supported.ui){var r=(240-i)/4.8;this.media.style.transform="translateY(-".concat(r,"%)")}else this.isHTML5&&this.elements.wrapper.classList.toggle(this.config.classNames.videoFixedRatio,null!==t);return{padding:i,ratio:t}}var oc={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(function(t){var n=t.getAttribute("type");return!!Pl.empty(n)||nc.mime.call(e,n)}):[]},getQualityOptions:function(){return oc.getSources.call(this).map(function(e){return Number(e.getAttribute("size"))}
38508).filter(Boolean)},extend:function(){if(this.isHTML5){var e=this;ac.call(e),Object.defineProperty(e.media,"quality",{get:function(){var t=oc.getSources.call(e).find(function(t){return t.getAttribute("src")===e.source});return t&&Number(t.getAttribute("size"))},set:function(t){var n=oc.getSources.call(e).find(function(e){return Number(e.getAttribute("size"))===t});if(n){var i=e.media,r=i.currentTime,a=i.paused,o=i.preload,s=i.readyState;e.media.src=n.getAttribute("src"),("none"!==o||s)&&(e.once("loadedmetadata",function(){e.currentTime=r,a||e.play()}),e.media.load()),Nl.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(Ul(oc.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function sc(e){return Pl.array(e)?e.filter(function(t,n){return e.indexOf(t)===n}):e}function lc(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)}function cc(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(!n.length)return e;var r=n.shift();return Pl.object(r)?(Object.keys(r).forEach(function(t){Pl.object(r[t])?(Object.keys(e).includes(t)||Object.assign(e,Ma({},t,{})),cc(e[t],r[t])):Object.assign(e,Ma({},t,r[t]))}),cc.apply(void 0,[e].concat(n))):e}var uc=Ce("match"),hc=A.f,fc=ue.f,dc=e.RegExp,pc=dc.prototype,mc=/a/g,gc=/a/g,vc=new dc(mc)!==mc;if(ke("RegExp",r&&(!vc||i(function(){return gc[uc]=!1,dc(mc)!=mc||dc(gc)==gc||"/a/i"!=dc(mc,"i")})))){for(var yc=function(e,t){var n=this instanceof yc,i=$n(e),r=void 0===t;return!n&&i&&e.constructor===yc&&r?e:Qa(vc?new dc(i&&!r?e.source:e,t):dc((i=e instanceof yc)?e.source:e,i&&r?Tn.call(e):t),n?this:pc,yc)},bc=function(e){e in yc||hc(yc,e,{configurable:!0,get:function(){return dc[e]},set:function(t){dc[e]=t}})},wc=fc(dc),kc=0;kc<wc.length;)bc(wc[kc++]);pc.constructor=yc,yc.prototype=pc,Q(e,"RegExp",yc)}function Tc(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Pl.empty(e)?e:e.toString().replace(/{(\d+)}/g,function(e,t){return n[t].toString()})}function Sc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1"),"g"),n.toString())}function Ec(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}function Ac(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(e=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e=Sc(e,"-"," "),e=Sc(e,"_"," "),Sc(e=Ec(e)," ","")}(e)).charAt(0).toLowerCase()+e.slice(1)}function Pc(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}Bs("RegExp");var Cc={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},xc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Pl.empty(e)||Pl.empty(t))return"";var n=lc(t.i18n,e);if(Pl.empty(n))return Object.keys(Cc).includes(e)?Cc[e]:"";var i={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(i).forEach(function(e){var t=Na(e,2),i=t[0],r=t[1];n=Sc(n,i,r)}),n},Lc=function(){function e(t){xa(this,e),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return Ia(e,[{key:"get",value:function(t){if(!e.supported||!this.enabled)return null;var n=window.localStorage.getItem(this.key);if(Pl.empty(n))return null;var i=JSON.parse(n);return Pl.string(t)&&t.length?i[t]:i}},{key:"set",value:function(t){if(e.supported&&this.enabled&&Pl.object(t)){var n=this.get();Pl.empty(n)&&(n={}),cc(n,t),window.localStorage.setItem(this.key,JSON.stringify(n))}}}],[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;return window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0}catch(e){return!1}}}]),e}();function Ic(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise(function(n,i){try{var r=new XMLHttpRequest;if(!("withCredentials"in r))return;r.addEventListener("load",function(){if("text"===t)try{n(JSON.parse(r.responseText))}catch(e){n(r.responseText)}else n(r.response)}),r.addEventListener("error",function(){throw new Error(r.status)}),r.open("GET",e,!0),r.responseType=t,r.send()}catch(e){i(e)}})}function Mc(e,t){if(Pl.string(e)){var n=Pl.string(t),i=function(){return null!==document.getElementById(t)},r=function(e,t){e.innerHTML=t,n&&i()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!i()){var a=Lc.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),n&&o.setAttribute("id",t),a){var s=window.localStorage.getItem("".concat("cache","-").concat(t));if(null!==s){var l=JSON.parse(s);r(o,l.content)}}Ic(e).then(function(e){Pl.empty(e)||(a&&window.localStorage.setItem("".concat("cache","-").concat(t),JSON.stringify({content:e})),r(o,e))}).catch(function(){})}}}var Nc=Math.ceil,jc=Math.floor;Se({target:"Math",stat:!0},{trunc:function(e){return(e>0?jc:Nc)(e)}});var Oc=function(e){return Math.trunc(e/60/60%60,10)},Rc=function(e){return Math.trunc(e/60%60,10)},_c=function(e){return Math.trunc(e%60,10)};function Uc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Pl.number(e))return Uc(null,t,n);var i=function(e){return"0".concat(e).slice(-2)},r=Oc(e),a=Rc(e),o=_c(e);return r=t||r>0?"".concat(r,":"):"","".concat(n&&e>0?"-":"").concat(r).concat(i(a),":").concat(i(o))}var Fc={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||ec.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=Kl.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:Wl.call(this,this.config.selectors.buttons.play),pause:Kl.call(this,this.config.selectors.buttons.pause),restart:Kl.call(this,this.config.selectors.buttons.restart),rewind:Kl.call(this,this.config.selectors.buttons.rewind),fastForward:Kl.call(this,this.config.selectors.buttons.fastForward),mute:Kl.call(this,this.config.selectors.buttons.mute),pip:Kl.call(this,this.config.selectors.buttons.pip),airplay:Kl.call(this,this.config.selectors.buttons.airplay),settings:Kl.call(this,this.config.selectors.buttons.settings),captions:Kl.call(this,this.config.selectors.buttons.captions),fullscreen:Kl.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Kl.call(this,this.config.selectors.progress),this.elements.inputs={seek:Kl.call(this,this.config.selectors.inputs.seek),volume:Kl.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Kl.call(this,this.config.selectors.display.buffer),currentTime:Kl.call(this,this.config.selectors.display.currentTime),duration:Kl.call(this,this.config.selectors.display.duration)},Pl.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var n=Fc.getIconUrl.call(this),i="".concat(n.cors?"":n.url,"#").concat(this.config.iconPrefix),r=document.createElementNS("http://www.w3.org/2000/svg","svg");Ol(r,cc(t,{role:"presentation",focusable:"false"}));var a=document.createElementNS("http://www.w3.org/2000/svg","use"),o="".concat(i,"-").concat(e);return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),r.appendChild(a),r},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=xc(e,this.config);return Rl("span",Object.assign({}
vendor: 4,279 bytes, line 38508
38508,t,{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),n)},createBadge:function(e){if(Pl.empty(e))return null;var t=Rl("span",{class:this.config.classNames.menu.value});return t.appendChild(Rl("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n=Object.assign({},t),i=Ac(e),r={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(function(e){Object.keys(n).includes(e)&&(r[e]=n[e],delete n[e])}),"button"!==r.element||Object.keys(n).includes("type")||(n.type="button"),Object.keys(n).includes("class")?n.class.includes(this.config.classNames.control)||(n.class+=" ".concat(this.config.classNames.control)):n.class=this.config.classNames.control,e){case"play":r.toggle=!0,r.label="play",r.labelPressed="pause",r.icon="play",r.iconPressed="pause";break;case"mute":r.toggle=!0,r.label="mute",r.labelPressed="unmute",r.icon="volume",r.iconPressed="muted";break;case"captions":r.toggle=!0,r.label="enableCaptions",r.labelPressed="disableCaptions",r.icon="captions-off",r.iconPressed="captions-on";break;case"fullscreen":r.toggle=!0,r.label="enterFullscreen",r.labelPressed="exitFullscreen",r.icon="enter-fullscreen",r.iconPressed="exit-fullscreen";break;case"play-large":n.class+=" ".concat(this.config.classNames.control,"--overlaid"),i="play",r.label="play",r.icon="play";break;default:Pl.empty(r.label)&&(r.label=i),Pl.empty(r.icon)&&(r.icon=e)}var a=Rl(r.element);return r.toggle?(a.appendChild(Fc.createIcon.call(this,r.iconPressed,{class:"icon--pressed"})),a.appendChild(Fc.createIcon.call(this,r.icon,{class:"icon--not-pressed"})),a.appendChild(Fc.createLabel.call(this,r.labelPressed,{class:"label--pressed"})),a.appendChild(Fc.createLabel.call(this,r.label,{class:"label--not-pressed"}))):(a.appendChild(Fc.createIcon.call(this,r.icon)),a.appendChild(Fc.createLabel.call(this,r.label))),cc(n,Dl(this.config.selectors.buttons[i],n)),Ol(a,n),"play"===i?(Pl.array(this.elements.buttons[i])||(this.elements.buttons[i]=[]),this.elements.buttons[i].push(a)):this.elements.buttons[i]=a,a},createRange:function(e,t){var n=Rl("input",cc(Dl(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":xc(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,Fc.updateRangeFill.call(this,n),is.setup(n),n},createProgress:function(e,t){var n=Rl("progress",cc(Dl(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){n.appendChild(Rl("span",null,"0"));var i={played:"played",buffer:"buffered"}[e],r=i?xc(i,this.config):"";n.innerText="% ".concat(r.toLowerCase())}return this.elements.display[e]=n,n},createTime:function(e){var t=Dl(this.config.selectors.display[e]),n=Rl("div",cc(t,{class:"".concat(this.config.classNames.display.time," ").concat(t.class?t.class:"").trim(),"aria-label":xc(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts:function(e,t){var n=this;Ll(e,"keydown keyup",function(i){if([32,38,39,40].includes(i.which)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var r,a=zl(e,'[role="menuitemradio"]');if(!a&&[32,39].includes(i.which))Fc.showMenuPanel.call(n,t,!0);else 32!==i.which&&(40===i.which||a&&39===i.which?(r=e.nextElementSibling,Pl.element(r)||(r=e.parentNode.firstElementChild)):(r=e.previousElementSibling,Pl.element(r)||(r=e.parentNode.lastElementChild)),Yl.call(n,r,!0))}},!1),Ll(e,"keyup",function(e){13===e.which&&Fc.focusFirstMenuItem.call(n,null,!0)})},createMenuItem:function(e){var t=this,n=e.value,i=e.list,r=e.type,a=e.title,o=e.badge,s=void 0===o?null:o,l=e.checked,c=void 0!==l&&l,u=Dl(this.config.selectors.inputs[r]),h=Rl("button",cc(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":c,value:n})),f=Rl("span");f.innerHTML=a,Pl.element(s)&&f.appendChild(s),h.appendChild(f),Object.defineProperty(h,"checked",{enumerable:!0,get:function(){return"true"===h.getAttribute("aria-checked")},set:function(e){e&&Array.from(h.parentNode.children).filter(function(e){return zl(e,'[role="menuitemradio"]')}
38508).forEach(function(e){return e.setAttribute("aria-checked","false")}),h.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(h,"click keyup",function(e){if(!Pl.keyboardEvent(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),h.checked=!0,r){case"language":t.currentTrack=Number(n);break;case"quality":t.quality=n;break;case"speed":t.speed=parseFloat(n)}Fc.showMenuPanel.call(t,"home",Pl.keyboardEvent(e))}},r,!1),Fc.bindMenuItemShortcuts.call(this,h,r),i.appendChild(h)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Pl.number(e)?Uc(e,Oc(this.duration)>0,t):e},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Pl.element(e)&&Pl.number(t)&&(e.innerText=Fc.formatTime(t,n))},updateVolume:function(){this.supported.ui&&(Pl.element(this.elements.inputs.volume)&&Fc.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),Pl.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Pl.element(e)&&(e.value=t,Fc.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&Pl.event(e)){var n,i,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=this.currentTime,i=this.duration,r=0===n||0===i||Number.isNaN(n)||Number.isNaN(i)?0:(n/i*100).toFixed(2),"timeupdate"===e.type&&Fc.setRange.call(this,this.elements.inputs.seek,r);break;case"playing":case"progress":!function(e,n){var i=Pl.number(n)?n:0,r=Pl.element(e)?e:t.elements.display.buffer;if(Pl.element(r)){r.value=i;var a=r.getElementsByTagName("span")[0];Pl.element(a)&&(a.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=Pl.event(e)?e.target:e;if(Pl.element(t)&&"range"===t.getAttribute("type")){if(zl(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var n=Fc.formatTime(this.currentTime),i=Fc.formatTime(this.duration),r=xc("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",n).replace("{duration}",i))}else if(zl(t,this.config.selectors.inputs.volume)){var a=100*t.value;t.setAttribute("aria-valuenow",a),t.setAttribute("aria-valuetext","".concat(a.toFixed(1),"%"))}else t.setAttribute("aria-valuenow",t.value);ec.isWebkit&&t.style.setProperty("--value","".concat(t.value/t.max*100,"%"))}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&Pl.element(this.elements.inputs.seek)&&Pl.element(this.elements.display.seekTooltip)&&0!==this.duration){var n=0,i=this.elements.progress.getBoundingClientRect(),r="".concat(this.config.classNames.tooltip,"--visible"),a=function(e){Hl(t.elements.display.seekTooltip,r,e)};if(this.touch)a(!1);else{if(Pl.event(e))n=100/i.width*(e.pageX-i.left);else{if(!Vl(this.elements.display.seekTooltip,r))return;n=parseFloat(this.elements.display.seekTooltip.style.left,10)}n<0?n=0:n>100&&(n=100),Fc.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*n),this.elements.display.seekTooltip.style.left="".concat(n,"%"),Pl.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!Pl.element(this.elements.display.duration)&&this.config.invertTime;Fc.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Fc.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return Bl(this.elements.display.currentTime,!0),void Bl(this.elements.progress,!0);Pl.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=Pl.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Fc.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Fc.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),Fc.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){Bl(this.elements.settings.buttons[e],
38508!t)},updateSetting:function(e,t,n){var i=this.elements.settings.panels[e],r=null,a=t;if("captions"===e)r=this.currentTrack;else{if(r=Pl.empty(n)?this[e]:n,Pl.empty(r)&&(r=this.config[e].default),!Pl.empty(this.options[e])&&!this.options[e].includes(r))return void this.debug.warn("Unsupported value of '".concat(r,"' for ").concat(e));if(!this.config[e].options.includes(r))return void this.debug.warn("Disabled value of '".concat(r,"' for ").concat(e))}if(Pl.element(a)||(a=i&&i.querySelector('[role="menu"]')),Pl.element(a)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=Fc.getLabel.call(this,e,r);var o=a&&a.querySelector('[value="'.concat(r,'"]'));Pl.element(o)&&(o.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?xc("normal",this.config):"".concat(t,"×");case"quality":if(Pl.number(t)){var n=xc("qualityLabel.".concat(t),this.config);return n.length?n:"".concat(t,"p")}return Ec(t);case"captions":return Bc.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(Pl.element(this.elements.settings.panels.quality)){var n=this.elements.settings.panels.quality.querySelector('[role="menu"]');Pl.array(e)&&(this.options.quality=sc(e).filter(function(e){return t.config.quality.options.includes(e)}));var i=!Pl.empty(this.options.quality)&&this.options.quality.length>1;if(Fc.toggleMenuButton.call(this,"quality",i),Fl(n),Fc.checkMenu.call(this),i){var r=function(e){var n=xc("qualityBadge.".concat(e),t.config);return n.length?Fc.createBadge.call(t,n):null};this.options.quality.sort(function(e,n){var i=t.config.quality.options;return i.indexOf(e)>i.indexOf(n)?1:-1}).forEach(function(e){Fc.createMenuItem.call(t,{value:e,list:n,type:"quality",title:Fc.getLabel.call(t,"quality",e),badge:r(e)})}),Fc.updateSetting.call(this,"quality",n)}}},setCaptionsMenu:function(){var e=this;if(Pl.element(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=Bc.getTracks.call(this),i=Boolean(n.length);if(Fc.toggleMenuButton.call(this,"captions",i),Fl(t),Fc.checkMenu.call(this),i){var r=n.map(function(n,i){return{value:i,checked:e.captions.toggled&&e.currentTrack===i,title:Bc.getLabel.call(e,n),badge:n.language&&Fc.createBadge.call(e,n.language.toUpperCase()),list:t,type:"language"}});r.unshift({value:-1,checked:!this.captions.toggled,title:xc("disabled",this.config),list:t,type:"language"}),r.forEach(Fc.createMenuItem.bind(this)),Fc.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(e){var t=this;if(Pl.element(this.elements.settings.panels.speed)){var n=this.elements.settings.panels.speed.querySelector('[role="menu"]');Pl.array(e)?this.options.speed=e:(this.isHTML5||this.isVimeo)&&(this.options.speed=[.5,.75,1,1.25,1.5,1.75,2]),this.options.speed=this.options.speed.filter(function(e){return t.config.speed.options.includes(e)});var i=!Pl.empty(this.options.speed)&&this.options.speed.length>1;Fc.toggleMenuButton.call(this,"speed",i),Fl(n),Fc.checkMenu.call(this),i&&(this.options.speed.forEach(function(e){Fc.createMenuItem.call(t,{value:e,list:n,type:"speed",title:Fc.getLabel.call(t,"speed",e)})}),Fc.updateSetting.call(this,"speed",n))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!Pl.empty(e)&&Object.values(e).some(function(e){return!e.hidden});Bl(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var n=e;Pl.element(n)||(n=Object.values(this.elements.settings.panels).find(function(e){return!e.hidden}));var i=n.querySelector('[role^="menuitem"]');Yl.call(this,i,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(Pl.element(t)&&Pl.element(n)){var i=t.hidden,r=i;if(Pl.boolean(e))r=e;else if(Pl.keyboardEvent(e)&&27===e.which)r=!1;else if(Pl.event(e)){var a=t.contains(e.target);if(a||!a&&e.target!==n&&r)return}n.setAttribute("aria-expanded",r),Bl(t,!r),Hl(this.elements.container,this.config.classNames.menu.open,r),r&&Pl.keyboardEvent(e)?Fc.focusFirstMenuItem.call(this,null,!0):r||i||Yl.call(this,n,Pl.keyboardEvent(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var n=t.scrollWidth,i=t.scrollHeight;return Ul(t),{width:n,height:i}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=document.getElementById("plyr-settings-".concat(this.id,"-").concat(t));if(Pl.element(i)){var r=i.parentNode,a=Array.from(r.children).find(function(e){return!e.hidden});if(nc.transitions&&!nc.reducedMotion){r.style.width="".concat(a.scrollWidth,"px"),r.style.height="".concat(a.scrollHeight,"px");var o=Fc.getMenuSize.call(this,i);Ll.call(this,r,Xl,function t(n){n.target===r&&["width","height"].includes(n.propertyName)&&(r.style.width="",r.style.height="",Il.call(e,r,Xl,t))}),r.style.width="".concat(o.width,"px"),r.style.height="".concat(o.height,"px")}Bl(a,!0),Bl(i,!1),Fc.focusFirstMenuItem.call(this,i,n)}},setDownloadLink:function(){var e=this.elements.buttons.download;Pl.element(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,n=Rl("div",Dl(this.config.selectors.controls.wrapper));if(this.config.controls.includes("restart")&&n.appendChild(Fc.createButton.call(this,"restart")),this.config.controls.includes("rewind")&&n.appendChild(Fc.createButton.call(this,"rewind")),this.config.controls.includes("play")&&n.appendChild(Fc.createButton.call(this,"play")),this.config.controls.includes("fast-forward")&&n.appendChild(Fc.createButton.call(this,"fast-forward")),this.config.controls.includes("progress")){var i=Rl("div",Dl(this.config.selectors.progress));if(i.appendChild(Fc.createRange.call(this,"seek",{id:"plyr-seek-".concat(e.id)})),i.appendChild(Fc.createProgress.call(this,"buffer")),this.config.tooltips.seek){var r=Rl("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(r),this.elements.display.seekTooltip=r}this.elements.progress=i,n.appendChild(this.elements.progress)}if(this.config.controls.includes("current-time")&&n.appendChild(Fc.createTime.call(this,"currentTime")),this.config.controls.includes("duration")&&n.appendChild(Fc.createTime.call(this,"duration")),this.config.controls.includes("mute")||this.config.controls.includes("volume")){var a=Rl("div",{class:"plyr__volume"});if(this.config.controls.includes("mute")&&a.appendChild(Fc.createButton.call(this,"mute")),this.config.controls.includes("volume")){var o={max:1,step:.
3850805,value:this.config.volume};a.appendChild(Fc.createRange.call(this,"volume",cc(o,{id:"plyr-volume-".concat(e.id)}))),this.elements.volume=a}n.appendChild(a)}if(this.config.controls.includes("captions")&&n.appendChild(Fc.createButton.call(this,"captions")),this.config.controls.includes("settings")&&!Pl.empty(this.config.settings)){var s=Rl("div",{class:"plyr__menu",hidden:""});s.appendChild(Fc.createButton.call(this,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var l=Rl("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),c=Rl("div"),u=Rl("div",{id:"plyr-settings-".concat(e.id,"-home")}),h=Rl("div",{role:"menu"});u.appendChild(h),c.appendChild(u),this.elements.settings.panels.home=u,this.config.settings.forEach(function(n){var i=Rl("button",cc(Dl(t.config.selectors.buttons.settings),{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));Fc.bindMenuItemShortcuts.call(t,i,n),Ll(i,"click",function(){Fc.showMenuPanel.call(t,n,!1)});var r=Rl("span",null,xc(n,t.config)),a=Rl("span",{class:t.config.classNames.menu.value});a.innerHTML=e[n],r.appendChild(a),i.appendChild(r),h.appendChild(i);var o=Rl("div",{id:"plyr-settings-".concat(e.id,"-").concat(n),hidden:""}),s=Rl("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});s.appendChild(Rl("span",{"aria-hidden":!0},xc(n,t.config))),s.appendChild(Rl("span",{class:t.config.classNames.hidden},xc("menuBack",t.config))),Ll(o,"keydown",function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),Fc.showMenuPanel.call(t,"home",!0))},!1),Ll(s,"click",function(){Fc.showMenuPanel.call(t,"home",!1)}),o.appendChild(s),o.appendChild(Rl("div",{role:"menu"})),c.appendChild(o),t.elements.settings.buttons[n]=i,t.elements.settings.panels[n]=o}),l.appendChild(c),s.appendChild(l),n.appendChild(s),this.elements.settings.popup=l,this.elements.settings.menu=s}if(this.config.controls.includes("pip")&&nc.pip&&n.appendChild(Fc.createButton.call(this,"pip")),this.config.controls.includes("airplay")&&nc.airplay&&n.appendChild(Fc.createButton.call(this,"airplay")),this.config.controls.includes("download")){var f={element:"a",href:this.download,target:"_blank"},d=this.config.urls.download;!Pl.url(d)&&this.isEmbed&&cc(f,{icon:"logo-".concat(this.provider),label:this.provider}),n.appendChild(Fc.createButton.call(this,"download",f))}return this.config.controls.includes("fullscreen")&&n.appendChild(Fc.createButton.call(this,"fullscreen")),this.config.controls.includes("play-large")&&this.elements.container.appendChild(Fc.createButton.call(this,"play-large")),this.elements.controls=n,this.isHTML5&&Fc.setQualityMenu.call(this,oc.getQualityOptions.call(this)),Fc.setSpeedMenu.call(this),n},inject:function(){var e=this;if(this.config.loadSprite){var t=Fc.getIconUrl.call(this);t.cors&&Mc(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var n=null;this.elements.controls=null;var i={id:this.id,seektime:this.config.seekTime,title:this.config.title},r=!0;Pl.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),Pl.element(this.config.controls)||Pl.string(this.config.controls)?n=this.config.controls:(n=Fc.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Bc.getLabel.call(this)}),r=!1);var a,o=function(e){var t=e;return Object.entries(i).forEach(function(e){var n=Na(e,2),i=n[0],r=n[1];t=Sc(t,"{".concat(i,"}"),r)}),t};if(r&&(Pl.string(this.config.controls)?n=o(n):Pl.element(n)&&(n.innerHTML=o(n.innerHTML))),Pl.string(this.config.selectors.controls.container)&&(a=document.querySelector(this.config.selectors.controls.container)),Pl.element(a)||(a=this.elements.container),a[Pl.element(n)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",n),Pl.element(this.elements.controls)||Fc.findElements.call(this),!Pl.empty(this.elements.buttons)){var s=function(t){var n=e.config.classNames.c
38508ontrolPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return Vl(t,n)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Hl(t,n,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(function(e){Pl.array(e)||Pl.nodeList(e)?Array.from(e).filter(Boolean).forEach(s):s(e)})}if(ec.isEdge&&Jl(a),this.config.tooltips.controls){var l=this.config,c=l.classNames,u=l.selectors,h="".concat(u.controls.wrapper," ").concat(u.labels," .").concat(c.hidden),f=Wl.call(this,h);Array.from(f).forEach(function(t){Hl(t,e.config.classNames.hidden,!1),Hl(t,e.config.classNames.tooltip,!0)})}}};function qc(e){var t=e;if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=document.createElement("a");n.href=t,t=n.href}try{return new URL(t)}catch(e){return null}}function Dc(e){var t=new URLSearchParams;return Pl.object(e)&&Object.entries(e).forEach(function(e){var n=Na(e,2),i=n[0],r=n[1];t.set(i,r)}),t}var Bc={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!nc.textTracks)Pl.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Fc.setCaptionsMenu.call(this);else{var e,t;if(Pl.element(this.elements.captions)||(this.elements.captions=Rl("div",Dl(this.config.selectors.captions)),e=this.elements.captions,t=this.elements.wrapper,Pl.element(e)&&Pl.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),ec.isIE&&window.URL){var n=this.media.querySelectorAll("track");Array.from(n).forEach(function(e){var t=e.getAttribute("src"),n=qc(t);null!==n&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&Ic(t,"blob").then(function(t){e.setAttribute("src",window.URL.createObjectURL(t))}).catch(function(){Ul(e)})})}var i=sc((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(function(e){return e.split("-")[0]})),r=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();if("auto"===r)r=Na(i,1)[0];var a=this.storage.get("captions");if(Pl.boolean(a)||(a=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:a,language:r,languages:i}),this.isHTML5){var o=this.config.captions.update?"addtrack removetrack":"removetrack";Ll.call(this,this.media.textTracks,o,Bc.update.bind(this))}setTimeout(Bc.update.bind(this),0)}},update:function(){var e=this,t=Bc.getTracks.call(this,!0),n=this.captions,i=n.active,r=n.language,a=n.meta,o=n.currentTrackNode,s=Boolean(t.find(function(e){return e.language===r}));this.isHTML5&&this.isVideo&&t.filter(function(e){return!a.get(e)}).forEach(function(t){e.debug.log("Track added",t),a.set(t,{default:"showing"===t.mode}),t.mode="hidden",Ll.call(e,t,"cuechange",function(){return Bc.updateCues.call(e)})}),(s&&this.language!==r||!t.includes(o))&&(Bc.setLanguage.call(this,r),Bc.toggle.call(this,i&&s)),Hl(this.elements.container,this.config.classNames.captions.enabled,!Pl.empty(t)),(this.config.controls||[]).includes("settings")&&this.config.settings.includes("captions")&&Fc.setCaptionsMenu.call(this)},toggle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var n=this.captions.toggled,i=this.config.classNames.captions.active,r=Pl.nullOrUndefined(e)?!n:e;if(r!==n){if(t||(this.captions.active=r,this.storage.set({captions:r})),!this.language&&r&&!t){var a=Bc.getTracks.call(this),o=Bc.findTrack.call(this,[this.captions.language].concat(ja(this.captions.languages)),!0);return this.captions.language=o.language,void Bc.set.call(this,a.indexOf(o))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=r),Hl(this.elements.container,i,r),this.captions.toggled=r,Fc.updateSetting.call(this,"captions"),Nl.call(this,this.media,r?"captionsenabled":"captionsdisabled")}}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=Bc.getTracks.call(this);if(-1!==e)if(Pl.number(e))if(e in n){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var i=n[e],r=(i||{}).language;this.captions.currentTrackNode=i,Fc.updateSetting.call(this,"captions"),t||(this.captions.language=r,this.storage.set({language:r})),this.isVimeo&&this.embed.enableTextTrack(r),Nl.call(this,this.media,"languagechange")}Bc.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Bc.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Bc.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Pl.string(e)){var n=e.toLowerCase();this.captions.language=n;var i=Bc.getTracks.call(this),r=Bc.findTrack.call(this,[n]);Bc.set.call(this,i.indexOf(r),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter(function(n){return!e.isHTML5||t||e.captions.meta.has(n)}).filter(function(e){return["captions","subtitles"].includes(e.kind)})},findTrack:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Bc.getTracks.call(this),a=function(e){return Number((n.captions.meta.get(e)||{}).default)},o=Array.from(r).sort(function(e,t){return a(t)-a(e)});return e.every(function(e){return!(t=o.find(function(t){return t.language===e}))}),t||(i?o[0]:void 0)},getCurrentTrack:function(){return Bc.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!Pl.track(t)&&nc.textTracks&&this.captions.toggled&&(t=Bc.getCurrentTrack.call(this)),Pl.track(t)?Pl.empty(t.label)?Pl.empty(t.language)?xc("enabled",this.config):e.language.toUpperCase():t.label:xc("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(Pl.element(this.elements.captions))if(Pl.nullOrUndefined(e)||Array.isArray(e)){var t=e;if(!t){var n=Bc.getCurrentTrack.call(this);
38508t=Array.from((n||{}).activeCues||[]).map(function(e){return e.getCueAsHTML()}).map(Pc)}var i=t.map(function(e){return e.trim()}).join("\n");if(i!==this.elements.captions.innerHTML){Fl(this.elements.captions);var r=Rl("span",Dl(this.config.selectors.caption));r.innerHTML=i,this.elements.captions.appendChild(r),Nl.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},Hc={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.5.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240]},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/v2/video/{0}.json"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://www.googleapis.com/youtube/v3/videos?id={0}&key={1}&fields=items(snippet(title))&part=snippet"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption",menu:{quality:".js-plyr__menu__list--quality"}},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-control
38508s",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},keys:{google:null},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1},youtube:{noCookie:!1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1}},Vc="picture-in-picture",zc="inline",Wc={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Kc={audio:"audio",video:"video"};var Yc=function(){},$c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];xa(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return Ia(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):Yc}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):Yc}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):Yc}}]),e}();function Gc(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;Pl.element(e)&&(e.pressed=this.active),Nl.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0),ec.isIos||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Pl.element(e)){var n=Wl.call(this,"button:not(:disabled), input:not(:disabled), [tabindex]"),i=n[0],r=n[n.length-1];xl.call(this,this.elements.container,"keydown",function(e){if("Tab"===e.key&&9===e.keyCode){var t=document.activeElement;t!==r||e.shiftKey?t===i&&e.shiftKey&&(r.focus(),e.preventDefault()):(i.focus(),e.preventDefault())}},t,!1)}}.call(this.player,this.target,this.active)}}function Qc(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",Hl(this.target,this.player.config.classNames.fullscreen.fallback,t),ec.isIos){var n=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";n||(n=document.createElement("meta")).setAttribute("name","viewport");var r=Pl.string(n.content)&&n.content.includes(i);t?(this.cleanupViewport=!r,r||(n.content+=",".concat(i))):this.cleanupViewport&&(n.content=n.content.split(",").filter(function(e){return e.trim()!==i}).join(",")),setTimeout(function(){return Jl(e.target)},100)}Gc.call(this)}var Xc=function(){function e(t){var n=this;xa(this,e),this.player=t,this.prefix=e.prefix,this.property=e.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,Ll.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),function(){Gc.call(n)}),Ll.call(this.player,this.player.elements.container,"dblclick",function(e){Pl.element(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.toggle()}),this.update()}return Ia(e,[{key:"update",value:function(){var t;this.enabled?(t=this.forceFallback?"Fallback (forced)":e.native?"Native":"Fallback",this.player.debug.log("".concat(t," fullscreen enabled"))):this.player.debug.log("Fullscreen not supported and fallback disabled");Hl(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(ec.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():!e.native||this.forceFallback?Qc.call(this,!0):this.prefix?Pl.empty(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen())}},{key:"exit",value:function(){if(this.enabled)if(ec.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),this.player.play();else if(!e.native||this.forceFallback)Qc.call(this,!1);else if(this.prefix){if(!Pl.empty(this.prefix)){var t="moz"===this.prefix?"Cancel":"Exit";document["".concat(this.prefix).concat(t).concat(this.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"usingNative",get:function(){return e.native&&!this.forceFallback}},{key:"enabled",get:function(){return(e.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){return!!this.enabled&&(!e.native||this.forceFallback?Vl(this.target,this.player.config.classNames.fullscreen.fallback):(this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement)===this.target)}},{key:"target",get:function(){return ec.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.container}}
38508],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(Pl.function(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some(function(t){return!(!Pl.function(document["".concat(t,"ExitFullscreen")])&&!Pl.function(document["".concat(t,"CancelFullScreen")]))&&(e=t,!0)}),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),e}(),Jc=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1};function Zc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise(function(n,i){var r=new Image,a=function(){delete r.onload,delete r.onerror,(r.naturalWidth>=t?n:i)(r)};Object.assign(r,{onload:a,onerror:a,src:e})})}Se({target:"Math",stat:!0},{sign:Jc});var eu={addStyleHook:function(){Hl(this.elements.container,this.config.selectors.container.replace(".",""),!0),Hl(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void eu.toggleNativeControls.call(this,!0);Pl.element(this.elements.controls)||(Fc.inject.call(this),this.listeners.controls()),eu.toggleNativeControls.call(this),this.isHTML5&&Bc.setup.call(this),this.volume=null,this.muted=null,this.speed=null,this.loop=null,this.quality=null,Fc.updateVolume.call(this),Fc.timeUpdate.call(this),eu.checkPlaying.call(this),Hl(this.elements.container,this.config.classNames.pip.supported,nc.pip&&this.isHTML5&&this.isVideo),Hl(this.elements.container,this.config.classNames.airplay.supported,nc.airplay&&this.isHTML5),Hl(this.elements.container,this.config.classNames.isIos,ec.isIos),Hl(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(function(){Nl.call(e,e.media,"ready")},0),eu.setTitle.call(this),this.poster&&eu.setPoster.call(this,this.poster,!1).catch(function(){}),this.config.duration&&Fc.durationUpdate.call(this)},setTitle:function(){var e=xc("play",this.config);if(Pl.string(this.config.title)&&!Pl.empty(this.config.title)&&(e+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach(function(t){t.setAttribute("aria-label",e)}),this.isEmbed){var t=Kl.call(this,"iframe");if(!Pl.element(t))return;var n=Pl.empty(this.config.title)?"video":this.config.title,i=xc("frameTitle",this.config);t.setAttribute("title",i.replace("{title}",n))}},togglePoster:function(e){Hl(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this;return arguments.length>
385081&&void 0!==arguments[1]&&!arguments[1]||!this.poster?(this.media.setAttribute("poster",e),function(){var e=this;return new Promise(function(t){return e.ready?setTimeout(t,0):Ll.call(e,e.elements.container,"ready",t)}).then(function(){})}.call(this).then(function(){return Zc(e)}).catch(function(n){throw e===t.poster&&eu.togglePoster.call(t,!1),n}).then(function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('".concat(e,"')"),backgroundSize:""}),eu.togglePoster.call(t,!0),e})):Promise.reject(new Error("Poster already set"))},checkPlaying:function(e){var t=this;Hl(this.elements.container,this.config.classNames.playing,this.playing),Hl(this.elements.container,this.config.classNames.paused,this.paused),Hl(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(function(e){e.pressed=t.playing}),Pl.event(e)&&"timeupdate"===e.type||eu.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(function(){Hl(t.elements.container,t.config.classNames.loading,t.loading),eu.toggleControls.call(t)},this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;if(t&&this.config.hideControls){var n=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||n))}}},tu=function(){function e(t){xa(this,e),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return Ia(e,[{key:"handleKey",value:function(e){var t=this.player,n=t.elements,i=e.keyCode?e.keyCode:e.which,r="keydown"===e.type,a=r&&i===this.lastKey;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&Pl.number(i)){if(r){var o=document.activeElement;if(Pl.element(o)){var s=t.config.selectors.editable;if(o!==n.inputs.seek&&zl(o,s))return;if(32===e.which&&zl(o,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(i)&&(e.preventDefault(),e.stopPropagation()),i){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:a||(t.currentTime=t.duration/10*(i-48));break;case 32:case 75:a||t.togglePlay();break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:a||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:a||t.toggleCaptions();break;case 76:t.loop=!t.loop}27===i&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=i}else this.lastKey=null}}},{key:"toggleMenu",value:function(e){Fc.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,Hl(t.container,e.config.classNames.isTouch,!0)}},{key:"setTabFocus",value:function(e){var t=this.player,n=t.elements;if(clearTimeout(this.focusTimer),"keydown"!==e.type||9===e.which){"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);var i,r=e.timeStamp-this.lastKeyDown<=20;if("focus"!==e.type||r)i=t.config.classNames.tabFocus,Hl(Wl.call(t,".".concat(i)),i,!1),this.focusTimer=setTimeout(function(){var e=document.activeElement;n.container.contains(e)&&Hl(document.activeElement,t.config.classNames.tabFocus,!0)},10)}}},{key:"global",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.player;t.config.keyboard.global&&xl.call(t,window,"keydown keyup",this.handleKey,e,!1),xl.call(t,document.body,"click",this.toggleMenu,e),Ml.call(t,document.body,"touchstart",this.firstTouch),xl.call(t,document.body,"keydown focus blur",this.setTabFocus,e,!1,!0)}},{key:"container",value:function(){var e=this,t=this.player,n=t.config,i=t.elements,r=t.timers;!n.keyboard.global&&n.keyboard.focused&&Ll.call(t,i.container,"keydown keyup",this.handleKey,!1),Ll.call(t,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",function(e){var n=i.controls;n&&"enterfullscreen"===e.type&&(n.pressed=!1,n.hover=!1);var a=0;["touchstart","touchmove","mousemove"].includes(e.type)&&(eu.toggleControls.call(t,!0),a=t.touch?3e3:2e3),clearTimeout(r.controls),r.controls=setTimeout(function(){return eu.toggleControls.call(t,!1)},a)});var a=function(e){if(!e)return ac.call(t);var n=i.container.getBoundingClientRect(),r=n.width,a=n.height;return ac.call(t,"".concat(r,":").concat(a))},o=function(){window.clearTimeout(r.resized),r.resized=window.setTimeout(a,50)};Ll.call(t,i.container,"enterfullscreen exitfullscreen",function(n){var r=t.fullscreen,s=r.target,l=r.usingNative;if(t.isEmbed&&s===i.container){var c="enterfullscreen"===n.type,u=a(c);u.padding;!function(n,i,r){if(t.isVimeo){var a=t.elements.wrapper.firstChild,o=Na(n,2)[1],s=Na(rc.call(e),2),l=s[0],c=s[1];a.style.maxWidth=r?"".concat(o/c*l,"px"):null,a.style.margin=r?"0 auto":null}}(u.ratio,0,c),l||(c?Ll.call(t,window,"resize",o):Il.call(t,window,"resize",o))}})}},{key:"media",value:function(){var e=this,t=this.player,n=t.elements;if(Ll.call(t,t.media,"timeupdate seeking seeked",function(e){return Fc.timeUpdate.call(t,e)}),Ll.call(t,t.media,"durationchange loadeddata loadedmetadata",function(e){return Fc.durationUpdate.call(t,e)}),Ll.call(t,t.media,"canplay loadeddata",function(){Bl(n.volume,!t.hasAudio),Bl(n.buttons.mute,!t.hasAudio)}),Ll.call(t,t.media,"ended",function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&t.restart()}),Ll.call(t,t.media,"progress playing seeking seeked",function(e){return Fc.updateProgress.call(t,e)}),Ll.call(t,t.media,"volumechange",function(e){return Fc.updateVolume.call(t,e)}),Ll.call(t,t.media,"playing play pause ended emptied timeupdate",function(e){return eu.checkPlaying.call(t,e)}),Ll.call(t,t.media,"waiting canplay seeked playing",function(e){return eu.checkLoading.call(t,e)}),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var i=Kl.call(t,".".concat(t.config.classNames.video));if(!Pl.element(i))return;Ll.call(t,n.container,"click",function(r){([n.container,i].includes(r.target)||i.contains(r.target))&&(t.touch&&t.config.hideControls||(t.ended?(e.proxy(r,t.restart,"restart"),e.proxy(r,t.play,"play")):e.proxy(r,t.togglePlay,"play")))})}t.supported.ui&&t.config.disableContextMenu&&Ll.call(t,n.wrapper,"contextmenu",function(e){e.preventDefault()},!1),Ll.call(t,t.media,"volumechange",function(){t.storage.set({volume:t.volume,muted:t.muted})}),Ll.call(t,t.media,"ratechange",function(){Fc.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),Ll.call(t,t.media,"qualitychange",function(e){Fc.updateSetting.call(t,"quality",null,e.detail.quality)}),Ll.call(t,t.media,"ready qualitychange",function(){Fc.setDownloadLink.call(t)});var r=t.config.events.concat(["keyup","keydown"]).join(" ");Ll.call(t,t.media,r,function(e){var i=e.detail,r=void 0===i?{}:i;"error"===e.type&&(r=t.media.error),Nl.call(t,n.container,e.type,!0,r)})}},{key:"proxy",value:function(e,t,n){var i=this.player,r=i.config.listeners[n],a=!0;Pl.function(r)&&(a=r.call(i,e)),a&&Pl.function(t)&&t.call(i,e)}},{key:"bind",value:function(e,t,n,i){var r=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.player,s=o.config.listeners[i],l=Pl.function(s);Ll.call(o,e,t,function(e){return r.proxy(e,n,i)},a&&!l)}},{key:"controls",value:function(){var e=this,t=this.player,n=t.elements,i=ec.isIE?"change":"input";
38508if(n.buttons.play&&Array.from(n.buttons.play).forEach(function(n){e.bind(n,"click",t.togglePlay,"play")}),this.bind(n.buttons.restart,"click",t.restart,"restart"),this.bind(n.buttons.rewind,"click",t.rewind,"rewind"),this.bind(n.buttons.fastForward,"click",t.forward,"fastForward"),this.bind(n.buttons.mute,"click",function(){t.muted=!t.muted},"mute"),this.bind(n.buttons.captions,"click",function(){return t.toggleCaptions()}),this.bind(n.buttons.download,"click",function(){Nl.call(t,t.media,"download")},"download"),this.bind(n.buttons.fullscreen,"click",function(){t.fullscreen.toggle()},"fullscreen"),this.bind(n.buttons.pip,"click",function(){t.pip="toggle"},"pip"),this.bind(n.buttons.airplay,"click",t.airplay,"airplay"),this.bind(n.buttons.settings,"click",function(e){e.stopPropagation(),Fc.toggleMenu.call(t,e)}),this.bind(n.buttons.settings,"keyup",function(e){var n=e.which;[13,32].includes(n)&&(13!==n?(e.preventDefault(),e.stopPropagation(),Fc.toggleMenu.call(t,e)):Fc.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(n.settings.menu,"keydown",function(e){27===e.which&&Fc.toggleMenu.call(t,e)}),this.bind(n.inputs.seek,"mousedown mousemove",function(e){var t=n.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);e.currentTarget.setAttribute("seek-value",i)}),this.bind(n.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",function(e){var n=e.currentTarget,i=e.keyCode?e.keyCode:e.which;if(!Pl.keyboardEvent(e)||39===i||37===i){t.lastSeekTime=Date.now();var r=n.hasAttribute("play-on-seeked"),a=["mouseup","touchend","keyup"].includes(e.type);r&&a?(n.removeAttribute("play-on-seeked"),t.play()):!a&&t.playing&&(n.setAttribute("play-on-seeked",""),t.pause())}}),ec.isIos){var r=Wl.call(t,'input[type="range"]');Array.from(r).forEach(function(t){return e.bind(t,i,function(e){return Jl(e.target)})})}this.bind(n.inputs.seek,i,function(e){var n=e.currentTarget,i=n.getAttribute("seek-value");Pl.empty(i)&&(i=n.value),n.removeAttribute("seek-value"),t.currentTime=i/n.max*t.duration},"seek"),this.bind(n.progress,"mouseenter mouseleave mousemove",function(e){return Fc.updateSeekTooltip.call(t,e)}),this.bind(n.progress,"mousemove touchmove",function(e){var n=t.previewThumbnails;n&&n.loaded&&n.startMove(e)}),this.bind(n.progress,"mouseleave click",function(){var e=t.previewThumbnails;e&&e.loaded&&e.endMove(!1,!0)}),this.bind(n.progress,"mousedown touchstart",function(e){var n=t.previewThumbnails;n&&n.loaded&&n.startScrubbing(e)}),this.bind(n.progress,"mouseup touchend",function(e){var n=t.previewThumbnails;n&&n.loaded&&n.endScrubbing(e)}),ec.isWebkit&&Array.from(Wl.call(t,'input[type="range"]')).forEach(function(n){e.bind(n,"input",function(e){return Fc.updateRangeFill.call(t,e.target)})}),t.config.toggleInvert&&!Pl.element(n.display.duration)&&this.bind(n.display.currentTime,"click",function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,Fc.timeUpdate.call(t))}),this.bind(n.inputs.volume,i,function(e){t.volume=e.target.value},"volume"),this.bind(n.controls,"mouseenter mouseleave",function(e){n.controls.hover=!t.touch&&"mouseenter"===e.type}),this.bind(n.controls,"mousedown mouseup touchstart touchend touchcancel",function(e){n.controls.pressed=["mousedown","touchstart"].includes(e.type)}),this.bind(n.controls,"focusin",function(){var n=t.config,i=t.elements,r=t.timers;Hl(i.controls,n.classNames.noTransition,!0),eu.toggleControls.call(t,!0),setTimeout(function(){Hl(i.controls,n.classNames.noTransition,!1)},0);var a=e.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout(function(){return eu.toggleControls.call(t,!1)},a)}),this.bind(n.inputs.volume,"wheel",function(e){var n=e.webkitDirectionInvertedFromDevice,i=Na([e.deltaX,-e.deltaY].map(function(e){return n?-e:e}),2),r=i[0],a=i[1],o=Math.sign(Math.abs(r)>Math.abs(a)?r:a);t.increaseVolume(o/50);var s=t.media.volume;(1===o&&s<1||-1===o&&s>0)&&e.preventDefault()},"volume",!1)}}]),e}(),nu=A.f,iu=Function.prototype,ru=iu.toString,au=/^\s*function ([^ (]*)/;!r||"name"in iu||nu(iu,"name",{configurable:!0,get:function(){try{return ru.call(this).match(au)[1]}catch(e){return""}}});var ou=Math.max,su=Math.min,lu=hn("splice");Se({target:"Array",proto:!0,forced:!lu},{splice:function(e,t){var n,i,r,a,o,s,l=Ft(this),c=te(l.length),u=re(e,c),h=arguments.length;if(0===h?n=i=0:1===h?(n=0,i=c-u):(n=h-2,i=su(ou(Z(t),0),c-u)),c+n-i>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(r=ri(l,i),a=0;a<i;a++)(o=u+a)in l&&cn(r,a,l[o]);if(r.length=i,n<i){for(a=u;a<c-i;a++)s=a+n,(o=a+i)in l?l[s]=l[o]:delete l[s];for(a=c;a>c-i+n;a--)delete l[a-1]}else if(n>i)for(a=c-i;a>u;a--)s=a+n-1,(o=a+i-1)in l?l[s]=l[o]:delete l[s];for(a=0;a<n;a++)l[a+u]=arguments[a+2];return l.length=c-i+n,r}});var cu=x(function(e,t){e.exports=function(){var e=function(){},t={},n={},i={};function r(e,t){if(e){var r=i[e];if(n[e]=t,r)for(;r.length;)r[0](e,t),r.splice(0,1)}}function a(t,n){t.call&&(t={success:t}),n.length?(t.error||e)(n):(t.success||e)(t)}function o(t,n,i,r){var a,s,l=document,c=i.async,u=(i.numRetries||0)+1,h=i.before||e,f=t.replace(/^(css|img)!/,"");r=r||0,/(^css!|\.css$)/.test(t)?((s=l.createElement("link")).rel="stylesheet",s.href=f,(a="hideFocus"in s)&&s.relList&&(
38508a=0,s.rel="preload",s.as="style")):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(s=l.createElement("img")).src=f:((s=l.createElement("script")).src=t,s.async=void 0===c||c),s.onload=s.onerror=s.onbeforeload=function(e){var l=e.type[0];if(a)try{s.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((r+=1)<u)return o(t,n,i,r)}else if("preload"==s.rel&&"style"==s.as)return s.rel="stylesheet";n(t,l,e.defaultPrevented)},!1!==h(t,s)&&l.head.appendChild(s)}function s(e,n,i){var s,l;if(n&&n.trim&&(s=n),l=(s?i:n)||{},s){if(s in t)throw"LoadJS";t[s]=!0}function c(t,n){!function(e,t,n){var i,r,a=(e=e.push?e:[e]).length,s=a,l=[];for(i=function(e,n,i){if("e"==n&&l.push(e),"b"==n){if(!i)return;l.push(e)}--a||t(l)},r=0;r<s;r++)o(e[r],i,n)}(e,function(e){a(l,e),t&&a({success:t,error:n},e),r(s,e)},l)}if(l.returnPromise)return new Promise(c);c()}return s.ready=function(e,t){return function(e,t){e=e.push?e:[e];var r,a,o,s=[],l=e.length,c=l;for(r=function(e,n){n.length&&s.push(e),--c||t(s)};l--;)a=e[l],(o=n[a])?r(a,o):(i[a]=i[a]||[]).push(r)}(e,function(e){a(t,e)}),s},s.done=function(e){r(e,[])},s.reset=function(){t={},n={},i={}},s.isDefined=function(e){return e in t},s}()});function uu(e){return new Promise(function(t,n){cu(e,{success:t,error:n})})}function hu(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Nl.call(this,this.media,e?"play":"pause"))}var fu={setup:function(){var e=this;Hl(this.elements.wrapper,this.config.classNames.embed,!0),ac.call(this),Pl.object(window.Vimeo)?fu.ready.call(this):uu(this.config.urls.vimeo.sdk).then(function(){fu.ready.call(e)}).catch(function(t){e.debug.warn("Vimeo API failed to load",t)})},ready:function(){var e=this,t=this,n=t.config.vimeo,i=Dc(cc({},{loop:t.config.loop.active,autoplay:t.autoplay,muted:t.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},n)),r=t.media.getAttribute("src");Pl.empty(r)&&(r=t.media.getAttribute(t.config.attributes.embed.id));var a,o=(a=r,Pl.empty(a)?null:Pl.number(Number(a))?a:a.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:a),s=Rl("iframe"),l=Tc(t.config.urls.vimeo.iframe,o,i);s.setAttribute("src",l),s.setAttribute("allowfullscreen",""),s.setAttribute("allowtransparency",""),s.setAttribute("allow","autoplay");var c=Rl("div",{poster:t.poster,class:t.config.classNames.embedContainer});c.appendChild(s),t.media=ql(c,t.media),Ic(Tc(t.config.urls.vimeo.api,o),"json").then(function(e){if(!Pl.empty(e)){var n=new URL(e[0].thumbnail_large);n.pathname="".concat(n.pathname.split("_")[0],".jpg"),eu.setPoster.call(t,n.href).catch(function(){})}}),t.embed=new window.Vimeo.Player(s,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return hu.call(t,!0),t.embed.play()},t.media.pause=function(){return hu.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var u=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return u},set:function(e){var n=t.embed,i=t.media,r=t.paused,a=t.volume,o=r&&!n.hasPlayed;i.seeking=!0,Nl.call(t,i,"seeking"),Promise.resolve(o&&n.setVolume(0)).then(function(){return n.setCurrentTime(e)}).then(function(){return o&&n.pause()}).then(function(){return o&&n.setVolume(a)}).catch(function(){})}});var h=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return h},set:function(e){t.embed.setPlaybackRate(e).then(function(){h=e,Nl.call(t,t.media,"ratechange")}).catch(function(e){"Error"===e.name&&Fc.setSpeedMenu.call(t,[])})}});var f=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return f},set:function(e){t.embed.setVolume(e).then(function(){f=e,Nl.call(t,t.media,"volumechange")})}});var d=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return d},set:function(e){var n=!!Pl.boolean(e)&&e;t.embed.setVolume(n?0:t.config.volume).then(function(){d=n,Nl.call(t,t.media,"volumechange")})}});var p,m=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return m},set:function(e){var n=Pl.boolean(e)?e:t.config.loop.active;t.embed.setLoop(n).then(function(){m=n})}}),t.embed.getVideoUrl().then(function(e){p=e,Fc.setDownloadLink.call(t)}).catch(function(t){e.debug.warn(t)}),Object.defineProperty(t.media,"currentSrc",{get:function(){return p}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then(function(n){var i=Na(n,2),r=i[0],a=i[1];t.embed.ratio="".concat(r,":").concat(a),ac.call(e)}
38508),t.embed.setAutopause(t.config.autopause).then(function(e){t.config.autopause=e}),t.embed.getVideoTitle().then(function(n){t.config.title=n,eu.setTitle.call(e)}),t.embed.getCurrentTime().then(function(e){u=e,Nl.call(t,t.media,"timeupdate")}),t.embed.getDuration().then(function(e){t.media.duration=e,Nl.call(t,t.media,"durationchange")}),t.embed.getTextTracks().then(function(e){t.media.textTracks=e,Bc.setup.call(t)}),t.embed.on("cuechange",function(e){var n=e.cues,i=(void 0===n?[]:n).map(function(e){return t=e.text,n=document.createDocumentFragment(),i=document.createElement("div"),n.appendChild(i),i.innerHTML=t,n.firstChild.innerText;var t,n,i});Bc.updateCues.call(t,i)}),t.embed.on("loaded",function(){(t.embed.getPaused().then(function(e){hu.call(t,!e),e||Nl.call(t,t.media,"playing")}),Pl.element(t.embed.element)&&t.supported.ui)&&t.embed.element.setAttribute("tabindex",-1)}),t.embed.on("play",function(){hu.call(t,!0),Nl.call(t,t.media,"playing")}),t.embed.on("pause",function(){hu.call(t,!1)}),t.embed.on("timeupdate",function(e){t.media.seeking=!1,u=e.seconds,Nl.call(t,t.media,"timeupdate")}),t.embed.on("progress",function(e){t.media.buffered=e.percent,Nl.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&Nl.call(t,t.media,"canplaythrough"),t.embed.getDuration().then(function(e){e!==t.media.duration&&(t.media.duration=e,Nl.call(t,t.media,"durationchange"))})}),t.embed.on("seeked",function(){t.media.seeking=!1,Nl.call(t,t.media,"seeked")}),t.embed.on("ended",function(){t.media.paused=!0,Nl.call(t,t.media,"ended")}),t.embed.on("error",function(e){t.media.error=e,Nl.call(t,t.media,"error")}),setTimeout(function(){return eu.build.call(t)},0)}};function du(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Nl.call(this,this.media,e?"play":"pause"))}function pu(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}var mu={setup:function(){var e=this;Hl(this.elements.wrapper,this.config.classNames.embed,!0),ac.call(this),Pl.object(window.YT)&&Pl.function(window.YT.Player)?mu.ready.call(this):(uu(this.config.urls.youtube.sdk).catch(function(t){e.debug.warn("YouTube API failed to load",t)}),window.onYouTubeReadyCallbacks=window.onYouTubeReadyCallbacks||[],window.onYouTubeReadyCallbacks.push(function(){mu.ready.call(e)}),window.onYouTubeIframeAPIReady=function(){window.onYouTubeReadyCallbacks.forEach(function(e){e()})})},getTitle:function(e){var t=this;if(Pl.function(this.embed.getVideoData)){var n=this.embed.getVideoData().title;if(Pl.empty(n))return this.config.title=n,void eu.setTitle.call(this)}var i=this.config.keys.google;Pl.string(i)&&!Pl.empty(i)&&Ic(Tc(this.config.urls.youtube.api,e,i)).then(function(e){Pl.object(e)&&(t.config.title=e.items[0].snippet.title,eu.setTitle.call(t))}).catch(function(){})},ready:function(){var e=this,t=e.media.getAttribute("id");if(Pl.empty(t)||!t.startsWith("youtube-")){var n=e.media.getAttribute("src");Pl.empty(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));var i,r,a=(i=n,Pl.empty(i)?null:i.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:i),o=(r=e.provider,"".concat(r,"-").concat(Math.floor(1e4*Math.random()))),s=Rl("div",{id:o,poster:e.poster});e.media=ql(s,e.media);var l=function(e){return"https://i.ytimg.com/vi/".concat(a,"/").concat(e,"default.jpg")};Zc(l("maxres"),121).catch(function(){return Zc(l("sd"),121)}).catch(function(){return Zc(l("hq"))}).then(function(t){return eu.setPoster.call(e,t.src)}).then(function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(function(){});var c=e.config.youtube;e.embed=new window.YT.Player(o,{videoId:a,host:pu(c),playerVars:cc({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},c),events:{onError:function(t){if(!e.media.error){var n=t.data,i={2:"The request contains an invali
38508d parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[n]||"An unknown error occured";e.media.error={code:n,message:i},Nl.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var n=t.target;e.media.playbackRate=n.getPlaybackRate(),Nl.call(e,e.media,"ratechange")},onReady:function(t){if(!Pl.function(e.media.play)){var n=t.target;mu.getTitle.call(e,a),e.media.play=function(){du.call(e,!0),n.playVideo()},e.media.pause=function(){du.call(e,!1),n.pauseVideo()},e.media.stop=function(){n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(n.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Nl.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return n.getPlaybackRate()},set:function(e){n.setPlaybackRate(e)}});var i=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return i},set:function(t){i=t,n.setVolume(100*i),Nl.call(e,e.media,"volumechange")}});var r=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return r},set:function(t){var i=Pl.boolean(t)?t:r;r=i,n[i?"mute":"unMute"](),Nl.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return n.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}}),e.options.speed=n.getAvailablePlaybackRates(),e.supported.ui&&e.media.setAttribute("tabindex",-1),Nl.call(e,e.media,"timeupdate"),Nl.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(function(){e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Nl.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Nl.call(e,e.media,"canplaythrough"))},200),setTimeout(function(){return eu.build.call(e)},50)}},onStateChange:function(t){var n=t.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(t.data)&&(e.media.seeking=!1,Nl.call(e,e.media,"seeked")),t.data){case-1:Nl.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),Nl.call(e,e.media,"progress");break;case 0:du.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):Nl.call(e,e.media,"ended");break;case 1:e.config.autoplay||!e.media.paused||e.embed.hasPlayed?(du.call(e,!0),Nl.call(e,e.media,"playing"),e.timers.playing=setInterval(function(){Nl.call(e,e.media,"timeupdate")},50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),Nl.call(e,e.media,"durationchange"))):e.media.pause();break;case 2:e.muted||e.embed.unMute(),du.call(e,!1)}Nl.call(e,e.elements.container,"statechange",!1,{code:t.data})}}})}}},gu={setup:function(){this.media?(Hl(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Hl(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Hl(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Rl("div",{class:this.config.classNames.video}),jl(this.media,this.elements.wrapper),this.elements.poster=Rl("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?oc.extend.call(this):this.isYouTube?mu.setup.call(this):this.isVimeo&&fu.setup.call(this)):this.debug.warn("No media element found!")}},vu=function(){function e(t){var n=this;xa(this,e),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(function(e,t){n.on("loaded",e),n.on("error",t)}),this.load()}return Ia(e,[{key:"load",value:function(){var e=this;this.enabled&&(Pl.object(window.google)&&Pl.object(window.google.ima)?this.ready():uu(this.player.config.urls.googleIMA.sdk).then(function(){e.ready()}).catch(function(){e.trigger("error",new Error("Google IMA SDK failed to load"))}))}},{key:"ready",value:function(){var e=this;this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(function(){e.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}},{key:"setupIMA",value:function(){this.elements.container=Rl("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.requestAds()}},{key:"requestAds",value:function(){var e=this,t=this.player.elements.container;try{this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(t){return e.onAdsManagerLoaded(t)},!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(t){return e.onAdError(t)},!1);var n=new google.ima.AdsRequest;n.adTagUrl=this.tagUrl,n.linearAdSlotWidth=t.offsetWidth,n.linearAdSlotHeight=t.offsetHeight,n.nonLinearAdSlotWidth=t.offsetWidth,n.nonLinearAdSlotHeight=t.offsetHeight,n.forceNonLinearFullSlot=!1,n.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(n)}catch(e){this.onAdError(e)}}},{key:"pollCountdown",value:function(){var e=this;if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]))return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(function(){var t=Uc(Math.max(e.manager.getRemainingTime(),0)),n="".concat(xc("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",n)},100)}},{key:"onAdsManagerLoaded",value:function(e){var t=this;if(this.enabled){var n=new google.ima.AdsRenderingSettings;n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.enablePreloading=!0,this.manager=e.getAdsManager(this.player,n),this.cuePoints=this.manager.getCuePoints(),this.manager.setVolume(this.player.volume),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(e){return t.onAdError(e)}),Object.keys(google.ima.AdEvent.Type).forEach(function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],function(e){return t.onAdEvent(e)})}),this.trigger("loaded")}}},{key:"addCuePoints",value:function(){var e=this;
38508Pl.empty(this.cuePoints)||this.cuePoints.forEach(function(t){if(0!==t&&-1!==t&&t<e.player.duration){var n=e.player.elements.progress;if(Pl.element(n)){var i=100/e.player.duration*t,r=Rl("span",{class:e.player.config.classNames.cues});r.style.left="".concat(i.toString(),"%"),n.appendChild(r)}}})}},{key:"onAdEvent",value:function(e){var t=this,n=this.player.elements.container,i=e.getAd(),r=e.getAdData(),a=function(e){var n="ads".concat(e.replace(/_/g,"").toLowerCase());Nl.call(t.player,t.player.media,n)};switch(e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),a(e.type),this.pollCountdown(!0),i.isLinear()||(i.width=n.offsetWidth,i.height=n.offsetHeight);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:a(e.type),this.loadAds();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:a(e.type),this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:a(e.type),this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.STARTED:case google.ima.AdEvent.Type.MIDPOINT:case google.ima.AdEvent.Type.COMPLETE:case google.ima.AdEvent.Type.IMPRESSION:case google.ima.AdEvent.Type.CLICK:a(e.type);break;case google.ima.AdEvent.Type.LOG:r.adError&&this.player.debug.warn("Non-fatal ad error: ".concat(r.adError.getMessage()))}}},{key:"onAdError",value:function(e){this.cancel(),this.player.debug.warn("Ads error",e)}},{key:"listeners",value:function(){var e,t=this,n=this.player.elements.container;this.player.on("canplay",function(){t.addCuePoints()}),this.player.on("ended",function(){t.loader.contentComplete()}),this.player.on("timeupdate",function(){e=t.player.currentTime}),this.player.on("seeked",function(){var n=t.player.currentTime;Pl.empty(t.cuePoints)||t.cuePoints.forEach(function(i,r){e<i&&i<n&&(t.manager.discardAdBreak(),t.cuePoints.splice(r,1))})}),window.addEventListener("resize",function(){t.manager&&t.manager.resize(n.offsetWidth,n.offsetHeight,google.ima.ViewMode.NORMAL)})}},{key:"play",value:function(){var e=this,t=this.player.elements.container;this.managerPromise||this.resumeContent(),this.managerPromise.then(function(){e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}}).catch(function(){})}},{key:"resumeContent",value:function(){this.elements.container.style.zIndex="",this.playing=!1,this.player.media.play()}},{key:"pauseContent",value:function(){this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}},{key:"cancel",value:function(){this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}},{key:"loadAds",value:function(){var e=this;this.managerPromise.then(function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise(function(t){e.on("loaded",t),e.player.debug.log(e.manager)}),e.requestAds()}).catch(function(){})}},{key:"trigger",value:function(e){for(var t=this,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a=this.events[e];Pl.array(a)&&a.forEach(function(e){Pl.function(e)&&e.apply(t,i)})}},{key:"on",value:function(e,t){return Pl.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this}},{key:"startSafetyTimer",value:function(e,t){var n=this;this.player.debug.log("Safety timer invoked from: ".concat(t)),this.safetyTimer=setTimeout(function(){n.cancel(),n.clearSafetyTimer("startSafetyTimer()")},e)}},{key:"clearSafetyTimer",value:function(e){Pl.nullOrUndefined(this.safetyTimer)||(this.player.debug.log("Safety timer cleared from: ".concat(e)),clearTimeout(this.safetyTimer),this.safetyTimer=null)}},{key:"enabled",get:function(){var e=this.config;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!Pl.empty(e.publisherId)||Pl.url(e.tagUrl))}},{key:"tagUrl",get:function(){var e=this.config;if(Pl.url(e.tagUrl))return e.tagUrl;var t={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:this.publisherId};return"".concat("https://go.aniview.com/api/adserver6/vast/","?").concat(Dc(t))}}]),e}(),yu=ai(6),bu=!0;"findIndex"in[]&&Array(1).findIndex(function(){bu=!1}),Se({target:"Array",proto:!0,forced:bu},{findIndex:function(e){return yu(this,e,arguments.length>1?arguments[1]:void 0)}}),_t("findIndex");var wu,ku=function(){function e(t){xa(this,e),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return Ia(e,[{key:"load",value:function(){var e=this;this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(function(){e.render(),e.determineContainerAutoSizing(),e.loaded=!0})}},{key:"getThumbnails",value:function(){var e=this;return new Promise(function(t){var n=e.player.config.previewThumbnails.src;if(Pl.empty(n))throw new Error("Missing previewThumbnails.src config attribute");var i=(Pl.string(n)?[n]:n).map(function(t){return e.getThumbnail(t)});Promise.all(i).then(function(){e.thumbnails.sort(function(e,t){return e.height-t.height}),e.player.debug.log("Preview thumbnails",e.thumbnails),t()})})}},{key:"getThumbnail",value:function(e){var t=this;return new Promise(function(n){Ic(e).then(function(i){var r,a,o={frames:(r=i,a=[],r.split(/\r\n\r\n|\n\n|\r\r/).forEac
38508h(function(e){var t={};e.split(/\r\n|\n|\r/).forEach(function(e){if(Pl.number(t.startTime)){if(!Pl.empty(e.trim())&&Pl.empty(t.text)){var n=e.trim().split("#xywh="),i=Na(n,1);if(t.text=i[0],n[1]){var r=Na(n[1].split(","),4);t.x=r[0],t.y=r[1],t.w=r[2],t.h=r[3]}}}else{var a=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);a&&(t.startTime=60*Number(a[1]||0)*60+60*Number(a[2])+Number(a[3])+Number("0.".concat(a[4])),t.endTime=60*Number(a[6]||0)*60+60*Number(a[7])+Number(a[8])+Number("0.".concat(a[9])))}}),t.text&&a.push(t)}),a),height:null,urlPrefix:""};o.frames[0].text.startsWith("/")||o.frames[0].text.startsWith("http://")||o.frames[0].text.startsWith("https://")||(o.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var s=new Image;s.onload=function(){o.height=s.naturalHeight,o.width=s.naturalWidth,t.thumbnails.push(o),n()},s.src=o.urlPrefix+o.frames[0].text})})}},{key:"startMove",value:function(e){if(this.loaded&&Pl.event(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t=this.player.elements.progress.getBoundingClientRect(),n=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Uc(this.seekTime)}this.showImageAtCurrentTime()}}},{key:"endMove",value:function(){this.toggleThumbContainer(!1,!0)}},{key:"startScrubbing",value:function(e){!1!==e.button&&0!==e.button||(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}},{key:"endScrubbing",value:function(){var e=this;this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Ml.call(this.player,this.player.media,"timeupdate",function(){e.mouseDown||e.toggleScrubbingContainer(!1)})}},{key:"listeners",value:function(){var e=this;this.player.on("play",function(){e.toggleThumbContainer(!1,!0)}),this.player.on("seeked",function(){e.toggleThumbContainer(!1)}),this.player.on("timeupdate",function(){e.lastTime=e.player.media.currentTime})}},{key:"render",value:function(){this.elements.thumb.container=Rl("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Rl("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);var e=Rl("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Rl("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(e),this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Rl("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}},{key:"showImageAtCurrentTime",value:function(){var e=this;this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();var t=this.thumbnails[0].frames.findIndex(function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime}),n=t>=0,i=0;this.mouseDown||this.toggleThumbContainer(n),n&&(this.thumbnails.forEach(function(n,r){e.loadedImages.includes(n.frames[t].text)&&(i=r)}),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(i)))}},{key:"loadImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=this.showingThumb,i=this.thumbnails[t],r=i.urlPrefix,a=i.frames[n],o=i.frames[n].text,s=r+o;if(this.currentImageElement&&this.currentImageElement.dataset.filename===o)this.showImage(this.currentImageElement,a,t,n,o,!1),this.currentImageElement.dataset.index=n,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);var l=new Image;
vendor: 4,394 bytes, line 38508
38508l.src=s,l.dataset.index=n,l.dataset.filename=o,this.showingThumbFilename=o,this.player.debug.log("Loading image: ".concat(s)),l.onload=function(){return e.showImage(l,a,t,n,o,!0)},this.loadingImage=l,this.removeOldImages(l)}}},{key:"showImage",value:function(e,t,n,i,r){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];this.player.debug.log("Showing thumb: ".concat(r,". num: ").concat(i,". qual: ").concat(n,". newimg: ").concat(a)),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(r)||this.loadedImages.push(r)),this.preloadNearby(i,!0).then(this.preloadNearby(i,!1)).then(this.getHigherQuality(n,e,t,r))}},{key:"removeOldImages",value:function(e){var t=this;Array.from(this.currentImageContainer.children).forEach(function(n){if("img"===n.tagName.toLowerCase()){var i=t.usingSprites?500:1e3;if(n.dataset.index!==e.dataset.index&&!n.dataset.deleting){n.dataset.deleting=!0;var r=t.currentImageContainer;setTimeout(function(){r.removeChild(n),t.player.debug.log("Removing thumb: ".concat(n.dataset.filename))},i)}}})}},{key:"preloadNearby",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise(function(i){setTimeout(function(){var r=t.thumbnails[0].frames[e].text;if(t.showingThumbFilename===r){var a;a=n?t.thumbnails[0].frames.slice(e):t.thumbnails[0].frames.slice(0,e).reverse();var o=!1;a.forEach(function(e){var n=e.text;if(n!==r&&!t.loadedImages.includes(n)){o=!0,t.player.debug.log("Preloading thumb filename: ".concat(n));var a=t.thumbnails[0].urlPrefix+n,s=new Image;s.src=a,s.onload=function(){t.player.debug.log("Preloaded thumb filename: ".concat(n)),t.loadedImages.includes(n)||t.loadedImages.push(n),i()}}}),o||i()}},300)})}},{key:"getHigherQuality",value:function(e,t,n,i){var r=this;if(e<this.thumbnails.length-1){var a=t.naturalHeight;this.usingSprites&&(a=n.h),a<this.thumbContainerHeight&&setTimeout(function(){r.showingThumbFilename===i&&(r.player.debug.log("Showing higher quality thumb for: ".concat(i)),r.loadImage(e+1))},300)}}},{key:"toggleThumbContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(n,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"toggleScrubbingContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"determineContainerAutoSizing",value:function(){this.elements.thumb.imageContainer.clientHeight>20&&(this.sizeSpecifiedInCSS=!0)}},{key:"setThumbContainerSizeAndPos",value:function(){if(!this.sizeSpecifiedInCSS){var e=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(this.thumbContainerHeight,"px"),this.elements.thumb.imageContainer.style.width="".concat(e,"px")}this.setThumbContainerPos()}},{key:"setThumbContainerPos",value:function(){var e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),n=this.elements.thumb.container,i=t.left-e.left+10,r=t.right-e.left-n.clientWidth-10,a=this.mousePosX-e.left-n.clientWidth/2;a<i&&(a=i),a>r&&(a=r),n.style.left="".concat(a,"px")}},{key:"setScrubbingContainerSize",value:function(){this.elements.scrubbing.container.style.width="".concat(this.player.media.clientWidth,"px"),this.elements.scrubbing.container.style.height="".concat(this.player.media.clientWidth/this.thumbAspectRatio,"px")}},{key:"setImageSizeAndOffset",value:function(e,t){if(this.usingSprites){var n=this.thumbContainerHeight/t.h;e.style.height="".concat(Math.floor(e.naturalHeight*n),"px"),e.style.width="".concat(Math.floor(e.naturalWidth*n),"px"),e.style.left="-".concat(t.x*n,"px"),e.style.top="-".concat(t.y*n,"px")}}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}}
vendor: 4,532 bytes, line 38508
38508,{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?Math.floor(this.player.media.clientWidth/this.thumbAspectRatio):Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),e}(),Tu={insertElements:function(e,t){var n=this;Pl.string(t)?_l(e,this.media,{src:t}):Pl.array(t)&&t.forEach(function(t){_l(e,n.media,t)})},change:function(e){var t=this;lc(e,"sources.length")?(oc.cancelRequests.call(this),this.destroy.call(this,function(){t.options.quality=[],Ul(t.media),t.media=null,Pl.element(t.elements.container)&&t.elements.container.removeAttribute("class");var n=e.sources,i=e.type,r=Na(n,1)[0],a=r.provider,o=void 0===a?Wc.html5:a,s=r.src,l="html5"===o?i:"div",c="html5"===o?{}:{src:s};Object.assign(t,{provider:o,type:i,supported:nc.check(i,o,t.config.playsinline),media:Rl(l,c)}),t.elements.container.appendChild(t.media),Pl.boolean(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),Pl.empty(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),eu.addStyleHook.call(t),t.isHTML5&&Tu.insertElements.call(t,"source",n),t.config.title=e.title,gu.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&Tu.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&eu.build.call(t),t.isHTML5&&t.media.load(),t.previewThumbnails&&t.previewThumbnails.load(),t.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}},Su=function(){function e(t,n){var i=this;if(xa(this,e),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=nc.touch,this.media=t,Pl.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||Pl.nodeList(this.media)||Pl.array(this.media))&&(this.media=this.media[0]),this.config=cc({},Hc,e.defaults,n||{},function(){try{return JSON.parse(i.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new $c(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",nc),!Pl.nullOrUndefined(this.media)&&Pl.element(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(nc.check().api){var r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;var a=this.media.tagName.toLowerCase(),o=null,s=null;switch(a){case"div":if(o=this.media.querySelector("iframe"),Pl.element(o)){if(s=qc(o.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Wc.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Wc.vimeo:null}(s.toString()),this.elements.container=this.media,this.media=o,this.elements.container.className="",s.search.length){var l=["1","true"];l.includes(s.searchParams.get("autoplay"))&&(this.config.autoplay=!0),l.includes(s.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=l.includes(s.searchParams.get("playsinline")),this.config.youtube.hl=s.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(Pl.empty(this.provider)||!Object.keys(Wc).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Kc.video;break;case"video":case"audio":this.type=a,this.provider=Wc.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.auto
38508play=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=nc.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new tu(this),this.storage=new Lc(this),this.media.plyr=this,Pl.element(this.elements.container)||(this.elements.container=Rl("div",{tabindex:0}),jl(this.media,this.elements.container)),eu.addStyleHook.call(this),gu.setup.call(this),this.config.debug&&Ll.call(this,this.elements.container,this.config.events.join(" "),function(e){i.debug.log("event: ".concat(e.type))}),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&eu.build.call(this),this.listeners.container(),this.listeners.global(),this.fullscreen=new Xc(this),this.config.ads.enabled&&(this.ads=new vu(this)),this.isHTML5&&this.config.autoplay&&setTimeout(function(){return i.play()},10),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ku(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return Ia(e,[{key:"play",value:function(){var e=this;return Pl.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(function(){return e.ads.play()}).catch(function(){return e.media.play()}),this.media.play()):null}},{key:"pause",value:function(){this.playing&&Pl.function(this.media.pause)&&this.media.pause()}},{key:"togglePlay",value:function(e){(Pl.boolean(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):Pl.function(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime=this.currentTime-(Pl.number(e)?e:this.config.seekTime)}},{key:"forward",value:function(e){this.currentTime=this.currentTime+(Pl.number(e)?e:this.config.seekTime)}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(Pl.number(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){Bc.toggle.call(this,e,!1)}},{key:"airplay",value:function(){nc.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=Vl(this.elements.container,this.config.classNames.hideControls),n=void 0===e?void 0:!e,i=Hl(this.elements.container,this.config.classNames.hideControls,n);if(i&&this.config.controls.includes("settings")&&!Pl.empty(this.config.settings)&&Fc.toggleMenu.call(this,!1),i!==t){var r=i?"controlshidden":"controlsshown";Nl.call(this,this.media,r)}return!i}return!1}},{key:"on",value:function(e,t){Ll.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){Ml.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){Il(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ready){var i=function(){document.body.style.overflow="",t.embed=null,n?(Object.keys(t.elements).length&&(Ul(t.elements.buttons.play),Ul(t.elements.captions),Ul(t.elements.controls),Ul(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),Pl.function(e)&&e()):(function(){this&&this.eventListeners&&(this.eventListeners.forEach(function(e){var t=e.element,n=e.type,i=e.callback,r=e.options;t.removeEventListener(n,i,r)}),this.eventListeners=[])}.call(t),ql(t.elements.original,t.elements.container),Nl.call(t,t.elements.original,"destroyed",!0),Pl.function(e)&&e.call(t.elements.original),t.ready=!1,setTimeout(function(){t.elements=null,t.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(eu.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&Pl.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}}},{key:"supports",value:function(e){return nc.mime.call(this,e)}},{key:"isHTML5",get:function(){return Boolean(this.provider===Wc.html5)}},{key:"isEmbed",get:function(){return Boolean(this.isYouTube||this.isVimeo)}},{key:"isYouTube",get:function(){return Boolean(this.provider===Wc.youtube)}},{key:"isVimeo",get:function(){return Boolean(this.provider===Wc.vimeo)}},{key:"isVideo",get:function(){return Boolean(this.type===Kc.video)}},{key:"isAudio",get:function(){return Boolean(this.type===Kc.audio)}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",set:function(e){if(this.duration){var t=Pl.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}},get:function(){return Number(this.media.currentTime)}},{key:"buffered",get:function(){var e=this.media.buffered;return Pl.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,n=Pl.number(t)&&t!==1/0?t:0;return e||n}},{key:"volume",set:function(e){var t=e;Pl.string(t)&&(t=Number(t)),Pl.number(t)||(t=this.storage.get("volume")),Pl.number(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!Pl.empty(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;Pl.boolean(t)||(t=this.storage.get("muted")),Pl.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}},{key:"speed",set:function(e){var t=null;Pl.number(e)&&(t=e),Pl.number(t)||(t=this.storage.get("speed")),Pl.number(t)||(t=this.config.speed.selected),t<.1&&(t=.1),t>2&&(t=2),this.config.speed.options.includes(t)?(this.config.speed.selected=t,this.media.playbackRate=t):this.debug.warn("Unsupported speed (".concat(t,")"))},get:function(){return Number(this.media.playbackRate)}},{key:"quality",set:function(e){var t=this.config.quality,n=this.options.quality;if(n.length){var i=[!Pl.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(Pl.number),r=!0;
38508if(!n.includes(i)){var a=function(e,t){return Pl.array(e)&&e.length?e.reduce(function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}):null}(n,i);this.debug.warn("Unsupported quality option: ".concat(i,", using ").concat(a," instead")),i=a,r=!1}t.selected=i,this.media.quality=i,r&&this.storage.set({quality:i})}},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=Pl.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return Boolean(this.media.loop)}},{key:"source",set:function(e){Tu.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"download",get:function(){var e=this.config.urls.download;return Pl.url(e)?e:this.source}},{key:"poster",set:function(e){this.isVideo?eu.setPoster.call(this,e,!1).catch(function(){}):this.debug.warn("Poster can only be set for video")},get:function(){return this.isVideo?this.media.getAttribute("poster"):null}},{key:"ratio",get:function(){var e=function(e){if(!Pl.array(e)||!e.every(Pl.number))return null;var t=Na(e,2),n=t[0],i=t[1],r=function e(t,n){return 0===n?t:e(n,t%n)}(n,i);return[n/r,i/r]}(rc.call(this));return Pl.array(e)?e.join(":"):e},set:function(e){this.isVideo?Pl.string(e)&&ic(e)?(this.config.ratio=e,ac.call(this)):this.debug.error("Invalid aspect ratio specified (".concat(e,")")):this.debug.warn("Aspect ratio can only be set for video")}},{key:"autoplay",set:function(e){var t=Pl.boolean(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return Boolean(this.config.autoplay)}},{key:"currentTrack",set:function(e){Bc.set.call(this,e,!1)},get:function(){var e=this.captions,t=e.toggled,n=e.currentTrack;return t?n:-1}},{key:"language",set:function(e){Bc.setLanguage.call(this,e,!1)},get:function(){return(Bc.getCurrentTrack.call(this)||{}).language}},{key:"pip",set:function(e){if(nc.pip){var t=Pl.boolean(e)?e:!this.pip;Pl.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Vc:zc),Pl.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}},get:function(){return nc.pip?Pl.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Vc:null}}],[{key:"supported",value:function(e,t,n){return nc.check(e,t,n)}},{key:"loadSprite",value:function(e,t){return Mc(e,t)}},{key:"setup",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;return Pl.string(t)?i=Array.from(document.querySelectorAll(t)):Pl.nodeList(t)?i=Array.from(t):Pl.array(t)&&(i=t.filter(Pl.element)),Pl.empty(i)?null:i.map(function(t){return new e(t,n)})}}]),e}();return Su.defaults=(wu=Hc,JSON.parse(JSON.stringify(wu))),Su}); 38509//# sourceMappingURL=plyr.polyfilled.min.js.map 38510 38511// Video block 38512$(function () { 38513 loadPlayer(); 38514 38515 function loadPlayer() { 38516 // Get all elements with the class 'video-wrapper' 38517 var videoWrappers = document.getElementsByClassName('video-wrapper'); 38518 38519 // If no video-wrapper elements are found, exit the function 38520 if (videoWrappers.length === 0) { 38521 return; 38522 } 38523 38524 // Configuration for the Plyr player 38525 var config = { 38526 displayDuration: true, 38527 invertTime: true, 38528 controls: ['play-large', 'play', 'progress', 'current-time', 'duration', 'mute', 'volume', 'fullscreen', 'captions', 'settings'], 38529 captions: { active: true, language: "auto", update: true }, 38530 settings: { active: true, update: true } 38531 }; 38532 38533 Array.from(videoWrappers).forEach(function (wrapper, index) { 38534 // Append a unique ID to each video-wrapper 38535 var videoId = 'video' + (index + 1); 38536 wrapper.id = videoId; 38537 38538 // Append a unique ID to the player element inside the wrapper 38539 var playerElement = wrapper.querySelector('#player'); 38540 if (playerElement) { 38541 var playerId = `player${index + 1}`; 38542 playerElement.id = playerId; 38543 38544 // Initialize Plyr for the current video-wrapper 38545 var player = new Plyr(`#${videoId} #${playerId}`, config); 38546 38547 // Set event listeners for the current player 38548 player.on('loadeddata', function (event) { 38549 player.currentTime = 0; 38550 }); 38551 38552 player.on('play', function (event) { 38553 var isFullscreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen; 38554 var isAndroid = navigator.userAgent.match(/android/i); 38555
38556 if (!isFullscreen && isAndroid) { 38557 player.fullscreen.enter(); 38558 } 38559 }); 38560 38561 // Get Video Duration 38562 var durationInterval = setInterval(function () { 38563 if (player && player.media && player.media.readyState > 0) { 38564 var minutes = Math.trunc((player.media.duration / 60) % 60, 10); 38565 minutes = '0' + minutes; 38566 var seconds = Math.trunc(player.media.duration % 60, 10); 38567 seconds = '0' + seconds; 38568 38569 wrapper.querySelector('.plyr__time--duration').innerText = minutes.slice(-2) + ":" + seconds.slice(-2); 38570 clearInterval(durationInterval); 38571 } 38572 }, 200); 38573 } else { 38574 console.error(`No #player element found in ${videoId}`); 38575 } 38576}); 38577 } 38578}); 38579 38580 38581/*! 38582 * Lightbox for Bootstrap 3 by @ashleydw 38583 * https://github.com/ashleydw/lightbox 38584 * 38585 * License: https://github.com/ashleydw/lightbox/blob/master/LICENSE 38586 */ 38587(function(){"use strict";var a,b;a=jQuery,b=function(b,c){var d,e,f;return this.options=a.extend({title:null,footer:null,remote:null},a.fn.ekkoLightbox.defaults,c||{}),this.$element=a(b),d="",this.modal_id=this.options.modal_id?this.options.modal_id:"ekkoLightbox-"+Math.floor(1e3*Math.random()+1),f='<div class="modal-header"'+(this.options.title||this.options.always_show_close?"":' style="display:none"')+'><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h4 class="modal-title">'+(this.options.title||" ")+"</h4></div>",e='<div class="modal-footer"'+(this.options.footer?"":' style="display:none"')+">"+this.options.footer+"</div>",a(document.body).append('<div id="'+this.modal_id+'" class="ekko-lightbox modal fade" tabindex="-1"><div class="modal-dialog"><div class="modal-content">'+f+'<div class="modal-body"><div class="ekko-lightbox-container"><div></div></div></div>'+e+"</div></div></div>"),this.modal=a("#"+this.modal_id),this.modal_dialog=this.modal.find(".modal-dialog").first(),this.modal_content=this.modal.find(".modal-content").first(),this.modal_body=this.modal.find(".modal-body").first(),this.modal_header=this.modal.find(".modal-header").first(),this.modal_footer=this.modal.find(".modal-footer").first(),this.lightbox_container=this.modal_body.find(".ekko-lightbox-container").first(),this.lightbox_body=this.lightbox_container.find(">
38587 div:first-child").first(),this.showLoading(),this.modal_arrows=null,this.border={top:parseFloat(this.modal_dialog.css("border-top-width"))+parseFloat(this.modal_content.css("border-top-width"))+parseFloat(this.modal_body.css("border-top-width")),right:parseFloat(this.modal_dialog.css("border-right-width"))+parseFloat(this.modal_content.css("border-right-width"))+parseFloat(this.modal_body.css("border-right-width")),bottom:parseFloat(this.modal_dialog.css("border-bottom-width"))+parseFloat(this.modal_content.css("border-bottom-width"))+parseFloat(this.modal_body.css("border-bottom-width")),left:parseFloat(this.modal_dialog.css("border-left-width"))+parseFloat(this.modal_content.css("border-left-width"))+parseFloat(this.modal_body.css("border-left-width"))},this.padding={top:parseFloat(this.modal_dialog.css("padding-top"))+parseFloat(this.modal_content.css("padding-top"))+parseFloat(this.modal_body.css("padding-top")),right:parseFloat(this.modal_dialog.css("padding-right"))+parseFloat(this.modal_content.css("padding-right"))+parseFloat(this.modal_body.css("padding-right")),bottom:parseFloat(this.modal_dialog.css("padding-bottom"))+parseFloat(this.modal_content.css("padding-bottom"))+parseFloat(this.modal_body.css("padding-bottom")),left:parseFloat(this.modal_dialog.css("padding-left"))+parseFloat(this.modal_content.css("padding-left"))+parseFloat(this.modal_body.css("padding-left"))},this.modal.on("show.bs.modal",this.options.onShow.bind(this)).on("shown.bs.modal",function(a){return function(){return a.modal_shown(),a.options.onShown.call(a)}}(this)).on("hide.bs.modal",this.options.onHide.bind(this)).on("hidden.bs.modal",function(b){return function(){return b.gallery&&a(document).off("keydown.ekkoLightbox"),b.modal.remove(),b.options.onHidden.call(b)}}(this)).modal("show",c),this.modal},b.prototype={modal_shown:function(){var b;return this.options.remote?(this.gallery=this.$element.data("gallery"),this.gallery&&("document.body"===this.options.gallery_parent_selector||""===this.options.gallery_parent_selector?this.gallery_items=a(document.body).find('*[data-gallery="'+this.gallery+'"]'):this.gallery_items=this.$element.parents(this.options.gallery_parent_selector).first().find('*[data-gallery="'+this.gallery+'"]'),this.gallery_index=this.gallery_items.index(this.$element),a(document).on("keydown.ekkoLightbox",this.navigate.bind(this)),this.options.directional_arrows&&this.gallery_items.length>1&&(this.lightbox_container.append('<div class="ekko-lightbox-nav-overlay"><a href="#" class="'+this.strip_stops(this.options.left_arrow_class)+'"></a><a href="#" class="'+this.strip_stops(this.options.right_arrow_class)+'"></a></div>'),this.modal_arrows=this.lightbox_container.find("div.ekko-lightbox-nav-overlay").first(),this.lightbox_container.find("a"+this.strip_spaces(this.options.left_arrow_class)).on("click",function(a){return function(b){return b.preventDefault(),a.navigate_left()}}(this)),this.lightbox_container.find("a"+this.strip_spaces(this.options.right_arrow_class)).on("click",function(a){return function(b){return b.preventDefault(),a.navigate_right()}}(this)))),this.options.type?"image"===this.options.type?this.preloadImage(this.options.remote,!0):"youtube"===this.options.type&&(b=this.getYoutubeId(this.options.remote))?this.showYoutubeVideo(b):"vimeo"===this.options.type?this.showVimeoVideo(this.options.remote):"instagram"===this.options.type?this.showInstagramVideo(this.options.remote):"url"===this.options.type?this.loadRemoteContent(this.options.remote):"video"===this.options.type?this.showVideoIframe(this.options.remote):this.error('Could not detect remote target type. Force the type using data-type="image|youtube|vimeo|instagram|url|video"'):this.detectRemoteType(this.options.remote)):this.error("No remote target given")},strip_stops:function(a){return a.replace(/\./g,"")},strip_spaces:function(a){return a.replace(/\s/g,"")},isImage:function(a){return a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSwf:function(a){return a.match(/\.(swf)((\?|#).*)?$/i)},getYoutubeId:function(a){var b;return b=a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/),b&&11===b[2].length?b[2]:!1},getVimeoId:function(a){return a.indexOf("vimeo")>0?a:!1},getInstagramId:function(a){return a.indexOf("instagram")>0?a:!1}
vendor: 4,525 bytes, line 38587
38587,navigate:function(a){if(a=a||window.event,39===a.keyCode||37===a.keyCode){if(39===a.keyCode)return this.navigate_right();if(37===a.keyCode)return this.navigate_left()}},navigateTo:function(b){var c,d;return 0>b||b>this.gallery_items.length-1?this:(this.showLoading(),this.gallery_index=b,this.$element=a(this.gallery_items.get(this.gallery_index)),this.updateTitleAndFooter(),d=this.$element.attr("data-remote")||this.$element.attr("href"),this.detectRemoteType(d,this.$element.attr("data-type")||!1),this.gallery_index+1<this.gallery_items.length&&(c=a(this.gallery_items.get(this.gallery_index+1),!1),d=c.attr("data-remote")||c.attr("href"),"image"===c.attr("data-type")||this.isImage(d))?this.preloadImage(d,!1):void 0)},navigate_left:function(){return 1!==this.gallery_items.length?(0===this.gallery_index?this.gallery_index=this.gallery_items.length-1:this.gallery_index--,this.options.onNavigate.call(this,"left",this.gallery_index),this.navigateTo(this.gallery_index)):void 0},navigate_right:function(){return 1!==this.gallery_items.length?(this.gallery_index===this.gallery_items.length-1?this.gallery_index=0:this.gallery_index++,this.options.onNavigate.call(this,"right",this.gallery_index),this.navigateTo(this.gallery_index)):void 0},detectRemoteType:function(a,b){var c;return b=b||!1,"image"===b||this.isImage(a)?(this.options.type="image",this.preloadImage(a,!0)):"youtube"===b||(c=this.getYoutubeId(a))?(this.options.type="youtube",this.showYoutubeVideo(c)):"vimeo"===b||(c=this.getVimeoId(a))?(this.options.type="vimeo",this.showVimeoVideo(c)):"instagram"===b||(c=this.getInstagramId(a))?(this.options.type="instagram",this.showInstagramVideo(c)):"video"===b?(this.options.type="video",this.showVideoIframe(c)):(this.options.type="url",this.loadRemoteContent(a))},updateTitleAndFooter:function(){var a,b,c,d;return c=this.modal_content.find(".modal-header"),b=this.modal_content.find(".modal-footer"),d=this.$element.data("title")||"",a=this.$element.data("footer")||"",d||this.options.always_show_close?c.css("display","").find(".modal-title").html(d||" "):c.css("display","none"),a?b.css("display","").html(a):b.css("display","none"),this},showLoading:function(){return this.lightbox_body.html('<div class="modal-loading">'+this.options.loadingMessage+"</div>"),this},showYoutubeVideo:function(a){var b,c,d;return c=null!=this.$element.attr("data-norelated")||this.options.no_related?"&rel=0":"",d=this.checkDimensions(this.$element.data("width")||560),b=d/(560/315),this.showVideoIframe("//www.youtube.com/embed/"+a+"?badge=0&autoplay=1&html5=1"+c,d,b)},showVimeoVideo:function(a){var b,c;return c=this.checkDimensions(this.$element.data("width")||560),b=c/(500/281),this.showVideoIframe(a+"?autoplay=1",c,b)},showInstagramVideo:function(a){var b,c;return c=this.checkDimensions(this.$element.data("width")||612),this.resize(c),b=c+80,this.lightbox_body.html('<iframe width="'+c+'" height="'+b+'" src="'+this.addTrailingSlash(a)+'embed/" frameborder="0" allowfullscreen></iframe>'),this.options.onContentLoaded.call(this),this.modal_arrows?this.modal_arrows.css("display","none"):void 0},showVideoIframe:function(a,b,c){return c=c||b,this.resize(b),this.lightbox_body.html('<div class="embed-responsive embed-responsive-16by9"><iframe width="'+b+'" height="'+c+'" src="'+a+'" frameborder="0" allowfullscreen class="embed-responsive-item"></iframe></div>'),this.options.onContentLoaded.call(this),this.modal_arrows&&this.modal_arrows.css("display","none"),this},loadRemoteContent:function(b){var c,d;return d=this.$element.data("width")||560,this.resize(d),c=this.$element.data("disableExternalCheck")||!1,c||this.isExternal(b)?(this.lightbox_body.html('<iframe width="'+d+'" height="'+d+'" src="'+b+'" frameborder="0" allowfullscreen></iframe>'),this.options.onContentLoaded.call(this)):this.lightbox_body.load(b,a.proxy(function(a){return function(){return a.$element.trigger("loaded.bs.modal")}}(this))),this.modal_arrows&&this.modal_arrows.css("display","none"),this},isExternal:function(a){var b;return b=a.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/),"string"==typeof b[1]&&b[1].length>0&&b[1].toLowerCase()!==location.protocol?!0:"string"==typeof b[2]&&b[2].length>0&&b[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host?!0:!1},error:function(a){return this.lightbox_body.html(a),this},preloadImage:function(b,c){var d;return d=new Image,(null==c||c===!0)&&(d.onload=function(b){return function(){var c;return c=a("<img />
38587"),c.attr("src",d.src),c.addClass("img-responsive"),b.lightbox_body.html(c),b.modal_arrows&&b.modal_arrows.css("display","block"),c.load(function(){return b.options.scale_height?b.scaleHeight(d.height,d.width):b.resize(d.width),b.options.onContentLoaded.call(b)})}}(this),d.onerror=function(a){return function(){return a.error("Failed to load image: "+b)}}(this)),d.src=b,d},scaleHeight:function(b,c){var d,e,f,g,h,i;return g=this.modal_header.outerHeight(!0)||0,f=this.modal_footer.outerHeight(!0)||0,this.modal_footer.is(":visible")||(f=0),this.modal_header.is(":visible")||(g=0),d=this.border.top+this.border.bottom+this.padding.top+this.padding.bottom,h=parseFloat(this.modal_dialog.css("margin-top"))+parseFloat(this.modal_dialog.css("margin-bottom")),i=a(window).height()-d-h-g-f,e=Math.min(i/b,1),this.modal_dialog.css("height","auto").css("max-height",i),this.resize(e*c)},resize:function(b){var c;return c=b+this.border.left+this.padding.left+this.padding.right+this.border.right,this.modal_dialog.css("width","auto").css("max-width",c),this.lightbox_container.find("a").css("line-height",function(){return a(this).parent().height()+"px"}),this},checkDimensions:function(a){var b,c;return c=a+this.border.left+this.padding.left+this.padding.right+this.border.right,b=document.body.clientWidth,c>b&&(a=this.modal_body.width()),a},close:function(){return this.modal.modal("hide")},addTrailingSlash:function(a){return"/"!==a.substr(-1)&&(a+="/"),a}},a.fn.ekkoLightbox=function(c){return this.each(function(){var d;return d=a(this),c=a.extend({remote:d.attr("data-remote")||d.attr("href"),gallery_parent_selector:d.attr("data-parent"),type:d.attr("data-type")},c,d.data()),new b(this,c),this})},a.fn.ekkoLightbox.defaults={gallery_parent_selector:"document.body",left_arrow_class:".glyphicon .glyphicon-chevron-left",right_arrow_class:".glyphicon .glyphicon-chevron-right",directional_arrows:!0,type:null,always_show_close:!0,no_related:!1,scale_height:!0,loadingMessage:"Loading...",onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}}}).call(this); 38588 38589/*$(document).ready(function ($) { 38590 38591 // delegate calls to data-toggle="lightbox" 38592 $(document).delegate('*[data-toggle="lightbox"]:not([data-gallery="navigateTo"])', 'click', function(event) { 38593 event.preventDefault(); 38594 return $(this).ekkoLightbox({ 38595 }); 38596 }); 38597 38598 });*/ 38599$(function () { 38600 $(document).undelegate('*[data-toggle="lightbox"]:not([data-gallery="navigateTo"])', 'click'); 38601 $(document).delegate('*[data-toggle="lightbox"]:not([data-gallery="navigateTo"])', 'click', function (event) { 38602 38603 event.preventDefault(); 38604 $(this).parent().append('<div id="hero-video-modal"><!-- Video Modal --><div class="modal videoModal modal videomodalforvideopopup videomodalforvideopopupgallery" id="videoModal" tabindex="-1" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body"><div class="embed-responsive embed-responsive-16by9" id="heroIframeVideo"></div></div></div></div></div></div>'); 38605 38606 var href = $(this).attr("href"); 38607 event.preventDefault(); 38608 var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/; 38609 var match = href.match(regExp); 38610 38611 if (match && match[2].length) { 38612 $(this).ekkoLightbox({}); 38613 $('.ekko-lightbox') 38614 .addClass('videoGalleryVideoModal') 38615 .children('.modal-dialog') 38616 .addClass('modal-dialog-centered') 38617 .before('<span class="modal-close" data-dismiss="modal">✕</span>'); 38618 } 38619 else if (href) { 38620 $(".videomodalforvideopopupgallery").show(); 38621 var FinalYoutubURL; 38622 FinalYoutubURL = $(this).attr("href"); 38623 var bodyEl = $('body'), 38624 htmlEl = $('html'); 38625 38626 var modalHtml = ' <div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body"><div class="embed-responsive embed-responsive-16by9" id="heroIframeVideo"><video controls autoplay controlslist="nodownload"><source src="' + FinalYoutubURL + '" type="video/mp4" /></video> </div> </div> </div> </div> </div>'; 38627 38628 $(".videomodalforvideopopupgallery").html(modalHtml); 38629 38630 bodyEl.find('.close').on("click", function () { $('video').get(0).pause(); $(".modal").hide(); $(".videomodalforvideopopupgallery").remove(); }); 38631 } 38632 else { 38633 return 'error'; 38634 } 38635 videoCaptions($(this).data('content-path')); 38636 }); 38637}); 38638 38639function playVideo(e) { 38640 const parentId = e.currentTarget.className; 38641 if ($($(e.currentTarget).find('video'))[0].paused && !$(e.currentTarget).find('img').hasClass("hide")) { 38642 $($(e.currentTarget).find('video'))[0].play();if($(e.currentTarget).children().length == 2){ 38643 $($(e.currentTarget).find('img')).addClass("hide");} 38644 $($(e.currentTarget).find('video'))[0].controls = true; 38645 } 38646} 38647 38648$(".carousel-rectangle .video-wrapper").on("click",function(){ 38649 38650 if ($(this).find("video")[0].paused && !$(this).find(".video__preview-play").hasClass('hide')) { 38651 $(this).find("video")[0].play(); 38652 $(this).find(".video__preview-play").addClass('hide'); 38653 $(this).find("video")[0].controls = true; 38654 } 38655}); 38656//Video Stats 38657function VideoStats(element){ 38658 38659 this.videoCont = document.getElementById('test'); 38660 this.videoEl = document.getElementById('vsPlayer'); 38661 window.video = this.videoEl; 38662 38663 //Video path management 38664 this.windowResize(); 38665 38666 //Scroll control 38667 this.controller = new ScrollMagic.Controller(); 38668 this.scene = new ScrollMagic.Scene({triggerElement: this.videoEl}); 38669 this.scene.on("start", function (e) { 38670 var isPlaying = this.videoEl.currentTime > 0 && !this.videoEl.paused && !this.videoEl.ended && this.videoEl.readyState > 2; 38671 if (!isPlaying) { 38672 setTimeout(function () { 38673 this.videoEl.play(); 38674 }.bind(this), 150); 38675 } 38676 this.videoEl.addEventListener("timeupdate", function () { 38677 var duration = Math.trunc(this.videoEl.duration % 60, 10); 38678 if (Math.round(this.videoEl.currentTime) === (duration - 1)) { 38679 this.videoEl.pause(); 38680 } 38681 }.bind(this)); 38682 38683 }.bind(this)).addTo(this.controller); 38684 38685 window.addEventListener("orientationchange", function() { 38686 this.windowResize(); 38687 }.bind(this)); 38688 38689} 38690VideoStats.prototype.windowResize = function (){ 38691 // var windowW = $(window).width(); 38692 var windowH = $(window).height(); 38693 var windowW = $(window).width(); 38694 38695 var scourceDesk = $('.dupont-videogallery .d-xl-flex').attr('data-deskvideo'); 38696 var scourceMob = $('.dupont-videogallery .d-xl-flex').attr('data-mobvideo'); 38697 38698 38699 if(windowW >= windowH){ 38700 this.videoEl.src = scourceDesk; 38701 this.videoEl.load(); 38702 }else{ 38703 this.videoEl.src = scourceMob; 38704 this.videoEl.load(); 38705 } 38706 this.videoCont.style.display = 'none'; 38707 this.videoCont.style.display = 'block'; 38708 this.videoEl.load(); 38709}; 38710$(function() { 38711 $(".component-video-stat").each(function () { 38712 new VideoStats($(this)); 38713 }); 38714}); 38715$(document).ready(function () { 38716 $('.video_carouselmodal').each(function(key,item) { 38717 var sildercarousal='slider'+key; 38718 this.id=sildercarousal;
38719 var sliderid='#'+sildercarousal; 38720 38721var gallerylength = $(sliderid).find(".carousel-rectangle").length; 38722//console.log($(window).width()); 38723var desktop_video = 3 38724if ($(window).width() < 992) { 38725 if (gallerylength >= 3) { 38726 desktop_video = 1; 38727 } 38728} 38729if (gallerylength > desktop_video) { 38730 $('.video_carouselmodal').addClass('slider-carousel'); 38731 $(sliderid).find(".prev-CMslider").removeClass("slick-hidden"); 38732 $(sliderid).find(".next-CMslider").removeClass("slick-hidden"); 38733 $(sliderid).slick({ 38734 slidesToShow: 3, 38735 slidesToScroll: 3, 38736 dots: false, 38737 infinite: false, 38738 autoplay: false, 38739 autoplaySpeed: 2000, 38740 prevArrow: $(sliderid).closest('.dupont-videogallery').find(".prev-CMslider"), 38741 nextArrow: $(sliderid).closest('.dupont-videogallery').find(".next-CMslider"), 38742 responsive: [{ 38743 breakpoint: 1200, 38744 settings: { 38745 slidesToShow: 3.1, 38746 slidesToScroll: 3 38747 } 38748 }, 38749 { 38750 breakpoint: 992, 38751 settings: { 38752 slidesToShow: 2.1, 38753 slidesToScroll: 2 38754 } 38755 }, 38756 { 38757 breakpoint: 768, 38758 settings: { 38759 slidesToShow: 1.1, 38760 slidesToScroll: 1 38761 } 38762 }, 38763 { 38764 breakpoint: 600, 38765 settings: { 38766 slidesToShow: 1, 38767 slidesToScroll: 1 38768 } 38769 }, 38770 { 38771 breakpoint: 479, 38772 settings: { 38773 slidesToShow: 1, 38774 slidesToScroll: 1 38775 } 38776 } 38777 38778 38779 ] 38780 }); 38781} else if (gallerylength <= 2 && $(window).width() < 992) { 38782 $('.video_carouselmodal').addClass('slider-carousel'); 38783 $(sliderid).find(".prev-CMslider").removeClass("slick-hidden"); 38784 $(sliderid).find(".next-CMslider").removeClass("slick-hidden"); 38785 $(sliderid).slick({ 38786 slidesToShow: 2, 38787 slidesToScroll: 2, 38788 dots: false, 38789 infinite: false, 38790 autoplay: false, 38791 autoplaySpeed: 2000, 38792 prevArrow: $(sliderid).closest('.dupont-videogallery').find(".prev-CMslider"), 38793 nextArrow: $(sliderid).closest('.dupont-videogallery').find(".next-CMslider"), 38794 responsive: [{ 38795 breakpoint: 1200, 38796 settings: { 38797 slidesToShow: 2.1, 38798 slidesToScroll: 2 38799 } 38800 }, 38801 { 38802 breakpoint: 992, 38803 settings: { 38804 slidesToShow: 1.1, 38805 slidesToScroll: 1 38806 } 38807 }, 38808 { 38809 breakpoint: 768, 38810 settings: { 38811 slidesToShow: 1.1, 38812 slidesToScroll: 1 38813 } 38814 }, 38815 { 38816 breakpoint: 600, 38817 settings: { 38818 slidesToShow: 1, 38819 slidesToScroll: 1 38820 } 38821 }, 38822 { 38823 breakpoint: 479, 38824 settings: { 38825 slidesToShow: 1, 38826 slidesToScroll: 1 38827 } 38828 } 38829 38830 38831 ] 38832 }); 38833} else { 38834 $('.carousel-rectangle').css('width', '300px'); 38835$(this).closest('.dupont-videogallery').find('.prev-CMslider, .next-CMslider').hide(); 38836 } 38837/*open video in popup*/ 38838$('.video_carouselmodal .carousel-rectangle').click(function () { 38839 38840 var videopath = $(this).html(); 38841 // console.log(videopath); 38842 38843 $('#video-myModal .modal-body').html(videopath); 38844 $('#video-myModal .modal-body video').removeAttr("height"); 38845}); 38846 38847}); 38848}); 38849 38850 38851 38852 38853 38854 38855 38856 38857 38858 38859 38860 38861$(document).ready(function () { 38862 38863 var videoView = function (cl) { 38864 this.el = $($('.' + cl)[0]); 38865 }; 38866 38867 videoView.prototype.setVideo = function (){ 38868 38869 var gs_video_root_classObj = this.el; 38870 var gs_video_root_class=".gs-video-view"; 38871 38872 var v_video_type=$('#video-src',gs_video_root_classObj).data('type'); 38873 if(v_video_type=="youtube"){ 38874 $('.playpause', gs_video_root_classObj ).attr('data-target','#videoModal-iframe'); 38875 } 38876 38877 38878 $(".video-wrapper .playpause", gs_video_root_classObj).click(function(e){ 38879 e.preventDefault(); 38880 var playicon_obj = $(this); 38881 var v_src = playicon_obj.siblings("video").attr("src"); 38882 let v_videoPath = $(this).siblings("video").data("content-path"); 38883 38884 $('#videoModal', gs_video_root_class).on('show.bs.modal', function () { 38885 $('#video1', gs_video_root_class).data('content-path',v_videoPath); 38886 $('#video1',gs_video_root_class).attr("src",v_src); 38887 $('#video1', gs_video_root_class)[0].play(); 38888 38889 }); 38890 $('#videoModal', gs_video_root_class).on('hide.bs.modal', function () { 38891 $('#video1', gs_video_root_class)[0].pause(); 38892 $('#video1', gs_video_root_class).attr("src","#"); 38893 $('#video1', gs_video_root_class).removeData('content-path'); 38894 }); 38895 38896 $('#videoModal-iframe', gs_video_root_class).on('show.bs.modal', function () { 38897 var v_autoply_src = v_src + "?autoplay=1"; 38898 $('#ifr-video',gs_video_root_class).first().attr("src",v_autoply_src); 38899 }); 38900 $('#videoModal-iframe', gs_video_root_class).on('hide.bs.modal', function () { 38901 $('#ifr-video',gs_video_root_class).attr("src","#"); 38902 }); 38903 38904 38905 }); 38906 38907 }; 38908 38909 $.each($('.gs-video-view'), function (i, v) { 38910 $(v).addClass("gsv-" + i); 38911 (new videoView("gsv-" + i)).setVideo(); 38912 38913 }); 38914 38915 38916}); 38917 38918//Component Code 38919$(function(){ 38920 function calcMargin(n) { 38921 return (100 / n / 2) - 3; 38922 } 38923 var margin = calcMargin($('.carousel-youtube-video').length); 38924 function setVideoPlayButton() { 38925 $('.pbs-container-wapper .carousel-youtube-video').each(function () { 38926 var $topRow = $(this).closest('.top-half'); 38927 var width = $topRow.width() / 2 - 50; 38928 var height = $topRow.height() / 2 - 25; 38929 /* $(this).css({ 38930 'margin-left':width+'px', 38931 'top':height+'px' 38932 });*/ 38933 }); 38934 } 38935 $(window).resize(function () { 38936 setTimeout(function () { setVideoPlayButton(); }, 100); 38937 setTimeout(function () { setVideoPlayButton(); }, 700); 38938 setTimeout(function () { setVideoPlayButton(); }, 1500); 38939 }); 38940 setTimeout(function () { setVideoPlayButton(); }, 250); 38941 setTimeout(function () { setVideoPlayButton(); }, 1500); 38942 38943}); 38944 38945$(function () {
38946 function openVideoDialog(element, event, anchor){ 38947 event.preventDefault(); 38948 var href = $(element).siblings(".videocarouselhref").data("href"); 38949 var videoPath = $(element).siblings(".videocarouselhref").data("content-path"); 38950 var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/; 38951 var match = href.match(regExp); 38952 if (match && match[2].length) { 38953 if(!anchor){ 38954 $(element).siblings('a[data-toggle="lightbox-building-carousel"]').attr("href", href); 38955 $(element).siblings('a[data-toggle="lightbox-building-carousel"]').ekkoLightbox({}); 38956 }else{ 38957 $(element).attr("href", href); 38958 $(element).ekkoLightbox({}); 38959 } 38960 $('.ekko-lightbox') 38961 .addClass('heroImageWithVideoModal') 38962 .children('.modal-dialog') 38963 .addClass('modal-dialog-centered') 38964 .before('<span class="modal-close" data-dismiss="modal">✕</span>'); 38965 if(!anchor){ 38966 $(element).siblings('a[data-toggle="lightbox-building-carousel"]').removeAttr("href", href); 38967 }else{ 38968 $(element).removeAttr("href", href); 38969 } 38970 } else if(href){ 38971 $($(".videocarousel ")[0]).parent().append('<div id="hero-video-modal" class="videocarousel_modal" style="width:60%"><!-- Video Modal --><div class="modal videoModal modal videomodalforvideopopup videomodalforvideopopupgallery" id="videoModal" tabindex="-1" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body"><div class="embed-responsive embed-responsive-16by9" id="heroIframeVideo"></div></div></div></div></div></div>'); 38972 $(".videomodalforvideopopupgallery").show(); 38973 var FinalYoutubURL = href; 38974 var bodyEl = $('body'), 38975 htmlEl = $('html'); 38976 38977 var modalHtml = '<div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body"><div class="embed-responsive embed-responsive-16by9" id="heroIframeVideo"><video controls autoplay><source src="' + FinalYoutubURL + '" type="video/mp4" /></video> </div> </div> </div> </div> </div>'; 38978 $(".videomodalforvideopopupgallery").html(modalHtml); 38979 videoCaptions(videoPath); 38980 bodyEl.find('.close').on("click", function () { $('video').get(0).pause(); $(".modal").hide(); $(".videocarousel_modal").remove(); }); 38981 }else { 38982 return 'error'; 38983 } 38984 } 38985 38986 $(document).delegate('.video-carousel img', 'click', function (event) { 38987 openVideoDialog(this, event); 38988 }); 38989 $(document).delegate('.video-carousel a[data-toggle="lightbox-building-carousel"]', 'click', function (event) { 38990 openVideoDialog(this, event, true); 38991 }); 38992}); 38993 38994$(function(){ 38995 $('.pbs-container-wapper .featured-carousel-slick').on("afterChange", function (event, slick, currentSlide) { 38996 var total = (window.innerWidth >= 960) ? ($(".featured-carousel-slick .slick-slide").length - 1) : $(".featured-carousel-slick .slick-slide").length; 38997 $(".c-prev").toggleClass('hide', currentSlide === 0); 38998 $(".c-next").toggleClass('hide', currentSlide === total - 1); 38999 }); 39000 39001 $.each($('.video-carousel'), function(i,v){ 39002 var videoItems = $(v).find('.dynamicVideoCarousel'); 39003 $.each(videoItems, function(x,y){ 39004 var thumbnailPath = $(y).find('.video-thumbnail').attr('src'); 39005 var href = $(y).find('.videocarouselhref').attr('data-href'); 39006 if(!thumbnailPath){ 39007 $(y).find('.video-thumbnail').attr('src',href+"/_jcr_content/renditions/cq5dam.thumbnail.319.319.png"); 39008 } 39009 }) 39010 }); 39011 39012 39013 39014}); 39015 39016$(document).ready(function(){ 39017 var tempObj={}; 39018 var dynamicHtml = ""; 39019 digitalData.user = {}; 39020 digitalData.user.email=''; 39021 39022 if($('#userMobileIcon').length != 0){ 39023 var iconPath = $('#userMobileIcon').attr('data-icon-path'); 39024 var activeIconPath = $('#userMobileIcon').attr('data-active-icon-path'); 39025 var htmlTemp = '<a href="javascript:void(0);" id="profileNavTrigger"><img src="'+iconPath+'" class="non_login_user"/><img src="'+activeIconPath+'" class="login_user" style="display:none"/></a><div class="profileClose open" id="profileClose"><span></span><span></span><span></span></div><ul id="profNavHolder"></ul>'; 39026 $('#userMobileIcon').html(htmlTemp); 39027 } 39028 39029 var currespath = $('.useravtarcurpage').data('res-path'); 39030 39031 39032 $.ajax({ 39033 type: "GET", 39034 url: "/dupont/userService", 39035 data: {"currentrespath":currespath}, 39036 dataType: "json", 39037 cache:false, 39038 contentType: "application/json", 39039 success: function (data) { 39040 tempObj = data; 39041 generateUserDropDown(); 39042 }, 39043 error: function (data) { 39044 console.log(data); 39045 } 39046 39047 }); 39048 39049 39050 39051 39052 function generateUserDropDown(){ 39053 if(tempObj != undefined && tempObj != '' && tempObj != null){ 39054 if(tempObj.anonymousUser == false){ 39055 39056 digitalData.user.email=tempObj.userInfo.userName; 39057 // _satellite.track("User_Login"); 39058 39059 //hide/show profile active icon 39060 $('.non_login_user').hide(); 39061 $('.login_user').show(); 39062 39063 localStorage.setItem('userName',tempObj.userInfo.userName); 39064 dynamicHtml += "<li>"+tempObj.userInfo.greet+" "+tempObj.userInfo.firstName+"</li>" 39065 39066 //checking if permission sets are not 0 39067 if(tempObj.userInfo.PermissionSets != undefined && tempObj.userInfo.PermissionSets.length != 0){ 39068 dynamicHtml += "<li><ul class='businessUnitList'>"; 39069 var permissionSets = tempObj.userInfo.PermissionSets; 39070 for(var i=0; i< permissionSets.length; i++){ 39071 if(permissionSets[i].buURL != undefined && permissionSets[i].buURL != '' && permissionSets[i].buURL != null){ 39072 dynamicHtml += "<li><a href='"+ permissionSets[i].buURL +"' target='_blank'><span class='letterBadge'>"+ permissionSets[i].buName.charAt(0).toUpperCase() +"</span> "+ permissionSets[i].buName +"</a></li>" 39073 }else{ 39074 dynamicHtml += "<li class='greyout'><a><span class='letterBadge'>"+ permissionSets[i].buName.charAt(0).toUpperCase() +"</span> "+ permissionSets[i].buName +"</a></li>" 39075 } 39076 } 39077 dynamicHtml += "</ul></li>"; 39078 } 39079 39080 //Checking of user menu list and showing with links 39081 if(tempObj.userInfo.userMenuList != undefined && tempObj.userInfo.userMenuList.length != 0){ 39082 var userMenuList= tempObj.userInfo.userMenuList; 39083 for(var j=0; j< userMenuList.length; j++){ 39084 if(userMenuList[j].signout == true && userMenuList[j].signout != undefined){ 39085 dynamicHtml += "<li id='signOutAnchor' data-signOuturl='"+userMenuList[j].menuURL+"'><a href='javascript:void(0)'>"+ userMenuList[j].menuTitle +"</a></li>" 39086 }else if(userMenuList[j].menuURL != undefined || userMenuList[j].menuTitle != undefined ){ 39087 39088 dynamicHtml += "<li><a data-analytics='link_track' href='"+ userMenuList[j].menuURL +"'>"+ userMenuList[j].menuTitle +"</a></li>" 39089 } 39090 } 39091 } 39092 } 39093 else{ 39094 //hide/show profile active icon 39095 $('.login_user').hide(); 39096 $('.non_login_user').show(); 39097 digitalData.user.email=''; 39098 // _satellite.track("User_Login"); 39099 39100 //Checking of user menu list and showing with links 39101 if(tempObj.anonymousInfo.userMenuList.length != 0){ 39102 var userMenuList= tempObj.anonymousInfo.userMenuList; 39103 var buParam = uAGetParam('BU'); 39104 for(var j=0; j< userMenuList.length; j++){ 39105 if(userMenuList[j].menuURL.toLowerCase().indexOf('signup.html') >-1 && buParam!=''){ 39106 userMenuList[j].menuURL = userMenuList[j].menuURL+'?BU='+buParam; 39107 } 39108 else if(userMenuList[j].menuURL.toLowerCase().indexOf('signin.html') >-1 ){ 39109 userMenuList[j].menuURL = userMenuList[j].menuURL +'#ret-page-url='+encodeURIComponent(window.location.href); 39110 } 39111 dynamicHtml += "<li><a data-analytics='link_track' href='"+ userMenuList[j].menuURL +"'>"+ userMenuList[j].menuTitle +"</a></li>" 39112 } 39113 } 39114 } 39115 } 39116 39117 39118 /*To get URL parameter value*/ 39119 function uAGetParam(param) { 39120 if(window.location.href.indexOf("delrin.com") > -1) 39121 { 39122 var paramVal ='delrin'; 39123 39124 return paramVal ; 39125 } 39126 else{ 39127 var url_string = window.location.href; //window.location.href 39128 var url = new URL(url_string); 39129 var paramVal = url.searchParams.get(param); 39130 paramVal = (paramVal!=null && paramVal!=undefined) ? paramVal : '' ; 39131 return paramVal ; 39132 } 39133 }; 39134 39135 if($('#userDropDown').length != 0){ 39136 $('#userDropDown').append(dynamicHtml); 39137 } 39138 39139 $('#profNavHolder').html(dynamicHtml); 39140 $('.businessUnitList a').click(function(){ 39141 var BUlabel =$(this).text().slice(2); 39142 var BUlink = $(this).attr('href'); 39143 var webVisitorId = _satellite.getVisitorId().getMarketingCloudVisitorID(); 39144 39145 var formname = 'engagement-submit'; 39146 //var formid = 'form2312'; 39147 //var formaction = 'https://s911788392.t.eloqua.com/e/ 39148 var formId, orgId; 39149 var munchkinId = digitalData?.page?.munchkinId; 39150 switch(munchkinId){ 39151 case "943-AHN-852": 39152 formId = 1001; 39153 orgId = "WS"; 39154 break; 39155 case "711-AML-956": 39156 orgId = "EC"; 39157 formId = 1001; 39158 break; 39159 case "508-SJA-205": 39160 orgId = "MS"; 39161 formId = 1014; 39162 break; 39163 default: 39164 formId = 1001; 39165 orgId = "WS"; 39166 break; 39167 } 39168 var formaction = _satellite.getVar('Marketo : Submit Form URL')+'?orgId='+orgId; 39169 var formmethod = 'POST'; 39170 var formenctype = 'multipart/form-data'; 39171 $(function() { 39172 var form = document.createElement('form'); 39173 form.name = formname; 39174 form.id = formId; 39175 form.action = formaction; 39176 form.method = formmethod; 39177 form.enctype = formenctype; 39178 form.classList.add('contactus-form'); 39179 /*{name: 'elqSiteID', value: '911788392'}, 39180 {name: 'elqFormName', value: formname},*/ 39181 var engmntFormValues = [ 39182 {name: 'webVisitorID', value: webVisitorId}, 39183 {name: 'engagementName', value: BUlabel}, 39184 {name: 'engagementURL', value: BUlink}, 39185 {name: 'emailAddress', value: digitalData.user.email}, 39186 {name: 'engagementType', value: 'Sign-in'}, 39187 {name: 'formId', value: formId} 39188 ] 39189
39190 engmntFormValues.forEach(function(inputAttrs){ 39191 var input = document.createElement('input'); 39192 input.name = inputAttrs.name; input.setAttribute('value', inputAttrs.value); 39193 form.appendChild(input) 39194 }) 39195 if(digitalData.user.email){ 39196 $.ajax({ 39197 url: form.action, 39198 type: form.method, 39199 data: $(form).serialize(), 39200 success: function(data) { 39201 console.log('eloqua analytics sent for Sign-in Activity') 39202 } 39203 }); 39204 } 39205 }) 39206 39207 39208 }); 39209 } 39210 39211 //user profile mobile navigation 39212 39213 $('#profileNavTrigger').click(function(){ 39214 $('#profNavHolder').show(); 39215 $('.hamburger').hide(); 39216 $('.profileClose').show(); 39217 $('#profileNavTrigger').hide(); 39218 }); 39219 39220 $('#profileClose').click(function(){ 39221 $('#profNavHolder').hide(); 39222 $('.hamburger').show(); 39223 $('.profileClose').hide(); 39224 $('#profileNavTrigger').show(); 39225 }); 39226 39227 39228 //Logout confirmation pop html cloining 39229 if($('#temoPopHolder').length != 0){ 39230 var signPopHTML = $('#temoPopHolder').html(); 39231 $('#temoPopHolder').remove();; 39232 $('body').append(signPopHTML); 39233 } 39234 39235 //shwing confirmation pop 39236 $(document).on('click','#signOutAnchor a',function(){ 39237 $('#signOutPop').show(); 39238 $('html').addClass('modal-open'); 39239 }); 39240 39241 //hiding pop confirmation 39242 $('#signOutpopCancel').click(function(){ 39243 $('#signOutPop').hide(); 39244 $('html').removeClass('modal-open'); 39245 }); 39246 39247 //logout function call 39248 39249 $('#signOutpopSignout').click(function(){ 39250 var signoutUrl = $('#signOutAnchor').attr('data-signOuturl'); 39251 if(signoutUrl != '' && signoutUrl != undefined && signoutUrl != null){ 39252 const domain = (window.location.href.toLowerCase().indexOf('pp') > -1) ? "https://www.pp.dupont.com": "https://www.dupont.com"; 39253 window.location.href = domain+"?signoutclicked&signouturl="+encodeURIComponent(window.location.origin+signoutUrl)+"&currpageurl="+encodeURIComponent(window.location.href); 39254 } 39255 39256 }); 39257 39258}); 39259 39260 39261$(document).scroll(function() { 39262 var y = $(this).scrollTop(); 39263 if (y > 1000) { 39264 $('.fixed-scroll').fadeIn(); 39265 } else { 39266 $('.fixed-scroll').fadeOut(); 39267 } 39268}); 39269/*! 39270 * ,/ 39271 * ,'/ 39272 * ,' / 39273 * ,' /_____, 39274 * .'____ ,' 39275 * / ,' 39276 * / ,' 39277 * /,' 39278 * /' 39279 * 39280 * Selectric Ï v1.13.0 (Aug 22 2017) - http://lcdsantos.github.io/jQuery-Selectric/ 39281 * 39282 * Copyright (c) 2017 Leonardo Santos; MIT License 39283 * 39284 */ 39285 39286(function(factory) { 39287 /* global define */ 39288 /* istanbul ignore next */ 39289 if ( typeof define === 'function' && define.amd ) { 39290 define(['jquery'], factory); 39291 } else if ( typeof module === 'object' && module.exports ) { 39292 // Node/CommonJS 39293 module.exports = function( root, jQuery ) { 39294 if ( jQuery === undefined ) { 39295 if ( typeof window !== 'undefined' ) { 39296 jQuery = require('jquery'); 39297 } else { 39298 jQuery = require('jquery')(root); 39299 } 39300 } 39301 factory(jQuery); 39302 return jQuery; 39303 }; 39304 } else { 39305 // Browser globals 39306 factory(jQuery); 39307 } 39308}(function($) { 39309 'use strict'; 39310 39311 var $doc = $(document); 39312 var $win = $(window); 39313 39314 var pluginName = 'selectric'; 39315 var classList = 'Input Items Open Disabled TempShow HideSelect Wrapper Focus Hover Responsive Above Below Scroll Group GroupLabel'; 39316 var eventNamespaceSuffix = '.sl'; 39317 39318 var chars = ['a', 'e', 'i', 'o', 'u', 'n', 'c', 'y']; 39319 var diacritics = [ 39320 /[\xE0-\xE5]/g, // a 39321 /[\xE8-\xEB]/g, // e 39322 /[\xEC-\xEF]/g, // i 39323 /[\xF2-\xF6]/g, // o 39324 /[\xF9-\xFC]/g, // u 39325 /[\xF1]/g, // n 39326 /[\xE7]/g, // c 39327 /[\xFD-\xFF]/g // y 39328 ]; 39329 39330 /** 39331 * Create an instance of Selectric 39332 * 39333 * @constructor 39334 * @param {Node} element - The <select> element 39335 * @param {object} opts - Options 39336 */ 39337 var Selectric = function(element, opts) { 39338 var _this = this; 39339 39340 _this.element = element; 39341 _this.$element = $(element); 39342 39343 _this.state = { 39344 multiple : !!_this.$element.attr('multiple'), 39345 enabled : false, 39346 opened : false, 39347 currValue : -1, 39348 selectedIdx : -1, 39349 highlightedIdx : -1 39350 }; 39351 39352 _this.eventTriggers = { 39353 open : _this.open, 39354 close : _this.close, 39355 destroy : _this.destroy, 39356 refresh : _this.refresh, 39357 init : _this.init 39358 }; 39359 39360 _this.init(opts); 39361 }; 39362 39363 Selectric.prototype = { 39364 utils: { 39365 /** 39366 * Detect mobile browser 39367 * 39368 * @return {boolean} 39369 */ 39370 isMobile: function() { 39371 return /android|ip(hone|od|ad)/i.test(navigator.userAgent); 39372 }, 39373 39374 /** 39375 * Escape especial characters in string (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) 39376 * 39377 * @param {string} str - The string to be escaped 39378 * @return {string} The string with the special characters escaped 39379 */ 39380 escapeRegExp: function(str) { 39381 return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string 39382 }, 39383 39384 /** 39385 * Replace diacritics 39386 * 39387 * @param {string} str - The string to replace the diacritics 39388 * @return {string} The string with diacritics replaced with ascii characters 39389 */ 39390 replaceDiacritics: function(str) { 39391 var k = diacritics.length; 39392 39393 while (k--) { 39394 str = str.toLowerCase().replace(diacritics[k], chars[k]); 39395 } 39396 39397 return str; 39398 }, 39399 39400 /**
39401 * Format string 39402 * https://gist.github.com/atesgoral/984375 39403 * 39404 * @param {string} f - String to be formated 39405 * @return {string} String formated 39406 */ 39407 format: function(f) { 39408 var a = arguments; // store outer arguments 39409 return ('' + f) // force format specifier to String 39410 .replace( // replace tokens in format specifier 39411 /\{(?:(\d+)|(\w+))\}/g, // match {token} references 39412 function( 39413 s, // the matched string (ignored) 39414 i, // an argument index 39415 p // a property name 39416 ) { 39417 return p && a[1] // if property name and first argument exist 39418 ? a[1][p] // return property from first argument 39419 : a[i]; // assume argument index and return i-th argument 39420 }); 39421 }, 39422 39423 /** 39424 * Get the next enabled item in the options list. 39425 * 39426 * @param {object} selectItems - The options object. 39427 * @param {number} selected - Index of the currently selected option. 39428 * @return {object} The next enabled item. 39429 */ 39430 nextEnabledItem: function(selectItems, selected) { 39431 while ( selectItems[ selected = (selected + 1) % selectItems.length ].disabled ) { 39432 // empty 39433 } 39434 return selected; 39435 }, 39436 39437 /** 39438 * Get the previous enabled item in the options list. 39439 * 39440 * @param {object} selectItems - The options object. 39441 * @param {number} selected - Index of the currently selected option. 39442 * @return {object} The previous enabled item. 39443 */ 39444 previousEnabledItem: function(selectItems, selected) { 39445 while ( selectItems[ selected = (selected > 0 ? selected : selectItems.length) - 1 ].disabled ) { 39446 // empty 39447 } 39448 return selected; 39449 }, 39450 39451 /** 39452 * Transform camelCase string to dash-case. 39453 * 39454 * @param {string} str - The camelCased string. 39455 * @return {string} The string transformed to dash-case. 39456 */ 39457 toDash: function(str) { 39458 return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase(); 39459 }, 39460 39461 /** 39462 * Calls the events registered with function name. 39463 * 39464 * @param {string} fn - The name of the function. 39465 * @param {number} scope - Scope that should be set on the function. 39466 */ 39467 triggerCallback: function(fn, scope) { 39468 var elm = scope.element; 39469 var func = scope.options['on' + fn]; 39470 var args = [elm].concat([].slice.call(arguments).slice(1)); 39471 39472 if ( $.isFunction(func) ) { 39473 func.apply(elm, args); 39474 } 39475 39476 $(elm).trigger(pluginName + '-' + this.toDash(fn), args); 39477 }, 39478 39479 /** 39480 * Transform array list to concatenated string and remove empty values 39481 * @param {array} arr - Class list 39482 * @return {string} Concatenated string 39483 */ 39484 arrayToClassname: function(arr) { 39485 var newArr = $.grep(arr, function(item) { 39486 return !!item; 39487 }); 39488 39489 return $.trim(newArr.join(' ')); 39490 } 39491 }, 39492 39493 /** Initializes */ 39494 init: function(opts) { 39495 var _this = this; 39496 39497 // Set options 39498 _this.options = $.extend(true, {}, $.fn[pluginName].defaults, _this.options, opts); 39499 39500 _this.utils.triggerCallback('BeforeInit', _this); 39501 39502 // Preserve data 39503 _this.destroy(true); 39504 39505 // Disable on mobile browsers 39506 if ( _this.options.disableOnMobile && _this.utils.isMobile() ) { 39507 _this.disableOnMobile = true; 39508 return; 39509 } 39510 39511 // Get classes 39512 _this.classes = _this.getClassNames(); 39513 39514 // Create elements 39515 var input = $('<input/>', { 'class': _this.classes.input, 'readonly': _this.utils.isMobile() }); 39516 var items = $('<div/>', { 'class': _this.classes.items, 'tabindex': -1 }); 39517 var itemsScroll = $('<div/>', { 'class': _this.classes.scroll }); 39518 var wrapper = $('<div/>', { 'class': _this.classes.prefix, 'html': _this.options.arrowButtonMarkup }); 39519 var label = $('<span/>', { 'class': 'label' }); 39520 var outerWrapper = _this.$element.wrap('<div/>').parent().append(wrapper.prepend(label), items, input); 39521 var hideSelectWrapper = $('<div/>', { 'class': _this.classes.hideselect }); 39522 39523 _this.elements = { 39524 input : input, 39525 items : items, 39526 itemsScroll : itemsScroll, 39527 wrapper : wrapper, 39528 label : label, 39529 outerWrapper : outerWrapper 39530 }; 39531 39532 if ( _this.options.nativeOnMobile && _this.utils.isMobile() ) { 39533 _this.elements.input = undefined; 39534 hideSelectWrapper.addClass(_this.classes.prefix + '-is-native'); 39535 39536 _this.$element.on('change', function() { 39537 _this.refresh(); 39538 }); 39539 } 39540 39541 _this.$element 39542 .on(_this.eventTriggers) 39543 .wrap(hideSelectWrapper); 39544 39545 _this.originalTabindex = _this.$element.prop('tabindex'); 39546 _this.$element.prop('tabindex', -1); 39547 39548 _this.populate(); 39549 _this.activate(); 39550 39551 _this.utils.triggerCallback('Init', _this); 39552 }, 39553 39554 /** Activates the plugin */ 39555 activate: function() { 39556 var _this = this; 39557 var hiddenChildren = _this.elements.items.closest(':visible').children(':hidden').addClass(_this.classes.tempshow); 39558 var originalWidth = _this.$element.width(); 39559 39560 hiddenChildren.removeClass(_this.classes.tempshow); 39561 39562 _this.utils.triggerCallback('BeforeActivate', _this); 39563 39564 _this.elements.outerWrapper.prop('class', 39565 _this.utils.arrayToClassname([ 39566 _this.classes.wrapper, 39567 _this.$element.prop('class').replace(/\S+/g, _this.classes.prefix + '-$&'), 39568 _this.options.responsive ? _this.classes.responsive : '' 39569 ]) 39570 ); 39571 39572 if ( _this.options.inheritOriginalWidth && originalWidth > 0 ) { 39573 _this.elements.outerWrapper.width(originalWidth); 39574 } 39575 39576 _this.unbindEvents(); 39577 39578 if ( !_this.$element.prop('disabled') ) { 39579 _this.state.enabled = true; 39580 39581 // Not disabled, so... Removing disabled class 39582 _this.elements.outerWrapper.removeClass(_this.classes.disabled); 39583 39584 // Remove styles from items box 39585 // Fix incorrect height when refreshed is triggered with fewer options 39586 _this.$li = _this.elements.items.removeAttr('style').find('li'); 39587 39588 _this.bindEvents(); 39589 } else { 39590 _this.elements.outerWrapper.addClass(_this.classes.disabled); 39591 39592 if ( _this.elements.input ) { 39593 _this.elements.input.prop('disabled', true); 39594 } 39595 } 39596 39597 _this.utils.triggerCallback('Activate', _this); 39598 }, 39599 39600 /** 39601 * Generate classNames for elements 39602 * 39603 * @return {object} Classes object 39604 */ 39605 getClassNames: function() { 39606 var _this = this; 39607 var customClass = _this.options.customClass; 39608 var classesObj = {}; 39609 39610 $.each(classList.split(' '), function(i, currClass) { 39611 var c = customClass.prefix + currClass; 39612 classesObj[currClass.toLowerCase()] = customClass.camelCase ? c : _this.utils.toDash(c); 39613 }); 39614 39615 classesObj.prefix = customClass.prefix; 39616 39617 return classesObj; 39618 }, 39619 39620 /** Set the label text */ 39621 setLabel: function() { 39622 var _this = this; 39623 var labelBuilder = _this.options.labelBuilder; 39624 39625 if ( _this.state.multiple ) { 39626 // Make sure currentValues is an array 39627 var currentValues = $.isArray(_this.state.currValue) ? _this.state.currValue : [_this.state.currValue]; 39628 // I'm not happy with this, but currentValues can be an empty 39629 // array and we need to fallback to the default option. 39630 currentValues = currentValues.length === 0 ? [0] : currentValues; 39631 39632 var labelMarkup = $.map(currentValues, function(value) { 39633 return $.grep(_this.lookupItems, function(item) { 39634 return item.index === value; 39635 })[0]; // we don't want nested arrays here 39636 }); 39637 39638 labelMarkup = $.grep(labelMarkup, function(item) { 39639 // Hide default (please choose) if more then one element were selected. 39640 // If no option value were given value is set to option text by default 39641 if ( labelMarkup.length > 1 || labelMarkup.length === 0 ) { 39642 return $.trim(item.value) !== ''; 39643 } 39644 return item; 39645 }); 39646 39647 labelMarkup = $.map(labelMarkup, function(item) { 39648 return $.isFunction(labelBuilder) 39649 ? labelBuilder(item) 39650 : _this.utils.format(labelBuilder, item); 39651 }); 39652 39653 // Limit the amount of selected values shown in label 39654 if ( _this.options.multiple.maxLabelEntries ) { 39655 if ( labelMarkup.length >= _this.options.multiple.maxLabelEntries + 1 ) { 39656 labelMarkup = labelMarkup.slice(0, _this.options.multiple.maxLabelEntries); 39657 labelMarkup.push( 39658 $.isFunction(labelBuilder) 39659 ? labelBuilder({ text: '...' }) 39660 : _this.utils.format(labelBuilder, { text: '...' })); 39661 } else { 39662 labelMarkup.slice(labelMarkup.length - 1); 39663 } 39664 } 39665 _this.elements.label.html(labelMarkup.join(_this.options.multiple.separator)); 39666 39667 } else { 39668 var currItem = _this.lookupItems[_this.state.currValue]; 39669 39670 _this.elements.label.html( 39671 $.isFunction(labelBuilder) 39672 ? labelBuilder(currItem) 39673 : _this.utils.format(labelBuilder, currItem) 39674 ); 39675 } 39676 }, 39677 39678 /** Get and save the available options */ 39679 populate: function() { 39680 var _this = this; 39681 var $options = _this.$element.children(); 39682 var $justOptions = _this.$element.find('option'); 39683 var $selected = $justOptions.filter(':selected'); 39684 var selectedIndex = $justOptions.index($selected); 39685 var currIndex = 0; 39686 var emptyValue = (_this.state.multiple ? [] : 0); 39687 39688 if ( $selected.length > 1 && _this.state.multiple ) { 39689 selectedIndex = []; 39690 $selected.each(function() { 39691 selectedIndex.push($(this).index()); 39692 }); 39693 } 39694 39695 _this.state.currValue = (~selectedIndex ? selectedIndex : emptyValue); 39696 _this.state.selectedIdx = _this.state.currValue; 39697 _this.state.highlightedIdx = _this.state.currValue; 39698 _this.items = []; 39699 _this.lookupItems = []; 39700 39701 if ( $options.length ) { 39702 // Build options markup 39703 $options.each(function(i) { 39704 var $elm = $(this); 39705 39706 if ( $elm.is('optgroup') ) { 39707 39708 var optionsGroup = { 39709 element : $elm, 39710 label : $elm.prop('label'), 39711 groupDisabled : $elm.prop('disabled'), 39712 items : [] 39713 }; 39714 39715 $elm.children().each(function(i) { 39716 var $elm = $(this); 39717 39718 optionsGroup.items[i] = _this.getItemData(currIndex, $elm, optionsGroup.groupDisabled || $elm.prop('disabled')); 39719 39720 _this.lookupItems[currIndex] = optionsGroup.items[i]; 39721 39722 currIndex++; 39723 }); 39724 39725 _this.items[i] = optionsGroup; 39726 39727 } else { 39728 39729 _this.items[i] = _this.getItemData(currIndex, $elm, $elm.prop('disabled')); 39730 39731 _this.lookupItems[currIndex] = _this.items[i]; 39732 39733 currIndex++; 39734 39735 } 39736 }); 39737 39738 _this.setLabel(); 39739 _this.elements.items.append( _this.elements.itemsScroll.html( _this.getItemsMarkup(_this.items) ) ); 39740 } 39741 }, 39742 39743 /** 39744 * Generate items object data 39745 * @param {integer} index - Current item index 39746 * @param {node} $elm - Current element node 39747 * @param {boolean} isDisabled - Current element disabled state 39748 * @return {object} Item object 39749 */ 39750 getItemData: function(index, $elm, isDisabled) { 39751 var _this = this; 39752 39753 return { 39754 index : index, 39755 element : $elm, 39756 value : $elm.val(), 39757 className : $elm.prop('class'), 39758 text : $elm.html(), 39759 slug : $.trim(_this.utils.replaceDiacritics($elm.html())), 39760 alt : $elm.attr('data-alt'), 39761 selected : $elm.prop('selected'), 39762 disabled : isDisabled 39763 }; 39764 }, 39765 39766 /** 39767 * Generate options markup 39768 * 39769 * @param {object} items - Object containing all available options 39770 * @return {string} HTML for the options box 39771 */ 39772 getItemsMarkup: function(items) { 39773 var _this = this; 39774 var markup = '<ul>'; 39775 39776 if ( $.isFunction(_this.options.listBuilder) && _this.options.listBuilder ) { 39777 items = _this.options.listBuilder(items); 39778 } 39779 39780 $.each(items, function(i, elm) { 39781 if ( elm.label !== undefined ) { 39782 39783 markup += _this.utils.format('<ul class="{1}"><li class="{2}">{3}</li>', 39784 _this.utils.arrayToClassname([ 39785 _this.classes.group, 39786 elm.groupDisabled ? 'disabled' : '', 39787 elm.element.prop('class') 39788 ]), 39789 _this.classes.grouplabel, 39790 elm.element.prop('label') 39791 ); 39792 39793 $.each(elm.items, function(i, elm) { 39794 markup += _this.getItemMarkup(elm.index, elm); 39795 }); 39796 39797 markup += '</ul>'; 39798 39799 } else { 39800 39801 markup += _this.getItemMarkup(elm.index, elm); 39802 39803 } 39804 }); 39805 39806 return markup + '</ul>'; 39807 }, 39808 39809 /** 39810 * Generate every option markup 39811 * 39812 * @param {number} index - Index of current item 39813 * @param {object} itemData - Current item 39814 * @return {string} HTML for the option 39815 */ 39816 getItemMarkup: function(index, itemData) { 39817 var _this = this; 39818 var itemBuilder = _this.options.optionsItemBuilder; 39819 // limit access to item data to provide a simple interface 39820 // to most relevant options. 39821 var filteredItemData = { 39822 value: itemData.value, 39823 text : itemData.text, 39824 slug : itemData.slug, 39825 index: itemData.index 39826 }; 39827 39828 return _this.utils.format('<li data-index="{1}" class="{2}">{3}</li>', 39829 index, 39830 _this.utils.arrayToClassname([ 39831 itemData.className, 39832 index === _this.items.length - 1 ? 'last' : '', 39833 itemData.disabled ? 'disabled' : '', 39834 itemData.selected ? 'selected' : '' 39835 ]), 39836 $.isFunction(itemBuilder) 39837 ? _this.utils.format(itemBuilder(itemData, this.$element, index), itemData) 39838 : _this.utils.format(itemBuilder, filteredItemData) 39839 ); 39840 }, 39841 39842 /** Remove events on the elements */ 39843 unbindEvents: function() { 39844 var _this = this; 39845 39846 _this.elements.wrapper 39847 .add(_this.$element) 39848 .add(_this.elements.outerWrapper) 39849 .add(_this.elements.input) 39850 .off(eventNamespaceSuffix); 39851 }, 39852 39853 /** Bind events on the elements */ 39854 bindEvents: function() { 39855 var _this = this; 39856 39857 _this.elements.outerWrapper.on('mouseenter' + eventNamespaceSuffix + ' mouseleave' + eventNamespaceSuffix, function(e) { 39858 $(this).toggleClass(_this.classes.hover, e.type === 'mouseenter'); 39859 39860 // Delay close effect when openOnHover is true 39861 if ( _this.options.openOnHover ) { 39862 clearTimeout(_this.closeTimer); 39863 39864 if ( e.type === 'mouseleave' ) { 39865 _this.closeTimer = setTimeout($.proxy(_this.close, _this), _this.options.hoverIntentTimeout); 39866 } else { 39867 _this.open(); 39868 } 39869 } 39870 }); 39871 39872 // Toggle open/close
39873 _this.elements.wrapper.on('click' + eventNamespaceSuffix, function(e) { 39874 _this.state.opened ? _this.close() : _this.open(e); 39875 }); 39876 39877 // Translate original element focus event to dummy input. 39878 // Disabled on mobile devices because the default option list isn't 39879 // shown due the fact that hidden input gets focused 39880 if ( !(_this.options.nativeOnMobile && _this.utils.isMobile()) ) { 39881 _this.$element.on('focus' + eventNamespaceSuffix, function() { 39882 _this.elements.input.focus(); 39883 }); 39884 39885 _this.elements.input 39886 .prop({ tabindex: _this.originalTabindex, disabled: false }) 39887 .on('keydown' + eventNamespaceSuffix, $.proxy(_this.handleKeys, _this)) 39888 .on('focusin' + eventNamespaceSuffix, function(e) { 39889 _this.elements.outerWrapper.addClass(_this.classes.focus); 39890 39891 // Prevent the flicker when focusing out and back again in the browser window 39892 _this.elements.input.one('blur', function() { 39893 _this.elements.input.blur(); 39894 }); 39895 39896 if ( _this.options.openOnFocus && !_this.state.opened ) { 39897 _this.open(e); 39898 } 39899 }) 39900 .on('focusout' + eventNamespaceSuffix, function() { 39901 _this.elements.outerWrapper.removeClass(_this.classes.focus); 39902 }) 39903 .on('input propertychange', function() { 39904 var val = _this.elements.input.val(); 39905 var searchRegExp = new RegExp('^' + _this.utils.escapeRegExp(val), 'i'); 39906 39907 // Clear search 39908 clearTimeout(_this.resetStr); 39909 _this.resetStr = setTimeout(function() { 39910 _this.elements.input.val(''); 39911 }, _this.options.keySearchTimeout); 39912 39913 if ( val.length ) { 39914 // Search in select options 39915 $.each(_this.items, function(i, elm) { 39916 if (elm.disabled) { 39917 return; 39918 } 39919 if (searchRegExp.test(elm.text) || searchRegExp.test(elm.slug)) { 39920 _this.highlight(i); 39921 return; 39922 } 39923 if (!elm.alt) { 39924 return; 39925 } 39926 var altItems = elm.alt.split('|'); 39927 for (var ai = 0; ai < altItems.length; ai++) { 39928 if (!altItems[ai]) { 39929 break; 39930 } 39931 if (searchRegExp.test(altItems[ai].trim())) { 39932 _this.highlight(i); 39933 return; 39934 } 39935 } 39936 }); 39937 } 39938 }); 39939 } 39940 39941 _this.$li.on({ 39942 // Prevent <input> blur on Chrome 39943 mousedown: function(e) { 39944 e.preventDefault(); 39945 e.stopPropagation(); 39946 }, 39947 click: function() { 39948 _this.select($(this).data('index')); 39949 39950 // Chrome doesn't close options box if select is wrapped with a label 39951 // We need to 'return false' to avoid that 39952 return false; 39953 } 39954 }); 39955 }, 39956 39957 /** 39958 * Behavior when keyboard keys is pressed 39959 * 39960 * @param {object} e - Event object 39961 */ 39962 handleKeys: function(e) { 39963 var _this = this; 39964 var key = e.which; 39965 var keys = _this.options.keys; 39966 39967 var isPrevKey = $.inArray(key, keys.previous) > -1; 39968 var isNextKey = $.inArray(key, keys.next) > -1; 39969 var isSelectKey = $.inArray(key, keys.select) > -1; 39970 var isOpenKey = $.inArray(key, keys.open) > -1; 39971 var idx = _this.state.highlightedIdx; 39972 var isFirstOrLastItem = (isPrevKey && idx === 0) || (isNextKey && (idx + 1) === _this.items.length); 39973 var goToItem = 0; 39974 39975 // Enter / Space 39976 if ( key === 13 || key === 32 ) { 39977 e.preventDefault(); 39978 } 39979 39980 // If it's a directional key 39981 if ( isPrevKey || isNextKey ) { 39982 if ( !_this.options.allowWrap && isFirstOrLastItem ) { 39983 return; 39984 } 39985 39986 if ( isPrevKey ) { 39987 goToItem = _this.utils.previousEnabledItem(_this.lookupItems, idx); 39988 } 39989 39990 if ( isNextKey ) { 39991 goToItem = _this.utils.nextEnabledItem(_this.lookupItems, idx); 39992 } 39993 39994 _this.highlight(goToItem); 39995 } 39996 39997 // Tab / Enter / ESC 39998 if ( isSelectKey && _this.state.opened ) { 39999 _this.select(idx); 40000 40001 if ( !_this.state.multiple || !_this.options.multiple.keepMenuOpen ) { 40002 _this.close(); 40003 } 40004 40005 return; 40006 } 40007 40008 // Space / Enter / Left / Up / Right / Down 40009 if ( isOpenKey && !_this.state.opened ) { 40010 _this.open(); 40011 } 40012 }, 40013 40014 /** Update the items object */ 40015 refresh: function() { 40016 var _this = this; 40017 40018 _this.populate(); 40019 _this.activate(); 40020 _this.utils.triggerCallback('Refresh', _this); 40021 }, 40022 40023 /** Set options box width/height */ 40024 setOptionsDimensions: function() { 40025 var _this = this; 40026 40027 // Calculate options box height 40028 // Set a temporary class on the hidden parent of the element 40029 var hiddenChildren = _this.elements.items.closest(':visible').children(':hidden').addClass(_this.classes.tempshow); 40030 var maxHeight = _this.options.maxHeight; 40031 var itemsWidth = _this.elements.items.outerWidth();
40032 var wrapperWidth = _this.elements.wrapper.outerWidth() - (itemsWidth - _this.elements.items.width()); 40033 40034 // Set the dimensions, minimum is wrapper width, expand for long items if option is true 40035 if ( !_this.options.expandToItemText || wrapperWidth > itemsWidth ) { 40036 _this.finalWidth = wrapperWidth; 40037 } else { 40038 // Make sure the scrollbar width is included 40039 _this.elements.items.css('overflow', 'scroll'); 40040 40041 // Set a really long width for _this.elements.outerWrapper 40042 _this.elements.outerWrapper.width(9e4); 40043 _this.finalWidth = _this.elements.items.width(); 40044 // Set scroll bar to auto 40045 _this.elements.items.css('overflow', ''); 40046 _this.elements.outerWrapper.width(''); 40047 } 40048 40049 _this.elements.items.width(_this.finalWidth).height() > maxHeight && _this.elements.items.height(maxHeight); 40050 40051 // Remove the temporary class 40052 hiddenChildren.removeClass(_this.classes.tempshow); 40053 }, 40054 40055 /** Detect if the options box is inside the window */ 40056 isInViewport: function() { 40057 var _this = this; 40058 40059 if (_this.options.forceRenderAbove === true) { 40060 _this.elements.outerWrapper.addClass(_this.classes.above); 40061 } else if (_this.options.forceRenderBelow === true) { 40062 _this.elements.outerWrapper.addClass(_this.classes.below); 40063 } else { 40064 var scrollTop = $win.scrollTop(); 40065 var winHeight = $win.height(); 40066 var uiPosX = _this.elements.outerWrapper.offset().top; 40067 var uiHeight = _this.elements.outerWrapper.outerHeight(); 40068 40069 var fitsDown = (uiPosX + uiHeight + _this.itemsHeight) <= (scrollTop + winHeight); 40070 var fitsAbove = (uiPosX - _this.itemsHeight) > scrollTop; 40071 40072 // If it does not fit below, only render it 40073 // above it fit's there. 40074 // It's acceptable that the user needs to 40075 // scroll the viewport to see the cut off UI 40076 var renderAbove = !fitsDown && fitsAbove; 40077 var renderBelow = !renderAbove; 40078 40079 _this.elements.outerWrapper.toggleClass(_this.classes.above, renderAbove); 40080 _this.elements.outerWrapper.toggleClass(_this.classes.below, renderBelow); 40081 } 40082 }, 40083 40084 /** 40085 * Detect if currently selected option is visible and scroll the options box to show it 40086 * 40087 * @param {Number|Array} index - Index of the selected items 40088 */ 40089 detectItemVisibility: function(index) { 40090 var _this = this; 40091 var $filteredLi = _this.$li.filter('[data-index]'); 40092 40093 if ( _this.state.multiple ) { 40094 // If index is an array, we can assume a multiple select and we 40095 // want to scroll to the uppermost selected item! 40096 // Math.min.apply(Math, index) returns the lowest entry in an Array. 40097 index = ($.isArray(index) && index.length === 0) ? 0 : index; 40098 index = $.isArray(index) ? Math.min.apply(Math, index) : index; 40099 } 40100 40101 var liHeight = $filteredLi.eq(index).outerHeight(); 40102 var liTop = $filteredLi[index].offsetTop; 40103 var itemsScrollTop = _this.elements.itemsScroll.scrollTop(); 40104 var scrollT = liTop + liHeight * 2; 40105 40106 _this.elements.itemsScroll.scrollTop( 40107 scrollT > itemsScrollTop + _this.itemsHeight ? scrollT - _this.itemsHeight : 40108 liTop - liHeight < itemsScrollTop ? liTop - liHeight : 40109 itemsScrollTop 40110 ); 40111 }, 40112 40113 /** 40114 * Open the select options box 40115 * 40116 * @param {Event} e - Event 40117 */ 40118 open: function(e) { 40119 var _this = this; 40120 40121 if ( _this.options.nativeOnMobile && _this.utils.isMobile()) { 40122 return false; 40123 } 40124 40125 _this.utils.triggerCallback('BeforeOpen', _this); 40126 40127 if ( e ) { 40128 e.preventDefault(); 40129 if (_this.options.stopPropagation) { 40130 e.stopPropagation(); 40131 } 40132 } 40133 40134 if ( _this.state.enabled ) { 40135 _this.setOptionsDimensions(); 40136 40137 // Find any other opened instances of select and close it 40138 $('.' + _this.classes.hideselect, '.' + _this.classes.open).children()[pluginName]('close'); 40139 40140 _this.state.opened = true; 40141 _this.itemsHeight = _this.elements.items.outerHeight();
40142 _this.itemsInnerHeight = _this.elements.items.height(); 40143 40144 // Toggle options box visibility 40145 _this.elements.outerWrapper.addClass(_this.classes.open); 40146 40147 // Give dummy input focus 40148 _this.elements.input.val(''); 40149 if ( e && e.type !== 'focusin' ) { 40150 _this.elements.input.focus(); 40151 } 40152 40153 // Delayed binds events on Document to make label clicks work 40154 setTimeout(function() { 40155 $doc 40156 .on('click' + eventNamespaceSuffix, $.proxy(_this.close, _this)) 40157 .on('scroll' + eventNamespaceSuffix, $.proxy(_this.isInViewport, _this)); 40158 }, 1); 40159 40160 _this.isInViewport(); 40161 40162 // Prevent window scroll when using mouse wheel inside items box 40163 if ( _this.options.preventWindowScroll ) { 40164 /* istanbul ignore next */ 40165 $doc.on('mousewheel' + eventNamespaceSuffix + ' DOMMouseScroll' + eventNamespaceSuffix, '.' + _this.classes.scroll, function(e) { 40166 var orgEvent = e.originalEvent; 40167 var scrollTop = $(this).scrollTop(); 40168 var deltaY = 0; 40169 40170 if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; } 40171 if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; } 40172 if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; } 40173 if ( 'deltaY' in orgEvent ) { deltaY = orgEvent.deltaY * -1; } 40174 40175 if ( scrollTop === (this.scrollHeight - _this.itemsInnerHeight) && deltaY < 0 || scrollTop === 0 && deltaY > 0 ) { 40176 e.preventDefault(); 40177 } 40178 }); 40179 } 40180 40181 _this.detectItemVisibility(_this.state.selectedIdx); 40182 40183 _this.highlight(_this.state.multiple ? -1 : _this.state.selectedIdx); 40184 40185 _this.utils.triggerCallback('Open', _this); 40186 } 40187 }, 40188 40189 /** Close the select options box */ 40190 close: function() { 40191 var _this = this; 40192 40193 _this.utils.triggerCallback('BeforeClose', _this); 40194 40195 // Remove custom events on document 40196 $doc.off(eventNamespaceSuffix); 40197 40198 // Remove visible class to hide options box 40199 _this.elements.outerWrapper.removeClass(_this.classes.open); 40200 40201 _this.state.opened = false; 40202 40203 _this.utils.triggerCallback('Close', _this); 40204 }, 40205 40206 /** Select current option and change the label */ 40207 change: function() { 40208 var _this = this; 40209 40210 _this.utils.triggerCallback('BeforeChange', _this); 40211 40212 if ( _this.state.multiple ) { 40213 // Reset old selected 40214 $.each(_this.lookupItems, function(idx) { 40215 _this.lookupItems[idx].selected = false; 40216 _this.$element.find('option').prop('selected', false); 40217 }); 40218 40219 // Set new selected 40220 $.each(_this.state.selectedIdx, function(idx, value) { 40221 _this.lookupItems[value].selected = true; 40222 _this.$element.find('option').eq(value).prop('selected', true); 40223 }); 40224 40225 _this.state.currValue = _this.state.selectedIdx; 40226 40227 _this.setLabel(); 40228 40229 _this.utils.triggerCallback('Change', _this); 40230 } else if ( _this.state.currValue !== _this.state.selectedIdx ) { 40231 // Apply changed value to original select 40232 _this.$element 40233 .prop('selectedIndex', _this.state.currValue = _this.state.selectedIdx) 40234 .data('value', _this.lookupItems[_this.state.selectedIdx].text); 40235 40236 // Change label text 40237 _this.setLabel(); 40238 40239 _this.utils.triggerCallback('Change', _this); 40240 } 40241 }, 40242 40243 /** 40244 * Highlight option 40245 * @param {number} index - Index of the options that will be highlighted 40246 */ 40247 highlight: function(index) { 40248 var _this = this; 40249 var $filteredLi = _this.$li.filter('[data-index]').removeClass('highlighted'); 40250 40251 _this.utils.triggerCallback('BeforeHighlight', _this); 40252 40253 // Parameter index is required and should not be a disabled item 40254 if ( index === undefined || index === -1 || _this.lookupItems[index].disabled ) { 40255 return; 40256 } 40257 40258 $filteredLi 40259 .eq(_this.state.highlightedIdx = index) 40260 .addClass('highlighted'); 40261 40262 _this.detectItemVisibility(index); 40263 40264 _this.utils.triggerCallback('Highlight', _this); 40265 }, 40266 40267 /** 40268 * Select option 40269 * 40270 * @param {number} index - Index of the option that will be selected 40271 */ 40272 select: function(index) { 40273 var _this = this; 40274 var $filteredLi = _this.$li.filter('[data-index]'); 40275 40276 _this.utils.triggerCallback('BeforeSelect', _this, index); 40277 40278 // Parameter index is required and should not be a disabled item 40279 if ( index === undefined || index === -1 || _this.lookupItems[index].disabled ) { 40280 return; 40281 } 40282 40283 if ( _this.state.multiple ) { 40284 // Make sure selectedIdx is an array 40285 _this.state.selectedIdx = $.isArray(_this.state.selectedIdx) ? _this.state.selectedIdx : [_this.state.selectedIdx]; 40286 40287 var hasSelectedIndex = $.inArray(index, _this.state.selectedIdx); 40288 if ( hasSelectedIndex !== -1 ) { 40289 _this.state.selectedIdx.splice(hasSelectedIndex, 1); 40290 } else { 40291 _this.state.selectedIdx.push(index); 40292 } 40293 40294 $filteredLi 40295 .removeClass('selected') 40296 .filter(function(index) { 40297 return $.inArray(index, _this.state.selectedIdx) !== -1; 40298 }) 40299 .addClass('selected'); 40300 } else { 40301 $filteredLi 40302 .removeClass('selected') 40303 .eq(_this.state.selectedIdx = index) 40304 .addClass('selected'); 40305 } 40306 40307 if ( !_this.state.multiple || !_this.options.multiple.keepMenuOpen ) { 40308 _this.close(); 40309 } 40310 40311 _this.change(); 40312 40313 _this.utils.triggerCallback('Select', _this, index); 40314 }, 40315 40316 /** 40317 * Unbind and remove 40318 * 40319 * @param {boolean} preserveData - Check if the data on the element should be removed too 40320 */ 40321 destroy: function(preserveData) { 40322 var _this = this; 40323 40324 if ( _this.state && _this.state.enabled ) { 40325 _this.elements.items.add(_this.elements.wrapper).add(_this.elements.input).remove(); 40326 40327 if ( !preserveData ) { 40328 _this.$element.removeData(pluginName).removeData('value'); 40329 } 40330 40331 _this.$element.prop('tabindex', _this.originalTabindex).off(eventNamespaceSuffix).off(_this.eventTriggers).unwrap().unwrap(); 40332 40333 _this.state.enabled = false;
vendor: 127,612 bytes, lines 40334-43719
40334 } 40335 } 40336 }; 40337 40338 // A really lightweight plugin wrapper around the constructor, 40339 // preventing against multiple instantiations 40340 $.fn[pluginName] = function(args) { 40341 return this.each(function() { 40342 var data = $.data(this, pluginName); 40343 40344 if ( data && !data.disableOnMobile ) { 40345 (typeof args === 'string' && data[args]) ? data[args]() : data.init(args); 40346 } else { 40347 $.data(this, pluginName, new Selectric(this, args)); 40348 } 40349 }); 40350 }; 40351 40352 /** 40353 * Default plugin options 40354 * 40355 * @type {object} 40356 */ 40357 $.fn[pluginName].defaults = { 40358 onChange : function(elm) { $(elm).change(); }, 40359 maxHeight : 300, 40360 keySearchTimeout : 500, 40361 arrowButtonMarkup : '<b class="button">▾</b>', 40362 disableOnMobile : false, 40363 nativeOnMobile : true, 40364 openOnFocus : true, 40365 openOnHover : false, 40366 hoverIntentTimeout : 500, 40367 expandToItemText : false, 40368 responsive : false, 40369 preventWindowScroll : true, 40370 inheritOriginalWidth : false, 40371 allowWrap : true, 40372 forceRenderAbove : false, 40373 forceRenderBelow : false, 40374 stopPropagation : true, 40375 optionsItemBuilder : '{text}', // function(itemData, element, index) 40376 labelBuilder : '{text}', // function(currItem) 40377 listBuilder : false, // function(items) 40378 keys : { 40379 previous : [37, 38], // Left / Up 40380 next : [39, 40], // Right / Down 40381 select : [9, 13, 27], // Tab / Enter / Escape 40382 open : [13, 32, 37, 38, 39, 40], // Enter / Space / Left / Up / Right / Down 40383 close : [9, 27] // Tab / Escape 40384 }, 40385 customClass : { 40386 prefix: pluginName, 40387 camelCase: false 40388 }, 40389 multiple : { 40390 separator: ', ', 40391 keepMenuOpen: true, 40392 maxLabelEntries: false 40393 } 40394 }; 40395})); 40396/*! 40397 DataTables 1.10.19 40398 ©2008-2018 SpryMedia Ltd - datatables.net/license 40399*/ 40400(function(h) { 40401 "function" === typeof define && define.amd ? define(["jquery"], function(E) { 40402 return h(E, window, document) 40403 }) : "object" === typeof exports ? module.exports = function(E, H) { 40404 E || (E = window); 40405 H || (H = "undefined" !== typeof window ? require("jquery") : require("jquery")(E)); 40406 return h(H, E, E.document) 40407 } : h(jQuery, window, document) 40408})(function(h, E, H, k) { 40409 function Z(a) { 40410 var b, c, d = {}; 40411 h.each(a, function(e) { 40412 if ((b = e.match(/^([^A-Z]+?)([A-Z])/)) && -1 !== "a aa ai ao as b fn i m o s ".indexOf(b[1] + " ")) c = e.replace(b[0], b[2].toLowerCase()), 40413 d[c] = e, "o" === b[1] && Z(a[e]) 40414 }); 40415 a._hungarianMap = d 40416 } 40417 40418 function J(a, b, c) { 40419 a._hungarianMap || Z(a); 40420 var d; 40421 h.each(b, function(e) { 40422 d = a._hungarianMap[e]; 40423 if (d !== k && (c || b[d] === k)) "o" === d.charAt(0) ? (b[d] || (b[d] = {}), h.extend(!0, b[d], b[e]), J(a[d], b[d], c)) : b[d] = b[e] 40424 }) 40425 } 40426 40427 function Ca(a) { 40428 var b = n.defaults.oLanguage, 40429 c = b.sDecimal; 40430 c && Da(c); 40431 if (a) { 40432 var d = a.sZeroRecords; 40433 !a.sEmptyTable && (d && "No data available in table" === b.sEmptyTable) && F(a, a, "sZeroRecords", "sEmptyTable"); 40434 !a.sLoadingRecords && (d && "Loading..." === b.sLoadingRecords) && F(a, 40435 a, "sZeroRecords", "sLoadingRecords"); 40436 a.sInfoThousands && (a.sThousands = a.sInfoThousands); 40437 (a = a.sDecimal) && c !== a && Da(a) 40438 } 40439 } 40440 40441 function fb(a) { 40442 A(a, "ordering", "bSort"); 40443 A(a, "orderMulti", "bSortMulti"); 40444 A(a, "orderClasses", "bSortClasses"); 40445 A(a, "orderCellsTop", "bSortCellsTop"); 40446 A(a, "order", "aaSorting"); 40447 A(a, "orderFixed", "aaSortingFixed"); 40448 A(a, "paging", "bPaginate"); 40449 A(a, "pagingType", "sPaginationType"); 40450 A(a, "pageLength", "iDisplayLength"); 40451 A(a, "searching", "bFilter"); 40452 "boolean" === typeof a.sScrollX && (a.sScrollX = a.sScrollX ? "100%" : 40453 ""); 40454 "boolean" === typeof a.scrollX && (a.scrollX = a.scrollX ? "100%" : ""); 40455 if (a = a.aoSearchCols) 40456 for (var b = 0, c = a.length; b < c; b++) a[b] && J(n.models.oSearch, a[b]) 40457 } 40458 40459 function gb(a) { 40460 A(a, "orderable", "bSortable"); 40461 A(a, "orderData", "aDataSort"); 40462 A(a, "orderSequence", "asSorting"); 40463 A(a, "orderDataType", "sortDataType"); 40464 var b = a.aDataSort; 40465 "number" === typeof b && !h.isArray(b) && (a.aDataSort = [b]) 40466 } 40467 40468 function hb(a) { 40469 if (!n.__browser) { 40470 var b = {}; 40471 n.__browser = b; 40472 var c = h("<div/>").css({ 40473 position: "fixed", 40474 top: 0, 40475 left: -1 * h(E).scrollLeft(), 40476 height: 1, 40477 width: 1, 40478 overflow: "hidden" 40479 }).append(h("<div/>").css({ 40480 position: "absolute", 40481 top: 1, 40482 left: 1, 40483 width: 100, 40484 overflow: "scroll" 40485 }).append(h("<div/>").css({ 40486 width: "100%", 40487 height: 10 40488 }))).appendTo("body"), 40489 d = c.children(), 40490 e = d.children(); 40491 b.barWidth = d[0].offsetWidth - d[0].clientWidth; 40492 b.bScrollOversize = 100 === e[0].offsetWidth && 100 !== d[0].clientWidth; 40493 b.bScrollbarLeft = 1 !== Math.round(e.offset().left); 40494 b.bBounding = c[0].getBoundingClientRect().width ? !0 : !1; 40495 c.remove() 40496 } 40497 h.extend(a.oBrowser, n.__browser); 40498 a.oScroll.iBarWidth = n.__browser.barWidth 40499 } 40500 40501 function ib(a, b, c, d, e, f) { 40502 var g, j = !1; 40503 c !== k && (g = c, j = !0); 40504 for (; d !== e;) a.hasOwnProperty(d) && (g = j ? b(g, a[d], d, a) : a[d], j = !0, d += f); 40505 return g 40506 } 40507 40508 function Ea(a, b) { 40509 var c = n.defaults.column, 40510 d = a.aoColumns.length, 40511 c = h.extend({}, n.models.oColumn, c, { 40512 nTh: b ? b : H.createElement("th"), 40513 sTitle: c.sTitle ? c.sTitle : b ? b.innerHTML : "", 40514 aDataSort: c.aDataSort ? c.aDataSort : [d], 40515 mData: c.mData ? c.mData : d, 40516 idx: d 40517 }); 40518 a.aoColumns.push(c); 40519 c = a.aoPreSearchCols; 40520 c[d] = h.extend({}, n.models.oSearch, c[d]); 40521 ka(a, d, h(b).data()) 40522 } 40523 40524 function ka(a, b, c) { 40525 var b = a.aoColumns[b], 40526 d = a.oClasses, 40527 e = h(b.nTh); 40528 if (!b.sWidthOrig) { 40529 b.sWidthOrig = e.attr("width") || null; 40530 var f = (e.attr("style") || "").match(/width:\s*(\d+[pxem%]+)/); 40531 f && (b.sWidthOrig = f[1]) 40532 } 40533 c !== k && null !== c && (gb(c), J(n.defaults.column, c), c.mDataProp !== k && !c.mData && (c.mData = c.mDataProp), c.sType && (b._sManualType = c.sType), c.className && !c.sClass && (c.sClass = c.className), c.sClass && e.addClass(c.sClass), h.extend(b, c), F(b, c, "sWidth", "sWidthOrig"), c.iDataSort !== k && (b.aDataSort = [c.iDataSort]), F(b, c, "aDataSort")); 40534 var g = b.mData, 40535 j = S(g), 40536 i = b.mRender ? 40537 S(b.mRender) : null, 40538 c = function(a) { 40539 return "string" === typeof a && -1 !== a.indexOf("@") 40540 }; 40541 b._bAttrSrc = h.isPlainObject(g) && (c(g.sort) || c(g.type) || c(g.filter)); 40542 b._setter = null; 40543 b.fnGetData = function(a, b, c) { 40544 var d = j(a, b, k, c); 40545 return i && b ? i(d, b, a, c) : d 40546 }; 40547 b.fnSetData = function(a, b, c) { 40548 return N(g)(a, b, c) 40549 }; 40550 "number" !== typeof g && (a._rowReadObject = !0); 40551 a.oFeatures.bSort || (b.bSortable = !1, e.addClass(d.sSortableNone)); 40552 a = -1 !== h.inArray("asc", b.asSorting); 40553 c = -1 !== h.inArray("desc", b.asSorting); 40554 !b.bSortable || !a && !c ? (b.sSortingClass = d.sSortableNone, 40555 b.sSortingClassJUI = "") : a && !c ? (b.sSortingClass = d.sSortableAsc, b.sSortingClassJUI = d.sSortJUIAscAllowed) : !a && c ? (b.sSortingClass = d.sSortableDesc, b.sSortingClassJUI = d.sSortJUIDescAllowed) : (b.sSortingClass = d.sSortable, b.sSortingClassJUI = d.sSortJUI) 40556 } 40557 40558 function $(a) { 40559 if (!1 !== a.oFeatures.bAutoWidth) { 40560 var b = a.aoColumns; 40561 Fa(a); 40562 for (var c = 0, d = b.length; c < d; c++) b[c].nTh.style.width = b[c].sWidth 40563 } 40564 b = a.oScroll; 40565 ("" !== b.sY || "" !== b.sX) && la(a); 40566 r(a, null, "column-sizing", [a]) 40567 } 40568 40569 function aa(a, b) { 40570 var c = ma(a, "bVisible"); 40571 return "number" === 40572 typeof c[b] ? c[b] : null 40573 } 40574 40575 function ba(a, b) { 40576 var c = ma(a, "bVisible"), 40577 c = h.inArray(b, c); 40578 return -1 !== c ? c : null 40579 } 40580 40581 function V(a) { 40582 var b = 0; 40583 h.each(a.aoColumns, function(a, d) { 40584 d.bVisible && "none" !== h(d.nTh).css("display") && b++ 40585 }); 40586 return b 40587 } 40588 40589 function ma(a, b) { 40590 var c = []; 40591 h.map(a.aoColumns, function(a, e) { 40592 a[b] && c.push(e) 40593 }); 40594 return c 40595 } 40596 40597 function Ga(a) { 40598 var b = a.aoColumns, 40599 c = a.aoData, 40600 d = n.ext.type.detect, 40601 e, f, g, j, i, h, l, q, t; 40602 e = 0; 40603 for (f = b.length; e < f; e++) 40604 if (l = b[e], t = [], !l.sType && l._sManualType) l.sType = l._sManualType; 40605 else if (!l.sType) { 40606 g = 0; 40607 for (j = d.length; g < 40608 j; g++) { 40609 i = 0; 40610 for (h = c.length; i < h; i++) { 40611 t[i] === k && (t[i] = B(a, i, e, "type")); 40612 q = d[g](t[i], a); 40613 if (!q && g !== d.length - 1) break; 40614 if ("html" === q) break 40615 } 40616 if (q) { 40617 l.sType = q; 40618 break 40619 } 40620 } 40621 l.sType || (l.sType = "string") 40622 } 40623 } 40624 40625 function jb(a, b, c, d) { 40626 var e, f, g, j, i, m, l = a.aoColumns; 40627 if (b) 40628 for (e = b.length - 1; 0 <= e; e--) { 40629 m = b[e]; 40630 var q = m.targets !== k ? m.targets : m.aTargets; 40631 h.isArray(q) || (q = [q]); 40632 f = 0; 40633 for (g = q.length; f < g; f++) 40634 if ("number" === typeof q[f] && 0 <= q[f]) { 40635 for (; l.length <= q[f];) Ea(a); 40636 d(q[f], m) 40637 } else if ("number" === typeof q[f] && 0 > q[f]) d(l.length + q[f], m); 40638 else if ("string" === 40639 typeof q[f]) { 40640 j = 0; 40641 for (i = l.length; j < i; j++)("_all" == q[f] || h(l[j].nTh).hasClass(q[f])) && d(j, m) 40642 } 40643 } 40644 if (c) { 40645 e = 0; 40646 for (a = c.length; e < a; e++) d(e, c[e]) 40647 } 40648 } 40649 40650 function O(a, b, c, d) { 40651 var e = a.aoData.length, 40652 f = h.extend(!0, {}, n.models.oRow, { 40653 src: c ? "dom" : "data", 40654 idx: e 40655 }); 40656 f._aData = b; 40657 a.aoData.push(f); 40658 for (var g = a.aoColumns, j = 0, i = g.length; j < i; j++) g[j].sType = null; 40659 a.aiDisplayMaster.push(e); 40660 b = a.rowIdFn(b); 40661 b !== k && (a.aIds[b] = f); 40662 (c || !a.oFeatures.bDeferRender) && Ha(a, e, c, d); 40663 return e 40664 } 40665 40666 function na(a, b) { 40667 var c; 40668 b instanceof h || (b = h(b)); 40669 return b.map(function(b, 40670 e) { 40671 c = Ia(a, e); 40672 return O(a, c.data, e, c.cells) 40673 }) 40674 } 40675 40676 function B(a, b, c, d) { 40677 var e = a.iDraw, 40678 f = a.aoColumns[c], 40679 g = a.aoData[b]._aData, 40680 j = f.sDefaultContent, 40681 i = f.fnGetData(g, d, { 40682 settings: a, 40683 row: b, 40684 col: c 40685 }); 40686 if (i === k) return a.iDrawError != e && null === j && (K(a, 0, "Requested unknown parameter " + ("function" == typeof f.mData ? "{function}" : "'" + f.mData + "'") + " for row " + b + ", column " + c, 4), a.iDrawError = e), j; 40687 if ((i === g || null === i) && null !== j && d !== k) i = j; 40688 else if ("function" === typeof i) return i.call(g); 40689 return null === i && "display" == d ? "" : i 40690 } 40691 40692 function kb(a, 40693 b, c, d) { 40694 a.aoColumns[c].fnSetData(a.aoData[b]._aData, d, { 40695 settings: a, 40696 row: b, 40697 col: c 40698 }) 40699 } 40700 40701 function Ja(a) { 40702 return h.map(a.match(/(\\.|[^\.])+/g) || [""], function(a) { 40703 return a.replace(/\\\./g, ".") 40704 }) 40705 } 40706 40707 function S(a) { 40708 if (h.isPlainObject(a)) { 40709 var b = {}; 40710 h.each(a, function(a, c) { 40711 c && (b[a] = S(c)) 40712 }); 40713 return function(a, c, f, g) { 40714 var j = b[c] || b._; 40715 return j !== k ? j(a, c, f, g) : a 40716 } 40717 } 40718 if (null === a) return function(a) { 40719 return a 40720 }; 40721 if ("function" === typeof a) return function(b, c, f, g) { 40722 return a(b, c, f, g) 40723 }; 40724 if ("string" === typeof a && (-1 !== a.indexOf(".") || -1 !== a.indexOf("[") || 40725 -1 !== a.indexOf("("))) { 40726 var c = function(a, b, f) { 40727 var g, j; 40728 if ("" !== f) { 40729 j = Ja(f); 40730 for (var i = 0, m = j.length; i < m; i++) { 40731 f = j[i].match(ca); 40732 g = j[i].match(W); 40733 if (f) { 40734 j[i] = j[i].replace(ca, ""); 40735 "" !== j[i] && (a = a[j[i]]); 40736 g = []; 40737 j.splice(0, i + 1); 40738 j = j.join("."); 40739 if (h.isArray(a)) { 40740 i = 0; 40741 for (m = a.length; i < m; i++) g.push(c(a[i], b, j)) 40742 } 40743 a = f[0].substring(1, f[0].length - 1); 40744 a = "" === a ? g : g.join(a); 40745 break 40746 } else if (g) { 40747 j[i] = j[i].replace(W, ""); 40748 a = a[j[i]](); 40749 continue 40750 } 40751 if (null === a || a[j[i]] === k) return k; 40752 a = a[j[i]] 40753 } 40754 } 40755 return a 40756 }; 40757 return function(b, e) { 40758 return c(b, e, a) 40759 } 40760 } 40761 return function(b) { 40762 return b[a] 40763 } 40764 } 40765 40766 function N(a) { 40767 if (h.isPlainObject(a)) return N(a._); 40768 if (null === a) return function() {}; 40769 if ("function" === typeof a) return function(b, d, e) { 40770 a(b, "set", d, e) 40771 }; 40772 if ("string" === typeof a && (-1 !== a.indexOf(".") || -1 !== a.indexOf("[") || -1 !== a.indexOf("("))) { 40773 var b = function(a, d, e) { 40774 var e = Ja(e), 40775 f; 40776 f = e[e.length - 1]; 40777 for (var g, j, i = 0, m = e.length - 1; i < m; i++) { 40778 g = e[i].match(ca); 40779 j = e[i].match(W); 40780 if (g) { 40781 e[i] = e[i].replace(ca, ""); 40782 a[e[i]] = []; 40783 f = e.slice(); 40784 f.splice(0, i + 1); 40785 g = f.join("."); 40786 if (h.isArray(d)) { 40787 j = 0; 40788 for (m = d.length; j < m; j++) f = {}, b(f, d[j], g), 40789 a[e[i]].push(f) 40790 } else a[e[i]] = d; 40791 return 40792 } 40793 j && (e[i] = e[i].replace(W, ""), a = a[e[i]](d)); 40794 if (null === a[e[i]] || a[e[i]] === k) a[e[i]] = {}; 40795 a = a[e[i]] 40796 } 40797 if (f.match(W)) a[f.replace(W, "")](d); 40798 else a[f.replace(ca, "")] = d 40799 }; 40800 return function(c, d) { 40801 return b(c, d, a) 40802 } 40803 } 40804 return function(b, d) { 40805 b[a] = d 40806 } 40807 } 40808 40809 function Ka(a) { 40810 return D(a.aoData, "_aData") 40811 } 40812 40813 function oa(a) { 40814 a.aoData.length = 0; 40815 a.aiDisplayMaster.length = 0; 40816 a.aiDisplay.length = 0; 40817 a.aIds = {} 40818 } 40819 40820 function pa(a, b, c) { 40821 for (var d = -1, e = 0, f = a.length; e < f; e++) a[e] == b ? d = e : a[e] > b && a[e]--; - 1 != d && c === k && a.splice(d, 40822 1) 40823 } 40824 40825 function da(a, b, c, d) { 40826 var e = a.aoData[b], 40827 f, g = function(c, d) { 40828 for (; c.childNodes.length;) c.removeChild(c.firstChild); 40829 c.innerHTML = B(a, b, d, "display") 40830 }; 40831 if ("dom" === c || (!c || "auto" === c) && "dom" === e.src) e._aData = Ia(a, e, d, d === k ? k : e._aData).data; 40832 else { 40833 var j = e.anCells; 40834 if (j) 40835 if (d !== k) g(j[d], d); 40836 else { 40837 c = 0; 40838 for (f = j.length; c < f; c++) g(j[c], c) 40839 } 40840 } 40841 e._aSortData = null; 40842 e._aFilterData = null; 40843 g = a.aoColumns; 40844 if (d !== k) g[d].sType = null; 40845 else { 40846 c = 0; 40847 for (f = g.length; c < f; c++) g[c].sType = null; 40848 La(a, e) 40849 } 40850 } 40851 40852 function Ia(a, b, c, d) { 40853 var e = [], 40854 f = b.firstChild, 40855 g, 40856 j, i = 0, 40857 m, l = a.aoColumns, 40858 q = a._rowReadObject, 40859 d = d !== k ? d : q ? {} : [], 40860 t = function(a, b) { 40861 if ("string" === typeof a) { 40862 var c = a.indexOf("@"); - 1 !== c && (c = a.substring(c + 1), N(a)(d, b.getAttribute(c))) 40863 } 40864 }, 40865 G = function(a) { 40866 if (c === k || c === i) j = l[i], m = h.trim(a.innerHTML), j && j._bAttrSrc ? (N(j.mData._)(d, m), t(j.mData.sort, a), t(j.mData.type, a), t(j.mData.filter, a)) : q ? (j._setter || (j._setter = N(j.mData)), j._setter(d, m)) : d[i] = m; 40867 i++ 40868 }; 40869 if (f) 40870 for (; f;) { 40871 g = f.nodeName.toUpperCase(); 40872 if ("TD" == g || "TH" == g) G(f), e.push(f); 40873 f = f.nextSibling 40874 } else { 40875 e = b.anCells; 40876 f = 0; 40877 for (g = e.length; f < g; f++) G(e[f]) 40878 } 40879 if (b = b.firstChild ? b : b.nTr)(b = b.getAttribute("id")) && N(a.rowId)(d, b); 40880 return { 40881 data: d, 40882 cells: e 40883 } 40884 } 40885 40886 function Ha(a, b, c, d) { 40887 var e = a.aoData[b], 40888 f = e._aData, 40889 g = [], 40890 j, i, m, l, q; 40891 if (null === e.nTr) { 40892 j = c || H.createElement("tr"); 40893 e.nTr = j; 40894 e.anCells = g; 40895 j._DT_RowIndex = b; 40896 La(a, e); 40897 l = 0; 40898 for (q = a.aoColumns.length; l < q; l++) { 40899 m = a.aoColumns[l]; 40900 i = c ? d[l] : H.createElement(m.sCellType); 40901 i._DT_CellIndex = { 40902 row: b, 40903 column: l 40904 }; 40905 g.push(i); 40906 if ((!c || m.mRender || m.mData !== l) && (!h.isPlainObject(m.mData) || m.mData._ !== l + ".display")) i.innerHTML = 40907 B(a, b, l, "display"); 40908 m.sClass && (i.className += " " + m.sClass); 40909 m.bVisible && !c ? j.appendChild(i) : !m.bVisible && c && i.parentNode.removeChild(i); 40910 m.fnCreatedCell && m.fnCreatedCell.call(a.oInstance, i, B(a, b, l), f, b, l) 40911 } 40912 r(a, "aoRowCreatedCallback", null, [j, f, b, g]) 40913 } 40914 e.nTr.setAttribute("role", "row") 40915 } 40916 40917 function La(a, b) { 40918 var c = b.nTr, 40919 d = b._aData; 40920 if (c) { 40921 var e = a.rowIdFn(d); 40922 e && (c.id = e); 40923 d.DT_RowClass && (e = d.DT_RowClass.split(" "), b.__rowc = b.__rowc ? qa(b.__rowc.concat(e)) : e, h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass)); 40924 d.DT_RowAttr && h(c).attr(d.DT_RowAttr); 40925 d.DT_RowData && h(c).data(d.DT_RowData) 40926 } 40927 } 40928 40929 function lb(a) { 40930 var b, c, d, e, f, g = a.nTHead, 40931 j = a.nTFoot, 40932 i = 0 === h("th, td", g).length, 40933 m = a.oClasses, 40934 l = a.aoColumns; 40935 i && (e = h("<tr/>").appendTo(g)); 40936 b = 0; 40937 for (c = l.length; b < c; b++) f = l[b], d = h(f.nTh).addClass(f.sClass), i && d.appendTo(e), a.oFeatures.bSort && (d.addClass(f.sSortingClass), !1 !== f.bSortable && (d.attr("tabindex", a.iTabIndex).attr("aria-controls", a.sTableId), Ma(a, f.nTh, b))), f.sTitle != d[0].innerHTML && d.html(f.sTitle), Na(a, "header")(a, d, 40938 f, m); 40939 i && ea(a.aoHeader, g); 40940 h(g).find(">tr").attr("role", "row"); 40941 h(g).find(">tr>th, >tr>td").addClass(m.sHeaderTH); 40942 h(j).find(">tr>th, >tr>td").addClass(m.sFooterTH); 40943 if (null !== j) { 40944 a = a.aoFooter[0]; 40945 b = 0; 40946 for (c = a.length; b < c; b++) f = l[b], f.nTf = a[b].cell, f.sClass && h(f.nTf).addClass(f.sClass) 40947 } 40948 } 40949 40950 function fa(a, b, c) { 40951 var d, e, f, g = [], 40952 j = [], 40953 i = a.aoColumns.length, 40954 m; 40955 if (b) { 40956 c === k && (c = !1); 40957 d = 0; 40958 for (e = b.length; d < e; d++) { 40959 g[d] = b[d].slice(); 40960 g[d].nTr = b[d].nTr; 40961 for (f = i - 1; 0 <= f; f--) !a.aoColumns[f].bVisible && !c && g[d].splice(f, 1); 40962 j.push([]) 40963 } 40964 d = 40965 0; 40966 for (e = g.length; d < e; d++) { 40967 if (a = g[d].nTr) 40968 for (; f = a.firstChild;) a.removeChild(f); 40969 f = 0; 40970 for (b = g[d].length; f < b; f++) 40971 if (m = i = 1, j[d][f] === k) { 40972 a.appendChild(g[d][f].cell); 40973 for (j[d][f] = 1; g[d + i] !== k && g[d][f].cell == g[d + i][f].cell;) j[d + i][f] = 1, i++; 40974 for (; g[d][f + m] !== k && g[d][f].cell == g[d][f + m].cell;) { 40975 for (c = 0; c < i; c++) j[d + c][f + m] = 1; 40976 m++ 40977 } 40978 h(g[d][f].cell).attr("rowspan", i).attr("colspan", m) 40979 } 40980 } 40981 } 40982 } 40983 40984 function P(a) { 40985 var b = r(a, "aoPreDrawCallback", "preDraw", [a]); 40986 if (-1 !== h.inArray(!1, b)) C(a, !1); 40987 else { 40988 var b = [], 40989 c = 0, 40990 d = a.asStripeClasses, 40991 e = 40992 d.length, 40993 f = a.oLanguage, 40994 g = a.iInitDisplayStart, 40995 j = "ssp" == y(a), 40996 i = a.aiDisplay; 40997 a.bDrawing = !0; 40998 g !== k && -1 !== g && (a._iDisplayStart = j ? g : g >= a.fnRecordsDisplay() ? 0 : g, a.iInitDisplayStart = -1); 40999 var g = a._iDisplayStart, 41000 m = a.fnDisplayEnd(); 41001 if (a.bDeferLoading) a.bDeferLoading = !1, a.iDraw++, C(a, !1); 41002 else if (j) { 41003 if (!a.bDestroying && !mb(a)) return 41004 } else a.iDraw++; 41005 if (0 !== i.length) { 41006 f = j ? a.aoData.length : m; 41007 for (j = j ? 0 : g; j < f; j++) { 41008 var l = i[j], 41009 q = a.aoData[l]; 41010 null === q.nTr && Ha(a, l); 41011 var t = q.nTr; 41012 if (0 !== e) { 41013 var G = d[c % e]; 41014 q._sRowStripe != G && (h(t).removeClass(q._sRowStripe).addClass(G), 41015 q._sRowStripe = G) 41016 } 41017 r(a, "aoRowCallback", null, [t, q._aData, c, j, l]); 41018 b.push(t); 41019 c++ 41020 } 41021 } else c = f.sZeroRecords, 1 == a.iDraw && "ajax" == y(a) ? c = f.sLoadingRecords : f.sEmptyTable && 0 === a.fnRecordsTotal() && (c = f.sEmptyTable), b[0] = h("<tr/>", { 41022 "class": e ? d[0] : "" 41023 }).append(h("<td />", { 41024 valign: "top", 41025 colSpan: V(a), 41026 "class": a.oClasses.sRowEmpty 41027 }).html(c))[0]; 41028 r(a, "aoHeaderCallback", "header", [h(a.nTHead).children("tr")[0], Ka(a), g, m, i]); 41029 r(a, "aoFooterCallback", "footer", [h(a.nTFoot).children("tr")[0], Ka(a), g, m, i]); 41030 d = h(a.nTBody); 41031 d.children().detach(); 41032 d.append(h(b)); 41033 r(a, "aoDrawCallback", "draw", [a]); 41034 a.bSorted = !1; 41035 a.bFiltered = !1; 41036 a.bDrawing = !1 41037 } 41038 } 41039 41040 function T(a, b) { 41041 var c = a.oFeatures, 41042 d = c.bFilter; 41043 c.bSort && nb(a); 41044 d ? ga(a, a.oPreviousSearch) : a.aiDisplay = a.aiDisplayMaster.slice(); 41045 !0 !== b && (a._iDisplayStart = 0); 41046 a._drawHold = b; 41047 P(a); 41048 a._drawHold = !1 41049 } 41050 41051 function ob(a) { 41052 var b = a.oClasses, 41053 c = h(a.nTable), 41054 c = h("<div/>").insertBefore(c), 41055 d = a.oFeatures, 41056 e = h("<div/>", { 41057 id: a.sTableId + "_wrapper", 41058 "class": b.sWrapper + (a.nTFoot ? "" : " " + b.sNoFooter) 41059 }); 41060 a.nHolding = c[0]; 41061 a.nTableWrapper = e[0]; 41062 a.nTableReinsertBefore = 41063 a.nTable.nextSibling; 41064 for (var f = a.sDom.split(""), g, j, i, m, l, q, k = 0; k < f.length; k++) { 41065 g = null; 41066 j = f[k]; 41067 if ("<" == j) { 41068 i = h("<div/>")[0]; 41069 m = f[k + 1]; 41070 if ("'" == m || '"' == m) { 41071 l = ""; 41072 for (q = 2; f[k + q] != m;) l += f[k + q], q++; 41073 "H" == l ? l = b.sJUIHeader : "F" == l && (l = b.sJUIFooter); - 1 != l.indexOf(".") ? (m = l.split("."), i.id = m[0].substr(1, m[0].length - 1), i.className = m[1]) : "#" == l.charAt(0) ? i.id = l.substr(1, l.length - 1) : i.className = l; 41074 k += q 41075 } 41076 e.append(i); 41077 e = h(i) 41078 } else if (">" == j) e = e.parent(); 41079 else if ("l" == j && d.bPaginate && d.bLengthChange) g = pb(a); 41080 else if ("f" == j && 41081 d.bFilter) g = qb(a); 41082 else if ("r" == j && d.bProcessing) g = rb(a); 41083 else if ("t" == j) g = sb(a); 41084 else if ("i" == j && d.bInfo) g = tb(a); 41085 else if ("p" == j && d.bPaginate) g = ub(a); 41086 else if (0 !== n.ext.feature.length) { 41087 i = n.ext.feature; 41088 q = 0; 41089 for (m = i.length; q < m; q++) 41090 if (j == i[q].cFeature) { 41091 g = i[q].fnInit(a); 41092 break 41093 } 41094 } 41095 g && (i = a.aanFeatures, i[j] || (i[j] = []), i[j].push(g), e.append(g)) 41096 } 41097 c.replaceWith(e); 41098 a.nHolding = null 41099 } 41100 41101 function ea(a, b) { 41102 var c = h(b).children("tr"), 41103 d, e, f, g, j, i, m, l, q, k; 41104 a.splice(0, a.length); 41105 f = 0; 41106 for (i = c.length; f < i; f++) a.push([]); 41107 f = 0; 41108 for (i = c.length; f < 41109 i; f++) { 41110 d = c[f]; 41111 for (e = d.firstChild; e;) { 41112 if ("TD" == e.nodeName.toUpperCase() || "TH" == e.nodeName.toUpperCase()) { 41113 l = 1 * e.getAttribute("colspan"); 41114 q = 1 * e.getAttribute("rowspan"); 41115 l = !l || 0 === l || 1 === l ? 1 : l; 41116 q = !q || 0 === q || 1 === q ? 1 : q; 41117 g = 0; 41118 for (j = a[f]; j[g];) g++; 41119 m = g; 41120 k = 1 === l ? !0 : !1; 41121 for (j = 0; j < l; j++) 41122 for (g = 0; g < q; g++) a[f + g][m + j] = { 41123 cell: e, 41124 unique: k 41125 }, a[f + g].nTr = d 41126 } 41127 e = e.nextSibling 41128 } 41129 } 41130 } 41131 41132 function ra(a, b, c) { 41133 var d = []; 41134 c || (c = a.aoHeader, b && (c = [], ea(c, b))); 41135 for (var b = 0, e = c.length; b < e; b++) 41136 for (var f = 0, g = c[b].length; f < g; f++) 41137 if (c[b][f].unique && (!d[f] || 41138 !a.bSortCellsTop)) d[f] = c[b][f].cell; 41139 return d 41140 } 41141 41142 function sa(a, b, c) { 41143 r(a, "aoServerParams", "serverParams", [b]); 41144 if (b && h.isArray(b)) { 41145 var d = {}, 41146 e = /(.*?)\[\]$/; 41147 h.each(b, function(a, b) { 41148 var c = b.name.match(e); 41149 c ? (c = c[0], d[c] || (d[c] = []), d[c].push(b.value)) : d[b.name] = b.value 41150 }); 41151 b = d 41152 } 41153 var f, g = a.ajax, 41154 j = a.oInstance, 41155 i = function(b) { 41156 r(a, null, "xhr", [a, b, a.jqXHR]); 41157 c(b) 41158 }; 41159 if (h.isPlainObject(g) && g.data) { 41160 f = g.data; 41161 var m = "function" === typeof f ? f(b, a) : f, 41162 b = "function" === typeof f && m ? m : h.extend(!0, b, m); 41163 delete g.data 41164 } 41165 m = { 41166 data: b, 41167 success: function(b) { 41168 var c = 41169 b.error || b.sError; 41170 c && K(a, 0, c); 41171 a.json = b; 41172 i(b) 41173 }, 41174 dataType: "json", 41175 cache: !1, 41176 type: a.sServerMethod, 41177 error: function(b, c) { 41178 var d = r(a, null, "xhr", [a, null, a.jqXHR]); - 1 === h.inArray(!0, d) && ("parsererror" == c ? K(a, 0, "Invalid JSON response", 1) : 4 === b.readyState && K(a, 0, "Ajax error", 7)); 41179 C(a, !1) 41180 } 41181 }; 41182 a.oAjaxData = b; 41183 r(a, null, "preXhr", [a, b]); 41184 a.fnServerData ? a.fnServerData.call(j, a.sAjaxSource, h.map(b, function(a, b) { 41185 return { 41186 name: b, 41187 value: a 41188 } 41189 }), i, a) : a.sAjaxSource || "string" === typeof g ? a.jqXHR = h.ajax(h.extend(m, { 41190 url: g || a.sAjaxSource 41191 })) : 41192 "function" === typeof g ? a.jqXHR = g.call(j, b, i, a) : (a.jqXHR = h.ajax(h.extend(m, g)), g.data = f) 41193 } 41194 41195 function mb(a) { 41196 return a.bAjaxDataGet ? (a.iDraw++, C(a, !0), sa(a, vb(a), function(b) { 41197 wb(a, b) 41198 }), !1) : !0 41199 } 41200 41201 function vb(a) { 41202 var b = a.aoColumns, 41203 c = b.length, 41204 d = a.oFeatures, 41205 e = a.oPreviousSearch, 41206 f = a.aoPreSearchCols, 41207 g, j = [], 41208 i, m, l, k = X(a); 41209 g = a._iDisplayStart; 41210 i = !1 !== d.bPaginate ? a._iDisplayLength : -1; 41211 var t = function(a, b) { 41212 j.push({ 41213 name: a, 41214 value: b 41215 }) 41216 }; 41217 t("sEcho", a.iDraw); 41218 t("iColumns", c); 41219 t("sColumns", D(b, "sName").join(",")); 41220 t("iDisplayStart", g); 41221 t("iDisplayLength", 41222 i); 41223 var G = { 41224 draw: a.iDraw, 41225 columns: [], 41226 order: [], 41227 start: g, 41228 length: i, 41229 search: { 41230 value: e.sSearch, 41231 regex: e.bRegex 41232 } 41233 }; 41234 for (g = 0; g < c; g++) m = b[g], l = f[g], i = "function" == typeof m.mData ? "function" : m.mData, G.columns.push({ 41235 data: i, 41236 name: m.sName, 41237 searchable: m.bSearchable, 41238 orderable: m.bSortable, 41239 search: { 41240 value: l.sSearch, 41241 regex: l.bRegex 41242 } 41243 }), t("mDataProp_" + g, i), d.bFilter && (t("sSearch_" + g, l.sSearch), t("bRegex_" + g, l.bRegex), t("bSearchable_" + g, m.bSearchable)), d.bSort && t("bSortable_" + g, m.bSortable); 41244 d.bFilter && (t("sSearch", e.sSearch), t("bRegex", 41245 e.bRegex)); 41246 d.bSort && (h.each(k, function(a, b) { 41247 G.order.push({ 41248 column: b.col, 41249 dir: b.dir 41250 }); 41251 t("iSortCol_" + a, b.col); 41252 t("sSortDir_" + a, b.dir) 41253 }), t("iSortingCols", k.length)); 41254 b = n.ext.legacy.ajax; 41255 return null === b ? a.sAjaxSource ? j : G : b ? j : G 41256 } 41257 41258 function wb(a, b) { 41259 var c = ta(a, b), 41260 d = b.sEcho !== k ? b.sEcho : b.draw, 41261 e = b.iTotalRecords !== k ? b.iTotalRecords : b.recordsTotal, 41262 f = b.iTotalDisplayRecords !== k ? b.iTotalDisplayRecords : b.recordsFiltered; 41263 if (d) { 41264 if (1 * d < a.iDraw) return; 41265 a.iDraw = 1 * d 41266 } 41267 oa(a); 41268 a._iRecordsTotal = parseInt(e, 10); 41269 a._iRecordsDisplay = parseInt(f, 41270 10); 41271 d = 0; 41272 for (e = c.length; d < e; d++) O(a, c[d]); 41273 a.aiDisplay = a.aiDisplayMaster.slice(); 41274 a.bAjaxDataGet = !1; 41275 P(a); 41276 a._bInitComplete || ua(a, b); 41277 a.bAjaxDataGet = !0; 41278 C(a, !1) 41279 } 41280 41281 function ta(a, b) { 41282 var c = h.isPlainObject(a.ajax) && a.ajax.dataSrc !== k ? a.ajax.dataSrc : a.sAjaxDataProp; 41283 return "data" === c ? b.aaData || b[c] : "" !== c ? S(c)(b) : b 41284 } 41285 41286 function qb(a) { 41287 var b = a.oClasses, 41288 c = a.sTableId, 41289 d = a.oLanguage, 41290 e = a.oPreviousSearch, 41291 f = a.aanFeatures, 41292 g = '<input type="search" class="' + b.sFilterInput + '"/>', 41293 j = d.sSearch, 41294 j = j.match(/_INPUT_/) ? j.replace("_INPUT_", 41295 g) : j + g, 41296 b = h("<div/>", { 41297 id: !f.f ? c + "_filter" : null, 41298 "class": b.sFilter 41299 }).append(h("<label/>").append(j)), 41300 f = function() { 41301 var b = !this.value ? "" : this.value; 41302 b != e.sSearch && (ga(a, { 41303 sSearch: b, 41304 bRegex: e.bRegex, 41305 bSmart: e.bSmart, 41306 bCaseInsensitive: e.bCaseInsensitive 41307 }), a._iDisplayStart = 0, P(a)) 41308 }, 41309 g = null !== a.searchDelay ? a.searchDelay : "ssp" === y(a) ? 400 : 0, 41310 i = h("input", b).val(e.sSearch).attr("placeholder", d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT", g ? Oa(f, g) : f).on("keypress.DT", function(a) { 41311 if (13 == a.keyCode) return !1 41312 }).attr("aria-controls", 41313 c); 41314 h(a.nTable).on("search.dt.DT", function(b, c) { 41315 if (a === c) try { 41316 i[0] !== H.activeElement && i.val(e.sSearch) 41317 } catch (d) {} 41318 }); 41319 return b[0] 41320 } 41321 41322 function ga(a, b, c) { 41323 var d = a.oPreviousSearch, 41324 e = a.aoPreSearchCols, 41325 f = function(a) { 41326 d.sSearch = a.sSearch; 41327 d.bRegex = a.bRegex; 41328 d.bSmart = a.bSmart; 41329 d.bCaseInsensitive = a.bCaseInsensitive 41330 }; 41331 Ga(a); 41332 if ("ssp" != y(a)) { 41333 xb(a, b.sSearch, c, b.bEscapeRegex !== k ? !b.bEscapeRegex : b.bRegex, b.bSmart, b.bCaseInsensitive); 41334 f(b); 41335 for (b = 0; b < e.length; b++) yb(a, e[b].sSearch, b, e[b].bEscapeRegex !== k ? !e[b].bEscapeRegex : e[b].bRegex, 41336 e[b].bSmart, e[b].bCaseInsensitive); 41337 zb(a) 41338 } else f(b); 41339 a.bFiltered = !0; 41340 r(a, null, "search", [a]) 41341 } 41342 41343 function zb(a) { 41344 for (var b = n.ext.search, c = a.aiDisplay, d, e, f = 0, g = b.length; f < g; f++) { 41345 for (var j = [], i = 0, m = c.length; i < m; i++) e = c[i], d = a.aoData[e], b[f](a, d._aFilterData, e, d._aData, i) && j.push(e); 41346 c.length = 0; 41347 h.merge(c, j) 41348 } 41349 } 41350 41351 function yb(a, b, c, d, e, f) { 41352 if ("" !== b) { 41353 for (var g = [], j = a.aiDisplay, d = Pa(b, d, e, f), e = 0; e < j.length; e++) b = a.aoData[j[e]]._aFilterData[c], d.test(b) && g.push(j[e]); 41354 a.aiDisplay = g 41355 } 41356 } 41357 41358 function xb(a, b, c, d, e, f) { 41359 var d = Pa(b, 41360 d, e, f), 41361 f = a.oPreviousSearch.sSearch, 41362 g = a.aiDisplayMaster, 41363 j, e = []; 41364 0 !== n.ext.search.length && (c = !0); 41365 j = Ab(a); 41366 if (0 >= b.length) a.aiDisplay = g.slice(); 41367 else { 41368 if (j || c || f.length > b.length || 0 !== b.indexOf(f) || a.bSorted) a.aiDisplay = g.slice(); 41369 b = a.aiDisplay; 41370 for (c = 0; c < b.length; c++) d.test(a.aoData[b[c]]._sFilterRow) && e.push(b[c]); 41371 a.aiDisplay = e 41372 } 41373 } 41374 41375 function Pa(a, b, c, d) { 41376 a = b ? a : Qa(a); 41377 c && (a = "^(?=.*?" + h.map(a.match(/"[^"]+"|[^ ]+/g) || [""], function(a) { 41378 if ('"' === a.charAt(0)) var b = a.match(/^"(.*)"$/), 41379 a = b ? b[1] : a; 41380 return a.replace('"', 41381 "") 41382 }).join(")(?=.*?") + ").*$"); 41383 return RegExp(a, d ? "i" : "") 41384 } 41385 41386 function Ab(a) { 41387 var b = a.aoColumns, 41388 c, d, e, f, g, j, i, h, l = n.ext.type.search; 41389 c = !1; 41390 d = 0; 41391 for (f = a.aoData.length; d < f; d++) 41392 if (h = a.aoData[d], !h._aFilterData) { 41393 j = []; 41394 e = 0; 41395 for (g = b.length; e < g; e++) c = b[e], c.bSearchable ? (i = B(a, d, e, "filter"), l[c.sType] && (i = l[c.sType](i)), null === i && (i = ""), "string" !== typeof i && i.toString && (i = i.toString())) : i = "", i.indexOf && -1 !== i.indexOf("&") && (va.innerHTML = i, i = Wb ? va.textContent : va.innerText), i.replace && (i = i.replace(/[\r\n]/g, "")), j.push(i); 41396 h._aFilterData = j; 41397 h._sFilterRow = j.join(" "); 41398 c = !0 41399 } return c 41400 } 41401 41402 function Bb(a) { 41403 return { 41404 search: a.sSearch, 41405 smart: a.bSmart, 41406 regex: a.bRegex, 41407 caseInsensitive: a.bCaseInsensitive 41408 } 41409 } 41410 41411 function Cb(a) { 41412 return { 41413 sSearch: a.search, 41414 bSmart: a.smart, 41415 bRegex: a.regex, 41416 bCaseInsensitive: a.caseInsensitive 41417 } 41418 } 41419 41420 function tb(a) { 41421 var b = a.sTableId, 41422 c = a.aanFeatures.i, 41423 d = h("<div/>", { 41424 "class": a.oClasses.sInfo, 41425 id: !c ? b + "_info" : null 41426 }); 41427 c || (a.aoDrawCallback.push({ 41428 fn: Db, 41429 sName: "information" 41430 }), d.attr("role", "status").attr("aria-live", "polite"), h(a.nTable).attr("aria-describedby", 41431 b + "_info")); 41432 return d[0] 41433 } 41434 41435 function Db(a) { 41436 var b = a.aanFeatures.i; 41437 if (0 !== b.length) { 41438 var c = a.oLanguage, 41439 d = a._iDisplayStart + 1, 41440 e = a.fnDisplayEnd(), 41441 f = a.fnRecordsTotal(), 41442 g = a.fnRecordsDisplay(), 41443 j = g ? c.sInfo : c.sInfoEmpty; 41444 g !== f && (j += " " + c.sInfoFiltered); 41445 j += c.sInfoPostFix; 41446 j = Eb(a, j); 41447 c = c.fnInfoCallback; 41448 null !== c && (j = c.call(a.oInstance, a, d, e, f, g, j)); 41449 h(b).html(j) 41450 } 41451 } 41452 41453 function Eb(a, b) { 41454 var c = a.fnFormatNumber, 41455 d = a._iDisplayStart + 1, 41456 e = a._iDisplayLength, 41457 f = a.fnRecordsDisplay(), 41458 g = -1 === e; 41459 return b.replace(/_START_/g, c.call(a, d)).replace(/_END_/g, 41460 c.call(a, a.fnDisplayEnd())).replace(/_MAX_/g, c.call(a, a.fnRecordsTotal())).replace(/_TOTAL_/g, c.call(a, f)).replace(/_PAGE_/g, c.call(a, g ? 1 : Math.ceil(d / e))).replace(/_PAGES_/g, c.call(a, g ? 1 : Math.ceil(f / e))) 41461 } 41462 41463 function ha(a) { 41464 var b, c, d = a.iInitDisplayStart, 41465 e = a.aoColumns, 41466 f; 41467 c = a.oFeatures; 41468 var g = a.bDeferLoading; 41469 if (a.bInitialised) { 41470 ob(a); 41471 lb(a); 41472 fa(a, a.aoHeader); 41473 fa(a, a.aoFooter); 41474 C(a, !0); 41475 c.bAutoWidth && Fa(a); 41476 b = 0; 41477 for (c = e.length; b < c; b++) f = e[b], f.sWidth && (f.nTh.style.width = v(f.sWidth)); 41478 r(a, null, "preInit", [a]); 41479 T(a); 41480 e = 41481 y(a); 41482 if ("ssp" != e || g) "ajax" == e ? sa(a, [], function(c) { 41483 var f = ta(a, c); 41484 for (b = 0; b < f.length; b++) O(a, f[b]); 41485 a.iInitDisplayStart = d; 41486 T(a); 41487 C(a, !1); 41488 ua(a, c) 41489 }, a) : (C(a, !1), ua(a)) 41490 } else setTimeout(function() { 41491 ha(a) 41492 }, 200) 41493 } 41494 41495 function ua(a, b) { 41496 a._bInitComplete = !0; 41497 (b || a.oInit.aaData) && $(a); 41498 r(a, null, "plugin-init", [a, b]); 41499 r(a, "aoInitComplete", "init", [a, b]) 41500 } 41501 41502 function Ra(a, b) { 41503 var c = parseInt(b, 10); 41504 a._iDisplayLength = c; 41505 Sa(a); 41506 r(a, null, "length", [a, c]) 41507 } 41508 41509 function pb(a) { 41510 for (var b = a.oClasses, c = a.sTableId, d = a.aLengthMenu, e = h.isArray(d[0]), f = 41511 e ? d[0] : d, d = e ? d[1] : d, e = h("<select/>", { 41512 name: c + "_length", 41513 "aria-controls": c, 41514 "class": b.sLengthSelect 41515 }), g = 0, j = f.length; g < j; g++) e[0][g] = new Option("number" === typeof d[g] ? a.fnFormatNumber(d[g]) : d[g], f[g]); 41516 var i = h("<div><label/></div>").addClass(b.sLength); 41517 a.aanFeatures.l || (i[0].id = c + "_length"); 41518 i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_", e[0].outerHTML)); 41519 h("select", i).val(a._iDisplayLength).on("change.DT", function() { 41520 Ra(a, h(this).val()); 41521 P(a) 41522 }); 41523 h(a.nTable).on("length.dt.DT", function(b, c, d) { 41524 a === 41525 c && h("select", i).val(d) 41526 }); 41527 return i[0] 41528 } 41529 41530 function ub(a) { 41531 var b = a.sPaginationType, 41532 c = n.ext.pager[b], 41533 d = "function" === typeof c, 41534 e = function(a) { 41535 P(a) 41536 }, 41537 b = h("<div/>").addClass(a.oClasses.sPaging + b)[0], 41538 f = a.aanFeatures; 41539 d || c.fnInit(a, b, e); 41540 f.p || (b.id = a.sTableId + "_paginate", a.aoDrawCallback.push({ 41541 fn: function(a) { 41542 if (d) { 41543 var b = a._iDisplayStart, 41544 i = a._iDisplayLength, 41545 h = a.fnRecordsDisplay(), 41546 l = -1 === i, 41547 b = l ? 0 : Math.ceil(b / i), 41548 i = l ? 1 : Math.ceil(h / i), 41549 h = c(b, i), 41550 k, l = 0; 41551 for (k = f.p.length; l < k; l++) Na(a, "pageButton")(a, f.p[l], l, h, b, i) 41552 } else c.fnUpdate(a, 41553 e) 41554 }, 41555 sName: "pagination" 41556 })); 41557 return b 41558 } 41559 41560 function Ta(a, b, c) { 41561 var d = a._iDisplayStart, 41562 e = a._iDisplayLength, 41563 f = a.fnRecordsDisplay(); 41564 0 === f || -1 === e ? d = 0 : "number" === typeof b ? (d = b * e, d > f && (d = 0)) : "first" == b ? d = 0 : "previous" == b ? (d = 0 <= e ? d - e : 0, 0 > d && (d = 0)) : "next" == b ? d + e < f && (d += e) : "last" == b ? d = Math.floor((f - 1) / e) * e : K(a, 0, "Unknown paging action: " + b, 5); 41565 b = a._iDisplayStart !== d; 41566 a._iDisplayStart = d; 41567 b && (r(a, null, "page", [a]), c && P(a)); 41568 return b 41569 } 41570 41571 function rb(a) { 41572 return h("<div/>", { 41573 id: !a.aanFeatures.r ? a.sTableId + "_processing" : null, 41574 "class": a.oClasses.sProcessing 41575 }).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0] 41576 } 41577 41578 function C(a, b) { 41579 a.oFeatures.bProcessing && h(a.aanFeatures.r).css("display", b ? "block" : "none"); 41580 r(a, null, "processing", [a, b]) 41581 } 41582 41583 function sb(a) { 41584 var b = h(a.nTable); 41585 b.attr("role", "grid"); 41586 var c = a.oScroll; 41587 if ("" === c.sX && "" === c.sY) return a.nTable; 41588 var d = c.sX, 41589 e = c.sY, 41590 f = a.oClasses, 41591 g = b.children("caption"), 41592 j = g.length ? g[0]._captionSide : null, 41593 i = h(b[0].cloneNode(!1)), 41594 m = h(b[0].cloneNode(!1)), 41595 l = b.children("tfoot"); 41596 l.length || (l = null); 41597 i = h("<div/>", { 41598 "class": f.sScrollWrapper 41599 }).append(h("<div/>", { 41600 "class": f.sScrollHead 41601 }).css({ 41602 overflow: "hidden", 41603 position: "relative", 41604 border: 0, 41605 width: d ? !d ? null : v(d) : "100%" 41606 }).append(h("<div/>", { 41607 "class": f.sScrollHeadInner 41608 }).css({ 41609 "box-sizing": "content-box", 41610 width: c.sXInner || "100%" 41611 }).append(i.removeAttr("id").css("margin-left", 0).append("top" === j ? g : null).append(b.children("thead"))))).append(h("<div/>", { 41612 "class": f.sScrollBody 41613 }).css({ 41614 position: "relative", 41615 overflow: "auto", 41616 width: !d ? null : v(d) 41617 }).append(b)); 41618 l && i.append(h("<div/>", { 41619 "class": f.sScrollFoot 41620 }).css({ 41621 overflow: "hidden", 41622 border: 0, 41623 width: d ? !d ? null : v(d) : "100%" 41624 }).append(h("<div/>", { 41625 "class": f.sScrollFootInner 41626 }).append(m.removeAttr("id").css("margin-left", 0).append("bottom" === j ? g : null).append(b.children("tfoot"))))); 41627 var b = i.children(), 41628 k = b[0], 41629 f = b[1], 41630 t = l ? b[2] : null; 41631 if (d) h(f).on("scroll.DT", function() { 41632 var a = this.scrollLeft; 41633 k.scrollLeft = a; 41634 l && (t.scrollLeft = a) 41635 }); 41636 h(f).css(e && c.bCollapse ? "max-height" : "height", e); 41637 a.nScrollHead = k; 41638 a.nScrollBody = f; 41639 a.nScrollFoot = t; 41640 a.aoDrawCallback.push({ 41641 fn: la, 41642 sName: "scrolling" 41643 }); 41644 return i[0] 41645 } 41646 41647 function la(a) { 41648 var b = a.oScroll, 41649 c = b.sX, 41650 d = b.sXInner, 41651 e = b.sY, 41652 b = b.iBarWidth, 41653 f = h(a.nScrollHead), 41654 g = f[0].style, 41655 j = f.children("div"), 41656 i = j[0].style, 41657 m = j.children("table"), 41658 j = a.nScrollBody, 41659 l = h(j), 41660 q = j.style, 41661 t = h(a.nScrollFoot).children("div"), 41662 n = t.children("table"), 41663 o = h(a.nTHead), 41664 p = h(a.nTable), 41665 s = p[0], 41666 r = s.style, 41667 u = a.nTFoot ? h(a.nTFoot) : null, 41668 x = a.oBrowser, 41669 U = x.bScrollOversize, 41670 Xb = D(a.aoColumns, "nTh"), 41671 Q, L, R, w, Ua = [], 41672 y = [], 41673 z = [], 41674 A = [], 41675 B, C = function(a) { 41676 a = a.style; 41677 a.paddingTop = "0"; 41678 a.paddingBottom = "0"; 41679 a.borderTopWidth = "0"; 41680 a.borderBottomWidth = "0"; 41681 a.height = 0 41682 }; 41683 L = j.scrollHeight > j.clientHeight; 41684 if (a.scrollBarVis !== 41685 L && a.scrollBarVis !== k) a.scrollBarVis = L, $(a); 41686 else { 41687 a.scrollBarVis = L; 41688 p.children("thead, tfoot").remove(); 41689 u && (R = u.clone().prependTo(p), Q = u.find("tr"), R = R.find("tr")); 41690 w = o.clone().prependTo(p); 41691 o = o.find("tr"); 41692 L = w.find("tr"); 41693 w.find("th, td").removeAttr("tabindex"); 41694 c || (q.width = "100%", f[0].style.width = "100%"); 41695 h.each(ra(a, w), function(b, c) { 41696 B = aa(a, b); 41697 c.style.width = a.aoColumns[B].sWidth 41698 }); 41699 u && I(function(a) { 41700 a.style.width = "" 41701 }, R); 41702 f = p.outerWidth(); 41703 if ("" === c) { 41704 r.width = "100%"; 41705 if (U && (p.find("tbody").height() > j.offsetHeight || 41706 "scroll" == l.css("overflow-y"))) r.width = v(p.outerWidth() - b); 41707 f = p.outerWidth() 41708 } else "" !== d && (r.width = v(d), f = p.outerWidth()); 41709 I(C, L); 41710 I(function(a) { 41711 z.push(a.innerHTML); 41712 Ua.push(v(h(a).css("width"))) 41713 }, L); 41714 I(function(a, b) { 41715 if (h.inArray(a, Xb) !== -1) a.style.width = Ua[b] 41716 }, o); 41717 h(L).height(0); 41718 u && (I(C, R), I(function(a) { 41719 A.push(a.innerHTML); 41720 y.push(v(h(a).css("width"))) 41721 }, R), I(function(a, b) { 41722 a.style.width = y[b] 41723 }, Q), h(R).height(0)); 41724 I(function(a, b) { 41725 a.innerHTML = '<div class="dataTables_sizing">' + z[b] + "</div>"; 41726 a.childNodes[0].style.height = 41727 "0"; 41728 a.childNodes[0].style.overflow = "hidden"; 41729 a.style.width = Ua[b] 41730 }, L); 41731 u && I(function(a, b) { 41732 a.innerHTML = '<div class="dataTables_sizing">' + A[b] + "</div>"; 41733 a.childNodes[0].style.height = "0"; 41734 a.childNodes[0].style.overflow = "hidden"; 41735 a.style.width = y[b] 41736 }, R); 41737 if (p.outerWidth() < f) { 41738 Q = j.scrollHeight > j.offsetHeight || "scroll" == l.css("overflow-y") ? f + b : f; 41739 if (U && (j.scrollHeight > j.offsetHeight || "scroll" == l.css("overflow-y"))) r.width = v(Q - b); 41740 ("" === c || "" !== d) && K(a, 1, "Possible column misalignment", 6) 41741 } else Q = "100%"; 41742 q.width = v(Q); 41743 g.width = v(Q); 41744 u && (a.nScrollFoot.style.width = v(Q)); 41745 !e && U && (q.height = v(s.offsetHeight + b)); 41746 c = p.outerWidth(); 41747 m[0].style.width = v(c); 41748 i.width = v(c); 41749 d = p.height() > j.clientHeight || "scroll" == l.css("overflow-y"); 41750 e = "padding" + (x.bScrollbarLeft ? "Left" : "Right"); 41751 i[e] = d ? b + "px" : "0px"; 41752 u && (n[0].style.width = v(c), t[0].style.width = v(c), t[0].style[e] = d ? b + "px" : "0px"); 41753 p.children("colgroup").insertBefore(p.children("thead")); 41754 l.scroll(); 41755 if ((a.bSorted || a.bFiltered) && !a._drawHold) j.scrollTop = 0 41756 } 41757 } 41758 41759 function I(a, b, c) { 41760 for (var d = 0, e = 0, 41761 f = b.length, g, j; e < f;) { 41762 g = b[e].firstChild; 41763 for (j = c ? c[e].firstChild : null; g;) 1 === g.nodeType && (c ? a(g, j, d) : a(g, d), d++), g = g.nextSibling, j = c ? j.nextSibling : null; 41764 e++ 41765 } 41766 } 41767 41768 function Fa(a) { 41769 var b = a.nTable, 41770 c = a.aoColumns, 41771 d = a.oScroll, 41772 e = d.sY, 41773 f = d.sX, 41774 g = d.sXInner, 41775 j = c.length, 41776 i = ma(a, "bVisible"), 41777 m = h("th", a.nTHead), 41778 l = b.getAttribute("width"), 41779 k = b.parentNode, 41780 t = !1, 41781 n, o, p = a.oBrowser, 41782 d = p.bScrollOversize; 41783 (n = b.style.width) && -1 !== n.indexOf("%") && (l = n); 41784 for (n = 0; n < i.length; n++) o = c[i[n]], null !== o.sWidth && (o.sWidth = Fb(o.sWidthOrig, k), t = !0); 41785 if (d || 41786 !t && !f && !e && j == V(a) && j == m.length) 41787 for (n = 0; n < j; n++) i = aa(a, n), null !== i && (c[i].sWidth = v(m.eq(n).width())); 41788 else { 41789 j = h(b).clone().css("visibility", "hidden").removeAttr("id"); 41790 j.find("tbody tr").remove(); 41791 var s = h("<tr/>").appendTo(j.find("tbody")); 41792 j.find("thead, tfoot").remove(); 41793 j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone()); 41794 j.find("tfoot th, tfoot td").css("width", ""); 41795 m = ra(a, j.find("thead")[0]); 41796 for (n = 0; n < i.length; n++) o = c[i[n]], m[n].style.width = null !== o.sWidthOrig && "" !== o.sWidthOrig ? v(o.sWidthOrig) : 41797 "", o.sWidthOrig && f && h(m[n]).append(h("<div/>").css({ 41798 width: o.sWidthOrig, 41799 margin: 0, 41800 padding: 0, 41801 border: 0, 41802 height: 1 41803 })); 41804 if (a.aoData.length) 41805 for (n = 0; n < i.length; n++) t = i[n], o = c[t], h(Gb(a, t)).clone(!1).append(o.sContentPadding).appendTo(s); 41806 h("[name]", j).removeAttr("name"); 41807 o = h("<div/>").css(f || e ? { 41808 position: "absolute", 41809 top: 0, 41810 left: 0, 41811 height: 1, 41812 right: 0, 41813 overflow: "hidden" 41814 } : {}).append(j).appendTo(k); 41815 f && g ? j.width(g) : f ? (j.css("width", "auto"), j.removeAttr("width"), j.width() < k.clientWidth && l && j.width(k.clientWidth)) : e ? j.width(k.clientWidth) : 41816 l && j.width(l); 41817 for (n = e = 0; n < i.length; n++) k = h(m[n]), g = k.outerWidth() - k.width(), k = p.bBounding ? Math.ceil(m[n].getBoundingClientRect().width) : k.outerWidth(), e += k, c[i[n]].sWidth = v(k - g); 41818 b.style.width = v(e); 41819 o.remove() 41820 } 41821 l && (b.style.width = v(l)); 41822 if ((l || f) && !a._reszEvt) b = function() { 41823 h(E).on("resize.DT-" + a.sInstance, Oa(function() { 41824 $(a) 41825 })) 41826 }, d ? setTimeout(b, 1E3) : b(), a._reszEvt = !0 41827 } 41828 41829 function Fb(a, b) { 41830 if (!a) return 0; 41831 var c = h("<div/>").css("width", v(a)).appendTo(b || H.body), 41832 d = c[0].offsetWidth; 41833 c.remove(); 41834 return d 41835 } 41836 41837 function Gb(a, 41838 b) { 41839 var c = Hb(a, b); 41840 if (0 > c) return null; 41841 var d = a.aoData[c]; 41842 return !d.nTr ? h("<td/>").html(B(a, c, b, "display"))[0] : d.anCells[b] 41843 } 41844 41845 function Hb(a, b) { 41846 for (var c, d = -1, e = -1, f = 0, g = a.aoData.length; f < g; f++) c = B(a, f, b, "display") + "", c = c.replace(Yb, ""), c = c.replace(/ /g, " "), c.length > d && (d = c.length, e = f); 41847 return e 41848 } 41849 41850 function v(a) { 41851 return null === a ? "0px" : "number" == typeof a ? 0 > a ? "0px" : a + "px" : a.match(/\d$/) ? a + "px" : a 41852 } 41853 41854 function X(a) { 41855 var b, c, d = [], 41856 e = a.aoColumns, 41857 f, g, j, i; 41858 b = a.aaSortingFixed; 41859 c = h.isPlainObject(b); 41860 var m = []; 41861 f = function(a) { 41862 a.length && 41863 !h.isArray(a[0]) ? m.push(a) : h.merge(m, a) 41864 }; 41865 h.isArray(b) && f(b); 41866 c && b.pre && f(b.pre); 41867 f(a.aaSorting); 41868 c && b.post && f(b.post); 41869 for (a = 0; a < m.length; a++) { 41870 i = m[a][0]; 41871 f = e[i].aDataSort; 41872 b = 0; 41873 for (c = f.length; b < c; b++) g = f[b], j = e[g].sType || "string", m[a]._idx === k && (m[a]._idx = h.inArray(m[a][1], e[g].asSorting)), d.push({ 41874 src: i, 41875 col: g, 41876 dir: m[a][1], 41877 index: m[a]._idx, 41878 type: j, 41879 formatter: n.ext.type.order[j + "-pre"] 41880 }) 41881 } 41882 return d 41883 } 41884 41885 function nb(a) { 41886 var b, c, d = [], 41887 e = n.ext.type.order, 41888 f = a.aoData, 41889 g = 0, 41890 j, i = a.aiDisplayMaster, 41891 h; 41892 Ga(a); 41893 h = X(a); 41894 b = 0; 41895 for (c = h.length; b < 41896 c; b++) j = h[b], j.formatter && g++, Ib(a, j.col); 41897 if ("ssp" != y(a) && 0 !== h.length) { 41898 b = 0; 41899 for (c = i.length; b < c; b++) d[i[b]] = b; 41900 g === h.length ? i.sort(function(a, b) { 41901 var c, e, g, j, i = h.length, 41902 k = f[a]._aSortData, 41903 n = f[b]._aSortData; 41904 for (g = 0; g < i; g++) 41905 if (j = h[g], c = k[j.col], e = n[j.col], c = c < e ? -1 : c > e ? 1 : 0, 0 !== c) return "asc" === j.dir ? c : -c; 41906 c = d[a]; 41907 e = d[b]; 41908 return c < e ? -1 : c > e ? 1 : 0 41909 }) : i.sort(function(a, b) { 41910 var c, g, j, i, k = h.length, 41911 n = f[a]._aSortData, 41912 o = f[b]._aSortData; 41913 for (j = 0; j < k; j++) 41914 if (i = h[j], c = n[i.col], g = o[i.col], i = e[i.type + "-" + i.dir] || e["string-" + i.dir], 41915 c = i(c, g), 0 !== c) return c; 41916 c = d[a]; 41917 g = d[b]; 41918 return c < g ? -1 : c > g ? 1 : 0 41919 }) 41920 } 41921 a.bSorted = !0 41922 } 41923 41924 function Jb(a) { 41925 for (var b, c, d = a.aoColumns, e = X(a), a = a.oLanguage.oAria, f = 0, g = d.length; f < g; f++) { 41926 c = d[f]; 41927 var j = c.asSorting; 41928 b = c.sTitle.replace(/<.*?>/g, ""); 41929 var i = c.nTh; 41930 i.removeAttribute("aria-sort"); 41931 c.bSortable && (0 < e.length && e[0].col == f ? (i.setAttribute("aria-sort", "asc" == e[0].dir ? "ascending" : "descending"), c = j[e[0].index + 1] || j[0]) : c = j[0], b += "asc" === c ? a.sSortAscending : a.sSortDescending); 41932 i.setAttribute("aria-label", b) 41933 } 41934 } 41935 41936 function Va(a, 41937 b, c, d) { 41938 var e = a.aaSorting, 41939 f = a.aoColumns[b].asSorting, 41940 g = function(a, b) { 41941 var c = a._idx; 41942 c === k && (c = h.inArray(a[1], f)); 41943 return c + 1 < f.length ? c + 1 : b ? null : 0 41944 }; 41945 "number" === typeof e[0] && (e = a.aaSorting = [e]); 41946 c && a.oFeatures.bSortMulti ? (c = h.inArray(b, D(e, "0")), -1 !== c ? (b = g(e[c], !0), null === b && 1 === e.length && (b = 0), null === b ? e.splice(c, 1) : (e[c][1] = f[b], e[c]._idx = b)) : (e.push([b, f[0], 0]), e[e.length - 1]._idx = 0)) : e.length && e[0][0] == b ? (b = g(e[0]), e.length = 1, e[0][1] = f[b], e[0]._idx = b) : (e.length = 0, e.push([b, f[0]]), e[0]._idx = 0); 41947 T(a); 41948 "function" == 41949 typeof d && d(a) 41950 } 41951 41952 function Ma(a, b, c, d) { 41953 var e = a.aoColumns[c]; 41954 Wa(b, {}, function(b) { 41955 !1 !== e.bSortable && (a.oFeatures.bProcessing ? (C(a, !0), setTimeout(function() { 41956 Va(a, c, b.shiftKey, d); 41957 "ssp" !== y(a) && C(a, !1) 41958 }, 0)) : Va(a, c, b.shiftKey, d)) 41959 }) 41960 } 41961 41962 function wa(a) { 41963 var b = a.aLastSort, 41964 c = a.oClasses.sSortColumn, 41965 d = X(a), 41966 e = a.oFeatures, 41967 f, g; 41968 if (e.bSort && e.bSortClasses) { 41969 e = 0; 41970 for (f = b.length; e < f; e++) g = b[e].src, h(D(a.aoData, "anCells", g)).removeClass(c + (2 > e ? e + 1 : 3)); 41971 e = 0; 41972 for (f = d.length; e < f; e++) g = d[e].src, h(D(a.aoData, "anCells", g)).addClass(c + 41973 (2 > e ? e + 1 : 3)) 41974 } 41975 a.aLastSort = d 41976 } 41977 41978 function Ib(a, b) { 41979 var c = a.aoColumns[b], 41980 d = n.ext.order[c.sSortDataType], 41981 e; 41982 d && (e = d.call(a.oInstance, a, b, ba(a, b))); 41983 for (var f, g = n.ext.type.order[c.sType + "-pre"], j = 0, i = a.aoData.length; j < i; j++) 41984 if (c = a.aoData[j], c._aSortData || (c._aSortData = []), !c._aSortData[b] || d) f = d ? e[j] : B(a, j, b, "sort"), c._aSortData[b] = g ? g(f) : f 41985 } 41986 41987 function xa(a) { 41988 if (a.oFeatures.bStateSave && !a.bDestroying) { 41989 var b = { 41990 time: +new Date, 41991 start: a._iDisplayStart, 41992 length: a._iDisplayLength, 41993 order: h.extend(!0, [], a.aaSorting), 41994 search: Bb(a.oPreviousSearch), 41995 columns: h.map(a.aoColumns, function(b, d) { 41996 return { 41997 visible: b.bVisible, 41998 search: Bb(a.aoPreSearchCols[d]) 41999 } 42000 }) 42001 }; 42002 r(a, "aoStateSaveParams", "stateSaveParams", [a, b]); 42003 a.oSavedState = b; 42004 a.fnStateSaveCallback.call(a.oInstance, a, b) 42005 } 42006 } 42007 42008 function Kb(a, b, c) { 42009 var d, e, f = a.aoColumns, 42010 b = function(b) { 42011 if (b && b.time) { 42012 var g = r(a, "aoStateLoadParams", "stateLoadParams", [a, b]); 42013 if (-1 === h.inArray(!1, g) && (g = a.iStateDuration, !(0 < g && b.time < +new Date - 1E3 * g) && !(b.columns && f.length !== b.columns.length))) { 42014 a.oLoadedState = h.extend(!0, {}, b); 42015 b.start !== k && 42016 (a._iDisplayStart = b.start, a.iInitDisplayStart = b.start); 42017 b.length !== k && (a._iDisplayLength = b.length); 42018 b.order !== k && (a.aaSorting = [], h.each(b.order, function(b, c) { 42019 a.aaSorting.push(c[0] >= f.length ? [0, c[1]] : c) 42020 })); 42021 b.search !== k && h.extend(a.oPreviousSearch, Cb(b.search)); 42022 if (b.columns) { 42023 d = 0; 42024 for (e = b.columns.length; d < e; d++) g = b.columns[d], g.visible !== k && (f[d].bVisible = g.visible), g.search !== k && h.extend(a.aoPreSearchCols[d], Cb(g.search)) 42025 } 42026 r(a, "aoStateLoaded", "stateLoaded", [a, b]) 42027 } 42028 } 42029 c() 42030 }; 42031 if (a.oFeatures.bStateSave) { 42032 var g = 42033 a.fnStateLoadCallback.call(a.oInstance, a, b); 42034 g !== k && b(g) 42035 } else c() 42036 } 42037 42038 function ya(a) { 42039 var b = n.settings, 42040 a = h.inArray(a, D(b, "nTable")); 42041 return -1 !== a ? b[a] : null 42042 } 42043 42044 function K(a, b, c, d) { 42045 c = "DataTables warning: " + (a ? "table id=" + a.sTableId + " - " : "") + c; 42046 d && (c += ". For more information about this error, please see http://datatables.net/tn/" + d); 42047 if (b) E.console && console.log && console.log(c); 42048 else if (b = n.ext, b = b.sErrMode || b.errMode, a && r(a, null, "error", [a, d, c]), "alert" == b) alert(c); 42049 else { 42050 if ("throw" == b) throw Error(c); 42051 "function" == 42052 typeof b && b(a, d, c) 42053 } 42054 } 42055 42056 function F(a, b, c, d) { 42057 h.isArray(c) ? h.each(c, function(c, d) { 42058 h.isArray(d) ? F(a, b, d[0], d[1]) : F(a, b, d) 42059 }) : (d === k && (d = c), b[c] !== k && (a[d] = b[c])) 42060 } 42061 42062 function Xa(a, b, c) { 42063 var d, e; 42064 for (e in b) b.hasOwnProperty(e) && (d = b[e], h.isPlainObject(d) ? (h.isPlainObject(a[e]) || (a[e] = {}), h.extend(!0, a[e], d)) : a[e] = c && "data" !== e && "aaData" !== e && h.isArray(d) ? d.slice() : d); 42065 return a 42066 } 42067 42068 function Wa(a, b, c) { 42069 h(a).on("click.DT", b, function(b) { 42070 h(a).blur(); 42071 c(b) 42072 }).on("keypress.DT", b, function(a) { 42073 13 === a.which && (a.preventDefault(), c(a)) 42074 }).on("selectstart.DT", 42075 function() { 42076 return !1 42077 }) 42078 } 42079 42080 function z(a, b, c, d) { 42081 c && a[b].push({ 42082 fn: c, 42083 sName: d 42084 }) 42085 } 42086 42087 function r(a, b, c, d) { 42088 var e = []; 42089 b && (e = h.map(a[b].slice().reverse(), function(b) { 42090 return b.fn.apply(a.oInstance, d) 42091 })); 42092 null !== c && (b = h.Event(c + ".dt"), h(a.nTable).trigger(b, d), e.push(b.result)); 42093 return e 42094 } 42095 42096 function Sa(a) { 42097 var b = a._iDisplayStart, 42098 c = a.fnDisplayEnd(), 42099 d = a._iDisplayLength; 42100 b >= c && (b = c - d); 42101 b -= b % d; 42102 if (-1 === d || 0 > b) b = 0; 42103 a._iDisplayStart = b 42104 } 42105 42106 function Na(a, b) { 42107 var c = a.renderer, 42108 d = n.ext.renderer[b]; 42109 return h.isPlainObject(c) && c[b] ? d[c[b]] || d._ : "string" === 42110 typeof c ? d[c] || d._ : d._ 42111 } 42112 42113 function y(a) { 42114 return a.oFeatures.bServerSide ? "ssp" : a.ajax || a.sAjaxSource ? "ajax" : "dom" 42115 } 42116 42117 function ia(a, b) { 42118 var c = [], 42119 c = Lb.numbers_length, 42120 d = Math.floor(c / 2); 42121 b <= c ? c = Y(0, b) : a <= d ? (c = Y(0, c - 2), c.push("ellipsis"), c.push(b - 1)) : (a >= b - 1 - d ? c = Y(b - (c - 2), b) : (c = Y(a - d + 2, a + d - 1), c.push("ellipsis"), c.push(b - 1)), c.splice(0, 0, "ellipsis"), c.splice(0, 0, 0)); 42122 c.DT_el = "span"; 42123 return c 42124 } 42125 42126 function Da(a) { 42127 h.each({ 42128 num: function(b) { 42129 return za(b, a) 42130 }, 42131 "num-fmt": function(b) { 42132 return za(b, a, Ya) 42133 }, 42134 "html-num": function(b) { 42135 return za(b, 42136 a, Aa) 42137 }, 42138 "html-num-fmt": function(b) { 42139 return za(b, a, Aa, Ya) 42140 } 42141 }, function(b, c) { 42142 x.type.order[b + a + "-pre"] = c; 42143 b.match(/^html\-/) && (x.type.search[b + a] = x.type.search.html) 42144 }) 42145 } 42146 42147 function Mb(a) { 42148 return function() { 42149 var b = [ya(this[n.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments)); 42150 return n.ext.internal[a].apply(this, b) 42151 } 42152 } 42153 var n = function(a) { 42154 this.$ = function(a, b) { 42155 return this.api(!0).$(a, b) 42156 }; 42157 this._ = function(a, b) { 42158 return this.api(!0).rows(a, b).data() 42159 }; 42160 this.api = function(a) { 42161 return a ? new s(ya(this[x.iApiIndex])) : new s(this) 42162 }; 42163 this.fnAddData = function(a, b) { 42164 var c = this.api(!0), 42165 d = h.isArray(a) && (h.isArray(a[0]) || h.isPlainObject(a[0])) ? c.rows.add(a) : c.row.add(a); 42166 (b === k || b) && c.draw(); 42167 return d.flatten().toArray() 42168 }; 42169 this.fnAdjustColumnSizing = function(a) { 42170 var b = this.api(!0).columns.adjust(), 42171 c = b.settings()[0], 42172 d = c.oScroll; 42173 a === k || a ? b.draw(!1) : ("" !== d.sX || "" !== d.sY) && la(c) 42174 }; 42175 this.fnClearTable = function(a) { 42176 var b = this.api(!0).clear(); 42177 (a === k || a) && b.draw() 42178 }; 42179 this.fnClose = function(a) { 42180 this.api(!0).row(a).child.hide() 42181 }; 42182 this.fnDeleteRow = function(a, 42183 b, c) { 42184 var d = this.api(!0), 42185 a = d.rows(a), 42186 e = a.settings()[0], 42187 h = e.aoData[a[0][0]]; 42188 a.remove(); 42189 b && b.call(this, e, h); 42190 (c === k || c) && d.draw(); 42191 return h 42192 }; 42193 this.fnDestroy = function(a) { 42194 this.api(!0).destroy(a) 42195 }; 42196 this.fnDraw = function(a) { 42197 this.api(!0).draw(a) 42198 }; 42199 this.fnFilter = function(a, b, c, d, e, h) { 42200 e = this.api(!0); 42201 null === b || b === k ? e.search(a, c, d, h) : e.column(b).search(a, c, d, h); 42202 e.draw() 42203 }; 42204 this.fnGetData = function(a, b) { 42205 var c = this.api(!0); 42206 if (a !== k) { 42207 var d = a.nodeName ? a.nodeName.toLowerCase() : ""; 42208 return b !== k || "td" == d || "th" == d ? c.cell(a, b).data() : 42209 c.row(a).data() || null 42210 } 42211 return c.data().toArray() 42212 }; 42213 this.fnGetNodes = function(a) { 42214 var b = this.api(!0); 42215 return a !== k ? b.row(a).node() : b.rows().nodes().flatten().toArray() 42216 }; 42217 this.fnGetPosition = function(a) { 42218 var b = this.api(!0), 42219 c = a.nodeName.toUpperCase(); 42220 return "TR" == c ? b.row(a).index() : "TD" == c || "TH" == c ? (a = b.cell(a).index(), [a.row, a.columnVisible, a.column]) : null 42221 }; 42222 this.fnIsOpen = function(a) { 42223 return this.api(!0).row(a).child.isShown() 42224 }; 42225 this.fnOpen = function(a, b, c) { 42226 return this.api(!0).row(a).child(b, c).show().child()[0] 42227 }; 42228 this.fnPageChange = function(a, b) { 42229 var c = this.api(!0).page(a); 42230 (b === k || b) && c.draw(!1) 42231 }; 42232 this.fnSetColumnVis = function(a, b, c) { 42233 a = this.api(!0).column(a).visible(b); 42234 (c === k || c) && a.columns.adjust().draw() 42235 }; 42236 this.fnSettings = function() { 42237 return ya(this[x.iApiIndex]) 42238 }; 42239 this.fnSort = function(a) { 42240 this.api(!0).order(a).draw() 42241 }; 42242 this.fnSortListener = function(a, b, c) { 42243 this.api(!0).order.listener(a, b, c) 42244 }; 42245 this.fnUpdate = function(a, b, c, d, e) { 42246 var h = this.api(!0); 42247 c === k || null === c ? h.row(b).data(a) : h.cell(b, c).data(a); 42248 (e === k || e) && h.columns.adjust(); 42249 (d === k || d) && h.draw(); 42250 return 0 42251 }; 42252 this.fnVersionCheck = x.fnVersionCheck; 42253 var b = this, 42254 c = a === k, 42255 d = this.length; 42256 c && (a = {}); 42257 this.oApi = this.internal = x.internal; 42258 for (var e in n.ext.internal) e && (this[e] = Mb(e)); 42259 this.each(function() { 42260 var e = {}, 42261 g = 1 < d ? Xa(e, a, !0) : a, 42262 j = 0, 42263 i, e = this.getAttribute("id"), 42264 m = !1, 42265 l = n.defaults, 42266 q = h(this); 42267 if ("table" != this.nodeName.toLowerCase()) K(null, 0, "Non-table node initialisation (" + this.nodeName + ")", 2); 42268 else { 42269 fb(l); 42270 gb(l.column); 42271 J(l, l, !0); 42272 J(l.column, l.column, !0); 42273 J(l, h.extend(g, q.data())); 42274 var t = n.settings, 42275 j = 0; 42276 for (i = t.length; j < i; j++) { 42277 var o = t[j]; 42278 if (o.nTable == this || o.nTHead && o.nTHead.parentNode == this || o.nTFoot && o.nTFoot.parentNode == this) { 42279 var s = g.bRetrieve !== k ? g.bRetrieve : l.bRetrieve; 42280 if (c || s) return o.oInstance; 42281 if (g.bDestroy !== k ? g.bDestroy : l.bDestroy) { 42282 o.oInstance.fnDestroy(); 42283 break 42284 } else { 42285 K(o, 0, "Cannot reinitialise DataTable", 3); 42286 return 42287 } 42288 } 42289 if (o.sTableId == this.id) { 42290 t.splice(j, 1); 42291 break 42292 } 42293 } 42294 if (null === e || "" === e) this.id = e = "DataTables_Table_" + n.ext._unique++; 42295 var p = h.extend(!0, {}, n.models.oSettings, { 42296 sDestroyWidth: q[0].style.width, 42297 sInstance: e, 42298 sTableId: e 42299 }); 42300 p.nTable = this; 42301 p.oApi = b.internal; 42302 p.oInit = g; 42303 t.push(p); 42304 p.oInstance = 1 === b.length ? b : q.dataTable(); 42305 fb(g); 42306 Ca(g.oLanguage); 42307 g.aLengthMenu && !g.iDisplayLength && (g.iDisplayLength = h.isArray(g.aLengthMenu[0]) ? g.aLengthMenu[0][0] : g.aLengthMenu[0]); 42308 g = Xa(h.extend(!0, {}, l), g); 42309 F(p.oFeatures, g, "bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" ")); 42310 F(p, g, ["asStripeClasses", "ajax", "fnServerData", "fnFormatNumber", "sServerMethod", 42311 "aaSorting", "aaSortingFixed", "aLengthMenu", "sPaginationType", "sAjaxSource", "sAjaxDataProp", "iStateDuration", "sDom", "bSortCellsTop", "iTabIndex", "fnStateLoadCallback", "fnStateSaveCallback", "renderer", "searchDelay", "rowId", ["iCookieDuration", "iStateDuration"], 42312 ["oSearch", "oPreviousSearch"], 42313 ["aoSearchCols", "aoPreSearchCols"], 42314 ["iDisplayLength", "_iDisplayLength"] 42315 ]); 42316 F(p.oScroll, g, [ 42317 ["sScrollX", "sX"], 42318 ["sScrollXInner", "sXInner"], 42319 ["sScrollY", "sY"], 42320 ["bScrollCollapse", "bCollapse"] 42321 ]); 42322 F(p.oLanguage, g, "fnInfoCallback"); 42323 z(p, "aoDrawCallback", g.fnDrawCallback, "user"); 42324 z(p, "aoServerParams", g.fnServerParams, "user"); 42325 z(p, "aoStateSaveParams", g.fnStateSaveParams, "user"); 42326 z(p, "aoStateLoadParams", g.fnStateLoadParams, "user"); 42327 z(p, "aoStateLoaded", g.fnStateLoaded, "user"); 42328 z(p, "aoRowCallback", g.fnRowCallback, "user"); 42329 z(p, "aoRowCreatedCallback", g.fnCreatedRow, "user"); 42330 z(p, "aoHeaderCallback", g.fnHeaderCallback, "user"); 42331 z(p, "aoFooterCallback", g.fnFooterCallback, "user"); 42332 z(p, "aoInitComplete", g.fnInitComplete, "user"); 42333 z(p, "aoPreDrawCallback", 42334 g.fnPreDrawCallback, "user"); 42335 p.rowIdFn = S(g.rowId); 42336 hb(p); 42337 var u = p.oClasses; 42338 h.extend(u, n.ext.classes, g.oClasses); 42339 q.addClass(u.sTable); 42340 p.iInitDisplayStart === k && (p.iInitDisplayStart = g.iDisplayStart, p._iDisplayStart = g.iDisplayStart); 42341 null !== g.iDeferLoading && (p.bDeferLoading = !0, e = h.isArray(g.iDeferLoading), p._iRecordsDisplay = e ? g.iDeferLoading[0] : g.iDeferLoading, p._iRecordsTotal = e ? g.iDeferLoading[1] : g.iDeferLoading); 42342 var v = p.oLanguage; 42343 h.extend(!0, v, g.oLanguage); 42344 v.sUrl && (h.ajax({ 42345 dataType: "json", 42346 url: v.sUrl, 42347 success: function(a) { 42348 Ca(a); 42349 J(l.oLanguage, a); 42350 h.extend(true, v, a); 42351 ha(p) 42352 }, 42353 error: function() { 42354 ha(p) 42355 } 42356 }), m = !0); 42357 null === g.asStripeClasses && (p.asStripeClasses = [u.sStripeOdd, u.sStripeEven]); 42358 var e = p.asStripeClasses, 42359 x = q.children("tbody").find("tr").eq(0); - 1 !== h.inArray(!0, h.map(e, function(a) { 42360 return x.hasClass(a) 42361 })) && (h("tbody tr", this).removeClass(e.join(" ")), p.asDestroyStripes = e.slice()); 42362 e = []; 42363 t = this.getElementsByTagName("thead"); 42364 0 !== t.length && (ea(p.aoHeader, t[0]), e = ra(p)); 42365 if (null === g.aoColumns) { 42366 t = []; 42367 j = 0; 42368 for (i = e.length; j < i; j++) t.push(null) 42369 } else t = 42370 g.aoColumns; 42371 j = 0; 42372 for (i = t.length; j < i; j++) Ea(p, e ? e[j] : null); 42373 jb(p, g.aoColumnDefs, t, function(a, b) { 42374 ka(p, a, b) 42375 }); 42376 if (x.length) { 42377 var w = function(a, b) { 42378 return a.getAttribute("data-" + b) !== null ? b : null 42379 }; 42380 h(x[0]).children("th, td").each(function(a, b) { 42381 var c = p.aoColumns[a]; 42382 if (c.mData === a) { 42383 var d = w(b, "sort") || w(b, "order"), 42384 e = w(b, "filter") || w(b, "search"); 42385 if (d !== null || e !== null) { 42386 c.mData = { 42387 _: a + ".display", 42388 sort: d !== null ? a + ".@data-" + d : k, 42389 type: d !== null ? a + ".@data-" + d : k, 42390 filter: e !== null ? a + ".@data-" + e : k 42391 }; 42392 ka(p, a) 42393 } 42394 } 42395 }) 42396 } 42397 var U = p.oFeatures, 42398 e = function() { 42399 if (g.aaSorting === k) { 42400 var a = p.aaSorting; 42401 j = 0; 42402 for (i = a.length; j < i; j++) a[j][1] = p.aoColumns[j].asSorting[0] 42403 } 42404 wa(p); 42405 U.bSort && z(p, "aoDrawCallback", function() { 42406 if (p.bSorted) { 42407 var a = X(p), 42408 b = {}; 42409 h.each(a, function(a, c) { 42410 b[c.src] = c.dir 42411 }); 42412 r(p, null, "order", [p, a, b]); 42413 Jb(p) 42414 } 42415 }); 42416 z(p, "aoDrawCallback", function() { 42417 (p.bSorted || y(p) === "ssp" || U.bDeferRender) && wa(p) 42418 }, "sc"); 42419 var a = q.children("caption").each(function() { 42420 this._captionSide = h(this).css("caption-side") 42421 }), 42422 b = q.children("thead"); 42423 b.length === 0 && (b = h("<thead/>").appendTo(q)); 42424 p.nTHead = b[0]; 42425 b = q.children("tbody"); 42426 b.length === 0 && (b = h("<tbody/>").appendTo(q)); 42427 p.nTBody = b[0]; 42428 b = q.children("tfoot"); 42429 if (b.length === 0 && a.length > 0 && (p.oScroll.sX !== "" || p.oScroll.sY !== "")) b = h("<tfoot/>").appendTo(q); 42430 if (b.length === 0 || b.children().length === 0) q.addClass(u.sNoFooter); 42431 else if (b.length > 0) { 42432 p.nTFoot = b[0]; 42433 ea(p.aoFooter, p.nTFoot) 42434 } 42435 if (g.aaData) 42436 for (j = 0; j < g.aaData.length; j++) O(p, g.aaData[j]); 42437 else(p.bDeferLoading || y(p) == "dom") && na(p, h(p.nTBody).children("tr")); 42438 p.aiDisplay = p.aiDisplayMaster.slice(); 42439 p.bInitialised = true; 42440 m === false && ha(p) 42441 }; 42442 g.bStateSave ? (U.bStateSave = !0, z(p, "aoDrawCallback", xa, "state_save"), Kb(p, g, e)) : e() 42443 } 42444 }); 42445 b = null; 42446 return this 42447 }, 42448 x, s, o, u, Za = {}, 42449 Nb = /[\r\n]/g, 42450 Aa = /<.*?>/g, 42451 Zb = /^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/, 42452 $b = RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)", "g"), 42453 Ya = /[',$£â¬Â¥%\u2009\u202F\u20BD\u20a9\u20BArfkÉÎ]/gi, 42454 M = function(a) { 42455 return !a || !0 === a || "-" === a ? !0 : !1 42456 }, 42457 Ob = function(a) { 42458 var b = parseInt(a, 10); 42459 return !isNaN(b) && 42460 isFinite(a) ? b : null 42461 }, 42462 Pb = function(a, b) { 42463 Za[b] || (Za[b] = RegExp(Qa(b), "g")); 42464 return "string" === typeof a && "." !== b ? a.replace(/\./g, "").replace(Za[b], ".") : a 42465 }, 42466 $a = function(a, b, c) { 42467 var d = "string" === typeof a; 42468 if (M(a)) return !0; 42469 b && d && (a = Pb(a, b)); 42470 c && d && (a = a.replace(Ya, "")); 42471 return !isNaN(parseFloat(a)) && isFinite(a) 42472 }, 42473 Qb = function(a, b, c) { 42474 return M(a) ? !0 : !(M(a) || "string" === typeof a) ? null : $a(a.replace(Aa, ""), b, c) ? !0 : null 42475 }, 42476 D = function(a, b, c) { 42477 var d = [], 42478 e = 0, 42479 f = a.length; 42480 if (c !== k) 42481 for (; e < f; e++) a[e] && a[e][b] && d.push(a[e][b][c]); 42482 else 42483 for (; e < 42484 f; e++) a[e] && d.push(a[e][b]); 42485 return d 42486 }, 42487 ja = function(a, b, c, d) { 42488 var e = [], 42489 f = 0, 42490 g = b.length; 42491 if (d !== k) 42492 for (; f < g; f++) a[b[f]][c] && e.push(a[b[f]][c][d]); 42493 else 42494 for (; f < g; f++) e.push(a[b[f]][c]); 42495 return e 42496 }, 42497 Y = function(a, b) { 42498 var c = [], 42499 d; 42500 b === k ? (b = 0, d = a) : (d = b, b = a); 42501 for (var e = b; e < d; e++) c.push(e); 42502 return c 42503 }, 42504 Rb = function(a) { 42505 for (var b = [], c = 0, d = a.length; c < d; c++) a[c] && b.push(a[c]); 42506 return b 42507 }, 42508 qa = function(a) { 42509 var b; 42510 a: { 42511 if (!(2 > a.length)) { 42512 b = a.slice().sort(); 42513 for (var c = b[0], d = 1, e = b.length; d < e; d++) { 42514 if (b[d] === c) { 42515 b = !1; 42516 break a 42517 } 42518 c = b[d] 42519 } 42520 } 42521 b = !0 42522 } 42523 if (b) return a.slice(); 42524 b = []; 42525 var e = a.length, 42526 f, g = 0, 42527 d = 0; 42528 a: for (; d < e; d++) { 42529 c = a[d]; 42530 for (f = 0; f < g; f++) 42531 if (b[f] === c) continue a; 42532 b.push(c); 42533 g++ 42534 } 42535 return b 42536 }; 42537 n.util = { 42538 throttle: function(a, b) { 42539 var c = b !== k ? b : 200, 42540 d, e; 42541 return function() { 42542 var b = this, 42543 g = +new Date, 42544 j = arguments; 42545 d && g < d + c ? (clearTimeout(e), e = setTimeout(function() { 42546 d = k; 42547 a.apply(b, j) 42548 }, c)) : (d = g, a.apply(b, j)) 42549 } 42550 }, 42551 escapeRegex: function(a) { 42552 return a.replace($b, "\\$1") 42553 } 42554 }; 42555 var A = function(a, b, c) { 42556 a[b] !== k && (a[c] = a[b]) 42557 }, 42558 ca = /\[.*?\]$/, 42559 W = /\(\)$/, 42560 Qa = n.util.escapeRegex, 42561 va = h("<div>")[0], 42562 Wb = va.textContent !== k, 42563 Yb = 42564 /<.*?>/g, 42565 Oa = n.util.throttle, 42566 Sb = [], 42567 w = Array.prototype, 42568 ac = function(a) { 42569 var b, c, d = n.settings, 42570 e = h.map(d, function(a) { 42571 return a.nTable 42572 }); 42573 if (a) { 42574 if (a.nTable && a.oApi) return [a]; 42575 if (a.nodeName && "table" === a.nodeName.toLowerCase()) return b = h.inArray(a, e), -1 !== b ? [d[b]] : null; 42576 if (a && "function" === typeof a.settings) return a.settings().toArray(); 42577 "string" === typeof a ? c = h(a) : a instanceof h && (c = a) 42578 } else return []; 42579 if (c) return c.map(function() { 42580 b = h.inArray(this, e); 42581 return -1 !== b ? d[b] : null 42582 }).toArray() 42583 }; 42584 s = function(a, b) { 42585 if (!(this instanceof s)) return new s(a, b); 42586 var c = [], 42587 d = function(a) { 42588 (a = ac(a)) && (c = c.concat(a)) 42589 }; 42590 if (h.isArray(a)) 42591 for (var e = 0, f = a.length; e < f; e++) d(a[e]); 42592 else d(a); 42593 this.context = qa(c); 42594 b && h.merge(this, b); 42595 this.selector = { 42596 rows: null, 42597 cols: null, 42598 opts: null 42599 }; 42600 s.extend(this, this, Sb) 42601 }; 42602 n.Api = s; 42603 h.extend(s.prototype, { 42604 any: function() { 42605 return 0 !== this.count() 42606 }, 42607 concat: w.concat, 42608 context: [], 42609 count: function() { 42610 return this.flatten().length 42611 }, 42612 each: function(a) { 42613 for (var b = 0, c = this.length; b < c; b++) a.call(this, this[b], b, this); 42614 return this 42615 }, 42616 eq: function(a) { 42617 var b = 42618 this.context; 42619 return b.length > a ? new s(b[a], this[a]) : null 42620 }, 42621 filter: function(a) { 42622 var b = []; 42623 if (w.filter) b = w.filter.call(this, a, this); 42624 else 42625 for (var c = 0, d = this.length; c < d; c++) a.call(this, this[c], c, this) && b.push(this[c]); 42626 return new s(this.context, b) 42627 }, 42628 flatten: function() { 42629 var a = []; 42630 return new s(this.context, a.concat.apply(a, this.toArray())) 42631 }, 42632 join: w.join, 42633 indexOf: w.indexOf || function(a, b) { 42634 for (var c = b || 0, d = this.length; c < d; c++) 42635 if (this[c] === a) return c; 42636 return -1 42637 }, 42638 iterator: function(a, b, c, d) { 42639 var e = [], 42640 f, g, j, h, m, l = this.context, 42641 n, o, u = this.selector; 42642 "string" === typeof a && (d = c, c = b, b = a, a = !1); 42643 g = 0; 42644 for (j = l.length; g < j; g++) { 42645 var r = new s(l[g]); 42646 if ("table" === b) f = c.call(r, l[g], g), f !== k && e.push(f); 42647 else if ("columns" === b || "rows" === b) f = c.call(r, l[g], this[g], g), f !== k && e.push(f); 42648 else if ("column" === b || "column-rows" === b || "row" === b || "cell" === b) { 42649 o = this[g]; 42650 "column-rows" === b && (n = Ba(l[g], u.opts)); 42651 h = 0; 42652 for (m = o.length; h < m; h++) f = o[h], f = "cell" === b ? c.call(r, l[g], f.row, f.column, g, h) : c.call(r, l[g], f, g, h, n), f !== k && e.push(f) 42653 } 42654 } 42655 return e.length || d ? (a = new s(l, a ? 42656 e.concat.apply([], e) : e), b = a.selector, b.rows = u.rows, b.cols = u.cols, b.opts = u.opts, a) : this 42657 }, 42658 lastIndexOf: w.lastIndexOf || function(a, b) { 42659 return this.indexOf.apply(this.toArray.reverse(), arguments) 42660 }, 42661 length: 0, 42662 map: function(a) { 42663 var b = []; 42664 if (w.map) b = w.map.call(this, a, this); 42665 else 42666 for (var c = 0, d = this.length; c < d; c++) b.push(a.call(this, this[c], c)); 42667 return new s(this.context, b) 42668 }, 42669 pluck: function(a) { 42670 return this.map(function(b) { 42671 return b[a] 42672 }) 42673 }, 42674 pop: w.pop, 42675 push: w.push, 42676 reduce: w.reduce || function(a, b) { 42677 return ib(this, a, b, 0, this.length, 42678 1) 42679 }, 42680 reduceRight: w.reduceRight || function(a, b) { 42681 return ib(this, a, b, this.length - 1, -1, -1) 42682 }, 42683 reverse: w.reverse, 42684 selector: null, 42685 shift: w.shift, 42686 slice: function() { 42687 return new s(this.context, this) 42688 }, 42689 sort: w.sort, 42690 splice: w.splice, 42691 toArray: function() { 42692 return w.slice.call(this) 42693 }, 42694 to$: function() { 42695 return h(this) 42696 }, 42697 toJQuery: function() { 42698 return h(this) 42699 }, 42700 unique: function() { 42701 return new s(this.context, qa(this)) 42702 }, 42703 unshift: w.unshift 42704 }); 42705 s.extend = function(a, b, c) { 42706 if (c.length && b && (b instanceof s || b.__dt_wrapper)) { 42707 var d, e, f, g = function(a, b, c) { 42708 return function() { 42709 var d = 42710 b.apply(a, arguments); 42711 s.extend(d, d, c.methodExt); 42712 return d 42713 } 42714 }; 42715 d = 0; 42716 for (e = c.length; d < e; d++) f = c[d], b[f.name] = "function" === typeof f.val ? g(a, f.val, f) : h.isPlainObject(f.val) ? {} : f.val, b[f.name].__dt_wrapper = !0, s.extend(a, b[f.name], f.propExt) 42717 } 42718 }; 42719 s.register = o = function(a, b) { 42720 if (h.isArray(a)) 42721 for (var c = 0, d = a.length; c < d; c++) s.register(a[c], b); 42722 else 42723 for (var e = a.split("."), f = Sb, g, j, c = 0, d = e.length; c < d; c++) { 42724 g = (j = -1 !== e[c].indexOf("()")) ? e[c].replace("()", "") : e[c]; 42725 var i; 42726 a: { 42727 i = 0; 42728 for (var m = f.length; i < m; i++) 42729 if (f[i].name === g) { 42730 i = 42731 f[i]; 42732 break a 42733 } i = null 42734 } 42735 i || (i = { 42736 name: g, 42737 val: {}, 42738 methodExt: [], 42739 propExt: [] 42740 }, f.push(i)); 42741 c === d - 1 ? i.val = b : f = j ? i.methodExt : i.propExt 42742 } 42743 }; 42744 s.registerPlural = u = function(a, b, c) { 42745 s.register(a, c); 42746 s.register(b, function() { 42747 var a = c.apply(this, arguments); 42748 return a === this ? this : a instanceof s ? a.length ? h.isArray(a[0]) ? new s(a.context, a[0]) : a[0] : k : a 42749 }) 42750 }; 42751 o("tables()", function(a) { 42752 var b; 42753 if (a) { 42754 b = s; 42755 var c = this.context; 42756 if ("number" === typeof a) a = [c[a]]; 42757 else var d = h.map(c, function(a) { 42758 return a.nTable 42759 }), 42760 a = h(d).filter(a).map(function() { 42761 var a = h.inArray(this, 42762 d); 42763 return c[a] 42764 }).toArray(); 42765 b = new b(a) 42766 } else b = this; 42767 return b 42768 }); 42769 o("table()", function(a) { 42770 var a = this.tables(a), 42771 b = a.context; 42772 return b.length ? new s(b[0]) : a 42773 }); 42774 u("tables().nodes()", "table().node()", function() { 42775 return this.iterator("table", function(a) { 42776 return a.nTable 42777 }, 1) 42778 }); 42779 u("tables().body()", "table().body()", function() { 42780 return this.iterator("table", function(a) { 42781 return a.nTBody 42782 }, 1) 42783 }); 42784 u("tables().header()", "table().header()", function() { 42785 return this.iterator("table", function(a) { 42786 return a.nTHead 42787 }, 1) 42788 }); 42789 u("tables().footer()", 42790 "table().footer()", 42791 function() { 42792 return this.iterator("table", function(a) { 42793 return a.nTFoot 42794 }, 1) 42795 }); 42796 u("tables().containers()", "table().container()", function() { 42797 return this.iterator("table", function(a) { 42798 return a.nTableWrapper 42799 }, 1) 42800 }); 42801 o("draw()", function(a) { 42802 return this.iterator("table", function(b) { 42803 "page" === a ? P(b) : ("string" === typeof a && (a = "full-hold" === a ? !1 : !0), T(b, !1 === a)) 42804 }) 42805 }); 42806 o("page()", function(a) { 42807 return a === k ? this.page.info().page : this.iterator("table", function(b) { 42808 Ta(b, a) 42809 }) 42810 }); 42811 o("page.info()", function() { 42812 if (0 === 42813 this.context.length) return k; 42814 var a = this.context[0], 42815 b = a._iDisplayStart, 42816 c = a.oFeatures.bPaginate ? a._iDisplayLength : -1, 42817 d = a.fnRecordsDisplay(), 42818 e = -1 === c; 42819 return { 42820 page: e ? 0 : Math.floor(b / c), 42821 pages: e ? 1 : Math.ceil(d / c), 42822 start: b, 42823 end: a.fnDisplayEnd(), 42824 length: c, 42825 recordsTotal: a.fnRecordsTotal(), 42826 recordsDisplay: d, 42827 serverSide: "ssp" === y(a) 42828 } 42829 }); 42830 o("page.len()", function(a) { 42831 return a === k ? 0 !== this.context.length ? this.context[0]._iDisplayLength : k : this.iterator("table", function(b) { 42832 Ra(b, a) 42833 }) 42834 }); 42835 var Tb = function(a, b, c) { 42836 if (c) { 42837 var d = new s(a); 42838 d.one("draw", function() { 42839 c(d.ajax.json()) 42840 }) 42841 } 42842 if ("ssp" == y(a)) T(a, b); 42843 else { 42844 C(a, !0); 42845 var e = a.jqXHR; 42846 e && 4 !== e.readyState && e.abort(); 42847 sa(a, [], function(c) { 42848 oa(a); 42849 for (var c = ta(a, c), d = 0, e = c.length; d < e; d++) O(a, c[d]); 42850 T(a, b); 42851 C(a, !1) 42852 }) 42853 } 42854 }; 42855 o("ajax.json()", function() { 42856 var a = this.context; 42857 if (0 < a.length) return a[0].json 42858 }); 42859 o("ajax.params()", function() { 42860 var a = this.context; 42861 if (0 < a.length) return a[0].oAjaxData 42862 }); 42863 o("ajax.reload()", function(a, b) { 42864 return this.iterator("table", function(c) { 42865 Tb(c, !1 === b, a) 42866 }) 42867 }); 42868 o("ajax.url()", function(a) { 42869 var b = 42870 this.context; 42871 if (a === k) { 42872 if (0 === b.length) return k; 42873 b = b[0]; 42874 return b.ajax ? h.isPlainObject(b.ajax) ? b.ajax.url : b.ajax : b.sAjaxSource 42875 } 42876 return this.iterator("table", function(b) { 42877 h.isPlainObject(b.ajax) ? b.ajax.url = a : b.ajax = a 42878 }) 42879 }); 42880 o("ajax.url().load()", function(a, b) { 42881 return this.iterator("table", function(c) { 42882 Tb(c, !1 === b, a) 42883 }) 42884 }); 42885 var ab = function(a, b, c, d, e) { 42886 var f = [], 42887 g, j, i, m, l, n; 42888 i = typeof b; 42889 if (!b || "string" === i || "function" === i || b.length === k) b = [b]; 42890 i = 0; 42891 for (m = b.length; i < m; i++) { 42892 j = b[i] && b[i].split && !b[i].match(/[\[\(:]/) ? b[i].split(",") : [b[i]]; 42893 l = 0; 42894 for (n = j.length; l < n; l++)(g = c("string" === typeof j[l] ? h.trim(j[l]) : j[l])) && g.length && (f = f.concat(g)) 42895 } 42896 a = x.selector[a]; 42897 if (a.length) { 42898 i = 0; 42899 for (m = a.length; i < m; i++) f = a[i](d, e, f) 42900 } 42901 return qa(f) 42902 }, 42903 bb = function(a) { 42904 a || (a = {}); 42905 a.filter && a.search === k && (a.search = a.filter); 42906 return h.extend({ 42907 search: "none", 42908 order: "current", 42909 page: "all" 42910 }, a) 42911 }, 42912 cb = function(a) { 42913 for (var b = 0, c = a.length; b < c; b++) 42914 if (0 < a[b].length) return a[0] = a[b], a[0].length = 1, a.length = 1, a.context = [a.context[b]], a; 42915 a.length = 0; 42916 return a 42917 }, 42918 Ba = function(a, b) { 42919 var c, 42920 d, e, f = [], 42921 g = a.aiDisplay; 42922 e = a.aiDisplayMaster; 42923 var j = b.search; 42924 c = b.order; 42925 d = b.page; 42926 if ("ssp" == y(a)) return "removed" === j ? [] : Y(0, e.length); 42927 if ("current" == d) { 42928 c = a._iDisplayStart; 42929 for (d = a.fnDisplayEnd(); c < d; c++) f.push(g[c]) 42930 } else if ("current" == c || "applied" == c) 42931 if ("none" == j) f = e.slice(); 42932 else if ("applied" == j) f = g.slice(); 42933 else { 42934 if ("removed" == j) { 42935 var i = {}; 42936 c = 0; 42937 for (d = g.length; c < d; c++) i[g[c]] = null; 42938 f = h.map(e, function(a) { 42939 return !i.hasOwnProperty(a) ? a : null 42940 }) 42941 } 42942 } else if ("index" == c || "original" == c) { 42943 c = 0; 42944 for (d = a.aoData.length; c < d; c++) "none" == 42945 j ? f.push(c) : (e = h.inArray(c, g), (-1 === e && "removed" == j || 0 <= e && "applied" == j) && f.push(c)) 42946 } 42947 return f 42948 }; 42949 o("rows()", function(a, b) { 42950 a === k ? a = "" : h.isPlainObject(a) && (b = a, a = ""); 42951 var b = bb(b), 42952 c = this.iterator("table", function(c) { 42953 var e = b, 42954 f; 42955 return ab("row", a, function(a) { 42956 var b = Ob(a), 42957 i = c.aoData; 42958 if (b !== null && !e) return [b]; 42959 f || (f = Ba(c, e)); 42960 if (b !== null && h.inArray(b, f) !== -1) return [b]; 42961 if (a === null || a === k || a === "") return f; 42962 if (typeof a === "function") return h.map(f, function(b) { 42963 var c = i[b]; 42964 return a(b, c._aData, c.nTr) ? b : null 42965 }); 42966 if (a.nodeName) { 42967 var b = 42968 a._DT_RowIndex, 42969 m = a._DT_CellIndex; 42970 if (b !== k) return i[b] && i[b].nTr === a ? [b] : []; 42971 if (m) return i[m.row] && i[m.row].nTr === a ? [m.row] : []; 42972 b = h(a).closest("*[data-dt-row]"); 42973 return b.length ? [b.data("dt-row")] : [] 42974 } 42975 if (typeof a === "string" && a.charAt(0) === "#") { 42976 b = c.aIds[a.replace(/^#/, "")]; 42977 if (b !== k) return [b.idx] 42978 } 42979 b = Rb(ja(c.aoData, f, "nTr")); 42980 return h(b).filter(a).map(function() { 42981 return this._DT_RowIndex 42982 }).toArray() 42983 }, c, e) 42984 }, 1); 42985 c.selector.rows = a; 42986 c.selector.opts = b; 42987 return c 42988 }); 42989 o("rows().nodes()", function() { 42990 return this.iterator("row", 42991 function(a, b) { 42992 return a.aoData[b].nTr || k 42993 }, 1) 42994 }); 42995 o("rows().data()", function() { 42996 return this.iterator(!0, "rows", function(a, b) { 42997 return ja(a.aoData, b, "_aData") 42998 }, 1) 42999 }); 43000 u("rows().cache()", "row().cache()", function(a) { 43001 return this.iterator("row", function(b, c) { 43002 var d = b.aoData[c]; 43003 return "search" === a ? d._aFilterData : d._aSortData 43004 }, 1) 43005 }); 43006 u("rows().invalidate()", "row().invalidate()", function(a) { 43007 return this.iterator("row", function(b, c) { 43008 da(b, c, a) 43009 }) 43010 }); 43011 u("rows().indexes()", "row().index()", function() { 43012 return this.iterator("row", 43013 function(a, b) { 43014 return b 43015 }, 1) 43016 }); 43017 u("rows().ids()", "row().id()", function(a) { 43018 for (var b = [], c = this.context, d = 0, e = c.length; d < e; d++) 43019 for (var f = 0, g = this[d].length; f < g; f++) { 43020 var h = c[d].rowIdFn(c[d].aoData[this[d][f]]._aData); 43021 b.push((!0 === a ? "#" : "") + h) 43022 } 43023 return new s(c, b) 43024 }); 43025 u("rows().remove()", "row().remove()", function() { 43026 var a = this; 43027 this.iterator("row", function(b, c, d) { 43028 var e = b.aoData, 43029 f = e[c], 43030 g, h, i, m, l; 43031 e.splice(c, 1); 43032 g = 0; 43033 for (h = e.length; g < h; g++) 43034 if (i = e[g], l = i.anCells, null !== i.nTr && (i.nTr._DT_RowIndex = g), null !== l) { 43035 i = 0; 43036 for (m = 43037 l.length; i < m; i++) l[i]._DT_CellIndex.row = g 43038 } pa(b.aiDisplayMaster, c); 43039 pa(b.aiDisplay, c); 43040 pa(a[d], c, !1); 43041 0 < b._iRecordsDisplay && b._iRecordsDisplay--; 43042 Sa(b); 43043 c = b.rowIdFn(f._aData); 43044 c !== k && delete b.aIds[c] 43045 }); 43046 this.iterator("table", function(a) { 43047 for (var c = 0, d = a.aoData.length; c < d; c++) a.aoData[c].idx = c 43048 }); 43049 return this 43050 }); 43051 o("rows.add()", function(a) { 43052 var b = this.iterator("table", function(b) { 43053 var c, f, g, h = []; 43054 f = 0; 43055 for (g = a.length; f < g; f++) c = a[f], c.nodeName && "TR" === c.nodeName.toUpperCase() ? h.push(na(b, c)[0]) : h.push(O(b, c)); 43056 return h 43057 }, 43058 1), 43059 c = this.rows(-1); 43060 c.pop(); 43061 h.merge(c, b); 43062 return c 43063 }); 43064 o("row()", function(a, b) { 43065 return cb(this.rows(a, b)) 43066 }); 43067 o("row().data()", function(a) { 43068 var b = this.context; 43069 if (a === k) return b.length && this.length ? b[0].aoData[this[0]]._aData : k; 43070 var c = b[0].aoData[this[0]]; 43071 c._aData = a; 43072 h.isArray(a) && c.nTr.id && N(b[0].rowId)(a, c.nTr.id); 43073 da(b[0], this[0], "data"); 43074 return this 43075 }); 43076 o("row().node()", function() { 43077 var a = this.context; 43078 return a.length && this.length ? a[0].aoData[this[0]].nTr || null : null 43079 }); 43080 o("row.add()", function(a) { 43081 a instanceof h && 43082 a.length && (a = a[0]); 43083 var b = this.iterator("table", function(b) { 43084 return a.nodeName && "TR" === a.nodeName.toUpperCase() ? na(b, a)[0] : O(b, a) 43085 }); 43086 return this.row(b[0]) 43087 }); 43088 var db = function(a, b) { 43089 var c = a.context; 43090 if (c.length && (c = c[0].aoData[b !== k ? b : a[0]]) && c._details) c._details.remove(), c._detailsShow = k, c._details = k 43091 }, 43092 Ub = function(a, b) { 43093 var c = a.context; 43094 if (c.length && a.length) { 43095 var d = c[0].aoData[a[0]]; 43096 if (d._details) { 43097 (d._detailsShow = b) ? d._details.insertAfter(d.nTr): d._details.detach(); 43098 var e = c[0], 43099 f = new s(e), 43100 g = e.aoData; 43101 f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details"); 43102 0 < D(g, "_details").length && (f.on("draw.dt.DT_details", function(a, b) { 43103 e === b && f.rows({ 43104 page: "current" 43105 }).eq(0).each(function(a) { 43106 a = g[a]; 43107 a._detailsShow && a._details.insertAfter(a.nTr) 43108 }) 43109 }), f.on("column-visibility.dt.DT_details", function(a, b) { 43110 if (e === b) 43111 for (var c, d = V(b), f = 0, h = g.length; f < h; f++) c = g[f], c._details && c._details.children("td[colspan]").attr("colspan", d) 43112 }), f.on("destroy.dt.DT_details", function(a, b) { 43113 if (e === b) 43114 for (var c = 0, d = g.length; c < d; c++) g[c]._details && db(f, c) 43115 })) 43116 } 43117 } 43118 }; 43119 o("row().child()", function(a, b) { 43120 var c = 43121 this.context; 43122 if (a === k) return c.length && this.length ? c[0].aoData[this[0]]._details : k; 43123 if (!0 === a) this.child.show(); 43124 else if (!1 === a) db(this); 43125 else if (c.length && this.length) { 43126 var d = c[0], 43127 c = c[0].aoData[this[0]], 43128 e = [], 43129 f = function(a, b) { 43130 if (h.isArray(a) || a instanceof h) 43131 for (var c = 0, k = a.length; c < k; c++) f(a[c], b); 43132 else a.nodeName && "tr" === a.nodeName.toLowerCase() ? e.push(a) : (c = h("<tr><td/></tr>").addClass(b), h("td", c).addClass(b).html(a)[0].colSpan = V(d), e.push(c[0])) 43133 }; 43134 f(a, b); 43135 c._details && c._details.detach(); 43136 c._details = h(e); 43137 c._detailsShow && c._details.insertAfter(c.nTr) 43138 } 43139 return this 43140 }); 43141 o(["row().child.show()", "row().child().show()"], function() { 43142 Ub(this, !0); 43143 return this 43144 }); 43145 o(["row().child.hide()", "row().child().hide()"], function() { 43146 Ub(this, !1); 43147 return this 43148 }); 43149 o(["row().child.remove()", "row().child().remove()"], function() { 43150 db(this); 43151 return this 43152 }); 43153 o("row().child.isShown()", function() { 43154 var a = this.context; 43155 return a.length && this.length ? a[0].aoData[this[0]]._detailsShow || !1 : !1 43156 }); 43157 var bc = /^([^:]+):(name|visIdx|visible)$/, 43158 Vb = function(a, b, 43159 c, d, e) { 43160 for (var c = [], d = 0, f = e.length; d < f; d++) c.push(B(a, e[d], b)); 43161 return c 43162 }; 43163 o("columns()", function(a, b) { 43164 a === k ? a = "" : h.isPlainObject(a) && (b = a, a = ""); 43165 var b = bb(b), 43166 c = this.iterator("table", function(c) { 43167 var e = a, 43168 f = b, 43169 g = c.aoColumns, 43170 j = D(g, "sName"), 43171 i = D(g, "nTh"); 43172 return ab("column", e, function(a) { 43173 var b = Ob(a); 43174 if (a === "") return Y(g.length); 43175 if (b !== null) return [b >= 0 ? b : g.length + b]; 43176 if (typeof a === "function") { 43177 var e = Ba(c, f); 43178 return h.map(g, function(b, f) { 43179 return a(f, Vb(c, f, 0, 0, e), i[f]) ? f : null 43180 }) 43181 } 43182 var k = typeof a === "string" ? a.match(bc) : 43183 ""; 43184 if (k) switch (k[2]) { 43185 case "visIdx": 43186 case "visible": 43187 b = parseInt(k[1], 10); 43188 if (b < 0) { 43189 var n = h.map(g, function(a, b) { 43190 return a.bVisible ? b : null 43191 }); 43192 return [n[n.length + b]] 43193 } 43194 return [aa(c, b)]; 43195 case "name": 43196 return h.map(j, function(a, b) { 43197 return a === k[1] ? b : null 43198 }); 43199 default: 43200 return [] 43201 } 43202 if (a.nodeName && a._DT_CellIndex) return [a._DT_CellIndex.column]; 43203 b = h(i).filter(a).map(function() { 43204 return h.inArray(this, i) 43205 }).toArray(); 43206 if (b.length || !a.nodeName) return b; 43207 b = h(a).closest("*[data-dt-column]"); 43208 return b.length ? [b.data("dt-column")] : [] 43209 }, c, f) 43210 }, 43211 1); 43212 c.selector.cols = a; 43213 c.selector.opts = b; 43214 return c 43215 }); 43216 u("columns().header()", "column().header()", function() { 43217 return this.iterator("column", function(a, b) { 43218 return a.aoColumns[b].nTh 43219 }, 1) 43220 }); 43221 u("columns().footer()", "column().footer()", function() { 43222 return this.iterator("column", function(a, b) { 43223 return a.aoColumns[b].nTf 43224 }, 1) 43225 }); 43226 u("columns().data()", "column().data()", function() { 43227 return this.iterator("column-rows", Vb, 1) 43228 }); 43229 u("columns().dataSrc()", "column().dataSrc()", function() { 43230 return this.iterator("column", function(a, b) { 43231 return a.aoColumns[b].mData 43232 }, 43233 1) 43234 }); 43235 u("columns().cache()", "column().cache()", function(a) { 43236 return this.iterator("column-rows", function(b, c, d, e, f) { 43237 return ja(b.aoData, f, "search" === a ? "_aFilterData" : "_aSortData", c) 43238 }, 1) 43239 }); 43240 u("columns().nodes()", "column().nodes()", function() { 43241 return this.iterator("column-rows", function(a, b, c, d, e) { 43242 return ja(a.aoData, e, "anCells", b) 43243 }, 1) 43244 }); 43245 u("columns().visible()", "column().visible()", function(a, b) { 43246 var c = this.iterator("column", function(b, c) { 43247 if (a === k) return b.aoColumns[c].bVisible; 43248 var f = b.aoColumns, 43249 g = f[c], 43250 j = b.aoData, 43251 i, m, l; 43252 if (a !== k && g.bVisible !== a) { 43253 if (a) { 43254 var n = h.inArray(!0, D(f, "bVisible"), c + 1); 43255 i = 0; 43256 for (m = j.length; i < m; i++) l = j[i].nTr, f = j[i].anCells, l && l.insertBefore(f[c], f[n] || null) 43257 } else h(D(b.aoData, "anCells", c)).detach(); 43258 g.bVisible = a; 43259 fa(b, b.aoHeader); 43260 fa(b, b.aoFooter); 43261 b.aiDisplay.length || h(b.nTBody).find("td[colspan]").attr("colspan", V(b)); 43262 xa(b) 43263 } 43264 }); 43265 a !== k && (this.iterator("column", function(c, e) { 43266 r(c, null, "column-visibility", [c, e, a, b]) 43267 }), (b === k || b) && this.columns.adjust()); 43268 return c 43269 }); 43270 u("columns().indexes()", "column().index()", 43271 function(a) { 43272 return this.iterator("column", function(b, c) { 43273 return "visible" === a ? ba(b, c) : c 43274 }, 1) 43275 }); 43276 o("columns.adjust()", function() { 43277 return this.iterator("table", function(a) { 43278 $(a) 43279 }, 1) 43280 }); 43281 o("column.index()", function(a, b) { 43282 if (0 !== this.context.length) { 43283 var c = this.context[0]; 43284 if ("fromVisible" === a || "toData" === a) return aa(c, b); 43285 if ("fromData" === a || "toVisible" === a) return ba(c, b) 43286 } 43287 }); 43288 o("column()", function(a, b) { 43289 return cb(this.columns(a, b)) 43290 }); 43291 o("cells()", function(a, b, c) { 43292 h.isPlainObject(a) && (a.row === k ? (c = a, a = null) : (c = b, b = null)); 43293 h.isPlainObject(b) && (c = b, b = null); 43294 if (null === b || b === k) return this.iterator("table", function(b) { 43295 var d = a, 43296 e = bb(c), 43297 f = b.aoData, 43298 g = Ba(b, e), 43299 j = Rb(ja(f, g, "anCells")), 43300 i = h([].concat.apply([], j)), 43301 l, m = b.aoColumns.length, 43302 n, o, u, s, r, v; 43303 return ab("cell", d, function(a) { 43304 var c = typeof a === "function"; 43305 if (a === null || a === k || c) { 43306 n = []; 43307 o = 0; 43308 for (u = g.length; o < u; o++) { 43309 l = g[o]; 43310 for (s = 0; s < m; s++) { 43311 r = { 43312 row: l, 43313 column: s 43314 }; 43315 if (c) { 43316 v = f[l]; 43317 a(r, B(b, l, s), v.anCells ? v.anCells[s] : null) && n.push(r) 43318 } else n.push(r) 43319 } 43320 } 43321 return n 43322 } 43323 if (h.isPlainObject(a)) return a.column !== 43324 k && a.row !== k && h.inArray(a.row, g) !== -1 ? [a] : []; 43325 c = i.filter(a).map(function(a, b) { 43326 return { 43327 row: b._DT_CellIndex.row, 43328 column: b._DT_CellIndex.column 43329 } 43330 }).toArray(); 43331 if (c.length || !a.nodeName) return c; 43332 v = h(a).closest("*[data-dt-row]"); 43333 return v.length ? [{ 43334 row: v.data("dt-row"), 43335 column: v.data("dt-column") 43336 }] : [] 43337 }, b, e) 43338 }); 43339 var d = this.columns(b), 43340 e = this.rows(a), 43341 f, g, j, i, m; 43342 this.iterator("table", function(a, b) { 43343 f = []; 43344 g = 0; 43345 for (j = e[b].length; g < j; g++) { 43346 i = 0; 43347 for (m = d[b].length; i < m; i++) f.push({ 43348 row: e[b][g], 43349 column: d[b][i] 43350 }) 43351 } 43352 }, 1); 43353 var l = this.cells(f, 43354 c); 43355 h.extend(l.selector, { 43356 cols: b, 43357 rows: a, 43358 opts: c 43359 }); 43360 return l 43361 }); 43362 u("cells().nodes()", "cell().node()", function() { 43363 return this.iterator("cell", function(a, b, c) { 43364 return (a = a.aoData[b]) && a.anCells ? a.anCells[c] : k 43365 }, 1) 43366 }); 43367 o("cells().data()", function() { 43368 return this.iterator("cell", function(a, b, c) { 43369 return B(a, b, c) 43370 }, 1) 43371 }); 43372 u("cells().cache()", "cell().cache()", function(a) { 43373 a = "search" === a ? "_aFilterData" : "_aSortData"; 43374 return this.iterator("cell", function(b, c, d) { 43375 return b.aoData[c][a][d] 43376 }, 1) 43377 }); 43378 u("cells().render()", "cell().render()", 43379 function(a) { 43380 return this.iterator("cell", function(b, c, d) { 43381 return B(b, c, d, a) 43382 }, 1) 43383 }); 43384 u("cells().indexes()", "cell().index()", function() { 43385 return this.iterator("cell", function(a, b, c) { 43386 return { 43387 row: b, 43388 column: c, 43389 columnVisible: ba(a, c) 43390 } 43391 }, 1) 43392 }); 43393 u("cells().invalidate()", "cell().invalidate()", function(a) { 43394 return this.iterator("cell", function(b, c, d) { 43395 da(b, c, a, d) 43396 }) 43397 }); 43398 o("cell()", function(a, b, c) { 43399 return cb(this.cells(a, b, c)) 43400 }); 43401 o("cell().data()", function(a) { 43402 var b = this.context, 43403 c = this[0]; 43404 if (a === k) return b.length && c.length ? B(b[0], 43405 c[0].row, c[0].column) : k; 43406 kb(b[0], c[0].row, c[0].column, a); 43407 da(b[0], c[0].row, "data", c[0].column); 43408 return this 43409 }); 43410 o("order()", function(a, b) { 43411 var c = this.context; 43412 if (a === k) return 0 !== c.length ? c[0].aaSorting : k; 43413 "number" === typeof a ? a = [ 43414 [a, b] 43415 ] : a.length && !h.isArray(a[0]) && (a = Array.prototype.slice.call(arguments)); 43416 return this.iterator("table", function(b) { 43417 b.aaSorting = a.slice() 43418 }) 43419 }); 43420 o("order.listener()", function(a, b, c) { 43421 return this.iterator("table", function(d) { 43422 Ma(d, a, b, c) 43423 }) 43424 }); 43425 o("order.fixed()", function(a) { 43426 if (!a) { 43427 var b = 43428 this.context, 43429 b = b.length ? b[0].aaSortingFixed : k; 43430 return h.isArray(b) ? { 43431 pre: b 43432 } : b 43433 } 43434 return this.iterator("table", function(b) { 43435 b.aaSortingFixed = h.extend(!0, {}, a) 43436 }) 43437 }); 43438 o(["columns().order()", "column().order()"], function(a) { 43439 var b = this; 43440 return this.iterator("table", function(c, d) { 43441 var e = []; 43442 h.each(b[d], function(b, c) { 43443 e.push([c, a]) 43444 }); 43445 c.aaSorting = e 43446 }) 43447 }); 43448 o("search()", function(a, b, c, d) { 43449 var e = this.context; 43450 return a === k ? 0 !== e.length ? e[0].oPreviousSearch.sSearch : k : this.iterator("table", function(e) { 43451 e.oFeatures.bFilter && ga(e, 43452 h.extend({}, e.oPreviousSearch, { 43453 sSearch: a + "", 43454 bRegex: null === b ? !1 : b, 43455 bSmart: null === c ? !0 : c, 43456 bCaseInsensitive: null === d ? !0 : d 43457 }), 1) 43458 }) 43459 }); 43460 u("columns().search()", "column().search()", function(a, b, c, d) { 43461 return this.iterator("column", function(e, f) { 43462 var g = e.aoPreSearchCols; 43463 if (a === k) return g[f].sSearch; 43464 e.oFeatures.bFilter && (h.extend(g[f], { 43465 sSearch: a + "", 43466 bRegex: null === b ? !1 : b, 43467 bSmart: null === c ? !0 : c, 43468 bCaseInsensitive: null === d ? !0 : d 43469 }), ga(e, e.oPreviousSearch, 1)) 43470 }) 43471 }); 43472 o("state()", function() { 43473 return this.context.length ? this.context[0].oSavedState : 43474 null 43475 }); 43476 o("state.clear()", function() { 43477 return this.iterator("table", function(a) { 43478 a.fnStateSaveCallback.call(a.oInstance, a, {}) 43479 }) 43480 }); 43481 o("state.loaded()", function() { 43482 return this.context.length ? this.context[0].oLoadedState : null 43483 }); 43484 o("state.save()", function() { 43485 return this.iterator("table", function(a) { 43486 xa(a) 43487 }) 43488 }); 43489 n.versionCheck = n.fnVersionCheck = function(a) { 43490 for (var b = n.version.split("."), a = a.split("."), c, d, e = 0, f = a.length; e < f; e++) 43491 if (c = parseInt(b[e], 10) || 0, d = parseInt(a[e], 10) || 0, c !== d) return c > d; 43492 return !0 43493 }; 43494 n.isDataTable = 43495 n.fnIsDataTable = function(a) { 43496 var b = h(a).get(0), 43497 c = !1; 43498 if (a instanceof n.Api) return !0; 43499 h.each(n.settings, function(a, e) { 43500 var f = e.nScrollHead ? h("table", e.nScrollHead)[0] : null, 43501 g = e.nScrollFoot ? h("table", e.nScrollFoot)[0] : null; 43502 if (e.nTable === b || f === b || g === b) c = !0 43503 }); 43504 return c 43505 }; 43506 n.tables = n.fnTables = function(a) { 43507 var b = !1; 43508 h.isPlainObject(a) && (b = a.api, a = a.visible); 43509 var c = h.map(n.settings, function(b) { 43510 if (!a || a && h(b.nTable).is(":visible")) return b.nTable 43511 }); 43512 return b ? new s(c) : c 43513 }; 43514 n.camelToHungarian = J; 43515 o("$()", function(a, b) { 43516 var c = 43517 this.rows(b).nodes(), 43518 c = h(c); 43519 return h([].concat(c.filter(a).toArray(), c.find(a).toArray())) 43520 }); 43521 h.each(["on", "one", "off"], function(a, b) { 43522 o(b + "()", function() { 43523 var a = Array.prototype.slice.call(arguments); 43524 a[0] = h.map(a[0].split(/\s/), function(a) { 43525 return !a.match(/\.dt\b/) ? a + ".dt" : a 43526 }).join(" "); 43527 var d = h(this.tables().nodes()); 43528 d[b].apply(d, a); 43529 return this 43530 }) 43531 }); 43532 o("clear()", function() { 43533 return this.iterator("table", function(a) { 43534 oa(a) 43535 }) 43536 }); 43537 o("settings()", function() { 43538 return new s(this.context, this.context) 43539 }); 43540 o("init()", function() { 43541 var a = 43542 this.context; 43543 return a.length ? a[0].oInit : null 43544 }); 43545 o("data()", function() { 43546 return this.iterator("table", function(a) { 43547 return D(a.aoData, "_aData") 43548 }).flatten() 43549 }); 43550 o("destroy()", function(a) { 43551 a = a || !1; 43552 return this.iterator("table", function(b) { 43553 var c = b.nTableWrapper.parentNode, 43554 d = b.oClasses, 43555 e = b.nTable, 43556 f = b.nTBody, 43557 g = b.nTHead, 43558 j = b.nTFoot, 43559 i = h(e), 43560 f = h(f), 43561 k = h(b.nTableWrapper), 43562 l = h.map(b.aoData, function(a) { 43563 return a.nTr 43564 }), 43565 o; 43566 b.bDestroying = !0; 43567 r(b, "aoDestroyCallback", "destroy", [b]); 43568 a || (new s(b)).columns().visible(!0); 43569 k.off(".DT").find(":not(tbody *)").off(".DT"); 43570 h(E).off(".DT-" + b.sInstance); 43571 e != g.parentNode && (i.children("thead").detach(), i.append(g)); 43572 j && e != j.parentNode && (i.children("tfoot").detach(), i.append(j)); 43573 b.aaSorting = []; 43574 b.aaSortingFixed = []; 43575 wa(b); 43576 h(l).removeClass(b.asStripeClasses.join(" ")); 43577 h("th, td", g).removeClass(d.sSortable + " " + d.sSortableAsc + " " + d.sSortableDesc + " " + d.sSortableNone); 43578 f.children().detach(); 43579 f.append(l); 43580 g = a ? "remove" : "detach"; 43581 i[g](); 43582 k[g](); 43583 !a && c && (c.insertBefore(e, b.nTableReinsertBefore), i.css("width", b.sDestroyWidth).removeClass(d.sTable), 43584 (o = b.asDestroyStripes.length) && f.children().each(function(a) { 43585 h(this).addClass(b.asDestroyStripes[a % o]) 43586 })); 43587 c = h.inArray(b, n.settings); - 1 !== c && n.settings.splice(c, 1) 43588 }) 43589 }); 43590 h.each(["column", "row", "cell"], function(a, b) { 43591 o(b + "s().every()", function(a) { 43592 var d = this.selector.opts, 43593 e = this; 43594 return this.iterator(b, function(f, g, h, i, m) { 43595 a.call(e[b](g, "cell" === b ? h : d, "cell" === b ? d : k), g, h, i, m) 43596 }) 43597 }) 43598 }); 43599 o("i18n()", function(a, b, c) { 43600 var d = this.context[0], 43601 a = S(a)(d.oLanguage); 43602 a === k && (a = b); 43603 c !== k && h.isPlainObject(a) && (a = a[c] !== k ? a[c] : 43604 a._); 43605 return a.replace("%d", c) 43606 }); 43607 n.version = "1.10.19"; 43608 n.settings = []; 43609 n.models = {}; 43610 n.models.oSearch = { 43611 bCaseInsensitive: !0, 43612 sSearch: "", 43613 bRegex: !1, 43614 bSmart: !0 43615 }; 43616 n.models.oRow = { 43617 nTr: null, 43618 anCells: null, 43619 _aData: [], 43620 _aSortData: null, 43621 _aFilterData: null, 43622 _sFilterRow: null, 43623 _sRowStripe: "", 43624 src: null, 43625 idx: -1 43626 }; 43627 n.models.oColumn = { 43628 idx: null, 43629 aDataSort: null, 43630 asSorting: null, 43631 bSearchable: null, 43632 bSortable: null, 43633 bVisible: null, 43634 _sManualType: null, 43635 _bAttrSrc: !1, 43636 fnCreatedCell: null, 43637 fnGetData: null, 43638 fnSetData: null, 43639 mData: null, 43640 mRender: null, 43641 nTh: null, 43642 nTf: null, 43643 sClass: null, 43644 sContentPadding: null, 43645 sDefaultContent: null, 43646 sName: null, 43647 sSortDataType: "std", 43648 sSortingClass: null, 43649 sSortingClassJUI: null, 43650 sTitle: null, 43651 sType: null, 43652 sWidth: null, 43653 sWidthOrig: null 43654 }; 43655 n.defaults = { 43656 aaData: null, 43657 aaSorting: [ 43658 [0, "asc"] 43659 ], 43660 aaSortingFixed: [], 43661 ajax: null, 43662 aLengthMenu: [10, 25, 50, 100], 43663 aoColumns: null, 43664 aoColumnDefs: null, 43665 aoSearchCols: [], 43666 asStripeClasses: null, 43667 bAutoWidth: !0, 43668 bDeferRender: !1, 43669 bDestroy: !1, 43670 bFilter: !0, 43671 bInfo: !0, 43672 bLengthChange: !0, 43673 bPaginate: !0, 43674 bProcessing: !1, 43675 bRetrieve: !1, 43676 bScrollCollapse: !1, 43677 bServerSide: !1, 43678 bSort: !0, 43679 bSortMulti: !0, 43680 bSortCellsTop: !1, 43681 bSortClasses: !0, 43682 bStateSave: !1, 43683 fnCreatedRow: null, 43684 fnDrawCallback: null, 43685 fnFooterCallback: null, 43686 fnFormatNumber: function(a) { 43687 return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g, this.oLanguage.sThousands) 43688 }, 43689 fnHeaderCallback: null, 43690 fnInfoCallback: null, 43691 fnInitComplete: null, 43692 fnPreDrawCallback: null, 43693 fnRowCallback: null, 43694 fnServerData: null, 43695 fnServerParams: null, 43696 fnStateLoadCallback: function(a) { 43697 try { 43698 return JSON.parse((-1 === a.iStateDuration ? sessionStorage : localStorage).getItem("DataTables_" + 43699 a.sInstance + "_" + location.pathname)) 43700 } catch (b) {} 43701 }, 43702 fnStateLoadParams: null, 43703 fnStateLoaded: null, 43704 fnStateSaveCallback: function(a, b) { 43705 try { 43706 (-1 === a.iStateDuration ? sessionStorage : localStorage).setItem("DataTables_" + a.sInstance + "_" + location.pathname, JSON.stringify(b)) 43707 } catch (c) {} 43708 }, 43709 fnStateSaveParams: null, 43710 iStateDuration: 7200, 43711 iDeferLoading: null, 43712 iDisplayLength: 10, 43713 iDisplayStart: 0, 43714 iTabIndex: 0, 43715 oClasses: {}, 43716 oLanguage: { 43717 oAria: { 43718 sSortAscending: ": activate to sort column ascending", 43719 sSortDescending: ": activate to sort column desce
43719nding" 43720 }, 43721 oPaginate: { 43722 sFirst: "First", 43723 sLast: "Last", 43724 sNext: "", //Next 43725 sPrevious: "" //Previous 43726 }, 43727 sEmptyTable: "No data available in table", 43728 sInfo: "Showing _START_ to _END_ of _TOTAL_ entries", 43729 sInfoEmpty: "Showing 0 to 0 of 0 entries", 43730 sInfoFiltered: "(filtered from _MAX_ total entries)", 43731 sInfoPostFix: "", 43732 sDecimal: "", 43733 sThousands: ",", 43734 sLengthMenu: "Show _MENU_ entries", 43735 sLoadingRecords: "Loading...", 43736 sProcessing: "Processing...", 43737 sSearch: "Search:", 43738 sSearchPlaceholder: "", 43739 sUrl: "", 43740 sZeroRecords: "No matching records found" 43741 }, 43742 oSearch: h.extend({}, 43743 n.models.oSearch), 43744 sAjaxDataProp: "data", 43745 sAjaxSource: null, 43746 sDom: "lfrtip", 43747 searchDelay: null, 43748 sPaginationType: "simple_numbers", 43749 sScrollX: "", 43750 sScrollXInner: "", 43751 sScrollY: "", 43752 sServerMethod: "GET", 43753 renderer: null, 43754 rowId: "DT_RowId" 43755 }; 43756 Z(n.defaults); 43757 n.defaults.column = { 43758 aDataSort: null, 43759 iDataSort: -1, 43760 asSorting: ["asc", "desc"], 43761 bSearchable: !0, 43762 bSortable: !0, 43763 bVisible: !0, 43764 fnCreatedCell: null, 43765 mData: null, 43766 mRender: null, 43767 sCellType: "td", 43768 sClass: "", 43769 sContentPadding: "", 43770 sDefaultContent: null, 43771 sName: "", 43772 sSortDataType: "std", 43773 sTitle: null, 43774 sType: null, 43775 sWidth: null 43776 }; 43777 Z(n.defaults.column); 43778 n.models.oSettings = { 43779 oFeatures: { 43780 bAutoWidth: null, 43781 bDeferRender: null, 43782 bFilter: null, 43783 bInfo: null, 43784 bLengthChange: null, 43785 bPaginate: null, 43786 bProcessing: null,
vendor: 12,192 bytes, lines 43787-44144
43787 bServerSide: null, 43788 bSort: null, 43789 bSortMulti: null, 43790 bSortClasses: null, 43791 bStateSave: null 43792 }, 43793 oScroll: { 43794 bCollapse: null, 43795 iBarWidth: 0, 43796 sX: null, 43797 sXInner: null, 43798 sY: null 43799 }, 43800 oLanguage: { 43801 fnInfoCallback: null 43802 }, 43803 oBrowser: { 43804 bScrollOversize: !1, 43805 bScrollbarLeft: !1, 43806 bBounding: !1, 43807 barWidth: 0 43808 }, 43809 ajax: null, 43810 aanFeatures: [], 43811 aoData: [], 43812 aiDisplay: [], 43813 aiDisplayMaster: [], 43814 aIds: {}, 43815 aoColumns: [], 43816 aoHeader: [], 43817 aoFooter: [], 43818 oPreviousSearch: {}, 43819 aoPreSearchCols: [], 43820 aaSorting: null, 43821 aaSortingFixed: [], 43822 asStripeClasses: null, 43823 asDestroyStripes: [], 43824 sDestroyWidth: 0, 43825 aoRowCallback: [], 43826 aoHeaderCallback: [], 43827 aoFooterCallback: [], 43828 aoDrawCallback: [], 43829 aoRowCreatedCallback: [], 43830 aoPreDrawCallback: [], 43831 aoInitComplete: [], 43832 aoStateSaveParams: [], 43833 aoStateLoadParams: [], 43834 aoStateLoaded: [], 43835 sTableId: "", 43836 nTable: null, 43837 nTHead: null, 43838 nTFoot: null, 43839 nTBody: null, 43840 nTableWrapper: null, 43841 bDeferLoading: !1, 43842 bInitialised: !1, 43843 aoOpenRows: [], 43844 sDom: null, 43845 searchDelay: null, 43846 sPaginationType: "two_button", 43847 iStateDuration: 0, 43848 aoStateSave: [], 43849 aoStateLoad: [], 43850 oSavedState: null, 43851 oLoadedState: null, 43852 sAjaxSource: null, 43853 sAjaxDataProp: null, 43854 bAjaxDataGet: !0, 43855 jqXHR: null, 43856 json: k, 43857 oAjaxData: k, 43858 fnServerData: null, 43859 aoServerParams: [], 43860 sServerMethod: null, 43861 fnFormatNumber: null, 43862 aLengthMenu: null, 43863 iDraw: 0, 43864 bDrawing: !1, 43865 iDrawError: -1, 43866 _iDisplayLength: 10, 43867 _iDisplayStart: 0, 43868 _iRecordsTotal: 0, 43869 _iRecordsDisplay: 0, 43870 oClasses: {}, 43871 bFiltered: !1, 43872 bSorted: !1, 43873 bSortCellsTop: null, 43874 oInit: null, 43875 aoDestroyCallback: [], 43876 fnRecordsTotal: function() { 43877 return "ssp" == y(this) ? 1 * this._iRecordsTotal : 43878 this.aiDisplayMaster.length 43879 }, 43880 fnRecordsDisplay: function() { 43881 return "ssp" == y(this) ? 1 * this._iRecordsDisplay : this.aiDisplay.length 43882 }, 43883 fnDisplayEnd: function() { 43884 var a = this._iDisplayLength, 43885 b = this._iDisplayStart, 43886 c = b + a, 43887 d = this.aiDisplay.length, 43888 e = this.oFeatures, 43889 f = e.bPaginate; 43890 return e.bServerSide ? !1 === f || -1 === a ? b + d : Math.min(b + a, this._iRecordsDisplay) : !f || c > d || -1 === a ? d : c 43891 }, 43892 oInstance: null, 43893 sInstance: null, 43894 iTabIndex: 0, 43895 nScrollHead: null, 43896 nScrollFoot: null, 43897 aLastSort: [], 43898 oPlugins: {}, 43899 rowIdFn: null, 43900 rowId: null 43901 }; 43902 n.ext = x = { 43903 buttons: {}, 43904 classes: {}, 43905 builder: "-source-", 43906 errMode: "alert", 43907 feature: [], 43908 search: [], 43909 selector: { 43910 cell: [], 43911 column: [], 43912 row: [] 43913 }, 43914 internal: {}, 43915 legacy: { 43916 ajax: null 43917 }, 43918 pager: {}, 43919 renderer: { 43920 pageButton: {}, 43921 header: {} 43922 }, 43923 order: {}, 43924 type: { 43925 detect: [], 43926 search: {}, 43927 order: {} 43928 }, 43929 _unique: 0, 43930 fnVersionCheck: n.fnVersionCheck, 43931 iApiIndex: 0, 43932 oJUIClasses: {}, 43933 sVersion: n.version 43934 }; 43935 h.extend(x, { 43936 afnFiltering: x.search, 43937 aTypes: x.type.detect, 43938 ofnSearch: x.type.search, 43939 oSort: x.type.order, 43940 afnSortData: x.order, 43941 aoFeatures: x.feature, 43942 oApi: x.internal, 43943 oStdClasses: x.classes, 43944 oPagination: x.pager 43945 }); 43946 h.extend(n.ext.classes, { 43947 sTable: "dataTable", 43948 sNoFooter: "no-footer", 43949 sPageButton: "paginate_button", 43950 sPageButtonActive: "current", 43951 sPageButtonDisabled: "disabled", 43952 sStripeOdd: "odd", 43953 sStripeEven: "even", 43954 sRowEmpty: "dataTables_empty", 43955 sWrapper: "dataTables_wrapper", 43956 sFilter: "dataTables_filter", 43957 sInfo: "dataTables_info", 43958 sPaging: "dataTables_paginate paging_", 43959 sLength: "dataTables_length", 43960 sProcessing: "dataTables_processing", 43961 sSortAsc: "sorting_asc", 43962 sSortDesc: "sorting_desc", 43963 sSortable: "sorting", 43964 sSortableAsc: "sorting_asc_disabled", 43965 sSortableDesc: "sorting_desc_disabled", 43966 sSortableNone: "sorting_disabled", 43967 sSortColumn: "sorting_", 43968 sFilterInput: "", 43969 sLengthSelect: "", 43970 sScrollWrapper: "dataTables_scroll", 43971 sScrollHead: "dataTables_scrollHead", 43972 sScrollHeadInner: "dataTables_scrollHeadInner", 43973 sScrollBody: "dataTables_scrollBody", 43974 sScrollFoot: "dataTables_scrollFoot", 43975 sScrollFootInner: "dataTables_scrollFootInner", 43976 sHeaderTH: "", 43977 sFooterTH: "", 43978 sSortJUIAsc: "", 43979 sSortJUIDesc: "", 43980 sSortJUI: "", 43981 sSortJUIAscAllowed: "", 43982 sSortJUIDescAllowed: "", 43983 sSortJUIWrapper: "", 43984 sSortIcon: "", 43985 sJUIHeader: "", 43986 sJUIFooter: "" 43987 }); 43988 var Lb = n.ext.pager; 43989 h.extend(Lb, { 43990 simple: function() { 43991 return ["previous", "next"] 43992 }, 43993 full: function() { 43994 return ["first", "previous", "next", "last"] 43995 }, 43996 numbers: function(a, b) { 43997 return [ia(a, b)] 43998 }, 43999 simple_numbers: function(a, b) { 44000 return ["previous", ia(a, b), "next"] 44001 }, 44002 full_numbers: function(a, b) { 44003 return ["first", "previous", ia(a, b), "next", "last"] 44004 }, 44005 first_last_numbers: function(a, b) { 44006 return ["first", ia(a, b), "last"] 44007 }, 44008 _numbers: ia, 44009 numbers_length: 7 44010 }); 44011 h.extend(!0, n.ext.renderer, { 44012 pageButton: { 44013 _: function(a, b, c, d, e, 44014 f) { 44015 var g = a.oClasses, 44016 j = a.oLanguage.oPaginate, 44017 i = a.oLanguage.oAria.paginate || {}, 44018 m, l, n = 0, 44019 o = function(b, d) { 44020 var k, s, u, r, v = function(b) { 44021 Ta(a, b.data.action, true) 44022 }; 44023 k = 0; 44024 for (s = d.length; k < s; k++) { 44025 r = d[k]; 44026 if (h.isArray(r)) { 44027 u = h("<" + (r.DT_el || "div") + "/>").appendTo(b); 44028 o(u, r) 44029 } else { 44030 m = null; 44031 l = ""; 44032 switch (r) { 44033 case "ellipsis": 44034 b.append('<span class="ellipsis">…</span>'); 44035 break; 44036 case "first": 44037 m = j.sFirst; 44038 l = r + (e > 0 ? "" : " " + g.sPageButtonDisabled); 44039 break; 44040 case "previous": 44041 m = j.sPrevious; 44042 l = r + (e > 0 ? "" : " " + g.sPageButtonDisabled); 44043 break; 44044 case "next": 44045 m = 44046 j.sNext; 44047 l = r + (e < f - 1 ? "" : " " + g.sPageButtonDisabled); 44048 break; 44049 case "last": 44050 m = j.sLast; 44051 l = r + (e < f - 1 ? "" : " " + g.sPageButtonDisabled); 44052 break; 44053 default: 44054 m = r + 1; 44055 l = e === r ? g.sPageButtonActive : "" 44056 } 44057 if (m !== null) { 44058 u = h("<a>", { 44059 "class": g.sPageButton + " " + l, 44060 "aria-controls": a.sTableId, 44061 "aria-label": i[r], 44062 "data-dt-idx": n, 44063 tabindex: a.iTabIndex, 44064 id: c === 0 && typeof r === "string" ? a.sTableId + "_" + r : null 44065 }).html(m).appendTo(b); 44066 Wa(u, { 44067 action: r 44068 }, v); 44069 n++ 44070 } 44071 } 44072 } 44073 }, 44074 s; 44075 try { 44076 s = h(b).find(H.activeElement).data("dt-idx") 44077 } catch (u) {} 44078 o(h(b).empty(), d); 44079 s !== k && h(b).find("[data-dt-idx=" + 44080 s + "]").focus() 44081 } 44082 } 44083 }); 44084 h.extend(n.ext.type.detect, [function(a, b) { 44085 var c = b.oLanguage.sDecimal; 44086 return $a(a, c) ? "num" + c : null 44087 }, function(a) { 44088 if (a && !(a instanceof Date) && !Zb.test(a)) return null; 44089 var b = Date.parse(a); 44090 return null !== b && !isNaN(b) || M(a) ? "date" : null 44091 }, function(a, b) { 44092 var c = b.oLanguage.sDecimal; 44093 return $a(a, c, !0) ? "num-fmt" + c : null 44094 }, function(a, b) { 44095 var c = b.oLanguage.sDecimal; 44096 return Qb(a, c) ? "html-num" + c : null 44097 }, function(a, b) { 44098 var c = b.oLanguage.sDecimal; 44099 return Qb(a, c, !0) ? "html-num-fmt" + c : null 44100 }, function(a) { 44101 return M(a) || 44102 "string" === typeof a && -1 !== a.indexOf("<") ? "html" : null 44103 }]); 44104 h.extend(n.ext.type.search, { 44105 html: function(a) { 44106 return M(a) ? a : "string" === typeof a ? a.replace(Nb, " ").replace(Aa, "") : "" 44107 }, 44108 string: function(a) { 44109 return M(a) ? a : "string" === typeof a ? a.replace(Nb, " ") : a 44110 } 44111 }); 44112 var za = function(a, b, c, d) { 44113 if (0 !== a && (!a || "-" === a)) return -Infinity; 44114 b && (a = Pb(a, b)); 44115 a.replace && (c && (a = a.replace(c, "")), d && (a = a.replace(d, ""))); 44116 return 1 * a 44117 }; 44118 h.extend(x.type.order, { 44119 "date-pre": function(a) { 44120 a = Date.parse(a); 44121 return isNaN(a) ? -Infinity : a 44122 }, 44123 "html-pre": function(a) { 44124 return M(a) ? 44125 "" : a.replace ? a.replace(/<.*?>/g, "").toLowerCase() : a + "" 44126 }, 44127 "string-pre": function(a) { 44128 return M(a) ? "" : "string" === typeof a ? a.toLowerCase() : !a.toString ? "" : a.toString() 44129 }, 44130 "string-asc": function(a, b) { 44131 return a < b ? -1 : a > b ? 1 : 0 44132 }, 44133 "string-desc": function(a, b) { 44134 return a < b ? 1 : a > b ? -1 : 0 44135 } 44136 }); 44137 Da(""); 44138 h.extend(!0, n.ext.renderer, { 44139 header: { 44140 _: function(a, b, c, d) { 44141 h(a.nTable).on("order.dt.DT", function(e, f, g, h) { 44142 if (a === f) { 44143 e = c.idx; 44144 b.removeClass(c.sSortingClass + " " + d.sSortAsc + " " + d.sSortDesc).addClass(h[e] == "asc" ? d.sSortAsc : h[e] == "de
44144sc" ? d.sSortDesc : 44145 c.sSortingClass) 44146 } 44147 }) 44148 }, 44149 jqueryui: function(a, b, c, d) { 44150 h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon + " " + c.sSortingClassJUI)).appendTo(b); 44151 h(a.nTable).on("order.dt.DT", function(e, f, g, h) { 44152 if (a === f) { 44153 e = c.idx; 44154 b.removeClass(d.sSortAsc + " " + d.sSortDesc).addClass(h[e] == "asc" ? d.sSortAsc : h[e] == "desc" ? d.sSortDesc : c.sSortingClass); 44155 b.find("span." + d.sSortIcon).removeClass(d.sSortJUIAsc + " " + d.sSortJUIDesc + " " + d.sSortJUI + " " + d.sSortJUIAscAllowed + " " + d.sSortJUIDescAllowed).addClass(h[e] == 44156 "asc" ? d.sSortJUIAsc : h[e] == "desc" ? d.sSortJUIDesc : c.sSortingClassJUI) 44157 } 44158 }) 44159 } 44160 } 44161 }); 44162 var eb = function(a) { 44163 return "string" === typeof a ? a.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """) : a 44164 }; 44165 n.render = { 44166 number: function(a, b, c, d, e) { 44167 return { 44168 display: function(f) { 44169 if ("number" !== typeof f && "string" !== typeof f) return f; 44170 var g = 0 > f ? "-" : "", 44171 h = parseFloat(f); 44172 if (isNaN(h)) return eb(f); 44173 h = h.toFixed(c); 44174 f = Math.abs(h); 44175 h = parseInt(f, 10); 44176 f = c ? b + (f - h).toFixed(c).substring(2) : ""; 44177 return g + (d || "") + h.toString().replace(/\B(?=(\d{3})+(?!\d))/g, 44178 a) + f + (e || "") 44179 } 44180 } 44181 }, 44182 text: function() { 44183 return { 44184 display: eb, 44185 filter: eb 44186 } 44187 } 44188 }; 44189 h.extend(n.ext.internal, { 44190 _fnExternApiFunc: Mb, 44191 _fnBuildAjax: sa, 44192 _fnAjaxUpdate: mb, 44193 _fnAjaxParameters: vb, 44194 _fnAjaxUpdateDraw: wb, 44195 _fnAjaxDataSrc: ta, 44196 _fnAddColumn: Ea, 44197 _fnColumnOptions: ka, 44198 _fnAdjustColumnSizing: $, 44199 _fnVisibleToColumnIndex: aa, 44200 _fnColumnIndexToVisible: ba, 44201 _fnVisbleColumns: V, 44202 _fnGetColumns: ma, 44203 _fnColumnTypes: Ga, 44204 _fnApplyColumnDefs: jb, 44205 _fnHungarianMap: Z, 44206 _fnCamelToHungarian: J, 44207 _fnLanguageCompat: Ca, 44208 _fnBrowserDetect: hb, 44209 _fnAddData: O, 44210 _fnAddTr: na, 44211 _fnNodeToDataIndex: function(a, 44212 b) { 44213 return b._DT_RowIndex !== k ? b._DT_RowIndex : null 44214 }, 44215 _fnNodeToColumnIndex: function(a, b, c) { 44216 return h.inArray(c, a.aoData[b].anCells) 44217 }, 44218 _fnGetCellData: B, 44219 _fnSetCellData: kb, 44220 _fnSplitObjNotation: Ja, 44221 _fnGetObjectDataFn: S, 44222 _fnSetObjectDataFn: N, 44223 _fnGetDataMaster: Ka, 44224 _fnClearTable: oa, 44225 _fnDeleteIndex: pa, 44226 _fnInvalidate: da, 44227 _fnGetRowElements: Ia, 44228 _fnCreateTr: Ha, 44229 _fnBuildHead: lb, 44230 _fnDrawHead: fa, 44231 _fnDraw: P, 44232 _fnReDraw: T, 44233 _fnAddOptionsHtml: ob, 44234 _fnDetectHeader: ea, 44235 _fnGetUniqueThs: ra, 44236 _fnFeatureHtmlFilter: qb, 44237 _fnFilterComplete: ga, 44238 _fnFilterCustom: zb, 44239 _fnFilterColumn: yb, 44240 _fnFilter: xb, 44241 _fnFilterCreateSearch: Pa, 44242 _fnEscapeRegex: Qa, 44243 _fnFilterData: Ab, 44244 _fnFeatureHtmlInfo: tb, 44245 _fnUpdateInfo: Db, 44246 _fnInfoMacros: Eb, 44247 _fnInitialise: ha, 44248 _fnInitComplete: ua, 44249 _fnLengthChange: Ra, 44250 _fnFeatureHtmlLength: pb, 44251 _fnFeatureHtmlPaginate: ub, 44252 _fnPageChange: Ta, 44253 _fnFeatureHtmlProcessing: rb, 44254 _fnProcessingDisplay: C, 44255 _fnFeatureHtmlTable: sb, 44256 _fnScrollDraw: la, 44257 _fnApplyToChildren: I, 44258 _fnCalculateColumnWidths: Fa, 44259 _fnThrottle: Oa, 44260 _fnConvertToWidth: Fb, 44261 _fnGetWidestNode: Gb, 44262 _fnGetMaxLenString: Hb, 44263 _fnStringToCss: v, 44264 _fnSortFlatten: X, 44265 _fnSort: nb, 44266 _fnSortAria: Jb, 44267 _fnSortListener: Va, 44268 _fnSortAttachListener: Ma, 44269 _fnSortingClasses: wa, 44270 _fnSortData: Ib, 44271 _fnSaveState: xa, 44272 _fnLoadState: Kb, 44273 _fnSettingsFromNode: ya, 44274 _fnLog: K, 44275 _fnMap: F, 44276 _fnBindAction: Wa, 44277 _fnCallbackReg: z, 44278 _fnCallbackFire: r, 44279 _fnLengthOverflow: Sa, 44280 _fnRenderer: Na, 44281 _fnDataSource: y, 44282 _fnRowAttributes: La, 44283 _fnExtend: Xa, 44284 _fnCalculateEnd: function() {} 44285 }); 44286 h.fn.dataTable = n; 44287 n.$ = h; 44288 h.fn.dataTableSettings = n.settings; 44289 h.fn.dataTableExt = n.ext; 44290 h.fn.DataTable = function(a) { 44291 return h(this).dataTable(a).api() 44292 }; 44293 h.each(n, function(a, b) { 44294 h.fn.DataTable[a] = b 44295 }); 44296 return h.fn.dataTable 44297}); 44298 44299$(document).ready(function () { 44300$('.topiclist-search').selectric(); 44301 44302 //$('select').selectric(); 44303}); 44304 $('#table1').DataTable({ 44305 "searching": false, 44306 "ordering": false, 44307 "info": false, 44308 "lengthChange": false 44309 }); 44310 44311 44312if($('#totalRecords').attr('data-total-records')!=null && $('#totalRecords').attr('data-total-records')!=undefined) //Suma 44313 { var TotalRecords = JSON.parse($('#totalRecords').attr('data-total-records')); 44314 var TotalResults = TotalRecords.searchResult.results; 44315 console.log(TotalRecords); 44316 } 44317 44318 $(document).ready(function () { 44319 function GetRecords(){ 44320 var input = { 44321 q: $('#searchNewsText')[0].value, 44322 month :$('#Month')[0].value, 44323 year: $('#Year')[0].value, 44324 viewType : $('#viewType').attr('data-view-type'), 44325 newsEventsPath : $('#newsEventsPath').val() 44326 }; 44327 44328 $.ajax({ 44329 type: "GET", 44330 url: "/dupont/newsevents/result", 44331 data: input, 44332 success: successCallback, 44333 dataType: "json", 44334 contentType: "application/json", 44335 }); 44336 }; 44337 44338 //On change of Month dropdown 44339 $('#Month').change(function(){ 44340 GetRecords(); 44341 }); 44342 44343 //On change of Year dropdown
44344 $('#Year').change(function(){ 44345 GetRecords(); 44346 }); 44347 44348 //On click of Search button 44349 $('#searchNews').click(function () { 44350 GetRecords(); 44351 }); 44352 44353 $('#showAllNews').click(function () { 44354 var input = { 44355 q: "", 44356 month :"All", 44357 year: "All", 44358 viewType : $('#viewType').attr('data-view-type'), 44359 newsEventsPath : $('#newsEventsPath').val() 44360 }; 44361 44362 //Code to reset filters when clicked on ShowallNews 44363 $('#Month')[0].value ="All"; 44364 $('#Year')[0].value = "All"; 44365 if($('#searchText')[0] != undefined){ 44366 $('#searchText')[0].value =""; 44367 } 44368 $('select').selectric(); 44369 44370 $.ajax({ 44371 type: "GET", 44372 url: "/dupont/newsevents/result", 44373 data: input, 44374 success: successCallback, 44375 dataType: "json", 44376 contentType: "application/json", 44377 }); 44378 44379 }); 44380 44381 44382 function successCallback(data) { 44383 44384 var results = data.searchResult.results; 44385 //TotalResults = results; 44386 44387 var searchResults = ""; 44388 var viewType= $('#viewType').attr('data-view-type'); 44389 44390 searchResults ='<table class="table table-condensed" id="table1">\ 44391 <thead>\ 44392 <tr role="row">\ 44393 <th class="sorting_disabled" rowspan="1" colspan="1" style="width: 860px;">'; 44394 if(viewType=="eventsView"){ 44395 searchResults +="EVENTS</th>"; 44396 searchResults +="<th class='sorting_disabled' rowspan='1' colspan='1' style='width: 209px;'>LOCATION</th>"; 44397 } 44398 else if(viewType=="webinarsView"){ 44399 searchResults +="WEBINARS</th>"; 44400 } 44401 else{ 44402 searchResults +="NEWS</th>"; 44403 } 44404 44405 44406 searchResults +='<th class="sorting_disabled" rowspan="1" colspan="1" style="width: 131px;">DATE</th> \ 44407 </tr>\ 44408 </thead>\ 44409 <tbody'; 44410 44411 for (var i = 0; i < results.length; i++) { 44412 44413 searchResults += '<tr>\ 44414 <td><a href='+results[i].pageLink+'>'+ results[i].linkTitle + '</a></td>' 44415 44416 if(viewType=="eventsView"){ 44417 searchResults +='<td>'+ results[i].eventsLocation + '</td>'; 44418 44419 } 44420 44421 searchResults +='<td>'+ results[i].newsEventsPubDate + '</td>\ 44422 </tr>'; 44423 44424 } 44425 44426 searchResults += '</tbody></table>'; 44427 $('.row.table')[0].innerHTML = searchResults; 44428 44429 $('.results')[0].innerHTML = results.length+ " Results"; 44430 44431 $('#table1').DataTable({ 44432 "destroy":true, 44433 "searching": false, 44434 "ordering": false, 44435 "info": false, 44436 "lengthChange": false 44437 }); 44438 44439 44440 } 44441 }); 44442 44443 44444$('body').on('mouseenter', '.cad', function(e){ 44445 $(this).find('.btn').addClass('hovered'); 44446}); 44447 44448$('body').on('mouseleave', '.cad', function(e){ 44449 $(this).find('.btn').removeClass('hovered'); 44450}); 44451 44452 44453/* new script */ 44454//window.onload=function(){ 44455 console.log("NCarousel"); 44456 $('.NewsCarcousal').slick({ 44457 infinite: false, 44458 slidesToShow: 3.1, 44459 slidesToScroll: 3, 44460 dots:false, 44461 // arrows: true, 44462 autoplay: false, 44463 autoplaySpeed: 2000, 44464 prevArrow: $(".prev-slider"), 44465 nextArrow: $(".next-slider"), 44466 responsive: [ 44467 { 44468 breakpoint: 1200, 44469 settings: { 44470 slidesToShow: 3.1, 44471 slidesToScroll: 3 44472 } 44473 }, 44474 { 44475 breakpoint: 992, 44476 settings: { 44477 slidesToShow: 1, 44478 slidesToScroll: 1 44479 } 44480 }, 44481 { 44482 breakpoint: 768, 44483 settings: { 44484 slidesToShow: 1, 44485 slidesToScroll: 1 44486 } 44487 }, 44488 { 44489 breakpoint: 600, 44490 settings: { 44491 slidesToShow: 1, 44492 slidesToScroll: 1 44493 } 44494 }, 44495 { 44496 breakpoint: 479, 44497 settings: { 44498 slidesToShow: 1, 44499 slidesToScroll: 1 44500 } 44501 } 44502 44503 44504 ] 44505 }); 44506 44507//}; 44508/* new script end */ 44509/* Showing see All with limit of news carousel items*/ 44510$( document ).ready(function() { 44511 var maxItems = $('.NewsCarcousal .slick-list .slick-track .slick-slide:last-child').data('slick-index'); 44512 console.log("maxItems"+maxItems); 44513 if(maxItems <= 2){ 44514 $('.NewsCTitle .see_text').hide(); 44515 } 44516}); 44517 44518/* End see All with limit */ 44519$('document').ready(function(){ 44520 console.log("IM in...YES"); 44521 var d = new Date(); 44522 var n = d.getDate(); 44523 44524 var day = d.getDay(); 44525 var weekday=new Array("S","Mo","Tu","We","Th", 44526 "Fr","Sa") 44527 44528 44529 $("#topiclinkDate").html(n); 44530 44531 $("#topiclinkDay").html(weekday[d.getDay()]); 44532 44533}); 44534var val1 = $('.color1val').val(); 44535var val2 = $('.color2val').val(); 44536 44537 44538$('.fixed:nth-child(odd)').css('background-color',val1); 44539$('.fixed:nth-child(even)').css('background-color',val2); 44540 44541$(' .editmode .tab-pane.fade').addClass('active in'); 44542$('.tab__content .tab-pane:first').addClass('active in'); 44543/*for desktop*/ 44544 if($(window).width()>768){ 44545 var onloaddesc = $('.tab__content .tab-pane.active.in').html(); 44546 $('.tab__content').hide(); 44547 $('.tabbed-description').html( onloaddesc); 44548 44549 $(document).ready(function(){ 44550 $('.tab-pane.fade.active').addClass('in'); 44551 44552 $('.nav-item').click(function(){ 44553 $('.nav-item').removeClass('active'); 44554 $(this).addClass('active'); 44555 $('.tab-pane.fade').removeClass('in'); 44556 $(this).find('.tab-pane.fade').addClass('active in'); 44557 var tabdesc = $('.tab-pane.active.in').html(); 44558 $('.tab__content').hide(); 44559 $('.tabbed-description').html( tabdesc); 44560 }); 44561 }) 44562 44563 var maxheighttab = $('.tabbed-navbar .nav-pills').height(); 44564 $('.tabbed-description').css('min-height',maxheighttab); 44565 } 44566 /*for mobile accordian*/ 44567 else{ 44568 $('.tabbed-description').hide(); 44569 $('.tab__content').hide(); 44570 $('.nav-item.active .tab__content').show(); 44571 $('.nav-item').click(function(){ 44572 $('.tab__content').hide(); 44573 $('.nav-item').removeClass('active'); 44574 $(this).addClass('active'); 44575 $(this).find('.tab__content').show(); 44576 44577 44578 }) 44579 44580 } 44581 44582 44583 44584function openTab(tabThis,tabId, isMobile) { 44585 if(typeof(isMobile) == 'undefined'){ 44586 isMobile = tabId; 44587 tabId = tabThis; 44588 tabThis = document.getElementById(tabId); 44589 } 44590 var tabContent = "tab-content"; 44591 var tabActive = " tab-active" 44592 var dataIdStr = "data"; 44593 var tab = "tab"; 44594 var expandActive = ""; 44595 44596 if(isMobile){ 44597 expandActive = "mbtn-expand"; 44598 tabContent = "mtab-content"; 44599 tabActive = "mtab-active"; 44600 dataIdStr = "mdata"; 44601 tab = "mtab"; 44602 } 44603 44604 var dataInd = tabId.substring(isMobile?4:3, tabId.trim().length); 44605 var elementId = dataIdStr+dataInd; 44606 var expandActiveId = expandActive+dataInd; 44607 var i, tabcontent, tablinks; 44608 try{ 44609 if(!isMobile){ 44610 tabcontent = $(tabThis).parent().next().children(); 44611 for (i = 0; i < tabcontent.length; i++) { 44612 tabcontent[i].style.display = "none"; 44613 } 44614 44615 tablinks = $(tabThis).siblings();//document.getElementsByClassName(tab); 44616 for (i = 0; i < tablinks.length; i++) { 44617 tablinks[i].className = tablinks[i].className.replace(tabActive, ""); 44618 } 44619 44620 $(tabThis).parent().next().find("div#"+elementId).show(); 44621 //document.getElementById(elementId).style.display = "block"; 44622 $(tabThis).addClass(tabActive); 44623 }else{ 44624 var expandedSign = document.getElementById(expandActiveId).textContent; 44625 if(expandedSign == "-"){ 44626 //Collapse 44627 document.getElementById(expandActiveId).textContent = "+"; 44628 document.getElementById(elementId).style.display = "none"; 44629 document.getElementById(tabId).className.replace(tabActive, ""); 44630 }else{ 44631 //Expand 44632 document.getElementById(expandActiveId).textContent = "-"; 44633 document.getElementById(elementId).style.display = "block"; 44634 document.getElementById(tabId).className += tabActive; 44635 } 44636 } 44637 }catch(e){ 44638 44639 } 44640} 44641$(document).ready(function() { 44642 if($('.water-vertical-tab-component').length) { 44643 $(".tab").each(function(){ 44644 if($(this).attr("id") == "btn0"){ 44645 openTab(this,"btn0", false); 44646 } 44647 }) 44648 } 44649}); 44650 44651 44652$(function() { 44653 44654 var horTabComp = function(cl) { 44655 44656 this.el = $($('.' + cl)[0]); 44657 44658 }; 44659 44660 44661 44662 horTabComp.prototype.showActiveTabbedContent = function() { 44663 44664 var self = this; 44665 44666 this.el.on('click','.title',function(evnt){ 44667 44668 var selectedTab = $(evnt.currentTarget).parent().parent(); 44669 var tabNo = selectedTab.attr('data-tab-no'); 44670 self.el.find('.tab-con-wraps').removeClass('active'); 44671 self.el.find('.hor-tab-item').removeClass('active'); 44672 selectedTab.addClass('active'); 44673 self.el.find('.wrap-item-'+tabNo).addClass('active'); 44674 44675 }); 44676 44677 }; 44678 44679 44680 44681 44682 44683 $.each($('.tabbed-hor-view'), function(i, v) { 44684 $(v).addClass("thv-" + i); 44685 (new horTabComp("thv-" + i)).showActiveTabbedContent(); 44686 44687 }); 44688 44689 /* Full bg image view ends*/ 44690 44691 44692 44693}); 44694$(document).ready(function () { 44695 44696 $('#AtticTab .nav-item').on('click',function(evnt){ 44697 44698 var currentTarget = $(evnt.currentTarget); 44699 var tabName = currentTarget.find('a').attr('data-href'); 44700 $('.img-card-tabbed-images-slide').find('.tab-panel').removeClass('active').hide(); 44701 $('.img-card-tabbed-images-slide').find(tabName).removeClass('fade').addClass('active').show(); 44702 $($('.tab-panel.active').find('.tab-card-row')).slick('slickRemove'); 44703 $.each($('.tab-panel'),function(i,v){ 44704 $($(v).find('.slick-dots li')[0]).click(); 44705 }); 44706 44707 }); 44708 44709 // card slick 44710 var $slider = $('.tab-card-row'); 44711 44712 $('.tab-card-view .tab-card-grid').matchHeight(); 44713 if ($(window).width() > 320) { 44714 $slider.slick({ 44715 arrows: true, 44716 slidesToShow: 1, 44717 infinite: false, 44718 dots: true, 44719 slidesToScroll: 1, 44720 /* customPaging: function (slider, i) { 44721 console.log(slider); 44722 return (i + 1) + '/' + slider.slideCount; 44723 },*/ 44724 responsive: [{ 44725 breakpoint: 1200, 44726 settings: { 44727 slidesToShow: 1, 44728 slidesToScroll: 1 44729 } 44730 }, { 44731 breakpoint: 1024, 44732 settings: { 44733 slidesToShow: 1, 44734 slidesToScroll: 1 44735 } 44736 }, { 44737 breakpoint: 768, 44738 settings: { 44739 slidesToShow: 1, 44740 slidesToScroll: 1 44741 } 44742 }] 44743 }); 44744 } else { 44745 $slider.slick('unslick'); 44746 } 44747 44748 // card slick end 44749 44750 // banner slick 44751 44752 $('.tab-imageslide .tab-img-slide').matchHeight(); 44753 if ($(window).width() > 320) { 44754 $('.tab-imageslide .tab-img-carousel .tab-img-row').slick({ 44755 arrows: true, 44756 slidesToShow: 1, 44757 infinite: false, 44758 //dots: true, 44759 slidesToScroll:1, 44760 responsive: [{ 44761 breakpoint: 1200, 44762 settings: { 44763 slidesToShow: 1, 44764 slidesToScroll: 1 44765 } 44766 }, { 44767 breakpoint: 1024, 44768 settings: { 44769 slidesToShow: 1, 44770 slidesToScroll: 1 44771 } 44772 }, { 44773 breakpoint: 768, 44774 settings: { 44775 slidesToShow: 1, 44776 slidesToScroll: 1 44777 } 44778 }] 44779 }); 44780 } else { 44781 $('.tab-imageslide .tab-img-carousel .tab-img-row').slick('unslick'); 44782 } 44783 // banner slick end 44784 44785 44786 44787 44788 44789 44790 if($('.img-card-tabbed-images-slide').length>0){ 44791 setTimeout(function(){ 44792 $('.img-card-tabbed-images-slide').find('.tab-panel').hide(); 44793 $($('.img-card-tabbed-images-slide').find('.tab-panel')[0]).show(); 44794 },5000); 44795 } 44796 44797 //refershing on click 44798 44799 $(document).ready(function () { 44800 $(".nav-item").click(function(){ 44801 $('.tab-img-row').slick('refresh'); 44802 44803 }); 44804 44805 /* $(".nav-item").click(function(){ 44806 $('.tab-card-row').slick('refresh'); 44807 });*/ 44808 44809 }); 44810 //refershing on click end 44811 44812 44813 44814/* $('.tab-card-row').each(function(ind,v){ 44815 44816 var $quoteSlickElement = $(this); 44817 var $quoteSlickCounter = $(this).find('.slick-list'); 44818 $quoteSlickCounter.append('<div class="slider__counter"></div>'); 44819 $quoteSlickElement.on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { 44820 //currentSlide is undefined on init -- set it to 0 in this case (currentSlide is 0 based) 44821 var i = (currentSlide ? currentSlide : 0) + 1; 44822 44823 $quoteSlickCounter.find('.slider__counter').html( '<span class="current_slide">' + i + '</span> / <span class="total_slides"> ' + slick.slideCount + '</span>'); 44824 44825 }); 44826 if(ind==0){ 44827 $quoteSlickCounter.find('.slider__counter').html( '<span class="current_slide">' + 1 + '</span> / <span class="total_slides"> ' + $('.tab-card-row').find('.card-column').length+ '</span>'); 44828 } 44829 44830});*/ 44831var $status = $('.slidescount'); 44832var $slickElement = $('.tab-card-row'); 44833 44834$slickElement.on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { 44835 //currentSlide is undefined on init -- set it to 0 in this case (currentSlide is 0 based) 44836 var i = (currentSlide ? currentSlide : 0) + 1; 44837 $status.text(i + '/' + $(this).find('.card-column').length); 44838}); 44839 44840$slickElement.slick({ 44841 slide: 'img', 44842 autoplay: true, 44843 dots: true 44844}); 44845 44846 44847 //slider count 44848 44849 /* if ($slider.length) { 44850 var currentSlide; 44851 var slidesCount;
44852 var sliderCounter = $('<div class="slider__counter"> </div>'); 44853 44854 44855 var updateSliderCounter = function(slick, currentIndex) { 44856 currentSlide = slick.slickCurrentSlide() + 1; 44857 slidesCount = slick.slideCount; 44858 $(sliderCounter).text(currentSlide + '/' +slidesCount) 44859 }; 44860 44861 $slider.on('init', function(event, slick) { 44862 $slider.append(sliderCounter); 44863 updateSliderCounter(slick); 44864 }); 44865 44866 $slider.on('afterChange', function(event, slick, currentSlide) { 44867 updateSliderCounter(slick, currentSlide); 44868 }); 44869 44870 $slider.slick(); 44871 }*/ 44872 44873 //slider count end 44874 44875 }); 44876 44877 44878 44879 44880 44881 44882 44883 44884 44885 $(document).on("click", ".subbtn", function(e){ 44886 44887 if(document.getElementById("subsbutton")!=null && document.getElementById("subsbutton")!=undefined) 44888 var EmailVal1 = (document.getElementById("subsbutton").value) 44889 44890 var testEmail = /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i 44891 44892if(testEmail.test(EmailVal1) && EmailVal1!=""){ 44893 44894 var TIformPathURL = $(".subbtn").attr('data-formpath'); 44895 44896 if(TIformPathURL!=null || TIformPathURL!=undefined || TIformPathURL!='') { 44897 if(TIformPathURL.indexOf('?') > 0) { 44898 location.href= TIformPathURL+'&emailAddress='+EmailVal1 44899 } else { 44900 location.href= TIformPathURL+'?emailAddress='+EmailVal1 44901 } 44902 } 44903 44904 $("#subscribeReq1").hide(); 44905 $("#subscribeReq2").hide(); 44906 } 44907 else if(EmailVal1==""){ 44908 $("#subscribeReq2").show(); 44909 $("#subscribeReq1").hide(); 44910 } 44911 else { 44912 $("#subscribeReq1").show(); 44913 $("#subscribeReq2").hide(); 44914 } 44915}); 44916 44917 44918 44919$(document).ready(function () { 44920 $(document).on('click','.news-box ',function (e) { 44921 var href = $(this).find(".hrefHiddenDivStory").data("href"); 44922 //$(this).attr("href",href); 44923 $(this).next('a[data-toggle="lightbox"]').attr("href",href); 44924 $(this).next('a[data-toggle="lightbox"]').click(); 44925 //$(this).removeAttr("href",href); 44926 $(this).next('a[data-toggle="lightbox"]').removeAttr("href",href); 44927 }); 44928 $('.pbs-container-wapper .story-package a').each(function(){ 44929 if(/.*?youtu(?:\.be|be\.com)/gm.test($(this).attr('href'))){ 44930 $(this).attr('data-remote',$(this).attr('href')).removeAttr('href') 44931 } 44932 }); 44933 44934 $(document).undelegate('*[data-toggle="lightbox"]:not([data-gallery="navigateTo"])', 'click'); 44935 $(document).delegate('*[data-toggle="lightbox"]:not([data-gallery="navigateTo"])', 'click', function (event) { 44936 44937 event.preventDefault(); 44938 $(this).parent().append('<div id="hero-video-modal"><!-- Video Modal --><div class="modal videoModal modal videomodalforvideopopup videomodalforvideopopupgallery" id="videoModal" tabindex="-1" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body"><div class="embed-responsive embed-responsive-16by9" id="heroIframeVideo"></div></div></div></div></div></div>'); 44939 44940 var href = $(this).attr("href"); 44941 event.preventDefault(); 44942 var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/; 44943 var match = href.match(regExp); 44944 44945 if (match && match[2].length) { 44946 $(this).ekkoLightbox({}); 44947 $('.ekko-lightbox') 44948 .addClass('videoGalleryVideoModal') 44949 .children('.modal-dialog') 44950 .addClass('modal-dialog-centered') 44951 .before('<span class="modal-close" data-dismiss="modal">✕</span>'); 44952 } 44953 else if (href) { 44954 $(".videomodalforvideopopupgallery").show(); 44955 var FinalYoutubURL; 44956 FinalYoutubURL = $(this).attr("href"); 44957 var bodyEl = $('body'), 44958 htmlEl = $('html'); 44959 44960 var modalHtml = ' <div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body"><div class="embed-responsive embed-responsive-16by9" id="heroIframeVideo"><video controls autoplay controlslist="nodownload"><source src="' + FinalYoutubURL + '" type="video/mp4" /></video> </div> </div> </div> </div> </div>'; 44961 44962 $(".videomodalforvideopopupgallery").html(modalHtml); 44963 44964 bodyEl.find('.close').on("click", function () { $('video').get(0).pause(); $(".modal").hide(); $(".videomodalforvideopopupgallery").remove(); }); 44965 } 44966 else { 44967 return 'error'; 44968 } 44969 videoCaptions($(this).data('content-path')); 44970 }); 44971}); 44972 44973/*! Hammer.JS - v2.0.8 - 2016-04-23 44974 * http://hammerjs.github.io/ 44975 * 44976 * Copyright (c) 2016 Jorik Tangelder; 44977 * Licensed under the MIT license */ 44978(function (window, document, exportName, undefined) { 44979 'use strict'; 44980 44981 var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o']; 44982 var TEST_ELEMENT = document.createElement('div'); 44983 44984 var TYPE_FUNCTION = 'function'; 44985 44986 var round = Math.round; 44987 var abs = Math.abs; 44988 var now = Date.now; 44989 44990 /** 44991 * set a timeout with a given scope 44992 * @param {Function} fn 44993 * @param {Number} timeout 44994 * @param {Object} context 44995 * @returns {number} 44996 */ 44997 function setTimeoutContext(fn, timeout, context) { 44998 return setTimeout(bindFn(fn, context), timeout); 44999 } 45000 45001 /** 45002 * if the argument is an array, we want to execute the fn on each entry 45003 * if it aint an array we don't want to do a thing. 45004 * this is used by all the methods that accept a single and array argument. 45005 * @param {*|Array} arg 45006 * @param {String} fn 45007 * @param {Object} [context] 45008 * @returns {Boolean} 45009 */ 45010 function invokeArrayArg(arg, fn, context) { 45011 if (Array.isArray(arg)) { 45012 each(arg, context[fn], context); 45013 return true; 45014 } 45015 return false;
vendor: 55,174 bytes, lines 45016-46794
45016 } 45017 45018 /** 45019 * walk objects and arrays 45020 * @param {Object} obj 45021 * @param {Function} iterator 45022 * @param {Object} context 45023 */ 45024 function each(obj, iterator, context) { 45025 var i; 45026 45027 if (!obj) { 45028 return; 45029 } 45030 45031 if (obj.forEach) { 45032 obj.forEach(iterator, context); 45033 } else if (obj.length !== undefined) { 45034 i = 0; 45035 while (i < obj.length) { 45036 iterator.call(context, obj[i], i, obj); 45037 i++; 45038 } 45039 } else { 45040 for (i in obj) { 45041 obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj); 45042 } 45043 } 45044 } 45045 45046 /** 45047 * wrap a method with a deprecation warning and stack trace 45048 * @param {Function} method 45049 * @param {String} name 45050 * @param {String} message 45051 * @returns {Function} A new function wrapping the supplied method. 45052 */ 45053 function deprecate(method, name, message) { 45054 var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n'; 45055 return function () { 45056 var e = new Error('get-stack-trace'); 45057 var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '') 45058 .replace(/^\s+at\s+/gm, '') 45059 .replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace'; 45060 45061 var log = window.console && (window.console.warn || window.console.log); 45062 if (log) { 45063 log.call(window.console, deprecationMessage, stack); 45064 } 45065 return method.apply(this, arguments); 45066 }; 45067 } 45068 45069 /** 45070 * extend object. 45071 * means that properties in dest will be overwritten by the ones in src. 45072 * @param {Object} target 45073 * @param {...Object} objects_to_assign 45074 * @returns {Object} target 45075 */ 45076 var assign; 45077 if (typeof Object.assign !== 'function') { 45078 assign = function assign(target) { 45079 if (target === undefined || target === null) { 45080 throw new TypeError('Cannot convert undefined or null to object'); 45081 } 45082 45083 var output = Object(target); 45084 for (var index = 1; index < arguments.length; index++) { 45085 var source = arguments[index]; 45086 if (source !== undefined && source !== null) { 45087 for (var nextKey in source) { 45088 if (source.hasOwnProperty(nextKey)) { 45089 output[nextKey] = source[nextKey]; 45090 } 45091 } 45092 } 45093 } 45094 return output; 45095 }; 45096 } else { 45097 assign = Object.assign; 45098 } 45099 45100 /** 45101 * extend object. 45102 * means that properties in dest will be overwritten by the ones in src. 45103 * @param {Object} dest 45104 * @param {Object} src 45105 * @param {Boolean} [merge=false] 45106 * @returns {Object} dest 45107 */ 45108 var extend = deprecate(function extend(dest, src, merge) { 45109 var keys = Object.keys(src); 45110 var i = 0; 45111 while (i < keys.length) { 45112 if (!merge || (merge && dest[keys[i]] === undefined)) { 45113 dest[keys[i]] = src[keys[i]]; 45114 } 45115 i++; 45116 } 45117 return dest; 45118 }, 'extend', 'Use `assign`.'); 45119 45120 /** 45121 * merge the values from src in the dest. 45122 * means that properties that exist in dest will not be overwritten by src 45123 * @param {Object} dest 45124 * @param {Object} src 45125 * @returns {Object} dest 45126 */ 45127 var merge = deprecate(function merge(dest, src) { 45128 return extend(dest, src, true); 45129 }, 'merge', 'Use `assign`.'); 45130 45131 /** 45132 * simple class inheritance 45133 * @param {Function} child 45134 * @param {Function} base 45135 * @param {Object} [properties] 45136 */ 45137 function inherit(child, base, properties) { 45138 var baseP = base.prototype, 45139 childP; 45140 45141 childP = child.prototype = Object.create(baseP); 45142 childP.constructor = child; 45143 childP._super = baseP; 45144 45145 if (properties) { 45146 assign(childP, properties); 45147 } 45148 } 45149 45150 /** 45151 * simple function bind 45152 * @param {Function} fn 45153 * @param {Object} context 45154 * @returns {Function} 45155 */ 45156 function bindFn(fn, context) { 45157 return function boundFn() { 45158 return fn.apply(context, arguments); 45159 }; 45160 } 45161 45162 /** 45163 * let a boolean value also be a function that must return a boolean 45164 * this first item in args will be used as the context 45165 * @param {Boolean|Function} val 45166 * @param {Array} [args] 45167 * @returns {Boolean} 45168 */ 45169 function boolOrFn(val, args) { 45170 if (typeof val == TYPE_FUNCTION) { 45171 return val.apply(args ? args[0] || undefined : undefined, args); 45172 } 45173 return val; 45174 } 45175 45176 /** 45177 * use the val2 when val1 is undefined 45178 * @param {*} val1 45179 * @param {*} val2 45180 * @returns {*} 45181 */ 45182 function ifUndefined(val1, val2) { 45183 return (val1 === undefined) ? val2 : val1; 45184 } 45185 45186 /** 45187 * addEventListener with multiple events at once 45188 * @param {EventTarget} target 45189 * @param {String} types 45190 * @param {Function} handler 45191 */ 45192 function addEventListeners(target, types, handler) { 45193 each(splitStr(types), function (type) { 45194 target.addEventListener(type, handler, false); 45195 }); 45196 } 45197 45198 /** 45199 * removeEventListener with multiple events at once 45200 * @param {EventTarget} target 45201 * @param {String} types 45202 * @param {Function} handler 45203 */ 45204 function removeEventListeners(target, types, handler) { 45205 each(splitStr(types), function (type) { 45206 target.removeEventListener(type, handler, false); 45207 }); 45208 } 45209 45210 /** 45211 * find if a node is in the given parent 45212 * @method hasParent 45213 * @param {HTMLElement} node 45214 * @param {HTMLElement} parent 45215 * @return {Boolean} found 45216 */ 45217 function hasParent(node, parent) { 45218 while (node) { 45219 if (node == parent) { 45220 return true; 45221 } 45222 node = node.parentNode; 45223 } 45224 return false; 45225 } 45226 45227 /** 45228 * small indexOf wrapper 45229 * @param {String} str 45230 * @param {String} find 45231 * @returns {Boolean} found 45232 */ 45233 function inStr(str, find) { 45234 return str.indexOf(find) > -1; 45235 } 45236 45237 /** 45238 * split string on whitespace 45239 * @param {String} str 45240 * @returns {Array} words 45241 */ 45242 function splitStr(str) { 45243 return str.trim().split(/\s+/g); 45244 } 45245 45246 /** 45247 * find if a array contains the object using indexOf or a simple polyFill 45248 * @param {Array} src 45249 * @param {String} find 45250 * @param {String} [findByKey] 45251 * @return {Boolean|Number} false when not found, or the index 45252 */ 45253 function inArray(src, find, findByKey) { 45254 if (src.indexOf && !findByKey) { 45255 return src.indexOf(find); 45256 } else { 45257 var i = 0; 45258 while (i < src.length) { 45259 if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) { 45260 return i; 45261 } 45262 i++; 45263 } 45264 return -1; 45265 } 45266 } 45267 45268 /** 45269 * convert array-like objects to real arrays 45270 * @param {Object} obj 45271 * @returns {Array} 45272 */ 45273 function toArray(obj) { 45274 return Array.prototype.slice.call(obj, 0); 45275 } 45276 45277 /** 45278 * unique array with objects based on a key (like 'id') or just by the array's value 45279 * @param {Array} src [{id:1},{id:2},{id:1}] 45280 * @param {String} [key] 45281 * @param {Boolean} [sort=False] 45282 * @returns {Array} [{id:1},{id:2}] 45283 */ 45284 function uniqueArray(src, key, sort) { 45285 var results = []; 45286 var values = []; 45287 var i = 0; 45288 45289 while (i < src.length) { 45290 var val = key ? src[i][key] : src[i]; 45291 if (inArray(values, val) < 0) { 45292 results.push(src[i]); 45293 } 45294 values[i] = val; 45295 i++; 45296 } 45297 45298 if (sort) { 45299 if (!key) { 45300 results = results.sort(); 45301 } else { 45302 results = results.sort(function sortUniqueArray(a, b) { 45303 return a[key] > b[key]; 45304 }); 45305 } 45306 } 45307 45308 return results; 45309 } 45310 45311 /** 45312 * get the prefixed property 45313 * @param {Object} obj 45314 * @param {String} property 45315 * @returns {String|Undefined} prefixed 45316 */ 45317 function prefixed(obj, property) { 45318 var prefix, prop; 45319 var camelProp = property[0].toUpperCase() + property.slice(1); 45320 45321 var i = 0; 45322 while (i < VENDOR_PREFIXES.length) { 45323 prefix = VENDOR_PREFIXES[i]; 45324 prop = (prefix) ? prefix + camelProp : property; 45325 45326 if (prop in obj) { 45327 return prop; 45328 } 45329 i++; 45330 } 45331 return undefined; 45332 } 45333 45334 /** 45335 * get a unique id 45336 * @returns {number} uniqueId 45337 */ 45338 var _uniqueId = 1; 45339 function uniqueId() { 45340 return _uniqueId++; 45341 } 45342 45343 /** 45344 * get the window object of an element 45345 * @param {HTMLElement} element 45346 * @returns {DocumentView|Window} 45347 */ 45348 function getWindowForElement(element) { 45349 var doc = element.ownerDocument || element; 45350 return (doc.defaultView || doc.parentWindow || window); 45351 } 45352 45353 var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i; 45354 45355 var SUPPORT_TOUCH = ('ontouchstart' in window); 45356 var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined; 45357 var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent); 45358 45359 var INPUT_TYPE_TOUCH = 'touch'; 45360 var INPUT_TYPE_PEN = 'pen'; 45361 var INPUT_TYPE_MOUSE = 'mouse'; 45362 var INPUT_TYPE_KINECT = 'kinect'; 45363 45364 var COMPUTE_INTERVAL = 25; 45365 45366 var INPUT_START = 1; 45367 var INPUT_MOVE = 2; 45368 var INPUT_END = 4; 45369 var INPUT_CANCEL = 8; 45370 45371 var DIRECTION_NONE = 1; 45372 var DIRECTION_LEFT = 2; 45373 var DIRECTION_RIGHT = 4; 45374 var DIRECTION_UP = 8; 45375 var DIRECTION_DOWN = 16; 45376 45377 var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT; 45378 var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN; 45379 var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL; 45380 45381 var PROPS_XY = ['x', 'y']; 45382 var PROPS_CLIENT_XY = ['clientX', 'clientY']; 45383 45384 /** 45385 * create new input type manager 45386 * @param {Manager} manager 45387 * @param {Function} callback 45388 * @returns {Input} 45389 * @constructor 45390 */ 45391 function Input(manager, callback) { 45392 var self = this; 45393 this.manager = manager; 45394 this.callback = callback; 45395 this.element = manager.element; 45396 this.target = manager.options.inputTarget; 45397 45398 // smaller wrapper around the handler, for the scope and the enabled state of the manager, 45399 // so when disabled the input events are completely bypassed. 45400 this.domHandler = function (ev) { 45401 if (boolOrFn(manager.options.enable, [manager])) { 45402 self.handler(ev); 45403 } 45404 }; 45405 45406 this.init(); 45407 45408 } 45409 45410 Input.prototype = { 45411 /** 45412 * should handle the inputEvent data and trigger the callback 45413 * @virtual 45414 */ 45415 handler: function () { }, 45416 45417 /** 45418 * bind the events 45419 */ 45420 init: function () { 45421 this.evEl && addEventListeners(this.element, this.evEl, this.domHandler); 45422 this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler); 45423 this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler); 45424 }, 45425 45426 /** 45427 * unbind the events 45428 */ 45429 destroy: function () { 45430 this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler); 45431 this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler); 45432 this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler); 45433 } 45434 }; 45435 45436 /** 45437 * create new input type manager 45438 * called by the Manager constructor 45439 * @param {Hammer} manager 45440 * @returns {Input} 45441 */ 45442 function createInputInstance(manager) { 45443 var Type; 45444 var inputClass = manager.options.inputClass; 45445 45446 if (inputClass) { 45447 Type = inputClass; 45448 } else if (SUPPORT_POINTER_EVENTS) { 45449 Type = PointerEventInput; 45450 } else if (SUPPORT_ONLY_TOUCH) { 45451 Type = TouchInput; 45452 } else if (!SUPPORT_TOUCH) { 45453 Type = MouseInput; 45454 } else { 45455 Type = TouchMouseInput; 45456 } 45457 return new (Type)(manager, inputHandler); 45458 } 45459 45460 /** 45461 * handle input events 45462 * @param {Manager} manager 45463 * @param {String} eventType 45464 * @param {Object} input 45465 */ 45466 function inputHandler(manager, eventType, input) { 45467 var pointersLen = input.pointers.length; 45468 var changedPointersLen = input.changedPointers.length; 45469 var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0)); 45470 var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0)); 45471 45472 input.isFirst = !!isFirst; 45473 input.isFinal = !!isFinal; 45474 45475 if (isFirst) { 45476 manager.session = {}; 45477 } 45478 45479 // source event is the normalized value of the domEvents 45480 // like 'touchstart, mouseup, pointerdown' 45481 input.eventType = eventType; 45482 45483 // compute scale, rotation etc 45484 computeInputData(manager, input); 45485 45486 // emit secret event 45487 manager.emit('hammer.input', input); 45488 45489 manager.recognize(input); 45490 manager.session.prevInput = input; 45491 } 45492 45493 /** 45494 * extend the data with some usable properties like scale, rotate, velocity etc 45495 * @param {Object} manager 45496 * @param {Object} input 45497 */ 45498 function computeInputData(manager, input) { 45499 var session = manager.session; 45500 var pointers = input.pointers; 45501 var pointersLength = pointers.length; 45502 45503 // store the first input to calculate the distance and direction 45504 if (!session.firstInput) { 45505 session.firstInput = simpleCloneInputData(input); 45506 } 45507 45508 // to compute scale and rotation we need to store the multiple touches 45509 if (pointersLength > 1 && !session.firstMultiple) { 45510 session.firstMultiple = simpleCloneInputData(input); 45511 } else if (pointersLength === 1) { 45512 session.firstMultiple = false; 45513 } 45514 45515 var firstInput = session.firstInput; 45516 var firstMultiple = session.firstMultiple; 45517 var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center; 45518 45519 var center = input.center = getCenter(pointers); 45520 input.timeStamp = now(); 45521 input.deltaTime = input.timeStamp - firstInput.timeStamp; 45522 45523 input.angle = getAngle(offsetCenter, center); 45524 input.distance = getDistance(offsetCenter, center); 45525 45526 computeDeltaXY(session, input); 45527 input.offsetDirection = getDirection(input.deltaX, input.deltaY); 45528 45529 var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY); 45530 input.overallVelocityX = overallVelocity.x; 45531 input.overallVelocityY = overallVelocity.y; 45532 input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y; 45533 45534 input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1; 45535 input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0; 45536 45537 input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length > 45538 session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers); 45539 45540 computeIntervalInputData(session, input); 45541 45542 // find the correct target 45543 var target = manager.element; 45544 if (hasParent(input.srcEvent.target, target)) { 45545 target = input.srcEvent.target; 45546 } 45547 input.target = target; 45548 } 45549 45550 function computeDeltaXY(session, input) { 45551 var center = input.center; 45552 var offset = session.offsetDelta || {}; 45553 var prevDelta = session.prevDelta || {}; 45554 var prevInput = session.prevInput || {}; 45555 45556 if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) { 45557 prevDelta = session.prevDelta = { 45558 x: prevInput.deltaX || 0, 45559 y: prevInput.deltaY || 0 45560 }; 45561 45562 offset = session.offsetDelta = { 45563 x: center.x, 45564 y: center.y 45565 }; 45566 } 45567 45568 input.deltaX = prevDelta.x + (center.x - offset.x); 45569 input.deltaY = prevDelta.y + (center.y - offset.y); 45570 } 45571 45572 /** 45573 * velocity is calculated every x ms 45574 * @param {Object} session 45575 * @param {Object} input 45576 */ 45577 function computeIntervalInputData(session, input) { 45578 var last = session.lastInterval || input, 45579 deltaTime = input.timeStamp - last.timeStamp, 45580 velocity, velocityX, velocityY, direction; 45581 45582 if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) { 45583 var deltaX = input.deltaX - last.deltaX; 45584 var deltaY = input.deltaY - last.deltaY; 45585 45586 var v = getVelocity(deltaTime, deltaX, deltaY); 45587 velocityX = v.x; 45588 velocityY = v.y; 45589 velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y; 45590 direction = getDirection(deltaX, deltaY); 45591 45592 session.lastInterval = input; 45593 } else { 45594 // use latest velocity info if it doesn't overtake a minimum period 45595 velocity = last.velocity; 45596 velocityX = last.velocityX; 45597 velocityY = last.velocityY; 45598 direction = last.direction; 45599 } 45600 45601 input.velocity = velocity; 45602 input.velocityX = velocityX; 45603 input.velocityY = velocityY; 45604 input.direction = direction; 45605 } 45606 45607 /** 45608 * create a simple clone from the input used for storage of firstInput and firstMultiple 45609 * @param {Object} input 45610 * @returns {Object} clonedInputData 45611 */ 45612 function simpleCloneInputData(input) { 45613 // make a simple copy of the pointers because we will get a reference if we don't 45614 // we only need clientXY for the calculations 45615 var pointers = []; 45616 var i = 0; 45617 while (i < input.pointers.length) { 45618 pointers[i] = { 45619 clientX: round(input.pointers[i].clientX), 45620 clientY: round(input.pointers[i].clientY) 45621 }; 45622 i++; 45623 } 45624 45625 return { 45626 timeStamp: now(), 45627 pointers: pointers, 45628 center: getCenter(pointers), 45629 deltaX: input.deltaX, 45630 deltaY: input.deltaY 45631 }; 45632 } 45633 45634 /** 45635 * get the center of all the pointers 45636 * @param {Array} pointers 45637 * @return {Object} center contains `x` and `y` properties 45638 */ 45639 function getCenter(pointers) { 45640 var pointersLength = pointers.length; 45641 45642 // no need to loop when only one touch 45643 if (pointersLength === 1) { 45644 return { 45645 x: round(pointers[0].clientX), 45646 y: round(pointers[0].clientY) 45647 }; 45648 } 45649 45650 var x = 0, y = 0, i = 0; 45651 while (i < pointersLength) { 45652 x += pointers[i].clientX; 45653 y += pointers[i].clientY; 45654 i++; 45655 } 45656 45657 return { 45658 x: round(x / pointersLength), 45659 y: round(y / pointersLength) 45660 }; 45661 } 45662 45663 /** 45664 * calculate the velocity between two points. unit is in px per ms. 45665 * @param {Number} deltaTime 45666 * @param {Number} x 45667 * @param {Number} y 45668 * @return {Object} velocity `x` and `y` 45669 */ 45670 function getVelocity(deltaTime, x, y) { 45671 return { 45672 x: x / deltaTime || 0, 45673 y: y / deltaTime || 0 45674 }; 45675 } 45676 45677 /** 45678 * get the direction between two points 45679 * @param {Number} x 45680 * @param {Number} y 45681 * @return {Number} direction 45682 */ 45683 function getDirection(x, y) { 45684 if (x === y) { 45685 return DIRECTION_NONE; 45686 } 45687 45688 if (abs(x) >= abs(y)) { 45689 return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT; 45690 } 45691 return y < 0 ? DIRECTION_UP : DIRECTION_DOWN; 45692 } 45693 45694 /** 45695 * calculate the absolute distance between two points 45696 * @param {Object} p1 {x, y} 45697 * @param {Object} p2 {x, y} 45698 * @param {Array} [props] containing x and y keys 45699 * @return {Number} distance 45700 */ 45701 function getDistance(p1, p2, props) { 45702 if (!props) { 45703 props = PROPS_XY; 45704 } 45705 var x = p2[props[0]] - p1[props[0]], 45706 y = p2[props[1]] - p1[props[1]]; 45707 45708 return Math.sqrt((x * x) + (y * y)); 45709 } 45710 45711 /** 45712 * calculate the angle between two coordinates 45713 * @param {Object} p1 45714 * @param {Object} p2 45715 * @param {Array} [props] containing x and y keys 45716 * @return {Number} angle 45717 */ 45718 function getAngle(p1, p2, props) { 45719 if (!props) { 45720 props = PROPS_XY; 45721 } 45722 var x = p2[props[0]] - p1[props[0]], 45723 y = p2[props[1]] - p1[props[1]]; 45724 return Math.atan2(y, x) * 180 / Math.PI; 45725 } 45726 45727 /** 45728 * calculate the rotation degrees between two pointersets 45729 * @param {Array} start array of pointers 45730 * @param {Array} end array of pointers 45731 * @return {Number} rotation 45732 */ 45733 function getRotation(start, end) { 45734 return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY); 45735 } 45736 45737 /** 45738 * calculate the scale factor between two pointersets 45739 * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out 45740 * @param {Array} start array of pointers 45741 * @param {Array} end array of pointers 45742 * @return {Number} scale 45743 */ 45744 function getScale(start, end) { 45745 return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY); 45746 } 45747 45748 var MOUSE_INPUT_MAP = { 45749 mousedown: INPUT_START, 45750 mousemove: INPUT_MOVE, 45751 mouseup: INPUT_END 45752 }; 45753 45754 var MOUSE_ELEMENT_EVENTS = 'mousedown'; 45755 var MOUSE_WINDOW_EVENTS = 'mousemove mouseup'; 45756 45757 /** 45758 * Mouse events input 45759 * @constructor 45760 * @extends Input 45761 */ 45762 function MouseInput() { 45763 this.evEl = MOUSE_ELEMENT_EVENTS; 45764 this.evWin = MOUSE_WINDOW_EVENTS; 45765 45766 this.pressed = false; // mousedown state 45767 45768 Input.apply(this, arguments); 45769 } 45770 45771 inherit(MouseInput, Input, { 45772 /** 45773 * handle mouse events 45774 * @param {Object} ev 45775 */ 45776 handler: function MEhandler(ev) { 45777 var eventType = MOUSE_INPUT_MAP[ev.type]; 45778 45779 // on start we want to have the left mouse button down 45780 if (eventType & INPUT_START && ev.button === 0) { 45781 this.pressed = true; 45782 } 45783 45784 if (eventType & INPUT_MOVE && ev.which !== 1) { 45785 eventType = INPUT_END; 45786 } 45787 45788 // mouse must be down 45789 if (!this.pressed) { 45790 return; 45791 } 45792 45793 if (eventType & INPUT_END) { 45794 this.pressed = false; 45795 } 45796 45797 this.callback(this.manager, eventType, { 45798 pointers: [ev], 45799 changedPointers: [ev], 45800 pointerType: INPUT_TYPE_MOUSE, 45801 srcEvent: ev 45802 }); 45803 } 45804 }); 45805 45806 var POINTER_INPUT_MAP = { 45807 pointerdown: INPUT_START, 45808 pointermove: INPUT_MOVE, 45809 pointerup: INPUT_END, 45810 pointercancel: INPUT_CANCEL, 45811 pointerout: INPUT_CANCEL 45812 }; 45813 45814 // in IE10 the pointer types is defined as an enum 45815 var IE10_POINTER_TYPE_ENUM = { 45816 2: INPUT_TYPE_TOUCH, 45817 3: INPUT_TYPE_PEN, 45818 4: INPUT_TYPE_MOUSE, 45819 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816 45820 }; 45821 45822 var POINTER_ELEMENT_EVENTS = 'pointerdown'; 45823 var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; 45824 45825 // IE10 has prefixed support, and case-sensitive 45826 if (window.MSPointerEvent && !window.PointerEvent) { 45827 POINTER_ELEMENT_EVENTS = 'MSPointerDown'; 45828 POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel'; 45829 } 45830 45831 /** 45832 * Pointer events input 45833 * @constructor 45834 * @extends Input 45835 */ 45836 function PointerEventInput() { 45837 this.evEl = POINTER_ELEMENT_EVENTS; 45838 this.evWin = POINTER_WINDOW_EVENTS; 45839 45840 Input.apply(this, arguments); 45841 45842 this.store = (this.manager.session.pointerEvents = []); 45843 } 45844 45845 inherit(PointerEventInput, Input, { 45846 /** 45847 * handle mouse events 45848 * @param {Object} ev 45849 */ 45850 handler: function PEhandler(ev) { 45851 var store = this.store; 45852 var removePointer = false; 45853 45854 var eventTypeNormalized = ev.type.toLowerCase().replace('ms', ''); 45855 var eventType = POINTER_INPUT_MAP[eventTypeNormalized]; 45856 var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType; 45857 45858 var isTouch = (pointerType == INPUT_TYPE_TOUCH); 45859 45860 // get index of the event in the store 45861 var storeIndex = inArray(store, ev.pointerId, 'pointerId'); 45862 45863 // start and mouse must be down 45864 if (eventType & INPUT_START && (ev.button === 0 || isTouch)) { 45865 if (storeIndex < 0) { 45866 store.push(ev); 45867 storeIndex = store.length - 1; 45868 } 45869 } else if (eventType & (INPUT_END | INPUT_CANCEL)) { 45870 removePointer = true; 45871 } 45872 45873 // it not found, so the pointer hasn't been down (so it's probably a hover) 45874 if (storeIndex < 0) { 45875 return; 45876 } 45877 45878 // update the event in the store 45879 store[storeIndex] = ev; 45880 45881 this.callback(this.manager, eventType, { 45882 pointers: store, 45883 changedPointers: [ev], 45884 pointerType: pointerType, 45885 srcEvent: ev 45886 }); 45887 45888 if (removePointer) { 45889 // remove from the store 45890 store.splice(storeIndex, 1); 45891 } 45892 } 45893 }); 45894 45895 var SINGLE_TOUCH_INPUT_MAP = { 45896 touchstart: INPUT_START, 45897 touchmove: INPUT_MOVE, 45898 touchend: INPUT_END, 45899 touchcancel: INPUT_CANCEL 45900 }; 45901 45902 var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart'; 45903 var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel'; 45904 45905 /** 45906 * Touch events input 45907 * @constructor 45908 * @extends Input 45909 */ 45910 function SingleTouchInput() { 45911 this.evTarget = SINGLE_TOUCH_TARGET_EVENTS; 45912 this.evWin = SINGLE_TOUCH_WINDOW_EVENTS; 45913 this.started = false; 45914 45915 Input.apply(this, arguments); 45916 } 45917 45918 inherit(SingleTouchInput, Input, { 45919 handler: function TEhandler(ev) { 45920 var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; 45921 45922 // should we handle the touch events? 45923 if (type === INPUT_START) { 45924 this.started = true; 45925 } 45926 45927 if (!this.started) { 45928 return; 45929 } 45930 45931 var touches = normalizeSingleTouches.call(this, ev, type); 45932 45933 // when done, reset the started state 45934 if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) { 45935 this.started = false; 45936 } 45937 45938 this.callback(this.manager, type, { 45939 pointers: touches[0], 45940 changedPointers: touches[1], 45941 pointerType: INPUT_TYPE_TOUCH, 45942 srcEvent: ev 45943 }); 45944 } 45945 }); 45946 45947 /** 45948 * @this {TouchInput} 45949 * @param {Object} ev 45950 * @param {Number} type flag 45951 * @returns {undefined|Array} [all, changed] 45952 */ 45953 function normalizeSingleTouches(ev, type) { 45954 var all = toArray(ev.touches); 45955 var changed = toArray(ev.changedTouches); 45956 45957 if (type & (INPUT_END | INPUT_CANCEL)) { 45958 all = uniqueArray(all.concat(changed), 'identifier', true); 45959 } 45960 45961 return [all, changed]; 45962 } 45963 45964 var TOUCH_INPUT_MAP = { 45965 touchstart: INPUT_START, 45966 touchmove: INPUT_MOVE, 45967 touchend: INPUT_END, 45968 touchcancel: INPUT_CANCEL 45969 }; 45970 45971 var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel'; 45972 45973 /** 45974 * Multi-user touch events input 45975 * @constructor 45976 * @extends Input 45977 */ 45978 function TouchInput() { 45979 this.evTarget = TOUCH_TARGET_EVENTS; 45980 this.targetIds = {}; 45981 45982 Input.apply(this, arguments); 45983 } 45984 45985 inherit(TouchInput, Input, { 45986 handler: function MTEhandler(ev) { 45987 var type = TOUCH_INPUT_MAP[ev.type]; 45988 var touches = getTouches.call(this, ev, type); 45989 if (!touches) { 45990 return; 45991 } 45992 45993 this.callback(this.manager, type, { 45994 pointers: touches[0], 45995 changedPointers: touches[1], 45996 pointerType: INPUT_TYPE_TOUCH, 45997 srcEvent: ev 45998 }); 45999 } 46000 }); 46001 46002 /** 46003 * @this {TouchInput} 46004 * @param {Object} ev 46005 * @param {Number} type flag 46006 * @returns {undefined|Array} [all, changed] 46007 */ 46008 function getTouches(ev, type) { 46009 var allTouches = toArray(ev.touches); 46010 var targetIds = this.targetIds; 46011 46012 // when there is only one touch, the process can be simplified 46013 if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) { 46014 targetIds[allTouches[0].identifier] = true; 46015 return [allTouches, allTouches]; 46016 } 46017 46018 var i, 46019 targetTouches, 46020 changedTouches = toArray(ev.changedTouches), 46021 changedTargetTouches = [], 46022 target = this.target; 46023 46024 // get target touches from touches 46025 targetTouches = allTouches.filter(function (touch) { 46026 return hasParent(touch.target, target); 46027 }); 46028 46029 // collect touches 46030 if (type === INPUT_START) { 46031 i = 0; 46032 while (i < targetTouches.length) { 46033 targetIds[targetTouches[i].identifier] = true; 46034 i++; 46035 } 46036 } 46037 46038 // filter changed touches to only contain touches that exist in the collected target ids 46039 i = 0; 46040 while (i < changedTouches.length) { 46041 if (targetIds[changedTouches[i].identifier]) { 46042 changedTargetTouches.push(changedTouches[i]); 46043 } 46044 46045 // cleanup removed touches 46046 if (type & (INPUT_END | INPUT_CANCEL)) { 46047 delete targetIds[changedTouches[i].identifier]; 46048 } 46049 i++; 46050 } 46051 46052 if (!changedTargetTouches.length) { 46053 return; 46054 } 46055 46056 return [ 46057 // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel' 46058 uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), 46059 changedTargetTouches 46060 ]; 46061 } 46062 46063 /** 46064 * Combined touch and mouse input 46065 * 46066 * Touch has a higher priority then mouse, and while touching no mouse events are allowed. 46067 * This because touch devices also emit mouse events while doing a touch. 46068 * 46069 * @constructor 46070 * @extends Input 46071 */ 46072 46073 var DEDUP_TIMEOUT = 2500; 46074 var DEDUP_DISTANCE = 25; 46075 46076 function TouchMouseInput() { 46077 Input.apply(this, arguments); 46078 46079 var handler = bindFn(this.handler, this); 46080 this.touch = new TouchInput(this.manager, handler); 46081 this.mouse = new MouseInput(this.manager, handler); 46082 46083 this.primaryTouch = null; 46084 this.lastTouches = []; 46085 } 46086 46087 inherit(TouchMouseInput, Input, { 46088 /** 46089 * handle mouse and touch events 46090 * @param {Hammer} manager 46091 * @param {String} inputEvent 46092 * @param {Object} inputData 46093 */ 46094 handler: function TMEhandler(manager, inputEvent, inputData) { 46095 var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH), 46096 isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE); 46097 46098 if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) { 46099 return; 46100 } 46101 46102 // when we're in a touch event, record touches to de-dupe synthetic mouse event 46103 if (isTouch) { 46104 recordTouches.call(this, inputEvent, inputData); 46105 } else if (isMouse && isSyntheticEvent.call(this, inputData)) { 46106 return; 46107 } 46108 46109 this.callback(manager, inputEvent, inputData); 46110 }, 46111 46112 /** 46113 * remove the event listeners 46114 */ 46115 destroy: function destroy() { 46116 this.touch.destroy(); 46117 this.mouse.destroy(); 46118 } 46119 }); 46120 46121 function recordTouches(eventType, eventData) { 46122 if (eventType & INPUT_START) { 46123 this.primaryTouch = eventData.changedPointers[0].identifier; 46124 setLastTouch.call(this, eventData); 46125 } else if (eventType & (INPUT_END | INPUT_CANCEL)) { 46126 setLastTouch.call(this, eventData); 46127 } 46128 } 46129 46130 function setLastTouch(eventData) { 46131 var touch = eventData.changedPointers[0]; 46132 46133 if (touch.identifier === this.primaryTouch) { 46134 var lastTouch = { x: touch.clientX, y: touch.clientY }; 46135 this.lastTouches.push(lastTouch); 46136 var lts = this.lastTouches; 46137 var removeLastTouch = function () { 46138 var i = lts.indexOf(lastTouch); 46139 if (i > -1) { 46140 lts.splice(i, 1); 46141 } 46142 }; 46143 setTimeout(removeLastTouch, DEDUP_TIMEOUT); 46144 } 46145 } 46146 46147 function isSyntheticEvent(eventData) { 46148 var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY; 46149 for (var i = 0; i < this.lastTouches.length; i++) { 46150 var t = this.lastTouches[i]; 46151 var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y); 46152 if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) { 46153 return true; 46154 } 46155 } 46156 return false; 46157 } 46158 46159 var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction'); 46160 var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined; 46161 46162 // magical touchAction value 46163 var TOUCH_ACTION_COMPUTE = 'compute'; 46164 var TOUCH_ACTION_AUTO = 'auto'; 46165 var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented 46166 var TOUCH_ACTION_NONE = 'none'; 46167 var TOUCH_ACTION_PAN_X = 'pan-x'; 46168 var TOUCH_ACTION_PAN_Y = 'pan-y'; 46169 var TOUCH_ACTION_MAP = getTouchActionProps(); 46170 46171 /** 46172 * Touch Action 46173 * sets the touchAction property or uses the js alternative 46174 * @param {Manager} manager 46175 * @param {String} value 46176 * @constructor 46177 */ 46178 function TouchAction(manager, value) { 46179 this.manager = manager; 46180 this.set(value); 46181 } 46182 46183 TouchAction.prototype = { 46184 /** 46185 * set the touchAction value on the element or enable the polyfill 46186 * @param {String} value 46187 */ 46188 set: function (value) { 46189 // find out the touch-action by the event handlers 46190 if (value == TOUCH_ACTION_COMPUTE) { 46191 value = this.compute(); 46192 } 46193 46194 if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) { 46195 this.manager.element.style[PREFIXED_TOUCH_ACTION] = value; 46196 } 46197 this.actions = value.toLowerCase().trim(); 46198 }, 46199 46200 /** 46201 * just re-set the touchAction value 46202 */ 46203 update: function () { 46204 this.set(this.manager.options.touchAction); 46205 }, 46206 46207 /** 46208 * compute the value for the touchAction property based on the recognizer's settings 46209 * @returns {String} value 46210 */ 46211 compute: function () { 46212 var actions = []; 46213 each(this.manager.recognizers, function (recognizer) { 46214 if (boolOrFn(recognizer.options.enable, [recognizer])) { 46215 actions = actions.concat(recognizer.getTouchAction()); 46216 } 46217 }); 46218 return cleanTouchActions(actions.join(' ')); 46219 }, 46220 46221 /** 46222 * this method is called on each input cycle and provides the preventing of the browser behavior 46223 * @param {Object} input 46224 */ 46225 preventDefaults: function (input) { 46226 var srcEvent = input.srcEvent; 46227 var direction = input.offsetDirection; 46228 46229 // if the touch action did prevented once this session 46230 if (this.manager.session.prevented) { 46231 srcEvent.preventDefault(); 46232 return; 46233 } 46234 46235 var actions = this.actions; 46236 var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE]; 46237 var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y]; 46238 var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X]; 46239 46240 if (hasNone) { 46241 //do not prevent defaults if this is a tap gesture 46242 46243 var isTapPointer = input.pointers.length === 1; 46244 var isTapMovement = input.distance < 2; 46245 var isTapTouchTime = input.deltaTime < 250; 46246 46247 if (isTapPointer && isTapMovement && isTapTouchTime) { 46248 return; 46249 } 46250 } 46251 46252 if (hasPanX && hasPanY) { 46253 // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent 46254 return; 46255 } 46256 46257 if (hasNone || 46258 (hasPanY && direction & DIRECTION_HORIZONTAL) || 46259 (hasPanX && direction & DIRECTION_VERTICAL)) { 46260 return this.preventSrc(srcEvent); 46261 } 46262 }, 46263 46264 /** 46265 * call preventDefault to prevent the browser's default behavior (scrolling in most cases) 46266 * @param {Object} srcEvent 46267 */ 46268 preventSrc: function (srcEvent) { 46269 this.manager.session.prevented = true; 46270 srcEvent.preventDefault(); 46271 } 46272 }; 46273 46274 /** 46275 * when the touchActions are collected they are not a valid value, so we need to clean things up. * 46276 * @param {String} actions 46277 * @returns {*} 46278 */ 46279 function cleanTouchActions(actions) { 46280 // none 46281 if (inStr(actions, TOUCH_ACTION_NONE)) { 46282 return TOUCH_ACTION_NONE; 46283 } 46284 46285 var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X); 46286 var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); 46287 46288 // if both pan-x and pan-y are set (different recognizers 46289 // for different directions, e.g. horizontal pan but vertical swipe?) 46290 // we need none (as otherwise with pan-x pan-y combined none of these 46291 // recognizers will work, since the browser would handle all panning 46292 if (hasPanX && hasPanY) { 46293 return TOUCH_ACTION_NONE; 46294 } 46295 46296 // pan-x OR pan-y 46297 if (hasPanX || hasPanY) { 46298 return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y; 46299 } 46300 46301 // manipulation 46302 if (inStr(actions, TOUCH_ACTION_MANIPULATION)) { 46303 return TOUCH_ACTION_MANIPULATION; 46304 } 46305 46306 return TOUCH_ACTION_AUTO; 46307 } 46308 46309 function getTouchActionProps() { 46310 if (!NATIVE_TOUCH_ACTION) { 46311 return false; 46312 } 46313 var touchMap = {}; 46314 var cssSupports = window.CSS && window.CSS.supports; 46315 ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) { 46316 46317 // If css.supports is not supported but there is native touch-action assume it supports 46318 // all values. This is the case for IE 10 and 11. 46319 touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true; 46320 }); 46321 return touchMap; 46322 } 46323 46324 /** 46325 * Recognizer flow explained; * 46326 * All recognizers have the initial state of POSSIBLE when a input session starts. 46327 * The definition of a input session is from the first input until the last input, with all it's movement in it. * 46328 * Example session for mouse-input: mousedown -> mousemove -> mouseup 46329 * 46330 * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed 46331 * which determines with state it should be. 46332 * 46333 * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to 46334 * POSSIBLE to give it another change on the next cycle. 46335 * 46336 * Possible 46337 * | 46338 * +-----+---------------+ 46339 * | | 46340 * +-----+-----+ | 46341 * | | | 46342 * Failed Cancelled | 46343 * +-------+------+ 46344 * | | 46345 * Recognized Began 46346 * | 46347 * Changed 46348 * | 46349 * Ended/Recognized 46350 */ 46351 var STATE_POSSIBLE = 1; 46352 var STATE_BEGAN = 2; 46353 var STATE_CHANGED = 4; 46354 var STATE_ENDED = 8; 46355 var STATE_RECOGNIZED = STATE_ENDED; 46356 var STATE_CANCELLED = 16; 46357 var STATE_FAILED = 32; 46358 46359 /** 46360 * Recognizer 46361 * Every recognizer needs to extend from this class. 46362 * @constructor 46363 * @param {Object} options 46364 */ 46365 function Recognizer(options) { 46366 this.options = assign({}, this.defaults, options || {}); 46367 46368 this.id = uniqueId(); 46369 46370 this.manager = null; 46371 46372 // default is enable true 46373 this.options.enable = ifUndefined(this.options.enable, true); 46374 46375 this.state = STATE_POSSIBLE; 46376 46377 this.simultaneous = {}; 46378 this.requireFail = []; 46379 } 46380 46381 Recognizer.prototype = { 46382 /** 46383 * @virtual 46384 * @type {Object} 46385 */ 46386 defaults: {}, 46387 46388 /** 46389 * set options 46390 * @param {Object} options 46391 * @return {Recognizer} 46392 */ 46393 set: function (options) { 46394 assign(this.options, options); 46395 46396 // also update the touchAction, in case something changed about the directions/enabled state 46397 this.manager && this.manager.touchAction.update(); 46398 return this; 46399 }, 46400 46401 /** 46402 * recognize simultaneous with an other recognizer. 46403 * @param {Recognizer} otherRecognizer 46404 * @returns {Recognizer} this 46405 */ 46406 recognizeWith: function (otherRecognizer) { 46407 if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) { 46408 return this; 46409 } 46410 46411 var simultaneous = this.simultaneous; 46412 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); 46413 if (!simultaneous[otherRecognizer.id]) { 46414 simultaneous[otherRecognizer.id] = otherRecognizer; 46415 otherRecognizer.recognizeWith(this); 46416 } 46417 return this; 46418 }, 46419 46420 /** 46421 * drop the simultaneous link. it doesnt remove the link on the other recognizer. 46422 * @param {Recognizer} otherRecognizer 46423 * @returns {Recognizer} this 46424 */ 46425 dropRecognizeWith: function (otherRecognizer) { 46426 if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) { 46427 return this; 46428 } 46429 46430 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); 46431 delete this.simultaneous[otherRecognizer.id]; 46432 return this; 46433 }, 46434 46435 /** 46436 * recognizer can only run when an other is failing 46437 * @param {Recognizer} otherRecognizer 46438 * @returns {Recognizer} this 46439 */ 46440 requireFailure: function (otherRecognizer) { 46441 if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) { 46442 return this; 46443 } 46444 46445 var requireFail = this.requireFail; 46446 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); 46447 if (inArray(requireFail, otherRecognizer) === -1) { 46448 requireFail.push(otherRecognizer); 46449 otherRecognizer.requireFailure(this); 46450 } 46451 return this; 46452 }, 46453 46454 /** 46455 * drop the requireFailure link. it does not remove the link on the other recognizer. 46456 * @param {Recognizer} otherRecognizer 46457 * @returns {Recognizer} this 46458 */ 46459 dropRequireFailure: function (otherRecognizer) { 46460 if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) { 46461 return this; 46462 } 46463 46464 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); 46465 var index = inArray(this.requireFail, otherRecognizer); 46466 if (index > -1) { 46467 this.requireFail.splice(index, 1); 46468 } 46469 return this; 46470 }, 46471 46472 /** 46473 * has require failures boolean 46474 * @returns {boolean} 46475 */ 46476 hasRequireFailures: function () { 46477 return this.requireFail.length > 0; 46478 }, 46479 46480 /** 46481 * if the recognizer can recognize simultaneous with an other recognizer 46482 * @param {Recognizer} otherRecognizer 46483 * @returns {Boolean} 46484 */ 46485 canRecognizeWith: function (otherRecognizer) { 46486 return !!this.simultaneous[otherRecognizer.id]; 46487 }, 46488 46489 /** 46490 * You should use `tryEmit` instead of `emit` directly to check 46491 * that all the needed recognizers has failed before emitting. 46492 * @param {Object} input 46493 */ 46494 emit: function (input) { 46495 var self = this; 46496 var state = this.state; 46497 46498 function emit(event) { 46499 self.manager.emit(event, input); 46500 } 46501 46502 // 'panstart' and 'panmove' 46503 if (state < STATE_ENDED) { 46504 emit(self.options.event + stateStr(state)); 46505 } 46506 46507 emit(self.options.event); // simple 'eventName' events 46508 46509 if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...) 46510 emit(input.additionalEvent); 46511 } 46512 46513 // panend and pancancel 46514 if (state >= STATE_ENDED) { 46515 emit(self.options.event + stateStr(state)); 46516 } 46517 }, 46518 46519 /** 46520 * Check that all the require failure recognizers has failed, 46521 * if true, it emits a gesture event, 46522 * otherwise, setup the state to FAILED. 46523 * @param {Object} input 46524 */ 46525 tryEmit: function (input) { 46526 if (this.canEmit()) { 46527 return this.emit(input); 46528 } 46529 // it's failing anyway 46530 this.state = STATE_FAILED; 46531 }, 46532 46533 /** 46534 * can we emit? 46535 * @returns {boolean} 46536 */ 46537 canEmit: function () { 46538 var i = 0; 46539 while (i < this.requireFail.length) { 46540 if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) { 46541 return false; 46542 } 46543 i++; 46544 } 46545 return true; 46546 }, 46547 46548 /** 46549 * update the recognizer 46550 * @param {Object} inputData 46551 */ 46552 recognize: function (inputData) { 46553 // make a new copy of the inputData 46554 // so we can change the inputData without messing up the other recognizers 46555 var inputDataClone = assign({}, inputData); 46556 46557 // is is enabled and allow recognizing? 46558 if (!boolOrFn(this.options.enable, [this, inputDataClone])) { 46559 this.reset(); 46560 this.state = STATE_FAILED; 46561 return; 46562 } 46563 46564 // reset when we've reached the end 46565 if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) { 46566 this.state = STATE_POSSIBLE; 46567 } 46568 46569 this.state = this.process(inputDataClone); 46570 46571 // the recognizer has recognized a gesture 46572 // so trigger an event 46573 if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) { 46574 this.tryEmit(inputDataClone); 46575 } 46576 }, 46577 46578 /** 46579 * return the state of the recognizer 46580 * the actual recognizing happens in this method 46581 * @virtual 46582 * @param {Object} inputData 46583 * @returns {Const} STATE 46584 */ 46585 process: function (inputData) { }, // jshint ignore:line 46586 46587 /** 46588 * return the preferred touch-action 46589 * @virtual 46590 * @returns {Array} 46591 */ 46592 getTouchAction: function () { }, 46593 46594 /** 46595 * called when the gesture isn't allowed to recognize 46596 * like when another is being recognized or it is disabled 46597 * @virtual 46598 */ 46599 reset: function () { } 46600 }; 46601 46602 /** 46603 * get a usable string, used as event postfix 46604 * @param {Const} state 46605 * @returns {String} state 46606 */ 46607 function stateStr(state) { 46608 if (state & STATE_CANCELLED) { 46609 return 'cancel'; 46610 } else if (state & STATE_ENDED) { 46611 return 'end'; 46612 } else if (state & STATE_CHANGED) { 46613 return 'move'; 46614 } else if (state & STATE_BEGAN) { 46615 return 'start'; 46616 } 46617 return ''; 46618 } 46619 46620 /** 46621 * direction cons to string 46622 * @param {Const} direction 46623 * @returns {String} 46624 */ 46625 function directionStr(direction) { 46626 if (direction == DIRECTION_DOWN) { 46627 return 'down'; 46628 } else if (direction == DIRECTION_UP) { 46629 return 'up'; 46630 } else if (direction == DIRECTION_LEFT) { 46631 return 'left'; 46632 } else if (direction == DIRECTION_RIGHT) { 46633 return 'right'; 46634 } 46635 return ''; 46636 } 46637 46638 /** 46639 * get a recognizer by name if it is bound to a manager 46640 * @param {Recognizer|String} otherRecognizer 46641 * @param {Recognizer} recognizer 46642 * @returns {Recognizer} 46643 */ 46644 function getRecognizerByNameIfManager(otherRecognizer, recognizer) { 46645 var manager = recognizer.manager; 46646 if (manager) { 46647 return manager.get(otherRecognizer); 46648 } 46649 return otherRecognizer; 46650 } 46651 46652 /** 46653 * This recognizer is just used as a base for the simple attribute recognizers. 46654 * @constructor 46655 * @extends Recognizer 46656 */ 46657 function AttrRecognizer() { 46658 Recognizer.apply(this, arguments); 46659 } 46660 46661 inherit(AttrRecognizer, Recognizer, { 46662 /** 46663 * @namespace 46664 * @memberof AttrRecognizer 46665 */ 46666 defaults: { 46667 /** 46668 * @type {Number} 46669 * @default 1 46670 */ 46671 pointers: 1 46672 }, 46673 46674 /** 46675 * Used to check if it the recognizer receives valid input, like input.distance > 10. 46676 * @memberof AttrRecognizer 46677 * @param {Object} input 46678 * @returns {Boolean} recognized 46679 */ 46680 attrTest: function (input) { 46681 var optionPointers = this.options.pointers; 46682 return optionPointers === 0 || input.pointers.length === optionPointers; 46683 }, 46684 46685 /** 46686 * Process the input and return the state for the recognizer 46687 * @memberof AttrRecognizer 46688 * @param {Object} input 46689 * @returns {*} State 46690 */ 46691 process: function (input) { 46692 var state = this.state; 46693 var eventType = input.eventType; 46694 46695 var isRecognized = state & (STATE_BEGAN | STATE_CHANGED); 46696 var isValid = this.attrTest(input); 46697 46698 // on cancel input and we've recognized before, return STATE_CANCELLED 46699 if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) { 46700 return state | STATE_CANCELLED; 46701 } else if (isRecognized || isValid) { 46702 if (eventType & INPUT_END) { 46703 return state | STATE_ENDED; 46704 } else if (!(state & STATE_BEGAN)) { 46705 return STATE_BEGAN; 46706 } 46707 return state | STATE_CHANGED; 46708 } 46709 return STATE_FAILED; 46710 } 46711 }); 46712 46713 /** 46714 * Pan 46715 * Recognized when the pointer is down and moved in the allowed direction. 46716 * @constructor 46717 * @extends AttrRecognizer 46718 */ 46719 function PanRecognizer() { 46720 AttrRecognizer.apply(this, arguments); 46721 46722 this.pX = null; 46723 this.pY = null; 46724 } 46725 46726 inherit(PanRecognizer, AttrRecognizer, { 46727 /** 46728 * @namespace 46729 * @memberof PanRecognizer 46730 */ 46731 defaults: { 46732 event: 'pan', 46733 threshold: 10, 46734 pointers: 1, 46735 direction: DIRECTION_ALL 46736 }, 46737 46738 getTouchAction: function () { 46739 var direction = this.options.direction; 46740 var actions = []; 46741 if (direction & DIRECTION_HORIZONTAL) { 46742 actions.push(TOUCH_ACTION_PAN_Y); 46743 } 46744 if (direction & DIRECTION_VERTICAL) { 46745 actions.push(TOUCH_ACTION_PAN_X); 46746 } 46747 return actions; 46748 }, 46749 46750 directionTest: function (input) { 46751 var options = this.options; 46752 var hasMoved = true; 46753 var distance = input.distance; 46754 var direction = input.direction; 46755 var x = input.deltaX; 46756 var y = input.deltaY; 46757 46758 // lock to axis? 46759 if (!(direction & options.direction)) { 46760 if (options.direction & DIRECTION_HORIZONTAL) { 46761 direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT; 46762 hasMoved = x != this.pX; 46763 distance = Math.abs(input.deltaX); 46764 } else { 46765 direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN; 46766 hasMoved = y != this.pY; 46767 distance = Math.abs(input.deltaY); 46768 } 46769 } 46770 input.direction = direction; 46771 return hasMoved && distance > options.threshold && direction & options.direction; 46772 }, 46773 46774 attrTest: function (input) { 46775 return AttrRecognizer.prototype.attrTest.call(this, input) && 46776 (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input))); 46777 }, 46778 46779 emit: function (input) { 46780 46781 this.pX = input.deltaX; 46782 this.pY = input.deltaY; 46783 46784 var direction = directionStr(input.direction); 46785 46786 if (direction) { 46787 input.additionalEvent = this.options.event + direction; 46788 } 46789 this._super.emit.call(this, input); 46790 } 46791 }); 46792 46793 /** 46794 * Pinch
46795 * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out). 46796 * @constructor 46797 * @extends AttrRecognizer 46798 */ 46799 function PinchRecognizer() { 46800 AttrRecognizer.apply(this, arguments); 46801 } 46802 46803 inherit(PinchRecognizer, AttrRecognizer, { 46804 /** 46805 * @namespace 46806 * @memberof PinchRecognizer 46807 */ 46808 defaults: { 46809 event: 'pinch', 46810 threshold: 0, 46811 pointers: 2 46812 }, 46813 46814 getTouchAction: function () { 46815 return [TOUCH_ACTION_NONE]; 46816 }, 46817 46818 attrTest: function (input) { 46819 return this._super.attrTest.call(this, input) && 46820 (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN); 46821 }, 46822 46823 emit: function (input) { 46824 if (input.scale !== 1) { 46825 var inOut = input.scale < 1 ? 'in' : 'out'; 46826 input.additionalEvent = this.options.event + inOut; 46827 } 46828 this._super.emit.call(this, input); 46829 } 46830 }); 46831 46832 /** 46833 * Press
vendor: 18,256 bytes, lines 46834-47373
46834 * Recognized when the pointer is down for x ms without any movement. 46835 * @constructor 46836 * @extends Recognizer 46837 */ 46838 function PressRecognizer() { 46839 Recognizer.apply(this, arguments); 46840 46841 this._timer = null; 46842 this._input = null; 46843 } 46844 46845 inherit(PressRecognizer, Recognizer, { 46846 /** 46847 * @namespace 46848 * @memberof PressRecognizer 46849 */ 46850 defaults: { 46851 event: 'press', 46852 pointers: 1, 46853 time: 251, // minimal time of the pointer to be pressed 46854 threshold: 9 // a minimal movement is ok, but keep it low 46855 }, 46856 46857 getTouchAction: function () { 46858 return [TOUCH_ACTION_AUTO]; 46859 }, 46860 46861 process: function (input) { 46862 var options = this.options; 46863 var validPointers = input.pointers.length === options.pointers; 46864 var validMovement = input.distance < options.threshold; 46865 var validTime = input.deltaTime > options.time; 46866 46867 this._input = input; 46868 46869 // we only allow little movement 46870 // and we've reached an end event, so a tap is possible 46871 if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) { 46872 this.reset(); 46873 } else if (input.eventType & INPUT_START) { 46874 this.reset(); 46875 this._timer = setTimeoutContext(function () { 46876 this.state = STATE_RECOGNIZED; 46877 this.tryEmit(); 46878 }, options.time, this); 46879 } else if (input.eventType & INPUT_END) { 46880 return STATE_RECOGNIZED; 46881 } 46882 return STATE_FAILED; 46883 }, 46884 46885 reset: function () { 46886 clearTimeout(this._timer); 46887 }, 46888 46889 emit: function (input) { 46890 if (this.state !== STATE_RECOGNIZED) { 46891 return; 46892 } 46893 46894 if (input && (input.eventType & INPUT_END)) { 46895 this.manager.emit(this.options.event + 'up', input); 46896 } else { 46897 this._input.timeStamp = now(); 46898 this.manager.emit(this.options.event, this._input); 46899 } 46900 } 46901 }); 46902 46903 /** 46904 * Rotate 46905 * Recognized when two or more pointer are moving in a circular motion. 46906 * @constructor 46907 * @extends AttrRecognizer 46908 */ 46909 function RotateRecognizer() { 46910 AttrRecognizer.apply(this, arguments); 46911 } 46912 46913 inherit(RotateRecognizer, AttrRecognizer, { 46914 /** 46915 * @namespace 46916 * @memberof RotateRecognizer 46917 */ 46918 defaults: { 46919 event: 'rotate', 46920 threshold: 0, 46921 pointers: 2 46922 }, 46923 46924 getTouchAction: function () { 46925 return [TOUCH_ACTION_NONE]; 46926 }, 46927 46928 attrTest: function (input) { 46929 return this._super.attrTest.call(this, input) && 46930 (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN); 46931 } 46932 }); 46933 46934 /** 46935 * Swipe 46936 * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction. 46937 * @constructor 46938 * @extends AttrRecognizer 46939 */ 46940 function SwipeRecognizer() { 46941 AttrRecognizer.apply(this, arguments); 46942 } 46943 46944 inherit(SwipeRecognizer, AttrRecognizer, { 46945 /** 46946 * @namespace 46947 * @memberof SwipeRecognizer 46948 */ 46949 defaults: { 46950 event: 'swipe', 46951 threshold: 10, 46952 velocity: 0.3, 46953 direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL, 46954 pointers: 1 46955 }, 46956 46957 getTouchAction: function () { 46958 return PanRecognizer.prototype.getTouchAction.call(this); 46959 }, 46960 46961 attrTest: function (input) { 46962 var direction = this.options.direction; 46963 var velocity; 46964 46965 if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) { 46966 velocity = input.overallVelocity; 46967 } else if (direction & DIRECTION_HORIZONTAL) { 46968 velocity = input.overallVelocityX; 46969 } else if (direction & DIRECTION_VERTICAL) { 46970 velocity = input.overallVelocityY; 46971 } 46972 46973 return this._super.attrTest.call(this, input) && 46974 direction & input.offsetDirection && 46975 input.distance > this.options.threshold && 46976 input.maxPointers == this.options.pointers && 46977 abs(velocity) > this.options.velocity && input.eventType & INPUT_END; 46978 }, 46979 46980 emit: function (input) { 46981 var direction = directionStr(input.offsetDirection); 46982 if (direction) { 46983 this.manager.emit(this.options.event + direction, input); 46984 } 46985 46986 this.manager.emit(this.options.event, input); 46987 } 46988 }); 46989 46990 /** 46991 * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur 46992 * between the given interval and position. The delay option can be used to recognize multi-taps without firing 46993 * a single tap. 46994 * 46995 * The eventData from the emitted event contains the property `tapCount`, which contains the amount of 46996 * multi-taps being recognized. 46997 * @constructor 46998 * @extends Recognizer 46999 */ 47000 function TapRecognizer() { 47001 Recognizer.apply(this, arguments); 47002 47003 // previous time and center, 47004 // used for tap counting 47005 this.pTime = false; 47006 this.pCenter = false; 47007 47008 this._timer = null; 47009 this._input = null; 47010 this.count = 0; 47011 } 47012 47013 inherit(TapRecognizer, Recognizer, { 47014 /** 47015 * @namespace 47016 * @memberof PinchRecognizer 47017 */ 47018 defaults: { 47019 event: 'tap', 47020 pointers: 1, 47021 taps: 1, 47022 interval: 300, // max time between the multi-tap taps 47023 time: 250, // max time of the pointer to be down (like finger on the screen) 47024 threshold: 9, // a minimal movement is ok, but keep it low 47025 posThreshold: 10 // a multi-tap can be a bit off the initial position 47026 }, 47027 47028 getTouchAction: function () { 47029 return [TOUCH_ACTION_MANIPULATION]; 47030 }, 47031 47032 process: function (input) { 47033 var options = this.options; 47034 47035 var validPointers = input.pointers.length === options.pointers; 47036 var validMovement = input.distance < options.threshold; 47037 var validTouchTime = input.deltaTime < options.time; 47038 47039 this.reset(); 47040 47041 if ((input.eventType & INPUT_START) && (this.count === 0)) { 47042 return this.failTimeout(); 47043 } 47044 47045 // we only allow little movement 47046 // and we've reached an end event, so a tap is possible 47047 if (validMovement && validTouchTime && validPointers) { 47048 if (input.eventType != INPUT_END) { 47049 return this.failTimeout(); 47050 } 47051 47052 var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true; 47053 var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold; 47054 47055 this.pTime = input.timeStamp; 47056 this.pCenter = input.center; 47057 47058 if (!validMultiTap || !validInterval) { 47059 this.count = 1; 47060 } else { 47061 this.count += 1; 47062 } 47063 47064 this._input = input; 47065 47066 // if tap count matches we have recognized it, 47067 // else it has began recognizing... 47068 var tapCount = this.count % options.taps; 47069 if (tapCount === 0) { 47070 // no failing requirements, immediately trigger the tap event 47071 // or wait as long as the multitap interval to trigger 47072 if (!this.hasRequireFailures()) { 47073 return STATE_RECOGNIZED; 47074 } else { 47075 this._timer = setTimeoutContext(function () { 47076 this.state = STATE_RECOGNIZED; 47077 this.tryEmit(); 47078 }, options.interval, this); 47079 return STATE_BEGAN; 47080 } 47081 } 47082 } 47083 return STATE_FAILED; 47084 }, 47085 47086 failTimeout: function () { 47087 this._timer = setTimeoutContext(function () { 47088 this.state = STATE_FAILED; 47089 }, this.options.interval, this); 47090 return STATE_FAILED; 47091 }, 47092 47093 reset: function () { 47094 clearTimeout(this._timer); 47095 }, 47096 47097 emit: function () { 47098 if (this.state == STATE_RECOGNIZED) { 47099 this._input.tapCount = this.count; 47100 this.manager.emit(this.options.event, this._input); 47101 } 47102 } 47103 }); 47104 47105 /** 47106 * Simple way to create a manager with a default set of recognizers. 47107 * @param {HTMLElement} element 47108 * @param {Object} [options] 47109 * @constructor 47110 */ 47111 function Hammer(element, options) { 47112 options = options || {}; 47113 options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset); 47114 return new Manager(element, options); 47115 } 47116 47117 /** 47118 * @const {string} 47119 */ 47120 Hammer.VERSION = '2.0.8'; 47121 47122 /** 47123 * default settings 47124 * @namespace 47125 */ 47126 Hammer.defaults = { 47127 /** 47128 * set if DOM events are being triggered. 47129 * But this is slower and unused by simple implementations, so disabled by default. 47130 * @type {Boolean} 47131 * @default false 47132 */ 47133 domEvents: false, 47134 47135 /** 47136 * The value for the touchAction property/fallback. 47137 * When set to `compute` it will magically set the correct value based on the added recognizers. 47138 * @type {String} 47139 * @default compute 47140 */ 47141 touchAction: TOUCH_ACTION_COMPUTE, 47142 47143 /** 47144 * @type {Boolean} 47145 * @default true 47146 */ 47147 enable: true, 47148 47149 /** 47150 * EXPERIMENTAL FEATURE -- can be removed/changed 47151 * Change the parent input target element. 47152 * If Null, then it is being set the to main element. 47153 * @type {Null|EventTarget} 47154 * @default null 47155 */ 47156 inputTarget: null, 47157 47158 /** 47159 * force an input class 47160 * @type {Null|Function} 47161 * @default null 47162 */ 47163 inputClass: null, 47164 47165 /** 47166 * Default recognizer setup when calling `Hammer()` 47167 * When creating a new Manager these will be skipped. 47168 * @type {Array} 47169 */ 47170 preset: [ 47171 // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...] 47172 [RotateRecognizer, { enable: false }], 47173 [PinchRecognizer, { enable: false }, ['rotate']], 47174 [SwipeRecognizer, { direction: DIRECTION_HORIZONTAL }], 47175 [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']], 47176 [TapRecognizer], 47177 [TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']], 47178 [PressRecognizer] 47179 ], 47180 47181 /** 47182 * Some CSS properties can be used to improve the working of Hammer. 47183 * Add them to this method and they will be set when creating a new Manager. 47184 * @namespace 47185 */ 47186 cssProps: { 47187 /** 47188 * Disables text selection to improve the dragging gesture. Mainly for desktop browsers. 47189 * @type {String} 47190 * @default 'none' 47191 */ 47192 userSelect: 'none', 47193 47194 /** 47195 * Disable the Windows Phone grippers when pressing an element. 47196 * @type {String} 47197 * @default 'none' 47198 */ 47199 touchSelect: 'none', 47200 47201 /** 47202 * Disables the default callout shown when you touch and hold a touch target. 47203 * On iOS, when you touch and hold a touch target such as a link, Safari displays 47204 * a callout containing information about the link. This property allows you to disable that callout. 47205 * @type {String} 47206 * @default 'none' 47207 */ 47208 touchCallout: 'none', 47209 47210 /** 47211 * Specifies whether zooming is enabled. Used by IE10> 47212 * @type {String} 47213 * @default 'none' 47214 */ 47215 contentZooming: 'none', 47216 47217 /** 47218 * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers. 47219 * @type {String} 47220 * @default 'none' 47221 */ 47222 userDrag: 'none', 47223 47224 /** 47225 * Overrides the highlight color shown when the user taps a link or a JavaScript 47226 * clickable element in iOS. This property obeys the alpha value, if specified. 47227 * @type {String} 47228 * @default 'rgba(0,0,0,0)' 47229 */ 47230 tapHighlightColor: 'rgba(0,0,0,0)' 47231 } 47232 }; 47233 47234 var STOP = 1; 47235 var FORCED_STOP = 2; 47236 47237 /** 47238 * Manager 47239 * @param {HTMLElement} element 47240 * @param {Object} [options] 47241 * @constructor 47242 */ 47243 function Manager(element, options) { 47244 this.options = assign({}, Hammer.defaults, options || {}); 47245 47246 this.options.inputTarget = this.options.inputTarget || element; 47247 47248 this.handlers = {}; 47249 this.session = {}; 47250 this.recognizers = []; 47251 this.oldCssProps = {}; 47252 47253 this.element = element; 47254 this.input = createInputInstance(this); 47255 this.touchAction = new TouchAction(this, this.options.touchAction); 47256 47257 toggleCssProps(this, true); 47258 47259 each(this.options.recognizers, function (item) { 47260 var recognizer = this.add(new (item[0])(item[1])); 47261 item[2] && recognizer.recognizeWith(item[2]); 47262 item[3] && recognizer.requireFailure(item[3]); 47263 }, this); 47264 } 47265 47266 Manager.prototype = { 47267 /** 47268 * set options 47269 * @param {Object} options 47270 * @returns {Manager} 47271 */ 47272 set: function (options) { 47273 assign(this.options, options); 47274 47275 // Options that need a little more setup 47276 if (options.touchAction) { 47277 this.touchAction.update(); 47278 } 47279 if (options.inputTarget) { 47280 // Clean up existing event listeners and reinitialize 47281 this.input.destroy(); 47282 this.input.target = options.inputTarget; 47283 this.input.init(); 47284 } 47285 return this; 47286 }, 47287 47288 /** 47289 * stop recognizing for this session. 47290 * This session will be discarded, when a new [input]start event is fired. 47291 * When forced, the recognizer cycle is stopped immediately. 47292 * @param {Boolean} [force] 47293 */ 47294 stop: function (force) { 47295 this.session.stopped = force ? FORCED_STOP : STOP; 47296 }, 47297 47298 /** 47299 * run the recognizers! 47300 * called by the inputHandler function on every movement of the pointers (touches) 47301 * it walks through all the recognizers and tries to detect the gesture that is being made 47302 * @param {Object} inputData 47303 */ 47304 recognize: function (inputData) { 47305 var session = this.session; 47306 if (session.stopped) { 47307 return; 47308 } 47309 47310 // run the touch-action polyfill 47311 this.touchAction.preventDefaults(inputData); 47312 47313 var recognizer; 47314 var recognizers = this.recognizers; 47315 47316 // this holds the recognizer that is being recognized. 47317 // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED 47318 // if no recognizer is detecting a thing, it is set to `null` 47319 var curRecognizer = session.curRecognizer; 47320 47321 // reset when the last recognizer is recognized 47322 // or when we're in a new session 47323 if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) { 47324 curRecognizer = session.curRecognizer = null; 47325 } 47326 47327 var i = 0; 47328 while (i < recognizers.length) { 47329 recognizer = recognizers[i]; 47330 47331 // find out if we are allowed try to recognize the input for this one. 47332 // 1. allow if the session is NOT forced stopped (see the .stop() method) 47333 // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one 47334 // that is being recognized. 47335 // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer. 47336 // this can be setup with the `recognizeWith()` method on the recognizer. 47337 if (session.stopped !== FORCED_STOP && ( // 1 47338 !curRecognizer || recognizer == curRecognizer || // 2 47339 recognizer.canRecognizeWith(curRecognizer))) { // 3 47340 recognizer.recognize(inputData); 47341 } else { 47342 recognizer.reset(); 47343 } 47344 47345 // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the 47346 // current active recognizer. but only if we don't already have an active recognizer 47347 if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) { 47348 curRecognizer = session.curRecognizer = recognizer; 47349 } 47350 i++; 47351 } 47352 }, 47353 47354 /** 47355 * get a recognizer by its event name. 47356 * @param {Recognizer|String} recognizer 47357 * @returns {Recognizer|Null} 47358 */ 47359 get: function (recognizer) { 47360 if (recognizer instanceof Recognizer) { 47361 return recognizer; 47362 } 47363 47364 var recognizers = this.recognizers; 47365 for (var i = 0; i < recognizers.length; i++) { 47366 if (recognizers[i].options.event == recognizer) { 47367 return recognizers[i]; 47368 } 47369 } 47370 return null; 47371 }, 47372 47373 /**
47374 * add a recognizer to the manager 47375 * existing recognizers with the same event name will be removed 47376 * @param {Recognizer} recognizer 47377 * @returns {Recognizer|Manager} 47378 */ 47379 add: function (recognizer) { 47380 if (invokeArrayArg(recognizer, 'add', this)) { 47381 return this; 47382 } 47383 47384 // remove existing 47385 var existing = this.get(recognizer.options.event); 47386 if (existing) { 47387 this.remove(existing); 47388 } 47389 47390 this.recognizers.push(recognizer); 47391 recognizer.manager = this; 47392 47393 this.touchAction.update(); 47394 return recognizer; 47395 }, 47396 47397 /** 47398 * remove a recognizer by name or instance 47399 * @param {Recognizer|String} recognizer 47400 * @returns {Manager} 47401 */ 47402 remove: function (recognizer) { 47403 if (invokeArrayArg(recognizer, 'remove', this)) { 47404 return this; 47405 } 47406 47407 recognizer = this.get(recognizer); 47408 47409 // let's make sure this recognizer exists 47410 if (recognizer) { 47411 var recognizers = this.recognizers; 47412 var index = inArray(recognizers, recognizer); 47413 47414 if (index !== -1) { 47415 recognizers.splice(index, 1); 47416 this.touchAction.update(); 47417 } 47418 } 47419 47420 return this; 47421 }, 47422 47423 /** 47424 * bind event 47425 * @param {String} events 47426 * @param {Function} handler 47427 * @returns {EventEmitter} this 47428 */ 47429 on: function (events, handler) { 47430 if (events === undefined) { 47431 return; 47432 } 47433 if (handler === undefined) { 47434 return; 47435 } 47436 47437 var handlers = this.handlers; 47438 each(splitStr(events), function (event) { 47439 handlers[event] = handlers[event] || []; 47440 handlers[event].push(handler); 47441 }); 47442 return this; 47443 }, 47444 47445 /** 47446 * unbind event, leave emit blank to remove all handlers 47447 * @param {String} events 47448 * @param {Function} [handler] 47449 * @returns {EventEmitter} this 47450 */ 47451 off: function (events, handler) { 47452 if (events === undefined) { 47453 return; 47454 } 47455 47456 var handlers = this.handlers; 47457 each(splitStr(events), function (event) { 47458 if (!handler) { 47459 delete handlers[event]; 47460 } else { 47461 handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1); 47462 } 47463 }); 47464 return this; 47465 }, 47466 47467 /** 47468 * emit event to the listeners 47469 * @param {String} event 47470 * @param {Object} data 47471 */ 47472 emit: function (event, data) { 47473 // we also want to trigger dom events 47474 if (this.options.domEvents) { 47475 triggerDomEvent(event, data); 47476 } 47477 47478 // no handlers, so skip it all 47479 var handlers = this.handlers[event] && this.handlers[event].slice(); 47480 if (!handlers || !handlers.length) { 47481 return; 47482 } 47483 47484 data.type = event; 47485 data.preventDefault = function () { 47486 data.srcEvent.preventDefault(); 47487 }; 47488 47489 var i = 0; 47490 while (i < handlers.length) { 47491 handlers[i](data); 47492 i++; 47493 } 47494 }, 47495 47496 /** 47497 * destroy the manager and unbinds all events 47498 * it doesn't unbind dom events, that is the user own responsibility 47499 */ 47500 destroy: function () { 47501 this.element && toggleCssProps(this, false); 47502 47503 this.handlers = {}; 47504 this.session = {}; 47505 this.input.destroy(); 47506 this.element = null; 47507 } 47508 }; 47509 47510 /** 47511 * add/remove the css properties as defined in manager.options.cssProps 47512 * @param {Manager} manager 47513 * @param {Boolean} add 47514 */ 47515 function toggleCssProps(manager, add) { 47516 var element = manager.element; 47517 if (!element.style) { 47518 return; 47519 } 47520 var prop; 47521 each(manager.options.cssProps, function (value, name) { 47522 prop = prefixed(element.style, name); 47523 if (add) { 47524 manager.oldCssProps[prop] = element.style[prop]; 47525 element.style[prop] = value; 47526 } else { 47527 element.style[prop] = manager.oldCssProps[prop] || ''; 47528 } 47529 }); 47530 if (!add) { 47531 manager.oldCssProps = {}; 47532 } 47533 } 47534 47535 /** 47536 * trigger dom event 47537 * @param {String} event 47538 * @param {Object} data 47539 */ 47540 function triggerDomEvent(event, data) { 47541 var gestureEvent = document.createEvent('Event'); 47542 gestureEvent.initEvent(event, true, true); 47543 gestureEvent.gesture = data; 47544 data.target.dispatchEvent(gestureEvent); 47545 } 47546 47547 assign(Hammer, { 47548 INPUT_START: INPUT_START, 47549 INPUT_MOVE: INPUT_MOVE, 47550 INPUT_END: INPUT_END, 47551 INPUT_CANCEL: INPUT_CANCEL, 47552 47553 STATE_POSSIBLE: STATE_POSSIBLE, 47554 STATE_BEGAN: STATE_BEGAN, 47555 STATE_CHANGED: STATE_CHANGED, 47556 STATE_ENDED: STATE_ENDED, 47557 STATE_RECOGNIZED: STATE_RECOGNIZED, 47558 STATE_CANCELLED: STATE_CANCELLED, 47559 STATE_FAILED: STATE_FAILED, 47560 47561 DIRECTION_NONE: DIRECTION_NONE, 47562 DIRECTION_LEFT: DIRECTION_LEFT, 47563 DIRECTION_RIGHT: DIRECTION_RIGHT, 47564 DIRECTION_UP: DIRECTION_UP, 47565 DIRECTION_DOWN: DIRECTION_DOWN, 47566 DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL, 47567 DIRECTION_VERTICAL: DIRECTION_VERTICAL, 47568 DIRECTION_ALL: DIRECTION_ALL, 47569 47570 Manager: Manager, 47571 Input: Input, 47572 TouchAction: TouchAction, 47573 47574 TouchInput: TouchInput, 47575 MouseInput: MouseInput, 47576 PointerEventInput: PointerEventInput, 47577 TouchMouseInput: TouchMouseInput, 47578 SingleTouchInput: SingleTouchInput, 47579 47580 Recognizer: Recognizer, 47581 AttrRecognizer: AttrRecognizer, 47582 Tap: TapRecognizer, 47583 Pan: PanRecognizer, 47584 Swipe: SwipeRecognizer, 47585 Pinch: PinchRecognizer, 47586 Rotate: RotateRecognizer, 47587 Press: PressRecognizer, 47588 47589 on: addEventListeners, 47590 off: removeEventListeners, 47591 each: each, 47592 merge: merge, 47593 extend: extend, 47594 assign: assign, 47595 inherit: inherit, 47596 bindFn: bindFn, 47597 prefixed: prefixed 47598 }); 47599 47600 // this prevents errors when Hammer is loaded in the presence of an AMD 47601 // style loader but by script tag, not by the loader. 47602 var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line 47603 freeGlobal.Hammer = Hammer; 47604 47605 if (typeof define === 'function' && define.amd) { 47606 define(function () { 47607 return Hammer; 47608 }); 47609 } else if (typeof module != 'undefined' && module.exports) { 47610 module.exports = Hammer; 47611 } else { 47612 window[exportName] = Hammer; 47613 } 47614 47615})(window, document, 'Hammer'); 47616 47617 47618(function (factory) { 47619 if (typeof define === 'function' && define.amd) { 47620 define(['jquery', 'hammerjs'], factory); 47621 } else if (typeof exports === 'object') { 47622 factory(require('jquery'), require('hammerjs')); 47623 } else { 47624 factory(jQuery, Hammer); 47625 } 47626}(function ($, Hammer) { 47627 function hammerify(el, options) { 47628 var $el = $(el); 47629 if (!$el.data("hammer")) { 47630 $el.data("hammer", new Hammer($el[0], options)); 47631 } 47632 } 47633 47634 $.fn.hammer = function (options) { 47635 return this.each(function () { 47636 hammerify(this, options); 47637 }); 47638 }; 47639 47640 // extend the emit method to also trigger jQuery events 47641 Hammer.Manager.prototype.emit = (function (originalEmit) { 47642 return function (type, data) { 47643 originalEmit.call(this, type, data); 47644 $(this.element).trigger({ 47645 type: type, 47646 gesture: data 47647 }); 47648 }; 47649 })(Hammer.Manager.prototype.emit); 47650})); 47651 47652function ComponentSteps(element) { 47653 this.element = element; 47654 this.showButton = element.find(".show-button"); 47655 this.hideButton = element.find(".hide-button"); 47656 this.highlightsExtra = element.find('.highlights-extra'); 47657 this.content = element.find('.content'); 47658 this.index = 0; 47659 47660 47661 47662 this.cards = element.find('.steps-cards').first(); 47663 this.cards.hammer(); 47664 47665 this.cards.on('swipeleft', this.swipeEvent.bind(this)); 47666 this.cards.on('swiperight', this.swipeEvent.bind(this)); 47667 47668 this.initializeComponent(); 47669} 47670 47671ComponentSteps.prototype.showButtonClicked = function (event) { 47672 this.highlightsExtra.addClass("display-visible").removeClass("display-hidden"); 47673 this.hideButton.addClass("display-visible").removeClass("display-hidden"); 47674 this.showButton.addClass("display-hidden").removeClass("display-visible"); 47675}; 47676 47677ComponentSteps.prototype.hideButtonClicked = function (event) { 47678 this.highlightsExtra.addClass("display-hidden").removeClass("display-visible"); 47679 this.hideButton.addClass("display-hidden").removeClass("display-visible"); 47680 this.showButton.addClass("display-visible").removeClass("display-hidden"); 47681}; 47682 47683ComponentSteps.prototype.swipeEvent = function (event) { 47684 var self = this; 47685 var type = event.type; 47686 this.index = this.element.data('index'); 47687 47688 if (type === 'swipeleft') { 47689 if (this.index < (this.content.length - 1)) { 47690 this.index = (this.index + 1); 47691 } 47692 } 47693 47694 if (type === 'swiperight') { 47695 if (this.index > 0) { 47696 this.index = (this.index - 1); 47697 } 47698 } 47699 47700 this.element.data('index', this.index); 47701 47702 this.content.each(function (i) { 47703 if (i === self.index) { 47704 $(this).addClass('active').removeClass('future past'); 47705 } else if (i < self.index) { 47706 $(this).removeClass('active future').addClass('past');; 47707 } else if (i > self.index) { 47708 $(this).removeClass('active past').addClass('future'); 47709 47710 } 47711 }); 47712}; 47713 47714 47715 47716ComponentSteps.prototype.initializeComponent = function () { 47717 47718 this.element.attr('data-index', 0); 47719 47720 this.showButton.on("click", this.showButtonClicked.bind(this)); 47721 this.hideButton.on("click", this.hideButtonClicked.bind(this)); 47722}; 47723 47724$(function () { 47725 $('.component-steps').each(function () { 47726 // console.log('hello', $(this)); 47727 new ComponentSteps($(this)); 47728 }); 47729 $(window).on('load resize', function () { 47730 if($(window).width() > 767) $('.component-steps').each(function(){$(this).find('.steps-cards').css("height", "initial")}); 47731 else { 47732 $('.component-steps').each(function(){ 47733 var cmpHeight = 120; 47734 $(this).find('.content').each(function(){ 47735 var stepHeight = $(this).height(); 47736 cmpHeight = (stepHeight > cmpHeight) ? stepHeight : cmpHeight; 47737 }) 47738 47739 $(this).find('.steps-cards').height(cmpHeight); 47740 }) 47741 } 47742}); 47743}); 47744 47745!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.facon=t(
47745)}(this,function(){return function(e,...t){let r="";const n={};for(let o=0;o<t.length;o++)if(t[o]instanceof HTMLElement){const l=`id${o}`;n[l]=t[o],r+=`${e[o]}<div append="${l}"></div>`}else r+=e[o]+t[o];r+=e[e.length-1];const o=document.createElement("template");o.innerHTML=r;const l=o.content;return[...l.querySelectorAll("[append]")].forEach(e=>{const t=n[e.getAttribute("append")];e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e)}),l.collect=({attr:e="ref",keepAttribute:t,to:r={}}={})=>[...l.querySelectorAll(`[${e}]`)].reduce((r,n)=>{const o=n.getAttribute(e).trim();return!t&&n.removeAttribute(e),r[o]=r[o]?Array.isArray(r[o])?[...r[o],n]:[r[o],n]:n,r},r),l};}); 47746/** 47747 * Display a nice easy to use multiselect list 47748 * @Version: 2.4.20 47749 * @Author: Patrick Springstubbe 47750 * @Contact: @JediNobleclem 47751 * @Website: springstubbe.us 47752 * @Source: https://github.com/nobleclem/jQuery-MultiSelect 47753 * 47754 * Usage: 47755 * $('select[multiple]').multiselect(); 47756 * $('select[multiple]').multiselect({ texts: { placeholder: 'Select options' } }); 47757 * $('select[multiple]').multiselect('reload'); 47758 * $('select[multiple]').multiselect( 'loadOptions', [{ 47759 * name : 'Option Name 1', 47760 * value : 'option-value-1', 47761 * checked: false, 47762 * attributes : { 47763 * custom1: 'value1', 47764 * custom2: 'value2' 47765 * } 47766 * },{ 47767 * name : 'Option Name 2', 47768 * value : 'option-value-2', 47769 * checked: false, 47770 * attributes : { 47771 * custom1: 'value1', 47772 * custom2: 'value2' 47773 * } 47774 * }]); 47775 * 47776 **/ 47777(function($){ 47778 var defaults = { 47779 columns: 1, // how many columns should be use to show options 47780 search : false, // include option search box 47781 47782 // search filter options 47783 searchOptions : { 47784 delay : 250, // time (in ms) between keystrokes until search happens 47785 showOptGroups: false, // show option group titles if no options remaining 47786 searchText : true, // search within the text 47787 searchValue : false, // search within the value 47788 onSearch : function( element ){} // fires on keyup before search on options happens 47789 }, 47790 47791 // plugin texts 47792 texts: { 47793 placeholder : 'Select options', // text to use in dummy input 47794 search : 'Search', // search input placeholder text 47795 selectedOptions: ' selected', // selected suffix text 47796 selectAll : 'Select all', // select all text 47797 unselectAll : 'Unselect all', // unselect all text 47798 noneSelected : 'None Selected' // None selected text 47799 }, 47800 47801 // general options 47802 selectAll : false, // add select all option 47803 selectGroup : false, // select entire optgroup 47804 minHeight : 200, // minimum height of option overlay 47805 maxHeight : null, // maximum height of option overlay 47806 maxWidth : null, // maximum width of option overlay (or selector) 47807 maxPlaceholderWidth: null, // maximum width of placeholder button 47808 maxPlaceholderOpts : 10, // maximum number of placeholder options to show until "# selected" shown instead 47809 showCheckbox : true, // display the checkbox to the user 47810 checkboxAutoFit : false, // auto calc checkbox padding 47811 optionAttributes : [], // attributes to copy to the checkbox from the option element 47812 47813 // Callbacks 47814 onLoad : function( element ){}, // fires at end of list initialization 47815 onOptionClick : function( element, option ){}, // fires when an option is clicked 47816 onControlClose: function( element ){}, // fires when the options list is closed 47817 onSelectAll : function( element, selected ){}, // fires when (un)select all is clicked 47818 onPlaceholder : function( element, placeholder, selectedOpts ){}, // fires when the placeholder txt is updated 47819 }; 47820 47821 var msCounter = 1; // counter for each select list 47822 var msOptCounter = 1; // counter for each option on page 47823 47824 // FOR LEGACY BROWSERS (talking to you IE8) 47825 if( typeof Array.prototype.map !== 'function' ) { 47826 Array.prototype.map = function( callback, thisArg ) { 47827 if( typeof thisArg === 'undefined' ) { 47828 thisArg = this; 47829 } 47830
vendor: 36,579 bytes, lines 47831-48692
47831 return $.isArray( thisArg ) ? $.map( thisArg, callback ) : []; 47832 }; 47833 } 47834 if( typeof String.prototype.trim !== 'function' ) { 47835 String.prototype.trim = function() { 47836 return this.replace(/^\s+|\s+$/g, ''); 47837 }; 47838 } 47839 47840 function MultiSelect( element, options ) 47841 { 47842 this.element = element; 47843 this.options = $.extend( true, {}, defaults, options ); 47844 this.updateSelectAll = true; 47845 this.updatePlaceholder = true; 47846 this.listNumber = msCounter; 47847 47848 msCounter = msCounter + 1; // increment counter 47849 47850 /* Make sure its a multiselect list */ 47851 if( !$(this.element).attr('multiple') ) { 47852 throw new Error( '[jQuery-MultiSelect] Select list must be a multiselect list in order to use this plugin' ); 47853 } 47854 47855 /* Options validation checks */ 47856 if( this.options.search ){ 47857 if( !this.options.searchOptions.searchText && !this.options.searchOptions.searchValue ){ 47858 throw new Error( '[jQuery-MultiSelect] Either searchText or searchValue should be true.' ); 47859 } 47860 } 47861 47862 /** BACKWARDS COMPATIBILITY **/ 47863 if( 'placeholder' in this.options ) { 47864 this.options.texts.placeholder = this.options.placeholder; 47865 delete this.options.placeholder; 47866 } 47867 if( 'default' in this.options.searchOptions ) { 47868 this.options.texts.search = this.options.searchOptions['default']; 47869 delete this.options.searchOptions['default']; 47870 } 47871 /** END BACKWARDS COMPATIBILITY **/ 47872 47873 // load this instance 47874 this.load(); 47875 } 47876 47877 MultiSelect.prototype = { 47878 /* LOAD CUSTOM MULTISELECT DOM/ACTIONS */ 47879 load: function() { 47880 var instance = this; 47881 47882 // make sure this is a select list and not loaded 47883 if( (instance.element.nodeName != 'SELECT') || $(instance.element).hasClass('jqmsLoaded') ) { 47884 return true; 47885 } 47886 47887 // sanity check so we don't double load on a select element 47888 $(instance.element).addClass('jqmsLoaded ms-list-'+ instance.listNumber ).data( 'plugin_multiselect-instance', instance ); 47889 47890 // add option container 47891 $(instance.element).after('<div id="ms-list-'+ instance.listNumber +'" class="ms-options-wrap"><button type="button"><span>None Selected</span></button><div class="ms-options"><ul></ul></div></div>'); 47892 47893 var placeholder = $(instance.element).siblings('#ms-list-'+ instance.listNumber +'.ms-options-wrap').find('> button:first-child'); 47894 var optionsWrap = $(instance.element).siblings('#ms-list-'+ instance.listNumber +'.ms-options-wrap').find('> .ms-options'); 47895 var optionsList = optionsWrap.find('> ul'); 47896 47897 // don't show checkbox (add class for css to hide checkboxes) 47898 if( !instance.options.showCheckbox ) { 47899 optionsWrap.addClass('hide-checkbox'); 47900 } 47901 else if( instance.options.checkboxAutoFit ) { 47902 optionsWrap.addClass('checkbox-autofit'); 47903 } 47904 47905 // check if list is disabled 47906 if( $(instance.element).prop( 'disabled' ) ) { 47907 placeholder.prop( 'disabled', true ); 47908 } 47909 47910 // set placeholder maxWidth 47911 if( instance.options.maxPlaceholderWidth ) { 47912 placeholder.css( 'maxWidth', instance.options.maxPlaceholderWidth ); 47913 } 47914 47915 // override with user defined maxHeight 47916 if( instance.options.maxHeight ) { 47917 var maxHeight = instance.options.maxHeight; 47918 } 47919 else { 47920 // cacl default maxHeight 47921 var maxHeight = ($(window).height() - optionsWrap.offset().top + $(window).scrollTop() - 20); 47922 } 47923 47924 // maxHeight cannot be less than options.minHeight 47925 maxHeight = maxHeight < instance.options.minHeight ? instance.options.minHeight : maxHeight; 47926 47927 optionsWrap.css({ 47928 maxWidth : instance.options.maxWidth, 47929 minHeight: instance.options.minHeight, 47930 maxHeight: maxHeight, 47931 }); 47932 47933 // isolate options scroll 47934 // @source: https://github.com/nobleclem/jQuery-IsolatedScroll 47935 optionsWrap.on( 'touchmove mousewheel DOMMouseScroll', function ( e ) { 47936 if( ($(this).outerHeight() < $(this)[0].scrollHeight) ) { 47937 var e0 = e.originalEvent, 47938 delta = e0.wheelDelta || -e0.detail; 47939 47940 if( ($(this).outerHeight() + $(this)[0].scrollTop) > $(this)[0].scrollHeight ) { 47941 e.preventDefault(); 47942 this.scrollTop += ( delta < 0 ? 1 : -1 ); 47943 } 47944 } 47945 }); 47946 47947 // hide options menus if click happens off of the list placeholder button 47948 $(document).off('click.ms-hideopts').on('click.ms-hideopts', function( event ){ 47949 if( !$(event.target).closest('.ms-options-wrap').length ) { 47950 $('.ms-options-wrap.ms-active > .ms-options').each(function(){ 47951 $(this).closest('.ms-options-wrap').removeClass('ms-active'); 47952 47953 var listID = $(this).closest('.ms-options-wrap').attr('id'); 47954 47955 var thisInst = $(this).parent().siblings('.'+ listID +'.jqmsLoaded').data('plugin_multiselect-instance'); 47956 47957 // USER CALLBACK 47958 if( typeof thisInst.options.onControlClose == 'function' ) { 47959 thisInst.options.onControlClose( thisInst.element ); 47960 } 47961 }); 47962 } 47963 // hide open option lists if escape key pressed 47964 }).on('keydown', function( event ){ 47965 if( (event.keyCode || event.which) == 27 ) { // esc key 47966 $(this).trigger('click.ms-hideopts'); 47967 } 47968 }); 47969 47970 // handle pressing enter|space while tabbing through 47971 placeholder.on('keydown', function( event ){ 47972 var code = (event.keyCode || event.which); 47973 if( (code == 13) || (code == 32) ) { // enter OR space 47974 placeholder.trigger( 'mousedown' ); 47975 } 47976 }); 47977 47978 // disable button action 47979 placeholder.on( 'mousedown', function( event ){ 47980 // ignore if its not a left click 47981 if( event.which && (event.which != 1) ) { 47982 return true; 47983 } 47984 47985 // hide other menus before showing this one 47986 $('.ms-options-wrap.ms-active').each(function(){ 47987 if( $(this).siblings( '.'+ $(this).attr('id') +'.jqmsLoaded')[0] != optionsWrap.parent().siblings('.ms-list-'+ instance.listNumber +'.jqmsLoaded')[0] ) { 47988 $(this).removeClass('ms-active'); 47989 47990 var thisInst = $(this).siblings( '.'+ $(this).attr('id') +'.jqmsLoaded').data('plugin_multiselect-instance'); 47991 47992 // USER CALLBACK 47993 if( typeof thisInst.options.onControlClose == 'function' ) { 47994 thisInst.options.onControlClose( thisInst.element ); 47995 } 47996 } 47997 }); 47998 47999 // show/hide options 48000 optionsWrap.closest('.ms-options-wrap').toggleClass('ms-active'); 48001 48002 // recalculate height 48003 if( optionsWrap.closest('.ms-options-wrap').hasClass('ms-active') ) { 48004 optionsWrap.css( 'maxHeight', '' ); 48005 48006 // override with user defined maxHeight 48007 if( instance.options.maxHeight ) { 48008 var maxHeight = instance.options.maxHeight; 48009 } 48010 else { 48011 // cacl default maxHeight 48012 var maxHeight = ($(window).height() - optionsWrap.offset().top + $(window).scrollTop() - 20); 48013 } 48014 48015 if( maxHeight ) { 48016 // maxHeight cannot be less than options.minHeight 48017 maxHeight = maxHeight < instance.options.minHeight ? instance.options.minHeight : maxHeight; 48018 48019 optionsWrap.css( 'maxHeight', maxHeight ); 48020 } 48021 } 48022 else if( typeof instance.options.onControlClose == 'function' ) { 48023 instance.options.onControlClose( instance.element ); 48024 } 48025 }).click(function( event ){ event.preventDefault(); }); 48026 48027 // add placeholder copy 48028 if( instance.options.texts.placeholder ) { 48029 placeholder.find('span').text( instance.options.texts.placeholder ); 48030 } 48031 48032 // add search box 48033 if( instance.options.search ) { 48034 optionsList.before('<div class="ms-search"><input type="text" value="" placeholder="'+ instance.options.texts.search +'" /></div>'); 48035 48036 var search = optionsWrap.find('.ms-search input'); 48037 search.on('keyup', function(){ 48038 // ignore keystrokes that don't make a difference 48039 if( $(this).data('lastsearch') == $(this).val() ) { 48040 return true; 48041 } 48042 48043 // pause timeout 48044 if( $(this).data('searchTimeout') ) { 48045 clearTimeout( $(this).data('searchTimeout') ); 48046 } 48047 48048 var thisSearchElem = $(this); 48049 48050 $(this).data('searchTimeout', setTimeout(function(){ 48051 thisSearchElem.data('lastsearch', thisSearchElem.val() ); 48052 48053 // USER CALLBACK 48054 if( typeof instance.options.searchOptions.onSearch == 'function' ) { 48055 instance.options.searchOptions.onSearch( instance.element ); 48056 } 48057 48058 // search non optgroup li's 48059 var searchString = $.trim( search.val().toLowerCase() ); 48060 if( searchString ) { 48061 optionsList.find('li[data-search-term*="'+ searchString +'"]:not(.optgroup)').removeClass('ms-hidden'); 48062 optionsList.find('li:not([data-search-term*="'+ searchString +'"], .optgroup)').addClass('ms-hidden'); 48063 } 48064 else { 48065 optionsList.find('.ms-hidden').removeClass('ms-hidden'); 48066 } 48067 48068 // show/hide optgroups based on if there are items visible within 48069 if( !instance.options.searchOptions.showOptGroups ) { 48070 optionsList.find('.optgroup').each(function(){ 48071 if( $(this).find('li:not(.ms-hidden)').length ) { 48072 $(this).show(); 48073 } 48074 else { 48075 $(this).hide(); 48076 } 48077 }); 48078 } 48079 48080 instance._updateSelectAllText(); 48081 }, instance.options.searchOptions.delay )); 48082 }); 48083 } 48084 48085 // add global select all options 48086 if( instance.options.selectAll ) { 48087 optionsList.before('<a href="#" class="ms-selectall global">' + instance.options.texts.selectAll + '</a>'); 48088 } 48089 48090 // handle select all option 48091 optionsWrap.on('click', '.ms-selectall', function( event ){ 48092 event.preventDefault(); 48093 48094 instance.updateSelectAll = false; 48095 instance.updatePlaceholder = false; 48096 48097 var select = optionsWrap.parent().siblings('.ms-list-'+ instance.listNumber +'.jqmsLoaded'); 48098 48099 if( $(this).hasClass('global') ) { 48100 // check if any options are not selected if so then select them 48101 if( optionsList.find('li:not(.optgroup, .selected, .ms-hidden) input[type="checkbox"]:not(:disabled)').length ) { 48102 // get unselected vals, mark as selected, return val list 48103 optionsList.find('li:not(.optgroup, .selected, .ms-hidden) input[type="checkbox"]:not(:disabled)').closest('li').addClass('selected'); 48104 optionsList.find('li.selected input[type="checkbox"]:not(:disabled)').prop( 'checked', true ); 48105 } 48106 // deselect everything 48107 else { 48108 optionsList.find('li:not(.optgroup, .ms-hidden).selected input[type="checkbox"]:not(:disabled)').closest('li').removeClass('selected'); 48109 optionsList.find('li:not(.optgroup, .ms-hidden, .selected) input[type="checkbox"]:not(:disabled)').prop( 'checked', false ); 48110 } 48111 } 48112 else if( $(this).closest('li').hasClass('optgroup') ) { 48113 var optgroup = $(this).closest('li.optgroup'); 48114 48115 // check if any selected if so then select them 48116 if( optgroup.find('li:not(.selected, .ms-hidden) input[type="checkbox"]:not(:disabled)').length ) { 48117 optgroup.find('li:not(.selected, .ms-hidden) input[type="checkbox"]:not(:disabled)').closest('li').addClass('selected'); 48118 optgroup.find('li.selected input[type="checkbox"]:not(:disabled)').prop( 'checked', true ); 48119 } 48120 // deselect everything 48121 else { 48122 optgroup.find('li:not(.ms-hidden).selected input[type="checkbox"]:not(:disabled)').closest('li').removeClass('selected'); 48123 optgroup.find('li:not(.ms-hidden, .selected) input[type="checkbox"]:not(:disabled)').prop( 'checked', false ); 48124 } 48125 } 48126 48127 var vals = []; 48128 optionsList.find('li.selected input[type="checkbox"]').each(function(){ 48129 vals.push( $(this).val() ); 48130 }); 48131 select.val( vals ).trigger('change'); 48132 48133 instance.updateSelectAll = true; 48134 instance.updatePlaceholder = true; 48135 48136 // USER CALLBACK 48137 if( typeof instance.options.onSelectAll == 'function' ) { 48138 instance.options.onSelectAll( instance.element, vals.length ); 48139 } 48140 48141 instance._updateSelectAllText(); 48142 instance._updatePlaceholderText(); 48143 }); 48144 48145 // add options to wrapper 48146 var options = []; 48147 $(instance.element).children().each(function(){ 48148 if( this.nodeName == 'OPTGROUP' ) { 48149 var groupOptions = []; 48150 48151 $(this).children('option').each(function(){ 48152 var thisOptionAtts = {}; 48153 for( var i = 0; i < instance.options.optionAttributes.length; i++ ) { 48154 var thisOptAttr = instance.options.optionAttributes[ i ]; 48155 48156 if( $(this).attr( thisOptAttr ) !== undefined ) { 48157 thisOptionAtts[ thisOptAttr ] = $(this).attr( thisOptAttr ); 48158 } 48159 } 48160 48161 groupOptions.push({ 48162 name : $(this).text(), 48163 value : $(this).val(), 48164 checked: $(this).prop( 'selected' ), 48165 attributes: thisOptionAtts 48166 }); 48167 }); 48168 48169 options.push({ 48170 label : $(this).attr('label'), 48171 options: groupOptions 48172 }); 48173 } 48174 else if( this.nodeName == 'OPTION' ) { 48175 var thisOptionAtts = {}; 48176 for( var i = 0; i < instance.options.optionAttributes.length; i++ ) { 48177 var thisOptAttr = instance.options.optionAttributes[ i ]; 48178 48179 if( $(this).attr( thisOptAttr ) !== undefined ) { 48180 thisOptionAtts[ thisOptAttr ] = $(this).attr( thisOptAttr ); 48181 } 48182 } 48183 48184 options.push({ 48185 name : $(this).text(), 48186 value : $(this).val(), 48187 checked : $(this).prop( 'selected' ), 48188 attributes: thisOptionAtts 48189 }); 48190 } 48191 else { 48192 // bad option 48193 return true; 48194 } 48195 }); 48196 instance.loadOptions( options, true, false ); 48197 48198 // BIND SELECT ACTION 48199 optionsWrap.on( 'click', 'input[type="checkbox"]', function(){ 48200 $(this).closest( 'li' ).toggleClass( 'selected' ); 48201 48202 var select = optionsWrap.parent().siblings('.ms-list-'+ instance.listNumber +'.jqmsLoaded'); 48203 48204 // toggle clicked option 48205 select.find('option[value="'+ instance._escapeSelector( $(this).val() ) +'"]').prop( 48206 'selected', $(this).is(':checked') 48207 ).closest('select').trigger('change'); 48208 48209 // USER CALLBACK 48210 if( typeof instance.options.onOptionClick == 'function' ) { 48211 instance.options.onOptionClick(instance.element, this); 48212 } 48213 48214 instance._updateSelectAllText(); 48215 instance._updatePlaceholderText(); 48216 }); 48217 48218 // BIND FOCUS EVENT 48219 optionsWrap.on('focusin', 'input[type="checkbox"]', function(){ 48220 $(this).closest('label').addClass('focused'); 48221 }).on('focusout', 'input[type="checkbox"]', function(){ 48222 $(this).closest('label').removeClass('focused'); 48223 }); 48224 48225 // USER CALLBACK 48226 if( typeof instance.options.onLoad === 'function' ) { 48227 instance.options.onLoad( instance.element ); 48228 } 48229 48230 // hide native select list 48231 $(instance.element).hide(); 48232 }, 48233 48234 /* LOAD SELECT OPTIONS */ 48235 loadOptions: function( options, overwrite, updateSelect ) { 48236 console.log( options ); 48237 overwrite = (typeof overwrite == 'boolean') ? overwrite : true; 48238 updateSelect = (typeof updateSelect == 'boolean') ? updateSelect : true; 48239 48240 var instance = this; 48241 var select = $(instance.element); 48242 var optionsList = select.siblings('#ms-list-'+ instance.listNumber +'.ms-options-wrap').find('> .ms-options > ul'); 48243 var optionsWrap = select.siblings('#ms-list-'+ instance.listNumber +'.ms-options-wrap').find('> .ms-options'); 48244 48245 if( overwrite ) { 48246 optionsList.find('> li').remove(); 48247 48248 if( updateSelect ) { 48249 select.find('> *').remove(); 48250 } 48251 } 48252 48253 var containers = []; 48254 for( var key in options ) { 48255 // Prevent prototype methods injected into options from being iterated over. 48256 if( !options.hasOwnProperty( key ) ) { 48257 continue; 48258 } 48259 48260 var thisOption = options[ key ]; 48261 var container = $('<li/>'); 48262 var appendContainer = true; 48263 48264 // OPTION 48265 if( thisOption.hasOwnProperty('value') ) { 48266 if( instance.options.showCheckbox && instance.options.checkboxAutoFit ) { 48267 container.addClass('ms-reflow'); 48268 } 48269 48270 // add option to ms dropdown 48271 instance._addOption( container, thisOption ); 48272 48273 if( updateSelect ) { 48274 var selOption = $('<option/>', { 48275 value: thisOption.value, 48276 text : thisOption.name 48277 }); 48278 48279 // add custom user attributes 48280 if( thisOption.hasOwnProperty('attributes') && Object.keys( thisOption.attributes ).length ) { 48281 selOption.attr( thisOption.attributes ); 48282 } 48283 48284 // mark option as selected 48285 if( thisOption.checked ) { 48286 selOption.prop( 'selected', true ); 48287 } 48288 48289 select.append( selOption ); 48290 } 48291 } 48292 // OPTGROUP 48293 else if( thisOption.hasOwnProperty('options') ) { 48294 var optGroup = $('<optgroup/>', { 48295 label: thisOption.label 48296 }); 48297 48298 optionsList.find('> li.optgroup > span.label').each(function(){ 48299 if( $(this).text() == thisOption.label ) { 48300 container = $(this).closest('.optgroup'); 48301 appendContainer = false; 48302 } 48303 }); 48304 48305 // prepare to append optgroup to select element 48306 if( updateSelect ) { 48307 if( select.find('optgroup[label="'+ thisOption.label +'"]').length ) { 48308 optGroup = select.find('optgroup[label="'+ thisOption.label +'"]'); 48309 } 48310 else { 48311 select.append( optGroup ); 48312 } 48313 } 48314 48315 // setup container 48316 if( appendContainer ) { 48317 container.addClass('optgroup'); 48318 container.append('<span class="label">'+ thisOption.label +'</span>'); 48319 container.find('> .label').css({ 48320 clear: 'both' 48321 }); 48322 48323 // add select all link 48324 if( instance.options.selectGroup ) { 48325 container.append('<a href="#" class="ms-selectall">' + instance.options.texts.selectAll + '</a>'); 48326 } 48327 48328 container.append('<ul/>'); 48329 } 48330 48331 for( var gKey in thisOption.options ) { 48332 // Prevent prototype methods injected into options from 48333 // being iterated over. 48334 if( !thisOption.options.hasOwnProperty( gKey ) ) { 48335 continue; 48336 } 48337 48338 var thisGOption = thisOption.options[ gKey ]; 48339 var gContainer = $('<li/>'); 48340 if( instance.options.showCheckbox && instance.options.checkboxAutoFit ) { 48341 gContainer.addClass('ms-reflow'); 48342 } 48343 48344 // no clue what this is we hit (skip) 48345 if( !thisGOption.hasOwnProperty('value') ) { 48346 continue; 48347 } 48348 48349 instance._addOption( gContainer, thisGOption ); 48350 48351 container.find('> ul').append( gContainer ); 48352 48353 // add option to optgroup in select element 48354 if( updateSelect ) { 48355 var selOption = $('<option/>', { 48356 value: thisGOption.value, 48357 text : thisGOption.name 48358 }); 48359 48360 // add custom user attributes 48361 if( thisGOption.hasOwnProperty('attributes') && Object.keys( thisGOption.attributes ).length ) { 48362 selOption.attr( thisGOption.attributes ); 48363 } 48364 48365 // mark option as selected 48366 if( thisGOption.checked ) { 48367 selOption.prop( 'selected', true ); 48368 } 48369 48370 optGroup.append( selOption ); 48371 } 48372 } 48373 } 48374 else { 48375 // no clue what this is we hit (skip) 48376 continue; 48377 } 48378 48379 if( appendContainer ) { 48380 containers.push( container ); 48381 } 48382 } 48383 optionsList.append( containers ); 48384 48385 // pad out label for room for the checkbox 48386 if( instance.options.checkboxAutoFit && instance.options.showCheckbox && !optionsWrap.hasClass('hide-checkbox') ) { 48387 var chkbx = optionsList.find('.ms-reflow:eq(0) input[type="checkbox"]'); 48388 if( chkbx.length ) { 48389 var checkboxWidth = chkbx.outerWidth(); 48390 checkboxWidth = checkboxWidth ? checkboxWidth : 15; 48391 48392 optionsList.find('.ms-reflow label').css( 48393 'padding-left', 48394 (parseInt( chkbx.closest('label').css('padding-left') ) * 2) + checkboxWidth 48395 ); 48396 48397 optionsList.find('.ms-reflow').removeClass('ms-reflow'); 48398 } 48399 } 48400 48401 // update placeholder text 48402 instance._updatePlaceholderText(); 48403 48404 // RESET COLUMN STYLES 48405 optionsWrap.find('ul').css({ 48406 'column-count' : '', 48407 'column-gap' : '', 48408 '-webkit-column-count': '', 48409 '-webkit-column-gap' : '', 48410 '-moz-column-count' : '', 48411 '-moz-column-gap' : '' 48412 }); 48413 48414 // COLUMNIZE 48415 if( select.find('optgroup').length ) { 48416 // float non grouped options 48417 optionsList.find('> li:not(.optgroup)').css({ 48418 'float': 'left', 48419 width: (100 / instance.options.columns) +'%' 48420 }); 48421 48422 // add CSS3 column styles 48423 optionsList.find('li.optgroup').css({ 48424 clear: 'both' 48425 }).find('> ul').css({ 48426 'column-count' : instance.options.columns, 48427 'column-gap' : 0, 48428 '-webkit-column-count': instance.options.columns, 48429 '-webkit-column-gap' : 0, 48430 '-moz-column-count' : instance.options.columns, 48431 '-moz-column-gap' : 0 48432 }); 48433 48434 // for crappy IE versions float grouped options 48435 if( this._ieVersion() && (this._ieVersion() < 10) ) { 48436 optionsList.find('li.optgroup > ul > li').css({ 48437 'float': 'left', 48438 width: (100 / instance.options.columns) +'%' 48439 }); 48440 } 48441 } 48442 else { 48443 // add CSS3 column styles 48444 optionsList.css({ 48445 'column-count' : instance.options.columns, 48446 'column-gap' : 0, 48447 '-webkit-column-count': instance.options.columns, 48448 '-webkit-column-gap' : 0, 48449 '-moz-column-count' : instance.options.columns, 48450 '-moz-column-gap' : 0 48451 }); 48452 48453 // for crappy IE versions float grouped options 48454 if( this._ieVersion() && (this._ieVersion() < 10) ) { 48455 optionsList.find('> li').css({ 48456 'float': 'left', 48457 width: (100 / instance.options.columns) +'%' 48458 }); 48459 } 48460 } 48461 48462 // update un/select all logic 48463 instance._updateSelectAllText(); 48464 }, 48465 48466 /* UPDATE MULTISELECT CONFIG OPTIONS */ 48467 settings: function( options ) { 48468 this.options = $.extend( true, {}, this.options, options ); 48469 this.reload(); 48470 }, 48471 48472 /* RESET THE DOM */ 48473 unload: function() { 48474 $(this.element).siblings('#ms-list-'+ this.listNumber +'.ms-options-wrap').remove(); 48475 $(this.element).show(function(){ 48476 $(this).css('display','').removeClass('jqmsLoaded'); 48477 }); 48478 }, 48479 48480 /* RELOAD JQ MULTISELECT LIST */ 48481 reload: function() { 48482 // remove existing options 48483 $(this.element).siblings('#ms-list-'+ this.listNumber +'.ms-options-wrap').remove(); 48484 $(this.element).removeClass('jqmsLoaded'); 48485 48486 // load element 48487 this.load(); 48488 }, 48489 48490 // RESET BACK TO DEFAULT VALUES & RELOAD 48491 reset: function() { 48492 var defaultVals = []; 48493 $(this.element).find('option').each(function(){ 48494 if( $(this).prop('defaultSelected') ) { 48495 defaultVals.push( $(this).val() ); 48496 } 48497 }); 48498 48499 $(this.element).val( defaultVals ); 48500 48501 this.reload(); 48502 }, 48503 48504 disable: function( status ) { 48505 status = (typeof status === 'boolean') ? status : true; 48506 $(this.element).prop( 'disabled', status ); 48507 $(this.element).siblings('#ms-list-'+ this.listNumber +'.ms-options-wrap').find('button:first-child') 48508 .prop( 'disabled', status ); 48509 }, 48510 48511 /** PRIVATE FUNCTIONS **/ 48512 // update the un/select all texts based on selected options and visibility 48513 _updateSelectAllText: function(){ 48514 if( !this.updateSelectAll ) { 48515 return; 48516 } 48517 48518 var instance = this; 48519 48520 // select all not used at all so just do nothing 48521 if( !instance.options.selectAll && !instance.options.selectGroup ) { 48522 return; 48523 } 48524 48525 var optionsWrap = $(instance.element).siblings('#ms-list-'+ instance.listNumber +'.ms-options-wrap').find('> .ms-options'); 48526 48527 // update un/select all text 48528 optionsWrap.find('.ms-selectall').each(function(){ 48529 var unselected = $(this).parent().find('li:not(.optgroup,.selected,.ms-hidden)'); 48530 48531 $(this).text( 48532 unselected.length ? instance.options.texts.selectAll : instance.options.texts.unselectAll 48533 ); 48534 }); 48535 }, 48536 48537 // update selected placeholder text 48538 _updatePlaceholderText: function(){ 48539 if( !this.updatePlaceholder ) { 48540 return; 48541 } 48542 48543 var instance = this; 48544 var select = $(instance.element); 48545 var selectVals = select.val() ? select.val() : []; 48546 var placeholder = select.siblings('#ms-list-'+ instance.listNumber +'.ms-options-wrap').find('> button:first-child'); 48547 var placeholderTxt = placeholder.find('span'); 48548 var optionsWrap = select.siblings('#ms-list-'+ instance.listNumber +'.ms-options-wrap').find('> .ms-options'); 48549 48550 // if there are disabled options get those values as well 48551 if( select.find('option:selected:disabled').length ) { 48552 selectVals = []; 48553 select.find('option:selected').each(function(){ 48554 selectVals.push( $(this).val() ); 48555 }); 48556 } 48557 48558 // get selected options 48559 var selOpts = []; 48560 for( var key in selectVals ) { 48561 // Prevent prototype methods injected into options from being iterated over. 48562 if( !selectVals.hasOwnProperty( key ) ) { 48563 continue; 48564 } 48565 48566 selOpts.push( 48567 $.trim( select.find('option[value="'+ instance._escapeSelector( selectVals[ key ] ) +'"]').text() ) 48568 ); 48569 48570 if( selOpts.length >= instance.options.maxPlaceholderOpts ) { 48571 break; 48572 } 48573 } 48574 48575 // UPDATE PLACEHOLDER TEXT WITH OPTIONS SELECTED 48576 placeholderTxt.text( selOpts.join( ', ' ) ); 48577 48578 if( selOpts.length ) { 48579 optionsWrap.closest('.ms-options-wrap').addClass('ms-has-selections'); 48580 48581 // USER CALLBACK 48582 if( typeof instance.options.onPlaceholder == 'function' ) { 48583 instance.options.onPlaceholder( instance.element, placeholderTxt, selOpts ); 48584 } 48585 } 48586 else { 48587 optionsWrap.closest('.ms-options-wrap').removeClass('ms-has-selections'); 48588 } 48589 48590 // replace placeholder text 48591 if( !selOpts.length ) { 48592 placeholderTxt.text( instance.options.texts.placeholder ); 48593 } 48594 // if copy is larger than button width use "# selected" 48595 else if( (placeholderTxt.width() > placeholder.width()) || (selOpts.length != selectVals.length) ) { 48596 placeholderTxt.text( selectVals.length + instance.options.texts.selectedOptions ); 48597 } 48598 }, 48599 48600 // Add option to the custom dom list 48601 _addOption: function( container, option ) { 48602 var instance = this; 48603 var optionNameText = $('<div/>').html( option.name ).text(); 48604 48605 var thisOption = $('<label/>', { 48606 for : 'ms-opt-'+ msOptCounter 48607 }).html( option.name ); 48608 48609 var thisCheckbox = $('<input>', { 48610 type : 'checkbox', 48611 title: optionNameText, 48612 id : 'ms-opt-'+ msOptCounter, 48613 value: option.value 48614 }); 48615 48616 // add user defined attributes 48617 if( option.hasOwnProperty('attributes') && Object.keys( option.attributes ).length ) { 48618 thisCheckbox.attr( option.attributes ); 48619 } 48620 48621 if( option.checked ) { 48622 container.addClass('default selected'); 48623 thisCheckbox.prop( 'checked', true ); 48624 } 48625 48626 thisOption.prepend( thisCheckbox ); 48627 48628 var searchTerm = ''; 48629 if( instance.options.searchOptions.searchText ) { 48630 searchTerm += ' ' + optionNameText.toLowerCase(); 48631 } 48632 if( instance.options.searchOptions.searchValue ) { 48633 searchTerm += ' ' + option.value.toLowerCase(); 48634 } 48635 48636 container.attr( 'data-search-term', $.trim( searchTerm ) ).prepend( thisOption ); 48637 48638 msOptCounter = msOptCounter + 1; 48639 }, 48640 48641 // check ie version 48642 _ieVersion: function() { 48643 var myNav = navigator.userAgent.toLowerCase(); 48644 return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false; 48645 }, 48646 48647 // escape selector 48648 _escapeSelector: function( string ) { 48649 if( typeof $.escapeSelector == 'function' ) { 48650 return $.escapeSelector( string ); 48651 } 48652 else { 48653 return string.replace(/[!"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~]/g, "\\$&"); 48654 } 48655 } 48656 }; 48657 48658 // ENABLE JQUERY PLUGIN FUNCTION 48659 $.fn.multiselect = function( options ){ 48660 if( !this.length ) { 48661 return; 48662 } 48663 48664 var args = arguments; 48665 var ret; 48666 48667 // menuize each list 48668 if( (options === undefined) || (typeof options === 'object') ) { 48669 return this.each(function(){ 48670 if( !$.data( this, 'plugin_multiselect' ) ) { 48671 $.data( this, 'plugin_multiselect', new MultiSelect( this, options ) ); 48672 } 48673 }); 48674 } else if( (typeof options === 'string') && (options[0] !== '_') && (options !== 'init') ) { 48675 this.each(function(){ 48676 var instance = $.data( this, 'plugin_multiselect' ); 48677 48678 if( instance instanceof MultiSelect && typeof instance[ options ] === 'function' ) { 48679 ret = instance[ options ].apply( instance, Array.prototype.slice.call( args, 1 ) ); 48680 } 48681 48682 // special destruct handler 48683 if( options === 'unload' ) { 48684 $.data( this, 'plugin_multiselect', null ); 48685 } 48686 }); 48687 48688 return ret; 48689 } 48690 }; 48691}(jQuery)); 48692
vendor: 24,103 bytes, lines 48693-48701
48693/*! 48694 * Masonry PACKAGED v4.2.2 48695 * Cascading grid layout library 48696 * https://masonry.desandro.com 48697 * MIT License 48698 * by David DeSandro 48699 */ 48700 48701!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,n,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),o&&!this.isTransitioning)return void this.layoutPosition();var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
48701 48702const ICON_PATH = "/content/dam/dupont/global/icons/social-media-share/"; 48703 48704/*Icon paths*/ 48705const CONSTANTS = { 48706 ICONS: { 48707 VERIFIED: ICON_PATH + "verified.png", 48708 LIKES_ICON: ICON_PATH + "likes.png", 48709 COMMENTS_ICON: ICON_PATH + "comments.png", 48710 SHARES_ICON: ICON_PATH + "shares.png", 48711 LINK_ICON: ICON_PATH + "link.png", 48712 PLAY_ICON: ICON_PATH + "play.svg", 48713 INSTA_ICON: ICON_PATH + "Instagram_icon.png", 48714 YOUTUBE_ICON: ICON_PATH + "YouTube-Icon.png", 48715 VIDEO_ICON: ICON_PATH + "video-icon.png", 48716 PLAYLIST_ICON: ICON_PATH + "playlist-icon.png", 48717 LIKES_ICON_WHITE:ICON_PATH + "likes_white.svg", 48718 LINK_ICON_YELLOW: ICON_PATH + "link_yellow.svg", 48719 PLAY_ICON_BLACK: ICON_PATH + "play-yellow-black.svg", 48720 }, 48721}; 48722let socialFeedDataObj = {}; 48723var gdpr_prefs=false; 48724var trustarc1=!document.cookie.match(/\bnotice_gdpr_prefs=/); 48725var trustarc2=!document.cookie.match(/\bnotice_behavior=\expressed\b/); 48726 48727 48728 48729var re = new RegExp("notice_gdpr_prefs" + "=([^;]+)"); 48730var value = re.exec(document.cookie); 48731if(value && value[0]){ 48732 console.log(value[0].split('=')[1]); 48733 if(value[0].split('=')[1] == '0,1:' ||value[0].split('=')[1] == '0,1,2:' ){ 48734 gdpr_prefs=true; 48735 } 48736 48737} 48738 48739 48740 48741/* Applies Slick Carousel to feed cards*/ 48742const applySlick = (container) => { 48743 let slidesNo = 5; 48744 let centerDisplayMode = true; 48745 48746 if (container.children().length == 5) { 48747 slidesNo = 4; 48748 centerDisplayMode = false; 48749 } 48750 48751 48752 container.on("beforeChange init", function(e, slick) { 48753 48754 setTimeout(() => { 48755 $($(container).find(".slick-scale")).removeClass("slick-scale"); 48756 48757 $(slick.$list[0].getElementsByClassName("slick-center")) 48758 .prev() 48759 .addClass("slick-scale"); 48760 $(slick.$list[0].getElementsByClassName("slick-center")) 48761 .next() 48762 .addClass("slick-scale"); 48763 48764 hideSeeMore(this); 48765 48766 }, 100); 48767 48768 }); 48769 48770 48771 container.slick({ 48772 centerMode: centerDisplayMode, 48773 centerPadding: "0", 48774 slidesToShow: slidesNo, 48775 arrows: true, 48776 adaptiveHeight: true, 48777 48778 //speed: 200, 48779 responsive: [{ 48780 breakpoint: 768, 48781 settings: { 48782 arrows: false, 48783 centerMode: true, 48784 centerPadding: "0px", 48785 slidesToShow: 3, 48786 }, 48787 }, 48788 { 48789 breakpoint: 480, 48790 settings: { 48791 arrows: false, 48792 centerMode: true, 48793 centerPadding: "0px", 48794 slidesToShow: 1, 48795 slidesToScroll: 1 48796 48797 }, 48798 }, 48799 ], 48800 }); 48801 $(container).find('.slick-prev').attr('data-analytics','cta_track').html('View Left'); 48802 $(container).find('.slick-next').attr('data-analytics','cta_track').html('View Right'); 48803}; 48804 48805/*Create HTML structure for cards*/ 48806const createNodes = (data, el) => { 48807 48808let view = el ? el.dataset.viewType : ''; 48809 const node = `${data.posts 48810 .map( 48811 (post) => 48812 `<div class="social-share-card" data-post-platform="${data.platform}"> 48813 <div class="content"> 48814 <div class="profile"> 48815 <div class="photo"> 48816 ${ 48817 (trustarc1 && trustarc2 || gdpr_prefs) 48818 ? `<img src="${post.profilePhoto || data.profile.profilePhoto}" />` 48819 : `` 48820 } 48821 </div> 48822 <div class="text"> 48823 <div class="name" title="${post.name || data.profile.name || ''}"><h6><a target="_blank" style="${(post.profileUrl ||data.profile.profileUrl) ? '':'pointer-events:none'}" href="${ 48824 post.profileUrl || data.profile.profileUrl 48825 }">${post.name || data.profile.name || ''}</a> 48826 48827 48828 ${ 48829 post.verified || data.profile.verified 48830 ? `<span class="verified"><img src="${CONSTANTS.ICONS.VERIFIED}"></span>` 48831 : `` 48832 }</h6> 48833 </div> 48834 <div class="story credits">${post.story}</span> 48835 </div> 48836 <div class="date credits">${post.postDate}</div> 48837 </div> 48838 </div> 48839 <div class="body"> 48840 <div class="text ${post.message ? '': 'p-0'}"><p class="${!(post.media.thumbnail || post.media.url) ? 'body3 full-height':'body3'}"><span class="post-desc">${post.message}</span></p><a class="see-more" href="${post.link}" target="_blank">${view == "fix-grid" ? Granite.I18n.get('See More') : Granite.I18n.get('...See More')}</a></div> 48841 ${!(post.media.thumbnail || post.media.url) ? '':` 48842 <div class="media"> 48843 ${ 48844 (post.media.type == "image" && (trustarc1 && trustarc2 || gdpr_prefs)) 48845 ? ` 48846 <img src="${post.media.thumbnail}"></img> 48847 ${ data.postType == "multipleplaylists" ? `<a href="${post.link}" target="_blank" data-title="View Playlist" class="playlist-icon"><img src="${CONSTANTS.ICONS.PLAYLIST_ICON}"></img></a>` : ``} 48848 ` 48849 48850 : (post.media.type == "video" && (trustarc1 && trustarc2 || gdpr_prefs)) 48851 ? ` 48852 <div class="vid-thumb-wrap"> 48853 <img src="${post.media.thumbnail}"></img> 48854 <img src="${view =="fix-grid" ? CONSTANTS.ICONS.PLAY_ICON_BLACK : CONSTANTS.ICONS.PLAY_ICON}" class="smf-play-icon" data-href="${post.media.url}"></img> 48855 </div> 48856 ` 48857 : (post.media.type == "slideshow" && (trustarc1 && trustarc2 || gdpr_prefs)) 48858 ? ` 48859 <div class="vid-thumb-wrap"> 48860 <iframe src="${post.media.url}" height="auto" width="100%" frameborder="0" title="Embedded post"></iframe> 48861 </div> 48862 ` 48863 : `
48864 ` 48865 } 48866 48867 </div> 48868 `} 48869 </div> 48870 <div class="actions"> 48871 <ul> 48872 ${ 48873 Number(post.likesCount) > 0 48874 ? `<li><img src="${view =="fix-grid" ? CONSTANTS.ICONS.LIKES_ICON_WHITE : CONSTANTS.ICONS.LIKES_ICON }"/><span> ${post.likesCount}</span></li>` 48875 : `` 48876 } 48877 ${ 48878 Number(post.commentsCount) > 0 48879 ? `<li data-ic-type="comments"><img src="${CONSTANTS.ICONS.COMMENTS_ICON}"/><span> ${post.commentsCount}</span></li>` 48880 : `` 48881 } 48882 ${ 48883 Number(post.sharedCount) > 0 48884 ? `<li><img src="${CONSTANTS.ICONS.SHARES_ICON}"/><span> ${post.sharedCount}</span></li>` 48885 : `` 48886 } 48887 ${ 48888 Number(post.videoCount) > 0 48889 ? `<li><img src="${CONSTANTS.ICONS.VIDEO_ICON}"/><span> ${post.videoCount}</span></li>` 48890 : `` 48891 } 48892 ${ 48893 post.link 48894 ? `<li><a target="_blank" title="View post" data-title="View Post" href="${post.link}"><img src="${view =="fix-grid" ? CONSTANTS.ICONS.LINK_ICON_YELLOW : CONSTANTS.ICONS.LINK_ICON}"/></a></li>` 48895 : `` 48896 } 48897 </ul> 48898 </div> 48899 </div> 48900 </div>` 48901 ) 48902 .join("")}`; 48903 return node; 48904}; 48905 48906/* Render feeds in social feed component*/ 48907const render = (container, data, curatedList, shouldAppend) => { 48908 let dynamicNodes = ''; 48909 data.forEach((obj) => { 48910 dynamicNodes += createNodes(obj, container); 48911 }); 48912 const curatedNodes = createNodes(curatedList, container); 48913 const node = shouldAppend == "true" ? facon`${dynamicNodes}${curatedNodes}` : facon`${curatedNodes}${dynamicNodes}`; 48914 const masonryGrid = $(container).find('.masonry-grid'); 48915 container.querySelector(".dupont-social-share-content").replaceChildren(node); 48916 48917 if (masonryGrid) { 48918 if (masonryGrid.attr('style')) { 48919 masonryGrid.masonry('destroy'); 48920 } 48921 masonryGrid.masonry({ 48922 itemSelector: '.social-share-card', 48923 columnWidth: '.social-share-card', 48924 percentPosition: true, 48925 gutter: 10 48926 }); 48927 48928 masonryGrid.imagesLoaded().progress(function() { 48929 masonryGrid.masonry('layout'); 48930 }); 48931 48932 } 48933 hideSeeMore(container); 48934 setLinksTarget(container); 48935 setAnalyticsAttributes(container); 48936 setCardContainerHeight(container); 48937 48938}; 48939 48940/*Set the heoght of card containers*/ 48941const setCardContainerHeight = (container) => { 48942 if(container.dataset.viewType == "fix-grid"){ 48943 $($(container).find('.body3')).each(function(i,val){ 48944 let lineHeight = window.innerWidth > 768 ? 30 : 26; 48945 let textContainerHeight = (Math.floor($(val).height() / lineHeight))*lineHeight; 48946 if(textContainerHeight){ 48947 if(window.innerWidth > 768 ){ 48948 $(val).css({'height':textContainerHeight}); 48949 }else{ 48950 $(val).css({'overflow-x':'visible'}); 48951 setTimeout(function(){ 48952 $(val).css({'overflow-x':'hidden'}); 48953 },100) 48954 } 48955 48956 } 48957 48958 }) 48959 } 48960} 48961 48962 48963/*Set all links target to blank*/ 48964const setLinksTarget = (container) => { 48965 ([...container.querySelectorAll(".post-desc")]).forEach((item) => { 48966 item.querySelectorAll("a").forEach((links) => { 48967 links.setAttribute("target", "_blank"); 48968 }); 48969 }) 48970 48971 48972}; 48973 48974/*Set analytics attribute on anchor links to trigger custom link click event*/ 48975const setAnalyticsAttributes = (container) => { 48976 48977 ([...container.querySelectorAll(".see-more, .actions a, .name a, .playlist-icon")]).forEach((linkEl) => { 48978 const href = linkEl.getAttribute("href"); 48979 if (href && (href != "#")) { 48980 //linkEl.setAttribute("data-analytics", "link_track"); 48981 } 48982 48983 }) 48984 48985}; 48986 48987 48988/*To hide see more link from cards*/ 48989const hideSeeMore = (container) => { 48990
48991 ([...container.querySelectorAll(".post-desc")]).forEach((item) => { 48992 const seeMoreEl = item.parentElement.parentElement.querySelector('.see-more'); 48993 if (item.offsetHeight < 50 || seeMoreEl.getAttribute("href") == "undefined") { 48994 seeMoreEl.style.display = "none"; 48995 } else { 48996 seeMoreEl.style.display = "block"; 48997 } 48998 }) 48999 49000}; 49001 49002/* To fecth feeds JSONs from SociableKit for all configured feed types*/ 49003function fetchPostsFromApi(mfList, el) { 49004 49005 try { 49006 let promise = Promise.resolve(); 49007 promise = Promise.all( 49008 mfList.map( 49009 obj => { 49010 const endpoint = obj.endpoint ? ((obj.endpoint.toLowerCase()).indexOf('.json') > -1 ? obj.endpoint : "https://data.accentapi.com/feed/" + obj.endpoint + ".json") : ""; 49011 49012 return fetch(endpoint).then( 49013 (response) => response.json() 49014 ).then((feeds) => { 49015 if (obj.platform == "pinterest") { 49016 feeds.posts = feeds.pins; 49017 49018 } 49019 if (obj.platform == "youtube" && obj.postType == "multipleplaylists") { 49020 feeds.posts = feeds.playlists; 49021 49022 } 49023 obj.feeds = feeds; 49024 49025 }).catch(error => { 49026 console.error('Unable to get items.', error); 49027 49028 }); 49029 49030 } 49031 49032 )); 49033 49034 socialFeedDataObj[el.getAttribute('data-sfcomp-id')]['mfList'] = mfList; 49035 49036 return promise 49037 49038 } catch (error) { 49039 console.log(error) 49040 throw (error) 49041 } 49042} 49043 49044/*To apply Sociable Kit moderation for filtering the feeds*/ 49045const applySociableKitModeration = (obj) => { 49046 try{ 49047 let filteredPosts = obj.posts; 49048 if (obj.settings.turnon_preapproval_posts == "1") { 49049 if (obj.settings.preapproved_posts) { 49050 const approvedPostId = obj.settings.preapproved_posts; 49051 const approvedPostsId = (approvedPostId.indexOf(",") > -1) ? approvedPostId.split(",") : [approvedPostId]; 49052 filteredPosts = obj.posts.filter((item) => { 49053 return (approvedPostsId.includes(item.id) || approvedPostsId.includes(item.post_id)) 49054 }) 49055 } 49056 } else if (obj.settings.excluded_posts) { 49057 const excludedPostId = obj.settings.excluded_posts; 49058 const excludedPostsId = (excludedPostId.indexOf(",") > -1) ? excludedPostId.split(",") : [excludedPostId]; 49059 filteredPosts = obj.posts.filter((item) => { 49060 return !(excludedPostsId.includes(item.id) || excludedPostsId.includes(item.post_id)) 49061 }) 49062 } 49063 49064 if (obj.settings.predefined_search_keyword) { 49065 const searchWord = obj.settings.predefined_search_keyword; 49066 const searchWords = (searchWord.indexOf(",") > -1) ? searchWord.split(",") : [searchWord]; 49067 obj['sociableKitTextFilters'] = searchWords; 49068 } 49069 49070 obj.posts = filteredPosts; 49071 49072 return obj; 49073}catch(e){ 49074 console.log("Error in Social Media Feed::",e) 49075} 49076 49077} 49078/*To add all the feeds data in one array*/ 49079const mergeFeedsData = (data, el) => { 49080 let mergedData = []; 49081 let FeedsData = socialFeedDataObj[el.getAttribute('data-sfcomp-id')]['mfList']; 49082 49083 FeedsData.forEach((obj) => { 49084 if (!obj.feeds) { 49085 obj.feeds = { 49086 bio: {}, 49087 posts: [] 49088 } 49089 } else { 49090 if (!obj.feeds.bio) { 49091 obj.feeds.bio = {}; 49092 } 49093 if (!obj.feeds.posts) { 49094 obj.feeds.posts = []; 49095 } 49096 49097 } 49098 obj.feeds = applySociableKitModeration(obj.feeds, el); 49099 mergedData.push(reformatData(obj,el)); 49100 49101 }) 49102 socialFeedDataObj[el.getAttribute('data-sfcomp-id')]['mergedObj'] = mergedData; 49103 return mergedData 49104} 49105 49106/*To refromat feeds data as per social feed component requirements*/ 49107const reformatData = (feedsDataObj,el) => { 49108 const data = feedsDataObj.feeds; 49109 const params = { 49110 filterText: feedsDataObj.filterText, 49111 filterType: feedsDataObj.filterType, 49112 maxPostCount: feedsDataObj.maxPostCount, 49113 platform: feedsDataObj.platform, 49114 postType: feedsDataObj.postType 49115 } 49116 49117 let formattedData = { 49118 posts: [], 49119 platform: params.platform, 49120 postType: params.postType, 49121 profile:{} 49122 }; 49123 49124 switch (
49125 params.platform + 49126 "/" + 49127 params.postType 49128 ) { 49129 case "twitter/hashtag": 49130 case "twitter/profile": 49131 try{ 49132 formattedData.profile = data.bio ? { 49133 profilePhoto: data.bio.profile_photo, 49134 profileUrl: "https://twitter.com/" + data.bio.screen_name, 49135 name: data.bio.name, 49136 screenName: data.bio.screen_name, 49137 verified: data.bio.verified, 49138 } : {}; 49139 data.posts.forEach((post) => { 49140 49141 formattedData.posts.push({ 49142 profilePhoto: post.profile_image_url_https, 49143 profileUrl: "https://twitter.com/" + post.screen_name, 49144 name: post.name, 49145 screenName: post.screen_name, 49146 verified: "", 49147 id: post.id, 49148 link: "https://twitter.com/i/status/" + post.id, 49149 story: "", 49150 message: post.tweet_text ? post.tweet_text 49151 .replace( 49152 /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi, 49153 "<a href='$1' target='_blank'>$1</a>" 49154 ) 49155 .replace( 49156 /#(\w*[a-zA-Z_??????]+\w*)/gi, 49157 '<a href="https://twitter.com/hashtag/$1" target="_blank">#$1</a>' 49158 ) 49159 .replace( 49160 /@(\w*[a-zA-Z_??????]+\w*)/gi, 49161 '<a href="https://twitter.com/$1" target="_blank">@$1</a>' 49162 ) : "", 49163 postDate: post.created_date_time, 49164 likesCount: post.favorite_count, 49165 commentsCount: "0", 49166 sharedCount: post.retweet_count, 49167 media: { 49168 url: post.video_url || "", 49169 title: "", 49170 description: "", 49171 thumbnail: (Array.isArray(post.media_url_https)) ? post.media_url_https[0]: (post.media_url_https.length ? 49172 post.media_url_https : ""), 49173 type: post.video_url ? 49174 "video" : post.media_url_https.length ? 49175 "image" : "message", 49176 }, 49177 }); 49178 }); 49179 }catch(err){ 49180 console.log("Error in getting Twitter Hashtag or Profile feed: ",err) 49181 } 49182 break; 49183 49184 case "facebook/page": 49185 try{ 49186 formattedData.profile = { 49187 profilePhoto: `https://graph.facebook.com/${data.bio.id}/picture`, 49188 profileUrl: "https://fb.com/" + data.bio.id, 49189 name: data.bio.name, 49190 screenName: data.bio.name, 49191 verified: "", 49192 }; 49193 data.posts.forEach((post) => { 49194 formattedData.posts.push({ 49195 id: post.id, 49196 link: "https://fb.com/" + post.id, 49197 story: post.story, 49198 message: post.message ? post.message 49199 .replace( 49200 /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi, 49201 "<a href='$1' target='_blank'>$1</a>" 49202 ) 49203 .replace( 49204 /#(\w*[a-zA-Z_??????]+\w*)/gi, 49205 '<a href="https://fb.com/hashtag/$1" target="_blank">#$1</a>' 49206 ) 49207 .replace( 49208 /@(\w*[a-zA-Z_??????]+\w*)/gi, 49209 '<a href="https://fb.com/$1" target="_blank">@$1</a>' 49210 ) : "", 49211 postDate: post.post_date,
49212 likesCount: post.likes_count, 49213 commentsCount: post.comments_count, 49214 sharedCount: "", 49215 media: { 49216 url: post.media_attachments[0].type == "video_inline" ? 49217 post.media_attachments[0].source : "", 49218 title: "", 49219 description: "", 49220 thumbnail: post.media_attachments[0].thumbnail, 49221 type: post.media_attachments[0].type == "video_inline" ? 49222 "video" : post.media_attachments[0].thumbnail ? 49223 "image" : "message", 49224 }, 49225 }); 49226 }); 49227 }catch(err){ 49228 console.log("Error in getting Facebook page feed: ",err) 49229 } 49230 49231 break; 49232 case "facebook/hashtag": 49233 try{ 49234 formattedData.profile = { 49235 //screenName: data.bio.name, 49236 //verified: "", 49237 }; 49238 data.posts.forEach((post) => { 49239 formattedData.posts.push({ 49240 profilePhoto: post.posted_by_image, 49241 name: post.posted_by_name, 49242 profileUrl: "", 49243 id: post.post_id, 49244 link: post.post_link, 49245 story: "", 49246 message: post.description ? post.description.replace( 49247 /(<\/?(?:a)[^>]*>)|<[^>]+>/gi, 49248 "$1") : "", 49249 postDate: post.post_date.split("at")[0], 49250 likesCount: post.likes, 49251 commentsCount: post.comments, 49252 sharedCount: post.share_count, 49253 media: { 49254 url: post.video_url, 49255 title: "", 49256 description: "", 49257 thumbnail: post.image_urls[0], 49258 type: post.video_url ? 49259 "video" : post.image_urls.length ? 49260 "image" : "message", 49261 }, 49262 }); 49263 }); 49264 }catch(err){ 49265 console.log("Error in getting Facebook hashtag feed: ",err) 49266 } 49267 49268 break; 49269 case "facebook/group": 49270 try{ 49271 formattedData.profile = { 49272 screenName: data.bio.name, 49273 verified: "", 49274 }; 49275 data.posts.forEach((post) => { 49276 formattedData.posts.push({ 49277 profilePhoto: post.profile_picture, 49278 name: post.profile_name, 49279 profileUrl: post.profile_link, 49280 id: post.id, 49281 link: post.post_link, 49282 story: post.story.replace(post.profile_name, ""), 49283 message: post.description ? post.description.replace( 49284 /(<\/?(?:a)[^>]*>)|<[^>]+>/gi, 49285 "$1" 49286 ) : "", 49287 postDate: post.publish_date.split(" ")[0], 49288 likesCount: post.likes_count, 49289 commentsCount: post.comment_count, 49290 sharedCount: post.share_count, 49291 media: { 49292 url: post.video_url, 49293 title: "", 49294 description: "", 49295 thumbnail: post.image_urls[0], 49296 type: post.video_url ? 49297 "video" : post.image_urls.length ? 49298 "image" : "message", 49299 }, 49300 }); 49301 }); 49302 }catch(err){ 49303 console.log("Error in getting Facebook Group feed : ",err) 49304 } 49305 49306 break; 49307 case "linkedin/profile": 49308 case "linkedin/page": 49309 try{ 49310 formattedData.profile = { 49311 profilePhoto: data.bio.user_profile, 49312 profileUrl: (params.postType == "page") ? "https://linkedin.com/company/" + data.bio.username : "https://linkedin.com/in/" + data.bio.username, 49313 name: data.bio.full_name, 49314 screenName: data.bio.name, 49315 verified: "", 49316 };
49317 data.posts.forEach((post) => { 49318 formattedData.posts.push({ 49319 id: post.id, 49320 link: "https://www.linkedin.com/feed/update/urn:li:activity:" + post.id, 49321 story: "", 49322 message: post.description ? post.description 49323 .replace( 49324 /(<\/?(?:a)[^>]*>)|<[^>]+>/gi, "$1") 49325 .replace("%27", "'") : ( (post.shared_post_owner_name ? (post.shared_post_owner_link ? "<a href='"+post.shared_post_owner_link+"'>" : "")+"<u>"+post.shared_post_owner_name+"</u>"+ (post.shared_post_owner_link ? "</a>" : "") +"<br>" :"")+(post.shared_post_description ? post.shared_post_description.replace( 49326 /(<\/?(?:a)[^>]*>)|<[^>]+>/gi, 49327 "$1") : "" )), 49328 postDate: post.post_date_time ? getFormattedDate(post.post_date_time) : "", 49329 likesCount: post.likes_count, 49330 commentsCount: post.comments_count, 49331 sharedCount: "", 49332 media: { 49333 url: post.video_url || post.embed_source+"?compact=1", 49334 title: "", 49335 description: "", 49336 //thumbnail: post.thumbnail || post.images[0], 49337 //thumbnail: post.images_sk_img && post.images_sk_img.length ? post.images_sk_img[0] : post.thumbnail_sk_img ? post.thumbnail_sk_img : (post.thumbnail || post.thumbnail_url), 49338 thumbnail: post.image_urls?.length ? post.image_urls[0] : post.thumbnail_url, 49339 type: post.video_url ? 49340 "video" : ((post.image_urls ? post.image_urls.length : 0) || post.thumbnail_url) ? 49341 "image" : post.embed_source ? 49342 "slideshow" : "message", 49343 }, 49344 }); 49345 }); 49346 }catch(err){ 49347 console.log("Error in getting Linkedin Page or Profile feed : ",err) 49348 } 49349 49350 break; 49351 case "instagram/profile": 49352 try{ 49353 formattedData.profile = { 49354 profileUrl: data.bio.link, 49355 profilePhoto: data.bio.user_profile, 49356 name: data.bio.full_name || data.bio.username, 49357 screenName: data.bio.username, 49358 verified: data.bio.is_verified, 49359 }; 49360 data.posts.forEach((post) => { 49361 formattedData.posts.push({ 49362 id: post.id, 49363 /*profilePhoto: `https://data.accentapi.com/images/${ 49364 post.owner_username 49365 }.jpg?nocache=${new Date().getTime()}`,*/ 49366 /*profilePhoto: post.owner_profile_sk_img,*/ 49367 link: post.link, 49368 story: "", 49369 message: post.pic_text || "", 49370 postDate: post.date_time_posted.split("T")[0], 49371 likesCount: post.pic_like_count_formatted, 49372 commentsCount: post.pic_comment_count_formatted, 49373 sharedCount: "", 49374 media: { 49375 url: post.video_url, 49376 title: "", 49377 description: "", 49378 //thumbnail: post.pic_src, 49379 thumbnail: post.thumbnail_sk_img || post.image_url || post.pic_src, 49380 type: post.video_url.includes("//video") ? "video" : "image", 49381 }, 49382 }); 49383 }); 49384 }catch(err){ 49385 console.log("Error in getting Instagram Profile feed : ",err) 49386 } 49387 49388 break; 49389 49390 case "instagram/hashtag": 49391 try{ 49392 formattedData.profile = {}; 49393 data.posts.forEach((post) => { 49394 formattedData.posts.push({ 49395 id: post.id, 49396 profilePhoto: CONSTANTS.ICONS.INSTA_ICON, 49397 link: post.view_on_ig_link, 49398 story: "", 49399 message: post.caption || post.caption_linked || "", 49400 postDate: post.taken_at_timestamp ? new Date(post.taken_at_timestamp).toDateString() : "",
49401 likesCount: post.likes_count, 49402 commentsCount: post.comments_count, 49403 sharedCount: "", 49404 media: { 49405 url: post.video_url, 49406 title: "", 49407 description: "", 49408 thumbnail: post.display_src, 49409 type: post.video_url ? "video" : "image", 49410 }, 49411 }); 49412 }); 49413 }catch(err){ 49414 console.log("Error in getting Instagram Hashtag feed : ",err) 49415 } 49416 49417 break; 49418 49419 49420 case "pinterest/pinterestboard": 49421 try{ 49422 formattedData.profile = { 49423 profileUrl: data.bio.profile_url, 49424 name: data.bio.full_name || '', 49425 //screenName: data.bio.username, 49426 //verified: data.bio.is_verified, 49427 }; 49428 data.posts.forEach((post) => { 49429 formattedData.posts.push({ 49430 id: post.id, 49431 profilePhoto: post.pinner.image_small_url, 49432 link: post.link, 49433 story: "", 49434 message: (post.description ? post.description.trim() : "") || "", 49435 postDate: "", 49436 likesCount: "", 49437 commentsCount: "", 49438 sharedCount: "", 49439 media: { 49440 url: post.video_url, 49441 title: "", 49442 description: "", 49443 thumbnail: post.images ? (Array.isArray(post.images) ? post.images[0] : post.images) : "", 49444 type: post.video_url ? "video" : "image", 49445 }, 49446 }); 49447 }); 49448 }catch(err){ 49449 console.log("Error in getting Pinterest Board feed : ",err) 49450 } 49451 49452 break; 49453 49454 case "youtube/channel": 49455 try{ 49456 formattedData.profile = { 49457 profileUrl: data.bio.channel_id ? "https://www.youtube.com/channel/" + data.bio.channel_id : "", 49458 name: data.bio.title || '', 49459 //screenName: data.bio.username, 49460 //verified: data.bio.is_verified, 49461 }; 49462 data.posts.forEach((post) => { 49463 formattedData.posts.push({ 49464 id: post.id, 49465 profilePhoto: data.bio.thumbnail ? data.bio.thumbnail : "", 49466 link: post.id ? "https://www.youtube.com/watch?v=" + post.id : "", 49467 story: post.title ? post.title : "", 49468 message: (post.description ? post.description.trim() : "") || "", 49469 postDate: post.published_at ? getFormattedDate(post.published_at) : "", 49470 likesCount: "", 49471 commentsCount: "", 49472 sharedCount: "", 49473 media: { 49474 url: "https://www.youtube.com/embed/" + post.id + "?autoplay=1", 49475 title: "", 49476 description: "", 49477 thumbnail: post.thumbnail.medium, 49478 type: ("https://www.youtube.com/embed/" + post.id) ? "video" : "image", 49479 }, 49480 }); 49481 }); 49482 }catch(err){ 49483 console.log("Error in getting YouTube Channel feed : ",err) 49484 } 49485 49486 break; 49487 49488 case "youtube/playlist": 49489 try{ 49490 formattedData.profile = { 49491 profileUrl: data.bio.playlist_id ? "https://www.youtube.com/playlist?list=" + data.bio.playlist_id : "", 49492 name: data.bio.title || '', 49493 }; 49494 data.posts.forEach((post) => { 49495 formattedData.posts.push({ 49496 id: post.id, 49497 profilePhoto: CONSTANTS.ICONS.YOUTUBE_ICON, 49498 link: post.id ? "https://www.youtube.com/watch?v=" + post.id : "", 49499 story: post.title ? post.title : "", 49500 message: (post.description ? post.description.trim() : "") || "", 49501 postDate: post.published_at ? getFormattedDate(post.published_at) : "",
49502 likesCount: "", 49503 commentsCount: "", 49504 sharedCount: "", 49505 media: { 49506 url: "https://www.youtube.com/embed/" + post.id + "?autoplay=1", 49507 title: "", 49508 description: "", 49509 thumbnail: post.thumbnail, 49510 type: ("https://www.youtube.com/embed/" + post.id) ? "video" : "image", 49511 }, 49512 }); 49513 }); 49514 }catch(err){ 49515 console.log("Error in getting YouTube Single Playlist feed : ",err) 49516 } 49517 49518 break; 49519 49520 case "youtube/multipleplaylists": 49521 try{ 49522 formattedData.profile = { 49523 profileUrl: data.bio.channel_id ? "https://www.youtube.com/channel/" + data.bio.channel_id : "", 49524 name: data.bio.title || '', 49525 }; 49526 data.posts.forEach((post) => { 49527 formattedData.posts.push({ 49528 id: post.id, 49529 profilePhoto: data.bio.thumbnail ? data.bio.thumbnail : "", 49530 link: post.playlist_link ? post.playlist_link : "", 49531 story: post.title ? post.title : "", 49532 message: (post.description ? post.description.trim() : "") || "", 49533 postDate: "", 49534 likesCount: "", 49535 commentsCount: "", 49536 sharedCount: "", 49537 videoCount: post.videos_count, 49538 media: { 49539 url: "", 49540 title: "", 49541 description: "", 49542 thumbnail: post.thumbnail, 49543 type: "image", 49544 }, 49545 }); 49546 }); 49547 }catch(err){ 49548 console.log("Error in getting YouTube Single Playlist feed : ",err) 49549 } 49550 49551 break; 49552 } 49553 /*To filter feeds based on sociable kit filter text moderation*/ 49554 if (data.sociableKitTextFilters) { 49555 formattedData.posts = formattedData.posts.filter((post) => { 49556 let isExist = false; 49557 data.sociableKitTextFilters.forEach((searchWord) => { 49558 if ((post.message + post.story).toUpperCase().includes(searchWord.trim().toUpperCase())) { 49559 isExist = true; 49560 return false 49561 } 49562 }) 49563 return isExist 49564 }); 49565 } 49566 49567 /*Not to show blank feeds (without descripton and thumbnial or video)*/ 49568 if (params.platform) { 49569 formattedData.posts = formattedData.posts.filter((post) => (post.message || post.media.url || post.media.thumbnail)); 49570 } 49571 49572 if (params.filterText) { 49573 const filterTexts = (params.filterText.indexOf(",") > -1) ? params.filterText.split(",") : [params.filterText] ; 49574 if (params.filterType == "contains") { 49575 formattedData.posts = formattedData.posts.filter((post) =>{ 49576 let isExist = false;
49577 filterTexts.forEach((searchWord) => { 49578 if ((post.message + post.story).toUpperCase().includes(searchWord.trim().toUpperCase())) { 49579 isExist = true; 49580 return false 49581 } 49582 }) 49583 return isExist 49584 }); 49585 }else{ 49586 formattedData.posts = formattedData.posts.filter((post) =>{ 49587 let isExist = false; 49588 filterTexts.forEach((searchWord) => { 49589 if ((post.message + post.story).toUpperCase().includes(searchWord.trim().toUpperCase())) { 49590 isExist = true; 49591 return false 49592 } 49593 }) 49594 return !isExist 49595 }); 49596 49597 } 49598 } 49599 49600 if(el.dataset.viewType == "fix-grid"){ 49601 params.maxPostCount = params.maxPostCount > 3 ? 3 : params.maxPostCount; 49602 49603 } 49604 49605 49606 if (params.maxPostCount && Number(params.maxPostCount) > 0) 49607 formattedData.posts = formattedData.posts.slice( 49608 0, 49609 Number(params.maxPostCount) 49610 ); 49611 49612 return formattedData; 49613}; 49614 49615/*Return formatted Date*/ 49616const getFormattedDate = (date) => { 49617 const mydate = new Date(date);
49618 const month = ["January", "February", "March", "April", "May", "June", 49619 "July", "August", "September", "October", "November", "December" 49620 ][mydate.getMonth()]; 49621 const fDate = month + ' ' + mydate.getDate() + ', ' + mydate.getFullYear(); 49622 49623 return fDate 49624} 49625 49626/*Handles Social media platform filters show/hide and click behaviour*/ 49627const setFilters = (data, el) => { 49628 let filterOPtions = []; 49629 const filterEl = $(el).find('#ms_filter'); 49630 const compId = el.getAttribute("data-sfcomp-id"); 49631 const cardsWrapper = $(el).find('.dupont-social-share-content'); 49632 49633 49634 data.forEach(function(obj) { 49635 switch (obj.platform) { 49636 49637 case "linkedin": 49638 if (filterOPtions.filter((item) => { 49639 return item.value == "linkedin" 49640 }).length < 1) { 49641 if (obj.feeds.posts.length && $(el).find('[data-post-platform="linkedin"]').length) { 49642 filterOPtions.push({ 49643 name: Granite.I18n.get("LinkedIn"), 49644 value: 'linkedin' 49645 }) 49646 } 49647 } 49648 49649 break; 49650 case "twitter": 49651 if (filterOPtions.filter((item) => { 49652 return item.value == "twitter" 49653 }).length < 1) { 49654 if (obj.feeds.posts.length && $(el).find('[data-post-platform="twitter"]').length) { 49655 filterOPtions.push({ 49656 name: Granite.I18n.get("Twitter"), 49657 value: 'twitter' 49658 }) 49659 } 49660 } 49661 break; 49662 case "facebook": 49663 if (filterOPtions.filter((item) => { 49664 return item.value == "facebook" 49665 }).length < 1) { 49666 if (obj.feeds.posts.length && $(el).find('[data-post-platform="facebook"]').length) { 49667 filterOPtions.push({ 49668 name: Granite.I18n.get("Facebook"), 49669 value: 'facebook' 49670 }) 49671 } 49672 } 49673 break; 49674 case "youtube": 49675 if (filterOPtions.filter((item) => { 49676 return item.value == "youtube" 49677 }).length < 1) { 49678 if (obj.feeds.posts.length && $(el).find('[data-post-platform="youtube"]').length) { 49679 filterOPtions.push({ 49680 name: Granite.I18n.get("YouTube"), 49681 value: 'youtube' 49682 }) 49683 } 49684 } 49685 break; 49686 case "instagram": 49687 if (filterOPtions.filter((item) => { 49688 return item.value == "instagram" 49689 }).length < 1) { 49690 if (obj.feeds.posts.length && $(el).find('[data-post-platform="instagram"]').length) { 49691 filterOPtions.push({ 49692 name: Granite.I18n.get("Instagram"), 49693 value: 'instagram' 49694 }) 49695 } 49696 } 49697 break; 49698 case "pinterest": 49699 if (filterOPtions.filter((item) => { 49700 return item.value == "pinterest" 49701 }).length < 1) { 49702 if (obj.feeds.posts.length && $(el).find('[data-post-platform="pinterest"]').length) { 49703 filterOPtions.push({ 49704 name: Granite.I18n.get("Pinterest"), 49705 value: 'pinterest' 49706 }) 49707 } 49708 } 49709 break; 49710 } 49711 }) 49712 49713 if (filterOPtions.length > 1) { 49714 el.querySelector(".sf-filter-section").classList.remove("d-none"); 49715 filterEl.multiselect({ 49716 columns: 1, 49717 placeholder: Granite.I18n.get("All Platforms"), 49718 onOptionClick: function(element, option) { 49719 let selectedFilters = filterEl.val(); 49720 let filterdPostsObj = {}; 49721 let curatedLists = { 49722 posts: [], 49723 profile: {} 49724 }; 49725 if (selectedFilters.length) { 49726 filterdPostsObj = socialFeedDataObj[compId].mergedObj.filter((item) => { 49727 return (selectedFilters.indexOf(item.platform) > -1 && item.posts.length > 0) 49728 }) 49729 49730 } else { 49731 filterdPostsObj = socialFeedDataObj[compId].mergedObj; 49732 curatedLists = socialFeedDataObj[compId].curatedList; 49733 } 49734 49735 if (cardsWrapper.hasClass('slick-slider')) { 49736 cardsWrapper.slick('unslick'); 49737 } else { 49738 $(cardsWrapper).html(''); 49739 } 49740 render( 49741 socialFeedDataObj[compId].sfEl, 49742 filterdPostsObj, 49743 curatedLists, 49744 socialFeedDataObj[compId].shouldAppend 49745 ) 49746 if (socialFeedDataObj[compId].loadMoreBtn == "true") { 49747 el.dataset.hasLoadMoreButton = "true"; 49748 } 49749
49750 setView(el, socialFeedDataObj[compId].params); 49751 49752 } 49753 49754 }); 49755 filterEl.multiselect('loadOptions', filterOPtions); 49756 } 49757 49758 49759} 49760 49761/*Set the display view for social feeds*/ 49762const setView = (element, params) => { 49763 const noOfCards = 49764 element.getElementsByClassName("social-share-card").length; 49765 const ssLoadMore = element.querySelector(".ssLoadMore"); 49766 const sliderEl = $( 49767 element.querySelector(".dupont-social-share-content") 49768 ); 49769 if (params.viewType == "carousel" && noOfCards > 4) { 49770 49771 sliderEl.removeClass("dupont-social-share-grid"); 49772 applySlick(sliderEl); 49773 49774 49775 } else if ((params.viewType == "card" || params.viewType == "masonry-grid") && noOfCards > 8) { 49776 ssLoadMore.parentElement.classList.add("load-more-show"); 49777 ssLoadMore.addEventListener("click", (event) => { 49778 event.preventDefault(); 49779 element.dataset.hasLoadMoreButton = "false"; 49780 if (params.viewType == "masonry-grid") { 49781 $(element).find(".masonry-grid").masonry('layout'); 49782 if (window.innerWidth < 480) { 49783 setTimeout(function() { 49784 $($(element).find(".masonry-grid").children()[8]).css('transform', 'translate3D(0px,0px,0px)'); 49785 }, 200); 49786 } 49787 } 49788 49789 setTimeout(function() { 49790 hideSeeMore(element); 49791 }, 100) 49792 }); 49793 } else { 49794 element.dataset.hasLoadMoreButton = "false"; 49795 if (params.viewType == "carousel" && noOfCards <= 4) { 49796 sliderEl.addClass("dupont-social-share-grid"); 49797 } 49798 } 49799 49800} 49801 49802/* Trigger component code execution*/ 49803[...document.getElementsByClassName("dupont-social-share-comp")].forEach( 49804 (element, ind) => { 49805 49806 element.setAttribute("data-sfcomp-id", "smf-" + ind); 49807 let feedsMultifieldData = []; 49808 (JSON.parse(element.dataset.feedsList)).forEach((item) => { 49809 49810 item.platform = (item.postType.indexOf("-") > -1) ? item.postType.split("-")[0] : ""; 49811 item.postType = (item.postType.indexOf("-") > -1) ? item.postType.split("-")[1] : ""; 49812 feedsMultifieldData.push(item); 49813 }); 49814 const params = { 49815 multiFieldData: feedsMultifieldData, 49816 curatedList: element.dataset.curatedList, 49817 shouldAppend: element.dataset.shouldAppend, 49818 viewType: element.dataset.viewType, 49819 hasLoadMoreButton: element.dataset.hasLoadMoreButton, 49820 }; 49821 49822 let curatedList = JSON.parse(params.curatedList); 49823 let updatedCurList = []; 49824 if(params.viewType == "fix-grid"){ 49825 $(element).parent().addClass('fixgrid-parent'); 49826 setTimeout(function(){ 49827 $(element).find(".bg_img").removeClass('no-background'); 49828 },500); 49829 49830 } 49831 49832 for (let item of curatedList.posts) { 49833 const obj = {}; 49834 obj['profilePhoto'] = item.logoPath; 49835 obj['name'] = item.labelLinkText ? item.labelLinkText : ''; 49836 obj['story'] = item.cardtitle ? item.cardtitle : ''; 49837 obj['message'] = item.description ? item.description : ''; 49838 obj['postDate'] = item.dateValue ? item.dateValue : ''; 49839 obj['link'] = item.pagePath; 49840 obj['media'] = { 49841 'url': item.media.videoPath, 49842 'thumbnail': item.media.imagePath, 49843 'type': item.media.videoPath ? "video" : "image" 49844 }; 49845 49846 updatedCurList.push(obj); 49847 } 49848 curatedList.posts = updatedCurList; 49849 socialFeedDataObj["smf-" + ind] = { 49850 sfEl: element, 49851 curatedList: curatedList, 49852 shouldAppend: params.shouldAppend, 49853 params: params, 49854 loadMoreBtn: params.hasLoadMoreButton 49855 }; 49856 49857 fetchPostsFromApi(params.multiFieldData, element).then((data) => { 49858 render( 49859 element, 49860 mergeFeedsData(data, element), 49861 curatedList, 49862 params.shouldAppend 49863 ); 49864 49865 setFilters(params.multiFieldData, element);
49866 setView(element, params); 49867 if(params.viewType == "fix-grid"){ 49868 49869 if(window.innerWidth <= 768){ 49870 $($(element).find(".social-share-card")[0]).addClass('active'); 49871 $(element).attr('active-card',1); 49872 setCardContainerHeight(element); 49873 49874 } 49875 } 49876 49877 }); 49878 49879 49880 $(element.parentElement).on("click", ".smf-play-icon", function(event) { 49881 const el = event.currentTarget; 49882 const src = el.getAttribute('data-href'); 49883 const videoEL = element.parentElement.querySelector('.smf-vid-container video'); 49884 const iFrameEl = element.parentElement.querySelector('.smf-vid-container iframe'); 49885 const conatinerEl = element.parentElement.querySelector('.smf-vid-container'); 49886 if (src.indexOf("youtube.com") > -1 || src.indexOf("linkedin.com") > -1) { 49887 conatinerEl.classList.add('iframe-wrap'); 49888 videoEL.classList.add('d-none'); 49889 iFrameEl.classList.remove('d-none'); 49890 iFrameEl.setAttribute('src', src); 49891 } else { 49892 conatinerEl.classList.remove('iframe-wrap'); 49893 iFrameEl.classList.add('d-none'); 49894 videoEL.classList.remove('d-none'); 49895 videoEL.setAttribute('src', src); 49896 } 49897 49898 element.parentElement.querySelector('.smf-video-model').style.display = "block"; 49899 }); 49900 49901 $(element.parentElement).on("click", ".smf-model-close-btn", function(event) { 49902 element.parentElement.querySelector('.smf-vid-container video').setAttribute('src', ''); 49903 element.parentElement.querySelector('.smf-vid-container iframe').setAttribute('src', ''); 49904 element.parentElement.querySelector('.smf-video-model').style.display = "none"; 49905 }); 49906 49907 $(document).on("click",".arrow-right-mob",function(){ 49908 49909 let activeCard = parseInt($(element).attr('active-card')); 49910 49911 $(element).find(".social-share-card").removeClass('active'); 49912 $($(element).find(".social-share-card")[activeCard]).addClass('active'); 49913 $($(element).find(".dots")).removeClass('active'); 49914 $($(element).find(".dots")[activeCard]).addClass('active'); 49915 49916 if($(element).attr('all-cards-appeared') =='yes'){ 49917 $(element).attr('active-card', 1); 49918 $(element).attr('all-cards-appeared','no'); 49919 $(element).find('.ss-see-more').css('visibility','hidden'); 49920 }else if((activeCard +1) == 3){ 49921 $(element).find('.ss-see-more').css('visibility','visible'); 49922 $(element).attr('all-cards-appeared','yes'); 49923 $(element).attr('active-card',0); 49924 }else{ 49925 $(element).attr('active-card',activeCard + 1); 49926 $(element).find('.ss-see-more').css('visibility','hidden'); 49927 } 49928 49929 49930 setCardContainerHeight(element); 49931 49932 }) 49933 49934 49935 49936 49937 } 49938 49939); 49940 49941var countryNameAbbr_json=[ 49942 { 49943 "country": "AFGHANISTAN", 49944 "abbreviation": "AF" 49945 }, 49946 { 49947 "country": "ALAND ISLANDS", 49948 "abbreviation": "AX" 49949 }, 49950 { 49951 "country": "ALBANIA", 49952 "abbreviation": "AL" 49953 }, 49954 { 49955 "country": "ALGERIA", 49956 "abbreviation": "DZ" 49957 }, 49958 { 49959 "country": "AMERICAN SAMOA", 49960 "abbreviation": "AMERICAN SAMOA" 49961 }, 49962 { 49963 "country": "ANDORRA", 49964 "abbreviation": "AD" 49965 }, 49966 { 49967 "country": "ANGOLA", 49968 "abbreviation": "AO" 49969 }, 49970 { 49971 "country": "ANGUILLA", 49972 "abbreviation": "AI" 49973 }, 49974 { 49975 "country": "ANTARCTICA", 49976 "abbreviation": "AQ" 49977 }, 49978 { 49979 "country": "ANTIGUA AND BARBUDA", 49980 "abbreviation": "AG" 49981 }, 49982 { 49983 "country": "ARGENTINA", 49984 "abbreviation": "AR" 49985 }, 49986 { 49987 "country": "ARMENIA", 49988 "abbreviation": "AM" 49989 }, 49990 { 49991 "country": "ARUBA", 49992 "abbreviation": "AW" 49993 }, 49994 { 49995 "country": "AUSTRALIA", 49996 "abbreviation": "AU" 49997 }, 49998 { 49999 "country": "AUSTRIA", 50000 "abbreviation": "AT" 50001 }, 50002 { 50003 "country": "AZERBAIJAN", 50004 "abbreviation": "AZ" 50005 }, 50006 { 50007 "country": "BAHAMAS", 50008 "abbreviation": "BS" 50009 }, 50010 { 50011 "country": "BAHRAIN", 50012 "abbreviation": "BH" 50013 }, 50014 { 50015 "country": "BANGLADESH", 50016 "abbreviation": "BD" 50017 }, 50018 { 50019 "country": "BARBADOS", 50020 "abbreviation": "BB" 50021 }, 50022 { 50023 "country": "BELARUS", 50024 "abbreviation": "BY" 50025 }, 50026 { 50027 "country": "BELGIUM", 50028 "abbreviation": "BE" 50029 }, 50030 { 50031 "country": "BELIZE", 50032 "abbreviation": "BZ" 50033 }, 50034 { 50035 "country": "BENIN", 50036 "abbreviation": "BJ" 50037 }, 50038 { 50039 "country": "BERMUDA", 50040 "abbreviation": "BM"
50041 }, 50042 { 50043 "country": "BHUTAN", 50044 "abbreviation": "BT" 50045 }, 50046 { 50047 "country": "BOLIVIA", 50048 "abbreviation": "BO" 50049 }, 50050 { 50051 "country": "BORNEO", 50052 "abbreviation": "BORNEO" 50053 }, 50054 { 50055 "country": "BOSNIA AND HERZEGOVINA", 50056 "abbreviation": "BA" 50057 }, 50058 { 50059 "country": "BOTSWANA", 50060 "abbreviation": "BW" 50061 }, 50062 { 50063 "country": "BOUVET ISLAND", 50064 "abbreviation": "BV" 50065 }, 50066 { 50067 "country": "BRAZIL", 50068 "abbreviation": "BR" 50069 }, 50070 { 50071 "country": "BRITISH INDIAN OCEAN TERRITORY", 50072 "abbreviation": "IO" 50073 }, 50074 { 50075 "country": "BRUNEI DARUSSALAM", 50076 "abbreviation": "BN" 50077 }, 50078 { 50079 "country": "BULGARIA", 50080 "abbreviation": "BG" 50081 }, 50082 { 50083 "country": "BURKINA FASO", 50084 "abbreviation": "BF" 50085 }, 50086 { 50087 "country": "BURUNDI", 50088 "abbreviation": "BI" 50089 }, 50090 { 50091 "country": "CAMBODIA", 50092 "abbreviation": "KH" 50093 }, 50094 { 50095 "country": "CAMEROON", 50096 "abbreviation": "CM" 50097 }, 50098 { 50099 "country": "CANADA", 50100 "abbreviation": "CA" 50101 }, 50102 { 50103 "country": "CAPE VERDE", 50104 "abbreviation": "CV" 50105 }, 50106 { 50107 "country": "CAYMAN ISLANDS", 50108 "abbreviation": "KY" 50109 }, 50110 { 50111 "country": "CENTRAL AFRICAN REPUBLIC", 50112 "abbreviation": "CF" 50113 }, 50114 { 50115 "country": "CHAD", 50116 "abbreviation": "TD" 50117 }, 50118 { 50119 "country": "CHILE", 50120 "abbreviation": "CL" 50121 }, 50122 { 50123 "country": "CHINA", 50124 "abbreviation": "CN" 50125 }, 50126 { 50127 "country": "CHRISTMAS ISLAND", 50128 "abbreviation": "CX" 50129 }, 50130 { 50131 "country": "COCOS (KEELING) ISLANDS", 50132 "abbreviation": "CC" 50133 }, 50134 { 50135 "country": "COLOMBIA", 50136 "abbreviation": "CO" 50137 }, 50138 { 50139 "country": "COMOROS", 50140 "abbreviation": "KM" 50141 }, 50142 { 50143 "country": "CONGO", 50144 "abbreviation": "CG" 50145 }, 50146 { 50147 "country": "CONGO, THE DEMOCRATIC REPUBLIC OF THE", 50148 "abbreviation": "CD" 50149 }, 50150 { 50151 "country": "COOK ISLANDS", 50152 "abbreviation": "CK" 50153 }, 50154 { 50155 "country": "COSTA RICA", 50156 "abbreviation": "CR" 50157 }, 50158 { 50159 "country": "CÃTE D'IVOIRE", 50160 "abbreviation": "CI" 50161 }, 50162 { 50163 "country": "CROATIA", 50164 "abbreviation": "HR" 50165 }, 50166 { 50167 "country": "CUBA", 50168 "abbreviation": "CU" 50169 }, 50170 { 50171 "country": "CYPRUS", 50172 "abbreviation": "CY" 50173 }, 50174 { 50175 "country": "CZECH REPUBLIC", 50176 "abbreviation": "CZ" 50177 }, 50178 { 50179 "country": "DENMARK", 50180 "abbreviation": "DK" 50181 }, 50182 { 50183 "country": "DJIBOUTI", 50184 "abbreviation": "DJ" 50185 }, 50186 { 50187 "country": "DOMINICA", 50188 "abbreviation": "DM" 50189 }, 50190 { 50191 "country": "DOMINICAN REPUBLIC", 50192 "abbreviation": "DO" 50193 }, 50194 { 50195 "country": "ECUADOR", 50196 "abbreviation": "EC" 50197 }, 50198 { 50199 "country": "EGYPT", 50200 "abbreviation": "EG" 50201 }, 50202 { 50203 "country": "EL SALVADOR", 50204 "abbreviation": "SV" 50205 }, 50206 { 50207 "country": "EQUATORIAL GUINEA", 50208 "abbreviation": "GQ" 50209 }, 50210 { 50211 "country": "ERITREA", 50212 "abbreviation": "ER" 50213 }, 50214 { 50215 "country": "ESTONIA", 50216 "abbreviation": "EE" 50217 }, 50218 { 50219 "country": "ETHIOPIA", 50220 "abbreviation": "ET" 50221 }, 50222 { 50223 "country": "FALKLAND ISLANDS (MALVINAS)", 50224 "abbreviation": "FK" 50225 }, 50226 { 50227 "country": "FAROE ISLANDS", 50228 "abbreviation": "FO" 50229 }, 50230 { 50231 "country": "FIJI", 50232 "abbreviation": "FJ" 50233 }, 50234 { 50235 "country": "FINLAND", 50236 "abbreviation": "FI" 50237 }, 50238 { 50239 "country": "FRANCE", 50240 "abbreviation": "FR" 50241 }, 50242 { 50243 "country": "FRENCH GUIANA", 50244 "abbreviation": "GF" 50245 }, 50246 { 50247 "country": "FRENCH POLYNESIA", 50248 "abbreviation": "PF" 50249 }, 50250 { 50251 "country": "FRENCH SOUTHERN TERRITORIES", 50252 "abbreviation": "TF" 50253 }, 50254 { 50255 "country": "GABON", 50256 "abbreviation": "GA" 50257 }, 50258 { 50259 "country": "GAMBIA", 50260 "abbreviation": "GM" 50261 }, 50262 { 50263 "country": "GEORGIA", 50264 "abbreviation": "GE" 50265 }, 50266 { 50267 "country": "GERMANY", 50268 "abbreviation": "DE" 50269 }, 50270 { 50271 "country": "GHANA", 50272 "abbreviation": "GH" 50273 }, 50274 { 50275 "country": "GIBRALTAR", 50276 "abbreviation": "GI" 50277 }, 50278 { 50279 "country": "GREECE", 50280 "abbreviation": "GR" 50281 }, 50282 { 50283 "country": "GREENLAND", 50284 "abbreviation": "GL" 50285 }, 50286 { 50287 "country": "GRENADA", 50288 "abbreviation": "GD" 50289 }, 50290 { 50291 "country": "GUADELOUPE", 50292 "abbreviation": "GP" 50293 }, 50294 { 50295 "country": "GUAM", 50296 "abbreviation": "GUAM" 50297 }, 50298 { 50299 "country": "GUATEMALA", 50300 "abbreviation": "GT" 50301 }, 50302 { 50303 "country": "GUINEA", 50304 "abbreviation": "GN" 50305 }, 50306 { 50307 "country": "GUINEA-BISSAU", 50308 "abbreviation": "GW" 50309 }, 50310 { 50311 "country": "GUYANA", 50312 "abbreviation": "GY" 50313 }, 50314 { 50315 "country": "HAITI", 50316 "abbreviation": "HT" 50317 }, 50318 { 50319 "country": "HEARD ISLAND AND MCDONALD ISLANDS", 50320 "abbreviation": "HM" 50321 }, 50322 { 50323 "country": "HOLY SEE (VATICAN CITY STATE)", 50324 "abbreviation": "VA" 50325 }, 50326 { 50327 "country": "HONDURAS", 50328 "abbreviation": "HN" 50329 }, 50330 { 50331 "country": "HUNGARY", 50332 "abbreviation": "HU" 50333 }, 50334 { 50335 "country": "ICELAND", 50336 "abbreviation": "IS" 50337 }, 50338 { 50339 "country": "INDIA", 50340 "abbreviation": "IN" 50341 }, 50342 { 50343 "country": "INDONESIA", 50344 "abbreviation": "ID" 50345 }, 50346 { 50347 "country": "IRAN, ISLAMIC REPUBLIC OF", 50348 "abbreviation": "IR" 50349 }, 50350 { 50351 "country": "IRAQ", 50352 "abbreviation": "IQ" 50353 }, 50354 { 50355 "country": "IRELAND", 50356 "abbreviation": "IE" 50357 }, 50358 { 50359 "country": "ISRAEL", 50360 "abbreviation": "IL" 50361 }, 50362 { 50363 "country": "ITALY", 50364 "abbreviation": "IT" 50365 }, 50366 { 50367 "country": "JAMAICA", 50368 "abbreviation": "JM" 50369 }, 50370 { 50371 "country": "JAPAN", 50372 "abbreviation": "JP" 50373 }, 50374 { 50375 "country": "JORDAN", 50376 "abbreviation": "JO" 50377 }, 50378 { 50379 "country": "KAZAKHSTAN", 50380 "abbreviation": "KZ" 50381 }, 50382 { 50383 "country": "KENYA", 50384 "abbreviation": "KE" 50385 }, 50386 { 50387 "country": "KIRIBATI", 50388 "abbreviation": "KI" 50389 }, 50390 {
50391 "country": "KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF", 50392 "abbreviation": "KP" 50393 }, 50394 { 50395 "country": "KOREA, REPUBLIC OF", 50396 "abbreviation": "KR" 50397 }, 50398 { 50399 "country": "KOSOVO", 50400 "abbreviation": "KOSOVO" 50401 }, 50402 { 50403 "country": "KUWAIT", 50404 "abbreviation": "KW" 50405 }, 50406 { 50407 "country": "KYRGYZSTAN", 50408 "abbreviation": "KG" 50409 }, 50410 { 50411 "country": "LAO PEOPLE'S DEMOCRATIC REPUBLIC", 50412 "abbreviation": "LA" 50413 }, 50414 { 50415 "country": "LAOS", 50416 "abbreviation": "LAOS" 50417 }, 50418 { 50419 "country": "LATVIA", 50420 "abbreviation": "LV" 50421 }, 50422 { 50423 "country": "LEBANON", 50424 "abbreviation": "LB" 50425 }, 50426 { 50427 "country": "LESOTHO", 50428 "abbreviation": "LS" 50429 }, 50430 { 50431 "country": "LIBERIA", 50432 "abbreviation": "LR" 50433 }, 50434 { 50435 "country": "LIBYAN ARAB JAMAHIRIYA", 50436 "abbreviation": "LY" 50437 }, 50438 { 50439 "country": "LIECHTENSTEIN", 50440 "abbreviation": "LI" 50441 }, 50442 { 50443 "country": "LITHUANIA", 50444 "abbreviation": "LT" 50445 }, 50446 { 50447 "country": "LUXEMBOURG", 50448 "abbreviation": "LU" 50449 }, 50450 { 50451 "country": "MACEDONIA", 50452 "abbreviation": "MACEDONIA" 50453 }, 50454 { 50455 "country": "MADAGASCAR", 50456 "abbreviation": "MG" 50457 }, 50458 { 50459 "country": "MALAWI", 50460 "abbreviation": "MW" 50461 }, 50462 { 50463 "country": "MALAYSIA", 50464 "abbreviation": "MY" 50465 }, 50466 { 50467 "country": "MALDIVES", 50468 "abbreviation": "MV" 50469 }, 50470 { 50471 "country": "MALI", 50472 "abbreviation": "ML" 50473 }, 50474 { 50475 "country": "MALTA", 50476 "abbreviation": "MT" 50477 }, 50478 {
50479 "country": "MARSHALL ISLANDS", 50480 "abbreviation": "MARSHALL ISLANDS" 50481 }, 50482 { 50483 "country": "MARTINIQUE", 50484 "abbreviation": "MQ" 50485 }, 50486 { 50487 "country": "MAURITANIA", 50488 "abbreviation": "MR" 50489 }, 50490 { 50491 "country": "MAURITIUS", 50492 "abbreviation": "MU" 50493 }, 50494 { 50495 "country": "MAYOTTE", 50496 "abbreviation": "YT" 50497 }, 50498 { 50499 "country": "MEXICO", 50500 "abbreviation": "MX" 50501 }, 50502 { 50503 "country": "MICRONESIA, FEDERATED STATES OF", 50504 "abbreviation": "MICRONESIA, FEDERATED STATES OF" 50505 }, 50506 { 50507 "country": "MOLDOVA, REPUBLIC OF", 50508 "abbreviation": "MD" 50509 }, 50510 { 50511 "country": "MONACO", 50512 "abbreviation": "MC" 50513 }, 50514 { 50515 "country": "MONGOLIA", 50516 "abbreviation": "MN" 50517 }, 50518 { 50519 "country": "MONTENEGRO", 50520 "abbreviation": "ME" 50521 }, 50522 { 50523 "country": "MONTSERRAT", 50524 "abbreviation": "MS" 50525 }, 50526 { 50527 "country": "MOROCCO", 50528 "abbreviation": "MA" 50529 }, 50530 { 50531 "country": "MOZAMBIQUE", 50532 "abbreviation": "MZ" 50533 }, 50534 { 50535 "country": "MYANMAR", 50536 "abbreviation": "MM" 50537 }, 50538 { 50539 "country": "NAMIBIA", 50540 "abbreviation": "NA" 50541 }, 50542 { 50543 "country": "NAURU", 50544 "abbreviation": "NR" 50545 }, 50546 { 50547 "country": "NEPAL", 50548 "abbreviation": "NP" 50549 }, 50550 { 50551 "country": "NETHERLANDS", 50552 "abbreviation": "NL" 50553 }, 50554 { 50555 "country": "NETHERLANDS ANTILLES", 50556 "abbreviation": "NETHERLANDS ANTILLES" 50557 }, 50558 { 50559 "country": "NEW CALEDONIA", 50560 "abbreviation": "NC" 50561 }, 50562 { 50563 "country": "NEW ZEALAND", 50564 "abbreviation": "NZ" 50565 }, 50566 { 50567 "country": "NICARAGUA", 50568 "abbreviation": "NI" 50569 }, 50570 { 50571 "country": "NIGER", 50572 "abbreviation": "NE" 50573 }, 50574 { 50575 "country": "NIGERIA", 50576 "abbreviation": "NG" 50577 }, 50578 { 50579 "country": "NIUE", 50580 "abbreviation": "NU" 50581 }, 50582 { 50583 "country": "NORFOLK ISLAND", 50584 "abbreviation": "NF" 50585 }, 50586 { 50587 "country": "NORTHERN MARIANA ISLANDS", 50588 "abbreviation": "NORTHERN MARIANA ISLANDS" 50589 }, 50590 { 50591 "country": "NORWAY", 50592 "abbreviation": "NO" 50593 }, 50594 { 50595 "country": "OMAN", 50596 "abbreviation": "OM" 50597 }, 50598 { 50599 "country": "PACIFIC ISLAND STATE", 50600 "abbreviation": "PACIFIC ISLAND STATE" 50601 }, 50602 { 50603 "country": "PAKISTAN", 50604 "abbreviation": "PK" 50605 }, 50606 { 50607 "country": "PALAU", 50608 "abbreviation": "PALAU" 50609 }, 50610 { 50611 "country": "PALESTINIAN TERRITORY, OCCUPIED", 50612 "abbreviation": "PALESTINIAN TERRITORY, OCCUPIED" 50613 }, 50614 { 50615 "country": "PANAMA", 50616 "abbreviation": "PA" 50617 }, 50618 { 50619 "country": "PAPUA NEW GUINEA", 50620 "abbreviation": "PG" 50621 }, 50622 { 50623 "country": "PARAGUAY", 50624 "abbreviation": "PY" 50625 }, 50626 { 50627 "country": "PERU", 50628 "abbreviation": "PE" 50629 }, 50630 { 50631 "country": "PHILIPPINES", 50632 "abbreviation": "PH" 50633 }, 50634 { 50635 "country": "PITCAIRN", 50636 "abbreviation": "PN" 50637 }, 50638 { 50639 "country": "POLAND", 50640 "abbreviation": "PL" 50641 }, 50642 { 50643 "country": "PORTUGAL", 50644 "abbreviation": "PT" 50645 }, 50646 { 50647 "country": "PUERTO RICO", 50648 "abbreviation": "PUERTO RICO" 50649 }, 50650 { 50651 "country": "QATAR", 50652 "abbreviation": "QA" 50653 }, 50654 { 50655 "country": "RÃUNION", 50656 "abbreviation": "RE" 50657 }, 50658 { 50659 "country": "ROMANIA", 50660 "abbreviation": "RO" 50661 }, 50662 { 50663 "country": "RWANDA", 50664 "abbreviation": "RW" 50665 }, 50666 { 50667 "country": "SAINT HELENA", 50668 "abbreviation": "SH" 50669 }, 50670 { 50671 "country": "SAINT KITTS AND NEVIS", 50672 "abbreviation": "KN" 50673 }, 50674 { 50675 "country": "SAINT LUCIA", 50676 "abbreviation": "LC" 50677 }, 50678 { 50679 "country": "SAINT PIERRE AND MIQUELON", 50680 "abbreviation": "PM" 50681 }, 50682 { 50683 "country": "SAINT VINCENT AND THE GRENADINES", 50684 "abbreviation": "VC" 50685 }, 50686 { 50687 "country": "SAMOA", 50688 "abbreviation": "WS" 50689 }, 50690 { 50691 "country": "SAN MARINO", 50692 "abbreviation": "SM" 50693 }, 50694 { 50695 "country": "SAO TOME AND PRINCIPE", 50696 "abbreviation": "ST" 50697 }, 50698 { 50699 "country": "SAUDI ARABIA", 50700 "abbreviation": "SA" 50701 }, 50702 { 50703 "country": "SENEGAL", 50704 "abbreviation": "SN" 50705 }, 50706 { 50707 "country": "SERBIA", 50708 "abbreviation": "RS" 50709 }, 50710 { 50711 "country": "SEYCHELLES", 50712 "abbreviation": "SC" 50713 }, 50714 { 50715 "country": "SIERRA LEONE", 50716 "abbreviation": "SL" 50717 }, 50718 { 50719 "country": "SINGAPORE", 50720 "abbreviation": "SG" 50721 }, 50722 { 50723 "country": "SLOVAKIA", 50724 "abbreviation": "SK" 50725 }, 50726 { 50727 "country": "SLOVENIA", 50728 "abbreviation": "SI" 50729 }, 50730 { 50731 "country": "SOLOMON ISLANDS", 50732 "abbreviation": "SB" 50733 }, 50734 { 50735 "country": "SRI LANKA", 50736 "abbreviation": "LK" 50737 }, 50738 { 50739 "country": "SOMALIA", 50740 "abbreviation": "SO" 50741 }, 50742 { 50743 "country": "SOUTH AFRICA", 50744 "abbreviation": "ZA" 50745 }, 50746 { 50747 "country": "SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS", 50748 "abbreviation": "GS" 50749 }, 50750 { 50751 "country": "SPAIN", 50752 "abbreviation": "ES" 50753 }, 50754 { 50755 "country": "SUDAN", 50756 "abbreviation": "SD" 50757 }, 50758 { 50759 "country": "SURINAME", 50760 "abbreviation": "SR" 50761 }, 50762 { 50763 "country": "SVALBARD AND JAN MAYEN", 50764 "abbreviation": "SJ" 50765 }, 50766 { 50767 "country": "SWAZILAND", 50768 "abbreviation": "SZ" 50769 }, 50770 { 50771 "country": "SWEDEN", 50772 "abbreviation": "SE" 50773 }, 50774 { 50775 "country": "SWITZERLAND", 50776 "abbreviation": "CH" 50777 }, 50778 { 50779 "country": "SYRIA", 50780 "abbreviation": "SYRIA" 50781 }, 50782 { 50783 "country": "TAJIKISTAN", 50784 "abbreviation": "TJ" 50785 }, 50786 { 50787 "country": "TANZANIA, UNITED REPUBLIC OF", 50788 "abbreviation": "TZ" 50789 }, 50790 { 50791 "country": "THAILAND", 50792 "abbreviation": "TH" 50793 }, 50794 { 50795 "country": "TIMOR-LESTE", 50796 "abbreviation": "TL" 50797 }, 50798 { 50799 "country": "TOGO", 50800 "abbreviation": "TG" 50801 }, 50802 { 50803 "country": "TOKELAU", 50804 "abbreviation": "TK" 50805 }, 50806 { 50807 "country": "TONGA", 50808 "abbreviation": "TO" 50809 }, 50810 { 50811 "country": "TRINIDAD AND TOBAGO", 50812 "abbreviation": "TT" 50813 }, 50814 { 50815 "country": "TUNISIA", 50816 "abbreviation": "TN" 50817 }, 50818 { 50819 "country": "TURKEY", 50820 "abbreviation": "TR" 50821 }, 50822 { 50823 "country": "TURKMENISTAN", 50824 "abbreviation": "TM" 50825 }, 50826 { 50827 "country": "TURKS AND CAICOS ISLANDS", 50828 "abbreviation": "TC" 50829 }, 50830 { 50831 "country": "TUVALU", 50832 "abbreviation": "TV" 50833 }, 50834 { 50835 "country": "UGANDA", 50836 "abbreviation": "UG" 50837 }, 50838 { 50839 "country": "UKRAINE", 50840 "abbreviation": "UA" 50841 }, 50842 { 50843 "country": "UNITED ARAB EMIRATES", 50844 "abbreviation": "AE" 50845 }, 50846 { 50847 "country": "UNITED KINGDOM", 50848 "abbreviation": "GB" 50849 }, 50850 { 50851 "country": "UNITED STATES", 50852 "abbreviation": "US" 50853 }, 50854 { 50855 "country": "UNITED STATES MINOR OUTLYING ISLANDS", 50856 "abbreviation": "UNITED STATES MINOR OUTLYING ISLANDS" 50857 }, 50858 { 50859 "country": "URUGUAY", 50860 "abbreviation": "UY" 50861 }, 50862 { 50863 "country": "UZBEKISTAN", 50864 "abbreviation": "UZ"
50865 }, 50866 { 50867 "country": "VANUATU", 50868 "abbreviation": "VU" 50869 }, 50870 { 50871 "country": "VENEZUELA", 50872 "abbreviation": "VENEZUELA" 50873 }, 50874 { 50875 "country": "VIETNAM", 50876 "abbreviation": "VN" 50877 }, 50878 { 50879 "country": "VIRGIN ISLANDS, BRITISH", 50880 "abbreviation": "VG" 50881 }, 50882 { 50883 "country": "VIRGIN ISLANDS, U.S.", 50884 "abbreviation": "VIRGIN ISLANDS, U.S." 50885 }, 50886 { 50887 "country": "WALLIS AND FUTUNA", 50888 "abbreviation": "WF" 50889 }, 50890 { 50891 "country": "WESTERN SAHARA", 50892 "abbreviation": "EH" 50893 }, 50894 { 50895 "country": "YEMEN", 50896 "abbreviation": "YE" 50897 }, 50898 { 50899 "country": "ZAMBIA", 50900 "abbreviation": "ZM" 50901 }, 50902 { 50903 "country": "ZIMBABWE", 50904 "abbreviation": "ZW" 50905 } 50906] 50907 50908if (document.getElementsByClassName('signUpForm').length) { 50909 var tempObj; 50910 var buList; 50911 $(document).ready(function() { 50912 if (document.getElementById('signupForm')) { 50913 document.getElementById('signupForm').reset(); 50914 } 50915 var succesURL = "/signup/signup_register.html"; 50916 var errorURL = "/content/dupont/amer/us/en/corporate-homepage/signup/userexists.html"; 50917 var updateProfileURL = "/content/dupont/amer/us/en/corporate-homepage/updatedprofile.html"; 50918 var targetURL = "/dupont/Usersignupservice/result"; 50919 var validateEmailURL = "/dupont/Duplicateuser"; 50920 var updateURL = "/dupont/Userupdateservice"; 50921 var select; 50922 var selectCompanySize; 50923 var selectState; 50924 var selectIndustry; 50925 var selectJobFunction; 50926 var selectRole; 50927 var selectize; 50928 var selectizeCompanySize; 50929 var selectizeState; 50930 var selectizeIndustry; 50931 var selectizeJobFunction; 50932 var selectizeRole; 50933 var signInLink = $('#signupForm').attr('data-signInLink'); 50934 var dupUserText = $('#signupForm').attr('data-dupUserText'); 50935 var dupUserBtnText = $('#signupForm').attr('data-dupUserBtnText'); 50936 var signupsuccessURL = $('#signupForm').attr('data-signupRegisterLink'); 50937 var selectSignup; 50938 var selectCompanySizeSignup; 50939 var selectStateSignup; 50940 var selectIndustrySignup; 50941 var selectJobFunctionSignup; 50942 var selectRoleSignup; 50943 var selectizeSignup; 50944 var selectizeCompanySizeSignup; 50945 var selectizeStateSignup; 50946 var selectizeIndustrySignup; 50947 var selectizeJobFunctionSignup; 50948 var selectizeRoleSignup; 50949 //var org_list=['wnp','eni','mnm']; 50950 var org_list = ['WS', 'EC', 'MS']; 50951 var org_Userdata = {}; 50952 var unsubscription_cnt = 0; 50953 /*if ($('#emailsignupEdit').val()) { 50954 var wnp_unsubscribeUrl = 'https://app.protectiontechnologies.dupont.com/e/f2.aspx?elqFormName=NAOptOut&elqSiteID=911788392&e='+ $('#emailsignupEdit').val(); 50955 var mnm_unsubscribeUrl = 'https://app.ti.dupont.com/e/f2?elqFormName=TAP-unsubscribe&elqSiteId=561466590&emailAddress='+ $('#emailsignupEdit').val(); 50956 var eni_unsubscribeUrl = 'https://app.electronics-imaging.dupont.com/e/f2?elqFormName=optout&elqSiteID=1516662972&emailAddress='+ $('#emailsignupEdit').val(); 50957 } 50958 if($('#emailsignupEdit').val()){ 50959 var wnp_subscribeUrl = 'https://app.protectiontechnologies.dupont.com/e/f2.aspx?elqFormName=optin&elqSiteID=911788392&e='+ $('#emailsignupEdit').val(); 50960 var mnm_subscribeUrl = 'https://app.ti.dupont.com/e/f2?elqFormName=optin&elqSiteId=561466590&emailAddress='+ $('#emailsignupEdit').val(); 50961 var eni_subscribeUrl = 'https://app.electronics-imaging.dupont.com/e/f2?elqFormName=optin&elqSiteID=1516662972&emailAddress='+ $('#emailsignupEdit').val(); 50962 }*/ 50963 50964 var emailGroupTooltip = [ 50965 Granite.I18n.get('myProfEventToolTip'), 50966 Granite.I18n.get('myProfeServicesToolTip'), 50967 Granite.I18n.get('myProfeBuUpdatesToolTip') 50968 ] 50969 50970 if (document.getElementById('noData')) { 50971 50972 if ($('#editForm #optin').parents('.optin-check').data('optinreq')) { 50973 50974 $('#editForm #optin').parents('.optin-check').show(); 50975 50976 } else { 50977 50978 $('#editForm #optin').parents('.optin-check').hide(); 50979 50980 } 50981 50982 } 50983
50984 if (document.getElementById('noData')) 50985 apiRequestLoop(org_list).then(result => { 50986 console.log('result', result); 50987 for (let [index, val] of org_list.entries()) { 50988 org_Userdata[val] = result[index] 50989 } 50990 getSubscriptionData(org_Userdata); 50991 console.log(org_Userdata); 50992 50993 }); 50994 50995 function apiRequestLoop(orgs) { 50996 50997 //const campaignDataUrl_org = '/dupont/campaignData?email='+$('#emailsignupEdit').val()+'&org='; 50998 const campaignDataUrl_org = '/dupont/preferenceCenter?email='+$('#emailsignupEdit').val()+'&org='; 50999 ////TODO:Remove below statement and uncomment above one 51000 //const campaignDataUrl_org = '/dupont/[email protected]&org='; 51001 let promiseArray = []; 51002 for (let org of orgs) { 51003 let campaignDataUrl = campaignDataUrl_org + org; 51004 promiseArray.push( 51005 fetch(campaignDataUrl, { 51006 cache: "no-cache" 51007 }).then((response) => response.json()).catch(error => { 51008 return Promise.reject() 51009 }) 51010 ); 51011 } 51012 console.log(promiseArray); 51013 return Promise.all(promiseArray); 51014 } 51015 51016 function getSubscriptionData(subs_data) { 51017 51018 //let noCampaign=$($('.subscriptionDetails')[0]).data('nocampaign') ? 'noCampaign' : ''; 51019 let noCampaign = $($('.subscriptionDetails')[0]).data('nocampaign') ? true : false; 51020 let noCampaignClass; 51021 51022 if (noCampaign) 51023 noCampaignClass = 'noCampaign'; 51024 else { 51025 //Check if noCampaign is undefined and set nocampaign to True if there is no data in the subs_data 51026 if (!subs_data.WS["Campaign Data"].length || !subs_data.EC["Campaign Data"].length || !subs_data.MS["Campaign Data"].length) { 51027 noCampaignClass = 'noCampaign'; 51028 } 51029 } 51030 51031 let html_div = `<div class='mySubscriptions'> 51032 <div class="buOrg-checkboxes"> 51033 <div id="buOrg-groups" class="mb-4"></div> 51034 </div> 51035 <div class="consent-text">${Granite.I18n.get('signupOptinLabel')}</div> 51036 <div id="uncheckInfo" class="mt-4 mb-3 uncheckInfo">${Granite.I18n.get('myProfileUncheckInfo')}</div> 51037 <div class='emailGroup-subscriptions' style="display:none"> 51038 <h5 class="business-unit-main-header">${Granite.I18n.get('myProfileEmailGroup')} </h5> 51039 <div class="emailGroup-checkboxes"> 51040 <div id="email-groups" class="mb-4"></div> 51041 </div> 51042 </div> 51043 <div class="${noCampaignClass} campaignGroup-subscriptions"> 51044 <h5 class="business-unit-main-header">${Granite.I18n.get('myProfileCampaigns')} </h5> 51045 <div id="business_org"> 51046 <div class="campaignGroup-checkboxes"> 51047 <div id="campaign-list" class="mb-4"></div> 51048 </div> 51049 </div> 51050 </div> 51051 </div>`; 51052 51053 $('#business_org').append(html_div); 51054 $('#business_org .mySubscriptions .noCampaign').hide(); 51055 51056 51057 let title_container = document.querySelector('#buOrg-groups'); 51058 let email_container = document.querySelector('#email-groups'); 51059 let campaignContainer = document.querySelector('#campaign-list'); 51060 51061 51062 getSubscriptionTitle(subs_data, title_container); 51063 getEmailGroupsData(subs_data, email_container); 51064 Object.entries(subs_data).forEach( 51065 ([key_org, value_data]) => { 51066 if (value_data.Email_Optin.ContactId) 51067 getCampaignsGroupsData(key_org, value_data, campaignContainer, noCampaign); 51068 } 51069 ); 51070 51071 if (!$("#editForm #editMyAccountForm").is(":visible")) { 51072 $('#editForm #business_org input[type="checkbox"]').removeAttr('disabled'); 51073 } 51074 51075 let Contacts_array = [];
51076 Object.entries(subs_data).forEach( 51077 ([key_org, value_data]) => { 51078 let a = value_data['Email_Optin'].ContactId; 51079 Contacts_array.push(a); 51080 }); 51081 let is_Any_ContactExist = Contacts_array.map(item => Boolean(item)).some(item => item === true); 51082 if (!is_Any_ContactExist) { 51083 $('#editForm #optin').parents('.optin-check').show(); 51084 } 51085 51086 } 51087 51088 const getSubscriptionTitle = (subs_data, title_container) => { 51089 let subscribed_val = '(' + Granite.I18n.get('myProfileSubscribed') + ')'; 51090 let unSubscribed_val = '(' + Granite.I18n.get('myProfileUnSubscribed') + ')'; 51091 51092 Object.entries(subs_data).forEach( 51093 ([key_org, value_data]) => { 51094 if (value_data.Email_Optin.ContactId) { 51095 let org_title = key_org === 'WS' ? Granite.I18n.get('myProfileWNPAbbr') : key_org === 'MS' ? Granite.I18n.get('myProfileMNMAbbr') : key_org === 'EC' ? Granite.I18n.get('myProfileENIAbbr') : ''; 51096 let span = document.createElement('span'); 51097 span.innerText = subscribed_val; 51098 let email_status; 51099 51100 if (value_data.Email_Optin.email_status === 'Opt-in') { 51101 email_status = true; 51102 } else if (value_data.Email_Optin.email_status === 'Opt-out') { 51103 email_status = false; 51104 } else { 51105 email_status = false; 51106 } 51107 51108 if(value_data.Email_Optin.email_status == null){ 51109 value_data.Email_Optin.email_status = "Opt-out"; 51110 } 51111 51112 title_container.appendChild(createCheckBox(org_title, key_org, email_status, 'bu_name', !value_data.Email_Optin.email_status.endsWith('Opt-out'), key_org, value_data.Email_Optin.ContactId, false)); 51113 $(`#${key_org}`).parent().find('label').append(span); 51114 $(`#${key_org}`).parent().find('label span').css({ 51115 'display': 'inline-block', 51116 'padding-left': '6px', 51117 'margin-bottom': 0 51118 }); 51119 51120 51121 $('.subscriptionDetails .form-title').show(); 51122 $(`#${key_org}`).parent().show(); 51123 $('.consent-text').show(); 51124 } else { 51125 $(`#${key_org}`).parent().hide(); 51126 } 51127 } 51128 ); 51129 51130 $.each($('#buOrg-groups input[type=checkbox][name=bu_name]'), function() { 51131 if ($(this).is(':checked')) { 51132 $(this).parent().find('label span').text(subscribed_val); 51133 } else { 51134 $(this).parent().find('label span').text(unSubscribed_val); 51135 } 51136 51137 this.dataset.modified = 'initial'; 51138 }); 51139 51140 $('#buOrg-groups input[type=checkbox][name=bu_name]').change(function() { 51141 if ($(this).is(':checked')) { 51142 $(this).parent().find('label span').text(subscribed_val); 51143 } else { 51144 $(this).parent().find('label span').text(unSubscribed_val); 51145 } 51146 51147 if (this.dataset.modified === 'initial') { 51148 this.dataset.modified = 'changed'; 51149 } else { 51150 this.dataset.modified = 'initial'; 51151 } 51152 51153 }); 51154 51155 } 51156 const getEmailGroupsData = (subs_data, email_container) => { 51157 51158 let data = []; 51159 let emailGroupList = Object.values(subs_data)[0].EmailGroup.map(item => { 51160 item = { 51161 ...item, 51162 Enabled: false 51163 }; 51164 return item; 51165 }); 51166 Object.entries(subs_data).forEach( 51167 ([key_org, value_data]) => { 51168 51169 console.log('key', key_org);
51170 Array.from(value_data['EmailGroup']).forEach((item, i) => { 51171 if (item.Enabled === true && i == 0) { 51172 emailGroupList[0] = item; 51173 } 51174 if (item.Enabled === true && i == 1) { 51175 emailGroupList[1] = item; 51176 } 51177 if (item.Enabled === true && i == 2) { 51178 emailGroupList[2] = item; 51179 } 51180 }); 51181 51182 }); 51183 51184 data = emailGroupList; 51185 data.forEach((element, i) => { 51186 email_container.appendChild(createCheckBox(element.Label.substring(element.Label.indexOf('-') + 1), element.Enabled, element.Enabled, element.Label, false, 'email-group-' + i, '', false)); 51187 $(`#email-group-${i}`).parent().attr('title', emailGroupTooltip[i]); 51188 }); 51189 51190 Object.entries(subs_data).forEach( 51191 ([key_org, value_data]) => { 51192 if (value_data.Email_Optin.ContactId) { 51193 $('.subscriptionDetails .form-title').show(); 51194 $('.emailGroup-subscriptions').show(); 51195 } 51196 }); 51197 51198 $.each($('#email-groups input[type=checkbox]'), function() { 51199 this.dataset.modified = 'initial'; 51200 }); 51201 51202 $('#email-groups input[type=checkbox]').change(function() { 51203 if ($(this).is(':checked')) { 51204 $(this).val('true'); 51205 } else { 51206 $(this).val('false'); 51207 } 51208 51209 if (this.dataset.modified === 'initial') { 51210 this.dataset.modified = 'changed'; 51211 } else { 51212 this.dataset.modified = 'initial'; 51213 } 51214 }); 51215 } 51216 const getCampaignsGroupsData = (key_org, data, campaignContainer, noCampaign) => { 51217 data['Campaign Data'].forEach( 51218 (element, index) => { 51219 if (!element.Value.endsWith('Opt-Out') && !noCampaign) { 51220 $('.subscriptionDetails .form-title').show(); 51221 $(`#${key_org}`).parent().show(); 51222 $('.consent-text').show(); 51223 51224 $('.campaignGroup-subscriptions').show(); 51225 51226 campaignContainer.appendChild(createCheckBox(element.Name, element.Value, !element.Value.endsWith('Opt-Out'), element.Name, element.Value.endsWith('Opt-Out'), `${key_org}-campaign-${index}`, element.campaignId, false)); 51227 } 51228 if (data['Email_Optin'].email_status === 'Opt-in' || data['Email_Optin'].email_status === 'Opt-out') { 51229 $('.subscriptionDetails .form-title').show(); 51230 $(`#${key_org}`).parent().show(); 51231 $('.consent-text').show(); 51232 } 51233 } 51234 ); 51235 } 51236 51237 function createCheckBox(text, value, checked, name, hide, id, cId, thirdState) { 51238 var container = document.createElement('div'); 51239 container.classList.add('campaign-check') 51240 container.classList.add('cstm-check') 51241 var label = document.createElement('label'); 51242 label.innerText = text; 51243 label.htmlFor = id; 51244 if (thirdState) label.classList.add('third-state') 51245 var checkBox = document.createElement('input'); 51246 checkBox.name = name; 51247 checkBox.value = value; 51248 checkBox.type = 'checkbox'; 51249 checkBox.checked = checked; 51250 checkBox.id = id; 51251 checkBox.dataset.cId = cId; 51252 checkBox.setAttribute("disabled", true); 51253 container.appendChild(checkBox); 51254 container.appendChild(label); 51255 return container; 51256 } 51257 51258 function unSubscribe() { 51259 51260 function apiRequestSend() { 51261 let isEmailGroupChanged = Array.from($('#email-groups input[type=checkbox]').map(function() { 51262 return this.dataset.modified; 51263 })).some(item => item === 'changed'); 51264 let isMainOrgChanged; 51265 let promiseArray = []; 51266
51267 Object.entries(org_Userdata).forEach( 51268 ([key, value]) => { 51269 //let campaignSubmit_url = '/dupont/campaignDataSubmit?email=' + document.getElementById('emailsignupEdit').value + `&org=${key}`; 51270 let campaignSubmit_url = '/dupont/preferenceCenter?email=' + document.getElementById('emailsignupEdit').value + `&org=${key}`; 51271 /*if (!$(`#${key}`).prop('checked') && $(`#${key}`).data('modified') == 'changed') { 51272 unsubscription_cnt++; 51273 unsubscribe_url = key === 'WS' ? wnp_unsubscribeUrl : key == 'MS' ? mnm_unsubscribeUrl : key == 'EC' ? eni_unsubscribeUrl : '#'; 51274 $.ajax({ 51275 url: unsubscribe_url, 51276 type: "POST", 51277 success: function() { 51278 console.log(`${key} Unsubscribed All`); 51279 } 51280 }); 51281 51282 }*/ 51283 51284 { 51285 var sendData = { 51286 'Email_Optin': {}, 51287 'Campaign Data': [], 51288 "EmailGroup": [] 51289 }; 51290 51291 isMainOrgChanged = $(`#${key}`).data('modified') == 'changed'; 51292 sendData['Email_Optin']['emailAddress'] = value['Email_Optin']['emailAddress']; 51293 sendData['Email_Optin']['ContactId'] = value['Email_Optin']['ContactId'].toString(); 51294 if (!$(`#${key}`).prop('checked') && $(`#${key}`).data('modified') == 'changed') { 51295 sendData['Email_Optin']['email_status'] = ''; 51296 }else if($(`#${key}`).prop('checked') && $(`#${key}`).data('modified') == 'changed'){ 51297 sendData['Email_Optin']['email_status'] = 'Opt-in'; 51298 }else{ 51299 if(value['Email_Optin']['email_status'] == null) 51300 sendData['Email_Optin']['email_status'] = ''; 51301 else 51302 sendData['Email_Optin']['email_status'] = value['Email_Optin']['email_status']; 51303 } 51304 51305 value['Campaign Data'].forEach(function(v, i) { 51306 var el = document.getElementById(`${key}-campaign-` + i); 51307 if (el && !el.checked && !el.hasAttribute('disabled')) 51308 sendData['Campaign Data'].push({ 51309 campaignId: v.campaignId, 51310 Label: v.Name, 51311 Value: 'Opt-Out' 51312 }) 51313 }) 51314 value['EmailGroup'].forEach(function(v, i) { 51315 if (v.ContactId) { 51316 var el = document.getElementById(`email-group-` + i); 51317 if (el && !el.hasAttribute('disabled')) 51318 sendData['EmailGroup'].push({ 51319 Label: v.Label, 51320 Enabled: el.value, 51321 ContactId: v.ContactId.toString() 51322 }) 51323 } 51324 }) 51325 /*if ($(`#${key}`).prop('checked') && $(`#${key}`).data('modified') == 'changed') { 51326 isMainOrgChanged = $(`#${key}`).data('modified') == 'changed'; 51327 51328 subscribe_url = key === 'WS' ? wnp_subscribeUrl : key == 'MS' ? mnm_subscribeUrl : key == 'EC' ? eni_subscribeUrl : '#'; 51329 $.ajax({ 51330 url: subscribe_url, 51331 type: "POST", 51332 success: function() { 51333 console.log(`${key} Main Org Subscribed`); 51334 }, 51335 error: function(err) { 51336 let errorMessage = 'Some Error has been encountered while saving your Subscriptions.' 51337 alert(errorMessage); 51338 } 51339 }); 51340 51341 51342 } else { 51343 isMainOrgChanged = false;
51344 }*/ 51345 51346 if (sendData['Campaign Data'].length > 0 || (sendData['EmailGroup'].length > 0 && isEmailGroupChanged) || isMainOrgChanged) { 51347 promiseArray.push( 51348 51349 new Promise(function(resolve, reject) { 51350 $.ajax({ 51351 type: "POST", 51352 url: campaignSubmit_url, 51353 data: JSON.stringify(sendData), 51354 dataType: "json", 51355 contentType: "application/json", 51356 cache: false, 51357 51358 success: function(msg) { 51359 let SuccessStatus; 51360 51361 console.log(`Success Sec:${key}`, msg); 51362 if (Object.keys(msg).length > 0){ 51363 //SuccessStatus = Object.values(msg).map(item => item.status_code).every(item => item === 200); 51364 SuccessStatus = msg.statusCode === 200; 51365 } 51366 51367 if (SuccessStatus) { 51368 unsubscription_cnt++; 51369 console.log('response', msg); 51370 resolve(`Success Status:${key}`, msg); 51371 } else { 51372 console.log('Failure Status', msg); 51373 reject(`${key}`, 'Fail'); 51374 } 51375 51376 }, 51377 error: function(err) { 51378 reject('Connection Error', err); 51379 console.log('Error Response', err); 51380 51381 } 51382 }); 51383 }) 51384 51385 51386 ); 51387 } 51388 } 51389 51390 } 51391 ); 51392 51393 return Promise.allSettled(promiseArray); 51394 51395 } 51396 51397 apiRequestSend().then(result => { 51398 console.log('PomiseArrayResult', result); 51399 let errorMessage = 'Some Error has been encountered while saving your email groups and campaign preferences data.' 51400 let UnsubscriptionResult = result.map(({ 51401 status 51402 }) => status).some(item => item == 'rejected'); 51403 51404 if (unsubscription_cnt == 0) { 51405 51406 setTimeout(function() { 51407 $('#accountSuccuessPop').show(); 51408 $('html').addClass('modal-open'); 51409 if (result.length > 0) { 51410 alert(errorMessage); 51411 } 51412 51413 }, 2000) 51414 } else { 51415 51416 setTimeout(function() { 51417 if (UnsubscriptionResult) { 51418 alert(errorMessage); 51419 $('#accountSuccuessPop').show(); 51420 $('html').addClass('modal-open'); 51421 } else { 51422 $('#accountSuccuessPop .unsubscribeMsg').show(); 51423 $('#accountSuccuessPop').show(); 51424 $('html').addClass('modal-open'); 51425 } 51426 }, 2000) 51427 51428 } 51429 51430 }) 51431 .catch(error => console.log('API Request Error', error)); 51432 } 51433 51434 51435 var flag = 1; 51436 var phoneno = /^(?=.*?[0-9])[0-9+()-]+$/; 51437 51438 if ($("#countryEdit").length != 0) { 51439 select = $("#countryEdit").selectize(); 51440 selectize = select[0].selectize; 51441 selectize.setValue($("#countryEdit").attr('data-country')); 51442 selectize.disable(); 51443 setTimeout(function() { 51444 $("#countryEdit").trigger('change'); 51445 }, 200); 51446 } 51447 51448 if ($("#countrySignUp").length != 0) { 51449 selectSignup = $("#countrySignUp").selectize(); 51450 selectizeSignup = selectSignup[0].selectize; 51451 selectizeSignup.disable(); 51452 } 51453 51454 if ($("#companySizeSignUpEdit").length != 0) { 51455 selectCompanySize = $("#companySizeSignUpEdit").selectize(); 51456 selectizeCompanySize = selectCompanySize[0].selectize; 51457 selectizeCompanySize.setValue($("#companySizeSignUpEdit").attr('data-companysize')); 51458 selectizeCompanySize.disable(); 51459 } 51460 51461 if ($("#companySizeSignUp").length != 0) { 51462 selectCompanySizeSignup = $("#companySizeSignUp").selectize(); 51463 selectizeCompanySizeSignup = selectCompanySizeSignup[0].selectize; 51464 selectizeCompanySizeSignup.disable(); 51465 51466 } 51467 51468 if ($("#stateSignUpEdit").length != 0) { 51469 selectState = $("#stateSignUpEdit").selectize(); 51470 selectizeState = selectState[0].selectize; 51471 selectizeState.setValue($("#stateSignUpEdit").attr('data-state')); 51472 selectizeState.disable(); 51473 } 51474 51475 if ($("#stateSignUp").length != 0) { 51476 selectStateSignup = $("#stateSignUp").selectize(); 51477 selectizeStateSignup = selectStateSignup[0].selectize; 51478 selectizeStateSignup.disable(); 51479 } 51480 51481 if ($("#industrySignUpEdit").length != 0) { 51482 selectIndustry = $("#industrySignUpEdit").selectize(); 51483 selectizeIndustry = selectIndustry[0].selectize; 51484 selectizeIndustry.setValue($("#industrySignUpEdit").attr('data-industry')); 51485 selectizeIndustry.disable(); 51486 } 51487 51488 if ($("#industrySignUp").length != 0) { 51489 selectIndustrySignup = $("#industrySignUp").selectize(); 51490 selectizeIndustrySignup = selectIndustrySignup[0].selectize; 51491 selectizeIndustrySignup.disable(); 51492 } 51493 51494 if ($("#jobfunctionSignUpEdit").length != 0) { 51495 selectJobFunction = $("#jobfunctionSignUpEdit").selectize(); 51496 selectizeJobFunction = selectJobFunction[0].selectize; 51497 selectizeJobFunction.setValue($("#jobfunctionSignUpEdit").attr('data-jobfunction')); 51498 selectizeJobFunction.disable(); 51499 } 51500 51501 if ($("#jobfunctionSignUp").length != 0) { 51502 selectJobFunctionSignup = $("#jobfunctionSignUp").selectize(); 51503 selectizeJobFunctionSignup = selectJobFunctionSignup[0].selectize; 51504 selectizeJobFunctionSignup.disable(); 51505 } 51506 51507 if ($("#roleSignUpEdit").length != 0) { 51508 selectRole = $("#roleSignUpEdit").selectize(); 51509 selectizeRole = selectRole[0].selectize; 51510 selectizeRole.setValue($("#roleSignUpEdit").attr('data-role')); 51511 selectizeRole.disable(); 51512 } 51513 51514 if ($("#roleSignUp").length != 0) { 51515 selectRoleSignup = $("#roleSignUp").selectize(); 51516 selectizeRoleSignup = selectRoleSignup[0].selectize; 51517 selectizeRoleSignup.disable(); 51518 } 51519 51520 function check_spam(className) { 51521 51522 var red_elems = document.getElementsByClassName(className); 51523 var spam = false;
51524 51525 for (var i = 0; i < red_elems.length; i++) { 51526 51527 if (spam) 51528 break; 51529 51530 var input_type = red_elems[i].type; 51531 51532 switch (input_type) { 51533 51534 case "checkbox": 51535 if (red_elems[i].value != "1") 51536 spam = true; 51537 break; 51538 51539 case "text": 51540 if (red_elems[i].value != "nan") 51541 spam = true; 51542 break; 51543 51544 case "email": 51545 if (red_elems[i].value != "[email protected]") 51546 spam = true; 51547 break; 51548 51549 case "password": 51550 if (red_elems[i].value != "nan") 51551 spam = true; 51552 break; 51553 51554 default: 51555 console.log("not defined case"); 51556 console.log(input_type); 51557 } 51558 51559 } 51560 51561 return spam; 51562 } 51563 51564 51565 function BuMapping(buName) { 51566 let org; 51567 if (buName) { 51568 if (buName.indexOf('water') > -1) { 51569 org = 'PS'; 51570 } else if (buName.indexOf('building') > -1 || buName.indexOf('pbs') > -1) { 51571 org = 'PS'; 51572 } else if (buName.indexOf('transportation') > -1 || buName.indexOf('tni') > -1 || buName.indexOf('tnap') > -1 || buName.indexOf('mobility') > -1) { 51573 org = 'MS'; 51574 } else if (buName.indexOf('electronic') > -1 || buName.indexOf('eni') > -1) { 51575 org = 'EC'; 51576 } else if (buName == 'safety') { 51577 org = 'PS'; 51578 } else if (buName == 'snc' || buName == 'safetyandconstruction') { 51579 org = 'PS'; 51580 } else if (buName == 'ppe') { 51581 org = 'PS'; 51582 } else if (buName == 'greatstuff') { 51583 org = 'PS'; 51584 } else if (buName == 'life-protection') { 51585 org = 'PS'; 51586 } else if (buName == 'corian') { 51587 org = 'PS'; 51588 } else if (buName == 'healthcare') { 51589 org = 'PS'; 51590 } 51591 } 51592 51593 51594 console.log(org); 51595 return org 51596 } 51597 51598 function validateEmail(org) { 51599 let pass = $("#signupForm").attr('data-skey'); 51600 $('#signupForm input[type="text"]').attr('readonly', 'readonly'); 51601 $('#signupForm input[type="checkbox"]').attr('disabled', 'disabled'); 51602 selectizeSignup.disable(); 51603 if (selectizeCompanySizeSignup) { 51604 selectizeCompanySizeSignup.disable(); 51605 } 51606 if (selectizeStateSignup) { 51607 selectizeStateSignup.disable(); 51608 } 51609 if (selectizeIndustrySignup) { 51610 selectizeIndustrySignup.disable(); 51611 } 51612 if (selectizeJobFunctionSignup) { 51613 selectizeJobFunctionSignup.disable(); 51614 } 51615 if (selectizeRoleSignup) { 51616 selectizeRoleSignup.disable(); 51617 } 51618 51619 let email_id = $('#emailsignup') ? $('#emailsignup').val() : ''; 51620 let sfdc_lookupUrl = '/dupont/userLookUpData'; 51621 51622 if (org) { 51623 let sfdc_db = org; 51624 let url = `${sfdc_lookupUrl}?email=${email_id}&org=${sfdc_db}&itemlistname=signup-form`; 51625 51626 let user_bu_data = new Promise(function(resolve, reject) { 51627 fetch(url, { 51628 cache: "no-cache" 51629 }) 51630 .then(res => { 51631 if (res.ok) 51632 return res.text(); 51633 else 51634 reject(res.status); 51635 }) 51636 .then(data => resolve(JSON.parse(eJsObj.decrypt(pass, data)))) 51637 .catch(error => { 51638 reject(error); 51639 }); 51640 }); 51641 51642 user_bu_data.then( 51643 function(user_bu_data) { 51644 if (user_bu_data.EmailAddress) { 51645 userDataFromBU = user_bu_data; 51646 setContent(userDataFromBU); 51647 userFieldsEnabled(); 51648 } else { 51649 userDataFromBU = {}; 51650 setContent(userDataFromBU); 51651 userFieldsEnabled(); 51652 } 51653 }).catch(error => { 51654 console.log('BU Parameter data fetch error :', error); 51655 userDataFromBU = {}; 51656 setContent(userDataFromBU); 51657 userFieldsEnabled(); 51658 }); 51659 51660 51661 } else { 51662 let url = `${sfdc_lookupUrl}?email=${email_id}&org=`; 51663 let wnp_url = url + 'PS' + '&itemlistname=signup-form'; 51664 let eni_url = url + 'EC' + '&itemlistname=signup-form'; 51665 let mnm_url = url + 'MS' + '&itemlistname=signup-form'; 51666 51667 let wnp = new Promise(function(resolve, reject) { 51668 fetch(wnp_url, { 51669 cache: "no-cache" 51670 }) 51671 .then(res => { 51672 if (res.ok) 51673 return res.text(); 51674 else 51675 reject(res.status); 51676 }) 51677 .then(data => resolve(JSON.parse(eJsObj.decrypt(pass, data)))) 51678 .catch(error => { 51679 reject(error); 51680 }); 51681 }); 51682 51683 wnp.then( 51684 function(wnp_data) { 51685 if (wnp_data.EmailAddress) { 51686 userDataFromBU = wnp_data; 51687 setContent(userDataFromBU); 51688 userFieldsEnabled(); 51689 } else { 51690 let eni = new Promise(function(resolve, reject) { 51691 fetch(eni_url, { 51692 cache: "no-cache" 51693 }) 51694 .then(res => { 51695 if (res.ok) 51696 return res.text(); 51697 else 51698 reject(res.status); 51699 }) 51700 .then(data => resolve(JSON.parse(eJsObj.decrypt(pass, data)))) 51701 .catch(error => { 51702 reject(error); 51703 }); 51704 }); 51705 eni.then( 51706 function(eni_data) { 51707 if (eni_data.EmailAddress) { 51708 userDataFromBU = eni_data; 51709 setContent(userDataFromBU); 51710 userFieldsEnabled(); 51711 } else { 51712 let mnm = new Promise(function(resolve, reject) { 51713 fetch(mnm_url, { 51714 cache: "no-cache" 51715 }) 51716 .then(res => { 51717 if (res.ok) 51718 return res.text(); 51719 else 51720 reject(res.status); 51721 }) 51722 .then(data => resolve(JSON.parse(eJsObj.decrypt(pass, data)))) 51723 .catch(error => { 51724 reject(error); 51725 }); 51726 }); 51727 mnm.then(
51728 function(mnm_data) { 51729 if (mnm_data.EmailAddress) { 51730 userDataFromBU = mnm_data; 51731 setContent(userDataFromBU); 51732 userFieldsEnabled(); 51733 } else { 51734 userDataFromBU = {}; 51735 setContent(userDataFromBU); 51736 userFieldsEnabled(); 51737 } 51738 } 51739 ).catch(error => { 51740 console.log('Mobility & Materials data fetch error :', error); 51741 userDataFromBU = {}; 51742 setContent(userDataFromBU); 51743 userFieldsEnabled(); 51744 }); 51745 } 51746 } 51747 ).catch(error => { 51748 console.log('Electronics & Industries data fetch error :', error); 51749 userDataFromBU = {}; 51750 setContent(userDataFromBU); 51751 userFieldsEnabled(); 51752 }); 51753 } 51754 } 51755 ).catch(error => { 51756 console.log('Water & Protection data fetch error :', error); 51757 userDataFromBU = {}; 51758 setContent(userDataFromBU); 51759 userFieldsEnabled(); 51760 }); 51761 } 51762 51763 } 51764 51765 function setContent(user_data) { 51766 51767 if ($.isEmptyObject(user_data)) { 51768 $('#signupForm .auth-msg').addClass('d-none'); 51769 $("#signupForm #firstname").parents('.formgroup-signup').parent().show(); 51770 $("#signupForm #lastname").parents('.formgroup-signup').parent().show(); 51771 $("#signupForm #companySignup").parents('.formgroup-signup').parent().show(); 51772 $("#signupForm #industrySignUp").parents('.formgroup-signup').parent().show(); 51773 $("#signupForm #address").parents('.formgroup-signup').parent().show(); 51774 $("#signupForm #countrySignUp").parents('.formgroup-signup').parent().show(); 51775 $("#signupForm #city").parents('.formgroup-signup').parent().show(); 51776 $("#signupForm #zipCode").parents('.formgroup-signup').parent().show(); 51777 $("#signupForm #phoneSignup").parents('.formgroup-signup').parent().show(); 51778 $("#signupForm #jobfunctionSignUp").parents('.formgroup-signup').parent().show(); 51779 $("#signupForm #roleSignUp").parents('.formgroup-signup').parent().show(); 51780 $("#signupForm #companySizeSignUp").parents('.formgroup-signup').parent().show(); 51781 $("#signupForm #optin").parents('.formgroup-signup').show(); 51782 51783 $("#signupForm #firstname").focus(); 51784 } else { 51785 51786 user_data.C_FirstName ? $("#firstname").parents('.formgroup-signup').parent().hide() : $("#firstname").parents('.formgroup-signup').parent().show(); 51787 user_data.C_LastName ? $("#lastname").parents('.formgroup-signup').parent().hide() : $("#lastname").parents('.formgroup-signup').parent().show(); 51788 user_data.C_Company ? $("#companySignup").parents('.formgroup-signup').parent().hide() : $("#companySignup").parents('.formgroup-signup').parent().show(); 51789 user_data.C_Industry1 ? $("#industrySignUp").parents('.formgroup-signup').parent().hide() : $("#industrySignUp").parents('.formgroup-signup').parent().show(); 51790 user_data.C_Address1 ? $("#address").parents('.formgroup-signup').parent().hide() : $("#address").parents('.formgroup-signup').parent().show(); 51791 user_data.C_Lead_Country1 ? $("#countrySignUp").parents('.formgroup-signup').parent().hide() : $("#countrySignUp").parents('.formgroup-signup').parent().show(); 51792 user_data.C_Mailing_City1 ? $("#city").parents('.formgroup-signup').parent().hide() : $("#city").parents('.formgroup-signup').parent().show(); 51793 51794 if (user_data.C_Lead_Country1) { 51795 if (user_data.C_Lead_Country1.toLowerCase() == 'united states') 51796 user_data.C_Mailing_State_Province1 ? $("#stateSignUp").parents('.formgroup-signup').parent().hide() : $("#stateSignUp").parents('.formgroup-signup').parent().show(); 51797 } 51798 51799 user_data.C_Mailing_Zip_Postal_Code1 ? $("#zipCode").parents('.formgroup-signup').parent().hide() : $("#zipCode").parents('.formgroup-signup').parent().show(); 51800 user_data.C_BusPhone ? $("#phoneSignup").parents('.formgroup-signup').parent().hide() : $("#phoneSignup").parents('.formgroup-signup').parent().show(); 51801 user_data.C_Job_Function1 ? $("#jobfunctionSignUp").parents('.formgroup-signup').parent().hide() : $("#jobfunctionSignUp").parents('.formgroup-signup').parent().show(); 51802 user_data.C_Role1 ? $("#roleSignUp").parents('.formgroup-signup').parent().hide() : $("#roleSignUp").parents('.formgroup-signup').parent().show(); 51803 51804 user_data.C_Company_Size1 ? $("#companySizeSignUp").parents('.formgroup-signup').parent().hide() : $("#companySizeSignUp").parents('.formgroup-signup').parent().show(); 51805 51806 $('#signupForm .auth-msg').show(); 51807 } 51808 51809 } 51810 51811 function userFieldsEnabled() { 51812 $("#emailsignup").closest('.customFieldset').find('span.errormessage ').hide(); 51813 $(".requireField#emailsignup").removeClass("requireFieldBorder"); 51814 $("#signUpSubmit").removeAttr('disabled'); 51815 $('#signupForm input[type="text"]').removeAttr('readonly'); 51816 $('#signupForm input[type="checkbox"]').removeAttr(' disabled'); 51817 selectizeSignup.enable(); 51818 51819 if (selectizeCompanySizeSignup) { 51820 selectizeCompanySizeSignup.enable(); 51821 } 51822 if (selectizeStateSignup) { 51823 selectizeStateSignup.enable(); 51824 } 51825 if (selectizeIndustrySignup) { 51826 selectizeIndustrySignup.enable(); 51827 } 51828 if (selectizeJobFunctionSignup) { 51829 selectizeJobFunctionSignup.enable(); 51830 } 51831 if (selectizeRoleSignup) { 51832 selectizeRoleSignup.enable(); 51833 } 51834 51835 $('.emailLoader').addClass('tickMark').show(); 51836 resourcePremiumCheck('signup'); 51837 } 51838 51839 51840 $("#signUpSubmit").on("click", function(event) { 51841 event.preventDefault(); 51842 var marketingId = window._satellite && window._satellite.getVisitorId && window._satellite.getVisitorId().getMarketingCloudVisitorID && _satellite.getVisitorId().getMarketingCloudVisitorID(); 51843 if (!marketingId) marketingId = "0000-0000-0000"; 51844 51845 if (check_spam('redundant')) { 51846 marketingId = marketingId + "----spam detected"; 51847 console.log("spam detected"); 51848 } 51849 $('.signUpForm input[name=Web_Visitor_ID]').attr('value', marketingId); 51850 $("form select.requireField,form input.requireField,form textarea.requireField").each(function(index) { 51851 51852 if (!$(this).val() || $(this).val() == "Select_Country" || ($(this).val() == "Select_State" && $('#countrySignUp').val() === "US") || $(this).val() == "Select_Industry" || $(this).val() == "Select_Job_Function" || $(this).val() == "Select_Role") { 51853 51854 $(this).closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 51855 $(this).closest('.customFieldset').find('span.errormessage').show(); 51856 $(this).closest('.requireField').addClass("requireFieldBorder"); 51857 flag = 0; 51858 51859 51860 } else { 51861 51862 $(this).closest('.customFieldset').find('span.errormessage').removeClass("requiredtext_form"); 51863 $(this).closest('.customFieldset').find('span.errormessage').hide(); 51864 51865 $(this).closest('.requireField').removeClass("requireFieldBorder"); 51866 } 51867 }); 51868 51869 51870 //var phoneno = /^[0-9]*(?:\.\d{1,2})?$/; 51871 if ($("#phoneSignup").length) { 51872 51873 if (!$(".requireField#phoneSignup").val() || !$(".requireField#phoneSignup").val().trim().match(phoneno)) { 51874 51875 $(".requireField#phoneSignup").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 51876 $(".requireField#phoneSignup").closest('.customFieldset').find('span.errormessage').show(); 51877 $(".requireField#phoneSignup").addClass("requireFieldBorder"); 51878 51879 flag = 0; 51880 51881 } else { 51882 $(".requireField#phoneSignup").closest('.customFieldset').find('span.errormessage').hide(); 51883 $(".requireField#phoneSignup").removeClass("requireFieldBorder"); 51884 } 51885 } 51886 51887 if ($("#zipCode").length) { 51888 51889 if (!$(".requireField#zipCode").val()) { 51890 51891 $(".requireField#zipCode").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 51892 $(".requireField#zipCode").closest('.customFieldset').find('span.errormessage').show(); 51893 $(".requireField#zipCode").addClass("requireFieldBorder"); 51894 51895 flag = 0; 51896 51897 } else { 51898 $(".requireField#zipCode").closest('.customFieldset').find('span.errormessage').hide(); 51899 $(".requireField#zipCode").removeClass("requireFieldBorder"); 51900 51901 51902 } 51903 } 51904 51905 if ($("#emailsignup").length) { 51906 51907 var patternEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 51908 51909 if ($(".requireField#emailsignup").length && !$(".requireField#emailsignup").val().match(patternEmail)) { 51910 51911 $(".requireField#emailsignup").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 51912 $(".requireField#emailsignup").closest('.customFieldset').find('span.errormessage').show(); 51913 $(".requireField#emailsignup").addClass("requireFieldBorder"); 51914 51915 flag = 0; 51916 51917 } 51918 } else { 51919 $("#emailsignup").closest('.customFieldset').find('span.errormessage ').hide(); 51920 $(".requireField#emailsignup").removeClass("requireFieldBorder"); 51921 } 51922 51923 if ($("#g-recaptcha-response").val() == "") { 51924 $("#recapthaHolder span.errormessage").show(); 51925 } else { 51926 $("#recapthaHolder span.errormessage").hide(); 51927 } 51928 if (!$("#g-recaptcha-response").length) { 51929 $(".errormessagerec").show(); 51930 $(".errormessagerec").text("Recaptcha is mandatory"); 51931 } else { 51932 $(".errormessagerec").hide(); 51933 } 51934 51935 if ($('.business-unit-start').children().length > 0) { 51936 $("#buListHeading").show(); 51937 if ($('#business-unit-selection input:checked').length == 0) { 51938 $("#buListHeading span.errormessage").show(); 51939 } else { 51940 $("#buListHeading span.errormessage").hide(); 51941 } 51942 } else { 51943 $("#buListHeading").hide(); 51944 } 51945 51946 if ($(".errormessage").is(":visible")) { 51947 console.log("form error message"); 51948 var firstErrorElement = $('.errormessage.required:visible')[0]; 51949 var firstErrorTop = $(firstErrorElement).offset().top - 170; 51950 window.scrollTo(0, firstErrorTop); 51951 51952 // Adobe Analytics 51953 const errElements = [ 51954 ...document.getElementsByClassName("errormessage"), 51955 ].filter((errEl) => errEl.offsetParent != null); 51956 const satelliteLoaded = typeof _satellite != "undefined"; 51957 if (errElements.length) { 51958 if (digitalData && digitalData.form) 51959 digitalData.form.formError = errElements 51960 .map((errEl) => 51961 errEl 51962 .closest(".form-group") 51963 ?.querySelector("[name]") 51964 ?.getAttribute("name") 51965 ) 51966 ?.join(","); 51967 if (satelliteLoaded) _satellite.track("formerror"); 51968 } 51969 // 51970 51971 51972 return; 51973 51974 } else { 51975 51976 51977 51978 buList = ''; 51979 var bu = $('#business-unit-selection input[name=business-unit]:checked'); 51980 for (var i = 0; i < bu.length; i++) { 51981 buList += bu[i].value + ';'; 51982 } 51983 if (buList.length > 0) { 51984 buList = buList.slice(0); 51985 } 51986 51987 /* var buHiddenFieldsContainers = document.querySelectorAll("[data-buname]"); 51988 var allHiddenFields = [];
51989 buHiddenFieldsContainers.forEach(function (bu) { 51990 var buData = { 51991 buName: bu.dataset.buname 51992 }; 51993 buData[bu.dataset.buname] = [] 51994 bu.querySelectorAll("input[type=hidden]").forEach(function(input) { 51995 buData[bu.dataset.buname].push({ 51996 hiddenname: input.name, 51997 hiddenvalue: input.value, 51998 }); 51999 }); 52000 allHiddenFields.push(buData); 52001 }); 52002 allHiddenFields = JSON.stringify(allHiddenFields); */ 52003 52004 $('#signupAlert').removeClass('show').addClass('hide'); 52005 52006 /* var waterHiddenInputs = $('input[value="Water Solutions"]')[0].checked ? 52007 (function(){ 52008 var hiddenInputs = ''; 52009 $('.water-hidden-field').each(function(){ 52010 hiddenInputs = hiddenInputs + '&' + $(this).attr('name') + '=' + $(this).val() 52011 }) 52012 return hiddenInputs; 52013 })() : ""; */ 52014 52015 var stateVal = $('#stateSignUp').val(); 52016 var companySizeVal = $('#companySizeSignUp').val(); 52017 let countriesJsonData = countryNameAbbr_json; 52018 let country_name = userDataFromBU.C_Lead_Country1 ? userDataFromBU.C_Lead_Country1 : ''; 52019 52020 const getCountryAbbr = (countries_Json, countryName) => { 52021 let country_abbr; 52022 countries_Json.forEach(element => { 52023 if (element.country.toLowerCase() === countryName.toLowerCase()) { 52024 country_abbr = element.abbreviation; 52025 } 52026 }); 52027 return country_abbr; 52028 }; 52029 52030 let country_abbr = getCountryAbbr(countriesJsonData, country_name); 52031 52032 52033 52034 52035 var formData = { 52036 'firstName': userDataFromBU.C_FirstName ? userDataFromBU.C_FirstName : $('#firstname').val(), 52037 'lastName': userDataFromBU.C_LastName ? userDataFromBU.C_LastName : $('#lastname').val(), 52038 'Email': $('#emailsignup').val(), 52039 'CompanyName': userDataFromBU.C_Company ? userDataFromBU.C_Company : $('#companySignup').val(), 52040 'Phone': userDataFromBU.C_BusPhone ? userDataFromBU.C_BusPhone : $('#phoneSignup').val(), 52041 'Country': userDataFromBU.C_Lead_Country1 ? (Boolean(country_abbr) ? country_abbr : null) : $('#countrySignUp').val(), 52042 'zip': userDataFromBU.C_Mailing_Zip_Postal_Code1 ? userDataFromBU.C_Mailing_Zip_Postal_Code1 : $('#zipCode').val(), 52043 'industry': userDataFromBU.C_Industry1 ? userDataFromBU.C_Industry1 : $('#industrySignUp').val(), 52044 'jobfunction': userDataFromBU.C_Job_Function1 ? userDataFromBU.C_Job_Function1 : $('#jobfunctionSignUp').val(), 52045 'role': userDataFromBU.C_Role1 ? userDataFromBU.C_Role1 : $('#roleSignUp').val(), 52046 'ExternalApps': buList, 52047 'currentresoure': $('.currentresource').val(), 52048 'Web_Visitor_ID': $('#Web_Visitor_ID').val(), 52049 //'optin': userDataFromBU.C_Email_Opt_Status1 ? userDataFromBU.C_Email_Opt_Status1 : $('#optin').val(), 52050 'optin': $('#optin').val(), 52051 'wp_access_application_optin': $('#wp_access_application_optin').val() 52052 }; 52053 52054 52055 if (userDataFromBU.C_Company_Size1) { 52056 formData['companysize'] = userDataFromBU.C_Company_Size1; 52057 } else if ((companySizeVal) && (companySizeVal !== "Select_Company_Size")) { 52058 formData['companysize'] = companySizeVal; 52059 } 52060 52061 if (userDataFromBU.C_Mailing_State_Province1) { 52062 formData['state'] = userDataFromBU.C_Mailing_State_Province1; 52063 } else if ((stateVal) && (stateVal !== "Select_State")) { 52064 formData['state'] = stateVal; 52065 } 52066 52067 if (userDataFromBU.C_Mailing_City1) { 52068 formData['city'] = userDataFromBU.C_Mailing_City1; 52069 } else if ($('#city').val()) { 52070 formData['city'] = $('#city').val(); 52071 } 52072 52073 if (userDataFromBU.C_Address1) {
52074 formData['address'] = userDataFromBU.C_Address1; 52075 } else if ($('#address').val()) { 52076 formData['address'] = $('#address').val(); 52077 } 52078 formData['g-recaptcha-response'] = $('#g-recaptcha-response').val(); 52079 $.ajax({ 52080 type: "POST", 52081 url: targetURL, 52082 data: formData, 52083 dataType: "json", 52084 encode: true, 52085 52086 success: function(msg) { 52087 //console.log(msg); 52088 if (msg.SuccessStatus == 1) { 52089 52090 const satelliteLoaded = typeof _satellite != "undefined"; 52091 if (satelliteLoaded) { 52092 if (digitalData && digitalData.form) { 52093 digitalData.form.formPlatform = "Sales Force"; 52094 digitalData.form.submit = document.getElementById('signUpSubmit').innerHTML; 52095 } 52096 _satellite.track("formend"); 52097 } 52098 52099 if (signupsuccessURL !== undefined) { 52100 window.location.href = signupsuccessURL + ".html"; 52101 } else { 52102 52103 window.location.href = succesURL; 52104 } 52105 } else if (msg.SuccessStatus == 0) { 52106 window.location.href = errorURL; 52107 } 52108 52109 }, 52110 complete: function(msg) {}, 52111 /* error:function(XMLHttpRequest, Error,msg)*/ 52112 error: function(data) { 52113 $('#signupAlert').removeClass('hide').addClass('show'); 52114 } 52115 }); 52116 } 52117 52118 }); 52119 52120 $("#countrySignUp").on('change', function() { 52121 if ($('#countrySignUp').val() === "US") { 52122 $('#stateSignUp').parents('.state-signup').show(); 52123 } else { 52124 $('#stateSignUp').parents('.state-signup').hide(); 52125 52126 } 52127 }); 52128 52129 $("#countryEdit").on('change', function() { 52130 if ($('#countryEdit').val() === "US") { 52131 $('#stateSignUpEdit').parents('.state-signupedit').show(); 52132 } else { 52133 $('#stateSignUpEdit').parents('.state-signupedit').hide(); 52134 52135 } 52136 }); 52137 52138 $('.signupEmail#emailsignup').blur(function() { 52139 console.log("blur initated"); 52140 var pattern = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 52141 if ($("#emailsignup.requireField").length) { 52142 52143 console.log("Required"); 52144 if ($(".requireField#emailsignup").length && !$(".requireField#emailsignup").val().match(pattern)) { 52145 console.log("pattern match"); 52146 $(".requireField#emailsignup").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 52147 $(".requireField#emailsignup").closest('.customFieldset').find('span.errormessage').show(); 52148 $(".requireField#emailsignup").addClass("requireFieldBorder"); 52149 $('#signupForm input[type="text"]').attr('readonly', 'readonly'); 52150 $('#signupForm input[type="checkbox"]').attr('disabled', 'disabled'); 52151 selectizeSignup.disable(); 52152 if (selectizeCompanySizeSignup) { 52153 selectizeCompanySizeSignup.disable(); 52154 } 52155 if (selectizeStateSignup) { 52156 selectizeStateSignup.disable(); 52157 } 52158 if (selectizeIndustrySignup) { 52159 selectizeIndustrySignup.disable(); 52160 } 52161 if (selectizeJobFunctionSignup) { 52162 selectizeJobFunctionSignup.disable(); 52163 } 52164 if (selectizeRoleSignup) { 52165 selectizeRoleSignup.disable(); 52166 } 52167 52168 $('.emailLoader').removeClass('tickMark').hide(); 52169 52170 flag = 0; 52171 52172 } else { 52173 console.log("Not Required"); 52174 $('.emailLoader').removeClass('tickMark').show(); 52175 52176 $.ajax({ 52177 type: "GET", 52178 cache: false, 52179 url: validateEmailURL, 52180 data: 'Email=' + $('#emailsignup').val() + '¤tresoure=' + $('.currentresource').val(), 52181 dataType: "json", 52182 contentType: "application/json", 52183 52184 success: function(msg) { 52185 //alert('success------->' + msg.SuccessStatus) 52186 if (msg.SuccessStatus == 1) { 52187 $(".requireField#emailsignup").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 52188 $(".requireField#emailsignup").closest('.customFieldset').find('span.errormessage').html('<span>' + dupUserText + ' <a href="' + signInLink + '.html#ret-page-url=' + encodeURIComponent(window.location.href) + '">' + dupUserBtnText + '.</a></span>'); 52189 $(".requireField#emailsignup").closest('.customFieldset').find('span.errormessage').show(); 52190 $(".requireField#emailsignup").addClass("requireFieldBorder"); 52191 $("#signUpSubmit").attr('disabled', 'disabled'); 52192 $('.emailLoader').hide(); 52193 $('#signupForm input[type="text"]').attr('readonly', 'readonly'); 52194 $('#signupForm input[type="checkbox"]').attr('disabled', 'disabled'); 52195 selectizeSignup.disable(); 52196 52197 if (selectizeCompanySizeSignup) { 52198 selectizeCompanySizeSignup.disable(); 52199 } 52200 if (selectizeStateSignup) { 52201 selectizeStateSignup.disable(); 52202 } 52203 if (selectizeIndustrySignup) { 52204 selectizeIndustrySignup.disable(); 52205 } 52206 if (selectizeJobFunctionSignup) { 52207 selectizeJobFunctionSignup.disable(); 52208 } 52209 if (selectizeRoleSignup) { 52210 selectizeRoleSignup.disable(); 52211 } 52212 52213 var firstErrorElement = $('.errormessage.required:visible')[0]; 52214 var firstErrorTop = $(firstErrorElement).offset().top - 170; 52215 window.scrollTo(0, firstErrorTop); 52216 52217 } else { 52218 let buName_bu = getUrlParamSF('BU', undefined); 52219 let org_name = BuMapping(buName_bu); 52220 validateEmail(org_name); 52221 52222 resourcePremiumCheck('signup'); 52223 } 52224 52225 52226 }, 52227 52228 error: function(data) { 52229 //alert(data.SuccessStatus + '--------> error'); 52230 $('.emailLoader').hide(); 52231 } 52232 }); 52233 } 52234 } 52235 }); 52236 52237 //edit icon click event to enable the my account form 52238 52239 $('#editMyAccountForm').click(function() { 52240 selectize.enable(); 52241 52242 if (selectizeCompanySize) { 52243 selectizeCompanySize.enable(); 52244 } 52245 if (selectizeState) { 52246 selectizeState.enable(); 52247 } 52248 if (selectizeIndustry) { 52249 selectizeIndustry.enable(); 52250 } 52251 if (selectizeJobFunction) { 52252 selectizeJobFunction.enable(); 52253 } 52254 if (selectizeRole) { 52255 selectizeRole.enable(); 52256 } 52257 52258 $('#editForm input[type="text"]').removeAttr('readonly'); 52259 $('#companyEdit').attr('readonly', 'readonly'); 52260 $('#editForm input[type="checkbox"]:not(:checked)').removeAttr(' disabled'); 52261 52262 $('#editForm #business_org input[type="checkbox"]:checked').removeAttr('disabled'); 52263 //$('#editForm #business_org input[type="checkbox"]:not(:checked)').attr('disabled','true'); 52264 52265 52266 $('#editMyAccountForm').hide(); 52267 $('.signupbtns').show(); 52268 $('#myAccountDesc').hide(); 52269 optincheck(); 52270 resourcePremiumCheck('edit'); 52271 }); 52272 52273 $('#editCancel , #popCancel').click(function(e) { 52274 e.preventDefault(); 52275 location.reload(); 52276 }); 52277 52278 //myAccount submit validations and service call 52279 52280 $("#signUpEditSubmit").on("click", function(event) { 52281 52282 event.preventDefault(); 52283 52284 var marketingId = window._satellite && window._satellite.getVisitorId && window._satellite.getVisitorId().getMarketingCloudVisitorID && _satellite.getVisitorId().getMarketingCloudVisitorID(); 52285 if (!marketingId) marketingId = "0000-0000-0000"; 52286 if (check_spam('redundant')) { 52287 marketingId = marketingId + "----spam detected"; 52288 console.log("spam detected"); 52289 } 52290 $('.signUpForm input[name=Web_Visitor_ID]').attr('value', marketingId); 52291 52292 $("form select.requireField,form input.requireField,form textarea.requireField").each(function(index) { 52293 52294 //if (!$(this).val() || $(this).val() == "-Select-") { 52295 52296 if (!$(this).val() || $(this).val() == "Select_Country" || ($(this).val() == "Select_State" && $('#countryEdit').val() === "US") || $(this).val() == "Select_Industry" || $(this).val() == "Select_Job_Function" || $(this).val() == "Select_Role") { 52297 52298 $(this).closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 52299 $(this).closest('.customFieldset').find('span.errormessage').show(); 52300 $(this).closest('.requireField').addClass("requireFieldBorder"); 52301 flag = 0; 52302 52303 52304 } else { 52305 52306 $(this).closest('.customFieldset').find('span.errormessage').removeClass("requiredtext_form"); 52307 $(this).closest('.customFieldset').find('span.errormessage').hide(); 52308 52309 $(this).closest('.requireField').removeClass("requireFieldBorder"); 52310 52311 } 52312 }); 52313 52314 if ($("#zipCodeEdit").length) { 52315 52316 if (!$(".requireField#zipCodeEdit").val()) { 52317 52318 $(".requireField#zipCodeEdit").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 52319 $(".requireField#zipCodeEdit").closest('.customFieldset').find('span.errormessage').show(); 52320 $(".requireField#zipCodeEdit").addClass("requireFieldBorder"); 52321 52322 flag = 0; 52323 52324 } else { 52325 $(".requireField#zipCodeEdit").closest('.customFieldset').find('span.errormessage').hide(); 52326 $(".requireField#zipCodeEdit").removeClass("requireFieldBorder"); 52327 52328 52329 } 52330 } 52331
52332 if ($("#phoneEdit").length) { 52333 52334 if (!$(".requireField#phoneEdit").val() || !$(".requireField#phoneEdit").val().trim().match(phoneno)) { 52335 52336 $(".requireField#phoneEdit").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 52337 $(".requireField#phoneEdit").closest('.customFieldset').find('span.errormessage').show(); 52338 $(".requireField#phoneEdit").addClass("requireFieldBorder"); 52339 52340 flag = 0; 52341 52342 } else { 52343 $(".requireField#phoneEdit").closest('.customFieldset').find('span.errormessage').hide(); 52344 $(".requireField#phoneEdit").removeClass("requireFieldBorder"); 52345 } 52346 } 52347 52348 if ($(".errormessage").is(":visible")) { 52349 console.log("form error message"); 52350 var firstErrorElement = $('.errormessage.required:visible')[0]; 52351 var firstErrorTop = $(firstErrorElement).offset().top - 170; 52352 window.scrollTo(0, firstErrorTop); 52353 52354 // Adobe Analytics 52355 const errElements = [ 52356 ...document.getElementsByClassName("errormessage"), 52357 ].filter((errEl) => errEl.offsetParent != null); 52358 const satelliteLoaded = typeof _satellite != "undefined"; 52359 if (errElements.length) { 52360 if (digitalData && digitalData.form) 52361 digitalData.form.formError = errElements 52362 .map((errEl) => 52363 errEl 52364 .closest(".form-group") 52365 ?.querySelector("[name]") 52366 ?.getAttribute("name") 52367 ) 52368 ?.join(","); 52369 if (satelliteLoaded) _satellite.track("formerror"); 52370 } 52371 // 52372 52373 52374 return; 52375 52376 } else { 52377 52378 buList = ''; 52379 var bu = $('#business-unit-selection-edit input[name=business-unit]:checked').not(':disabled'); 52380 for (var i = 0; i < bu.length; i++) { 52381 buList += bu[i].value + ';'; 52382 } 52383 if (buList.length > 0) { 52384 buList = buList.slice(0); 52385 } 52386 52387 $('#editAccountAlert').removeClass('show').addClass('hide'); 52388 52389 var formDataUpdate = { 52390 'firstName': $('#firstnameEdit').val(), 52391 'lastName': $('#lastnameEdit').val(), 52392 'Email': $('#emailsignupEdit').val(), 52393 'CompanyName': $('#companyEdit').val(), 52394 'Phone': $('#phoneEdit').val(), 52395 'Country': $('#countryEdit').val(), 52396 'zip': $('#zipCodeEdit').val(), 52397 'industry': $('#industrySignUpEdit').val(), 52398 'jobfunction': $('#jobfunctionSignUpEdit').val(), 52399 'role': $('#roleSignUpEdit').val(), 52400 'ExternalApps': buList, 52401 'UserName': $('#userNameEdit').val(), 52402 'currentresoure': $('.currentresource').val(), 52403 'Web_Visitor_ID': $('#Web_Visitor_ID').val(), 52404 //'optin': $('#optin').val(), 52405 'wp_access_application_optin': $('#wp_access_application_optin').val() 52406 52407 }; 52408 52409 52410 var stateValEdit = $('#stateSignUpEdit').val(); 52411 52412 var companySizeValEdit = $('#companySizeSignUpEdit').val(); 52413 52414 if ((companySizeValEdit) && (companySizeValEdit !== "Select_Company_Size")) { 52415 formDataUpdate['companysize'] = companySizeValEdit; 52416 } 52417 52418 if ((stateValEdit) && (stateValEdit !== "Select_State")) { 52419 formDataUpdate['state'] = stateValEdit; 52420 } 52421 if ($('#countryEdit').val() !== "US") { 52422 formDataUpdate['state'] = ''; 52423 } 52424 52425 if ($('#cityEdit').val()) { 52426 formDataUpdate['city'] = $('#cityEdit').val(); 52427 } 52428 52429 if ($('#addressEdit').val()) {
52430 formDataUpdate['address'] = $('#addressEdit').val(); 52431 } 52432 52433 if ($('.optin-fields #optin').length) { 52434 formDataUpdate['optin'] = $('#optin').val(); 52435 } 52436 52437 52438 $.ajax({ 52439 type: "POST", 52440 url: updateURL, 52441 data: formDataUpdate, 52442 dataType: "json", 52443 encode: true, 52444 success: function(msg) { 52445 //console.log(msg); 52446 if (msg.SuccessStatus == 1) { 52447 if (document.getElementById('noData')) { 52448 unSubscribe(); 52449 52450 } else { 52451 52452 setTimeout(function() { 52453 $('#accountSuccuessPop').show(); 52454 $('html').addClass('modal-open'); 52455 }, 2000) 52456 52457 } 52458 const satelliteLoaded = typeof _satellite != "undefined"; 52459 if (satelliteLoaded) { 52460 if (digitalData && digitalData.form) { 52461 digitalData.form.formPlatform = "Sales Force"; 52462 digitalData.form.submit = document.getElementById('signUpEditSubmit').innerHTML; 52463 } 52464 _satellite.track("formend"); 52465 } 52466 } else if (msg.SuccessStatus == 0) { 52467 //window.location.href = errorURL; 52468 } 52469 52470 }, 52471 complete: function(msg) {}, 52472 /* error:function(XMLHttpRequest, Error,msg)*/ 52473 error: function(data) { 52474 $('#editAccountAlert').removeClass('hide').addClass('show'); 52475 } 52476 }); 52477 52478 } 52479 }); 52480 var pageURL = location.pathname.split('/'); 52481 var pageLastNode = pageURL[pageURL.length - 1]; 52482 if (pageLastNode == "signin.html") { 52483 if (document.referrer == "https://sfdcssosit-tools-dupont.cs9.force.com") { 52484 history.go(-2); 52485 } 52486 } 52487 52488 52489 //Private and valid pages authentication on button click 52490 $('#AdditionalPermissions').click(function(e) { 52491 e.preventDefault(); 52492 if (localStorage.getItem('userName') != undefined && localStorage.getItem('userName') != '' && localStorage.getItem('userName') != null) { 52493 var username = localStorage.getItem('userName'); 52494 } 52495 var currentLocation = location.href; 52496 var redirectUrl = $('#AdditionalPermissions a').attr('href'); 52497 52498 $.ajax({ 52499 type: "GET", 52500 cache: false, 52501 url: "/dupont/AdditionalPermissions", 52502 data: "UserName=" + username + "&URL=" + currentLocation + "¤tresoure=" + $('.currentresource').val(), 52503 dataType: "json", 52504 contentType: "application/json", 52505 success: function(data) { 52506 console.log(data); 52507 52508 if (data.SuccessStatus == "1") { 52509 /* window.location.href = redirectUrl; */ 52510 52511 $("#GetAccessPop .signOutPop-modal-body p").text(data.SuccessMessage); 52512 $('#GetAccessPop').show(); 52513 $('html').addClass('modal-open'); 52514 } else if (data.SuccessStatus == "0") { 52515 52516 $("#GetAccessPop .signOutPop-modal-body p").text(data.SuccessMessage); 52517 $('#GetAccessPop').show(); 52518 $('html').addClass('modal-open'); 52519 52520 } else { 52521 52522 /*No Message */ 52523 52524 } 52525 //hiding getAccess pop Status with Time Out 52526 setTimeout(function() { 52527 $("#GetAccessPop").fadeOut(); 52528 $('html').removeClass('modal-open'); 52529 52530 }, 30000); 52531 }, 52532 error: function(data) { 52533 console.log(data); 52534 } 52535 52536 }); 52537 }); 52538 52539 52540 $('#popSignout').click(function() { 52541 var signoutUrl = $('#signOutAnchor').attr('data-signOuturl'); 52542 if (signoutUrl != '' && signoutUrl != undefined && signoutUrl != null) { 52543 window.location.href = signoutUrl; 52544 } 52545 }); 52546 52547 $('#wp_access_application_optin').closest('.optin-check').hide(); 52548 52549 // let optin_val = $('#optin').val(); 52550 // let wp_access_application_optin_val = $('#wp_access_application_optin').val(); 52551 52552 52553 if ($('#optin').data('value')) { 52554 $('#optin').val($('#optin').data('value')); 52555 } 52556 52557 if ($('#wp_access_application_optin').data('value')) { 52558 $('#wp_access_application_optin').val($('#wp_access_application_optin').data('value')); 52559 } 52560 52561 if ($('#optin').val() === 'Opt-in') { 52562 $('#optin').prop('checked', true); 52563 } else { 52564 $('#optin').prop('checked', false); 52565 } 52566 52567 if ($('#wp_access_application_optin').val() === 'yes') { 52568 $('#wp_access_application_optin').prop('checked', true); 52569 } else { 52570 $('#wp_access_application_optin').prop('checked', false); 52571 } 52572 52573 $('#wp_access_application_optin').prop('disabled', true); 52574 52575 $('input[type=checkbox][name=optin]').change(function() { 52576 if (this.checked) { 52577 $('#optin').val('Opt-in'); 52578 } else { 52579 //$('#optin').val('Opt-out'); 52580 $('#optin').val(''); 52581 } 52582 }); 52583 $('input[type=checkbox][name=wp_access_application_optin]').change(function() { 52584 if (this.checked) { 52585 $('#wp_access_application_optin').val('yes'); 52586 } else { 52587 $('#wp_access_application_optin').val('no'); 52588 } 52589 }); 52590 52591 }); 52592 52593 //select the defualt checkboxes 52594 var b_units = $("#business-unit-selection-edit").attr('data-units'); 52595 var b_unitsArray = []; 52596 if (b_units != '' && b_units != undefined && b_units.length != -1) { 52597 b_unitsArray = b_units.split(';'); 52598 } 52599 52600 /* New Ajax Call Service For SignUp and MyAccount html Starts written by @Palguna Ganta */ 52601 52602 52603 $(document).ready(function() { 52604 var getAppformData = { 52605 'currentresoure': $('.currentresource').val() 52606 }; 52607 52608 $.ajax({ 52609 type: "GET", 52610 url: "/dupont/AppDetails", 52611 data: getAppformData, 52612 contentType: "application/json;charset=utf-8", 52613 datatype: "json", 52614 success: function(data) { 52615 tempObj = JSON.parse(data); 52616 console.log(tempObj); 52617 getappdet(tempObj); 52618 52619 console.log($(".business-unit .business-unit-main-header").length); 52620 52621 }, 52622 error: function(data) { 52623 console.log(data); 52624 } 52625 }); 52626 52627 }); 52628 52629 52630 function getUrlVarsSF() { 52631 var vars = {}; 52632 var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { 52633 vars[key] = value; 52634 }); 52635 return vars; 52636 }; 52637 /*To fetch BU url paramter */ 52638 function getUrlParamSF(parameter, defaultvalue) { 52639 52640 var urlparameter = defaultvalue; 52641 if (window.location.href.indexOf(parameter) > -1) { 52642 urlparameter = (getUrlVarsSF()[parameter]).toLowerCase(); 52643 } 52644 return urlparameter; 52645 }; 52646 52647 function showBUrelatedApp(buName) { 52648 52649 var buText = ''; 52650 try { 52651 if (buName.indexOf('water') > -1) { 52652 buText = 'water solution'; 52653 } else if (buName.indexOf('building') > -1 || buName.indexOf('pbs') > -1) { 52654 buText = 'performance building solution'; 52655 } else if (buName.indexOf('transportation') > -1 || buName.indexOf('tni') > -1 || buName.indexOf('tnap') > -1) { 52656 52657 } else if (buName.indexOf('nutrition') > -1 || buName.indexOf('nnh') > -1 || buName.indexOf('nnb') > -1) { 52658 52659 } else if (buName.indexOf('electronic') > -1 || buName.indexOf('eni') > -1) { 52660 52661 } else if (buName.indexOf('industrial-biosciences') > -1 || buName.indexOf('ib') > -1) { 52662 52663 } else if (buName == 'safety') { 52664 buText = 'safety'; 52665 } else if (buName == 'snc' || buName == 'safetyandconstruction') { 52666 52667 } else if (buName == 'ppe') { 52668 buText = 'personal protection'; 52669 } else if (buName == 'corporate') { 52670 52671 } else if (buName == 'greatstuff') { 52672 52673 52674 } else if (buName == 'life-protection') { 52675 52676 52677 } else if (buName == 'corian') { 52678 52679 } else if (buName == 'healthcare') { 52680 buText = 'healthcare'; 52681 } 52682 else if (buName == 'delrin') { 52683 buText = 'delrin'; 52684 } 52685 else if (buName == 'liveo') { 52686 buText = 'e&i'; 52687 } 52688 } catch (e) { 52689 console.log('invalid BU', e); 52690 } 52691 52692 52693 if (buText.trim() != '') { 52694 $.each($('.business-unit-main-header'), function(ind, val) { 52695 52696 if ($(val).text().toLowerCase().indexOf(buText) < 0) { 52697 if (buText == 'safety' && $(val).text().toLowerCase() == 'dupont⢠tyvek® healthcare packaging resource center') { 52698 $(val).parent().show(); 52699 } else { 52700 $(val).parent().hide(); 52701 } 52702 } 52703 }); 52704 } 52705 52706 }; 52707 52708 function resourcePremiumCheck(val) { 52709 let business_unitVal; 52710 $('.business-unit-start .business-unit-sub-list input[name=business-unit]').each(function() { 52711 if ($(this).val() === 'Resource Center Premium' && this.checked) { 52712 business_unitVal = $(this).val(); 52713 } 52714 }); 52715 52716 if ($('#wp_access_application_optin').val() === 'no' && business_unitVal) { 52717 if (val == 'signup') { 52718 $('#wp_access_application_optin').closest('.optin-check').show(); 52719 $('#wp_access_application_optin').prop('disabled', false); 52720 } else if (val == 'edit') { 52721 $('#wp_access_application_optin').closest('.optin-check').show(); 52722 $('#wp_access_application_optin').prop('disabled', false); 52723 } else { 52724 $('#wp_access_application_optin').closest('.optin-check').show(); 52725 $('#wp_access_application_optin').prop('disabled', true); 52726 } 52727 } else if ($('#wp_access_application_optin').val() === 'yes' && business_unitVal) { 52728 $('#wp_access_application_optin').closest('.optin-check').show(); 52729 } else { 52730 $('#wp_access_application_optin').closest('.optin-check').hide(); 52731 } 52732 } 52733 52734 function optincheck() { 52735 if ($('#optin').val() == '' || $('#optin').val() == undefined) { 52736 $('#optin').prop('disabled', false); 52737 } else { 52738 $('#optin').prop('disabled', true); 52739 } 52740 } 52741 52742 function getappdet() { 52743 var b = 0; //declaring Business unit index 52744 for (var j = 0; j < tempObj.length; j++) 52745 52746 { 52747 /* Business unit header loop starts Here */ 52748 var buMainheader = tempObj[j].appCategory; 52749 52750 // var businnessUnitHeader = '<div class="bu-app-wrapper-' + j + ' col-md-6"><h5 id="BuHeader-' + j + '" class="business-unit-main-header">' + buMainheader + '</h5>'; 52751 // $(".business-unit-start").append(businnessUnitHeader); 52752 var sublistobj = JSON.parse(tempObj[j].allApps); 52753 52754 for (var i = 0; i < sublistobj.length; i++) { 52755 52756 /* Business Sub Unit loop starts Here */
52757 var appval = sublistobj[i].External_app_value__c; 52758 var displayname = sublistobj[i].Display_Name__c; 52759 var appdesc = sublistobj[i].App_Description__c; 52760 var appChecked = b_unitsArray.some(item => item === appval); 52761 52762 //var businnessUnitHeader = '<div class="bu-app-wrapper-' + j + ' col-md-6"><h5 id="BuHeader-' + j + '" class="business-unit-main-header">' + buMainheader + '</h5>'; 52763 52764 var businessUnitSubList = `<div class="business-unit-sub-list row"> 52765 <article class="col-sm-12"> 52766 <input type="checkbox" name="business-unit" id="business-unit-${b}" value ="${appval}" disabled ="disabled" ${appChecked?'checked':''}> 52767 <label for = "business-unit-${b}" >${displayname} </label> 52768 <span>${appdesc}</span > 52769 </article> 52770 </div>`; 52771 52772 52773 52774 if (b_unitsArray.length > 0) { 52775 if (appChecked) { 52776 var businnessUnitHeader = '<div class="bu-app-wrapper-' + j + ' col-md-6"><h5 id="myApp-BuHeader-' + j + '" class="business-unit-main-header">' + buMainheader + '</h5>'; 52777 if (!($(`.myApps #myApp-BuHeader-${j}`).text() === buMainheader)) 52778 $(".myApps .business-unit-start").append(businnessUnitHeader); 52779 52780 $(".myApps .bu-app-wrapper-" + j).append(businessUnitSubList); 52781 $('.myApps .bu_title').show(); 52782 } else { 52783 var businnessUnitHeader = '<div class="bu-app-wrapper-' + j + ' col-md-6"><h5 id="addApp-BuHeader-' + j + '" class="business-unit-main-header">' + buMainheader + '</h5>'; 52784 if (!($(`.addApps #addApp-BuHeader-${j}`).text() === buMainheader)) 52785 $(".addApps .business-unit-start").append(businnessUnitHeader); 52786 52787 $(".addApps .bu-app-wrapper-" + j).append(businessUnitSubList); 52788 $('.addApps .bu_title').show(); 52789 } 52790 } else { 52791 var businnessUnitHeader = '<div class="bu-app-wrapper-' + j + ' col-md-6"><h5 id="addApp-BuHeader-' + j + '" class="business-unit-main-header">' + buMainheader + '</h5>'; 52792 if (!($(`.myApps #addApp-BuHeader-${j}`).text() === buMainheader)) 52793 $(".myApps .business-unit-start").append(businnessUnitHeader); 52794 52795 $(".myApps .bu-app-wrapper-" + j).append(businessUnitSubList); 52796 $('.myApps.editForm .bu_title').show(); 52797 52798 } 52799 52800 /* Business Sub Unit loop Ends Here */ 52801 52802 // for (var k = 0; k < b_unitsArray.length; k++) { 52803 // if (appval == b_unitsArray[k]) { 52804 // $("#business-unit-selection-edit input[type='checkbox']").eq(b).prop("checked", true); 52805 // } 52806 // } 52807 52808 52809 52810 b++; //Business unit index increment 52811 52812 } 52813 52814 /* Business unit header loop Ends Here */ 52815 } 52816 52817 var buName = getUrlParamSF('BU', undefined); 52818 52819 //optincheck(); 52820 //$('#business-unit-11').prop('checked',true); 52821 resourcePremiumCheck(); 52822 52823 $('input[type=checkbox][name=business-unit]').change(function() { 52824 if ($(this).val() == 'Resource Center Premium') { 52825 if ($(this).val() == 'Resource Center Premium' && $(this).is(':checked')) { 52826 $('#wp_access_application_optin').closest('.optin-check').show(); 52827 $('#wp_access_application_optin').val('yes'); 52828 $('#wp_access_application_optin').prop('checked', true); 52829 } else { 52830 $('#wp_access_application_optin').prop("checked", false); 52831 $('#wp_access_application_optin').val('no'); 52832 $('#wp_access_application_optin').closest('.optin-check').hide(); 52833 } 52834 } 52835 }); 52836 showBUrelatedApp(buName); 52837 52838 if ($('#business-unit-selection-edit') || $('#business-unit-selection')) { 52839 $('.business-unit-start').children(':visible').each(function(n) { 52840 if (n % 2 === 0) { 52841 $(this).css('float', 'left'); 52842 } else { 52843 $(this).css('float', 'right'); 52844 } 52845 }); 52846 } 52847 52848 52849 /**Accordion Code */ 52850 52851 $('.buList-accordion-header').click(function(event) { 52852 // animate the open close 52853 event.stopPropagation(); 52854 $(event.target) 52855 .next('.buList-accordion-content')
52856 .toggle() 52857 .end() 52858 // apply a class to change icon and set state 52859 .closest('.buList-accordion-wrapper') 52860 .toggleClass('open'); 52861 }); 52862 52863 /* */ 52864 52865 if ($('#signupForm .business-unit-start').children().length > 0) { 52866 $("#signupForm #buListHeading").show(); 52867 } else { 52868 $("#signupForm #buListHeading").hide(); 52869 } 52870 } 52871 52872 52873 /* New Ajax Call Service For SignUp and MyAccount html Ends Here*/ 52874 52875 52876 $("body").append($('#GetAccessPop')); 52877 52878 52879 //hiding getAccess pop Status 52880 $('#GetAccesspopCancel').click(function() { 52881 $('#GetAccessPop').fadeOut(); 52882 $('html').removeClass('modal-open'); 52883 }); 52884 52885} 52886 52887 52888function sideScrollComponent(el) { 52889 this.el = el; 52890 this.image = el.find("#sideImage"); 52891 this.articles = el.find(".right-side"); 52892 this.updateOptions = updateOptions.bind(this); 52893 this.init(); 52894} 52895 52896sideScrollComponent.prototype.calculateSettings = function() { 52897 var settings = {}; 52898 var imgH = this.image[0].getBoundingClientRect().height; 52899 var artH = this.articles[0].getBoundingClientRect().height; 52900 settings.offset = imgH * 0.5; 52901 settings.duration = artH - imgH - 50; 52902 if(settings.duration < 0){ 52903 settings.duration = 1; 52904 } 52905 return settings; 52906}; 52907 52908function updateOptions() { 52909 var isMobile = window.innerWidth <= 768; 52910 if (isMobile) { 52911 this.scene.enabled(false); 52912 this.scene.offset(0); 52913 this.scene.duration(0); 52914 return; 52915 } 52916 this.scene.enabled(true); 52917 var settings = this.calculateSettings(); 52918 this.scene.offset(settings.offset); 52919 this.scene.duration(settings.duration); 52920} 52921 52922sideScrollComponent.prototype.init = function() { 52923 var controller = new ScrollMagic.Controller(); 52924 this.scene = new ScrollMagic.Scene({ 52925 triggerElement: "#trigger1" 52926 }) 52927 .setPin("#sideImage") 52928 .addTo(controller); 52929 this.updateOptions(); 52930 window.addEventListener("resize", this.updateOptions); 52931}; 52932 52933$(function() { 52934 $(".side-scroll").each(function() { 52935 new sideScrollComponent($(this)); 52936 }); 52937}); 52938 52939function ScrollInteraction(el) { 52940 this.el = el; 52941 this.controller = new ScrollMagic.Controller(); 52942 52943 this.topToBottomScenes = []; 52944 this.centerToCenterScenes = []; 52945 52946 this.updateNavHeight(); 52947 this.setUpLongType(); 52948 52949 window.addEventListener("resize", this.onResize.bind(this)); 52950} 52951 52952ScrollInteraction.prototype.onResize = function() { 52953 var self = this; 52954 52955 requestAnimationFrame(function() { 52956 self.updateNavHeight(); 52957 self.updateCenterToCenterScenes(); 52958 self.updateTopToBottomScenes(); 52959 }); 52960}; 52961 52962ScrollInteraction.prototype.updateNavHeight = function() { 52963 this.navHeight = 0; 52964 52965 try { 52966 this.navHeight = document 52967 .querySelector(".component-navigation") 52968 .getBoundingClientRect().height; 52969 } catch (error) {} 52970}; 52971 52972ScrollInteraction.prototype.getCenterToCenterScene = function(el) { 52973 var scene = new ScrollMagic.Scene({ 52974 triggerElement: el, 52975 offset: this.navHeight / -2, // half of nav height 52976 duration: el.getBoundingClientRect().height 52977 }).addTo(this.controller); 52978 52979 this.centerToCenterScenes.push(scene); 52980 return scene; 52981}; 52982 52983ScrollInteraction.prototype.updateCenterToCenterScenes = function() { 52984 var self = this; 52985 52986 this.centerToCenterScenes.forEach(function(scene) { 52987 var el = scene.triggerElement(); 52988 52989 scene.offset(self.navHeight / -2); 52990 scene.duration(el.getBoundingClientRect().height); 52991 scene.refresh(); 52992 }); 52993}; 52994 52995ScrollInteraction.prototype.getTopToBottomScene = function(el) { 52996 var scene = new ScrollMagic.Scene({ 52997 triggerElement: el, 52998 triggerHook: "onEnter", 52999 duration: 53000 el.getBoundingClientRect().height + window.innerHeight - this.navHeight 53001 }).addTo(this.controller); 53002 53003 this.topToBottomScenes.push(scene); 53004 return scene; 53005}; 53006 53007ScrollInteraction.prototype.updateTopToBottomScenes = function() { 53008 var self = this; 53009 53010 this.topToBottomScenes.forEach(function(scene) { 53011 var el = scene.triggerElement(); 53012 53013 scene.duration( 53014 el.getBoundingClientRect().height + window.innerHeight - self.navHeight 53015 ); 53016 scene.refresh(); 53017 }); 53018}; 53019 53020ScrollInteraction.prototype.setUpLongType = function() { 53021 var self = this; 53022 53023 var c2cScene = this.getCenterToCenterScene(this.el); 53024 var t2bScene = this.getTopToBottomScene(this.el); 53025 53026 // for each callout 53027 $(this.el) 53028 .find(".scroll-interaction--callout-positioner") 53029 .each(function(index, calloutPositionerEl) { 53030 53031 // position positioner according to authored progress point 53032 calloutPositionerEl.style.top = 53033 calloutPositionerEl.dataset.appearat * 100 + "%"; 53034 calloutPositionerEl.style.transform = 53035 "translateY(" + calloutPositionerEl.dataset.appearat * -100 + "%)"; 53036 53037 var calloutEl = calloutPositionerEl.querySelector(".scroll-interaction--callout"); 53038 var calloutHeight = calloutEl.getBoundingClientRect().height; 53039 var calloutT2bScene = self.getTopToBottomScene(calloutPositionerEl); 53040 53041 function updatePosition() { 53042 var progress = calloutT2bScene.progress(); 53043 53044 //Position fixes for scroll interaction in tabbed component 53045 calloutEl = calloutPositionerEl.querySelector(".scroll-interaction--callout"); 53046 calloutHeight = calloutEl.getBoundingClientRect().height; 53047 calloutT2bScene = self.getTopToBottomScene(calloutPositionerEl); 53048 53049 // when container enters viewport, callout top is aligned to container top 53050 // when container leaves viewport, callout bottom is aligned to container bottom 53051 var containerHeight = window.innerHeight - self.navHeight; 53052 var delta = containerHeight - calloutHeight; 53053 var translateValue = Math.round(progress * delta); 53054 53055 // callouts fade in/out over first/last quarter of container scroll progress 53056 var opacityPrecision = 1000; 53057 var mirroredProgress = 53058 Math.abs( 53059 Math.abs( 53060 Math.round(progress * opacityPrecision) - opacityPrecision / 2 53061 ) - 53062 opacityPrecision / 2 53063 ) / opacityPrecision; 53064 var opacityThreshold = 0.25; 53065 var opacityValue = (mirroredProgress - 0) / (opacityThreshold - 0); 53066 53067 calloutEl.style.visibility = 53068 mirroredProgress === 0 ? "hidden" : "inherit"; 53069 calloutEl.style.transform = "translate3d(0," + translateValue + "px,0
53069)"; 53070 calloutEl.style.opacity = opacityValue; 53071 } 53072 53073 // update callout position on scroll 53074 window.addEventListener("scroll", function() { 53075 if (calloutT2bScene.state() !== "DURING") { 53076 return; 53077 } 53078 53079 requestAnimationFrame(function() { 53080 updatePosition(); 53081 }); 53082 }); 53083 53084 // set initial callout position 53085 requestAnimationFrame(function() { 53086 updatePosition(); 53087 }); 53088 }); 53089 53090 // flip background assets at authored appearAt positions 53091 $(this.el) 53092 .find(".scroll-interaction--image[data-appearat]") 53093 .each(function(index, imgEl) { 53094 c2cScene.on("progress", function(e) { 53095 imgEl.classList.toggle("visible", e.progress >= imgEl.dataset.appearat); 53096 }); 53097 }); 53098 53099 // when videos load, update everything 53100 $(this.el) 53101 .find("video") 53102 .each(function(index, videoEl) { 53103 videoEl.addEventListener("loadeddata", function() { 53104 requestAnimationFrame(function() { 53105 self.updateCenterToCenterScenes(); 53106 self.updateTopToBottomScenes(); 53107 }); 53108 }); 53109 }); 53110 53111 // when images load, update everything 53112 $(this.el) 53113 .find("img") 53114 .each(function(index, imageEl) { 53115 imageEl.addEventListener("load", function() { 53116 requestAnimationFrame(function() { 53117 self.updateCenterToCenterScenes(); 53118 self.updateTopToBottomScenes(); 53119 }); 53120 }); 53121 }); 53122 53123 // when entering component, play videos 53124 t2bScene.on("enter", function() { 53125 $(self.el) 53126 .find("video") 53127 .each(function(index, videoEl) { 53128 videoEl.play(); 53129 }); 53130 }); 53131 53132 // when leaving component pause videos 53133 t2bScene.on("leave", function() { 53134 $(self.el) 53135 .find("video") 53136 .each(function(index, videoEl) { 53137 videoEl.pause(); 53138 }); 53139 }); 53140}; 53141 53142$(function() { 53143 $(".scroll-interaction").each(function() { 53144 new ScrollInteraction(this); 53145 }); 53146}); 53147(function ($, $document) { 53148 53149 "use strict"; 53150 $document.on("dialog-ready", function () { 53151 var multiFieldNum = $(this).attr("aria-posinset"); 53152 53153 $(".cq-dialog-submit").on('click', function(event) { 53154 53155 }); 53156 }); 53157 53158})($, $(document)); 53159(function ($, $document) { 53160 "use strict"; 53161 53162 $(document).on("click", ".cq-dialog-submit", function (e) { 53163 var regexSelector = $('[data-regex]').not(".richtext-container>div.coral-RichText-editable"); 53164 var error = false; 53165 var invalidTabs = []; 53166 var errorMsg = ""; 53167 var regModelHeading = $("[data-regex-model-heading]").attr("data-regex-model-heading"); 53168 var regContentHeading = $("[data-regex-content-heading]").attr("data-regex-content-heading"); 53169 53170 if (regModelHeading === null || typeof regModelHeading === "undefined") { 53171 regModelHeading = "Dialog cannot be submitted"; 53172 } 53173 53174 if (regContentHeading === null || typeof regContentHeading === "undefined") { 53175 regContentHeading = "Following Fields are invalid"; 53176 } 53177 53178 // remove existing error flag, error tooltip and error model 53179 $(".regex-error").remove(); 53180 $("coral-tab").removeClass('is-invalid'); 53181 $("#regexDialogId").remove(); 53182 53183 // checking fields for validation 53184 $(regexSelector).each(function (i) { 53185 var $this = $(this); 53186 var regex = $this.data("regex"); 53187 var regexText = $this.data("regextext"); 53188 var regexMode = $this.data("regexmode"); 53189 var value = $this.val(); 53190 var dialogMode = 0; 53191 53192 if (regexMode === 'floating') { 53193 dialogMode = 1; 53194 } else if (regexMode === 'auto') { 53195 dialogMode = 2; 53196 } 53197 53198 if (!(regex == "" || typeof regex === 'undefined')) { 53199 errorMsg = errorMsg + validateField($this, value, regex, regexText, dialogMode); 53200 } 53201 }); 53202 53203 if (error) {
53204 invalidTabs.forEach(function (tab) { 53205 if (!tab.hasClass("is-invalid")) 53206 tab.addClass("is-invalid"); 53207 }); 53208 if (errorMsg !== "") { 53209 var dialog = getDialog(errorMsg); 53210 document.body.appendChild(dialog); 53211 dialog.show(); 53212 } 53213 return false; 53214 } 53215 53216 53217 // function to validate and get field regexText error message 53218 function validateField($this, value, regex, regexText, dialogMode) { 53219 var newVal = getValue(regex, value, $this); 53220 regex = newVal[0]; 53221 value = newVal[1]; 53222 var errMsg = ""; 53223 53224 if (regexText == "" || typeof regexText == 'undefined') { 53225 regexText = Granite.I18n.get("Invalid input"); 53226 } else { 53227 regexText = Granite.I18n.get(regexText); 53228 } 53229 53230 if ((!(new RegExp(regex).test(value)) && regex != "required") || (regex === "required" && value.length == 0)) { 53231 error = true; 53232 if ($this.hasClass('coral-PathBrowser') || $this.hasClass('coral-ColorInput') || $this.hasClass('coral3-ColorInput') || $this.prop('tagName').toLowerCase() === "coral-datepicker" || $this.prop('tagName').toLowerCase() === "foundation-autocomplete") { 53233 $this.find("input.coral3-Textfield").addClass("is-invalid").addClass("regex-invalid"); 53234 $this.find("input.coral-Textfield").addClass("is-invalid").addClass("regex-invalid"); 53235 } else if ($this.hasClass("coral3-FileUpload")) { 53236 $this.find(".cq-FileUpload-thumbnail").addClass("regex-invalid"); 53237 } else if ($this.hasClass('coral3-NumberInput')) { 53238 $this.find("input.coral-Textfield").addClass("is-invalid").addClass("regex-invalid"); 53239 $this.find("input.coral3-Textfield").addClass("is-invalid").addClass("regex-invalid"); 53240 $this.addClass("is-invalid"); 53241 } else { 53242 $this.addClass("is-invalid").addClass("regex-invalid"); 53243 } 53244 53245 if ($this.parents().hasClass("coral3-Accordion-item")) { 53246 $this.closest("coral-accordion-item").attr("selected", true); 53247 } 53248 53249 if (dialogMode != 1) { 53250 if ($this.parent().hasClass("richtext-container")) { 53251 $this.siblings(".coral-RichText-editable").addClass("regex-invalid"); 53252 $this.parent().siblings(".coral-Form-fieldinfo").addClass("hide"); 53253 } else { 53254 $this.siblings(".coral-Form-fieldinfo").addClass("hide"); 53255 } 53256 } 53257 53258 var tabId = $this.parents('coral-panel').attr('id'); 53259 var curTab = $this.parents('coral-tabview').find('coral-tab[aria-controls="' + tabId + '"]'); 53260 if (typeof curTab !== 'undefined' || typeof curTab !== null) { 53261 invalidTabs.push(curTab); 53262 } 53263 if (dialogMode != 1) { 53264 insertErrToolTip($this, regexText); 53265 } 53266 if (dialogMode != 0) { 53267 errMsg = getErrMsg($this, regexText, curTab.find("coral-tab-label")); 53268 } 53269 } else { 53270 $this.removeClass("regex-invalid").find(".regex-invalid").removeClass("regex-invalid"); 53271 if ($this.hasClass('coral-PathBrowser') || $this.hasClass('coral-ColorInput') || $this.hasClass('coral3-ColorInput') || $this.prop('tagName').toLowerCase() === "coral-datepicker" || $this.prop('tagName').toLowerCase() === "foundation-autocomplete") { 53272 $this.find("input.coral-Textfield").removeClass("is-invalid").removeClass("regex-invalid"); 53273 $this.find("input.coral3-Textfield").removeClass("is-invalid").removeClass("regex-invalid"); 53274 } else if ($this.hasClass('coral3-NumberInput')) { 53275 $this.find("input.coral-Textfield").removeClass("is-invalid").removeClass("regex-invalid"); 53276 $this.find("input.coral3-Textfield").removeClass("is-invalid").removeClass("regex-invalid"); 53277 $this.removeClass("is-invalid"); 53278 } else { 53279 $this.removeClass("is-invalid"); 53280 } 53281 53282 if ($this.parent().hasClass("richtext-container")) { 53283 $this.siblings(".coral-RichText-editable").removeClass("regex-invalid"); 53284 $this.parent().siblings(".coral-Form-fieldinfo").removeClass("hide"); 53285 } else { 53286 $this.siblings(".coral-Form-fieldinfo").removeClass("hide"); 53287 } 53288 53289 if ($this.parents().hasClass("coral3-Accordion-item")) { 53290 $this.closest("coral-accordion-item").removeAttr("selected"); 53291 } 53292 } 53293 return errMsg; 53294 } 53295 53296 53297 // function to get error message string for a field 53298 function getErrMsg(field, regexText, curTab) { 53299 var $eleLabel = field.siblings('label.coral-Form-fieldlabel'); 53300 var eleLabel = ""; 53301 var errMsg = ""; 53302 var pos = ""; 53303 var tab = ""; 53304 53305 if (typeof $eleLabel !== undefined) { 53306 if ($eleLabel.parents('coral-multifield-item').length) { 53307 pos = "[" + parseInt($eleLabel.parents('coral-multifield-item').index() + 1) + "]"; 53308 } 53309 53310 if ($eleLabel.length == 1) { 53311 eleLabel = $eleLabel.text(); 53312 } else if ($eleLabel.length == 0 && field.parent().hasClass("richtext-container")) { 53313 eleLabel = field.closest(".richtext-container").siblings('label.coral-Form-fieldlabel').text(); 53314 } else if ($eleLabel.length == 0 && field.closest(".coral-Form-fieldset").find(".coral-Form-fieldset-legend").length > 0) { 53315 eleLabel = field.closest(".coral-Form-fieldset").find(".coral-Form-fieldset-legend").text(); 53316 } else if ($eleLabel.length == 0 && field.hasClass("coral3-Checkbox")) { 53317 eleLabel = field.find('coral-checkbox-label').text(); 53318 } else if ($eleLabel.length == 0 && field.hasClass("coral3-FileUpload")) { 53319 eleLabel = "File Upload"; 53320 } 53321 } 53322 53323 if (typeof curTab !== 'undefined') { 53324 tab = curTab.text(); 53325 } 53326 53327 if (tab !== "" && eleLabel !== "") { 53328 errMsg = '<p><span class="errTab">' + tab + '</span>
53328<span class="err-separator">-></span><span class="errLabel"> ' + eleLabel + pos + '</span><span class="err-separator">:</span>' + regexText + '</p>'; 53329 } else if (tab === "" && eleLabel !== "") { 53330 errMsg = '<p><span class="errLabel"> ' + eleLabel + pos + '</span><span class="err-separator">:</span>' + regexText + '</p>'; 53331 } else if (tab !== "" && eleLabel === "") { 53332 errMsg = '<p><span class="errTab">' + tab + '</span><span class="err-separator">-></span>' + regexText + '</p>'; 53333 } else { 53334 errMsg = '<p>' + regexText + '</p>'; 53335 } 53336 return errMsg; 53337 } 53338 53339 // function to get error message dailog model 53340 function getDialog(errorMsg) { 53341 var dialog = new Coral.Dialog(); 53342 dialog.id = 'regexDialogId'; 53343 dialog.header.innerHTML = '<coral-alert-header>' + regModelHeading + '</coral-alert-header>'; 53344 dialog.content.innerHTML = '<coral-alert-content><div class="heading">'+regContentHeading+'</div><div class="content">' + errorMsg + '</div></coral-alert-content>'; 53345 dialog.footer.innerHTML = '<button is="coral-button" variant="primary" coral-close id="regex-dialog-ok"><coral-button-label>Ok</coral-button-label></button>'; 53346 dialog.variant = "error"; 53347 return dialog; 53348 } 53349 53350 // function to insert error tooltip for a field 53351 function insertErrToolTip(field, regexText) { 53352 var error = new Coral.Icon(); 53353 error.icon = "alert"; 53354 error.size = "S"; 53355 error.classList.add("coral-Form-fielderror", "regex-error"); 53356 53357 var tooltip = new Coral.Tooltip(); 53358 tooltip.variant = "error"; 53359 tooltip.classList.add("regex-error"); 53360 tooltip.placement = field.closest(".coral-Form").hasClass("coral-Form--vertical") ? "left" : "bottom"; 53361 tooltip.target = error; 53362 tooltip.content.innerHTML = regexText; 53363 tooltip.id = Coral.commons.getUID(); 53364 53365 $(error).data("foundation-validation.internal.error.tooltip", tooltip); 53366 error.setAttribute("aria-labelledby", tooltip.id); 53367 error.setAttribute("tabindex", 0); 53368 field.data("foundation-validation.internal.error", error); 53369 53370 if (field.parent().hasClass("richtext-container")) { 53371 field.parent().after(error, tooltip); 53372 } else if (field.hasClass("coral3-FileUpload")) { 53373 field.find(".cq-FileUpload-thumbnail").prepend(error, tooltip); 53374 } else { 53375 field.after(error, tooltip); 53376 } 53377 } 53378 53379 // function to get value from non text input fields 53380 function getValue(regex, value, $inputEle) { 53381 if ($inputEle.hasClass('coral3-NumberInput')) { 53382 if($inputEle.find("input.coral-Textfield").length>0) 53383 value = $inputEle.find("input.coral-Textfield").attr("aria-valuenow"); 53384 else 53385 value = $inputEle.find("input.coral3-Textfield").attr("aria-valuenow"); 53386 } else if ($inputEle.hasClass('coral-PathBrowser') || $inputEle.prop('tagName').toLowerCase() === "foundation-autocomplete") { 53387 if($inputEle.find("input.coral-Textfield").length>0) 53388 value = $inputEle.find("input.coral-Textfield").val(); 53389 else 53390 value = $inputEle.find("input.coral3-Textfield").val(); 53391 } else if ($inputEle.hasClass('coral3-FileUpload')) { 53392 var fileValue = $inputEle.find('input[data-cq-fileupload-parameter="filename"]').val(); 53393 var filereference = $inputEle.find('input[data-cq-fileupload-parameter="filereference"]').val(); 53394 var fileImage = $inputEle.find('div.cq-FileUpload-thumbnail-img img'); 53395 53396 if ((fileValue !== undefined && fileValue !== "false" && fileValue !== "") || (fileImage.length > 0 && fileValue == "" && filereference == "")) { 53397 value = "true"; 53398 regex = "required"; 53399 }
53399 else if (filereference !== undefined && filereference !== "false" && filereference !== "") { 53400 value = filereference; 53401 } else { 53402 value = ""; 53403 } 53404 } else if ($inputEle.hasClass('coral3-Select')) { 53405 value = $inputEle.find('input[handle="input"]').val(); 53406 } else if ($inputEle.hasClass("coral-Checkbox") || $inputEle.hasClass("coral3-Checkbox")) { 53407 if ($inputEle.prop('checked')) 53408 value = "true"; 53409 else 53410 value = ""; 53411 } else if ($inputEle.hasClass('coral-RadioGroup')) { 53412 if ($inputEle.find("coral-radio").prop('checked')) 53413 value = "true"; 53414 else 53415 value = ""; 53416 } else if ($inputEle.hasClass('coral-Form-fieldset')) { 53417 if ($inputEle.find("coral-checkbox").prop('checked')) 53418 value = "true"; 53419 else 53420 value = ""; 53421 } else if (regex === "multifield") { 53422 var min = $inputEle.data("min"); 53423 var max = $inputEle.data("max"); 53424 var multiFieldItem = $inputEle.find("coral-multifield-item").size(); 53425 53426 if (typeof min !== 'number') 53427 min = 0; 53428 if (typeof max !== 'number') 53429 max = 99999; 53430 if (multiFieldItem < min || multiFieldItem > max) { 53431 value = ""; 53432 } else { 53433 value = "true"; 53434 } 53435 regex = "required"; 53436 } 53437 return [regex, value]; 53438 } 53439 53440 }); 53441 53442})($, $(document)); 53443$(function() { 53444 /*Resource finder preview component*/ 53445 var rfPreviewComponent = function(compId) { 53446 53447 this.rfPrevComp = $($('.' + compId)[0]); 53448 53449 if (this.rfPrevComp.length > 0) { 53450 this.rfContainer = this.rfPrevComp.find('#rf-content-wrapper'); 53451 this.viewType = this.rfContainer.attr('data-default-view'); 53452 this.searchResultsContainer = this.rfPrevComp.find('#search-results-container'); 53453 this.fieldObj = JSON.parse(this.rfContainer.attr('data-fields-obj')); 53454 this.resData = []; 53455 this.anonymousUser = true; 53456 let downloadCartEL = $(".cmp-resFinder-Preview .dn-cart-container"); 53457 let expandCartEL = $(".cmp-resFinder-Preview .dn-expand-wrapper"); 53458 53459 if (this.viewType == "list") { 53460 this.blockView = false; 53461 } else { 53462 this.blockView = true; 53463 } 53464 53465 if (downloadCartEL && downloadCartEL.length > 1) { 53466 downloadCartEL.not(downloadCartEL[0]).remove(); 53467 expandCartEL.not(expandCartEL[0]).remove(); 53468 } 53469 53470 53471 53472 53473 } 53474 53475 53476 }; 53477 53478 /*To bind events with handlers*/ 53479 53480 rfPreviewComponent.prototype.bindEvents = function() { 53481 var self = this; 53482 this.rfPrevComp.on('click', '.play-icon, [data-type="video"]', $.proxy(this.playBtnClickHandler, this)); 53483 this.rfPrevComp.on('click', '#model-close, .model-bg', $.proxy(this.modelCloseBtnClickHandler, this)); 53484 this.rfPrevComp.find('.view-icons > .fas').on('click', $.proxy(this.viewOrderBtnClickHandler, this)); 53485 this.rfPrevComp.on('click', '.lock-screen, .hor-lock-screen', $.proxy(this.signInLinkClickHandler, this)); 53486 this.rfPrevComp.on('click', '.select-res', $.proxy(this.addDocsToDownloadQueue, this)); 53487 this.rfPrevComp.on('click', '.dn-cart-container', $.proxy(this.downloadZipClickHandler, this)); 53488 this.rfPrevComp.on('click', '.expand-arrow', $.proxy(this.showHideExpandedCart, this)); 53489 this.rfPrevComp.on('click', '.dc-close', $.proxy(this.showHideExpandedCart, this)); 53490 this.rfPrevComp.on('click', '.remove-icon', $.proxy(this.removeFromCart, this)); 53491 53492 }; 53493 53494 53495 /*To remove data from html attributes*/ 53496 53497 rfPreviewComponent.prototype.removeData = function() { 53498 this.rfContainer.removeAttr('data-fields-obj'); 53499 }; 53500 53501 /*To intiate component execution*/ 53502 rfPreviewComponent.prototype.init = function() { 53503 if (this.rfPrevComp.length > 0) { 53504 this.removeData(); 53505 this.bindEvents(); 53506 this.checkUserLogin(this.fetchData); 53507 53508 } 53509 53510 }; 53511 53512 /*To check for user login*/ 53513 rfPreviewComponent.prototype.checkUserLogin = function(callback) { 53514 var self = this; 53515 53516 $.ajax({ 53517 type: "GET", 53518 url: "/dupont/userService", 53519 dataType: "json", 53520 contentType: "application/json", 53521 cache: false, 53522 success: function(data) { 53523 53524 if (data.anonymousUser == false) { 53525 self.anonymousUser = false;
53526 } 53527 callback(self, data); 53528 }, 53529 error: function(data) { 53530 console.log("Error in user login service::" + data); 53531 callback(self, data); 53532 } 53533 53534 }); 53535 }; 53536 53537 53538 /*To check fro user login*/ 53539 rfPreviewComponent.prototype.fetchData = function(self, data) { 53540 self.resourceDataCall = 0; 53541 53542 self.getResourcesData(self.resourcesPaths, self.initiateExecution, data); 53543 53544 }; 53545 53546 /*To initiate execution*/ 53547 rfPreviewComponent.prototype.initiateExecution = function(self) { 53548 self.displayResults(); 53549 self.setSignInLinks(); 53550 }; 53551 53552 53553 53554 /*To fetch resources data*/ 53555 53556 rfPreviewComponent.prototype.getResourcesData = function(resPaths, callback, data) { 53557 53558 var tags = []; 53559 var self = this; 53560 var user = (data.anonymousUser == true) ? false : true; 53561 var countryTag = this.fieldObj.countryTag; 53562 var filterParam = this.getParam(this.fieldObj.filterParam); 53563 var ifuParamVal = ''; 53564 var listType = this.fieldObj.listType; 53565 filterParam = filterParam ? filterParam : ""; 53566 if (countryTag == '' || countryTag == null || countryTag == "null") { 53567 countryTag = undefined; 53568 } 53569 53570 self.resourceDataCall++; 53571 53572 if (this.fieldObj.showArchivedDocs == "true") { 53573 if (this.fieldObj.archivedParam == "true") { 53574 ifuParamVal = "all"; 53575 } else { 53576 ifuParamVal = this.fieldObj.ifuParam; 53577 } 53578 listType = "dynamic"; 53579 } 53580 console.log("ifuParamVal", ifuParamVal) 53581 $.ajax({ 53582 53583 url: "/dupont/getResourcesData", 53584 dataType: "json", 53585 cache: false, 53586 data: { 53587 searchPath: JSON.parse(this.fieldObj.resPaths), 53588 countryTag: countryTag, 53589 anonymousUser: user, 53590 sortType: this.fieldObj.sortResults, 53591 listType: listType, 53592 filterTags: JSON.parse(this.fieldObj.filterTags), 53593 filterLogic: this.fieldObj.filterLogic, 53594 filterParam: filterParam, 53595 ifuParam: ifuParamVal, 53596 excludeFilterTags: JSON.parse(this.fieldObj.excludeFilterTags), 53597 maxCountResources: [this.fieldObj.maxResultCountDocs, this.fieldObj.maxResultCountPages, this.fieldObj.maxResultCountImages, this.fieldObj.maxResultCountVideos] 53598 53599 }, 53600 success: function(result) { 53601 53602 if (result.resourcesData.length > 0) { 53603 53604 if (self.fieldObj.sortResults == 'title') { 53605 self.resData = result.resourcesData.sort(self.sortByTitle); 53606 } else { 53607 self.resData = result.resourcesData.sort(self.sortByLastModified); 53608 } 53609 } else { 53610 self.rfPrevComp.hide(); 53611 } 53612 53613 53614 callback(self); 53615 53616 }, 53617 error: function(e) { 53618 console.log("Error in Resources service call", e) 53619 if (self.resourceDataCall == 1) { 53620 self.getResourcesData(self.resourcesPaths, callback, data); 53621 } else { 53622 53623 callback(self); 53624 self.rfPrevComp.hide(); 53625 } 53626 // callback(self); 53627 } 53628 }); 53629 53630 53631 53632 }; 53633 53634 /*Create a list of doucments which are to be downloaded*/ 53635 rfPreviewComponent.prototype.addDocsToDownloadQueue = function(evnt) { 53636 let el = $(evnt.currentTarget); 53637 let docPath = el.attr('href'); 53638 evnt.preventDefault(); 53639 let downloadCartEL = $(".cmp-resFinder-Preview .dn-cart-container"); 53640 let expandCartEL = $(".cmp-resFinder-Preview .dn-expand-wrapper"); 53641 53642 if (!el.hasClass('selected')) { 53643 el.addClass('selected'); 53644 if (el.parent().hasClass('item-result')) { 53645 el.parent().prev().find('.select-res').addClass('selected'); 53646 } else { 53647 el.parent().parent().next().find('.select-res').addClass('selected'); 53648 } 53649 if (!rcDownloadDocsList.includes(docPath)) { 53650 rcDownloadDocsList.push(docPath); 53651 } 53652 53653 } else { 53654 el.removeClass('selected'); 53655 if (el.parent().hasClass('item-result')) { 53656 el.parent().prev().find('.select-res').removeClass('selected'); 53657 } else { 53658 el.parent().parent().next().find('.select-res').removeClass('selected'); 53659 } 53660 rcDownloadDocsList.splice(rcDownloadDocsList.indexOf(docPath), 1); 53661 53662 } 53663 53664 downloadCartEL.find('.file-count').text(rcDownloadDocsList.length); 53665 (rcDownloadDocsList.length > 0) ? downloadCartEL.show(): downloadCartEL.hide(); 53666 (rcDownloadDocsList.length >
53666 0) ? expandCartEL.show(): (expandCartEL.hide() && $(".dn-expand-wrapper .docs-list").removeClass('show')); 53667 this.prepareExpandCart(rcDownloadDocsList); 53668 53669 } 53670 53671 rfPreviewComponent.prototype.prepareExpandCart = function(rcDownloadDocsList) { 53672 let html = ''; 53673 rcDownloadDocsList.forEach(function(item, ind) { 53674 html += '<li><span class="doc-name" doc-path="' + item + '">' + $("a[href='" + item + "']").siblings('.res-name').text() + '</span><i class="remove-icon"></i></li>'; 53675 }) 53676 $(".cmp-resFinder-Preview .dn-expand-wrapper ul").html(html); 53677 53678 } 53679 53680 rfPreviewComponent.prototype.showHideExpandedCart = function(event) { 53681 $(".dn-expand-wrapper .docs-list").toggleClass('show'); 53682 53683 } 53684 53685 rfPreviewComponent.prototype.removeFromCart = function(event) { 53686 let el = $(event.currentTarget); 53687 let docPath = el.siblings('.doc-name').attr('doc-path'); 53688 rcDownloadDocsList.splice(rcDownloadDocsList.indexOf(docPath), 1); 53689 $("a[href='" + docPath + "']").removeClass('selected'); 53690 $(".select-res[href='" + docPath + "']").removeClass('selected'); 53691 el.parent().remove(); 53692 $(".cmp-resFinder-Preview .dn-cart-container").find('.file-count').text(rcDownloadDocsList.length); 53693 if ($(".docs-list li").length < 1) { 53694 this.showHideExpandedCart(); 53695 $(".cmp-resFinder-Preview .dn-cart-container, .cmp-resFinder-Preview .dn-expand-wrapper").hide(); 53696 } 53697 } 53698 53699 rfPreviewComponent.prototype.getParam = function(param, url_String) { 53700 if (url_String) { 53701 var url_string = url_String; 53702 } else { 53703 var url_string = window.location.href; //window.location.href 53704 } 53705 53706 var url = new URL(url_string); 53707 53708 return url.searchParams.get(param); 53709 }; 53710 53711 53712 rfPreviewComponent.prototype.setSignInLinks = function() { 53713 var signUpEl = this.rfPrevComp.find('.sign-up'); 53714 var signInEl = this.rfPrevComp.find('.sign-in'); 53715 var signInLink = signInEl.attr('href'); 53716 signInEl.attr('href', signInLink + '#ret-page-url=' + encodeURIComponent(window.location.href)); 53717 if (this.buParam) { 53718 var signupLink = signUpEl.attr('href'); 53719 signUpEl.attr('href', signupLink + '?BU=' + this.buParam); 53720 } 53721 53722 }; 53723 53724 rfPreviewComponent.prototype.signInLinkClickHandler = function(evnt) { 53725 this.rfPrevComp.find('#signin-model').show(); 53726 }; 53727 53728 rfPreviewComponent.prototype.downloadZipClickHandler = function(evnt) { 53729 let downloadCartEL = $(".cmp-resFinder-Preview .dn-cart-container"); 53730 if (!downloadCartEL.find('.doc-loader').hasClass('show')) { 53731 rc_Download_Zip(rcDownloadDocsList); 53732 downloadCartEL.find('.doc-loader').addClass('show'); 53733 } 53734 }; 53735 53736 53737 rfPreviewComponent.prototype.viewOrderBtnClickHandler = function(event) { 53738 var el = $(event.currentTarget); 53739 el.siblings('.fas').removeClass('active'); 53740 el.addClass('active'); 53741 if (el.attr('id') == 'blockOrder') { 53742 this.blockView = true; 53743 this.searchResultsContainer.find('.list-view').hide(); 53744 this.searchResultsContainer.find('.block-view').show(); 53745 } else { 53746 this.blockView = false; 53747 this.searchResultsContainer.find('.block-view').hide(); 53748 this.searchResultsContainer.find('.list-view').show(); 53749 } 53750 53751 53752 53753 }; 53754 53755 rfPreviewComponent.prototype.modelCloseBtnClickHandler = function(event) { 53756 53757 this.rfPrevComp.find('#video-model').hide(); 53758 this.rfPrevComp.find('#vid-container video').attr('src', ''); 53759 this.rfPrevComp.find('.model-bg').hide(); 53760 53761 }; 53762 53763 53764 rfPreviewComponent.prototype.playBtnClickHandler = function(event) { 53765 53766 var el = $(event.currentTarget); 53767 if (el.attr('data-type') == "video") { 53768 var src = el.attr('href'); 53769 event.preventDefault(); 53770 } else { 53771 var src = el.siblings('video').attr('src'); 53772 } 53773 53774 this.rfPrevComp.find('#vid-container video').attr('src', src); 53775 this.rfPrevComp.find('#video-model').show(); 53776 53777 }; 53778 53779 53780 /*To manage matching results display in search results block */ 53781 rfPreviewComponent.prototype.displayResults = function() { 53782 53783 var resDataList = this.resData; 53784 this.clearResults(); 53785 this.showResults(resDataList); 53786 53787 }; 53788 53789 53790 /*To clear results from search results block*/ 53791 rfPreviewComponent.prototype.clearResults = function() { 53792 this.searchResultsContainer.html(''); 53793 }; 53794 53795 // To sort array by title 53796 rfPreviewComponent.prototype.sortByTitle = function(a, b) { 53797 var titleA = a.title.trim().toUpperCase(); // ignore upper and lowercase 53798 var titleB = b.title.trim().toUpperCase(); // ignore upper and lowercase 53799 if (titleA < titleB) { 53800 return -1; 53801 } 53802 if (titleA > titleB) { 53803 return 1; 53804 } 53805 53806 // names must be equal 53807 return 0; 53808 }; 53809 53810 // To sort array by lastModified Date 53811 rfPreviewComponent.prototype.sortByLastModified = function(a, b) { 53812 53813 return new Date(b.lastmodified) - new Date(a.lastmodified); 53814 }; 53815 53816 /*To show results in search results block*/ 53817 rfPreviewComponent.prototype.showResults = function(searchResults) { 53818 var self = this; 53819 53820 $.each(searchResults, function(ind, val) { 53821 var htmlElmnt = ''; 53822 var path = val.path; 53823 var iconClass = ''; 53824 var thumbPath = val.path; 53825 thumbPath = thumbPath.replace(/\(/g, '\\('); 53826 thumbPath = thumbPath.replace(/\)/g, "\\)"); 53827 thumbPath = thumbPath.replace(/ /g, "%20"); 53828 var lastindex = path.lastIndexOf('/'); 53829 var fileName = lastindex > -1 ? path.substr(lastindex + 1, path.length) : ""; 53830 53831 if (val.format == 'cq:page') { 53832 var pathtype = "page"; 53833 53834 if (path.indexOf('.html') < 0) { 53835 path = path + '.html'; 53836 } 53837 // if (path.indexOf('webinars') > -1) { 53838 //var pathtype = "video"; 53839 // } 53840 53841 if ((val.path.indexOf('/secure/') > -1) || (val.path.indexOf('/secured/') > -1)) { 53842 53843 if (self.anonymousUser == true) { 53844 53845 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div><div class="lock-screen" data-file-name="' + fileName + '"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + '<span>' + Granite.I18n.get("To Unlock") + '</span></span></div> </div><div class="page-name"> <span data-type= ' + pathtype + '>' + val.title + '</span></div></div> <div class="item-result list-view"><span data-type=' + pathtype + ' ><div><h5>' + val.title + '</h5></div><div class="res-icon pages"></div></span><div class="hor-lock-screen" data-file-name="' + fileName + '"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 53846 53847 } else { 53848 53849 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> <div class="unlock-icon"></div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + '>' + val.title + '</a></div></div> <div class="item-result list-view"><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="unlocked-title"><h5>' + val.title + '</h5></div></a> <a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="res-icon pages"></div></a> <div class="hor-unlock-icon"></div></div>'; 53850 53851 } 53852 53853 }
53853 else if (val.path.indexOf('/validated/') > -1) { 53854 53855 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-3 validated"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + '>' + val.title + '</a></div></div> <div class="item-result list-view validated"><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="res-icon pages"></div></a></div>'; 53856 53857 53858 } else { 53859 53860 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + '>' + val.title + '</a></div></div> <div class="item-result list-view"><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="res-icon pages"></div></a></div>'; 53861 53862 } 53863 53864 53865 } else if (val.format.indexOf('image') > -1) { 53866 53867 53868 if (val.path.indexOf('/secure/') > -1) { 53869 53870 if (self.anonymousUser == true) { 53871 53872 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img"> <div class="thumb-img"> </div> <div class="lock-screen" data-file-name="' + fileName + '"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + '<span>' + Granite.I18n.get("To Unlock") + '</span></span> </div></div> <div class="img-name">' + val.title + '</div> </div> <div class="item-result list-view"><span><div><h5>' + val.title + '</h5></div><div class="res-icon images"></div></span> <div class="hor-lock-screen" data-file-name="' + fileName + '"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 53873 53874 } else { 53875 53876 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> <div class="unlock-icon"></div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> <div class="item-result list-view images"><a href="' + path + '" data-type="image" download><div class="unlocked-title"><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="image" class="select-res"><div class="select-box"></div><div class="res-icon images"></div></a> <div class="hor-unlock-icon"></div></div>'; 53877 53878 } 53879 53880 } else if (val.path.indexOf('/validated/') > -1) { 53881 53882 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-3 validated"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> <div class="item-result list-view validated images"><a href="' + path + '" data-type="image" target="_blank"><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="image" class="select-res"><div class="select-box"></div><div class="res-icon images"></div></a></div>'; 53883 53884 53885 } else { 53886 53887 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> <div class="item-result list-view images"><a href="' + path + '" data-type="image" target="_blank"><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="image" class="select-res"><div class="select-box"></div><div class="res-icon images"></div></a></div>'; 53888 53889 53890 } 53891 53892 53893 } else if (val.format.indexOf('video') > -1) { 53894 53895 53896 if (val.path.indexOf('/secure/') > -1) { 53897 53898 if (self.anonymousUser == true) { 53899 53900 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-3"> <video poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="lock-screen" data-file-name="' + fileName + '"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span> </div> <div class="vid-name-container top-set"> <span class="vid-name" >' + val.title + '</span></div></div> <div class="item-result list-view"><span><div><h5>' + val.title + '</h5></div><div class="res-icon videos"></div></span> <div class="hor-lock-screen" data-file-name="' + fileName + '"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 53901 53902 } else { 53903 53904 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-3"> <video src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="unlock-icon"></div><div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div> </div> <div class="item-result list-view"><a href="' + path + '" data-type="video" download><div class="unlocked-title"><h5>' + val.title + '</h5></div></a> <a href="' + path + '" data-type="video" download><div class="res-icon videos"></div></a> <div class="hor-unlock-icon"></div> </div>'; 53905 53906 } 53907 53908 }
53908 else if (val.path.indexOf('/validated/') > -1) { 53909 53910 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-3 validated"> <video src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div></div> <div class="item-result list-view validated"><a href="' + path + '" data-type="video" download><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="video" download><div class="res-icon videos"></div></a></div>'; 53911 53912 53913 } else { 53914 53915 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-3"> <video src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div></div> <div class="item-result list-view"><a href="' + path + '" data-type="video" download><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="video" download><div class="res-icon videos"></div></a></div>'; 53916 53917 53918 } 53919 53920 } else { 53921 var isDoc = true; 53922 var tagsString = val.tags.toString().toLowerCase(); 53923 var dataType = "document"; 53924 var showIFUClass = ""; 53925 if (val.format.indexOf('pdf') > -1) { 53926 iconClass = 'pdf'; 53927 } else if (val.format.indexOf('presentation') > -1) { 53928 iconClass = 'ppt'; 53929 } else if (val.format.indexOf('sheet') > -1) { 53930 iconClass = 'sheet'; 53931 } else if (val.format.indexOf('document') > -1 || val.format.indexOf('msword') > -1) { 53932 iconClass = 'doc'; 53933 } else if (val.format.indexOf('zip') > -1) { 53934 iconClass = 'zip'; 53935 isDoc = false; 53936 } else if (val.format.indexOf('exe') > -1) { 53937 iconClass = 'exe'; 53938 isDoc = false; 53939 } 53940 53941 if (self.fieldObj.showArchivedDocs == "true") { 53942 showIFUClass = "show-ifu"; 53943 } 53944 53945 53946 // if(isDoc && ((tagsString.indexOf('dupont:literature_type/case-study') >-1) || (tagsString.indexOf('dupont:literature_type/article')>-1))){ 53947 // dataType = "page"; 53948 //} 53949 53950 if (val.path.indexOf('/secure/') > -1) { 53951 53952 if (self.anonymousUser == true) { 53953 53954 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-3"><a data-type="' + dataType + '"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> <div class="lock-screen" data-file-name="' + fileName + '"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div> </div></a><div class="res-name">' + val.title + '</div> <div class="ifu-no ' + showIFUClass + '">IFU: ' + val.ifuNo + '</div> </div> <div class="item-result list-view"><span data-type="' + dataType + '"><div><h5>' + val.title + '</h5><div class="ifu-no ' + showIFUClass + '">IFU: ' + val.ifuNo + '</div></div><div class="res-icon ' + iconClass + '"></div></span> <div class="hor-lock-screen" data-file-name="' + fileName + '"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 53955 } else { 53956 53957 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-3"><a href="' + path + '" target="_blank" data-type="' + dataType + '"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="unlock-icon"></div><div class="res-name">' + val.title + '</div> <div class="ifu-no ' + showIFUClass + '">IFU: ' + val.ifuNo + '</div> <div class="res-download"><a href="' + path + '" data-type="' + dataType + '" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> <div class="item-result list-view docs"><a href="' + path + '" data-type="' + dataType + '" target="_blank"><div class="unlocked-title"><h5>' + val.title + '</h5><div class="ifu-no ' + showIFUClass + '">IFU: ' + val.ifuNo + '</div></div></a><a href="' + path + '" data-type="' + dataType + '" class="select-res"><div class="select-box"></div><div class="res-icon ' + iconClass + '"></div></a><div class="hor-unlock-icon"></div></div>'; 53958 53959 } 53960 53961 }
53961 else if (val.path.indexOf('/validated/') > -1) { 53962 53963 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-3 validated"><a href="' + path + '" target="_blank" data-type="' + dataType + '"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="res-name">' + val.title + '</div> <div class="ifu-no ' + showIFUClass + '">IFU: ' + val.ifuNo + '</div> <div class="res-download"><a href="' + path + '" data-type="' + dataType + '" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> <div class="item-result list-view validated docs"><a href="' + path + '" data-type="' + dataType + '" target="_blank"><div><h5>' + val.title + '</h5> <div class="ifu-no ' + showIFUClass + '">IFU: ' + val.ifuNo + '</div></div></a><a href="' + path + '" data-type="' + dataType + '" class="select-res"><div class="select-box"></div><div class="res-icon ' + iconClass + '"></div></a></div>'; 53964 53965 53966 } else { 53967 53968 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-3"><a href="' + path + '" target="_blank" data-type="' + dataType + '"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="res-name">' + val.title + '</div> <div class="ifu-no ' + showIFUClass + '">IFU: ' + val.ifuNo + '</div> <div class="res-download"><a href="' + path + '" data-type="' + dataType + '" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> <div class="item-result list-view docs"><a href="' + path + '" data-type="' + dataType + '" target="_blank"><div><h5>' + val.title + '</h5><div class="ifu-no ' + showIFUClass + '">IFU: ' + val.ifuNo + '</div></div></a><a href="' + path + '" data-type="' + dataType + '" class="select-res"><div class="select-box"></div><div class="res-icon ' + iconClass + '"></div></a></div>'; 53969 53970 } 53971 53972 53973 } 53974 53975 self.searchResultsContainer.append(htmlElmnt); 53976 53977 }); 53978 53979 53980 if (this.blockView) { 53981 this.searchResultsContainer.find('.block-view').show(); 53982 } else { 53983 this.searchResultsContainer.find('.list-view').show(); 53984 } 53985 53986 if (this.rfPrevComp.parent().hasClass('teal-color-icons')) { 53987 this.searchResultsContainer.find('a[data-type="page"]').attr('target', '_self'); 53988 } 53989 53990 53991 }; 53992 53993 53994 $.each($('.cmp-resFinder-Preview'), function(i, v) { 53995 $(v).addClass("Rfp-" + i); 53996 (new rfPreviewComponent("Rfp-" + i)).init(); 53997 53998 }); 53999 54000 54001}); 54002 54003$(function() { 54004 /*Resource finder extension component*/ 54005 54006 var rfExtensionComponent = function(compId) { 54007 this.rfExtComp = $($('.' + compId)[0]); 54008 if (this.rfExtComp.length > 0) { 54009 this.rfContainer = this.rfExtComp.find('#rf-ext-container'); 54010 this.resultsContainer = this.rfExtComp.find('.results-container'); 54011 this.bgColor = this.rfContainer.attr('data-attr-bgColor'); 54012 this.caption = this.rfContainer.attr('data-attr-caption'); 54013 this.ctaLabel = this.rfContainer.attr('data-attr-ctaLabel'); 54014 this.ctaUrl = this.rfContainer.attr('data-attr-ctaUrl'); 54015 this.filterLogic = this.rfContainer.attr('data-attr-filterLogic'); 54016 this.headline = this.rfContainer.attr('data-attr-headline'); 54017 this.listType = this.rfContainer.attr('data-attr-listType'); 54018 this.newtab = this.rfContainer.attr('data-attr-newtab'); 54019 this.paginationCount = this.rfContainer.attr('data-attr-paginationCount') ? parseInt(this.rfContainer.attr('data-attr-paginationCount')) : 0; 54020 this.signInPath = this.rfContainer.attr('data-attr-signInPath'); 54021 this.signUpPath = this.rfContainer.attr('data-attr-signUpPath'); 54022 this.sortResults = this.rfContainer.attr('data-attr-sortResults'); 54023 this.view = this.rfContainer.attr('data-attr-view'); 54024 this.viewIcons = this.rfContainer.attr('data-attr-viewIcons');
54025 this.viewType = this.rfContainer.attr('data-attr-viewType'); 54026 this.filterTags = this.rfContainer.attr('data-attr-filterTags'); 54027 this.mandatoryTags = this.rfContainer.attr('data-attr-mandatoryTags'); 54028 this.resCountAudios = this.rfContainer.attr('data-attr-resCountAudios'); 54029 this.resCountDocs = this.rfContainer.attr('data-attr-resCountDocs'); 54030 this.resCountImages = this.rfContainer.attr('data-attr-resCountImages'); 54031 this.resCountPages = this.rfContainer.attr('data-attr-resCountPages'); 54032 this.resCountVideos = this.rfContainer.attr('data-attr-resCountVideos'); 54033 this.resCountwebinars = this.rfContainer.attr('data-attr-resCountwebinars'); 54034 this.resPaths = JSON.parse(this.rfContainer.attr('data-attr-resPaths')); 54035 this.cfPaths = JSON.parse(this.rfContainer.attr('data-attr-cfPaths')); 54036 this.filtersObjList = JSON.parse(this.rfContainer.attr('data-attr-filtersObjList')); 54037 this.loadMoreBtn = this.rfExtComp.find('.cta-container'); 54038 this.resData = []; 54039 this.currentresultCount = 0; 54040 this.sortUp = true; 54041 54042 54043 } 54044 54045 54046 }; 54047 54048 /*To bind events with handlers*/ 54049 54050 rfExtensionComponent.prototype.bindEvents = function() { 54051 var self = this; 54052 this.rfContainer.on('click', '.sort-by div', $.proxy(this.sortBtnsClickHandler, this)); 54053 this.rfContainer.on('click', '.load-more-cta', $.proxy(this.loadMoreBtnClickHandler, this)); 54054 this.rfContainer.on('click', '.filter-btn', $.proxy(this.filterBtnClickHandler, this)); 54055 this.rfContainer.on('click', '.play-icon, .wb-video', $.proxy(this.playBtnClickHandler, this)); 54056 this.rfExtComp.on('click', '.model-close-btn, .model-bg', $.proxy(this.modelCloseBtnClickHandler, this)); 54057 this.rfExtComp.on('click', '.audio-play, .fa-headphones-alt', $.proxy(this.audioPlayBtnClickHandler, this)); 54058 54059 54060 54061 }; 54062 54063 54064 /*To remove data from html attributes*/ 54065 54066 rfExtensionComponent.prototype.removeData = function() { 54067 54068 this.rfContainer.removeAttr('data-attr-bgColor'); 54069 this.rfContainer.removeAttr('data-attr-caption'); 54070 this.rfContainer.removeAttr('data-attr-ctaLabel'); 54071 this.rfContainer.removeAttr('data-attr-ctaUrl'); 54072 this.rfContainer.removeAttr('data-attr-filterLogic'); 54073 this.rfContainer.removeAttr('data-attr-headline'); 54074 this.rfContainer.removeAttr('data-attr-listType'); 54075 this.rfContainer.removeAttr('data-attr-newtab'); 54076 this.rfContainer.removeAttr('data-attr-paginationCount'); 54077 this.rfContainer.removeAttr('data-attr-signInPath'); 54078 this.rfContainer.removeAttr('data-attr-signUpPath'); 54079 this.rfContainer.removeAttr('data-attr-sortResults'); 54080 this.rfContainer.removeAttr('data-attr-view'); 54081 this.rfContainer.removeAttr('data-attr-viewIcons'); 54082 this.rfContainer.removeAttr('data-attr-viewType'); 54083 this.rfContainer.removeAttr('data-attr-filterTags'); 54084 this.rfContainer.removeAttr('data-attr-mandatoryTags'); 54085 this.rfContainer.removeAttr('data-attr-resCountAudios'); 54086 this.rfContainer.removeAttr('data-attr-resCountDocs'); 54087 this.rfContainer.removeAttr('data-attr-resCountImages'); 54088 this.rfContainer.removeAttr('data-attr-resCountPages'); 54089 this.rfContainer.removeAttr('data-attr-resCountVideos'); 54090 this.rfContainer.removeAttr('data-attr-resCountwebinars'); 54091 this.rfContainer.removeAttr('data-attr-resPaths'); 54092 this.rfContainer.removeAttr('data-attr-cfPaths'); 54093 this.rfContainer.removeAttr('data-attr-filtersObjList'); 54094 }; 54095 54096 54097 54098 /*To intiate component execution*/ 54099 rfExtensionComponent.prototype.init = function() { 54100 if (this.rfExtComp.length > 0) { 54101 var self = this; 54102 this.removeData(); 54103 this.bindEvents(); 54104 //this.checkUserLogin(this.fetchData); 54105 this.fetchData(this); 54106 54107 } 54108 54109 }; 54110 54111 /*To check fro user login*/ 54112 rfExtensionComponent.prototype.fetchData = function(self, data) { 54113 self.resourceDataCall = 0; 54114 self.getResourcesData(self.resPaths, self.initiateExecution, data); 54115 //self.getCFsData(self.cfPaths, self.initiateExecution, data); 54116 }; 54117 54118 54119 /*To check for user login*/ 54120 rfExtensionComponent.prototype.checkUserLogin = function(callback) { 54121 var self = this; 54122 54123 $.ajax({ 54124 type: "GET", 54125 url: "/dupont/userService", 54126 dataType: "json", 54127 contentType: "application/json", 54128 cache: false, 54129 success: function(data) { 54130 54131 if (data.anonymousUser == false) { 54132 self.anonymousUser = false;
54133 } 54134 callback(self, data); 54135 }, 54136 error: function(data) { 54137 console.log("Error in user login service::" + data); 54138 callback(self, data); 54139 } 54140 54141 }); 54142 }; 54143 54144 54145 54146 /*To fetch resources data*/ 54147 54148 rfExtensionComponent.prototype.getResourcesData = function(resPaths, callback, data, isCache) { 54149 54150 var tags = []; 54151 var self = this; 54152 //var user = (data.anonymousUser == true) ? false : true; 54153 var filtertags = []; 54154 var mandatoryTags = []; 54155 var getFromCache = (isCache == false) ? false : true; 54156 if (this.listType != "fixed") { 54157 filtertags = this.filterTags != undefined ? this.filterTags.split(',') : []; 54158 mandatoryTags = this.mandatoryTags != undefined ? this.mandatoryTags.split(',') : []; 54159 } 54160 54161 this.resCountDocs = ((this.resCountDocs == undefined) || (this.listType == "fixed")) ? 2500 : this.resCountDocs; 54162 this.resCountPages = ((this.resCountPages == undefined) || (this.listType == "fixed")) ? 2500 : this.resCountPages; 54163 this.resCountImages = ((this.resCountImages == undefined) || (this.listType == "fixed")) ? 2500 : this.resCountImages; 54164 this.resCountVideos = ((this.resCountVideos == undefined) || (this.listType == "fixed")) ? 2500 : this.resCountVideos; 54165 this.resCountAudios = ((this.resCountAudios == undefined) || (this.listType == "fixed")) ? 2500 : this.resCountAudios; 54166 this.resCountwebinars = ((this.resCountwebinars == undefined) || (this.listType == "fixed")) ? 2500 : this.resCountwebinars; 54167 54168 self.resourceDataCall++ ; 54169 $.ajax({ 54170 54171 url: "/dupont/getExtendedResourcesData", 54172 dataType: "json", 54173 cache: getFromCache, 54174 //async:false, 54175 data: { 54176 searchPath: this.resPaths, 54177 cfPaths: this.cfPaths, 54178 locale: this.pageLocale, 54179 anonymousUser: false, 54180 sortType: this.sortResults, 54181 maxCountDocs: this.resCountDocs, 54182 maxCountPages: this.resCountPages, 54183 maxCountImages: this.resCountImages, 54184 maxCountVideos: this.resCountVideos, 54185 maxCountAudios: this.resCountAudios, 54186 maxCountWebinars: this.resCountwebinars, 54187 listType: this.listType, 54188 filterTags: filtertags, 54189 mandatoryTags:mandatoryTags, 54190 filterLogic: this.filterLogic, 54191 view: this.view 54192 54193 }, 54194 success: function(result) { 54195 54196 if (result.resourcesData.length > 0) { 54197 54198 if (self.sortResults == "title") { 54199 self.resData = result.resourcesData.sort(self.sortByTitle); 54200 } else if (self.sortResults == "last-modified-date") { 54201 self.resData = result.resourcesData.sort(self.sortByLastModified); 54202 } else { 54203 self.resData = result.resourcesData.sort(self.sortByCreationDate); 54204 } 54205 callback(self); 54206 54207 }else if((self.resourceDataCall == 1 || self.resourceDataCall == 2)){ 54208 self.getResourcesData(self.resPaths, callback, data, false); 54209 }else{ 54210 callback(self); 54211 } 54212 54213 54214 54215 }, 54216 error: function(e) { 54217 console.log("Error in Resources service call", e) 54218 if(self.resourceDataCall == 1){ 54219 self.getResourcesData(self.resPaths, callback, data, false); 54220 }else{ 54221 54222 callback(self); 54223 //self.rfPrevComp.hide(); 54224 } 54225 //callback(self); 54226 } 54227 }); 54228 54229 54230 54231 }; 54232 54233 54234 /*To intiate component execution*/ 54235 rfExtensionComponent.prototype.initiateExecution = function(self) { 54236 self.createFilters(); 54237 self.displayResults(self.resData); 54238 var filterTag = self.getParam('filter'); 54239 if (filterTag) { 54240 self.rfContainer.find("[data-attr-id='" + filterTag.toLowerCase() + "']").trigger('click'); 54241 } 54242 $(window).resize(function() { 54243 self.setListItemsHeight(); 54244 }); 54245 54246 //self.setSignInLinks(); 54247 if(self.view == "product" && self.viewType == "grid"){ 54248 self.resultsContainer.addClass('product-list'); 54249 } 54250 54251 }; 54252 54253 // To create filters 54254 rfExtensionComponent.prototype.createFilters = function() { 54255 var html = ''; 54256 54257 $.each(this.filtersObjList, function(i, v) { 54258 html += '<div class="filter-btn col-lg-4 col-md-6 col-sm-6" data-attr-id="' + (v.tagId).toLowerCase() + '" title="'+v.label+'"><div>' + v.label + '</div></div>'; 54259 }); 54260 this.rfContainer.find('.filters-container').html(html); 54261 }; 54262 54263 54264 rfExtensionComponent.prototype.getParam = function(param, url_String) { 54265 if (url_String) { 54266 var url_string = url_String; 54267 } else { 54268 var url_string = window.location.href; //window.location.href 54269 } 54270 54271 var url = new URL(url_string); 54272 54273 return url.searchParams.get(param); 54274 }; 54275 54276 54277 // To sort array by title 54278 rfExtensionComponent.prototype.sortByTitle = function(a, b) { 54279 var titleA = a.title.trim().toUpperCase(); // ignore upper and lowercase 54280 var titleB = b.title.trim().toUpperCase(); // ignore upper and lowercase 54281 if (titleA < titleB) { 54282 return -1; 54283 } 54284 if (titleA > titleB) { 54285 return 1; 54286 } 54287 54288 // names must be equal 54289 return 0; 54290 }; 54291 54292 // To sort array by lastModified Date 54293 rfExtensionComponent.prototype.sortByLastModified = function(a, b) { 54294 54295 return new Date(b.lastmodified) - new Date(a.lastmodified); 54296 }; 54297 54298 // To sort array by Creation Date 54299 rfExtensionComponent.prototype.sortByCreationDate = function(a, b) { 54300 return new Date(b.createdDate) - new Date(a.createdDate); 54301 }; 54302 54303 rfExtensionComponent.prototype.audioPlayBtnClickHandler = function(event) { 54304 event.preventDefault(); 54305 var el = $(event.currentTarget); 54306 var self = this; 54307 if(el.hasClass('dn-icon')){ 54308 var src = el.parent().siblings('.res-name').find('a').attr('href'); 54309 var title = el.parent().siblings('.res-name').find('a').text(); 54310 }else{ 54311 var src = el.attr('href'); 54312 var title = el.text(); 54313 } 54314 54315 var lastDotIndex = src.lastIndexOf('.'); 54316 var audioFileType = src.substr(lastDotIndex + 1, src.length); 54317 if (audioFileType.length < 3) { 54318 audioFileType = "mp3"; 54319 } 54320 54321 54322 this.rfExtComp.find('#video-audio-model').show(); 54323 54324 this.rfExtComp.find('#video-audio-model #audio-container').css('display', 'flex'); 54325 54326 54327 $("#jquery_jplayer_rfe").jPlayer({ 54328 ready: function() { 54329 var ready = true; 54330 var obj = { 54331 title: title, 54332 mp3: src 54333 }; 54334 switch (audioFileType) { 54335 case "m4a": 54336 obj = { 54337 title: title, 54338 m4a: src 54339 }; 54340 break; 54341 54342 case "webma": 54343 obj = { 54344 title: title, 54345 webma: src 54346 }; 54347 break; 54348 54349 54350 case "oga": 54351 obj = { 54352 title: title, 54353 oga: src 54354 }; 54355 break; 54356 54357 54358 case "fla": 54359 obj = { 54360 title: title, 54361 fla: src 54362 }; 54363 break; 54364 54365 case "wav": 54366 obj = { 54367 title: title, 54368 wav: src 54369 }; 54370 break; 54371 54372 } 54373 54374 $(this).jPlayer("setMedia", obj); 54375 $(this).jPlayer("play"); 54376 54377 }, 54378 54379 loadeddata: function(event) { // calls after setting the song duration 54380 songDuration = event.jPlayer.status.duration; 54381 }, 54382 54383 swfPath: "dist/jplayer", 54384 supplied: "mp3", 54385 wmode: "window", 54386 useStateClassSkin: true, 54387 autoBlur: false, 54388 smoothPlayBar: true, 54389 keyEnabled: true, 54390 remainingDuration: true, 54391 toggleDuration: true, 54392 play: function(e){ 54393 var jpContainer = $(self.rfExtComp).find('#jp_container_1');
54394 if(!jpContainer.hasClass('jp-state-playing')){ 54395 jpContainer.addClass('jp-state-playing'); 54396 } 54397 }, 54398 pause: function(e){ 54399 var jpContainer = $(self.rfExtComp).find('#jp_container_1'); 54400 if(jpContainer.hasClass('jp-state-playing')){ 54401 jpContainer.removeClass('jp-state-playing'); 54402 } 54403 } 54404 }); 54405 54406 54407 54408 }; 54409 54410 54411 54412 54413 rfExtensionComponent.prototype.playBtnClickHandler = function(event) { 54414 54415 var el = $(event.currentTarget); 54416 if (el.attr('data-type') == "video" || el.attr('data-type') == "webinar") { 54417 var src = el.attr('href'); 54418 event.preventDefault(); 54419 } else { 54420 var src = el.siblings('video').attr('src'); 54421 } 54422 54423 this.rfExtComp.find('#vid-container video').attr('src', src); 54424 this.rfExtComp.find('#video-audio-model, #video-audio-model #vid-container').show(); 54425 54426 54427 }; 54428 54429 /*To handle load more button click*/ 54430 54431 rfExtensionComponent.prototype.loadMoreBtnClickHandler = function(evnt) { 54432 54433 if ((this.currentresultCount < this.paginationArr.length) && !$(evnt.target).attr('href')) { 54434 //this.currentresultCount+=this.resultPageSize; 54435 var currentScrollTop = $(window).scrollTop(); 54436 window.scrollTo(0, currentScrollTop); 54437 if ((this.currentresultCount + this.paginationCount) < this.paginationArr.length) { 54438 this.pagination(this.paginationArr, this.currentresultCount, this.currentresultCount + this.paginationCount); 54439 54440 } else { 54441 this.pagination(this.paginationArr, this.currentresultCount, this.paginationArr.length); 54442 } 54443 54444 54445 /*if (this.blockOrderBtn.hasClass('active')) { 54446 this.searchResultsContainer.find('.col-sm-12').removeClass('col-sm-12').addClass('col-lg-4').addClass('col-md-6'); 54447 }*/ 54448 54449 54450 54451 } 54452 }; 54453 54454 // To handle sorting icons click 54455 rfExtensionComponent.prototype.sortBtnsClickHandler = function(evnt) { 54456 54457 if ($(evnt.target).hasClass('up-arrow')) { 54458 if (!this.sortUp) { 54459 this.paginationArr.reverse(); 54460 this.displayResults(this.paginationArr); 54461 this.sortUp = true; 54462 } 54463 } else { 54464 if (this.sortUp) { 54465 this.paginationArr.reverse(); 54466 this.displayResults(this.paginationArr); 54467 this.sortUp = false; 54468 } 54469 } 54470 54471 54472 54473 }; 54474 54475 rfExtensionComponent.prototype.modelCloseBtnClickHandler = function(evnt) { 54476 54477 var el = $(evnt.target); 54478 54479 if ((el.hasClass('model-bg') || el.hasClass('model-close-btn'))) { 54480 54481 if (!this.rfExtComp.find('#video-audio-model').is(":hidden")) { 54482 this.rfExtComp.find('#vid-container video').attr('src', ''); 54483 var videoEl = this.rfExtComp.find('#vid-container video')[0]; 54484 if (videoEl.muted == true) { 54485 videoEl.muted = false; 54486 } 54487 } 54488 if (!this.rfExtComp.find('#audio-container').is(":hidden")) { 54489 $('#jquery_jplayer_rfe').jPlayer("destroy") 54490 } 54491 54492 this.rfExtComp.find('.model-bg').hide(); 54493 this.rfExtComp.find('.model-bg').children('#vid-container, #audio-container').hide(); 54494 54495 } 54496 54497 }; 54498 54499 /*To set list items height*/ 54500 rfExtensionComponent.prototype.filterBtnClickHandler = function(evnt) { 54501 var el = $(evnt.currentTarget); 54502 var tagID = el.attr('data-attr-id'); 54503 if(el.hasClass('active')){ 54504 el.removeClass('active'); 54505 this.displayResults(this.resData); 54506 }else{ 54507 54508 this.rfContainer.find('.filter-btn').removeClass('active'); 54509 el.addClass('active'); 54510 var results = this.getFilteredResults(this.resData, tagID); 54511 this.displayResults(results); 54512 } 54513 54514 54515 }; 54516 54517 /*To set list items height*/ 54518 rfExtensionComponent.prototype.getFilteredResults = function(results, tagId) { 54519 54520 var filteredResults = []; 54521 54522 for (var i = 0; i < results.length; i++) { 54523 if (results[i].tags) { 54524 if ((JSON.stringify(results[i].tags).toLowerCase()).indexOf('"' + tagId.toLowerCase() + '"') > -1) { 54525 filteredResults.push(results[i]); 54526 } 54527 } 54528 } 54529 54530 54531 return filteredResults; 54532 }; 54533 54534 54535 /*To set list items height*/ 54536 rfExtensionComponent.prototype.setListItemsHeight = function() { 54537 54538 $.each(this.resultsContainer.find('.product .bg-img'), function(i, v) { 54539 $(v).css('height', $(v).width()); 54540 $(v).find('.res-img').css('height', $(v).width()); 54541 }) 54542 54543 }; 54544 54545 /*To initiate rendering results function*/ 54546 rfExtensionComponent.prototype.displayResults = function(results) { 54547 this.clearResults(); 54548 if (results.length > 0) {
54549 this.rfContainer.find('#noResultFound').hide(); 54550 this.paginationArr = results; 54551 if (this.ctaLabel && this.ctaUrl) { 54552 this.showResults(results); 54553 } else if (this.ctaLabel) { 54554 this.pagination(results, 0, this.paginationCount); 54555 } else { 54556 this.showResults(results); 54557 } 54558 } else { 54559 this.rfContainer.find('#noResultFound').show(); 54560 this.pagination([], 0, 0); 54561 } 54562 }; 54563 54564 /*To clear results*/ 54565 rfExtensionComponent.prototype.clearResults = function() { 54566 this.resultsContainer.html(''); 54567 }; 54568 54569 /*To handle pagination*/ 54570 rfExtensionComponent.prototype.pagination = function(searchResults, startResultCount, toResultCount) { 54571 var resultsSet = searchResults.slice(startResultCount, toResultCount); 54572 // this.currentResultsCountContainer.html(toResultCount); 54573 this.currentresultCount = toResultCount; 54574 this.showResults(resultsSet); 54575 54576 if (toResultCount >= searchResults.length) { 54577 this.loadMoreBtn.hide(); 54578 } else { 54579 this.loadMoreBtn.show(); 54580 } 54581 54582 54583 }; 54584 54585 54586 54587 /* To render results*/ 54588 rfExtensionComponent.prototype.showResults = function(searchResults) { 54589 var self = this; 54590 54591 $.each(searchResults, function(ind, val) { 54592 var htmlElmnt = ''; 54593 var path = val.path; 54594 var iconClass = ''; 54595 var thumbPath = val.path; 54596 thumbPath = thumbPath.replace(/\(/g, '\\('); 54597 thumbPath = thumbPath.replace(/\)/g, "\\)"); 54598 var lastindex = path.lastIndexOf('/'); 54599 var fileName = lastindex > -1 ? path.substr(lastindex + 1, path.length) : ""; 54600 var gridClasses = ''; 54601 54602 switch (self.view) { 54603 case "article": 54604 gridClasses = 'article col-sm-12 col-md-12 col-lg-12'; 54605 break; 54606 case "product": 54607 gridClasses = 'product col-sm-6 col-md-4 col-lg-4'; 54608 break; 54609 case "video": 54610 gridClasses = 'video col-sm-6 col-md-4 col-lg-4'; 54611 break; 54612 case "podcast": 54613 gridClasses = 'audio col-sm-6 col-md-4 col-lg-3'; 54614 break; 54615 case "webinar": 54616 gridClasses = 'webinar'; 54617 break; 54618 default: 54619 gridClasses = 'col-sm-6 col-md-4 col-lg-3'; 54620 } 54621 54622 if (val.format == 'cq:page') { 54623 var pathtype = "page"; 54624 54625 if (path.indexOf('.html') < 0) { 54626 path = path + '.html'; 54627 } 54628 54629 if ((self.view == "article") || (self.view == "product")) { 54630 thumbPath = val.teaserImage; 54631 }else{ 54632 thumbPath = thumbPath+'.thumb.319.319.png' ; 54633 } 54634 54635 if (self.view == "article") { 54636 var eyebrowTxt = ''; 54637 var desc = ''; 54638 if (self.rfExtComp.find('.filter-btn.active').length > 0) { 54639 eyebrowTxt = self.rfExtComp.find('.filter-btn.active').text(); 54640 } 54641 if (val.description && val.description != "null") { 54642 desc = val.description; 54643 } 54644 54645 htmlElmnt += '<div class="res-list block-view ' + gridClasses + '"> <div class="bg-img page col-sm-12 col-md-6 col-lg-6"><div class="res-img" style="background-image:url(' + thumbPath + ') "> </div> </div><div class="page-name col-sm-12 col-md-6 col-lg-6"> <span class="eyebrow">' + eyebrowTxt + ' </span> <a href="' + path + '" target="_blank" data-type= ' + pathtype + ' >' + val.title + ' <span class="fas fa-long-arrow-alt-right"></span></a><span class="dvdr"></span><span class="desc">' + desc + '</span></div></div> <div class="item-result list-view"><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="res-icon pages"></div></a></div>'; 54646 54647 } else { 54648 htmlElmnt += '<div class="res-list block-view ' + gridClasses + '"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + ') "> </div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + ' >' + val.title + ' <span class="fas fa-long-arrow-alt-right"></span></a></div></div> <div class="item-result list-view"><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="res-icon pages"></div></a></div>'; 54649 } 54650 54651 54652 54653 } else if (val.format.indexOf('image') > -1) { 54654 54655 htmlElmnt += '<div class="image-list block-view ' + gridClasses + '"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" download><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> <div class="item-result list-view"><a href="' + path + '" data-type="image" download><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="image" download><div class="res-icon images"></div></a></div>'; 54656 54657 54658 } else if (val.format.indexOf('video') > -1) { 54659 54660 htmlElmnt += '<div class="video-list block-view ' + gridClasses + '"> <video src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div></div> <div class="item-result list-view"><a href="' + path + '" data-type="video" download><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="video" download><div class="res-icon videos"></div></a></div>'; 54661 54662 54663 } else if (val.format.indexOf('audio') > -1 ) { 54664 var desc = ''; 54665 if (val.description) { 54666 desc = val.description; 54667 } 54668 iconClass = "audio-icon" 54669 htmlElmnt += '<div class="res-list audio-list doc-list block-view ' + gridClasses + '"><div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div><div class="res-name"> <a href="' + path + '" target="_blank" class="audio-play" data-type= "audio" title="'+val.title+'"> <div>' + val.title + '</div> <span class="fas fa-long-arrow-alt-right"></span></a></div> <div class="res-download"><div class="dn-icon fas fa-headphones-alt"></div><span>' + desc + ' </span></div></div> <div class="item-result list-view"><a class="audio-play" href="' + path + '" data-type="audio" download><div><h5>' + val.title + '</h5></div></a><a class="audio-play" href="' + path + '" data-type="audio" download><div class="res-icon ' + iconClass + '"></div></a></div>'; 54670 54671 54672 } else if ((val.format.indexOf('content-fragment') > -1) || (val.format.indexOf('webinar') > -1)) { 54673 54674 var viewclass = "wb-list-view"; 54675 var day = "";
54676 var month = ""; 54677 var time = ""; 54678 var dataType = ""; 54679 var desc = ""; 54680 var ctaHtml = ''; 54681 54682 if(val.format.indexOf('webinar') > -1){ 54683 var ctaText = "WATCH NOW"; 54684 var url = val.path ; 54685 dataType = "wb-video"; 54686 54687 if(self.viewType == "grid" || (self.view == "default" && self.viewType == "grid")){ 54688 viewclass = "wb-grid-view"; 54689 day = Granite.I18n.get("ON"); 54690 time = Granite.I18n.get("DEMAND"); 54691 }else{ 54692 month = Granite.I18n.get("ON") ; 54693 day = Granite.I18n.get("DEMAND"); 54694 } 54695 54696 54697 }else{ 54698 var ctaText = "REGISTER"; 54699 var url = val.url ; 54700 var date = new Date(val.date); 54701 if(date){ 54702 day = (date).getUTCDate(); 54703 var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; 54704 month = months[(date).getUTCMonth()]; 54705 } 54706 54707 if(val.time && val.time!="null"){ 54708 time = val.time; 54709 } 54710 54711 if(self.viewType == "grid" || (self.view == "default" && self.viewType == "grid") ){ 54712 viewclass = "wb-grid-view"; 54713 if(date){ 54714 day = month+" "+day+", "+(date).getUTCFullYear(); 54715 } 54716 } 54717 } 54718 54719 if (val.description) { 54720 desc = val.description; 54721 } 54722 54723 if(url && url != "null"){ 54724 var ctaHtml = '<a href="'+url+'" class="'+dataType+'" data-type="webinar">'+Granite.I18n.get(ctaText)+'<span class="fa fa-long-arrow-alt-right"></span> </a>' ; 54725 } 54726 54727 //iconClass = "audio-icon" 54728 htmlElmnt += '<div class="'+viewclass+' '+self.view+'"><div class="date-block"><div class="month">'+month.toUpperCase()+'</div><div class="day">'+day+'</div><div class="time">'+time+'</div></div><div class="middle-col"><div class="title">'+val.title+'</div><div class="description">'+desc+'</div></div><div class="btn-block">'+ctaHtml+'</div></div>'; 54729 54730 } 54731 else { 54732 var isDoc = true; 54733 // var tagsString = val.tags.toString().toLowerCase(); 54734 var dataType = "document"; 54735 if (val.format.indexOf('pdf') > -1) { 54736 iconClass = 'pdf'; 54737 } else if (val.format.indexOf('presentation') > -1) { 54738 iconClass = 'ppt'; 54739 } else if (val.format.indexOf('sheet') > -1) { 54740 iconClass = 'sheet'; 54741 } else if (val.format.indexOf('document') > -1 || val.format.indexOf('msword') > -1) { 54742 iconClass = 'doc'; 54743 } 54744 54745 54746 htmlElmnt += '<div class="res-list doc-list block-view ' + gridClasses + '"><a href="' + path + '" target="_blank" data-type="' + dataType + '"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="res-name">' + val.title + '</div> <div class="res-download"><a href="' + path + '" data-type="' + dataType + '" download><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> <div class="item-result list-view"><a href="' + path + '" data-type="' + dataType + '" download><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="' + dataType + '" download><div class="res-icon ' + iconClass + '"></div></a></div>'; 54747 54748 54749 54750 } 54751 54752 self.resultsContainer.append(htmlElmnt); 54753 if (self.viewType == "list") { 54754 self.resultsContainer.find('.list-view').show(); 54755 54756 } else { 54757 self.resultsContainer.find('.block-view').show(); 54758 } 54759 self.setListItemsHeight(); 54760 54761 }); 54762 }; 54763 54764 54765 let rfExtCompObj = new rfExtensionComponent(); 54766 54767 /*initiate execution*/ 54768 $.each($('.cmp-rf-extension'), function(i, v) { 54769 $(v).addClass("Rfe-" + i); 54770 (new rfExtensionComponent("Rfe-" + i)).init(); 54771 54772 }); 54773 54774 54775 54776}); 54777 54778let rcIndexedDb = function() { 54779 this.db; 54780 this.create(); 54781 54782} 54783 54784 54785 54786rcIndexedDb.prototype.create = function() { 54787 let self = this; 54788 54789 //prefixes of implementation that we want to test 54790 window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; 54791 54792 //prefixes of window.IDB objects 54793 window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction; 54794 window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange; 54795 54796 if (!window.indexedDB) { 54797 console.log("Your browser doesn't support a stable version of IndexedDB."); 54798 } 54799 54800 let request = window.indexedDB.open("RCDatabase", 1); 54801 54802 request.onerror = function(event) { 54803 console.log("error: in db creation"); 54804 }; 54805 54806 request.onsuccess = function(event) { 54807 self.db = request.result; 54808 //console.log("success: " + self.db); 54809 }; 54810
54811 request.onupgradeneeded = function(event) { 54812 self.db = event.target.result; 54813 let objectStore = self.db.createObjectStore("rcdata", { 54814 keyPath: "id" 54815 }); 54816 54817 } 54818 54819} 54820 54821rcIndexedDb.prototype.read = function(buname) { 54822 return new Promise((resolve, reject) => { 54823 let transaction = this.db.transaction(["rcdata"]); 54824 let objectStore = transaction.objectStore("rcdata"); 54825 let request = objectStore.get(buname); 54826 let isError = false; 54827 54828 request.onerror = function(event) { 54829 console.log("Unable to retrieve data from database!"); 54830 }; 54831 54832 request.onsuccess = function(event) { 54833 // Do something with the request.result! 54834 if (request.result) { 54835 resolve(request.result); 54836 //console.log("Resources: ", request.result.resourcesdata ," Tag mapping: ",request.result.tagmapping ," Anonymous user: ",request.result.anonymoususer ,"TimeStamp",request.result.timsestamp); 54837 } else { 54838 console.log("Requested result couldn't be found in your database!"); 54839 reject("error"); 54840 } 54841 }; 54842 }); 54843 54844} 54845 54846rcIndexedDb.prototype.readAll = function() { 54847 var objectStore = this.db.transaction("rcdata").objectStore("rcdata"); 54848 54849 objectStore.openCursor().onsuccess = function(event) { 54850 var cursor = event.target.result; 54851 54852 if (cursor) { 54853 //console.log("Data for id " + cursor.key + " is " + cursor.value.docs); 54854 console.log("Data for id " + cursor.key + " is - " + "Resources: ", request.result.resourcesdata ," Tag mapping: ",request.result.tagmapping ," Anonymous USer: ",request.result.anonymoususer ,"TimeStamp",request.result.timsestamp); 54855 cursor.continue(); 54856 } else { 54857 console.log("No more entries!"); 54858 } 54859 }; 54860 54861} 54862 54863rcIndexedDb.prototype.add = function(buName,resourcesData,tagIDTitlesList,anonymousUser,timeStamp) { 54864 54865 var request = this.db.transaction(["rcdata"], "readwrite").objectStore("rcdata").add({ 54866 id: buName, 54867 resourcesdata: resourcesData, 54868 tagmapping:tagIDTitlesList, 54869 anonymoususer:anonymousUser, 54870 timsestamp:timeStamp 54871 }); 54872 54873 request.onsuccess = function(event) { 54874 //console.log("Record has been added to your database."); 54875 }; 54876 54877 request.onerror = function(event) { 54878 console.log("Unable to add. Record aready exist in your database! "); 54879 } 54880} 54881 54882rcIndexedDb.prototype.remove = function(buname) { 54883 var request = this.db.transaction(["rcdata"], "readwrite") 54884 .objectStore("rcdata") 54885 .delete(buname); 54886 54887 request.onsuccess = function(event) { 54888 //console.log("Record has been removed from your database."); 54889 }; 54890 54891} 54892 54893 54894rcIndexedDb.prototype.deleteDBStore = function() { 54895 54896 return new Promise((resolve, reject) => { 54897 var req = this.db.transaction("rcdata", 'readwrite').objectStore("rcdata").clear(); 54898 req.onsuccess = function () { 54899 console.log("Deleted indexdb store successfully"); 54900 resolve(req.result); 54901 }; 54902 req.onerror = function () { 54903 console.log("Couldn't delete indexdb store"); 54904 reject("error"); 54905 }; 54906 req.onblocked = function () { 54907 console.log("Couldn't delete indexdb store due to the operation being blocked"); 54908 reject("error"); 54909 }; 54910 }) 54911 54912} 54913 54914 54915let rcIndexDbObj = new rcIndexedDb(); 54916 54917 54918/* @license 54919 * jQuery.print, version 1.6.0 54920 * (c) Sathvik Ponangi, Doers' Guild 54921 * Licence: CC-By (http://creativecommons.org/licenses/by/3.0/) 54922 *--------------------------------------------------------------------------*/ 54923(function ($) { 54924 "use strict"; 54925 // A nice closure for our definitions 54926 54927 function jQueryCloneWithSelectAndTextAreaValues(elmToClone, withDataAndEvents, deepWithDataAndEvents) { 54928 // Replacement jQuery clone that also clones the values in selects and textareas as jQuery doesn't for performance reasons - https://stackoverflow.com/questions/742810/clone-isnt-cloning-select-values 54929 // Based on https://github.com/spencertipping/jquery.fix.clone 54930 var $elmToClone = $(elmToClone), 54931 $result = $elmToClone.clone(withDataAndEvents, deepWithDataAndEvents), 54932 $myTextareas = $elmToClone.find('textarea').add($elmToClone.filter('textarea')), 54933 $resultTextareas = $result.find('textarea').add($result.filter('textarea')), 54934 $mySelects = $elmToClone.find('select').add($elmToClone.filter('select')), 54935 $resultSelects = $result.find('select').add($result.filter('select')), 54936 i, l, j, m; 54937 54938 for (i = 0, l = $myTextareas.length; i < l; ++i) { 54939 $($resultTextareas[i]).val($($myTextareas[i]).val()); 54940 } 54941 for (i = 0, l = $mySelects.length; i < l; ++i) { 54942 for (j = 0, m = $mySelects[i].options.length; j < m; ++j) { 54943 if ($mySelects[i].options[j].selected === true) { 54944 $resultSelects[i].options[j].selected = true; 54945 } 54946 } 54947 } 54948 return $result; 54949 } 54950 54951 function getjQueryObject(string) { 54952 // Make string a vaild jQuery thing 54953 var jqObj = $(""); 54954 try { 54955 jqObj = jQueryCloneWithSelectAndTextAreaValues(string); 54956 } catch (e) { 54957 jqObj = $("<span />") 54958 .html(string); 54959 } 54960 return jqObj; 54961 } 54962 54963 function printFrame(frameWindow, content, options) { 54964 // Print the selected window/iframe 54965 var def = $.Deferred(); 54966 try { 54967 frameWindow = frameWindow.contentWindow || frameWindow.contentDocument || frameWindow;
vendor: 6,731 bytes, lines 54968-55140
54968 var wdoc = frameWindow.document || frameWindow.contentDocument || frameWindow; 54969 if(options.doctype) { 54970 wdoc.write(options.doctype); 54971 } 54972 wdoc.write(content); 54973 wdoc.close(); 54974 var printed = false, 54975 callPrint = function () { 54976 if(printed) { 54977 return; 54978 } 54979 // Fix for IE : Allow it to render the iframe 54980 frameWindow.focus(); 54981 try { 54982 // Fix for IE11 - printng the whole page instead of the iframe content 54983 if (!frameWindow.document.execCommand('print', false, null)) { 54984 // document.execCommand returns false if it failed -http://stackoverflow.com/a/21336448/937891 54985 frameWindow.print(); 54986 } 54987 // focus body as it is losing focus in iPad and content not getting printed 54988 $('body').focus(); 54989 } catch (e) { 54990 frameWindow.print(); 54991 } 54992 frameWindow.close(); 54993 printed = true; 54994 def.resolve(); 54995 }; 54996 // Print once the frame window loads - seems to work for the new-window option but unreliable for the iframe 54997 $(frameWindow).on("load", callPrint); 54998 // Fallback to printing directly if the frame doesn't fire the load event for whatever reason 54999 setTimeout(callPrint, options.timeout); 55000 } catch (err) { 55001 def.reject(err); 55002 } 55003 return def; 55004 } 55005 55006 function printContentInIFrame(content, options) { 55007 var $iframe = $(options.iframe + ""); 55008 var iframeCount = $iframe.length; 55009 if (iframeCount === 0) { 55010 // Create a new iFrame if none is given 55011 $iframe = $('<iframe height="0" width="0" border="0" wmode="Opaque"/>') 55012 .prependTo('body') 55013 .css({ 55014 "position": "absolute", 55015 "top": -999, 55016 "left": -999 55017 }); 55018 } 55019 var frameWindow = $iframe.get(0); 55020 return printFrame(frameWindow, content, options) 55021 .done(function () { 55022 // Success 55023 setTimeout(function () { 55024 // Wait for IE 55025 if (iframeCount === 0) { 55026 // Destroy the iframe if created here 55027 $iframe.remove(); 55028 } 55029 }, 1000); 55030 }) 55031 .fail(function (err) { 55032 // Use the pop-up method if iframe fails for some reason 55033 console.error("Failed to print from iframe", err); 55034 printContentInNewWindow(content, options); 55035 }) 55036 .always(function () { 55037 try { 55038 options.deferred.resolve(); 55039 } catch (err) { 55040 console.warn('Error notifying deferred', err); 55041 } 55042 }); 55043 } 55044 55045 function printContentInNewWindow(content, options) { 55046 // Open a new window and print selected content 55047 var frameWindow = window.open(); 55048 return printFrame(frameWindow, content, options) 55049 .always(function () { 55050 try { 55051 options.deferred.resolve(); 55052 } catch (err) { 55053 console.warn('Error notifying deferred', err); 55054 } 55055 }); 55056 } 55057 55058 function isNode(o) { 55059 /* http://stackoverflow.com/a/384380/937891 */ 55060 return !!(typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string"); 55061 } 55062 $.print = $.fn.print = function () { 55063 // Print a given set of elements 55064 var options, $this, self = this; 55065 // console.log("Printing", this, arguments); 55066 if (self instanceof $) { 55067 // Get the node if it is a jQuery object 55068 self = self.get(0); 55069 } 55070 if (isNode(self)) { 55071 // If `this` is a HTML element, i.e. for 55072 // $(selector).print() 55073 $this = $(self); 55074 if (arguments.length > 0) { 55075 options = arguments[0]; 55076 } 55077 } else { 55078 if (arguments.length > 0) { 55079 // $.print(selector,options) 55080 $this = $(arguments[0]); 55081 if (isNode($this[0])) { 55082 if (arguments.length > 1) { 55083 options = arguments[1]; 55084 } 55085 } else { 55086 // $.print(options) 55087 options = arguments[0]; 55088 $this = $("html"); 55089 } 55090 } else { 55091 // $.print() 55092 $this = $("html"); 55093 } 55094 } 55095 // Default options 55096 var defaults = { 55097 globalStyles: true, 55098 mediaPrint: false, 55099 stylesheet: null, 55100 noPrintSelector: ".no-print", 55101 iframe: true, 55102 append: null, 55103 prepend: null, 55104 manuallyCopyFormValues: true, 55105 deferred: $.Deferred(), 55106 timeout: 750, 55107 title: null, 55108 doctype: '<!doctype html>' 55109 }; 55110 // Merge with user-options 55111 options = $.extend({}, defaults, (options || {})); 55112 var $styles = $(""); 55113 if (options.globalStyles) { 55114 // Apply the stlyes from the current sheet to the printed page 55115 $styles = $("style, link, meta, base, title"); 55116 } else if (options.mediaPrint) { 55117 // Apply the media-print stylesheet 55118 $styles = $("link[media=print]"); 55119 } 55120 if (options.stylesheet) { 55121 // Add a custom stylesheet if given 55122 $styles = $.merge($styles, $('<link rel="stylesheet" href="' + options.stylesheet + '">')); 55123 } 55124 // Create a copy of the element to print 55125 var copy = jQueryCloneWithSelectAndTextAreaValues($this); 55126 // Wrap it in a span to get the HTML markup string 55127 copy = $("<span/>") 55128 .append(copy); 55129 // Remove unwanted elements 55130 copy.find(options.noPrintSelector) 55131 .remove(); 55132 // Add in the styles 55133 copy.append(jQueryCloneWithSelectAndTextAreaValues($styles)); 55134 // Update title 55135 if (options.title) { 55136 var title = $("title", copy); 55137 if (title.length === 0) { 55138 title = $("<title />"); 55139 copy.append(title); 55140 }
55141 title.text(options.title); 55142 } 55143 // Appedned content 55144 copy.append(getjQueryObject(options.append)); 55145 // Prepended content 55146 copy.prepend(getjQueryObject(options.prepend)); 55147 if (options.manuallyCopyFormValues) { 55148 // Manually copy form values into the HTML for printing user-modified input fields 55149 // http://stackoverflow.com/a/26707753 55150 copy.find("input") 55151 .each(function () { 55152 var $field = $(this); 55153 if ($field.is("[type='radio']") || $field.is("[type='checkbox']")) { 55154 if ($field.prop("checked")) { 55155 $field.attr("checked", "checked"); 55156 } 55157 } else { 55158 $field.attr("value", $field.val()); 55159 } 55160 }); 55161 copy.find("select").each(function () { 55162 var $field = $(this); 55163 $field.find(":selected").attr("selected", "selected"); 55164 }); 55165 copy.find("textarea").each(function () { 55166 // Fix for https://github.com/DoersGuild/jQuery.print/issues/18#issuecomment-96451589 55167 var $field = $(this); 55168 $field.text($field.val()); 55169 }); 55170 } 55171 // Get the HTML markup string 55172 var content = copy.html(); 55173 // Notify with generated markup & cloned elements - useful for logging, etc 55174 try { 55175 options.deferred.notify('generated_markup', content, copy); 55176 } catch (err) { 55177 console.warn('Error notifying deferred', err); 55178 } 55179 // Destroy the copy 55180 copy.remove(); 55181 if (options.iframe) { 55182 // Use an iframe for printing 55183 try { 55184 printContentInIFrame(content, options); 55185 } catch (e) { 55186 // Use the pop-up method if iframe fails for some reason 55187 console.error("Failed to print from iframe", e.stack, e.message); 55188 printContentInNewWindow(content, options); 55189 } 55190 } else { 55191 // Use a new window for printing 55192 printContentInNewWindow(content, options); 55193 } 55194 return this; 55195 }; 55196})(jQuery); 55197 55198const rc_video_engament_tracking = function(vidPath, vidName, vidDuration, vidCurTime, vidEl) { 55199 var BUvalue = _satellite.getVar('QueryParam'); 55200 var ecid = ""; 55201 55202 if(_satellite.getVisitorId().getMarketingCloudVisitorID()){ 55203 ecid = _satellite.getVisitorId().getMarketingCloudVisitorID(); 55204 } 55205 else { 55206 ecid ="0000-0000-0000"; 55207 } 55208 55209 var userEmail = _satellite.getVar('userEmail'); 55210 var formname, formaction, formmethod, formenctype, formId, orgId; 55211 var siteId = ""; 55212 var owningOrganization = ""; 55213 var engType = "Page View"; 55214 var engSubType = "Video"; 55215 var munchkinId; 55216 55217 if(digitalData.marketo) munchkinId = digitalData.marketo.munchkinId; 55218 if(!munchkinId) munchkinId = digitalData.page.munchkinId; 55219 switch(munchkinId){ 55220 case "943-AHN-852": 55221 formId = 1001; 55222 orgId = "WS"; 55223 break; 55224 case "711-AML-956": 55225 orgId = "EC"; 55226 formId = 1001; 55227 break; 55228 case "508-SJA-205": 55229 orgId = "MS"; 55230 formId = 1014; 55231 break; 55232 default: 55233 formId = 1001; 55234 orgId = "WS"; 55235 break; 55236 } 55237 55238 var formaction = _satellite.getVar('Marketo : Submit Form URL')+'?orgId='+orgId; 55239 var fd = new FormData(); 55240 55241 55242 if (BUvalue !== undefined) { 55243 siteId = digitalData.eloqua.siteId; 55244 55245 } 55246 if (BUvalue !== undefined && siteId !== undefined && siteId !== "" && vidDuration > 0) { 55247 var curVidTime = (vidCurTime > 0 ? getMinutes(vidCurTime) : 0); 55248 55249 if(vidCurTime/60 >= 30){ 55250 console.log("inside 30 mins block") 55251 } 55252 /*fd.append('elqSiteID', siteId);*/ 55253 fd.append('webVisitorID', ecid); 55254 /*fd.append('elqFormName', formname);*/ 55255 fd.append('engagementType', engType); 55256 fd.append('engagementSubType', engSubType); 55257 fd.append('engagementName', vidName); 55258 fd.append('engagementURL', vidPath); 55259 fd.append('engagementSource', 'Website'); 55260 fd.append('BUQuestion1', 'Total Video Time:'); 55261 fd.append('BUAnswer1', (vidDuration > 0 ? getMinutes(vidDuration) : 0)); 55262 fd.append('BUQuestion2', 'Watched Video Time:'); 55263 fd.append('BUAnswer2', curVidTime); 55264 if(vidCurTime/60 >= 30){ 55265 fd.append('BUQuestion3', 'Certificate'); 55266 fd.append('BUAnswer3', 'Certificate'); 55267 } 55268 fd.append('formId',formId); 55269 if(owningOrganization){ 55270 fd.append('owningOrganization', owningOrganization); 55271 } 55272 if(userEmail && userEmail != "NA"){ 55273 fd.append('emailAddress', userEmail); 55274 /*Send engagement to Eloqua*/ 55275 if(!((vidEl.attr('data-lastPlayedVideo') === vidEl.attr('name')) && (vidEl.attr('data-lpVidCurTime') == curVidTime))){ 55276 navigator.sendBeacon(formaction, fd); 55277 } 55278 } 55279 55280 /*Saves last engament relevant information in video Element*/ 55281 vidEl.attr({'data-lastPlayedVideo':vidEl.attr('name'),'data-lpVidCurTime':curVidTime}); 55282 /*Returns time in minutes, takes param as seconds*/ 55283 function getMinutes(sec) { 55284 var time_s = sec; 55285 var minute = Math.floor(time_s / 60); 55286 var rest_seconds = Math.floor(time_s % 60); 55287 if (rest_seconds < 10) { 55288 rest_seconds = "0" + rest_seconds; 55289 } 55290 55291 return minute + ":" + rest_seconds 55292 } 55293 55294 } 55295 55296}; 55297/*To handle all facet realted functionalities */ 55298var rfFacetHandler = function(rFCmpRef) { 55299 this.rFResultObj = rFCmpRef; 55300 this.cmpRF = rFCmpRef.rfComp; 55301 this.tempDelFilters = []; 55302 this.tempAddedFilters = []; 55303 this.facetsContainer = this.cmpRF.find('#facets-container'); 55304 this.facetOptionsCount = 20; 55305 55306}; 55307 55308/*To bind events with handlers*/ 55309 55310rfFacetHandler.prototype.bindEvents = function() { 55311 this.cmpRF.on('click', '.facet-category', $.proxy(this.facetCategoryClickHandler, this)); 55312 this.cmpRF.on('click', '.facet-option', $.proxy(this.facetOptionClickHandler, this)); 55313 this.cmpRF.on('click', '.view-all', $.proxy(this.viewAllFacetClickHandler, this)); 55314 this.cmpRF.on('click', '.clear-facets', $.proxy(this.clearAllFacetClickHandler, this)); 55315 this.cmpRF.on('click', '.deselect-facet', $.proxy(this.deSelectFacetClickHandler, this)); 55316 this.cmpRF.on('click', '.mv-facet-category', $.proxy(this.mobFacetCatClickHandler, this)); 55317 this.cmpRF.on('click', '.close-facets', $.proxy(this.cancelBtnClickHandler, this)); 55318 this.cmpRF.on('click', '.apply-filters', $.proxy(this.applyFiltersClickHandler, this)); 55319 this.cmpRF.on('click', '.mv-facets-link', $.proxy(this.filtersLinkClickHandler, this)); 55320 55321 55322}; 55323 55324 55325/*To intiate component execution*/ 55326rfFacetHandler.prototype.init = function() { 55327 this.bindEvents(); 55328 $(this.cmpRF.find('.facet-category')[0]).click(); 55329 55330}; 55331 55332/*To create facets on page*/ 55333rfFacetHandler.prototype.prepareFacets = function(facetsObj, resType) { 55334 var restypeHtml = resType + 'html'; 55335
55336 if (this[restypeHtml] == undefined) { 55337 var facetsList = ''; 55338 var mViewHeader = '<div class="mv-facet-header"><nav>'; 55339 55340 for (var key in facetsObj) { 55341 var isBrand = false; 55342 var filtersArr = []; 55343 var options = ''; 55344 55345 55346 mViewHeader += '<a href="#' + this.replaceWhiteSpaces(key) + '" class="mv-facet-category">' + key + '</a>'; 55347 facetsList += '<div class="facets-wrapper"><div class="facet-category">' + key + ' <span></span></div>'; 55348 facetsList += '<div class="facet-content" id="' + this.replaceWhiteSpaces(key) + '">'; 55349 55350 for(var x=0; x<facetsObj[key].length; x++){ 55351 55352 var tagObj = $.grep(this.rFResultObj.tagIDTitleList, function(obj){return obj.id==(facetsObj[key][x]);})[0]; 55353 55354 if(tagObj){ 55355 55356 if(tagObj.title){ 55357 55358 filtersArr.push([facetsObj[key][x].toLowerCase(), tagObj.title]); 55359 } 55360 } 55361 55362 }; 55363 55364 filtersArr.sort(function(a,b) { 55365 a = a[1].toLowerCase(); 55366 b = b[1].toLowerCase(); 55367 if( a == b) return 0; 55368 return a < b ? -1 : 1; 55369 }); 55370 55371 for (var j = 0; j < filtersArr.length; j++) { 55372 55373 var hideClass = ''; 55374 55375 if (j >= this.facetOptionsCount) { 55376 hideClass = 'hide-option'; 55377 } 55378 55379 options += '<div class="facet-option ' + hideClass + '"><input type="checkbox" name="facets" value="' + filtersArr[j][0] + '"/><div class="checkmark"></div><label>' + filtersArr[j][1] + '</label></div>'; 55380 55381 } 55382 55383 55384 facetsList += options + '</div>'; 55385 55386 if (facetsObj[key].length > this.facetOptionsCount) { 55387 facetsList += '<a class="view-all" href="#">'+Granite.I18n.get("view-all")+'</a>'; 55388 } 55389 55390 facetsList += '</div>'; 55391 55392 } 55393 55394 mViewHeader += '</nav></div>'; 55395 var footer = '<div class="mv-facets-footer"><span class="close-facets">'+Granite.I18n.get("cancel")+'</span><span class="apply-filters">'+Granite.I18n.get("apply-filters")+'</span></div>' 55396 facetsList = mViewHeader + facetsList + footer; 55397 55398 this[restypeHtml] = facetsList; 55399 } 55400 this.facetsContainer.append(this[restypeHtml]); 55401 55402}; 55403 55404/*To split tag and call method to convert first letter of facet in upper case*/ 55405rfFacetHandler.prototype.modifyFacetOption = function(tag) { 55406 var tagStr = tag.split('/')[1]; 55407 55408 if (tagStr != undefined) { 55409 55410 return this.convertToUpperCase(tagStr); 55411 } 55412 55413 55414}; 55415 55416/*To replce white spaces in a string with _*/ 55417rfFacetHandler.prototype.replaceWhiteSpaces = function(text) { 55418 return text.replace(/\s/g, "_"); 55419}; 55420 55421/*To prepare facets list from the tags available in search results */ 55422rfFacetHandler.prototype.prepareFacetsList = function(pagesData, facetsList, resType) { 55423 55424 var restype = resType + 'obj'; 55425 var facetsListObj = {}; 55426 var allowedFacets = ['business_unit', 'country', 'pcg', 'brands', 'industry', 'uses_and_applications', 'literature_type']; 55427 var facetMapping = { 55428 'business_unit': 'Business Unit', 55429 'country': 'Country', 55430 //'corporate_category': 'Corporate Category', 55431 'pcg': 'Product Types', 55432 'brands': 'Brands', 55433 'industry': 'Industries', 55434 // 'products': 'Products', 55435 'uses_and_applications': 'Applications', 55436 'literature_type': 'Type', 55437 55438 55439 } 55440 55441 if (this[resType] != undefined) { 55442 55443 this.prepareFacets(this[resType], resType); 55444 } else { 55445 55446 if (facetsList != undefined && facetsList.length > 0) { 55447 allowedFacets = []; 55448 facetMapping = {}; 55449 for (var k = 0; k < facetsList.length; k++) { 55450 var tagName = (facetsList[k].tag.split(':')[1]).toLowerCase(); 55451 if (!allowedFacets.includes(tagName)) { 55452 allowedFacets.push(tagName); 55453 } 55454 if(allowedFacets.includes('industry-segment') || allowedFacets.includes('industry')){ 55455 allowedFacets.push('industry'); 55456 allowedFacets.push('industry-segment'); 55457 } 55458 facetMapping[tagName] = facetsList[k].label; 55459 } 55460 } 55461 55462 55463 for (var i = 0; i < pagesData.length; i++) { 55464 for (var j = 0; j < pagesData[i].tags.length; j++) { 55465 var tagVal = pagesData[i].tags[j].split('/'); 55466 var tagType = tagVal[0].split(':')[1] != undefined ? tagVal[0].split(':')[1].toLowerCase() : ''; 55467 var tagHead = facetMapping[tagType]; 55468 55469 if (allowedFacets.includes(tagType)) { 55470 if (tagVal[1]) { 55471 var tagVal1 = tagVal[0] + '/' + tagVal[1]; 55472 // Find the facet object for this tagType to get tagsnotrequired 55473 var facetObj = Array.isArray(facetsList) ? facetsList.find(f => (f.tag && f.tag.split(':')[1] && f.tag.split(':')[1].toLowerCase() === tagType)) : undefined; 55474 var tagsNotRequired = []; 55475 if (facetObj && facetObj.tagsnotrequired) { 55476 try { 55477 tagsNotRequired = JSON.parse(facetObj.tagsnotrequired); 55478 } catch (e) { 55479 // If tagsnotrequired is a string like "[DuPont:literature_type/building-science-bulletin, DuPont:literature_type/application]" 55480 // Remove brackets and whitespace, then split by comma 55481 tagsNotRequired = facetObj.tagsnotrequired 55482 .replace(/^\[|\]$/g, '') // remove leading [ and trailing ] 55483 .split(',') 55484 .map(s => s.trim()); // trim whitespace from each element 55485 } 55486 } 55487 if (tagsNotRequired.includes(tagVal1)) { 55488 continue; 55489 } 55490 55491 if (!facetsListObj.hasOwnProperty(tagHead)) { 55492 facetsListObj[tagHead] = []; 55493 } 55494 if(pagesData[i].tags[j].includes('industry-segment/') || pagesData[i].tags[j].includes('industry/')){ 55495 if (!facetsListObj.hasOwnProperty(facetMapping['industry'])){ 55496 facetsListObj[facetMapping['industry']] = []; 55497 } 55498 if(!facetsListObj.hasOwnProperty(facetMapping['industry-segment'])) { 55499 facetsListObj[facetMapping['industry-segment']] = []; 55500 } 55501 } 55502 55503 if (facetsListObj[tagHead].indexOf(tagVal1) == -1) { 55504 if(pagesData[i].tags[j].includes('industry-segment/') || pagesData[i].tags[j].includes('industry/')){ 55505 facetsListObj[facetMapping['industry']].push(tagVal1); 55506 facetsListObj[facetMapping['industry-segment']].push(tagVal1); 55507 }else{ 55508 facetsListObj[tagHead].push(tagVal1); 55509 } 55510 } 55511 } 55512 } 55513 } 55514 } 55515 55516 55517 55518 if (facetsList != undefined && facetsList.length > 0) { 55519 var rearrangedObj = {}; 55520 for (var l = 0; l < facetsList.length; l++) { 55521 if (facetsListObj[facetsList[l].label] != undefined && facetsListObj[facetsList[l].label].length > 0) { 55522 rearrangedObj[facetsList[l].label] = facetsListObj[facetsList[l].label]; 55523 } 55524 } 55525 } else { 55526 var rearrangedObj = facetsListObj; 55527 } 55528 this[resType] = rearrangedObj; 55529 this.prepareFacets(rearrangedObj, resType); 55530 } 55531 55532}; 55533 55534 55535 55536/*To convert first letter of all words in upper case*/
55537rfFacetHandler.prototype.convertToUpperCase = function(str) { 55538 var str1 = str.replace(/_/g, " "); 55539 var str2 = str1.replace(/-/g, " "); 55540 var strSpittted = str2.replace(/td/g, "").split(" "); 55541 var finalStr = ''; 55542 for (var i = 0; i < strSpittted.length; i++) { 55543 if (i == 0) { 55544 finalStr = finalStr + strSpittted[i].charAt(0).toUpperCase() + strSpittted[i].slice(1); 55545 } else { 55546 finalStr = finalStr + ' ' + strSpittted[i].charAt(0).toUpperCase() + strSpittted[i].slice(1); 55547 } 55548 } 55549 return finalStr; 55550}; 55551 55552 55553/*To de select all the selected facets*/ 55554rfFacetHandler.prototype.clearFacets = function() { 55555 var selectedFacetsBlock = this.cmpRF.find('.sel-facets-block'); 55556 this.rFResultObj.selectedFiltersArr = []; 55557 this.cmpRF.find("[name='facets']").prop('checked', false); 55558 selectedFacetsBlock.find('span').remove(); 55559}; 55560 55561/*To handle event on view product button click. Displays filtered results in search results*/ 55562rfFacetHandler.prototype.showFilteredResults = function() { 55563 55564 var selectedFacetsBlock = this.cmpRF.find('.sel-facets-block'); 55565 var prmFilterInd = this.rFResultObj.selectedFiltersArr.findIndex(x => x.value === "dupont:premiumcontent"); 55566 if(this.rFResultObj.premiumToggle){ 55567 if(prmFilterInd<0){ 55568 this.rFResultObj.selectedFiltersArr.push({type:"",value:"dupont:premiumcontent"}); 55569 prmFilterInd = 0; 55570 } 55571 55572 }else{ 55573 if(prmFilterInd >-1){ 55574 this.rFResultObj.selectedFiltersArr.splice(prmFilterInd,1); 55575 } 55576 } 55577 55578 55579 if (this.rFResultObj.selectedFiltersArr.length > 0) { 55580 if(! ((this.rFResultObj.selectedFiltersArr.length == 1) && (prmFilterInd == 0))){ 55581 selectedFacetsBlock.show(); 55582 }else{ 55583 selectedFacetsBlock.hide(); 55584 } 55585 55586 } else { 55587 selectedFacetsBlock.hide(); 55588 } 55589 55590 var searchResults = this.rFResultObj.selectedFiltersArr.length>0 ? this.rFResultObj.filteredResults(this.rFResultObj.searchResultsArr, this.rFResultObj.selectedFiltersArr) : this.rFResultObj.searchResultsArr; 55591 55592 this.rFResultObj.setTotalResultsCount(searchResults); 55593 this.rFResultObj.clearResults(); 55594 this.rFResultObj.paginationArr = searchResults; 55595 if (searchResults.length > this.rFResultObj.resultPageSize) { 55596 this.rFResultObj.pagination(searchResults, 0, this.rFResultObj.resultPageSize); 55597 this.rFResultObj.togglePagination(true); 55598 55599 } else { 55600 this.rFResultObj.togglePagination(false); 55601 this.rFResultObj.pagination(searchResults, 0, searchResults.length); 55602 } 55603 55604 this.updateFacets(searchResults); 55605 55606 55607}; 55608 55609 55610/*To deselact clicked facet and show filtered results*/ 55611rfFacetHandler.prototype.deSelectFacetClickHandler = function(event) { 55612 55613 var currentFacet = $(event.currentTarget).parent(); 55614 var facetValue = currentFacet.attr('data-facet-name'); 55615 this.cmpRF.find("input[value='" + facetValue + "']").prop('checked', false); 55616 currentFacet.remove(); 55617 55618 for (var i = 0; i < this.rFResultObj.selectedFiltersArr.length; i++) { 55619 if (this.rFResultObj.selectedFiltersArr[i].value == facetValue) { 55620 this.rFResultObj.selectedFiltersArr.splice(i, 1); 55621 } 55622 55623 } 55624 55625 this.rFResultObj.uncheckedFilter = true; 55626 this.showFilteredResults(); 55627}; 55628 55629 55630 55631 55632/*To clear all the selected facets*/ 55633rfFacetHandler.prototype.clearAllFacetClickHandler = function(event) { 55634 55635 if (event != undefined) { 55636 this.rFResultObj.uncheckedFilter = true; 55637 event.preventDefault(); 55638 } 55639 //selectedFacetsBlock.hide(); 55640 this.clearFacets(); 55641 this.showFilteredResults(); 55642 55643 55644}; 55645 55646/*To handle click event on view all facet link and show hiddedn facet options*/ 55647rfFacetHandler.prototype.viewAllFacetClickHandler = function(event) { 55648 55649 var currentEl = $(event.currentTarget); 55650 event.preventDefault(); 55651 currentEl.hide(); 55652 currentEl.siblings('.facet-content').find('.hide-option').addClass('show-option'); 55653 55654}; 55655 55656/*To handle event on filters link click in mobile view */ 55657rfFacetHandler.prototype.filtersLinkClickHandler = function(event) { 55658 55659 this.facetsContainer.show(); 55660 $(this.cmpRF.find('.mv-facet-header nav')).scrollLeft(0); 55661 $(this.cmpRF.find('.mv-facet-category')[0]).click(); 55662}; 55663 55664 55665 55666/*To handle event on apply filters button click*/ 55667rfFacetHandler.prototype.applyFiltersClickHandler = function(event) { 55668 this.tempDelFilters = []; 55669 this.tempAddedFilters = []; 55670 this.facetsContainer.hide(); 55671}; 55672 55673 55674/*To handle event on cancel click*/ 55675rfFacetHandler.prototype.cancelBtnClickHandler = function(event) { 55676 var self = this; 55677 var selectedFacetsBlock = this.cmpRF.find('.sel-facets-block'); 55678 55679 55680 $.each(this.tempDelFilters, function(j, val) { 55681
55682 self.rFResultObj.selectedFiltersArr.push(val); 55683 var inputEl = self.cmpRF.find("input[value='" + val.value + "']"); 55684 inputEl.prop('checked', true); 55685 $('<span class="facet-name" data-facet-name="' + val.value + '">' + inputEl.siblings('label').text() + ' <span class="deselect-facet">x</span></span>').insertBefore(selectedFacetsBlock.find('.clear-facets')); 55686 55687 }); 55688 55689 $.each(this.tempAddedFilters, function(x, v) { 55690 for (var i = 0; i < self.rFResultObj.selectedFiltersArr.length; i++) { 55691 if (self.rFResultObj.selectedFiltersArr[i].value == v.value) { 55692 self.rFResultObj.selectedFiltersArr.splice(i, 1); 55693 } 55694 55695 } 55696 self.cmpRF.find("input[value='" + v.value + "']").prop('checked', false); 55697 selectedFacetsBlock.find("[data-facet-name='" + v.value + "']").remove(); 55698 55699 }); 55700 55701 this.tempDelFilters = []; 55702 this.tempAddedFilters = []; 55703 this.showFilteredResults(); 55704 this.facetsContainer.hide(); 55705 55706}; 55707 55708 55709 55710/*To handle event on mobile facet category click*/ 55711rfFacetHandler.prototype.mobFacetCatClickHandler = function(event) { 55712 55713 var currentTarget = $(event.currentTarget); 55714 var href = currentTarget.attr('href'); 55715 event.preventDefault(); 55716 this.cmpRF.find('.mv-facet-category').removeClass('active'); 55717 this.cmpRF.find('.facet-content').hide(); 55718 currentTarget.addClass('active'); 55719 this.cmpRF.find(href).show(); 55720 55721}; 55722 55723 55724/*To handle event on facet category click*/ 55725rfFacetHandler.prototype.facetCategoryClickHandler = function(event) { 55726 var currentEl = $(event.currentTarget); 55727 var facetContent = currentEl.siblings('.facet-content'); 55728 var enabledOptions = facetContent.children().not(".facet-disabled"); 55729 if (currentEl.hasClass('open')) { 55730 currentEl.removeClass('open'); 55731 facetContent.hide(); 55732 currentEl.siblings('.view-all').hide(); 55733 } else { 55734 this.cmpRF.find('.facet-content').hide(); 55735 this.cmpRF.find('.view-all').hide(); 55736 this.cmpRF.find('.facet-category').removeClass('open'); 55737 currentEl.addClass('open'); 55738 facetContent.find('.hide-option').removeClass('show-option'); 55739 facetContent.show(); 55740 if (enabledOptions.length > this.facetOptionsCount) { 55741 currentEl.siblings('.view-all').show(); 55742 } 55743 } 55744}; 55745 55746/*To handle event on facet option click*/ 55747rfFacetHandler.prototype.facetOptionClickHandler = function(event, el) { 55748 55749 var inputEl = el!=undefined ? el : $(event.currentTarget).find('input'); 55750 if(inputEl.length>0){ 55751 var filterVal = inputEl.attr('value'); 55752 var selectedFacetsBlock = this.cmpRF.find('.sel-facets-block'); 55753 var isMobFacetsOn = this.cmpRF.find('.mv-facet-header').is(':visible'); 55754 55755 if(el){ 55756 var facCat=inputEl.parent().parent().siblings('.facet-category'); 55757 if(!facCat.hasClass('open')){ 55758 facCat.click(); 55759 } 55760 55761 } 55762 55763 if (inputEl.is(':checked')) { 55764 inputEl.prop('checked', false); 55765 for (var i = 0; i < this.rFResultObj.selectedFiltersArr.length; i++) { 55766 if (this.rFResultObj.selectedFiltersArr[i].value == filterVal) { 55767 this.rFResultObj.selectedFiltersArr.splice(i, 1); 55768 } 55769 } 55770 selectedFacetsBlock.find("[data-facet-name='" + filterVal + "']").remove(); 55771 if (isMobFacetsOn) { 55772 var item = { 55773 type: '', 55774 value: filterVal 55775 }; 55776 if (!this.tempDelFilters.includes(item)) { 55777 this.tempDelFilters.push(item); 55778 } 55779 } 55780 this.rFResultObj.uncheckedFilter = true; 55781 55782 } else { 55783 inputEl.prop('checked', true); 55784 this.rFResultObj.selectedFiltersArr.push({ 55785 type: '', 55786 value: filterVal 55787 }); 55788 55789 if (isMobFacetsOn) { 55790 var item = { 55791 type: '', 55792 value: filterVal 55793 }; 55794 if (!this.tempAddedFilters.includes(item)) { 55795 this.tempAddedFilters.push(item); 55796 } 55797 } 55798 55799 $('<span class="facet-name" data-facet-name="' + filterVal + '">' + inputEl.siblings('label').text() + ' <span class="deselect-facet">x</span></span>').insertBefore(selectedFacetsBlock.find('.clear-facets')); 55800 this.rFResultObj.clickedFilter = inputEl.siblings('label').text(); 55801 } 55802
55803 this.showFilteredResults(); 55804 } 55805 55806}; 55807 55808 55809 55810/*To enable and disable facets based on the tags found in search results*/ 55811rfFacetHandler.prototype.updateFacets = function(searchResults) { 55812 55813 var self =this; 55814 var filterEls=[]; 55815 55816 this.cmpRF.find('.facet-option').removeClass('hide-option').removeClass('show-option').addClass('facet-disabled'); 55817 55818 for (var i = 0; i < searchResults.length; i++) { 55819 var tags = searchResults[i].tags; 55820 55821 if (tags != undefined) { 55822 for (var j = 0; j < tags.length; j++) { 55823 var tag = tags[j].split('/'); 55824 var tagName = tag[0] + '/' + tag[1]; 55825 var el = 'input[value="' + tagName.toLowerCase() + '"]'; 55826 55827 if((filterEls.indexOf(el)<0)){ 55828 filterEls.push(el); 55829 } 55830 55831 } 55832 } 55833 55834 } 55835 55836 $(filterEls.toString()).parent().removeClass('facet-disabled'); 55837 55838 $.each(this.cmpRF.find('.facet-content'), function(i, v) { 55839 55840 var enabledOptions = $(v).children().not(".facet-disabled"); 55841 55842 if (enabledOptions.length <= self.facetOptionsCount) { 55843 $(v).siblings('.view-all').hide(); 55844 } else { 55845 55846 $.each(enabledOptions, function(ind, val) { 55847 55848 if (ind >= self.facetOptionsCount) { 55849 $(val).addClass('hide-option'); 55850 } 55851 55852 }); 55853 if ($(v).is(':visible')) { 55854 $(v).siblings('.view-all').show(); 55855 } 55856 } 55857 55858 55859 }); 55860 55861} 55862 55863let rcDownloadDocsList = []; 55864$(function() { 55865 /*Resource finder component*/ 55866 55867 var resFinderComponent = function() { 55868 this.rfComp = $($('.cmp-resFinder')[0]); 55869 if (this.rfComp.length > 0) { 55870 this.rfContainer = this.rfComp.find('#rf-content-wrapper'); 55871 this.searchInput = this.rfComp.find('#search-input'); 55872 this.resourcesPaths = (JSON.parse(rfDataObj.resourcesPaths)); 55873 this.cfPaths = (JSON.parse(rfDataObj.cfPaths)); 55874 this.countryTag = rfDataObj.countryTag; 55875 this.pageLocale = rfDataObj.locale; 55876 this.resourcesData = {}; 55877 this.facetsList = JSON.parse(rfDataObj.facetsList); 55878 this.buParam = rfDataObj.buParam != undefined ? rfDataObj.buParam : ''; 55879 this.tagIDTitleList = []; 55880 this.toolTips = JSON.parse(rfDataObj.toolTips); 55881 this.sdsObj = JSON.parse(rfDataObj.sdsObj); 55882 this.copyRightTxt = rfDataObj.copyrightText; 55883 this.cacheTimestamp = rfDataObj.cacheTimeStamp; 55884 this.searchResultsContainer = this.rfComp.find('#search-results-container'); 55885 this.totalCountContainer = this.rfComp.find('#searchResult-totalcount, #totalResults'); 55886 this.currentResultsCountContainer = this.rfComp.find('#currentTotal'); 55887 this.loadMoreBtn = this.rfComp.find('#loadMoreBtn'); 55888 this.paginationContainer = this.rfComp.find('#paginationContainer'); 55889 this.searchInputClearBtn = this.rfComp.find('#clean-search'); 55890 this.noResutFoundContainer = this.rfComp.find('#noResultFound'); 55891 this.totalResultCountContainer = this.rfComp.find('#totalResultCountContainer'); 55892 this.cancelSearchBtn = this.rfComp.find('#cancel-search'); 55893 this.mobileBreakPoint = 576; 55894 this.resultPageSize = 15; 55895 this.currentresultCount = 0; 55896 this.searchResultsArr = []; 55897 this.selectedFiltersArr = []; 55898 this.filteredResultsArr = []; 55899 this.uiAutoComplete = null; 55900 this.blockView = true; 55901 this.kFAQs = []; 55902 this.resData = []; 55903 this.dateSort = true; 55904 this.serviceCallCount = 0; 55905 this.anonymousUser = true; 55906 this.sharedVideo = false; 55907 this.isMobileDevice = false; 55908 this.premiumToggle = false; 55909 rfDataObj = undefined; 55910 //delete rfDataObj; 55911 55912 } 55913 55914 55915 }; 55916 55917 /*To bind events with handlers*/ 55918 55919 resFinderComponent.prototype.bindEvents = function() { 55920 var self = this;
55921 this.searchInput.keyup($.proxy(this.searchInputChangeEventHandler, this)); 55922 this.loadMoreBtn.on('click', $.proxy(this.loadMoreBtnClickHandler, this)); 55923 this.searchInputClearBtn.on('click', $.proxy(this.clearBtnClickHandler, this)); 55924 this.searchInput.focus($.proxy(this.searchInputFocusIn, this)); 55925 this.searchInput.focusout($.proxy(this.searchInputFocusOut, this)); 55926 this.rfComp.on('click', '.res-tabs', $.proxy(this.tabsClickHandler, this)); 55927 this.rfComp.on('click', '.play-icon, [data-type="video"]', $.proxy(this.playBtnClickHandler, this)); 55928 this.rfComp.on('click', '.model-close-btn, .model-bg', $.proxy(this.modelCloseBtnClickHandler, this)); 55929 this.rfComp.find('.view-icons > .fas').on('click', $.proxy(this.viewOrderBtnClickHandler, this)); 55930 this.rfComp.find('.sort-by button').on('click', $.proxy(this.sortOrderBtnClickHandler, this)); 55931 this.rfComp.on('click', '.faq-wrap>.acc-head', $.proxy(this.accordionClickHandler, this)); 55932 this.rfComp.on('click', '.faq-wrap a, #faq-container a', $.proxy(this.faqLinkClickHandler, this)); 55933 this.rfComp.on('click', '.lock-screen, .hor-lock-screen, .lock-ol', $.proxy(this.signInLinkClickHandler, this)); 55934 this.rfComp.on('click', '.share-icon, .share-txt, .hor-share-icon, .ol-share ', $.proxy(this.shareBtnClickHandler, this)) 55935 this.rfComp.on('click', '.print-faq, .ol-print', $.proxy(this.printBtnClickHandler, this)); 55936 this.rfComp.on('click', '.tgl-wrap', $.proxy(this.premiumToggleClickHandler, this)); 55937 this.rfComp.on('click', '.select-res', $.proxy(this.addDocsToDownloadQueue, this)); 55938 this.rfComp.on('click', '.dn-cart-container', $.proxy(this.downloadZipClickHandler, this)); 55939 this.rfComp.on('click', '.reload-cta', $.proxy(this.refreshBrowserData, this)); 55940 55941 55942 }; 55943 55944 55945 /*To intiate component execution*/ 55946 resFinderComponent.prototype.init = function() { 55947 if (this.rfComp.length > 0) { 55948 var self = this; 55949 var filterTags = this.getParam('filterTags'); 55950 self.filterTagsArr = []; 55951 if((this.buParam == 'eni' || this.buParam.indexOf('electronics') > -1 || this.buParam.indexOf('kalrez') > -1) && this.countryTag){ 55952 this.countryTag = this.countryTag.replaceAll(/DuPont:/gi, 'electronics:'); 55953 } 55954 if (filterTags) { 55955 if (filterTags.indexOf(';') > -1) { 55956 $.each(filterTags.split(';'), function(i,v){ 55957 if(v){ 55958 self.filterTagsArr.push(v); 55959 } 55960 }); 55961 55962 } else { 55963 self.filterTagsArr[0] = filterTags; 55964 } 55965 55966 } 55967 this.loader(true); 55968 this.checkUserLogin(this.fetchData); 55969 this.showCustomSDSLabel(); 55970 } 55971 55972 }; 55973 55974 55975 /*To fetch the data either from indexDB or AEM*/ 55976 resFinderComponent.prototype.fetchData = function(self, data) { 55977 self.resourceDataCall = 0; 55978 self.faqDataCall = 0; 55979 window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; 55980 55981 if(self.buParam && window.indexedDB){ 55982 self.readDataFromIndexDB(self,self.getDataFromAEM, data); 55983 }else{ 55984 self.getDataFromAEM(self, data); 55985 } 55986 55987 55988 55989 }; 55990 /*To get the data from AEM*/ 55991 resFinderComponent.prototype.getDataFromAEM = function(self, data) { 55992 self.getResourcesData(self.resourcesPaths, self.initiateExecution, data); 55993 if(self.cfPaths.length >0 ){ 55994 self.getCFsData(self.cfPaths, self.initiateExecution, data); 55995 }else{ 55996 self.serviceCallCount += 1; 55997 } 55998 55999 }; 56000 56001 56002 /*To check for user login*/ 56003 resFinderComponent.prototype.checkUserLogin = function(callback) { 56004 var self = this; 56005 56006 $.ajax({ 56007 type: "GET", 56008 url: "/dupont/userService", 56009 dataType: "json", 56010 contentType: "application/json", 56011 cache: false, 56012 success: function(data) { 56013 56014 if (data.anonymousUser == false) { 56015 self.anonymousUser = false;
56016 } 56017 callback(self, data); 56018 }, 56019 error: function(data) { 56020 console.log("Error in user login service::" + data); 56021 callback(self, data); 56022 } 56023 56024 }); 56025 }; 56026 56027 /*To intiate component execution*/ 56028 resFinderComponent.prototype.initiateExecution = function(self, dontAddToDB) { 56029 56030 self.serviceCallCount += 1; 56031 56032 if (self.serviceCallCount == 2) { 56033 56034 var premiumContent = self.getParam('premiumContent'); 56035 premiumContent = (premiumContent != null && premiumContent != undefined) ? premiumContent : ''; 56036 if(!dontAddToDB){ 56037 self.addDataToIndexDB(); 56038 } 56039 self.loader(false); 56040 self.bindEvents(); 56041 self.setSDSLink(); 56042 if(self.kFAQs.length==0){ 56043 self.rfComp.find("[data-res-name='kFAQs']").remove(); 56044 } 56045 self.initiateSearch(); 56046 self.initAutocomplete(); 56047 self.setSignInLinks(); 56048 if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 56049 self.isMobileDevice = true; 56050 } 56051 56052 if(premiumContent == "true" && self.rfComp.find('.prm-toggle').hasClass('visible')){ 56053 self.rfComp.find('.tgl-wrap').trigger('click'); 56054 } 56055 56056 self.triggerVideoEngagement(); 56057 56058 } 56059 56060 }; 56061 56062 /*Read the data from indexDB and based on user signin, timestamp use the data or get it from AEM*/ 56063 resFinderComponent.prototype.readDataFromIndexDB = function(self,callback,data) { 56064 56065 rcIndexDbObj.read(this.buParam).then(data => { 56066 if(data){ 56067 let rcCachetimeStamp = ""; 56068 let currentDateTime = new Date(); 56069 currentDateTime.toUTCString(); 56070 const currentTimeStamp = Math.floor(currentDateTime.getTime());// In hours 56071 let rcCacheDateTime = self.cacheTimestamp ? new Date(self.cacheTimestamp) :""; 56072 if(rcCacheDateTime){ 56073 rcCacheDateTime.toUTCString(); 56074 rcCachetimeStamp = Math.floor(rcCacheDateTime.getTime()); 56075 } 56076 const timeDifference = ((currentTimeStamp/(1000*3600)) - (data.timsestamp/(1000*3600))).toFixed(2);//Time Difference between database timestamp and current timesatmp in hours 56077 56078 if((rcCachetimeStamp && (rcCachetimeStamp > data.timsestamp)) || (data.anonymoususer != self.anonymousUser) || (timeDifference > 24)){ //Get the data form server if cache timestmap set in RC dialog is greater than database timestamp or if user sigmed in state changes or difrence between old timestamp and new timestamp becomes greater than 1 day 56079 rcIndexDbObj.remove(self.buParam);// To remove already exising record 56080 callback(self,data); 56081 }else{ 56082 self.resourcesData = JSON.parse(data.resourcesdata); 56083 self.tagIDTitleList = JSON.parse(data.tagmapping); 56084 self.kArticles = self.resourcesData.pages != undefined ? self.resourcesData.pages : []; 56085 self.kImages = self.resourcesData.images != undefined ? self.resourcesData.images : []; 56086 self.kVideos = self.resourcesData.videos != undefined ? self.resourcesData.videos : []; 56087 self.kDocs = self.resourcesData.kdocs != undefined ? self.resourcesData.kdocs : []; 56088 self.kZip = self.resourcesData.zip != undefined ? self.resourcesData.zip : []; 56089 self.kExe = self.resourcesData.exe != undefined ? self.resourcesData.exe : []; 56090 self.kDocs = self.kDocs.concat(self.kZip, self.kExe); 56091 self.resData = self.kDocs; 56092 self.kFAQs = self.resourcesData.faqs != undefined ? self.resourcesData.faqs : []; 56093 self.serviceCallCount = 1; 56094 self.initiateExecution(self, true); 56095 self.showClearDataPrompt(); 56096 } 56097 }else{ 56098 callback(self,data); 56099 } 56100 56101 }, error => { 56102 callback(self,data); 56103 }); 56104 } 56105 56106 /*Adds the data to indexDB*/ 56107 resFinderComponent.prototype.addDataToIndexDB = function() { 56108 let currentDateTime = new Date(); 56109 currentDateTime.toUTCString(); 56110 const currentTimeStamp = Math.floor(currentDateTime.getTime());// In hours 56111 56112 rcIndexDbObj.add(this.buParam, JSON.stringify(this.resourcesData),JSON.stringify(this.tagIDTitleList),this.anonymousUser,currentTimeStamp); 56113 56114 } 56115 56116 /*To fetch resources data*/ 56117 56118 resFinderComponent.prototype.getResourcesData = function(cfPaths, callback, data) { 56119 56120 var tags = []; 56121 var self = this; 56122 var user = (self.anonymousUser == true) ? false : true; 56123 var countryTag = this.countryTag; 56124 56125 if(countryTag=='' || countryTag==null){ 56126 countryTag = undefined; 56127 } 56128 56129 self.resourceDataCall++ ; 56130 56131 $.ajax({ 56132 56133 url: "/dupont/getResourcesData", 56134 dataType: "json", 56135 cache: false, 56136 data: { 56137 searchPath: this.resourcesPaths, 56138 countryTag: countryTag, 56139 locale: this.pageLocale, 56140 anonymousUser: user, 56141 filterTags:self.filterTagsArr 56142 56143 }, 56144 success: function(result) { 56145 if (!result || !result.resourcesData || Object.keys(result.resourcesData).length === 0) { 56146 // If result data is empty, retry the call 56147 console.log("****result data is empty*****"); 56148 if (self.resourceDataCall == 1) { 56149 self.getResourcesData(cfPaths, callback, data); 56150 } else { 56151 callback(self); 56152 } 56153 } 56154 else 56155 { 56156 self.resourcesData["exe"] = result.resourcesData.exe; 56157 self.resourcesData["images"] = result.resourcesData.images; 56158 self.resourcesData["kdocs"] = result.resourcesData.kdocs; 56159 self.resourcesData["pages"] = result.resourcesData.pages; 56160 self.resourcesData["videos"] = result.resourcesData.videos; 56161 self.resourcesData["zip"] = result.resourcesData.zip; 56162 self.tagIDTitleList = self.tagIDTitleList.concat(result.tagTitlesMap); 56163 56164 self.kArticles = self.resourcesData.pages != undefined ? self.resourcesData.pages : []; 56165 self.kImages = self.resourcesData.images != undefined ? self.resourcesData.images : []; 56166 self.kVideos = self.resourcesData.videos != undefined ? self.resourcesData.videos : []; 56167 self.kDocs = self.resourcesData.kdocs != undefined ? self.resourcesData.kdocs : []; 56168 self.kZip = self.resourcesData.zip != undefined ? self.resourcesData.zip : []; 56169 self.kExe = self.resourcesData.exe != undefined ? self.resourcesData.exe : []; 56170 self.kDocs = self.kDocs.concat(self.kZip, self.kExe); 56171 self.resData = self.kDocs; 56172 56173 callback(self); 56174 } 56175 56176 }, 56177 error: function(e) { 56178 console.log("Error in Resources service call", e) 56179 if(self.resourceDataCall == 1){ 56180 self.getResourcesData(cfPaths, callback, data); 56181 }else{ 56182 56183 callback(self); 56184 } 56185 } 56186 }); 56187 56188 56189 56190 }; 56191 56192 56193 /*To fetch faq content fragments data*/ 56194 56195 resFinderComponent.prototype.getCFsData = function(cfPaths, callback, data) { 56196 56197 var self = this; 56198 var tags = self.filterTagsArr; 56199 var user = (self.anonymousUser == true) ? false : true; 56200 56201 if (this.countryTag) { 56202 tags.push(this.countryTag); 56203 } 56204 self.faqDataCall++ ; 56205 56206 $.ajax({ 56207 56208 url: "/dupont/getFAQData", 56209 dataType: "json", 56210 cache: false, 56211 data: { 56212 searchPath: cfPaths, 56213 filterTags: tags, 56214 locale: this.pageLocale, 56215 anonymousUser: user 56216 }, 56217 success: function(result) { 56218 56219 self.kFAQs = result.faqData; 56220 self.resourcesData['faqs'] = result.faqData; 56221 self.tagIDTitleList = self.tagIDTitleList.concat(result.tagTitlesMap); 56222 56223 callback(self); 56224 }, 56225 error: function(e) { 56226 console.log("Error in FAQ service call", e) 56227 if(self.faqDataCall == 1){ 56228 self.getCFsData(cfPaths, callback, data); 56229 }else{ 56230 callback(self); 56231 } 56232 56233 56234 } 56235 }); 56236 56237 56238 56239 }; 56240 56241 /*To intiate search based on query parameters*/ 56242 56243 resFinderComponent.prototype.initiateSearch = function() { 56244 56245 var restype = this.getParam('restype'); 56246 restype = ((restype != null) && (restype != undefined)) ? restype.toLowerCase() : ''; 56247 var tagId = this.getParam('tagId'); 56248 if((tagId == undefined || tagId == null) && this.getParam('filterTags')!=undefined){ 56249 tagId = this.getParam('filterTags'); 56250 } 56251 tagId = ((tagId != null) && (tagId != undefined)) ? tagId.toLowerCase() : ''; 56252 if(tagId && (this.buParam == 'eni' || this.buParam.indexOf('electronics') >
56252 -1 || this.buParam.indexOf('kalrez') > -1)){ 56253 tagId = tagId.replaceAll(/dupont:/gi, 'electronics:'); 56254 56255 } 56256 var searchTxt = this.getParam('searchtext'); 56257 searchTxt = (searchTxt != null && searchTxt != undefined) ? searchTxt : ''; 56258 var sharedAssetParam = this.getParam('shared-asset'); 56259 sharedAssetParam = ((sharedAssetParam != null) && (sharedAssetParam != undefined)) ? (decodeURIComponent(sharedAssetParam)).toLowerCase().trim() : ''; 56260 this.facets = this.getFacets(this.buParam); 56261 this.facetHandlerObj = new rfFacetHandler(this); 56262 this.facetHandlerObj.prepareFacetsList(this.resData, this.facets, 'resources'); 56263 this.facetHandlerObj.init(); 56264 this.searchInput.val(searchTxt); 56265 this.setToolTip('kDocs'); 56266 this.applyParamFilters(restype, tagId, searchTxt, sharedAssetParam); 56267 56268 56269 }; 56270 56271 /*Create a list of doucments which are to be downloaded*/ 56272 resFinderComponent.prototype.addDocsToDownloadQueue = function(evnt) { 56273 var el = $(evnt.currentTarget); 56274 var docPath = el.attr('href'); 56275 evnt.preventDefault(); 56276 56277 if(!el.hasClass('selected')){ 56278 el.addClass('selected'); 56279 if(el.parent().hasClass('item-result')){ 56280 el.parent().prev().find('.select-res').addClass('selected'); 56281 }else{ 56282 el.parent().parent().next().find('.select-res').addClass('selected'); 56283 } 56284 if(!rcDownloadDocsList.includes(docPath)){ 56285 rcDownloadDocsList.push(docPath); 56286 } 56287 56288 }else{ 56289 el.removeClass('selected'); 56290 if(el.parent().hasClass('item-result')){ 56291 el.parent().prev().find('.select-res').removeClass('selected'); 56292 }else{ 56293 el.parent().parent().next().find('.select-res').removeClass('selected'); 56294 } 56295 rcDownloadDocsList.splice(rcDownloadDocsList.indexOf(docPath), 1); 56296 56297 } 56298 56299 this.rfComp.find('.file-count').text(rcDownloadDocsList.length); 56300 (rcDownloadDocsList.length > 0) ? this.rfComp.find('.dn-cart-container').show() : this.rfComp.find('.dn-cart-container').hide(); 56301 56302 } 56303 56304 /*To show custom SDS link for other langugage SDSs*/ 56305 resFinderComponent.prototype.showCustomSDSLabel = function() { 56306 56307 if((this.pageLocale.toLowerCase() === "en_us") && (this.buParam === "liveo")){ 56308 56309 $("<div class='custom-sds-link'>Non-English and other countries SDS are avalibale on this link</div>").insertAfter("#rf-sds-links"); 56310 56311 } 56312 56313 else if((this.pageLocale.toLowerCase() === "zh_cn") && (this.buParam === "liveo")){ 56314 56315 $("<div class='custom-sds-link'>æ¤é¾æ¥æä¾éè±è¯åå ¶ä»å½å®¶/å°åºç SDS</div>").insertAfter("#rf-sds-links"); 56316 56317 } 56318 56319 56320 }; 56321 56322 /*Displays a prompt to clear Saved Browser Data */ 56323 resFinderComponent.prototype.showClearDataPrompt = function() { 56324 let promptBox = this.rfComp.find('.reload-data-wrapper'); 56325 promptBox.addClass("show"); 56326 } 56327 56328 /*Deletes data stored in indexDB and reloads the page */ 56329 resFinderComponent.prototype.refreshBrowserData = function() { 56330 56331 rcIndexDbObj.deleteDBStore().then(data => { 56332 window.location.reload(); 56333 56334 }, error => { 56335 alert("Encountered some error"); 56336 }); 56337 56338 } 56339 56340 56341 56342 /*To intiate search based on query parameters*/ 56343 56344 resFinderComponent.prototype.triggerVideoEngagement = function() { 56345 var self = this; 56346 56347 window.addEventListener('beforeunload', function logData() { 56348 //if (document.visibilityState === 'hidden') { 56349 var videoEl = self.rfComp.find('#vid-container video')[0]; 56350 if($(videoEl).is(":visible")){ 56351 rc_video_engament_tracking($(videoEl).attr('src'), $(videoEl).attr('vid-title'), videoEl.duration, videoEl.currentTime, $(videoEl)); 56352 } 56353 56354 // } 56355 }); 56356 56357 56358 56359 this.rfComp.find('#vid-container video').on('ended', function() { 56360 var videoEl = self.rfComp.find('#vid-container video')[0]; 56361 rc_video_engament_tracking($(videoEl).attr('src'), $(videoEl).attr('vid-title'), videoEl.duration, videoEl.currentTime, $(videoEl)); 56362 56363 }); 56364 56365 } 56366 56367 /*To set sign in and sign up links based on URL parameters*/ 56368 56369 resFinderComponent.prototype.setSignInLinks = function() { 56370 var signUpEl = this.rfComp.find('.sign-up'); 56371 // var signInEl = this.rfComp.find('.sign-in'); 56372 // var signInLink = signInEl.attr('href'); 56373 // signInEl.attr('href',signInLink+'#ret-page-url='+encodeURIComponent(window.location.href)); 56374 if(this.buParam){ 56375 var signupLink = signUpEl.attr('href'); 56376 signUpEl.attr('href',signupLink+'?BU='+this.buParam); 56377 } 56378 56379 }; 56380 56381 /*To show loader*/ 56382 56383 resFinderComponent.prototype.loader = function(show) { 56384 var loaderEl = this.rfComp.find('#loader-screen-rc'); 56385 if (show) { 56386 loaderEl.addClass('show'); 56387 } else { 56388 loaderEl.removeClass('show'); 56389 } 56390 }; 56391 56392 56393 /*To set SDS link*/ 56394 56395 resFinderComponent.prototype.setSDSLink = function() { 56396 56397 if (this.sdsObj.sdsLabel != "null" && this.sdsObj.sdsLabel.trim() != "") { 56398
56399 this.rfComp.find("#rf-sds-links").prepend("<a href='" + this.sdsObj.sdsLink + "'>" + this.sdsObj.sdsLabel + "</a>").show(); 56400 } 56401 }; 56402 56403 resFinderComponent.prototype.applyParamFilters = function(restype, tagId, searchtext, sharedAssetParam) { 56404 56405 if(sharedAssetParam){ 56406 var hyphenIndex = sharedAssetParam.indexOf('-'); 56407 if(hyphenIndex > -1){ 56408 var restype = sharedAssetParam.substr(0,hyphenIndex); 56409 var resName = "s-r:"+sharedAssetParam.substr(hyphenIndex+1, sharedAssetParam.length-1); 56410 56411 } 56412 } 56413 56414 switch (true) { 56415 56416 case restype.indexOf('image') > -1: 56417 56418 this.tabsClickHandler(null, this.rfComp.find("[data-res-name='kImages']"), resName); 56419 56420 break; 56421 56422 case restype.indexOf('article') > -1: 56423 56424 this.tabsClickHandler(null, this.rfComp.find("[data-res-name='kArticles']"), resName); 56425 56426 break; 56427 56428 case restype.indexOf('video') > -1: 56429 56430 if(resName){ 56431 56432 this.sharedVideo = true; 56433 } 56434 56435 this.tabsClickHandler(null, this.rfComp.find("[data-res-name='kVideos']"), resName); 56436 56437 break; 56438 56439 case restype.indexOf('faq') > -1: 56440 56441 if(this.kFAQs.length>0){ 56442 this.tabsClickHandler(null, this.rfComp.find("[data-res-name='kFAQs']"), resName); 56443 }else{ 56444 this.displayResults(searchtext); 56445 } 56446 56447 break; 56448 56449 case restype != undefined: 56450 56451 if(resName){ 56452 this.displayResults(resName); 56453 }else{ 56454 this.displayResults(searchtext); 56455 } 56456 56457 56458 break; 56459 56460 }; 56461 56462 if (tagId != '') { 56463 56464 var tagIDs = []; 56465 var self = this; 56466 if (tagId.indexOf(';') > -1) { 56467 tagIDs = tagId.split(';'); 56468 } else { 56469 tagIDs[0] = tagId; 56470 } 56471 $.each(tagIDs, function(i, v) { 56472 if (v.trim() != '') { 56473 var tagValue = v.toLowerCase(); 56474 self.facetHandlerObj.facetOptionClickHandler(null, self.rfComp.find("input[value='" + tagValue + "']")); 56475 } 56476 }); 56477 56478 56479 } else if (searchtext != '' && resName!= undefined) { 56480 this.facetHandlerObj.clearAllFacetClickHandler(); 56481 } 56482 56483 56484 }; 56485 56486 56487 56488 /*To intiate search based on query parameters*/ 56489 resFinderComponent.prototype.getFacets = function(buParam) { 56490 var buFacets = []; 56491 56492 56493 switch (true) { 56494 56495 case buParam == 'safety': 56496 buFacets = this.facetsList['safety']; 56497 break; 56498 case buParam == 'safetyandconstruction' || buParam == 'snc': 56499 buFacets = this.facetsList['snc']; 56500 break; 56501 case buParam == 'ppe': 56502 buFacets = this.facetsList['ppe']; 56503 break; 56504 case buParam == 'pbs' || buParam.indexOf('building') > -1: 56505 buFacets = this.facetsList['pbs']; 56506 break; 56507 /* case buParam == 'nnb' || buParam.indexOf('nutrition') > -1: 56508 buFacets = this.facetsList['nnb']; 56509 break;*/ 56510 case buParam == 'mobility': 56511 buFacets = this.facetsList['tni']; 56512 break; 56513 case buParam == 'eni' || buParam.indexOf('electronic') > -1: 56514 buFacets = this.facetsList['eni']; 56515 break; 56516 /*case buParam == 'ib' || buParam.indexOf('industrial-biosciences') > -1: 56517 buFacets = this.facetsList['ib']; 56518 break;*/ 56519 case buParam.indexOf('water') > -1: 56520 //buId = 'water-solutions'; 56521 buFacets = this.facetsList['water']; 56522 break; 56523 case buParam.indexOf('greatstuff') > -1: 56524 buFacets = this.facetsList['gs']; 56525 break; 56526 case buParam == 'frothpak': 56527 buFacets = this.facetsList['fp']; 56528 break; 56529 case buParam == 'life-protection': 56530 buFacets = this.facetsList['lifeprotection']; 56531 break; 56532 case buParam == 'corian': 56533 buFacets = this.facetsList['corian']; 56534 break; 56535 case buParam == 'cyrel': 56536 buFacets = this.facetsList['cyrel']; 56537 break; 56538 case buParam == 'artistri': 56539 buFacets = this.facetsList['artistri']; 56540 break; 56541 case buParam.indexOf('corporate') > -1: 56542 buFacets = this.facetsList['corporate']; 56543 break; 56544 case buParam == 'kalrez': 56545 buFacets = this.facetsList['kalrez']; 56546 break; 56547 case buParam == 'vespel': 56548 buFacets = this.facetsList['vespel']; 56549 break; 56550 case buParam == 'liveo': 56551 buFacets = this.facetsList['liveo']; 56552 break; 56553 case buParam == 'molykote': 56554 buFacets = this.facetsList['molykote']; 56555 break; 56556 case buParam == 'tedlar': 56557 buFacets = this.facetsList['tedlar']; 56558 break; 56559 56560 default: 56561 buFacets = this.facetsList['global']; 56562 56563 } 56564 56565 return buFacets; 56566 56567 56568 }; 56569 56570 56571 56572 56573 resFinderComponent.prototype.getParam = function(param, url_String) { 56574 if(url_String){ 56575 var url_string = url_String; 56576 }else{ 56577 var url_string = window.location.href; //window.location.href 56578 } 56579 56580 var url = new URL(url_string); 56581 56582 return url.searchParams.get(param); 56583 }; 56584 56585 56586 /*To create tokens form the search text and remove stop words and characters*/ 56587 resFinderComponent.prototype.tokenizeAndRemoveStopWords = function(sentence) { 56588 var tokens = sentence.split(' '); 56589 var actualTokens = []; 56590 $.each(tokens, function(i, v) { 56591 if (v.trim().length > 0) { 56592 if ((stopWords.indexOf((v.trim()).toLowerCase()) < 0) && (stopChars.indexOf(v.trim()) < 0) && ((v.trim().length > 2))) { 56593 actualTokens.push(v.trim()); 56594 } 56595 } 56596 56597 }); 56598 return actualTokens; 56599 }; 56600 56601 56602 // To sort array by title 56603 resFinderComponent.prototype.sortByTitle = function(a, b) { 56604 if (a.format == "content-fragment") { 56605 var temp = document.createElement("div"); 56606 temp.innerHTML = a.title; 56607 var titleA = (temp.textContent || temp.innerText || "").trim().toUpperCase(); 56608 temp.innerHTML = b.title; 56609 var titleB = (temp.textContent || temp.innerText || "").trim().toUpperCase(); 56610 56611 } else { 56612 var titleA = a.title.trim().toUpperCase(); 56613 var titleB = b.title.trim().toUpperCase(); 56614 } 56615 56616 if (titleA < titleB) { 56617 return -1; 56618 } 56619 if (titleA > titleB) { 56620 return 1; 56621 } 56622 56623 // names must be equal 56624 return 0; 56625 }; 56626 56627 // To sort array by Label 56628 resFinderComponent.prototype.sortByLabel = function(a, b) { 56629 56630 var labelA = a.label.trim().toUpperCase(); // ignore upper and lowercase 56631 var labelB = b.label.trim().toUpperCase(); // ignore upper and lowercase 56632 if (labelA < labelB) { 56633 return -1; 56634 } 56635 if (labelA > labelB) { 56636 return 1; 56637 } 56638 56639 // names must be equal 56640 return 0; 56641 }; 56642 56643 // To sort array by date 56644 resFinderComponent.prototype.sortByDate = function(a, b) { 56645 56646 return new Date(b.lastmodified) - new Date(a.lastmodified); 56647 }; 56648 56649 56650 56651 56652 /*To remove special characters from text*/ 56653 resFinderComponent.prototype.removeSpecialChars = function(searchWord) { 56654 56655 var seachWordRep1 = searchWord.replace(/â¢/g, ""); 56656 var seachWordRep2 = seachWordRep1.replace(/®/g, ""); 56657 var seachWordRep3 = seachWordRep2.replace(/%20/g, " "); 56658 56659 return seachWordRep3; 56660 56661 }; 56662 56663 56664 /*To handle search input focus in event*/ 56665 resFinderComponent.prototype.searchInputFocusIn = function(event) { 56666 var self = this; 56667 56668 this.searchInput.parent().addClass('focused'); 56669 56670 if (this.searchInput.val() == '') { 56671 56672 if (window.innerWidth < this.mobileBreakPoint) { 56673 56674 self.searchInput.parent().parent().addClass('mobile-view'); 56675 window.scrollTo(0, self.searchInput.parent().offset().top - 20); 56676 }; 56677 56678 } 56679 56680 56681 56682 }; 56683 56684 56685 56686 /*To handle search input focus out event*/ 56687 resFinderComponent.prototype.searchInputFocusOut = function(event) { 56688 var self = this; 56689 setTimeout(function() { 56690 self.searchInput.parent().removeClass('focused'); 56691 }, 100); 56692 56693 if (window.innerWidth < self.mobileBreakPoint) { 56694 setTimeout(function() { 56695 self.searchInput.parent().parent().removeClass('mobile-view'); 56696 }, 200) 56697 window.scrollTo(0, 0); 56698 } 56699 56700 }; 56701 56702 resFinderComponent.prototype.setToolTip = function(tabName) { 56703 var tooltip = ''; 56704 var toolTipEl = this.rfComp.find('.tool-tip'); 56705 switch (tabName) { 56706 56707 case 'kDocs': 56708 56709 tooltip = this.toolTips['docs'] != "null" ? this.toolTips['docs'] : ''; 56710 break; 56711 56712 case 'kArticles': 56713 56714 tooltip = this.toolTips['articles'] != "null" ? this.toolTips['articles'] : ''; 56715 break; 56716 56717 case 'kImages': 56718 56719 tooltip = this.toolTips['images'] != "null" ? this.toolTips['images'] : ''; 56720 break; 56721 56722 case 'kVideos': 56723 56724 tooltip = this.toolTips['videos'] != "null" ? this.toolTips['videos'] : ''; 56725 break; 56726 56727 case 'kFAQs': 56728 56729 tooltip = this.toolTips['faqs'] != "null" ? this.toolTips['faqs'] : ''; 56730 break; 56731 } 56732 56733 56734 if (tooltip != '') { 56735 toolTipEl.find('span').text(tooltip); 56736 toolTipEl.show(); 56737 } else { 56738 toolTipEl.hide(); 56739 } 56740 56741 }; 56742 56743 resFinderComponent.prototype.copyToClipboard = function(str) { 56744 var el = this.rfComp.find('#clipborad-el')[0]; 56745 $(el).val(str); 56746 el.select(); 56747 document.execCommand('copy'); 56748 el.blur(); 56749 }; 56750 56751 resFinderComponent.prototype.premiumToggleClickHandler = function(evnt) { 56752 var el = $(evnt.currentTarget); 56753 if(el.hasClass('active')){ 56754 el.removeClass('active'); 56755 this.premiumToggle = false;
56756 }else{ 56757 el.addClass('active'); 56758 this.premiumToggle = true; 56759 } 56760 this.facetHandlerObj.showFilteredResults(); 56761 }; 56762 56763 resFinderComponent.prototype.downloadZipClickHandler = function(evnt) { 56764 if(!this.rfComp.find('.doc-loader').hasClass('show')){ 56765 rc_Download_Zip(rcDownloadDocsList); 56766 this.rfComp.find('.doc-loader').addClass('show'); 56767 } 56768 }; 56769 56770 56771 resFinderComponent.prototype.printBtnClickHandler = function(evnt) { 56772 56773 var el = $(evnt.currentTarget); 56774 56775 56776 if(el.hasClass('ol-print')){ 56777 var faqEl = el.parent(); 56778 }else{ 56779 56780 var faqEl = el.parents('.faq-wrap')[0]; 56781 } 56782 56783 $(faqEl).print({ 56784 globalStyles: true, 56785 mediaPrint: true, 56786 stylesheet: null, 56787 noPrintSelector: null, 56788 iframe: true, 56789 append: '<div class="rc-print-copyright">'+this.copyRightTxt+'</div>', 56790 prepend: '<img class="rc-print-logo" src="/content/dam/dupont/amer/us/en/corporate/general/icons/DuPont_tm_rgb.png" ></img>', 56791 manuallyCopyFormValues: false, 56792 deferred: $.Deferred(), 56793 timeout: 1500, 56794 title: null, 56795 doctype: '<!doctype html>' 56796 }); 56797 56798 }; 56799 56800 resFinderComponent.prototype.signInLinkClickHandler = function(evnt) { 56801 var el = $(evnt.currentTarget); 56802 var fileName = encodeURIComponent(el.attr('data-file-name')); 56803 var selectedTabName = this.rfComp.find('.res-tabs.selected').attr('data-res-name'); 56804 var filePrefix = selectedTabName.substr(1,selectedTabName.length-2); 56805 var signInEl = this.rfComp.find('.sign-in'); 56806 var signInLink = signInEl.attr('href'); 56807 if(signInLink.indexOf('.html#')>-1){ 56808 signInLink = (signInLink.split('.html#')[0])+".html"; 56809 } 56810 56811 signInEl.attr('href',signInLink+'#ret-page-url='+encodeURIComponent((window.location.href.split('?'))[0]+"?BU="+this.buParam+"&shared-asset="+filePrefix+"-"+fileName)); 56812 this.rfComp.find('#signin-model').show(); 56813 }; 56814 56815 resFinderComponent.prototype.shareBtnClickHandler = function(evnt) { 56816 evnt.preventDefault(); 56817 var el = $(evnt.currentTarget); 56818 if(el.hasClass('share-txt')){ 56819 el = $(el.siblings('.share-icon')[0]); 56820 } 56821 var fileName = encodeURIComponent(el.attr('data-file-name')); 56822 var shareTTEl = this.rfComp.find('.share-tooltip'); 56823 var selectedTabName = this.rfComp.find('.res-tabs.selected').attr('data-res-name'); 56824 var filePrefix = selectedTabName.substr(1,selectedTabName.length-2); 56825 this.copyToClipboard((window.location.href.split('?'))[0]+"?BU="+this.buParam+"&shared-asset="+filePrefix+"-"+fileName); 56826 shareTTEl.text(Granite.I18n.get("Share link copied to clipboard")); 56827 shareTTEl.css({left:evnt.pageX-40+'px', top: evnt.pageY+25+'px'}).fadeIn(400); 56828 setTimeout(function(){ 56829 shareTTEl.fadeOut(200); 56830 },1200); 56831 evnt.stopPropagation(); 56832 }; 56833 56834 resFinderComponent.prototype.faqLinkClickHandler = function(evnt) { 56835 56836 var el = $(evnt.currentTarget); 56837 var faqLink = (el.attr('href').trim()).toLowerCase(); 56838 56839 if(faqLink.indexOf('shared-asset=faq-')>-1){ 56840 evnt.preventDefault(); 56841 var faqModel = this.rfComp.find('#faq-model'); 56842 var faqParam = this.getParam('shared-asset',faqLink); 56843 var faqName = faqParam.substr(faqParam.indexOf('-')+1, faqParam.length-1); 56844 var faq = (this.kFAQs.filter(function(item) { 56845 var name = (item.path.substr(item.path.lastIndexOf('/') + 1, item.path.length - 1)).toLowerCase(); 56846 return (name == faqName); 56847 }))[0]; 56848 56849 if (faq) { 56850 if(this.rfComp.find('#faq-container .lock-ol').length>0){ 56851 this.rfComp.find('#faq-container .lock-ol').remove(); 56852 } 56853 if((faq.path.indexOf('/secure/')>-1) && (this.anonymousUser == true)){ 56854 this.rfComp.find('#faq-container').append('<div class="lock-ol" data-file-name="'+faqName+'"><div class="ol-lock-icon"></div><div class="ol-signin-link">'+ Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></div></div>'); 56855 faq.answer = ''; 56856 56857 } 56858 56859 if(this.isMobileDevice){ 56860 faqModel.find('.ol-print').hide(); 56861 }else{ 56862 faqModel.find('.ol-print').show(); 56863 } 56864 56865 faqModel.find('.q-t').html(faq.title); 56866 faqModel.find('.ol-share').attr('data-file-name',faqName); 56867 56868 if(faq.answer.trim()){ 56869 faqModel.find('.a-t').html(faq.answer); 56870 faqModel.find('.a-el').show(); 56871 56872 }else{ 56873 faqModel.find('.a-t').html(''); 56874 faqModel.find('.a-el').hide(); 56875 } 56876 56877 faqModel.show(); 56878 56879 } 56880 } 56881 56882 }; 56883 56884
56885 resFinderComponent.prototype.accordionClickHandler = function(evnt) { 56886 56887 var el = $(evnt.currentTarget); 56888 var faqEl = el.parent(); 56889 56890 if(!faqEl.siblings('.hor-lock-screen').length > 0){ 56891 56892 if (faqEl.hasClass('isLink')) { 56893 56894 var href = el.find('.q-text>a').attr('href'); 56895 window.open(href, "_self"); 56896 56897 } else { 56898 56899 if (faqEl.hasClass('expanded')) { 56900 56901 faqEl.removeClass('expanded'); 56902 if(el.attr('data-click-type') == 'default'){ 56903 el.removeAttr('data-click-type'); 56904 } 56905 56906 } else { 56907 var path = faqEl.attr('data-faq-path'); 56908 var answerEl = el.siblings('.acc-content').find('.a-content'); 56909 var faq = (this.kFAQs.filter(function(item) { 56910 return item.path == path; 56911 }))[0]; 56912 56913 if (answerEl.text().trim() == '') { 56914 answerEl.html(faq.answer); 56915 56916 /*if(this.searchInput.val().length>2){ 56917 this.highlightWordInResults(answerEl, this.searchInput.val()); 56918 }*/ 56919 } 56920 faqEl.addClass('expanded'); 56921 } 56922 } 56923 } 56924 }; 56925 56926 56927 resFinderComponent.prototype.viewOrderBtnClickHandler = function(event) { 56928 var el = $(event.currentTarget); 56929 el.siblings('.fas').removeClass('active'); 56930 el.addClass('active'); 56931 if (el.attr('id') == 'blockOrder') { 56932 this.blockView = true; 56933 this.searchResultsContainer.find('.list-view').hide(); 56934 this.searchResultsContainer.find('.block-view').show(); 56935 } else { 56936 this.blockView = false; 56937 this.searchResultsContainer.find('.block-view').hide(); 56938 this.searchResultsContainer.find('.list-view').show(); 56939 } 56940 56941 56942 56943 }; 56944 56945 resFinderComponent.prototype.sortOrderBtnClickHandler = function(event) { 56946 var el = $(event.currentTarget); 56947 el.siblings('button').removeClass('active'); 56948 el.addClass('active'); 56949 if (el.attr('id') == 'date-sort') { 56950 this.dateSort = true; 56951 this.titleSort = false; 56952 56953 } else { 56954 this.dateSort = false; 56955 this.titleSort = true; 56956 56957 } 56958 this.sortBtnClicked = true; 56959 this.facetHandlerObj.showFilteredResults(); 56960 56961 }; 56962 56963 56964 resFinderComponent.prototype.modelCloseBtnClickHandler = function(evnt) { 56965 var el = $(evnt.target); 56966 56967 if((el.hasClass('model-bg') || el.hasClass('model-close-btn')) && (el.attr('id')!="loader-screen-rc")){ 56968 56969 if(!this.rfComp.find('#video-model').is(":hidden")){ 56970 var videoEl = this.rfComp.find('#vid-container video')[0]; 56971 rc_video_engament_tracking($(videoEl).attr('src'), $(videoEl).attr('vid-title'), videoEl.duration, videoEl.currentTime, $(videoEl)); 56972 56973 $(videoEl).attr('src', ''); 56974 //var videoEl = this.rfComp.find('#vid-container video')[0]; 56975 if(videoEl.muted == true){ 56976 videoEl.muted=false; 56977 } 56978 } 56979 this.rfComp.find('.model-bg').hide(); 56980 } 56981 56982 }; 56983 56984 resFinderComponent.prototype.playBtnClickHandler = function(event) { 56985 56986 var el = $(event.currentTarget); 56987 var vidTitle = ''; 56988 if(el.attr('data-type') =="video"){ 56989 var src = el.attr('href'); 56990 event.preventDefault(); 56991 }else{ 56992 var src = el.siblings('video').attr('src'); 56993 } 56994 56995 if(el.hasClass('vid-name') || el.hasClass('play-icon')){ 56996 vidTitle = el.parents('.video-list').find('.vid-name').text(); 56997 }else{ 56998 vidTitle = el.parents('.item-result').find('h5').text(); 56999 } 57000 57001 this.rfComp.find('#vid-container video').attr({'src': src, 'vid-title':vidTitle}); 57002 this.rfComp.find('#video-model').show(); 57003 57004 57005 }; 57006 57007 resFinderComponent.prototype.tabsClickHandler = function(event, tabEl, resName) { 57008 57009 var el = tabEl != undefined ? tabEl : $(event.currentTarget); 57010 var selectedFacets = this.selectedFiltersArr; 57011 var selFacetsBlockHTML = $(this.rfComp.find('.sel-facets-block')[0]).html(); 57012 57013 if (!el.hasClass('selected')) { 57014 this.resData = this[el.attr('data-res-name')]; 57015 el.siblings().removeClass('selected'); 57016 el.addClass('selected'); 57017 this.setToolTip(el.attr('data-res-name')); 57018 if (this.rfComp.find('.sort-by button.active').attr('id') == "date-sort") { 57019 this.dateSort = true; 57020 this.titleSort = false;
57021 } else { 57022 this.dateSort = false; 57023 this.titleSort = true; 57024 } 57025 this.rfComp.find('#facets-container').find('.facets-wrapper, .mv-facet-header, .mv-facets-footer').remove(); 57026 this.facetHandlerObj.prepareFacetsList(this.resData, this.facets, el.attr('data-res-name')); 57027 $(this.rfComp.find('.facet-category')[0]).click(); 57028 if(resName){ 57029 this.displayResults(resName); 57030 }else{ 57031 this.displayResults(this.searchInput.val()); 57032 } 57033 57034 57035 if (selectedFacets.length > 0) { 57036 57037 if (this.filteredResults(this.searchResultsArr, selectedFacets).length < 1) { 57038 57039 this.selectedFiltersArr = selectedFacets; 57040 $(this.rfComp.find('.sel-facets-block')[0]).html(selFacetsBlockHTML); 57041 this.facetHandlerObj.showFilteredResults(); 57042 } else { 57043 57044 var tagIDs = ''; 57045 57046 $.each(selectedFacets, function(i, v) { 57047 tagIDs += v.value + ';'; 57048 }); 57049 57050 this.applyParamFilters('', tagIDs, this.searchInput.val()); 57051 57052 } 57053 57054 } 57055 57056 if (el.attr('data-res-name') == "kFAQs") { 57057 57058 var firstFAQEl = $(this.searchResultsContainer.find(".faq-wrap")[0]); 57059 57060 if (!(firstFAQEl.hasClass('isLink') || firstFAQEl.hasClass('locked'))) { 57061 firstFAQEl.find('.acc-head').attr('data-click-type','default').trigger('click'); 57062 } 57063 } 57064 57065 } 57066 57067 }; 57068 57069 /*To handle event on load more button click. Load more results in search results as per given pagination count*/ 57070 resFinderComponent.prototype.loadMoreBtnClickHandler = function() { 57071 57072 if (this.currentresultCount < this.paginationArr.length) { 57073 var currentScrollTop = $(window).scrollTop(); 57074 window.scrollTo(0, currentScrollTop); 57075 if ((this.currentresultCount + this.resultPageSize) < this.paginationArr.length) { 57076 this.pagination(this.paginationArr, this.currentresultCount, this.currentresultCount + this.resultPageSize); 57077 57078 } else { 57079 this.pagination(this.paginationArr, this.currentresultCount, this.paginationArr.length); 57080 } 57081 57082 57083 } 57084 57085 }; 57086 57087 /*To handle search input change event.*/ 57088 resFinderComponent.prototype.searchInputChangeEventHandler = function(event) { 57089 57090 if (event.keyCode == 13) { 57091 if (this.searchInput.val().length > 2) { 57092 this.displayResults(this.searchInput.val()); 57093 } 57094 this.closeAutocompleteMenu(); 57095 } else if (this.searchInput.val() == '') { 57096 this.searchInputClearBtn.hide(); 57097 if (this.selectedFiltersArr.length < 1) { 57098 this.displayResults(''); 57099 } 57100 57101 } else { 57102 this.searchInputClearBtn.css('visibility', 'visible').show(); 57103 } 57104 57105 }; 57106 57107 /*To handle event on clear button click. Clear search input box and hides autocomplete menu.*/ 57108 resFinderComponent.prototype.clearBtnClickHandler = function() { 57109 this.searchInput.val(''); 57110 this.searchInputClearBtn.hide(); 57111 if (this.uiAutoComplete.is(':visible')) { 57112 this.uiAutoComplete.hide(); 57113 } 57114 if (this.selectedFiltersArr.length < 1) { 57115 this.displayResults(''); 57116 } 57117 }; 57118 57119 57120 57121 /*To set totall found results count*/ 57122 resFinderComponent.prototype.setTotalResultsCount = function(searchResults) { 57123 57124 this.totalCountContainer.html(searchResults.length); 57125 digitalData.pageInfo.onsiteSearchTerm = this.searchInput.val().trim(); 57126 digitalData.pageInfo.selectedTab = this.rfComp.find(".res-tabs.selected").text().trim(); 57127 digitalData.pageInfo.selectedFilter = this.clickedFilter; 57128 57129 if (searchResults.length < 1) { 57130 if(digitalData.pageInfo.onsiteSearchTerm != ""){ 57131 digitalData.pageInfo.onsiteSearchResults = "NA"; 57132 _satellite.track("Null_Searches"); 57133 } 57134 this.noResutFoundContainer.show(); 57135 this.paginationContainer.hide(); 57136 this.totalResultCountContainer.hide(); 57137 57138 } else if ((searchResults.length >= 1) && ((digitalData.pageInfo.onsiteSearchTerm != "") || (digitalData.pageInfo.selectedFilter !=undefined)) && !(this.uncheckedFilter==true) && !(this.sortBtnClicked==true)) { 57139 57140 digitalData.pageInfo.onsiteSearchResults = searchResults.length; 57141 _satellite.track("Success_Search"); 57142 this.noResutFoundContainer.hide(); 57143 this.paginationContainer.show() 57144 this.totalResultCountContainer.show(); 57145 } else { 57146 digitalData.pageInfo.onsiteSearchResults = searchResults.length; 57147 this.noResutFoundContainer.hide(); 57148 this.paginationContainer.show() 57149 this.totalResultCountContainer.show(); 57150 } 57151 57152 this.clickedFilter = undefined; 57153 this.uncheckedFilter = undefined; 57154 this.sortBtnClicked = undefined; 57155 57156 }; 57157 57158 57159 57160 57161 /*To combine brand and products tags data into one final list for type ahead search*/ 57162 resFinderComponent.prototype.createDataSourceAndSetPremiumToggle = function() { 57163 57164 this.finalDataSource = []; 57165 57166 for (var key in this.resourcesData) { 57167 57168 for (var i = 0; i < this.resourcesData[key].length; i++) { 57169 var item = this.resourcesData[key][i];
57170 if(item.path.indexOf('/validated/')>-1){ 57171 if(!this.rfComp.find('.prm-toggle').hasClass('visible')){ 57172 this.rfComp.find('.prm-toggle').addClass('visible'); 57173 } 57174 57175 if(item.tags.length>0){ 57176 item.tags.push('dupont:premiumcontent'); 57177 }else{ 57178 item.tags = ['dupont:premiumcontent']; 57179 } 57180 } 57181 57182 if (key == "faqs") { 57183 57184 var temp = document.createElement("div"); 57185 temp.innerHTML = item.title; 57186 var title = temp.textContent || temp.innerText || ""; 57187 57188 this.finalDataSource.push({ 57189 label: title, 57190 value: this.removeSpecialChars(item.path.slice(item.path.lastIndexOf('/') + 1, item.path.length)) + " " + title + " " + this.removeSpecialChars(title), 57191 type: key 57192 }); 57193 57194 } else { 57195 57196 this.finalDataSource.push({ 57197 label: item.title, 57198 value: this.removeSpecialChars(item.path.slice(item.path.lastIndexOf('/') + 1, item.path.length)) + " " + item.title + " " + this.removeSpecialChars(item.title), 57199 type: key 57200 }); 57201 57202 } 57203 57204 } 57205 } 57206 57207 }; 57208 57209 57210 /*To return a filtered list as a source to auto complete based on the search text*/ 57211 resFinderComponent.prototype.getFilteredList = function(searchText) { 57212 if(searchText.split(" ").length>1){ 57213 for(var i=0;i<searchText.split(" ").length;i++){ 57214 searchText = searchText.split(" ")[i] 57215 var matchingTitlesArr = this.finalDataSource.filter(function(item) { 57216 return item.value.toLowerCase().indexOf(searchText.toLowerCase()) !== -1; 57217 57218 }); 57219 } } 57220 57221 var matchingTitlesArr = this.finalDataSource.filter(function(item) { 57222 57223 return item.value.toLowerCase().indexOf(searchText.toLowerCase()) !== -1; 57224 }); 57225 57226 57227 return matchingTitlesArr; 57228 57229 }; 57230 57231 57232 /*To initiate and handle autocomplete search functionality */ 57233 resFinderComponent.prototype.initAutocomplete = function() { 57234 var self = this; 57235 this.createDataSourceAndSetPremiumToggle(); 57236 57237 this.searchInput.autocomplete({ 57238 source: function(request, response) { 57239 response($.map(self.getFilteredList(request.term), function(el) { 57240 return el; 57241 })); 57242 57243 }, 57244 minLength: 3, 57245 select: function(event, ui) { 57246 event.preventDefault(); 57247 self.searchInput.val(ui.item.label); 57248 57249 switch (true) { 57250 57251 case ui.item.type == 'images': 57252 $("[data-res-name='kImages']").click(); 57253 break; 57254 case ui.item.type == 'videos': 57255 $("[data-res-name='kVideos']").click(); 57256 break; 57257 case (ui.item.type=='kdocs' || ui.item.type=='zip' || ui.item.type=='exe'): 57258 $("[data-res-name='kDocs']").click(); 57259 break; 57260 case ui.item.type=='pages': 57261 $("[data-res-name='kArticles']").click(); 57262 break; 57263 case ui.item.type=='faqs': 57264 $("[data-res-name='kFAQs']").click(); 57265 break; 57266 57267 } 57268 self.displayResults("a-c-r:" + ui.item.label); 57269 57270 57271 }, 57272 open: function(event, ui) { 57273 57274 if (window.innerWidth < self.mobileBreakPoint) { 57275 57276 var menuTop = self.uiAutoComplete.position().top; 57277 self.uiAutoComplete.css('top', menuTop + 10); 57278 } 57279 self.searchInput.parent().addClass('focused'); 57280 57281 57282 }, 57283 57284 position: { 57285 of: self.searchInput.parent() 57286 } 57287 57288 57289 57290 }); 57291 57292 this.uiAutoComplete = $('.ui-autocomplete'); 57293 this.uiAutoComplete.addClass('rf-autoComp'); 57294 57295 $.ui.autocomplete.prototype._renderItem = function(ul, item) { 57296 57297 57298 57299 return $("<li>") 57300 .attr("data-value", item.value) 57301 .attr("data-type", item.type) 57302 .append(item.label) 57303 .appendTo(ul); 57304 }; 57305 57306 57307 $.ui.autocomplete.prototype._renderMenu = function(ul, items) { 57308 var that = this; 57309 var maxResult = 50; 57310 57311 var shortedList = []; 57312 57313 var articles = (items.filter(item => item.type == 'pages')).slice(0, maxResult).sort(this.sortByLabel); 57314 var kDocs = (items.filter(item => (item.type == 'kdocs' || item.type == 'zip' || item.type == 'exe') )).slice(0, maxResult).sort(this.sortByLabel); 57315 var images = (items.filter(item => item.type == 'images')).slice(0, maxResult).sort(this.sortByLabel); 57316 var videos = (items.filter(item => item.type == 'videos')).slice(0, maxResult).sort(this.sortByLabel); 57317 var faqs = ((items.filter(item => item.type == 'faqs')).slice(0, maxResult)).sort(self.sortByLabel); 57318 57319 shortedList = kDocs.concat(articles, images, videos, faqs); 57320 57321 $.each(shortedList, function(index, item) { 57322 that._renderItemData(ul, item); 57323 }); 57324 57325 $('<li data-value="KArticles" class="option-type">' + Granite.I18n.get("articles") + '</li>').insertBefore($(ul).find("[data-type='pages']")[0]); 57326 $('<li data-value="KDocs" class="option-type">' + Granite.I18n.get("documents") + '</li>').insertBefore($(ul).find("[data-type='kdocs']")[0]); 57327 $('<li data-value="KImages" class="option-type">' + Granite.I18n.get("images") + '</li>').insertBefore($(ul).find("[data-type='images']")[0]); 57328 $('<li data-value="KVideos" class="option-type">' + Granite.I18n.get("videos") + '</li>').insertBefore($(ul).find("[data-type='videos']")[0]); 57329 $('<li data-value="KFAQs" class="option-type">' + Granite.I18n.get("faqs") + '</li>').insertBefore($(ul).find("[data-type='faqs']")[0]); 57330 57331 self.highlightWord($(ul), self.searchInput.val()); 57332 57333 }; 57334 57335 $.ui.autocomplete.prototype._resizeMenu = function() { 57336 57337 this.menu.element.outerWidth(self.searchInput.parent().outerWidth()); 57338 57339 }; 57340 57341 57342 57343 57344 $(document).on('touchend', function(event) { 57345 if (window.innerWidth < self.mobileBreakPoint) { 57346 57347 if (self.uiAutoComplete.is(':visible')) { 57348 57349 var target = $(event.target); 57350 if ((target.attr('id') == 'search-input') || (target.parent().hasClass('ui-autocomplete')) || (target.attr('id') == 'clean-search') || (target.parent().attr('id') == 'clean-search') || (target.attr('id') == 'cancel-search')) { 57351 57352 return true; 57353 } else { 57354 57355 if (self.searchInput.is(':focus')) { 57356 57357 self.searchInput.blur(); 57358 self.uiAutoComplete.show(); 57359 57360 return false;
57361 57362 } 57363 } 57364 57365 } else if (self.searchInput.is(':focus')) { 57366 self.searchInput.blur(); 57367 } 57368 57369 57370 } 57371 57372 }); 57373 57374 }; 57375 57376 /*To close autocomplete menu*/ 57377 resFinderComponent.prototype.closeAutocompleteMenu = function() { 57378 this.uiAutoComplete.hide(); 57379 this.searchInput.parent().removeClass('focused'); 57380 this.searchInput.parent().parent().removeClass('mobile-view'); 57381 57382 }; 57383 57384 /*To higlight matching text in autocomplte menu in bold characters*/ 57385 resFinderComponent.prototype.highlightWord = function(searchBlock, searchWord) { 57386 57387 var text = searchWord; 57388 text = text.replace(/\?/g, ""); 57389 var searchTextElements = searchBlock.find('li'); 57390 57391 if (text) { 57392 $.each(searchTextElements, function(ind, val) { 57393 var pattern = new RegExp("(" + text + ")", "gi"); 57394 var searchTxt = $(val).html(); 57395 var seachTextCopy = searchTxt.toLowerCase(); 57396 var text1 = searchTxt.substr(seachTextCopy.indexOf(text.toLowerCase()), text.length); 57397 var new_text = searchTxt.replace(pattern, "<span style='font-weight:bold;'>" + text1 + "</span>"); 57398 $(val).html(new_text); 57399 57400 }); 57401 57402 57403 57404 } 57405 }; 57406 57407 57408 57409 /*To highlight matching text in search results*/ 57410 resFinderComponent.prototype.highlightWordInResults = function(searchBlock, searchWord) { 57411 57412 57413 var text = (searchWord).trim(); 57414 57415 if (text.indexOf('|') > -1) { 57416 text = text.split('|')[0]; 57417 } 57418 57419 var searchTextElements = searchBlock.find('h5, p, .img-name, .vid-name, .res-name, .page-name>a, .page-name>span'); 57420 57421 if (text) { 57422 $.each(searchTextElements, function(ind, val) { 57423 $.each($(val).find('.text-search'), function(i, v) { 57424 $(v).replaceWith($(v).text()); 57425 }) 57426 var searchTxt = $(val).html(); 57427 searchTxt = ($("<textarea></textarea>").html(searchTxt).text()); 57428 var seachTextCopy = searchTxt.toLowerCase(); 57429 var pattern = new RegExp('(' + text + ')', "gi"); 57430 57431 var text1 = searchTxt.substr(seachTextCopy.indexOf(text.toLowerCase()), text.length); 57432 var new_text = searchTxt.replace(pattern, "<span class='text-search'>" + text1 + "</span>"); 57433 57434 $(val).html(new_text); 57435 57436 }); 57437 57438 57439 57440 } 57441 57442 }; 57443 57444 57445 57446 57447 /*To manage matching results display in search results block */ 57448 resFinderComponent.prototype.displayResults = function(searchWord) { 57449 57450 var resDataList = this.resData; 57451 var searchResults = this.findSearchResults(searchWord, resDataList); 57452 this.facetHandlerObj.clearAllFacetClickHandler(); 57453 57454 }; 57455 57456 57457 /*To find filtered results based on the selected filters*/ 57458 resFinderComponent.prototype.filteredResults = function(resultsArr, filtersArr) { 57459 57460 57461 var filterredResultsArr = []; 57462 57463 filtersArr.sort(function(a, b) { 57464 return b.value.length - a.value.length; 57465 }); 57466 57467 for (var j = 0; j < resultsArr.length; j++) { 57468 57469 var tagFoundArr = []; 57470 for (var k = 0; k < resultsArr[j].tags.length; k++) { 57471 57472 57473 for (var i = 0; i < filtersArr.length; i++) { 57474 57475 var tag = (filtersArr[i].value).toLowerCase(); 57476 57477 if ((resultsArr[j].tags[k].toLowerCase()) == tag) { 57478 if (!tagFoundArr.includes(tag)) { 57479 tagFoundArr.push(tag); 57480 } 57481 57482 break; 57483 57484 } 57485 57486 } 57487 57488 57489 57490 57491 } 57492 57493 57494 if (tagFoundArr.length >= filtersArr.length) { 57495 57496 if (filtersArr.length > 0) { 57497 57498 if (!filterredResultsArr.includes(resultsArr[j])) { 57499
57500 filterredResultsArr.push(resultsArr[j]); 57501 57502 } 57503 57504 } else { 57505 filterredResultsArr = []; 57506 } 57507 57508 } 57509 57510 57511 } 57512 57513 return filterredResultsArr; 57514 57515 }; 57516 57517 57518 57519 /*To create tokens form the search text and remove stop words and characters*/ 57520 resFinderComponent.prototype.tokenizeAndRemoveStopWords = function(sentence) { 57521 var tokens = sentence.split(' '); 57522 var actualTokens = []; 57523 $.each(tokens, function(i, v) { 57524 if (v.trim().length > 0) { 57525 //if ((stopWords.indexOf((v.trim()).toLowerCase()) < 0) && (stopChars.indexOf(v.trim()) < 0) && ((v.trim().length > 2))) { 57526 if ((stopWords.indexOf((v.trim()).toLowerCase()) < 0) && (stopChars.indexOf(v.trim()) < 0)) { 57527 actualTokens.push(v.trim()); 57528 } 57529 } 57530 }); 57531 return actualTokens; 57532 }; 57533 57534 /*To find matching results with the search word from product and brand pages*/ 57535 resFinderComponent.prototype.findSearchResults = function(searchText, resDataList) { 57536 57537 var self = this; 57538 57539 this.searchResultsArr = []; 57540 57541 if (searchText.length > 0) { 57542 57543 if ((searchText).indexOf(' ') > -1) { 57544 57545 var searchTokens = this.tokenizeAndRemoveStopWords(searchText.toLowerCase()); 57546 57547 } else { 57548 57549 var searchTokens = [searchText.toLowerCase()]; 57550 } 57551 57552 if (((searchText).indexOf('s-r:') > -1)) { 57553 57554 searchText = (searchText.split('s-r:')[1]).toLowerCase(); 57555 57556 for (var i = 0; i < resDataList.length; i++) { 57557 var path = resDataList[i].path; 57558 var lastSlashIndex = path.lastIndexOf('/'); 57559 if(lastSlashIndex>-1){ 57560 var fileName = decodeURIComponent((path.substr(lastSlashIndex+1, path.length-1)).toLowerCase()); 57561 } 57562 57563 if(fileName == searchText){
57564 this.searchResultsArr.push(resDataList[i]); 57565 break; 57566 } 57567 57568 } 57569 } 57570 57571 else if (((searchText).indexOf('a-c-r:') > -1)) { 57572 57573 searchText = (searchText.split('a-c-r:')[1]).toLowerCase(); 57574 57575 for (var i = 0; i < resDataList.length; i++) { 57576 57577 if (resDataList[i].format == 'content-fragment') { 57578 57579 var temp = document.createElement("div"); 57580 temp.innerHTML = resDataList[i].title; 57581 var title = temp.textContent || temp.innerText || ""; 57582 } else { 57583 57584 var title = resDataList[i].title; 57585 } 57586 57587 57588 if (title) { 57589 57590 if (title.toLowerCase().indexOf(searchText) > -1) { 57591 this.searchResultsArr.push(resDataList[i]); 57592 } 57593 } 57594 57595 57596 } 57597 } else { 57598 57599 57600 for (var i = 0; i < resDataList.length; i++) { 57601 57602 if (resDataList[i].format == 'content-fragment') { 57603 57604 var text = (resDataList[i].path+" "+resDataList[i].qaID + " " + resDataList[i].keywords + " " + resDataList[i].summary + " " + resDataList[i].title + " " + resDataList[i].answer + " " + JSON.stringify(resDataList[i].tags)).toLowerCase(); 57605 57606 } else { 57607 57608 var text = (this.removeSpecialChars(resDataList[i].title)+" "+resDataList[i].path+" "+resDataList[i].title + " " + JSON.stringify(resDataList[i].tags)+" "+resDataList[i].keywords).toLowerCase(); 57609 } 57610 57611 57612 $.each(searchTokens, function(ind, val) { 57613 57614 if (text.indexOf(val) > -1) {
57615 self.searchResultsArr.push(resDataList[i]); 57616 return false; 57617 } 57618 }); 57619 57620 } 57621 57622 if ((searchTokens.length <= 15)) { 57623 this.searchResultsArr = this.sortSearchResults(this.searchResultsArr, searchTokens); 57624 } 57625 57626 } 57627 57628 this.dateSort = false; 57629 this.titleSort = false; 57630 57631 } else { 57632 57633 this.searchResultsArr = resDataList; 57634 } 57635 this.loader(false); 57636 return this.searchResultsArr; 57637 57638 57639 }; 57640 57641 /*To sort search results based on the search tokens presence*/ 57642 resFinderComponent.prototype.sortSearchResults = function(searchResults, stemmedTokens) { 57643 57644 var combinations = (this.createWordsCombinations(stemmedTokens)).reverse(); 57645 var sortedResultsArr = []; 57646 var resultsArr = []; 57647 var allWordsMatchArr = []; 57648 var searchText = this.searchInput.val().toLowerCase(); 57649 57650 if (combinations.length > 0) { 57651 57652 $.each(combinations, function(i, val) { 57653 57654 for (var j = 0; j < searchResults.length; j++) { 57655 var found = true; 57656 for (var k = 0; k < val.length; k++) { 57657 57658 if (searchResults[j].format == 'content-fragment') { 57659 57660 if (!(((searchResults[j].title.toLowerCase()).indexOf(val[k].toLowerCase()) > -1) || ((searchResults[j].answer.toLowerCase()).indexOf(val[k].toLowerCase()) > -1))) { 57661 found = false; 57662 } 57663 57664 } else { 57665 57666 if (!((searchResults[j].title.toLowerCase()).indexOf(val[k].toLowerCase()) > -1)) { 57667 found = false; 57668 } 57669 57670 } 57671 57672 } 57673 57674 57675 if (!(resultsArr.includes(searchResults[j]) || allWordsMatchArr.includes(searchResults[j]))) { 57676 57677 if (found) { 57678 57679 if (((searchResults[j].title.toLowerCase()).indexOf(searchText) > -1)) { 57680 57681 allWordsMatchArr.push(searchResults[j]); 57682 57683 } else { 57684 57685 resultsArr.push(searchResults[j]); 57686 } 57687 57688 57689 } 57690 57691 57692 } 57693 57694 } 57695 57696 if (i == 20) { 57697 return false; 57698 } 57699 57700 }); 57701 57702 for (var x = 0; x < searchResults.length; x++) { 57703 57704 if (!allWordsMatchArr.includes(searchResults[x])) { 57705 57706 if (!resultsArr.includes(searchResults[x])) { 57707 resultsArr.push(searchResults[x]); 57708 } 57709 57710 } 57711 57712 }; 57713 57714 sortedResultsArr = allWordsMatchArr.concat(resultsArr); 57715 57716 57717 } else { 57718 57719 sortedResultsArr = searchResults; 57720 } 57721 57722 57723 return sortedResultsArr; 57724 57725 }; 57726 57727 57728 /*To sort search results based on the search tokens presence*/ 57729 resFinderComponent.prototype.createWordsCombinations = function(tokens) { 57730 57731 var result = []; 57732 57733 var loop = function(start, depth, prefix) { 57734 57735 for (var i = start; i >= 0; i--) { 57736 var next = []; 57737 next.push(tokens[i]) 57738 for (var j = 0; j < prefix.length; j++) { 57739 57740 next.push(prefix[j]); 57741 } 57742 //var next = prefix.concat(tokens[i]); 57743 if (depth < tokens.length - 1) 57744 loop(i - 1, depth + 1, next); 57745 else 57746 result.push(next); 57747 } 57748 } 57749 57750 for (var i = tokens.length - 1; i >= 0; i--) { 57751 loop(tokens.length - 1, i, ''); 57752 } 57753 57754 57755 return result; 57756 57757 57758 57759 }; 57760 57761 57762 57763 /*To clear results from search results block*/ 57764 resFinderComponent.prototype.clearResults = function() { 57765 this.searchResultsContainer.html(''); 57766 }; 57767 57768 57769 /*To toggle display of pagination container*/ 57770 resFinderComponent.prototype.togglePagination = function(show) { 57771 if (show) { 57772 this.paginationContainer.show(); 57773 } else { 57774 this.paginationContainer.hide(); 57775 } 57776 57777 }; 57778 57779 /*To handle pagination*/ 57780 resFinderComponent.prototype.pagination = function(searchResults, startResultCount, toResultCount) { 57781 57782 if (this.dateSort) { 57783 searchResults.sort(this.sortByDate); 57784 } else if (this.titleSort) { 57785 searchResults.sort(this.sortByTitle); 57786 } 57787 57788 var resultsSet = searchResults.slice(startResultCount, toResultCount); 57789 this.currentResultsCountContainer.html(toResultCount); 57790 this.currentresultCount = toResultCount; 57791 this.showResults(resultsSet); 57792 if (toResultCount == searchResults.length) { 57793 this.loadMoreBtn.hide(); 57794 } else { 57795 this.loadMoreBtn.show(); 57796 } 57797 57798 57799 }; 57800 57801 57802 /*To show results in search results block*/ 57803 resFinderComponent.prototype.showResults = function(searchResults) { 57804 57805 var self = this; 57806 57807 $.each(searchResults, function(ind, val) { 57808 var htmlElmnt = ''; 57809 var path = val.path; 57810 var iconClass = ''; 57811 var thumbPath = val.path; 57812 thumbPath = thumbPath.replace(/\(/g, '\\('); 57813 thumbPath = thumbPath.replace(/\)/g, "\\)"); 57814 thumbPath = thumbPath.replace(/ /g, "%20"); 57815 var lastindex = path.lastIndexOf('/'); 57816 var fileName = lastindex > -1 ? path.substr(lastindex+1, path.length): ""; 57817 57818 if (val.format == 'cq:page') { 57819 var pathtype = "page"; 57820 if (val.publishdate != 'null' && val.publishdate != '') { 57821 var date = new Date(val.publishdate); 57822 var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; 57823 var publishDate = months[date.getMonth()] + ' ' + date.getDate() + ', ' + date.getFullYear(); 57824 var publishDateEl = '<div class="publish-date"><span>Posted on:</span> ' + publishDate + '</div>'; 57825 } else { 57826 publishDateEl = ''; 57827 } 57828 57829 if (path.indexOf('.html') < 0) { 57830 path = path + '.html'; 57831 } 57832 // if (path.indexOf('webinars') > -1) { 57833 //var pathtype = "video"; 57834 // } 57835 57836 if ((val.path.indexOf('/secure/') > -1) || (val.path.indexOf('/secured/') > -1)) { 57837 57838 if (self.anonymousUser == true) { 57839 57840 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-4"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div><div class="lock-screen" data-file-name="'+fileName+'"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + '<span>' + Granite.I18n.get("To Unlock") + '</span></span></div> </div><div class="page-name"> <span data-type= ' + pathtype + '>' + val.title + '</span></div></div> <div class="item-result list-view"><span data-type=' + pathtype + ' ><div><h5>' + val.title + '</h5></div><div class="res-icon pages"></div></span><div class="hor-lock-screen" data-file-name="'+fileName+'"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 57841 57842 } else { 57843 57844 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-4"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> <div class="unlock-icon"></div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + '>' + val.title + '</a></div><div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div> <div class="item-result list-view"><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="unlocked-title"><h5>' + val.title + '</h5></div></a> <a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="res-icon pages"></div></a> <div class="hor-share-icon" data-file-name="'+fileName+'"></div><div class="hor-unlock-icon"></div></div>'; 57845 57846 } 57847 57848 }
57848 else if (val.path.indexOf('/validated/') > -1) { 57849 57850 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-4 validated"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + '>' + val.title + '</a></div><div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div> <div class="item-result list-view validated"><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="res-icon pages"></div></a><div class="hor-share-icon" data-file-name="'+fileName+'"></div></div>'; 57851 57852 57853 }else { 57854 57855 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-4"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + '>' + val.title + '</a></div><div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div> <div class="item-result list-view"><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" target="_blank"data-type=' + pathtype + ' ><div class="res-icon pages"></div></a><div class="hor-share-icon" data-file-name="'+fileName+'"></div></div>'; 57856 57857 } 57858 57859 57860 } else if (val.format.indexOf('image') > -1) { 57861 57862 57863 if (val.path.indexOf('/secure/') > -1) { 57864 57865 if (self.anonymousUser == true) { 57866 57867 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-4"> <div class="bg-img"> <div class="thumb-img"> </div> <div class="lock-screen" data-file-name="'+fileName+'"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + '<span>' + Granite.I18n.get("To Unlock") + '</span></span> </div></div> <div class="img-name">' + val.title + '</div> </div> <div class="item-result list-view images"><span><div><h5>' + val.title + '</h5></div><div class="res-icon images"></div></span> <div class="hor-lock-screen" data-file-name="'+fileName+'"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 57868 57869 } else { 57870 57871 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-4"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> <div class="unlock-icon"></div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a><div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div></div> <div class="item-result list-view images"><a href="' + path + '" data-type="image" target="_blank"><div class="unlocked-title"><h5>' + val.title + '</h5></div></a><a class="select-res" href="' + path + '" data-type="image" ><div class="select-box"></div><div class="res-icon images"></div></a> <div class="hor-share-icon" data-file-name="'+fileName+'"></div> <div class="hor-unlock-icon"></div></div>'; 57872 57873 } 57874 57875 } else if (val.path.indexOf('/validated/') > -1) { 57876 57877 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-4 validated"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a><div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div></div> <div class="item-result list-view validated images"><a href="' + path + '" data-type="image" target="_blank"><div><h5>' + val.title + '</h5></div></a><a class="select-res" href="' + path + '" data-type="image" ><div class="select-box"></div><div class="res-icon images"></div></a><div class="hor-share-icon" data-file-name="'+fileName+'"></div></div>'; 57878 57879 57880 } else { 57881 57882 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-4"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a><div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div></div> <div class="item-result list-view images"><a href="' + path + '" data-type="image" target="_blank"><div><h5>' + val.title + '</h5></div></a><a class="select-res" href="' + path + '" data-type="image" ><div class="select-box"></div><div class="res-icon images"></div></a><div class="hor-share-icon" data-file-name="'+fileName+'"></div></div>'; 57883 57884 57885 } 57886 57887 57888 } else if (val.format.indexOf('video') > -1) { 57889 /*Added this code to fix CORB issue for cross domains*/ 57890 var dmThumbnailURL="https://dupont.scene7.com/is/image/Dupont/"+fileName.split(".")[0]+"?fmt=png-alpha"; 57891 if(val.path.indexOf("/content/dam/") > -1){ 57892 val.path = "/content/dam/"+val.path.split("/content/dam/")[1] ; 57893 path = val.path; 57894 } 57895 57896 /**/ 57897 57898 if (val.path.indexOf('/secure/') > -1) { 57899 57900 if (self.anonymousUser == true) { 57901 57902 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-4"> <video poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="lock-screen" data-file-name="'+fileName+'"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span> </div> <div class="vid-name-container top-set"> <span class="vid-name" >' + val.title + '</span></div></div> <div class="item-result list-view"><span><div><h5>' + val.title + '</h5></div><div class="res-icon videos"></div></span> <div class="hor-lock-screen" data-file-name="'+fileName+'"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 57903 } else { 57904 57905 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-4"> <video oncontextmenu="return false;" src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="unlock-icon"></div><div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div> <div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div> <div class="item-result list-view"><a href="' + path + '" data-type="video" download><div class="unlocked-title"><h5>' + val.title + '</h5></div></a> <a href="' + path + '" data-type="video" download><div class="res-icon videos"></div></a> <div class="hor-share-icon" data-file-name="'+fileName+'"></div> <div class="hor-unlock-icon"></div> </div>'; 57906 } 57907 57908 }
57908 else if (val.path.indexOf('/validated/') > -1) { 57909 57910 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-4 validated"> <video oncontextmenu="return false;" src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div> <div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div> <div class="item-result list-view validated"><a href="' + path + '" data-type="video" download><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="video" download><div class="res-icon videos"></div></a><div class="hor-share-icon" data-file-name="'+fileName+'"></div></div>'; 57911 57912 } 57913 else { 57914 57915 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-4"> <video oncontextmenu="return false;" src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' +'"> </video> <div class="play-icon"></div> <div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div> <div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div> <div class="item-result list-view"><a href="' + path + '" data-type="video" download><div><h5>' + val.title + '</h5></div></a><a href="' + path + '" data-type="video" download><div class="res-icon videos"></div></a><div class="hor-share-icon" data-file-name="'+fileName+'"></div></div>'; 57916 57917 } 57918 57919 } else if (val.format.indexOf('content-fragment') > -1) { 57920 57921 var linkClass = ''; 57922 57923 if (val.url.trim() != '') { 57924 linkClass = 'isLink'; 57925 } else { 57926 linkClass = ''; 57927 } 57928 57929 if(!self.isMobileDevice){ 57930 var printHtml = '<span class="print-faq"></span>'; 57931 }else{ 57932 57933 var printHtml = ''; 57934 } 57935 57936 if (val.path.indexOf('/secure/') > -1) { 57937 57938 if (self.anonymousUser == true) { 57939 57940 htmlElmnt += '<div class="faq-list col-12"><div class="faq-wrap locked ' + linkClass + '" data-faq-path="' + val.path + '"><div class="acc-head"><span class="q-icon">Q</span><span class="q-text"></span><span class="acc-icon"></span></div><div class="acc-content"><span class="a-icon">A</span><span class="a-text"><span class="a-content"></span></span></div></div> <div class="hor-lock-screen" data-file-name="'+fileName+'"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 57941 57942 } else { 57943 57944 htmlElmnt += '<div class="faq-list col-12"><div class="faq-wrap ' + linkClass + '" data-faq-path="' + val.path + '"><div class="acc-head"><span class="q-icon">Q</span><span class="q-text"></span><div class="hor-unlock-icon"></div> <span class="acc-icon"></span></div><div class="acc-content"><span class="a-icon">A</span><span class="a-text"><span class="a-content"></span></span>'+printHtml+'<div class="hor-share-icon" data-file-name="'+fileName+'"></div></div></div> </div>'; 57945 57946 } 57947 57948 } else if (val.path.indexOf('/validated/') > -1) { 57949 57950 htmlElmnt += '<div class="faq-list col-12 validated"><div class="faq-wrap ' + linkClass + '" data-faq-path="' + val.path + '"><div class="acc-head"><span class="q-icon">Q</span><span class="q-text"></span><span class="acc-icon"></span></div><div class="acc-content"><span class="a-icon">A</span><span class="a-text"><span class="a-content"></span></span>'+printHtml+'<div class="hor-share-icon" data-file-name="'+fileName+'"></div></div></div> </div>'; 57951 57952 57953 } else { 57954 57955 htmlElmnt += '<div class="faq-list col-12"><div class="faq-wrap ' + linkClass + '" data-faq-path="' + val.path + '"><div class="acc-head"><span class="q-icon">Q</span><span class="q-text"></span><span class="acc-icon"></span></div><div class="acc-content"><span class="a-icon">A</span><span class="a-text"><span class="a-content"></span></span>'+printHtml+'<div class="hor-share-icon" data-file-name="'+fileName+'"></div></div></div> </div>'; 57956 57957 } 57958 57959 self.searchResultsContainer.append(htmlElmnt); 57960 57961 $("[data-faq-path='" + val.path + "']").find('.q-text').html(val.title); 57962 57963 57964 } else { 57965 var isDoc = true; 57966 var tagsString = val.tags.toString().toLowerCase(); 57967 var dataType = "document"; 57968 if (val.format.indexOf('pdf') > -1) { 57969 iconClass = 'pdf'; 57970 } else if (val.format.indexOf('presentation') > -1) { 57971 iconClass = 'ppt'; 57972 } else if (val.format.indexOf('sheet') > -1) { 57973 iconClass = 'sheet'; 57974 } else if (val.format.indexOf('document') > -1 || val.format.indexOf('msword') > -1) { 57975 iconClass = 'doc'; 57976 } 57977 else if (val.format.indexOf('zip') > -1) { 57978 iconClass = 'zip'; 57979 isDoc = false;
57980 } 57981 else if (val.format.indexOf('exe') > -1) { 57982 iconClass = 'exe'; 57983 isDoc = false; 57984 } 57985 57986 57987 // if(isDoc && ((tagsString.indexOf('dupont:literature_type/case-study') >-1) || (tagsString.indexOf('dupont:literature_type/article')>-1))){ 57988 // dataType = "page"; 57989 //} 57990 57991 if (val.path.indexOf('/secure/') > -1) { 57992 57993 if (self.anonymousUser == true) { 57994 57995 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-4"><a data-type="'+dataType+'"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> <div class="lock-screen" data-file-name="'+fileName+'"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div> </div></a><div class="res-name">' + val.title + '</div> </div> <div class="item-result list-view docs"><span data-type="'+dataType+'"><div><h5>' + val.title + '</h5></div><div class="res-icon ' + iconClass + '"></div></span> <div class="hor-lock-screen" data-file-name="'+fileName+'"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 57996 } else { 57997 57998 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-4"><a href="' + path + '" target="_blank" data-type="'+dataType+'"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="unlock-icon"></div><div class="res-name">' + val.title + '</div> <div class="res-download"><a href="' + path + '" data-type="'+dataType+'" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a> <div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div></div> <div class="item-result list-view docs"><a href="' + path + '" data-type="'+dataType+'" target="_blank"><div class="unlocked-title"><h5>' + val.title + '</h5></div></a><a class="select-res" href="' + path + '" data-type="'+dataType+'" ><div class="select-box"></div><div class="res-icon ' + iconClass + '"></div></a> <div class="hor-share-icon" data-file-name="'+fileName+'"></div> <div class="hor-unlock-icon"></div></div>'; 57999 58000 } 58001 58002 } else if (val.path.indexOf('/validated/') > -1) { 58003 58004 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-4 validated"><a href="' + path + '" target="_blank" data-type="'+dataType+'"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="res-name">' + val.title + '</div> <div class="res-download"><a href="' + path + '" data-type="'+dataType+'" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a> <div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div></div> <div class="item-result list-view validated docs"><a href="' + path + '" data-type="'+dataType+'" target="_blank"><div><h5>' + val.title + '</h5></div></a><a class="select-res" href="' + path + '" data-type="'+dataType+'" ><div class="select-box"></div><div class="res-icon ' + iconClass + '"></div></a><div class="hor-share-icon" data-file-name="'+fileName+'"></div></div>'; 58005 58006 58007 }else { 58008 58009 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-4"><a href="' + path + '" target="_blank" data-type="'+dataType+'"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="res-name">' + val.title + '</div> <div class="res-download"><a href="' + path + '" data-type="'+dataType+'" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a> <div class="s-wrap"><div class="share-icon" data-file-name="'+fileName+'"></div><span class="share-txt">' + Granite.I18n.get("Share") + '</span></div></div></div> <div class="item-result list-view docs"><a href="' + path + '" data-type="'+dataType+'" target="_blank"><div><h5>' + val.title + '</h5></div></a><a class="select-res" href="' + path + '" data-type="'+dataType+'" ><div class="select-box"></div><div class="res-icon ' + iconClass + '"></div></a><div class="hor-share-icon" data-file-name="'+fileName+'"></div></div>'; 58010 58011 } 58012 58013 58014 } 58015 58016 if (val.format.indexOf('content-fragment') < 0) { 58017 58018 self.searchResultsContainer.append(htmlElmnt); 58019 } 58020 58021 58022 }); 58023 58024 if(this.sharedVideo){ 58025 var videoSrc = $(self.rfComp.find('.video-list')[0]).find('video').attr('src'); 58026 if(videoSrc){ 58027 $(this.rfComp.find('#search-results-container .play-icon')[0]).trigger('click'); 58028 setTimeout(function(){ 58029 var videoEl = self.rfComp.find('#vid-container video')[0]; 58030 if(videoEl.currentTime == 0){ 58031 videoEl.muted=true; 58032 videoEl.play(); 58033 } 58034 },500); 58035 } 58036 this.sharedVideo=false; 58037 } 58038 58039 58040 if (this.blockView) { 58041 this.searchResultsContainer.find('.block-view').show(); 58042 } else { 58043 this.searchResultsContainer.find('.list-view').show(); 58044 } 58045 58046 if (!$('[data-res-name="kFAQs"]').hasClass('selected')) { 58047 58048 this.highlightWordInResults(this.searchResultsContainer, this.searchInput.val()); 58049 58050 } 58051 58052 if(rcDownloadDocsList.length){ 58053 $.each(rcDownloadDocsList , function(i,val){ 58054 self.rfComp.find('a.select-res[href="'+val+'"]').addClass('selected'); 58055 }) 58056 58057 } 58058 58059 }; 58060 58061 58062 58063 let rfCompObj = new resFinderComponent(); 58064 58065 /*initiate execution*/ 58066 rfCompObj.init(); 58067 58068 58069 58070}); 58071$(window).on("load",function(){ $(".search-result").on('DOMSubtreeModified', function() { 58072 58073 58074 58075 $("video").each(function(){$(this).attr("controlsList","nodownload");}); 58076 58077 58078 58079}); 58080}); 58081 58082function StickyBar(element) { 58083 this.el = element; 58084 this.navBarEl = $(".container-fluid.no-gutters"); 58085 this.lastScrollY = $(window).scrollTop(); 58086 this.minimunScroll = 72; 58087 this.initializeEvents(); 58088} 58089StickyBar.prototype.checkScroll = function (e) { 58090 var scrollY = $(window).scrollTop(), 58091 scrollMax = ($(document).height() - $(window).height()), 58092 isSafari = (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1); 58093 var scrollElastic = (isSafari) ? document.body.scrollTop : window.scrollY; 58094 58095 if (scrollElastic > 0 && scrollElastic < scrollMax) { 58096 if (scrollY > this.lastScrollY) { 58097 this.el.addClass('scroll-sticky') 58098 } else { 58099 this.el.removeClass('scroll-sticky') 58100 } 58101 this.lastScrollY = scrollY; 58102 } 58103}; 58104 58105StickyBar.prototype.initializeEvents = function () { 58106 58107 var supportsOrientationChange = "onorientationchange" in window, 58108 orientationEvent = supportsOrientationChange ? "orientationchange" : "resize", 58109 self = this; 58110 58111 $(window).on("scroll", this.checkScroll.bind(this)); 58112 $(window).on(orientationEvent, this.checkScroll.bind(this)); 58113}; 58114 58115$(function () { 58116 $(".container-fluid.no-gutters").each(function () { 58117 new StickyBar($(this)); 58118 }); 58119}); 58120 58121 function reCaptchaVerify(response) { 58122 var captchaEl= $(".g-recaptcha")[0]; 58123 if(response){ 58124 $(captchaEl).attr('validated',true); 58125 $("#response-div").html(""); 58126 } 58127 else{ 58128 $(captchaEl).attr('validated',false); 58129 } 58130 58131 } 58132 58133 function reCaptchaExpired () { 58134 /* do something when it expires */ 58135 } 58136 58137 function reCaptchaCallback () { 58138 var recaptchaLang = 'en'; 58139 switch(digitalData.page.pageLanguage) { 58140 case 'Chinese': recaptchaLang = 'zh-CN'; 58141 break; 58142 case 'German': recaptchaLang = 'de'; 58143 break; 58144 case 'Korean': recaptchaLang = 'ko'; 58145 break;
58146 case 'Japanese': recaptchaLang = 'ja'; 58147 break; 58148 case 'Italian': recaptchaLang = 'it'; 58149 break; 58150 case 'Spanish': recaptchaLang = 'es'; 58151 break; 58152 case 'Polish': recaptchaLang = 'pl'; 58153 break; 58154 case 'Dutch': recaptchaLang = 'nl'; 58155 break; 58156 case 'French': recaptchaLang = 'fr'; 58157 break; 58158 case 'Turkish': recaptchaLang = 'tr'; 58159 break; 58160 case 'Russian': recaptchaLang = 'ru'; 58161 break; 58162 case 'Swedish': recaptchaLang = 'sv'; 58163 break; 58164 case 'Portuguese': recaptchaLang = 'pt'; 58165 break; 58166 case 'Czech': recaptchaLang = 'cs'; 58167 break; 58168 case 'Danish': recaptchaLang = 'da'; 58169 break; 58170 } 58171 grecaptcha.render('rcaptcha', { 58172 // 'sitekey': RC2KEY, 58173 'callback': reCaptchaVerify, 58174 'expired-callback': reCaptchaExpired, 58175 'hl': recaptchaLang 58176 }); 58177 } 58178 58179 58180//(function() { 58181 if (document.getElementsByClassName("webinar-rc-comp").length) { 58182 /*var user = { 58183 emailfound: false, 58184 previousEmail: "", 58185 }; 58186 58187 var resetUser = false;*/ 58188 58189 /*eloqua push logic*/ 58190 var userElqDetails = {}; 58191 58192 function chkWbRCElq() { 58193 var b = "", 58194 N = new Date(20020101), 58195 O = new Date(), 58196 g = O.getMilliseconds(), 58197 r = N.getTimezoneOffset(), 58198 l = window, 58199 q = document, 58200 z = 0, 58201 m = 1, 58202 f = 2, 58203 c = "", 58204 n = "", 58205 B = "/visitor/v200/svrGP", 58206 k = "eloqua.com", 58207 d = "", 58208 e = ""; 58209 58210 function a(a) { 58211 return typeof a === "undefined" || null === a || a === ""; 58212 } 58213 58214 function J(a) { 58215 try { 58216 return typeof a === "string" && decodeURI(a) !== a; 58217 } catch (b) { 58218 return false; 58219 } 58220 } 58221 58222 function p(b) { 58223 if (a(b)) 58224 if (document.referrer) b = document.referrer; 58225 else b = "elqNone"; 58226 return encodeURIComponent(b); 58227 } 58228 58229 function K(j, i) { 58230 if (!a(d) && !a(b)) { 58231 var h = 58232 d + 58233 "?pps=50&siteid=" + 58234 b + 58235 "&DLKey=" + 58236 encodeURIComponent(j) + 58237 "&DLLookup=" + 58238 encodeURIComponent(i) + 58239 "&ms=" + 58240 g + 58241 e; 58242 if (!a(c)) h += "&elqGUID=" + c; 58243 var f = document.createElement("script"); 58244 f.type = "text/javascript"; 58245 f.src = h; 58246 f.onload = SetElqContent; 58247 f.onerror = SetElqContent; 58248 document.getElementsByTagName("head")[0].appendChild(f); 58249 } 58250 } 58251 58252 function H() { 58253 if (!a(d) && !a(b)) { 58254 var h = d + "?pps=70&siteid=" + b + "&ms=" + g + e; 58255 if (!a(c)) h += "&elqGUID=" + c; 58256 var f = document.createElement("script"); 58257 f.type = "text/javascript"; 58258 f.src = h; 58259 document.getElementsByTagName("head")[0].appendChild(f); 58260 } 58261 } 58262 58263 function j(s, k, l) { 58264 var i = ""; 58265 if (!a(d) && !a(b)) { 58266 if (e != "") { 58267 var q = h("OPTIN"); 58268 if (q != null) 58269 if (q == "0") return; 58270 else if (q == "1") i += "&isOptedIn=1"; 58271 } 58272 k = p(k); 58273 if (!a(l)) 58274 if (l === f) i += "&optin=country"; 58275 else if (l === m) i += "&optin=all"; 58276 else if (l === z) i += "&optin=disabled"; 58277 var t = new Image(1, 1); 58278 if (!a(s)) { 58279 var j = 58280 d + 58281 "?pps=3&siteid=" + 58282 b + 58283 "&ref=" + 58284 encodeURIComponent(s) + 58285 "&ref2=" + 58286 k + 58287 "&tzo=" + 58288 r + 58289 "&ms=" + 58290 g + 58291 i + 58292 e; 58293 if (!a(c)) j += "&elqGUID=" + c; 58294 j += o(n); 58295 t.src = j; 58296 } else { 58297 var j = 58298 d + 58299 "?pps=3&siteid=" + 58300 b + 58301 "&ref2=" + 58302 k + 58303 "&tzo=" + 58304 r + 58305 "&ms=" + 58306 g + 58307 i + 58308 e; 58309 if (!a(c)) j += "&elqGUID=" + c; 58310 j += o(n); 58311 t.src = j; 58312 } 58313 } 58314 } 58315 58316 function I(b, a) { 58317 j(b, a, z); 58318 } 58319 58320 function u(b, a) { 58321 j(b, a, f); 58322 } 58323 58324 function v(b, a) { 58325 j(b, a, m); 58326 } 58327 58328 function i(f) { 58329 if (!a(d) && !a(b) && !a(f)) { 58330 if (f == 40 && e != "") { 58331 var i = h("OPTIN"); 58332 if (i != null) 58333 if (i == "0") 58334 return y("function elqGetOptOutStatus(){ return 0; }"); 58335 else if (i == "1") 58336 return y("function elqGetOptOutStatus(){ return 1; }"); 58337 } 58338 if ((f != 43 && f != 44) || e == "") { 58339 elqOptActionSrc = 58340 d + 58341 "?pps=" + 58342 encodeURIComponent(f) + 58343 "&siteid=" + 58344 b + 58345 "&ref=" + 58346 encodeURIComponent(location.href) + 58347 "&ms=" + 58348 g + 58349 e; 58350 if (!a(c)) elqOptActionSrc += "&elqGUID=" + c; 58351 var j = document.createElement("script"); 58352 j.type = "text/javascript"; 58353 j.src = elqOptActionSrc; 58354 document.getElementsByTagName("head")[0].appendChild(j); 58355 } 58356 } 58357 } 58358 58359 function y(b) { 58360 var a = document.createElement("script"); 58361 a.type = "text/javascript"; 58362 a.appendChild(document.createTextNode(b)); 58363 document.getElementsByTagName("head")[0].appendChild(a); 58364 } 58365 58366 function t(g, e, c) { 58367 if (!a(d) && !a(b)) 58368 if (x()) { 58369 A("ELQSITEVISITED", "YES"); 58370 w(g, e, c); 58371 } else if (g == f) u(e, c); 58372 else v(e, c); 58373 } 58374 58375 function s(c, g, e) { 58376 if (!a(d) && !a(b)) { 58377 var i = h("OPTIN"); 58378 if (i != null) 58379 if (i == "0") return; 58380 else i == "1" && j(g, e, c); 58381 else if (x()) { 58382 A("ELQSITEVISITED", "YES"); 58383 if (c == f) w(c, g, e); 58384 else elqCreateOptInBanner(); 58385 } else c == f && j(g, e, c); 58386 } 58387 } 58388 58389 function w(l, k, i) { 58390 i = p(i); 58391 var h = d + "?pps=45&siteid=" + b + e; 58392 if (!a(k)) h += "&ref=" + encodeURIComponent(k); 58393 h += "&ref2=" + i + "&tzo=" + r + "&ms=" + g; 58394 if (l == f) h += "&optin=country"; 58395 else h += "&optin=all"; 58396 if (!a(c)) h += "&elqGUID=" + c; 58397 var j = document.createElement("script"); 58398 j.type = "text/javascript"; 58399 j.src = h; 58400 document.getElementsByTagName("head")[0].appendChild(j); 58401 } 58402 58403 function E(b, a) { 58404 if (e != "") s(f, b, a); 58405 else t(f, b, a); 58406 } 58407 58408 function F(b, a) { 58409 if (e != "") s(m, b, a); 58410 else t(m, b, a); 58411 } 58412 58413 function A(b, a) { 58414 document.cookie = b + "=" + a; 58415 document.cookie += ";path=/; secure; HttpOnly; "; 58416 } 58417 58418 function C(a, c) { 58419 if (a == "") return null; 58420 var b = a.indexOf("="); 58421 if (b > 0) { 58422 var d = a.substr(0, b); 58423 if (d.trim() == c) return a.substr(b + 1); 58424 } 58425 return null; 58426 } 58427 58428 function h(c) { 58429 for (var b = document.cookie.split(";"), a = 0; a < b.length; a++) { 58430 elqCookieValue = C(b[a], c); 58431 if (elqCookieValue != null) return unescape(elqCookieValue); 58432 } 58433 return null; 58434 } 58435 58436 function G(e, d) { 58437 var a = h(e); 58438 if (a != null) 58439 for (var c = a.split("&"), b = 0; b < c.length; b++) { 58440 a = C(c[b], d); 58441 if (a != null) return a; 58442 } 58443 return null; 58444 } 58445 58446 function x() { 58447 var a = h("ELQSITEVISITED"); 58448 return a == null || a != "YES"; 58449 } 58450 58451 function o(b) { 58452 var c = ""; 58453 if (!a(b)) c += "&bkuuidSwapTime=" + encodeURIComponent(b); 58454 return c; 58455 } 58456 58457 function P(a) { 58458 return !isNaN(a) && parseInt(Number(a)) == a && !isNaN(parseInt(a, 10)); 58459 } 58460 var M = function() { 58461 this.push = function() { 58462 for (var a = 0; a < arguments.length; a++) 58463 try { 58464 if (typeof arguments[a] === "function") arguments[a](); 58465 else 58466 switch (arguments[a][0]) { 58467 case "elqSetRootDomain": 58468 k = encodeURIComponent(arguments[a][1]); 58469 var g; 58470 if (arguments[a][2] != undefined && P(arguments[a][2])) { 58471 g = arguments[a][2]; 58472 k = k + ":" + g; 58473 } 58474 d = "https://s" + b + ".t." + k + B; 58475 break; 58476 case "elqSetSiteId": 58477 b = encodeURIComponent(arguments[a][1]); 58478 d = "https://s" + b + ".t." + k + B; 58479 break; 58480 case "elqTrackPageView": 58481 I.apply(this, arguments[a].slice(1)); 58482 break; 58483 case "elqVisitorGuid": 58484 c = encodeURIComponent(arguments[a][1]); 58485 break; 58486 case "elqTrackPageViewOptinByCountry": 58487 u.apply(this, arguments[a].slice(1)); 58488 break; 58489 case "elqTrackPageViewOptinAll": 58490 v.apply(this, arguments[a].slice(1)); 58491 break; 58492 case "elqTrackPageViewDisplayOptInBannerByCountry": 58493 E.apply(this, arguments[a].slice(1)); 58494 break; 58495 case "elqTrackPageViewDisplayOptInBannerForAll": 58496 F.apply(this, arguments[a].slice(1)); 58497 break; 58498 case "elqDataLookup": 58499 K.apply(this, arguments[a].slice(1)); 58500 break; 58501 case "elqGetCustomerGUID": 58502 H.apply(this); 58503 break; 58504 case "elqOptStatus":
58505 i(40); 58506 break; 58507 case "elqOptIn": 58508 i(41); 58509 break; 58510 case "elqOptOut": 58511 i(42); 58512 break; 58513 case "elqGlobalOptIn": 58514 i(43); 58515 break; 58516 case "elqGlobalOptOut": 58517 i(44); 58518 break; 58519 case "elqUseFirstPartyCookie": 58520 e = 58521 "&firstPartyCookieDomain=" + 58522 encodeURIComponent(arguments[a][1]); 58523 var f = G("ELOQUA", "GUID"); 58524 if (f != null) c = encodeURIComponent(f); 58525 n = h("BKUT"); 58526 } 58527 } catch (j) {} 58528 }; 58529 }, 58530 L = l._elqQ; 58531 l._elqQ = new M(); 58532 l._elqQ.push.apply(l._elqQ, L); 58533 58534 function D(i, j, h) { 58535 if (!a(d) && !a(b) && !a(i)) { 58536 h = p(h); 58537 var f = 58538 d + 58539 "?pps=17&siteid=" + 58540 b + 58541 "&elq=" + 58542 encodeURIComponent(j || "") + 58543 "&ref=" + 58544 encodeURIComponent(i) + 58545 "&ref2=" + 58546 h + 58547 "&ms=" + 58548 g; 58549 if (!a(c)) f += "&elqGUID=" + c; 58550 f += o(n); 58551 if (f.length <= 2036) { 58552 var k = new Image(1, 1); 58553 k.src = f; 58554 } else { 58555 try { 58556 var e = q.createElement("iframe"); 58557 } catch (l) { 58558 e = 58559 "<iframe src='" + 58560 f + 58561 "' width='0' height='0' style='display:none;visibility:hidden;'></iframe>"; 58562 q.body.innerHTML += e; 58563 return; 58564 } 58565 e.height = "0"; 58566 e.width = "0"; 58567 e.style.display = "none"; 58568 e.style.visibility = "hidden"; 58569 q.body.appendChild(e); 58570 e.src = f; 58571 } 58572 } 58573 } 58574 l._elq = { 58575 trackEvent: function(a, b, c) { 58576 D(a, b, c); 58577 }, 58578 trackOutboundLink: function(b, f, g) { 58579 D(b.href, f, g); 58580 var d = J(b.href) ? b.href : encodeURI(b.href), 58581 c, 58582 e = b.getAttribute("target"); 58583 if (a(e)) c = 'document.location = "' + d + '"'; 58584 else c = 'window.open("' + d + '", "' + encodeURIComponent(e) + '")'; 58585 setTimeout(c, 1e3); 58586 }, 58587 }; 58588 } 58589 58590 window.SetElqContent = function() { 58591 58592 try{ 58593 userElqDetails.firstName = GetElqContentPersonalizationValue("C_FirstName") ; 58594 userElqDetails.lastName = GetElqContentPersonalizationValue("C_LastName") ; 58595 userElqDetails.company = GetElqContentPersonalizationValue("C_Company") ; 58596 if(GetElqContentPersonalizationValue("C_Country")){ 58597 userElqDetails.country = GetElqContentPersonalizationValue("C_Country").toUpperCase(); 58598 }else if(GetElqContentPersonalizationValue("C_Lead_Country1")){ 58599 userElqDetails.country = GetElqContentPersonalizationValue("C_Lead_Country1").toUpperCase(); 58600 } 58601 58602 userElqDetails.role = GetElqContentPersonalizationValue("C_Role1") ; 58603 userElqDetails.jobFunction = GetElqContentPersonalizationValue("C_Job_Function1") ; 58604 userElqDetails.busPhone = GetElqContentPersonalizationValue("C_BusPhone"); 58605 userElqDetails.accountType = GetElqContentPersonalizationValue("C_Account_Type1"); 58606 //userElqDetails.jobTitle = GetElqContentPersonalizationValue("C_Title"); 58607 userElqDetails.industry = GetElqContentPersonalizationValue("C_Industry1"); 58608 userElqDetails.state = GetElqContentPersonalizationValue("C_Mailing_State_Province1"); 58609 userElqDetails.zip = GetElqContentPersonalizationValue("C_Mailing_Zip_Postal_Code1"); 58610 userElqDetails.companySize = GetElqContentPersonalizationValue("C_Company_Size1"); 58611 userElqDetails.address = GetElqContentPersonalizationValue("C_Address1"); 58612 userElqDetails.city = GetElqContentPersonalizationValue("C_Mailing_City1"); 58613 userElqDetails.subIndustry = GetElqContentPersonalizationValue("C_Business_Sub_industry1"); 58614 userElqDetails.businessSegment = GetElqContentPersonalizationValue("C_Business_Segment1"); 58615 58616 //console.log(">>>>>>>",userElqDetails) 58617 }catch(e){ 58618 console.log("error in eloqua lookup",e); 58619 } 58620 58621 }; 58622 } 58623 58624 58625$(function() { 58626 /*Webinar RC component*/ 58627 58628 let webinarRCComponent = function(compId) { 58629 try{ 58630 58631 this.wbRCComp = $($('.'+compId)[0]); 58632 58633 if (this.wbRCComp.length > 0) { 58634 let results = this.wbRCComp.attr('data-attr-results'); 58635 results = results ? results : "{}"; 58636 this.loadMoreBtn = $(this.wbRCComp.find('.load-more')[0]); 58637 this.signInLink = this.wbRCComp.attr('data-attr-signinlink'); 58638 this.visitorIdField = this.wbRCComp.attr('data-attr-visitorID'); 58639 //this.showLoadMore = true; 58640 this.loadMoreCount = 4; 58641 this.currentResultsCount = 0; 58642 this.compData = JSON.parse(results); 58643 this.results = this.compData.webinarresults ? this.compData.webinarresults : []; 58644 this.formData = this.compData.otherFields ? this.compData.otherFields : {}; 58645 this.showLoadMore = this.formData.loadmore ? (this.results.length <= this.loadMoreCount ? false : true) : false;
58646 this.userRecongnized = false; 58647 58648 if(this.formData.headline){ 58649 this.wbRCComp.find('.headline').html(this.compData.otherFields.headline); 58650 } 58651 58652 //console.log("this.results>>>>>",JSON.parse(this.wbRCComp.attr('data-attr-results'))) 58653 //console.log("this.visitorIdField",this.visitorIdField); 58654 } 58655 } 58656 catch(e){ 58657 console.log(e); 58658 } 58659 } 58660 58661 /*To bind events with handlers*/ 58662 58663 webinarRCComponent.prototype.bindEvents = function() { 58664 let self = this; 58665 58666 this.loadMoreBtn.on('click', $.proxy(this.loadMoreBtnClickHandler, this)); 58667 this.wbRCComp.on('click','.usrSignedIn', $.proxy(this.subcribeClickHandler, this)); 58668 this.wbRCComp.on('click','.wb-rc-model', $.proxy(this.wbRcModelClickHandler, this)); 58669 this.wbRCComp.on('click','.subscribe-dialog button', $.proxy(this.wbRcBtnClickHandler, this)); 58670 58671 }; 58672 58673 webinarRCComponent.prototype.removeAttributes = function() { 58674 this.wbRCComp.removeAttr('data-attr-results'); 58675 this.wbRCComp.removeAttr('data-attr-signinlink'); 58676 this.wbRCComp.removeAttr('data-attr-loadmore'); 58677 this.wbRCComp.removeAttr('data-attr-visitorID'); 58678 } 58679 58680 webinarRCComponent.prototype.init = function(){ 58681 58682 this.removeAttributes(); 58683 this.bindEvents(); 58684 58685 if(!this.showLoadMore){ 58686 this.renderHTML(this.prepareHTML(this.results)); 58687 }else{ 58688 if(this.results.length > this.loadMoreCount){ 58689 this.currentResultsCount = this.loadMoreCount; 58690 this.renderHTML(this.prepareHTML(this.results.slice(0,this.loadMoreCount))); 58691 58692 }else{ 58693 this.renderHTML(this.prepareHTML(this.results)); 58694 } 58695 this.loadMoreBtn.css('display','block'); 58696 } 58697 58698 this.getUserEmail($.proxy(this.doEloquaLookup, this)); 58699 58700 } 58701 58702 webinarRCComponent.prototype.wbRcBtnClickHandler = function(evnt){ 58703 if($(evnt.target).hasClass('no-res')){ 58704 this.wbRCComp.find('.wb-rc-model').toggle(); 58705 }else if($(evnt.target).hasClass('yes-res')){ 58706 this.wbRCComp.find('.yes-res').prop('disabled',true); 58707 this.triggerFormSubmit(); 58708 this.wbRCComp.find('.middle-container').show(); 58709 this.wbRCComp.find('.response-msg').hide(); 58710 this.wbRCComp.find('.gooey').show(); 58711 //this.wbRCComp.find('.wb-rc-model').toggle(); 58712 } 58713 } 58714 58715 webinarRCComponent.prototype.subcribeClickHandler = function(evnt){ 58716 58717 this.subscribedWebinarIndex = $(evnt.currentTarget).attr('data-webinarindex'); 58718 this.wbRCComp.find('.web-name').html(this.results[this.subscribedWebinarIndex]['webinarName']); 58719 this.wbRCComp.find('.web-description').html(this.results[this.subscribedWebinarIndex]['webinarDescription']); 58720 this.wbRCComp.find('.web-date').html("<i>"+this.results[this.subscribedWebinarIndex]['webinarDate']+"</i>"); 58721 this.wbRCComp.find('.wb-rc-model').css('display','flex'); 58722 58723 } 58724 58725 webinarRCComponent.prototype.wbRcModelClickHandler = function(evnt){ 58726 if($(evnt.target).hasClass('wb-rc-model')){ 58727 this.wbRCComp.find('.wb-rc-model').toggle(); 58728 } 58729 58730 } 58731 58732 webinarRCComponent.prototype.loadMoreBtnClickHandler = function(){ 58733 let results = []; 58734 if(this.currentResultsCount+this.loadMoreCount < this.results.length){ 58735 results = this.results.slice(this.currentResultsCount, this.currentResultsCount+this.loadMoreCount); 58736 this.currentResultsCount = this.currentResultsCount+this.loadMoreCount ; 58737 58738 }else{ 58739 results = this.results.slice(this.currentResultsCount, this.results.length); 58740 this.loadMoreBtn.hide(); 58741 } 58742 //console.log(">>>jj",results) 58743 58744 this.renderHTML(this.prepareHTML(results)); 58745 if(this.userRecongnized){ 58746 this.showSubscribeLinks(); 58747 } 58748 } 58749 58750 webinarRCComponent.prototype.getUserEmail = function(elqLookup){ 58751 let self = this; 58752 let i =0; 58753 58754 let interval = setInterval(function(){ 58755 i++; 58756 58757 if(digitalData.user.email){ 58758 58759 clearInterval(interval); 58760 58761 if(!$('body').attr('eloqua-lookup-done')){ 58762 elqLookup(digitalData.user.email); 58763 58764 let j =0; 58765 let findUSer = setInterval(function(){ 58766 58767 j++; 58768 if((userElqDetails.firstName !=undefined && userElqDetails.firstName !== "" && userElqDetails.firstName !== "Not Provided") && (userElqDetails.country != undefined && userElqDetails.country !== "" && userElqDetails.country !== "Not Provided")){ 58769 clearInterval(findUSer); 58770 self.userRecongnized = true; 58771 self.showSubscribeLinks(); 58772 }else if(j==10){ 58773 clearInterval(findUSer); 58774 } 58775 },500); 58776 58777 58778 } 58779 }else if(i == 25){ 58780 clearInterval(interval); 58781 } 58782 58783 58784 },500); 58785 58786//To be deleted below lines are for testing purpose 58787 /* if(!$('body').attr('eloqua-lookup-done')){ 58788 elqLookup("[email protected]"); 58789 //if((userElqDetails.firstName !=undefined && userElqDetails.firstName !== "" && userElqDetails.firstName !== "Not Provided") && (userElqDetails.country != undefined && userElqDetails.country !== "" && userElqDetails.country !== "Not Provided")){ 58790 self.userRecongnized = true; 58791 self.showSubscribeLinks(); 58792 //} 58793 58794 } */ 58795 58796 } 58797 58798 webinarRCComponent.prototype.showSubscribeLinks = function(){ 58799 this.wbRCComp.find('.register-link').hide(); 58800 this.wbRCComp.find('.usrSignedIn').show(); 58801 }; 58802 58803 webinarRCComponent.prototype.triggerFormSubmit = function(){ 58804 58805 let self = this; 58806 let subcribedWebinarObj = this.results[this.subscribedWebinarIndex]; 58807 58808 let paramsObj = { 58809 "emailAddress":digitalData.user.email == "" ? undefined:digitalData.user.email, 58810 "firstName":(userElqDetails.firstName == "" || userElqDetails.firstName == "N
58810ot Provided") ? undefined:userElqDetails.firstName, 58811 "lastName":(userElqDetails.lastName == "" || userElqDetails.lastName == "Not Provided") ? undefined:userElqDetails.lastName, 58812 "companyName":(userElqDetails.company == "" || userElqDetails.company == "Not Provided") ? undefined:userElqDetails.company, 58813 "country":(userElqDetails.country == "" || userElqDetails.country == "Not Provided") ? undefined:userElqDetails.country, 58814 "role": (userElqDetails.role == "" || userElqDetails.role == "Not Provided") ? undefined:userElqDetails.role, 58815 //"influenceType":userElqDetails.role, 58816 "phoneNumber":(userElqDetails.busPhone == "" || userElqDetails.busPhone == "Not Provided") ? undefined:userElqDetails.busPhone, 58817 "jobFunction":(userElqDetails.jobFunction == "" || userElqDetails.jobFunction == "Not Provided") ? undefined:userElqDetails.jobFunction, 58818 "businessIndustry": (userElqDetails.industry == "" || userElqDetails.industry == "Not Provided") ? undefined:userElqDetails.industry, 58819 "state": (userElqDetails.state == "" || userElqDetails.state == "Not Provided") ? undefined:userElqDetails.state, 58820 "zipCode":(userElqDetails.zip == "" || userElqDetails.zip == "Not Provided") ? undefined:userElqDetails.zip, 58821 "address": (userElqDetails.address == "" || userElqDetails.address == "Not Provided") ? undefined:userElqDetails.address, 58822 "city": (userElqDetails.city == "" || userElqDetails.city == "Not Provided") ? undefined:userElqDetails.city, 58823 "businessSubIndustry":(userElqDetails.subIndustry == "" || userElqDetails.subIndustry == "Not Provided") ? undefined:userElqDetails.subIndustry, 58824 "businessSegment": (userElqDetails.businessSegment == "" || userElqDetails.businessSegment == "Not Provided") ? undefined:userElqDetails.businessSegment, 58825 "companySize": (userElqDetails.companySize == "" || userElqDetails.companySize == "Not Provided") ? undefined:userElqDetails.companySize, 58826 "accountType": (userElqDetails.accountType == "" || userElqDetails.accountType == "Not Provided") ? undefined:userElqDetails.accountType, 58827 "elqSiteId":this.formData.siteId ? this.formData.siteId : undefined, 58828 58829 58830 58831 //"accountType":userElqDetails.companyType, 58832 //"JobTitle":userElqDetails.jobTitle, 58833 58834 //"industry":userElqDetails.industry, 58835 58836 }; 58837 58838 58839 //console.log("subcribedWebinarObj",subcribedWebinarObj); 58840 subcribedWebinarObj.hidden_fields.forEach(function(item){ 58841 Object.keys(item).forEach(function(field){ 58842 paramsObj[field] = item[field]; 58843 }) 58844 58845 // paramsObj[item] 58846 }); 58847 let webVistorIDField = this.visitorIdField ? this.visitorIdField : "webVisitorID"; 58848 if(_satellite.getVisitorId().getMarketingCloudVisitorID()){ 58849 paramsObj[webVistorIDField] = _satellite.getVisitorId().getMarketingCloudVisitorID(); 58850 }else if(s.fid) { 58851 paramsObj[webVistorIDField] = s.fid; 58852 } 58853 else { 58854 paramsObj[webVistorIDField] ="0000-0000-0000"; 58855 } 58856 58857 paramsObj["originForm"] = window.location.href; 58858 paramsObj["originURL"] = parent.document.referrer; 58859 58860 58861 // console.log(">>>>paramsObj",paramsObj); 58862 $.ajax({ 58863 type: "POST", 58864 url: this.formData.actionURL, 58865 //dataType: "json", 58866 //contentType: "application/json", 58867 cache: false, 58868 data:paramsObj, 58869 error: function(data) { 58870 alert("Encountered some error in sending data to Eloqua"); 58871 }, 58872 success: function(data) { 58873 self.wbRCComp.find('.gooey').hide(); 58874 self.wbRCComp.find('.response-msg').show(); 58875 setTimeout(function(){ 58876 self.wbRCComp.find('.middle-container').hide(); 58877 self.wbRCComp.find('.wb-rc-model').trigger('click'); 58878 self.wbRCComp.find('.yes-res').prop('disabled',false); 58879 58880 },3000); 58881 console.log("Error in webinar RC Form Submit:", data); 58882 58883 } 58884 58885 }); 58886 58887 } 58888 58889 58890 webinarRCComponent.prototype.prepareHTML = function(results){ 58891 let html = ''; 58892 58893 for(let i=0; i<results.length; i++){ 58894 58895 const thumbnailPath = (results[i]["webinar-thumbnail"]) ? results[i]["webinar-thumbnail"] : "/content/dam/dupont/global/icons/webinar_thumb.png"; 58896 results[i].webinarName = results[i].webinarName ? results[i].webinarName : ""; 58897 html += '<div class="col-md-3 card-col">'+ 58898 '<div class="box">'+ 58899 '<img src="'+thumbnailPath+'" class="img-fluid"/>'+ 58900 '<div class="text">'+ 58901 '<h5 title="'+results[i].webinarName+'">'+results[i].webinarName+'</h5>'; 58902 if(results[i].webinarDate){ 58903 html += '<div class="web_date"><span><b>'+Granite.I18n.get("Date")+':</b> '+results[i].webinarDate+'</span></div>'; 58904 } 58905 58906 html +='<a data-analytics="link_track" data-title="'+results[i].webinarName+'" class="usrSignedIn" data-webinarindex="'+i+'">
58906'+Granite.I18n.get("Register")+'<span class="right-arrow"></span></a>'; 58907 if(results[i].landing_page_url){ 58908 html += '<a href="'+results[i].landing_page_url+'" target="_blank" data-analytics="link_track" data-title="'+results[i].webinarName+'" class="register-link">'+Granite.I18n.get("Register")+'<span class="right-arrow"></span></a>'; 58909 } 58910 58911 html +='</div>'+ 58912 '</div>'+ 58913 '</div>' 58914 } 58915 58916 //console.log("html",html); 58917 return html ; 58918 //this.wbRCComp.find('.bottomCardRow').html(html); 58919 } 58920 58921 58922 58923 webinarRCComponent.prototype.renderHTML = function(html){ 58924 58925 this.wbRCComp.find('.bottomCardRow').append(html); 58926 } 58927 58928 58929 58930 webinarRCComponent.prototype.doEloquaLookup = function(userEmail){ 58931 $('body').attr('eloqua-lookup-done','yes'); 58932 GetElqContentPersonalizationValue = undefined; 58933 /*if (document.getElementById("eloquaPushResp")){ 58934 document.head.removeChild(document.getElementById("eloquaPushResp")); 58935 }*/ 58936 58937 window._elqQ = []; 58938 _elqQ.push(["elqSetSiteId", this.formData.siteId]); 58939 _elqQ.push(["elqTrackPageView"]); 58940 _elqQ.push([ 58941 "elqDataLookup", 58942 escape(this.formData.lookupId), 58943 "<C_EmailAddress>" + 58944 userEmail + 58945 "</C_EmailAddress>", 58946 ]); 58947 chkWbRCElq(); 58948 } 58949 58950 58951 $.each($('.webinar-rc-comp'),function(i,v) { 58952 $(v).addClass("wrc-"+i); 58953 (new webinarRCComponent("wrc-"+i)).init(); 58954 58955 }); 58956}); 58957 58958 58959$(function(){ 58960 58961 58962 var quoteCarousel = function(cl) { 58963 58964 this.el = $($('.' + cl)[0]); 58965 58966 }; 58967 58968 quoteCarousel.prototype.scrollTrack = function() { 58969 58970 var self = this; 58971 58972 this.doAnimate(); 58973 58974 $(window).scroll(function() { 58975 58976 self.doAnimate(); 58977 58978 58979 }) 58980 58981 }; 58982 58983 quoteCarousel.prototype.doAnimate = function() { 58984 58985 var scrollTop = $(window).scrollTop(); 58986 var sbHeight = window.innerHeight * (window.innerHeight / document.body.offsetHeight); 58987 this.elScrollTop = this.el.offset().top; 58988 58989 if((scrollTop)>=(this.elScrollTop-window.innerHeight+150)){ 58990 if(!this.el.hasClass('animate')){ 58991 this.el.addClass('animate'); 58992 } 58993 } 58994 }; 58995 58996 58997 $.each($('.qb-with-Carousel'), function(i, v) { 58998 58999 var isAnimate = $(v).attr('data-is-animate'); 59000 $(v).addClass("qb-car-" + i); 59001 59002 if(isAnimate){ 59003 59004 (new quoteCarousel("qb-car-" + i)).scrollTrack(); 59005 } 59006 59007 }); 59008 59009 59010 $('.quote-carousel-container').each(function(){ 59011 59012 var $quoteSlickElement = $(this); 59013 var $quoteSlickCounter = $(this).closest('.quote-carousel-section').find('.quote-counter-info'); 59014 59015 $quoteSlickElement.on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { 59016 //currentSlide is undefined on init -- set it to 0 in this case (currentSlide is 0 based) 59017 var i = (currentSlide ? currentSlide : 0) + 1; 59018 $quoteSlickCounter.html( '<span class="current_slide">' + i + '</span> / <span class="total_slides"> ' + slick.slideCount + '</span>'); 59019 }); 59020 59021 if($quoteSlickElement.find('.carousel-quote-desc').length>1){ 59022 59023 $quoteSlickElement.slick({ 59024 arrows: true, 59025 slidesToShow: 1, 59026 infinite: false, 59027 slidesToScroll: 1, 59028 prevArrow:"<button type='button' class='slick-prev pull-left'><img src='/content/dam/dupont/amer/us/en/greatstuff-redesign/arrow-right.svg' style='transform:rotate(180deg); -webkit-transform:rotate(180deg);'></button>", 59029 nextArrow:"<button type='button' class='slick-next pull-right'><img src='/content/dam/dupont/amer/us/en/greatstuff-redesign/arrow-right.svg' style='position:absolute;'></button>" 59030 59031 }); 59032 } 59033 59034 59035 }); 59036 59037 59038 59039 59040}); 59041 59042 59043$(function() { 59044 /*Query based text component*/ 59045 var qbTextComponent = function(compId) { 59046 59047 this.qbTextComp = $($('.'+compId)[0]); 59048 59049 if (this.qbTextComp.length > 0) { 59050 this.qbContainer = this.qbTextComp.find('#qb-container'); 59051 this.mappingsList = JSON.parse(this.qbContainer.attr('data-attr-mappings')); 59052 this.deftitle = this.qbContainer.attr('data-attr-deftitle'); 59053 this.defDesc = this.qbContainer.attr('data-attr-defDesc'); 59054 this.localStorage = this.qbContainer.attr('data-attr-lclStorage'); 59055 59056 } 59057 59058 59059 }; 59060 59061 59062 /*To remove data from html attributes*/ 59063 59064 qbTextComponent.prototype.removeData = function() { 59065 this.qbContainer.removeAttr('data-attr-mappings'); 59066 this.qbContainer.removeAttr('data-attr-deftitle'); 59067 this.qbContainer.removeAttr('data-attr-defDesc'); 59068 this.qbContainer.removeAttr('data-attr-lclStorage'); 59069 }; 59070 59071 /*To intiate component execution*/ 59072 qbTextComponent.prototype.init = function() { 59073 try{ 59074 if (this.qbTextComp.length > 0) { 59075 var srcParam = this.getParam('src'); 59076 var formIdParam = this.getParam('dfp'); 59077 var self = this; 59078 this.removeData(); 59079 if(this.localStorage == "true"){ 59080 var x = 0; 59081 var lsInterval = setInterval(function(){ 59082 x++ ; 59083 var mappingObj = localStorage.getItem("sf-dfp"); 59084 if(mappingObj){ 59085 mappingObj = JSON.parse(mappingObj); 59086 59087 var title = (mappingObj['noTitle'] == "true") ? "": (mappingObj['title'] ? mappingObj['title'] : self.deftitle ); 59088 var description = (mappingObj['noDescription'] == "true") ?"": (mappingObj['description'] ? mappingObj['description'] : self.defDesc); 59089 59090 clearInterval(lsInterval); 59091 self.setTitleAndDescription(title, description); 59092 }else if(x == 30){ 59093 clearInterval(lsInterval); 59094 } 59095 59096 },500) 59097 59098 } 59099 else if(srcParam || formIdParam){ 59100 //var delimeter = srcParam.indexOf("_")>0 ? "_" : "."; 59101 //var campaignId = this.getCampaignID(srcParam,delimeter); 59102 // if(campaignId && ($('input[name="trackingCode"]').length > 0)){ 59103 const param = formIdParam ? formIdParam : srcParam; 59104 59105 if(srcParam){ 59106 if(($('input[name="trackingCode"]').length > 0)){ 59107 $('input[name="trackingCode"]').attr('value',srcParam); 59108 }else if($('form').length >0){ 59109 $($('form')[0]).append('<input type="hidden" name="trackingCode" value="'+srcParam+'"/>'); 59110 } 59111 } 59112 59113 for (var i in this.mappingsList){ 59114 if(this.mappingsList[i].queryParam.indexOf(',')>-1){ 59115 var params = this.mappingsList[i].queryParam.split(',');
59116 params.forEach(function(v,j){ 59117 if(v == param){ 59118 self.setTitleAndDescription(self.mappingsList[i].title, self.mappingsList[i].description); 59119 } 59120 }) 59121 }else{ 59122 59123 if(this.mappingsList[i].queryParam == param){ 59124 this.setTitleAndDescription(this.mappingsList[i].title, this.mappingsList[i].description); 59125 59126 } 59127 } 59128 } 59129 }else{ 59130 this.setTitleAndDescription(this.deftitle, this.defDesc); 59131 59132 } 59133 59134 } 59135 }catch(error){ 59136 console.log("error in QueryBasedText Component>>>",error) 59137 } 59138 59139 }; 59140 59141 qbTextComponent.prototype.setTitleAndDescription = function(title, desc) { 59142 this.qbContainer.find('#qb-title').html(title); 59143 this.qbContainer.find('#qb-description').html(desc); 59144 }; 59145 59146 qbTextComponent.prototype.getCampaignID = function(param, delimeter) { 59147 var delimeterIndexes = []; 59148 var campaignId = ""; 59149 59150 param.split("").forEach(function(item, index) { 59151 if (item === delimeter) { 59152 delimeterIndexes.push(index); 59153 59154 } 59155 59156 }) 59157 59158 if (delimeterIndexes[3]) { 59159 campaignId = param.substring(delimeterIndexes[2] + 1, delimeterIndexes[3]); 59160 } else if (delimeterIndexes[2]) { 59161 campaignId = param.substr(delimeterIndexes[2] + 1); 59162 } 59163 59164 59165 return campaignId; 59166 59167 }; 59168 59169 59170 59171 59172 qbTextComponent.prototype.getParam = function(param, url_String) { 59173 if(url_String){ 59174 var url_string = url_String; 59175 }else{ 59176 var url_string = window.location.href; //window.location.href 59177 } 59178 59179 var url = new URL(url_string); 59180 59181 return url.searchParams.get(param); 59182 }; 59183 59184 59185 59186 59187 $.each($('.cmp-queryBasedText'),function(i,v) { 59188 $(v).addClass("qbt-"+i); 59189 (new qbTextComponent("qbt-"+i)).init(); 59190 59191 }); 59192 59193 59194}); 59195 59196(function(){ 59197 if(document.getElementsByClassName('productcomparator').length) { 59198 59199 function swipedetect(el, callback){ 59200 59201 var touchsurface = el, 59202 swipedir, 59203 startX, 59204 startY, 59205 distX, 59206 distY, 59207 threshold = 100, //required min distance traveled to be considered swipe 59208 restraint = 100, // maximum distance allowed at the same time in perpendicular direction 59209 allowedTime = 300, // maximum time allowed to travel that distance 59210 elapsedTime, 59211 startTime, 59212 handleswipe = callback || function(swipedir){} 59213 59214 touchsurface.addEventListener('touchstart', function(e){ 59215 var touchobj = e.changedTouches[0] 59216 swipedir = 'none' 59217 dist = 0 59218 startX = touchobj.pageX 59219 startY = touchobj.pageY 59220 startTime = new Date().getTime() // record time when finger first makes contact with surface 59221 //e.preventDefault() 59222 }, false) 59223 59224 touchsurface.addEventListener('touchmove', function(e){ 59225 //e.preventDefault() // prevent scrolling when inside DIV 59226 }, false) 59227 59228 touchsurface.addEventListener('touchend', function(e){ 59229 var touchobj = e.changedTouches[0] 59230 distX = touchobj.pageX - startX // get horizontal dist traveled by finger while in contact with surface 59231 distY = touchobj.pageY - startY // get vertical dist traveled by finger while in contact with surface 59232 elapsedTime = new Date().getTime() - startTime // get time elapsed 59233 if (elapsedTime <= allowedTime){ // first condition for awipe met 59234 if (Math.abs(distX) >= threshold && Math.abs(distY) <= restraint){ // 2nd condition for horizontal swipe met 59235 swipedir = (distX < 0)? 'left' : 'right' // if dist traveled is negative, it indicates left swipe 59236 } 59237 else if (Math.abs(distY) >= threshold && Math.abs(distX) <= restraint){ // 2nd condition for vertical swipe met 59238 swipedir = (distY < 0)? 'up' : 'down' // if dist traveled is negative, it indicates up swipe 59239 } 59240 } 59241 handleswipe(swipedir) 59242 //e.preventDefault() 59243 }, false) 59244 } 59245 59246 //USAGE: 59247 59248 var el = document.querySelector('.productcomparator .wrapper'); 59249 swipedetect(el, function(swipedir){ 59250 var scrollPixels = $('.scroll-table th').last().innerWidth(); 59251 event.preventDefault(); 59252 if(swipedir == 'right') $(el).animate( 59253 { 59254 scrollLeft: "-="+scrollPixels +"px" 59255 }, 59256 200, function() { 59257 updateColumns() 59258 } 59259 ); 59260 else if (swipedir=='left') $(el).animate( 59261 { 59262 scrollLeft: "+=" + scrollPixels + "px" 59263 }, 59264 200, function() { 59265 updateColumns() 59266 } 59267 ); 59268 }); 59269 59270 59271 function updateColWidth() { 59272 if($(window).width() < 768) { 59273 $(".scroll-table .first-col").width(""); 59274 } 59275 else { 59276 if($(".scroll-table thead th").length < 4) { 59277 $('.scroll-table .first-col').innerWidth(150) 59278 } 59279 else { 59280 59281 var ww = $('.molykote-prod-comparator .wrapper').innerWidth(); 59282 $('.scroll-table thead th').innerWidth(ww/5) 59283 } 59284 } 59285 } 59286 updateColWidth(); 59287 59288 $(window).resize(updateColWidth); 59289 $(window).resize(updateColumns); 59290 59291 updateColumns(); 59292 59293 $(".table-right-button").each(function() { 59294 var wrapper = $(this).closest(".scroll-table").find(".wrapper"); 59295 $(this).click(function() { 59296 var scrollPixels = $('.scroll-table th').last().innerWidth(); 59297 event.preventDefault(); 59298 wrapper.animate( 59299 { 59300 scrollLeft: "+=" + scrollPixels + "px" 59301 }, 59302 200, function() { 59303 updateColumns() 59304 } 59305 ); 59306 }); 59307 }); 59308 59309 $(".table-left-button").each(function() { 59310 var wrapper = $(this).closest(".scroll-table").find(".wrapper");
59311 //console.log(getScrollCoordinates(wrapper)) 59312 $(this).click(function() { 59313 var scrollPixels = $('.scroll-table th').last().innerWidth(); 59314 event.preventDefault(); 59315 wrapper.animate( 59316 { 59317 scrollLeft: "-="+scrollPixels +"px" 59318 }, 59319 200, function() { 59320 updateColumns() 59321 } 59322 ); 59323 }); 59324 }); 59325 59326 59327 function updateColumns() { 59328 $(".table-left-button, .table-right-button").removeAttr('disabled') 59329 var s,v, ww, total, from, to, fc, w; 59330 s = $(".scroll-table .wrapper").scrollLeft() 59331 w = $(".scroll-table table th").length; 59332 ww = $(".scroll-table .wrapper").innerWidth() 59333 var colWidth; 59334 colWidth = $('.scroll-table th').last().innerWidth(), fc = $('.scroll-table th').first().innerWidth(); 59335 59336 total = w - 1; 59337 ww = ww - fc; 59338 from = Math.max(Math.round(s / colWidth + 1), 1); 59339 to = Math.min(Math.round(from + ww / colWidth - 1), total); 59340 $('#column-from').text(from); 59341 $('#column-to').text(to); 59342 $('#column-total').text(total); 59343 if(to == total) $(".table-right-button").attr('disabled', true) 59344 if(from == 1) $(".table-left-button").attr('disabled', true) 59345 } 59346 } 59347})(); 59348 59349function PrdHotspotsClickHandler(e){ 59350 this.elem = $(e); 59351 let self= this; 59352 59353 if(this.elem.find('.hotspots').children().length ===0){ 59354 this.elem.find('.legends_info').hide(); 59355 } 59356 59357 this.elem.find('.hotspot').each(function(i,e){ 59358 $(this).on('click',function(event){ 59359 $(this).parents('.productImageBlock').find('.hotspot').removeClass('active'); 59360 $(this).addClass('active'); 59361 59362 self.elem.find('.legends_info').hide(); 59363 59364 let zoomId = $(this).attr('data-imageZoomId') ? $(this).attr('data-imageZoomId') : ''; 59365 59366 self.elem.find('.legend').each(function(i,ie){ 59367 $(this).on('click',function(){ 59368 $(this).parent().find('.legends_info').show(); 59369 $(this).parents('.productImageBlock').find('.hotspot').removeClass('active'); 59370 $(this).removeClass('active'); 59371 }); 59372 59373 if($(this).attr('id')==zoomId){ 59374 $(this).addClass('active'); 59375 }else{ 59376 $(this).removeClass('active'); 59377 } 59378 }); 59379 }); 59380 }); 59381 59382 $(window).on('click', function (e) { 59383 if (!$(e.target).hasClass('hotspot')) { 59384 self.elem.find('.hotspot').removeClass('active'); 59385 self.elem.find('.legends .legend').removeClass('active'); 59386 if(self.elem.find('.hotspots').children().length ===0){ 59387 self.elem.find('.legends .legends_info').hide(); 59388 }else{ 59389 self.elem.find('.legends .legends_info').show(); 59390 } 59391 } 59392 }); 59393} 59394 59395$('.productImagewithHotspots').each(function(i,e){ 59396 new PrdHotspotsClickHandler(e); 59397}); 59398 59399function printPage() { 59400 window.print(); 59401} 59402 59403function openMenu() { 59404 if ($('#socialMenu').hasClass('hide')) { 59405 $('#socialMenu').removeClass('hide'); 59406 } else { 59407 $('#socialMenu').addClass('hide'); 59408 } 59409} 59410 59411window.onclick = function(event) { 59412 console.log(event); 59413 if (!$(event.target).is('#socialImage') && 59414 !$(event.target).is('#social') 59415 && !$('#socialMenu').hasClass('hide')) { 59416 $('#socialMenu').addClass('hide'); 59417 } 59418}; 59419 59420function shareContent(site) { 59421 59422 var siteUrl = encodeURIComponent(window.location.href); 59423 59424 var winTop = (screen.height / 2) - (400 / 2), 59425 winLeft = (screen.width / 2) - (600 / 2); 59426 var strParam = 'width=' + 600 + ',height=' + 400 + ',resizable=' + 'no,'+'top=' + winTop + ',left=' + winLeft ; 59427 59428 var objWindow; 59429 switch(site.toLowerCase()){ 59430 case "twitter": 59431 objWindow = window.open("http://twitter.com/intent/tweet?&text=" + decodeURIComponent($('#desc').val()) +"&url=" + siteUrl+ "&hashtags=", "", strParam).focus(); 59432 break; 59433 case "linkedin": 59434 objWindow = window.open("http://www.linkedin.com/shareArticle?mini=true&url=" + siteUrl, '', strParam).focus(); 59435 break; 59436 } 59437}; 59438 59439$(window).on('load',function(){ 59440 $('.dupont-image_zoomin').click(function(){ 59441 var imgPath = $(this).attr('href'); 59442 $('#newsModal .modal-body img').attr('src',imgPath); 59443 var innertext = $(this).parents('figcaption').html(); 59444 $('#newsModal .modal-body figcaption p').html(innertext); 59445 $('#newsModal .modal-body figcaption p .download-align').remove(); 59446 59447 }); 59448}); 59449 59450function accordion_exec(){ 59451 59452 $('.acc-head').click(function(event){ 59453 59454 let title_href_val =$(event.currentTarget).attr('href'); 59455 59456 if(title_href_val ==='' || title_href_val==='#' || title_href_val==undefined){ 59457 event.preventDefault(); 59458 $(this).parent().siblings().find('> .acc-panel').slideUp(); 59459 $(this).parent().siblings().find('> .acc-head').removeClass('active'); 59460 59461 $(this).toggleClass('active'); 59462 //$(this).parent().find('.arrow').toggleClass('arrow-animate'); 59463 $(this).parent().find('> .acc-panel').slideToggle(); 59464 /*Added below code to trigger assets list component execution*/ 59465 if($(this).hasClass('active')){ 59466 $(document).trigger('nested-accordion-opened'); 59467 } 59468 /****/ 59469 } 59470 if($(event.currentTarget).find('> .acc-title-desc').hasClass('link')){ 59471 $(this).siblings('.acc-panel').hide(); 59472 } 59473 }); 59474} 59475accordion_exec(); 59476 59477 59478(function(){if(document.getElementsByClassName('web-lookup-form').length){ 59479 59480 var params = new URLSearchParams(window.location.search); 59481 var email; 59482 var emailInput = document.getElementById('email'); 59483 var getData = document.getElementById('getCampaignData'); 59484 var emailGroupContainer = document.getElementById('email-groups'); 59485 var campaignContainer = document.getElementById('campaign-list'); 59486 var unsubAllLink = document.querySelector('#unsubAll a'); 59487 if (params.has('email') && (/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(params.get('email')))) { 59488 email = params.get('email'); 59489 emailInput.value = email; 59490 getSubscriptionData(); 59491 } 59492 else { 59493 document.getElementById('emailError').style.display = 'inline'; 59494 document.getElementById('Unsubscribe').setAttribute('disabled', true) 59495 } 59496 getData.addEventListener('click', function(e){ 59497 if(!(/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(emailInput.value))) { 59498 document.getElementById('emailError').style.display = 'inline';
59499 document.getElementById('noData').style.display = 'none'; 59500 campaignContainer.innerHTML = ''; 59501 emailGroupContainer.innerHTML = ''; 59502 Array.from(document.querySelectorAll('.show-campaign a')).forEach(function(v) { 59503 v.closest('.show-campaign').classList.add('d-none'); 59504 }) 59505 Array.from(document.getElementsByClassName('business-unit-main-header')).forEach(e => e.style.display='none') 59506 document.getElementById('unckeckInfo').style.display = 'none'; 59507 document.getElementById('unsubAll').style.display = 'none'; 59508 document.getElementById('unsubscribe-container').style.display = 'none'; 59509 document.getElementById('Unsubscribe').setAttribute('disabled', true) 59510 } 59511 else { 59512 document.getElementById('emailError').style.display = 'none'; 59513 document.getElementById('Unsubscribe').removeAttribute('disabled'); 59514 getSubscriptionData(); 59515 } 59516 }) 59517 59518 Array.from(document.querySelectorAll('.show-campaign a')).forEach(function(v) { 59519 v.closest('.show-campaign').classList.add('d-none'); 59520 v.addEventListener('click', function(e) { 59521 e.preventDefault(); 59522 e.target.closest('div').classList.toggle('show-unsub') 59523 }) 59524 }) 59525 59526 function updateUnsubButton() { 59527 var flag = [...document.querySelectorAll('.cstm-check input')].find(function(el) { 59528 return (!el.closest('.cstm-check').classList.contains('hidden-check') && !el.checked); 59529 }) 59530 if(flag) document.getElementById('unsubscribe-container').style.display = 'block'; 59531 else document.getElementById('unsubscribe-container').style.display = 'none'; 59532 } 59533 function createCheckBox(text, value, checked, name, hide, id, cId, thirdState) { 59534 var container = document.createElement('div'); 59535 container.classList.add('cstm-check') 59536 var label = document.createElement('label'); 59537 label.innerText = text; 59538 label.htmlFor = id; 59539 if(thirdState) label.classList.add('third-state') 59540 var checkBox = document.createElement('input'); 59541 checkBox.name = name; 59542 checkBox.value = value; 59543 checkBox.type = 'checkbox'; 59544 checkBox.checked = checked; 59545 checkBox.id = id; 59546 checkBox.dataset.cId = cId; 59547 checkBox.onchange = updateUnsubButton; 59548 if(hide) checkBox.setAttribute("disabled", true); 59549 container.appendChild(checkBox); 59550 container.appendChild(label); 59551 if(hide) container.classList.add("hidden-check"); 59552 return container; 59553 } 59554 var data; 59555 59556 function getSubscriptionData() { 59557 59558 var xhr = new XMLHttpRequest(); 59559 xhr.onreadystatechange = function() { 59560 if (this.readyState == 4 && this.status == 200) { 59561 campaignContainer.innerHTML = ''; 59562 emailGroupContainer.innerHTML = ''; 59563 document.getElementById('unsubscribe-container').style.display = 'none'; 59564 document.getElementById('noData').style.display = 'block'; 59565 var hasHidden = [false, false] 59566 data = xhr.response; 59567 [...document.getElementsByClassName('business-unit-main-header')].forEach(e => e.style.display='none') 59568 document.getElementById('unckeckInfo').style.display = 'none'; 59569 document.getElementById('unsubAll').style.display = 'none'; 59570 if(data['EmailGroup'].length) { 59571 document.getElementsByClassName('business-unit-main-header')[0].style.display='block'; 59572 document.getElementById('unckeckInfo').style.display = 'block'; 59573 document.getElementById('unsubAll').style.display = 'block'; 59574 document.getElementById('unckeckInfo').style.display = 'block'; 59575 document.getElementById('noData').style.display = 'none'; 59576 } 59577 if(data['Campaign Data'].length) { 59578 document.getElementsByClassName('business-unit-main-header')[1].style.display='block'; 59579 document.getElementById('unckeckInfo').style.display = 'block'; 59580 document.getElementById('unsubAll').style.display = 'block'; 59581 document.getElementById('unckeckInfo').style.display = 'block';
59582 document.getElementById('noData').style.display = 'none'; 59583 } 59584 data['Campaign Data'].forEach((element, index) => { 59585 if(!element.Value.endsWith('Opt-In')) hasHidden[1] = true; 59586 var thirdState = !(element.Value.endsWith('Opt-In') || element.Value.endsWith('Opt-Out')) 59587 campaignContainer.appendChild(createCheckBox(element.Name, element.Value, element.Value.endsWith('Opt-In'), element.Name, !element.Value.endsWith('Opt-In'), 'campaign-'+index, element.campaignId, thirdState)); 59588 }); 59589 data['EmailGroup'].forEach((element, index) => { 59590 if(!element.Enabled) hasHidden[0] = true; 59591 emailGroupContainer.appendChild(createCheckBox(element.Label.substring(element.Label.indexOf('-')+1), element.Label, element.Enabled, element.Label, !element.Enabled, 'email-group-'+index, element.ContactId, false)); 59592 }); 59593 if(hasHidden[0]) { document.querySelectorAll('.show-campaign')[0].classList.remove('d-none');document.querySelectorAll('.show-campaign')[1].classList.remove('d-none');} 59594 if(hasHidden[1]) { document.querySelectorAll('.show-campaign')[2].classList.remove('d-none');document.querySelectorAll('.show-campaign')[3].classList.remove('d-none');} 59595 unsubAllLink.setAttribute('href', decodeURIComponent(unsubAllLink.getAttribute('href')).substring(0, decodeURIComponent(unsubAllLink.getAttribute('href')).lastIndexOf('e=')+2)+emailInput.value); 59596 } 59597 } 59598 xhr.responseType = 'json'; 59599 xhr.open('GET', '/dupont/campaignData?email='+emailInput.value); 59600 xhr.send(); 59601 } 59602 59603 /*document.querySelector('#unsubAll a').addEventListener('click', function(e) { 59604 e.preventDefault(); 59605 var href = e.target.getAttribute('href'); 59606 var redirectUrl = e.target.dataset.redir; 59607 var xhr = new XMLHttpRequest(); 59608 xhr.onreadystatechange = function() { 59609 if (this.readyState == 4 && this.status == 200) { 59610 location.href=redirectUrl; 59611 } 59612 } 59613 xhr.responseType = 'json'; 59614 xhr.open('GET', href); 59615 xhr.send(); 59616 })*/ 59617 59618 document.getElementById('Unsubscribe').addEventListener('click', submitPreferences) 59619 function submitPreferences() { 59620 var sendData = {'Campaign Data': [], "EmailGroup": []}; 59621 data['Campaign Data'].forEach(function(v,i) { 59622 var el = document.getElementById('campaign-'+i); 59623 if(!el.checked && !el.hasAttribute('disabled')) sendData['Campaign Data'].push({ 59624 campaignId: v.campaignId, 59625 Name: v.Name, 59626 Value: 'Opt-Out' 59627 }) 59628 }) 59629 data['EmailGroup'].forEach(function(v,i) { 59630 var el = document.getElementById('email-group-'+i); 59631 if(!el.checked && !el.hasAttribute('disabled')) sendData['EmailGroup'].push({ 59632 Name: v.Label, 59633 Enabled: "false", 59634 ContactId: v.ContactId 59635 }) 59636 }) 59637 var xhr = new XMLHttpRequest(); 59638 xhr.onreadystatechange = function() { 59639 if (this.readyState == 4 && this.status == 200) { 59640 var unscubscribeResp = xhr.response; 59641 getData.setAttribute('disabled', true); 59642 document.getElementById('Unsubscribe').setAttribute('disabled', true) 59643 document.getElementById('successMsg').style.display = 'block'; 59644 //location.reload(); 59645 } 59646 } 59647 xhr.responseType = 'json'; 59648 xhr.open('POST', '/dupont/campaignDataSubmit?email='+emailInput.value); 59649 xhr.setRequestHeader('Content-Type', 'application/json'); 59650 xhr.send(JSON.stringify(sendData)); 59651 59652 } 59653} 59654})(); 59655 59656(function () { 59657 'use strict'; 59658 59659 var RS = function (conf) { 59660 this.input = null; 59661 this.inputDisplay = null; 59662 this.slider = null; 59663 this.sliderWidth = 0; 59664 this.sliderLeft = 0; 59665 this.pointerWidth = 0; 59666 this.pointerR = null; 59667 this.pointerL = null; 59668 this.activePointer = null; 59669 this.selected = null; 59670 this.scale = null; 59671 this.step = 0; 59672 this.tipL = null; 59673 this.tipR = null; 59674 this.timeout = null; 59675 this.valRange = false;
59676 59677 this.values = { 59678 start: null, 59679 end: null 59680 }; 59681 this.conf = { 59682 target: null, 59683 values: null, 59684 set: null, 59685 range: false, 59686 width: null, 59687 scale: true, 59688 labels: true, 59689 tooltip: true, 59690 step: null, 59691 disabled: false, 59692 onChange: null 59693 }; 59694 59695 this.cls = { 59696 container: 'rs-container', 59697 background: 'rs-bg', 59698 selected: 'rs-selected', 59699 pointer: 'rs-pointer', 59700 scale: 'rs-scale', 59701 noscale: 'rs-noscale', 59702 tip: 'rs-tooltip' 59703 }; 59704 59705 for (var i in this.conf) { if (conf.hasOwnProperty(i)) this.conf[i] = conf[i]; } 59706 59707 this.init(); 59708 }; 59709 59710 RS.prototype.init = function () { 59711 if (typeof this.conf.target === 'object') this.input = this.conf.target; 59712 else this.input = document.getElementById(this.conf.target.replace('#', '')); 59713 59714 if (!this.input) return console.log('Cannot find target element...'); 59715 59716 this.inputDisplay = getComputedStyle(this.input, null).display; 59717 this.input.style.display = 'none'; 59718 this.valRange = !(this.conf.values instanceof Array); 59719 59720 if (this.valRange) { 59721 if (!this.conf.values.hasOwnProperty('min') || !this.conf.values.hasOwnProperty('max')) 59722 return console.log('Missing min or max value...'); 59723 } 59724 return this.createSlider(); 59725 }; 59726 59727 RS.prototype.createSlider = function () { 59728 this.slider = createElement('div', this.cls.container); 59729 this.slider.innerHTML = '<div class="rs-bg"></div>'; 59730 this.selected = createElement('div', this.cls.selected); 59731 this.pointerL = createElement('div', this.cls.pointer, ['dir', 'left']); 59732 this.scale = createElement('div', this.cls.scale); 59733 59734 if (this.conf.tooltip) { 59735 this.tipL = createElement('div', this.cls.tip); 59736 this.tipR = createElement('div', this.cls.tip); 59737 this.pointerL.appendChild(this.tipL); 59738 } 59739 this.slider.appendChild(this.selected); 59740 this.slider.appendChild(this.scale); 59741 this.slider.appendChild(this.pointerL); 59742 59743 if (this.conf.range) { 59744 this.pointerR = createElement('div', this.cls.pointer, ['dir', 'right']); 59745 if (this.conf.tooltip) this.pointerR.appendChild(this.tipR); 59746 this.slider.appendChild(this.pointerR); 59747 } 59748 59749 this.input.parentNode.insertBefore(this.slider, this.input.nextSibling); 59750 59751 if (this.conf.width) this.slider.style.width = parseInt(this.conf.width) + 'px'; 59752 //this.sliderLeft = this.slider.getBoundingClientRect().left; 59753 this.sliderLeft = $(this.slider).offset().left; 59754 if(this.sliderLeft==0){ 59755 if($(window).width()>768){ 59756 this.sliderLeft = 159; 59757 }else{ 59758 this.sliderLeft = 35; 59759 } 59760 } 59761 //this.sliderWidth = this.slider.clientWidth; 59762 this.sliderWidth = $(this.slider).width(); 59763 //this.pointerWidth = this.pointerL.clientWidth; 59764 this.pointerWidth = $(this.pointerL).width(); 59765 59766 if (!this.conf.scale) this.slider.classList.add(this.cls.noscale); 59767 59768 return this.setInitialValues(); 59769 }; 59770 59771 RS.prototype.setInitialValues = function () { 59772 this.disabled(this.conf.disabled); 59773 59774 if (this.valRange) this.conf.values = prepareArrayValues(this.conf); 59775 59776 this.values.start = 0; 59777 this.values.end = this.conf.range ? this.conf.values.length - 1 : 0; 59778 59779 59780 if (this.conf.set && this.conf.set.length && checkInitial(this.conf)) { 59781 var vals = this.conf.set; 59782 59783 if (this.conf.range) { 59784 this.values.start = this.conf.values.indexOf(vals[0]); 59785 this.values.end = this.conf.set[1] ? this.conf.values.indexOf(vals[1]) : null; 59786 } 59787 else this.values.end = this.conf.values.indexOf(vals[0]); 59788 } 59789 return this.createScale(); 59790 }; 59791 59792 RS.prototype.createScale = function (resize) { 59793 this.step = this.sliderWidth / (this.conf.values.length - 1); 59794 59795 for (var i = 0, iLen = this.conf.values.length; i < iLen; i++) { 59796 var span = createElement('span'), 59797 ins = createElement('ins'); 59798 59799 span.appendChild(ins); 59800 this.scale.appendChild(span); 59801 59802 span.style.width = i === iLen - 1 ? 0 : this.step + 'px'; 59803 59804 if (!this.conf.labels) { 59805 if (i === 0 || i === iLen - 1) ins.innerHTML = this.conf.values[i] 59806 } 59807 else ins.innerHTML = this.conf.values[i]; 59808 59809 //ins.style.marginLeft = (ins.clientWidth / 2) * - 1 + 'px'; 59810 ins.style.marginLeft = ($(ins).width() / 2) * - 1 + 'px'; 59811 } 59812 return this.addEvents(); 59813 }; 59814 59815 RS.prototype.updateScale = function () { 59816 this.step = this.sliderWidth / (this.conf.values.length - 1); 59817 59818 var pieces = this.slider.querySelectorAll('span'); 59819 59820 for (var i = 0, iLen = pieces.length; i < iLen; i++) 59821 pieces[i].style.width = this.step + 'px'; 59822 59823 return this.setValues(); 59824 }; 59825 59826 RS.prototype.addEvents = function () { 59827 var pointers = this.slider.querySelectorAll('.' + this.cls.pointer), 59828 pieces = this.slider.querySelectorAll('span'); 59829 59830 createEvents(document, 'mousemove touchmove', this.move.bind(this)); 59831 createEvents(document, 'mouseup touchend touchcancel', this.drop.bind(this)); 59832 59833 for (var i = 0, iLen = pointers.length; i < iLen; i++) 59834 createEvents(pointers[i], 'mousedown touchstart', this.drag.bind(this)); 59835 59836 for (var i = 0, iLen = pieces.length; i < iLen; i++) 59837 createEvents(pieces[i], 'click', this.onClickPiece.bind(this)); 59838 59839 window.addEventListener('resize', this.onResize.bind(this)); 59840 59841 return this.setValues(); 59842 }; 59843 59844 RS.prototype.drag = function (e) { 59845 e.preventDefault(); 59846 59847 if (this.conf.disabled) return; 59848 59849 var dir = e.target.getAttribute('data-dir'); 59850 if (dir === 'left') this.activePointer = this.pointerL; 59851 if (dir === 'right') this.activePointer = this.pointerR; 59852 59853 return this.slider.classList.add('sliding'); 59854 }; 59855 59856 RS.prototype.move = function (e) { 59857 if (this.activePointer && !this.conf.disabled) { 59858 var coordX = e.type === 'touchmove' ? e.touches[0].clientX : e.pageX, 59859 index = coordX - this.sliderLeft - (this.pointerWidth / 2); 59860 59861 index = Math.round(index / this.step); 59862 59863 if (index <= 0) index = 0; 59864 if (index > this.conf.values.length - 1) index = this.conf.values.length - 1; 59865 59866 if (this.conf.range) { 59867 if (this.activePointer === this.pointerL) this.values.start = index; 59868 if (this.activePointer === this.pointerR) this.values.end = index; 59869 } 59870 else this.values.end = index; 59871 59872 return this.setValues(); 59873 } 59874 }; 59875 59876 RS.prototype.drop = function () { 59877 this.activePointer = null; 59878 }; 59879 59880 RS.prototype.setValues = function (start, end) { 59881 var activePointer = this.conf.range ? 'start' : 'end'; 59882 59883 if (start && this.conf.values.indexOf(start) > -1) 59884 this.values[activePointer] = this.conf.values.indexOf(start); 59885 59886 if (end && this.conf.values.indexOf(end) > -1) 59887 this.values.end = this.conf.values.indexOf(end); 59888 59889 if (this.conf.range && this.values.start > this.values.end) 59890 this.values.start = this.values.end; 59891 59892 this.pointerL.style.left = (this.values[activePointer] * this.step - (this.pointerWidth / 2)) + 'px'; 59893 59894 if (this.conf.range) { 59895 if (this.conf.tooltip) { 59896 this.tipL.innerHTML = this.conf.values[this.values.start]; 59897 this.tipR.innerHTML = this.conf.values[this.values.end]; 59898 } 59899 this.input.value = this.conf.values[this.values.start] + ',' + this.conf.values[this.values.end]; 59900 this.pointerR.style.left = (this.values.end * this.step - (this.pointerWidth / 2)) + 'px'; 59901 } 59902 else { 59903 if (this.conf.tooltip) 59904 this.tipL.innerHTML = this.conf.values[this.values.end]; 59905 this.input.value = this.conf.values[this.values.end]; 59906 } 59907 59908 if (this.values.end > this.conf.values.length - 1) this.values.end = this.conf.values.length - 1; 59909 if (this.values.start < 0) this.values.start = 0; 59910 59911 this.selected.style.width = (this.values.end - this.values.start) * this.step + 'px'; 59912 this.selected.style.left = this.values.start * this.step + 'px'; 59913 59914 return this.onChange(); 59915 }; 59916 59917 RS.prototype.onClickPiece = function (e) { 59918 59919 if (this.conf.disabled) return; 59920 59921 var idx = Math.round((e.clientX - this.sliderLeft) / this.step); 59922 59923 if (idx > this.conf.values.length - 1) idx = this.conf.values.length - 1; 59924 if (idx < 0) idx = 0; 59925 59926 if (this.conf.range) { 59927 if (idx - this.values.start <= this.values.end - idx) { 59928 this.values.start = idx; 59929 } 59930 else this.values.end = idx; 59931 } 59932 else this.values.end = idx; 59933 59934 this.slider.classList.remove('sliding'); 59935 59936 return this.setValues(); 59937 }; 59938 59939 RS.prototype.onChange = function () { 59940 var _this = this; 59941 59942 if (this.timeout) clearTimeout(this.timeout); 59943 59944 this.timeout = setTimeout(function () { 59945 if (_this.conf.onChange && typeof _this.conf.onChange === 'function') { 59946 return _this.conf.onChange(_this.input.value); 59947 } 59948 }, 500); 59949 }; 59950 59951 RS.prototype.onResize = function () { 59952 //this.sliderLeft = this.slider.getBoundingClientRect().left; 59953 this.sliderLeft = $(this.slider).offset().left; 59954 if(this.sliderLeft==0){ 59955 if($(window).width()>768){ 59956 this.sliderLeft = 159; 59957 }else{ 59958 this.sliderLeft = 35; 59959 } 59960 } 59961 //this.sliderWidth = this.slider.clientWidth; 59962 this.sliderWidth = $(this.slider).width(); 59963 return this.updateScale(); 59964 }; 59965 59966 RS.prototype.disabled = function (disabled) { 59967 this.conf.disabled = disabled; 59968 this.slider.classList[disabled ? 'add' : 'remove']('disabled'); 59969 }; 59970 59971 RS.prototype.getValue = function () { 59972 return this.input.value; 59973 }; 59974 59975 RS.prototype.destroy = function () { 59976 this.input.style.display = this.inputDisplay; 59977 this.slider.remove(); 59978 }; 59979 59980 var createElement = function (el, cls, dataAttr) { 59981 var element = document.createElement(el); 59982 if (cls) element.className = cls; 59983 if (dataAttr && dataAttr.length === 2) 59984 element.setAttribute('data-' + dataAttr[0], dataAttr[1]); 59985 59986 return element; 59987 }, 59988 59989 createEvents = function (el, ev, callback) { 59990 var events = ev.split(' '); 59991 59992 for (var i = 0, iLen = events.length; i < iLen; i++) 59993 el.addEventListener(events[i], callback); 59994 }, 59995 59996 prepareArrayValues = function (conf) { 59997 var values = [], 59998 range = conf.values.max - conf.values.min; 59999 60000 if (!conf.step) { 60001 console.log('No step defined...'); 60002 return [conf.values.min, conf.values.max]; 60003 } 60004 60005 for (var i = 0, iLen = (range / conf.step); i < iLen; i++) 60006 values.push(conf.values.min + i * conf.step); 60007 60008 if (values.indexOf(conf.values.max) < 0) values.push(conf.values.max); 60009 60010 return values; 60011 }, 60012 60013 checkInitial = function (conf) { 60014 if (!conf.set || conf.set.length < 1) return null; 60015 if (conf.values.indexOf(conf.set[0]) < 0) return null; 60016 60017 if (conf.range) { 60018 if (conf.set.length < 2 || conf.values.indexOf(conf.set[1]) < 0) return null; 60019 } 60020 return true; 60021 }; 60022 60023 window.rSlider = RS; 60024 60025})(); 60026function initMap() { 60027 //var latlng = new google.maps.LatLng(37.393246, -122.042206); 60028 var map = new google.maps.Map(document.getElementById("gmapResult"), { 60029 zoom: 18, 60030 //center: { lat: 37.393246, lng: -122.042206 },
60031 60032 }); 60033 var geocoder = new google.maps.Geocoder(); 60034 geocodeAddress(geocoder, map); 60035 } 60036 60037 function geocodeAddress(geocoder, resultsMap) { 60038 var address = document.getElementById('address').value; 60039 console.log("gmapAddress-->" + address); 60040 geocoder.geocode({'address': address}, function(results, status) { 60041 if (status === 'OK') { 60042 resultsMap.setCenter(results[0].geometry.location); 60043 var marker = new google.maps.Marker({ 60044 map: resultsMap, 60045 //position: new google.maps.LatLng(results[0].geometry.location), 60046 position: results[0].geometry.location, 60047 mapTypeControl: true, 60048 mapTypeControlOptions: { 60049 style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, 60050 //position: google.maps.ControlPosition.TOP_CENTER 60051 }, 60052 zoomControl: true, 60053 zoomControlOptions: { 60054 //position: google.maps.ControlPosition.LEFT_CENTER 60055 }, 60056 scaleControl: true, 60057 streetViewControl: true, 60058 streetViewControlOptions: { 60059 //position: google.maps.ControlPosition.LEFT_TOP 60060 }, 60061 fullscreenControl: true 60062 }); 60063 } else { 60064 alert('Geocode was not successful for the following reason: ' + status); 60065 } 60066 }); 60067 } 60068/*To handle all facet realted functionalities */ 60069var mapFacetHandler = function (rFCmpRef) { 60070 this.rFResultObj = rFCmpRef; 60071 this.cmpRF = rFCmpRef.mapComp; 60072 this.tempDelFilters = []; 60073 this.tempAddedFilters = []; 60074 this.facetsContainer = this.cmpRF.find('#facets-container'); 60075 this.facetOptionsCount = 20; 60076 this.capacityAnalysis = "no"; 60077 this.commYrAnalysis = "no"; 60078 this.commChanged = "no"; 60079 this.capLabel; 60080 this.cap_initialization=0; 60081}; 60082 60083/*To bind events with handlers*/ 60084 60085mapFacetHandler.prototype.bindEvents = function () { 60086 this.cmpRF.on('click', '.facet-category', $.proxy(this.facetCategoryClickHandler, this)); 60087 this.cmpRF.on('click', '.facet-option', $.proxy(this.facetOptionClickHandler, this)); 60088 this.cmpRF.on('click', '.view-all', $.proxy(this.viewAllFacetClickHandler, this)); 60089 this.cmpRF.on('click', '.clear-facets', $.proxy(this.clearAllFacetClickHandler, this)); 60090 this.cmpRF.on('click', '.deselect-facet', $.proxy(this.deSelectFacetClickHandler, this)); 60091 this.cmpRF.on('click', '.mv-facet-category', $.proxy(this.mobFacetCatClickHandler, this)); 60092 this.cmpRF.on('click', '.close-facets', $.proxy(this.cancelBtnClickHandler, this)); 60093 this.cmpRF.on('click', '.apply-filters', $.proxy(this.applyFiltersClickHandler, this)); 60094 this.cmpRF.on('click', '.mv-facets-link', $.proxy(this.filtersLinkClickHandler, this)); 60095 60096 this.cmpRF.on('click', '.share-icon, .share-txt, .hor-share-icon, .ol-share ', $.proxy(this.shareBtnClickHandler, this)); 60097 60098}; 60099 60100 60101mapFacetHandler.prototype.shareBtnClickHandler = function (evnt) { 60102 evnt.preventDefault(); 60103 var el = $(evnt.currentTarget); 60104 var selectedFilters=[]; 60105 var capacity_params; 60106 var facet_params; 60107 for(var i=0; i<this.rFResultObj.selectedFiltersArr.length; i++){ 60108 selectedFilters.push(this.rFResultObj.selectedFiltersArr[i].value); 60109 } 60110 if(this.rFResultObj.selectedFiltersArr.length>0){ 60111 facet_params = JSON.stringify(selectedFilters); 60112 } 60113 60114 if(this.rFResultObj.paramMinMaxVal.length>0){ 60115 capacity_params = JSON.stringify(this.rFResultObj.paramMinMaxVal); 60116 } 60117 var commissioning_params = JSON.stringify(this.rFResultObj.paramCommMinMaxVal); 60118 60119 const mapRefer_url = new URL(window.location.href); 60120 60121 if(facet_params!=undefined){ 60122 mapRefer_url.searchParams.set('facets', facet_params); 60123 } 60124 60125 if(capacity_params!=undefined && $("#capacity .facet-option input").is(':checked') ){ 60126 mapRefer_url.searchParams.set('capacity', capacity_params); 60127 } 60128 mapRefer_url.searchParams.set('commissioning', commissioning_params); 60129 60130 60131 //var fileName = encodeURIComponent(el.attr('data-file-name')); 60132 var shareTTEl = this.cmpRF.find('.share-tooltip'); 60133 //var selectedTabName = this.rfComp.find('.res-tabs.selected').attr('data-res-name'); 60134 //var filePrefix = selectedTabName.substr(1,selectedTabName.length-2); 60135 //this.copyToClipboard((window.location.href.split('?'))[0]+"?BU="+this.buParam+"&shared-asset="+filePrefix+"-"+fileName); 60136 //this.copyToClipboard(mapRefer_url.href); 60137 this.copyToClipboard(decodeURIComponent(mapRefer_url.href)); 60138 shareTTEl.text(Granite.I18n.get("Share link copied to clipboard")); 60139 shareTTEl.css({ left: evnt.pageX - 120 + 'px', top: evnt.pageY + 25 + 'px' }).fadeIn(400); 60140 setTimeout(function () { 60141 shareTTEl.fadeOut(200); 60142 }, 1200); 60143 evnt.stopPropagation(); 60144}; 60145 60146mapFacetHandler.prototype.copyToClipboard = function (str) { 60147 var el = this.cmpRF.find('#clipborad-el')[0]; 60148 $(el).val(str); 60149 el.select(); 60150 document.execCommand('copy'); 60151 el.blur(); 60152}; 60153 60154/*To intiate component execution*/ 60155mapFacetHandler.prototype.init = function () { 60156 var self = this; 60157 this.bindEvents(); 60158 $(this.cmpRF.find('.facet-category')[0]).click(); 60159 $('.mapReferences .facets-showhide').find('#mapR').css('height','500px'); 60160
60161 this.showFilteredResults(); 60162 const mapRefer_geturl = new URL(window.location.href); 60163 60164 if (mapRefer_geturl.href.indexOf('?') > -1) { 60165 var facet_getParams = JSON.parse(mapRefer_geturl.searchParams.get('facets')); 60166 var capacity_getParams = JSON.parse(mapRefer_geturl.searchParams.get('capacity')); 60167 var commissioning_getParams = JSON.parse(mapRefer_geturl.searchParams.get('commissioning')); 60168 if (facet_getParams !== null ) { 60169 $.each($("#facets-container .facets-wrapper .facet-content input"), function () { 60170 60171 for (var i = 0; i < facet_getParams.length; i++) { 60172 //if ($(this).val() == facet_getParams[i].value) { 60173 if ($(this).val() == facet_getParams[i]) { 60174 $(this).prop('checked', true); 60175 $(this).click(); 60176 60177 if ($(".facet-content #capacity")) { 60178 if (self.rFResultObj.range_list.hasOwnProperty(facet_getParams[i])) { 60179 self.rFResultObj.range_list[facet_getParams[i]].setValues(capacity_getParams[0], capacity_getParams[1]); 60180 } 60181 } 60182 } 60183 60184 } 60185 }); 60186 } 60187 if(commissioning_getParams !==null){ 60188 if ($(".facet-content #Commissioning")) { 60189 self.rFResultObj.comm_yr_range.setValues(commissioning_getParams[0], commissioning_getParams[1]); 60190 } 60191 } 60192 } 60193 if(this.rFResultObj.filterTags.length>0) 60194 { 60195 $.each($("#facets-container .facets-wrapper .facet-content input"), function () { 60196 for (var i = 0; i < self.rFResultObj.filterTags.length; i++) { 60197 if ($(this).val().toLowerCase() == self.rFResultObj.filterTags[i].toLowerCase()) { 60198 $(this).prop('checked', true); 60199 } 60200 } 60201 }); 60202 } 60203 $('.mapReferences .facets-showhide').find('.facets-container').remove(); 60204 $('.mapReferences .facets-showhide').find('.sel-facets-block').remove(); 60205 $('.mapReferences .facets-showhide').find('.selected-ref').removeClass('col-8'); 60206 $('.mapReferences .facets-showhide').find('.selected-ref').css('float','left'); 60207 $('.mapReferences .facets-showhide').find('.map-result').removeClass('col-8'); 60208 $(".mapReferences .facets-showhide").parents('.search-component').find('.mv-facets-link').removeClass('show'); 60209 60210 $('.mapReferences .close-filters').find('.facet-category').removeClass('open'); 60211 $('.mapReferences .close-filters').find('.facet-content').css('display','none'); 60212}; 60213mapFacetHandler.prototype.prepareMobileHeaderNav = function(){ 60214 var mViewHeader = '<div class="mv-facet-header"><nav></nav></div>'; 60215 this.facetsContainer.append(mViewHeader); 60216 60217} 60218mapFacetHandler.prototype.prepareMobileFooterNav = function(){ 60219 60220 var footer = '<div class="mv-facets-footer"><span class="close-facets">' + Granite.I18n.get("cancel") + '</span><span class="apply-filters">' + Granite.I18n.get("apply-filters") + '</span></div>'; 60221 this.facetsContainer.append(footer); 60222} 60223/*To create facets on page*/ 60224mapFacetHandler.prototype.prepareFacets = function (facetsObj) { 60225 var facetsList = ''; 60226 //var mViewHeader = '<div class="mv-facet-header"><nav>'; 60227 60228 for (var key in facetsObj) { 60229 var isBrand = false; 60230 var filtersArr = []; 60231 var options = ''; 60232 60233 $('.mv-facet-header nav').append('<a href="#' + this.replaceWhiteSpaces(key) + '" class="mv-facet-category">' + key + '</a>'); 60234 //this.mViewHeader += '<a href="#' + this.replaceWhiteSpaces(key) + '" class="mv-facet-category">' + key + '</a>'; 60235 facetsList += '<div class="facets-wrapper"><div class="facet-category">' + key + ' <span></span></div>'; 60236 facetsList += '<div class="facet-content" id="' + this.replaceWhiteSpaces(key) + '">'; 60237 60238 for (var x = 0; x < facetsObj[key].length; x++) { 60239 60240 var tagObj = $.grep(this.rFResultObj.tagIDTitleList, function (obj) { return obj.id == (facetsObj[key][x]); })[0]; 60241 60242 if (tagObj) { 60243 60244 if (tagObj.title) { 60245
60246 filtersArr.push([facetsObj[key][x].toLowerCase(), tagObj.title]); 60247 } 60248 } 60249 60250 }; 60251 60252 filtersArr.sort(function (a, b) { 60253 a = a[1].toLowerCase(); 60254 b = b[1].toLowerCase(); 60255 if (a == b) return 0; 60256 return a < b ? -1 : 1; 60257 }); 60258 60259 for (var j = 0; j < filtersArr.length; j++) { 60260 60261 var hideClass = ''; 60262 60263 if (j >= this.facetOptionsCount) { 60264 hideClass = 'hide-option'; 60265 } 60266 60267 options += '<div class="facet-option ' + hideClass + '"><input type="checkbox" name="facets" value="' + filtersArr[j][0] + '"/><div class="checkmark"></div><label>' + filtersArr[j][1] + '</label></div>'; 60268 60269 } 60270 60271 60272 facetsList += options + '</div>'; 60273 60274 if (facetsObj[key].length > this.facetOptionsCount) { 60275 facetsList += '<a class="view-all" href="#">' + Granite.I18n.get("view-all") + '</a>'; 60276 } 60277 60278 facetsList += '</div>'; 60279 60280 } 60281 60282 //this.mViewHeader += '</nav></div>'; 60283 //var footer = '<div class="mv-facets-footer"><span class="close-facets">' + Granite.I18n.get("cancel") + '</span><span class="apply-filters">' + Granite.I18n.get("apply-filters") + '</span></div>' 60284 //facetsList = mViewHeader + facetsList + this.footer; 60285 //facetsList = this.mViewHeader + facetsList; 60286 60287 this.facetsContainer.append(facetsList); 60288 60289 60290 60291}; 60292 mapFacetHandler.prototype.prepareCaps = function (capList) { 60293 this.cap_initialization=0; 60294 60295 $('#capacity .rs-container').remove(); 60296 this.capacityAnalysis="no"; 60297 for (var p = 0; p < capList.length; p++) { 60298 var slider_minmax_div = ''; 60299 var cap_id; 60300 var cap_target_id; 60301 if (p == 0) { 60302 cap_id = "mcube"; 60303 cap_target_id = '#' + cap_id + ''; 60304 } else { 60305 cap_id = capList[p].unitlabel.toLowerCase(); 60306 cap_target_id = '#' + cap_id + ''; 60307 } 60308 var self = this; 60309 var min_val = parseInt(capList[p].unitMinValue); 60310 var max_val = parseInt(capList[p].unitMaxValue); 60311 60312 var cap_slider_width; 60313 60314 if($(window).width()>=1024 && $(window).width()<=1200){ 60315 cap_slider_width = 220; 60316 }else if($(window).width()>768 && $(window).width()<1024){ 60317 cap_slider_width = 170; 60318 }else{ 60319 cap_slider_width = 260; 60320 } 60321 60322 60323 var map_refer_slider = new rSlider({ 60324 target: cap_target_id, 60325 values: { min: min_val, max: max_val }, 60326 step: 100, 60327 range: true, 60328 set: [min_val, max_val], 60329 scale: false, 60330 labels: true, 60331 width: cap_slider_width, 60332 onChange: function (vals) { 60333 self.cap_initialization++; 60334 console.log(vals); 60335 if(self.cap_initialization>3){ 60336 self.capacityAnalysis="yes"; 60337 } 60338 self.capLabel = self.rFResultObj.capacityFilterLabel; 60339 self.showFilteredResults(); 60340 } 60341 }); 60342 slider_minmax_div = '<p class="min-val">' + min_val + '</p><p class="max-val">' + max_val + '</p>'; 60343 $($('.slider-blk .rs-container .rs-bg')[p]).append(slider_minmax_div); 60344 60345 60346 this.rFResultObj.range_list[cap_id] = map_refer_slider; 60347 60348 } 60349 60350 $(".slider-blk .rs-pointer").hover(function () { 60351 $(this).find(".rs-tooltip").show(); 60352 }, function () { 60353 $(this).find(".rs-tooltip").hide(); 60354 }); 60355 60356 }; 60357 mapFacetHandler.prototype.prepareComm = function (commissioning_yr) { 60358 60359 $('#Commissioning .rs-container').remove(); 60360 60361 if (Object.keys(commissioning_yr).length > 0) { 60362 var self = this; 60363 var commYr_id = commissioning_yr.label + '_yr'; 60364 var commYr_target = '#' + commYr_id + ''; 60365 if(commissioning_yr.minYear==undefined){ 60366 commissioning_yr.minYear=0; 60367 } 60368 if(commissioning_yr.maxYear==undefined){ 60369 commissioning_yr.maxYear=0; 60370 } 60371 var commMinYear = parseInt(commissioning_yr.minYear); 60372 var commMaxYear = parseInt(commissioning_yr.maxYear); 60373 this.comMinYr = commMinYear; 60374 this.comMaxYr = commMaxYear; 60375 60376 var comm_slider_width; 60377 60378 if($(window).width()>=1024 && $(window).width()<=1200){ 60379 comm_slider_width = 220; 60380 }else if($(window).width()>768 && $(window).width()<1024){ 60381 comm_slider_width = 170; 60382 }else{ 60383 comm_slider_width = 260; 60384 } 60385
60386 this.rFResultObj.comm_yr_range = new rSlider({ 60387 target: commYr_target, 60388 values: { min: commMinYear, max: commMaxYear }, 60389 step: 1, 60390 range: true, 60391 set: [commMinYear, commMaxYear], 60392 scale: false, 60393 labels: true, 60394 width: comm_slider_width, 60395 onChange: function (vals) { 60396 console.log(vals); 60397 self.showFilteredResults(); 60398 self.showShare(); 60399 60400 } 60401 }); 60402 60403 var comm_slider_minmax_div = '<p class="min-val">' + commMinYear + '</p><p class="max-val">' + commMaxYear + '</p>'; 60404 $('#Commissioning .slider-blk .rs-container .rs-bg').append(comm_slider_minmax_div); 60405 60406 } 60407 60408 60409 $(".slider-blk .rs-pointer").hover(function () { 60410 $(this).find(".rs-tooltip").show(); 60411 }, function () { 60412 $(this).find(".rs-tooltip").hide(); 60413 }); 60414 60415 }; 60416 mapFacetHandler.prototype.showShare = function () { 60417 if(mapref.comm_yr_range.getValue().split(',').map(Number)[0]>this.comMinYr){ 60418 this.commChanged="yes"; 60419 $(".sel-facets-block").show(); 60420 } 60421 if(mapref.comm_yr_range.getValue().split(',').map(Number)[1]<this.comMaxYr){ 60422 this.commChanged="yes"; 60423 $(".sel-facets-block").show(); 60424 } 60425 60426 } 60427 60428/*To split tag and call method to convert first letter of facet in upper case*/ 60429mapFacetHandler.prototype.modifyFacetOption = function (tag) { 60430 var tagStr = tag.split('/')[1]; 60431 60432 if (tagStr != undefined) { 60433 60434 return this.convertToUpperCase(tagStr); 60435 } 60436 60437 60438}; 60439 60440/*To replce white spaces in a string with _*/ 60441mapFacetHandler.prototype.replaceWhiteSpaces = function (text) { 60442 return text.replace(/\s/g, "_"); 60443}; 60444 60445 60446 60447/*To prepare facets list from the tags available in search results */ 60448mapFacetHandler.prototype.prepareFacetsList = function (expFragData, facetsList) { 60449 60450 var facetsListObj = {}; 60451 var allowedFacets = ['business_unit', 'country', 'pcg', 'brands', 'industry', 'uses_and_applications', 'literature_type' ]; 60452 var facetMapping = { 60453 'business_unit': 'Business Unit', 60454 'country': 'Country', 60455 //'corporate_category': 'Corporate Category', 60456 'pcg': 'Product Types', 60457 'brands': 'Brands', 60458 'industry': 'Industries', 60459 // 'products': 'Products', 60460 'uses_and_applications': 'Applications', 60461 'literature_type': 'Type', 60462 60463 60464 } 60465 60466 60467 if (facetsList != undefined && facetsList.length > 0) { 60468 allowedFacets = []; 60469 facetMapping = {}; 60470 for (var k = 0; k < facetsList.length; k++) { 60471 var tagName = (facetsList[k].tag.split(':')[1]).toLowerCase(); 60472 if (!allowedFacets.includes(tagName)) { 60473 allowedFacets.push(tagName); 60474 } 60475 if(allowedFacets.includes('industry-segment') || allowedFacets.includes('industry')){ 60476 allowedFacets.push('industry'); 60477 allowedFacets.push('industry-segment'); 60478 } 60479 facetMapping[tagName] = facetsList[k].label; 60480 } 60481 } 60482 60483 60484 for (var i = 0; i < expFragData.length; i++) { 60485 60486 for (var j = 0; j < expFragData[i].tags.length; j++) { 60487 60488 var tagVal = expFragData[i].tags[j].split('/'); 60489 var tagType = tagVal[0].split(':')[1] != undefined ? tagVal[0].split(':')[1].toLowerCase() : ''; 60490 var tagHead = facetMapping[tagType]; 60491 60492 if (allowedFacets.includes(tagType)) { 60493 60494 if (tagVal[1]) { 60495 60496 var tagVal1 = tagVal[0] + '/' + tagVal[1]; 60497 60498 if (!facetsListObj.hasOwnProperty(tagHead)) { 60499 facetsListObj[tagHead] = []; 60500 60501 } 60502 if(expFragData[i].tags[j].includes('industry-segment/') || expFragData[i].tags[j].includes('industry/')){ 60503 if (!facetsListObj.hasOwnProperty(facetMapping['industry'])){ 60504 facetsListObj[facetMapping['industry']] = []; 60505 } 60506 if(!facetsListObj.hasOwnProperty(facetMapping['industry-segment'])) { 60507 facetsListObj[facetMapping['industry-segment']] = []; 60508 } 60509 } 60510 60511 if (facetsListObj[tagHead].indexOf(tagVal1) == -1) { 60512 if(expFragData[i].tags[j].includes('industry-segment/') || expFragData[i].tags[j].includes('industry/')){ 60513 facetsListObj[facetMapping['industry']].push(tagVal1); 60514 facetsListObj[facetMapping['industry-segment']].push(tagVal1); 60515 }else{ 60516 facetsListObj[tagHead].push(tagVal1); 60517 } 60518 } 60519 60520 if (facetsListObj[tagHead].indexOf(tagVal1) == -1) { 60521 60522 facetsListObj[tagHead].push(tagVal1) 60523 } 60524 60525 } 60526 60527 } 60528 } 60529 60530 60531 } 60532 60533 if (facetsList != undefined && facetsList.length > 0) { 60534 var rearrangedObj = {}; 60535 for (var l = 0; l < facetsList.length; l++) { 60536 if (facetsListObj[facetsList[l].label] != undefined && facetsListObj[facetsList[l].label].length > 0) { 60537 rearrangedObj[facetsList[l].label] = facetsListObj[facetsList[l].label]; 60538 } 60539 } 60540 } else { 60541 var rearrangedObj = facetsListObj; 60542 } 60543 this.prepareFacets(rearrangedObj);
60544 this.showFilteredResults(); 60545 60546 60547}; 60548 60549mapFacetHandler.prototype.prepareCapacityList = function (capList) { 60550 60551 this.cap_initialization=0; 60552 60553 $('.rs-container').remove(); 60554 //$('.mv-facet-header nav').append('<a href="#capacity" class="mv-facet-category">Capacity</a>'); 60555 $('.mv-facet-header nav').append('<a href="#capacity" class="mv-facet-category">'+capList[0].catLabel+'</a>'); 60556 60557 //var facets_wrapper = '<div class="facets-wrapper"><div class="facet-category">Capacity <span></span></div><div class="facet-content" id="capacity">'; 60558 var facets_wrapper = '<div class="facets-wrapper"><div class="facet-category">'+capList[0].catLabel+'<span></span></div><div class="facet-content" id="capacity">'; 60559 var facet_option = ''; 60560 60561 for (var p = 0; p < capList.length; p++) { 60562 var cap_id = ''; 60563 if (p == 0) { 60564 cap_id = "mcube"; 60565 } else { 60566 cap_id = capList[p].unitlabel; 60567 } 60568 60569 facet_option += '<div class="facet-option"><input type="checkbox" name="facets" value=' + cap_id.toLowerCase() + '><div class="checkmark"></div><label>' + capList[p].unitlabel + '</label></div>'; 60570 facet_option += '<div class="slider-blk slider-height"><input type="text" id="' + cap_id.toLowerCase() + '" class="slider-container"></div>'; 60571 60572 } 60573 60574 facets_wrapper += facet_option + '</div></div>'; 60575 60576 this.facetsContainer.append(facets_wrapper); 60577 60578 for (var p = 0; p < capList.length; p++) { 60579 var slider_minmax_div = ''; 60580 var cap_id; 60581 var cap_target_id; 60582 if (p == 0) { 60583 cap_id = "mcube"; 60584 cap_target_id = '#' + cap_id + ''; 60585 } else { 60586 cap_id = capList[p].unitlabel.toLowerCase(); 60587 cap_target_id = '#' + cap_id + ''; 60588 } 60589 var self = this; 60590 var min_val = parseInt(capList[p].unitMinValue); 60591 var max_val = parseInt(capList[p].unitMaxValue); 60592 60593 var cap_slider_width; 60594 60595 if($(window).width()>=1024 && $(window).width()<=1200){ 60596 cap_slider_width = 220; 60597 }else if($(window).width()>768 && $(window).width()<1024){ 60598 cap_slider_width = 170; 60599 }else{ 60600 cap_slider_width = 260; 60601 } 60602 60603 60604 var map_refer_slider = new rSlider({ 60605 target: cap_target_id, 60606 values: { min: min_val, max: max_val }, 60607 step: 100, 60608 range: true, 60609 set: [min_val, max_val], 60610 scale: false, 60611 labels: true, 60612 width: cap_slider_width, 60613 onChange: function (vals) { 60614 //console.log(vals); 60615 self.cap_initialization++; 60616 if(self.cap_initialization>3){ 60617 self.capacityAnalysis="yes"; 60618 } 60619 60620 self.showFilteredResults(); 60621 } 60622 }); 60623 slider_minmax_div = '<p class="min-val">' + min_val + '</p><p class="max-val">' + max_val + '</p>'; 60624 $($('.slider-blk .rs-container .rs-bg')[p]).append(slider_minmax_div); 60625 this.rFResultObj.range_list[cap_id] = map_refer_slider; 60626 } 60627 60628 $(".slider-blk .rs-pointer").hover(function () { 60629 $(this).find(".rs-tooltip").show(); 60630 }, function () { 60631 $(this).find(".rs-tooltip").hide(); 60632 }); 60633 60634 60635}; 60636mapFacetHandler.prototype.prepareCommissioningSlider = function (commissioning_yr) { 60637 60638 if (Object.keys(commissioning_yr).length > 0) { 60639 var self = this; 60640 var commYr_id = commissioning_yr.label + '_yr'; 60641 var commYr_target = '#' + commYr_id + ''; 60642 if(commissioning_yr.minYear==undefined){ 60643 commissioning_yr.minYear=0; 60644 } 60645 if(commissioning_yr.maxYear==undefined){ 60646 commissioning_yr.maxYear=0; 60647 } 60648 var commMinYear = parseInt(commissioning_yr.minYear); 60649 var commMaxYear = parseInt(commissioning_yr.maxYear); 60650 this.comMinYr = commMinYear; 60651 this.comMaxYr = commMaxYear; 60652 60653 $('.mv-facet-header nav').append('<a href="#' + commissioning_yr.label + '" class="mv-facet-category">' + commissioning_yr.label + '</a>'); 60654 var facets_wrapper = '<div class="facets-wrapper"><div class="facet-category">' + commissioning_yr.label + ' <span></span></div><div class="facet-content" id="' + commissioning_yr.label + '">'; 60655 facets_wrapper += '<div class="slider-blk slider-height"><input type="text" id="' + commYr_id + '" class="slider-container"></div>'; 60656 60657 facets_wrapper += '</div></div>'; 60658 60659 this.facetsContainer.append(facets_wrapper); 60660 60661 var comm_slider_width; 60662 60663 if($(window).width()>=1024 && $(window).width()<=1200){ 60664 comm_slider_width = 220; 60665 }else if($(window).width()>768 && $(window).width()<1024){ 60666 comm_slider_width = 170; 60667 }else{ 60668 comm_slider_width = 260; 60669 } 60670
60671 this.rFResultObj.comm_yr_range = new rSlider({ 60672 target: commYr_target, 60673 values: { min: commMinYear, max: commMaxYear }, 60674 step: 1, 60675 range: true, 60676 set: [commMinYear, commMaxYear], 60677 scale: false, 60678 labels: true, 60679 width: comm_slider_width, 60680 onChange: function (vals) { 60681 console.log(vals); 60682 self.showFilteredResults(); 60683 self.showShare(); 60684 } 60685 }); 60686 60687 var comm_slider_minmax_div = '<p class="min-val">' + commMinYear + '</p><p class="max-val">' + commMaxYear + '</p>'; 60688 $('#Commissioning .slider-blk .rs-container .rs-bg').append(comm_slider_minmax_div); 60689 60690 } 60691 60692 $(".slider-blk .rs-pointer").hover(function () { 60693 $(this).find(".rs-tooltip").show(); 60694 }, function () { 60695 $(this).find(".rs-tooltip").hide(); 60696 }); 60697 60698 60699}; 60700 60701 60702 60703/*To convert first letter of all words in upper case*/ 60704mapFacetHandler.prototype.convertToUpperCase = function (str) { 60705 var str1 = str.replace(/_/g, " "); 60706 var str2 = str1.replace(/-/g, " "); 60707 var strSpittted = str2.replace(/td/g, "").split(" "); 60708 var finalStr = ''; 60709 for (var i = 0; i < strSpittted.length; i++) { 60710 if (i == 0) { 60711 finalStr = finalStr + strSpittted[i].charAt(0).toUpperCase() + strSpittted[i].slice(1); 60712 } else { 60713 finalStr = finalStr + ' ' + strSpittted[i].charAt(0).toUpperCase() + strSpittted[i].slice(1); 60714 } 60715 } 60716 return finalStr; 60717}; 60718 60719 60720/*To de select all the selected facets*/ 60721mapFacetHandler.prototype.clearFacets = function () { 60722 this.capacityAnalysis ="no"; 60723 this.commYrAnalysis="no"; 60724 digitalData.pageInfo.selectedFilter=undefined; 60725 this.commChanged = "no"; 60726 var selectedFacetsBlock = this.cmpRF.find('.sel-facets-block'); 60727 this.rFResultObj.selectedFiltersArr = []; 60728 this.rFResultObj.selFiltersAnalytics= []; 60729 this.cmpRF.find("[name='facets']").prop('checked', false); 60730 selectedFacetsBlock.find('span.facet-name').remove(); 60731 60732 $('#capacity').show(); 60733 $('#capacity').siblings(".facet-category").addClass('open'); 60734 this.prepareCaps(this.rFResultObj.capUnitsList); 60735 $('#capacity').hide(); 60736 $('#capacity').siblings(".facet-category").removeClass('open'); 60737 60738 60739 $('#Commissioning').show(); 60740 $('#Commissioning').siblings(".facet-category").addClass('open'); 60741 this.prepareComm(this.rFResultObj.commissioning_yr); 60742 $('#Commissioning').hide(); 60743 $('#Commissioning').siblings(".facet-category").removeClass('open'); 60744 60745 60746 $("#capacity").find(".facet-option").siblings(".facet-option").show(); 60747 $("#capacity").find(".facet-option").siblings(".facet-disabled").hide(); 60748 $("#capacity").find(".facet-option").next(".slider-blk").addClass('slider-height'); 60749 $("#capacity").find(".facet-option").next(".slider-blk").css('visibility', 'hidden'); 60750 $("#capacity").find(".facet-option").next(".slider-blk").css('opacity', '0'); 60751 60752 60753 60754}; 60755 60756/*To handle event on view product button click. Displays filtered results in search results*/ 60757mapFacetHandler.prototype.showFilteredResults = function () { 60758 try { 60759 if(this.capacityAnalysis=="yes"){ 60760 60761 60762 var analyticsFilter_arr=[]; 60763 var caplabel = this.capLabel ? this.capLabel : "Capacity"; 60764 var minMaxVal = this.rFResultObj.range_list[this.cap_key].getValue().split(',').map(Number); 60765 60766 for (var k = 0; k < this.rFResultObj.selFiltersAnalytics.length; k++) { 60767 if (this.rFResultObj.selFiltersAnalytics[k].value == this.cap_key) { 60768 this.rFResultObj.selFiltersAnalytics.splice(k, 1); 60769 } 60770 } 60771 60772 this.rFResultObj.selFiltersAnalytics.push({ 60773 catLabel: caplabel, 60774 filterLabel : minMaxVal[0] + this.capacityFilterLabel +' | '+ minMaxVal[1] + this.capacityFilterLabel, 60775 value: this.cap_key 60776 }); 60777 60778 for(var k=0; k<this.rFResultObj.selFiltersAnalytics.length;k++){ 60779 analyticsFilter_arr.push(this.rFResultObj.selFiltersAnalytics[k].catLabel +' | '+this.rFResultObj.selFiltersAnalytics[k].filterLabel); 60780 } 60781 60782 digitalData.pageInfo.selectedFilter = analyticsFilter_arr.join(', '); 60783 _satellite.track("Reference_Map_Location"); 60784 } 60785 60786 if(this.commYrAnalysis=="yes"){ 60787 var analyticsFilter_arr=[]; 60788 60789 for (var k = 0; k < this.rFResultObj.selFiltersAnalytics.length; k++) { 60790 if (this.rFResultObj.selFiltersAnalytics[k].value == this.commissionFilterLabel ) { 60791 this.rFResultObj.selFiltersAnalytics.splice(k, 1); 60792 } 60793 } 60794 60795 var comm_range = this.rFResultObj.comm_yr_range.getValue().split(',').map(Number); 60796 60797 this.rFResultObj.selFiltersAnalytics.push({ 60798 catLabel : this.commissionFilterLabel, 60799 filterLabel : comm_range[0]+' | '+ comm_range[1], 60800 value : this.commissionFilterLabel 60801 }); 60802 60803 60804 for(var k=0; k<this.rFResultObj.selFiltersAnalytics.length;k++){ 60805 analyticsFilter_arr.push(this.rFResultObj.selFiltersAnalytics[k].catLabel +' | '+this.rFResultObj.selFiltersAnalytics[k].filterLabel); 60806 } 60807 60808 60809 digitalData.pageInfo.selectedFilter = analyticsFilter_arr.join(', '); 60810 _satellite.track("Reference_Map_Location"); 60811 } 60812 60813 var selectedFacetsBlock = this.cmpRF.find('.sel-facets-block'); 60814 if (this.rFResultObj.selectedFiltersArr.length > 0) { 60815 selectedFacetsBlock.show(); 60816 } else if(this.commChanged=="yes"){ 60817 selectedFacetsBlock.show(); 60818 } else{ 60819 selectedFacetsBlock.hide(); 60820 } 60821 60822 if(this.rFResultObj.filterTags.length>0){ 60823 var searchResults = this.rFResultObj.filteredResults(this.rFResultObj.searchResultsArr, this.rFResultObj.selectedFiltersArr, this.rFResultObj.filterTags, this.rFResultObj.range_list, this.rFResultObj.comm_yr_range); 60824 }else{ 60825 var searchResults = this.rFResultObj.selectedFiltersArr.length > 0 ? this.rFResultObj.filteredResults(this.rFResultObj.searchResultsArr, this.rFResultObj.selectedFiltersArr, this.rFResultObj.filterTags, this.rFResultObj.range_list, this.rFResultObj.comm_yr_range) : this.rFResultObj.searchResultsArr; 60826 if (this.rFResultObj.selectedFiltersArr.length == 0) { 60827 if (Object.keys(this.rFResultObj.comm_yr_range).length>0) { 60828 searchResults = this.rFResultObj.filteredResults(this.rFResultObj.searchResultsArr, this.rFResultObj.selectedFiltersArr, this.rFResultObj.filterTags, this.rFResultObj.range_list, this.rFResultObj.comm_yr_range) 60829 } 60830 } 60831 } 60832 60833 var units = []; 60834 for (var k = 0; k < searchResults.length; k++) { 60835 for (var l = 0; l < searchResults[k].capacity.length; l++) { 60836 var unit_key = searchResults[k].capacity[l].dataKey; 60837 60838 if (unit_key == "m³/h") { 60839 unit_key = "mcube"; 60840 } 60841 60842 if (!units.includes(unit_key)) { 60843 60844 units.push(unit_key); 60845 } 60846 } 60847 } 60848 60849 60850 this.rFResultObj.clearMarkers(); 60851 this.rFResultObj.markerResults(searchResults); 60852 60853 if (searchResults.length > 0) { 60854 this.updateFacets(searchResults, units); 60855 } 60856 } 60857 catch(e){} 60858}; 60859 60860 60861/*To deselact clicked facet and show filtered results*/ 60862mapFacetHandler.prototype.deSelectFacetClickHandler = function (event) { 60863 this.capacityAnalysis ="no"; 60864 //this.commYrAnalysis="no"; 60865 digitalData.pageInfo.selectedFilter=undefined; 60866 var currentFacet = $(event.currentTarget).parent(); 60867 var facetValue = currentFacet.attr('data-facet-name'); 60868 this.cmpRF.find("input[value='" + facetValue + "']").prop('checked', false); 60869 var input_elem = this.cmpRF.find("input[value='" + facetValue + "']"); 60870 currentFacet.remove(); 60871 60872 for (var i = 0; i < this.rFResultObj.selectedFiltersArr.length; i++) { 60873 if (this.rFResultObj.selectedFiltersArr[i].value == facetValue) { 60874 this.rFResultObj.selectedFiltersArr.splice(i, 1); 60875 } 60876 } 60877 for (var k = 0; k < this.rFResultObj.selFiltersAnalytics.length; k++) { 60878 if (this.rFResultObj.selFiltersAnalytics[k].value == facetValue) { 60879 this.rFResultObj.selFiltersAnalytics.splice(k, 1); 60880 } 60881 } 60882 60883 if (input_elem.parents(".facet-content").is("#capacity")) { 60884 //input_elem.parents(".facet-content").show(); 60885 if(!input_elem.parents(".facet-content").siblings('.facet-category').hasClass('open')){ 60886 input_elem.parents(".facet-content").siblings('.facet-category').click(); 60887 } 60888 60889 input_elem.parents(".facet-option").siblings(".facet-option").show(); 60890 input_elem.parents(".facet-option").siblings(".facet-disabled").hide(); 60891 this.prepareCaps(this.rFResultObj.capUnitsList); 60892 input_elem.parents(".facet-option").next(".slider-blk").addClass('slider-height'); 60893 input_elem.parents(".facet-option").next(".slider-blk").css('visibility', 'hidden'); 60894 input_elem.parents(".facet-option").next(".slider-blk").css('opacity', '0'); 60895 60896 input_elem.parents(".facet-content").siblings('.facet-category').click(); 60897 60898 } 60899 60900 60901 this.rFResultObj.uncheckedFilter = true;
60902 this.showFilteredResults(); 60903}; 60904 60905 60906 60907 60908/*To clear all the selected facets*/ 60909mapFacetHandler.prototype.clearAllFacetClickHandler = function (event) { 60910 60911 if (event != undefined) { 60912 this.rFResultObj.uncheckedFilter = true; 60913 event.preventDefault(); 60914 } 60915 //selectedFacetsBlock.hide(); 60916 this.clearFacets(); 60917 this.showFilteredResults(); 60918 60919 60920}; 60921 60922/*To handle click event on view all facet link and show hiddedn facet options*/ 60923mapFacetHandler.prototype.viewAllFacetClickHandler = function (event) { 60924 60925 var currentEl = $(event.currentTarget); 60926 event.preventDefault(); 60927 currentEl.hide(); 60928 currentEl.siblings('.facet-content').find('.hide-option').addClass('show-option'); 60929 60930}; 60931 60932/*To handle event on filters link click in mobile view */ 60933mapFacetHandler.prototype.filtersLinkClickHandler = function (event) { 60934 $('.embeddedServiceHelpButton').css('display','none'); 60935 this.facetsContainer.show(); 60936 $(this.cmpRF.find('.mv-facet-header nav')).scrollLeft(0); 60937 $(this.cmpRF.find('.mv-facet-category')[0]).click(); 60938 60939}; 60940 60941 60942 60943/*To handle event on apply filters button click*/ 60944mapFacetHandler.prototype.applyFiltersClickHandler = function (event) { 60945 this.tempDelFilters = []; 60946 this.tempAddedFilters = []; 60947 this.facetsContainer.hide(); 60948 $('.embeddedServiceHelpButton').css('display', ''); 60949}; 60950 60951 60952/*To handle event on cancel click*/ 60953mapFacetHandler.prototype.cancelBtnClickHandler = function (event) { 60954 var self = this; 60955 var selectedFacetsBlock = this.cmpRF.find('.sel-facets-block'); 60956 60957 60958 $.each(this.tempDelFilters, function (j, val) { 60959 60960 self.rFResultObj.selectedFiltersArr.push(val); 60961 var inputEl = self.cmpRF.find("input[value='" + val.value + "']"); 60962 inputEl.prop('checked', true); 60963 $('<span class="facet-name" data-facet-name="' + val.value + '">' + inputEl.siblings('label').text() + ' <span class="deselect-facet">x</span></span>').insertBefore(selectedFacetsBlock.find('.clear-facets')); 60964 60965 }); 60966 60967 $.each(this.tempAddedFilters, function (x, v) { 60968 for (var i = 0; i < self.rFResultObj.selectedFiltersArr.length; i++) { 60969 if (self.rFResultObj.selectedFiltersArr[i].value == v.value) { 60970 self.rFResultObj.selectedFiltersArr.splice(i, 1); 60971 } 60972 60973 } 60974 self.cmpRF.find("input[value='" + v.value + "']").prop('checked', false); 60975 selectedFacetsBlock.find("[data-facet-name='" + v.value + "']").remove(); 60976 60977 }); 60978 60979 this.tempDelFilters = []; 60980 this.tempAddedFilters = []; 60981 this.showFilteredResults(); 60982 this.facetsContainer.hide(); 60983 $('.embeddedServiceHelpButton').css('display', ''); 60984 60985}; 60986 60987 60988 60989/*To handle event on mobile facet category click*/ 60990mapFacetHandler.prototype.mobFacetCatClickHandler = function (event) { 60991 60992 var currentTarget = $(event.currentTarget); 60993 var href = currentTarget.attr('href'); 60994 event.preventDefault(); 60995 this.cmpRF.find('.mv-facet-category').removeClass('active'); 60996 this.cmpRF.find('.facet-content').hide(); 60997 currentTarget.addClass('active'); 60998 this.cmpRF.find(href).show(); 60999 61000 if (this.cmpRF.find(href).is("#Commissioning")) { 61001 this.cmpRF.find(href).find(".slider-blk").removeClass('slider-height'); 61002 this.cmpRF.find(href).find(".slider-blk").css('visibility', 'visible'); 61003 this.cmpRF.find(href).find(".slider-blk").css('opacity', '1'); 61004 } 61005 61006}; 61007 61008 61009/*To handle event on facet category click*/ 61010mapFacetHandler.prototype.facetCategoryClickHandler = function (event) { 61011 this.commYrAnalysis="no"; 61012 this.capacityAnalysis ="no"; 61013 var currentEl = $(event.currentTarget); 61014 var facetContent = currentEl.siblings('.facet-content'); 61015 var enabledOptions = facetContent.children().not(".facet-disabled"); 61016 if (currentEl.hasClass('open')) { 61017 currentEl.removeClass('open'); 61018 facetContent.hide(); 61019 currentEl.siblings('.view-all').hide(); 61020 61021 if (currentEl.siblings(".facet-content").is("#Commissioning")) { 61022 61023 currentEl.siblings(".facet-content").find(".slider-blk").removeClass('slider-height'); 61024 currentEl.siblings(".facet-content").find(".slider-blk").css('visibility', 'visible'); 61025 currentEl.siblings(".facet-content").find(".slider-blk").css('opacity', '1'); 61026 } 61027 61028 } else { 61029 61030 61031 this.cmpRF.find('.facet-content').hide(); 61032 this.cmpRF.find('.view-all').hide(); 61033 this.cmpRF.find('.facet-category').removeClass('open'); 61034 currentEl.addClass('open'); 61035 facetContent.find('.hide-option').removeClass('show-option'); 61036 facetContent.show(); 61037 if (enabledOptions.length > this.facetOptionsCount) { 61038 currentEl.siblings('.view-all').show(); 61039 } 61040 61041 if (currentEl.siblings(".facet-content").is("#Commissioning")) { 61042 this.commYrAnalysis="yes"; 61043 61044 var analyticsFilter_arr=[]; 61045 var comm_range = this.rFResultObj.comm_yr_range.getValue().split(',').map(Number); 61046 this.commissionFilterLabel = $(event.currentTarget).text(); 61047 61048 for (var k = 0; k < this.rFResultObj.selFiltersAnalytics.length; k++) { 61049 if (this.rFResultObj.selFiltersAnalytics[k].value == this.commissionFilterLabel ) { 61050 this.rFResultObj.selFiltersAnalytics.splice(k, 1); 61051 } 61052 } 61053 61054 this.rFResultObj.selFiltersAnalytics.push({ 61055 catLabel: this.commissionFilterLabel, 61056 filterLabel : comm_range[0]+' | '+ comm_range[1], 61057 value: this.commissionFilterLabel 61058 }); 61059 61060 for(var k=0; k<this.rFResultObj.selFiltersAnalytics.length;k++){ 61061 analyticsFilter_arr.push(this.rFResultObj.selFiltersAnalytics[k].catLabel +' | '+this.rFResultObj.selFiltersAnalytics[k].filterLabel); 61062 } 61063 61064 //digitalData.pageInfo.selectedFilter = this.commissionFilterLabel+' | '+comm_range[0]+' | '+ comm_range[1]; 61065 digitalData.pageInfo.selectedFilter = analyticsFilter_arr.join(', '); 61066 61067 currentEl.siblings(".facet-content").find(".slider-blk").removeClass('slider-height'); 61068 currentEl.siblings(".facet-content").find(".slider-blk").css('visibility', 'visible'); 61069 currentEl.siblings(".facet-content").find(".slider-blk").css('opacity', '1'); 61070 _satellite.track("Reference_Map_Location"); 61071 } 61072 } 61073 61074 61075 61076}; 61077 61078/*To handle event on facet option click*/ 61079mapFacetHandler.prototype.facetOptionClickHandler = function (event, el) { 61080 this.rFResultObj.filterTags=[]; 61081 61082 var inputEl = el != undefined ? el : $(event.currentTarget).find('input'); 61083 if (inputEl.length > 0) { 61084 var filterVal = inputEl.attr('value'); 61085 var selectedFacetsBlock = this.cmpRF.find('.sel-facets-block'); 61086 var isMobFacetsOn = this.cmpRF.find('.mv-facet-header').is(':visible'); 61087 61088 if (el) { 61089 var facCat = inputEl.parent().parent().siblings('.facet-category'); 61090 if (!facCat.hasClass('open')) { 61091 facCat.click(); 61092 } 61093 61094 } 61095 61096 if (inputEl.is(':checked')) { 61097 inputEl.prop('checked', false); 61098 for (var i = 0; i < this.rFResultObj.selectedFiltersArr.length; i++) { 61099 if (this.rFResultObj.selectedFiltersArr[i].value == filterVal) { 61100 this.rFResultObj.selectedFiltersArr.splice(i, 1); 61101 } 61102 } 61103 for (var k = 0; k < this.rFResultObj.selFiltersAnalytics.length; k++) { 61104 if (this.rFResultObj.selFiltersAnalytics[k].value == filterVal) { 61105 this.rFResultObj.selFiltersAnalytics.splice(k, 1); 61106 } 61107 } 61108 selectedFacetsBlock.find("[data-facet-name='" + filterVal + "']").remove(); 61109 if (isMobFacetsOn) { 61110 var item = { 61111 type: '', 61112 value: filterVal 61113 }; 61114 if (!this.tempDelFilters.includes(item)) { 61115 this.tempDelFilters.push(item); 61116 } 61117 } 61118 this.rFResultObj.uncheckedFilter = true; 61119 61120 if (inputEl.parents(".facet-content").is("#capacity")) { 61121 $(event.currentTarget).siblings(".facet-option").show(); 61122 $(event.currentTarget).siblings(".facet-disabled").hide(); 61123 $(event.currentTarget).next(".slider-blk").addClass('slider-height'); 61124 $(event.currentTarget).next(".slider-blk").css('visibility', 'hidden'); 61125 $(event.currentTarget).next(".slider-blk").css('opacity', '0'); 61126 } 61127 61128 this.rFResultObj.clearMarkers(); 61129 this.rFResultObj.markerResults(this.rFResultObj.searchResultsArr); 61130 61131 61132 this.capacityAnalysis = "no"; 61133 digitalData.pageInfo.selectedFilter=undefined; 61134 } else { 61135 var analyticsFilter_arr=[]; 61136 61137 this.capacityAnalysis = "no"; 61138 inputEl.prop('checked', true);
61139 this.rFResultObj.selectedFiltersArr.push({ 61140 type: '', 61141 value: filterVal 61142 }); 61143 61144 61145 if (isMobFacetsOn) { 61146 var item = { 61147 type: '', 61148 value: filterVal 61149 }; 61150 if (!this.tempAddedFilters.includes(item)) { 61151 this.tempAddedFilters.push(item); 61152 } 61153 } 61154 61155 $('<span class="facet-name" data-facet-name="' + filterVal + '">' + inputEl.siblings('label').text() + ' <span class="deselect-facet">x</span></span>').insertBefore(selectedFacetsBlock.find('.clear-facets')); 61156 this.rFResultObj.clickedFilter = inputEl.siblings('label').text(); 61157 this.rFResultObj.clickedCategory = inputEl.parents(".facet-content").siblings('.facet-category.open').text(); 61158 61159 if (!inputEl.parents(".facet-content").is("#capacity")) { 61160 this.rFResultObj.selFiltersAnalytics.push({ 61161 catLabel: this.rFResultObj.clickedCategory, 61162 filterLabel : this.rFResultObj.clickedFilter, 61163 value: filterVal 61164 }); 61165 } 61166 61167 for(var k=0; k<this.rFResultObj.selFiltersAnalytics.length;k++){ 61168 analyticsFilter_arr.push(this.rFResultObj.selFiltersAnalytics[k].catLabel +' | '+this.rFResultObj.selFiltersAnalytics[k].filterLabel); 61169 61170 } 61171 61172 61173 if (!inputEl.parents(".facet-content").is("#capacity")) { 61174 digitalData.pageInfo.selectedFilter = analyticsFilter_arr.join(', '); 61175 _satellite.track("Reference_Map_Location"); 61176 } 61177 61178 61179 if (inputEl.parents(".facet-content").is("#capacity")) { 61180 this.capacityAnalysis = "yes"; 61181 this.capLabel = inputEl.parents(".facet-content").siblings('.facet-category.open').text(); 61182 $(event.currentTarget).siblings(".facet-option").hide(); 61183 //$(event.currentTarget).next(".slider-blk").show(); 61184 $(event.currentTarget).next(".slider-blk").removeClass('slider-height'); 61185 $(event.currentTarget).next(".slider-blk").css('visibility', 'visible'); 61186 $(event.currentTarget).next(".slider-blk").css('opacity', '1'); 61187 this.rFResultObj.cap_unit = filterVal; 61188 this.capacityFilterLabel = inputEl.siblings('label').text(); 61189 61190 this.cap_key = inputEl.val(); 61191 var minMaxVal = this.rFResultObj.range_list[this.cap_key].getValue().split(',').map(Number); 61192 61193 61194 } 61195 61196 } 61197 61198 this.showFilteredResults(); 61199 61200 } 61201 61202}; 61203 61204 61205 61206/*To enable and disable facets based on the tags found in search results*/ 61207mapFacetHandler.prototype.updateFacets = function (searchResults, units) { 61208 61209 var self = this; 61210 var filterEls = []; 61211 var unitEls = []; 61212 61213 this.cmpRF.find('.facet-option').removeClass('hide-option').removeClass('show-option').addClass('facet-disabled'); 61214 61215 for (var i = 0; i < searchResults.length; i++) { 61216 var tags = searchResults[i].tags; 61217 61218 if (tags != undefined) { 61219 for (var j = 0; j < tags.length; j++) { 61220 var tag = tags[j].split('/'); 61221 var tagName = tag[0] + '/' + tag[1]; 61222 var el = 'input[value="' + tagName.toLowerCase() + '"]'; 61223 61224 if ((filterEls.indexOf(el) < 0)) { 61225 filterEls.push(el); 61226 } 61227 61228 } 61229 } 61230 61231 } 61232 61233 for (var k = 0; k < units.length; k++) { 61234 var unitel = 'input[value="' + units[k].toLowerCase() + '"]'; 61235 if ((filterEls.indexOf(unitel) < 0)) { 61236 filterEls.push(unitel); 61237 } 61238 } 61239 61240 $(filterEls.toString()).parent().removeClass('facet-disabled'); 61241 61242 $.each(this.cmpRF.find('.facet-content'), function (i, v) { 61243 61244 var enabledOptions = $(v).children().not(".facet-disabled"); 61245 61246 if (enabledOptions.length <= self.facetOptionsCount) { 61247 $(v).siblings('.view-all').hide(); 61248 } else { 61249 $.each(enabledOptions, function (ind, val) { 61250 if (ind >= self.facetOptionsCount) { 61251 $(val).addClass('hide-option'); 61252 } 61253 61254 }); 61255 if ($(v).is(':visible')) { 61256 $(v).siblings('.view-all').show(); 61257 } 61258 } 61259 61260 61261 }); 61262 61263} 61264 61265 61266let map_map_refer; 61267 61268function initMap_references() { 61269 var minZoomVal; 61270 61271 if($(window).width() < 768){ 61272 minZoomVal = 1; 61273 }else if($(window).width() >= 768 && $(window).width() < 1300){ 61274 minZoomVal = 1.2; 61275 }else{ 61276 minZoomVal = 1.7; 61277 } 61278 map_map_refer = new google.maps.Map(document.getElementById("mapR"), { 61279 zoom: 1.8, 61280 center: new google.maps.LatLng(55.3781, 3.4360), 61281 mapTypeId: "terrain", 61282 minZoom: minZoomVal, 61283 scaleControl: true 61284 }); 61285}; 61286 61287 61288var mapRefer = function (mapdata) { 61289 this.mapComp = $($('.mapReferences')[0]); 61290 if (this.mapComp.length > 0) { 61291 this.facetsList = JSON.parse(mapDataObj.facetsList); 61292 this.capUnitsList = JSON.parse(mapDataObj.capUnitsList); 61293 this.commissioning_yr = JSON.parse(mapDataObj.commissioning_yr);
61294 this.filterTags = mapDataObj.filterTags != "" ? mapDataObj.filterTags.split(',') : mapDataObj.filterTags; 61295 61296 this.exp_data; 61297 this.tagIDTitleList = []; 61298 this.searchResultsArr = []; 61299 this.selectedFiltersArr = []; 61300 this.filteredResultsArr = []; 61301 this.map_map_refer = mapdata; 61302 this.lanlang = []; 61303 this.range_list = []; 61304 this.comm_yr_range = {}; 61305 this.cap_unit; 61306 this.paramMinMaxVal = []; 61307 this.paramCommMinMaxVal = []; 61308 this.markers = []; 61309 61310 this.selFiltersAnalytics = []; 61311 61312 this.expFragPath = mapDataObj.expFragPath; 61313 this.pageLocale = mapDataObj.locale; 61314 } 61315 61316} 61317 61318/*To find filtered results based on the selected filters*/ 61319mapRefer.prototype.filteredResults = function (resultsArr, filtersArr, filterTags, range_list, comm_yr_range) { 61320 61321 61322 var filterredResultsArr = []; 61323 61324 filtersArr.sort(function (a, b) { 61325 return b.value.length - a.value.length; 61326 }); 61327 61328 for (var j = 0; j < resultsArr.length; j++) { 61329 var tagFoundArr = []; 61330 var filterTagFound = []; 61331 var yr_range_true = true; 61332 61333 if(Object.keys(comm_yr_range).length > 0){ 61334 var minmax_Year = comm_yr_range.getValue().split(','); 61335 this.paramCommMinMaxVal = minmax_Year.map(Number); 61336 var comm_year = resultsArr[j].commissioningYear; 61337 yr_range_true = parseInt(comm_year) >= parseInt(minmax_Year[0]) && parseInt(comm_year) <= parseInt(minmax_Year[1]); 61338 } 61339 61340 61341 for (var k = 0; k < resultsArr[j].tags.length; k++) { 61342 61343 61344 for (var i = 0; i < filtersArr.length; i++) { 61345 61346 var tag = (filtersArr[i].value).toLowerCase(); 61347 61348 if ((resultsArr[j].tags[k].toLowerCase()) == tag) { 61349 if (!tagFoundArr.includes(tag)) { 61350 tagFoundArr.push(tag); 61351 } 61352 break; 61353 } 61354 } 61355 61356 for (var p = 0; p < filterTags.length; p++) { 61357 61358 var tag = (filterTags[p]).toLowerCase(); 61359 61360 if ((resultsArr[j].tags[k].toLowerCase()) == tag) { 61361 if (!filterTagFound.includes(tag)) { 61362 filterTagFound.push(tag); 61363 } 61364 break; 61365 } 61366 } 61367 61368 61369 } 61370 61371 for (var k = 0; k < resultsArr[j].capacity.length; k++) { 61372 for (var i = 0; i < filtersArr.length; i++) { 61373 61374 var minmax_val = []; 61375 61376 var cap_unit = (filtersArr[i].value).toLowerCase(); 61377 61378 61379 for( var key in range_list){ 61380 if(key == cap_unit){ 61381 minmax_val = range_list[key].getValue().split(','); 61382 } 61383 } 61384 61385 this.paramMinMaxVal = minmax_val.map(Number); 61386 61387 if(cap_unit == "mcube"){ 61388 cap_unit = "m³/h"; 61389 // this.cap_unit = "m³/h"; 61390 } 61391 61392 var cap_value = (resultsArr[j].capacity[k].dataValue.toLowerCase()).replace(/,/g, ''); 61393 if(minmax_val.length > 0){ 61394 61395 var range_true = parseInt(cap_value) >= parseInt(minmax_val[0]) && parseInt(cap_value) <= parseInt(minmax_val[1]); 61396 61397 } 61398 61399 if ((resultsArr[j].capacity[k].dataKey.toLowerCase()) == cap_unit && range_true) { 61400 if (!tagFoundArr.includes(cap_unit)) { 61401 tagFoundArr.push(cap_unit); 61402 } 61403 break; 61404 61405 } 61406 61407 } 61408 } 61409 61410 61411 61412 if(this.filterTags.length > 0){ 61413 if(filterTagFound.length >= filterTags.length && yr_range_true){ 61414 if (!filterredResultsArr.includes(resultsArr[j])) { 61415
61416 filterredResultsArr.push(resultsArr[j]); 61417 61418 } 61419 } 61420 }else{ 61421 if (tagFoundArr.length >= filtersArr.length && yr_range_true) { 61422 61423 if (filtersArr.length > 0) { 61424 61425 if (!filterredResultsArr.includes(resultsArr[j])) { 61426 61427 filterredResultsArr.push(resultsArr[j]); 61428 61429 } 61430 61431 }else if(Object.keys(comm_yr_range).length > 0){ 61432 if(yr_range_true){ 61433 if (!filterredResultsArr.includes(resultsArr[j])) { 61434 61435 filterredResultsArr.push(resultsArr[j]); 61436 61437 } 61438 } 61439 } else{ 61440 filterredResultsArr = []; 61441 } 61442 } 61443 } 61444 61445 61446 61447 } 61448 61449 return filterredResultsArr; 61450}; 61451 61452 61453mapRefer.prototype.getExpFragments = function (facelist) { 61454 61455 var self = this; 61456 $.ajax({ 61457 61458 url: "/dupont/getReferencesMapData", 61459 dataType: "json", 61460 data: { 61461 expFragPath: this.expFragPath, 61462 //filterTags: ["DuPont:country/us"], 61463 locale: this.pageLocale 61464 }, 61465 success: function (result) { 61466 //console.log("getReferencesMapData-->" + JSON.stringify(result)); 61467 self.exp_data = result; 61468 self.tagIDTitleList = result.tagTitlesMap; 61469 61470 self.searchResultsArr = self.getValidatedexpFragments(self.exp_data.xfElements); 61471 61472 61473 self.facetHandlerObj = new mapFacetHandler(self); 61474 self.facetHandlerObj.prepareMobileHeaderNav(); 61475 if(self.facetsList.length > 0){ 61476 self.facetHandlerObj.prepareFacetsList(self.searchResultsArr, facelist); 61477 } 61478 61479 if(self.capUnitsList.length > 0){ 61480 self.facetHandlerObj.prepareCapacityList(self.capUnitsList); 61481 } 61482 if(Object.keys(self.commissioning_yr).length > 0){ 61483 self.facetHandlerObj.prepareCommissioningSlider(self.commissioning_yr); 61484 } 61485 self.facetHandlerObj.prepareMobileFooterNav(); 61486 self.facetHandlerObj.init(); 61487 61488 }, 61489 error: function (e) { 61490 console.log("Error in ReferencesInteractiveMap service call", e) 61491 // callback(self); 61492 } 61493 }); 61494} 61495 61496mapRefer.prototype.getValidatedexpFragments =function(expFrags){ 61497 61498 var validExpFreags = []; 61499 for(var i=0; i < expFrags.length; i++){ 61500 61501 if(expFrags[i].latValue != "" && expFrags[i].lngValue != ""){ 61502 validExpFreags.push(expFrags[i]); 61503 } 61504 61505 } 61506 return validExpFreags; 61507} 61508 61509mapRefer.prototype.init = function () { 61510 if (this.mapComp.length > 0) { 61511 this.getExpFragments(this.facetsList); 61512 } 61513} 61514 61515mapRefer.prototype.markerResults = function (exp_content) { 61516 61517 this.markers = []; 61518 var bounds = new google.maps.LatLngBounds(); 61519 var infowindow = new google.maps.InfoWindow(); 61520 var v_latlng; 61521 61522 61523 for (var i = 0; i < exp_content.length; i++) { 61524 var lat = parseFloat(exp_content[i].latValue); 61525 var lng = parseFloat(exp_content[i].lngValue); 61526 v_latlng = new google.maps.LatLng(lat, lng); 61527 61528 var marker = new google.maps.Marker({ 61529 position: v_latlng, 61530 map: map_map_refer, 61531 icon: exp_content[i].pinImagePath?exp_content[i].pinImagePath:'/content/dam/dupont/amer/us/en/corporate/general/icons/locationPin-red.svg' 61532 }); 61533 61534 bounds.extend(v_latlng); 61535 61536 this.markers.push(marker); 61537 61538 } 61539 61540 61541 if(exp_content.length > 1){ 61542 map_map_refer.fitBounds(bounds); 61543 }else if(exp_content.length == 1){ 61544 map_map_refer.setCenter(v_latlng); 61545 map_map_refer.setZoom(3); 61546 } 61547 61548 61549 for (let i = 0; i < exp_content.length; i++) { 61550 61551 var country = []; 61552 var technology = []; 61553 var industry = []; 61554 var application = []; 61555 var watertype = []; 61556 var capacity_unit = ''; 61557 var cap_value = ''; 61558 var comma = ''; 61559 61560 61561 var filtersArr = []; 61562 for(var k=0; k < exp_content[i].tags.length; k++){ 61563 var exp_tag = exp_content[i].tags[k]; 61564 var tagObj = $.grep(this.tagIDTitleList, function(obj){return obj.id==(exp_tag);})[0]; 61565 61566 if(tagObj){ 61567 if(tagObj.title){ 61568 filtersArr.push([exp_tag, tagObj.title]); 61569 } 61570 } 61571 } 61572 61573 filtersArr.forEach(element => { 61574 var tagVal = element[0].split('/'); 61575 var tagType = tagVal[0].split(':')[1] != undefined ? tagVal[0].split(':')[1].toLowerCase() : ''; 61576 61577 // if(tagType=='country'){ 61578 // country.push(element[1].toLowerCase()); 61579 // }else 61580 if(tagType == 'type'){ 61581 watertype.push(element[1]); 61582 }else if(tagType == 'pcg'){ 61583 technology.push(element[1]); 61584 }else if(tagType == 'uses_and_applications'){ 61585 application.push(element[1]); 61586 }else if(tagType == 'industry-segment' || tagType == 'industry'){ 61587 industry.push(element[1]); 61588 } 61589 61590 }); 61591 61592 for(var k = 0; k < exp_content[i].capacity.length; k++){ 61593 var cap=exp_content[i].capacity[k].dataKey.toLowerCase(); 61594 if(this.cap_unit == "mcube"){ 61595 this.cap_unit = "m³/h"; 61596 } 61597 if(cap == this.cap_unit){ 61598 capacity_unit = exp_content[i].capacity[k].dataKey; 61599 cap_value = exp_content[i].capacity[k].dataValue; 61600 61601 } 61602 } 61603 61604 if(exp_content[i].capacity.length>0){
61605 capacity_unit = capacity_unit?capacity_unit:exp_content[i].capacity[0].dataKey; 61606 cap_value = cap_value?cap_value:exp_content[i].capacity[0].dataValue; 61607 } 61608 61609 61610 if(country.length > 0){ 61611 comma = ', '; 61612 } 61613 61614 var info_div = '<div class="info-window"><div class="info-blk"><div class="info-text">' 61615 //info_div+='<div class="marker-details"><p class="marker-title">Location</p><p class="marker-text">'+exp_content[i].locationText+', <span class="country">'+country+'</span></p></div>'; 61616 if(exp_content[i].locationText.length > 0){ 61617 info_div += '<div class="marker-details"><p class="marker-title">Location</p><p class="marker-text">'+exp_content[i].locationText+'</p></div>'; 61618 } 61619 if(technology.length > 0){ 61620 info_div += '<div class="marker-details"><p class="marker-title">Technology</p><p class="marker-text">'+technology.join(', ')+'</p></div>'; 61621 } 61622 61623 if(industry.length > 0){ 61624 info_div += '<div class="marker-details"><p class="marker-title">Industry</p><p class="marker-text">'+industry.join(', ')+'</p></div>'; 61625 } 61626 if(application.length > 0){ 61627 info_div += '<div class="marker-details"><p class="marker-title">Application</p><p class="marker-text">'+application.join(', ')+'</p></div>'; 61628 } 61629 if(watertype.length > 0){ 61630 info_div += '<div class="marker-details"><p class="marker-title">Feed Water Source</p><p class="marker-text">'+watertype.join(', ')+'</p></div>'; 61631 } 61632 if(cap_value.length > 0){ 61633 info_div += '<div class="marker-details"><p class="marker-title">Capacity</p><p class="marker-text">'+cap_value+' '+capacity_unit+'</p></div>'; 61634 } 61635 61636 if(exp_content[i].commissioningYear.length > 0){ 61637 info_div += '<div class="marker-details"><p class="marker-title">Commissioning</p><p class="marker-text">'+exp_content[i].commissioningYear+'</p></div>'; 61638 } 61639 61640 61641 for(let [index,v] of exp_content[i].xfRefData.entries()){ 61642 if(v.dataValue.includes('http') || v.dataValue.includes('www') ){ 61643 info_div += `<div class="info-link"><a href=${v.dataValue} target="_bank">${v.dataKey}</a></div>`; 61644 }else{ 61645 info_div += `<div class="marker-details"><p class="marker-title">${v.dataKey}</p><p class="marker-text">${v.dataValue}</p></div>`; 61646 } 61647 61648 } 61649 61650 61651 if (exp_content[i].linkPath.length > 0) { 61652 let label1 = exp_content[i].label1 ? exp_content[i].label1 : "Related Resources"; 61653 info_div += '<div class="info-link"><a href="' + exp_content[i].linkPath + '" target="_bank">' + label1 + '</a></div>'; 61654 } 61655 61656 if(exp_content[i].path2.length > 0){ 61657 let label2 = exp_content[i].label2 ? exp_content[i].label2 : "Related Case Study"; 61658 info_div += '<div class="info-link"><a href="' + exp_content[i].path2 + '" target="_bank">' + label2 + '</a></div>'; 61659 } 61660 61661 if(exp_content[i].path3.length > 0){ 61662 let label3 = exp_content[i].label3 ? exp_content[i].label3 : "Related Article Page"; 61663 info_div += '<div class="info-link"><a href="' + exp_content[i].path3 + '" target="_bank">' + label3 + '</a></div>'; 61664 } 61665 61666 info_div += '</div>'; 61667 info_div += '</div>'; 61668 61669 info_div += '<div class="info-img"><img src="' + exp_content[i].imagePath + '" alt=""></div>'; 61670 61671 info_div += '</div>'; 61672 61673 61674 61675 61676 61677 google.maps.event.addListener(this.markers[i],'click', (function(marker,content,infowindow){ 61678 return function() { 61679 digitalData.pageInfo.selectedReferenceLocation = exp_content[i].locationText; 61680 _satellite.track("Reference_Map_Location"); 61681 digitalData.pageInfo.selectedReferenceLocation = undefined; 61682 61683 if($(window).width() < 767){ 61684 $(".modal-body").empty(); 61685 $(".modal-body").append(content); 61686 $('#infoModal').modal('show'); 61687 }else{ 61688 infowindow.setContent(content); 61689 infowindow.open(map_map_refer,marker); 61690 61691 zoomLevel = map_map_refer.getZoom(); 61692 if (zoomLevel <= 3) { 61693 map_map_refer.panTo(this.getPosition()); 61694 map_map_refer.setZoom(3); 61695 clickedMarker = marker; 61696 } 61697 } 61698 61699 google.maps.event.addListener(infowindow, 'closeclick', function() { 61700 map_map_refer.fitBounds(bounds); 61701 if(exp_content.length == 1){ 61702 map_map_refer.setCenter(exp_content[0].latValue, exp_content[0].lngValue); 61703 map_map_refer.setZoom(3); 61704 } 61705 }); 61706 61707 google.maps.event.addListener(map_map_refer, 'click', function() { 61708 infowindow.close(); 61709 }); 61710 61711 }; 61712 })(this.markers[i],info_div,infowindow)); 61713 61714 61715 } 61716 61717 google.maps.event.addListener(map_map_refer, 'click', function(event) { 61718 //map_map_refer.fitBounds(bounds); 61719 infowindow.close(); 61720 }); 61721 61722 61723} 61724 61725mapRefer.prototype.setMapOnAll = function(map){ 61726 for (let i = 0; i < this.markers.length; i++) {
vendor: 21,257 bytes, lines 61727-61771
61727 this.markers[i].setMap(map); 61728 } 61729} 61730 61731mapRefer.prototype.deleteMarkers = function(){ 61732 this.clearMarkers(); 61733 this.markers = []; 61734} 61735 61736mapRefer.prototype.clearMarkers = function() { 61737 this.setMapOnAll(null); 61738} 61739 61740 61741let mapref = new mapRefer(map_map_refer); 61742 61743mapref.init(); 61744 61745/**! 61746 61747 @license 61748 handlebars v4.7.7 61749 61750Copyright (C) 2011-2019 by Yehuda Katz 61751 61752Permission is hereby granted, free of charge, to any person obtaining a copy 61753of this software and associated documentation files (the "Software"), to deal 61754in the Software without restriction, including without limitation the rights 61755to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 61756copies of the Software, and to permit persons to whom the Software is 61757furnished to do so, subject to the following conditions: 61758 61759The above copyright notice and this permission notice shall be included in 61760all copies or substantial portions of the Software. 61761 61762THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 61763IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 61764FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61765AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 61766LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 61767OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 61768THE SOFTWARE. 61769 61770*/ 61771!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=r();return a.compile=function(b,c){return k.compile(b,c,a)},a.precompile=function(b,c){return k.precompile(b,c,a)},a.AST=i["default"],a.Compiler=k.Compiler,a.JavaScriptCompiler=m["default"],a.Parser=j.parser,a.parse=j.parse,a.parseWithoutProcessing=j.parseWithoutProcessing,a}var e=c(1)["default"];b.__esModule=!0;var f=c(2),g=e(f),h=c(45),i=e(h),j=c(46),k=c(51),l=c(52),m=e(l),n=c(49),o=e(n),p=c(44),q=e(p),r=g["default"].create,s=d();s.create=d,q["default"](s),s.Visitor=o["default"],s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(3)["default"],f=c(1)["default"];b.__esModule=!0;var g=c(4),h=e(g),i=c(37),j=f(i),k=c(6),l=f(k),m=c(5),n=e(m),o=c(38),p=e(o),q=c(44),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}var e=c(1)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d;var f=c(5),g=c(6),h=e(g),i=c(10),j=c(30),k=c(32),l=e(k),m=c(33),n="4.7.7";b.VERSION=n;var o=8;b.COMPILER_REVISION=o;var p=7;b.LAST_COMPATIBLE_COMPILER_REVISION=p;var q={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};b.REVISION_CHANGES=q;var r="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===r){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===r)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===r){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]},resetLoggedPropertyAccesses:function(){m.resetLoggedProperties()}};var s=l["default"].log;b.log=s,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return!a&&0!==a||!(!p(a)||0!==a.length)}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===n.call(a)};b.isArray=p},function(a,b,c){"use strict";function d(a,b){var c=b&&b.loc,g=void 0,h=void 0,i=void 0,j=void 0;c&&(g=c.start.line,h=c.end.line,i=c.start.column,j=c.end.column,a+=" - "+g+":"+i);for(var k=Error.prototype.constructor.call(this,a),l=0;l<f.length;l++)this[f[l]]=k[f[l]];Error.captureStackTrace&&Error.captureStackTrace(this,d);try{c&&(this.lineNumber=g,this.endLineNumber=h,e?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:j,enumerable:!0})):(this.column=i,this.endColumn=j))}catch(m){}}var e=c(7)["default"];b.__esModule=!0;var f=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];d.prototype=new Error,b["default"]=d,a.exports=b["default"]},function(a,b,c){a.exports={"default":c(8),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b,c){return d.setDesc(a,b,c)}},function(a,b){var c=Object;a.exports={create:c.create,getProto:c.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:c.getOwnPropertyDescriptor,setDesc:c.defineProperty,setDescs:c.defineProperties,getKeys:c.keys,getNames:c.getOwnPropertyNames,getSymbols:c.getOwnPropertySymbols,each:[].forEach}},function(a,b,c){"use strict";function d(a){h["default"](a),j["default"](a),l["default"](a),n["default"](a),p["default"](a),r["default"](a),t["default"](a)}function e(a,b,c){a.helpers[b]&&(a.hooks[b]=a.helpers[b],c||delete a.helpers[b])}var f=c(1)["default"];b.__esModule=!0,b.registerDefaultHelpers=d,b.moveHelperToHooks=e;var g=c(11),h=f(g),i=c(12),j=f(i),k=c(25),l=f(k),m=c(26),n=f(m),o=c(27),p=f(o),q=c(28),r=f(q),s=c(29),t=f(s)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(d.isArray(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){(function(d){"use strict";var e=c(13)["default"],f=c(1)["default"];b.__esModule=!0;var g=c(5),h=c(6),i=f(h);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,d){l&&(l.key=b,l.index=c,l.first=0===c,l.last=!!d,m&&(l.contextPath=m+b)),k+=f(a[b],{data:l,blockParams:g.blockParams([a[b],b],[m+b,null])})}if(!b)throw new i["default"]("Must pass iterator to #each");var f=b.fn,h=b.inverse,j=0,k="",l=void 0,m=void 0;if(b.data&&b.ids&&(m=g.appendContextPath(b.data.contextPath,b.ids[0])+"."),g.isFunction(a)&&(a=a.call(this)),b.data&&(l=g.createFrame(b.data)),a&&"object"==typeof a)if(g.isArray(a))for(var n=a.length;j<n;j++)j in a&&c(j,j,j===a.length-1);else if(d.Symbol&&a[d.Symbol.iterator]){for(var o=[],p=a[d.Symbol.iterator](),q=p.next();!q.done;q=p.next())o.push(q.value);a=o;for(var n=a.length;j<n;j++)c(j,j,j===a.length-1)}else!function(){var b=void 0;e(a).forEach(function(a){void 0!==b&&c(b,j-1),b=a,j++}),void 0!==b&&c(b,j-1,!0)}();return 0===j&&(k=h(this)),k})},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b,c){a.exports={"default":c(14),__esModule:!0}},function(a,b,c){c(15),a.exports=c(21).Object.keys},function(a,b,c){var d=c(16);c(18)("keys",function(a){return function(b){return a(d(b))}})},function(a,b,c){var d=c(17);a.exports=function(a){return Object(d(a))}},function(a,b){a.exports=function(a){if(void 0==a)throw TypeError("Can't call method on "+a);return a}},function(a,b,c){var d=c(19),e=c(21),f=c(24);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){var d=c(20),e=c(21),f=c(22),g="prototype",h=function(a,b,c){var i,j,k,l=a&h.F,m=a&h.G,n=a&h.S,o=a&h.P,p=a&h.B,q=a&h.W,r=m?e:e[b]||(e[b]={}),s=m?d:n?d[b]:(d[b]||{})[g];m&&(c=b);for(i in c)j=!l&&s&&i in s,j&&i in r||(k=j?s[i]:c[i],r[i]=m&&"function"!=typeof s[i]?c[i]:p&&j?f(k,d):q&&s[i]==k?function(a){var b=function(b){return this instanceof a?new a(b):a(b)};return b[g]=a[g],b}(k):o&&"function"==typeof k?f(Function.call,k):k,o&&((r[g]||(r[g]={}))[i]=k))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,a.exports=h},function(a,b){var c=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b){var c=a.exports={version:"1.2.6"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(23);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(6),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("if",function(a,b){if(2!=arguments.length)throw new g["default"]("#if requires exactly one argument");return e.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||e.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){if(2!=arguments.length)throw new g["default"]("#unless requires exactly one argument");return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d<arguments.length-1;d++)b.push(arguments[d]);var e=1;null!=c.hash.level?e=c.hash.level:c.data&&null!=c.data.level&&(e=c.data.level),b[0]=e,a.log.apply(a,b)})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("lookup",function(a,b,c){return a?c.lookupProperty(a,b):a})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("with",function(a,b){if(2!=arguments.length)throw new g["default"]("#with requires exactly one argument");e.isFunction(a)&&(a=a.call(this));var c=b.fn;if(e.isEmpty(a))return b.inverse(this);var d=b.data;return b.data&&b.ids&&(d=e.createFrame(b.data),d.contextPath=e.appendContextPath(b.data.contextPath,b.ids[0])),c(a,{data:d,blockParams:e.blockParams([a],[d&&d.contextPath])})})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){g["default"](a)}var e=c(1)["default"];b.__esModule=!0,b.registerDefaultDecorators=d;var f=c(31),g=e(f)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerDecorator("inline",function(a,b,c,e){var f=a;return b.partials||(b.partials={},f=function(e,f){var g=c.partials;c.partials=d.extend({},g,b.partials);var h=a(e,f);return c.partials=g,h}),b.partials[e.args[0]]=e.fn,f})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5),e={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(a){if("string"==typeof a){var b=d.indexOf(e.methodMap,a.toLowerCase());a=b>=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=i(null);b.constructor=!1,b.__defineGetter__=!1,b.__defineSetter__=!1,b.__lookupGetter__=!1;var c=i(null);return c.__proto__=!1,{properties:{whitelist:l.createNewLookupObject(c,a.allowedProtoProperties),defaultValue:a.allowProtoPropertiesByDefault},methods:{whitelist:l.createNewLookupObject(b,a.allowedProtoMethods),defaultValue:a.allowProtoMethodsByDefault}}}function e(a,b,c){return"function"==typeof a?f(b.methods,c):f(b.properties,c)}function f(a,b){return void 0!==a.whitelist[b]?a.whitelist[b]===!0:void 0!==a.defaultValue?a.defaultValue:(g(b),!1)}function g(a){o[a]!==!0&&(o[a]=!0,n.log("error",'Handlebars: Access has been denied to resolve the property "'+a+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}function h(){j(o).forEach(function(a){delete o[a]})}var i=c(34)["default"],j=c(13)["default"],k=c(3)["default"];b.__esModule=!0,b.createProtoAccessControl=d,b.resultIsAllowed=e,b.resetLoggedProperties=h;var l=c(36),m=c(32),n=k(m),o=i(null)},function(a,b,c){a.exports={"default":c(35),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b){return d.create(a,b)}},function(a,b,c){"use strict";function d(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return f.extend.apply(void 0,[e(null)].concat(b))}var e=c(34)["default"];b.__esModule=!0,b.createNewLookupObject=d;var f=c(5)},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=v.COMPILER_REVISION;if(!(b>=v.LAST_COMPATIBLE_COMPILER_REVISION&&b<=v.COMPILER_REVISION)){if(b<v.LAST_COMPATIBLE_COMPILER_REVISION){var d=v.REVISION_CHANGES[c],e=v.REVISION_CHANGES[b];throw new u["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new u["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=s.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e);var f=s.extend({},e,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),g=b.VM.invokePartial.call(this,c,d,f);if(null==g&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),g=e.partials[e.name](d,f)),null!=g){if(e.indent){for(var h=g.split("\n"),i=0,j=h.length;i<j&&(h[i]||i+1!==j);i++)h[i]=e.indent+h[i];g=h.join("\n")}return g}throw new u["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(g,b,g.helpers,g.partials,f,i,h)}var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],f=e.data;d._setup(e),!e.partial&&a.useData&&(f=j(b,f));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=e.depths?b!=e.depths[0]?[b].concat(e.depths):e.depths:[b]),(c=k(a.main,c,g,e.depths||[],f,i))(b,e)}if(!b)throw new u["default"]("No environment passed to template");if(!a||!a.main)throw new u["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e=a.compiler&&7===a.compiler[0],g={strict:function(a,b,c){if(!(a&&b in a))throw new u["default"]('"'+b+'" not defined in '+a,{loc:c});return g.lookupProperty(a,b)},lookupProperty:function(a,b){var c=a[b];return null==c?c:Object.prototype.hasOwnProperty.call(a,b)?c:y.resultIsAllowed(c,g.protoAccessControl,b)?c:void 0},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++){var e=a[d]&&g.lookupProperty(a[d],b);if(null!=e)return a[d][b]}},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:s.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},mergeIfNeeded:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=s.extend({},b,a)),c},nullContext:n({}),noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){if(c.partial)g.protoAccessControl=c.protoAccessControl,g.helpers=c.helpers,g.partials=c.partials,g.decorators=c.decorators,g.hooks=c.hooks;else{var d=s.extend({},b.helpers,c.helpers);l(d,g),g.helpers=d,a.usePartial&&(g.partials=g.mergeIfNeeded(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(g.decorators=s.extend({},b.decorators,c.decorators)),g.hooks={},g.protoAccessControl=y.createProtoAccessControl(c);var f=c.allowCallsToHelperMissing||e;w.moveHelperToHooks(g,"helperMissing",f),w.moveHelperToHooks(g,"blockHelperMissing",f)}},d._child=function(b,c,d,e){if(a.useBlockParams&&!d)throw new u["default"]("must pass block params");if(a.useDepths&&!e)throw new u["default"]("must pass parent depths");return f(g,b,a[b],c,0,d,e)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return!g||b==g[0]||b===a.nullContext&&null===g[0]||(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=k(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a="@partial-block"===c.name?c.data["partial-block"]:c.partials[c.name],a}function h(a,b,c){var d=c.data&&c.data["partial-block"];c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var e=void 0;if(c.fn&&c.fn!==i&&!function(){c.data=v.createFrame(c.data);var a=c.fn;e=c.data["partial-block"]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.data=v.createFrame(c.data),c.data["partial-block"]=d,a(b,c)},a.partials&&(c.partials=s.extend({},c.partials,a.partials))}(),void 0===a&&e&&(a=e),void 0===a)throw new u["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?v.createFrame(b):{},b.root=a),b}function k(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),s.extend(b,g)}return b}function l(a,b){o(a).forEach(function(c){var d=a[c];a[c]=m(d,b)})}function m(a,b){var c=b.lookupProperty;return x.wrapHelper(a,function(a){return s.extend({lookupProperty:c},a)})}var n=c(39)["default"],o=c(13)["default"],p=c(3)["default"],q=c(1)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var r=c(5),s=p(r),t=c(6),u=q(t),v=c(4),w=c(10),x=c(43),y=c(33)},function(a,b,c){a.exports={"default":c(40),__esModule:!0}},function(a,b,c){c(41),a.exports=c(21).Object.seal},function(a,b,c){var d=c(42);c(18)("seal",function(a){return function(b){return a&&d(b)?a(b):b}})},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b){"use strict";function c(a,b){if("function"!=typeof a)return a;var c=function(){var c=arguments[arguments.length-1];return arguments[arguments.length-1]=b(c),a.apply(this,arguments)};return c}
61771b.__esModule=!0,b.wrapHelper=c},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){return b.Handlebars===a&&(b.Handlebars=d),a}},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b){"use strict";b.__esModule=!0;var c={helpers:{helperExpression:function(a){return"SubExpression"===a.type||("MustacheStatement"===a.type||"BlockStatement"===a.type)&&!!(a.params&&a.params.length||a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if("Program"===a.type)return a;i["default"].yy=o,o.locInfo=function(a){return new o.SourceLocation(b&&b.srcName,a)};var c=i["default"].parse(a);return c}function e(a,b){var c=d(a,b),e=new k["default"](b);return e.accept(c)}var f=c(1)["default"],g=c(3)["default"];b.__esModule=!0,b.parseWithoutProcessing=d,b.parse=e;var h=c(47),i=f(h),j=c(48),k=f(j),l=c(50),m=g(l),n=c(5);b.parser=i["default"];var o={};n.extend(o,m)},function(a,b){"use strict";b.__esModule=!0
vendor: 10,920 bytes, line 61771
61771;var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:this.$=d.prepareProgram(f[h]);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=f[h];break;case 8:this.$=f[h];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(f[h]),strip:d.stripFlags(f[h],f[h]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[h],value:f[h],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(f[h-2],f[h-1],f[h],this._$);break;case 12:this.$={path:f[h-3],params:f[h-2],hash:f[h-1]};break;case 13:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 14:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 15:this.$={open:f[h-5],path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 16:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 17:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 18:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 19:var i=d.prepareBlock(f[h-2],f[h-1],f[h],f[h],!1,this._$),j=d.prepareProgram([i],f[h-1].loc);j.chained=!0,this.$={strip:f[h-2].strip,program:j,chain:!0};break;case 20:this.$=f[h];break;case 21:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 22:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 23:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[h-3],params:f[h-2],hash:f[h-1],indent:"",strip:d.stripFlags(f[h-4],f[h]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(f[h-2],f[h-1],f[h],this._$);break;case 26:this.$={path:f[h-3],params:f[h-2],hash:f[h-1],strip:d.stripFlags(f[h-4],f[h])};break;case 27:this.$=f[h];break;case 28:this.$=f[h];break;case 29:this.$={type:"SubExpression",path:f[h-3],params:f[h-2],hash:f[h-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[h],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(f[h-2]),value:f[h],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(f[h-1]);break;case 33:this.$=f[h];break;case 34:this.$=f[h];break;case 35:this.$={type:"StringLiteral",value:f[h],original:f[h],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[h]),original:Number(f[h]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===f[h],original:"true"===f[h],loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 40:this.$=f[h];break;case 41:this.$=f[h];break;case 42:this.$=d.preparePath(!0,f[h],this._$);break;case 43:this.$=d.preparePath(!1,f[h],this._$);break;case 44:f[h-2].push({part:d.id(f[h]),original:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 45:this.$=[{part:d.id(f[h]),original:f[h]}];break;case 46:this.$=[];break;case 47:f[h-1].push(f[h]);break;case 48:this.$=[];break;case 49:f[h-1].push(f[h]);break;case 50:this.$=[];break;case 51:f[h-1].push(f[h]);break;case 58:this.$=[];break;case 59:f[h-1].push(f[h]);break;case 64:this.$=[];break;case 65:f[h-1].push(f[h]);break;case 70:this.$=[];break;case 71:f[h-1].push(f[h]);break;case 78:this.$=[];break;case 79:f[h-1].push(f[h]);break;case 82:this.$=[];break;case 83:f[h-1].push(f[h]);break;case 86:this.$=[];break;case 87:f[h-1].push(f[h]);break;case 90:this.$=[];break;case 91:f[h-1].push(f[h]);break;case 94:this.$=[];break;case 95:f[h-1].push(f[h]);break;case 98:this.$=[f[h]];break;case 99:f[h-1].push(f[h]);break;case 100:this.$=[f[h]];break;case 101:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{
61771
vendor: 16,586 bytes, line 61772
6177233:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(a,b){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:(null!==n&&"undefined"!=typeof n||(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substring(a,b.yyleng-c+a)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(e(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(1)["default"];b.__esModule=!0;var j=c(
6177249
vendor: 6,533 bytes, line 61772
61772),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,i=0,j=d.length;i<j;i++){var k=d[i],l=this.accept(k);if(l){var m=e(d,i,c),n=f(d,i,c),o=l.openStandalone&&m,p=l.closeStandalone&&n,q=l.inlineStandalone&&m&&n;l.close&&g(d,i,!0),l.open&&h(d,i,!0),b&&q&&(g(d,i),h(d,i)&&"PartialStatement"===k.type&&(k.indent=/([ \t]+$)/.exec(d[i-1].original)[1])),b&&o&&(g((k.program||k.inverse).body),h(d,i)),b&&p&&(g(d,i),h((k.inverse||k.program).body))}}return a},d.prototype.BlockStatement=d.prototype.DecoratorBlock=d.prototype.PartialBlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),!this.options.ignoreStandalone&&e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.Decorator=d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(){this.parents=[]}function e(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function f(a){e.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function g(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}var h=c(1)["default"];b.__esModule=!0;var i=c(6),j=h(i);d.prototype={constructor:d,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&!d.prototype[c.type])throw new j["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new j["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;b<c;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){if(!this[a.type])throw new j["default"]("Unknown type: "+a.type,a);this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:e,Decorator:e,BlockStatement:f,DecoratorBlock:f,PartialStatement:g,PartialBlockStatement:function(a){g.call(this,a),this.acceptKey(a,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:e,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if(b=b.path?b.path.original:b,a.path.original!==b){var c={loc:a.path.loc};throw new q["default"](a.path.original+" doesn't match "+b,c)}}function e(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function f(a){return/^\[.*\]$/.test(a)?a.substring(1,a.length-1):a}function g(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function h(a){return a.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function i(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g=0,h=b.length;g<h;g++){var i=b[g].part,j=b[g].original!==i;if(d+=(b[g].separator||"")+i,j||".."!==i&&"."!==i&&"this"!==i)e.push(i);else{if(e.length>0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===i&&f++}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:e}}function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}}function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}}var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock=n;var p=c(6),q=o(p)},function(a,b,c){"use strict";function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}function e(a,b){return f||(f=d()),f.call(this,a,b)}if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=m.extend({},b),"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a){return f||(f=d()),f._setup(a)},e._child=function(a,b,c,e){return f||(f=d()),
vendor: 11,631 bytes, lines 61772-61773
61772f._child(a,b,c,e)},e}function g(a,b){if(a===b)return!0;if(m.isArray(a)&&m.isArray(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!g(a[c],b[c]))return!1;return!0}}function h(a){if(!a.path.parts){var b=a.path;a.path={type:"PathExpression",data:!1,depth:0,parts:[b.original+""],original:b.original+"",loc:b.loc}}}var i=c(34)["default"],j=c(1)["default"];b.__esModule=!0,b.Compiler=d,b.precompile=e,b.compile=f;var k=c(6),l=j(k),m=c(5),n=c(45),o=j(n),p=[].slice;d.prototype={compiler:d,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;c<b;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}b=this.children.length;for(var c=0;c<b;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[],b.knownHelpers=m.extend(i(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},b.knownHelpers),this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){if(!this[a.type])throw new l["default"]("Unknown type: "+a.type,a);this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;d<c;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){h(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(a){var b=a.program&&this.compileProgram(a.program),c=this.setupFullMustacheParams(a,b,void 0),d=a.path;this.useDecorators=!0,this.opcode("registerDecorator",c.length,d.original)},PartialStatement:function(a){this.usePartial=!0;var b=a.program;b&&(b=this.compileProgram(a.program));var c=a.params;if(c.length>1)throw new l["default"]("Unsupported number of partial arguments: "+c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type;e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")},PartialBlockStatement:function(a){this.PartialStatement(a)},MustacheStatement:function(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(a){this.DecoratorBlock(a)},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new l["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,o["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=o["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");c<d;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:p.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=o["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&o["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;b<c;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||o["default"].helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;b<c;b++){var d=this.options.blockParams[b],e=d&&m.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){this.value=a}function e(){}function f(a,b,c,d){var e=b.popStack(),f=0,g=c.length;for(a&&g--;f<g;f++)e=b.nameLookup(e,c[f],d);return a?[b.aliasable("container.strict"),"(",e,", ",b.quotedString(c[f]),", ",JSON.stringify(b.source.currentLocation)," )"]:e}var g=c(13)["default"],h=c(1)["default"];b.__esModule=!0;var i=c(4),j=c(6),k=h(j),l=c(5),m=c(53),n=h(m);e.prototype={nameLookup:function(a,b){return this.internalNameLookup(a,b)},depthedLookup:function(a){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(a),")"]},compilerInfo:function(){var a=i.COMPILER_REVISION,b=i.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return l.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(a,b){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",a,",",JSON.stringify(b),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||a.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;h<i;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new k["default"]("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),";\n"]), 61773this.decorators.push("return fn;"),d?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var j=this.createFunctionContext(d);if(this.isChild)return j;var l={compiler:this.compilerInfo(),main:j};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var m=this.context,n=m.programs,o=m.decorators;for(h=0,i=n.length;h<i;h++)n[h]&&(l[h]=n[h],o[h]&&(l[h+"_d"]=o[h],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new n["default"](this.options.srcName),this.decorators=new n["default"](this.options.srcName)},createFunctionContext:function(a){var b=this,c="",d=this.stackVars.concat(this.registers.list);d.length>0&&(c+=", "+d.join(", "));var e=0;g(this.aliases).forEach(function(a){var d=b.aliases[a];d.children&&d.referenceCount>1&&(c+=", alias"+ ++e+"="+a,d.children[0]="alias"+e)}),this.lookupPropertyFunctionIsUsed&&(c+=", "+this.lookupPropertyFunctionVarDeclaration());var f=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&f.push("blockParams"),this.useDepths&&f.push("depths");var h=this.mergeSource(c);return a?(f.push(h),Function.apply(this,f)):this.source.wrap(["function(",f.join(","),") {\n ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\
61773n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(a){var b=this.aliasable("container.hooks.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("container.hooks.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,a));for(var h=b.length;c<h;c++)this.replaceStack(function(e){var f=g.nameLookup(e,b[c],a);return d?[" && ",f]:[" != null ? ",f," : ",e]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,b){var c=this.nameLookup("decorators",b,"decorator"),d=this.setupHelperArgs(b,a);this.decorators.push(["fn = ",this.decorators.functionCall(c,"",["fn","props","container",d])," || fn;"])},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=[];c&&f.push(e.name),f.push(d),this.options.strict||f.push(this.aliasable("container.hooks.helperMissing"));var g=["(",this.itemsSeparatedBy(f,"||"),")"],h=this.source.functionCall(g,"call",e.callParams);this.push(h)},itemsSeparatedBy:function(a,b){var c=[];c.push(a[0]);for(var d=1;d<a.length;d++)c.push(b,a[d]);return c},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",e.decorators="container.decorators",a?d.unshift(b):d.unshift(this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e),d.push(e),this.push(this.source.functionCall("container.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):"Sub
61773Expression"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:e,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;f<g;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);if(null==h){this.context.programs.push("");var i=this.context.programs.length;d.index=i,d.name="program"+i,this.context.programs[i]=e.compile(d,b,this.context,!this.precompile),this.context.decorators[i]=e.decorators,this.context.environments[i]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams,d.useDepths=this.useDepths,d.useBlockParams=this.useBlockParams}else d.index=h.index,d.name="program"+h.index,this.useDepths=this.useDepths||h.useDepths,this.useBlockParams=this.useBlockParams||h.useBlockParams}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;b<c;b++){var d=this.context.environments[b];if(d&&d.equals(a))return d}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"container.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof d||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,e=void 0,f=void 0;if(!this.isInline())throw new k["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)c=[g.value],b=["(",c],f=!0;else{e=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),e&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;b<c;b++){var e=a[b];if(e instanceof d)this.compileStack.push(e);else{var f=this.incrStack();this.pushSource([f," = ",e,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new k["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper"),g=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:d,paramsInit:e,name:f,callParams:[g].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=!c,i=void 0;h&&(c=[]),d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var j=this.popStack(),k=this.popStack();(k||j)&&(d.fn=k||"container.noop",d.inverse=j||"container.noop");for(var l=b;l--;)i=this.popStack(),c[l]=i,this.trackIds&&(g[l]=this.popStack()),this.stringParams&&(f[l]=this.popStack(),e[l]=this.popStack());return h&&(d.args=this.source.generateArray(c)),this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c);return e.loc=JSON.stringify(this.source.currentLocation),e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["o
61773ptions=",e]):c?(c.push(e),""):e}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=e.RESERVED_WORDS={},c=0,d=a.length;c<d;c++)b[a[c]]=!0}(),e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b,c){if(g.isArray(a)){for(var d=[],e=0,f=a.length;e<f;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}var f=c(13)["default"];b.__esModule=!0;var g=c(5),h=void 0;try{}catch(i){}h||(h=function(a,b,c,d){this.src="",d&&this.add(d)},h.prototype={add:function(a){g.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){g.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add([" ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;b<c;b++)a(this.source[b])},empty:function(){var a=this.currentLocation||{start:{}};return new h(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof h?a:(a=d(a,this,b),new h(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=this,c=[];f(a).forEach(function(e){var f=d(a[e],b);"undefined"!==f&&c.push([b.quotedString(e),":",f])});var e=this.generateList(c);
61773return e.prepend("{"),e.add("}"),e},generateList:function(a){for(var b=this.empty(),c=0,e=a.length;c<e;c++)c&&b.add(","),b.add(d(a[c],this));return b},generateArray:function(a){var b=this.generateList(a);return b.prepend("["),b.add("]"),b}},b["default"]=e,a.exports=b["default"]}])}); 61774/*! 61775 * Masonry PACKAGED v4.2.2 61776 * Cascading grid layout library 61777 * https://masonry.desandro.com 61778 * MIT License 61779 * by David DeSandro 61780 */ 61781 61782!(function(t, e) { 61783 "function" == typeof define && define.amd 61784 ? define("jquery-bridget/jquery-bridget", ["jquery"], function(i) { 61785 return e(t, i); 61786 }) 61787 : "object" == typeof module && module.exports 61788 ? (module.exports = e(t, require("jquery"))) 61789 : (t.jQueryBridget = e(t, t.jQuery)); 61790})(window, function(t, e) { 61791 "use strict"; 61792 function i(i, r, a) { 61793 function h(t, e, n) { 61794 var o, 61795 r = "$()." + i + '("' + e + '")'; 61796 return ( 61797 t.each(function(t, h) { 61798 var u = a.data(h, i); 61799 if (!u) 61800 return void s( 61801 i + " not initialized. Cannot call methods, i.e. " + r 61802 ); 61803 var d = u[e]; 61804 if (!d || "_" == e.charAt(0)) 61805 return void s(r + " is not a valid method"); 61806 var l = d.apply(u, n); 61807 o = void 0 === o ? l : o; 61808 }), 61809 void 0 !== o ? o : t 61810 ); 61811 } 61812 function u(t, e) { 61813 t.each(function(t, n) { 61814 var o = a.data(n, i); 61815 o ? (o.option(e), o._init()) : ((o = new r(n, e)), a.data(n, i, o)); 61816 }); 61817 } 61818 (a = a || e || t.jQuery), 61819 a && 61820 (r.prototype.option || 61821 (r.prototype.option = function(t) { 61822 a.isPlainObject(t) && 61823 (this.options = a.extend(!0, this.options, t)); 61824 }), 61825 (a.fn[i] = function(t) { 61826 if ("string" == typeof t) { 61827 var e = o.call(arguments, 1); 61828 return h(this, t, e); 61829 } 61830 return u(this, t), this; 61831 }), 61832 n(a)); 61833 } 61834 function n(t) { 61835 !t || (t && t.bridget) || (t.bridget = i); 61836 } 61837 var o = Array.prototype.slice, 61838 r = t.console, 61839 s = 61840 "undefined" == typeof r 61841 ? function() {} 61842 : function(t) { 61843 r.error(t); 61844 }; 61845 return n(e || t.jQuery), i; 61846}), 61847 (function(t, e) { 61848 "function" == typeof define && define.amd 61849 ? define("ev-emitter/ev-emitter", e) 61850 : "object" == typeof module && module.exports 61851 ? (module.exports = e()) 61852 : (t.EvEmitter = e()); 61853 })("undefined" != typeof window ? window : this, function() { 61854 function t() {} 61855 var e = t.prototype; 61856 return ( 61857 (e.on = function(t, e) { 61858 if (t && e) { 61859 var i = (this._events = this._events || {}), 61860 n = (i[t] = i[t] || []); 61861 return -1 == n.indexOf(e) && n.push(e), this; 61862 } 61863 }), 61864 (e.once = function(t, e) { 61865 if (t && e) { 61866 this.on(t, e); 61867 var i = (this._onceEvents = this._onceEvents || {}), 61868 n = (i[t] = i[t] || {}); 61869 return (n[e] = !0), this; 61870 } 61871 }), 61872 (e.off = function(t, e) { 61873 var i = this._events && this._events[t]; 61874 if (i && i.length) { 61875 var n = i.indexOf(e); 61876 return -1 != n && i.splice(n, 1), this; 61877 } 61878 }), 61879 (e.emitEvent = function(t, e) { 61880 var i = this._events && this._events[t]; 61881 if (i && i.length) { 61882 (i = i.slice(0)), (e = e || []); 61883 for ( 61884 var n = this._onceEvents && this._onceEvents[t], o = 0; 61885 o < i.length; 61886 o++ 61887 ) { 61888 var r = i[o], 61889 s = n && n[r]; 61890 s && (this.off(t, r), delete n[r]), r.apply(this, e); 61891 } 61892 return this; 61893 } 61894 }), 61895 (e.allOff = function() { 61896 delete this._events, delete this._onceEvents; 61897 }), 61898 t 61899 ); 61900 }), 61901 (function(t, e) { 61902 "function" == typeof define && define.amd 61903 ? define("get-size/get-size", e) 61904 : "object" == typeof module && module.exports 61905 ? (module.exports = e()) 61906 : (t.getSize = e()); 61907 })(window, function() { 61908 "use strict"; 61909 function t(t) { 61910 var e = parseFloat(t), 61911 i = -1 == t.indexOf("%") && !isNaN(e); 61912 return i && e; 61913 } 61914 function e() {} 61915 function i() { 61916 for ( 61917 var t = { 61918 width: 0, 61919 height: 0, 61920 innerWidth: 0, 61921 innerHeight: 0, 61922 outerWidth: 0, 61923 outerHeight: 0 61924 }, 61925 e = 0; 61926 u > e; 61927 e++ 61928 ) { 61929 var i = h[e]; 61930 t[i] = 0; 61931 } 61932 return t; 61933 } 61934 function n(t) { 61935 var e = getComputedStyle(t); 61936 return ( 61937 e || 61938 a( 61939 "Style returned " + 61940 e + 61941 ". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1" 61942 ), 61943 e 61944 ); 61945 } 61946 function o() { 61947 if (!d) { 61948 d = !0; 61949 var e = document.createElement("div"); 61950 (e.style.width = "200px"), 61951 (e.style.padding = "1px 2px 3px 4px"), 61952 (e.style.borderStyle = "solid"), 61953 (e.style.borderWidth = "1px 2px 3px 4px"), 61954 (e.style.boxSizing = "border-box"); 61955 var i = document.body || document.documentElement; 61956 i.appendChild(e); 61957 var o = n(e); 61958 (s = 200 == Math.round(t(o.width))), 61959 (r.isBoxSizeOuter = s), 61960 i.removeChild(e); 61961 } 61962 } 61963 function r(e) { 61964 if ( 61965 (o(), 61966 "string" == typeof e && (e = document.querySelector(e)), 61967 e && "object" == typeof e && e.nodeType) 61968 ) { 61969 var r = n(e); 61970 if ("none" == r.display) return i(); 61971 var a = {}; 61972 (a.width = e.offsetWidth), (a.height = e.offsetHeight); 61973 for ( 61974 var d = (a.isBorderBox = "border-box" == r.boxSizing), l = 0; 61975 u > l; 61976 l++ 61977 ) { 61978 var c = h[l], 61979 f = r[c], 61980 m = parseFloat(f); 61981 a[c] = isNaN(m) ? 0 : m; 61982 } 61983 var p = a.paddingLeft + a.paddingRight, 61984 g = a.paddingTop + a.paddingBottom, 61985 y = a.marginLeft + a.marginRight, 61986 v = a.marginTop + a.marginBottom, 61987 _ = a.borderLeftWidth + a.borderRightWidth, 61988 z = a.borderTopWidth + a.borderBottomWidth, 61989 E = d && s, 61990 b = t(r.width); 61991 b !== !1 && (a.width = b + (E ? 0 : p + _)); 61992 var x = t(r.height); 61993 return ( 61994 x !== !1 && (a.height = x + (E ? 0 : g + z)), 61995 (a.innerWidth = a.width - (p + _)), 61996 (a.innerHeight = a.height - (g + z)), 61997 (a.outerWidth = a.width + y), 61998 (a.outerHeight = a.height + v), 61999 a 62000 ); 62001 } 62002 } 62003 var s, 62004 a = 62005 "undefined" == typeof console 62006 ? e 62007 : function(t) { 62008 console.error(t); 62009 }, 62010 h = [ 62011 "paddingLeft", 62012 "paddingRight", 62013 "paddingTop", 62014 "paddingBottom", 62015 "marginLeft", 62016 "marginRight", 62017 "marginTop", 62018 "marginBottom", 62019 "borderLeftWidth", 62020 "borderRightWidth", 62021 "borderTopWidth", 62022 "borderBottomWidth" 62023 ], 62024 u = h.length, 62025 d = !1; 62026 return r; 62027 }), 62028 (function(t, e) { 62029 "use strict"; 62030 "function" == typeof define && define.amd 62031 ? define("desandro-matches-selector/matches-selector", e) 62032 : "object" == typeof module && module.exports 62033 ? (module.exports = e()) 62034 : (t.matchesSelector = e()); 62035 })(window, function() { 62036 "use strict"; 62037 var t = (function() { 62038 var t = window.Element.prototype; 62039 if (t.matches) return "matches"; 62040 if (t.matchesSelector) return "matchesSelector"; 62041 for (var e = ["webkit", "moz", "ms", "o"], i = 0; i < e.length; i++) { 62042 var n = e[i], 62043 o = n + "MatchesSelector"; 62044 if (t[o]) return o; 62045 } 62046 })(); 62047 return function(e, i) { 62048 return e[t](i); 62049 }; 62050 }), 62051 (function(t, e) { 62052 "function" == typeof define && define.amd 62053 ? define("fizzy-ui-utils/utils", [ 62054 "desandro-matches-selector/matches-selector" 62055 ], function(i) { 62056 return e(t, i); 62057 }) 62058 : "object" == typeof module && module.exports 62059 ? (module.exports = e(t, require("desandro-matches-selector"))) 62060 : (t.fizzyUIUtils = e(t, t.matchesSelector)); 62061 })(window, function(t, e) { 62062 var i = {}; 62063 (i.extend = function(t, e) { 62064 for (var i in e) t[i] = e[i]; 62065 return t; 62066 }), 62067 (i.modulo = function(t, e) { 62068 return ((t % e) + e) % e; 62069 }); 62070 var n = Array.prototype.slice; 62071 (i.makeArray = function(t) { 62072 if (Array.isArray(t)) return t; 62073 if (null === t || void 0 === t) return []; 62074 var e = "object" == typeof t && "number" == typeof t.length; 62075 return e ? n.call(t) : [t]; 62076 }), 62077 (i.removeFrom = function(t, e) { 62078 var i = t.indexOf(e); 62079 -1 != i && t.splice(i, 1); 62080 }), 62081 (i.getParent = function(t, i) { 62082 for (; t.parentNode && t != document.body; ) 62083 if (((t = t.parentNode), e(t, i))) return t; 62084 }), 62085 (i.getQueryElement = function(t) { 62086 return "string" == typeof t ? document.querySelector(t) : t; 62087 }), 62088 (i.handleEvent = function(t) { 62089 var e = "on" + t.type; 62090 this[e] && this[e](t); 62091 }), 62092 (i.filterFindElements = function(t, n) { 62093 t = i.makeArray(t); 62094 var o = []; 62095 return ( 62096 t.forEach(function(t) { 62097 if (t instanceof HTMLElement) { 62098 if (!n) return void o.push(t); 62099 e(t, n) && o.push(t); 62100 for (var i = t.querySelectorAll(n), r = 0; r < i.length; r++) 62101 o.push(i[r]); 62102 } 62103 }), 62104 o 62105 ); 62106 }), 62107 (i.debounceMethod = function(t, e, i) { 62108 i = i || 100; 62109 var n = t.prototype[e], 62110 o = e + "Timeout"; 62111 t.prototype[e] = function() { 62112 var t = this[o]; 62113 clearTimeout(t); 62114 var e = arguments, 62115 r = this; 62116 this[o] = setTimeout(function() { 62117 n.apply(r, e), delete r[o]; 62118 }, i); 62119 }; 62120 }), 62121 (i.docReady = function(t) { 62122 var e = document.readyState; 62123 "complete" == e || "interactive" == e 62124 ? setTimeout(t) 62125 : document.addEventListener("DOMContentLoaded", t); 62126 }), 62127 (i.toDashed = function(t) { 62128 return t 62129 .replace(/(.)([A-Z])/g, function(t, e, i) { 62130 return e + "-" + i; 62131 }) 62132 .toLowerCase(); 62133 }); 62134 var o = t.console; 62135 return ( 62136 (i.htmlInit = function(e, n) { 62137 i.docReady(function() { 62138 var r = i.toDashed(n), 62139 s = "data-" + r, 62140 a = document.querySelectorAll("[" + s + "]"), 62141 h = document.querySelectorAll(".js-" + r), 62142 u = i.makeArray(a).concat(i.makeArray(h)), 62143 d = s + "-options", 62144 l = t.jQuery; 62145 u.forEach(function(t) { 62146 var i, 62147 r = t.getAttribute(s) || t.getAttribute(d); 62148 try { 62149 i = r && JSON.parse(r); 62150 } catch (a) { 62151 return void ( 62152 o && 62153 o.error("Error parsing " + s + " on " + t.className + ": " + a) 62154 ); 62155 } 62156 var h = new e(t, i); 62157 l && l.data(t, n, h); 62158 }); 62159 }); 62160 }), 62161 i 62162 ); 62163 }), 62164 (function(t, e) { 62165 "function" == typeof define && define.amd 62166 ? define("outlayer/item", [ 62167 "ev-emitter/ev-emitter", 62168 "get-size/get-size" 62169 ], e) 62170 : "object" == typeof module && module.exports 62171 ? (module.exports = e(require("ev-emitter"), require("get-size"))) 62172 : ((t.Outlayer = {}), (t.Outlayer.Item = e(t.EvEmitter, t.getSize))); 62173 })(window, function(t, e) { 62174 "use strict"; 62175 function i(t) { 62176 for (var e in t) return !1; 62177 return (e = null), !0; 62178 } 62179 function n(t, e) { 62180 t && 62181 ((this.element = t), 62182 (this.layout = e), 62183 (this.position = { x: 0, y: 0 }), 62184 this._create()); 62185 } 62186 function o(t) { 62187 return t.replace(/([A-Z])/g, function(t) { 62188 return "-" + t.toLowerCase(); 62189 }); 62190 } 62191 var r = document.documentElement.style, 62192 s = "string" == typeof r.transition ? "transition" : "WebkitTransition", 62193 a = "string" == typeof r.transform ? "transform" : "WebkitTransform", 62194 h = { 62195 WebkitTransition: "webkitTransitionEnd", 62196 transition: "transitionend" 62197 }[s], 62198 u = { 62199 transform: a, 62200 transition: s, 62201 transitionDuration: s + "Duration", 62202 transitionProperty: s + "Property", 62203 transitionDelay: s + "Delay" 62204 }, 62205 d = (n.prototype = Object.create(t.prototype)); 62206 (d.constructor = n), 62207 (d._create = function() { 62208 (this._transn = { ingProperties: {}, clean: {}, onEnd: {} }), 62209 this.css({ position: "absolute" }); 62210 }), 62211 (d.handleEvent = function(t) { 62212 var e = "on" + t.type; 62213 this[e] && this[e](t); 62214 }), 62215 (d.getSize = function() { 62216 this.size = e(this.element); 62217 }), 62218 (d.css = function(t) { 62219 var e = this.element.style; 62220 for (var i in t) { 62221 var n = u[i] || i; 62222 e[n] = t[i]; 62223 } 62224 }), 62225 (d.getPosition = function() { 62226 var t = getComputedStyle(this.element), 62227 e = this.layout._getOption("originLeft"), 62228 i = this.layout._getOption("originTop"), 62229 n = t[e ? "left" : "right"], 62230 o = t[i ? "top" : "bottom"], 62231 r = parseFloat(n), 62232 s = parseFloat(o), 62233 a = this.layout.size; 62234 -1 != n.indexOf("%") && (r = (r / 100) * a.width), 62235 -1 != o.indexOf("%") && (s = (s / 100) * a.height), 62236 (r = isNaN(r) ? 0 : r),
62237 (s = isNaN(s) ? 0 : s), 62238 (r -= e ? a.paddingLeft : a.paddingRight), 62239 (s -= i ? a.paddingTop : a.paddingBottom), 62240 (this.position.x = r), 62241 (this.position.y = s); 62242 }), 62243 (d.layoutPosition = function() { 62244 var t = this.layout.size, 62245 e = {}, 62246 i = this.layout._getOption("originLeft"), 62247 n = this.layout._getOption("originTop"), 62248 o = i ? "paddingLeft" : "paddingRight", 62249 r = i ? "left" : "right", 62250 s = i ? "right" : "left", 62251 a = this.position.x + t[o]; 62252 (e[r] = this.getXValue(a)), (e[s] = ""); 62253 var h = n ? "paddingTop" : "paddingBottom", 62254 u = n ? "top" : "bottom", 62255 d = n ? "bottom" : "top", 62256 l = this.position.y + t[h]; 62257 (e[u] = this.getYValue(l)), 62258 (e[d] = ""), 62259 this.css(e), 62260 this.emitEvent("layout", [this]); 62261 }), 62262 (d.getXValue = function(t) { 62263 var e = this.layout._getOption("horizontal"); 62264 return this.layout.options.percentPosition && !e 62265 ? (t / this.layout.size.width) * 100 + "%" 62266 : t + "px"; 62267 }), 62268 (d.getYValue = function(t) { 62269 var e = this.layout._getOption("horizontal"); 62270 return this.layout.options.percentPosition && e 62271 ? (t / this.layout.size.height) * 100 + "%" 62272 : t + "px"; 62273 }), 62274 (d._transitionTo = function(t, e) { 62275 this.getPosition(); 62276 var i = this.position.x, 62277 n = this.position.y, 62278 o = t == this.position.x && e == this.position.y; 62279 if ((this.setPosition(t, e), o && !this.isTransitioning)) 62280 return void this.layoutPosition(); 62281 var r = t - i, 62282 s = e - n, 62283 a = {}; 62284 (a.transform = this.getTranslate(r, s)), 62285 this.transition({ 62286 to: a, 62287 onTransitionEnd: { transform: this.layoutPosition }, 62288 isCleaning: !0 62289 }); 62290 }), 62291 (d.getTranslate = function(t, e) { 62292 var i = this.layout._getOption("originLeft"), 62293 n = this.layout._getOption("originTop"); 62294 return ( 62295 (t = i ? t : -t), 62296 (e = n ? e : -e), 62297 "translate3d(" + t + "px, " + e + "px, 0)" 62298 ); 62299 }), 62300 (d.goTo = function(t, e) { 62301 this.setPosition(t, e), this.layoutPosition(); 62302 }), 62303 (d.moveTo = d._transitionTo), 62304 (d.setPosition = function(t, e) { 62305 (this.position.x = parseFloat(t)), (this.position.y = parseFloat(e)); 62306 }), 62307 (d._nonTransition = function(t) { 62308 this.css(t.to), t.isCleaning && this._removeStyles(t.to); 62309 for (var e in t.onTransitionEnd) t.onTransitionEnd[e].call(this); 62310 }), 62311 (d.transition = function(t) { 62312 if (!parseFloat(this.layout.options.transitionDuration)) 62313 return void this._nonTransition(t); 62314 var e = this._transn; 62315 for (var i in t.onTransitionEnd) e.onEnd[i] = t.onTransitionEnd[i]; 62316 for (i in t.to) 62317 (e.ingProperties[i] = !0), t.isCleaning && (e.clean[i] = !0); 62318 if (t.from) { 62319 this.css(t.from); 62320 var n = this.element.offsetHeight; 62321 n = null; 62322 } 62323 this.enableTransition(t.to), 62324 this.css(t.to), 62325 (this.isTransitioning = !0); 62326 }); 62327 var l = "opacity," + o(a); 62328 (d.enableTransition = function() { 62329 if (!this.isTransitioning) { 62330 var t = this.layout.options.transitionDuration; 62331 (t = "number" == typeof t ? t + "ms" : t), 62332 this.css({ 62333 transitionProperty: l, 62334 transitionDuration: t, 62335 transitionDelay: this.staggerDelay || 0 62336 }), 62337 this.element.addEventListener(h, this, !1); 62338 } 62339 }), 62340 (d.onwebkitTransitionEnd = function(t) { 62341 this.ontransitionend(t); 62342 }), 62343 (d.onotransitionend = function(t) { 62344 this.ontransitionend(t); 62345 }); 62346 var c = { "-webkit-transform": "transform" }; 62347 (d.ontransitionend = function(t) { 62348 if (t.target === this.element) { 62349 var e = this._transn, 62350 n = c[t.propertyName] || t.propertyName; 62351 if ( 62352 (delete e.ingProperties[n], 62353 i(e.ingProperties) && this.disableTransition(), 62354 n in e.clean && 62355 ((this.element.style[t.propertyName] = ""), delete e.clean[n]), 62356 n in e.onEnd) 62357 ) { 62358 var o = e.onEnd[n]; 62359 o.call(this), delete e.onEnd[n]; 62360 } 62361 this.emitEvent("transitionEnd", [this]); 62362 } 62363 }), 62364 (d.disableTransition = function() { 62365 this.removeTransitionStyles(), 62366 this.element.removeEventListener(h, this, !1), 62367 (this.isTransitioning = !1); 62368 }), 62369 (d._removeStyles = function(t) { 62370 var e = {}; 62371 for (var i in t) e[i] = ""; 62372 this.css(e); 62373 }); 62374 var f = { 62375 transitionProperty: "", 62376 transitionDuration: "", 62377 transitionDelay: "" 62378 }; 62379 return ( 62380 (d.removeTransitionStyles = function() { 62381 this.css(f); 62382 }), 62383 (d.stagger = function(t) { 62384 (t = isNaN(t) ? 0 : t), (this.staggerDelay = t + "ms"); 62385 }), 62386 (d.removeElem = function() { 62387 this.element.parentNode.removeChild(this.element), 62388 this.css({ display: "" }), 62389 this.emitEvent("remove", [this]); 62390 }), 62391 (d.remove = function() { 62392 return s && parseFloat(this.layout.options.transitionDuration) 62393 ? (this.once("transitionEnd", function() { 62394 this.removeElem(); 62395 }), 62396 void this.hide()) 62397 : void this.removeElem(); 62398 }), 62399 (d.reveal = function() { 62400 delete this.isHidden, this.css({ display: "" }); 62401 var t = this.layout.options, 62402 e = {}, 62403 i = this.getHideRevealTransitionEndProperty("visibleStyle"); 62404 (e[i] = this.onRevealTransitionEnd), 62405 this.transition({ 62406 from: t.hiddenStyle, 62407 to: t.visibleStyle, 62408 isCleaning: !0, 62409 onTransitionEnd: e 62410 }); 62411 }), 62412 (d.onRevealTransitionEnd = function() { 62413 this.isHidden || this.emitEvent("reveal"); 62414 }), 62415 (d.getHideRevealTransitionEndProperty = function(t) { 62416 var e = this.layout.options[t]; 62417 if (e.opacity) return "opacity"; 62418 for (var i in e) return i; 62419 }), 62420 (d.hide = function() { 62421 (this.isHidden = !0), this.css({ display: "" }); 62422 var t = this.layout.options, 62423 e = {}, 62424 i = this.getHideRevealTransitionEndProperty("hiddenStyle"); 62425 (e[i] = this.onHideTransitionEnd), 62426 this.transition({ 62427 from: t.visibleStyle, 62428 to: t.hiddenStyle, 62429 isCleaning: !0, 62430 onTransitionEnd: e 62431 }); 62432 }), 62433 (d.onHideTransitionEnd = function() { 62434 this.isHidden && 62435 (this.css({ display: "none" }), this.emitEvent("hide")); 62436 }), 62437 (d.destroy = function() { 62438 this.css({ 62439 position: "", 62440 left: "", 62441 right: "", 62442 top: "", 62443 bottom: "", 62444 transition: "", 62445 transform: "" 62446 }); 62447 }), 62448 n 62449 ); 62450 }), 62451 (function(t, e) { 62452 "use strict"; 62453 "function" == typeof define && define.amd 62454 ? define("outlayer/outlayer", [ 62455 "ev-emitter/ev-emitter", 62456 "get-size/get-size", 62457 "fizzy-ui-utils/utils", 62458 "./item" 62459 ], function(i, n, o, r) { 62460 return e(t, i, n, o, r); 62461 }) 62462 : "object" == typeof module && module.exports 62463 ? (module.exports = e( 62464 t, 62465 require("ev-emitter"), 62466 require("get-size"), 62467 require("fizzy-ui-utils"), 62468 require("./item") 62469 )) 62470 : (t.Outlayer = e( 62471 t, 62472 t.EvEmitter, 62473 t.getSize, 62474 t.fizzyUIUtils, 62475 t.Outlayer.Item 62476 )); 62477 })(window, function(t, e, i, n, o) { 62478 "use strict"; 62479 function r(t, e) { 62480 var i = n.getQueryElement(t); 62481 if (!i) 62482 return void ( 62483 h && 62484 h.error( 62485 "Bad element for " + this.constructor.namespace + ": " + (i || t) 62486 ) 62487 ); 62488 (this.element = i), 62489 u && (this.$element = u(this.element)), 62490 (this.options = n.extend({}, this.constructor.defaults)), 62491 this.option(e); 62492 var o = ++l; 62493 (this.element.outlayerGUID = o), (c[o] = this), this._create(); 62494 var r = this._getOption("initLayout"); 62495 r && this.layout(); 62496 } 62497 function s(t) { 62498 function e() { 62499 t.apply(this, arguments); 62500 } 62501 return ( 62502 (e.prototype = Object.create(t.prototype)), 62503 (e.prototype.constructor = e), 62504 e 62505 ); 62506 } 62507 function a(t) { 62508 if ("number" == typeof t) return t; 62509 var e = t.match(/(^\d*\.?\d*)(\w*)/), 62510 i = e && e[1], 62511 n = e && e[2]; 62512 if (!i.length) return 0; 62513 i = parseFloat(i); 62514 var o = m[n] || 1; 62515 return i * o; 62516 } 62517 var h = t.console, 62518 u = t.jQuery, 62519 d = function() {}, 62520 l = 0, 62521 c = {}; 62522 (r.namespace = "outlayer"), 62523 (r.Item = o), 62524 (r.defaults = { 62525 containerStyle: { position: "relative" }, 62526 initLayout: !0, 62527 originLeft: !0, 62528 originTop: !0, 62529 resize: !0, 62530 resizeContainer: !0, 62531 transitionDuration: "0.4s", 62532 hiddenStyle: { opacity: 0, transform: "scale(0.001)" }, 62533 visibleStyle: { opacity: 1, transform: "scale(1)" } 62534 }); 62535 var f = r.prototype; 62536 n.extend(f, e.prototype), 62537 (f.option = function(t) { 62538 n.extend(this.options, t); 62539 }), 62540 (f._getOption = function(t) { 62541 var e = this.constructor.compatOptions[t]; 62542 return e && void 0 !== this.options[e] 62543 ? this.options[e] 62544 : this.options[t]; 62545 }), 62546 (r.compatOptions = { 62547 initLayout: "isInitLayout", 62548 horizontal: "isHorizontal", 62549 layoutInstant: "isLayoutInstant", 62550 originLeft: "isOriginLeft", 62551 originTop: "isOriginTop", 62552 resize: "isResizeBound", 62553 resizeContainer: "isResizingContainer" 62554 }), 62555 (f._create = function() { 62556 this.reloadItems(), 62557 (this.stamps = []), 62558 this.stamp(this.options.stamp), 62559 n.extend(this.element.style, this.options.containerStyle); 62560 var t = this._getOption("resize"); 62561 t && this.bindResize(); 62562 }), 62563 (f.reloadItems = function() { 62564 this.items = this._itemize(this.element.children); 62565 }), 62566 (f._itemize = function(t) { 62567 for ( 62568 var e = this._filterFindItemElements(t), 62569 i = this.constructor.Item, 62570 n = [], 62571 o = 0; 62572 o < e.length; 62573 o++ 62574 ) { 62575 var r = e[o], 62576 s = new i(r, this); 62577 n.push(s); 62578 } 62579 return n; 62580 }), 62581 (f._filterFindItemElements = function(t) { 62582 return n.filterFindElements(t, this.options.itemSelector); 62583 }), 62584 (f.getItemElements = function() { 62585 return this.items.map(function(t) { 62586 return t.element; 62587 }); 62588 }), 62589 (f.layout = function() { 62590 this._resetLayout(), this._manageStamps(); 62591 var t = this._getOption("layoutInstant"), 62592 e = void 0 !== t ? t : !this._isLayoutInited; 62593 this.layoutItems(this.items, e), (this._isLayoutInited = !0); 62594 }), 62595 (f._init = f.layout), 62596 (f._resetLayout = function() {
62597 this.getSize(); 62598 }), 62599 (f.getSize = function() { 62600 this.size = i(this.element); 62601 }), 62602 (f._getMeasurement = function(t, e) { 62603 var n, 62604 o = this.options[t]; 62605 o 62606 ? ("string" == typeof o 62607 ? (n = this.element.querySelector(o)) 62608 : o instanceof HTMLElement && (n = o), 62609 (this[t] = n ? i(n)[e] : o)) 62610 : (this[t] = 0); 62611 }), 62612 (f.layoutItems = function(t, e) { 62613 (t = this._getItemsForLayout(t)), 62614 this._layoutItems(t, e), 62615 this._postLayout(); 62616 }), 62617 (f._getItemsForLayout = function(t) { 62618 return t.filter(function(t) { 62619 return !t.isIgnored; 62620 }); 62621 }), 62622 (f._layoutItems = function(t, e) { 62623 if ((this._emitCompleteOnItems("layout", t), t && t.length)) { 62624 var i = []; 62625 t.forEach(function(t) { 62626 var n = this._getItemLayoutPosition(t); 62627 (n.item = t), (n.isInstant = e || t.isLayoutInstant), i.push(n); 62628 }, this), 62629 this._processLayoutQueue(i); 62630 } 62631 }), 62632 (f._getItemLayoutPosition = function() { 62633 return { x: 0, y: 0 }; 62634 }), 62635 (f._processLayoutQueue = function(t) { 62636 this.updateStagger(), 62637 t.forEach(function(t, e) { 62638 this._positionItem(t.item, t.x, t.y, t.isInstant, e); 62639 }, this); 62640 }), 62641 (f.updateStagger = function() { 62642 var t = this.options.stagger; 62643 return null === t || void 0 === t 62644 ? void (this.stagger = 0) 62645 : ((this.stagger = a(t)), this.stagger); 62646 }), 62647 (f._positionItem = function(t, e, i, n, o) { 62648 n ? t.goTo(e, i) : (t.stagger(o * this.stagger), t.moveTo(e, i)); 62649 }), 62650 (f._postLayout = function() { 62651 this.resizeContainer(); 62652 }), 62653 (f.resizeContainer = function() { 62654 var t = this._getOption("resizeContainer"); 62655 if (t) { 62656 var e = this._getContainerSize(); 62657 e && 62658 (this._setContainerMeasure(e.width, !0), 62659 this._setContainerMeasure(e.height, !1)); 62660 } 62661 }), 62662 (f._getContainerSize = d), 62663 (f._setContainerMeasure = function(t, e) { 62664 if (void 0 !== t) { 62665 var i = this.size; 62666 i.isBorderBox && 62667 (t += e 62668 ? i.paddingLeft + 62669 i.paddingRight + 62670 i.borderLeftWidth + 62671 i.borderRightWidth 62672 : i.paddingBottom + 62673 i.paddingTop + 62674 i.borderTopWidth + 62675 i.borderBottomWidth), 62676 (t = Math.max(t, 0)), 62677 (this.element.style[e ? "width" : "height"] = t + "px"); 62678 } 62679 }), 62680 (f._emitCompleteOnItems = function(t, e) { 62681 function i() { 62682 o.dispatchEvent(t + "Complete", null, [e]); 62683 } 62684 function n() { 62685 s++, s == r && i(); 62686 } 62687 var o = this, 62688 r = e.length; 62689 if (!e || !r) return void i(); 62690 var s = 0; 62691 e.forEach(function(e) { 62692 e.once(t, n); 62693 }); 62694 }), 62695 (f.dispatchEvent = function(t, e, i) { 62696 var n = e ? [e].concat(i) : i; 62697 if ((this.emitEvent(t, n), u)) 62698 if (((this.$element = this.$element || u(this.element)), e)) { 62699 var o = u.Event(e); 62700 (o.type = t), this.$element.trigger(o, i); 62701 } else this.$element.trigger(t, i); 62702 }), 62703 (f.ignore = function(t) { 62704 var e = this.getItem(t); 62705 e && (e.isIgnored = !0); 62706 }), 62707 (f.unignore = function(t) { 62708 var e = this.getItem(t); 62709 e && delete e.isIgnored; 62710 }), 62711 (f.stamp = function(t) { 62712 (t = this._find(t)), 62713 t && 62714 ((this.stamps = this.stamps.concat(t)), 62715 t.forEach(this.ignore, this)); 62716 }), 62717 (f.unstamp = function(t) { 62718 (t = this._find(t)), 62719 t && 62720 t.forEach(function(t) { 62721 n.removeFrom(this.stamps, t), this.unignore(t); 62722 }, this); 62723 }), 62724 (f._find = function(t) { 62725 return t 62726 ? ("string" == typeof t && (t = this.element.querySelectorAll(t)), 62727 (t = n.makeArray(t))) 62728 : void 0; 62729 }), 62730 (f._manageStamps = function() { 62731 this.stamps && 62732 this.stamps.length &&
62733 (this._getBoundingRect(), 62734 this.stamps.forEach(this._manageStamp, this)); 62735 }), 62736 (f._getBoundingRect = function() { 62737 var t = this.element.getBoundingClientRect(), 62738 e = this.size; 62739 this._boundingRect = { 62740 left: t.left + e.paddingLeft + e.borderLeftWidth, 62741 top: t.top + e.paddingTop + e.borderTopWidth, 62742 right: t.right - (e.paddingRight + e.borderRightWidth), 62743 bottom: t.bottom - (e.paddingBottom + e.borderBottomWidth) 62744 }; 62745 }), 62746 (f._manageStamp = d), 62747 (f._getElementOffset = function(t) { 62748 var e = t.getBoundingClientRect(), 62749 n = this._boundingRect, 62750 o = i(t), 62751 r = { 62752 left: e.left - n.left - o.marginLeft, 62753 top: e.top - n.top - o.marginTop, 62754 right: n.right - e.right - o.marginRight, 62755 bottom: n.bottom - e.bottom - o.marginBottom 62756 }; 62757 return r; 62758 }), 62759 (f.handleEvent = n.handleEvent), 62760 (f.bindResize = function() { 62761 t.addEventListener("resize", this), (this.isResizeBound = !0); 62762 }), 62763 (f.unbindResize = function() { 62764 t.removeEventListener("resize", this), (this.isResizeBound = !1); 62765 }), 62766 (f.onresize = function() { 62767 this.resize(); 62768 }), 62769 n.debounceMethod(r, "onresize", 100), 62770 (f.resize = function() { 62771 this.isResizeBound && this.needsResizeLayout() && this.layout(); 62772 }), 62773 (f.needsResizeLayout = function() { 62774 var t = i(this.element), 62775 e = this.size && t; 62776 return e && t.innerWidth !== this.size.innerWidth; 62777 }), 62778 (f.addItems = function(t) { 62779 var e = this._itemize(t); 62780 return e.length && (this.items = this.items.concat(e)), e; 62781 }), 62782 (f.appended = function(t) { 62783 var e = this.addItems(t); 62784 e.length && (this.layoutItems(e, !0), this.reveal(e)); 62785 }), 62786 (f.prepended = function(t) { 62787 var e = this._itemize(t); 62788 if (e.length) { 62789 var i = this.items.slice(0); 62790 (this.items = e.concat(i)), 62791 this._resetLayout(), 62792 this._manageStamps(), 62793 this.layoutItems(e, !0), 62794 this.reveal(e), 62795 this.layoutItems(i); 62796 } 62797 }), 62798 (f.reveal = function(t) { 62799 if ((this._emitCompleteOnItems("reveal", t), t && t.length)) { 62800 var e = this.updateStagger(); 62801 t.forEach(function(t, i) { 62802 t.stagger(i * e), t.reveal(); 62803 }); 62804 } 62805 }), 62806 (f.hide = function(t) { 62807 if ((this._emitCompleteOnItems("hide", t), t && t.length)) { 62808 var e = this.updateStagger(); 62809 t.forEach(function(t, i) { 62810 t.stagger(i * e), t.hide(); 62811 }); 62812 } 62813 }), 62814 (f.revealItemElements = function(t) { 62815 var e = this.getItems(t); 62816 this.reveal(e); 62817 }), 62818 (f.hideItemElements = function(t) { 62819 var e = this.getItems(t); 62820 this.hide(e); 62821 }), 62822 (f.getItem = function(t) { 62823 for (var e = 0; e < this.items.length; e++) { 62824 var i = this.items[e]; 62825 if (i.element == t) return i; 62826 } 62827 }), 62828 (f.getItems = function(t) { 62829 t = n.makeArray(t); 62830 var e = []; 62831 return ( 62832 t.forEach(function(t) { 62833 var i = this.getItem(t); 62834 i && e.push(i); 62835 }, this), 62836 e 62837 ); 62838 }), 62839 (f.remove = function(t) { 62840 var e = this.getItems(t); 62841 this._emitCompleteOnItems("remove", e), 62842 e && 62843 e.length && 62844 e.forEach(function(t) { 62845 t.remove(), n.removeFrom(this.items, t); 62846 }, this); 62847 }), 62848 (f.destroy = function() { 62849 var t = this.element.style; 62850 (t.height = ""), 62851 (t.position = ""), 62852 (t.width = ""), 62853 this.items.forEach(function(t) { 62854 t.destroy(); 62855 }), 62856 this.unbindResize(); 62857 var e = this.element.outlayerGUID; 62858 delete c[e], 62859 delete this.element.outlayerGUID, 62860 u && u.removeData(this.element, this.constructor.namespace); 62861 }), 62862 (r.data = function(t) { 62863 t = n.getQueryElement(t); 62864 var e = t && t.outlayerGUID; 62865 return e && c[e]; 62866 }), 62867 (r.create = function(t, e) { 62868 var i = s(r); 62869 return ( 62870 (i.defaults = n.extend({}, r.defaults)), 62871 n.extend(i.defaults, e), 62872 (i.compatOptions = n.extend({}, r.compatOptions)), 62873 (i.namespace = t), 62874 (i.data = r.data), 62875 (i.Item = s(o)), 62876 n.htmlInit(i, t), 62877 u && u.bridget && u.bridget(t, i), 62878 i 62879 ); 62880 }); 62881 var m = { ms: 1, s: 1e3 }; 62882 return (r.Item = o), r; 62883 }), 62884 (function(t, e) { 62885 "function" == typeof define && define.amd 62886 ? define(["outlayer/outlayer", "get-size/get-size"], e) 62887 : "object" == typeof module && module.exports 62888 ? (module.exports = e(require("outlayer"), require("get-size"))) 62889 : (t.Masonry = e(t.Outlayer, t.getSize)); 62890 })(window, function(t, e) { 62891 var i = t.create("masonry"); 62892 i.compatOptions.fitWidth = "isFitWidth"; 62893 var n = i.prototype; 62894 return ( 62895 (n._resetLayout = function() {
62896 this.getSize(), 62897 this._getMeasurement("columnWidth", "outerWidth"), 62898 this._getMeasurement("gutter", "outerWidth"), 62899 this.measureColumns(), 62900 (this.colYs = []); 62901 for (var t = 0; t < this.cols; t++) this.colYs.push(0); 62902 (this.maxY = 0), (this.horizontalColIndex = 0); 62903 }), 62904 (n.measureColumns = function() { 62905 if ((this.getContainerWidth(), !this.columnWidth)) { 62906 var t = this.items[0], 62907 i = t && t.element; 62908 this.columnWidth = (i && e(i).outerWidth) || this.containerWidth; 62909 } 62910 var n = (this.columnWidth += this.gutter), 62911 o = this.containerWidth + this.gutter, 62912 r = o / n, 62913 s = n - (o % n), 62914 a = s && 1 > s ? "round" : "floor"; 62915 (r = Math[a](r)), (this.cols = Math.max(r, 1)); 62916 }), 62917 (n.getContainerWidth = function() { 62918 var t = this._getOption("fitWidth"), 62919 i = t ? this.element.parentNode : this.element, 62920 n = e(i); 62921 this.containerWidth = n && n.innerWidth; 62922 }), 62923 (n._getItemLayoutPosition = function(t) { 62924 t.getSize(); 62925 var e = t.size.outerWidth % this.columnWidth, 62926 i = e && 1 > e ? "round" : "ceil", 62927 n = Math[i](t.size.outerWidth / this.columnWidth); 62928 n = Math.min(n, this.cols); 62929 for ( 62930 var o = this.options.horizontalOrder 62931 ? "_getHorizontalColPosition" 62932 : "_getTopColPosition", 62933 r = this[o](n, t), 62934 s = { x: this.columnWidth * r.col, y: r.y }, 62935 a = r.y + t.size.outerHeight, 62936 h = n + r.col, 62937 u = r.col; 62938 h > u; 62939 u++ 62940 ) 62941 this.colYs[u] = a; 62942 return s; 62943 }), 62944 (n._getTopColPosition = function(t) { 62945 var e = this._getTopColGroup(t), 62946 i = Math.min.apply(Math, e); 62947 return { col: e.indexOf(i), y: i }; 62948 }), 62949 (n._getTopColGroup = function(t) { 62950 if (2 > t) return this.colYs; 62951 for (var e = [], i = this.cols + 1 - t, n = 0; i > n; n++) 62952 e[n] = this._getColGroupY(n, t); 62953 return e; 62954 }), 62955 (n._getColGroupY = function(t, e) { 62956 if (2 > e) return this.colYs[t]; 62957 var i = this.colYs.slice(t, t + e); 62958 return Math.max.apply(Math, i); 62959 }), 62960 (n._getHorizontalColPosition = function(t, e) { 62961 var i = this.horizontalColIndex % this.cols, 62962 n = t > 1 && i + t > this.cols; 62963 i = n ? 0 : i; 62964 var o = e.size.outerWidth && e.size.outerHeight; 62965 return ( 62966 (this.horizontalColIndex = o ? i + t : this.horizontalColIndex), 62967 { col: i, y: this._getColGroupY(i, t) } 62968 ); 62969 }), 62970 (n._manageStamp = function(t) { 62971 var i = e(t), 62972 n = this._getElementOffset(t), 62973 o = this._getOption("originLeft"), 62974 r = o ? n.left : n.right, 62975 s = r + i.outerWidth, 62976 a = Math.floor(r / this.columnWidth); 62977 a = Math.max(0, a); 62978 var h = Math.floor(s / this.columnWidth); 62979 (h -= s % this.columnWidth ? 0 : 1), (h = Math.min(this.cols - 1, h)); 62980 for ( 62981 var u = this._getOption("originTop"), 62982 d = (u ? n.top : n.bottom) + i.outerHeight, 62983 l = a; 62984 h >= l; 62985 l++ 62986 ) 62987 this.colYs[l] = Math.max(d, this.colYs[l]); 62988 }), 62989 (n._getContainerSize = function() { 62990 this.maxY = Math.max.apply(Math, this.colYs); 62991 var t = { height: this.maxY }; 62992 return ( 62993 this._getOption("fitWidth") && 62994 (t.width = this._getContainerFitWidth()), 62995 t 62996 ); 62997 }), 62998 (n._getContainerFitWidth = function() { 62999 for (var t = 0, e = this.cols; --e && 0 === this.colYs[e]; ) t++; 63000 return (this.cols - t) * this.columnWidth - this.gutter; 63001 }), 63002 (n.needsResizeLayout = function() { 63003 var t = this.containerWidth; 63004 return this.getContainerWidth(), t != this.containerWidth; 63005 }), 63006 i 63007 ); 63008 }); 63009 63010/*! 63011 * imagesLoaded PACKAGED v4.1.4 63012 * JavaScript is all like "You images are done yet or what?" 63013 * MIT License 63014 */ 63015 63016!(function(e, t) { 63017 "function" == typeof define && define.amd 63018 ? define("ev-emitter/ev-emitter", t) 63019 : "object" == typeof module && module.exports 63020 ? (module.exports = t()) 63021 : (e.EvEmitter = t()); 63022})("undefined" != typeof window ? window : this, function() { 63023 function e() {} 63024 var t = e.prototype; 63025 return ( 63026 (t.on = function(e, t) { 63027 if (e && t) { 63028 var i = (this._events = this._events || {}), 63029 n = (i[e] = i[e] || []); 63030 return n.indexOf(t) == -1 && n.push(t), this; 63031 } 63032 }), 63033 (t.once = function(e, t) { 63034 if (e && t) { 63035 this.on(e, t); 63036 var i = (this._onceEvents = this._onceEvents || {}), 63037 n = (i[e] = i[e] || {}); 63038 return (n[t] = !0), this; 63039 } 63040 }), 63041 (t.off = function(e, t) { 63042 var i = this._events && this._events[e]; 63043 if (i && i.length) { 63044 var n = i.indexOf(t); 63045 return n != -1 && i.splice(n, 1), this; 63046 } 63047 }), 63048 (t.emitEvent = function(e, t) { 63049 var i = this._events && this._events[e]; 63050 if (i && i.length) { 63051 (i = i.slice(0)), (t = t || []); 63052 for ( 63053 var n = this._onceEvents && this._onceEvents[e], o = 0; 63054 o < i.length; 63055 o++ 63056 ) { 63057 var r = i[o], 63058 s = n && n[r]; 63059 s && (this.off(e, r), delete n[r]), r.apply(this, t); 63060 } 63061 return this; 63062 } 63063 }), 63064 (t.allOff = function() { 63065 delete this._events, delete this._onceEvents; 63066 }), 63067 e 63068 ); 63069}), 63070 (function(e, t) { 63071 "use strict"; 63072 "function" == typeof define && define.amd 63073 ? define(["ev-emitter/ev-emitter"], function(i) { 63074 return t(e, i); 63075 }) 63076 : "object" == typeof module && module.exports 63077 ? (module.exports = t(e, require("ev-emitter"))) 63078 : (e.imagesLoaded = t(e, e.EvEmitter)); 63079 })("undefined" != typeof window ? window : this, function(e, t) { 63080 function i(e, t) { 63081 for (var i in t) e[i] = t[i]; 63082 return e; 63083 } 63084 function n(e) { 63085 if (Array.isArray(e)) return e; 63086 var t = "object" == typeof e && "number" == typeof e.length; 63087 return t ? d.call(e) : [e]; 63088 } 63089 function o(e, t, r) { 63090 if (!(this instanceof o)) return new o(e, t, r); 63091 var s = e; 63092 return ( 63093 "string" == typeof e && (s = document.querySelectorAll(e)), 63094 s 63095 ? ((this.elements = n(s)), 63096 (this.options = i({}, this.options)), 63097 "function" == typeof t ? (r = t) : i(this.options, t), 63098 r && this.on("always", r), 63099 this.getImages(), 63100 h && (this.jqDeferred = new h.Deferred()), 63101 void setTimeout(this.check.bind(this))) 63102 : void a.error("Bad element for imagesLoaded " + (s || e)) 63103 ); 63104 } 63105 function r(e) { 63106 this.img = e; 63107 } 63108 function s(e, t) { 63109 (this.url = e), (this.element = t), (this.img = new Image()); 63110 } 63111 var h = e.jQuery, 63112 a = e.console, 63113 d = Array.prototype.slice; 63114 (o.prototype = Object.create(t.prototype)), 63115 (o.prototype.options = {}), 63116 (o.prototype.getImages = function() {
63117 (this.images = []), this.elements.forEach(this.addElementImages, this); 63118 }), 63119 (o.prototype.addElementImages = function(e) { 63120 "IMG" == e.nodeName && this.addImage(e), 63121 this.options.background === !0 && this.addElementBackgroundImages(e); 63122 var t = e.nodeType; 63123 if (t && u[t]) { 63124 for (var i = e.querySelectorAll("img"), n = 0; n < i.length; n++) { 63125 var o = i[n]; 63126 this.addImage(o); 63127 } 63128 if ("string" == typeof this.options.background) { 63129 var r = e.querySelectorAll(this.options.background); 63130 for (n = 0; n < r.length; n++) { 63131 var s = r[n]; 63132 this.addElementBackgroundImages(s); 63133 } 63134 } 63135 } 63136 }); 63137 var u = { 1: !0, 9: !0, 11: !0 }; 63138 return ( 63139 (o.prototype.addElementBackgroundImages = function(e) { 63140 var t = getComputedStyle(e); 63141 if (t) 63142 for ( 63143 var i = /url\((['"])?(.*?)\1\)/gi, n = i.exec(t.backgroundImage); 63144 null !== n; 63145 63146 ) { 63147 var o = n && n[2]; 63148 o && this.addBackground(o, e), (n = i.exec(t.backgroundImage)); 63149 } 63150 }), 63151 (o.prototype.addImage = function(e) { 63152 var t = new r(e); 63153 this.images.push(t); 63154 }), 63155 (o.prototype.addBackground = function(e, t) { 63156 var i = new s(e, t); 63157 this.images.push(i); 63158 }), 63159 (o.prototype.check = function() { 63160 function e(e, i, n) { 63161 setTimeout(function() { 63162 t.progress(e, i, n); 63163 }); 63164 } 63165 var t = this; 63166 return ( 63167 (this.progressedCount = 0), 63168 (this.hasAnyBroken = !1), 63169 this.images.length 63170 ? void this.images.forEach(function(t) { 63171 t.once("progress", e), t.check(); 63172 }) 63173 : void this.complete() 63174 ); 63175 }), 63176 (o.prototype.progress = function(e, t, i) { 63177 this.progressedCount++, 63178 (this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded), 63179 this.emitEvent("progress", [this, e, t]), 63180 this.jqDeferred && 63181 this.jqDeferred.notify && 63182 this.jqDeferred.notify(this, e), 63183 this.progressedCount == this.images.length && this.complete(), 63184 this.options.debug && a && a.log("progress: " + i, e, t); 63185 }), 63186 (o.prototype.complete = function() { 63187 var e = this.hasAnyBroken ? "fail" : "done"; 63188 if ( 63189 ((this.isComplete = !0), 63190 this.emitEvent(e, [this]), 63191 this.emitEvent("always", [this]), 63192 this.jqDeferred) 63193 ) { 63194 var t = this.hasAnyBroken ? "reject" : "resolve"; 63195 this.jqDeferred[t](this); 63196 } 63197 }), 63198 (r.prototype = Object.create(t.prototype)), 63199 (r.prototype.check = function() { 63200 var e = this.getIsImageComplete(); 63201 return e 63202 ? void this.confirm(0 !== this.img.naturalWidth, "naturalWidth") 63203 : ((this.proxyImage = new Image()), 63204 this.proxyImage.addEventListener("load", this), 63205 this.proxyImage.addEventListener("error", this), 63206 this.img.addEventListener("load", this), 63207 this.img.addEventListener("error", this), 63208 void (this.proxyImage.src = this.img.src)); 63209 }), 63210 (r.prototype.getIsImageComplete = function() { 63211 return this.img.complete && this.img.naturalWidth; 63212 }), 63213 (r.prototype.confirm = function(e, t) { 63214 (this.isLoaded = e), this.emitEvent("progress", [this, this.img, t]); 63215 }), 63216 (r.prototype.handleEvent = function(e) { 63217 var t = "on" + e.type; 63218 this[t] && this[t](e); 63219 }), 63220 (r.prototype.onload = function() { 63221 this.confirm(!0, "onload"), this.unbindEvents(); 63222 }), 63223 (r.prototype.onerror = function() { 63224 this.confirm(!1, "onerror"), this.unbindEvents(); 63225 }), 63226 (r.prototype.unbindEvents = function() { 63227 this.proxyImage.removeEventListener("load", this), 63228 this.proxyImage.removeEventListener("error", this), 63229 this.img.removeEventListener("load", this), 63230 this.img.removeEventListener("error", this); 63231 }), 63232 (s.prototype = Object.create(r.prototype)),
63233 (s.prototype.check = function() { 63234 this.img.addEventListener("load", this), 63235 this.img.addEventListener("error", this), 63236 (this.img.src = this.url); 63237 var e = this.getIsImageComplete(); 63238 e && 63239 (this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), 63240 this.unbindEvents()); 63241 }), 63242 (s.prototype.unbindEvents = function() { 63243 this.img.removeEventListener("load", this), 63244 this.img.removeEventListener("error", this); 63245 }), 63246 (s.prototype.confirm = function(e, t) { 63247 (this.isLoaded = e), 63248 this.emitEvent("progress", [this, this.element, t]); 63249 }), 63250 (o.makeJQueryPlugin = function(t) { 63251 (t = t || e.jQuery), 63252 t && 63253 ((h = t), 63254 (h.fn.imagesLoaded = function(e, t) { 63255 var i = new o(this, e, t); 63256 return i.jqDeferred.promise(h(this)); 63257 })); 63258 }), 63259 o.makeJQueryPlugin(), 63260 o 63261 ); 63262 }); 63263 63264/*! 63265 * @fileOverview TouchSwipe - jQuery Plugin 63266 * @version 1.6.18 63267 * 63268 * @author Matt Bryson http://www.github.com/mattbryson 63269 * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin 63270 * @see http://labs.rampinteractive.co.uk/touchSwipe/ 63271 * @see http://plugins.jquery.com/project/touchSwipe 63272 * @license 63273 * Copyright (c) 2010-2015 Matt Bryson 63274 * Dual licensed under the MIT or GPL Version 2 licenses. 63275 * 63276 */ 63277!function(factory){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],factory):factory("undefined"!=typeof module&&module.exports?require("jquery"):jQuery)}(function($){"use strict";function init(options){return!options||void 0!==options.allowPageScroll||void 0===options.swipe&&void 0===options.swipeStatus||(options.allowPageScroll=NONE),void 0!==options.click&&void 0===options.tap&&(options.tap=options.click),options||(options={}),options=$.extend({},$.fn.swipe.defaults,options),this.each(function(){var $this=$(this),plugin=$this.data(PLUGIN_NS);plugin||(plugin=new TouchSwipe(this,options),$this.data(PLUGIN_NS,plugin))})}function TouchSwipe(element,options){function touchStart(jqEvent){if(!(getTouchInProgress()||$(jqEvent.target).closest(options.excludedElements,$element).length>0)){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(!event.pointerType||"mouse"!=event.pointerType||0!=options.fallbackToMouseEvents){var ret,touches=event.touches,evt=touches?touches[0]:event;return phase=PHASE_START,touches?fingerCount=touches.length:options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),distance=0,direction=null,currentDirection=null,pinchDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,maximumsMap=createMaximumsData(),cancelMultiFingerRelease(),createFingerData(0,evt),!touches||fingerCount===options.fingers||options.fingers===ALL_FINGERS||hasPinches()?(startTime=getTimeStamp(),2==fingerCount&&(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)),(options.swipeStatus||options.pinchStatus)&&(ret=triggerHandler(event,phase))):ret=!1,ret===!1?(phase=PHASE_CANCEL,triggerHandler(event,phase),ret):(options.hold&&(holdTimeout=setTimeout($.proxy(function(){$element.trigger("hold",[event.target]),options.hold&&(ret=options.hold.call($element,event,event.target))},this),options.longTapThreshold)),setTouchInProgress(!0),null)}}}function touchMove(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(phase!==PHASE_END&&phase!==PHASE_CANCEL&&!inMultiFingerRelease()){var ret,touches=event.touches,evt=touches?touches[0]:event,currentFinger=updateFingerData(evt);if(endTime=getTimeStamp(),touches&&(fingerCount=touches.length),options.hold&&clearTimeout(holdTimeout),phase=PHASE_MOVE,2==fingerCount&&(0==startTouchesDistance?(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)):(updateFingerData(touches[1]),endTouchesDistance=calculateTouchesDistance(fingerData[0].end,fingerData[1].end),pinchDirection=calculatePinchDirection(fingerData[0].end,fingerData[1].end)),pinchZoom=calculatePinchZoom(startTouchesDistance,endTouchesDistance),pinchDistance=Math.abs(startTouchesDistance-endTouchesDistance)),fingerCount===options.fingers||options.fingers===ALL_FINGERS||!touches||hasPinches()){if(direction=calculateDirection(currentFinger.start,currentFinger.end),currentDirection=calculateDirection(currentFinger.last,currentFinger.end),val
vendor: 2,097 bytes, line 63277
63277idateDefaultEvent(jqEvent,currentDirection),distance=calculateDistance(currentFinger.start,currentFinger.end),duration=calculateDuration(),setMaxDistance(direction,distance),ret=triggerHandler(event,phase),!options.triggerOnTouchEnd||options.triggerOnTouchLeave){var inBounds=!0;if(options.triggerOnTouchLeave){var bounds=getbounds(this);inBounds=isInBounds(currentFinger.end,bounds)}!options.triggerOnTouchEnd&&inBounds?phase=getNextPhase(PHASE_MOVE):options.triggerOnTouchLeave&&!inBounds&&(phase=getNextPhase(PHASE_END)),phase!=PHASE_CANCEL&&phase!=PHASE_END||triggerHandler(event,phase)}}else phase=PHASE_CANCEL,triggerHandler(event,phase);ret===!1&&(phase=PHASE_CANCEL,triggerHandler(event,phase))}}function touchEnd(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent,touches=event.touches;if(touches){if(touches.length&&!inMultiFingerRelease())return startMultiFingerRelease(event),!0;if(touches.length&&inMultiFingerRelease())return!0}return inMultiFingerRelease()&&(fingerCount=fingerCountAtRelease),endTime=getTimeStamp(),duration=calculateDuration(),didSwipeBackToCancel()||!validateSwipeDistance()?(phase=PHASE_CANCEL,triggerHandler(event,phase)):options.triggerOnTouchEnd||options.triggerOnTouchEnd===!1&&phase===PHASE_MOVE?(options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),phase=PHASE_END,triggerHandler(event,phase)):!options.triggerOnTouchEnd&&hasTap()?(phase=PHASE_END,triggerHandlerForGesture(event,phase,TAP)):phase===PHASE_MOVE&&(phase=PHASE_CANCEL,triggerHandler(event,phase)),setTouchInProgress(!1),null}function touchCancel(){fingerCount=0,endTime=0,startTime=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,cancelMultiFingerRelease(),setTouchInProgress(!1)}function touchLeave(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;options.triggerOnTouchLeave&&(phase=getNextPhase(PHASE_END),triggerHandler(event,phase))}function removeListeners(){$element.unbind(START_EV,touchStart),$element.unbind(CANCEL_EV,touchCancel),$element.unbind(MOVE_EV,touchMove),$element.unbind(END_EV,touchEnd),LEAVE_EV&&$element.unbind
vendor: 8,266 bytes, line 63277
63277(LEAVE_EV,touchLeave),setTouchInProgress(!1)}function getNextPhase(currentPhase){var nextPhase=currentPhase,validTime=validateSwipeTime(),validDistance=validateSwipeDistance(),didCancel=didSwipeBackToCancel();return!validTime||didCancel?nextPhase=PHASE_CANCEL:!validDistance||currentPhase!=PHASE_MOVE||options.triggerOnTouchEnd&&!options.triggerOnTouchLeave?!validDistance&¤tPhase==PHASE_END&&options.triggerOnTouchLeave&&(nextPhase=PHASE_CANCEL):nextPhase=PHASE_END,nextPhase}function triggerHandler(event,phase){var ret,touches=event.touches;return(didSwipe()||hasSwipes())&&(ret=triggerHandlerForGesture(event,phase,SWIPE)),(didPinch()||hasPinches())&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,PINCH)),didDoubleTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,DOUBLE_TAP):didLongTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,LONG_TAP):didTap()&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,TAP)),phase===PHASE_CANCEL&&touchCancel(event),phase===PHASE_END&&(touches?touches.length||touchCancel(event):touchCancel(event)),ret}function triggerHandlerForGesture(event,phase,gesture){var ret;if(gesture==SWIPE){if($element.trigger("swipeStatus",[phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection]),options.swipeStatus&&(ret=options.swipeStatus.call($element,event,phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection),ret===!1))return!1;if(phase==PHASE_END&&validateSwipe()){if(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),$element.trigger("swipe",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipe&&(ret=options.swipe.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection),ret===!1))return!1;switch(direction){case LEFT:$element.trigger("swipeLeft",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeLeft&&(ret=options.swipeLeft.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case RIGHT:$element.trigger("swipeRight",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeRight&&(ret=options.swipeRight.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case UP:$element.trigger("swipeUp",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeUp&&(ret=options.swipeUp.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case DOWN:$element.trigger("swipeDown",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeDown&&(ret=options.swipeDown.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection))}}}if(gesture==PINCH){if($element.trigger("pinchStatus",[phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchStatus&&(ret=options.pinchStatus.call($element,event,phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData),ret===!1))return!1;if(phase==PHASE_END&&validatePinch())switch(pinchDirection){case IN:$element.trigger("pinchIn",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchIn&&(ret=options.pinchIn.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData));break;case OUT:$element.trigger("pinchOut",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchOut&&(ret=options.pinchOut.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData))}}return gesture==TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),hasDoubleTap()&&!inDoubleTap()?(doubleTapStartTime=getTimeStamp(),singleTapTimeout=setTimeout($.proxy(function(){doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target))},this),options.doubleTapThreshold)):(doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target)))):gesture==DOUBLE_TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),doubleTapStartTime=null,$element.trigger("doubletap",[event.target]),options.doubleTap&&(ret=options.doubleTap.call($element,event,event.target))):gesture==LONG_TAP&&(phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),doubleTapStartTime=null,$element.trigger("longtap",[event.target]),options.longTap&&(ret=options.longTap.call($element,event,event.target)))),ret}function validateSwipeDistance(){var valid=!0;return null!==options.threshold&&(valid=distance>=options.threshold),valid}function didSwipeBackToCancel(){var cancelled=!1;return null!==options.cancelThreshold&&null!==direction&&(cancelled=getMaxDistance(direction)-distance>=options.cancelThreshold),cancelled}function validatePinchDistance(){return null!==options.pinchThreshold?pinchDistance>=options.pinchThreshold:!0}function validateSwipeTime(){var result;return result=options.maxTimeThreshold?!(duration>=options.maxTimeThreshold):!0}function validateDefaultEvent(jqEvent,direction){if(options.preventDefaultEvents!==!1)if(options.allowPageScroll===NONE)jqEvent.preventDefault();else{var auto=options.allowPageScroll===AUTO;switch(direction){case LEFT:(options.swipeLeft&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case RIGHT:(options.swipeRight&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case UP:(options.swipeUp&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case DOWN:(options.swipeDown&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case NONE:}}}function validatePinch(){var hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),hasCorrectDistance=validatePinchDistance();return hasCorrectFingerCount&&hasEndPoint&&hasCorrectDistance}function hasPinches(){return!!(options.pinchStatus||options.pinchIn||options.pinchOut)}function didPinch(){return!(!validatePinch()||!hasPinches())}function validateSwipe(){var hasValidTime=validateSwipeTime(),hasValidDistance=validateSwipeDistance(),hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),didCancel=didSwipeBackToCancel(),valid=!didCancel&&hasEndPoint&&hasCorrectFingerCount&&hasValidDistance&&hasValidTime;return valid}function hasSwipes(){return!!(options.swipe||options.swipeStatus||options.swipeLeft||options.swipeRight||options.swipeUp||options.swipeDown)}function didSwipe(){return!(!validateSwipe()||!hasSwipes())}function validateFingers(){return fingerCount===options.fingers||options.fingers===ALL_FINGERS||!SUPPORTS_TOUCH}function validateEndPoint(){return 0!==fingerData[0].end.x}function hasTap(){return!!options.tap}function hasDoubleTap(){return!!options.doubleTap}function hasLongTap(){return!!options.longTap}function validateDoubleTap(){if(null==doubleTapStartTime)return!1;var now=getTimeStamp();return hasDoubleTap()&&now-doubleTapStartTime<=options.doubleTapThreshold}function inDoubleTap(){return validateDoubleTap()}function validateTap(){return(1===fingerCount||!SUPPORTS_TOUCH)&&(isNaN(distance)||distance<options.threshold)}function validateLongTap(){return duration>options.longTapThreshold&&DOUBLE_TAP_THRESHOLD>distance}function didTap(){return!(!validateTap()||!hasTap())}function didDoubleTap(){return!(!validateDoubleTap()||!hasDoubleTap())}function didLongTap(){return!(!validateLongTap()||!hasLongTap())}function startMultiFingerRelease(event){previousTouchEndTime=getTimeStamp(),fingerCountAtRelease=event.touches.length+1}function cancelMultiFingerRelease(){previousTouchEndTime=0,fingerCountAtRelease=0}function inMultiFingerRelease(){var withinThreshold=!1;if(previousTouchEndTime){var diff=getTimeStamp()-previousTouchEndTime;diff<=options.fingerReleaseThreshold&&(withinThreshold=!0)}return withinThreshold}function getTouchInProgress(){return!($element.data(PLUGIN_NS+"_intouch")!==!0)}function setTouchInProgress(val){$element&&(val===!0?($element.
vendor: 3,253 bytes, line 63277
63277bind(MOVE_EV,touchMove),$element.bind(END_EV,touchEnd),LEAVE_EV&&$element.bind(LEAVE_EV,touchLeave)):($element.unbind(MOVE_EV,touchMove,!1),$element.unbind(END_EV,touchEnd,!1),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave,!1)),$element.data(PLUGIN_NS+"_intouch",val===!0))}function createFingerData(id,evt){var f={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return f.start.x=f.last.x=f.end.x=evt.pageX||evt.clientX,f.start.y=f.last.y=f.end.y=evt.pageY||evt.clientY,fingerData[id]=f,f}function updateFingerData(evt){var id=void 0!==evt.identifier?evt.identifier:0,f=getFingerData(id);return null===f&&(f=createFingerData(id,evt)),f.last.x=f.end.x,f.last.y=f.end.y,f.end.x=evt.pageX||evt.clientX,f.end.y=evt.pageY||evt.clientY,f}function getFingerData(id){return fingerData[id]||null}function setMaxDistance(direction,distance){direction!=NONE&&(distance=Math.max(distance,getMaxDistance(direction)),maximumsMap[direction].distance=distance)}function getMaxDistance(direction){return maximumsMap[direction]?maximumsMap[direction].distance:void 0}function createMaximumsData(){var maxData={};return maxData[LEFT]=createMaximumVO(LEFT),maxData[RIGHT]=createMaximumVO(RIGHT),maxData[UP]=createMaximumVO(UP),maxData[DOWN]=createMaximumVO(DOWN),maxData}function createMaximumVO(dir){return{direction:dir,distance:0}}function calculateDuration(){return endTime-startTime}function calculateTouchesDistance(startPoint,endPoint){var diffX=Math.abs(startPoint.x-endPoint.x),diffY=Math.abs(startPoint.y-endPoint.y);return Math.round(Math.sqrt(diffX*diffX+diffY*diffY))}function calculatePinchZoom(startDistance,endDistance){var percent=endDistance/startDistance*1;return percent.toFixed(2)}function calculatePinchDirection(){return 1>pinchZoom?OUT:IN}function calculateDistance(startPoint,endPoint){return Math.round(Math.sqrt(Math.pow(endPoint.x-startPoint.x,2)+Math.pow(endPoint.y-startPoint.y,2)))}function calculateAngle(startPoint,endPoint){var x=startPoint.x-endPoint.x,y=endPoint.y-startPoint.y,r=Math.atan2(y,x),angle=Math.round(180*r/Math.PI);return 0>angle&&(angle=360-Math.abs(angle)),angle}function calculateDirection(startPoint,endPoint){if(comparePoints(startPoint,endPoint))return NONE;var angle=calculateAngle(startPoint,endPoint);return 45>=angle&&angle>=0?LEFT:360>=angle&&angle>=315?LEFT:angle>=135&&225>=angle?RIGHT:angle>45&&135>angle?DOWN:UP}function getTimeStamp(){var now=new Date;return now.getTime()}function getbounds(el){el=$(el);var offset=el.offset(),bounds={left:offset.left,right:offset.left+el.outerWidth(),top:offset.top,bottom:offset.top+el.outerHeight()};return bounds}function isInBounds(point,bounds){return point.x>bounds.left&&point.x<bounds.right&&point.y>bounds.top&&point.y<bounds.bottom}function comparePoints(pointA,pointB){return pointA.x==pointB.x&&pointA.y==pointB.y}var options=$.extend({},options),useTouchEvents=SUPPORTS_TOUCH||SUPPORTS_POINTER||!options.fallbackToMouseEvents,START_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerDown":"pointerdown":"touchstart":"mousedown",MOVE_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerMove":"pointermove":"touchmove":"mousemove",END_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerUp":"pointerup":"touchend":"mou
63277seup",LEAVE_EV=useTouchEvents?SUPPORTS_POINTER?"mouseleave":null:"mouseleave",CANCEL_EV=SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerCancel":"pointercancel":"touchcancel",distance=0,direction=null,currentDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,pinchDirection=0,maximumsMap=null,$element=$(element),phase="start",fingerCount=0,fingerData={},startTime=0,endTime=0,previousTouchEndTime=0,fingerCountAtRelease=0,doubleTapStartTime=0,singleTapTimeout=null,holdTimeout=null;try{$element.bind(START_EV,touchStart),$element.bind(CANCEL_EV,touchCancel)}catch(e){$.error("events not supported "+START_EV+","+CANCEL_EV+" on jQuery.swipe")}this.enable=function(){return this.disable(),$element.bind(START_EV,touchStart),$element.bind(CANCEL_EV,touchCancel),$element},this.disable=function(){return removeListeners(),$element},this.destroy=function(){removeListeners(),$element.data(PLUGIN_NS,null),$element=null},this.option=function(property,value){if("object"==typeof property)options=$.extend(options,property);else if(void 0!==options[property]){if(void 0===value)return options[property];options[property]=value}else{if(!property)return options;$.error("Option "+property+" does not exist on jQuery.swipe.options")}return null}}var VERSION="1.6.18",LEFT="left",RIGHT="right",UP="up",DOWN="down",IN="in",OUT="out",
63277NONE="none",AUTO="auto",SWIPE="swipe",PINCH="pinch",TAP="tap",DOUBLE_TAP="doubletap",LONG_TAP="longtap",HORIZONTAL="horizontal",VERTICAL="vertical",ALL_FINGERS="all",DOUBLE_TAP_THRESHOLD=10,PHASE_START="start",PHASE_MOVE="move",PHASE_END="end",PHASE_CANCEL="cancel",SUPPORTS_TOUCH="ontouchstart"in window,SUPPORTS_POINTER_IE10=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!SUPPORTS_TOUCH,SUPPORTS_POINTER=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!SUPPORTS_TOUCH,PLUGIN_NS="TouchSwipe",defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:".noSwipe",preventDefaultEvents:!0};$.fn.swipe=function(method){var $this=$(this),plugin=$this.data(PLUGIN_NS);if(plugin&&"string"==typeof method){if(plugin[method])return plugin[method].apply(plugin,Array.prototype.slice.call(arguments,1));$.error("Method "+method+" does not exist on jQuery.swipe")}else if(plugin&&"object"==typeof method)plugin.option.apply(plugin,arguments);else if(!(plugin||"object"!=typeof method&&method))return init.apply(this,arguments);return $this},$.fn.swipe.version=VERSION,$.fn.swipe.defaults=defaults,$.fn.swipe.phases={PHASE_START:PHASE_START,PHASE_MOVE:PHASE_MOVE,PHASE_END:PHASE_END,PHASE_CANCEL:PHASE_CANCEL},$.fn.swipe.directions={LEFT:LEFT,RIGHT:RIGHT,UP:UP,DOWN:DOWN,IN:IN,OUT:OUT},$.fn.swipe.pageScroll={NONE:NONE,HORIZONTAL:HORIZONTAL,VERTICAL:VERTICAL,AUTO:AUTO},$.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:ALL_FINGERS}}); 63278function FilterHandler() { 63279 if (window.filterHandlerInstance) { 63280 return window.filterHandlerInstance; 63281 } 63282 if (!window.selectedFilters) { 63283 window.selectedFilters = { 63284 month: 1 63285 } 63286 } 63287 this.listeners = []; 63288 window.filterHandlerInstance = this; 63289 this.filters = $.extend([], globalArticleData.filters); 63290 this.formatFilters(); 63291 this.applyFilters(); 63292} 63293FilterHandler.prototype.applyLocalFilters = function(defaultFilters) { 63294 var filters = defaultFilters ? defaultFilters : this.getActiveFilters(); 63295 var monthArticles = globalArticleData.articles.find(function(articles) { 63296 return articles.monthKey === selectedFilters.month; 63297 }); 63298 if(monthArticles!=undefined){ 63299 if (!filters || filters.length === 0) { 63300 63301 return monthArticles.articleItems; 63302 } 63303 var articles = monthArticles.articleItems.filter(function(article) { 63304 return article.tags.find(function(tag) { 63305 return filters.indexOf(tag) !== -1; 63306 }) 63307 }); 63308 63309 return articles; 63310 } 63311 else{ 63312 63313 return [ ]; 63314 } 63315 63316} 63317FilterHandler.prototype.formatFilters = function() { 63318 var self = this; 63319 for (var i = 0; i < this.filters.length; i++) { 63320 var filter = this.filters[i]; 63321 var filteredCount = self.applyLocalFilters(filter.tags.map(function(tag) { 63322 return tag.tagId; 63323 })).length; 63324 filter.title = filter.title.replace(/\([^()]*\)/g, '') + " (" + filteredCount + ")"; 63325 } 63326} 63327FilterHandler.prototype.applyFilters = function(filters) { 63328 this.prefilterArticles = this.applyLocalFilters(filters); 63329 window.currentArticles = this.prefilterArticles; 63330 this.emitChanges(); 63331}; 63332FilterHandler.prototype.getActiveFilters = function(filters) { 63333 if (!window.activeFilters) { 63334 window.activeFilters = []; 63335 } 63336 return window.activeFilters; 63337}; 63338FilterHandler.prototype.listenChanges = function(callback) { 63339 if (this.listeners.indexOf(callback) === -1) { 63340 this.listeners.push(callback); 63341 } 63342} 63343FilterHandler.prototype.emitChanges = function() { 63344 this.listeners.forEach(function(callback) { 63345 if (typeof callback === 'function') { 63346 callback(); 63347 } 63348 }); 63349} 63350FilterHandler.prototype.setMonth = function(month) { 63351 window.selectedFilters.month = month; 63352 this.formatFilters(); 63353 this.applyFilters(); 63354}; 63355 63356function Filters(filterBox,datastring) { 63357 this.filterBox = filterBox; 63358 this.filterBody = this.filterBox.find(".filter-body"); 63359 this.breakpointColSm = 576; 63360 if (!filterBox || !$("#filter-template").length || !$("#filter-body-template").length) { 63361 return; 63362 } 63363 this.template = Handlebars.compile($("#filter-template").html()); 63364 this.templateBody = Handlebars.compile($("#filter-body-template").html()); 63365 this.filterHandler = new FilterHandler(); 63366 this.filters = this.filterHandler.filters; 63367 this.filterHandler.listenChanges(this.filterChange.bind(this)); 63368 this.prefilterArticles = []; 63369 this.init(); 63370} 63371 63372Filters.prototype.init = function() { 63373 this.filterHandler.applyFilters(); 63374 this.render(); 63375 this.initSwipe(); 63376 this.initEvents(); 63377}; 63378Filters.prototype.isMobile = function() { 63379 return $(window).width() < this.breakpointColSm; 63380} 63381Filters.prototype.initSwipe = function() { 63382 var self = this; 63383 this.filterBody.swipe({ 63384 swipeLeft: function(event, direction, distance, duration, fingerCount) { 63385 var nextItem = self.filterBox.find('.filter-nav .nav-tab > a.active').parent().next('li'); 63386 if (!self.isMobile() || !nextItem.length) { 63387 return; 63388 } 63389 var left = nextItem.position().left; 63390 var margin = self.filterBox.find('.filter-nav .nav-tab > a.active').parent().next('li').css('margin-left'); 63391 margin = margin ? parseInt(margin.replace('px', '')) : 0; 63392 left = left + margin; 63393 self.filterBox.find('ul.nav').css({ 63394 left: -left + 'px' 63395 }); 63396 self.filterBox.find('.filter-nav .nav-tab > a.active').parent().next('li').find('a').trigger('click'); 63397 }, 63398 swipeRight: function(event, direction, distance, duration, fingerCount) { 63399 var prevItem = self.filterBox.find('.filter-nav .nav-tab > a.active').parent().prev('li'); 63400 if (!self.isMobile() || !prevItem.length) { 63401 return; 63402 } 63403 var left = prevItem.position().left; 63404 var margin = self.filterBox.find('.filter-nav .nav-tab > a.active').parent().prev('li').css('margin-left'); 63405 margin = margin ? parseInt(margin.replace('px', '')) : 0; 63406 left = left + margin; 63407 self.filterBox.find('ul.nav').css({ 63408 left: -left + 'px' 63409 }); 63410 self.filterBox.find('.filter-nav .nav-tab > a.active').parent().prev('li').find('a').trigger('click'); 63411 } 63412 }); 63413}; 63414 63415Filters.prototype.checkActive = function() { 63416 if (!this.isMobile()) { 63417 this.filterBox.find('ul.nav').css({ 63418 left: '0px' 63419 }); 63420 return; 63421 } 63422 var left = this.filterBox.find('.filter-nav .nav-tab > a.active').parent().position().left; 63423 var margin = this.filterBox.find('.filter-nav .nav-tab > a.active').parent().css('margin-left'); 63424 margin = margin ? parseInt(margin.replace('px', '')) : 0; 63425 left = left + margin; 63426 this.filterBox.find('ul.nav').css({ 63427 left: -left + 'px' 63428 }); 63429}; 63430Filters.prototype.initEvents = function() { 63431 var self = this; 63432 $(window).resize(function() { 63433 return self.checkActive(); 63434 }); 63435 $(document).ready(function() { 63436 return self.checkActive(); 63437 });
63438 this.filterBox.find('input:checkbox').change(function(e) { 63439 self.filterUpdate(); 63440 }); 63441 this.filterBox.find('input:checkbox').change(function(e) { 63442 self.filterUpdate(); 63443 }); 63444 this.filterBox.find('.clear-filter-btn').click(function(e) { 63445 e.preventDefault(); 63446 self.clearFilters(); 63447 }); 63448 this.filterBox.find(".close-filter, .nav-tab>a.active>span").click(function() { 63449 self.filterBox.toggleClass("filter-open"); 63450 self.filterHandler.applyFilters(); 63451 }); 63452}; 63453Filters.prototype.filterUpdate = function() { 63454 this.setActiveFilters(); 63455 var filtersCount = this.filterHandler.applyLocalFilters(); 63456 this.filterBox.find('.view-products-btn').html('View Products (' + filtersCount.length + ')'); 63457} 63458Filters.prototype.clearFilters = function() { 63459 this.filterBox.find('input:checkbox').prop('checked', false); 63460 this.filterUpdate(); 63461} 63462Filters.prototype.render = function() { 63463 this.fitlers = this.filters.map(function(filter, index) { 63464 filter.active = index === 0 ? 'active' : ''; 63465 return filter; 63466 }); 63467 this.renderNav(); 63468 this.filterBox.find("#tab-content").html( 63469 this.templateBody({ 63470 filters: this.filters 63471 }) 63472 ); 63473 this.filterBox.find('.view-products-btn').html('View Products'); 63474 63475}; 63476Filters.prototype.renderNav = function() { 63477 this.filterBox.find("#nav-test").html( 63478 this.template({ 63479 filters: this.filters 63480 }) 63481 ); 63482}; 63483Filters.prototype.setActiveFilters = function() { 63484 var values = this.filterBox.find('input:checkbox:checked') 63485 .map(function(item) { 63486 return $(this).val(); 63487 }) 63488 .get(); 63489 window.activeFilters = values; 63490} 63491Filters.prototype.filterChange = function() { 63492 this.renderNav(); 63493 this.filterBox.find('.view-products-btn').html('View Products'); 63494}/* 63495$(function() { 63496 new Filters($(".filter-box")); 63497});*/ 63498function FilterHandlerevents() { 63499 if (window.FilterHandlereventsInstance) { 63500 return window.FilterHandlereventsInstance; 63501 } 63502 if (!window.selectedFilters) { 63503 window.selectedFilters = { 63504 month: 1 63505 } 63506 } 63507 this.listeners = []; 63508 window.FilterHandlereventsInstance = this; 63509 this.filters = $.extend([], globalArticleDataevents.filters); 63510 this.formatFilters(); 63511 this.applyFilters2(); 63512} 63513FilterHandlerevents.prototype.applyLocalFilters = function(defaultFilters) { 63514 var filters = defaultFilters ? defaultFilters : this.getActiveFilters(); 63515 var monthArticles = globalArticleDataevents.articles.find(function(articles) { 63516 return articles.monthKey === selectedFilters.month; 63517 }); 63518 if(monthArticles!=undefined){ 63519 if (!filters || filters.length === 0) { 63520 63521 return monthArticles.articleItems; 63522 } 63523 var articles = monthArticles.articleItems.filter(function(article) { 63524 return article.tags.find(function(tag) { 63525 return filters.indexOf(tag) !== -1; 63526 }) 63527 }); 63528 63529 return articles; 63530 } 63531 else{ 63532 63533 return [ ]; 63534 } 63535 63536} 63537FilterHandlerevents.prototype.formatFilters = function() { 63538 var self = this; 63539 for (var i = 0; i < this.filters.length; i++) { 63540 var filter = this.filters[i]; 63541 var filteredCount = self.applyLocalFilters(filter.tags.map(function(tag) { 63542 return tag.tagId; 63543 })).length; 63544 filter.title = filter.title.replace(/\([^()]*\)/g, '') + " (" + filteredCount + ")"; 63545 } 63546} 63547FilterHandlerevents.prototype.applyFilters2 = function(filters) { 63548 this.prefilterArticles = this.applyLocalFilters(filters); 63549 window.currentArticlesevents = this.prefilterArticles; 63550 this.emitChanges(); 63551}; 63552FilterHandlerevents.prototype.getActiveFilters = function(filters) { 63553 if (!window.activeFilters) { 63554 window.activeFilters = []; 63555 } 63556 return window.activeFilters; 63557}; 63558FilterHandlerevents.prototype.listenChanges = function(callback) { 63559 if (this.listeners.indexOf(callback) === -1) { 63560 this.listeners.push(callback); 63561 } 63562} 63563FilterHandlerevents.prototype.emitChanges = function() { 63564 this.listeners.forEach(function(callback) { 63565 if (typeof callback === 'function') { 63566 callback(); 63567 } 63568 }); 63569} 63570FilterHandlerevents.prototype.setMonth = function(month) { 63571 window.selectedFilters.month = month; 63572 this.formatFilters(); 63573 this.applyFilters2(); 63574}; 63575 63576function Filters2(filterBox) { 63577 this.filterBox = filterBox; 63578 this.filterBody = this.filterBox.find(".filter-body"); 63579 this.breakpointColSm = 576; 63580 if (!filterBox || !$("#filter-template-events").length || !$("#filter-body-template-event").length) { 63581 return; 63582 } 63583 this.template = Handlebars.compile($("#filter-template-events").html()); 63584 this.templateBody = Handlebars.compile($("#filter-body-template-event").html()); 63585 this.FilterHandlerevents = new FilterHandlerevents(); 63586 filters = this.FilterHandlerevents.Filters2; 63587 this.FilterHandlerevents.listenChanges(this.filterChange.bind(this)); 63588 this.prefilterArticles = []; 63589 this.init(); 63590} 63591 63592Filters2.prototype.init = function() { 63593 this.FilterHandlerevents.applyFilters2(); 63594 this.render(); 63595 this.initSwipe(); 63596 this.initEvents(); 63597}; 63598Filters2.prototype.isMobile = function() { 63599 return $(window).width() < this.breakpointColSm; 63600} 63601Filters2.prototype.initSwipe = function() { 63602 var self = this; 63603 this.filterBody.swipe({ 63604 swipeLeft: function(event, direction, distance, duration, fingerCount) { 63605 var nextItem = self.filterBox.find('.filter-nav .nav-tab > a.active').parent().next('li'); 63606 if (!self.isMobile() || !nextItem.length) { 63607 return; 63608 } 63609 var left = nextItem.position().left; 63610 var margin = self.filterBox.find('.filter-nav .nav-tab > a.active').parent().next('li').css('margin-left'); 63611 margin = margin ? parseInt(margin.replace('px', '')) : 0; 63612 left = left + margin; 63613 self.filterBox.find('ul.nav').css({ 63614 left: -left + 'px' 63615 }); 63616 self.filterBox.find('.filter-nav .nav-tab > a.active').parent().next('li').find('a').trigger('click'); 63617 }, 63618 swipeRight: function(event, direction, distance, duration, fingerCount) { 63619 var prevItem = self.filterBox.find('.filter-nav .nav-tab > a.active').parent().prev('li'); 63620 if (!self.isMobile() || !prevItem.length) { 63621 return; 63622 } 63623 var left = prevItem.position().left; 63624 var margin = self.filterBox.find('.filter-nav .nav-tab > a.active').parent().prev('li').css('margin-left'); 63625 margin = margin ? parseInt(margin.replace('px', '')) : 0; 63626 left = left + margin; 63627 self.filterBox.find('ul.nav').css({ 63628 left: -left + 'px' 63629 }); 63630 self.filterBox.find('.filter-nav .nav-tab > a.active').parent().prev('li').find('a').trigger('click'); 63631 } 63632 }); 63633}; 63634 63635Filters2.prototype.checkActive = function() { 63636 if (!this.isMobile()) { 63637 this.filterBox.find('ul.nav').css({ 63638 left: '0px' 63639 }); 63640 return; 63641 } 63642 var left = this.filterBox.find('.filter-nav .nav-tab > a.active').parent().position().left; 63643 var margin = this.filterBox.find('.filter-nav .nav-tab > a.active').parent().css('margin-left'); 63644 margin = margin ? parseInt(margin.replace('px', '')) : 0; 63645 left = left + margin; 63646 this.filterBox.find('ul.nav').css({ 63647 left: -left + 'px' 63648 }); 63649}; 63650Filters2.prototype.initEvents = function() { 63651 var self = this; 63652 $(window).resize(function() { 63653 return self.checkActive(); 63654 }); 63655 $(document).ready(function() { 63656 return self.checkActive(); 63657 });
63658 this.filterBox.find('input:checkbox').change(function(e) { 63659 self.filterUpdate(); 63660 }); 63661 this.filterBox.find('input:checkbox').change(function(e) { 63662 self.filterUpdate(); 63663 }); 63664 this.filterBox.find('.clear-filter-btn').click(function(e) { 63665 e.preventDefault(); 63666 self.clearFilters2(); 63667 }); 63668 this.filterBox.find(".close-filter, .nav-tab>a.active>span").click(function() { 63669 self.filterBox.toggleClass("filter-open"); 63670 self.FilterHandlerevents.applyFilters2(); 63671 }); 63672}; 63673Filters2.prototype.filterUpdate = function() { 63674 this.setActiveFilters2(); 63675 var Filters2Count = this.FilterHandlerevents.applyLocalFilters2(); 63676 this.filterBox.find('.view-products-btn').html('View Products (' + Filters2Count.length + ')'); 63677} 63678Filters2.prototype.clearFilters2 = function() { 63679 this.filterBox.find('input:checkbox').prop('checked', false); 63680 this.filterUpdate(); 63681} 63682Filters2.prototype.render = function() { 63683 this.fitlers = filters.map(function(filter, index) { 63684 filter.active = index === 0 ? 'active' : ''; 63685 return filter; 63686 }); 63687 this.renderNav(); 63688 this.filterBox.find("#tab-content").html( 63689 this.templateBody({ 63690 Filters2: filters 63691 }) 63692 ); 63693 this.filterBox.find('.view-products-btn').html('View Products'); 63694 63695}; 63696Filters2.prototype.renderNav = function() { 63697 this.filterBox.find("#nav-test").html( 63698 this.template({ 63699 Filters2: filters 63700 }) 63701 ); 63702}; 63703Filters2.prototype.setActiveFilters2 = function() { 63704 var values = this.filterBox.find('input:checkbox:checked') 63705 .map(function(item) { 63706 return $(this).val(); 63707 }) 63708 .get(); 63709 window.activeFilters2 = values; 63710} 63711Filters2.prototype.filterChange = function() { 63712 this.renderNav(); 63713 this.filterBox.find('.view-products-btn').html('View Products'); 63714}/* 63715$(function() { 63716 new Filters2($(".filter-box")); 63717});*/ 63718 63719function listingComponent(el, defaultType) { 63720 console.log("thisisel"+el); 63721 this.el = el; 63722 this.dateCarouselEl = el.find(".date-carousel"); 63723 var gridNews = el.find(".news-container-grid"); 63724 var listNews = el.find(".news-container-list"); 63725 if($(el).hasClass("articlecomponentlisting")){ 63726 listNews = el.find(".news-container-list-events"); 63727 } 63728 this.newsList = gridNews.length !== 0 ? gridNews : listNews; 63729 this.filterEl = $(".filter-box")[0]; 63730 this.filterBtn = el.find(".filter-btn")[0]; 63731 this.filterHandler = new FilterHandler(); 63732 this.currentMonth = 1; 63733 this.limit = 9; 63734 this.currentPage = 0; 63735 this.months = [ 63736 {name: 'january', value: 1}, 63737 {name: 'february', value: 2}, 63738 {name: 'march', value: 3}, 63739 {name: 'april', value: 4}, 63740 {name: 'may', value: 5}, 63741 {name: 'june', value: 6}, 63742 {name: 'july', value: 7}, 63743 {name: 'august', value: 8}, 63744 {name: 'september', value: 9}, 63745 {name: 'october', value: 10}, 63746 {name: 'november', value: 11}, 63747 {name: 'december', value: 12} 63748 ]; 63749 this.defaultType = defaultType ? defaultType: 'smallListItem'; 63750 this.defaultItem = this.defaultType; 63751 if(this.el.hasClass('listing-view')){ 63752 this.defaultItem = 'listingListItem'; 63753 } 63754 window.months = this.months; 63755 Handlebars.registerHelper('ifDistinct', function(v1, v2, options) { 63756 if(v1 !== v2) { 63757 return options.fn(this); 63758 } 63759 return options.inverse(this); 63760 }); 63761 Handlebars.registerHelper('ifIsZero', function(value, options) { 63762 if(value != '') { 63763 return options.fn(this); 63764 } 63765 return options.inverse(this); 63766 }); 63767 Handlebars.registerPartial('smallListItem',$("#listing-item-small").html()); 63768 Handlebars.registerPartial('mediumListItem',$("#listing-item-medium").html()); 63769 Handlebars.registerPartial('largeListItem',$("#listing-item-large").html()); 63770 Handlebars.registerPartial('xlargeListItem',$("#listing-item-xlarge").html()); 63771 Handlebars.registerPartial('noimageListItem',$("#listing-item-noimage").html()); 63772 Handlebars.registerPartial('listingListItem',$("#listing-item-list").html()); 63773 this.listingTemplate = Handlebars.compile($("#listing-articles").html()); 63774 this.filterHandler.listenChanges(this.resetRenderList.bind(this)); 63775 this.initRenderList(); 63776 this.initDateCarousel(); 63777 this.initMasonry(); 63778 this.initInterface(); 63779 this.dateCarouselEl.on( 63780 "afterChange", 63781 function(event, slick, currentSlide) { 63782 var total = this.el.find(".slick-slide").length - 1; 63783 if (currentSlide === 0) { 63784 this.el.find(".c-prev").addClass("hide"); 63785 } else if (currentSlide === total) { 63786 this.el.find(".c-next").addClass("hide"); 63787 this.el.find(".c-prev").removeClass("hide"); 63788 } else { 63789 this.el.find(".c-next").removeClass("hide"); 63790 this.el.find(".c-prev").removeClass("hide"); 63791 } 63792 this.currentMonth = currentSlide + 1; 63793 this.filterHandler.setMonth(this.currentMonth); 63794 63795 63796 63797 }.bind(this) 63798 ); 63799 } 63800 listingComponent.prototype.initRenderList = function() { 63801 var self = this; 63802 var listItems = currentArticles.slice(this.currentPage, this.currentPage + this.limit); 63803 63804 this.el.find('.grid-container-article').html(this.listingTemplate({articles:listItems, defaultItem: this.defaultItem})); 63805 }; 63806 listingComponent.prototype.resetRenderList = function() { 63807 this.cleanGrid(); 63808 63809 this.currentPage = 0; 63810 var listItem = currentArticles.slice(this.currentPage, this.currentPage + this.limit); 63811 63812 var elements = $(this.listingTemplate({articles:listItem, defaultItem: this.defaultItem})); 63813 63814 if(elements.length<1){ 63815 $('.noArticleDiv').empty(); 63816 elements="<div class='noArticleDiv' style='margin:auto;'><h5>No news found for this month</h5></div>"; 63817 63818 } 63819 if(this.defaultItem === 'listingListItem') { 63820 var container = this.el.find(".grid-container-article"); 63821 $('.noArticleDiv').empty(); 63822 container.append(elements); 63823 } else {
63824 $('.noArticleDiv').empty(); 63825 this.masonry.append(elements).masonry('appended', elements); 63826 } 63827 this.moreNewsBtnEl.classList.add("fa-chevron-down"); 63828 this.moreNewsBtnEl.classList.remove("fa-chevron-up"); 63829 63830 } 63831 listingComponent.prototype.initDateCarousel = function() { 63832 this.dateCarouselEl.slick({ 63833 slidesToShow: 3, 63834 infinite: false, 63835 touchThreshold: 10, 63836 waitForAnimate: false, 63837 centerMode: true, 63838 speed: 333, 63839 arrows: true, 63840 prevArrow: '<div class="c-arrow c-prev hide"></div>', 63841 nextArrow: '<div class="c-arrow c-next"></div>', 63842 responsive: [ 63843 { 63844 breakpoint: 768, 63845 settings: { 63846 swipe: true, 63847 slidesToShow: 1 63848 } 63849 } 63850 ] 63851 }); 63852 var moveToMonth = new Date().getMonth(); 63853 this.dateCarouselEl.slick('slickGoTo', moveToMonth); 63854 }; 63855 63856 listingComponent.prototype.initInterface = function() { 63857 this.blockBtnEl = this.el.find("#blockOrder")[0]; 63858 this.listBtnEl = this.el.find("#listOrder")[0]; 63859 this.moreNewsBtnEl = this.el.find("#moreNews")[0]; 63860 this.newsContainerEl = this.el.find("#newsContainer")[0]; 63861 this.blockBtnEl.addEventListener( 63862 "click", 63863 function(event) { 63864 this.orderArticles(event); 63865 }.bind(this) 63866 ); 63867 this.listBtnEl.addEventListener( 63868 "click", 63869 function(event) { 63870 this.orderArticles(event); 63871 }.bind(this) 63872 ); 63873 this.filterBtn.addEventListener( 63874 "click", 63875 function() { 63876 this.toggleFilterMenu(); 63877 }.bind(this) 63878 ); 63879 if (this.moreNewsBtnEl !== undefined) { 63880 this.moreNewsBtnEl.addEventListener( 63881 "click", 63882 function(event) { 63883 this.toggleMoreArticles(event); 63884 63885 }.bind(this) 63886 ); 63887 } 63888 if (this.newsList) { 63889 for (var i = 0; i < this.newsList.length; i++) { 63890 if (i > 8) { 63891 this.newsList[i].hidden = true; 63892 } 63893 } 63894 } 63895 63896 /*Added to show list view by default*/ 63897 var self=this; 63898 setTimeout(function(){ 63899 self.listBtnEl.click(); 63900 },300) 63901 /* end*/ 63902 63903 }; 63904 63905 listingComponent.prototype.initMasonry = function() { 63906 var grid = this.el.find(".grid").imagesLoaded(function() { 63907 grid.masonry({ 63908 itemSelector: ".grid-item", 63909 percentPosition: true, 63910 columnWidth: ".grid-sizer", 63911 horizontalOrder: false 63912 }); 63913 }); 63914 this.masonry = grid; 63915 }; 63916 63917 listingComponent.prototype.orderArticles = function(event) { 63918 if (event.target.id === "blockOrder") { 63919 if(this.blockBtnEl.classList.contains("active")){ 63920 return; 63921 } 63922 this.blockBtnEl.classList.add("active"); 63923 this.listBtnEl.classList.remove("active"); 63924 this.cleanGrid(); 63925 this.defaultItem = this.defaultType; 63926 this.masonry.masonry(); 63927 this.resetRenderList(); 63928 } 63929 if (event.target.id === "listOrder") { 63930 if(this.listBtnEl.classList.contains("active")){ 63931 return; 63932 } 63933 this.blockBtnEl.classList.remove("active"); 63934 this.listBtnEl.classList.add("active"); 63935 this.cleanGrid(); 63936 this.defaultItem = 'listingListItem'; 63937 this.masonry.masonry('destroy'); 63938 //window.mason = this.masonry; 63939 this.resetRenderList(); 63940 } 63941 }; 63942 63943 listingComponent.prototype.toggleMoreArticles = function() { 63944 this.currentPage++; 63945 var self = this; 63946 var listItems = currentArticles.slice(this.currentPage * this.limit, (this.currentPage + 1) * this.limit); 63947 var maxPage = Math.floor(currentArticles.length / this.limit); 63948 if(this.moreNewsBtnEl.classList.contains("fa-chevron-up")){ 63949 this.resetRenderList(); 63950 $('html, body').animate({ 63951 scrollTop: $(".container.component-listing").offset().top 63952 }, 200); 63953 return; 63954 } 63955 var elements = $(this.listingTemplate({articles:listItems, defaultItem: this.defaultItem})); 63956 this.moreNewsBtnEl.classList.remove("fa-chevron-up"); 63957 if(this.defaultItem === 'listingListItem') { 63958 var container = this.el.find(".grid-container-article"); 63959 63960 container.append(elements); 63961 63962 } else { 63963 this.masonry.append(elements).masonry('appended', elements); 63964 } 63965 if(this.currentPage >= maxPage){ 63966 this.moreNewsBtnEl.classList.remove("fa-chevron-down"); 63967 this.moreNewsBtnEl.classList.add("fa-chevron-up"); 63968 63969 63970 } 63971 63972 }; 63973 listingComponent.prototype.cleanGrid = function(){ 63974 var html = this.el.find(".news-container-grid"); 63975 if(this.defaultItem === 'listingListItem') { 63976 this.el.find(".grid-container-article").empty(); 63977 } else { 63978 this.masonry.masonry('remove', html).masonry(); 63979 } 63980 } 63981 listingComponent.prototype.toggleFilterMenu = function() { 63982 if (this.filterEl) { 63983 this.filterEl.classList.toggle("filter-open"); 63984 } 63985 }; 63986function listingComponentevents(el, defaultType) { 63987 this.el = el; 63988 this.dateCarouselEl = el.find(".date-events-carousel"); 63989 var gridNews = el.find(".news-container-grid"); 63990 var listNews = el.find(".news-container-list"); 63991 this.newsList = gridNews.length !== 0 ? gridNews : listNews; 63992 this.filterEl = $(".filter-box")[0]; 63993 this.filterBtn = el.find(".filter-btn")[0]; 63994 this.filterHandler = new FilterHandlerevents(); 63995 this.currentMonth = 1; 63996 this.limit = 9; 63997 this.currentPage = 0; 63998 this.months = [ 63999 {name: 'january', value: 1}, 64000 {name: 'february', value: 2}, 64001 {name: 'march', value: 3}, 64002 {name: 'april', value: 4}, 64003 {name: 'may', value: 5}, 64004 {name: 'june', value: 6}, 64005 {name: 'july', value: 7}, 64006 {name: 'august', value: 8}, 64007 {name: 'september', value: 9}, 64008 {name: 'october', value: 10}, 64009 {name: 'november', value: 11}, 64010 {name: 'december', value: 12} 64011 ]; 64012 this.defaultType = defaultType ? defaultType: 'smallListItem'; 64013 this.defaultItem = this.defaultType; 64014 if(this.el.hasClass('listing-view')){ 64015 this.defaultItem = 'listingListItems'; 64016 } 64017 window.months = this.months; 64018 Handlebars.registerHelper('ifDistinct', function(v1, v2, options) { 64019 if(v1 !== v2) { 64020 return options.fn(this); 64021 } 64022 return options.inverse(this); 64023 }); 64024 Handlebars.registerHelper('ifIsZero', function(value, options) { 64025 if(value != '') { 64026 return options.fn(this); 64027 } 64028 return options.inverse(this); 64029 }); 64030 64031 Handlebars.registerPartial('smallListItem',$(".articlecomponentlisting-events #listing-item-small-events").html()); 64032 Handlebars.registerPartial('mediumListItem',$(".articlecomponentlisting-events #listing-item-medium-events").html()); 64033 Handlebars.registerPartial('largeListItem',$(".articlecomponentlisting-events #listing-item-large-events").html()); 64034 Handlebars.registerPartial('xlargeListItem',$(".articlecomponentlisting-events #listing-item-xlarge-events").html()); 64035 Handlebars.registerPartial('noimageListItem',$(".articlecomponentlisting-events #listing-item-noimage-events").html()); 64036 Handlebars.registerPartial('listingListItems',$(".articlecomponentlisting-events #listing-item-list-events").html()); 64037 this.listingTemplate = Handlebars.compile($(".articlecomponentlisting-events #listing-articles-events").html()); 64038 this.filterHandler.listenChanges(this.resetRenderList.bind(this)); 64039 this.initRenderList(); 64040 this.initDateCarousel(); 64041 this.initMasonry(); 64042 this.initInterface(); 64043 this.dateCarouselEl.on( 64044 "afterChange", 64045 function(event, slick, currentSlide) { 64046 var total = this.el.find(".slick-slide").length - 1; 64047 if (currentSlide === 0) { 64048 this.el.find(".c-prev").addClass("hide"); 64049 } else if (currentSlide === total) { 64050 this.el.find(".c-next").addClass("hide"); 64051 this.el.find(".c-prev").removeClass("hide"); 64052 } else { 64053 this.el.find(".c-next").removeClass("hide"); 64054 this.el.find(".c-prev").removeClass("hide"); 64055 } 64056 this.currentMonth = currentSlide + 1; 64057 this.filterHandler.setMonth(this.currentMonth); 64058 64059 64060 64061 }.bind(this) 64062 ); 64063 } 64064 listingComponentevents.prototype.initRenderList = function() { 64065 var self = this; 64066 var listItems = currentArticlesevents.slice(this.currentPage, this.currentPage + this.limit); 64067 64068 this.el.find('.grid-container-article-events').html(this.listingTemplate({articles:listItems, defaultItem: this.defaultItem})); 64069 }; 64070 listingComponentevents.prototype.resetRenderList = function() { 64071 this.cleanGrid(); 64072 64073 this.currentPage = 0; 64074 var listItem = currentArticlesevents.slice(this.currentPage, this.currentPage + this.limit); 64075 64076 var elements = $(this.listingTemplate({articles:listItem, defaultItem: this.defaultItem})); 64077 64078 if(elements.length<1){ 64079 $('.noArticleDivevents').empty(); 64080 elements="<div class='noArticleDivevents' style='margin:auto;'><h5>No events found for this month</h5></div>"; 64081 64082 64083 } 64084 if(this.defaultItem === 'listingListItems') { 64085 var container = this.el.find(".grid-container-article-events"); 64086 $('.noArticleDivevents').empty(); 64087 container.append(elements); 64088 } else {
64089 $('.noArticleDivevents').empty(); 64090 this.masonry.append(elements).masonry('appended', elements); 64091 } 64092 this.moreNewsBtnEl.classList.add("fa-chevron-down"); 64093 this.moreNewsBtnEl.classList.remove("fa-chevron-up"); 64094 64095ul = $('.grid-container-article-events'); // your parent ul element 64096ul.children().each(function(i,li){ul.prepend(li)}) 64097 } 64098 listingComponentevents.prototype.initDateCarousel = function() { 64099 this.dateCarouselEl.slick({ 64100 slidesToShow: 3, 64101 infinite: false, 64102 touchThreshold: 10, 64103 waitForAnimate: false, 64104 centerMode: true, 64105 speed: 333, 64106 arrows: true, 64107 prevArrow: '<div class="c-arrow c-prev hide"></div>', 64108 nextArrow: '<div class="c-arrow c-next"></div>', 64109 responsive: [ 64110 { 64111 breakpoint: 768, 64112 settings: { 64113 swipe: true, 64114 slidesToShow: 1 64115 } 64116 } 64117 ] 64118 }); 64119 var moveToMonth = new Date().getMonth(); 64120 this.dateCarouselEl.slick('slickGoTo', moveToMonth); 64121 }; 64122 64123 listingComponentevents.prototype.initInterface = function() { 64124 this.blockBtnEl = this.el.find("#blockOrder")[0]; 64125 this.listBtnEl = this.el.find("#listOrder")[0]; 64126 this.moreNewsBtnEl = this.el.find("#moreNews")[0]; 64127 this.newsContainerEl = this.el.find("#newsContainer")[0]; 64128 this.blockBtnEl.addEventListener( 64129 "click", 64130 function(event) { 64131 this.orderArticles(event); 64132 }.bind(this) 64133 ); 64134 this.listBtnEl.addEventListener( 64135 "click", 64136 function(event) { 64137 this.orderArticles(event); 64138 }.bind(this) 64139 ); 64140 this.filterBtn.addEventListener( 64141 "click", 64142 function() { 64143 this.toggleFilterMenu(); 64144 }.bind(this) 64145 ); 64146 if (this.moreNewsBtnEl !== undefined) { 64147 this.moreNewsBtnEl.addEventListener( 64148 "click", 64149 function(event) { 64150 this.toggleMoreArticles(event); 64151 64152 }.bind(this) 64153 ); 64154 } 64155 if (this.newsList) { 64156 for (var i = 0; i < this.newsList.length; i++) { 64157 if (i > 8) { 64158 this.newsList[i].hidden = true; 64159 } 64160 } 64161 } 64162 64163 /*Added to show list view by default*/ 64164 var self=this; 64165 setTimeout(function(){ 64166 self.listBtnEl.click(); 64167 },300) 64168 /* end*/ 64169 64170 }; 64171 64172 listingComponentevents.prototype.initMasonry = function() { 64173 var grid = this.el.find(".grid").imagesLoaded(function() { 64174 grid.masonry({ 64175 itemSelector: ".grid-item", 64176 percentPosition: true, 64177 columnWidth: ".grid-sizer", 64178 horizontalOrder: false 64179 }); 64180 }); 64181 this.masonry = grid; 64182 }; 64183 64184 listingComponentevents.prototype.orderArticles = function(event) { 64185 if (event.target.id === "blockOrder") { 64186 if(this.blockBtnEl.classList.contains("active")){ 64187 return; 64188 } 64189 this.blockBtnEl.classList.add("active"); 64190 this.listBtnEl.classList.remove("active"); 64191 this.cleanGrid(); 64192 this.defaultItem = this.defaultType; 64193 this.masonry.masonry(); 64194 this.resetRenderList(); 64195 } 64196 if (event.target.id === "listOrder") { 64197 if(this.listBtnEl.classList.contains("active")){ 64198 return; 64199 } 64200 this.blockBtnEl.classList.remove("active"); 64201 this.listBtnEl.classList.add("active"); 64202 this.cleanGrid(); 64203 this.defaultItem = 'listingListItems'; 64204 this.masonry.masonry('destroy'); 64205 //window.mason = this.masonry; 64206 this.resetRenderList(); 64207 } 64208 $(".articlecontainerlist").addClass("ascending"); ul = $('.grid-container-article'); // your parent ul element 64209ul.children().each(function(i,li){ul.prepend(li)}) 64210 }; 64211 64212 listingComponentevents.prototype.toggleMoreArticles = function() { 64213 this.currentPage++; 64214 var self = this; 64215 var listItems = currentArticlesevents.slice(this.currentPage * this.limit, (this.currentPage + 1) * this.limit); 64216 var maxPage = Math.floor(currentArticlesevents.length / this.limit); 64217 if(this.moreNewsBtnEl.classList.contains("fa-chevron-up")){ 64218 this.resetRenderList(); 64219 $('html, body').animate({ 64220 scrollTop: $(".container.component-listing").offset().top 64221 }, 200); 64222 return; 64223 } 64224 var elements = $(this.listingTemplate({articles:listItems, defaultItem: this.defaultItem})); 64225 this.moreNewsBtnEl.classList.remove("fa-chevron-up"); 64226 if(this.defaultItem === 'listingListItems') { 64227 var container = this.el.find(".grid-container-article-events"); 64228 64229 container.append(elements); 64230 64231 } else { 64232 this.masonry.append(elements).masonry('appended', elements); 64233 } 64234 if(this.currentPage >= maxPage){ 64235 this.moreNewsBtnEl.classList.remove("fa-chevron-down"); 64236 this.moreNewsBtnEl.classList.add("fa-chevron-up"); 64237 64238 64239 } 64240 64241 }; 64242 listingComponentevents.prototype.cleanGrid = function(){ 64243 var html = this.el.find(".news-container-grid"); 64244 if(this.defaultItem === 'listingListItems') { 64245 this.el.find(".grid-container-article-events").empty(); 64246 } else { 64247 this.masonry.masonry('remove', html).masonry(); 64248 } 64249 } 64250 listingComponentevents.prototype.toggleFilterMenu = function() { 64251 if (this.filterEl) { 64252 this.filterEl.classList.toggle("filter-open"); 64253 } 64254 }; 64255$(function() { 64256 $(".component-listing.container").each(function(i,e) { 64257 var listingSearchPath = $(this).data('path'); 64258 $.get("/dupont/getListingItems/corporateData", { listingSearchPath: listingSearchPath }, function(data, status){ 64259 window.globalArticleData = data; 64260 64261 new Filters($(".filter-box")); 64262 new listingComponent($(e)); 64263 }); 64264 }); 64265 64266 }); 64267 64268 $(function() { 64269 $(".articlecomponentlisting.container").each(function(i,e) { 64270 var listingSearchPath = $(this).data('path'); 64271 $.get("/dupont/getListingItems/corporateData", { listingSearchPath: listingSearchPath }, function(data, status){ 64272 window.globalArticleDataevents = data; 64273 64274 new Filters2($(".articlecomponentlisting .filter-box")); 64275 new listingComponentevents($(e)); 64276 }); 64277 }); 64278 64279 }); 64280 64281 64282window.onscroll = function() {scrollFunction()}; 64283 64284function scrollFunction() { 64285 64286if (document.documentElement.scrollTop >= window.innerHeight 64287 || window.pageYOffset >= window.innerHeight) { 64288 $('#jump').addClass('active'); 64289} else { 64290 $('#jump').removeClass('active'); 64291} 64292} 64293 64294function goToTop() { 64295 64296$('html, body').animate({scrollTop: 0}, 520); 64297} 64298$(function() { 64299 64300 var isComp = function(cl) { 64301 64302 this.el = $($('.' + cl)[0]); 64303 this.elHeight = $(this.el.find('.wrap')[0]).height(); 64304 this.imgWraps = this.el.find('.scroll-interaction--wrappers .wrap'); 64305 this.el.find('.empty_container').height(this.elHeight * this.imgWraps.length); 64306 this.tabletBreakPoint = 1023; 64307 this.setUnderline(); 64308 this.mobileDevice = this.detectMobileDevice(); 64309 this.setOnwindowResize(); 64310 64311 }; 64312 64313 64314 isComp.prototype.setUnderline = function() { 64315 64316 var self = this; 64317 64318 self.toolTipTopArr = []; 64319 64320 $.each(this.imgWraps, function(i, v) { 64321 64322 var ttPos = $(v).find('.tooltip').position(); 64323 var ttTitleHeight = $(v).find('.tt-title').height(); 64324 var hotspotLeft = 0; 64325 64326 if($(v).find('.hotspot').position()){ 64327 64328 hotspotLeft = $(v).find('.hotspot').position().left; 64329 } 64330 64331 self.toolTipTopArr[i] = ttPos.top; 64332 64333 $(v).find('.txt_undrline').css({ 64334 'top': ttPos.top + ttTitleHeight + 10, 64335 'left': ttPos.left + 4 , 64336 'width':hotspotLeft - ttPos.left 64337 }); 64338 }); 64339 64340 }; 64341 64342 isComp.prototype.detectMobileDevice = function() { 64343 64344 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 64345 64346 return true; 64347 } else { 64348 64349 return false;
64350 } 64351 }; 64352 64353 isComp.prototype.setOnwindowResize = function() { 64354 64355 var self = this; 64356 64357 self.showAllScreens(); 64358 64359 $(window).resize(function() { 64360 64361 self.showAllScreens(); 64362 64363 }); 64364 }; 64365 64366 64367 isComp.prototype.scrollTrack = function() { 64368 64369 var self = this; 64370 64371 64372 $(window).scroll(function() { 64373 64374 if ((window.innerWidth > self.tabletBreakPoint) && (!self.mobileDevice)) { 64375 64376 var scrollTop = $(window).scrollTop(); 64377 self.elScrollTop = self.el.offset().top; 64378 self.elHeight = $(self.el.find('.wrap')[0]).height(); 64379 64380 if (self.el.hasClass('mobile')) { 64381 self.el.removeClass('mobile'); 64382 } 64383 64384 $.each(self.imgWraps, function(i, v) { 64385 64386 var toolTipEl = $(v).find('.tooltip'); 64387 var txt_ul_El = $(v).find('.txt_undrline'); 64388 var currentElTooltip = $(self.imgWraps[i]).find('.tooltip'); 64389 var tooltipPos = (self.elHeight - 512) / 2; 64390 var toolTipLength = 0; 64391 64392 64393 if ((scrollTop >= (self.elScrollTop - window.innerHeight + (self.elHeight * (i + 1)))) && (scrollTop < (self.elScrollTop - window.innerHeight + (self.elHeight * (i + 2)))) && !$(v).hasClass('show-img')) { 64394 64395 self.imgWraps.removeClass('show-img'); 64396 64397 if (!$(v).hasClass('show-img')) { 64398 64399 if (!toolTipEl.hasClass('animate') && (i != (self.imgWraps.length - 1))) { 64400 toolTipEl.addClass('animate'); 64401 $(v).find('.hotspot').addClass('animate'); 64402 64403 } 64404 $(v).addClass('show-img'); 64405 64406 } 64407 } 64408 64409 64410 64411 if ($(self.imgWraps[i + 1]).find('.tooltip').position()) { 64412 64413 tooltipPos += $(self.imgWraps[i + 1]).find('.tooltip').position().top; 64414 64415 } 64416 64417 64418 64419 if (currentElTooltip) { 64420 64421 toolTipLength += self.elHeight - (self.toolTipTopArr[i] + currentElTooltip.height()) - 150; 64422 64423 } 64424 64425 64426 var extraSpace = tooltipPos + toolTipLength; 64427 64428 if(window.innerHeight > 720){ 64429 64430 var leftspace = window.innerHeight - self.elHeight ; 64431 extraSpace = tooltipPos + toolTipLength-leftspace ; 64432 } 64433 64434 if(window.innerHeight > 1000){ 64435 64436 var leftspace = window.innerHeight - self.elHeight ; 64437 extraSpace = tooltipPos + toolTipLength-2*leftspace ; 64438 } 64439 64440 64441 64442 if ((scrollTop >= (self.elScrollTop - window.innerHeight + (self.elHeight * (i + 1)) + extraSpace)) && (scrollTop < (self.elScrollTop - window.innerHeight + (self.elHeight * (i + 2)))) && $(v).hasClass('show-img')) { 64443 64444 if (!toolTipEl.hasClass('animate') && (i != (self.imgWraps.length - 1))) { 64445 toolTipEl.addClass('animate'); 64446 $(v).find('.hotspot').addClass('animate'); 64447 64448 } 64449 if (toolTipEl.hasClass('animate-back')) { 64450 //toolTipEl.removeClass('animate-back'); 64451 } 64452 64453 if (!txt_ul_El.hasClass('animate') && (i != (self.imgWraps.length - 1))) { 64454 $(v).find('.txt_undrline').addClass('animate'); 64455 } 64456 64457 } else if ((scrollTop >= (self.elScrollTop - window.innerHeight + (self.elHeight * (i + 1)))) && (scrollTop < (self.elScrollTop - window.innerHeight + (self.elHeight * (i + 1)) + extraSpace)) && $(v).hasClass('show-img')) { 64458 64459 if (toolTipEl.hasClass('animate') && (i != (self.imgWraps.length - 1))) { 64460 toolTipEl.removeClass('animate'); 64461 $(v).find('.hotspot').removeClass('animate'); 64462 64463 } 64464 if (!toolTipEl.hasClass('animate-back') && (i != (self.imgWraps.length - 1))) { 64465 //toolTipEl.addClass('animate-back'); 64466 } 64467 64468 64469 if (txt_ul_El.hasClass('animate') && (i != (self.imgWraps.length - 1))) { 64470 $(v).find('.txt_undrline').removeClass('animate'); 64471 } 64472 64473 } 64474 64475 64476 }); 64477 64478 } 64479 }) 64480 64481 }; 64482 64483 isComp.prototype.showAllScreens = function() { 64484 64485 if ((window.innerWidth <= this.tabletBreakPoint) || (this.mobileDevice)) { 64486 64487 this.el.addClass('mobile'); 64488 } 64489 }; 64490 64491 64492 64493 64494 $.each($('.is-comp'), function(i, v) {
64495 $(v).addClass("is-" + i); 64496 (new isComp("is-" + i)).scrollTrack(); 64497 64498 }); 64499 64500 /* Full bg image view ends*/ 64501 64502 64503 64504}); 64505 64506function ImmersiveImages(elm) { 64507 this.elm = elm; 64508 this.carousel; 64509 this.breakpoint = 992; 64510 this.init(); 64511} 64512 64513ImmersiveImages.prototype.slick = function() { 64514 if (this.carousel) { 64515 return; 64516 } 64517 this.carousel = this.elm.slick({ 64518 speed: 100, 64519 arrows: false, 64520 cssEase: 'linear', 64521 slidesToShow: 1, 64522 slidesToScroll: 1, 64523 draggable: true, 64524 swipe: true, 64525 infinite: false, 64526 centerMode: true, 64527 centerPadding: '18px' 64528 }); 64529} 64530ImmersiveImages.prototype.unslick = function() { 64531 if (!this.carousel) { 64532 return; 64533 } 64534 this.elm.slick('unslick'); 64535 this.carousel = false; 64536} 64537ImmersiveImages.prototype.checkSlick = function() { 64538 if ($(window).width() >= this.breakpoint) { 64539 return this.unslick(); 64540 } 64541 this.slick(); 64542} 64543ImmersiveImages.prototype.init = function() { 64544 this.checkSlick(); 64545 var self = this; 64546 $(window).resize(function() { 64547 self.checkSlick(); 64548 }); 64549} 64550$(function() { 64551 new ImmersiveImages($(".immersive-images")); 64552}); 64553 64554function ImmersiveArticleNavigation(element) { 64555 this.el = element; 64556 this.navBarEl = $('.component-navigation').first(); 64557 this.titleEl = $('.title').first(); 64558 this.shareIconsEl = this.el.find('.component-immersive-article-navigation--contain-share').first(); 64559 this.navIconsTargetEl = this.navBarEl.find('.component-navigation--logo').first(); 64560 this.lastScrollY = $(window).scrollTop(); 64561 this.minimunScroll = 50; 64562 this.setupNavForIcons(); 64563 this.initializeEvents(); 64564} 64565 64566ImmersiveArticleNavigation.prototype.setupNavForIcons = function () { 64567 if (this.navIconsTargetEl) { 64568 this.navIconsTargetEl.append('<div class="navigationShare immersiveShare">'+ this.titleEl.html() + this.shareIconsEl.html() + '</div>'); 64569 } 64570}; 64571 64572 64573ImmersiveArticleNavigation.prototype.checkScroll = function (e) { 64574 var self = this, 64575 scrollY = $(window).scrollTop(), 64576 windowW = $(window).width(), 64577 scrollMax = ($(document).height() - $(window).height()), 64578 isSafari = (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1); 64579 scrollY = scrollY < 0 ? 0 : scrollY; 64580 if (windowW >= 1024) { 64581 64582 var scrollElastic = (isSafari) ? document.body.scrollTop : window.scrollY; 64583 this.navIconsTargetEl.removeClass('showShare'); 64584 var absScrollDiff = Math.abs(scrollY - this.lastScrollY); 64585 if(absScrollDiff < this.minimunScroll && scrollY !== 0) { 64586 return; 64587 } 64588 if (scrollElastic > 0 && scrollElastic < scrollMax) { 64589 if (scrollY > this.lastScrollY) { 64590 this.el.addClass('scroll-postop'); 64591 self.el.removeClass('scroll-postop-out').addClass('scroll-postop-in'); 64592 this.navBarEl.addClass('scroll-out').removeClass('scroll-in'); 64593 } else { 64594 if(self.el.hasClass('scroll-postop-in') && self.navBarEl.hasClass('scroll-in')){ 64595 self.el.removeClass('scroll-postop-in').addClass('scroll-postop-out'); 64596 } 64597 setTimeout(function () { 64598 if(self.navBarEl.hasClass('scroll-in')){ 64599 self.el.removeClass('scroll-postop scroll-postop-in scroll-postop-out'); 64600 } 64601 }, 400); 64602 this.navBarEl.removeClass('scroll-out').addClass('scroll-in'); 64603 } 64604 this.lastScrollY = scrollY; 64605 } 64606 } else { 64607 if(this.navBarEl.hasClass('scroll-out')){ 64608 this.navBarEl.removeClass('scroll-out').addClass('scroll-in'); 64609 this.el.removeClass('scroll-postop scroll-postop-in scroll-postop-out'); 64610 } 64611 if (this.navIconsTargetEl) { 64612 if (scrollY > this.lastScrollY) { 64613 this.navIconsTargetEl.addClass('showShare'); 64614 this.navIconsTargetEl.addClass('scroll-postop'); 64615 } else { 64616 this.navIconsTargetEl.removeClass('showShare'); 64617 this.navIconsTargetEl.removeClass('scroll-postop'); 64618 } 64619 this.lastScrollY = scrollY; 64620 } 64621 } 64622}; 64623 64624ImmersiveArticleNavigation.prototype.initializeEvents = function () { 64625 64626 var supportsOrientationChange = "onorientationchange" in window, 64627 orientationEvent = supportsOrientationChange ? "orientationchange" : "resize", 64628 self = this; 64629 64630 $(window).on("scroll", this.checkScroll.bind(this)); 64631 $(window).on(orientationEvent, this.checkScroll.bind(this)); 64632 $(window).resize(this.checkScroll.bind(this)); 64633}; 64634 64635$(function () { 64636 $(".component-immersive-article-navigation").each(function () { 64637 new ImmersiveArticleNavigation($(this)); 64638 }); 64639}); 64640 64641function ImmersiveAccordion(el) { 64642 this.el = el; 64643 this.itemEls = this.el.find(".accordion-item"); 64644 this.defaultActive = this.el[0].attributes["data-active-item"].nodeValue - 1; 64645 this.active = this.el.find(".active")[0].attributes["data-item"].nodeValue; 64646 this.updateActiveItem = updateActiveItem.bind(this); 64647 this.calculateSizes = calculateSizes.bind(this); 64648 this.calculateItemStyles = calculateItemStyles.bind(this); 64649 this.updateAccordionItems = throttle( 64650 this.updateAccordionItems.bind(this), 64651 450 64652 ); 64653 this.init(); 64654 this.updateAccordionItems(); 64655 this.setDefaultSlideCarousel(); 64656} 64657 64658ImmersiveAccordion.prototype.init = function() { 64659 for (var i = 0; i < this.itemEls.length; i++) { 64660 this.itemEls[i].addEventListener("mouseenter", this.updateActiveItem); 64661 } 64662 window.addEventListener("resize", this.updateAccordionItems); 64663 this.initCarousel(); 64664}; 64665 64666function updateActiveItem(ev) { 64667 var newActive = ev.target.attributes["data-item"].nodeValue; 64668 if (newActive === this.active) { 64669 return; 64670 } 64671 this.active = newActive; 64672 this.updateAccordionItems(); 64673} 64674 64675function calculateSizes() { 64676 this.fullWidth = this.el.find(".accordion-container")[0].offsetWidth; 64677 this.closed = Math.floor(this.fullWidth / 6); 64678 this.open = Math.floor(this.closed * 2.5); 64679} 64680 64681function calculateItemStyles(itemEl) { 64682 var styles = {}; 64683 var position = itemEl.attributes["data-item"].nodeValue; 64684 64685 if (position < this.active) { 64686 $(itemEl).removeClass("active"); 64687 styles.width = this.closed + "px"; 64688 } 64689 if (position === this.active) { 64690 $(itemEl).addClass("active"); 64691 styles.width = this.open + "px"; 64692 } 64693 if (position > this.active) { 64694 $(itemEl).removeClass("active"); 64695 styles.width = this.closed + "px"; 64696 } 64697 64698 $(itemEl).css(styles); 64699} 64700 64701ImmersiveAccordion.prototype.updateAccordionItems = function() { 64702 if (window.innerWidth < 1024) { 64703 return; 64704 } 64705 this.calculateSizes(); 64706 for (var i = 0; i < this.itemEls.length; i++) { 64707 var currentEl = this.itemEls[i]; 64708 this.calculateItemStyles(currentEl); 64709 } 64710}; 64711 64712ImmersiveAccordion.prototype.initCarousel = function() { 64713 this.lastSlide = document.createElement("div"); 64714 this.lastSlide.classList.add("accordion-carousel-item");
64715 this.carouselEl = this.el.find(".accordion-immersive-carousel"); 64716 this.carouselEl[0].append(this.lastSlide); 64717 this.carouselEl.slick({ 64718 slidesToShow: 1.1, 64719 infinite: false, 64720 touchThreshold: 10, 64721 waitForAnimate: false, 64722 speed: 333, 64723 arrows: false, 64724 mobileFirst: true, 64725 responsive: [ 64726 { 64727 breakpoint: 1, 64728 settings: {} 64729 }, 64730 { 64731 breakpoint: 576, 64732 settings: { 64733 slidesToShow: 1.6, 64734 swipe: true, 64735 arrows: false, 64736 centerMode: false 64737 } 64738 }, 64739 { 64740 breakpoint: 1024, 64741 settings: {} 64742 } 64743 ] 64744 }); 64745 this.carouselEl.on( 64746 "breakpoint", 64747 function(event, slick, breakpoint) { 64748 if (breakpoint === 1024) { 64749 return; 64750 } 64751 this.setDefaultSlideCarousel(); 64752 }.bind(this) 64753 ); 64754 64755 this.carouselEl.on( 64756 "beforeChange", 64757 function(event, slick, currentSlide, nextSlide) { 64758 if (nextSlide === 5) { 64759 event.preventDefault(); 64760 setTimeout(function() { 64761 slick.slickGoTo(4); 64762 }, 50); 64763 } 64764 }.bind(this) 64765 ); 64766}; 64767 64768ImmersiveAccordion.prototype.setDefaultSlideCarousel = function() { 64769 if (window.innerWidth > 1024) { 64770 return; 64771 } 64772 this.carouselEl[0].slick.slickGoTo(this.defaultActive); 64773}; 64774 64775function throttle(func, wait, options) { 64776 var context, args, result; 64777 var timeout = null; 64778 var previous = 0; 64779 if (!options) options = {}; 64780 var later = function() { 64781 previous = options.leading === false ? 0 : Date.now(); 64782 timeout = null; 64783 result = func.apply(context, args); 64784 if (!timeout) context = args = null; 64785 }; 64786 return function() { 64787 var now = Date.now(); 64788 if (!previous && options.leading === false) previous = now; 64789 var remaining = wait - (now - previous); 64790 context = this; 64791 args = arguments; 64792 if (remaining <= 0 || remaining > wait) { 64793 if (timeout) { 64794 clearTimeout(timeout); 64795 timeout = null; 64796 } 64797 previous = now; 64798 result = func.apply(context, args); 64799 if (!timeout) context = args = null; 64800 } else if (!timeout && options.trailing !== false) { 64801 timeout = setTimeout(later, remaining); 64802 } 64803 return result; 64804 }; 64805} 64806 64807$(function() { 64808 $(".component-immersive-accordion").each(function() { 64809 new ImmersiveAccordion($(this)); 64810 }); 64811}); 64812 64813function ImmersiveAccordionV2(el) { 64814 this.el = el; 64815 this.itemEls = this.el.find(".accordion-item"); 64816 this.defaultActive = this.el[0].attributes["data-active-item"].nodeValue - 1; 64817 this.active = this.el.find(".active")[0].attributes["data-item"].nodeValue; 64818 this.updateActiveItem = this.updateActiveItem.bind(this); 64819 this.calculateSizes = this.calculateSizes.bind(this); 64820 this.calculateItemStyles = this.calculateItemStyles.bind(this); 64821 this.updateAccordionItems = throttle( 64822 this.updateAccordionItems.bind(this), 64823 450 64824 ); 64825 this.init(); 64826 this.updateAccordionItems(); 64827 this.setDefaultSlideCarousel(); 64828 64829 /*setTimeout(function(){ 64830 el.css('visibility','visible'); 64831 },600);*/ 64832 64833} 64834 64835ImmersiveAccordionV2.prototype.init = function() { 64836 var self = this; 64837 for (var i = 0; i < this.itemEls.length; i++) { 64838 this.itemEls[i].addEventListener("mouseenter", this.updateActiveItem.bind(this)); 64839 } 64840 window.addEventListener("resize", this.updateAccordionItems); 64841 this.initCarousel(); 64842 64843 64844}; 64845 64846 64847ImmersiveAccordionV2.prototype.updateActiveItem = function(ev) { 64848 64849 var newActive = $(ev.target).attr("data-item"); 64850 if(newActive === this.active) { 64851 return; 64852 } 64853 64854 this.active = newActive; 64855 this.updateAccordionItems(); 64856}; 64857 64858ImmersiveAccordionV2.prototype.calculateSizes = function() { 64859 this.fullWidth = this.el.find(".accordion-container").first().width(); 64860 this.fullHeight = this.el.find(".accordion-container").first().height(); 64861 this.closed = Math.floor(this.fullWidth / 6); 64862 this.open = Math.floor(this.closed * 2.5); 64863}; 64864 64865ImmersiveAccordionV2.prototype.calculateItemStyles = function(itemEl) { 64866 var el = $(itemEl); 64867 var position = el.attr("data-item"); 64868 64869 if (position !== this.active) { 64870 64871 el.width(this.closed + "px"); 64872 el.find('img').height(this.fullHeight + "px"); 64873 el.find('.text').css({'transition-delay':'0.3s','transition-duration':'.3s'}); 64874 el.removeClass("active"); 64875 } else { 64876 64877 el.attr('style',''); 64878 el.find('img').height( (this.fullHeight + 100) + "px"); 64879 // el.find('.text').width( Math.floor(this.open*0.7 ) + "px"); 64880 el.find('.text').css({'width':Math.floor(this.open*0.7)+'px'}); 64881 el.addClass('active'); 64882 } 64883}; 64884 64885ImmersiveAccordionV2.prototype.updateAccordionItems = function() { 64886 if (window.innerWidth < 1024) { 64887 return; 64888 } 64889 64890 this.calculateSizes(); 64891 for (var i = 0; i < this.itemEls.length; i++) { 64892 var currentEl = this.itemEls[i]; 64893 this.calculateItemStyles(currentEl); 64894 } 64895}; 64896 64897ImmersiveAccordionV2.prototype.initCarousel = function() {
64898 this.carouselEl = this.el.find(".accordion-immersive-carousel"); 64899 this.carouselEl.slick({ 64900 slidesToShow: 1.1, 64901 infinite: false, 64902 touchThreshold: 10, 64903 waitForAnimate: false, 64904 speed: 333, 64905 arrows: false, 64906 mobileFirst: true, 64907 responsive: [ 64908 { 64909 breakpoint: 1, 64910 settings: {} 64911 }, 64912 { 64913 breakpoint: 576, 64914 settings: { 64915 slidesToShow: 1.6, 64916 swipe: true, 64917 arrows: false, 64918 centerMode: false 64919 } 64920 }, 64921 { 64922 breakpoint: 1024, 64923 settings: {} 64924 } 64925 ] 64926 }); 64927 this.carouselEl.on( 64928 "breakpoint", 64929 function(event, slick, breakpoint) { 64930 if (breakpoint === 1024 || breakpoint === 1) { 64931 return; 64932 } 64933 this.setDefaultSlideCarousel(); 64934 }.bind(this) 64935 ); 64936}; 64937 64938ImmersiveAccordionV2.prototype.setDefaultSlideCarousel = function() { 64939 if (window.innerWidth > 1024) { 64940 return; 64941 } 64942 this.carouselEl[0].slick.slickGoTo(this.defaultActive); 64943}; 64944 64945function throttle(func, wait, options) { 64946 var context, args, result; 64947 var timeout = null; 64948 var previous = 0; 64949 if (!options) options = {}; 64950 var later = function() { 64951 previous = options.leading === false ? 0 : Date.now(); 64952 timeout = null; 64953 result = func.apply(context, args); 64954 if (!timeout) context = args = null; 64955 }; 64956 return function() { 64957 var now = Date.now(); 64958 if (!previous && options.leading === false) previous = now; 64959 var remaining = wait - (now - previous); 64960 context = this; 64961 args = arguments; 64962 if (remaining <= 0 || remaining > wait) { 64963 if (timeout) { 64964 clearTimeout(timeout); 64965 timeout = null; 64966 } 64967 previous = now; 64968 result = func.apply(context, args); 64969 if (!timeout) context = args = null; 64970 } else if (!timeout && options.trailing !== false) { 64971 timeout = setTimeout(later, remaining); 64972 } 64973 return result; 64974 }; 64975} 64976 64977$(function() { 64978 $(".component-immersive-accordion-v2").each(function() { 64979 new ImmersiveAccordionV2($(this)); 64980 }); 64981}); 64982 64983 64984 64985 64986 64987 64988 /* Toggle Micro Plugin */ 64989 jQuery.fn.clickToggle = function(a, b) { 64990 return this.on("click", function(ev) { [b, a][this.$_io ^= 1].call(this, ev) }) 64991 }; 64992/*** */ 64993 $(function () { 64994 64995 64996 var gsZ_View = function (cl) { 64997 this.el = $($('.' + cl)[0]); 64998 this.psaccountId = this.el.find(".cta.ps-widget").attr('data-ps-account'); 64999 65000 if(this.psaccountId){ 65001 var metaTag = '<meta name="ps-account" content="'+this.psaccountId+'">'; 65002 $('head').find("[name='ps-account']").remove(); 65003 $('head').append(metaTag); 65004 } 65005 65006 }; 65007 65008 gsZ_View.prototype.setZoom = function () { 65009 //var gs_root_class =".gs-zoomImg-view"; 65010 var gs_root_class = this.el; 65011 65012 copyImage(); 65013 slideCounter(); 65014 65015 $('.zoom-img',gs_root_class).zoom({ on: 'click', magnify:1.2 }); 65016 65017 function slideCounter() { 65018 var $slider = $('.thumb-imgs-list', gs_root_class); 65019 if ($slider.length) { 65020 var currentSlide; 65021 var slidesCount; 65022 var sliderCounter = document.createElement('div'); 65023 sliderCounter.classList.add('slider__counter'); 65024 65025 var updateSliderCounter = function (slick, currentIndex) { 65026 currentSlide = slick.slickCurrentSlide() + 1; 65027 slidesCount = slick.slideCount; 65028 $(sliderCounter).text(currentSlide + '/' + slidesCount) 65029 }; 65030 65031 $slider.on('init', function (event, slick) { 65032 $slider.append(sliderCounter); 65033 updateSliderCounter(slick); 65034 }); 65035 65036 $slider.on('afterChange', function (event, slick, currentSlide) { 65037 updateSliderCounter(slick, currentSlide); 65038 }); 65039 65040 addSlickOnZoom(); 65041 } 65042 } 65043 65044 $(window).resize(function() { 65045 65046 addSlickOnZoom(); 65047 }); 65048 65049 function addSlickOnZoom(){ 65050 65051 var thumbImgsList = $('.thumb-imgs-list'); 65052 65053 if(thumbImgsList.length){ 65054 65055 if (window.innerWidth < 1200) { 65056 65057 if(!thumbImgsList.hasClass('slick-slider')){ 65058 thumbImgsList.slick({ 65059 arrows: true, 65060 slidesToShow: 1, 65061 infinite: false, 65062 slidesToScroll: 1, 65063 65064 }); 65065 65066 65067 65068 } 65069 65070 thumbImgsList.find(".slider__counter").css({'display':'block', 'width':thumbImgsList.width()}); 65071 thumbImgsList.css('overflow-y','unset'); 65072 65073 }else{ 65074 65075 if(thumbImgsList.hasClass('slick-slider')){ 65076 65077 thumbImgsList.slick('unslick'); 65078 thumbImgsList.find(".slider__counter").hide(); 65079 65080 65081 } 65082 65083 if(thumbImgsList.find('.thumb-img').length<5){ 65084 65085 thumbImgsList.css('overflow-y','hidden'); 65086 } 65087 else{ 65088 65089 thumbImgsList.css('overflow-y','auto'); 65090 } 65091 65092 } 65093 65094 } 65095 65096 } 65097 65098 65099 function copyImage() { 65100 $(".zoom-img" , gs_root_class).empty(); 65101 $(".zoom-img" , gs_root_class).append($(".thumb-img.active", gs_root_class).html()); 65102 65103 $(".thumb-img", gs_root_class).on('click', function () { 65104 var x=$(this).children("img").attr("src"); 65105 $(".mod-img").attr("src",x); 65106 65107 $(".zoom-img", gs_root_class).removeClass("zoom-cur"); 65108 $(".thumb-img", gs_root_class).removeClass("active"); 65109 $(this).addClass("active"); 65110 65111 $(".zoom-img", gs_root_class).empty(); 65112 $(".zoom-img", gs_root_class).append($(this).html()); 65113 65114 $('.zoom-img').zoom({ on: 'click',magnify:1.2 }); 65115 }); 65116 } 65117 65118 if ($(window).width() > 1200) { 65119 $(".thumb-img" , gs_root_class).removeAttr("data-toggle"); 65120 } 65121 65122 /***Zoom In Out Cursor Toggle */ 65123 $('.zoom-img',gs_root_class).clickToggle(function(ev) { 65124 if($(this).hasClass("zoom-cur")){ 65125 $(this).removeClass("zoom-cur"); 65126 }else{ 65127 $(this).addClass("zoom-cur"); 65128 } 65129 }, function(ev) { 65130 if($(this).hasClass("zoom-cur")){ 65131 $(this).removeClass("zoom-cur"); 65132 }else{ 65133 $(this).addClass("zoom-cur"); 65134 } 65135 }); 65136 /******* */ 65137 }; 65138 65139 $.each($('.gs-zoomImg-view'), function (i, v) { 65140 $(v).addClass("gsz-" + i); 65141 (new gsZ_View("gsz-" + i)).setZoom(); 65142 }); 65143}); 65144 65145 65146 65147var pdslideIndex = 1; 65148pdshowSlides(pdslideIndex); 65149 65150function plusSlides(n) { 65151 pdshowSlides(pdslideIndex += n); 65152} 65153 65154function currentSlide(n) { 65155 pdshowSlides(pdslideIndex = n); 65156} 65157 65158function pdshowSlides(n) { 65159 var i; 65160 var slides = document.getElementsByClassName("pdmySlides"); 65161 65162 if (n > slides.length) {pdslideIndex = 1} 65163 if (n < 1) {pdslideIndex = slides.length} 65164 for (i = 0; i < slides.length; i++) { 65165 slides[i].style.display = "none"; 65166 slides[pdslideIndex-1].style.display = "block"; 65167 } 65168 65169 65170 65171} 65172 65173jQuery(document).ready(function($){ 65174 $('.p-sizes div').first().addClass('active'); 65175 65176 $('.size-1').on({ 65177 'click': function(){ 65178 $('.activeimage-1').addClass('activeimg').siblings().removeClass('activeimg'); 65179 65180 } 65181 }); 65182 65183 $('.size-2').on({ 65184 'click': function(){ 65185 65186 $('.activeimage-2').addClass('activeimg').siblings().removeClass('activeimg'); 65187 65188 } 65189 }); 65190 65191 $('.size-3').on({ 65192 'click': function(){ 65193 $('.activeimage-3').addClass('activeimg').siblings().removeClass('activeimg'); 65194 } 65195 }); 65196 $('.size-4').on({ 65197 'click': function(){ 65198 $('.activeimage-4').addClass('activeimg').siblings().removeClass('activeimg'); 65199 } 65200 }); 65201 65202 $('.size-5').on({ 65203 'click': function(){ 65204 $('.activeimage-5').addClass('activeimg').siblings().removeClass('activeimg'); 65205 } 65206 }); 65207 65208 $('.size-6').on({ 65209 'click': function(){ 65210 $('.activeimage-6').addClass('activeimg').siblings().removeClass('activeimg'); 65211 } 65212 }); 65213 65214 $('.size-7').on({ 65215 'click': function(){ 65216 $('.activeimage-7').addClass('activeimg').siblings().removeClass('activeimg'); 65217 } 65218 }); 65219 65220 $(document).on('click', '.p-sizes div', function(){ 65221 $(this).addClass('active').siblings().removeClass('active'); 65222 }) 65223 65224 65225}); 65226$(function(){ 65227 function zoomImage(cmp, action) { 65228 cmp.find('.image-zoom-round--image img').attr('src', action.children('img').first().data('img-src')) 65229 $('.image-zoom-round--thumbnail__active').removeClass('image-zoom-round--thumbnail__active') 65230 action.parent().addClass('image-zoom-round--thumbnail__active') 65231 } 65232 65233 function adjustZoomImage() { 65234 $('.image-zoom-round').each(function() { 65235 var cmp = $(this); 65236 var img = cmp.find('.image-zoom-round--image img'); 65237 var w = img.width(); 65238 img.css({'height':w+'px'}) 65239 img.addClass('img-loaded'); 65240 cmp.find('.image-zoom-round--thumbnail a').click(function(e) { 65241 e.preventDefault(); 65242 var action = $(this); 65243 zoomImage(cmp, action) 65244 }) 65245 65246 cmp.find('.image-zoom-round--small').css({justifyContent: ''}) 65247 if($( window ).width() > 767) { 65248 cmp.find('.image-zoom-round--small').height(w); 65249 cmp.find('.image-zoom-round--thumbnail').height(w/4 -5); 65250 cmp.find('.image-zoom-round--thumbnail').width(w/4 -5); 65251 } 65252 else { 65253 cmp.find('.image-zoom-round--small').height('unset'); 65254 cmp.find('.image-zoom-round--thumbnail').height('unset'); 65255 cmp.find('.image-zoom-round--thumbnail').width('unset'); 65256 if(cmp.find('.image-zoom-round--thumbnail').length > 4) cmp.find('.image-zoom-round--small').css({justifyContent: 'flex-start'}) 65257 } 65258 zoomImage(cmp, cmp.find('.image-zoom-round--thumbnail a').first()); 65259 if($(window).width()>=768){ 65260 $('.image-gallery.tedlar-map-view').find('.cta-block').css('top', ($('.image-gallery.tedlar-map-view').find('.image-zoom-round--small').outerHeight()+30)+'px' ); 65261 }else{ 65262 $('.image-gallery.tedlar-map-view').find('.cta-block').css('top', 'unset' ); 65263 } 65264 65265 65266 }); 65267 } 65268 adjustZoomImage(); 65269 65270 $( window ).resize(function() { 65271 adjustZoomImage(); 65272 }); 65273}); 65274 65275$(document).ready(function(){ 65276 console.log("readyy"); 65277 $("#more-images").click(function(){ 65278 console.log("inside click"); 65279 $(".extra-img").show(); 65280 $("#more-images").hide(); 65281 $("#less-images").show(); 65282 }); 65283 65284 $("#less-images").click(function(){ 65285 console.log("inside click"); 65286 $(".extra-img").hide(); 65287 $("#more-images").show(); 65288 $("#less-images").hide(); 65289 }); 65290 65291 $(".button").click(function(){ 65292 window.location=$(this).find("a").attr("href"); return false;
65293 }); 65294 65295 65296 65297 var x = window.matchMedia("(max-width: 767px)"); 65298 if (x.matches){ 65299 let slideIndex = 1; 65300 showSlides(slideIndex); 65301 65302 function currentSlide(n) { 65303 showSlides(slideIndex = n); 65304 } 65305 65306 function showSlides(n) { 65307 let i; 65308 let slides = document.getElementsByClassName("slides"); 65309 console.log(slides,"slides"); 65310 console.log(n,"value of n"); 65311 let dots = document.getElementsByClassName("dot"); 65312 65313 if (n > slides.length) { 65314 slideIndex = 1} 65315 if (n < 1) {slideIndex = slides.length} 65316 for (i = 0; i < slides.length; i++) { 65317 slides[i].style.display = "none"; 65318 } 65319 for (i = 0; i < dots.length; i++) { 65320 dots[i].className = dots[i].className.replace(" active", ""); 65321 } 65322 console.log(slideIndex,"slideindex"); 65323 slides[slideIndex-1].style.display = "block"; 65324 dots[slideIndex-1].className += " active"; 65325 } 65326 } 65327 65328 // $(".image-modal").on("show",function(){ 65329 // console.log("inside show"); 65330 // var $body = $(document.body); 65331 // var oldWidth = $body.innerWidth(); 65332 // $body.css("overflow", "hidden"); 65333 // $body.width(oldWidth); 65334 // // $("body").addClass("modal-open"); 65335 // }).on("hide",function(){ 65336 // var $body = $(document.body); 65337 // $body.css("overflow", "auto"); 65338 // $body.width("auto"); 65339 // $("body").removeClass("modal-open"); 65340 // }) 65341 65342 let slideIndex; 65343 $(".slides img").on("click",function(){ 65344 $(".image-modal").show(); 65345 // $("body").addClass("modal-open"); 65346 var $body = $(document.body); 65347 var oldWidth = $body.innerWidth(); 65348 $body.css("overflow", "hidden"); 65349 $body.width(oldWidth); 65350 console.log(this.id,"image click"); 65351 slideIndex =this.id; 65352 showSlides(slideIndex); 65353 }); 65354 $(".cross").on("click",function(){ 65355 $(".image-modal").hide(); 65356 // $("body").removeClass("modal-open"); 65357 var $body = $(document.body); 65358 $body.css("overflow", "auto"); 65359 $body.width("auto"); 65360 }) 65361 $(".prev").on("click",function(){ 65362 plusSlides(-1); 65363 }); 65364 $(".next").on("click",function(){ 65365 plusSlides(1); 65366 }) 65367 65368 65369 65370 65371 // Next/previous controls 65372 function plusSlides(n) { 65373 showSlides(slideIndex += n); 65374 } 65375 65376 function showSlides(n) { 65377 let i; 65378 let slides = document.getElementsByClassName("slides-xl"); 65379 console.log(slides,"slides"); 65380 console.log(n,"value of n"); 65381 // let dots = document.getElementsByClassName("dot"); 65382 65383 if (n > slides.length) { 65384 slideIndex = 1} 65385 if (n < 1) {slideIndex = slides.length} 65386 for (i = 0; i < slides.length; i++) { 65387 slides[i].style.display = "none"; 65388 } 65389 // for (i = 0; i < dots.length; i++) { 65390 // dots[i].className = dots[i].className.replace(" active", ""); 65391 // } 65392 console.log(slideIndex,"slideindex"); 65393 slides[slideIndex-1].style.display = "block"; 65394 // dots[slideIndex-1].className += " active"; 65395 } 65396 65397 65398 65399 65400 65401 65402}); 65403 65404(function () { 65405 init(); 65406 function init(){ 65407 65408 let arrowSVG = '<svg width="10" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M1 15l6-7-6-7" stroke="#217AC6" stroke-width="2" fill="none" fill-rule="evenodd"/></svg>'; 65409 65410 $('.image-carousel').each(function(index, elem){ 65411 let options = $(elem).data(); 65412 65413 $(elem).owlCarousel({ 65414 slideBy:'page', 65415 items : options.items || 1, 65416 margin:10, 65417 loop: false, 65418 nav: !options.nav != null ? options.nav : true, 65419 dots: false, 65420 navText: [arrowSVG, arrowSVG] 65421 }); 65422 }); 65423 65424 } 65425})(); 65426var currentSelection = 0; 65427var imageSrcArray = []; 65428var videoSrcArray = []; 65429 65430function traverseGridChildren(){ 65431 $(".imageGrid").each(function(){ 65432 var imageGridChildren = $(this).find(".gridItemParent"); 65433 65434 var itemHeight = $(".gridItem").height() + 10; 65435 var itemWidth = $(".gridItem").width() + 10; 65436 var itemsInColumn = Math.floor($(".selectedImage").height()/itemHeight); 65437 65438 itemsInColumn = itemsInColumn < 5 ? 5 : itemsInColumn; 65439 65440 /*if(imageGridChildren.length <= itemsInColumn*2){ 65441 $(this).closest(".galleryView").find(".navButtons").hide(); 65442 }*/ 65443 65444 var newHTML = ""; 65445 for(var i=0; i<imageGridChildren.length; i++){ 65446 if(i>0 && i%itemsInColumn == 0){ 65447 newHTML += "</div>"; 65448 } 65449 if(i%itemsInColumn == 0){ 65450 newHTML += "<div class=\"imageGridColumn\">"; 65451 } 65452 65453 newHTML += imageGridChildren[i].outerHTML; 65454 65455 if(i == imageGridChildren.length-1){ 65456 newHTML += "</div>"; 65457 } 65458 } 65459 65460 $(this).html(newHTML); 65461 65462 var totalWidth = Math.ceil(imageGridChildren.length/itemsInColumn) * itemWidth; 65463 //var totalHeight = itemsInColumn * itemHeight; 65464 $(this).css("width", totalWidth + "px"); 65465 65466 //resizeThumbnails(); 65467 }); 65468 65469 toggleNavigation(); 65470} 65471 65472function toggleNavigation(){ 65473 $(".imageGrid").each(function(){ 65474 //Hide Buttons 65475 if($(this).is(":visible")){ 65476 var totalColumns = $(this).find(".imageGridColumn"); 65477 if(totalColumns.length < 3) 65478 $(this).closest(".galleryView").find(".navButtons").hide(); 65479 else 65480 $(this).closest(".galleryView").find(".navButtons").show(); 65481 }else{ 65482 $(this).closest(".galleryView").find(".navButtons").show(); 65483 } 65484 }); 65485} 65486 65487function playMedGalVideo(playButton){ 65488 $(playButton).hide(); 65489 var height = $(playButton).closest(".selectedImageContainer").find(".selectedImage").height(); 65490 $(playButton).closest(".selectedImageContainer").find(".selectedVideo").show(); 65491 $(playButton).closest(".selectedImageContainer").find(".selectedVideo")[0].play(); 65492 $(playButton).closest(".selectedImageContainer").find(".selectedVideo").css("max-height", height); 65493} 65494 65495function resizeThumbnails(){ 65496 if($(".imageGrid").is(":visible")){ 65497 $(".imageGrid").each(function(){ 65498 var tobeItemWidth = ($(this).closest(".imageGridParent").width() - 20)/2; 65499 $(".gridItem").css("width", tobeItemWidth + "px"); 65500 65501 var totalWidth = $(this).children().length * ($(this).find(".gridItem").width() + 10); 65502 $(this).css("width", totalWidth+"px"); 65503 }); 65504 65505 if($(".imageGrid").height() > $(".selectedImage").height()){ 65506 traverseGridChildren(); 65507 } 65508 }else{ 65509 $(".navButtons").show(); 65510 } 65511 //resize video 65512 var height = $(".selectedImage").height(); 65513 $(".selectedVideo").css("max-height", height); 65514 65515 toggleNavigation(); 65516 65517 $(".galleryOuterView").height($(".galleryView").height() + 40); 65518} 65519 65520function toggleImageVideo(image, videoURL){ 65521 if(videoURL){ 65522 //Show Video Hide Image 65523 $(image).closest(".galleryView").find("#selectedImage").hide(); 65524 $(image).closest(".galleryView").find(".selectedVideoContainer").show(); 65525 $(image).closest(".galleryView").find("video source").attr("src", videoURL);
65526 $(image).closest(".galleryView").find(".videoFallback").css("display", "block"); 65527 }else{ 65528 //Show Image hide Video 65529 $(image).closest(".galleryView").find("#selectedImage").show(); 65530 $(image).closest(".galleryView").find(".selectedVideoContainer").hide(); 65531 } 65532} 65533 65534function selectImage(image){ 65535 65536 resetVideo(); 65537 65538 65539 //Check for Video 65540 var videoURL = $(image).attr("videoUrl"); 65541 toggleImageVideo(image, videoURL); 65542 65543 var imagePath = $(image).attr("src"); 65544 var imageTitle = $(image).attr("assetTitle"); 65545 var imageDescription = $(image).attr("assetDescription"); 65546 65547 //Change big image path 65548 $(image).closest(".galleryView").find(".selectedImage").attr("src", imagePath); 65549 $(image).closest(".imageGrid").find(".gridItemParent").removeClass("active") 65550 $(image).closest(".gridItemParent").addClass("active"); 65551 65552 if(imageTitle) 65553 $(image).closest(".galleryView").find(".imageTitle").html(imageTitle); 65554 else 65555 $(image).closest(".galleryView").find(".imageTitle").html(""); 65556 65557 if(imageDescription) 65558 $(image).closest(".galleryView").find(".imageDescription").html(imageDescription); 65559 else 65560 $(image).closest(".galleryView").find(".imageDescription").html(""); 65561} 65562 65563function clickImage(overlay){ 65564 var image = $(overlay).closest(".gridItemParent").find("img"); 65565 selectImage(image); 65566} 65567 65568 65569function activeTab(tab){ 65570 imageSrcArray = []; 65571 videoSrcArray = []; 65572 currentSelection = 0; 65573 var activeTab = $(tab).data("assets").trim(); 65574 activeTab = activeTab.replace(/ /g, "_"); 65575 $(".mediaGalleryTabs li").removeClass("active"); 65576 $(tab).addClass("active"); 65577 $(".galleryView[data-gallery]").removeClass("active"); 65578 $(".galleryView[data-gallery="+activeTab+"]").addClass("active"); 65579 65580 resetVideo(); 65581} 65582 65583function resetVideo(){ 65584 //Reset Video 65585 var videos = $(".selectedVideo"); 65586 for(var i=0; i<videos.length; i++){ 65587 if($(videos[i]).is(":visible")){ 65588 videos[i].load();
65589 //Hide Video and Show Banner 65590 $(videos[i]).hide(); 65591 $(videos[i]).closest(".galleryView").find(".videoFallback").show(); 65592 } 65593 } 65594} 65595 65596function scrollIt(button){ 65597 resetVideo(); 65598 var selectedTab = $(".mediaGalleryTabs li.active").data("assets"); 65599 if($(button).closest(".galleryView").find(".imageGrid").is(":visible")){ 65600 var imageGridWidth = $(".imageGrid").width(); 65601 if($(button).closest(".galleryView").find(".imageGridColumn").length >4){ imageGridWidth = $(".imageGridColumn").width()*2} 65602 if(button.id == "left"){ 65603 $(button).closest(".galleryView").find(".imageGridParent").animate({ 65604 scrollLeft: "-="+imageGridWidth+"px" 65605 }, "slow"); 65606 }else if(button.id == "right"){ 65607 $(button).closest(".galleryView").find(".imageGridParent").animate({ 65608 scrollLeft: "+="+imageGridWidth+"px" 65609 }, "slow"); 65610 } 65611 }else{ 65612 if(imageSrcArray.length <=0){ 65613 //Generate Array 65614 saveImageSrc(button); 65615 } 65616 var cSelectedImage = $(button).closest(".galleryView").find(".selectedImage"); 65617 var selectedImage = cSelectedImage.attr("src"); 65618 if(selectedImage.indexOf("http") == -1){ 65619 selectedImage = window.location.origin + selectedImage; 65620 } 65621 65622 currentSelection = imageSrcArray.indexOf(selectedImage); 65623 console.log(currentSelection); 65624 //swap image 65625 if(button.id == "left"){ 65626 //move to previous 65627 if(currentSelection <= 0){ 65628 //First Image 65629 }else{ 65630 //Go to previous image 65631 var newSrc = imageSrcArray[--currentSelection]; 65632 cSelectedImage.attr("src", newSrc); 65633 } 65634 }else if(button.id == "right"){ 65635 //move to next 65636 if(currentSelection >= imageSrcArray.length-1){ 65637 //Last Image 65638 }else{ 65639 //Go to previous image 65640 var newSrc = imageSrcArray[++currentSelection]; 65641 cSelectedImage.removeAttr("src"); 65642 cSelectedImage.attr("src", newSrc); 65643 } 65644 } 65645 65646 65647 //Show Video 65648 toggleImageVideo(button, videoSrcArray[currentSelection]); 65649 65650 } 65651} 65652 65653function saveImageSrc(button){ 65654 var images = $(button).closest(".galleryView").find(".gridItem"); 65655 for(var i=0; i<images.length; i++){ 65656 imageSrcArray.push(images[i].src); 65657 videoSrcArray.push($(images[i]).attr("videoUrl") ? $(images[i]).attr("videoUrl") : "" ); 65658 } 65659} 65660 65661$(document).ready(function(){ 65662 //Set data-assets and data-gallery 65663 $(".mediaGalleryTabs li").each(function(){ 65664 var assetVal = $(this).data("assets").trim(); 65665 assetVal = assetVal.replace(/ /g, "_"); 65666 $(this).removeAttr("data-assets"); 65667 $(this).attr("data-assets", assetVal); 65668 }); 65669 65670 $(".galleryView").each(function(){ 65671 var galleryVal = $(this).data("gallery").trim(); 65672 galleryVal = galleryVal.replace(/ /g, "_"); 65673 $(this).removeAttr("data-gallery"); 65674 $(this).attr("data-gallery", galleryVal); 65675 }); 65676 65677 traverseGridChildren(); 65678 65679 $(window).resize(function(){ 65680 resizeThumbnails(); 65681 }); 65682 65683 $(".galleryOuterView").height($(".galleryView").height() + 40); 65684 65685}); 65686 65687$(function(){ 65688 65689 var iFrameComp = function(cl) { 65690 65691 this.el = $($('.' + cl)[0]); 65692 65693 }; 65694 65695 iFrameComp.prototype.init = function() { 65696 65697 var self = this; 65698 var deskHeight = this.el.find('iframe').attr('data-deskheight'); 65699 var tabHeight = this.el.find('iframe').attr('data-tabheight'); 65700 var mobHeight = this.el.find('iframe').attr('data-mobheight'); 65701 this.noPaddingConf = this.el.find('iframe').attr('data-noPadding'); 65702 65703 if(this.noPaddingConf){ 65704 this.el.css({'padding':'0px', 'width':'100%'}); 65705 } 65706 65707 this.setHeight(deskHeight, tabHeight, mobHeight); 65708 65709 if(mobHeight || tabHeight){ 65710 65711 $(window).resize(function() { 65712 65713 self.setHeight(deskHeight, tabHeight, mobHeight); 65714 65715 65716 }) 65717 } 65718 65719 }; 65720 65721 iFrameComp.prototype.setHeight = function(deskHeight, tabHeight, mobHeight) { 65722 65723 var winWidth = window.innerWidth; 65724 var height = deskHeight!=undefined ? deskHeight:'auto'; 65725 if(winWidth <= 576){ 65726 if(mobHeight){ 65727 height = mobHeight; 65728 } 65729 }else if(winWidth <= 1024){ 65730 if(tabHeight){ 65731 height = tabHeight; 65732 } 65733 } 65734 65735 if(this.noPaddingConf){ 65736 this.el.css('height',height); 65737 } 65738 this.el.find('iframe').css('height',height); 65739 }; 65740 65741 65742 65743 65744 $.each($('.iframe-comp'), function(i, v) { 65745 65746 $(v).addClass("ifc-" + i); 65747 65748 (new iFrameComp("ifc-" + i)).init(); 65749 65750 }); 65751 65752 65753 65754}); 65755 65756 65757 65758$(function() { 65759 var imgWithHotspotsCarousal = function(cl){ 65760 this.imgWithHsClComp = $($('.' + cl)[0]); 65761 65762 if (this.imgWithHsClComp.length > 0) { 65763 this.hsCarousalContainer = this.imgWithHsClComp.find('.hotspotCarousel'); 65764 this.hsCarousalSlides = this.imgWithHsClComp.find('.carousel-slides'); 65765 this.hsCarousalSlide = this.imgWithHsClComp.find('.slide'); 65766 this.hsCarousalbgImage= this.imgWithHsClComp.find('.bg-img'); 65767 this.hsToggle = this.imgWithHsClComp.find('.hotspot-toggle'); 65768 this.autoplay = this.hsCarousalSlides.attr('data-autoplay') ? true :false ; 65769 this.autoplaySpeed = this.hsCarousalSlides.attr('data-autoplaySpeed') ? this.hsCarousalSlides.attr('data-autoplaySpeed') : ''; 65770 65771 this.hsSlideoutWrapper = this.imgWithHsClComp.find("#hs-slideout-wrapper"); 65772 65773 this.multiFieldLists = JSON.parse(this.hsCarousalSlides.attr('data-multiFieldsList-obj')); 65774 this.slidesWithHotspotsList = this.multiFieldLists; 65775 console.log(this.multiFieldLists); 65776 //this.slidesWithHotspotsList = hsMappings; 65777 65778 } 65779 } 65780 imgWithHotspotsCarousal.prototype.init = function(){ 65781 this.createHotSpots(); 65782 this.initiateCarousel(); 65783 this.hotspotClickHandler(); 65784 65785 this.bindEvents(); 65786 65787 this.removeObjData(); 65788 } 65789 65790 imgWithHotspotsCarousal.prototype.initiateCarousel = function(){ 65791 let slickProperties={ 65792 autoplay: this.autoplay, 65793 autoplaySpeed: this.autoplaySpeed, 65794 arrows: true, 65795 infinite: true, 65796 slidesToShow: 1, 65797 slidesToScroll: 1, 65798 dots: true 65799 //appendArrows: $('.nav-icons .slick-buttons'),
65800 //prevArrow : '<button type="button" class="slick-prev-arrow"></button>' , 65801 //nextArrow : '<button type="button" class="slick-next-arrow"></button>' 65802 }; 65803 this.hsCarousalSlides.slick(slickProperties); 65804 65805 this.imgWithHsClComp.find('.nav-icons .slick-buttons').append($('.carousel-slides').find('.slick-prev').clone()); 65806 this.imgWithHsClComp.find('.nav-icons .slick-buttons').append($('.carousel-slides').find('.slick-next').clone()); 65807 65808 this.imgWithHsClComp.find('.nav-icons .slick-buttons .slick-prev').on('click', ()=> $('.carousel-slides .slick-prev').click()); 65809 this.imgWithHsClComp.find('.nav-icons .slick-buttons .slick-next').on('click', ()=> $('.carousel-slides .slick-next').click()); 65810 } 65811 65812 imgWithHotspotsCarousal.prototype.bindEvents = function(){ 65813 this.imgWithHsClComp.on('click', '.close-btn', $.proxy(this.closeBtnClickHandler, this)); 65814 this.imgWithHsClComp.on('click', '.nav-icons .nav-button .hotspot-toggle', $.proxy(this.hotspotToggleHandler, this)); 65815 } 65816 65817 imgWithHotspotsCarousal.prototype.hotspotClickHandler = function(){ 65818 let self = this; 65819 this.slidesWithHotspotsList.forEach(function(v,i){ 65820 v.hotspots.forEach(function(item,j){ 65821 self.hsCarousalSlides.find(`#slide-${i}-${item.hsId}`).on('mouseover', function(evnt) { 65822 65823 let hotspotWidth = $(this).outerWidth(); 65824 let hoverPopupWidth = $(this).find('.hover-block').outerWidth(); 65825 65826 let left = (hoverPopupWidth/2)-(hotspotWidth/2); 65827 let top = -65; 65828 65829 let hoverEl = $(this).find('.hover-block'); 65830 65831 if($(this).position().left< left){ 65832 left= $(this).position().left-5; 65833 } 65834 65835 let slideOffsetRight = $(this).parent('.slide .img-container')[0].getBoundingClientRect().right; 65836 let hotspotOffsetRight = $(this)[0].getBoundingClientRect().right; 65837 let rightGap = slideOffsetRight - hotspotOffsetRight; 65838 65839 let slideOffsetTop = $(this).parent('.slide .img-container')[0].getBoundingClientRect().top; 65840 let hotspotOffsetTop= $(this)[0].getBoundingClientRect().top; 65841 let topGap = hotspotOffsetTop - slideOffsetTop; 65842 65843 if( rightGap < left ){ 65844 left= left + (left-rightGap) + 15; 65845 } 65846 65847 if(topGap<65){ 65848 top =0; 65849 hoverEl.css({'padding-top': '45px'}); 65850 } 65851 if(item.hoverText){ 65852 hoverEl.css({'left':-left+"px", top:top+"px"}); 65853 hoverEl.show(); 65854 if(top==0){ 65855 hoverEl.addClass('fadeInDown'); 65856 }else{ 65857 hoverEl.addClass('fadeInUp'); 65858 } 65859 65860 } 65861 }); 65862 65863 // self.hsCarousalSlides.find(`#slide-${i}-${item.hsId}`).on('mouseout', function(evnt) { 65864 // var hoverEl = $(this).find('.hover-block'); 65865 // }); 65866 65867 self.hsCarousalSlides.find(`#slide-${i}-${item.hsId}`).on('click touchend', function(evnt) { 65868 evnt.preventDefault(); 65869 65870 self.hsSlideoutWrapper.show(); 65871 self.hsSlideoutWrapper.find(".hs-slideout").addClass('animate'); 65872 $('html,body').css('overflow-y','hidden'); 65873 65874 setTimeout(function(){ 65875 self.hsSlideoutWrapper.find(".so-loader").show(); 65876 self.imgWithHsClComp.find('.close-btn').show(); 65877 self.hsSlideoutWrapper.find(".hs-slideout").css('width','0p
65877x').html('<iframe id="hs_iframe" src='+item.xfPath + '.html?wcmmode=disabled></iframe>'); 65878 self.hsSlideoutWrapper.find('#hs_iframe').on('load', function(x,y) { 65879 var iframeDoc = $(document.getElementById('hs_iframe').contentWindow.document); 65880 iframeDoc.find('body').css({'overflow-x':'hidden','padding-top':'25px'}); 65881 iframeDoc.find('body').append("<style>.image-zoom-round--image img{border-radius:0px;} .image-zoom-round--thumbnail img{border-radius:0px;} </style>"); 65882 iframeDoc.on('click','a', function(evnt){ 65883 var el = $(evnt.currentTarget); 65884 var linkUrl = el.attr('href'); 65885 var dataType = el.attr('data-type'); 65886 var downloadAttr = el.attr('download') ; 65887 var target = el.attr('target'); 65888 if(target == undefined || target.trim() == ""){ 65889 target = "_self"; 65890 } 65891 if(linkUrl && linkUrl.trim() != "" && (dataType != "audio") && (dataType != "video") && (downloadAttr == undefined)){ 65892 evnt.preventDefault(); 65893 65894 window.open(linkUrl, target); 65895 } 65896 }); 65897 self.hsSlideoutWrapper.find(".so-loader").hide(); 65898 65899 65900 }); 65901 },500); 65902 //evnt.stopPropagation(); 65903 }); 65904 }); 65905 }); 65906 } 65907 65908 imgWithHotspotsCarousal.prototype.createHotSpots = function(){ 65909 let self=this; 65910 this.slidesWithHotspotsList.forEach(function(v,i){ 65911 // self.hsCarousalSlides.append(`<div class="slide slide-${i}"><div class="bg-img" style="background-image:url(${v.bgImg})"></div></div>`); 65912 self.hsCarousalSlides.append(`<div class="slide slide-${i}"><h4 class="appDesc">${v.slideTitle}</h4><div class="img-container"><img class="bgImg" src="${v.bgImgPath}"></div></div>`); 65913 v.hotspots.forEach(function(item,j){ 65914 self.hsCarousalSlides.find(`.slide-${i} .img-container`).append(`<div class="hotspotImg" id="slide-${i}-${item.hsId}" style="top:${item["top-position"]}%; left:${item["left-position"]}% "><div class="hover-block"><div class="hover-popups">${item.hoverText}</div></div></div>`); 65915 }); 65916 }); 65917 } 65918 imgWithHotspotsCarousal.prototype.hotspotToggleHandler = function(){ 65919 let currentSlide = $('.carousel-slides').slick('slickCurrentSlide'); 65920 this.imgWithHsClComp.find(`.slide-${currentSlide} .hotspotImg`).toggle(); 65921 //this.imgWithHsClComp.find('.hotspotImg').toggle(); 65922 65923 } 65924 65925 imgWithHotspotsCarousal.prototype.closeBtnClickHandler = function() { 65926 this.imgWithHsClComp.find('#hs-slideout-wrapper').hide(); 65927 this.imgWithHsClComp.find('.close-btn').hide(); 65928 this.imgWithHsClComp.find("#hs-slideout-wrapper .so-loader").hide(); 65929 this.imgWithHsClComp.find('#hs-slideout-wrapper .hs-slideout').removeClass('animate').html(''); 65930 $('html, body').css('overflow-y','auto'); 65931 65932 }; 65933 imgWithHotspotsCarousal.prototype.removeObjData = function(){ 65934 this.hsCarousalSlides.removeAttr('data-multiFieldsList-obj'); 65935 } 65936 65937 65938 65939 $.each($('.imageWithHotspotCarousel'), function (i, v) { 65940 $(v).addClass("imageWithHotspotCarousel-" + i); 65941 (new imgWithHotspotsCarousal("imageWithHotspotCarousel-" + i)).init(); 65942 }); 65943}); 65944 65945function HistoryJumpLinks(el) { 65946 this.el = el; 65947 this.requestedEraId; 65948 this.controller = new ScrollMagic.Controller(); 65949 65950 this.controller.scrollTo(function(newScrollPos) { 65951 $("html, body") 65952 .stop("hjl-scroll") 65953 .animate( 65954 { scrollTop: newScrollPos }, 65955 { 65956 queue: "hjl-scroll" 65957 } 65958 ) 65959 .dequeue("hjl-scroll"); 65960 }); 65961 65962 this.initScenes(); 65963 this.initEvents(); 65964 65965 // activate default (first) era 65966 this.setActiveEra(); 65967} 65968 65969HistoryJumpLinks.prototype.initScenes = function() { 65970 var self = this; 65971 65972 // fade/slide in intro section 65973 new ScrollMagic.Scene({ 65974 triggerElement: self.el.querySelector(".history-jump-links--intro"), 65975 triggerHook: "onEnter", 65976 duration: "50%" 65977 }) 65978 .addTo(self.controller) 65979 .on("progress", function(event) { 65980 requestAnimationFrame(function() { 65981 self.el.querySelector(".history-jump-links--intro").style.opacity = 65982 event.progress; 65983 self.el.querySelector(".history-jump-links--intro").style.transform = 65984 "translateY(" + Math.abs(event.progress - 1) * 15 + "vh)"; 65985 }); 65986 }); 65987 65988 // fade in side timeline 65989 new ScrollMagic.Scene({ 65990 triggerElement: self.el.querySelector(".history-jump-links--history"), 65991 triggerHook: "onEnter", 65992 duration: "50%" 65993 }) 65994 .addTo(self.controller) 65995 .on("progress", function(event) { 65996 requestAnimationFrame(function() { 65997 self.el.querySelector(".history-jump-links--timeline").style.opacity = 65998 event.progress; 65999 }); 66000 }); 66001 66002 // fade/slide in each era and trigger timeline update 66003 $(self.el) 66004 .find(".history-jump-links--era") 66005 .each(function(index, sectionEl) { 66006 var eraId = sectionEl.dataset.era; 66007 66008 new ScrollMagic.Scene({ 66009 triggerElement: sectionEl, 66010 triggerHook: "onEnter", 66011 duration: "50%" 66012 }) 66013 .addTo(self.controller) 66014 .on("progress", function(event) { 66015 requestAnimationFrame(function() { 66016 sectionEl.style.opacity = event.progress; 66017 sectionEl.querySelector( 66018 ".history-jump-links--era-intro" 66019 ).style.transform = 66020 "translateY(" + Math.abs(event.progress - 1) * 5 + "vh)"; 66021 sectionEl.querySelector( 66022 ".history-jump-links--era-content" 66023 ).style.transform = 66024 "translateY(" + Math.abs(event.progress - 1) * 25 + "vh)"; 66025 }); 66026 }); 66027 66028 new ScrollMagic.Scene({ 66029 triggerElement: sectionEl, 66030 duration: function() { 66031 return sectionEl.getBoundingClientRect().height; 66032 } 66033 }) 66034 .addTo(self.controller) 66035 .on("enter", function() { 66036 if (!self.requestedEraId || self.requestedEraId === eraId) { 66037 self.setActiveEra(eraId); 66038 self.requestedEraId = undefined; 66039 } 66040 }); 66041 }); 66042}; 66043 66044HistoryJumpLinks.prototype.initEvents = function() { 66045 var self = this; 66046 66047 $(self.el) 66048 .find(".history-jump-links--timeline button") 66049 .each(function(index, buttonEl) { 66050 var eraId = buttonEl.dataset.era; 66051 66052 buttonEl.addEventListener("click", function() { 66053 var navHeight = $(".component-navigation").height() || 0; 66054 var newScrollTop = 66055 $(self.el) 66056 .find('.history-jump-links--era[data-era="' + eraId + '"]') 66057 .offset().top - navHeight; 66058 66059 self.controller.scrollTo(newScrollTop); 66060 66061 self.requestedEraId = eraId; 66062 self.setActiveEra(eraId); 66063 }); 66064 }); 66065 // For integration purposes button click function is removed. 66066 // $(self.el) 66067 // .find(".history-jump-links--era button") 66068 // .on("click", function() { 66069 // alert("details"); 66070 // }); 66071}; 66072 66073HistoryJumpLinks.prototype.setActiveEra = function(eraId) { 66074 var eraEls = $(this.el).find(".history-jump-links--era"); 66075 var firstSectionId = eraEls.first().data("era"); 66076 var activeEraId = eraId || firstSectionId; 66077 66078 this.setActiveButton(activeEraId); 66079 // this.setActiveTitle(activeEraId); 66080}; 66081 66082HistoryJumpLinks.prototype.setActiveButton = function(eraId) { 66083 $(this.el) 66084 .find(".history-jump-links--timeline button") 66085 .each(function(index, button) { 66086 $(button).toggleClass( 66087 "active", 66088 $(button).is('[data-era="' + eraId + '"]') 66089 ); 66090 }); 66091}; 66092 66093// HistoryJumpLinks.prototype.setActiveTitle = function(eraId) { 66094// var eraEls = $(this.el).find(".history-jump-links--era");
66095// var activeEraEl = eraEls.filter('[data-era="' + eraId + '"]'); 66096 66097// activeEraEl.find(".history-jump-links--era-intro").addClass("active"); 66098// activeEraEl 66099// .siblings() 66100// .find(".history-jump-links--era-intro") 66101// .removeClass("active"); 66102// }; 66103 66104$(function() { 66105 $(".history-jump-links").each(function() { 66106 new HistoryJumpLinks(this); 66107 }); 66108}); 66109 66110function historyPopupComponent(el) { 66111 this.el = el; 66112 this.scrollPosition = 0; 66113 this.init(); 66114 window.historyPopUp = this; 66115 // For demo pourpuses only. 66116 if (window.location.href.match("historypopupmodel")) { 66117 this.open(); 66118 } 66119} 66120 66121historyPopupComponent.prototype.init = function() { 66122 this.yearEl = this.el.find(".year"); 66123 this.descriptionEl = this.el.find(".description"); 66124 this.imageEl = this.el.find(".img-container"); 66125 this.popDescription = this.el.find(".pop-description"); 66126 66127 this.noScroll = noScroll.bind(this); 66128 66129 $(".open-modal").on( 66130 "click", 66131 function() { 66132 this.open(); 66133 }.bind(this) 66134 ); 66135 this.el.find(".close-modal-btn").on( 66136 "click", 66137 function() { 66138 this.close(); 66139 $('.component-navigation, .footerref, .history-jump-links').css({'filter': 'blur(0px)'}); 66140 $('.history-jump-links--background img').css({'height': 'calc(100vh - 88px)'}); 66141 }.bind(this) 66142 ); 66143}; 66144 66145historyPopupComponent.prototype.open = function() { 66146 $("body").addClass("modal-window-open"); 66147 $(".history-popup").addClass("open"); 66148 $(".history-popup").removeClass("hidden"); 66149 this.el[0].scrollTo(0, 0); 66150 this.disableScroll(); 66151}; 66152 66153historyPopupComponent.prototype.close = function() { 66154 $("body").removeClass("modal-window-open"); 66155 $(".history-popup").removeClass("open"); 66156 setTimeout(function() { 66157 $(".history-popup").addClass("hidden"); 66158 }, 550); 66159 this.enableScroll(); 66160}; 66161 66162historyPopupComponent.prototype.openWithData = function(data) { 66163 $("body").addClass("modal-window-open"); 66164 $(".history-popup").addClass("open"); 66165 $(".history-popup").removeClass("hidden"); 66166 this.descriptionEl.text(data.description); 66167 this.yearEl.text(data.year); 66168 this.imageEl.css("background-image", "url(" + data.image + ")"); 66169 this.popDescription.html(data.popDescription); 66170 this.el[0].scrollTo(0, 0); 66171 this.disableScroll(); 66172}; 66173 66174function noScroll() { 66175 window.scrollTo(0, this.scrollPosition); 66176} 66177 66178historyPopupComponent.prototype.disableScroll = function() { 66179 this.scrollPosition = window.scrollY; 66180 window.addEventListener("scroll", this.noScroll); 66181}; 66182 66183historyPopupComponent.prototype.enableScroll = function() { 66184 window.removeEventListener("scroll", this.noScroll); 66185}; 66186 66187$(function() { 66188 $(".history-popup").each(function() { 66189 new historyPopupComponent($(this)); 66190 }); 66191}); 66192 66193$(function() { 66194 var historyJumpLinksEl = $(".history-jump-links"); 66195 window.el = historyJumpLinksEl; 66196 66197 historyJumpLinksEl 66198 .find(".history-jump-links--era button") 66199 .on("click", function() { 66200 data = { 66201 year: $(this).children()[0].textContent, 66202 description: $(this).children()[1].textContent, 66203 image: $(this).children('.popImage').val(), 66204 popDescription: $(this).children('.popDesc').val() 66205 }; 66206 window.historyPopUp.openWithData(data); 66207 $('.component-navigation, .footerref, .history-jump-links').css({'filter': 'blur(8px)'}); 66208 $('.history-jump-links--background img').css({'height': '100%'}); 66209 }); 66210}); 66211 66212$(document).ready(function(){ 66213 $('.Carousel-slider-view1').slick({ 66214 arrows: false, 66215 infinite: true, 66216 slidesToShow: 1, 66217 slidesToScroll: 1, 66218 fade: true, 66219 autoplay: true, 66220 dots: true, 66221 66222 customPaging: function(slider, i) { 66223 var thumb = slider.$slides.eq(i).attr('data-thumb'); 66224 if(thumb == undefined){ 66225 thumb=''; 66226 } 66227 i++; 66228 var customHtml = '<a><span class="number">'+i+'</span> <p class="name">'+thumb+'</p></a>'; 66229 return customHtml; 66230 }, 66231 }); 66232 var stepCount = $('.Carousel-slider-view1 .Carousel-slick-title-text img').length; 66233 $('.Carousel-slider-view1').on('setPosition', function(event, slick, currentSlide, nextSlide) { 66234 var StepIndex = $('.Carousel-slider-view1').find('.slick-slide.slick-active').attr('data-slick-index'); 66235 StepIndex = parseInt(StepIndex) +1; 66236 var widthCalc=(StepIndex/stepCount)*100; 66237 $('.progress').css('background-size', widthCalc + '% 100%'); 66238 }); 66239}); 66240 66241 66242$('.sliding-view').find('.carousel-inner').each(function() { 66243 66244if ($(this).children('div').length === 1) $(this).siblings('.carousel-indicators, .carousel-control-prev, .carousel-control-next').hide(); 66245 66246}); 66247$(window).on('load', function(){ 66248 var firstTime = localStorage.getItem("first_time"); 66249 console.log("hello"+firstTime); 66250 if(firstTime){ 66251 var x=".gs-hero-view .slick-slide.slick-current.slick-active"; 66252 var y=".gs-hero-view .img-wrapper .can-img .center-img"; 66253 $(y,x).attr("src", $(y,x).attr("src")); 66254 }else{ 66255 localStorage.setItem("first_time","1"); 66256 } 66257 66258}); 66259 66260$(document).ready(function () { 66261 66262 /* Hero List Componenet DOM Root Class Variable */ 66263 var gs_herolist_root_class=".gs-hero-view"; 66264 66265 /**Function Calls */ 66266 /***Center Image Clone */ 66267 cpCenterImg(); 66268 66269 /* Can to Box Image Switch Func Calling */ 66270 canToBox(); 66271 66272 /* Applying Slick Carousel */ 66273 $('.hero-list',gs_herolist_root_class).slick({ 66274 arrows: true, 66275 slidesToShow: 1, 66276 dots: true, 66277 infinite: false, 66278 speed: 500, 66279 //fade: true, 66280 cssEase: 'ease-in-out', 66281 slidesToScroll: 1, 66282 //useTransform: true, 66283 refresh: true, 66284 responsive: [{ 66285 breakpoint: 1024, 66286 settings: { 66287 dots: false, 66288 slidesToShow: 1, 66289 slidesToScroll: 1 66290 } 66291 }] 66292 }); 66293 66294 $(window).resize(function(){ 66295 66296 dots_position(); 66297 }); 66298 66299 /* Slick Dots Position based on text size (height)*/ 66300 dots_position(); 66301 66302 var counter = 1; 66303 66304 var dsInterval = setInterval(function(){ 66305 66306 dots_position(); 66307 counter++; 66308 if(counter==30){ 66309 66310 clearInterval(dsInterval); 66311 } 66312 66313 },1000); 66314 66315 setTimeout(function(){ 66316 dots_position(); 66317 }, 15000); 66318 setTimeout(function(){ 66319 dots_position(); 66320 }, 30000); 66321 66322 hero_animations(); 66323 66324 $(".hero-list").find('.slick-prev').addClass('click-disabled'); 66325 /* Click Event on Hero Play Icon */ 66326 $(".video-text-wrapper .playpause", gs_herolist_root_class).click(function(e){ 66327 e.preventDefault(); 66328 66329 var playicon_obj = $(this); 66330 var v_src = playicon_obj.siblings("video").attr("src");
66331 let v_videoPath = $(this).siblings("video").data("content-path"); 66332 66333 $('#video1', gs_herolist_root_class).data('content-path',v_videoPath); 66334 $('#video1', gs_herolist_root_class).attr("src",v_src); 66335 66336 $('#heroVideoModal', gs_herolist_root_class).on('shown.bs.modal', function () { 66337 $('#video1', gs_herolist_root_class)[0].play(); 66338 }); 66339 66340 $('#heroVideoModal', gs_herolist_root_class).on('hidden.bs.modal', function () { 66341 $('#video1', gs_herolist_root_class)[0].pause(); 66342 $('#video1', gs_herolist_root_class).attr("src","#"); 66343 $('#video1', gs_herolist_root_class).removeData('content-path'); 66344 }); 66345 66346 }); 66347 66348 66349 $(".hero-list .slick-next.slick-arrow", gs_herolist_root_class).on("click",function(){ 66350 66351 var lastSlideId = $(".hero-list").find('.hero-image-carousel:last-child').attr('id'); 66352 66353 var slickCrId = $(".hero-list").find('.slick-current').attr('id'); 66354 66355 if( slickCrId == lastSlideId){ 66356 66357 $(".hero-list").find('.slick-next').addClass('click-disabled'); 66358 }else{ 66359 $(".hero-list").find('.slick-next').removeClass('click-disabled'); 66360 } 66361 66362 $(".hero-list").find('.slick-prev').removeClass('click-disabled'); 66363 66364 // $(".hero-list").find('.center-img').attr('prev-anim-played',false); 66365 66366 //if($(".hero-list").find('.slick-current').find('.center-img').attr('next-anim-played')!="true" && $(".hero-list").find('.slick-current').find('.center-img').attr('next-anim-played') != undefined){ 66367 66368 var x=".slick-slide.slick-current.slick-active"; 66369 var y=".img-wrapper .center-img"; 66370 var z=".img-wrapper .center-img-cp" 66371 var _heroImg = ".hero_image"; 66372 66373 $(y,x).attr("src",""); 66374 $(y,x).attr("src", $(z,x).attr("src")); 66375 66376 //$(".hero-list").find('.center-img').attr('next-anim-played',false); 66377 // $(".hero-list").find('.slick-current').find('.center-img').attr('next-anim-played',true); 66378 66379 //} 66380 66381 hero_animations(); 66382 dots_position(); 66383 66384 }); 66385 66386 $(".hero-list .slick-prev.slick-arrow", gs_herolist_root_class).on("click",function(){ 66387 66388 var firstSlideId = $(".hero-list").find('.hero-image-carousel:first-child').attr('id'); 66389 66390 var slickCrId = $(".hero-list").find('.slick-current').attr('id'); 66391 66392 if( slickCrId == firstSlideId){ 66393 66394 $(".hero-list").find('.slick-prev').addClass('click-disabled'); 66395 }else{ 66396 $(".hero-list").find('.slick-prev').removeClass('click-disabled'); 66397 } 66398 66399 $(".hero-list").find('.slick-next').removeClass('click-disabled'); 66400 66401 // $(".hero-list").find('.center-img').attr('next-anim-played',false); 66402 //if($(".hero-list").find('.slick-current').find('.center-img').attr('prev-anim-played')!="true" && $(".hero-list").find('.slick-current').find('.center-img').attr('prev-anim-played')!=undefined){ 66403 66404 var x=".slick-slide.slick-current.slick-active"; 66405 var y=".img-wrapper .can-img .center-img"; 66406 var z=".img-wrapper .can-img-rev"; 66407 66408 if($(z,x).attr("src")){ 66409 $(y,x).attr("src", $(z,x).attr("src")); 66410 } 66411 66412 // $(".hero-list").find('.center-img').attr('prev-anim-played',false); 66413 // $(".hero-list").find('.slick-current').find('.center-img').attr('prev-anim-played',true); 66414 // } 66415 66416 hero_animations(); 66417 dots_position(); 66418 66419 }); 66420 66421 $('.slick-dots li button').on('click', function(){ 66422 //e.preventDefault();
66423 animateOnClick(); 66424 function animateOnClick() { 66425 setTimeout(function(){ 66426 var x=".slick-slide.slick-current.slick-active"; 66427 var y=".img-wrapper .center-img"; 66428 var z=".img-wrapper .center-img-cp" 66429 var _heroImg = ".hero_image"; 66430 66431 $(y,x).attr("src",""); 66432 $(y,x).attr("src", $(z,x).attr("src")); 66433 66434 var firstSlideId = $(".hero-list").find('.hero-image-carousel:first-child').attr('id'); 66435 var lastSlideId = $(".hero-list").find('.hero-image-carousel:last-child').attr('id'); 66436 66437 var slickCrId = $(".hero-list").find('.slick-current').attr('id'); 66438 66439 if( slickCrId == lastSlideId){ 66440 66441 $(".hero-list").find('.slick-next').addClass('click-disabled'); 66442 }else{ 66443 $(".hero-list").find('.slick-next').removeClass('click-disabled'); 66444 } 66445 66446 if(slickCrId == firstSlideId){ 66447 66448 $(".hero-list").find('.slick-prev').addClass('click-disabled'); 66449 }else{ 66450 $(".hero-list").find('.slick-prev').removeClass('click-disabled'); 66451 } 66452 66453 66454 hero_animations(); 66455 dots_position(); 66456 66457 }, 200); 66458 } 66459 }); 66460 66461 /** Replacing Large Size Can GIF Images with Less size Static Can Images in Mobile MOde*/ 66462 var bg_imgs= $(".hero-image-carousel", gs_herolist_root_class); 66463 $.each(bg_imgs,function(i,v){ 66464 if($(window).width()<1023){ 66465 var bg_url=$(v).find(".mobile-bg-img").css("background-image"); 66466 $(v).find(".hero-image").css("background-image",bg_url); 66467 } 66468 }); 66469 /** */ 66470 66471/*****Center Image Clone */ 66472function cpCenterImg(){ 66473 var img_wrap =$(".img-wrapper" , gs_herolist_root_class); 66474 66475 $.each(img_wrap,function(i,v){ 66476 var org_img= $(v).find(".center-img"); 66477 var cp_img= $(v).find(".center-img-cp"); 66478 66479 $(cp_img).attr("src", $(org_img).attr("src")); 66480 }); 66481} 66482/****Can To Box Switch Function Defination */ 66483 66484function canToBox(){ 66485 var imgs= $(".img-wrapper .center-img", gs_herolist_root_class); 66486 66487 66488 $.each(imgs,function(i,v){ 66489 if($(v).parents(".img-tag-wrap").hasClass("box-img")){ 66490 66491 $(v).parents(".img-tag-wrap").addClass("pro-wrap"); 66492 $(v).parents(".txt-img-video-wrapper").addClass("box"); 66493 $(v).parents(".txt-img-video-wrapper").children(".text-img-wrapper").removeClass("col-7"); 66494 $(v).parents(".txt-img-video-wrapper").children(".text-img-wrapper").addClass("col-12"); 66495 66496 $(v).parents(".txt-img-video-wrapper").children(".img-wrapper").removeClass("col-5 col-md-6 col-lg-3"); 66497 $(v).parents(".txt-img-video-wrapper").children(".img-wrapper").addClass("col-12 col-md-6 col-lg-5"); 66498 66499 $(v).parents(".txt-img-video-wrapper").children(".video-text").removeClass("col-12 col-md-12 col-lg-5"); 66500 $(v).parents(".txt-img-video-wrapper").children(".video-text").addClass("col-12 col-md-12 col-lg-3"); 66501 } 66502 }); 66503 66504 66505 66506} 66507/**** */ 66508 66509/** Dynamic Slick Dots Position with respective of Text size */ 66510function dots_position(){ 66511 var v_dots_height= ($(".hero-image", ".slick-slide.slick-current.slick-active").height()-$(".text-carousel",".slick-slide.slick-current.slick-active").height())/2; 66512 var v_dots_height= v_dots_height + 80; 66513 66514 var mmargin = $(".container").css('margin-left'); 66515 var v_dots_left = parseInt(mmargin) +94; 66516 66517 var textBlock = $('.text-carousel'); 66518 66519 if(textBlock.length){ 66520 66521 var textboxTop = textBlock.offset().top; 66522 var textBlockHeight = textBlock.height(); 66523 66524 $(".hero-list .slick-dots").css("top", textboxTop+textBlockHeight-80); 66525 66526 } 66527 66528 $(".hero-list .slick-dots").css("left", v_dots_left); 66529 66530} 66531 66532/**Hero List Animations on all Items Including text and video and can arrows */ 66533function hero_animations(){ 66534 /* Slick Arrow Variables */ 66535 var v_prev_slickarrow = ".hero-list .slick-prev.slick-arrow"; 66536 var v_next_slickarrow = ".hero-list .slick-next.slick-arrow"; 66537 66538 /* Slick Active class variables */ 66539 var $slick_active =".hero-animations .slick-slide.slick-current.slick-active"; 66540 var $slick_slide =".hero-animations .slick-slide"; 66541 66542 /* Animation to Slick Arrows */ 66543 $(v_prev_slickarrow , gs_herolist_root_class).addClass("fadeInLeft"); 66544 $(v_next_slickarrow , gs_herolist_root_class).addClass("fadeInRight"); 66545 66546 $(".hero-image",$slick_slide).removeClass("animated anim"); 66547 $(".hero-image",$slick_active).addClass("animated anim"); 66548 66549 $(".text-carousel", $slick_slide).removeClass("animated fadeInLeft-anim"); 66550 $(".text-carousel", $slick_active).addClass("animated fadeInLeft-anim"); 66551 66552 $(".video-text-wrapper", $slick_slide).removeClass("animated fadeInRight-anim"); 66553 $(".video-text-wrapper", $slick_active).addClass("animated fadeInRight-anim"); 66554 66555 $(".img-wrapper .new-prod-tag", $slick_active).addClass("animated bounce"); 66556 $(".video-text .video-desc-tag", $slick_active).addClass("animated fadeInDownBig-anim"); 66557 66558 $(".new-prod-tag img",$slick_slide).removeClass("arrow-ico"); 66559 $(".new-prod-tag img", $slick_active).addClass("arrow-ico"); 66560 66561 $(".video-tags img",$slick_slide ).removeClass("curve-arrow"); 66562 $(".video-tags img", $slick_active).addClass("curve-arrow"); 66563} 66564 66565 66566}); 66567 66568 66569var dots=Boolean($(".herolist-slides").data("dots")); 66570var arrows =Boolean($(".herolist-slides").data("arrows")); 66571var autoplay =Boolean($(".herolist-slides").data("autoplay")); 66572 66573 $(".herolist-slides").slick({ 66574 slidesToShow:1, 66575 slidesToScroll:1, 66576 arrows: arrows, 66577 dots: dots, 66578 autoplay:autoplay, 66579 autoplaySpeed:10000 66580 }); 66581 66582/*! 66583 * VERSION: 2.0.2 66584 * DATE: 2018-08-27 66585 * UPDATES AND DOCS AT: http://greensock.com 66586 * 66587 * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin 66588 * 66589 * @license Copyright (c) 2008-2018, GreenSock. All rights reserved. 66590 * This work is subject to the terms at http://greensock.com/standard-license or for
vendor: 22,720 bytes, lines 66591-66595
66591 * Club GreenSock members, the software agreement that was issued with your membership. 66592 * 66593 * @author: Jack Doyle, [email protected] 66594 **/ 66595var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(a,b,c){var d=function(a){var b,c=[],d=a.length;for(b=0;b!==d;c.push(a[b++]));return c},e=function(a,b,c){var d,e,f=a.cycle;for(d in f)e=f[d],a[d]="function"==typeof e?e(c,b[c]):e[c%e.length];delete a.cycle},f=function(a,b,d){c.call(this,a,b,d),this._cycle=0,this._yoyo=this.vars.yoyo===!0||!!this.vars.yoyoEase,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._repeat&&this._uncache(!0),this.render=f.prototype.render},g=1e-10,h=c._internals,i=h.isSelector,j=h.isArray,k=f.prototype=c.to({},.1,{}),l=[];f.version="2.0.2",k.constructor=f,k.kill()._gc=!1,f.killTweensOf=f.killDelayedCallsTo=c.killTweensOf,f.getTweensOf=c.getTweensOf,f.lagSmoothing=c.lagSmoothing,f.ticker=c.ticker,f.render=c.render,k.invalidate=function(){return this._yoyo=this.vars.yoyo===!0||!!this.vars.yoyoEase,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._yoyoEase=null,this._uncache(!0),c.prototype.invalidate.call(this)},k.updateTo=function(a,b){var d,e=this.ratio,f=this.vars.immediateRender||a.immediateRender;b&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay));for(d in a)this.vars[d]=a[d];if(this._initted||f)if(b)this._initted=!1,f&&this.render(0,!0,!0);else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&c._onPluginEvent("_onDisable",this),this._time/this._duration>.998){var g=this._totalTime;this.render(0,!0,!1),this._initted=!1,this.render(g,!0,!1)}else if(this._initted=!1,this._init(),this._time>0||f)for(var h,i=1/(1-e),j=this._firstPT;j;)h=j.s+j.c,j.c*=i,j.s=h-j.c,j=j._next;return this},k.render=function(a,b,d){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var e,f,i,j,k,l,m,n,o,p=this._dirty?this.totalDuration():this._totalDuration,q=this._time,r=this._totalTime,s=this._cycle,t=this._duration,u=this._rawPrevTime;if(a>=p-1e-7&&a>=0?(this._totalTime=p,this._cycle=this._repeat,this._yoyo&&0!==(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=t,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(e=!0,f="onComplete",d=d||this._timeline.autoRemoveChildren),0===t&&(this._initted||!this.vars.lazy||d)&&(this._startTime===this._timeline._duration&&(a=0),(0>u||0>=a&&a>=-1e-7||u===g&&"isPause"!==this.data)&&u!==a&&(d=!0,u>g&&(f="onReverseComplete")),this._rawPrevTime=n=!b||a||u===a?a:g)):1e-7>a?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==r||0===t&&u>0)&&(f="onReverseComplete",e=this._reversed),0>a&&(this._active=!1,0===t&&(this._initted||!this.vars.lazy||d)&&(u>=0&&(d=!0),this._rawPrevTime=n=!b||a||u===a?a:g)),this._initted||(d=!0)):(this._totalTime=this._time=a,0!==this._repeat&&(j=t+this._repeatDelay,this._cycle=this._totalTime/j>>0,0!==this._cycle&&this._cycle===this._totalTime/j&&a>=r&&this._cycle--,this._time=this._totalTime-this._cycle*j,this._yoyo&&0!==(1&this._cycle)&&(this._time=t-this._time,o=this._yoyoEase||this.vars.yoyoEase,o&&(this._yoyoEase||(o!==!0||this._initted?this._yoyoEase=o=o===!0?this._ease:o instanceof Ease?o:Ease.map[o]:(o=this.vars.ease,this._yoyoEase=o=o?o instanceof Ease?o:"function"==typeof o?new Ease(o,this.vars.easeParams):Ease.map[o]||c.defaultEase:c.defaultEase)),this.ratio=o?1-o.getRatio((t-this._time)/t):0)),this._time>t?this._time=t:this._time<0&&(this._time=0)),this._easeType&&!o?(k=this._time/t,l=this._easeType,m=this._easePower,(1===l||3===l&&k>=.5)&&(k=1-k),3===l&&(k*=2),1===m?k*=k:2===m?k*=k*k:3===m?k*=k*k*k:4===m&&(k*=k*k*k*k),1===l?this.ratio=1-k:2===l?this.ratio=k:this._time/t<.5?this.ratio=k/2:this.ratio=1-k/2):o||(this.ratio=this._ease.getRatio(this._time/t))),q===this._time&&!d&&s===this._cycle)return void(r!==this._totalTime&&this._onUpdate&&(b||this._callback("onUpdate")));if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!d&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=q,this._totalTime=r,this._rawPrevTime=u,this._cycle=s,h.lazyTweens.push(this),void(this._lazy=[a,b]);!this._time||e||o?e&&this._ease._calcEnd&&!o&&(this.ratio=this._ease.getRatio(0===this._time?0:1)):this.ratio=this._ease.getRatio(this._time/t)}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==q&&a>=0&&(this._active=!0),0===r&&(2===this._initted&&a>0&&this._init(),this._startAt&&(a>=0?this._startAt.render(a,!0,d):f||(f="_dummyGS")),this.vars.onStart&&(0!==this._totalTime||0===t)&&(b||this._callback("onStart"))),i=this._firstPT;i;)i.f?i.t[i.p](i.c*this.ratio+i.s):i.t[i.p]=i.c*this.ratio+i.s,i=i._next;this._onUpdate&&(0>a&&this._startAt&&this._startTime&&this._startAt.render(a,!0,d),b||(this._totalTime!==r||f)&&this._callback("onUpdate")),this._cycle!==s&&(b||this._gc||this.vars.onRepeat&&this._callback("onRepeat")),f&&(!this._gc||d)&&(0>a&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(a,!0,d),e&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!b&&this.vars[f]&&this._callback(f),0===t&&this._rawPrevTime===g&&n!==g&&(this._rawPrevTime=0))},f.to=function(a,b,c){return new f(a,b,c)},f.from=function(a,b,c){return c.runBackwards=!0,c.immediateRender=0!=c.immediateRender,new f(a,b,c)},f.fromTo=function(a,b,c,d){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,new f(a,b,d)},f.staggerTo=f.allTo=function(a,b,g,h,k,m,n){h=h||0;var o,p,q,r,s=0,t=[],u=function(){g.onComplete&&g.onComplete.apply(g.onCompleteScope||this,arguments),k.apply(n||g.callbackScope||this,m||l)},v=g.cycle,w=g.startAt&&g.startAt.cycle;for(j(a)||("string"==typeof a&&(a=c.selector(a)||a),i(a)&&(a=d(a))),a=a||[],0>h&&(a=d(a),a.reverse(),h*=-1),o=a.length-1,q=0;o>=q;q++){p={};for(r in g)p[r]=g[r];if(v&&(e(p,a,q),null!=p.duration&&(b=p.duration,delete p.duration)),w){w=p.startAt={};for(r in g.startAt)w[r]=g.startAt[r];e(p.startAt,a,q)}p.delay=s+(p.delay||0),q===o&&k&&(p.onComplete=u),t[q]=new f(a[q],b,p),s+=h}return t},f.staggerFrom=f.allFrom=function(a,b,c,d,e,g,h){return c.runBackwards=!0,c.immediateRender=0!=c.immediateRender,f.staggerTo(a,b,c,d,e,g,h)},f.staggerFromTo=f.allFromTo=function(a,b,c,d,e,g,h,i){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,f.staggerTo(a,b,d,e,g,h,i)},f.delayedCall=function(a,b,c,d,e){return new f(b,0,{delay:a,onComplete:b,onCompleteParams:c,callbackScope:d,onReverseComplete:b,onReverseCompleteParams:c,immediateRender:!1,useFrames:e,overwrite:0})},f.set=function(a,b){return new f(a,0,b)},f.isTweening=function(a){return c.getTweensOf(a,!0).length>0};var m=function(a,b){for(var d=[],e=0,f=a._first;f;)f instanceof c?d[e++]=f:(b&&(d[e++]=f),d=d.concat(m(f,b)),e=d.length),f=f._next;return d},n=f.getAllTweens=function(b){return m(a._rootTimeline,b).concat(m(a._rootFramesTimeline,b))};f.killAll=function(a,c,d,e){null==c&&(c=!0),null==d&&(d=!0);var f,g,h,i=n(0!=e),j=i.length,k=c&&d&&e;for(h=0;j>h;h++)g=i[h],(k||g instanceof b||(f=g.target===g.vars.onComplete)&&d||c&&!f)&&(a?g.totalTime(g._reversed?0:g.totalDuration()):g._enabled(!1,!1))},f.killChildTweensOf=function(a,b){if(null!=a){var e,g,k,l,m,n=h.tweenLookup;if("string"==typeof a&&(a=c.selector(a)||a),i(a)&&(a=d(a)),j(a))for(l=a.length;--l>-1;)f.killChildTweensOf(a[l],b);else{e=[];for(k in n)for(g=n[k].target.parentNode;g;)g===a&&(e=e.concat(n[k].tweens)),g=g.parentNode;for(m=e.length,l=0;m>l;l++)b&&e[l].totalTime(e[l].totalDuration()),e[l]._enabled(!1,!1)}}};var o=function(a,c,d,e){c=c!==!1,d=d!==!1,e=e!==!1;for(var f,g,h=n(e),i=c&&d&&e,j=h.length;--j>-1;)g=h[j],(i||g instanceof b||(f=g.target===g.vars.onComplete)&&d||c&&!f)&&g.paused(a)};return f.pauseAll=function(a,b,c){o(!0,a,b,c)},f.resumeAll=function(a,b,c){o(!1,a,b,c)},f.globalTimeScale=function(b){var d=a._rootTimeline,e=c.ticker.time;return arguments.length?(b=b||g,d._startTime=e-(e-d._startTime)*d._timeScale/b,d=a._rootFramesTimeline,e=c.ticker.frame,d._startTime=e-(e-d._startTime)*d._timeScale/b,d._timeScale=a._rootTimeline._timeScale=b,b):d._timeScale},k.progress=function(a,b){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-a:a)+this._cycle*(this._duration+this._repeatDelay),b):this._time/this.duration()},k.totalProgress=function(a,b){return arguments.length?this.totalTime(this.totalDuration()*a,b):this._totalTime/this.totalDuration()},k.time=function(a,b){return arguments.length?(this._dirty&&this.totalDuration(),a>this._duration&&(a=this._duration),this._yoyo&&0!==(1&this._cycle)?a=this._duration-a+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(a+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(a,b)):this._time},k.duration=function(b){return arguments.length?a.prototype.duration.call(this,b):this._duration},k.totalDuration=function(a){return arguments.length?-1===this._repeat?this:this.duration((a-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},k.repeat=function(a){return arguments.length?(this._repeat=a,this._uncache(!0)):this._repeat},k.repeatDelay=function(a){return arguments.length?(this._repeatDelay=a,this._uncache(!0)):this._repeatDelay},k.yoyo=function(a){return arguments.length?(this._yoyo=a,this):this._yoyo},f},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(a,b,c){var d=function(a){b.call(this,a),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var c,d,e=this.vars;for(d in e)c=e[d],i(c)&&-1!==c.join("").indexOf("{self}")&&(e[d]=this._swapSelfInParams(c));i(e.tweens)&&this.add(e.tweens,0,e.align,e.stagger)},e=1e-10,f=c._internals,g=d._internals={},h=f.isSelector,i=f.isArray,j=f.lazyTweens,k=f.lazyRender,l=_gsScope._gsDefine.globals,m=function(a){var b,c={};for(b in a)c[b]=a[b];return c},n=function(a,b,c){var d,e,f=a.cycle;for(d in f)e=f[d],a[d]="function"==typeof e?e(c,b[c]):e[c%e.length];delete a.cycle},o=g.pauseCallback=function(){},p=function(a){var b,c=[],d=a.length;for(b=0;b!==d;c.push(a[b++]));return c},q=d.prototype=new b;return d.version="2.0.2",q.constructor=d,q.kill()._gc=q._forcingPlayhead=q._hasPause=!1,q.to=function(a,b,d,e){var f=d.repeat&&l.TweenMax||c;return b?this.add(new f(a,b,d),e):this.set(a,d,e)},q.from=function(a,b,d,e){return this.add((d.repeat&&l.TweenMax||c).from(a,b,d),e)},q.fromTo=function(a,b,d,e,f){var g=e.repeat&&l.TweenMax||c;return b?this.add(g.fromTo(a,b,d,e),f):this.set(a,e,f)},q.staggerTo=function(a,b,e,f,g,i,j,k){var l,o,q=new d({onComplete:i,onCompleteParams:j,callbackScope:k,smoothChildTiming:this.smoothChildTiming}),r=e.cycle;for("string"==typeof a&&(a=c.selector(a)||a),a=a||[],h(a)&&(a=p(a)),f=f||0,0>f&&(a=p(a),a.reverse(),f*=-1),o=0;o<a.length;o++)l=m(e),l.startAt&&(l.startAt=m(l.startAt),l.startAt.cycle&&n(l.startAt,a,o)),r&&(n(l,a,o),null!=l.duration&&(b=l.duration,delete l.duration)),q.to(a[o],b,l,o*f);return this.add(q,g)},q.staggerFrom=function(a,b,c,d,e,f,g,h){return c.immediateRender=0!=c.immediateRender,c.runBackwards=!0,this.staggerTo(a,b,c,d,e,f,g,h)},q.staggerFromTo=function(a,b,c,d,e,f,g,h,i){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,this.staggerTo(a,b,d,e,f,g,h,i)},q.call=function(a,b,d,e){return this.add(c.delayedCall(0,a,b,d),e)},q.set=function(a,b,d){return d=this._parseTimeOrLabel(d,0,!0),null==b.immediateRender&&(b.immediateRender=d===this._time&&!this._paused),this.add(new c(a,0,b),d)},d.exportRoot=function(a,b){a=a||{},null==a.smoothChildTiming&&(a.smoothChildTiming=!0);var e,f,g,h,i=new d(a),j=i._timeline;for(null==b&&(b=!0),j._remove(i,!0),i._startTime=0,i._rawPrevTime=i._time=i._totalTime=j._time,g=j._first;g;)h=g._next,b&&g instanceof c&&g.target===g.vars.onComplete||(f=g._startTime-g._delay,0>f&&(e=1),i.add(g,f)),g=h;return j.add(i,0),e&&i.totalDuration(),i},q.add=function(e,f,g,h){var j,k,l,m,n,o;if("number"!=typeof f&&(f=this._parseTimeOrLabel(f,0,!0,e)),!(e instanceof a)){if(e instanceof Array||e&&e.push&&i(e)){for(g=g||"normal",h=h||0,j=f,k=e.length,l=0;k>l;l++)i(m=e[l])&&(m=new d({tweens:m})),this.add(m,j),"string"!=typeof m&&"function"!=typeof m&&("sequence"===g?j=m._startTime+m.totalDuration()/m._timeScale:"start"===g&&(m._startTime-=m.delay())),j+=h;return this._uncache(!0)}if("string"==typeof e)return this.addLabel(e,f);if("function"!=typeof e)throw"Cannot add "+e+" into the timeline; it is not a tween, timeline, function, or string.";e=c.delayedCall(0,e)}if(b.prototype.add.call(this,e,f),e._time&&(j=Math.max(0,Math.min(e.totalDuration(),(this.rawTime()-e._startTime)*e._timeScale)),Math.abs(j-e._totalTime)>1e-5&&e.render(j,!1,!1)),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(n=this,o=n.rawTime()>e._startTime;n._timeline;)o&&n._timeline.smoothChildTiming?n.totalTime(n._totalTime,!0):n._gc&&n._enabled(!0,!1),n=n._timeline;return this},q.remove=function(b){if(b instanceof a){this._remove(b,!1);var c=b._timeline=b.vars.useFrames?a._rootFramesTimeline:a._rootTimeline;return b._startTime=(b._paused?b._pauseTime:c._time)-(b._reversed?b.totalDuration()-b._totalTime:b._totalTime)/b._timeScale,this}if(b instanceof Array||b&&b.push&&i(b)){for(var d=b.length;--d>-1;)this.remove(b[d]);return this}return"string"==typeof b?this.removeLabel(b):this.kill(null,b)},q._remove=function(a,c){b.prototype._remove.call(this,a,c);var d=this._last;return d?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},q.append=function(a,b){return this.add(a,this._parseTimeOrLabel(null,b,!0,a))},q.insert=q.insertMultiple=function(a,b,c,d){return this.add(a,b||0,c,d)},q.appendMultiple=function(a,b,c,d){return this.add(a,this._parseTimeOrLabel(null,b,!0,a),c,d)},q.addLabel=function(a,b){return this._labels[a]=this._parseTimeOrLabel(b),this},q.addPause=function(a,b,d,e){var f=c.delayedCall(0,o,d,e||this);return f.vars.onComplete=f.vars.onReverseComplete=b,f.data="isPause",this._hasPause=!0,this.add(f,a)},q.removeLabel=function(a){return delete this._labels[a],this},q.getLabelTime=function(a){return null!=this._labels[a]?this._labels[a]:-1},q._parseTimeOrLabel=function(b,c,d,e){var f,g;if(e instanceof a&&e.timeline===this)this.remove(e);else if(e&&(e instanceof Array||e.push&&i(e)))for(g=e.length;--g>-1;)e[g]instanceof a&&e[g].timeline===this&&this.remove(e[g]);if(f="number"!=typeof b||c?this.duration()>99999999999?this.recent().endTime(!1):this._duration:0,"string"==typeof c)return this._parseTimeOrLabel(c,d&&"number"==typeof b&&null==this._labels[c]?b-f:0,d);if(c=c||0,"string"!=typeof b||!isNaN(b)&&null==this._labels[b])null==b&&(b=f);else{if(g=b.indexOf("="),-1===g)return null==this._labels[b]?d?this._labels[b]=f+c:c:this._labels[b]+c;c=parseInt(b.charAt(g-1)+"1",10)*Number(b.substr(g+1)),b=g>1?this._parseTimeOrLabel(b.substr(0,g-1),0,d):f}return Number(b)+c},q.seek=function(a,b){return this.totalTime("number"==typeof a?a:this._parseTimeOrLabel(a),b!==!1)},q.stop=function(){return this.paused(!0)},q.gotoAndPlay=function(a,b){return this.play(a,b)},q.gotoAndStop=function(a,b){return this.pause(a,b)},q.render=function(a,b,c){this._gc&&this._enabled(!0,!1);var d,f,g,h,i,l,m,n=this._time,o=this._dirty?this.totalDuration():this._totalDuration,p=this._startTime,q=this._timeScale,r=this._paused;if(n!==this._time&&(a+=this._time-n),a>=o-1e-7&&a>=0)this._totalTime=this._time=o,this._reversed||this._hasPausedChild()||(f=!0,h="onComplete",i=!!this._timeline.autoRemoveChildren,0===this._duration&&(0>=a&&a>=-1e-7||this._rawPrevTime<0||this._rawPrevTime===e)&&this._rawPrevTime!==a&&this._first&&(i=!0,this._rawPrevTime>e&&(h="onReverseComplete"))),this._rawPrevTime=this._duration||!b||a||this._rawPrevTime===a?a:e,a=o+1e-4;else if(1e-7>a)if(this._totalTime=this._time=0,(0!==n||0===this._duration&&this._rawPrevTime!==e&&(this._rawPrevTime>0||0>a&&this._rawPrevTime>=0))&&(h="onReverseComplete",f=this._reversed),0>a)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(i=f=!0,h="onReverseComplete"):this._rawPrevTime>=0&&this._first&&(i=!0),this._rawPrevTime=a;else{if(this._rawPrevTime=this._duration||!b||a||this._rawPrevTime===a?a:e,0===a&&f)for(d=this._first;d&&0===d._startTime;)d._duration||(f=!1),d=d._next;a=0,this._initted||(i=!0)}else{if(this._hasPause&&!this._forcingPlayhead&&!b){if(a>=n)for(d=this._first;d&&d._startTime<=a&&!l;)d._duration||"isPause"!==d.data||d.ratio||0===d._startTime&&0===this._rawPrevTime||(l=d),d=d._next;else for(d=this._last;d&&d._startTime>=a&&!l;)d._duration||"isPause"===d.data&&d._rawPrevTime>0&&(l=d),d=d._prev;l&&(this._time=a=l._startTime,this._totalTime=a+this._cycle*(this._totalDuration+this._repeatDelay))}this._totalTime=this._time=this._rawPrevTime=a}if(this._time!==n&&this._first||c||i||l){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==n&&a>0&&(this._active=!0),0===n&&this.vars.onStart&&(0===this._time&&this._duration||b||this._callback("onStart")),m=this._time,m>=n)for(d=this._first;d&&(g=d._next,m===this._time&&(!this._paused||r));)(d._active||d._startTime<=m&&!d._paused&&!d._gc)&&(l===d&&this.pause(),d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)),d=g;else for(d=this._last;d&&(g=d._prev,m===this._time&&(!this._paused||r));){if(d._active||d._startTime<=n&&!d._paused&&!d._gc){if(l===d){for(l=d._prev;l&&l.endTime()>this._time;)l.render(l._reversed?l.totalDuration()-(a-l._startTime)*l._timeScale:(a-l._startTime)*l._timeScale,b,c),l=l._prev;l=null,this.pause()}d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)}d=g}this._onUpdate&&(b||(j.length&&k(),this._callback("onUpdate"))),h&&(this._gc||(p===this._startTime||q!==this._timeScale)&&(0===this._time||o>=this.totalDuration())&&(f&&(j.length&&k(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!b&&this.vars[h]&&this._callback(h)))}},q._hasPausedChild=function(){for(var a=this._first;a;){if(a._paused||a instanceof d&&a._hasPausedChild())return!0;a=a._next}return!1},q.getChildren=function(a,b,d,e){e=e||-9999999999;for(var f=[],g=this._first,h=0;g;)g._startTime<e||(g instanceof c?b!==!1&&(f[h++]=g):(d!==!1&&(f[h++]=g),a!==!1&&(f=f.concat(g.getChildren(!0,b,d)),h=f.length))),g=g._next;return f},q.getTweensOf=function(a,b){var d,e,f=this._gc,g=[],h=0;for(f&&this._enabled(!0,!0),d=c.getTweensOf(a),e=d.length;--e>-1;)(d[e].timeline===this||b&&this._contains(d[e]))&&(g[h++]=d[e]);return f&&this._enabled(!1,!0),g},q.recent=function(){return this._recent},q._contains=function(a){for(var b=a.timeline;b;){if(b===this)return!0;b=b.timeline}return!1},q.shiftChildren=function(a,b,c){c=c||0;for(var d,e=this._first,f=this._labels;e;)e._startTime>=c&&(e._startTime+=a),e=e._next;if(b)for(d in f)f[d]>=c&&(f[d]+=a);return this._uncache(!0)},q._kill=function(a,b){if(!a&&!b)return this._enabled(!1,!1);for(var c=b?this.getTweensOf(b):this.getChildren(!0,!0,!1),d=c.length,e=!1;--d>-1;)c[d]._kill(a,b)&&(e=!0);return e},q.clear=function(a){var b=this.getChildren(!1,!0,!0),c=b.length;for(this._time=this._totalTime=0;--c>-1;)b[c]._enabled(!1,!1);return a!==!1&&(this._labels={}),this._uncache(!0)},q.invalidate=function(){for(var b=this._first;b;)b.invalidate(),b=b._next;return a.prototype.invalidate.call(this)},q._enabled=function(a,c){if(a===this._gc)for(var d=this._first;d;)d._enabled(a,!0),d=d._next;return b.prototype._enabled.call(this,a,c)},q.totalTime=function(b,c,d){this._forcingPlayhead=!0;var e=a.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,e},q.duration=function(a){return arguments.length?(0!==this.duration()&&0!==a&&this.timeScale(this._duration/a),this):(this._dirty&&this.totalDuration(),this._duration)},q.totalDuration=function(a){if(!arguments.length){if(this._dirty){for(var b,c,d=0,e=this._last,f=999999999999;e;)b=e._prev,e._dirty&&e.totalDuration(),e._startTime>f&&this._sortChildren&&!e._paused&&!this._calculatingDuration?(this._calculatingDuration=1,this.add(e,e._startTime-e._delay),this._calculatingDuration=0):f=e._startTime,e._startTime<0&&!e._paused&&(d-=e._startTime,this._timeline.smoothChildTiming&&(this._startTime+=e._startTime/this._timeScale,this._time-=e._startTime,this._totalTime-=e._startTime,this._rawPrevTime-=e._startTime),this.shiftChildren(-e._startTime,!1,-9999999999),f=0),c=e._startTime+e._totalDuration/e._timeScale,c>d&&(d=c),e=b;this._duration=this._totalDuration=d,this._dirty=!1}return this._totalDuration}return a&&this.totalDuration()?this.timeScale(this._totalDuration/a):this},q.paused=function(b){if(!b)for(var c=this._first,d=this._time;c;)c._startTime===d&&"isPause"===c.data&&(c._rawPrevTime=0),c=c._next;return a.prototype.paused.apply(this,arguments)},q.usesFrames=function(){for(var b=this._timeline;b._timeline;)b=b._timeline;return b===a._rootFramesTimeline},q.rawTime=function(a){return a&&(this._paused||this._repeat&&this.time()>0&&this.totalProgress()<1)?this._totalTime%(this._duration+this._repeatDelay):this._paused?this._totalTime:(this._timeline.rawTime(a)-this._startTime)*this._timeScale},d},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(a,b,c){var d=function(b){a.call(this,b),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},e=1e-10,f=b._internals,g=f.lazyTweens,h=f.lazyRender,i=_gsScope._gsDefine.globals,j=new c(null,null,1,0),k=d.prototype=new a;return k.constructor=d,k.kill()._gc=!1,d.version="2.0.2",k.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),a.prototype.invalidate.call(this)},k.addCallback=function(a,c,d,e){return this.add(b.delayedCall(0,a,d,e),
vendor: 4,964 bytes, line 66595
66595c)},k.removeCallback=function(a,b){if(a)if(null==b)this._kill(null,a);else for(var c=this.getTweensOf(a,!1),d=c.length,e=this._parseTimeOrLabel(b);--d>-1;)c[d]._startTime===e&&c[d]._enabled(!1,!1);return this},k.removePause=function(b){return this.removeCallback(a._internals.pauseCallback,b)},k.tweenTo=function(a,c){c=c||{};var d,e,f,g={ease:j,useFrames:this.usesFrames(),immediateRender:!1,lazy:!1},h=c.repeat&&i.TweenMax||b;for(e in c)g[e]=c[e];return g.time=this._parseTimeOrLabel(a),d=Math.abs(Number(g.time)-this._time)/this._timeScale||.001,f=new h(this,d,g),g.onStart=function(){f.target.paused(!0),f.vars.time===f.target.time()||d!==f.duration()||f.isFromTo||f.duration(Math.abs(f.vars.time-f.target.time())/f.target._timeScale).render(f.time(),!0,!0),c.onStart&&c.onStart.apply(c.onStartScope||c.callbackScope||f,c.onStartParams||[])},f},k.tweenFromTo=function(a,b,c){c=c||{},a=this._parseTimeOrLabel(a),c.startAt={onComplete:this.seek,onCompleteParams:[a],callbackScope:this},c.immediateRender=c.immediateRender!==!1;var d=this.tweenTo(b,c);return d.isFromTo=1,d.duration(Math.abs(d.vars.time-a)/this._timeScale||.001)},k.render=function(a,b,c){this._gc&&this._enabled(!0,!1);var d,f,i,j,k,l,m,n,o=this._time,p=this._dirty?this.totalDuration():this._totalDuration,q=this._duration,r=this._totalTime,s=this._startTime,t=this._timeScale,u=this._rawPrevTime,v=this._paused,w=this._cycle;if(o!==this._time&&(a+=this._time-o),a>=p-1e-7&&a>=0)this._locked||(this._totalTime=p,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(f=!0,j="onComplete",k=!!this._timeline.autoRemoveChildren,0===this._duration&&(0>=a&&a>=-1e-7||0>u||u===e)&&u!==a&&this._first&&(k=!0,u>e&&(j="onReverseComplete"))),this._rawPrevTime=this._duration||!b||a||this._rawPrevTime===a?a:e,this._yoyo&&0!==(1&this._cycle)?this._time=a=0:(this._time=q,a=q+1e-4);else if(1e-7>a)if(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==o||0===q&&u!==e&&(u>0||0>a&&u>=0)&&!this._locked)&&(j="onReverseComplete",f=this._reversed),0>a)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(k=f=!0,j="onReverseComplete"):u>=0&&this._first&&(k=!0),this._rawPrevTime=a;else{if(this._rawPrevTime=q||!b||a||this._rawPrevTime===a?a:e,0===a&&f)for(d=this._first;d&&0===d._startTime;)d._duration||(f=!1),d=d._next;a=0,this._initted||(k=!0)}else if(0===q&&0>u&&(k=!0),this._time=this._rawPrevTime=a,this._locked||(this._totalTime=a,0!==this._repeat&&(l=q+this._repeatDelay,this._cycle=this._totalTime/l>>0,0!==this._cycle&&this._cycle===this._totalTime/l&&a>=r&&this._cycle--,this._time=this._totalTime-this._cycle*l,this._yoyo&&0!==(1&this._cycle)&&(this._time=q-this._time),this._time>q?(this._time=q,a=q+1e-4):this._time<0?this._time=a=0:a=this._time)),this._hasPause&&!this._forcingPlayhead&&!b){if(a=this._time,a>=o||this._repeat&&w!==this._cycle)for(d=this._first;d&&d._startTime<=a&&!m;)d._duration||"isPause"!==d.data||d.ratio||0===d._startTime&&0===this._rawPrevTime||(m=d),d=d._next;else for(d=this._last;d&&d._startTime>=a&&!m;)d._duration||"isPause"===d.data&&d._rawPrevTime>0&&(m=d),d=d._prev;m&&m._startTime<q&&(this._time=a=m._startTime,this._totalTime=a+this._cycle*(this._totalDuration+this._repeatDelay))}if(this._cycle!==w&&!this._locked){var x=this._yoyo&&0!==(1&w),y=x===(this._yoyo&&0!==(1&this._cycle)),z=this._totalTime,A=this._cycle,B=this._rawPrevTime,C=this._time;if(this._totalTime=w*q,this._cycle<w?x=!x:this._totalTime+=q,this._time=o,this._rawPrevTime=0===q?u-1e-4:u,this._cycle=w,this._locked=!0,o=x?0:q,this.render(o,b,0===q),b||this._gc||this.vars.onRepeat&&(this._cycle=A,this._locked=!1,this._callback("onRepeat")),o!==this._time)return;if(y&&(this._cycle=w,this._locked=!0,o=x?q+1e-4:-1e-4,this.render(o,!0,!1)),this._locked=!1,this._paused&&!v)return;this._time=C,this._totalTime=z,this._cycle=A,this._rawPrevTime=B}if(!(this._time!==o&&this._first||c||k||m))return void(r!==this._totalTime&&this._onUpdate&&(b||this._callback("onUpdate")));if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==r&&a>0&&(this._active=!0),0===r&&this.vars.onStart&&(0===this._totalTime&&this._totalDuration||b||this._callback("onStart")),n=this._time,n>=o)for(d=this._first;d&&(i=d._next,n===this._time&&(!this._paused||v));)(d._active||d._startTime<=this._time&&!d._paused&&!d._gc)&&(m===d&&this.pause(),d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)),d=i;else for(d=this._last;d&&(i=d._prev,n===this._time&&(!this._paused||v));){if(d._active||d._startTime<=o&&!d._paused&&!d._gc){if(m===d){for(m=d._prev;m&&m.endTime()>this._time;)m.render(m._reversed?m.totalDuration()-(a-m._startTime)*m._timeScale:(a-m._startTime)*m._timeScale,b,c),m=m._prev;m=null,this.pause()}d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)}d=i}
vendor: 11,041 bytes, lines 66595-66596
66595this._onUpdate&&(b||(g.length&&h(),this._callback("onUpdate"))),j&&(this._locked||this._gc||(s===this._startTime||t!==this._timeScale)&&(0===this._time||p>=this.totalDuration())&&(f&&(g.length&&h(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!b&&this.vars[j]&&this._callback(j)))},k.getActive=function(a,b,c){null==a&&(a=!0),null==b&&(b=!0),null==c&&(c=!1);var d,e,f=[],g=this.getChildren(a,b,c),h=0,i=g.length;for(d=0;i>d;d++)e=g[d],e.isActive()&&(f[h++]=e);return f},k.getLabelAfter=function(a){a||0!==a&&(a=this._time);var b,c=this.getLabelsArray(),d=c.length;for(b=0;d>b;b++)if(c[b].time>a)return c[b].name;return null},k.getLabelBefore=function(a){null==a&&(a=this._time);for(var b=this.getLabelsArray(),c=b.length;--c>-1;)if(b[c].time<a)return b[c].name;return null},k.getLabelsArray=function(){var a,b=[],c=0;for(a in this._labels)b[c++]={time:this._labels[a],name:a};return b.sort(function(a,b){return a.time-b.time}),b},k.invalidate=function(){return this._locked=!1,a.prototype.invalidate.call(this)},k.progress=function(a,b){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-a:a)+this._cycle*(this._duration+this._repeatDelay),b):this._time/this.duration()||0},k.totalProgress=function(a,b){return arguments.length?this.totalTime(this.totalDuration()*a,b):this._totalTime/this.totalDuration()||0},k.totalDuration=function(b){return arguments.length?-1!==this._repeat&&b?this.timeScale(this.totalDuration()/b):this:(this._dirty&&(a.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},k.time=function(a,b){return arguments.length?(this._dirty&&this.totalDuration(),a>this._duration&&(a=this._duration),this._yoyo&&0!==(1&this._cycle)?a=this._duration-a+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(a+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(a,b)):this._time},k.repeat=function(a){return arguments.length?(this._repeat=a,this._uncache(!0)):this._repeat},k.repeatDelay=function(a){return arguments.length?(this._repeatDelay=a,this._uncache(!0)):this._repeatDelay},k.yoyo=function(a){return arguments.length?(this._yoyo=a,this):this._yoyo},k.currentLabel=function(a){return arguments.length?this.seek(a,!0):this.getLabelBefore(this._time+1e-8)},d},!0),function(){var a=180/Math.PI,b=[],c=[],d=[],e={},f=_gsScope._gsDefine.globals,g=function(a,b,c,d){c===d&&(c=d-(d-b)/1e6),a===b&&(b=a+(c-a)/1e6),this.a=a,this.b=b,this.c=c,this.d=d,this.da=d-a,this.ca=c-a,this.ba=b-a},h=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",i=function(a,b,c,d){var e={a:a},f={},g={},h={c:d},i=(a+b)/2,j=(b+c)/2,k=(c+d)/2,l=(i+j)/2,m=(j+k)/2,n=(m-l)/8;return e.b=i+(a-i)/4,f.b=l+n,e.c=f.a=(e.b+f.b)/2,f.c=g.a=(l+m)/2,g.b=m-n,h.b=k+(d-k)/4,g.c=h.a=(g.b+h.b)/2,[e,f,g,h]},j=function(a,e,f,g,h){var j,k,l,m,n,o,p,q,r,s,t,u,v,w=a.length-1,x=0,y=a[0].a;for(j=0;w>j;j++)n=a[x],k=n.a,l=n.d,m=a[x+1].d,h?(t=b[j],u=c[j],v=(u+t)*e*.25/(g?.5:d[j]||.5),o=l-(l-k)*(g?.5*e:0!==t?v/t:0),p=l+(m-l)*(g?.5*e:0!==u?v/u:0),q=l-(o+((p-o)*(3*t/(t+u)+.5)/4||0))):(o=l-(l-k)*e*.5,p=l+(m-l)*e*.5,q=l-(o+p)/2),o+=q,p+=q,n.c=r=o,0!==j?n.b=y:n.b=y=n.a+.6*(n.c-n.a),n.da=l-k,n.ca=r-k,n.ba=y-k,f?(s=i(k,y,r,l),a.splice(x,1,s[0],s[1],s[2],s[3]),x+=4):x++,y=p;n=a[x],n.b=y,n.c=y+.4*(n.d-y),n.da=n.d-n.a,n.ca=n.c-n.a,n.ba=y-n.a,f&&(s=i(n.a,y,n.c,n.d),a.splice(x,1,s[0],s[1],s[2],s[3]))},k=function(a,d,e,f){var h,i,j,k,l,m,n=[];if(f)for(a=[f].concat(a),i=a.length;--i>-1;)"string"==typeof(m=a[i][d])&&"="===m.charAt(1)&&(a[i][d]=f[d]+Number(m.charAt(0)+m.substr(2)));if(h=a.length-2,0>h)return n[0]=new g(a[0][d],0,0,a[0][d]),n;for(i=0;h>i;i++)j=a[i][d],k=a[i+1][d],n[i]=new g(j,0,0,k),e&&(l=a[i+2][d],b[i]=(b[i]||0)+(k-j)*(k-j),c[i]=(c[i]||0)+(l-k)*(l-k));return n[i]=new g(a[i][d],0,0,a[i+1][d]),n},l=function(a,f,g,i,l,m){var n,o,p,q,r,s,t,u,v={},w=[],x=m||a[0];l="string"==typeof l?","+l+",":h,null==f&&(f=1);for(o in a[0])w.push(o);if(a.length>1){for(u=a[a.length-1],t=!0,n=w.length;--n>-1;)if(o=w[n],Math.abs(x[o]-u[o])>.05){t=!1;break}t&&(a=a.concat(),m&&a.unshift(m),a.push(a[1]),m=a[a.length-3])}for(b.length=c.length=d.length=0,n=w.length;--n>-1;)o=w[n],e[o]=-1!==l.indexOf(","+o+","),v[o]=k(a,o,e[o],m);for(n=b.length;--n>-1;)b[n]=Math.sqrt(b[n]), 66596c[n]=Math.sqrt(c[n]);if(!i){for(n=w.length;--n>-1;)if(e[o])for(p=v[w[n]],s=p.length-1,q=0;s>q;q++)r=p[q+1].da/c[q]+p[q].da/b[q]||0,d[q]=(d[q]||0)+r*r;for(n=d.length;--n>-1;)d[n]=Math.sqrt(d[n])}for(n=w.length,q=g?4:1;--n>-1;)o=w[n],p=v[o],j(p,f,g,i,e[o]),t&&(p.splice(0,q),p.splice(p.length-q,q));return v},m=function(a,b,c){b=b||"soft";var d,e,f,h,i,j,k,l,m,n,o,p={},q="cubic"===b?3:2,r="soft"===b,s=[];if(r&&c&&(a=[c].concat(a)),null==a||a.length<q+1)throw"invalid Bezier data";for(m in a[0])s.push(m);for(j=s.length;--j>-1;){for(m=s[j],p[m]=i=[],n=0,l=a.length,k=0;l>k;k++)d=null==c?a[k][m]:"string"==typeof(o=a[k][m])&&"="===o.charAt(1)?c[m]+Number(o.charAt(0)+o.substr(2)):Number(o),r&&k>1&&l-1>k&&(i[n++]=(d+i[n-2])/2),i[n++]=d;for(l=n-q+1,n=0,k=0;l>k;k+=q)d=i[k],e=i[k+1],f=i[k+2],h=2===q?0:i[k+3],i[n++]=o=3===q?new g(d,e,f,h):new g(d,(2*e+d)/3,(2*e+f)/3,f);i.length=n}return p},n=function(a,b,c){for(var d,e,f,g,h,i,j,k,l,m,n,o=1/c,p=a.length;--p>-1;)for(m=a[p],f=m.a,g=m.d-f,h=m.c-f,i=m.b-f,d=e=0,k=1;c>=k;k++)j=o*k,l=1-j,d=e-(e=(j*j*g+3*l*(j*h+l*i))*j),n=p*c+k-1,b[n]=(b[n]||0)+d*d},o=function(a,b){b=b>>0||6;var c,d,e,f,g=[],h=[],i=0,j=0,k=b-1,l=[],m=[];for(c in a)n(a[c],g,b);for(e=g.length,d=0;e>d;d++)i+=Math.sqrt(g[d]),f=d%b,m[f]=i,f===k&&(j+=i,f=d/b>>0,l[f]=m,h[f]=j,i=0,m=[]);return{length:j,lengths:h,segments:l}},p=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.8",API:2,global:!0,init:function(a,b,c){this._target=a,b instanceof Array&&(b={values:b}),this._func={},this._mod={},this._props=[],this._timeRes=null==b.timeResolution?6:parseInt(b.timeResolution,10);var d,e,f,g,h,i=b.values||[],j={},k=i[0],n=b.autoRotate||c.vars.orientToBezier;this._autoRotate=n?n instanceof Array?n:[["x","y","rotation",n===!0?0:Number(n)||0]]:null;for(d in k)this._props.push(d);for(f=this._props.length;--f>-1;)d=this._props[f],this._overwriteProps.push(d),e=this._func[d]="function"==typeof a[d],j[d]=e?a[d.indexOf("set")||"function"!=typeof a["get"+d.substr(3)]?d:"get"+d.substr(3)]():parseFloat(a[d]),h||j[d]!==i[0][d]&&(h=j);if(this._beziers="cubic"!==b.type&&"quadratic"!==b.type&&"soft"!==b.type?l(i,isNaN(b.curviness)?1:b.curviness,!1,"thruBasic"===b.type,b.correlate,h):m(i,b.type,j),this._segCount=this._beziers[d].length,this._timeRes){var p=o(this._beziers,this._timeRes);this._length=p.length,this._lengths=p.lengths,this._segments=p.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(n=this._autoRotate)for(this._initialRotations=[],n[0]instanceof Array||(this._autoRotate=n=[n]),f=n.length;--f>-1;){for(g=0;3>g;g++)d=n[f][g],this._func[d]="function"==typeof a[d]?a[d.indexOf("set")||"function"!=typeof a["get"+d.substr(3)]?d:"get"+d.substr(3)]:!1;d=n[f][2],this._initialRotations[f]=(this._func[d]?this._func[d].call(this._target):this._target[d])||0,this._overwriteProps.push(d)}return this._startRatio=c.vars.runBackwards?1:0,!0},set:function(b){var c,d,e,f,g,h,i,j,k,l,m=this._segCount,n=this._func,o=this._target,p=b!==this._startRatio;if(this._timeRes){if(k=this._lengths,l=this._curSeg,b*=this._length,e=this._li,b>this._l2&&m-1>e){for(j=m-1;j>e&&(this._l2=k[++e])<=b;);this._l1=k[e-1],this._li=e,this._curSeg=l=this._segments[e],this._s2=l[this._s1=this._si=0]}else if(b<this._l1&&e>0){for(;e>0&&(this._l1=k[--e])>=b;);0===e&&b<this._l1?this._l1=0:e++,this._l2=k[e],this._li=e,this._curSeg=l=this._segments[e],this._s1=l[(this._si=l.length-1)-1]||0,this._s2=l[this._si]}if(c=e,b-=this._l1,e=this._si,b>this._s2&&e<l.length-1){for(j=l.length-1;j>e&&(this._s2=l[++e])<=b;);this._s1=l[e-1],this._si=e}else if(b<this._s1&&e>0){for(;e>0&&(this._s1=l[--e])>=b;);0===e&&b<this._s1?this._s1=0:e++,this._s2=l[e],this._si=e}h=(e+(b-this._s1)/(this._s2-this._s1))*this._prec||0}else c=0>b?0:b>=1?m-1:m*b>>0,h=(b-c*(1/m))*m;for(d=1-h,e=this._props.length;--e>-1;)f=this._props[e],g=this._beziers[f][c],i=(h*h*g.da+3*d*(h*g.ca+d*g.ba))*h+g.a,this._mod[f]&&(i=this._mod[f](i,o)),n[f]?o[f](i):o[f]=i;if(this._autoRotate){var q,r,s,t,u,v,w,x=this._autoRotate;for(e=x.length;--e>-1;)f=x[e][2],v=x[e][3]||0,w=x[e][4]===!0?1:a,g=this._beziers[x[e][0]],q=this._beziers[x[e][1]],g&&q&&(g=g[c],q=q[c],r=g.a+(g.b-g.a)*h,t=g.b+(g.c-g.b)*h,r+=(t-r)*h,t+=(g.c+(g.d-g.c)*h-t)*h,s=q.a+(q.b-q.a)*h,u=q.b+(q.c-q.b)*h,s+=(u-s)*h,u+=(q.c+(q.d-q.c)*h-u)*h,i=p?Math.atan2(u-s,t-r)*w+v:this._initialRotations[e],this._mod[f]&&(i=this._mod[f](i,o)),n[f]?o[f](i):o[f]=i)}}}),q=p.prototype;p.bezierThrough=l,p.cubicToQuadratic=i,p._autoCSS=!0,p.quadraticToCubic=function(a,b,c){return new g(a,(2*b+a)/3,(2*b+c)/3,c)},p._cssRegister=function(){var a=f.CSSPlugin;if(a){var b=a._internals,c=b._parseToProxy,d=b._setPluginRatio,e=b.CSSPropTween;b._registerComplexSpecialProp("bezier",{parser:function(a,b,f,g,h,i){b instanceof Array&&(b={values:b}),i=new p;var j,k,l,m=b.values,n=m.length-1,o=[],q={};if(0>n)return h;for(j=0;n>=j;j++)l=c(a,m[j],g,h,i,n!==j),o[j]=l.end;for(k in b)q[k]=b[k];return q.values=o,h=new e(a,"bezier",0,0,l.pt,2),h.data=l,h.plugin=i,h.setRatio=d,0===q.autoRotate&&(q.autoRotate=!0),!q.autoRotate||q.autoRotate instanceof Array||(j=q.autoRotate===!0?0:Number(q.autoRotate),q.autoRotate=null!=l.end.left?[["left","top","rotation",j,!1]]:null!=l.end.x?[["x","y","rotation",j,!1]]:!1),q.autoRotate&&(g._transform||g._enableTransforms(!1),l.autoRotate=g._target._gsTransform,l.proxy.rotation=l.autoRotate.rotation||0,g._overwriteProps.push("rotation")),i._onInitTween(l.proxy,q,g._tween),h}})}},q._mod=function(a){for(var b,c=this._overwriteProps,d=c.length;--d>-1;)b=a[c[d]],b&&"function"==typeof b&&(this._mod[c[d]]=b)},q._kill=function(a){var b,c,d=this._props;for(b in this._beziers)if(b in a)for(delete this._beziers[b],delete this._func[b],c=d.length;--c>-1;)d[c]===b&&d.splice(c,1);if(d=this._autoRotate)for(c=d.length;--c>-1;)a[d[c][2]]&&d.splice(c,1);return this._super._kill.call(this,a)}}(),_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(a,b){var c,d,e,f,g=function(){a.call(this,"css"),this._overwriteProps.length=0,this.setRatio=g.prototype.setRatio},h=_gsScope._gsDefine.globals,i={},j=g.prototype=new a("css");j.constructor=g,g.version="2.0.2",g.API=2,g.defaultTransformPerspective=0,g.defaultSkewType="compensated",g.defaultSmoothOrigin=!0,j="px",g.suffixMap={top:j,right:j,bottom:j,left:j,width:j,height:j,fontSize:j,padding:j,margin:j,perspective:j,lineHeight:""};var k,l,m,n,o,p,q,r,s=/(?:\-|\.|\b)(\d|\.|e\-)+/g,t=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,u=/(?:\+=|\
vendor: 12,790 bytes, line 66596
66596-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,v=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,w=/(?:\d|\-|\+|=|#|\.)*/g,x=/opacity *= *([^)]*)/i,y=/opacity:([^;]*)/i,z=/alpha\(opacity *=.+?\)/i,A=/^(rgb|hsl)/,B=/([A-Z])/g,C=/-([a-z])/gi,D=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,E=function(a,b){return b.toUpperCase()},F=/(?:Left|Right|Width)/i,G=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,H=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,I=/,(?=[^\)]*(?:\(|$))/gi,J=/[\s,\(]/i,K=Math.PI/180,L=180/Math.PI,M={},N={style:{}},O=_gsScope.document||{createElement:function(){return N}},P=function(a,b){return O.createElementNS?O.createElementNS(b||"http://www.w3.org/1999/xhtml",a):O.createElement(a)},Q=P("div"),R=P("img"),S=g._internals={_specialProps:i},T=(_gsScope.navigator||{}).userAgent||"",U=function(){var a=T.indexOf("Android"),b=P("a");return m=-1!==T.indexOf("Safari")&&-1===T.indexOf("Chrome")&&(-1===a||parseFloat(T.substr(a+8,2))>3),o=m&&parseFloat(T.substr(T.indexOf("Version/")+8,2))<6,n=-1!==T.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T))&&(p=parseFloat(RegExp.$1)),b?(b.style.cssText="top:1px;opacity:.55;",/^0.55/.test(b.style.opacity)):!1}(),V=function(a){return x.test("string"==typeof a?a:(a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100:1},W=function(a){_gsScope.console&&console.log(a)},X="",Y="",Z=function(a,b){b=b||Q;var c,d,e=b.style;if(void 0!==e[a])return a;for(a=a.charAt(0).toUpperCase()+a.substr(1),c=["O","Moz","ms","Ms","Webkit"],d=5;--d>-1&&void 0===e[c[d]+a];);return d>=0?(Y=3===d?"ms":c[d],X="-"+Y.toLowerCase()+"-",Y+a):null},$=("undefined"!=typeof window?window:O.defaultView||{getComputedStyle:function(){}}).getComputedStyle,_=g.getStyle=function(a,b,c,d,e){var f;return U||"opacity"!==b?(!d&&a.style[b]?f=a.style[b]:(c=c||$(a))?f=c[b]||c.getPropertyValue(b)||c.getPropertyValue(b.replace(B,"-$1").toLowerCase()):a.currentStyle&&(f=a.currentStyle[b]),null==e||f&&"none"!==f&&"auto"!==f&&"auto auto"!==f?f:e):V(a)},aa=S.convertToPixels=function(a,c,d,e,f){if("px"===e||!e&&"lineHeight"!==c)return d;if("auto"===e||!d)return 0;var h,i,j,k=F.test(c),l=a,m=Q.style,n=0>d,o=1===d;if(n&&(d=-d),o&&(d*=100),"lineHeight"!==c||e)if("%"===e&&-1!==c.indexOf("border"))h=d/100*(k?a.clientWidth:a.clientHeight);else{if(m.cssText="border:0 solid red;position:"+_(a,"position")+";line-height:0;","%"!==e&&l.appendChild&&"v"!==e.charAt(0)&&"rem"!==e)m[k?"borderLeftWidth":"borderTopWidth"]=d+e;else{if(l=a.parentNode||O.body,-1!==_(l,"display").indexOf("flex")&&(m.position="absolute"),i=l._gsCache,j=b.ticker.frame,i&&k&&i.time===j)return i.width*d/100;m[k?"width":"height"]=d+e}l.appendChild(Q),h=parseFloat(Q[k?"offsetWidth":"offsetHeight"]),l.removeChild(Q),k&&"%"===e&&g.cacheWidths!==!1&&(i=l._gsCache=l._gsCache||{},i.time=j,i.width=h/d*100),0!==h||f||(h=aa(a,c,d,e,!0))}else i=$(a).lineHeight,a.style.lineHeight=d,h=parseFloat($(a).lineHeight),a.style.lineHeight=i;return o&&(h/=100),n?-h:h},ba=S.calculateOffset=function(a,b,c){if("absolute"!==_(a,"position",c))return 0;var d="left"===b?"Left":"Top",e=_(a,"margin"+d,c);return a["offset"+d]-(aa(a,b,parseFloat(e),e.replace(w,""))||0)},ca=function(a,b){var c,d,e,f={};if(b=b||$(a,null))if(c=b.length)for(;--c>-1;)e=b[c],(-1===e.indexOf("-transform")||Da===e)&&(f[e.replace(C,E)]=b.getPropertyValue(e));else for(c in b)(-1===c.indexOf("Transform")||Ca===c)&&(f[c]=b[c]);else if(b=a.currentStyle||a.style)for(c in b)"string"==typeof c&&void 0===f[c]&&(f[c.replace(C,E)]=b[c]);return U||(f.opacity=V(a)),d=Ra(a,b,!1),f.rotation=d.rotation,f.skewX=d.skewX,f.scaleX=d.scaleX,f.scaleY=d.scaleY,f.x=d.x,f.y=d.y,Fa&&(f.z=d.z,f.rotationX=d.rotationX,f.rotationY=d.rotationY,f.scaleZ=d.scaleZ),f.filters&&delete f.filters,f},da=function(a,b,c,d,e){var f,g,h,i={},j=a.style;for(g in c)"cssText"!==g&&"length"!==g&&isNaN(g)&&(b[g]!==(f=c[g])||e&&e[g])&&-1===g.indexOf("Origin")&&("number"==typeof f||"string"==typeof f)&&(i[g]="auto"!==f||"left"!==g&&"top"!==g?""!==f&&"auto"!==f&&"none"!==f||"string"!=typeof b[g]||""===b[g].replace(v,"")?f:0:ba(a,g),void 0!==j[g]&&(h=new sa(j,g,j[g],h)));if(d)for(g in d)"className"!==g&&(i[g]=d[g]);return{difs:i,firstMPT:h}},ea={width:["Left","Right"],height:["Top","Bottom"]},fa=["marginLeft","marginRight","marginTop","marginBottom"],ga=function(a,b,c){if("svg"===(a.nodeName+"").toLowerCase())return(c||$(a))[b]||0;if(a.getCTM&&Oa(a))return a.getBBox()[b]||0;var d=parseFloat("width"===b?a.offsetWidth:a.offsetHeight),e=ea[b],f=e.length;for(c=c||$(a,null);--f>-1;)d-=parseFloat(_(a,"padding"+e[f],c,!0))||0,d-=parseFloat(_(a,"border"+e[f]+"Width",c,!0))||0;return d},ha=function(a,b){if("contain"===a||"auto"===a||"auto auto"===a)return a+" ";(null==a||""===a)&&(a="0 0");var c,d=a.split(" "),e=-1!==a.indexOf("left")?"0%":-1!==a.indexOf("right")?"100%":d[0],f=-1!==a.indexOf("top")?"0%":-1!==a.indexOf("bottom")?"100%":d[1];if(d.length>3&&!b){for(d=a.split(", ").join(",").split(","),a=[],c=0;c<d.length;c++)a.push(ha(d[c]));return a.join(",")}return null==f?f="center"===e?"50%":"0":"center"===f&&(f="50%"),("center"===e||isNaN(parseFloat(e))&&-1===(e+"").indexOf("="))&&(e="50%"),a=e+" "+f+(d.length>2?" "+d[2]:""),b&&(b.oxp=-1!==e.indexOf("%"),b.oyp=-1!==f.indexOf("%"),b.oxr="="===e.charAt(1),b.oyr="="===f.charAt(1),b.ox=parseFloat(e.replace(v,"")),b.oy=parseFloat(f.replace(v,"")),b.v=a),b||a},ia=function(a,b){return"function"==typeof a&&(a=a(r,q)),"string"==typeof a&&"="===a.charAt(1)?parseInt(a.charAt(0)+"1",10)*parseFloat(a.substr(2)):parseFloat(a)-parseFloat(b)||0},ja=function(a,b){"function"==typeof a&&(a=a(r,q));var c="string"==typeof a&&"="===a.charAt(1);return"string"==typeof a&&"v"===a.charAt(a.length-2)&&(a=(c?a.substr(0,2):0)+window["inner"+("vh"===a.substr(-2)?"Height":"Width")]*(parseFloat(c?a.substr(2):a)/100)),null==a?b:c?parseInt(a.charAt(0)+"1",10)*parseFloat(a.substr(2))+b:parseFloat(a)||0},ka=function(a,b,c,d){var e,f,g,h,i,j=1e-6;return"function"==typeof a&&(a=a(r,q)),null==a?h=b:"number"==typeof a?h=a:(e=360,f=a.split("_"),i="="===a.charAt(1),g=(i?parseInt(a.charAt(0)+"1",10)*parseFloat(f[0].substr(2)):parseFloat(f[0]))*(-1===a.indexOf("rad")?1:L)-(i?0:b),f.length&&(d&&(d[c]=b+g),-1!==a.indexOf("short")&&(g%=e,g!==g%(e/2)&&(g=0>g?g+e:g-e)),-1!==a.indexOf("_cw")&&0>g?g=(g+9999999999*e)%e-(g/e|0)*e:-1!==a.indexOf("ccw")&&g>0&&(g=(g-9999999999*e)%e-(g/e|0)*e)),h=b+g),j>h&&h>-j&&(h=0),h},la={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ma=function(a,b,c){return a=0>a?a+1:a>1?a-1:a,255*(1>6*a?b+(c-b)*a*6:.5>a?c:2>3*a?b+(c-b)*(2/3-a)*6:b)+.5|0},na=g.parseColor=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;if(a)if("number"==typeof a)c=[a>>16,a>>8&255,255&a];else{if(","===a.charAt(a.length-1)&&(a=a.substr(0,a.length-1)),la[a])c=la[a];else if("#"===a.charAt(0))4===a.length&&(d=a.charAt(1),e=a.charAt(2),f=a.charAt(3),a="#"+d+d+e+e+f+f),a=parseInt(a.substr(1),16),c=[a>>16,a>>8&255,255&a];else if("hsl"===a.substr(0,3))if(c=m=a.match(s),b){if(-1!==a.indexOf("="))return a.match(t)}else g=Number(c[0])%360/360,h=Number(c[1])/100,i=Number(c[2])/100,e=.5>=i?i*(h+1):i+h-i*h,d=2*i-e,c.length>3&&(c[3]=Number(c[3])),c[0]=ma(g+1/3,d,e),c[1]=ma(g,d,e),c[2]=ma(g-1/3,d,e);else c=a.match(s)||la.transparent;c[0]=Number(c[0]),c[1]=Number(c[1]),c[2]=Number(c[2]),c.length>3&&(c[3]=Number(c[3]))}else c=la.black;return b&&!m&&(d=c[0]/255,e=c[1]/255,f=c[2]/255,j=Math.max(d,e,f),k=Math.min(d,e,f),i=(j+k)/2,j===k?g=h=0:(l=j-k,h=i>.5?l/(2-j-k):l/(j+k),g=j===d?(e-f)/l+(f>e?6:0):j===e?(f-d)/l+2:(d-e)/l+4,g*=60),c[0]=g+.5|0,c[1]=100*h+.5|0,c[2]=100*i+.5|0),c},oa=function(a,b){var c,d,e,f=a.match(pa)||[],g=0,h="";if(!f.length)return a;for(c=0;c<f.length;c++)d=f[c],e=a.substr(g,a.indexOf(d,g)-g),g+=e.length+d.length,d=na(d,b),3===d.length&&d.push(1),h+=e+(b?"hsla("+d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:"rgba("+d.join(","))+")";return h+a.substr(g)},pa="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b";for(j in la)pa+="|"+j+"\\b";pa=new RegExp(pa+")","gi"),g.colorStringFilter=function(a){var b,c=a[0]+" "+a[1];pa.test(c)&&(b=-1!==c.indexOf("hsl(")||-1!==c.indexOf("hsla("),a[0]=oa(a[0],b),a[1]=oa(a[1],b)),pa.lastIndex=0},b.defaultStringFilter||(b.defaultStringFilter=g.colorStringFilter);var qa=function(a,b,c,d){if(null==a)return function(a){return a};var e,f=b?(a.match(pa)||[""])[0]:"",g=a.split(f).join("").match(u)||[],h=a.substr(0,a.indexOf(g[0])),i=")"===a.charAt(a.length-1)?")":"",j=-1!==a.indexOf(" ")?" ":",",k=g.length,l=k>0?g[0].replace(s,""):"";return k?e=b?function(a){var b,m,n,o;if("number"==typeof a)a+=l;else if(d&&I.test(a)){for(o=a.replace(I,"|").split("|"),n=0;n<o.length;n++)o[n]=e(o[n]);return o.join(",")}if(b=(a.match(pa)||[f])[0],m=a.split(b).join("").match(u)||[],n=m.length,k>n--)for(;++n<k;)m[n]=c?m[(n-1)/2|0]:g[n];return h+m.join(j)+j+b+i+(-1!==a.indexOf("inset")?" inset":"")}:function(a){var b,f,m;if("number"==typeof a)a+=l;else if(d&&I.test(a)){for(f=a.replace(I,"|").split("|"),m=0;m<f.length;m++)f[m]=e(f[m]);return f.join(",")}if(b=a.match(u)||[],m=b.length,k>m--)for(;++m<k;)b[m]=c?b[(m-1)/2|0]:g[m];return h+b.join(j)+i}:function(a){return a}},ra=function(a){return a=a.split(","),function(b,c,d,e,f,g,h){var i,j=(c+"").split(" ");for(h={},i=0;4>i;i++)h[a[i]]=j[i]=j[i]||j[(i-1)/2>>0];return e.parse(b,h,f,g)}},sa=(S._setPluginRatio=function(a){this.plugin.setRatio(a);for(var b,c,d,e,f,g=this.data,h=g.proxy,i=g.firstMPT,j=1e-6;i;)b=h[i.v],i.r?b=i.r(b):j>b&&b>-j&&(b=0),i.t[i.p]=b,i=i._next;if(g.autoRotate&&(g.autoRotate.rotation=g.mod?g.mod.call(this._tween,h.rotation,this.t,this._tween):h.rotation),1===a||0===a)for(i=g.firstMPT,f=1===a?"e":"b";i;){if(c=i.t,c.type){if(1===c.type){for(e=c.xs0+c.s+c.xs1,d=1;d<c.l;d++)e+=c["xn"+d]+c["xs"+(d+1)];c[f]=e}}else c[f]=c.s+c.xs0;i=i._next}},function(a,b,c,d,e){this.t=a,this.p=b,this.v=c,this.r=e,d&&(d._prev=this,this._next=d)}),ta=(S._parseToProxy=function(a,b,c,d,e,f){var g,h,i,j,k,l=d,m={},n={},o=c._transform,p=M;for(c._transform=null,M=b,d=k=c.parse(a,b,d,e),M=p,f&&(c._transform=o,l&&(l._prev=null,l._prev&&(l._prev._next=null)));d&&d!==l;){if(d.type<=1&&(h=d.p,n[h]=d.s+d.c,m[h]=d.s,f||(j=new sa(d,"s",h,j,d.r),d.c=0),1===d.type))for(g=d.l;--g>0;)i="xn"+g,h=d.p+"_"+i,n[h]=d.data[i],m[h]=d[i],f||(j=new sa(d,i,h,j,d.rxp[i]));d=d._next}return{proxy:m,end:n,firstMPT:j,pt:k}},S.CSSPropTween=function(a,b,d,e,g,h,i,j,k,l,m){this.t=a,this.p=b,this.s=d,this.c=e,this.n=i||b,a instanceof ta||f.push(this.n),this.r=j?"function"==typeof j?j:Math.round:j,this.type=h||0,k&&(this.pr=k,c=!0),this.b=void 0===l?d:l,this.e=void 0===m?d+e:m,g&&(this._next=g,g._prev=this)}),ua=function(a,b,c,d,e,f){var g=new ta(a,b,c,d-c,e,-1,f);return g.b=c,g.e=g.xs0=d,g},va=g.parseComplex=function(a,b,c,d,e,f,h,i,j,l){c=c||f||"","function"==typeof d&&(d=d(r,q)),h=new ta(a,b,0,0,h,l?2:1,null,!1,i,c,d),d+="",e&&pa.test(d+c)&&(d=[c,d],g.colorStringFilter(d),c=d[0],d=d[1]);var m,n,o,p,u,v,w,x,y,z,A,B,C,D=c.split(", ").join(",").split(" "),E=d.split(", ").join(",").split(" "),F=D.length,G=k!==!1;for((-1!==d.indexOf(",")||-1!==c.indexOf(","))&&(-1!==(d+c).indexOf("rgb")||-1!==(d+c).indexOf("hsl")?(D=D.join(" ").replace(I,", ").split(" "),E=E.join(" ").replace(I,", ").split(" ")):(D=D.join(" ").split(",").join(", ").split(" "),E=E.join(" ").split(",").join(", ").split(" ")),F=D.length),F!==E.length&&(D=(f||"").split(" "),F=D.length),h.plugin=j,h.setRatio=l,pa.lastIndex=0,m=0;F>m;m++)if(p=D[m],u=E[m]+"",x=parseFloat(p),x||0===x)h.appendXtra("",x,ia(u,x),u.replace(t,""),G&&-1!==u.indexOf("px")?Math.round:!1,!0);else if(e&&pa.test(p))B=u.indexOf(")")+1,B=")"+(B?u.substr(B):""),C=-1!==u.indexOf("hsl")&&U,z=u,p=na(p,C),u=na(u,C),y=p.length+u.length>6,y&&!U&&0===u[3]?(h["xs"+h.l]+=h.l?" transparent":"transparent",h.e=h.e.split(E[m]).join("transparent")):(U||(y=!1),C?h.appendXtra(z.substr(0,z.indexOf("hsl"))+(y?"hsla(":"hsl("),p[0],ia(u[0],p[0]),",",!1,!0).appendXtra("",p[1],ia(u[1],p[1]),"%,",!1).appendXtra("",p[2],ia(u[2],p[2]),y?"%,":"%"+B,!1):h.appendXtra(z.substr(0,z.indexOf("rgb"))+(y?"rgba(":"rgb("),p[0],u[0]-p[0],",",Math.round,!0).appendXtra("",p[1],u[1]-p[1],",",Math.round).appendXtra("",p[2],u[2]-p[2],y?",":B,Math.round),y&&(p=p.length<4?1:p[3],h.appendXtra("",p,(u.length<4?1:u[3])-p,B,!1))),pa.lastIndex=0;else if(v=p.match(s)){if(w=u.match(t),!w||w.length!==v.length)return h;for(o=0,n=0;n<v.length;n++)A=v[n],z=p.indexOf(A,o),h.appendXtra(p.substr(o,z-o),Number(A),ia(w[n],A),"",G&&"px"===p.substr(z+A.length,2)?Math.round:!1,
vendor: 13,758 bytes, lines 66596-66597
665960===n),o=z+A.length;h["xs"+h.l]+=p.substr(o)}else h["xs"+h.l]+=h.l||h["xs"+h.l]?" "+u:u;if(-1!==d.indexOf("=")&&h.data){for(B=h.xs0+h.data.s,m=1;m<h.l;m++)B+=h["xs"+m]+h.data["xn"+m];h.e=B+h["xs"+m]}return h.l||(h.type=-1,h.xs0=h.e),h.xfirst||h},wa=9;for(j=ta.prototype,j.l=j.pr=0;--wa>0;)j["xn"+wa]=0,j["xs"+wa]="";j.xs0="",j._next=j._prev=j.xfirst=j.data=j.plugin=j.setRatio=j.rxp=null,j.appendXtra=function(a,b,c,d,e,f){var g=this,h=g.l;return g["xs"+h]+=f&&(h||g["xs"+h])?" "+a:a||"",c||0===h||g.plugin?(g.l++,g.type=g.setRatio?2:1,g["xs"+g.l]=d||"",h>0?(g.data["xn"+h]=b+c,g.rxp["xn"+h]=e,g["xn"+h]=b,g.plugin||(g.xfirst=new ta(g,"xn"+h,b,c,g.xfirst||g,0,g.n,e,g.pr),g.xfirst.xs0=0),g):(g.data={s:b+c},g.rxp={},g.s=b,g.c=c,g.r=e,g)):(g["xs"+h]+=b+(d||""),g)};var xa=function(a,b){b=b||{},this.p=b.prefix?Z(a)||a:a,i[a]=i[this.p]=this,this.format=b.formatter||qa(b.defaultValue,b.color,b.collapsible,b.multi),b.parser&&(this.parse=b.parser),this.clrs=b.color,this.multi=b.multi,this.keyword=b.keyword,this.dflt=b.defaultValue,this.pr=b.priority||0},ya=S._registerComplexSpecialProp=function(a,b,c){"object"!=typeof b&&(b={parser:c});var d,e,f=a.split(","),g=b.defaultValue;for(c=c||[g],d=0;d<f.length;d++)b.prefix=0===d&&b.prefix,b.defaultValue=c[d]||g,e=new xa(f[d],b)},za=S._registerPluginProp=function(a){if(!i[a]){var b=a.charAt(0).toUpperCase()+a.substr(1)+"Plugin";ya(a,{parser:function(a,c,d,e,f,g,j){var k=h.com.greensock.plugins[b];return k?(k._cssRegister(),i[d].parse(a,c,d,e,f,g,j)):(W("Error: "+b+" js file not loaded."),f)}})}};j=xa.prototype,j.parseComplex=function(a,b,c,d,e,f){var g,h,i,j,k,l,m=this.keyword;if(this.multi&&(I.test(c)||I.test(b)?(h=b.replace(I,"|").split("|"),i=c.replace(I,"|").split("|")):m&&(h=[b],i=[c])),i){for(j=i.length>h.length?i.length:h.length,g=0;j>g;g++)b=h[g]=h[g]||this.dflt,c=i[g]=i[g]||this.dflt,m&&(k=b.indexOf(m),l=c.indexOf(m),k!==l&&(-1===l?h[g]=h[g].split(m).join(""):-1===k&&(h[g]+=" "+m)));b=h.join(", "),c=i.join(", ")}return va(a,this.p,b,c,this.clrs,this.dflt,d,this.pr,e,f)},j.parse=function(a,b,c,d,f,g,h){return this.parseComplex(a.style,this.format(_(a,this.p,e,!1,this.dflt)),this.format(b),f,g)},g.registerSpecialProp=function(a,b,c){ya(a,{parser:function(a,d,e,f,g,h,i){var j=new ta(a,e,0,0,g,2,e,!1,c);return j.plugin=h,j.setRatio=b(a,d,f._tween,e),j},priority:c})},g.useSVGTransformAttr=!0;var Aa,Ba="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),Ca=Z("transform"),Da=X+"transform",Ea=Z("transformOrigin"),Fa=null!==Z("perspective"),Ga=S.Transform=function(){this.perspective=parseFloat(g.defaultTransformPerspective)||0,this.force3D=g.defaultForce3D!==!1&&Fa?g.defaultForce3D||"auto":!1},Ha=_gsScope.SVGElement,Ia=function(a,b,c){var d,e=O.createElementNS("http://www.w3.org/2000/svg",a),f=/([a-z])([A-Z])/g;for(d in c)e.setAttributeNS(null,d.replace(f,"$1-$2").toLowerCase(),c[d]);return b.appendChild(e),e},Ja=O.documentElement||{},Ka=function(){var a,b,c,d=p||/Android/i.test(T)&&!_gsScope.chrome;return O.createElementNS&&!d&&(a=Ia("svg",Ja),b=Ia("rect",a,{width:100,height:50,x:100}),c=b.getBoundingClientRect().width,b.style[Ea]="50% 50%",b.style[Ca]="scaleX(0.5)",d=c===b.getBoundingClientRect().width&&!(n&&Fa),Ja.removeChild(a)),d}(),La=function(a,b,c,d,e,f){var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=a._gsTransform,w=Qa(a,!0);v&&(t=v.xOrigin,u=v.yOrigin),(!d||(h=d.split(" ")).length<2)&&(n=a.getBBox(),0===n.x&&0===n.y&&n.width+n.height===0&&(n={x:parseFloat(a.hasAttribute("x")?a.getAttribute("x"):a.hasAttribute("cx")?a.getAttribute("cx"):0)||0,y:parseFloat(a.hasAttribute("y")?a.getAttribute("y"):a.hasAttribute("cy")?a.getAttribute("cy"):0)||0,width:0,height:0}),b=ha(b).split(" "),h=[(-1!==b[0].indexOf("%")?parseFloat(b[0])/100*n.width:parseFloat(b[0]))+n.x,(-1!==b[1].indexOf("%")?parseFloat(b[1])/100*n.height:parseFloat(b[1]))+n.y]),c.xOrigin=k=parseFloat(h[0]),c.yOrigin=l=parseFloat(h[1]),d&&w!==Pa&&(m=w[0],n=w[1],o=w[2],p=w[3],q=w[4],r=w[5],s=m*p-n*o,s&&(i=k*(p/s)+l*(-o/s)+(o*r-p*q)/s,j=k*(-n/s)+l*(m/s)-(m*r-n*q)/s,k=c.xOrigin=h[0]=i,l=c.yOrigin=h[1]=j)),v&&(f&&(c.xOffset=v.xOffset,c.yOffset=v.yOffset,v=c),e||e!==!1&&g.defaultSmoothOrigin!==!1?(i=k-t,j=l-u,v.xOffset+=i*w[0]+j*w[2]-i,v.yOffset+=i*w[1]+j*w[3]-j):v.xOffset=v.yOffset=0),f||a.setAttribute("data-svg-origin",h.join(" "))},Ma=function(a){var b,c=P("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),d=this.parentNode,e=this.nextSibling,f=this.style.cssText;if(Ja.appendChild(c),c.appendChild(this),this.style.display="block",a)try{b=this.getBBox(),this._originalGetBBox=this.getBBox,this.getBBox=Ma}catch(g){}else this._originalGetBBox&&(b=this._originalGetBBox());return e?d.insertBefore(this,e):d.appendChild(this),Ja.removeChild(c),this.style.cssText=f,b},Na=function(a){try{return a.getBBox()}catch(b){return Ma.call(a,!0)}},Oa=function(a){return!(!Ha||!a.getCTM||a.parentNode&&!a.ownerSVGElement||!Na(a))},Pa=[1,0,0,1,0,0],Qa=function(a,b){var c,d,e,f,g,h,i=a._gsTransform||new Ga,j=1e5,k=a.style;if(Ca?d=_(a,Da,null,!0):a.currentStyle&&(d=a.currentStyle.filter.match(G),d=d&&4===d.length?[d[0].substr(4),Number(d[2].substr(4)),Number(d[1].substr(4)),d[3].substr(4),i.x||0,i.y||0].join(","):""),c=!d||"none"===d||"matrix(1, 0, 0, 1, 0, 0)"===d,!Ca||!(h=!$(a)||"none"===$(a).display)&&a.parentNode||(h&&(f=k.display,k.display="block"),a.parentNode||(g=1,Ja.appendChild(a)),d=_(a,Da,null,!0),c=!d||"none"===d||"matrix(1, 0, 0, 1, 0, 0)"===d,f?k.display=f:h&&Va(k,"display"),g&&Ja.removeChild(a)),(i.svg||a.getCTM&&Oa(a))&&(c&&-1!==(k[Ca]+"").indexOf("matrix")&&(d=k[Ca],c=0),e=a.getAttribute("transform"),c&&e&&(e=a.transform.baseVal.consolidate().matrix,d="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")",c=0)),c)return Pa;for(e=(d||"").match(s)||[],wa=e.length;--wa>-1;)f=Number(e[wa]),e[wa]=(g=f-(f|=0))?(g*j+(0>g?-.5:.5)|0)/j+f:f;return b&&e.length>6?[e[0],e[1],e[4],e[5],e[12],e[13]]:e},Ra=S.getTransform=function(a,c,d,e){if(a._gsTransform&&d&&!e)return a._gsTransform;var f,h,i,j,k,l,m=d?a._gsTransform||new Ga:new Ga,n=m.scaleX<0,o=2e-5,p=1e5,q=Fa?parseFloat(_(a,Ea,c,!1,"0 0 0").split(" ")[2])||m.zOrigin||0:0,r=parseFloat(g.defaultTransformPerspective)||0;if(m.svg=!(!a.getCTM||!Oa(a)),m.svg&&(La(a,_(a,Ea,c,!1,"50% 50%")+"",m,a.getAttribute("data-svg-origin")),Aa=g.useSVGTransformAttr||Ka),f=Qa(a),f!==Pa){if(16===f.length){var s,t,u,v,w,x=f[0],y=f[1],z=f[2],A=f[3],B=f[4],C=f[5],D=f[6],E=f[7],F=f[8],G=f[9],H=f[10],I=f[12],J=f[13],K=f[14],M=f[11],N=Math.atan2(D,H);m.zOrigin&&(K=-m.zOrigin,I=F*K-f[12],J=G*K-f[13],K=H*K+m.zOrigin-f[14]),m.rotationX=N*L,N&&(v=Math.cos(-N),w=Math.sin(-N),s=B*v+F*w,t=C*v+G*w,u=D*v+H*w,F=B*-w+F*v,G=C*-w+G*v,H=D*-w+H*v,M=E*-w+M*v,B=s,C=t,D=u),N=Math.atan2(-z,H),m.rotationY=N*L,N&&(v=Math.cos(-N),w=Math.sin(-N),s=x*v-F*w,t=y*v-G*w,u=z*v-H*w,G=y*w+G*v,H=z*w+H*v,M=A*w+M*v,x=s,y=t,z=u),N=Math.atan2(y,x),m.rotation=N*L,N&&(v=Math.cos(N),w=Math.sin(N),s=x*v+y*w,t=B*v+C*w,u=F*v+G*w,y=y*v-x*w,C=C*v-B*w,G=G*v-F*w,x=s,B=t,F=u),m.rotationX&&Math.abs(m.rotationX)+Math.abs(m.rotation)>359.9&&(m.rotationX=m.rotation=0,m.rotationY=180-m.rotationY),N=Math.atan2(B,C),m.scaleX=(Math.sqrt(x*x+y*y+z*z)*p+.5|0)/p,m.scaleY=(Math.sqrt(C*C+D*D)*p+.5|0)/p,m.scaleZ=(Math.sqrt(F*F+G*G+H*H)*p+.5|0)/p,x/=m.scaleX,B/=m.scaleY,y/=m.scaleX,C/=m.scaleY,Math.abs(N)>o?(m.skewX=N*L,B=0,"simple"!==m.skewType&&(m.scaleY*=1/Math.cos(N))):m.skewX=0,m.perspective=M?1/(0>M?-M:M):0,m.x=I,m.y=J,m.z=K,m.svg&&(m.x-=m.xOrigin-(m.xOrigin*x-m.yOrigin*B),m.y-=m.yOrigin-(m.yOrigin*y-m.xOrigin*C))}else if(!Fa||e||!f.length||m.x!==f[4]||m.y!==f[5]||!m.rotationX&&!m.rotationY){var O=f.length>=6,P=O?f[0]:1,Q=f[1]||0,R=f[2]||0,S=O?f[3]:1;m.x=f[4]||0,m.y=f[5]||0,i=Math.sqrt(P*P+Q*Q),j=Math.sqrt(S*S+R*R),k=P||Q?Math.atan2(Q,P)*L:m.rotation||0,l=R||S?Math.atan2(R,S)*L+k:m.skewX||0,m.scaleX=i,m.scaleY=j,m.rotation=k,m.skewX=l,Fa&&(m.rotationX=m.rotationY=m.z=0,m.perspective=r,m.scaleZ=1),m.svg&&(m.x-=m.xOrigin-(m.xOrigin*P+m.yOrigin*R),m.y-=m.yOrigin-(m.xOrigin*Q+m.yOrigin*S))}Math.abs(m.skewX)>90&&Math.abs(m.skewX)<270&&(n?(m.scaleX*=-1,m.skewX+=m.rotation<=0?180:-180,m.rotation+=m.rotation<=0?180:-180):(m.scaleY*=-1,m.skewX+=m.skewX<=0?180:-180)),m.zOrigin=q;for(h in m)m[h]<o&&m[h]>-o&&(m[h]=0)}return d&&(a._gsTransform=m,m.svg&&(Aa&&a.style[Ca]?b.delayedCall(.001,function(){Va(a.style,Ca)}):!Aa&&a.getAttribute("transform")&&b.delayedCall(.001,function(){a.removeAttribute("transform")}))),m},Sa=function(a){var b,c,d=this.data,e=-d.rotation*K,f=e+d.skewX*K,g=1e5,h=(Math.cos(e)*d.scaleX*g|0)/g,i=(Math.sin(e)*d.scaleX*g|0)/g,j=(Math.sin(f)*-d.scaleY*g|0)/g,k=(Math.cos(f)*d.scaleY*g|0)/g,l=this.t.style,m=this.t.currentStyle;if(m){c=i,i=-j,j=-c,b=m.filter,l.filter="";var n,o,q=this.t.offsetWidth,r=this.t.offsetHeight,s="absolute"!==m.position,t="progid:DXImageTransform.Microsoft.Matrix(M11="+h+", M12="+i+", M21="+j+", M22="+k,u=d.x+q*d.xPercent/100,v=d.y+r*d.yPercent/100;if(null!=d.ox&&(n=(d.oxp?q*d.ox*.01:d.ox)-q/2,o=(d.oyp?r*d.oy*.01:d.oy)-r/2,u+=n-(n*h+o*i),v+=o-(n*j+o*k)),s?(n=q/2,o=r/2,t+=", Dx="+(n-(n*h+o*i)+u)+", Dy="+(o-(n*j+o*k)+v)+")"):t+=", sizingMethod='auto expand')",-1!==b.indexOf("DXImageTransform.Microsoft.Matrix(")?l.filter=b.replace(H,t):l.filter=t+" "+b,(0===a||1===a)&&1===h&&0===i&&0===j&&1===k&&(s&&-1===t.indexOf("Dx=0, Dy=0")||x.test(b)&&100!==parseFloat(RegExp.$1)||-1===b.indexOf(b.indexOf("Alpha"))&&l.removeAttribute("filter")),!s){var y,z,A,B=8>p?1:-1;for(n=d.ieOffsetX||0,o=d.ieOffsetY||0,d.ieOffsetX=Math.round((q-((0>h?-h:h)*q+(0>i?-i:i)*r))/2+u),d.ieOffsetY=Math.round((r-((0>k?-k:k)*r+(0>j?-j:j)*q))/2+v),wa=0;4>wa;wa++)z=fa[wa],y=m[z],c=-1!==y.indexOf("px")?parseFloat(y):aa(this.t,z,parseFloat(y),y.replace(w,""))||0,A=c!==d[z]?2>wa?-d.ieOffsetX:-d.ieOffsetY:2>wa?n-d.ieOffsetX:o-d.ieOffsetY,l[z]=(d[z]=Math.round(c-A*(0===wa||2===wa?1:B)))+"px"}}},Ta=S.set3DTransformRatio=S.setTransformRatio=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,o,p,q,r,s,t,u,v,w,x,y,z=this.data,A=this.t.style,B=z.rotation,C=z.rotationX,D=z.rotationY,E=z.scaleX,F=z.scaleY,G=z.scaleZ,H=z.x,I=z.y,J=z.z,L=z.svg,M=z.perspective,N=z.force3D,O=z.skewY,P=z.skewX;if(O&&(P+=O,B+=O),((1===a||0===a)&&"auto"===N&&(this.tween._totalTime===this.tween._totalDuration||!this.tween._totalTime)||!N)&&!J&&!M&&!D&&!C&&1===G||Aa&&L||!Fa)return void(B||P||L?(B*=K,x=P*K,y=1e5,c=Math.cos(B)*E,f=Math.sin(B)*E,d=Math.sin(B-x)*-F,g=Math.cos(B-x)*F,x&&"simple"===z.skewType&&(b=Math.tan(x-O*K),b=Math.sqrt(1+b*b),d*=b,g*=b,O&&(b=Math.tan(O*K),b=Math.sqrt(1+b*b),c*=b,f*=b)),L&&(H+=z.xOrigin-(z.xOrigin*c+z.yOrigin*d)+z.xOffset,I+=z.yOrigin-(z.xOrigin*f+z.yOrigin*g)+z.yOffset,Aa&&(z.xPercent||z.yPercent)&&(q=this.t.getBBox(),H+=.01*z.xPercent*q.width,I+=.01*z.yPercent*q.height),q=1e-6,q>H&&H>-q&&(H=0),q>I&&I>-q&&(I=0)),u=(c*y|0)/y+","+(f*y|0)/y+","+(d*y|0)/y+","+(g*y|0)/y+","+H+","+I+")",L&&Aa?this.t.setAttribute("transform","matrix("+u):A[Ca]=(z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) matrix(":"matrix(")+u):A[Ca]=(z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) matrix(":"matrix(")+E+",0,0,"+F+","+H+","+I+")");if(n&&(q=1e-4,q>E&&E>-q&&(E=G=2e-5),q>F&&F>-q&&(F=G=2e-5),!M||z.z||z.rotationX||z.rotationY||(M=0)),B||P)B*=K,r=c=Math.cos(B),s=f=Math.sin(B),P&&(B-=P*K,r=Math.cos(B),s=Math.sin(B),"simple"===z.skewType&&(b=Math.tan((P-O)*K),b=Math.sqrt(1+b*b),r*=b,s*=b,z.skewY&&(b=Math.tan(O*K),b=Math.sqrt(1+b*b),c*=b,f*=b))),d=-s,g=r;else{if(!(D||C||1!==G||M||L))return void(A[Ca]=(z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) translate3d(":"translate3d(")+H+"px,"+I+"px,"+J+"px)"+(1!==E||1!==F?" scale("+E+","+F+")":""));c=g=1,d=f=0}k=1,e=h=i=j=l=m=0,o=M?-1/M:0,p=z.zOrigin,q=1e-6,v=",",w="0",B=D*K,B&&(r=Math.cos(B),s=Math.sin(B),i=-s,l=o*-s,e=c*s,h=f*s,k=r,o*=r,c*=r,f*=r),B=C*K,B&&(r=Math.cos(B),s=Math.sin(B),b=d*r+e*s,t=g*r+h*s,j=k*s,m=o*s,e=d*-s+e*r,h=g*-s+h*r,k*=r,o*=r,d=b,g=t),1!==G&&(e*=G,h*=G,k*=G,o*=G),1!==F&&(d*=F,g*=F,j*=F,m*=F),1!==E&&(c*=E,f*=E,i*=E,l*=E),(p||L)&&(p&&(H+=e*-p,I+=h*-p,J+=k*-p+p),L&&(H+=z.xOrigin-(z.xOrigin*c+z.yOrigin*d)+z.xOffset,I+=z.yOrigin-(z.xOrigin*f+z.yOrigin*g)+z.yOffset),q>H&&H>-q&&(H=w),q>I&&I>-q&&(I=w),q>J&&J>-q&&(J=0)),u=z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) matrix3d(":"matrix3d(",u+=(q>c&&c>-q?w:c)+v+(q>f&&f>-q?w:f)+v+(q>i&&i>-q?w:i),u+=v+(q>l&&l>-q?w:l)+v+(q>d&&d>-q?w:d)+v+(q>g&&g>-q?w:g),C||D||1!==G?(u+=v+(q>j&&j>-q?w:j)+v+(q>m&&m>-q?w:m)+v+(q>e&&e>-q?w:e),u+=v+(q>h&&h>-q?w:h)+v+(q>k&&k>-q?w:k)+v+(q>o&&o>-q?w:o)+v):u+=",0,0,0,0,1,0,",u+=H+v+I+v+J+v+(M?1+-J/M:1)+")",A[Ca]=u; 66597};j=Ga.prototype,j.x=j.y=j.z=j.skewX=j.skewY=j.rotation=j.rotationX=j.rotationY=j.zOrigin=j.xPercent=j.yPercent=j.xOffset=j.yOffset=0,j.scaleX=j.scaleY=j.scaleZ=1,ya("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",{parser:function(a,b,c,d,f,h,i){if(d._lastParsedTransform===i)return f;d._lastParsedTransform=i;var j,k=i.scale&&"function"==typeof i.scale?i.scale:0;"function"==typeof i[c]&&(j=i[c],i[c]=b),k&&(i.scale=k(r,a));var l,m,n,o,p,s,t,u,v,w=a._gsTransform,x=a.style,y=1e-6,z=Ba.length,A=i,B={},C="transformOrigin",D=Ra(a,e,!0,A.parseTransform),E=A.transform&&("function"==typeof A.transform?A.transform(r,q):A.transform);if(D.skewType=A.skewType||D.skewType||g.defaultSkewType,d._transform=D,"rotationZ"in A&&(A.rotation=A.rotationZ),E&&"string"==typeof E&&Ca)m=Q.style,m[Ca]=E,m.display="block",m.position="absolute",-1!==E.indexOf("%")&&(m.width=_(a,"width"),m.height=_(a,"he
66597ight")),O.body.appendChild(Q),l=Ra(Q,null,!1),"simple"===D.skewType&&(l.scaleY*=Math.cos(l.skewX*K)),D.svg&&(s=D.xOrigin,t=D.yOrigin,l.x-=D.xOffset,l.y-=D.yOffset,(A.transformOrigin||A.svgOrigin)&&(E={},La(a,ha(A.transformOrigin),E,A.svgOrigin,A.smoothOrigin,!0),s=E.xOrigin,t=E.yOrigin,l.x-=E.xOffset-D.xOffset,l.y-=E.yOffset-D.yOffset),(s||t)&&(u=Qa(Q,!0),l.x-=s-(s*u[0]+t*u[2]),l.y-=t-(s*u[1]+t*u[3]))),O.body.removeChild(Q),l.perspective||(l.perspective=D.perspective),null!=A.xPercent&&(l.xPercent=ja(A.xPercent,D.xPercent)),null!=A.yPercent&&(l.yPercent=ja(A.yPercent,D.yPercent));else if("object"==typeof A){if(l={scaleX:ja(null!=A.scaleX?A.scaleX:A.scale,D.scaleX),scaleY:ja(null!=A.scaleY?A.scaleY:A.scale,D.scaleY),scaleZ:ja(A.scaleZ,D.scaleZ),x:ja(A.x,D.x),y:ja(A.y,D.y),z:ja(A.z,D.z),xPercent:ja(A.xPercent,D.xPercent),yPercent:ja(A.yPercent,D.yPercent),perspective:ja(A.transformPerspective,D.perspective)},p=A.directionalRotation,null!=p)if("object"==typeof p)for(m in p)A[m]=p[m];else A.rotation=p;"string"==typeof A.x&&-1!==A.x.indexOf("%")&&(l.x=0,l.xPercent=ja(A.x,D.xPercent)),"string"==typeof A.y&&-1!==A.y.indexOf("%")&&(l.y=0,l.yPercent=ja(A.y,D.yPercent)),l.rotation=ka("rotation"in A?A.rotation:"shortRotation"in A?A.shortRotation+"_short":D.rotation,D.rotation,"rotation",B),Fa&&(l.rotationX=ka("rotationX"in A?A.rotationX:"shortRotationX"in A?A.shortRotationX+"_short":D.rotationX||0,D.rotationX,"rotationX",B),l.rotationY=ka("rotationY"in A?A.rotationY:"shortRotationY"in A?A.shortRotationY+"_short":D.rotationY||0,D.rotationY,"rotationY",B)),l.skewX=ka(A.skewX,D.skewX),l.skewY=ka(A.skewY,D.skewY)}for(Fa&&null!=A.force3D&&(D.force3D=A.force3D,o=!0),n=D.force3D||D.z||D.rotationX||D.rotationY||l.z||l.rotationX||l.rotationY||l.perspective,n||null==A.scale||(l.scaleZ=1);--z>-1;)v=Ba[z],E=l[v]-D[v],(E>y||-y>E||null!=A[v]||null!=M[v])&&(o=!0,f=new ta(D,v,D[v],E,f),v in B&&(f.e=B[v]),f.xs0=0,f.plugin=h,d._overwriteProps.push(f.n));return E=A.transformOrigin,D.svg&&(E||A.svgOrigin)&&(s=D.xOffset,t=D.yOffset,La(a,ha(E),l,A.svgOrigin,A.smoothOrigin),f=ua(D,"xOrigin",(w?D:l).xOrigin,l.xOrigin,f,C),f=ua(D,"yOrigin",(w?D:l).yOrigin,l.yOrigin,f,C),(s!==D.xOffset||t!==D.yOffset)&&(f=ua(D,"xOffset",w?s:D.xOffset,D.xOffset,f,C),f=ua(D,"yOffset",w?t:D.yOffset,D.yOffset,f,C)),E="0px 0px"),(E||Fa&&n&&D.zOrigin)&&(Ca?(o=!0,v=Ea,E=(E||_(a,v,e,!1,"50% 50%"))+"",f=new ta(x,v,0,0,f,-1,C),f.b=x[v],f.plugin=h,Fa?(m=D.zOrigin,E=E.split(" "),D.zOrigin=(E.length>2&&(0===m||"0px"!==E[2])?parseFloat(E[2]):m)||0,f.xs0=f.e=E[0]+" "+(E[1]||"50%")+" 0px",f=new ta(D,"zOrigin",0,0,f,-1,f.n),f.b=m,f.xs0=f.e=D.zOrigin):f.xs0=f.e=E):ha(E+"",D)),o&&(d._transformType=D.svg&&Aa||!n&&3!==this._transformType?2:3),j&&(i[c]=j),k&&(i.scale=k),f},prefix:!0}),ya("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),ya("borderRadius",{defaultValue:"0px",parser:function(a,b,c,f,g,h){b=this.format(b);var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],z=a.style;for(q=parseFloat(a.offsetWidth),r=parseFloat(a.offsetHeight),i=b.split(" "),j=0;j<y.length;j++)this.p.indexOf("border")&&(y[j]=Z(y[j])),m=l=_(a,y[j],e,!1,"0px"),-1!==m.indexOf(" ")&&(l=m.split(" "),m=l[0],l=l[1]),n=k=i[j],o=parseFloat(m),t=m.substr((o+"").length),u="="===n.charAt(1),u?(p=parseInt(n.charAt(0)+"1",10),n=n.substr(2),p*=parseFloat(n),s=n.substr((p+"").length-(0>p?1:0))||""):(p=parseFloat(n),s=n.substr((p+"").length)),""===s&&(s=d[c]||t),s!==t&&(v=aa(a,"borderLeft",o,t),w=aa(a,"borderTop",o,t),"%"===s?(m=v/q*100+"%",l=w/r*100+"%"):"em"===s?(x=aa(a,"borderLeft",1,"em"),m=v/x+"em",l=w/x+"em"):(m=v+"px",l=w+"px"),u&&(n=parseFloat(m)+p+s,k=parseFloat(l)+p+s)),g=va(z,y[j],m+" "+l,n+" "+k,!1,"0px",g);return g},prefix:!0,formatter:qa("0px 0px 0px 0px",!1,!0)}),ya("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius",{defaultValue:"0px",parser:function(a,b,c,d,f,g){return va(a.style,c,this.format(_(a,c,e,!1,"0px 0px")),this.format(b),!1,"0px",f)},prefix:!0,formatter:qa("0px 0px",!1,!0)}),ya("backgroundPosition",{defaultValue:"0 0",parser:function(a,b,c,d,f,g){var h,i,j,k,l,m,n="background-position",o=e||$(a,null),q=this.format((o?p?o.getPropertyValue(n+"-x")+" "+o.getPropertyValue(n+"-y"):o.getPropertyValue(n):a.currentStyle.backgroundPositionX+" "+a.currentStyle.backgroundPositionY)||"0 0"),r=this.format(b);if(-1!==q.indexOf("%")!=(-1!==r.indexOf("%"))&&r.split(",").length<2&&(m=_(a,"backgroundImage").replace(D,""),m&&"none"!==m)){for(h=q.split(" "),i=r.split(" "),R.setAttribute("src",m),j=2;--j>-1;)q=h[j],k=-1!==q.indexOf("%"),k!==(-1!==i[j].indexOf("%"))&&(l=0===j?a.offsetWidth-R.width:a.offsetHeight-R.height,h[j]=k?parseFloat(q)/100*l+"px":parseFloat(q)/l*100+"%");q=h.join(" ")}return this.parseComplex(a.style,q,r,f,g)},formatter:ha}),ya("backgroundSize",{defaultValue:"0 0",formatter:function(a){return a+="","co"===a.substr(0,2)?a:ha(-1===a.indexOf(" ")?a+" "+a:a)}}),ya("perspective",{defaultValue:"0px",prefix:!0}),ya("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),ya("transformStyle",{prefix:!0}),ya("backfaceVisibility",{prefix:!0}),ya("userSelect",{prefix:!0}),ya("margin",{parser:ra("marginTop,marginRight,marginBottom,marginLeft")}),ya("padding",{parser:ra("paddingTop,paddingRight,paddingBottom,paddingLeft")}),ya("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(a,b,c,d,f,g){var h,i,j;return 9>p?(i=a.currentStyle,j=8>p?" ":",",h="rect("+i.clipTop+j+i.clipRight+j+i.clipBottom+j+i.clipLeft+")",b=this.format(b).split(",").join(j)):(h=this.format(_(a,this.p,e,!1,this.dflt)),b=this.format(b)),this.parseComplex(a.style,h,b,f,g)}}),ya("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),ya("autoRound,strictUnits",{parser:function(a,b,c,d,e){return e}}),ya("border",{defaultValue:"0px solid #000",parser:function(a,b,c,d,f,g){var h=_(a,"borderTopWidth",e,!1,"0px"),i=this.format(b).split(" "),j=i[0].replace(w,"");return"px"!==j&&(h=parseFloat(h)/aa(a,"borderTopWidth",1,j)+j),this.parseComplex(a.style,this.format(h+" "+_(a,"borderTopStyle",e,!1,"solid")+" "+_(a,"borderTopColor",e,!1,"#000")),i.join(" "),f,g)},color:!0,formatter:function(a){var b=a.split(" ");return b[0]+" "+(b[1]||"solid")+" "+(a.match(pa)||["#000"])[0]}}),ya("borderWidth",{parser:ra("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),ya("float,cssFloat,styleFloat",{parser:function(a,b,c,d,e,f){var g=a.style,h="cssFloat"in g?"cssFloat":"styleFloat";return new ta(g,h,0,0,e,-1,c,!1,0,g[h],b)}});var Ua=function(a){var b,c=this.t,d=c.filter||_(this.data,"filter")||"",e=this.s+this.c*a|0;100===e&&(-1===d.indexOf("atrix(")&&-1===d.indexOf("radient(")&&-1===d.indexOf("oader(")?(c.removeAttribute("filter"),b=!_(this.data,"filter")):(c.filter=d.replace(z,""),b=!0)),b||(this.xn1&&(c.filter=d=d||"alpha(opacity="+e+")"),-1===d.indexOf("pacity")?0===e&&this.xn1||(c.filter=d+" alpha(opacity="+e+")"):c.filter=d.replace(x,"opacity="+e))};ya("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(a,b,c,d,f,g){var h=parseFloat(_(a,"opacity",e,!1,"1")),i=a.style,j="autoAlpha"===c;return"string"==typeof b&&"="===b.charAt(1)&&(b=("-"===b.charAt(0)?-1:1)*parseFloat(b.substr(2))+h),j&&1===h&&"hidden"===_(a,"visibility",e)&&0!==b&&(h=0),U?f=new ta(i,"opacity",h,b-h,f):(f=new ta(i,"opacity",100*h,100*(b-h),f),f.xn1=j?1:0,i.zoom=1,f.type=2,f.b="alpha(opacity="+f.s+")",f.e="alpha(opacity="+(f.s+f.c)+")",f.data=a,f.plugin=g,f.setRatio=Ua),j&&(f=new ta(i,"visibility",0,0,f,-1,null,!1,0,0!==h?"inherit":"hidden",0===b?"hidden":"inherit"),f.xs0="inherit",d._overwriteProps.push(f.n),d._over
vendor: 7,292 bytes, line 66597
66597writeProps.push(c)),f}});var Va=function(a,b){b&&(a.removeProperty?(("ms"===b.substr(0,2)||"webkit"===b.substr(0,6))&&(b="-"+b),a.removeProperty(b.replace(B,"-$1").toLowerCase())):a.removeAttribute(b))},Wa=function(a){if(this.t._gsClassPT=this,1===a||0===a){this.t.setAttribute("class",0===a?this.b:this.e);for(var b=this.data,c=this.t.style;b;)b.v?c[b.p]=b.v:Va(c,b.p),b=b._next;1===a&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};ya("className",{parser:function(a,b,d,f,g,h,i){var j,k,l,m,n,o=a.getAttribute("class")||"",p=a.style.cssText;if(g=f._classNamePT=new ta(a,d,0,0,g,2),g.setRatio=Wa,g.pr=-11,c=!0,g.b=o,k=ca(a,e),l=a._gsClassPT){for(m={},n=l.data;n;)m[n.p]=1,n=n._next;l.setRatio(1)}return a._gsClassPT=g,g.e="="!==b.charAt(1)?b:o.replace(new RegExp("(?:\\s|^)"+b.substr(2)+"(?![\\w-])"),"")+("+"===b.charAt(0)?" "+b.substr(2):""),a.setAttribute("class",g.e),j=da(a,k,ca(a),i,m),a.setAttribute("class",o),g.data=j.firstMPT,a.style.cssText=p,g=g.xfirst=f.parse(a,j.difs,g,h)}});var Xa=function(a){if((1===a||0===a)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var b,c,d,e,f,g=this.t.style,h=i.transform.parse;if("all"===this.e)g.cssText="",e=!0;else for(b=this.e.split(" ").join("").split(","),d=b.length;--d>-1;)c=b[d],i[c]&&(i[c].parse===h?e=!0:c="transformOrigin"===c?Ea:i[c].p),Va(g,c);e&&(Va(g,Ca),f=this.t._gsTransform,f&&(f.svg&&(this.t.removeAttribute("data-svg-origin"),this.t.removeAttribute("transform")),delete this.t._gsTransform))}};for(ya("clearProps",{parser:function(a,b,d,e,f){return f=new ta(a,d,0,0,f,2),f.setRatio=Xa,f.e=b,f.pr=-10,f.data=e._tween,c=!0,f}}),j="bezier,throwProps,physicsProps,physics2D".split(","),wa=j.length;wa--;)za(j[wa]);j=g.prototype,j._firstPT=j._lastParsedTransform=j._transform=null,j._onInitTween=function(a,b,h,j){if(!a.nodeType)return!1;this._target=q=a,this._tween=h,this._vars=b,r=j,k=b.autoRound,c=!1,d=b.suffixMap||g.suffixMap,e=$(a,""),f=this._overwriteProps;var n,p,s,t,u,v,w,x,z,A=a.style;if(l&&""===A.zIndex&&(n=_(a,"zIndex",e),("auto"===n||""===n)&&this._addLazySet(A,"zIndex",0)),"string"==typeof b&&(t=A.cssText,n=ca(a,e),A.cssText=t+";"+b,n=da(a,n,ca(a)).difs,!U&&y.test(b)&&(n.opacity=parseFloat(RegExp.$1)),b=n,A.cssText=t),b.className?this._firstPT=p=i.className.parse(a,b.className,"className",this,null,null,b):this._firstPT=p=this.parse(a,b,null),this._transformType){for(z=3===this._transformType,Ca?m&&(l=!0,""===A.zIndex&&(w=_(a,"zIndex",e),("auto"===w||""===w)&&this._addLazySet(A,"zIndex",0)),o&&this._addLazySet(A,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(z?"visible":"hidden"))):A.zoom=1,s=p;s&&s._next;)s=s._next;x=new ta(a,"transform",0,0,null,2),this._linkCSSP(x,null,s),x.setRatio=Ca?Ta:Sa,x.data=this._transform||Ra(a,e,!0),x.tween=h,x.pr=-1,f.pop()}if(c){for(;p;){for(v=p._next,s=t;s&&s.pr>p.pr;)s=s._next;(p._prev=s?s._prev:u)?p._prev._next=p:t=p,(p._next=s)?s._prev=p:u=p,p=v}this._firstPT=t}return!0},j.parse=function(a,b,c,f){var g,h,j,l,m,n,o,p,s,t,u=a.style;for(g in b){if(n=b[g],"function"==typeof n&&(n=n(r,q)),h=i[g])c=h.parse(a,n,g,this,c,f,b);else{if("--"===g.substr(0,2)){this._tween._propLookup[g]=this._addTween.call(this._tween,a.style,"setProperty",$(a).getPropertyValue(g)+"",n+"",g,!1,g);continue}m=_(a,g,e)+"",s="string"==typeof n,"color"===g||"fill"===g||"stroke"===g||-1!==g.indexOf("Color")||s&&A.test(n)?(s||(n=na(n),n=(n.length>3?"rgba(":"rgb(")+n.join(",")+")"),c=va(u,g,m,n,!0,"transparent",c,0,f)):s&&J.test(n)?c=va(u,g,m,n,!0,null,c,0,f):(j=parseFloat(m),o=j||0===j?m.substr((j+"").length):"",(""===m||"auto"===m)&&("width"===g||"height"===g?(j=ga(a,g,e),o="px"):"left"===g||"top"===g?(j=ba(a,g,e),o="px"):(j="opacity"!==g?0:1,o="")),t=s&&"="===n.charAt(1),t?(l=parseInt(n.charAt(0)+"1",10),n=n.substr(2),l*=parseFloat(n),p=n.replace(w,"")):(l=parseFloat(n),p=s?n.replace(w,""):""),""===p&&(p=g in d?d[g]:o),n=l||0===l?(t?l+j:l)+p:b[g],o!==p&&(""!==p||"lineHeight"===g)&&(l||0===l)&&j&&(j=aa(a,g,j,o),"%"===p?(j/=aa(a,g,100,"%")/100,b.strictUnits!==!0&&(m=j+"%")):"em"===p||"rem"===p||"vw"===p||"vh"===p?j/=aa(a,g,1,p):"px"!==p&&(l=aa(a,g,l,p),p="px"),t&&(l||0===l)&&(n=l+j+p)),t&&(l+=j),!j&&0!==j||!l&&0!==l?void 0!==u[g]&&(n||n+""!="NaN"&&null!=n)?(c=new ta(u,g,l||j||0,0,c,-1,g,!1,0,m,n),c.xs0="none"!==n||"display"!==g&&-1===g.indexOf("Style")?n:m):W("invalid "+g+" tween value: "+b[g]):(c=new ta(u,g,j,l-j,c,0,g,k!==!1&&("px"===p||"zIndex"===g),0,m,n),c.xs0=p))}f&&c&&!c.plugin&&(c.plugin=f)}return c},j.setRatio=function(a){var b,c,d,e=this._firstPT,f=1e-6;if(1!==a||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(a||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;e;){if(b=e.c*a+e.s,e.r?b=e.r(b):f>b&&b>-f&&(b=0),e.type)if(1===e.type)if(d=e.l,2===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2;else if(3===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2+e.xn2+e.xs3;else if(4===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2+e.xn2+e.xs3+e.xn3+e.xs4;else if(5===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2+e.xn2+e.xs3+e.xn3+e.xs4+e.xn4+e.xs5;else{for(c=e.xs0+b+e.xs1,d=1;d<e.l;d++)c+=e["xn"+d]+e["xs"+(d+1)];e.t[e.p]=c}else-1===e.type?e.t[e.p]=e.xs0:e.setRatio&&e.setRatio(a);else e.t[e.p]=b+e.xs0;e=e._next}else for(;e;)2!==e.type?e.t[e.p]=e.b:e.setRatio(a),e=e._next;else for(;e;){if(2!==e.type)if(e.r&&-1!==e.type)if(b=e.r(e.s+e.c),e.type){if(1===e.type){for(d=e.l,c=e.xs0+b+e.xs1,d=1;d<e.l;d++)c+=e["xn"+d]+e["xs"+(d+1)];e.t[e.p]=c}}else e.t[e.p]=b+e.xs0;else e.t[e.p]=e.e;else e.setRatio(a);e=e._next}},j._enableTransforms=function(a){this._transform=this._transform||Ra(this._target,e,!0),this._transformType=this._transform.svg&&Aa||!a&&3!==this._transformType?2:3};var Ya=function(a){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)};j._addLazySet=function(a,b,c){var d=this._firstPT=new ta(a,b,0,0,this._firstPT,2);d.e=c,d.setRatio=Ya,d.data=this},j._linkCSSP=function(a,b,c,d){return a&&(b&&(b._prev=a),a._next&&(a._next._prev=a._prev),a._prev?a._prev._next=a._next:this._firstPT===a&&(this._firstPT=a._next,d=!0),c?c._next=a:d||null!==this._firstPT||(this._firstPT=a),a._next=b,a._prev=c),a},j._mod=function(a){for(var b=this._firstPT;b;)"function"==typeof a[b.p]&&(b.r=a[b.p]),b=b._next},j._kill=function(b){var c,d,e,f=b;if(b.autoAlpha||b.alpha){f={};for(d in b)f[d]=b[d];f.opacity=1,f.autoAlpha&&(f.visibility=1)}for(b.className&&(c=this._classNamePT)&&(e=c.xfirst,e&&e._prev?this._linkCSSP(e._prev,c._next,e._prev._prev):e===this._firstPT&&(this._firstPT=c._next),c._next&&this._linkCSSP(c._next,c._next._next,e._prev),this._classNamePT=null),c=this._firstPT;c;)c.plugin&&c.plugin!==d&&c.plugin._kill&&(c.plugin._kill(b),d=c.plugin),c=c._next;return a.prototype._kill.call(this,f)};var Za=function(a,b,c){var d,e,f,g;if(a.slice)for(e=a.length;--e>-1;)Za(a[e],b,c);else for(d=a.childNodes,e=d.length;--e>-1;)f=d[e],g=f.type,f.style&&(b.push(ca(f)),c&&c.push(f)),1!==g&&9!==g&&11!==g||!f.childNodes.length||Za(f,b,c)};return g.cascadeTo=function(a,c,d){var e,f,g,h,i=b.to(a,c,d),j=[i],k=[],l=[],m=[],n=b._internals.reservedProps;for(a=i._targets||i.target,Za(a,k,m),i.render(c,!0,!0),Za(a,l),i.render(0,!0,!0),i._enabled(!0),e=m.length;--e>-1;)if(f=d
vendor: 7,785 bytes, line 66597
66597a(m[e],k[e],l[e]),f.firstMPT){f=f.difs;for(g in d)n[g]&&(f[g]=d[g]);h={};for(g in f)h[g]=k[e][g];j.push(b.fromTo(m[e],c,h,f))}return j},a.activate([g]),g},!0),function(){var a=_gsScope._gsDefine.plugin({propName:"roundProps",version:"1.7.0",priority:-1,API:2,init:function(a,b,c){return this._tween=c,!0}}),b=function(a){var b=1>a?Math.pow(10,(a+"").length-2):1;return function(c){return(Math.round(c/a)*a*b|0)/b}},c=function(a,b){for(;a;)a.f||a.blob||(a.m=b||Math.round),a=a._next},d=a.prototype;d._onInitAllProps=function(){var a,d,e,f,g=this._tween,h=g.vars.roundProps,i={},j=g._propLookup.roundProps;if("object"!=typeof h||h.push)for("string"==typeof h&&(h=h.split(",")),e=h.length;--e>-1;)i[h[e]]=Math.round;else for(f in h)i[f]=b(h[f]);for(f in i)for(a=g._firstPT;a;)d=a._next,a.pg?a.t._mod(i):a.n===f&&(2===a.f&&a.t?c(a.t._firstPT,i[f]):(this._add(a.t,f,a.s,a.c,i[f]),d&&(d._prev=a._prev),a._prev?a._prev._next=d:g._firstPT===a&&(g._firstPT=d),a._next=a._prev=null,g._propLookup[f]=j)),a=d;return!1},d._add=function(a,b,c,d,e){this._addTween(a,b,c,c+d,b,e||Math.round),this._overwriteProps.push(b)}}(),function(){_gsScope._gsDefine.plugin({propName:"attr",API:2,version:"0.6.1",init:function(a,b,c,d){var e,f;if("function"!=typeof a.setAttribute)return!1;for(e in b)f=b[e],"function"==typeof f&&(f=f(d,a)),this._addTween(a,"setAttribute",a.getAttribute(e)+"",f+"",e,!1,e),this._overwriteProps.push(e);return!0}})}(),_gsScope._gsDefine.plugin({propName:"directionalRotation",version:"0.3.1",API:2,init:function(a,b,c,d){"object"!=typeof b&&(b={rotation:b}),this.finals={};var e,f,g,h,i,j,k=b.useRadians===!0?2*Math.PI:360,l=1e-6;for(e in b)"useRadians"!==e&&(h=b[e],"function"==typeof h&&(h=h(d,a)),j=(h+"").split("_"),f=j[0],g=parseFloat("function"!=typeof a[e]?a[e]:a[e.indexOf("set")||"function"!=typeof a["get"+e.substr(3)]?e:"get"+e.substr(3)]()),h=this.finals[e]="string"==typeof f&&"="===f.charAt(1)?g+parseInt(f.charAt(0)+"1",10)*Number(f.substr(2)):Number(f)||0,i=h-g,j.length&&(f=j.join("_"),-1!==f.indexOf("short")&&(i%=k,i!==i%(k/2)&&(i=0>i?i+k:i-k)),-1!==f.indexOf("_cw")&&0>i?i=(i+9999999999*k)%k-(i/k|0)*k:-1!==f.indexOf("ccw")&&i>0&&(i=(i-9999999999*k)%k-(i/k|0)*k)),(i>l||-l>i)&&(this._addTween(a,e,g,g+i,e),this._overwriteProps.push(e)));return!0},set:function(a){var b;if(1!==a)this._super.setRatio.call(this,a);else for(b=this._firstPT;b;)b.f?b.t[b.p](this.finals[b.p]):b.t[b.p]=this.finals[b.p],b=b._next}})._autoCSS=!0,_gsScope._gsDefine("easing.Back",["easing.Ease"],function(a){var b,c,d,e,f=_gsScope.GreenSockGlobals||_gsScope,g=f.com.greensock,h=2*Math.PI,i=Math.PI/2,j=g._class,k=function(b,c){var d=j("easing."+b,function(){},!0),e=d.prototype=new a;return e.constructor=d,e.getRatio=c,d},l=a.register||function(){},m=function(a,b,c,d,e){var f=j("easing."+a,{easeOut:new b,easeIn:new c,easeInOut:new d},!0);return l(f,a),f},n=function(a,b,c){this.t=a,this.v=b,c&&(this.next=c,c.prev=this,this.c=c.v-b,this.gap=c.t-a)},o=function(b,c){var d=j("easing."+b,function(a){this._p1=a||0===a?a:1.70158,this._p2=1.525*this._p1},!0),e=d.prototype=new a;return e.constructor=d,e.getRatio=c,e.config=function(a){return new d(a)},d},p=m("Back",o("BackOut",function(a){return(a-=1)*a*((this._p1+1)*a+this._p1)+1}),o("BackIn",function(a){return a*a*((this._p1+1)*a-this._p1)}),o("BackInOut",function(a){return(a*=2)<1?.5*a*a*((this._p2+1)*a-this._p2):.5*((a-=2)*a*((this._p2+1)*a+this._p2)+2)})),q=j("easing.SlowMo",function(a,b,c){b=b||0===b?b:.7,null==a?a=.7:a>1&&(a=1),this._p=1!==a?b:0,this._p1=(1-a)/2,this._p2=a,this._p3=this._p1+this._p2,this._calcEnd=c===!0},!0),r=q.prototype=new a;return r.constructor=q,r.getRatio=function(a){var b=a+(.5-a)*this._p;return a<this._p1?this._calcEnd?1-(a=1-a/this._p1)*a:b-(a=1-a/this._p1)*a*a*a*b:a>this._p3?this._calcEnd?1===a?0:1-(a=(a-this._p3)/this._p1)*a:b+(a-b)*(a=(a-this._p3)/this._p1)*a*a*a:this._calcEnd?1:b},q.ease=new q(.7,.7),r.config=q.config=function(a,b,c){return new q(a,b,c)},b=j("easing.SteppedEase",function(a,b){a=a||1,this._p1=1/a,this._p2=a+(b?0:1),this._p3=b?1:0},!0),r=b.prototype=new a,r.constructor=b,r.getRatio=function(a){return 0>a?a=0:a>=1&&(a=.999999999),((this._p2*a|0)+this._p3)*this._p1},r.config=b.config=function(a,c){return new b(a,c)},c=j("easing.ExpoScaleEase",function(a,b,c){this._p1=Math.log(b/a),this._p2=b-a,this._p3=a,this._ease=c},!0),r=c.prototype=new a,r.constructor=c,r.getRatio=function(a){return this._ease&&(a=this._ease.getRatio(a)),(this._p3*Math.exp(this._p1*a)-this._p3)/this._p2},r.config=c.config=function(a,b,d){return new c(a,b,d)},d=j("easing.RoughEase",function(b){b=b||{};for(var c,d,e,f,g,h,i=b.taper||"none",j=[],k=0,l=0|(b.points||20),m=l,o=b.randomize!==!1,p=b.clamp===!0,q=b.template instanceof a?b.template:null,r="number"==typeof b.strength?.4*b.strength:.4;--m>-1;)c=o?Math.random():1/l*m,d=q?q.getRatio(c):c,"none"===i?e=r:"out"===i?(f=1-c,e=f*f*r):"in"===i?e=c*c*r:.5>c?(f=2*c,e=f*f*.5*r):(f=2*(1-c),e=f*f*.5*r),o?d+=Math.random()*e-.5*e:m%2?d+=.5*e:d-=.5*e,p&&(d>1?d=1:0>d&&(d=0)),j[k++]={x:c,y:d};for(j.sort(function(a,b){return a.x-b.x}),h=new n(1,1,null),m=l;--m>-1;)g=j[m],h=new n(g.x,g.y,h);this._prev=new n(0,0,0!==h.t?h:h.next)},!0),r=d.prototype=new a,r.constructor=d,r.getRatio=function(a){var b=this._prev;if(a>b.t){for(;b.next&&a>=b.t;)b=b.next;b=b.prev}else for(;b.prev&&a<=b.t;)b=b.prev;return this._prev=b,b.v+(a-b.t)/b.gap*b.c},r.config=function(a){return new d(a)},d.ease=new d,m("Bounce",k("BounceOut",function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}),k("BounceIn",function(a){return(a=1-a)<1/2.75?1-7.5625*a*a:2/2.75>a?1-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?1-(7.5625*(a-=2.25/2.75)*a+.9375):1-(7.5625*(a-=2.625/2.75)*a+.984375)}),k("BounceInOut",function(a){var b=.5>a;return a=b?1-2*a:2*a-1,a=1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375,b?.5*(1-a):.5*a+.5})),m("Circ",k("CircOut",function(a){return Math.sqrt(1-(a-=1)*a)}),k("CircIn",function(a){return-(Math.sqrt(1-a*a)-1)}),k("CircInOut",function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)})),e=function(b,c,d){var e=j("easing."+b,function(a,b){this._p1=a>=1?a:1,this._p2=(b||d)/(1>a?a:1),this._p3=this._p2/h*(Math.asin(1/this._p1)||0),this._p2=h/this._p2},!0),f=e.prototype=new a;return f.constructor=e,f.getRatio=c,f.config=function(a,b){return new e(a,b)},e},m("Elastic",e("ElasticOut",function(a){return this._p1*Math.pow(2,-10*a)*Math.sin((a-this._p3)*this._p2)+1},.3),e("ElasticIn",function(a){return-(this._p1*Math.pow(2,10*(a-=1))*Math.sin((a-this._p3)*this._p2))},.3),e("ElasticInOut",function(a){return(a*=2)<1?-.5*(this._p1*Math.pow(2,10*(a-=1))*Math.sin((a-this._p3)*this._p2)):this._p1*Math.pow(2,-10*(a-=1))*Math.sin((a-this._p3)*this._p2)*.5+1},.45)),m("Expo",k("ExpoOut",function(a){return 1-Math.pow(2,-10*a)}),k("ExpoIn",function(a){return Math.pow(2,10*(a-1))-.001}),k("ExpoInOut",function(a){return(a*=2)<1?.5*Math.pow(2,10*(a-1)):.5*(2-Math.pow(2,-10*(a-1)))})),m("Sine",k("SineOut",function(a){return Math.sin(a*i)}),k("SineIn",function(a){return-Math.cos(a*i)+1}),k("SineInOut",function(a){return-.5*(Math.cos(Math.PI*a)-1)})),j("easing.EaseLookup",{find:function(b){return a.map[b]}},!0),l(f.SlowMo,"SlowMo","ease,"),l(d,"RoughEase","ease,"),l(b,"SteppedEase","ease,"),p},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(a,b){"use strict";var c={},d=a.document,e=a.GreenSockGlobals=a.GreenSockGlobals||a,f=e[b];if(f)return"undefined"!=typeof module&&module.exports&&(module.exports=f),f;var g,h,i,j,k,l=function(a){var b,c=a.split("."),d=e;for(b=0;b<c.length;b++)d[c[b]]=d=d[c[b]]||{};return d},m=l("com.greensock"),n=1e-
vendor: 1,436 bytes, line 66597
6659710,o=function(a){var b,c=[],d=a.length;for(b=0;b!==d;c.push(a[b++]));return c},p=function(){},q=function(){var a=Object.prototype.toString,b=a.call([]);return function(c){return null!=c&&(c instanceof Array||"object"==typeof c&&!!c.push&&a.call(c)===b)}}(),r={},s=function(d,f,g,h){this.sc=r[d]?r[d].sc:[],r[d]=this,this.gsClass=null,this.func=g;var i=[];this.check=function(j){for(var k,m,n,o,p=f.length,q=p;--p>-1;)(k=r[f[p]]||new s(f[p],[])).gsClass?(i[p]=k.gsClass,q--):j&&k.sc.push(this);if(0===q&&g){if(m=("com.greensock."+d).split("."),n=m.pop(),o=l(m.join("."))[n]=this.gsClass=g.apply(g,i),h)if(e[n]=c[n]=o,"undefined"!=typeof module&&module.exports)if(d===b){module.exports=c[b]=o;for(p in c)o[p]=c[p]}else c[b]&&(c[b][n]=o);else"function"==typeof define&&define.amd&&define((a.GreenSockAMDPath?a.GreenSockAMDPath+"/":"")+d.split(".").pop(),[],function(){return o});for(p=0;p<this.sc.length;p++)this.sc[p].check()}},this.check(!0)},t=a._gsDefine=function(a,b,c,d){return new s(a,b,c,d)},u=m._class=function(a,b,c){return b=b||function(){},t(a,[],function(){return b},c),b};t.globals=e;var v=[0,0,1,1],w=u("easing.Ease",function(a,b,c,d){this._func=a,this._type=c||0,this._power=d||0,this._params=b?v.concat(b):v},!0),x=w.map={},y=w.register=function(a,b,c,d){for(var e,f,g,h,i=b.split(","),j=i.length,k=(c||"easeIn,easeOut,easeInOut").split(",");--j>-1;)for(f=i[j],e=d?u("easing."+f,null,!0):m.easing[f]||{},g=k.length;--g>-1;
vendor: 17,726 bytes, lines 66597-66598
66597)h=k[g],x[f+"."+h]=x[h+f]=e[h]=a.getRatio?a:a[h]||new a};for(i=w.prototype,i._calcEnd=!1,i.getRatio=function(a){if(this._func)return this._params[0]=a,this._func.apply(null,this._params);var b=this._type,c=this._power,d=1===b?1-a:2===b?a:.5>a?2*a:2*(1-a);return 1===c?d*=d:2===c?d*=d*d:3===c?d*=d*d*d:4===c&&(d*=d*d*d*d),1===b?1-d:2===b?d:.5>a?d/2:1-d/2},g=["Linear","Quad","Cubic","Quart","Quint,Strong"],h=g.length;--h>-1;)i=g[h]+",Power"+h,y(new w(null,null,1,h),i,"easeOut",!0),y(new w(null,null,2,h),i,"easeIn"+(0===h?",easeNone":"")),y(new w(null,null,3,h),i,"easeInOut");x.linear=m.easing.Linear.easeIn,x.swing=m.easing.Quad.easeInOut;var z=u("events.EventDispatcher",function(a){this._listeners={},this._eventTarget=a||this});i=z.prototype,i.addEventListener=function(a,b,c,d,e){e=e||0;var f,g,h=this._listeners[a],i=0;for(this!==j||k||j.wake(),null==h&&(this._listeners[a]=h=[]),g=h.length;--g>-1;)f=h[g],f.c===b&&f.s===c?h.splice(g,1):0===i&&f.pr<e&&(i=g+1);h.splice(i,0,{c:b,s:c,up:d,pr:e})},i.removeEventListener=function(a,b){var c,d=this._listeners[a];if(d)for(c=d.length;--c>-1;)if(d[c].c===b)return void d.splice(c,1)},i.dispatchEvent=function(a){var b,c,d,e=this._listeners[a];if(e)for(b=e.length,b>1&&(e=e.slice(0)),c=this._eventTarget;--b>-1;)d=e[b],d&&(d.up?d.c.call(d.s||c,{type:a,target:c}):d.c.call(d.s||c))};var A=a.requestAnimationFrame,B=a.cancelAnimationFrame,C=Date.now||function(){return(new Date).getTime()},D=C();for(g=["ms","moz","webkit","o"],h=g.length;--h>-1&&!A;)A=a[g[h]+"RequestAnimationFrame"],B=a[g[h]+"CancelAnimationFrame"]||a[g[h]+"CancelRequestAnimationFrame"];u("Ticker",function(a,b){var c,e,f,g,h,i=this,l=C(),m=b!==!1&&A?"auto":!1,o=500,q=33,r="tick",s=function(a){var b,d,j=C()-D;j>o&&(l+=j-q),D+=j,i.time=(D-l)/1e3,b=i.time-h,(!c||b>0||a===!0)&&(i.frame++,h+=b+(b>=g?.004:g-b),d=!0),a!==!0&&(f=e(s)),d&&i.dispatchEvent(r)};z.call(i),i.time=i.frame=0,i.tick=function(){s(!0)},i.lagSmoothing=function(a,b){return arguments.length?(o=a||1/n,void(q=Math.min(b,o,0))):1/n>o},i.sleep=function(){null!=f&&(m&&B?B(f):clearTimeout(f),e=p,f=null,i===j&&(k=!1))},i.wake=function(a){null!==f?i.sleep():a?l+=-D+(D=C()):i.frame>10&&(D=C()-o+5),e=0===c?p:m&&A?A:function(a){return setTimeout(a,1e3*(h-i.time)+1|0)},i===j&&(k=!0),s(2)},i.fps=function(a){return arguments.length?(c=a,g=1/(c||60),h=this.time+g,void i.wake()):c},i.useRAF=function(a){return arguments.length?(i.sleep(),m=a,void i.fps(c)):m},i.fps(a),setTimeout(function(){"auto"===m&&i.frame<5&&"hidden"!==(d||{}).visibilityState&&i.useRAF(!1)},1500)}),i=m.Ticker.prototype=new m.events.EventDispatcher,i.constructor=m.Ticker;var E=u("core.Animation",function(a,b){if(this.vars=b=b||{},this._duration=this._totalDuration=a||0,this._delay=Number(b.delay)||0,this._timeScale=1,this._active=b.immediateRender===!0,this.data=b.data,this._reversed=b.reversed===!0,Y){k||j.wake();var c=this.vars.useFrames?X:Y;c.add(this,c._time),this.vars.paused&&this.paused(!0)}});j=E.ticker=new m.Ticker,i=E.prototype,i._dirty=i._gc=i._initted=i._paused=!1,i._totalTime=i._time=0,i._rawPrevTime=-1,i._next=i._last=i._onUpdate=i._timeline=i.timeline=null,i._paused=!1;var F=function(){k&&C()-D>2e3&&("hidden"!==(d||{}).visibilityState||!j.lagSmoothing())&&j.wake();var a=setTimeout(F,2e3);a.unref&&a.unref()};F(),i.play=function(a,b){return null!=a&&this.seek(a,b),this.reversed(!1).paused(!1)},i.pause=function(a,b){return null!=a&&this.seek(a,b),this.paused(!0)},i.resume=function(a,b){return null!=a&&this.seek(a,b),this.paused(!1)},i.seek=function(a,b){return this.totalTime(Number(a),b!==!1)},i.restart=function(a,b){return this.reversed(!1).paused(!1).totalTime(a?-this._delay:0,b!==!1,!0)},i.reverse=function(a,b){return null!=a&&this.seek(a||this.totalDuration(),b),this.reversed(!0).paused(!1)},i.render=function(a,b,c){},i.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,(this._gc||!this.timeline)&&this._enabled(!0),this},i.isActive=function(){var a,b=this._timeline,c=this._startTime;return!b||!this._gc&&!this._paused&&b.isActive()&&(a=b.rawTime(!0))>=c&&a<c+this.totalDuration()/this._timeScale-1e-7},i._enabled=function(a,b){return k||j.wake(),this._gc=!a,this._active=this.isActive(),b!==!0&&(a&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!a&&this.timeline&&this._timeline._remove(this,!0)),!1},i._kill=function(a,b){return this._enabled(!1,!1)},i.kill=function(a,b){return this._kill(a,b),this},i._uncache=function(a){for(var b=a?this:this.timeline;b;)b._dirty=!0,b=b.timeline;return this},i._swapSelfInParams=function(a){for(var b=a.length,c=a.concat();--b>-1;)"{self}"===a[b]&&(c[b]=this);return c},i._callback=function(a){var b=this.vars,c=b[a],d=b[a+"Params"],e=b[a+"Scope"]||b.callbackScope||this,f=d?d.length:0;switch(f){case 0:c.call(e);break;case 1:c.call(e,d[0]);break;case 2:c.call(e,d[0],d[1]);break;default:c.apply(e,d)}},i.eventCallback=function(a,b,c,d){if("on"===(a||"").substr(0,2)){var e=this.vars;if(1===arguments.length)return e[a];null==b?delete e[a]:(e[a]=b,e[a+"Params"]=q(c)&&-1!==c.join("").indexOf("{self}")?this._swapSelfInParams(c):c,e[a+"Scope"]=d),"onUpdate"===a&&(this._onUpdate=b)}return this},i.delay=function(a){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+a-this._delay),this._delay=a,this):this._delay},i.duration=function(a){return arguments.length?(this._duration=this._totalDuration=a,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==a&&this.totalTime(this._totalTime*(a/this._duration),!0),this):(this._dirty=!1,this._duration)},i.totalDuration=function(a){return this._dirty=!1,arguments.length?this.duration(a):this._totalDuration},i.time=function(a,b){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(a>this._duration?this._duration:a,b)):this._time},i.totalTime=function(a,b,c){if(k||j.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>a&&!c&&(a+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var d=this._totalDuration,e=this._timeline;if(a>d&&!c&&(a=d),this._startTime=(this._paused?this._pauseTime:e._time)-(this._reversed?d-a:a)/this._timeScale,e._dirty||this._uncache(!1),e._timeline)for(;e._timeline;)e._timeline._time!==(e._startTime+e._totalTime)/e._timeScale&&e.totalTime(e._totalTime,!0),e=e._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==a||0===this._duration)&&(K.length&&$(),this.render(a,b,!1),K.length&&$())}return this},i.progress=i.totalProgress=function(a,b){var c=this.duration();return arguments.length?this.totalTime(c*a,b):c?this._time/c:this.ratio; 66598},i.startTime=function(a){return arguments.length?(a!==this._startTime&&(this._startTime=a,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,a-this._delay)),this):this._startTime},i.endTime=function(a){return this._startTime+(0!=a?this.totalDuration():this.duration())/this._timeScale},i.timeScale=function(a){if(!arguments.length)return this._timeScale;var b,c;for(a=a||n,this._timeline&&this._timeline.smoothChildTiming&&(b=this._pauseTime,c=b||0===b?b:this._timeline.totalTime(),this._startTime=c-(c-this._startTime)*this._timeScale/a),this._timeScale=a,c=this.timeline;c&&c.timeline;)c._dirty=!0,c.totalDuration(),c=c.timeline;return this},i.reversed=function(a){return arguments.length?(a!=this._reversed&&(this._reversed=a,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},i.paused=function(a){if(!arguments.length)return this._paused;var b,c,d=this._timeline;return a!=this._paused&&d&&(k||a||j.wake(),b=d.rawTime(),c=b-this._pauseTime,!a&&d.smoothChildTiming&&(this._startTime+=c,this._uncache(!1)),this._pauseTime=a?b:null,this._paused=a,this._active=this.isActive(),!a&&0!==c&&this._initted&&this.duration()&&(b=d.smoothChildTiming?this._totalTime:(b-this._startTime)/this._timeScale,this.render(b,b===this._totalTime,!0))),this._gc&&!a&&this._enabled(!0,!1),this};var G=u("core.SimpleTimeline",function(a){E.call(this,0,a),this.autoRemoveChildren=this.smoothChildTiming=!0});i=G.prototype=new E,i.constructor=G,i.kill()._gc=!1,i._first=i._last=i._recent=null,i._sortChildren=!1,i.add=i.insert=function(a,b,c,d){var e,f;if(a._startTime=Number(b||0)+a._delay,a._paused&&this!==a._timeline&&(a._pauseTime=this.rawTime()-(a._timeline.rawTime()-a._pauseTime)),a.timeline&&a.timeline._remove(a,!0),a.timeline=a._timeline=this,a._gc&&a._enabled(!0,!0),e=this._last,this._sortChildren)for(f=a._startTime;e&&e._startTime>f;)e=e._prev;return e?(a._next=e._next,e._next=a):(a._next=this._first,this._first=a),a._next?a._next._prev=a:this._last=a,a._prev=e,this._recent=a,this._timeline&&this._uncache(!0),this},i._remove=function(a,b){return a.timeline===this&&(b||a._enabled(!1,!0),a._prev?a._prev._next=a._next:this._first===a&&(this._first=a._next),a._next?a._next._prev=a._prev:this._last===a&&(this._last=a._prev),a._next=a._prev=a.timeline=null,a===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},i.render=function(a,b,c){var d,e=this._first;for(this._totalTime=this._time=this._rawPrevTime=a;e;)d=e._next,(e._active||a>=e._startTime&&!e._paused&&!e._gc)&&(e._reversed?e.render((e._dirty?e.totalDuration():e._totalDuration)-(a-e._startTime)*e._timeScale,b,c):e.render((a-e._startTime)*e._timeScale,b,c)),e=d},i.rawTime=function(){return k||j.wake(),this._totalTime};var H=u("TweenLite",function(b,c,d){if(E.call(this,c,d),this.render=H.prototype.render,null==b)throw"Cannot tween a null target.";this.target=b="string"!=typeof b?b:H.selector(b)||b;var e,f,g,h=b.jquery||b.length&&b!==a&&b[0]&&(b[0]===a||b[0].nodeType&&b[0].style&&!b.nodeType),i=this.vars.overwrite;if(this._overwrite=i=null==i?W[H.defaultOverwrite]:"number"==typeof i?i>>0:W[i],(h||b instanceof Array||b.push&&q(b))&&"number"!=typeof b[0])for(this._targets=g=o(b),this._propLookup=[],this._siblings=[],e=0;e<g.length;e++)f=g[e],f?"string"!=typeof f?f.length&&f!==a&&f[0]&&(f[0]===a||f[0].nodeType&&f[0].style&&!f.nodeType)?(g.splice(e--,1),this._targets=g=g.concat(o(f))):(this._siblings[e]=_(f,this,!1),1===i&&this._siblings[e].length>1&&ba(f,this,null,1,this._siblings[e])):(f=g[e--]=H.selector(f),"string"==typeof f&&g.splice(e+1,1)):g.splice(e--,1);else this._propLookup={},this._siblings=_(b,this,!1),1===i&&this._siblings.length>1&&ba(b,this,null,1,this._siblings);(this.vars.immediateRender||0===c&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-n,this.render(Math.min(0,-this._delay)))},!0),I=function(b){return b&&b.length&&b!==a&&b[0]&&(b[0]===a||b[0].nodeType&&b[0].style&&!b.nodeType)},J=function(a,b){var c,d={};for(c in a)V[c]||c in b&&"transform"!==c&&"x"!==c&&"y"!==c&&"width"!==c&&"height"!==c&&"className"!==c&&"border"!==c||!(!S[c]||S[c]&&S[c]._autoCSS)||(d[c]=a[c],delete a[c]);a.css=d};i=H.prototype=new E,i.constructor=H,i.kill()._gc=!1,i.ratio=0,i._firstPT=i._targets=i._overwrittenProps=i._startAt=null,i._notifyPluginsOfEnabled=i._lazy=!1,H.version="2.0.2",H.defaultEase=i._ease=new w(null,null,1,1),H.defaultOverwrite="auto",H.ticker=j,H.autoSleep=120,H.lagSmoothing=function(a,b){j.lagSmoothing(a,b)},H.selector=a.$||a.jQuery||function(b){var c=a.$||a.jQuery;return c?(H.selector=c,c(b)):(d||(d=a.document),d?d.querySelectorAll?d.querySelectorAll(b):d.getElementById("#"===b.charAt(0)?b.substr(1):b):b)};var K=[],L={},M=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,N=/[\+-]=-?[\.\d]/,O=function(a){for(var b,c=this._firstPT,d=1e-6;c;)b=c.blob?1===a&&null!=this.end?this.end:a?this.join(""):this.start:c.c*a+c.s,c.m?b=c.m.call(this._tween,b,this._target||c.t,this._tween):d>b&&b>-d&&!c.blob&&(b=0),c.f?c.fp?c.t[c.p](c.fp,b):c.t[c.p](b):c.t[c.p]=b,c=c._next},P=function(a,b,c,d){var e,f,g,h,i,j,k,l=[],m=0,n="",o=0;for(l.start=a,l.end=b,a=l[0]=a+"",b=l[1]=b+"",c&&(c(l),a=l[0],b=l[1]),l.length=0,e=a.match(M)||[],f=b.match(M)||[],d&&(d._next=null,d.blob=1,l._firstPT=l._applyPT=d),i=f.length,h=0;i>h;h++)k=f[h],j=b.substr(m,b.indexOf(k,m)-m),n+=j||!h?j:",",m+=j.length,o?o=(o+1)%5:"rgba("===j.substr(-5)&&(o=1),k===e[h]||e.length<=h?n+=k:(n&&(l.push(n),n=""),g=parseFloat(e[h]),l.push(g),l._firstPT={_next:l._firstPT,t:l,p:l.length-1,s:g,c:("="===k.charAt(1)?parseInt(k.charAt(0)+"1",10)*parseFloat(k.substr(2)):parseFloat(k)-g)||0,f:0,m:o&&4>o?Math.round:0}),m+=k.length;return n+=b.substr(m),n&&l.push(n),l.setRatio=O,N.test(b)&&(l.end=null),l},Q=function(a,b,c,d,e,f,g,h,i){"function"==typeof d&&(d=d(i||0,a));var j,k=typeof a[b],l="function"!==k?"":b.indexOf("set")||"function"!=typeof a["get"+b.substr(3)]?b:"get"+b.substr(3),m="get"!==c?c:l?g?a[l](g):a[l]():a[b],n="string"==typeof d&&"="===d.charAt(1),o={t:a,p:b,s:m,f:"function"===k,pg:0,n:e||b,m:f?"function"==typeof f?f:Math.round:0,pr:0,c:n?parseInt(d.charAt(0)+"1",10)*parseFloat(d.substr(2)):parseFloat(d)-m||0};return("number"!=typeof m||"number"!=typeof d&&!n)&&(g||isNaN(m)||!n&&isNaN(d)||"boolean"==typeof m||"boolean"==typeof d?(o.fp=g,j=P(m,n?parseFloat(o.s)+o.c+(o.s+"").replace(/[0-9\-\.]/g,""):d,h||H.defaultStringFilter,o),o={t:j,p:"setRatio",s:0,c:1,f:2,pg:0,n:e||b,pr:0,m:0}):(o.s=parseFloat(m),n||(o.c=parseFloat(d)-o.s||0))),o.c?((o._next=this._firstPT)&&(o._next._prev=o),this._firstPT=o,o):void 0},R=H._internals={isArray:q,isSelector:I,lazyTweens:K,blobDif:P},S=H._plugins={},T=R.tweenLookup={},U=0,V=R.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1,id:1,yoyoEase:1},W={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},X=E._rootFramesTimeline=new G,Y=E._rootTimeline=new G,Z=30,$=R.lazyRender=function(){var a,b=K.length;for(L={};--b>-1;)a=K[b],a&&a._lazy!==!1&&(a.render(a._lazy[0],a._lazy[1],!0),a._lazy=!1);K.length=0};Y._startTime=j.time,X._startTime=j.frame,Y._active=X._active=!0,setTimeout($,1),E._updateRoot=H.render=function(){var a,b,c;if(K.length&&$(),Y.render((j.time-Y._startTime)*Y._timeScale,!1,!1),X.render((j.frame-X._startTime)*X._timeScale,!1,!1),K.length&&$(),j.frame>=Z){Z=j.frame+(parseInt(H.autoSleep,10)||120);for(c in T){for(b=T[c].tweens,a=b.length;--a>-1;)b[a]._gc&&b.splice(a,1);0===b.length&&delete T[c]}if(c=Y._first,(!c||c._paused)&&H.autoSleep&&!X._first&&1===j._listeners.tick.length){for(;c&&c._paused;)c=c._next;c||j.sleep()}}},j.addEventListener("tick",E._updateRoot);var _=function(a,b,c){var d,e,f=a._gsTweenID;if(T[f||(a._gsTweenID=f="t"+U++)]||(T[f]={target:a,tweens:[]}),b&&(d=T[f].tweens,d[e=d.length]=b,c))for(;--e>-1;)d[e]===b&&d.splice(e,1);return T[f].tweens},aa=function(a,b,c,d){var e,f,g=a.vars.onOverwrite;return g&&(e=g(a,b,c,d)),g=H.onOverwrite,g&&(f=g(a,b,c,d)),e!==!1&&f!==!1},ba=function(a,b,c,d,e){var f,g,h,i;if(1===d||d>=4){for(i=e.length,f=0;i>f;f++)if((h=e[f])!==b)h._gc||h._kill(null,a,b)&&(g=!0);else if(5===d)break;return g}var j,k=b._startTime+n,l=[],m=0,o=0===b._duration;for(f=e.length;--f>-1;)(h=e[f])===b||h._gc||h._paused||(h._timeline!==b._timeline?(j=j||ca(b,0,o),0===ca(h,j,o)&&(l[m++]=h)):h._startTime<=k&&h._startTime+h.totalDuration()/h._timeScale>k&&((o||!h._initted)&&k-h._startTime<=2e-10||(l[m++]=h)));for(f=m;--f>-1;)if(h=l[f],i=h._firstPT,2===d&&h._kill(c,a,b)&&(g=!0),2!==d||!h._firstPT&&h._initted&&i){if(2!==d&&!aa(h,b))continue;h._enabled(!1,!1)&&(g=!0)}return g},ca=function(a,b,c){for(var d=a._timeline,e=d._timeScale,f=a._startTime;d._timeline;){if(f+=d._startTime,e*=d._timeScale,d._paused)return-100;d=d._timeline}return f/=e,f>b?f-b:c&&f===b||!a._initted&&2*n>f-b?n:(f+=a.totalDuration()/a._timeScale/e)>b+n?0:f-b-n};i._init=function(){var a,b,c,d,e,f,g=this.vars,h=this._overwrittenProps,i=this._duration,j=!!g.immediateRender,k=g.ease;if(g.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),e={};for(d in g.startAt)e[d]=g.startAt[d];if(e.data="isStart",e.overwrite=!1,e.immediateRender=!0,e.lazy=j&&g.lazy!==!1,e.startAt=e.delay=null,e.onUpdate=g.onUpdate,e.onUpdateParams=g.onUpdateParams,e.onUpdateScope=g.onUpdateScope||g.callbackScope||this,this._startAt=H.to(this.target||{},0,e),j)if(this._time>0)this._startAt=null;else if(0!==i)return}else if(g.runBackwards&&0!==i)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{0!==this._time&&(j=!1),c={};for(d in g)V[d]&&"autoCSS"!==d||(c[d]=g[d]);if(c.overwrite=0,c.data="isFromStart",c.lazy=j&&g.lazy!==!1,c.immediateRender=j,this._startAt=H.to(this.target,0,c),j){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=k=k?k instanceof w?k:"function"==typeof k?new w(k,g.easeParams):x[k]||H.defaultEase:H.defaultEase,g.easeParams instanceof Array&&k.config&&(this._ease=k.config.apply(k,g.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(f=this._targets.length,a=0;f>a;a++)this._initProps(this._targets[a],this._propLookup[a]={},this._siblings[a],h?h[a]:null,a)&&(b=!0);else b=this._initProps(this.target,this._propLookup,this._siblings,h,0);if(b&&H._onPluginEvent("_onInitAllProps",this),h&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),g.runBackwards)for(c=this._firstPT;c;)c.s+=c.c,c.c=-c.c,c=c._next;this._onUpdate=g.onUpdate,this._initted=!0}
vendor: 4,174 bytes, line 66598
66598,i._initProps=function(b,c,d,e,f){var g,h,i,j,k,l;if(null==b)return!1;L[b._gsTweenID]&&$(),this.vars.css||b.style&&b!==a&&b.nodeType&&S.css&&this.vars.autoCSS!==!1&&J(this.vars,b);for(g in this.vars)if(l=this.vars[g],V[g])l&&(l instanceof Array||l.push&&q(l))&&-1!==l.join("").indexOf("{self}")&&(this.vars[g]=l=this._swapSelfInParams(l,this));else if(S[g]&&(j=new S[g])._onInitTween(b,this.vars[g],this,f)){for(this._firstPT=k={_next:this._firstPT,t:j,p:"setRatio",s:0,c:1,f:1,n:g,pg:1,pr:j._priority,m:0},h=j._overwriteProps.length;--h>-1;)c[j._overwriteProps[h]]=this._firstPT;(j._priority||j._onInitAllProps)&&(i=!0),(j._onDisable||j._onEnable)&&(this._notifyPluginsOfEnabled=!0),k._next&&(k._next._prev=k)}else c[g]=Q.call(this,b,g,"get",l,g,0,null,this.vars.stringFilter,f);return e&&this._kill(e,b)?this._initProps(b,c,d,e,f):this._overwrite>1&&this._firstPT&&d.length>1&&ba(b,this,c,this._overwrite,d)?(this._kill(c,b),this._initProps(b,c,d,e,f)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(L[b._gsTweenID]=!0),i)},i.render=function(a,b,c){var d,e,f,g,h=this._time,i=this._duration,j=this._rawPrevTime;if(a>=i-1e-7&&a>=0)this._totalTime=this._time=i,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(d=!0,e="onComplete",c=c||this._timeline.autoRemoveChildren),0===i&&(this._initted||!this.vars.lazy||c)&&(this._startTime===this._timeline._duration&&(a=0),(0>j||0>=a&&a>=-1e-7||j===n&&"isPause"!==this.data)&&j!==a&&(c=!0,j>n&&(e="onReverseComplete")),this._rawPrevTime=g=!b||a||j===a?a:n);else if(1e-7>a)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==h||0===i&&j>0)&&(e="onReverseComplete",d=this._reversed),0>a&&(this._active=!1,0===i&&(this._initted||!this.vars.lazy||c)&&(j>=0&&(j!==n||"isPause"!==this.data)&&(c=!0),this._rawPrevTime=g=!b||a||j===a?a:n)),(!this._initted||this._startAt&&this._startAt.progress())&&(c=!0);else if(this._totalTime=this._time=a,this._easeType){var k=a/i,l=this._easeType,m=this._easePower;(1===l||3===l&&k>=.5)&&(k=1-k),3===l&&(k*=2),1===m?k*=k:2===m?k*=k*k:3===m?k*=k*k*k:4===m&&(k*=k*k*k*k),1===l?this.ratio=1-k:2===l?this.ratio=k:.5>a/i?this.ratio=k/2:this.ratio=1-k/2}else this.ratio=this._ease.getRatio(a/i);if(this._time!==h||c){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!c&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=h,this._rawPrevTime=j,K.push(this),void(this._lazy=[a,b]);this._time&&!d?this.ratio=this._ease.getRatio(this._time/i):d&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==h&&a>=0&&(this._active=!0),0===h&&(this._startAt&&(a>=0?this._startAt.render(a,!0,c):e||(e="_dummyGS")),this.vars.onStart&&(0!==this._time||0===i)&&(b||this._callback("onStart"))),f=this._firstPT;f;)f.f?f.t[f.p](f.c*this.ratio+f.s):f.t[f.p]=f.c*this.ratio+f.s,f=f._next;this._onUpdate&&(0>a&&this._startAt&&a!==-1e-4&&this._startAt.render(a,!0,c),b||(this._time!==h||d||c)&&this._callback("onUpdate")),e&&(!this._gc||c)&&(0>a&&this._startAt&&!this._onUpdate&&a!==-1e-4&&this._startAt.render(a,!0,c),d&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!b&&this.vars[e]&&this._callback(e),0===i&&this._rawPrevTime===n&&g!==n&&(this._rawPrevTime=0))}},i._kill=function(a,b,c){if("all"===a&&(a=null),null==a&&(null==b||b===this.target))return this._lazy=!1,this._enabled(!1,!1);b="string"!=typeof b?b||this._targets||this.target:H.selector(b)||b;var d,e,f,g,h,i,j,k,l,m=c&&this._time&&c._startTime===this._startTime&&this._timeline===c._timeline,n=this._firstPT;if((q(b)||I(b))&&"number"!=typeof b[0])for(d=b.length;--d>-1;)this._kill(a,b[d],c)&&(i=!0);else{if(this._targets){for(d=this._targets.length;--d>-1;)if(b===this._targets[d]){h=this._propLookup[d]||{},this._overwrittenProps=this._overwrittenProps||[],e=this._overwrittenProps[d]=a?this._overwrittenProps[d]||{}:"all";break}}else{if(b!==this.target)return!1;h=this._propLookup,e=this._overwrittenProps=a?this._overwrittenProps||{}:"all"}
vendor: 5,837 bytes, lines 66598-66644
66598if(h){if(j=a||h,k=a!==e&&"all"!==e&&a!==h&&("object"!=typeof a||!a._tempKill),c&&(H.onOverwrite||this.vars.onOverwrite)){for(f in j)h[f]&&(l||(l=[]),l.push(f));if((l||!a)&&!aa(this,c,b,l))return!1}for(f in j)(g=h[f])&&(m&&(g.f?g.t[g.p](g.s):g.t[g.p]=g.s,i=!0),g.pg&&g.t._kill(j)&&(i=!0),g.pg&&0!==g.t._overwriteProps.length||(g._prev?g._prev._next=g._next:g===this._firstPT&&(this._firstPT=g._next),g._next&&(g._next._prev=g._prev),g._next=g._prev=null),delete h[f]),k&&(e[f]=1);!this._firstPT&&this._initted&&n&&this._enabled(!1,!1)}}return i},i.invalidate=function(){return this._notifyPluginsOfEnabled&&H._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],E.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-n,this.render(Math.min(0,-this._delay))),this},i._enabled=function(a,b){if(k||j.wake(),a&&this._gc){var c,d=this._targets;if(d)for(c=d.length;--c>-1;)this._siblings[c]=_(d[c],this,!0);else this._siblings=_(this.target,this,!0)}return E.prototype._enabled.call(this,a,b),this._notifyPluginsOfEnabled&&this._firstPT?H._onPluginEvent(a?"_onEnable":"_onDisable",this):!1},H.to=function(a,b,c){return new H(a,b,c)},H.from=function(a,b,c){return c.runBackwards=!0,c.immediateRender=0!=c.immediateRender,new H(a,b,c)},H.fromTo=function(a,b,c,d){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,new H(a,b,d)},H.delayedCall=function(a,b,c,d,e){return new H(b,0,{delay:a,onComplete:b,onCompleteParams:c,callbackScope:d,onReverseComplete:b,onReverseCompleteParams:c,immediateRender:!1,lazy:!1,useFrames:e,overwrite:0})},H.set=function(a,b){return new H(a,0,b)},H.getTweensOf=function(a,b){if(null==a)return[];a="string"!=typeof a?a:H.selector(a)||a;var c,d,e,f;if((q(a)||I(a))&&"number"!=typeof a[0]){for(c=a.length,d=[];--c>-1;)d=d.concat(H.getTweensOf(a[c],b));for(c=d.length;--c>-1;)for(f=d[c],e=c;--e>-1;)f===d[e]&&d.splice(c,1)}else if(a._gsTweenID)for(d=_(a).concat(),c=d.length;--c>-1;)(d[c]._gc||b&&!d[c].isActive())&&d.splice(c,1);return d||[]},H.killTweensOf=H.killDelayedCallsTo=function(a,b,c){"object"==typeof b&&(c=b,b=!1);for(var d=H.getTweensOf(a,b),e=d.length;--e>-1;)d[e]._kill(c,a)};var da=u("plugins.TweenPlugin",function(a,b){this._overwriteProps=(a||"").split(","),this._propName=this._overwriteProps[0],this._priority=b||0,this._super=da.prototype},!0);if(i=da.prototype,da.version="1.19.0",da.API=2,i._firstPT=null,i._addTween=Q,i.setRatio=O,i._kill=function(a){var b,c=this._overwriteProps,d=this._firstPT;if(null!=a[this._propName])this._overwriteProps=[];else for(b=c.length;--b>-1;)null!=a[c[b]]&&c.splice(b,1);for(;d;)null!=a[d.n]&&(d._next&&(d._next._prev=d._prev),d._prev?(d._prev._next=d._next,d._prev=null):this._firstPT===d&&(this._firstPT=d._next)),d=d._next;return!1},i._mod=i._roundProps=function(a){for(var b,c=this._firstPT;c;)b=a[this._propName]||null!=c.n&&a[c.n.split(this._propName+"_").join("")],b&&"function"==typeof b&&(2===c.f?c.t._applyPT.m=b:c.m=b),c=c._next},H._onPluginEvent=function(a,b){var c,d,e,f,g,h=b._firstPT;if("_onInitAllProps"===a){for(;h;){for(g=h._next,d=e;d&&d.pr>h.pr;)d=d._next;(h._prev=d?d._prev:f)?h._prev._next=h:e=h,(h._next=d)?d._prev=h:f=h,h=g}h=b._firstPT=e}for(;h;)h.pg&&"function"==typeof h.t[a]&&h.t[a]()&&(c=!0),h=h._next;return c},da.activate=function(a){for(var b=a.length;--b>-1;)a[b].API===da.API&&(S[(new a[b])._propName]=a[b]);return!0},t.plugin=function(a){if(!(a&&a.propName&&a.init&&a.API))throw"illegal plugin definition.";var b,c=a.propName,d=a.priority||0,e=a.overwriteProps,f={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},g=u("plugins."+c.charAt(0).toUpperCase()+c.substr(1)+"Plugin",function(){da.call(this,c,d),this._overwriteProps=e||[]},a.global===!0),h=g.prototype=new da(c);h.constructor=g,g.API=a.API;for(b in f)"function"==typeof a[b]&&(h[f[b]]=a[b]);return g.version=a.version,da.activate([g]),g},g=a._gsQueue){for(h=0;h<g.length;h++)g[h]();for(i in r)r[i].func||a.console.log("GSAP encountered missing dependency: "+i)}k=!1}("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,"TweenMax"); 66599(function(){ 66600 66601 var HeroParallax = function($el) { 66602 this.init($el); 66603 }; 66604 66605 var p = HeroParallax.prototype; 66606 66607 p.$el; 66608 p.$parallaxImage = null; 66609 p.viewPortHeight = null; 66610 p.scrollTop = null; 66611 p.yPos = null; 66612 p.elementHeight = null; 66613 p.imageHeight = null; 66614 p.lastScrollTop = 0; 66615 p.targetTranslateY = 0; 66616 p.parallaxSpeed = .5; 66617 66618 p.init = function($el){ 66619 this.$el = $el; 66620 this.$parallaxImage = $(this.$el.find('img.parallax-img')[0]); 66621 this.scrollTop = $(window).scrollTop(); 66622 this.yPos = $($el).offset().top; 66623 this.lastScrollTop = window.scrollY; 66624 66625 $(window).scroll(this.onScroll.bind(this)); 66626 $(window).resize(this.onResize.bind(this)); 66627 this.onResize(); 66628 66629 /*var linkInView = $(".jumpLink a").offset().top - $(window).height() > 0 ? $(".jumpLink a").offset().top - $(window).height() : 0; 66630 TweenMax.to(".jumpLink a", .4, {top:"-10px", ease:Power2.easeInOut, yoyo:true, repeat:5, delay:3, startAt:{y:linkInView}});*/ 66631 66632 }; 66633 66634 p.onScroll = function(){ 66635 66636 this.scrollTop = window.pageYOffset || document.documentElement.scrollTop; 66637 this.yPos = $(this.$el).offset().top; 66638 66639 if(this.yPos + this.elementHeight > this.scrollTop && this.yPos < this.scrollTop + this.viewPortHeight){ 66640 66641 this.targetTranslateY += (this.lastScrollTop - this.scrollTop)*this.parallaxSpeed; 66642 this.lastScrollTop = this.scrollTop; 66643 var scrollBounds = this.imageHeight - this.elementHeight; 66644
66645 if(this.targetTranslateY < -scrollBounds){ 66646 this.targetTranslateY = -scrollBounds; 66647 66648 } else if(this.targetTranslateY > 0){ 66649 this.targetTranslateY = 0; 66650 } 66651 66652 this.$parallaxImage.css({ 66653 'transform': 'translate3d(0px, '+this.targetTranslateY+'px, 0px)' 66654 }); 66655 } 66656 66657 this.lastScrollTop = this.scrollTop; 66658 }; 66659 66660 p.onResize = function(){ 66661 //make sure that scaled image covers the whole background 66662 this.viewPortHeight = $(window).height(); 66663 this.elementHeight = this.$el.height(); 66664 var elementWidth = this.$el.width(); 66665 this.imageHeight = this.$parallaxImage.height(); 66666 var imageWidth = this.$parallaxImage.width(); 66667 66668 if(this.imageHeight < this.elementHeight){ 66669 var scaleHeight = (this.elementHeight/this.imageHeight) * 1.4; //scale the image up to height of container + 40% so there is room left for parallax movement 66670 this.$parallaxImage.height(this.imageHeight*scaleHeight); 66671 this.$parallaxImage.width(imageWidth*scaleHeight); 66672 } else if(imageWidth < elementWidth){ 66673 var scaleWidth = (elementWidth/imageWidth); //scale the image width to width of container 66674 this.$parallaxImage.height(this.imageHeight*scaleWidth); 66675 this.$parallaxImage.width(imageWidth*scaleWidth); 66676 } 66677 66678 //reset the size refs 66679 this.imageHeight = this.$parallaxImage.height(); 66680 imageWidth = this.$parallaxImage.width(); 66681 this.$parallaxImage.css({ 66682 'left':'50%', 66683 'margin-left':'-'+imageWidth/2+"px" 66684 }) 66685 } 66686 66687 window.HeroParallax = HeroParallax; 66688 66689 $(document).ready(function() { 66690 $(".homepage-hero").each(function(){ 66691 var heroParallax = new HeroParallax($(this)); 66692 }); 66693 }); 66694 66695})(); 66696 66697 66698(function () { 66699 var $select = $('#homeSelect').selectize({ 66700 onInitialize: function () { 66701 $('#homeSelect-selectized').attr('disabled', 'disabled'); 66702 66703 }, 66704 onChange: function(value) { 66705 window.location.href = value; 66706 } 66707 }); 66708 66709})(); 66710 66711 66712/*to get secondary navbar fixed when scrolled for brandviews*/ 66713var fixme = $('.hero__secondary-nav'); 66714if (fixme.length) { 66715var fixmeTop = fixme.offset().top; 66716} 66717 66718$(window).scroll(function() { 66719 var currentScroll = $(window).scrollTop(); 66720 66721 if (currentScroll >= fixmeTop) { 66722 $('.hero__secondary-nav').css({ 66723 position: 'fixed', 66724 top: '0', 66725 left: '0', 66726 width:'100%' 66727 }); 66728 }else { // apply position: static 66729 $('.hero__secondary-nav').css({ // if you scroll above it 66730 position: 'static' 66731 }); 66732 } 66733 66734}); 66735 66736$(document).ready(function () { 66737 var linkTarget = $('.heroimage #externalLink').attr('target') ? '_blank' : '_self'; 66738 var linkURL = $('.heroimage #externalLink').attr('href'); 66739 $('.heroimage #externalLink').attr('href', 'javascript:void(0)'); 66740 66741 if(linkURL) { 66742 $('.heroimage #externalLink').on('click', function(event) { 66743 event.preventDefault(); 66744 $('#exitModal').modal('show'); 66745 }); 66746 } 66747 66748 $('#exitModal .redirect').on('click', function() { 66749 window.open(linkURL, linkTarget); 66750 $('#exitModal').modal('hide'); 66751 }); 66752}); 66753 66754function fixHeaders(){ 66755 var elms = document.querySelectorAll('h1>span>.text-line-header-home'); 66756 elms.forEach(function (elm){ 66757 //elm.style = "top:" + elm.parentElement.offsetHeight + "px; width: "+elm.parentElement.offsetWidth +"px;"; 66758 66759 elm.style.setProperty("top",elm.parentElement.offsetHeight +"px"); 66760 elm.style.setProperty("width",elm.parentElement.offsetWidth +"px"); 66761 }); 66762} 66763 66764window.addEventListener('load', fixHeaders); 66765window.addEventListener("resize", fixHeaders); 66766 66767document.querySelectorAll('.component-header').forEach(function(el) { 66768 var opacity = el.getAttribute('data-bgopacity') || '0.3'; 66769 el.style.setProperty('--bg-opacity', opacity); 66770}); 66771$(function(){ 66772 $(document).delegate('*[data-toggle="lightbox-building"]:not([data-gallery="navigateTo"])', 'click', function(event) { 66773 66774 event.preventDefault(); 66775 var href = $(".hrefHiddenDiv").data("href"); 66776 $(this).attr("href",href); 66777 $(this).ekkoLightbox({}); 66778 $('.ekko-lightbox') 66779 .addClass('heroImageWithVideoModal')
66780 .children('.modal-dialog') 66781 .addClass('modal-dialog-centered') 66782 .before('<span class="modal-close" data-dismiss="modal">✕</span>'); 66783 $(this).removeAttr("href",href); 66784 }); 66785 $('.pbs-container-wapper .heroImage_Img:not(.hero-img-vedio-button) .heroImage-Text').wrap($('<div>').addClass('container')); 66786}); 66787 66788/*Color change purpose*/ 66789 66790$(document).ready(function(){ 66791 66792 $.xcolor = $('.req_color').html(); 66793 66794 $('.heroBreadcum ul.foundation-breadcrumb li').css("color",$.xcolor); 66795 $('.heroBreadcum ul.foundation-breadcrumb li a').css("color",$.xcolor); 66796 66797}); 66798 66799/*color changes end */ 66800 66801 66802 66803// Add url parameter or replace if already exists. 66804function addUrlParam(url, key, value) { 66805 var newParam = key+"="+value; 66806if(newParam!=undefined && url!=undefined) 66807 var result = url.replace(new RegExp("(&|\\?)"+key+"=[^\&|#]*"), '$1' + newParam); 66808 66809 if (result === url && url!=undefined) { 66810 result = (url.indexOf("?") != -1 ? url.split("?")[0]+"?"+newParam+"&"+url.split("?")[1] 66811 : (url.indexOf("#") != -1 ? url.split("#")[0]+"?"+newParam+"#"+ url.split("#")[1] 66812 : url+'?'+newParam)); 66813 } 66814 return result; 66815} 66816 66817/* 66818// Add and remove autoplay on videos opened in modals 66819$('.modal.videoModal').on('shown.bs.modal', function() { 66820 var $iframe = $(this).find('iframe'); 66821 66822 if ($iframe.length) { 66823 var src = $iframe.attr('src'); 66824 var srcNew = addUrlParam(src, 'autoplay', '1'); 66825 $iframe.attr('src', srcNew); 66826 } 66827 66828}); 66829$('.modal.videoModal').on('hide.bs.modal', function() { 66830 var $iframe = $(this).find('iframe'); 66831 if ($iframe.length) { 66832 var src = $iframe.attr('src'); 66833 if(src!=undefined) 66834 var srcNew = addUrlParam(src, 'autoplay', '0'); 66835 if(srcNew!=undefined) 66836$iframe.attr('src', srcNew); 66837 } 66838}); 66839 66840*/ 66841 66842 66843 66844 66845/* this is for converting youtbe url to embed url starts here */ 66846 66847$(document).ready(function(){ 66848 var ClickdPath = $(".URLVideo").text() 66849 $('.heroVideoModal').click(function(){ 66850 66851 var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/; 66852 var match = ClickdPath.match(regExp); 66853 var FinalYoutubURL=''; 66854 66855 console.log("match",match); 66856 66857 if (match && match[2].length) { 66858 66859 FinalYoutubURL = "https://www.youtube.com/embed/"+match[2]; 66860 66861 $('#heroIframeVideo').html('<iframe src="" frameborder="0" allowfullscreen id="iframeVIdeo"></iframe>'); 66862 $('#iframeVIdeo').attr('src',FinalYoutubURL); 66863 66864 } 66865 else if(ClickdPath){ 66866 FinalYoutubURL = $(".URLVideo").text(); 66867 66868 $('#heroIframeVideo').html('<iframe src="" frameborder="0" allowfullscreen id="iframeVIdeo" controls></iframe>'); 66869 $('#iframeVIdeo').attr('src',FinalYoutubURL); 66870 } 66871 else{ 66872 return 'error'; 66873 } 66874 66875 66876 }) 66877}); 66878 66879/* youtube to embed url converting ends here */ 66880 66881 66882 66883 66884$(function() { 66885 var imageEl = $($('.setBGImage')[0]); 66886 if(imageEl.length>0){ 66887 var imagePath = (imageEl.attr('data-image-path')).split('.'); 66888 var elStyle = imageEl.attr('style'); 66889 imageEl.removeAttr('data-image-path'); 66890 setBGImage(); 66891 66892 $(window).resize(function() { 66893 66894 setBGImage(); 66895 }); 66896 } 66897 function setBGImage() { 66898 if (window.innerWidth < 576) { 66899 imageEl.css('background-image', 'url(' + imagePath[0] + '_small.' + imagePath[1] + ')'); 66900 } else { 66901 imageEl.attr('style', elStyle); 66902 } 66903 66904 } 66905 66906 $('.component-header-light, .component-header-dark').each(function() { 66907 if($(this).data('smallimg')) { 66908 var e = $(this) 66909 setResponsiveImage(e); 66910 66911 $(window).resize(function() { 66912 66913 setResponsiveImage(e); 66914 }); 66915 } 66916 }) 66917 66918 function setResponsiveImage(e) { 66919 if (window.innerWidth < 576) { 66920 e.css('background-image', 'url(' + e.data('smallimg') + ')'); 66921 } else { 66922 e.css('background-image', 'url(' + e.data('largeimg') + ')'); 66923 } 66924 } 66925}); 66926 66927$(function() { 66928 66929 var heroAnimComp = function(cl) { 66930 66931 var self =this; 66932 this.el = $($('.' + cl)[0]); 66933 this.mobileBreakpoint= 768; 66934 this.applyMobileHeight(); 66935 66936 $(window).resize(function(){ 66937 66938 self.applyMobileHeight(); 66939 66940 }); 66941 66942 66943 66944 }; 66945 66946 heroAnimComp.prototype.applyMobileHeight = function() { 66947 66948 var elMobHeight = this.el.attr('data-mob-height'); 66949 var elDefaultHeight = this.el.attr('data-default-height'); 66950 66951 if(window.innerWidth < 768){ 66952 66953 this.el.height(elMobHeight); 66954 }else{ 66955 this.el.height(elDefaultHeight); 66956 } 66957 66958 }; 66959 66960 heroAnimComp.prototype.scrollTrack = function() { 66961 66962 var self = this; 66963 66964 this.doAnimate(); 66965 66966 $(window).scroll(function() { 66967 66968 self.doAnimate(); 66969 66970 66971 }) 66972 66973 }; 66974 66975 heroAnimComp.prototype.doAnimate = function() { 66976 66977 var scrollTop = $(window).scrollTop(); 66978 var sbHeight = window.innerHeight * (window.innerHeight / document.body.offsetHeight); 66979 this.elScrollTop = this.el.offset().top; 66980 66981 if((scrollTop)>=(this.elScrollTop-window.innerHeight+150)){ 66982 if(!this.el.hasClass('animate')){ 66983 this.el.addClass('animate'); 66984 } 66985 } 66986 }; 66987 66988 66989 $.each($('.hero-img-with-animation'), function(i, v) { 66990 66991 var isAnimate = $(v).attr('data-is-animate'); 66992 $(v).addClass("hero-anim-" + i); 66993 var compObj = new heroAnimComp("hero-anim-" + i); 66994 66995 if(isAnimate){ 66996 66997 compObj.scrollTrack(); 66998 } 66999 67000 }); 67001 67002 67003 67004}); 67005 67006$(document).ready(function () { 67007 67008 67009 var podCastView = function (cl) { 67010 this.el = $($('.' + cl)[0]); 67011 }; 67012 67013 67014 podCastView.prototype.setPodCast =function(){ 67015 var podCastView = this.el; 67016 67017 var audio_path = $('.audio-caption.podCastlink-text', podCastView ).data('audio'); 67018 67019 if(audio_path){ 67020 this.getDuration(audio_path) 67021 .then(function (length) { 67022 //var minutes = Math.round(length/60 * 100) / 100; 67023 var minutes = Math.floor(length / 60); 67024 var seconds = length - minutes * 60; 67025 67026 console.log('I got length ' + length); 67027 $("#duration", podCastView).text(minutes + '.' + seconds.toFixed() + ' min'); 67028 }); 67029 } 67030 67031 if (!$('.audio-caption.podCastlink-text',podCastView).data('audio')) { 67032 $('.audio-caption.podCastlink-text', podCastView).removeAttr('data-toggle'); 67033 }; 67034 67035 $('.hero-img',podCastView ).on('click', function () { 67036 if(audio_path){ 67037 $('.audio-caption.podCastlink-text', podCastView).trigger('click'); 67038 } 67039 $(".video-caption.podCastlink-text", podCastView).trigger('click'); 67040 }); 67041 67042 $('.audio-caption.podCastlink-text', podCastView).on('click', function(e){ 67043 var audio_paths = $($(this),podCastView).data('audio'); 67044 if(audio_paths){ 67045 $($(this).data('target'), podCastView).modal('show'); 67046 $('#jp_container_1',podCastView).show(); 67047 $('#jp_container_1', podCastView).addClass('jp-state-playing'); 67048 67049 67050 var index = audio_paths.substr(audio_paths.lastIndexOf('/')+1).lastIndexOf('.'); 67051 var audio_title=(audio_paths.substr(audio_paths.lastIndexOf('/')+1).substr(0,index)).replaceAll('_',' ').replaceAll('-',' '); 67052 67053 $("#jquery_jplayer_1", podCastView).jPlayer({ 67054 ready: function () { 67055 var ready = true; 67056 $($(this),podCastView).jPlayer("setMedia", { 67057 title: audio_title, 67058 //mp3: "/content/dam/dupont/amer/us/en/pbs/Kalimba.mp3", 67059 //mp3: "../audio/Kalimba.mp3" 67060 mp3: audio_paths 67061 }); 67062 $($(this),podCastView).jPlayer("play", 1); 67063 }, 67064 67065 loadeddata: function (event) { // calls after setting the song duration 67066 songDuration = event.jPlayer.status.duration; 67067 }, 67068 67069 swfPath: "dist/jplayer", 67070 supplied: "mp3", 67071 wmode: "window", 67072 useStateClassSkin: true, 67073 autoBlur: false, 67074 smoothPlayBar: true, 67075 keyEnabled: true, 67076 remainingDuration: true, 67077 toggleDuration: true 67078 }); 67079 67080 $("#jPlayereModalCenter", podCastView).on('hide.bs.modal', function () { 67081 $('#jp_container_1 .jp-stop', podCastView).click(); 67082 $('#jquery_jplayer_1', podCastView).jPlayer("destroy"); 67083 //$('#jp_container_1', podCastView).removeClass('jp-state-playing'); 67084 }); 67085 $("#jPlayereModalCenter", podCastView).on('show.bs.modal', function () { 67086 $('#jp_container_1 .jp-play', podCastView).click(); 67087 67088 }); 67089 } 67090 67091 e.stopPropagation(); 67092 }); 67093 67094 $(".video-caption.podCastlink-text, .playpause",podCastView).click(function (e) { 67095 e.preventDefault(); 67096 e.stopPropagation(); 67097 67098 var playicon_obj = $(this); 67099 var v_src = playicon_obj.data('video'); 67100 67101 if(v_src){ 67102 $($(this).data('target'), podCastView).modal('show'); 67103 67104 if(v_src.lastIndexOf('https')>0 || v_src.lastIndexOf('www')>0 ){ 67105 $('#videoModal-iframe #ifr-video', podCastView).attr("src", v_src); 67106 $('#videoModal-iframe #video1', podCastView).attr("src", '#'); 67107 $('#videoModal-iframe #video1', podCastView).hide(); 67108 }else{ 67109 $('#videoModal-iframe #video1', podCastView).attr("src", v_src); 67110 $('#videoModal-iframe #ifr-video', podCastView).attr("src", '#'); 67111 $('#videoModal-iframe #ifr-video', podCastView).hide(); 67112 } 67113 67114 67115 $('#videoModal-iframe', podCastView).on('shown.bs.modal', function () { 67116 if(v_src.lastIndexOf('https')>0 || v_src.lastIndexOf('www')>0 ){ 67117 var v_autoply_src = v_src + "?autoplay=1"; 67118 $('#ifr-video', podCastView).attr("src",v_autoply_src); 67119 }else{ 67120 $('#videoModal-iframe #video1', podCastView)[0].play(); 67121 } 67122 }); 67123 } 67124 }); 67125 67126 $('#videoModal-iframe',podCastView).on('hidden.bs.modal', function () { 67127 $('#ifr-video', podCastView).attr("src","#"); 67128 $('#videoModal-iframe #video1', podCastView).attr("src","#"); 67129 }); 67130 67131 67132 67133 }; 67134 67135 podCastView.prototype.getDuration =function getDuration(src) { 67136 return new Promise(function (resolve) { 67137 var audio = new Audio(); 67138 $(audio).on("loadedmetadata", function () { 67139 resolve(audio.duration); 67140 }); 67141 audio.src = src; 67142 }); 67143 }; 67144 67145 $.each($('.hero-podCastView'), function (i, v) { 67146 $(v).addClass("eduhub-" + i); 67147 (new podCastView("eduhub-" + i)).setPodCast(); 67148 }); 67149 67150}); 67151 67152$(document).ready(function(){ 67153 $('.heroimage .hero-Carousel-Slides').slick({ 67154 infinite: true, 67155 slidesToShow: 1, 67156 slidesToScroll: 1, 67157 autoplay: true, 67158 autoplaySpeed: 15000, 67159 pauseOnFocus: false, 67160 pauseOnHover: false, 67161 touchMove:false, 67162 dots:true, 67163 adaptiveHeight: true 67164 }); 67165}); 67166 67167 67168function loadScreen(){ 67169 $('<style>.heroWith-animatedTitle .overlay:after{opacity:0;z-index:-1;}</style>').appendTo('.new-body'); 67170 splitTitleAndAnimate(); 67171} 67172 67173 67174function splitTitleAndAnimate(){ 67175 if($('.heroWith-animatedTitle').length){ 67176 $('.animated-block').each((x,y)=>{ 67177 let animatedTitle=$(y).find('.animated-title').data('title'); 67178 words= animatedTitle ? animatedTitle.split(" ") : ''; 67179 console.log(words); 67180 let animdelay=0; 67181 if(words){ 67182 words.forEach((ele,index) => { 67183 67184 ele= ele+" " 67185 let heading = document.createElement("span"); 67186 heading.innerHTML=ele; 67187 $(y).find('.animated-title').append(heading); 67188 67189 console.log(ele,index,"after h1"); 67190 //var className = "header"+index+'a '; 67191 let className = `header-anim header-anim${index}`; 67192 //let animdelay = index==0? '660ms': 660*(index+1)+'ms'; 67193 animdelay = 660*index; 67194 //console.log(className,"class name"); 67195 67196 67197 $(y).find('.animated-title').find("span:last").css('animation-delay',animdelay+'ms'); 67198 $(y).find('.animated-title').find("span:last").addClass(className); 67199 //$(this).addClass(className).css('animation-duration',660*(index+1)) 67200 67201 }); 67202 } 67203 $(y).find('.tag1').css('animation-delay',animdelay+660+'ms'); 67204 $(y).find('.animated-btn').css('animation-delay',animdelay+660+'ms'); 67205 $(y).find('.tag1').css('animation-name','fade-In'); 67206 $(y).find('.animated-btn').css('animation-name','fade-In'); 67207 67208 // $('.heroimage .animated-block .tag1').css('animation-delay',animdelay+660+'ms'); 67209 // $('.heroimage .animated-block .animated-btn').css('animation-delay',animdelay+660+'ms'); 67210 // $('.heroimage .animated-block .tag1').css('animation-name','fade-In'); 67211 // $('.heroimage .animated-block .animated-btn').css('animation-name','fade-In'); 67212 }); 67213 } 67214 67215 67216 67217} 67218 67219window.addEventListener("load",loadScreen); 67220 67221$(document).ready(function(){ 67222 $('.ei-heroCarousel-with-video .heroFV-slides').slick({ 67223 infinite: true, 67224 slidesToShow: 1, 67225 slidesToScroll: 1, 67226 autoplay: true, 67227 autoplaySpeed: 20000, 67228 pauseOnFocus: false, 67229 pauseOnHover: false, 67230 touchMove:false, 67231 dots:true 67232 }); 67233 onresize = (event) => {$('.ei-heroCarousel-with-video .heroFV-slides').slick('setPosition');}; 67234 let ei_heroCarousel = ".ei-heroCarousel-with-video"; 67235 $(".ei-heroCarousel-with-video .play-icon").click(function(e){ 67236 e.preventDefault(); 67237 67238 var playicon_obj = $(this); 67239 var v_src = playicon_obj.siblings(".video").attr("data-src");
67240 let v_videoPath = $(this).siblings(".video").data("content-path"); 67241 67242 $('#video1', ei_heroCarousel).data('content-path',v_videoPath); 67243 $('#video1', ei_heroCarousel).attr("src",v_src); 67244 67245 $('#heroVideoModal', ei_heroCarousel).on('shown.bs.modal', function () { 67246 $('#video1', ei_heroCarousel)[0].play(); 67247 }); 67248 67249 $('#heroVideoModal', ei_heroCarousel).on('hidden.bs.modal', function () { 67250 $('#video1', ei_heroCarousel)[0].pause(); 67251 $('#video1', ei_heroCarousel).attr("src","#"); 67252 $('#video1', ei_heroCarousel).removeData('content-path'); 67253 }); 67254 67255 }); 67256$(".heroFV-slide video").each(function() { 67257 if(!$(this).parent().parent().parent().parent().hasClass("slick-active") && !$(this)[0].paused){$(this)[0].pause();} 67258 else if($(this).parent().parent().parent().parent().hasClass("slick-active") && $(this)[0].paused){$(this)[0].play();} 67259 }); 67260 }); 67261 67262$(window).on("load", function() { 67263 67264 $(".slick-dots").on('DOMSubtreeModified', function() { 67265 $(".heroFV-slide video").each(function() { 67266 if(!$(this).parent().parent().parent().parent().hasClass("slick-active") && !$(this)[0].paused){$(this)[0].pause();} 67267 else if($(this).parent().parent().parent().parent().hasClass("slick-active") && $(this)[0].paused){$(this)[0].play();} 67268 }); 67269 67270 }) 67271 67272}); 67273 67274function StickyBar(element) { 67275 this.el = element; 67276 this.navBarEl = $(".container-fluid.no-gutters"); 67277 this.lastScrollY = $(window).scrollTop(); 67278 this.minimunScroll = 72; 67279 this.initializeEvents(); 67280} 67281StickyBar.prototype.checkScroll = function (e) { 67282 var scrollY = $(window).scrollTop(), 67283 scrollMax = ($(document).height() - $(window).height()), 67284 isSafari = (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1); 67285 var scrollElastic = (isSafari) ? document.body.scrollTop : window.scrollY; 67286 67287 if (scrollElastic > 0 && scrollElastic < scrollMax) { 67288 if (scrollY > this.lastScrollY) { 67289 this.el.addClass('scroll-sticky') 67290 } else { 67291 this.el.removeClass('scroll-sticky') 67292 } 67293 this.lastScrollY = scrollY; 67294 } 67295}; 67296 67297StickyBar.prototype.initializeEvents = function () { 67298 67299 var supportsOrientationChange = "onorientationchange" in window, 67300 orientationEvent = supportsOrientationChange ? "orientationchange" : "resize", 67301 self = this; 67302 67303 $(window).on("scroll", this.checkScroll.bind(this)); 67304 $(window).on(orientationEvent, this.checkScroll.bind(this)); 67305}; 67306 67307$(function () { 67308 $(".container-fluid.no-gutters").each(function () { 67309 new StickyBar($(this)); 67310 }); 67311}); 67312 67313function getCookie(cname) { 67314 var name = cname + "="; 67315 var ca = document.cookie.split(';'); 67316 for(var i = 0; i < ca.length; i++) { 67317 var c = ca[i]; 67318 while (c.charAt(0) == ' ') { 67319 c = c.substring(1); 67320 } 67321 if(c.indexOf(name) == 0) { 67322 return c.substring(name.length, c.length); 67323 } 67324 } 67325 return ""; 67326} 67327function checkCookie() { 67328 var user = getCookie("gatedRegisteredEmail"); 67329 if(user != "") { 67330 return true; 67331 } else { 67332 return false; 67333 } 67334} 67335function setCookie(cname, cvalue, exdays) { 67336 var d = new Date(); 67337 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 67338 var expires = "expires=" + d.toUTCString(); 67339 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 67340} 67341 67342$(window).on("load", function() { 67343 if($("#gated-modal .smart-form form").children().find("input[name=sourceTrackingCode]") && $("#gated-modal .smart-form form").children().find("input[name=sourceTrackingCode]").val()) { 67344 setCookie("s_campaign", $(".smart-form form").children().find("input[name=sourceTrackingCode]").val()); 67345 } 67346 67347}); 67348var gatingSuccessHandled = false; 67349var observer = new MutationObserver(function (m) { 67350 67351 if($(".success-message").length && !gatingSuccessHandled){ 67352 gatingSuccessHandled = true; 67353 $("head").append("<style>input[type=submit] {pointer-events: none;background-color:#e1e1e1!important;}</style>"); 67354 document.cookie = 's_campaign=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;domain=.pp.dupont.com;' 67355 document.cookie = 's_campaign=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;domain=.dupont.com;' 67356 localStorage.removeItem("src_tracking_code"); 67357 67358 // Set the gatedRegisteredEmail cookie BEFORE closeModal so that 67359 // any code checking checkCookie() during close sees the cookie already set 67360 if($("input[fieldtype=email]:visible").val()){
67361 setCookie('gatedRegisteredEmail', $("input[fieldtype=email]:visible").val(), 1); 67362 } 67363 67364 if(closeModal){ 67365 closeModal($("input[fieldtype=email]:visible").val()); 67366 } 67367 67368 if($("input[fieldtype=email]:visible").val()){ 67369 // Trigger custom event for external tracking of gated email submission 67370 $(document).trigger('gatedRegisteredEmailSet'); 67371 } 67372 if(digitalData.page.aemPageurl.indexOf("liveo") != -1 || digitalData.page.aemPageurl.indexOf("building") != -1) { 67373 var href = $(".gatingContainer .cta").attr("href"); 67374 var target = $(".gatingContainer .cta").attr("target"); 67375 $(".gatingContainer .cta").attr("download", $(".gatingContainer .cta").attr("data-title")); 67376 $(".gatingContainer .cta")[0].click(); 67377 //window.open(href,target); 67378 } 67379 } 67380}); 67381 67382$(document).ready(function(){ 67383 67384 if( document.getElementById("smart-form-container")){ 67385 observer.observe(document.getElementById("smart-form-container"), { childList: true, subtree: true, }); 67386 } 67387 if(digitalData.page.aemPageurl.indexOf("/electronics-industrial") != -1 && !checkCookie()) { 67388 $(".gatingContainer").append("<style>.modal-content .close{ display: none}</style>"); 67389 } 67390 67391 if(digitalData.page.aemPageurl.indexOf("liveo") != -1){ 67392 $(".gatingContainer .cta").attr("download", $(".gatingContainer .cta").attr("data-title")); 67393 } 67394 67395 var gated = document.getElementsByClassName('gatingContainer'); 67396 let target_elems = $(gated).attr('data-specificClasses') ? $(gated).attr('data-specificClasses').split(',').map(s => s.trim()) : []; 67397 var ppeModalOpenCheck = false; 67398 var ctaPath = ""; 67399 var fStart = false;
67400 67401 if(gated.length) { 67402 gated = gated[0]; 67403 67404 function isInViewport(elem) { 67405 var bounding = elem.getBoundingClientRect(); 67406 return ( 67407 bounding.top < window.innerHeight/2 67408 ); 67409 }; 67410 var isModalOpen = false; 67411 var scrollLvl = 0; 67412 67413 function gatedScrollFunction() { 67414 if(isInViewport(gated)) { 67415 if(gated.getBoundingClientRect().top > scrollLvl) { 67416 67417 } 67418 else { 67419 if(!isModalOpen) openModal(false); 67420 } 67421 67422 scrollLvl = gated.getBoundingClientRect().top; 67423 } 67424 } 67425 function modalOnClick() { 67426 if($(gated).closest('.gating-container').hasClass('gate-on-click')) 67427 return true; 67428 return false; 67429 } 67430 function gatedFormClickModalHandler(e){ 67431 if(!fStart) { 67432 //_satellite.track("formstart"); 67433 fStart = true; 67434 } 67435 if(digitalData.category.subBusinessunit == "Personal Protection" || digitalData.page.aemPageurl.indexOf("/personal-protection/") >= 0 || digitalData.page.aemPageurl.indexOf("/transportation-industrial") >= 0) { 67436 console.log("gatedSubBusinessunit================**********************" + digitalData.category.subBusinessunit); 67437 ctaPath = $('.gate-on-click .gatingContainer a').attr('href'); 67438 console.log("ctaPath================**********************" + ctaPath); 67439 ppeModalOpenCheck = true; 67440 } 67441 openModal(true); 67442 return false; 67443 } 67444 if(!modalOnClick()) { 67445 $(document).ready(function(){ 67446 if(isInViewport(gated)) { 67447 if(!fStart){ 67448 //_satellite.track("formstart"); 67449 fStart = true; 67450 } 67451 openModal(false); 67452 $(window).scroll(gatedScrollFunction) 67453 } 67454 else { 67455 if(!fStart){ 67456 //_satellite.track("formstart"); 67457 fStart = true; 67458 } 67459 $(window).scroll(gatedScrollFunction) 67460 } 67461 }) 67462 } 67463 if(modalOnClick()) { 67464 if(checkCookie()) { 67465 if(!fStart){ 67466 // _satellite.track("formstart"); 67467 fStart = true; 67468 } 67469 openModal(true); 67470 return false; 67471 } 67472 67473 if($(gated).hasClass('specific-element')){ 67474 target_elems.forEach(function(target_elem) { 67475 $(gated).on('click', `.${target_elem}`, gatedFormClickModalHandler); 67476 }); 67477 }else{ 67478 $(gated).on('click', gatedFormClickModalHandler); 67479 } 67480 67481 } 67482 67483 var modalClosed = false, checkTargetBehavior = $('.gate-on-click .gatingContainer a').attr('target'); 67484 67485 function closeModal(gatedEmail) { 67486 $(window).unbind('scroll', gatedScrollFunction); 67487 $(gated).unbind('click'); 67488 $(gated).closest('.gating-container').removeClass('gated-blurred'); 67489 $(gated).closest('.gating-container').removeClass('gate-on-click'); 67490 $('#gated-modal').modal('hide'); 67491 $('html').css({ 'overflow': 'auto' }); 67492 67493 isModalOpen = false; 67494 67495 if(ppeModalOpenCheck && ctaPath != "" && !modalClosed) { 67496 var ctaTarget = ""; 67497 if(checkTargetBehavior == undefined) { 67498 ctaTarget = "_self"; 67499 } 67500 else { 67501 ctaTarget = "_blank"; 67502 } 67503 if(!$(gated).hasClass('specific-element')){ 67504 window.open(ctaPath, ctaTarget); 67505 } 67506 modalClosed = true; 67507 } 67508 } 67509 67510 window.closeModal = closeModal; 67511 67512 $('#gated-modal .close').click(function() { 67513 $('html').css({ 'overflow': 'auto' }); 67514 isModalOpen = false; 67515 // Fire custom event so other components can react to modal close 67516 $(document).trigger('gatedModalClosed'); 67517 }) 67518 67519 function openModal(closeable) { 67520 if(checkCookie()) { 67521 closeModal(getCookie('gatedRegisteredEmail')); 67522 return; 67523 } 67524 67525 isModalOpen = true; 67526 if(!$('.modal-body').is(':visible')) { 67527 $('#gated-modal').modal({ backdrop: 'static', keyboard: false }); 67528 $('html').css({ 'overflow': 'hidden' }); 67529 } 67530 } 67531 function deleteCookie(name) { 67532 document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 67533 } 67534 } 67535}); 67536 67537 67538(function ($, $document) { 67539 67540 try{ 67541 //console.log("isEditMode>>>",$.cookie('wcmmode')) 67542 if($.cookie('wcmmode')==="edit"){ 67543 67544 $document.on("dialog-ready", function() { 67545 setTimeout(function(){ 67546 if($('coral-select[name="./featuredBlock"]')){ 67547 $('coral-select[name="./featuredBlock"]').trigger('change'); 67548 } 67549 }, 500) 67550 }); 67551 67552 $(document).on("change", 'coral-select[name="./featuredBlock"]', function (evnt) { 67553 let selctedViewName = $('coral-select[name="./featuredBlock"]').find('input[name="./featuredBlock"]').val(); 67554 $('input[name="./commoncategory"]').show(); 67555 $('input[name="./commoncategory"]').siblings('label').show(); 67556 67557 $('input[name="./commontitle"]').parent().parent().show(); 67558 $('input[name="./commontitle"]').siblings('label').parent().parent().show(); 67559 67560 $('input[name="./commondescription"]').parent().parent().show(); 67561 $('input[name="./commondescription"]').siblings('label').parent().parent().show(); 67562 67563 $('input[name="./commonCtaText"]').show(); 67564 $('input[name="./commonCtaText"]').siblings('label').show(); 67565 67566 $('input[name="./commonCtaUrl"]').parent().parent().parent().show(); 67567 $('input[name="./commonCtaUrl"]').siblings('label').parent().parent().parent().show(); 67568 67569 $('input[name="./commonOpenNewTab"]').parent('coral-checkbox').show(); 67570 $('input[name="./commonOpenNewTab"]').siblings('label').parent('coral-checkbox').show(); 67571 67572 $('input[name="./commonfile"]').parent().parent().show(); 67573 $('input[name="./commonfile"]').siblings('label').parent().parent().show(); 67574 67575 if(selctedViewName === "textView"){ 67576 $('input[name="./commonfile"]').parent().parent().hide(); 67577 $('input[name="./commonfile"]').siblings('label').parent().parent().hide(); 67578 }else if(selctedViewName === "centeredView"){ 67579 $('input[name="./commonfile"]').parent().parent().hide(); 67580 $('input[name="./commonfile"]').siblings('label').parent().parent().hide(); 67581 67582 $('input[name="./commonCtaText"]').hide(); 67583 $('input[name="./commonCtaText"]').siblings('label').hide(); 67584 67585 $('input[name="./commonCtaUrl"]').parent().parent().parent().hide(); 67586 $('input[name="./commonCtaUrl"]').siblings('label').parent().parent().parent().hide(); 67587 67588 $('input[name="./commonOpenNewTab"]').parent('coral-checkbox').hide(); 67589 $('input[name="./commonOpenNewTab"]').siblings('label').parent('coral-checkbox').hide(); 67590 67591 }else if(selctedViewName === "expandedView"){ 67592 $('input[name="./commonfile"]').parent().parent().hide(); 67593 $('input[name="./commonfile"]').siblings('label').parent().parent().hide(); 67594 67595 }else if(selctedViewName === "leadershipView"){ 67596 $('input[name="./commondescription"]').parent().parent().hide(); 67597 $('input[name="./commondescription"]').siblings('label').parent().parent().hide(); 67598 67599 $('input[name="./commonfile"]').parent().parent().hide(); 67600 $('input[name="./commonfile"]').siblings('label').parent().parent().hide(); 67601 67602 }else if(selctedViewName === "imageTextView"){ 67603 $('input[name="./commontitle"]').parent().parent().hide(); 67604 $('input[name="./commontitle"]').siblings('label').parent().parent().hide(); 67605 67606 }else if(selctedViewName === "imageTextLeftView"){ 67607 $('input[name="./commontitle"]').parent().parent().hide(); 67608 $('input[name="./commontitle"]').siblings('label').parent().parent().hide(); 67609 67610 }else if(selctedViewName === "bgParallaxView"){ 67611 $('input[name="./commonCtaText"]').hide(); 67612 $('input[name="./commonCtaText"]').siblings('label').hide(); 67613 67614 $('input[name="./commonCtaUrl"]').parent().parent().parent().hide(); 67615 $('input[name="./commonCtaUrl"]').siblings('label').parent().parent().parent().hide(); 67616 67617 $('input[name="./commonOpenNewTab"]').parent('coral-checkbox').hide(); 67618 $('input[name="./commonOpenNewTab"]').siblings('label').parent('coral-checkbox').hide(); 67619 67620 }else if(selctedViewName === "bgimageanimationView"){ 67621 $('input[name="./commoncategory"]').hide(); 67622 $('input[name="./commoncategory"]').siblings('label').hide(); 67623 67624 }else if(selctedViewName === "videotextview"){ 67625 $('input[name="./commoncategory"]').hide(); 67626 $('input[name="./commoncategory"]').siblings('label').hide(); 67627 67628 $('input[name="./commontitle"]').parent().parent().hide(); 67629 $('input[name="./commontitle"]').siblings('label').parent().parent().hide(); 67630 67631 $('input[name="./commonCtaText"]').hide(); 67632 $('input[name="./commonCtaText"]').siblings('label').hide(); 67633 67634 $('input[name="./commonCtaUrl"]').parent().parent().parent().hide(); 67635 $('input[name="./commonCtaUrl"]').siblings('label').parent().parent().parent().hide(); 67636 67637 $('input[name="./commonOpenNewTab"]').parent('coral-checkbox').hide(); 67638 $('input[name="./commonOpenNewTab"]').siblings('label').parent('coral-checkbox').hide(); 67639 67640 $('input[name="./commonfile"]').parent().parent().hide(); 67641 $('input[name="./commonfile"]').siblings('label').parent().parent().hide(); 67642 67643 }else if(selctedViewName === "bgImageCardView"){ 67644 $('input[name="./commontitle"]').parent().parent().hide(); 67645 $('input[name="./commontitle"]').siblings('label').parent().parent().hide(); 67646 67647 } 67648 }); 67649 } 67650 }catch(e){ 67651 console.log(e) 67652 } 67653 67654})($, $(document)); 67655 67656 67657 67658function FeaturedBlockExpanded(el) { 67659 this.CLAMPED_LINE_COUNT = 5; 67660 this.el = el; 67661 this.isCollapsed = true; 67662 67663 this.setUpElements(); 67664 this.setHeights(); 67665 this.initEvents(); 67666} 67667 67668FeaturedBlockExpanded.prototype.setUpElements = function() { 67669 this.clampedContent = this.el.querySelector( 67670 ".featured-block-expanded--clamped-content" 67671 ); 67672 this.fullContent = this.clampedContent.cloneNode(true); 67673 this.closePositioner = this.el.querySelector( 67674 ".featured-block-expanded--close-positioner" 67675 ); 67676 67677 $(this.clampedContent).before(this.fullContent); 67678 $(this.fullContent) 67679 .removeClass("featured-block-expanded--clamped-content") 67680 .addClass("featured-block-expanded--full-content") 67681 .css({ 67682 display: "none" 67683 }); 67684}; 67685 67686FeaturedBlockExpanded.prototype.setHeights = function() { 67687 var isMobile = matchMedia("(max-width: 767px)").matches; 67688 Granite.I18n.setLocale(); 67689 var readMoreLocalizeTitle = Granite.I18n.get("Read more"); 67690 67691 this.COLLAPSED_HEIGHT = 67692 parseInt(getComputedStyle(this.clampedContent).lineHeight) * 67693 this.CLAMPED_LINE_COUNT; 67694 67695 this.fullContent.style.height = 67696 (this.isCollapsed ? this.COLLAPSED_HEIGHT : this.fullContent.scrollHeight) + 67697 "px"; 67698 67699 shave(this.clampedContent, this.COLLAPSED_HEIGHT, { 67700 character: 67701 ' <button class="featured-block-expanded--read-more">' + readMoreLocalizeTitle + 'â¦</button>' 67702 }); 67703 67704 this.el.querySelector( 67705 ".featured-block-expanded--content-column" 67706 ).style.paddingTop = isMobile 67707 ? "" 67708 : this.el 67709 .querySelector(".featured-block-expanded--intro-column h4") 67710 .getBoundingClientRect().height + "px"; 67711}; 67712 67713FeaturedBlockExpanded.prototype.initEvents = function() { 67714 $(this.el).on( 67715 "click", 67716 ".featured-block-expanded--read-more", 67717 this.expand.bind(this) 67718 ); 67719 67720 $(this.el).on( 67721 "click", 67722 ".featured-block-expanded--close", 67723 this.collapse.bind(this) 67724 ); 67725 67726 window.addEventListener("resize", this.setHeights.bind(this)); 67727}; 67728 67729FeaturedBlockExpanded.prototype.expand = function() { 67730 this.isCollapsed = false;
67731 clearTimeout(this.collapseTimeout); 67732 67733 // show full content and animate to full height 67734 this.fullContent.style.display = ""; 67735 this.fullContent.style.height = this.fullContent.scrollHeight + "px"; 67736 67737 // position clamped content on top of full and fade out 67738 this.clampedContent.style.position = "absolute"; 67739 this.clampedContent.style.opacity = 0; 67740 this.clampedContent.style.visibility = "hidden"; 67741 67742 // show close button 67743 this.closePositioner.style.opacity = 1; 67744 this.closePositioner.style.visibility = "visible"; 67745}; 67746 67747FeaturedBlockExpanded.prototype.collapse = function() { 67748 var self = this; 67749 67750 this.isCollapsed = true; 67751 clearTimeout(this.collapseTimeout); 67752 67753 // animate full content to collapsed height 67754 this.fullContent.style.height = this.COLLAPSED_HEIGHT + "px"; 67755 67756 // fade clamped content in on top of full content 67757 this.clampedContent.style.opacity = 1; 67758 this.clampedContent.style.visibility = "visible"; 67759 67760 // hide close button 67761 this.closePositioner.style.opacity = 0; 67762 this.closePositioner.style.visibility = "hidden"; 67763 67764 // at end of animation, hide full content and reset clamped content positioning 67765 this.collapseTimeout = setTimeout(function() { 67766 self.fullContent.style.display = "none"; 67767 self.clampedContent.style.position = ""; 67768 }, 333); 67769 67770 // scroll to top of block 67771 var navHeight = $('.component-navigation').height() || 0; 67772 var newBodyScrollTop = $(this.el).position().top - navHeight; 67773 67774 $("html, body").animate({ scrollTop: newBodyScrollTop }, 222); 67775}; 67776 67777$(function() { 67778 $(".featured-block-expanded").each(function() { 67779 new FeaturedBlockExpanded(this); 67780 }); 67781}); 67782 67783!function(n){var i={};function o(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=i,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=11)}([,,function(e,t,n){"use strict";e.exports=function(e){"complete"===document.readyState||"interactive"===document.readyState?e.call():document.attachEvent?document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&e.call()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",e)}},,function(n,e,t){"use strict";(function(e){var t;t="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n.exports=t}).call(this,t(5))},function(e,t,n){"use strict";var i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(i=window)}e.exports=i},,,,,,function(e,t,n){e.exports=n(12)},function(e,t,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=l(n(2)),a=n(4),r=l(n(13));function l(e){return e&&e.__esModule?e:{default:e}}var s=a.window.jarallax;if(a.window.jarallax=r.default,a.window.jarallax.noConflict=function(){return a.window.jarallax=s,this},void 0!==a.jQuery){var c=function(){var e=arguments||[];Array.prototype.unshift.call(e,this);var t=r.default.apply(a.window,e);return"object"!==(void 0===t?"undefined":i(t))?t:this};c.constructor=r.default.constructor;var u=a.jQuery.fn.jarallax;a.jQuery.fn.jarallax=c,a.jQuery.fn.jarallax.noConflict=function(){return a.jQuery.fn.jarallax=u,this}}(0,o.default)(function(){(0,r.default)(document.querySelectorAll("[data-jarallax]"))})},function(e,I,P){"use strict";(function(e){Object.defineProperty(I,"__esModule",{value:!0});var s=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,o=!1,a=void 0;try{for(var r,l=e[Symbol.iterator]();!(i=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{!i&&l.return&&l.return()}finally{if(o)throw a}}return n}(e,t);
67783throw new TypeError("Invalid attempt to destructure non-iterable instance")},t=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e};function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=r(P(2)),o=r(P(14)),a=P(4);function r(e){return e&&e.__esModule?e:{default:e}}var u=-1<navigator.userAgent.indexOf("MSIE ")||-1<navigator.userAgent.indexOf("Trident/")||-1<navigator.userAgent.indexOf("Edge/"),l=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),d=function(){for(var e="transform WebkitTransform MozTransform".split(" "),t=document.createElement("div"),n=0;n<e.length;n++)if(t&&void 0!==t.style[e[n]])return e[n];return!1}(),m=void 0;var v=void 0,b=void 0,p=void 0,f=!1,g=!1;function y(e){v=a.window.innerWidth||document.documentElement.clientWidth,b=l?(!m&&document.body&&((m=document.createElement("div")).style.cssText="position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;",document.body.appendChild(m)),(m?m.clientHeight:0)||a.window.innerHeight||document.documentElement.clientHeight):a.window.innerHeight||document.documentElement.clientHeight,"object"!==(void 0===e?"undefined":c(e))||"load"!==e.type&&"dom
67783-loaded"!==e.type||(f=!0)}y(),a.window.addEventListener("resize",y),a.window.addEventListener("orientationchange",y),a.window.addEventListener("load",y),(0,n.default)(function(){y({type:"dom-loaded"})});var h=[],x=!1;function w(){if(h.length){p=void 0!==a.window.pageYOffset?a.window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;var t=f||!x||x.width!==v||x.height!==b,n=g||t||!x||x.y!==p;g=f=!1,(t||n)&&(h.forEach(function(e){t&&e.onResize(),n&&e.onScroll()}),x={width:v,height:b,y:p}),(0,o.default)(w)}}var A=!!e.ResizeObserver&&new e.ResizeObserver(function(e){e&&e.length&&(0,o.default)(function(){e.forEach(function(e){e.target&&e.target.jarallax&&(f||e.target.jarallax.onResize(),g=!0)})})}),$=0,S=(t(j,[{key:"css",value:function(t,n){return"string"==typeof n?a.window.getComputedStyle(t).getPropertyValue(n):(n.transform&&d&&(n[d]=n.transform),Object.keys(n).forEach(function(e){t.style[e]=n[e]}),t)}},{key:"extend",value:function(n){var i=arguments;return n=n||{},Object.keys(arguments).forEach(function(t){i[t]&&Object.keys(i[t]).forEach(function(e){n[e]=i[t][e]})}),n}},{key:"getWindowData",value:function(){return{width:v,height:b,y:p}}},{key:"initImg",value:function(){var e=this,t=e.options.imgElement;return t&&"string"==typeof t&&(t=e.$item.querySelector(t)),t instanceof Element||(t=null),t&&(e.options.keepImg?e.image.$item=t.cloneNode(!0):(e.image.$item=t,e.image.$itemParent=t.parentNode),e.image.useImgTag=!0),!(!e.image.$item&&(null===e.image.src&&(e.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.image.bgImage=e.css(e.$item,"background-image")),!e.image.bgImage||"none"===e.image.bgImage))}},{key:"canInitParallax",value:function(){return d&&!this.options.disableParallax()}},{key:"init",value:function(){var e=this,t={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},n={};if(!e.options.keepImg){var i=e.$item.getAttribute("style");if(i&&e.$item.setAttribute("data-jarallax-original-styles",i),e.image.useImgTag){var o=e.image.$item.getAttribute("style");o&&e.image.$item.setAttribute("data-jarallax-original-styles",o)}}if("static"===e.css(e.$item,"position")&&e.css(e.$item,{position:"relative"}),"auto"===e.css(e.$item,"z-index")&&e.css(e.$item,{zIndex:0}),e.image.$container=document.createElement("div"),e.css(e.image.$container,t),e.css(e.image.$container,{"z-index":e.options.zIndex}),u&&e.css(e.image.$container,{opacity:.9999}),e.image.$container.setAttribute("id","jarallax-container-"+e.instanceID),e.$item.appendChild(e.image.$container),e.image.useImgTag?n=e.extend({"object-fit":e.options.imgSize,"object-position":e.options.imgPosition,"font-family":"object-fit: "+e.options.imgSize+"; object-position: "+e.options.imgPosition+";","max-width":"none"},t,n):(e.image.$item=document.createElement("div"),e.image.src&&(n=e.extend({"background-position":e.options.imgPosition,"background-size":e.options.imgSize,"background-repeat":e.options.imgRepeat,"background-image":e.image.bgImage||'url("'+e.image.src+'")'},t,n))),"opacity"!==e.options.type&&"scale"!==e.options.type&&"scale-opacity"!==e.options.type&&1!==e.options.speed||(e.image.position="absolute"),"fixed"===e.image.position)for(var a=0,r=e.$item;null!==r&&r!==document&&0===a;){var l=e.css(r,"-webkit-transform")||e.css(r,"-moz-transform")||e.css(r,"transform");l&&"none"!==l&&(a=1,e.image.position="absolute"),r=r.parentNode}n.position=e.image.position,e.css(e.image.$item,n),e.image.$container.appendChild(e.image.$item),e.onResize(),e.onScroll(!0),e.o
67783ptions.automaticResize&&A&&A.observe(e.$item),e.options.onInit&&e.options.onInit.call(e),"none"!==e.css(e.$item,"background-image")&&e.css(e.$item,{"background-image":"none"}),e.addToParallaxList()}},{key:"addToParallaxList",value:function(){h.push(this),1===h.length&&w()}},{key:"removeFromParallaxList",value:function(){var n=this;h.forEach(function(e,t){e.instanceID===n.instanceID&&h.splice(t,1)})}},{key:"destroy",value:function(){var e=this;e.removeFromParallaxList();var t=e.$item.getAttribute("data-jarallax-original-styles");if(e.$item.removeAttribute("data-jarallax-original-styles"),t?e.$item.setAttribute("style",t):e.$item.removeAttribute("style"),e.image.useImgTag){var n=e.image.$item.getAttribute("data-jarallax-original-styles");e.image.$item.removeAttribute("data-jarallax-original-styles"),n?e.image.$item.setAttribute("style",t):e.image.$item.removeAttribute("style"),e.image.$itemParent&&e.image.$itemParent.appendChild(e.image.$item)}e.$clipStyles&&e.$clipStyles.parentNode.removeChild(e.$clipStyles),e.image.$container&&e.image.$container.parentNode.removeChild(e.image.$container),e.options.onDestroy&&e.options.onDestroy.call(e),delete e.$item.jarallax}},{key:"clipContainer",value:function(){if("fixed"===this.image.position){var e=this,t=e.image.$container.getBoundingClientRect(),n=t.width,i=t.height;e.$clipStyles||(e.$clipStyles=document.createElement("style"),e.$clipStyles.setAttribute("type","text/css"),e.$clipStyles.setAttribute("id","jarallax-clip-"+e.instanceID),(document.head||document.getElementsByTagName("head")[0]).appendChild(e.$clipStyles));var o="#jarallax-container-"+e.instanceID+" {\n clip: rect(0 "+n+"px "+i+"px 0);\n clip: rect(0, "+n+"px, "+i+"px, 0);\n }";e.$clipStyles.styleSheet?e.$clipStyles.styleSheet.cssText=o:e.$clipStyles.innerHTML=o}}},{key:"coverImage",value:function(){var e=this,t=e.image.$container.getBoundingClientRect(),n=t.height,i=e.options.speed,o="scroll"===e.options.type||"scroll-opacity"===e.options.type,a=0,r=n,l=0;return o&&(i<0?(a=i*Math.max(n,b),b<n&&(a-=i*(n-b))):a=i*(n+b),1<i?r=Math.abs(a-b):i<0?r=a/i+Math.abs(a):r+=(b-n)*(1-i),a/=2),e.parallaxScrollDistance=a,l=o?(b-r)/2:(n-r)/2,e.css(e.image.$item,{height:r+"px",marginTop:l+"px",left:"fixed"===e.image.position?t.left+"px":"0",width:t.width+"px"}),e.options.onCoverImage&&e.options.onCoverImage.call(e),{image:{height:r,marginTop:l},container:t}}},{key:"isVisible",value:function(){return this.isElementInViewport||!1}},{key:"onScroll",value:function(e){var t=this,n=t.$item.getBoundingClientRect(),i=n.top,o=n.height,a={},r=n;if(t.options.elementInViewport&&(r=t.options.elementInViewport.getBoundingClientRect()),t.isElementInViewport=0<=r.bottom&&0<=r.right&&r.top<=b&&r.left<=v,e||t.isElementInViewport){var l=Math.max(0,i),s=Math.max(0,o+i),c=Math.max(0,-i),u=Math.max(0,i+o-b),d=Math.max(0,o-(i+o-b)),m=Math.max(0,-i+b-o),p=1-2*(b-i)/(b+o),f=1;if(o<b?f=1-(c||u)/o:s<=b?f=s/b:d<=b&&(f=d/b),"opacity"!==t.options.type&&"scale-opacity"!==t.options.type&&"scroll-opacity"!==t.options.type||(a.transform="translate3d(0,0,0)",a.opacity=f),"scale"===t.options.type||"scale-opacity"===t.options.type){var g=1;t.options.speed<0?g-=t.options.speed*f:g+=t.options.speed*(1-f),a.transform="scale("+g+") translate3d(0,0,0)"}if("scroll"===t.options.type||"scroll-opacity"===t.options.type){var y=t.parallaxScrollDistance*p;"absolute"===t.image.position&&(y-=i),a.transform="translate3d(0,"+y+"px,0)"}t.css(t.image.$item,a),t.options.onScroll&&t.options.onScroll.call(t,{section:n,beforeTop:l,beforeTopEnd:s,afterTop:c,beforeBottom:u,beforeBottomEnd:d,afterBottom:m,visiblePercent:f,fromViewportCenter:p})}}},{key:"onResize",value:function(){this.coverImage(),this.clipContainer()}}]),j);function j(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,j);var n=this;n.instanceID=$++,n.$item=e,n.defaults={type:"scroll",speed:.5,imgSrc:null,imgElement:".jarallax-img",imgSize:"cover",imgPosition:"50% 50%",imgRepeat:"no-repeat",keepImg:!1,elementInViewport:null,zIndex:-100,disableParallax:!1,disableVideo:!1,automaticResize:!0,videoSrc:null,videoStartTime:0,videoEndTime:0,videoVolume:0,videoLoop:!0,videoPlayOnlyVisible:!0,videoLazyLoading:!0,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null};var i=n.$item.dataset||{},o={};
67783if(Object.keys(i).forEach(function(e){var t=e.substr(0,1).toLowerCase()+e.substr(1);t&&void 0!==n.defaults[t]&&(o[t]=i[e])}),n.options=n.extend({},n.defaults,o,t),n.pureOptions=n.extend({},n.options),Object.keys(n.options).forEach(function(e){"true"===n.options[e]?n.options[e]=!0:"false"===n.options[e]&&(n.options[e]=!1)}),n.options.speed=Math.min(2,Math.max(-1,parseFloat(n.options.speed))),"string"==typeof n.options.disableParallax&&(n.options.disableParallax=new RegExp(n.options.disableParallax)),n.options.disableParallax instanceof RegExp){var a=n.options.disableParallax;n.options.disableParallax=function(){return a.test(navigator.userAgent)}}if("function"!=typeof n.options.disableParallax&&(n.options.disableParallax=function(){return!1}),"string"==typeof n.options.disableVideo&&(n.options.disableVideo=new RegExp(n.options.disableVideo)),n.options.disableVideo instanceof RegExp){var r=n.options.disableVideo;n.options.disableVideo=function(){return r.test(navigator.userAgent)}}"function"!=typeof n.options.disableVideo&&(n.options.disableVideo=function(){return!1});var l=n.options.elementInViewport;l&&"object"===(void 0===l?"undefined":c(l))&&void 0!==l.length&&(l=s(l,1)[0]);l instanceof Element||(l=null),n.options.elementInViewport=l,n.image={src:n.options.imgSrc||null,$container:null,useImgTag:!1,position:/iPad|iPhone|iPod|Android/.test(navigator.userAgent)?"absolute":"fixed"},n.initImg()&&n.canInitParallax()&&n.init()}function E(e,t){("object"===("undefined"==typeof HTMLElement?"undefined":c(HTMLElement))?e instanceof HTMLElement:e&&"object"===(void 0===e?"undefined":c(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)&&(e=[e]);for(var n=t,i=Array.prototype.slice.call(arguments,2),o=e.length,a=0,r=void 0;a<o;a++)if("object"===(void 0===n?"undefined":c(n))||void 0===n?e[a].jarallax||(e[a].jarallax=new S(e[a],n)):e[a].jarallax&&(r=e[a].jarallax[n].apply(e[a].jarallax,i)),void 0!==r)return r;return e}E.constructor=S,I.default=E}).call(this,P(5))},function(e,t,n){"use strict";var i=n(15),o=i.requestAnimationFrame||i.webkitRequestAnimationFrame||i.mozRequestAnimationFrame||function(e){var t=+new Date,n=Math.max(0,16-(t-a)),i=setTimeout(e,n);return a=t,i},a=+new Date;var r=i.cancelAnimationFrame||i.webkitCancelAnimationFrame||i.mozCancelAnimationFrame||clearTimeout;Function.prototype.bind&&(o=o.bind(i),r=r.bind(i)),(e.exports=o).cancel=r},function(n,e,t){"use strict";(function(e){var t;t="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n.exports=t}).call(this,t(5))}]); 67784if($('.parallax-feature-block .featuredBlock').length) { 67785$('.parallax-feature-block .featuredBlock').jarallax({ 67786 speed: -1 67787}); 67788} 67789 67790$(function() { 67791 if($(window).width() > 991){ 67792 $('.assetContent-trans .asset-txt-content_left').each(function(){ 67793 var new_count =$(this).find('li').length; 67794 if(new_count > 3){ 67795 $(this).find('ul li:gt(2)').hide(); 67796 var blockbgColor = $('.assetContent-trans .asset-txt').css( "background-color" ); 67797 $('#trigger_featuredModal .modal-content').css('background-color',blockbgColor); 67798 $(this).find('.view_morelink').show(); 67799 $('.view_morelink').on('click',function(){ 67800 $('#trigger_featuredModal .modal-body ul li').remove(); 67801 var modal_title = $(this).siblings('h1').text(); 67802 var completelinks = $(this).prev('ul').html(); 67803 $('#trigger_featuredModal .modal-header h4').text(modal_title); 67804 $('#trigger_featuredModal .modal-body ul').append(completelinks); 67805 $('#trigger_featuredModal .modal-body li').show(); 67806 }) 67807 67808 } 67809 }) 67810 } 67811 if($(window).width() > 1400){ 67812 $('#trigger_featuredModal .modal-dialog').css('width','75%'); 67813 } 67814}) 67815 67816$(function() { 67817 67818 let imageCarousalView = function(element) { 67819 this.icComp = $(element); 67820 } 67821 67822 imageCarousalView.prototype.init = function() { 67823 if (this.icComp.length) { 67824 this.initImageCarousal(); 67825 this.bindEvents(); 67826 } 67827 } 67828 67829 imageCarousalView.prototype.bindEvents = function() { 67830 let self = this; 67831 this.icComp.on('click', '.carsl-item', $.proxy(this.carousalItemClickHandler, this)); 67832 this.icComp.on('click', '.main-image .play-icon', $.proxy(this.playIconClickHandler, this)); 67833 this.icComp.on('click', '.model .close-btn', $.proxy(this.modelCloseClickHandler, this)); 67834 } 67835 67836 imageCarousalView.prototype.carousalItemClickHandler = function(evnt) { 67837 let el = $(evnt.currentTarget); 67838 let self = this; 67839 let thumbnailEl = $(el).find('.thumb'); 67840 if ($(el).find('.play-icon').length) { 67841 self.icComp.find('.main-image img').attr({ 67842 'src': '' 67843 }); 67844 self.icComp.find('.main-image img').attr({ 67845 'src': thumbnailEl.attr('src'), 67846 'alt': thumbnailEl.attr('alt'), 67847 'video-path': thumbnailEl.attr('data-file-src') 67848 }); 67849 self.icComp.find('.main-image .play-icon').show(); 67850 } else { 67851 self.icComp.find('.main-image img').attr({ 67852 'src': '' 67853 }); 67854 self.icComp.find('.main-image img').attr({ 67855 'src': thumbnailEl.attr('data-file-src'), 67856 'alt': thumbnailEl.attr('alt') 67857 }); 67858 self.icComp.find('.main-image .play-icon').hide(); 67859 } 67860 } 67861 67862 imageCarousalView.prototype.playIconClickHandler = function() { 67863 this.icComp.find('.model video').attr('src', this.icComp.find('.main-image img').attr('video-path')); 67864 this.icComp.find('.model').show(); 67865 } 67866 67867 imageCarousalView.prototype.modelCloseClickHandler = function() { 67868 this.icComp.find('.model').hide(); 67869 this.icComp.find('.model video').attr('src', ''); 67870 } 67871 67872 imageCarousalView.prototype.initImageCarousal = function() { 67873 let self = this; 67874 $(this.icComp.find('.img-wraps')).slick({ 67875 dots: false, 67876 infinite: false, 67877 speed: 300, 67878 slidesToShow: 5, 67879 slidesToScroll: 5, 67880 responsive: [{ 67881 breakpoint: 1290, 67882 settings: { 67883 slidesToShow: 4, 67884 slidesToScroll: 4, 67885 infinite: true, 67886 67887 } 67888 }, 67889 { 67890 breakpoint: 1024, 67891 settings: { 67892 slidesToShow: 4, 67893 slidesToScroll: 4, 67894 infinite: true, 67895 67896 } 67897 }, 67898 67899 { 67900 breakpoint: 576, 67901 settings: { 67902 slidesToShow: 4, 67903 slidesToScroll: 4 67904 } 67905 }, 67906 { 67907 breakpoint: 480, 67908 settings: { 67909 slidesToShow: 3, 67910 slidesToScroll: 3 67911 } 67912 }, 67913 { 67914 breakpoint: 300, 67915 settings: { 67916 slidesToShow: 2, 67917 slidesToScroll: 2 67918 } 67919 } 67920 67921 ] 67922 }); 67923 setTimeout(function() { 67924 $(self.icComp.find(".slick-slide[data-slick-index='0']")).trigger('click'); 67925 $(self.icComp.find(".slick-slide[data-slick-index='0']")).find(".carsl-item").trigger('click'); 67926 self.icComp.find('.main-image img').show(); 67927 self.icComp.find('.img-wraps').css('visibility', 'visible'); // Ensure thumbnails are visible 67928 self.icComp.find('.img-wraps').slick('setPosition'); // Recalculate slick position to fix hidden CSS 67929 67930 // Inject additional styles 67931 $("<style>") 67932 .prop("type", "text/css") 67933 .html(` 67934 .tab-content-wrapper .slick-track { width: 432px !important; } 67935 .tab-content-wrapper .carsl-item { width: 108px !important; } 67936 `) 67937 .appendTo("head"); 67938 }, 500) 67939 } 67940 67941 $('.image-carousal-view').each(function() { 67942 let icvComp = new imageCarousalView(this); 67943 icvComp.init(); 67944 }); 67945 67946 // Ensure no interference between carousels 67947 $('.image-carousal-view .img-wraps').each(function() { 67948 $(this).css('visibility', 'hidden'); // Hide initially to avoid conflicts 67949 }); 67950 67951 67952 67953}) 67954 67955//new WOW().init(); 67956 67957$(function () { 67958 var featured_ctas = function (cl) { 67959 67960 this.el = $($('.' + cl)[0]); 67961 this.accID = this.el.find('.grt-buy-btn').attr('data-ps-account'); 67962 67963 if(this.accID){ 67964 var metaTag = '<meta name="ps-account" content="'+this.accID+'">'; 67965 $('head').find("[name='ps-account']").remove(); 67966 $('head').append(metaTag); 67967 } 67968 67969 }; 67970 67971 $.each($('.gs_featuredWithCTA_block'), function (i, v) { 67972 $(v).addClass("gs_featured-" + i); 67973 (new featured_ctas("gs_featured-" + i)); 67974 }); 67975 67976}); 67977 67978$(function() { 67979 /*Featured Resources component*/ 67980 var frComponent = function(compId) { 67981 67982 this.frComp = $($('.'+compId)[0]); 67983 67984 if (this.frComp.length > 0) { 67985 this.rfContainer = this.frComp.find('#rf-content-wrapper'); 67986 this.blockView = true; 67987 this.searchResultsContainer = this.frComp.find('#search-results-container'); 67988 this.fieldObj = this.rfContainer.attr('data-fields-obj') ? JSON.parse(this.rfContainer.attr('data-fields-obj')) : undefined; 67989 this.buParam = this.rfContainer.attr('data-buParam'); 67990 this.resData = []; 67991 this.anonymousUser = true; 67992 let downloadCartEL = $(".cmp-featured-resources .dn-cart-container"); 67993 let rcDownloadCartEl = $(".cmp-resFinder .dn-cart-container"); 67994 67995 if(rcDownloadCartEl && rcDownloadCartEl.length > 0){ 67996 downloadCartEL.remove(); 67997 this.downloadCartEL = rcDownloadCartEl; 67998 }else if(downloadCartEL && downloadCartEL.length > 1){ 67999 downloadCartEL.not(downloadCartEL[0]).remove(); 68000 this.downloadCartEL = downloadCartEL[0]; 68001 }else{ 68002 this.downloadCartEL = downloadCartEL; 68003 } 68004 68005 68006 } 68007 68008 68009 }; 68010 68011 /*To bind events with handlers*/ 68012 68013 frComponent.prototype.bindEvents = function() { 68014 var self = this; 68015 this.frComp.on('click', '.play-icon, [data-type="video"]', $.proxy(this.playBtnClickHandler, this)); 68016 this.frComp.on('click', '#model-close, .model-bg', $.proxy(this.modelCloseBtnClickHandler, this)); 68017 this.frComp.on('click', '.lock-screen, .hor-lock-screen', $.proxy(this.signInLinkClickHandler, this)); 68018 this.frComp.on('click', '.select-res', $.proxy(this.addDocsToDownloadQueue, this)); 68019 this.frComp.on('click', '.dn-cart-container', $.proxy(this.downloadZipClickHandler, this)); 68020 68021 }; 68022 68023 68024 /*To remove data from html attributes*/ 68025 68026 frComponent.prototype.removeData = function() { 68027 this.rfContainer.removeAttr('data-fields-obj'); 68028 }; 68029 68030 /*To intiate component execution*/ 68031 frComponent.prototype.init = function() { 68032 if (this.frComp.length > 0 && this.fieldObj) { 68033 this.removeData(); 68034 this.bindEvents(); 68035 this.frComp.find(".headline").show(); 68036 this.checkUserLogin(this.fetchData); 68037 68038 } 68039 68040 }; 68041 68042 /*To check for user login*/ 68043 frComponent.prototype.checkUserLogin = function(callback) { 68044 var self = this; 68045 68046 $.ajax({ 68047 type: "GET", 68048 url: "/dupont/userService", 68049 dataType: "json", 68050 contentType: "application/json", 68051 cache: false, 68052 success: function(data) { 68053 68054 if (data.anonymousUser == false) { 68055 self.anonymousUser = false;
68056 } 68057 callback(self, data); 68058 }, 68059 error: function(data) { 68060 console.log("Error in user login service::" + data); 68061 callback(self, data); 68062 } 68063 68064 }); 68065 }; 68066 68067 68068 /*To check fro user login*/ 68069 frComponent.prototype.fetchData = function(self, data) { 68070 self.resourceDataCall = 0; 68071 68072 self.getResourcesData(self.resourcesPaths, self.initiateExecution, data); 68073 68074 }; 68075 68076 /*To initiate execution*/ 68077 frComponent.prototype.initiateExecution = function(self) { 68078 self.displayResults(); 68079 self.setSignInLinks(); 68080 }; 68081 68082 68083 68084 /*To fetch resources data*/ 68085 68086 frComponent.prototype.getResourcesData = function(resPaths, callback, data) { 68087 68088 var tags = []; 68089 var self = this; 68090 var user = (data.anonymousUser == true) ? false : true; 68091 var listType = this.fieldObj.listType; 68092 self.resourceDataCall++ ; 68093 68094 $.ajax({ 68095 68096 url: "/dupont/getResourcesData", 68097 dataType: "json", 68098 cache: false, 68099 data: { 68100 searchPath: this.fieldObj.resPaths, 68101 anonymousUser: user, 68102 sortType: this.fieldObj.sortResults, 68103 listType: listType, 68104 filterTags: (this.fieldObj.filterTags.length ? this.fieldObj.filterTags : []), 68105 filterLogic: this.fieldObj.filterLogic, 68106 maxCountResources: [4,4,4,4] 68107 68108 }, 68109 success: function(result) { 68110 68111 if(result.resourcesData.length>0){ 68112 68113 if(self.fieldObj.sortResults == 'title'){ 68114 self.resData = result.resourcesData.sort(self.sortByTitle); 68115 }else{ 68116 self.resData = result.resourcesData.sort(self.sortByLastModified); 68117 } 68118 68119 if(self.resData.length > 4){ 68120 self.resData = self.resData.slice(0,4); 68121 } 68122 }else{ 68123 self.frComp.hide(); 68124 } 68125 68126 68127 callback(self); 68128 68129 }, 68130 error: function(e) { 68131 console.log("Error in Resources service call", e) 68132 if(self.resourceDataCall == 1){ 68133 self.getResourcesData(self.resourcesPaths, callback, data); 68134 }else{ 68135 68136 callback(self); 68137 self.frComp.hide(); 68138 } 68139 // callback(self); 68140 } 68141 }); 68142 68143 68144 68145 }; 68146 68147 /*Create a list of doucments which are to be downloaded*/ 68148 frComponent.prototype.addDocsToDownloadQueue = function(evnt) { 68149 let el = $(evnt.currentTarget); 68150 let docPath = el.attr('href'); 68151 evnt.preventDefault(); 68152 let downloadCartEL = $(this.downloadCartEL); 68153 68154 if(!el.hasClass('selected')){ 68155 el.addClass('selected'); 68156 if(!rcDownloadDocsList.includes(docPath)){ 68157 rcDownloadDocsList.push(docPath); 68158 } 68159 68160 }else{ 68161 el.removeClass('selected'); 68162 rcDownloadDocsList.splice(rcDownloadDocsList.indexOf(docPath), 1); 68163 68164 } 68165 68166 downloadCartEL.find('.file-count').text(rcDownloadDocsList.length); 68167 (rcDownloadDocsList.length > 0) ? downloadCartEL.show() : downloadCartEL.hide(); 68168 68169 } 68170 68171 68172 frComponent.prototype.setSignInLinks = function() { 68173 var signUpEl = this.frComp.find('.sign-up'); 68174 var signInEl = this.frComp.find('.sign-in'); 68175 var signInLink = signInEl.attr('href'); 68176 signInEl.attr('href',signInLink+'#ret-page-url='+encodeURIComponent(window.location.href)); 68177 if(this.buParam){ 68178 var signupLink = signUpEl.attr('href'); 68179 signUpEl.attr('href',signupLink+'?BU='+this.buParam); 68180 } 68181 68182 }; 68183 68184 frComponent.prototype.signInLinkClickHandler = function(evnt) { 68185 this.frComp.find('#signin-model').show(); 68186 }; 68187 68188 frComponent.prototype.downloadZipClickHandler = function(evnt) { 68189 let downloadCartEL = $(this.downloadCartEL); 68190 if(!downloadCartEL.find('.doc-loader').hasClass('show')){ 68191 rc_Download_Zip(rcDownloadDocsList); 68192 downloadCartEL.find('.doc-loader').addClass('show'); 68193 } 68194 }; 68195 68196 68197 68198 frComponent.prototype.modelCloseBtnClickHandler = function(event) { 68199 68200 this.frComp.find('#video-model').hide(); 68201 this.frComp.find('#vid-container video').attr('src',''); 68202 this.frComp.find('.model-bg').hide(); 68203 68204 }; 68205 68206 68207 frComponent.prototype.playBtnClickHandler = function(event) { 68208 68209 var el = $(event.currentTarget); 68210 if(el.attr('data-type') =="video"){ 68211 var src = el.attr('href'); 68212 event.preventDefault(); 68213 }else{ 68214 var src = el.siblings('video').attr('src'); 68215 } 68216 68217 this.frComp.find('#vid-container video').attr('src', src); 68218 this.frComp.find('#video-model').show(); 68219 68220 }; 68221 68222 68223 /*To manage matching results display in search results block */ 68224 frComponent.prototype.displayResults = function() { 68225 68226 var resDataList = this.resData; 68227 this.clearResults(); 68228 this.showResults(resDataList); 68229 68230 }; 68231 68232 68233 /*To clear results from search results block*/ 68234 frComponent.prototype.clearResults = function() { 68235 this.searchResultsContainer.html(''); 68236 }; 68237 68238 // To sort array by title 68239 frComponent.prototype.sortByTitle = function(a, b) { 68240 var titleA = a.title.trim().toUpperCase(); // ignore upper and lowercase 68241 var titleB = b.title.trim().toUpperCase(); // ignore upper and lowercase 68242 if (titleA < titleB) { 68243 return -1; 68244 } 68245 if (titleA > titleB) { 68246 return 1; 68247 } 68248 68249 // names must be equal 68250 return 0; 68251 }; 68252 68253 // To sort array by lastModified Date 68254 frComponent.prototype.sortByLastModified = function(a, b) { 68255 68256 return new Date(b.lastmodified) - new Date(a.lastmodified); 68257 }; 68258 68259 /*To show results in search results block*/ 68260 frComponent.prototype.showResults = function(searchResults) { 68261 var self = this; 68262 68263 $.each(searchResults, function(ind, val) { 68264 var htmlElmnt = ''; 68265 var path = val.path; 68266 var iconClass = ''; 68267 var thumbPath = val.path; 68268 thumbPath = thumbPath.replace(/\(/g, '\\('); 68269 thumbPath = thumbPath.replace(/\)/g, "\\)"); 68270 thumbPath = thumbPath.replace(/ /g, "%20"); 68271 var lastindex = path.lastIndexOf('/'); 68272 var fileName = lastindex > -1 ? path.substr(lastindex+1, path.length): ""; 68273 68274 if (val.format == 'cq:page') { 68275 var pathtype = "page"; 68276 68277 if (path.indexOf('.html') < 0) { 68278 path = path + '.html'; 68279 } 68280 68281 68282 if ((val.path.indexOf('/secure/') > -1) || (val.path.indexOf('/secured/') > -1)) { 68283 68284 if (self.anonymousUser == true) { 68285 68286 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div><div class="lock-screen" data-file-name="'+fileName+'"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + '<span>' + Granite.I18n.get("To Unlock") + '</span></span></div> </div><div class="page-name"> <span data-type= ' + pathtype + '>' + val.title + '</span></div></div> '; 68287 68288 } else { 68289 68290 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> <div class="unlock-icon"></div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + '>' + val.title + '</a></div></div> '; 68291 68292 } 68293 68294 }
68294 else if (val.path.indexOf('/validated/') > -1) { 68295 68296 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-3 validated"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + '>' + val.title + '</a></div></div> '; 68297 68298 68299 }else { 68300 68301 htmlElmnt += '<div class="res-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img page"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div><div class="page-name"> <a href="' + path + '" target="_blank" data-type= ' + pathtype + '>' + val.title + '</a></div></div> '; 68302 68303 } 68304 68305 68306 } else if (val.format.indexOf('image') > -1) { 68307 68308 68309 if (val.path.indexOf('/secure/') > -1) { 68310 68311 if (self.anonymousUser == true) { 68312 68313 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img"> <div class="thumb-img"> </div> <div class="lock-screen" data-file-name="'+fileName+'"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + '<span>' + Granite.I18n.get("To Unlock") + '</span></span> </div></div> <div class="img-name">' + val.title + '</div> </div> '; 68314 68315 } else { 68316 68317 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> <div class="unlock-icon"></div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> '; 68318 68319 } 68320 68321 } else if (val.path.indexOf('/validated/') > -1) { 68322 68323 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-3 validated"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> '; 68324 68325 68326 } else { 68327 68328 htmlElmnt += '<div class="image-list block-view col-sm-6 col-md-4 col-lg-3"> <div class="bg-img"> <div class="thumb-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div> <div class="img-name">' + val.title + '</div> <div class="img-download"><a href="' + val.path + '" data-type="image" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> '; 68329 68330 68331 } 68332 68333 68334 } else if (val.format.indexOf('video') > -1) { 68335 68336 68337 if (val.path.indexOf('/secure/') > -1) { 68338 68339 if (self.anonymousUser == true) { 68340 68341 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-3"> <video poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="lock-screen" data-file-name="'+fileName+'"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span> </div> <div class="vid-name-container top-set"> <span class="vid-name" >' + val.title + '</span></div></div> '; 68342 68343 } else { 68344 68345 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-3"> <video src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="unlock-icon"></div><div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div> </div> '; 68346 68347 } 68348 68349 }
68349 else if (val.path.indexOf('/validated/') > -1) { 68350 68351 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-3 validated"> <video src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div></div> '; 68352 68353 68354 } 68355 else { 68356 68357 htmlElmnt += '<div class="video-list block-view col-sm-6 col-md-4 col-lg-3"> <video src="' + val.path + '" poster="' + val.path + '.thumb.319.319.png' + '"> </video> <div class="play-icon"></div> <div class="vid-name-container ul-top-set"> <a class="vid-name" href="' + val.path + '" data-type="video" download>' + val.title + '</a></div></div> '; 68358 68359 68360 } 68361 68362 } else { 68363 var isDoc = true; 68364 var tagsString = val.tags.toString().toLowerCase(); 68365 var dataType = "document"; 68366 var showIFUClass = ""; 68367 if (val.format.indexOf('pdf') > -1) { 68368 iconClass = 'pdf'; 68369 } else if (val.format.indexOf('presentation') > -1) { 68370 iconClass = 'ppt'; 68371 } else if (val.format.indexOf('sheet') > -1) { 68372 iconClass = 'sheet'; 68373 } else if (val.format.indexOf('document') > -1 || val.format.indexOf('msword') > -1) { 68374 iconClass = 'doc'; 68375 } 68376 else if (val.format.indexOf('zip') > -1) { 68377 iconClass = 'zip'; 68378 isDoc = false; 68379 } 68380 else if (val.format.indexOf('exe') > -1) { 68381 iconClass = 'exe'; 68382 isDoc = false; 68383 } 68384 68385 68386 if (val.path.indexOf('/secure/') > -1) { 68387 68388 if (self.anonymousUser == true) { 68389 68390 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-3"><a data-type="'+dataType+'"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> <div class="lock-screen" data-file-name="'+fileName+'"> <div class="lock-icon"></div><span class="sign-in-link">' + Granite.I18n.get("Sign In/Register") + ' <span>' + Granite.I18n.get("To Unlock") + '</span></span></div> </div></a><div class="res-name">' + val.title + '</div> </div> '; 68391 } else { 68392 68393 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-3"><a href="' + path + '" target="_blank" data-type="'+dataType+'"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="unlock-icon"></div><div class="res-name">' + val.title + '</div> <div class="res-download"><a href="' + path + '" data-type="'+dataType+'" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> '; 68394 68395 } 68396 68397 } else if (val.path.indexOf('/validated/') > -1) { 68398 68399 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-3 validated"><a href="' + path + '" target="_blank" data-type="'+dataType+'"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="res-name">' + val.title + '</div> <div class="res-download"><a href="' + path + '" data-type="'+dataType+'" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> '; 68400 68401 68402 }else { 68403 68404 htmlElmnt += '<div class="res-list doc-list block-view col-sm-6 col-md-4 col-lg-3"><a href="' + path + '" target="_blank" data-type="'+dataType+'"> <div class="bg-img ' + iconClass + '"><div class="res-img" style="background-image:url(' + thumbPath + '.thumb.319.319.png' + ') "> </div> </div></a><div class="res-name">' + val.title + '</div> <div class="res-download"><a href="' + path + '" data-type="'+dataType+'" class="select-res"><div class="dn-icon"></div><span>' + Granite.I18n.get("download") + ' </span></a></div></div> '; 68405 68406 } 68407 68408 68409 } 68410 68411 self.searchResultsContainer.append(htmlElmnt); 68412 68413 }); 68414 68415 68416 if (this.blockView) { 68417 this.searchResultsContainer.find('.block-view').show(); 68418 } 68419 68420 68421 }; 68422 68423 68424 $.each($('.cmp-featured-resources'),function(i,v) { 68425 $(v).addClass("fr-"+i); 68426 (new frComponent("fr-"+i)).init(); 68427 68428 }); 68429 68430 68431}); 68432 68433$(function () { 68434 $(function () {
68435 if ($('.people-carousel').length < 1) { 68436 return; 68437 } 68438 68439 $('.people-carousel').slick({ 68440 speed: 100, 68441 arrows: false, 68442 cssEase: 'linear', 68443 slidesToShow: 1, 68444 slidesToScroll: 1, 68445 draggable: true, 68446 swipe: true 68447 }); 68448 }); 68449}); 68450 68451$(function() { 68452 68453 /*FAQ preview component*/ 68454 var faqPreviewComponent = function(compId) { 68455 68456 this.faqPrevComp = $($('.'+compId)[0]); 68457 68458 if (this.faqPrevComp.length > 0) { 68459 this.rfpWrapper = this.faqPrevComp.find('.rfp-wrapper'); 68460 this.cfPaths = (JSON.parse(this.rfpWrapper.attr('data-attr-faqPaths'))); 68461 this.countryTag = this.rfpWrapper.attr('data-attr-countryTag'); 68462 this.filterTags = (JSON.parse(this.rfpWrapper.attr('data-attr-filterTags'))); 68463 this.sortResultsType = this.rfpWrapper.attr('data-attr-sortType'); 68464 this.maxResultsCount = this.rfpWrapper.attr('data-attr-maxCount'); 68465 this.resourcesData = []; 68466 this.searchResultsContainer = this.faqPrevComp.find('.results-wrapper'); 68467 this.anonymousUser = true; 68468 this.faqData = []; 68469 faqPrevDataObj = undefined; 68470 //delete faqPrevDataObj; 68471 } 68472 68473 }; 68474 68475 /*To bind events with handlers*/ 68476 68477 faqPreviewComponent.prototype.bindEvents = function() { 68478 68479 this.faqPrevComp.on('click','.faq-wrap>.acc-head', $.proxy(this.accordionClickHandler, this)); 68480 this.faqPrevComp.on('click', '.hor-lock-screen', $.proxy(this.signInLinkClickHandler, this)); 68481 this.faqPrevComp.on('click', '.model-close-btn', $.proxy(this.modelCloseBtnClickHandler, this)); 68482 68483 }; 68484 68485 68486 /*To intiate component execution*/ 68487 faqPreviewComponent.prototype.init = function() { 68488 68489 if (this.faqPrevComp.length > 0) { 68490 this.loader(true); 68491 this.checkUserLogin(this.fetchData); 68492 68493 } 68494 68495 }; 68496 68497 68498 /*To check fro user login*/ 68499 faqPreviewComponent.prototype.fetchData = function(self, data) { 68500 68501 self.getCFsData(self.cfPaths, self.initiateExecution, data); 68502 }; 68503 68504 68505 /*To intiate component execution*/ 68506 faqPreviewComponent.prototype.initiateExecution = function(self) { 68507 68508 self.loader(false); 68509 self.removeData(); 68510 self.bindEvents(); 68511 self.setSignInLinks(); 68512 self.displayResults(); 68513 68514 }; 68515 68516 /*To remove data from html attributes*/ 68517 68518 faqPreviewComponent.prototype.removeData = function() { 68519 this.rfpWrapper.removeAttr('data-attr-faqPaths'); 68520 this.rfpWrapper.removeAttr('data-attr-countryTag'); 68521 this.rfpWrapper.removeAttr('data-attr-filterTags'); 68522 this.rfpWrapper.removeAttr('data-attr-sortType'); 68523 this.rfpWrapper.removeAttr('data-attr-maxCount'); 68524 }; 68525 68526 /*To check for user login*/ 68527 faqPreviewComponent.prototype.checkUserLogin = function(callback) { 68528 var self = this; 68529 68530 $.ajax({ 68531 type: "GET", 68532 url: "/dupont/userService", 68533 dataType: "json", 68534 contentType: "application/json", 68535 success: function (data) { 68536 68537 if(data.anonymousUser == false) { 68538 self.anonymousUser = false; 68539 } 68540 callback(self, data); 68541 }, 68542 error: function (data) { 68543 console.log("Error in user login service::"+data); 68544 callback(self, data); 68545 } 68546 68547 }); 68548 }; 68549 68550 /*To fetch faq content fragments data*/ 68551 faqPreviewComponent.prototype.getCFsData = function(cfPaths, callback, data) { 68552 68553 var tags=[]; 68554 var self = this; 68555 var user = (data.anonymousUser == true) ? false : true; 68556 68557 if(this.countryTag){ 68558 tags.push(this.countryTag); 68559 } 68560 68561 if(this.filterTags.length>0){ 68562 68563 for(var i=0; i<this.filterTags.length; i++){ 68564 68565 tags.push(this.filterTags[i]); 68566 } 68567 } 68568 68569 68570 $.ajax({ 68571 68572 url: "/dupont/getFAQData", 68573 dataType:"json", 68574 data: {searchPath:cfPaths, filterTags:tags, locale:this.pageLocale, anonymousUser:user, sortType: this.sortResultsType, maxCount:this.maxResultsCount, tagTitlesMapping: false}, 68575 success: function(result){ 68576 68577 self.faqData = result.faqData; 68578 callback(self); 68579 }, 68580 error: function(e){ 68581 console.log("Error in FAQ service call",e) 68582 callback(self); 68583 } 68584 }); 68585 68586 68587 68588 }; 68589 68590 /*To set sign in and sign up links based on URL parameters*/ 68591 68592 faqPreviewComponent.prototype.setSignInLinks = function() { 68593 var signInEl = this.faqPrevComp.find('.sign-in'); 68594 var signInLink = signInEl.attr('href'); 68595 signInEl.attr('href',signInLink+'#ret-page-url='+encodeURIComponent(window.location.href)); 68596 68597 }; 68598 68599 /*To show loader*/ 68600 faqPreviewComponent.prototype.loader = function(show) { 68601 68602 var loaderEl = this.faqPrevComp.find('#loader-screen-fp'); 68603 68604 if(show){ 68605 loaderEl.addClass('show'); 68606 }else{ 68607 loaderEl.removeClass('show'); 68608 } 68609 }; 68610 68611 faqPreviewComponent.prototype.signInLinkClickHandler = function(evnt) { 68612 68613 this.faqPrevComp.find('#signin-model').show(); 68614 }; 68615 68616 faqPreviewComponent.prototype.modelCloseBtnClickHandler = function(event) { 68617 68618 this.faqPrevComp.find('.model-bg').hide(); 68619 68620 }; 68621
68622 faqPreviewComponent.prototype.accordionClickHandler = function(evnt) { 68623 68624 var el = $(evnt.currentTarget); 68625 var faqEl = el.parent(); 68626 68627 if(!faqEl.siblings('.hor-lock-screen').length > 0){ 68628 68629 if(faqEl.hasClass('isLink')){ 68630 68631 var href = el.find('.q-text>a').attr('href'); 68632 window.open(href,"_self"); 68633 68634 }else{ 68635 68636 if(faqEl.hasClass('expanded')){ 68637 faqEl.removeClass('expanded'); 68638 68639 }else{ 68640 var path = faqEl.attr('data-faq-path'); 68641 var answerEl = el.siblings('.acc-content').find('.a-content'); 68642 var faq = (this.faqData.filter(function(item) { 68643 return item.path == path; 68644 }))[0]; 68645 68646 if(answerEl.text().trim()==''){ 68647 answerEl.html(faq.answer); 68648 } 68649 faqEl.addClass('expanded'); 68650 } 68651 } 68652 } 68653 }; 68654 68655 68656 /*To manage matching results display in search results block */ 68657 faqPreviewComponent.prototype.displayResults = function() { 68658 68659 var resDataList = this.faqData; 68660 this.clearResults(); 68661 this.showResults(resDataList); 68662 68663 }; 68664 68665 68666 /*To clear results from search results block*/ 68667 faqPreviewComponent.prototype.clearResults = function() { 68668 this.searchResultsContainer.html(''); 68669 }; 68670 68671 68672 /*To show results in search results block*/ 68673 faqPreviewComponent.prototype.showResults = function(searchResults) { 68674 68675 var self = this; 68676 68677 $.each(searchResults, function(ind, val) { 68678 var htmlElmnt = ''; 68679 var path = val.path; 68680 var iconClass = ''; 68681 68682 68683 if (val.format.indexOf('content-fragment') > -1) { 68684 68685 var linkClass = ''; 68686 68687 if (val.url.trim() != '') { 68688 linkClass = 'isLink'; 68689 } else { 68690 linkClass = ''; 68691 } 68692 68693 68694 if (val.path.indexOf('/secure/') > -1) { 68695 68696 if (self.anonymousUser == true) { 68697 68698 htmlElmnt += '<div class="faq-list col-12"><div class="faq-wrap locked ' + linkClass + '" data-faq-path="' + val.path + '"><div class="acc-head"><span class="q-icon">Q</span><span class="q-text"></span><span class="acc-icon"></span></div><div class="acc-content"><span class="a-icon">A</span><span class="a-text"><span class="a-content"></span></span></div></div> <div class="hor-lock-screen"><div class="hor-lock-icon"></div><span class="hor-sign-in-link">' + Granite.I18n.get("Sign In/Register") + '<span>' + Granite.I18n.get("To Unlock") + '</span></span></div></div>'; 68699 68700 } else { 68701 68702 htmlElmnt += '<div class="faq-list col-12"><div class="faq-wrap ' + linkClass + '" data-faq-path="' + val.path + '"><div class="acc-head"><span class="q-icon">Q</span><span class="q-text"></span> <div class="hor-unlock-icon"></div><span class="acc-icon"></span></div><div class="acc-content"><span class="a-icon">A</span><span class="a-text"><span class="a-content"></span></span></div></div> </div>'; 68703 68704 } 68705 68706 } else { 68707 68708 htmlElmnt += '<div class="faq-list col-12"><div class="faq-wrap ' + linkClass + '" data-faq-path="' + val.path + '"><div class="acc-head"><span class="q-icon">Q</span><span class="q-text"></span><span class="acc-icon"></span></div><div class="acc-content"><span class="a-icon">A</span><span class="a-text"><span class="a-content"></span></span></div></div> </div>'; 68709 68710 } 68711 68712 self.searchResultsContainer.append(htmlElmnt); 68713 68714 $("[data-faq-path='" + val.path + "']").find('.q-text').html(val.title); 68715 68716 68717 } 68718 68719 }); 68720 68721 }; 68722 68723 68724 $.each($('.cmp-faq-preview'),function(i,v) { 68725 $(v).addClass("faqp-"+i); 68726 (new faqPreviewComponent("faqp-"+i)).init(); 68727 68728 }); 68729 68730 68731}); 68732 68733 68734function FAQAccordion(element) { 68735 this.element = $(element); 68736 this.init(); 68737} 68738 68739FAQAccordion.prototype.init = function() { 68740 let self = this; 68741 this.element.find('.faq-acc-head').click(function(event) { 68742 self.handleClick(event); 68743 }); 68744}; 68745 68746FAQAccordion.prototype.handleClick = function(event) { 68747 let title_href_val = $(event.currentTarget).attr('href'); 68748 68749 if (title_href_val === '' || title_href_val === '#' || title_href_val === undefined) { 68750 event.preventDefault(); 68751 let isActive = $(event.currentTarget).hasClass('active'); 68752 68753 if (!this.element.hasClass('multiple-expand')) { 68754 $(event.currentTarget).parent().siblings().find('> .faq-acc-panel').slideUp(); 68755 $(event.currentTarget).parent().siblings().find('> .faq-acc-head').removeClass('active'); 68756 } 68757 68758 if (isActive) { 68759 $(event.currentTarget).removeClass('active'); 68760 $(event.currentTarget).parent().find('> .faq-acc-panel').slideUp(); 68761 } else { 68762 $(event.currentTarget).addClass('active'); 68763 $(event.currentTarget).parent().find('> .faq-acc-panel').slideDown(); 68764 } 68765 68766 if ($(event.currentTarget).hasClass('active')) { 68767 $(document).trigger('nested-accordion-opened'); 68768 } 68769 } 68770 68771 if ($(event.currentTarget).find('> .acc-title-desc').hasClass('link')) { 68772 $(event.currentTarget).siblings('.faq-acc-panel').hide(); 68773 } 68774}; 68775FAQAccordion.prototype.addPagination = function() { 68776 let self = this; 68777 let itemsPerPage = 5; 68778 let items = this.element.find('.accordion_acc'); 68779 let numItems = items.length; 68780 let numPages = Math.ceil(numItems / itemsPerPage); 68781 68782 if (numPages <= 1) return; 68783 68784 let pagination = $('<div class="faq-pagination"></div>'); 68785 for (let i = 1; i <= numPages; i++) { 68786 pagination.append('<a href="#" class="faq-page" data-page="' + i + '">' + i + '</a>'); 68787 } 68788 this.element.append(pagination); 68789 68790 items.hide(); 68791 items.slice(0, itemsPerPage).show(); 68792 68793 this.element.find('.faq-page').click(function(event) { 68794 event.preventDefault(); 68795 let page = $(this).data('page'); 68796 let start = (page - 1) * itemsPerPage; 68797 let end = start + itemsPerPage; 68798 68799 items.hide().slice(start, end).show(); 68800 self.element.find('.faq-page').removeClass('active'); 68801 $(this).addClass('active'); 68802 }); 68803 68804 this.element.find('.faq-page').first().addClass('active'); 68805}; 68806 68807FAQAccordion.prototype.addViewMoreButton = function() { 68808 let self = this; 68809 let itemsPerPage = 5; 68810 let items = this.element.find('.accordion_acc'); 68811 let numItems = items.length; 68812 68813 if (numItems <= itemsPerPage) return; 68814 68815 let viewMoreButton = $(`<div class="faq-view-more"><a class="cta">${Granite.I18n.get("View More")}</a><div>`); 68816 this.element.append(viewMoreButton); 68817 68818 let visibleItems = itemsPerPage; 68819 items.slice(visibleItems).hide(); 68820 68821 viewMoreButton.click(function(event) { 68822 event.preventDefault(); 68823 visibleItems += itemsPerPage; 68824 items.slice(0, visibleItems).slideDown(); 68825 68826 if (visibleItems >= numItems) { 68827 viewMoreButton.hide(); 68828 } 68829 }); 68830}; 68831 68832FAQAccordion.prototype.expandAccordions = function() { 68833 if (this.element.hasClass('expand_first')) { 68834 this.element.find('.accordion_acc').first().find('> .faq-acc-head').addClass('active'); 68835 this.element.find('.accordion_acc').first().find('> .faq-acc-panel').slideDown(); 68836 } else if (this.element.hasClass('expand_all')) { 68837 this.element.find('.accordion_acc').find('> .faq-acc-head').addClass('active'); 68838 this.element.find('.accordion_acc').find('> .faq-acc-panel').slideDown(); 68839 } 68840}; 68841 68842 68843FAQAccordion.prototype.init = function() { 68844 let self = this; 68845 this.element.find('.faq-acc-head').click(function(event) { 68846 self.handleClick(event); 68847 }); 68848 this.addViewMoreButton(); 68849 this.expandAccordions(); 68850}; 68851 68852$(document).ready(function() { 68853 $('.faq-accordion-block').each(function() { 68854 new FAQAccordion(this); 68855 }); 68856}); 68857 68858 68859 68860 68861var stopWords= ["a", "a's", "able", "about", "above", "according", "accordingly", "across", "actually", "after", "afterwards", "again", "against", "ain't", "all", "allow", "allows", "almost", "alone", "along", "already", "also", "although", "always", "am", "among", "amongst", "an", "and", "another", "any", "anybody", "anyhow", "anyone", "anything", "anyway", "anyways", "anywhere", "apart", "appear", "appreciate", "appropriate", "are", "aren't", "around", "as", "aside", "ask", "asking", "associated", "at", "available", "away", "awfully", "b", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "believe", "below", "beside", "besides", "best", "better", "between", "beyond", "both", "brief", "but", "by", "c", "c'mon", "c's", "came", "can", "can't", "cannot", "cant", "cause", "causes", "certain", "certainly", "changes", "clearly", "co", "com", "come", "comes", "concerning", "consequently", "consider", "considering", "contain", "containing", "contains", "corresponding", "could", "couldn't", "course", "currently", "d", "definitely", "described", "despite", "did", "didn't", "different", "do", "does", "doesn't", "doing", "don't", "done", "down", "downwards", "during", "e", "each", "edu", "eg", "eight", "either", "else", "elsewhere", "enough", "entirely", "especially", "et", "etc", "even", "ever", "every", "everybody", "everyone", "everything", "everywhere", "ex", "exactly", "example", "except", "f", "far", "few", "fifth", "first", "five", "followed", "following", "follows", "for", "former", "formerly", "forth", "four", "from", "further", "furthermore", "g", "get", "gets", "getting", "given", "gives", "go", "goes", "going", "gone", "got", "gotten", "greetings", "h", "had", "hadn't", "happens", "hardly", "has", "hasn't", "have", "haven't", "having", "he", "he's", "hello", "help", "hence", "her", "here", "here's", "hereafter", "hereby", "herein", "hereupon", "hers", "herself", "hi", "him", "himself", "his", "hither", "hopefully", "how", "howbeit", "however", "i", "i'd", "i'll", "i'm", "i've", "ie", "if", "ignored", "immediate", "in", "inasmuch", "inc", "indeed", "indicate", "indicated", "indicates", "inner", "insofar", "instead", "into", "inward", "is", "isn't", "it", "it'd", "it'll", "it's", "its", "itself", "j", "just", "k", "keep", "keeps", "kept", "know", "known", "knows", "l", "last", "lately", "later", "latter", "latterly", "least", "less", "lest", "let", "let's", "like", "liked", "likely", "little", "look", "looking", "looks", "ltd", "m", "mainly", "many", "may", "maybe", "me", "mean", "meanwhile", "merely", "might", "more", "moreover", "most", "mostly", "much", "must", "my", "myself", "n", "name", "namely", "nd", "near", "nearly", "necessary", "need", "needs", "neither", "never", "nevertheless", "new", "next", "nine", "no", "nobody", "non", "none", "noone", "nor", "normally", "not", "nothing", "novel", "now", "nowhere", "o", "obviously", "of", "off", "often", "oh", "ok", "okay", "old", "on", "once", "one", "ones", "only", "onto", "or", "other", "others", "otherwise", "ought", "our", "ours", "ourselves", "out", "outside", "over", "overall", "own", "p", "particular", "particularly", "per", "perhaps", "placed", "please", "plus", "possible", "presumably", "probably", "provides", "q", "que", "quite", "qv", "r", "rather", "rd", "re", "really", "reasonably", "regarding", "regardless", "regards", "relatively", "respectively", "right", "s", "said", "same", "saw", "say", "saying", "says", "second", "secondly", "see", "seeing", "seem", "seemed", "seeming", "seems", "seen", "self", "selves", "sensible", "sent", "serious", "seriously", "seven", "several", "shall", "she", "should", "shouldn't", "since", "six", "so", "some", "somebody", "somehow", "someone", "something", "sometime", "sometimes", "somewhat", "somewhere", "soon", "sorry", "specified", "specify", "specifying", "still", "sub", "such", "sup", "sure", "t", "t's", "take", "taken", "tell", "tends", "th", "than", "thank", "thanks", "thanx", "that", "that's", "thats", "the", "their", "theirs", "them", "themselves", "then", "thence", "there", "there's", "thereafter", "thereby", "therefore", "therein", "theres", "thereupon", "these", "they", "they'd", "they'll", "they're", "they've", "think", "third", "this", "thorough", "thoroughly", "those", "though", "three", "through", "throughout", "thru", "thus", "to", "together", "too", "took", "toward", "towards", "tried", "tries", "truly", "try", "trying", "twice", "two", "u", "un", "under", "unfortunately", "unless", "unlikely", "until", "unto", "up", "upon", "us", "use", "used", "useful", "uses", "using", "usually", "uucp", "v", "value", "various", "very", "via", "viz", "vs", "w", "want", "wants", "was", "wasn't", "way", "we", "we'd", "we'll", "we're", "we've", "welcome", "well", "went", "were", "weren't", "what", "what's", "whatever", "when", "whence", "whenever", "where", "where's", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which", "while", "whither", "who", "who's", "whoever", "whole", "whom", "whose", "why", "will", "willing", "wish", "with", "within", "without", "won't", "wonder", "would", "wouldn't", "x", "y", "yes", "yet", "you", "you'd", "you'll", "you're", "you've", "your", "yours", "yourself", "yourselves", "z", "zero", "product", "products"] ; 68862var stopChars= ["&", ",", "@", "#", "!", "~", "$", "`", "%", "^", "*","(", ")", "-", "_", "+", "=", "|", ">", "<", "?", "/", ".", ";", ":", "{", "}" ] ; 68863 68864 68865$(function() { 68866 /*FAQ Component*/ 68867 var faqComp = function() { 68868 68869 this.cmpFaq = $($('.cmp-faq')[0]); 68870 68871 if (this.cmpFaq.length > 0) { 68872 68873 this.faqDataObj = faqDataObj; 68874 this.filters = this.faqDataObj.filters; 68875 this.faqList = this.faqDataObj.faqList; 68876 this.tagTitlesMap = this.faqDataObj.tagTitlesMap; 68877 this.dynamicTagsList = this.faqDataObj.dynamicTagsList; 68878 this.searchInput = this.cmpFaq.find('#search-box'); 68879 this.searchInputClearBtn = this.cmpFaq.find('.clear-btn'); 68880 this.searchBtn = this.cmpFaq.find('.search-btn'); 68881 this.searchResultsSection = this.cmpFaq.find('.search-result-block'); 68882 this.resultCountContainer = this.cmpFaq.find('.result-count-wrapper'); 68883 this.searchResultsConatiner = this.cmpFaq.find('.search-results-accordion'); 68884 this.currentCountEl = this.cmpFaq.find('.current-count'); 68885 this.totalCountEl = this.cmpFaq.find('.total-count'); 68886 this.searchVMBtn = this.cmpFaq.find('.search-vm-btn'); 68887 this.filtersContainer = this.cmpFaq.find('.filters-wrapper'); 68888 this.filtersVMBtn = this.cmpFaq.find('.fiters-vm-btn'); 68889 this.filterResultsConatiner = this.cmpFaq.find('.filter-results-accordion'); 68890 this.el = this.cmpFaq.find('.faq-outer-wrapper'); 68891 this.filtertype = this.el.attr('data-attr-filterType'); 68892 this.hideFilters = this.el.attr('data-attr-hideFilters'); 68893 this.noResultText = this.cmpFaq.find('.no-result-text'); 68894 this.filtersNoResultText = this.cmpFaq.find('.filters-no-result-text'); 68895 this.resultPageSize = 10; 68896 this.filterResultPageSize = 10; 68897 faqDataObj = undefined; 68898 //delete faqDataObj; 68899 68900 } 68901 68902 }; 68903 68904 /*To bind events with handlers*/ 68905 68906 faqComp.prototype.bindEvents = function() { 68907 68908 var self = this; 68909 68910 this.searchBtn.on('click', $.proxy(this.searchBtnClickHandler, this));
68911 this.searchInput.keyup($.proxy(this.searchInputChangeEventHandler, this)); 68912 this.searchInputClearBtn.on('click', $.proxy(this.clearBtnClickHandler, this)); 68913 this.searchVMBtn.on('click', $.proxy(this.searchVMBtnClickHandler, this)); 68914 this.cmpFaq.on('click', '.q-text', $.proxy(this.accordionClickHandler, this)); 68915 this.filtersVMBtn.on('click', $.proxy(this.filtersVMBtnClickHandler, this)); 68916 this.cmpFaq.on('click', '.filters', $.proxy(this.filtersClickHandler, this)); 68917 68918 }; 68919 68920 /*To intiate component execution*/ 68921 faqComp.prototype.init = function() { 68922 if (this.cmpFaq.length > 0) { 68923 68924 this.bindEvents(); 68925 68926 this.removeDuplicates(); 68927 68928 if(this.el.attr('data-is-animate')){ 68929 68930 this.scrollTrack(); 68931 } 68932 68933 if(!this.hideFilters){ 68934 this.createFilters(this.filters, this.faqList); 68935 $(this.cmpFaq.find('.filters')[0]).click(); 68936 68937 } 68938 68939 this.initAutocomplete(); 68940 68941 } 68942 68943 }; 68944 68945/*To remove duplicates */ 68946 faqComp.prototype.removeDuplicates = function(event) { 68947 68948 var self = this; 68949 68950 var upList = []; 68951 68952 $.each(self.faqList, function(i,v){ 68953 68954 var found = false; 68955 68956 68957 for (var j=0; j<upList.length; j++){ 68958 68959 if(v.question.toLowerCase() == upList[j].question.toLowerCase()){ 68960 found = true; 68961 break; 68962 } 68963 } 68964 68965 if(!found){ 68966 68967 upList.push(v); 68968 } 68969 68970 }); 68971 68972 this.faqList = upList; 68973 68974 }; 68975 68976 68977 68978/*To handle search input change event.*/ 68979 faqComp.prototype.searchInputChangeEventHandler = function(event) { 68980 68981 if (event.keyCode == 13) { 68982 if (this.searchInput.val()!= '') { 68983 this.uiAutoComplete.hide(); 68984 this.searchBtnClickHandler(); 68985 } 68986 68987 } 68988 }; 68989 68990 faqComp.prototype.accordionClickHandler = function(evnt) { 68991 68992 var targetEl = $(evnt.currentTarget); 68993 targetEl.parent().toggleClass('collapsed'); 68994 68995 }; 68996 68997 faqComp.prototype.searchBtnClickHandler = function() { 68998 68999 var searchText = this.searchInput.val().trim(); 69000 69001 if(searchText.length>2){ 69002 69003 var searchResults = this.findSearchResults(searchText.toLowerCase(), this.faqList); 69004 69005 this.searchResultsSection.show(); 69006 69007 this.searchResultsConatiner.html(''); 69008 69009 this.setTotalResultsCount(searchResults.length); 69010 69011 if (searchResults.length > this.resultPageSize) { 69012 this.pagination(searchResults, 0, this.resultPageSize); 69013 this.togglePagination(true); 69014 69015 } else { 69016 this.togglePagination(false); 69017 this.pagination(searchResults, 0, searchResults.length); 69018 } 69019 69020 69021 $(this.searchResultsConatiner.find('li')[0]).removeClass('collapsed'); 69022 } 69023 69024 }; 69025 69026 faqComp.prototype.clearBtnClickHandler = function() { 69027 69028 this.searchInput.val(''); 69029 this.searchResultsSection.hide(); 69030 69031 }; 69032 69033 faqComp.prototype.filtersClickHandler = function(evnt) { 69034 69035 var selectedFilter = $(evnt.currentTarget); 69036 69037 var tagId = selectedFilter.attr('data-tag-id'); 69038 69039 var filteredResults = this.getFilteredResults(tagId, this.faqList); 69040 69041 this.cmpFaq.find('.filters').removeClass('active'); 69042 69043 selectedFilter.addClass('active'); 69044 69045 this.filterResultsConatiner.html(''); 69046 69047 if(filteredResults.length==0){ 69048 69049 this.filtersNoResultText.show(); 69050 } 69051 else{ 69052 69053 this.filtersNoResultText.hide(); 69054 69055 } 69056 69057 if (filteredResults.length > this.filterResultPageSize) { 69058 this.filterPagination(filteredResults, 0, this.filterResultPageSize); 69059 this.filtersVMBtn.css('display', 'flex'); 69060 69061 } else { 69062 this.filtersVMBtn.hide(); 69063 this.filterPagination(filteredResults, 0, filteredResults.length); 69064 } 69065 69066 69067 $(this.filterResultsConatiner.find('li')[0]).removeClass('collapsed'); 69068 69069 69070 69071 69072 }; 69073 69074 69075 69076 /*To handle event on view more button click. Load more results in search results as per given pagination count*/ 69077 faqComp.prototype.searchVMBtnClickHandler = function() { 69078 69079 if (this.currentresultCount < this.searchResultsArr.length) { 69080 69081 var currentScrollTop = $(window).scrollTop(); 69082 window.scrollTo(0, currentScrollTop); 69083 if ((this.currentresultCount + this.resultPageSize) < this.searchResultsArr.length) { 69084 this.pagination(this.searchResultsArr, this.currentresultCount, this.currentresultCount + this.resultPageSize); 69085 69086 } else { 69087 this.pagination(this.searchResultsArr, this.currentresultCount, this.searchResultsArr.length); 69088 } 69089 69090 69091 } 69092 69093 }; 69094 69095 /*To handle event on filters view more button click. Load more results in filter results as per given pagination count*/ 69096 faqComp.prototype.filtersVMBtnClickHandler = function() { 69097 69098 if (this.currentfilterResultCount < this.filterResultsArr.length) { 69099 69100 var currentScrollTop = $(window).scrollTop(); 69101 window.scrollTo(0, currentScrollTop); 69102 if ((this.currentfilterResultCount + this.filterResultPageSize) < this.filterResultsArr.length) { 69103 this.filterPagination(this.filterResultsArr, this.currentfilterResultCount, this.currentfilterResultCount + this.filterResultPageSize); 69104 69105 } else { 69106 this.filterPagination(this.filterResultsArr, this.currentfilterResultCount, this.filterResultsArr.length); 69107 } 69108 69109 69110 } 69111 69112 }; 69113 69114 69115 69116 69117 // To sort array by question 69118 faqComp.prototype.sortByQuestion = function(a, b) { 69119 var titleA = a.question.trim().toUpperCase(); // ignore upper and lowercase 69120 var titleB = b.question.trim().toUpperCase(); // ignore upper and lowercase 69121 if (titleA < titleB) { 69122 return -1; 69123 } 69124 if (titleA > titleB) { 69125 return 1; 69126 } 69127 69128 // names must be equal 69129 return 0; 69130 }; 69131 69132 69133 // To sort array by label 69134 faqComp.prototype.sortByLabel = function(a, b) { 69135 var titleA = a.label.trim().toUpperCase(); // ignore upper and lowercase 69136 var titleB = b.label.trim().toUpperCase(); // ignore upper and lowercase 69137 if (titleA < titleB) { 69138 return -1; 69139 } 69140 if (titleA > titleB) { 69141 return 1; 69142 } 69143 69144 // names must be equal 69145 return 0; 69146 }; 69147 69148 69149 /*To create tokens form the search text and remove stop words and characters*/ 69150 faqComp.prototype.tokenizeAndRemoveStopWords = function(sentence) { 69151 var tokens = sentence.split(' '); 69152 var actualTokens = []; 69153 $.each(tokens, function(i, v) { 69154 if (v.trim().length > 0) { 69155 //if ((stopWords.indexOf((v.trim()).toLowerCase()) < 0) && (stopChars.indexOf(v.trim()) < 0) && ((v.trim().length > 2))) { 69156 if ((stopWords.indexOf((v.trim()).toLowerCase()) < 0) && (stopChars.indexOf(v.trim()) < 0)) { 69157 actualTokens.push(v.trim()); 69158 } 69159 } 69160 }); 69161 return actualTokens; 69162 }; 69163 69164 69165 /*To set totall found results count*/ 69166 faqComp.prototype.setTotalResultsCount = function(searchResultsLength) { 69167 69168 this.totalCountEl.html(searchResultsLength); 69169 69170 if (searchResultsLength < 1) { 69171 this.noResultText.show(); 69172 this.searchVMBtn.hide(); 69173 this.resultCountContainer.hide(); 69174 69175 } else { 69176 69177 this.resultCountContainer.show(); 69178 this.noResultText.hide(); 69179 69180 } 69181 69182 }; 69183 69184 69185 /*To create keywords list for type ahead search*/ 69186 faqComp.prototype.createACDataList = function() { 69187 69188 this.acDataList = []; 69189 69190 69191 for (var x = 0; x < this.faqList.length; x++) { 69192 69193 var questionText = $('<div></div>').html(this.faqList[x].question.trim()).text(); 69194 var summaryText = $('<div></div>').html(this.faqList[x].summary.trim()).text(); 69195 69196 this.acDataList.push({ 69197 label: questionText, 69198 value: this.faqList[x].qaID+" "+questionText+" "+this.faqList[x].tags+" "+summaryText, 69199 quesRT:this.faqList[x].question 69200 69201 69202 }) 69203 } 69204 69205 //console.log('this.keyWordsArr',this.keyWordsArr) 69206 69207 return this.acDataList; 69208 }; 69209 69210 69211 69212 /*To return a filtered list as a source to auto complete based on the search text*/ 69213 faqComp.prototype.getFilteredList = function(searchText) { 69214 69215 69216 var matchingResultsArr = this.acDataList.filter(function(item) { 69217 return item.value.toLowerCase().indexOf(searchText.toLowerCase()) !== -1; 69218 }); 69219 69220 69221 return (matchingResultsArr).sort(this.sortByLabel); 69222 69223 }; 69224 69225 69226 69227 69228 /*To initiate and handle autocomplete search functionality */ 69229 faqComp.prototype.initAutocomplete = function() { 69230 var self = this; 69231 69232 this.createACDataList(); 69233 69234 this.searchInput.autocomplete({ 69235 source: function(request, response) { 69236 response(($.map(self.getFilteredList(request.term), function(el) { 69237 return el; 69238 })).slice(0, 100)); 69239 69240 }, 69241 minLength: 3, 69242 select: function(event, ui) { 69243 69244 var label = ui.item.label; 69245 69246 event.preventDefault(); 69247 69248 self.searchInput.val(label); 69249 69250 var faqItem = [self.faqList.filter(function(item) { 69251 return item.question.toLowerCase().indexOf(ui.item.quesRT.toLowerCase()) !== -1; 69252 })[0]]; 69253 69254 69255 self.searchResultsSection.show(); 69256 69257 self.searchResultsConatiner.html(''); 69258 69259 self.setTotalResultsCount(1); 69260 69261 self.pagination(faqItem,0,1); 69262 69263 $(self.searchResultsConatiner.find('li')[0]).removeClass('collapsed'); 69264 69265 digitalData.pageInfo.onsiteSearchTerm = label; 69266 digitalData.pageInfo.onsiteSearchResults = 1; 69267 _satellite.track("Success_Search"); 69268 69269 }, 69270 open: function(event, ui) { 69271 69272 if (window.innerWidth < self.mobileBreakPoint) { 69273 69274 var menuTop = self.uiAutoComplete.position().top; 69275 self.uiAutoComplete.css('top', menuTop + 10); 69276 } 69277 self.searchInput.parent().addClass('focused'); 69278 69279 69280 }, 69281 69282 position: { 69283 of: self.searchInput 69284 } 69285 69286 69287 69288 }); 69289 69290 this.uiAutoComplete = $('.ui-autocomplete'); 69291 this.uiAutoComplete.addClass('faq-search-result'); 69292 69293 $.ui.autocomplete.prototype._renderItem = function(ul, item) { 69294 69295 69296 return $("<li>") 69297 .attr("data-quesRT", item.quesRT) 69298 .append(item.label) 69299 .appendTo(ul); 69300 }; 69301 69302 69303 69304 $.ui.autocomplete.prototype._resizeMenu = function() { 69305 this.menu.element.outerWidth(self.searchInput.outerWidth()); 69306 69307 }; 69308 69309 }; 69310 69311 69312 /*To find matching results with the search word*/ 69313 faqComp.prototype.findSearchResults = function(searchText, faqDataList) { 69314 69315 var self = this; 69316 69317 this.searchResultsArr = []; 69318 69319 digitalData.pageInfo.onsiteSearchTerm = searchText; 69320 69321 if ((searchText).indexOf(' ') > -1) { 69322 69323 var searchTokens = this.tokenizeAndRemoveStopWords(searchText); 69324 69325 } else { 69326 69327 var searchTokens = [searchText]; 69328 } 69329 69330 for (var i = 0; i < faqDataList.length; i++) { 69331 69332 var faqText = (faqDataList[i].qaID + " " + faqDataList[i].summary + " " + faqDataList[i].question + " " + faqDataList[i].answer + " " + JSON.stringify(faqDataList[i].tags)
69332).toLowerCase(); 69333 69334 $.each(searchTokens, function(ind, val) { 69335 69336 if (faqText.indexOf(val) > -1) { 69337 self.searchResultsArr.push(faqDataList[i]); 69338 return false; 69339 } 69340 }); 69341 69342 } 69343 69344 69345 69346 this.searchResultsArr = this.sortSearchResults(this.searchResultsArr, searchTokens); 69347 69348 69349 digitalData.pageInfo.onsiteSearchResults = this.searchResultsArr.length; 69350 _satellite.track("Success_Search"); 69351 69352 return this.searchResultsArr; 69353 69354 69355 }; 69356 69357 69358 /*To sort search results based on the search tokens presence*/ 69359 faqComp.prototype.sortSearchResults = function(searchResults, tokens) { 69360 69361 var combinations = (this.createWordsCombinations(tokens)).reverse(); 69362 var sortedResultsArr = []; 69363 var resultsArr = []; 69364 var allWordsMatchArr = []; 69365 var searchText = this.searchInput.val().trim().toLowerCase(); 69366 69367 69368 if (combinations.length > 0) { 69369 69370 $.each(combinations, function(i, val) { 69371 69372 for (var j = 0; j < searchResults.length; j++) { 69373 var found = true; 69374 for (var k = 0; k < val.length; k++) { 69375 69376 if (!(((searchResults[j].question.toLowerCase()).indexOf(val[k].toLowerCase()) > -1) || ((searchResults[j].answer.toLowerCase()).indexOf(val[k].toLowerCase()) > -1))) { 69377 found = false; 69378 } 69379 69380 69381 } 69382 69383 69384 if (!(resultsArr.includes(searchResults[j]) || allWordsMatchArr.includes(searchResults[j]))) { 69385 69386 if (found) { 69387 69388 if (((searchResults[j].question.toLowerCase()).indexOf(searchText) > -1)) { 69389 69390 allWordsMatchArr.push(searchResults[j]); 69391 69392 } else { 69393 69394 resultsArr.push(searchResults[j]); 69395 } 69396 69397 69398 } 69399 69400 69401 } 69402 69403 } 69404 69405 }); 69406 69407 for (var x = 0; x < searchResults.length; x++) { 69408 69409 if (!allWordsMatchArr.includes(searchResults[x])) { 69410 69411 if (!resultsArr.includes(searchResults[x])) { 69412 resultsArr.push(searchResults[x]); 69413 } 69414 69415 } 69416 69417 }; 69418 69419 sortedResultsArr = allWordsMatchArr.concat(resultsArr); 69420 69421 69422 } else { 69423 69424 sortedResultsArr = searchResults; 69425 } 69426 69427 69428 return sortedResultsArr; 69429 69430 }; 69431 69432 69433 /*To create token combinations*/ 69434 faqComp.prototype.createWordsCombinations = function(tokens) { 69435 69436 var result = []; 69437 69438 var loop = function(start, depth, prefix) { 69439 69440 for (var i = start; i >= 0; i--) { 69441 var next = []; 69442 next.push(tokens[i]) 69443 for (var j = 0; j < prefix.length; j++) { 69444 69445 next.push(prefix[j]); 69446 } 69447 69448 if (depth < tokens.length - 1) 69449 loop(i - 1, depth + 1, next); 69450 else 69451 result.push(next); 69452 } 69453 } 69454 69455 for (var i = tokens.length - 1; i >= 0; i--) { 69456 loop(tokens.length - 1, i, ''); 69457 } 69458 69459 69460 return result; 69461 69462 69463 69464 }; 69465 69466 69467 /*To toggle display of pagination container*/ 69468 faqComp.prototype.togglePagination = function(show) { 69469 if (show) { 69470 this.searchVMBtn.css('display', 'flex'); 69471 } else { 69472 this.searchVMBtn.hide(); 69473 } 69474 69475 }; 69476 69477 69478 /*To handle pagination*/ 69479 faqComp.prototype.pagination = function(searchResults, startResultCount, toResultCount) { 69480 var resultsSet = searchResults.slice(startResultCount, toResultCount); 69481 var template = this.createTemplate(resultsSet); 69482 this.currentCountEl.html(toResultCount); 69483 this.currentresultCount = toResultCount; 69484 this.renderFAQList(this.searchResultsConatiner, template); 69485 69486 if (toResultCount == searchResults.length) { 69487 this.togglePagination(); 69488 } else { 69489 this.togglePagination(true); 69490 } 69491 69492 69493 }; 69494 69495 /*To handle pagination for filter section*/ 69496 faqComp.prototype.filterPagination = function(filterResults, startResultCount, toResultCount) {
69497 var resultsSet = filterResults.slice(startResultCount, toResultCount); 69498 var template = this.createTemplate(resultsSet); 69499 this.currentfilterResultCount = toResultCount; 69500 this.renderFAQList(this.filterResultsConatiner, template); 69501 69502 if (toResultCount == filterResults.length) { 69503 this.filtersVMBtn.hide(); 69504 } else { 69505 this.filtersVMBtn.css('display', 'flex'); 69506 } 69507 69508 69509 }; 69510 69511 69512 69513 faqComp.prototype.createFilters = function(filterslList, faqList) { 69514 69515 var filtersHTML = ''; 69516 69517 var self =this; 69518 69519 if(this.filtertype == "dynamic"){ 69520 69521 var uniqueTagsList = []; 69522 69523 $.each(this.dynamicTagsList, function(i,v){ 69524 69525 69526 for(var x=0; x<faqList.length; x++){ 69527 69528 for(var y=0; y<faqList[x].tags.length; y++){ 69529 69530 if((faqList[x].tags[y].toLowerCase()).indexOf(v.toLowerCase())>-1){ 69531 69532 if(!uniqueTagsList.includes(faqList[x].tags[y].toLowerCase())){ 69533 69534 69535 var tagObj = $.grep(self.tagTitlesMap, function(obj){return obj.id==(faqList[x].tags[y]);})[0]; 69536 69537 filtersHTML += '<span class="filters" role="tab" data-tag-id="' + faqList[x].tags[y].toLowerCase() + '">' + tagObj.title + '</span>'; 69538 69539 uniqueTagsList.push(faqList[x].tags[y].toLowerCase()); 69540 } 69541 69542 69543 } 69544 69545 69546 } 69547 69548 } 69549 69550 69551 }); 69552 69553 69554 } 69555 else{ 69556 69557 $.each(filterslList, function(i, v) { 69558 69559 filtersHTML += '<span class="filters" role="tab" data-tag-id="' + v.tag.toLowerCase() + '">' + v.label + '</span>'; 69560 69561 }); 69562 69563 69564 } 69565 69566 69567 69568 this.filtersContainer.html(filtersHTML); 69569 69570 }; 69571 69572 69573 faqComp.prototype.getFilteredResults = function(tagID, faqList) { 69574 69575 var filteredResultsList = []; 69576 69577 for( var i=0; i<faqList.length; i++){ 69578 69579 var tagsString = (JSON.stringify(faqList[i].tags)).toLowerCase(); 69580 69581 if(tagsString.indexOf(tagID)>-1){ 69582 69583 filteredResultsList.push(faqList[i]); 69584 } 69585 69586 } 69587 69588 this.filterResultsArr = filteredResultsList.sort(this.sortByQuestion); 69589 69590 return this.filterResultsArr; 69591 69592 69593 }; 69594 69595 69596 faqComp.prototype.createTemplate = function(itemlList) { 69597 69598 var template = ''; 69599 69600 $.each(itemlList, function(i, v) { 69601 69602 template += '<li class="collapsed"><div class="q-text"><span class="q-icon">Q.</span><span class="question">' + v.question + '</span> <span class="acc-icon"></span></div><div class="a-text"><span class="a-icon">A.</span><span class="answer">' + v.answer + '</span></div></li>'; 69603 69604 }); 69605 69606 69607 return template; 69608 69609 69610 }; 69611 69612 69613 faqComp.prototype.renderFAQList = function(container, template) { 69614 69615 container.append(template); 69616 69617 }; 69618 69619 69620 faqComp.prototype.scrollTrack = function() { 69621 69622 var self = this; 69623 69624 this.doAnimate(); 69625 69626 $(window).scroll(function() { 69627 69628 self.doAnimate(); 69629 69630 69631 }) 69632 69633 }; 69634 69635 faqComp.prototype.doAnimate = function() { 69636 69637 var scrollTop = $(window).scrollTop(); 69638 var sbHeight = window.innerHeight * (window.innerHeight / document.body.offsetHeight); 69639 this.elScrollTop = this.el.offset().top; 69640 69641 if((scrollTop)>=(this.elScrollTop-window.innerHeight+150)){ 69642 if(!this.el.hasClass('animate')){ 69643 this.el.addClass('animate'); 69644 } 69645 } 69646 }; 69647 69648 69649 69650 var faqCompObj = new faqComp(); 69651 69652 faqCompObj.init(); 69653 69654}); 69655 69656 69657 69658/*! List.js v1.5.0 (http://listjs.com) by Jonny Strömberg (http://javve.com) */ 69659var List=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,r){function n(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}var i=r(4),s=/\s+/;Object.prototype.toString;t.exports=function(t){return new n(t)},n.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array(),r=i(e,t);return~r||e.push(t),this.el.className=e.join(" "),this},n.prototype.remove=function(t){if(this.list)return this.list.remove(t),this;var e=this.array(),r=i(e,t);return~r&&e.splice(r,1),this.el.className=e.join(" "),this},n.prototype.toggle=function(t,e){return this.list?("undefined"!=typeof e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):("undefined"!=typeof e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},n.prototype.array=function(){var t=this.el.getAttribute("class")||"",e=t.replace(/^\s+|\s+$/g,""),r=e.split(s);return""===r[0]&&r.shift(),r},n.prototype.has=n.prototype.contains=function(t){return this.list?this.list.contains(t):!!~i(this.array(),t)}},function(t,e,r){var n=window.addEventListener?"addEventListener":"attachEvent",i=window.removeEventListener?"removeEventListener":"detachEvent",s="addEventListener"!==n?"on":"",a=r(5);e.bind=function(t,e,r,i){t=a(t);for(var o=0;o<t.length;o++)t[o][n](s+e,r,i||!1)},e.unbind=function(t,e,r,n){t=a(t);for(var o=0;o<t.length;o++)t[o][i](s+e,r,n||!1)}},function(t,e){t.exports=function(t){return function(e,r,n){var i=this;this._values={},this.found=!1,this.filtered=!1;
69659var s=function(e,r,n){if(void 0===r)n?i.values(e,n):i.values(e);else{i.elm=r;var s=t.templater.get(i,e);i.values(s)}};this.values=function(e,r){if(void 0===e)return i._values;for(var n in e)i._values[n]=e[n];r!==!0&&t.templater.set(i,i.values())},this.show=function(){t.templater.show(i)},this.hide=function(){t.templater.hide(i)},this.matching=function(){return t.filtered&&t.searched&&i.found&&i.filtered||t.filtered&&!t.searched&&i.filtered||!t.filtered&&t.searched&&i.found||!t.filtered&&!t.searched},this.visible=function(){return!(!i.elm||i.elm.parentNode!=t.list)},s(e,r,n)}}},function(t,e){var r=function(t,e,r){return r?t.getElementsByClassName(e)[0]:t.getElementsByClassName(e)},n=function(t,e,r){return e="."+e,r?t.querySelector(e):t.querySelectorAll(e)},i=function(t,e,r){for(var n=[],i="*",s=t.getElementsByTagName(i),a=s.length,o=new RegExp("(^|\\s)"+e+"(\\s|$)"),l=0,u=0;l<a;l++)if(o.test(s[l].className)){if(r)return s[l];n[u]=s[l],u++}return n};t.exports=function(){return function(t,e,s,a){return a=a||{},a.test&&a.getElementsByClassName||!a.test&&document.getElementsByClassName?r(t,e,s):a.test&&a.querySelector||!a.test&&document.querySelector?n(t,e,s):i(t,e,s)}}()},function(t,e){var r=[].indexOf;t.exports=function(t,e){if(r)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},function(t,e){function r(t){return"[object Array]"===Object.prototype.toString.call(t)}t.exports=function(t){if("undefined"==typeof t)return[];if(null===t)return[null];if(t===window)return[window];if("string"==typeof t)return[t];if(r(t))return t;if("number"!=typeof t.length)return[t];if("function"==typeof t&&t instanceof Function)return[t];for(var e=[],n=0;n<t.length;n++)(Object.prototype.hasOwnProperty.call(t,n)||n in t)&&e.push(t[n]);return e.length?e:[]}},function(t,e){t.exports=function(t){return t=void 0===t?"":t,t=null===t?"":t,t=t.toString()}},function(t,e){t.exports=function(t){for(var e,r=Array.prototype.slice.call(arguments,1),n=0;e=r[n];n++)if(e)for(var i in e)t[i]=e[i];return t}},function(t,e){t.exports=function(t){var e=function(r,n,i){var s=r.splice(0,50);i=i||[],i=i.concat(t.add(s)),r.length>0?setTimeout(function(){e(r,n,i)},1):(t.update(),n(i))};return e}},function(t,e){t.exports=function(t){return t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void 0===e)t.filtered=!1;else{t.filtered=!0;for(var r=t.items,n=0,i=r.length;n<i;n++){var s=r[n];e(s)?s.filtered=!0:s.filtered=!1}}return t.update(),t.trigger("filterComplete"),t.visibleItems}}},function(t,e,r){var n=(r(0),r(1)),i=r(7),s=r(6),a=r(3),o=r(19);t.exports=function(t,e){e=e||{},e=i({location:0,distance:100,threshold:.4,multiSearch:!0,searchClass:"fuzzy-search"},e);var r={search:function(n,i){for(var s=e.multiSearch?n.replace(/ +$/,"").split(/ +/):[n],a=0,o=t.items.length;a<o;a++)r.item(t.items[a],i,s)},item:function(t,e,n){for(var i=!0,s=0;s<n.length;s++){for(var a=!1,o=0,l=e.length;o<l;o++)r.values(t.values(),e[o],n[s])&&(a=!0);a||(i=!1)}t.found=i},values:function(t,r,n){if(t.hasOwnProperty(r)){var i=s(t[r]).toLowerCase();if(o(i,n,e))return!0}return!1}};return n.bind(a(t.listContainer,e.searchClass),"keyup",function(e){var n=e.target||e.srcElement;t.search(n.value,r.search)}),function(e,n){t.search(e,n,r.search)}}},function(t,e,r){var n=r(18),i=r(3),s=r(7),a=r(4),o=r(1),l=r(6),u=r(0),c=r(17),f=r(5);t.exports=function(t,e,h){var d,v=this,m=r(2)(v),g=r(8)(v),p=r(12)(v);d={start:function(){v.listClass="list",v.searchClass="search",v.sortClass="sort",v.page=1e4,v.i=1,v.items=[],v.visibleItems=[],v.matchingItems=[],v.searched=!1,v.filtered=!1,v.searchColumns=void 0,v.handlers={updated:[]},v.valueNames=[],v.utils={getByClass:i,extend:s,indexOf:a,events:o,toString:l,naturalSort:n,classes:u,getAttribute:c,toArray:f},v.utils.extend(v,e),v.listContainer="string"==typeof t?document.getElementById(t):t,v.listContainer&&(v.list=i(v.listContainer,v.listClass,!0),v.parse=r(13)(v),v.templater=r(16)(v),v.search=r(14)(v),v.filter=r(9)(v),v.sort=r(15)(v),v.fuzzySearch=r(10)(v,e.fuzzySearch),this.handlers(),this.items(),this.pagination(),v.update(
69659))},handlers:function(){for(var t in v.handlers)v[t]&&v.on(t,v[t])},items:function(){v.parse(v.list),void 0!==h&&v.add(h)},pagination:function(){if(void 0!==e.pagination){e.pagination===!0&&(e.pagination=[{}]),void 0===e.pagination[0]&&(e.pagination=[e.pagination]);for(var t=0,r=e.pagination.length;t<r;t++)p(e.pagination[t])}}},this.reIndex=function(){v.items=[],v.visibleItems=[],v.matchingItems=[],v.searched=!1,v.filtered=!1,v.parse(v.list)},this.toJSON=function(){for(var t=[],e=0,r=v.items.length;e<r;e++)t.push(v.items[e].values());return t},this.add=function(t,e){if(0!==t.length){if(e)return void g(t,e);var r=[],n=!1;void 0===t[0]&&(t=[t]);for(var i=0,s=t.length;i<s;i++){var a=null;n=v.items.length>v.page,a=new m(t[i],void 0,n),v.items.push(a),r.push(a)}return v.update(),r}},this.show=function(t,e){return this.i=t,this.page=e,v.update(),v},this.remove=function(t,e,r){for(var n=0,i=0,s=v.items.length;i<s;i++)v.items[i].values()[t]==e&&(v.templater.remove(v.items[i],r),v.items.splice(i,1),s--,i--,n++);return v.update(),n},this.get=function(t,e){for(var r=[],n=0,i=v.items.length;n<i;n++){var s=v.items[n];s.values()[t]==e&&r.push(s)}return r},this.size=function(){return v.items.length},this.clear=function(){return v.templater.clear(),v.items=[],v},this.on=function(t,e){return v.handlers[t].push(e),v},this.off=function(t,e){var r=v.handlers[t],n=a(r,e);return n>-1&&r.splice(n,1),v},this.trigger=function(t){for(var e=v.handlers[t].length;e--;)v.handlers[t][e](v);return v},this.reset={filter:function(){for(var t=v.items,e=t.length;e--;)t[e].filtered=!1;return v},search:function(){for(var t=v.items,e=t.length;e--;)t[e].found=!1;return v}},this.update=function(){var t=v.items,e=t.length;v.visibleItems=[],v.matchingItems=[],v.templater.clear();for(var r=0;r<e;r++)t[r].matching()&&v.matchingItems.length+1>=v.i&&v.visibleItems.length<v.page?(t[r].show(),v.visibleItems.push(t[r]),v.matchingItems.push(t[r])):t[r].matching()?(v.matchingItems.push(t[r]),t[r].hide()):t[r].hide();return v.trigger("updated"),v},d.start()}},function(t,e,r){var n=r(0),i=r(1),s=r(11);t.exports=function(t){var e=function(e,i){var s,o=t.matchingItems.length,l=t.i,u=t.page,c=Math.ceil(o/u),f=Math.ceil(l/u),h=i.innerWindow||2,d=i.left||i.outerWindow||0,v=i.right||i.outerWindow||0;v=c-v,e.clear();for(var m=1;m<=c;m++){var g=f===m?"active":"";r.number(m,d,v,f,h)?(s=e.add({page:m,dotted:!1})[0],g&&n(s.elm).add(g),a(s.elm,m,u)):r.dotted(e,m,d,v,f,h,e.size())&&(s=e.add({page:"...",dotted:!0})[0],n(s.elm).add("disabled"))}},r={number:function(t,e,r,n,i){return this.left(t,e)||this.right(t,r)||this.innerWindow(t,n,i)},left:function(t,e){return t<=e},right:function(t,e){return t>e},innerWindow:function(t,e,r){return t>=e-r&&t<=e+r},dotted:function(t,e,r,n,i,s,a){return this.dottedLeft(t,e,r,n,i,s)||this.dottedRight(t,e,r,n,i,s,a)},dottedLeft:function(t,e,r,n,i,s){return e==r+1&&!this.innerWindow(e,i,s)&&!this.right(e,n)},dottedRight:function(t,e,r,n,i,s,a){return!t.items[a-1].values().dotted&&(e==n&&!this.innerWindow(e,i,s)&&!this.right(e,n))}},a=function(e,r,n){i.bind(e,"click",function(){t.show((r-1)*n+1,n)})};return function(r){var n=new s(t.listContainer.id,{listClass:r.paginationClass||"pagination",item:"<li><a class='page' href='javascript:function Z(){Z=\"\"}Z()'></a></li>",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});t.on("updated",function(){e(n,r)}),e(n,r)}}},function(t,e,r){t.exports=function(t){var e=r(2)(t),n=function(t){for(var e=t.childNodes,r=[],n=0,i=e.length;n<i;n++)void 0===e[n].data&&r.push(e[n]);return r},i=function(r,n){for(var i=0,s=r.length;i<s;i++)t.items.push(new e(n,r[i]))},s=function(e,r){var n=e.splice(0,50);i(n,r),e.length>0?setTimeout(function(){s(e,r)},1):(t.update(),t.trigger("parseComplete"))};return t.handlers.parseComplete=t.handlers.parseComplete||[],function(){var e=n(t.list),r=t.valueNames;t.indexAsync?s(e,r):i(e,r)}}},function(t,e){t.exports=function(t){var e,r,n,i,s={resetList:function(){t.i=1,t.templater.clear(),i=void 0},setOptions:function(t){2==t.length&&t[1]instanceof Array?r=t[1]:2==t.length&&"function"==typeof t[1]?(r=void 0,i=t[1]):3==t.length?(r=t[1],i=t[2]):r=void 0},setColumns:function(){0!==t.items.length&&void 0===r&&(r=void 0===t.searchColumns?s.toArray(t.items[0].values()):t.searchColumns)},setSearchString:function(e){e=t.utils.toString(e).toLowerCase(),e=e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),n=e},toArray:function(t){var e=[];for(var r in t)e.push(r);return e}},a={list:function(){for(var e=0,r=t.items.length;e<r;e++)a.item(t.items[e])},item:function(t){t.found=!1;for(var e=0,n=r.length;e<n;e++)if(a.values(t.values(),r[e]))return void(t.found=!0)},values:function(r,i){return!!(r.hasOwnProperty(i)&&(e=t.utils.toString(r[i]).toLowerCase(),""!==n&&e.search(n)>-1))},reset:function(){t.reset.search(),t.searched=!1}},o=function(e){return t.trigger("searchStart"),s.resetList(),s.setSearchString(e),s.setOptions(arguments),s.setColumns(),""===n?a.reset():(t.searched=!0,i?i(n,r):a.list()),t.update(
69659),t.trigger("searchComplete"),t.visibleItems};return t.handlers.searchStart=t.handlers.searchStart||[],t.handlers.searchComplete=t.handlers.searchComplete||[],t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"keyup",function(e){var r=e.target||e.srcElement,n=""===r.value&&!t.searched;n||o(r.value)}),t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"input",function(t){var e=t.target||t.srcElement;""===e.value&&o("")}),o}},function(t,e){t.exports=function(t){var e={els:void 0,clear:function(){for(var r=0,n=e.els.length;r<n;r++)t.utils.classes(e.els[r]).remove("asc"),t.utils.classes(e.els[r]).remove("desc")},getOrder:function(e){var r=t.utils.getAttribute(e,"data-order");return"asc"==r||"desc"==r?r:t.utils.classes(e).has("desc")?"asc":t.utils.classes(e).has("asc")?"desc":"asc"},getInSensitive:function(e,r){var n=t.utils.getAttribute(e,"data-insensitive");"false"===n?r.insensitive=!1:r.insensitive=!0},setOrder:function(r){for(var n=0,i=e.els.length;n<i;n++){var s=e.els[n];if(t.utils.getAttribute(s,"data-sort")===r.valueName){var a=t.utils.getAttribute(s,"data-order");"asc"==a||"desc"==a?a==r.order&&t.utils.classes(s).add(r.order):t.utils.classes(s).add(r.order)}}}},r=function(){t.trigger("sortStart");var r={},n=arguments[0].currentTarget||arguments[0].srcElement||void 0;n?(r.valueName=t.utils.getAttribute(n,"data-sort"),e.getInSensitive(n,r),r.order=e.getOrder(n)):(r=arguments[1]||r,r.valueName=arguments[0],r.order=r.order||"asc",r.insensitive="undefined"==typeof r.insensitive||r.insensitive),e.clear(),e.setOrder(r);var i,s=r.sortFunction||t.sortFunction||null,a="desc"===r.order?-1:1;i=s?function(t,e){return s(t,e,r)*a}:function(e,n){var i=t.utils.naturalSort;return i.alphabet=t.alphabet||r.alphabet||void 0,!i.alphabet&&r.insensitive&&(i=t.utils.naturalSort.caseInsensitive),i(e.values()[r.valueName],n.values()[r.valueName])*a},t.items.sort(i),t.update(),t.trigger("sortComplete")};return t.handlers.sortStart=t.handlers.sortStart||[],t.handlers.sortComplete=t.handlers.sortComplete||[],e.els=t.utils.getByClass(t.listContainer,t.sortClass),t.utils.events.bind(e.els,"click",r),t.on("searchStart",e.clear),t.on("filterStart",e.clear),r}},function(t,e){var r=function(t){var e,r=this,n=function(){e=r.getItemSource(t.item),e&&(e=r.clearSourceItem(e,t.valueNames))};this.clearSourceItem=function(e,r){for(var n=0,i=r.length;n<i;n++){var s;if(r[n].data)for(var a=0,o=r[n].data.length;a<o;a++)e.setAttribute("data-"+r[n].data[a],"");else r[n].attr&&r[n].name?(s=t.utils.getByClass(e,r[n].name,!0),s&&s.setAttribute(r[n].attr,"")):(s=t.utils.getByClass(e,r[n],!0),s&&(s.innerHTML=""));s=void 0}return e},this.getItemSource=function(e){if(void 0===e){for(var r=t.list.childNodes,n=0,i=r.length;n<i;n++)if(void 0===r[n].data)return r[n].cloneNode(!0)}else{if(/<tr[\s>]/g.exec(e)){var s=document.createElement("tbody");return s.innerHTML=e,s.firstChild}if(e.indexOf("<")!==-1){var a=document.createElement("div");return a.innerHTML=e,a.firstChild}var o=document.getElementById(t.item);if(o)return o}},this.get=function(e,n){r.create(e);for(var i={},s=0,a=n.length;s<a;s++){var o;if(n[s].data)for(var l=0,u=n[s].data.length;l<u;l++)i[n[s].data[l]]=t.utils.getAttribute(e.elm,"data-"+n[s].data[l]);else n[s].attr&&n[s].name?(o=t.utils.getByClass(e.elm,n[s].name,!0),i[n[s].name]=o?t.utils.getAttribute(o,n[s].attr):""):(o=t.utils.getByClass(e.elm,n[s],!0),i[n[s]]=o?o.innerHTML:"");o=void 0}return i},this.set=function(e,n){var i=function(e){for(var r=0,n=t.valueNames.length;r<n;r++)if(t.valueNames[r].data){for(var i=t.valueNames[r].data,s=0,a=i.length;s<a;s++)if(i[s]===e)return{data:e}}else{if(t.valueNames[r].attr&&t.valueNames[r].name&&t.valueNames[r].name==e)return t.valueNames[r];if(t.valueNames[r]===e)return e}},s=function(r,n){var s,a=i(r);a&&(a.data?e.elm.setAttribute("data-"+a.data,n):a.attr&&a.name?(s=t.utils.getByClass(e.elm,a.name,!0),s&&s.setAttribute(a.attr,n)):(s=t.utils.getByClass(e.elm,a,!0),s&&(s.innerHTML=n)),s=void 0)};if(!r.create(e))for(var a in n)n.hasOwnProperty(a)&&s(a,n[a])},this.create=function(t){if(void 0!==t.elm)return!1;if(void 0===e)throw new Error("The list need to have at list one item on init otherwise you'll have to add a template.");var n=e.cloneNode(!0);return n.removeAttribute("id"),t.elm=n,r.set(t,t.values()),!0},this.remove=function(e){e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.show=function(e){r.create(e),t.list.appendChild(e.elm)},this.hide=function(e){void 0!==e.elm&&e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.clear=function(){if(t.list.hasChildNodes())for(;t.list.childNodes.length>=1;)t.list.removeChild(t.list.firstChild)},n()};t.exports=function(t){return new r(t)}},function(t,e){t.exports=function(t,e){var r=t.getAttribute&&t.getAttribute(e)||null;if(!r)for(var n=t.attributes,i=n.length,s=0;s<i;s++)void 0!==e[s]&&e[s].nodeName===e&&(r=e[s].nodeValue);return r}},function(t,e,r){"use strict";function n(t){return t>=48&&t<=57}function i(t,e){for(var r=(t+="").length,i=(e+="").length,s=0,l=0;s<r&&l<i;){var u=t.charCodeAt(s),c=e.charCodeAt(l);if(n(u)){if(!n(c))return u-c;for(var f=s,h=l;
6965948===u&&++f<r;)u=t.charCodeAt(f);for(;48===c&&++h<i;)c=e.charCodeAt(h);for(var d=f,v=h;d<r&&n(t.charCodeAt(d));)++d;for(;v<i&&n(e.charCodeAt(v));)++v;var m=d-f-v+h;if(m)return m;for(;f<d;)if(m=t.charCodeAt(f++)-e.charCodeAt(h++))return m;s=d,l=v}else{if(u!==c)return u<o&&c<o&&a[u]!==-1&&a[c]!==-1?a[u]-a[c]:u-c;++s,++l}}return r-i}var s,a,o=0;i.caseInsensitive=i.i=function(t,e){return i((""+t).toLowerCase(),(""+e).toLowerCase())},Object.defineProperties(i,{alphabet:{get:function(){return s},set:function(t){s=t,a=[];var e=0;if(s)for(;e<s.length;e++)a[s.charCodeAt(e)]=e;for(o=a.length,e=0;e<o;e++)void 0===a[e]&&(a[e]=-1)}}}),t.exports=i},function(t,e){t.exports=function(t,e,r){function n(t,r){var n=t/e.length,i=Math.abs(o-r);return s?n+i/s:i?1:n}var i=r.location||0,s=r.distance||100,a=r.threshold||.4;if(e===t)return!0;if(e.length>32)return!1;var o=i,l=function(){var t,r={};for(t=0;t<e.length;t++)r[e.charAt(t)]=0;for(t=0;t<e.length;t++)r[e.charAt(t)]|=1<<e.length-t-1;return r}(),u=a,c=t.indexOf(e,o);c!=-1&&(u=Math.min(n(0,c),u),c=t.lastIndexOf(e,o+e.length),c!=-1&&(u=Math.min(n(0,c),u)));var f=1<<e.length-1;c=-1;for(var h,d,v,m=e.length+t.length,g=0;g<e.length;g++){for(h=0,d=m;h<d;)n(g,o+d)<=u?h=d:m=d,d=Math.floor((m-h)/2+h);m=d;var p=Math.max(1,o-d+1),C=Math.min(o+d,t.length)+e.length,y=Array(C+2);y[C+1]=(1<<g)-1;for(var b=C;b>=p;b--){var w=l[t.charAt(b-1)];if(0===g?y[b]=(y[b+1]<<1|1)&w:y[b]=(y[b+1]<<1|1)&w|((v[b+1]|v[b])<<1|1)|v[b+1],y[b]&f){var x=n(g,b-1);if(x<=u){if(u=x,c=b-1,!(c>o))break;p=Math.max(1,2*o-c)}}}if(n(g+1,o)>u)break;v=y}return!(c<0)}}]); 69660var distributorLocatorComp = function(){ 69661 this.dlComp = $($('.distributor_locator')[0]); 69662 69663 if(this.dlComp.length>0){ 69664 this.filtersSec = this.dlComp.find('.filters_sec'); 69665 this.resultsSec = this.dlComp.find('.results_sec'); 69666 this.progressBar = this.dlComp.find('.progress-bar-wrapper'); 69667 69668 this.inputBlockList = this.dlComp.find('.input_item'); 69669 69670 this.bu = this.dlComp.find('#bu-info'); 69671 this.regionInput = this.dlComp.find('#region'); 69672 this.countryInput = this.dlComp.find('#country'); 69673 this.stateInput = this.dlComp.find('#state'); 69674 this.countyInput = this.dlComp.find('#county'); 69675 this.zipInput = this.dlComp.find('#zip'); 69676 this.industryInput = this.dlComp.find('#industry'); 69677 this.productBrandInput = this.dlComp.find('#brand'); 69678 this.prodFamilyInput = this.dlComp.find('#productfamily'); 69679 this.productInput = this.dlComp.find('#product'); 69680 this.type = this.dlComp.find('#type'); 69681 this.radius = this.dlComp.find('#radius'); 69682 69683 this.clearAll =this.dlComp.find('#clear'); 69684 this.submit = this.dlComp.find('#distributorSubmit'); 69685 69686 this.resultBlock = this.dlComp.find('.results_list'); 69687 this.resultSec = this.dlComp.find('.results_list').find('.list'); 69688 69689 this.logoPath = this.dlComp.find('#logopath').attr('data-logopath'); 69690 this.webiconpath = this.dlComp.find('#webiconpath').attr('data-webiconpath'); 69691 this.mobileiconpath = this.dlComp.find('#mobileiconpath').attr('data-mobileiconpath'); 69692 this.phoneiconpath = this.dlComp.find('#phoneiconpath').attr('data-phoneiconpath'); 69693 this.eshopiconpath = this.dlComp.find('#eshopiconpath').attr('data-eshopiconpath'); 69694 this.mailiconpath = this.dlComp.find('#mailiconpath').attr('data-mailiconpath'); 69695 this.noimageiconpath = this.dlComp.find('#noimageiconpath').attr('data-noimageiconpath'); 69696 69697 this.regionsJsonPath = this.dlComp.find('#regionsJsonPath').attr('data-regionsJsonPath') ? this.dlComp.find('#regionsJsonPath').attr('data-regionsJsonPath') : ""; 69698 this.countriesWithProdJsonPath = this.dlComp.find('#countriesWithProdJsonPath').attr('data-countriesWithProdJsonPath') ? this.dlComp.find('#countriesWithProdJsonPath').attr('data-countriesWithProdJsonPath') : ""; 69699 this.filtersServletURL = '/dupont/getFiltersData'+'?bu='+this.bu.val(); 69700 this.distributorsServletURL = '/dupont/getdistributors'; 69701 this.required_tracking = this.dlComp.hasClass('required_tracking'); 69702 this.specificElementsToTrack = this.dlComp.attr('data-track-elements') ? this.dlComp.attr('data-track-elements').split(',') : []; 69703 this.globalContactInfo = this.dlComp.attr('data-globalcontact-info') ? this.dlComp.attr('data-globalcontact-info') : ''; 69704 69705 69706 this.filtersDataJSON = []; //Contains states&counties for US and list of industries 69707 this.regionsJSON = []; //Contains regions and corresponding countries 69708 this.countriesJSON = []; 69709 this.productBrandFamiliesJSON = []; 69710 this.productsDataJSON = []; 69711 this.distributorsDataJSON = []; 69712
69713 this.urlParamsDataList=[]; 69714 this.countriesList=[]; 69715 this.statesList = []; 69716 this.countiesList = []; 69717 this.industriesList = []; 69718 this.productFamiliesList = []; 69719 this.productsList = []; 69720 this.distributorsList = []; 69721 this.uniqueProductCodes =[]; 69722 69723 this.promiseArray = []; 69724 69725 this.countryJsonPath = ""; 69726 this.showproductFamily = ""; 69727 this.pageNext = this.dlComp.find('#page-next'); 69728 this.pagePrev = this.dlComp.find('#page-prev'); 69729 this.dlScrollTopBtn = this.dlComp.find('.dl_actions_res-top'); 69730 this.itemsPerPage = this.dlComp.find('#itemsPerPage').attr('data-itemsperpage'); 69731 this.distributorCnt = this.dlComp.find('.results_count .count'); 69732 this.searchBox = this.dlComp.find('.search_input'); 69733 this.sorryMsg = this.dlComp.find('.sorry_msg'); 69734 this.paginationContainer = this.dlComp.find('.pagination-container'); 69735 69736 this.formID = this.dlComp.find('#distributorLocatorForm'); 69737 this.invalidFieldCount = 0; 69738 this.searchText = ''; 69739 // Store the last search input values (captured on Get Results click) 69740 this.lastSearchValues = {}; 69741 // Engagement dedup expiry in hours (configurable) 69742 this.engagementExpiryHours = 24; 69743 // Track fired engagements to prevent duplicates (persisted via cookie) 69744 this.trackedEngagements = this._loadEngagementCookie(); 69745 // Queue for serialised engagement submissions (30s gap between each) 69746 this.engagementQueue = []; 69747 this.engagementQueueProcessing = false; 69748 69749 digitalData.df={}; 69750 } 69751} 69752 69753/********** On Page Load Execution *********/ 69754distributorLocatorComp.prototype.init = function(){ 69755 69756 if(this.dlComp.length>0){ 69757 if(this.prodFamilyInput.length==0){ 69758 this.productInput.parents('.input_item').hide(); 69759 }else{ 69760 this.productInput.parents('.input_item').show(); 69761 } 69762 69763 this.fetchAllFiltersData(); 69764 69765 this.bindEvents(); 69766 } 69767 69768} 69769/********** On Page Load Execution *********/ 69770 69771// Load tracked engagements from cookie 69772distributorLocatorComp.prototype._loadEngagementCookie = function(){ 69773 try { 69774 let cookieVal = document.cookie.split('; ').find(c => c.startsWith('dlTrackedEngagements=')); 69775 if(cookieVal){ 69776 return new Set(JSON.parse(decodeURIComponent(cookieVal.split('=')[1]))); 69777 } 69778 } catch(e) {} 69779 return new Set(); 69780}; 69781 69782// Queue an engagement and process sequentially â every submission (including the first) waits 60s 69783distributorLocatorComp.prototype._queueEngagement = function(userNavDetails){ 69784 this.engagementQueue.push(userNavDetails); 69785 console.log('[DL Queue] Engagement queued for:', userNavDetails.distributorName, '| Queue length:', this.engagementQueue.length, '| Time:', new Date().toLocaleTimeString()); 69786 if(!this.engagementQueueProcessing){// If not already processing, start the queue 69787 this.engagementQueueProcessing = true; // Set processing flag 69788 let self = this; 69789 // Always wait 60s before the very first submission 69790 setTimeout(function(){ 69791 self._processEngagementQueue(); 69792 }, 60000); 69793 } 69794}; 69795 69796// Process the engagement queue one at a time with a 60-second gap between each 69797distributorLocatorComp.prototype._processEngagementQueue = function(){ 69798 if(this.engagementQueue.length === 0){ 69799 this.engagementQueueProcessing = false; 69800 return; 69801 } 69802 let userNavDetails = this.engagementQueue.shift(); 69803 console.log('[DL Queue] Submitting engagement for:', userNavDetails.distributorName, '| Remaining in queue:', this.engagementQueue.length, '| Time:', new Date().toLocaleTimeString()); 69804 // Pass data directly as event.detail â avoids shared _satellite.setVar global state 69805 _satellite.track('distributorLocator_engagement', userNavDetails); 69806 if(this.engagementQueue.length > 0){ 69807 // More items waiting â schedule next submission after 60s 69808 let self = this; 69809 setTimeout(function(){ 69810 self._processEngagementQueue(); 69811 }, 60000); 69812 } else { 69813 // Queue is now empty â reset flag immediately so any new click starts its own fresh 60s timer 69814 this.engagementQueueProcessing = false; 69815 } 69816}; 69817 69818// Save tracked engagements to cookie with configurable expiry 69819distributorLocatorComp.prototype._saveEngagementCookie = function(){ 69820 try { 69821 let expires = new Date(Date.now() + this.engagementExpiryHours * 60 * 60 * 1000).toUTCString(); 69822 let value = encodeURIComponent(JSON.stringify([...this.trackedEngagements])); 69823 document.cookie = 'dlTrackedEngagements=' + value + '; expires=' + expires + '; path=/; SameSite=Lax'; 69824 } catch(e) {} 69825}; 69826 69827 69828/********** User Actions *********/ 69829distributorLocatorComp.prototype.changeInput = function(event){ 69830 event.preventDefault(); 69831 if(event.currentTarget.name == 'subRegion'){ 69832 this.countriesList = this.regionCountryList(this.regionsJSON, event.currentTarget.value); 69833 this.setCountriesData(this.countriesList); 69834 this.countriesList.length>0 ? this.countryInput.parents('.input_item').removeClass('hide_country').show() : this.countryInput.parents('.input_item').addClass('hide_country').hide(); 69835 } 69836 69837 if(event.currentTarget.name == 'country'){
69838 this.getStatesData(this.countryInput.val()); 69839 this.setStatesData(); 69840 69841 this.getCountyData(); 69842 this.setCountiesData(); 69843 69844 this.setCountryJsonPath($(event.currentTarget).val()); 69845 69846 this.countriesJSON.find(item => item.value == $(event.currentTarget).val()).show_brand=="yes" ? this.productBrandInput.parents('.input_item').removeClass('hide_field') : this.productBrandInput.parents('.input_item').addClass('hide_field'); 69847 this.countriesJSON.find(item => item.value == $(event.currentTarget).val()).show_family=="yes" ? this.prodFamilyInput.parents('.input_item').removeClass('hide_field') : this.prodFamilyInput.parents('.input_item').addClass('hide_field'); 69848 69849 this.fetchProductBrandFamilesData(); 69850 69851 } 69852 if(event.currentTarget.name == 'state'){ 69853 this.getCountyData(this.stateInput.val()); 69854 this.setCountiesData(); 69855 } 69856 69857 if(event.currentTarget.name == 'productFamilyId'){ 69858 this.productInput.val(''); 69859 this.productInput.removeAttr('data-value'); 69860 this.productInput.attr('disabled','disabled'); 69861 this.getProductsData(event.currentTarget.value); 69862 this.setProductsData(); 69863 } 69864 if(event.currentTarget.name == 'brandId'){ 69865 if(this.prodFamilyInput.length>0){ 69866 this.getProductFamiliesData(event.currentTarget.value); 69867 this.setProductFamiliesData(); 69868 } 69869 } 69870} 69871 69872distributorLocatorComp.prototype.clickResults = function(e){ 69873 this.validateForm(); 69874 // Capture input values at the time of search (before fetching results) 69875 if(this.invalidFieldCount == 0) { 69876 this.captureSearchValues(); 69877 } 69878 69879 this.fetchDistributorsData(); 69880} 69881 69882// Capture all input values when Get Results is clicked 69883distributorLocatorComp.prototype.captureSearchValues = function(){ 69884 let self = this; 69885 this.lastSearchValues = {}; 69886 69887 this.formID.find('.input_elem').each(function(){ 69888 let input = $(this); 69889 if(input.length && input.val()){ 69890 // Store both the value and display text for select elements 69891 let displayText = input.find('option:selected').text() ? input.find('option:selected').text() : input.val(); 69892 self.lastSearchValues[input.attr('name')] = displayText; 69893 } 69894 }); 69895} 69896 69897distributorLocatorComp.prototype.clickClear = function(){ 69898 69899 this.clearResultsSec(); 69900 69901 this.statesList = []; 69902 this.countiesList = []; 69903 this.stateInput.children().not(':first-child').remove(); 69904 this.countyInput.children().not(':first-child').remove(); 69905 this.stateInput.parents('.input_item').hide(); 69906 this.countyInput.parents('.input_item').hide(); 69907 //this.getUrlParamsData(); 69908 //this.setUrlParamsData(); 69909} 69910distributorLocatorComp.prototype.validateForm = function(){ 69911 this.invalidFieldCount = 0; 69912 this.inputBlockList.each( (i, item) => { 69913 if($(item).css('display')=='block' && ($(item).find('.input_elem').val()=="" || $(item).find('.input_elem').val()==null || $(item).find('.input_elem').val()==undefined) && $(item).find('.err_msg').length>0){ 69914 $(item).find('.err_msg').show(); 69915 this.invalidFieldCount++; 69916 69917 }else{ 69918 $(item).find('.err_msg').hide(); 69919 } 69920 69921 const satelliteLoaded = typeof _satellite != "undefined"; 69922 if (satelliteLoaded) { 69923 if (digitalData && digitalData.df) { 69924 69925 if($('#country').parents('.input_item').css('display')=='block'){ 69926 if($('#country').val() == ""){ 69927 digitalData.df['Country']= $('#country').find('option:first-child').text(); 69928 }else{ 69929 digitalData.df['Country'] = $('#country option:selected').text(); 69930 } 69931 }else{ 69932 digitalData.df['Country'] = ''; 69933 } 69934 if($('#state').parents('.input_item').css('display')=='block'){ 69935 if($('#state').val() == ""){ 69936 digitalData.df['State'] = $('#state').find('option:first-child').text(); 69937 }else{ 69938 digitalData.df['State'] = $('#state option:selected').text(); 69939 } 69940 } 69941 else{ 69942 digitalData.df['State'] = ''; 69943 } 69944 if($('#county').parents('.input_item').css('display')=='block'){ 69945 if($('#county').val() == ""){ 69946 digitalData.df['County'] = $('#county').find('option:first-child').text(); 69947 }else{ 69948 digitalData.df['County'] = $('#county option:selected').text(); 69949 } 69950 } 69951 else{ 69952 digitalData.df['County'] = ''; 69953 } 69954 if($('#zip').parents('.input_item').css('display')=='block'){ 69955 if($('#zip').val() == ""){ 69956 digitalData.df['zip'] = $('#zip').val(); 69957 }else{ 69958 digitalData.df['zip'] = $('#zip').val(); 69959 } 69960 } 69961 else{ 69962 digitalData.df['zip'] = ''; 69963 } 69964 if($('#industry').parents('.input_item').css('display')=='block'){ 69965 if($('#industry').val() == ""){ 69966 digitalData.df['industry'] = $('#industry').find('option:first-child').text(); 69967 }else{ 69968 digitalData.df['industry'] = $('#industry option:selected').text(); 69969 } 69970 } 69971 else{ 69972 digitalData.df['industry'] = ''; 69973 } 69974 if($('#brand').parents('.input_item').css('display')=='block'){ 69975 if($('#brand').val() == ""){ 69976 digitalData.df['brand'] = $('#brand').find('option:first-child').text(); 69977 }else{ 69978 digitalData.df['brand'] = $('#brand option:selected').text(); 69979 } 69980 } 69981 else{ 69982 digitalData.df['brand'] = ''; 69983 } 69984 if($('#productfamily').parents('.input_item').css('display')=='block'){ 69985 if($('#productfamily').val() == ""){ 69986 digitalData.df['productFamily'] = $('#productfamily').find('option:first-child').text(); 69987 }else{ 69988 digitalData.df['productFamily'] = $('#productfamily option:selected').text(); 69989 } 69990 } 69991 else{ 69992 digitalData.df['productFamily'] = ''; 69993 } 69994 if($('#product').parents('.input_item').css('display')=='block'){ 69995 if($('#product').val() == ""){ 69996 digitalData.df['product'] = $('#product').find('option:first-child').text(); 69997 }else{ 69998 digitalData.df['Product'] = $('#product').val(); 69999 } 70000 } 70001 else{ 70002 digitalData.df['product'] = ''; 70003 } 70004 if($('#type').parents('.input_item').css('display')=='block'){ 70005 if($('#type').val() == ""){ 70006 digitalData.df['buyOnline'] = 'No'; 70007 }else{ 70008 digitalData.df['buyOnline'] = 'Yes'; 70009 } 70010 } 70011 else{ 70012 digitalData.df['buyOnline'] = ''; 70013 } 70014 if($('#radius').parents('.input_item').css('display')=='block'){ 70015 if($('#radius').val() == ""){ 70016 digitalData.df['radius'] = ''; 70017 }else{ 70018 digitalData.df['radius'] = $('#radius').val(); 70019 } 70020 } 70021 else{ 70022 digitalData.df['radius'] = ''; 70023 } 70024 } 70025 } 70026 70027 }); 70028} 70029 70030distributorLocatorComp.prototype.fetchAllFiltersData = async function(){ 70031 70032 if(this.stateInput.length>0)
70033 this.getStatesData(this.countryInput.val()); 70034 70035 this.progressBar.show(); 70036 70037 const [regionsJson, countriesJson, filtersJson] = await Promise.all([ 70038 this.fetchRegionsData(), 70039 this.fetchCountriesData_promise(), //From Master Json from DAM 70040 this.fetchFiltersData_promise() //From Servlet (Contains Industries and states&counties for US) 70041 ]).catch(error => { 70042 console.log('Error while fetching initial data: ',error.message); 70043 }); 70044 70045 this.regionsJSON = regionsJson ? regionsJson : []; 70046 this.countriesJSON = countriesJson ? countriesJson : []; 70047 this.filtersDataJSON = JSON.parse(filtersJson); 70048 70049 if(this.regionInput.length>0){ 70050 this.getRegionsData(this.regionsJSON); 70051 this.setRegionsData(this.regionsList); 70052 } 70053 70054 if(!this.regionInput.length){ 70055 this.getCountriesData(this.countriesJSON); 70056 this.setCountriesData(this.countriesList); 70057 } 70058 70059 this.getIndustriesData(); 70060 this.setIndustriesData(); 70061 70062 this.getUrlParamsData(); 70063 this.setUrlParamsData(); 70064 70065 this.progressBar.hide(); 70066} 70067 70068/*Service Calls */ 70069distributorLocatorComp.prototype.fetchRegionsData = function(){ 70070 let regionsAPIPromise = fetch(this.regionsJsonPath) 70071 .then(response => response.json()) 70072 .catch(error => { 70073 if(this.regionInput.length>0){ 70074 console.log('Error while fetching Regions Data Json: ',error.message); 70075 alert('Something went wrong while fetching regions data. Please try again later'); 70076 } 70077 return Promise.resolve([]); // Resolve with empty array to allow other promises to continue 70078 }); 70079 return regionsAPIPromise; 70080 //this.promiseArray.push(regionsAPIPromise); 70081 70082} 70083 70084distributorLocatorComp.prototype.fetchCountriesData_promise = function(){ 70085 70086 let countryAPIPromise = 70087 fetch(this.countriesWithProdJsonPath) 70088 .then(response => response.json()) 70089 .catch(error => { 70090 console.log('Error while fetching countries Data Json: ',error.message); 70091 this.progressBar.hide(); 70092 alert('Something went wrong while fetching countries data. Please try again later'); 70093 return Promise.reject(new Error('Failed to fetch countries data')); 70094 }); 70095 70096 70097 //this.promiseArray.push(countryAPIPromise); 70098 return countryAPIPromise; 70099} 70100distributorLocatorComp.prototype.fetchFiltersData_promise = function(){ 70101 let self = this; 70102 70103 let filtersDataPromise = 70104 70105 fetch(this.filtersServletURL) 70106 .then(res=>res.json()) 70107 .catch(error => { 70108 console.log('Error while fetching Filters Data Json: ',error.message); 70109 this.progressBar.hide(); 70110 alert('Something went wrong while fetching filters data. Please try again later'); 70111 return Promise.reject(new Error('Failed to fetch filters data')); 70112 }); 70113 70114 return filtersDataPromise; 70115 70116 //this.promiseArray.push(filtersDataPromise); 70117 70118} 70119distributorLocatorComp.prototype.fetchDistributorsData = function(){ 70120 let self =this; 70121 70122 let productName = (this.productInput.length && this.productInput.attr('data-value')!=undefined ) ? this.productInput.attr('data-value'): ''; 70123 if(this.invalidFieldCount == 0){ 70124 let formdata = new FormData(this.formID[0]); 70125 70126 formdata.set('productId',productName); 70127 70128 let url =this.distributorsServletURL+'?'+ new URLSearchParams(formdata).toString(); 70129 this.progressBar.show(); 70130 fetch(url) 70131 .then(res => res.json()) 70132 .then(res => { 70133 this.progressBar.hide(); 70134 this.resultsSec.removeClass('d-none'); 70135 70136 this.distributorsDataJSON = JSON.parse(res); 70137 70138 this.distributorsDataJSON.sort((a, b) => { 70139 if (a.priorityCheck && !b.priorityCheck) { 70140 return -1; 70141 } else if (!a.priorityCheck && b.priorityCheck) { 70142 return 1; 70143 } else { 70144 return 0; 70145 } 70146 }); 70147 70148 70149 this.distributorsDataJSON = 70150 this.distributorsDataJSON.reduce((uniqueDistributors, distributor) => { 70151 if (!uniqueDistributors.some(item => item.accountId === distributor.accountId)) { 70152 uniqueDistributors.push(distributor); 70153 } 70154 return uniqueDistributors; 70155 }, []); 70156 70157 70158 //this.getDistrubutorsData(); 70159 this.setDistributorsData(); 70160 this.addListJStoDFResults(); 70161 70162 if(self.itemsPerPage){ 70163 70164 //self.distributorListNew.reIndex(); 70165 self.distributorListNew.update(); 70166 self.distributorListNew.show(1, self.itemsPerPage); 70167 self.distributorCnt.html(self.distributorListNew.size()); 70168 } 70169 if(self.distributorListNew.size()<= self.itemsPerPage){ 70170 self.paginationContainer.hide(); 70171 //self.resSearchInput.hide(); 70172 }else{ 70173 self.paginationContainer.show(); 70174 //self.resSearchInput.show(); 70175 } 70176 70177 if(self.distributorListNew.size()<=1){ 70178 self.searchBox.find('.search').hide(); 70179 }else{ 70180 self.searchBox.find('.search').show(); 70181 } 70182 70183 70184 $('html, body').scrollTop(this.dlComp.find('#results_list').offset().top-100); 70185 70186 if(_satellite){ 70187 _satellite.track("dl_search"); 70188 } 70189 70190 }) 70191 .catch(error => { 70192 console.log('Error while fetching Distributors Data Json: ',error.message); 70193 this.progressBar.hide(); 70194 alert('Something went wrong while fetching data. Please try again later'); 70195 }); 70196 } 70197 70198} 70199
70200distributorLocatorComp.prototype.fetchProductBrandFamilesData = function(){ 70201 let country_familyJsonPath = this.countryJsonPath; 70202 70203 if(country_familyJsonPath){ 70204 fetch(country_familyJsonPath) 70205 .then(response => response.json()) 70206 .then(result => { 70207 this.productBrandFamiliesJSON = result; 70208 70209 this.productBrandFamiliesJSON = this.productBrandFamiliesJSON.filter(item => item.families.length>0); 70210 70211 if(!this.productBrandInput.parents('.input_item').hasClass('hide_field')){ 70212 70213 } 70214 if(this.productBrandInput.length>0 && !this.productBrandInput.parents('.input_item').hasClass('hide_field')){ 70215 this.getProductBrandsData(); 70216 this.setProductBrandData(); 70217 } 70218 70219 70220 if(this.prodFamilyInput.length>0 && (this.productBrandInput.length==0 || this.productBrandInput.parents('.input_item').hasClass('hide_field') ) ){ 70221 this.getProductFamiliesData(); 70222 this.setProductFamiliesData(); 70223 } 70224 70225 }) 70226 .catch(error => { 70227 this.productBrandInput.children().not(':first-child').remove(); 70228 this.prodFamilyInput.children().not(':first-child').remove(); 70229 console.log('Error while fetching Products Family Data Json: ',error.message); 70230 }); 70231 } 70232 70233} 70234 70235/* **** */ 70236 70237 70238/********** Getters *********/ 70239distributorLocatorComp.prototype.regionCountryList = function(regionsJson, regionCode){ 70240 let countryList = regionsJson.filter(item => item.regionCode === regionCode)[0].countries.map(item=> {return {name: item.name, value: item.value}}); 70241 return countryList.length ? countryList : []; 70242} 70243 70244distributorLocatorComp.prototype.getRegionsData = function(regionsJson){ 70245 let regionList = regionsJson ? regionsJson.map(item => { return {name: item.region, code: item.regionCode}}) : []; 70246 let uniqueRegionList = [...new Set(regionList.map(item => JSON.stringify(item)))].map(item => JSON.parse(item)); 70247 this.regionsList = uniqueRegionList.sort((a, b) => a.name.localeCompare(b.name)); 70248 70249} 70250distributorLocatorComp.prototype.getCountriesData = function(countriesJson){ 70251 this.countriesList = countriesJson.sort((a, b) => a.name.localeCompare(b.name)); 70252} 70253distributorLocatorComp.prototype.getUrlParamsData = function(){ 70254 this.urlParams = new URLSearchParams(window.location.search); 70255} 70256 70257distributorLocatorComp.prototype.getStatesData = function(country){ 70258 let countryCode = country ? country : this.countryInput.val(); 70259 70260 if(countryCode=='US' && this.stateInput.length>0){ 70261 this.stateInput.parents('.input_item').show(); 70262 this.countyInput.parents('.input_item').show(); 70263 this.zipInput.parents('.input_item').show(); 70264 70265 let listOfCountries = this.filtersDataJSON.listOfCountries; 70266 70267 let matchingStates = listOfCountries.filter(item => item.countryCode==countryCode); 70268 70269 if(matchingStates.length){ 70270 this.statesList = matchingStates[0].stateDetails.sort((a, b) => a.Name.localeCompare(b.Name)); 70271 }else{ 70272 this.statesList = []; 70273 } 70274 }else{ 70275 this.stateInput.parents('.input_item').hide(); 70276 this.countyInput.parents('.input_item').hide(); 70277 this.zipInput.parents('.input_item').hide(); 70278 } 70279} 70280distributorLocatorComp.prototype.getCountyData = function(state){ 70281 70282 if(this.countryInput.val()=='US' && this.stateInput.length>0){ 70283 let stateCode = state ? state : this.stateInput.val(); 70284 let matchingStates = this.statesList.filter(item => item.Code==stateCode); 70285 70286 if(matchingStates.length){ 70287 this.countiesList = matchingStates[0].countyDetails.sort((a, b) => a.Name.localeCompare(b.Name)); 70288 }else{ 70289 this.countiesList = []; 70290 } 70291 }else{ 70292 this.countiesList = []; 70293 } 70294} 70295distributorLocatorComp.prototype.getIndustriesData = function(){ 70296 this.industriesList = this.filtersDataJSON.listOfIndustries.sort((a, b) => a.localeCompare(b)); 70297} 70298distributorLocatorComp.prototype.getProductBrandsData = function(prodFamily){ 70299 this.productBrandsList = this.productBrandFamiliesJSON; 70300 this.productBrandsList.sort((a, b) => (a.brandName > b.brandName ? 1 : -1)); 70301} 70302distributorLocatorComp.prototype.getProductFamiliesData = function(brand){ 70303 if(brand){ 70304 this.productFamiliesList = this.productBrandFamiliesJSON.filter(item => item.brandId==brand)[0].families; 70305 }else{ 70306 this.productFamiliesList = this.productBrandFamiliesJSON.map(item => item.families).flat(); 70307 } 70308 70309 this.productFamiliesList = this.productFamiliesList.filter(item => !item.productFamilyName.includes("com.tcs.pim")); 70310 this.productFamiliesList.sort((a, b) => (a.productFamilyName > b.productFamilyName ? 1 : -1)); 70311} 70312distributorLocatorComp.prototype.getProductsData = function(prodFamily){ 70313 this.uniqueProductCodes = []; 70314 if (prodFamily) { 70315 this.productsList = this.productFamiliesList.filter(item => item.p360ProductNo == prodFamily)[0].products; 70316 this.productsList.sort((a, b) => (a.productName > b.productName ? 1 : -1)); 70317 } else { 70318 this.productsList = []; 70319 } 70320 70321 this.productsList.forEach(item=> { 70322 this.uniqueProductCodes.push({label: item['productName'], value:item['p360VariantNo']}); 70323 }) 70324 70325} 70326distributorLocatorComp.prototype.getDistributorsData = function(){ 70327 //this.distributorsDataJSON = ""; 70328} 70329 70330 70331 70332 70333/********** Setters *********/ 70334distributorLocatorComp.prototype.setRegionsData = function(regionsList){ 70335 this.regionInput.children().not(':first-child').remove(); 70336 // Sort regions alphabetically by name 70337 let sortedRegions = regionsList.slice().sort((a, b) => a.name.localeCompare(b.name)); 70338 sortedRegions.forEach(item => { 70339 let option = `<option value="${item.code}">${item.name}</option>`; 70340 this.regionInput.append(option); 70341 }); 70342} 70343distributorLocatorComp.prototype.setCountriesData = function(countriesList){ 70344 this.countryInput.children().not(':first-child').remove(); 70345 // Sort countries alphabetically by name 70346 let sortedCountries = countriesList.slice().sort((a, b) => a.name.localeCompare(b.name));
70347 sortedCountries.forEach(item => { 70348 let option = `<option value="${item.value}">${item.name}</option>`; 70349 this.countryInput.append(option); 70350 }); 70351} 70352distributorLocatorComp.prototype.setUrlParamsData = function(){ 70353 let paramsFlag = false; 70354 for (const [key, value] of this.urlParams.entries()) { 70355 for (const input of this.inputBlockList.find('input,select')) { 70356 if ($(input).length && $(input).attr('name') === key ){ 70357 if(input.nodeName === "SELECT" && $(input).find(`option[value="${value}"]`).length){ 70358 paramsFlag = true; 70359 $(input).val(value); 70360 $(input).trigger('change'); 70361 }else if(input.nodeName === "INPUT"){ 70362 paramsFlag = true; 70363 $(input).val(value); 70364 } 70365 } 70366 } 70367 } 70368 if(this.urlParams.size>0 && paramsFlag){ 70369 this.submit.trigger('click'); 70370 } 70371} 70372distributorLocatorComp.prototype.setStatesData = function(){ 70373 70374 this.stateInput.children().not(':first-child').remove(); 70375 this.statesList.forEach( item => { 70376 let option = `<option value="${item.Code}">${item.Name}</option>`; 70377 70378 this.stateInput.append(option); 70379 }) 70380} 70381distributorLocatorComp.prototype.setCountiesData = function(){ 70382 this.countyInput.children().not(':first-child').remove(); 70383 this.countiesList.forEach( item => { 70384 let option = `<option value="${item.Name}">${item.Name}</option>`; 70385 70386 this.countyInput.append(option); 70387 }) 70388} 70389distributorLocatorComp.prototype.setIndustriesData = function(){ 70390 70391 this.industryInput.children().not(':first-child').remove(); 70392 // Sort industries alphabetically 70393 let sortedIndustries = this.industriesList.slice().sort((a, b) => a.localeCompare(b)); 70394 sortedIndustries.forEach(item => { 70395 let option = `<option value="${item}">${Granite.I18n.get(item)}</option>`; 70396 this.industryInput.append(option); 70397 }); 70398 // Add "Others" as the last option 70399 70400 if(this.bu.val()=='rollgoods' && !this.industriesList.includes("Others") && this.industryInput.find('option[value="Others"]').length === 0 && !this.industryInput.parents('.input_item').hasClass('hide_field') && this.industryInput.length){ 70401 this.industryInput.append(`<option value="Others">${Granite.I18n.get('Others')}</option>`); 70402 } 70403} 70404distributorLocatorComp.prototype.setProductBrandData = function(){ 70405 try { 70406 this.productBrandInput.children().not(':first-child').remove(); 70407 70408 if(this.productBrandInput.length){ 70409 this.productBrandsList.forEach( item => { 70410 let option = `<option value="${item.brandId}">${item.brandName}</option>`; 70411 this.productBrandInput.append(option); 70412 }) 70413 }else{ 70414 this.productInput.parents('.input_item').remove(); 70415 } 70416 70417 let valueExists = this.productFamiliesList.filter(item => item.brandName === this.urlParams.get('brand')).length; 70418 70419 if(this.urlParams.get('brand') && valueExists ){ 70420 this.productBrandInput.val(this.urlParams.get('brand')); 70421 this.productBrandInput.trigger('change'); 70422 }else{ 70423 this.productBrandInput.val(''); 70424 } 70425 // if(this.urlParams.get('productId')){ 70426 // this.productInput.val(this.productsList.filter(item => item.p360VariantNo === this.urlParams.get('productId'))[0].productName); 70427 // this.productInput.attr('data-value',this.urlParams.get('productId')); 70428 // }else{ 70429 // this.productInput.val(''); 70430 // this.productInput.removeAttr('data-value'); 70431 // this.productInput.attr('disabled','disabled'); 70432 70433 // } 70434 } catch (error) { 70435 console.error('Error in setProductBrandData:', error); 70436 } 70437} 70438distributorLocatorComp.prototype.setProductFamiliesData = function(){ 70439 try { 70440 this.prodFamilyInput.children().not(':first-child').remove(); 70441 70442 if(this.prodFamilyInput.length){ 70443 this.productFamiliesList.forEach( item => { 70444 let option = `<option value="${item.p360ProductNo}">${item.productFamilyName}</option>`; 70445 this.prodFamilyInput.append(option); 70446 }) 70447 }else{ 70448 this.productInput.parents('.input_item').remove(); 70449 } 70450 70451 let valueExists = this.productFamiliesList.filter(item => item.p360ProductNo === this.urlParams.get('productFamilyId')).length; 70452 70453 if(this.urlParams.get('productFamilyId') && valueExists ){ 70454 this.prodFamilyInput.val(this.urlParams.get('productFamilyId')); 70455 this.prodFamilyInput.trigger('change'); 70456 }else{ 70457 this.prodFamilyInput.val(''); 70458 }
70459 if(this.urlParams.get('productId')){ 70460 this.productInput.val(this.productsList.filter(item => item.p360VariantNo === this.urlParams.get('productId'))[0].productName); 70461 this.productInput.attr('data-value',this.urlParams.get('productId')); 70462 }else{ 70463 this.productInput.val(''); 70464 this.productInput.removeAttr('data-value'); 70465 this.productInput.attr('disabled','disabled'); 70466 70467 } 70468 } catch (error) { 70469 console.error('Error in setProductFamiliesData:', error); 70470 } 70471} 70472distributorLocatorComp.prototype.setProductsData = function(){ 70473 let self= this; 70474 70475 this.productInput.removeAttr('disabled'); 70476 70477 this.productInput.autocomplete({ 70478 source: this.uniqueProductCodes, 70479 classes: { 70480 "ui-autocomplete": "dl-product-autocomplete", 70481 }, 70482 select: function(event, ui) { 70483 event.preventDefault(); 70484 self.productInput.val(ui.item.label); 70485 self.productInput.attr('data-value',ui.item.value); 70486 }, 70487 minLength: 2 70488 }); 70489} 70490distributorLocatorComp.prototype.setCountryJsonPath = function(country_val){ 70491 70492 this.countryJsonPath = country_val ? this.countriesJSON.filter(item => item.value == country_val)[0].jsonpath : ""; 70493 this.showproductFamily = country_val ? this.countriesJSON.filter(item => item.value == country_val)[0].show_family : ""; 70494} 70495distributorLocatorComp.prototype.setDistributorsData = function(){ 70496 try { 70497 this.resultSec.children().remove(); 70498 this.resultSec.siblings('.contact_item').remove(); 70499 70500 if(this.distributorsDataJSON.length==0){ 70501 this.sorryMsg.show(); 70502 this.paginationContainer.hide(); 70503 }else{ 70504 this.sorryMsg.hide(); 70505 } 70506 70507 if(this.globalContactInfo){ 70508 let html_contactText= ` 70509 <div class="contact_item"> 70510 <div class="contact_logo"> 70511 <img src="/content/dam/dupont/amer/us/en/corporate/general/icons/DuPont_tm_rgb.png" alt="Distributor Logo" srcset=""> 70512 </div> 70513 <div class="contact_info">${this.globalContactInfo}</div> 70514 </div>`; 70515 this.resultSec.before(html_contactText); 70516 } 70517 this.distributorsDataJSON.forEach(item =>{ 70518 try { 70519 let img_src = this.logoPath ? this.logoPath+'/'+item.accountId : '/content/dam/dupont/amer/us/en/mobility/public/images/icons/no-img.jpg'; 70520 let err_msg = this.noimageiconpath ? this.noimageiconpath : '/content/dam/dupont/amer/us/en/mobility/public/images/icons/no-img.jpg'; 70521 let website_url = item.website; 70522 let address = item.accountAddress ? item.accountAddress : {}; 70523 let city = address.city && address.city.toLowerCase()!=="not applicable" ? address.city.replace(/"/g, '').trim() + ', ' : ""; 70524 let state = address.state && address.state.toLowerCase()!=="not applicable" ? address.state + ', ' : ""; 70525 let zip = address.postalCode && address.postalCode.toLowerCase()!=="not applicable" ? address.postalCode : ""; 70526 70527 let address1 = city + state + zip; 70528 70529 let country = address.country ? address.country : ""; 70530 70531 if (website_url) { 70532 website_url = website_url.replace(/^["'\s]+|["'\s]+$/g, ''); 70533 if (!website_url.startsWith('http')) { 70534 website_url = 'https://' + website_url; 70535 } 70536 } 70537 70538 let eshop_rl = item.eshopURL; 70539 if (eshop_rl) { 70540 eshop_rl = eshop_rl.replace(/^["'\s]+|["'\s]+$/g, ''); 70541 if (!eshop_rl.startsWith('http')) { 70542 eshop_rl = 'https://' + eshop_rl; 70543 } 70544 } 70545 70546 let html_item= ` 70547 <div class="item"> 70548 <div class="dealer_logo"> 70549 <img src="${img_src}" alt="Distributor Logo" srcset="" onerror="this.src='${err_msg}';this.parentNode.classList.add('no_img');"> 70550 70551 </div> 70552 <div class="dealer_info"> 70553 ${item.accountName && item.accountName.toLowerCase()!=="not applicable" ? `<div class="dealer_name">${item.accountName}</div>` : ``} 70554 ${item.accountDesc && item.accountDesc.toLowerCase()!=="not applicable" ? `<div class="dealer_desc">${item.accountDesc}</div>`: `` } 70555 <div class="address_contact"> 70556 <div class="address"> 70557 ${address.street && item.accountName.toLowerCase()!=="not applicable" ? `<div class="address_item address1">${address.street}</div>` : ``} 70558 ${address1 ? `<div class="address_item city">${address1}</div>` : ``} 70559 ${address.country && item.accountName.toLowerCase()!=="not applicable" ? `<div class="address_item country">${address.country}</div>` : ``} 70560 </div> 70561 <div class="address_detail"> 70562 <div class="address_details_top"> 70563 ${item.website && item.website.toLowerCase()!=="not applicable" ? `<div class="address_item website" data-label="Visit Website"><a data-analytics="link_track" target="_blank" href="${website_url}">${Granite.I18n.get('Visit Website')}</a></div>` : ``} 70564 ${item.mobilenumber && item.mobilenumber.toLowerCase()!=="not applicable" ? `<div class="address_item mobile" data-label="Mobile Number">${item.mobilenumber}</div>` : `` } 70565 ${item.phone && item.phone.toLowerCase()!=="not applicable" ? `<div class="address_item phone" data-label="Phone Number">${item.phone}</div>` : ``} 70566 ${item.eshopURL && item.eshopURL.toLowerCase()!=="not applicable"? `<div class="address_item e-shop" data-label="Visit E-shop"><a target="_blank" data-analytics="link_track" href="${eshop_rl}">Visit E-shop</a></div>`:``} 70567 </div> 70568 ${item.accountEmail && item.accountEmail.toLowerCase()!=="not applicable" ? `<div class="address_item email" data-label="Email"><a href="mailto:${item.accountEmail}" >${item.accountEmail}</a></div>` : ``} 70569 </div> 70570 </div> 70571 70572 70573 </div>
70574 </div>`; 70575 70576 this.resultSec.append(html_item); 70577 } catch (error) { 70578 console.error('Error in setDistributorsData - inner loop:', error); 70579 } 70580 }); 70581 this.distributorCnt.text(this.distributorsDataJSON.length); 70582 } catch (error) { 70583 console.error('Error in setDistributorsData:', error); 70584 } 70585} 70586/********** */ 70587 70588 70589/********** Events *********/ 70590distributorLocatorComp.prototype.bindEvents = function(){ 70591 this.regionInput.on('change', $.proxy(this.changeInput, this)); 70592 this.countryInput.on('change', $.proxy(this.changeInput, this)); 70593 this.stateInput.on('change', $.proxy(this.changeInput, this)); 70594 this.productBrandInput.on('change', $.proxy(this.changeInput, this)); 70595 this.prodFamilyInput.on('change', $.proxy(this.changeInput, this)); 70596 this.dlScrollTopBtn.on('click',$.proxy(this.scrollToResultsTop, this)); 70597 70598 70599 this.clearAll.on('click', $.proxy(this.clickClear, this)); 70600 this.submit.on('click', $.proxy(this.clickResults, this)); 70601 if(this.required_tracking) { 70602 this.trackUserClicks(); 70603 } 70604} 70605 70606/********** Utility Methods *********/ 70607distributorLocatorComp.prototype.clearResultsSec = function(){ 70608 this.formID[0].reset(); 70609 this.inputBlockList.find('.err_msg').hide(); 70610 this.formID.find('.input_item.hide_country').show(); 70611} 70612distributorLocatorComp.prototype.addListJStoDFResults =function(){ 70613 let self=this; 70614 let listClass = 'results_list'; 70615 let itemName = 'dealer_name'; 70616 this.distributorListNew = new List(listClass, { 70617 valueNames: [itemName], 70618 page: this.itemsPerPage, 70619 pagination: [{ 70620 paginationClass: 'pagination', 70621 innerWindow: 2, 70622 outerWindow: 2 70623 }] 70624 }); 70625 70626 this.distributorListNew.on('searchComplete', function () { 70627 self.distributorCnt.html(self.distributorListNew.update().matchingItems.length); 70628 }) 70629 70630 this.distributorListNew.on('updated', function () { 70631 $('#page-prev, #page-next').show(); 70632 //hide next & prev when not needed 70633 setTimeout(function () { 70634 70635 if ($('.pagination').children().length < 2) { 70636 $('#page-prev, #page-next').hide(); 70637 } 70638 else if ($('.pagination li:first-child').hasClass('active')) { 70639 $('#page-prev').hide(); 70640 } 70641 else if ($('.pagination li:last-child').hasClass('active')) 70642 { 70643 $('#page-next').hide(); 70644 } 70645 }, 0); 70646 }); 70647 70648 this.searchBox[0].onkeyup = function (e) { 70649 self.distributorListNew.search(e.target.value); 70650 self.searchText = e.target.value; 70651 self.searchBoxTimeOut = setTimeout(function(){ 70652 if(self.searchText == self.dlComp.find("#search").val()){ 70653 if((self.prevousSearchTerm != self.searchText) && self.searchText){ 70654 if(_satellite){ 70655 if (digitalData && digitalData.df) { 70656 digitalData.df['searchTerm'] = self.searchText; 70657 } 70658 _satellite.track("dl_searchterm"); 70659 70660 } 70661 } 70662 self.prevousSearchTerm = self.searchText; 70663 clearTimeout(self.searchBoxTimeOut); 70664 } 70665 70666 },3000); 70667 70668 } 70669 70670 this.pageNext.on('click', function(){ 70671 $('.pagination .active').next().trigger('click'); 70672 $('html, body').scrollTop(self.dlComp.find('#results_list').offset().top-100); 70673 }); 70674 this.pagePrev.on('click', function(){ 70675 $('.pagination .active').prev().trigger('click'); 70676 $('html, body').scrollTop(self.dlComp.find('#results_list').offset().top-100); 70677 }); 70678} 70679distributorLocatorComp.prototype.scrollToResultsTop =function(e){ 70680 $('html, body').scrollTop(this.dlComp.find('#results_list').offset().top-100); 70681} 70682distributorLocatorComp.prototype.trackUserClicks =function(){ 70683 let self = this; 70684 70685 // Clear localStorage keys matching form input names on initial load 70686 // so the smart form does not pre-populate from stale localStorage data 70687 if(!window.dlInitialClearDone) { 70688 window.dlInitialClearDone = true; 70689 // Remove keys for distributor locator form inputs 70690 self.formID.find('.input_elem').each(function(){ 70691 let name = $(this).attr('name'); 70692 if(name) { 70693 localStorage.removeItem(name); 70694 } 70695 }); 70696 // Also remove keys for tracking details 70697 localStorage.removeItem('distributorName');
70698 localStorage.removeItem('clickedElement'); 70699 } 70700 70701 // Store for hidden field values that need to persist 70702 window.dlHiddenFieldValues = window.dlHiddenFieldValues || {}; 70703 70704 // Function to apply stored hidden field values to the DOM 70705 const applyHiddenFieldValues = function() { 70706 if($('#smart-form-container').length && Object.keys(window.dlHiddenFieldValues).length > 0) { 70707 for(const [key, value] of Object.entries(window.dlHiddenFieldValues)) { 70708 let $input = $('#smart-form-container').find(`input[localstorage="${key}"]`); 70709 if($input.length && $input.val() !== value) { 70710 $input.val(value); 70711 } 70712 } 70713 } 70714 }; 70715 70716 // Setup MutationObserver to watch for form re-renders and re-apply values 70717 const setupHiddenFieldObserver = function() { 70718 if(window.dlHiddenFieldObserver) return; // Already set up 70719 70720 const smartFormContainer = document.getElementById('smart-form-container'); 70721 if(!smartFormContainer) return; 70722 70723 window.dlHiddenFieldObserver = new MutationObserver(function(mutations) { 70724 // Use setTimeout to let the form finish rendering 70725 setTimeout(applyHiddenFieldValues, 0); 70726 }); 70727 70728 window.dlHiddenFieldObserver.observe(smartFormContainer, { 70729 childList: true, 70730 subtree: true, 70731 attributes: true, 70732 attributeFilter: ['value'] 70733 }); 70734 }; 70735 70736 const userNavigationDetails = function(){ 70737 let details ={}; 70738 details['distributorName'] = $(this).closest('.item').find('.dealer_name')? $(this).closest('.item').find('.dealer_name').text() : ""; 70739 details['clickedElement'] = $(this).attr('data-label') ? $(this).attr('data-label') : $(this).text().trim(); 70740 70741 // Use captured search values from Get Results click instead of current form values 70742 // This ensures we track the actual search criteria used, not potentially modified values 70743 if(Object.keys(self.lastSearchValues).length > 0) { 70744 for(const [key, value] of Object.entries(self.lastSearchValues)){ 70745 details[key] = value; 70746 } 70747 } else { 70748 // Fallback: read from form if no search has been performed yet 70749 self.formID.find('.input_elem').each(function(){ 70750 let input = $(this); 70751 if(input.length && input.val()){ 70752 details[input.attr('name')] = input.find('option:selected').text() ? input.find('option:selected').text() : input.val(); 70753 } 70754 }); 70755 } 70756 return details; 70757 } 70758 // Helper to bind click event based on cookie 70759 const bindAddressItemClick = () => { 70760 this.specificElementsToTrack.forEach(selector => { 70761 this.dlComp.off('click', `.${selector}`); 70762 this.dlComp.on('click', `.${selector}`, function(event){ 70763 // Ignore click if it landed on a ::before pseudo-element. 70764 // When a pseudo-element is clicked, event.target is the host element itself (not a child). 70765 // So if the click target is the delegated element and it has a ::before with content, ignore it. 70766 if (event.target === this) { 70767 const style = window.getComputedStyle(this, '::before'); 70768 if (style && style.content && style.content !== 'none' && style.content !== '""' && style.content !== "''") { 70769 return; 70770 } 70771 } 70772 if(_satellite.cookie.get('gatedRegisteredEmail')){ 70773 let userNavDetails = userNavigationDetails.call(this, self); 70774 // Build a unique key including search filters to prevent duplicate engagement tracking 70775 let searchKey = Object.keys(self.lastSearchValues).length > 0 70776 ? Object.values(self.lastSearchValues).join('|') 70777 : '';
70778 let engagementKey = (userNavDetails['distributorName'] || '') + '|' + (userNavDetails['clickedElement'] || '') + '|' + searchKey; 70779 if(!self.trackedEngagements.has(engagementKey)){ 70780 self.trackedEngagements.add(engagementKey); 70781 self._saveEngagementCookie(); 70782 event.stopPropagation(); 70783 // Queue the engagement â submissions are spaced 30s apart to prevent Marketo conflicts 70784 self._queueEngagement(userNavDetails); 70785 } 70786 }else{ 70787 event.preventDefault(); 70788 70789 // Store the original link href and target so it can be opened after gating 70790 const $clickedLink = $(this).is('a') ? $(this) : $(this).find('a'); 70791 window.dlPendingLink = { 70792 href: $clickedLink.attr('href'), 70793 target: $clickedLink.attr('target') || '_self' 70794 }; 70795 70796 // Store user nav details in hidden form fields and localStorage 70797 let userNavDetails = userNavigationDetails.call(this, self); 70798 70799 // Track engagement in cookie on first click (before gating) 70800 let searchKey = Object.keys(self.lastSearchValues).length > 0 70801 ? Object.values(self.lastSearchValues).join('|') 70802 : '';
70803 let engagementKey = (userNavDetails['distributorName'] || '') + '|' + (userNavDetails['clickedElement'] || '') + '|' + searchKey; 70804 self.trackedEngagements.add(engagementKey); 70805 self._saveEngagementCookie(); 70806 for(const [key, value] of Object.entries(userNavDetails)){ 70807 if($('#smart-form-container').length) { 70808 // Store in window object for MutationObserver to re-apply 70809 window.dlHiddenFieldValues[key] = value; 70810 // Set the DOM value directly 70811 $('#smart-form-container').find(`input[localstorage="${key}"]`).val(value); 70812 } 70813 } 70814 // Setup observer to persist values on form re-renders 70815 setupHiddenFieldObserver(); 70816 // Optionally trigger gating modal if needed 70817 } 70818 }); 70819 }); 70820 }; 70821 // Initial binding on page load 70822 bindAddressItemClick(); 70823 // After gated form submit: open the pending link 70824 $(document).on('gatedRegisteredEmailSet', function() { 70825 if(window.dlPendingLink && window.dlPendingLink.href) { 70826 window.open(window.dlPendingLink.href, window.dlPendingLink.target); 70827 window.dlPendingLink = null; 70828 } 70829 }); 70830 // After modal close button click (without submitting): open the pending link 70831 $(document).on('gatedModalClosed', function() { 70832 if(window.dlPendingLink && window.dlPendingLink.href) { 70833 window.open(window.dlPendingLink.href, window.dlPendingLink.target); 70834 window.dlPendingLink = null; 70835 } 70836 }); 70837 70838} 70839 70840 70841let dlCompObj = new distributorLocatorComp(); 70842dlCompObj.init(); 70843 70844 70845 70846/*! List.js v1.5.0 (http://listjs.com) by Jonny Strömberg (http://javve.com) */ 70847var List=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,r){function n(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}var i=r(4),s=/\s+/;Object.prototype.toString;t.exports=function(t){return new n(t)},n.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array(),r=i(e,t);return~r||e.push(t),this.el.className=e.join(" "),this},n.prototype.remove=function(t){if(this.list)return this.list.remove(t),this;var e=this.array(),r=i(e,t);return~r&&e.splice(r,1),this.el.className=e.join(" "),this},n.prototype.toggle=function(t,e){return this.list?("undefined"!=typeof e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):("undefined"!=typeof e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},n.prototype.array=function(){var t=this.el.getAttribute("class")||"",e=t.replace(/^\s+|\s+$/g,""),r=e.split(s);return""===r[0]&&r.shift(),r},n.prototype.has=n.prototype.contains=function(t){return this.list?this.list.contains(t):!!~i(this.array(),t)}},function(t,e,r){var n=window.addEventListener?"addEventListener":"attachEvent",i=window.removeEventListener?"removeEventListener":"detachEvent",s="addEventListener"!==n?"on":"",a=r(5);e.bind=function(t,e,r,i){t=a(t);for(var o=0;o<t.length;o++)t[o][n](s+e,r,i||!1)},e.unbind=function(t,e,r,n){t=a(t);for(var o=0;o<t.length;o++)t[o][i](s+e,r,n||!1)}},function(t,e){t.exports=function(t){return function(e,r,n){var i=this;this._values={},this.found=!1,this.filtered=!1;var s=function(e,r,n){if(void 0===r)n?i.values(e,n):i.values(e);else{i.elm=r;var s=t.templater.get(i,e);i.values(s)}};this.values=function(e,r){if(void 0===e)return i._values;for(var n in e)i._values[n]=e[n];r!==!0&&t.templater.set(i,i.values())},this.show=function(){t.templater.show(i)},this.hide=function(){t.templater.hide(i)},this.matching=function(){return t.filtered&&t.searched&&i.found&&i.filtered||t.filtered&&!t.searched&&i.filtered||!t.filtered&&t.searched&&i.found||!t.filtered&&!t.searched},this.visible=function(){return!(!i.elm||i.elm.parentNode!=t.list)},s(e,r,n)}}},function(t,e){var r=function(t,e,r){return r?t.getElementsByClassName(e)[0]:t.getElementsByClassName(e)},n=function(t,e,r){return e="."+e,r?t.querySelector(e):t.querySelectorAll(e)},i=function(t,e,r){for(var n=[],i="*",s=t.getElementsByTagName(i),a=s.length,o=new RegExp("(^|\\s)"+e+"(\\s|$)"),l=0,u=0;l<a;l++)if(o.test(s[l].className)){if(r)return s[l];n[u]=s[l],u++}return n};t.exports=function(){return function(t,e,s,a){return a=a||{},a.test&&a.getElementsByClassName||!a.test&&document.getElementsByClassName?r(t,e,s):a.test&&a.querySelector||!a.test&&document.querySelector?n(t,e,s):i(t,e,s)}}()},function(t,e){var r=[].indexOf;
70847t.exports=function(t,e){if(r)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},function(t,e){function r(t){return"[object Array]"===Object.prototype.toString.call(t)}t.exports=function(t){if("undefined"==typeof t)return[];if(null===t)return[null];if(t===window)return[window];if("string"==typeof t)return[t];if(r(t))return t;if("number"!=typeof t.length)return[t];if("function"==typeof t&&t instanceof Function)return[t];for(var e=[],n=0;n<t.length;n++)(Object.prototype.hasOwnProperty.call(t,n)||n in t)&&e.push(t[n]);return e.length?e:[]}},function(t,e){t.exports=function(t){return t=void 0===t?"":t,t=null===t?"":t,t=t.toString()}},function(t,e){t.exports=function(t){for(var e,r=Array.prototype.slice.call(arguments,1),n=0;e=r[n];n++)if(e)for(var i in e)t[i]=e[i];return t}},function(t,e){t.exports=function(t){var e=function(r,n,i){var s=r.splice(0,50);i=i||[],i=i.concat(t.add(s)),r.length>0?setTimeout(function(){e(r,n,i)},1):(t.update(),n(i))};return e}},function(t,e){t.exports=function(t){return t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void 0===e)t.filtered=!1;else{t.filtered=!0;for(var r=t.items,n=0,i=r.length;n<i;n++){var s=r[n];e(s)?s.filtered=!0:s.filtered=!1}}return t.update(),t.trigger("filterComplete"),t.visibleItems}}},function(t,e,r){var n=(r(0),r(1)),i=r(7),s=r(6),a=r(3),o=r(19);t.exports=function(t,e){e=e||{},e=i({location:0,distance:100,threshold:.4,multiSearch:!0,searchClass:"fuzzy-search"},e);var r={search:function(n,i){for(var s=e.multiSearch?n.replace(/ +$/,"").split(/ +/):[n],a=0,o=t.items.length;a<o;a++)r.item(t.items[a],i,s)},item:function(t,e,n){for(var i=!0,s=0;s<n.length;s++){for(var a=!1,o=0,l=e.length;o<l;o++)r.values(t.values(),e[o],n[s])&&(a=!0);a||(i=!1)}t.found=i},values:function(t,r,n){if(t.hasOwnProperty(r)){var i=s(t[r]).toLowerCase();if(o(i,n,e))return!0}return!1}};return n.bind(a(t.listContainer,e.searchClass),"keyup",function(e){var n=e.target||e.srcElement;t.search(n.value,r.search)}),function(e,n){t.search(e,n,r.search)}}},function(t,e,r){var n=r(18),i=r(3),s=r(7),a=r(4),o=r(1),l=r(6),u=r(0),c=r(17),f=r(5);t.exports=function(t,e,h){var d,v=this,m=r(2)(v),g=r(8)(v),p=r(12)(v);d={start:function(){v.listClass="list",v.searchClass="search",v.sortClass="sort",v.page=1e4,v.i=1,v.items=[],v.visibleItems=[],v.matchingItems=[],v.searched=!1,v.filtered=!1,v.searchColumns=void 0,v.handlers={updated:[]},v.valueNames=[],v.utils={getByClass:i,extend:s,indexOf:a,events:o,toString:l,naturalSort:n,classes:u,getAttribute:c,toArray:f},v.utils.extend(v,e),v.listContainer="string"==typeof t?document.getElementById(t):t,v.listContainer&&(v.list=i(v.listContainer,v.listClass,!0),v.parse=r(13)(v),v.templater=r(16)(v),v.search=r(14)(v),v.filter=r(9)(v),v.sort=r(15)(v),v.fuzzySearch=r(10)(v,e.fuzzySearch),this.handlers(),this.items(),this.pagination(),v.update())},handlers:function(){for(var t in v.handlers)v[t]&&v.on(t,v[t])},items:function(){v.parse(v.list),void 0!==h&&v.add(h)},pagination:function(){if(void 0!==e.pagination){e.pagination===!0&&(e.pagination=[{}]),void 0===e.pagination[0]&&(e.pagination=[e.pagination]);for(var t=0,r=e.pagination.length;t<r;t++)p(e.pagination[t])}}},this.reIndex=function(){v.items=[],v.visibleItems=[],v.matchingItems=[],v.searched=!1,v.filtered=!1,v.parse(v.list)},this.toJSON=function(){for(var t=[],e=0,r=v.items.length;e<r;e++)t.push(v.items[e].values());return t},this.add=function(t,e){if(0!==t.length){if(e)return void g(t,e);var r=[],n=!1;void 0===t[0]&&(t=[t]);for(var i=0,s=t.length;i<s;i++){var a=null;n=v.items.length>v.page,a=new m(t[i],void 0,n),v.items.push(a),r.push(a)}return v.update(),r}},this.show=function(t,e){return this.i=t,this.page=e,v.update(),v},this.remove=function(t,e,r){for(var n=0,i=0,s=v.items.length;i<s;i++)v.items[i].values()[t]==e&&(v.templater.remove(v.items[i],r),v.items.splice(i,1),s--,i--,n++);return v.update(),n},this.get=function(t,e){for(var r=[],n=0,i=v.items.length;n<i;n++){var s=v.items[n];s.values()[t]==e&&r.push(s)}return r},this.size=function(){return v.items.length},this.clear=function(){return v.templater.clear(),v.items=[],v},this.on=function(t,e){return v.handlers[t].push(e),v},this.off=function(t,e){var r=v.handlers[t],n=a(r,e);return n>-1&&r.splice(n,1),v},this.trigger=function(t){for(var e=v.handlers[t].length;e--;)v.handlers[t][e](v);return v},this.reset={filter:function(){for(var t=v.items,e=t.length;e--;)t[e].filtered=!1;return v},search:function(){for(var t=v.items,e=t.length;e--;)t[e].found=!1;return v}},this.update=function(){var t=v.items,e=t.length;v.visibleItems=[],v.matchingItems=[],v.templater.clear();for(var r=0;r<e;r++)t[r].matching()&&v.matchingItems.length+1>=v.i&&v.visibleItems.length<v.page?(t[r].show(),v.visibleItems.push(t[r]),v.matchingItems.push(t[r])):t[r].matching()?(v.matchingItems.push(t[r]),t[r].hide()):t[r].hide();return v.trigger("updated"),v},d.start()}},function(t,e,r){var n=r(0),i=r(1),s=r(11);t.exports=function(t){var e=function(e,i){var s,o=t.matchingItems.length,l=t.i,u=t.page,c=Math.ceil(o/u),f=Math.ceil(l/u),h=i.innerWindow||2,d=i.left||i.outerWindow||0,v=i.right||i.outerWindow||0;v=c-v,e.clear();for(var m=1;m<=c;m++){var g=f===m?"active":"";r.number(m,d,v,f,h)?(s=e.add({page:m,dotted:!1})[0],g&&n(s.elm).add(g),a(s.elm,m,u)):r.dotted(e,m,d,v,f,h,e.size())&&(s=e.add({page:"...",dotted:!0})[0],n(s.elm).add("disabled"))}},r={number:function(t,e,r,n,i){return this.left(t,e)||this.right(t,r)||this.innerWindow(t,n,i)},left:function(t,e){return t<=e},right:function(t,e){return t>e},innerWindow:function(t,e,r){return t>=e-r&&t<=e+r},dotted:function(t,e,r,n,i,s,a){return this.dottedLeft(t,e,r,n,i,s)||this.dottedRight(t,e,r,n,i,s,a)},dottedLeft:function(t,e,r,n,i,s){return e==r+1&&!this.innerWindow(e,i,s)&&!this.right(e,n)},dottedRight:function(t,e,r,n,i,s,a){return!t.items[a-1].values().dotted&&(e==n&&!this.innerWindow(e,i,s)&&!this.right(e,n))}},a=function(e,r,n){i.bind(e,"click",function(){t.show((r-1)*n+1,n)})};return function(r){var n=new s(t.listContainer.id,{listClass:r.paginationClass||"pagination",item:"<li><a class='page' href='javascript:function Z(){Z=\"\"}Z()'></a></li>",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});t.on("updated",function(){e(n,r)}),e(n,r)}}},function(t,e,r){t.exports=function(t){var e=r(2)(t),n=function(t){for(var e=t.childNodes,r=[],n=0,i=e.length;n<i;n++)void 0===e[n].data&&r.push(e[n]);return r},i=function(r,n){for(var i=0,s=r.length;i<s;i++)t.items.push(new e(n,r[i]))},s=function(e,r){var n=e.splice(0,50);i(n,r),e.length>0?setTimeout(function(){s(e,r)}
70847,1):(t.update(),t.trigger("parseComplete"))};return t.handlers.parseComplete=t.handlers.parseComplete||[],function(){var e=n(t.list),r=t.valueNames;t.indexAsync?s(e,r):i(e,r)}}},function(t,e){t.exports=function(t){var e,r,n,i,s={resetList:function(){t.i=1,t.templater.clear(),i=void 0},setOptions:function(t){2==t.length&&t[1]instanceof Array?r=t[1]:2==t.length&&"function"==typeof t[1]?(r=void 0,i=t[1]):3==t.length?(r=t[1],i=t[2]):r=void 0},setColumns:function(){0!==t.items.length&&void 0===r&&(r=void 0===t.searchColumns?s.toArray(t.items[0].values()):t.searchColumns)},setSearchString:function(e){e=t.utils.toString(e).toLowerCase(),e=e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),n=e},toArray:function(t){var e=[];for(var r in t)e.push(r);return e}},a={list:function(){for(var e=0,r=t.items.length;e<r;e++)a.item(t.items[e])},item:function(t){t.found=!1;for(var e=0,n=r.length;e<n;e++)if(a.values(t.values(),r[e]))return void(t.found=!0)},values:function(r,i){return!!(r.hasOwnProperty(i)&&(e=t.utils.toString(r[i]).toLowerCase(),""!==n&&e.search(n)>-1))},reset:function(){t.reset.search(),t.searched=!1}},o=function(e){return t.trigger("searchStart"),s.resetList(),s.setSearchString(e),s.setOptions(arguments),s.setColumns(),""===n?a.reset():(t.searched=!0,i?i(n,r):a.list()),t.update(),t.trigger("searchComplete"),t.visibleItems};return t.handlers.searchStart=t.handlers.searchStart||[],t.handlers.searchComplete=t.handlers.searchComplete||[],t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"keyup",function(e){var r=e.target||e.srcElement,n=""===r.value&&!t.searched;n||o(r.value)}),t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"input",function(t){var e=t.target||t.srcElement;""===e.value&&o("")}),o}},function(t,e){t.exports=function(t){var e={els:void 0,clear:function(){for(var r=0,n=e.els.length;r<n;r++)t.utils.classes(e.els[r]).remove("asc"),t.utils.classes(e.els[r]).remove("desc")},getOrder:function(e){var r=t.utils.getAttribute(e,"data-order");return"asc"==r||"desc"==r?r:t.utils.classes(e).has("desc")?"asc":t.utils.classes(e).has("asc")?"desc":"asc"},getInSensitive:function(e,r){var n=t.utils.getAttribute(e,"data-insensitive");
70847"false"===n?r.insensitive=!1:r.insensitive=!0},setOrder:function(r){for(var n=0,i=e.els.length;n<i;n++){var s=e.els[n];if(t.utils.getAttribute(s,"data-sort")===r.valueName){var a=t.utils.getAttribute(s,"data-order");"asc"==a||"desc"==a?a==r.order&&t.utils.classes(s).add(r.order):t.utils.classes(s).add(r.order)}}}},r=function(){t.trigger("sortStart");var r={},n=arguments[0].currentTarget||arguments[0].srcElement||void 0;n?(r.valueName=t.utils.getAttribute(n,"data-sort"),e.getInSensitive(n,r),r.order=e.getOrder(n)):(r=arguments[1]||r,r.valueName=arguments[0],r.order=r.order||"asc",r.insensitive="undefined"==typeof r.insensitive||r.insensitive),e.clear(),e.setOrder(r);var i,s=r.sortFunction||t.sortFunction||null,a="desc"===r.order?-1:1;i=s?function(t,e){return s(t,e,r)*a}:function(e,n){var i=t.utils.naturalSort;return i.alphabet=t.alphabet||r.alphabet||void 0,!i.alphabet&&r.insensitive&&(i=t.utils.naturalSort.caseInsensitive),i(e.values()[r.valueName],n.values()[r.valueName])*a},t.items.sort(i),t.update(),t.trigger("sortComplete")};return t.handlers.sortStart=t.handlers.sortStart||[],t.handlers.sortComplete=t.handlers.sortComplete||[],e.els=t.utils.getByClass(t.listContainer,t.sortClass),t.utils.events.bind(e.els,"click",r),t.on("searchStart",e.clear),t.on("filterStart",e.clear),r}},function(t,e){var r=function(t){var e,r=this,n=function(){e=r.getItemSource(t.item),e&&(e=r.clearSourceItem(e,t.valueNames))};this.clearSourceItem=function(e,r){for(var n=0,i=r.length;n<i;n++){var s;if(r[n].data)for(var a=0,o=r[n].data.length;a<o;a++)e.setAttribute("data-"+r[n].data[a],"");else r[n].attr&&r[n].name?(s=t.utils.getByClass(e,r[n].name,!0),s&&s.setAttribute(r[n].attr,"")):(s=t.utils.getByClass(e,r[n],!0),s&&(s.innerHTML=""));s=void 0}return e},this.getItemSource=function(e){if(void 0===e){for(var r=t.list.childNodes,n=0,i=r.length;n<i;n++)if(void 0===r[n].data)return r[n].cloneNode(!0)}else{if(/<tr[\s>]/g.exec(e)){var s=document.createElement("tbody");return s.innerHTML=e,s.firstChild}if(e.indexOf("<")!==-1){var a=document.createElement("div");return a.innerHTML=e,a.firstChild}var o=document.getElementById(t.item);if(o)return o}},this.get=function(e,n){r.create(e);for(var i={},s=0,a=n.length;s<a;s++){var o;if(n[s].data)for(var l=0,u=n[s].data.length;l<u;l++)i[n[s].data[l]]=t.utils.getAttribute(e.elm,"data-"+n[s].data[l]);else n[s].attr&&n[s].name?(o=t.utils.getByClass(e.elm,n[s].name,!0),i[n[s].name]=o?t.utils.getAttribute(o,n[s].attr):""):(o=t.utils.getByClass(e.elm,n[s],!0),i[n[s]]=o?o.innerHTML:"");o=void 0}return i},this.set=function(e,n){var i=function(e){for(var r=0,n=t.valueNames.length;r<n;r++)if(t.valueNames[r].data){for(var i=t.valueNames[r].data,s=0,a=i.length;s<a;s++)if(i[s]===e)return{data:e}}else{if(t.valueNames[r].attr&&t.valueNames[r].name&&t.valueNames[r].name==e)return t.valueNames[r];if(t.valueNames[r]===e)return e}},s=function(r,n){var s,a=i(r);a&&(a.data?e.elm.setAttribute("data-"+a.data,n):a.attr&&a.name?(s=t.utils.getByClass(e.elm,a.name,!0),s&&s.setAttribute(a.attr,n)):(s=t.utils.getByClass(e.elm,a,!0),s&&(s.innerHTML=n)),s=void 0)};if(!r.create(e))for(var a in n)n.hasOwnProperty(a)&&s(a,n[a])},this.create=function(t){if(void 0!==t.elm)return!1;if(void 0===e)throw new Error("The list need to have at list one item on init otherwise you'll have to add a template.");var n=e.cloneNode(!0);return n.removeAttribute("id"),t.elm=n,r.set(t,t.values()),!0},this.remove=function(e){e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.show=function(e){r.create(e),t.list.appendChild(e.elm)},this.hide=function(e){void 0!==e.elm&&e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.clear=function(){if(t.list.hasChildNodes())for(;t.list.childNodes.length>=1;)t.list.removeChild(t.list.firstChild)},n()};t.exports=function(t){return new r(t)}},function(t,e){t.exports=function(t,e){var r=t.getAttribute&&t.getAttribute(e)||null;if(!r)for(var n=t.attributes,i=n.length,s=0;s<i;s++)void 0!==e[s]&&e[s].nodeName===e&&(r=e[s].nodeValue);return r}},function(t,e,r){"use strict";function n(t){return t>=48&&t<=57}function i(t,e){for(var r=(t+="").length,i=(e+="").length,s=0,l=0;s<r&&l<i;){var u=t.charCodeAt(s),c=e.charCodeAt(l);if(n(u)){if(!n(c))return u-c;for(var f=s,h=l;
7084748===u&&++f<r;)u=t.charCodeAt(f);for(;48===c&&++h<i;)c=e.charCodeAt(h);for(var d=f,v=h;d<r&&n(t.charCodeAt(d));)++d;for(;v<i&&n(e.charCodeAt(v));)++v;var m=d-f-v+h;if(m)return m;for(;f<d;)if(m=t.charCodeAt(f++)-e.charCodeAt(h++))return m;s=d,l=v}else{if(u!==c)return u<o&&c<o&&a[u]!==-1&&a[c]!==-1?a[u]-a[c]:u-c;++s,++l}}return r-i}var s,a,o=0;i.caseInsensitive=i.i=function(t,e){return i((""+t).toLowerCase(),(""+e).toLowerCase())},Object.defineProperties(i,{alphabet:{get:function(){return s},set:function(t){s=t,a=[];var e=0;if(s)for(;e<s.length;e++)a[s.charCodeAt(e)]=e;for(o=a.length,e=0;e<o;e++)void 0===a[e]&&(a[e]=-1)}}}),t.exports=i},function(t,e){t.exports=function(t,e,r){function n(t,r){var n=t/e.length,i=Math.abs(o-r);return s?n+i/s:i?1:n}var i=r.location||0,s=r.distance||100,a=r.threshold||.4;if(e===t)return!0;if(e.length>32)return!1;var o=i,l=function(){var t,r={};for(t=0;t<e.length;t++)r[e.charAt(t)]=0;for(t=0;t<e.length;t++)r[e.charAt(t)]|=1<<e.length-t-1;return r}(),u=a,c=t.indexOf(e,o);c!=-1&&(u=Math.min(n(0,c),u),c=t.lastIndexOf(e,o+e.length),c!=-1&&(u=Math.min(n(0,c),u)));var f=1<<e.length-1;c=-1;for(var h,d,v,m=e.length+t.length,g=0;g<e.length;g++){for(h=0,d=m;h<d;)n(g,o+d)<=u?h=d:m=d,d=Math.floor((m-h)/2+h);m=d;var p=Math.max(1,o-d+1),C=Math.min(o+d,t.length)+e.length,y=Array(C+2);y[C+1]=(1<<g)-1;for(var b=C;b>=p;b--){var w=l[t.charAt(b-1)];if(0===g?y[b]=(y[b+1]<<1|1)&w:y[b]=(y[b+1]<<1|1)&w|((v[b+1]|v[b])<<1|1)|v[b+1],y[b]&f){var x=n(g,b-1);if(x<=u){if(u=x,c=b-1,!(c>o))break;p=Math.max(1,2*o-c)}}}if(n(g+1,o)>u)break;v=y}return!(c<0)}}]); 70848var distributorFinderComp = function(){ 70849 this.dfComp =$($('.distributor-finder')[0]); 70850 70851 if(this.dfComp.length>0){ 70852 70853 /*Containers*/ 70854 this.distributorFinderForm = this.dfComp.find('#distributor-finder_form'); 70855 this.selectElementsList = this.dfComp.find('.select-css-distributor'); 70856 this.distResultBlockWrapper = this.dfComp.find('.distributor-finder_res-wrapper'); 70857 this.distResultBlock = this.dfComp.find('.distributor-finder_res'); 70858 this.paginationContainer = this.dfComp.find('.pagination-container'); 70859 this.resSearchInput = this.dfComp.find('.distributor-finder_res-search'); 70860 this.dfFilterBlk = this.dfComp.find('.distributor-finder_param'); 70861 70862 this.distFinderFiltersBlk = this.dfComp.find('.distributor-finder_filter'); 70863 this.pageNext = this.dfComp.find('#page-next'); 70864 this.pagePrev = this.dfComp.find('#page-prev'); 70865 this.dFScrollTopBtn = this.dfComp.find('.distributor-finder_res-top'); 70866 70867 /*Buttons*/ 70868 this.clearResultsBtn = this.dfComp.find('#clearDistributorSearch'); 70869 this.getResultsBtn = this.dfComp.find('#getDistributorResults'); 70870 70871 /*Input Elements*/ 70872 this.brandSelector = this.dfComp.find('#brand-selector'); 70873 this.productsPageRootPath = this.dfComp.find('#productPageRootpath'); 70874 this.productSelector = this.dfComp.find('#product-selector'); 70875 this.productSelectorHidden =this.dfComp.find('#product-selector-hidden'); 70876 this.industrySelector =this.dfComp.find('#industry-selector'); 70877 this.countrySelector = this.dfComp.find('#country-selector'); 70878 this.stateSelector = this.dfComp.find('#state-selector'); 70879 this.countySelector = this.dfComp.find('#county-selector'); 70880 this.zipSelector = this.dfComp.find('#zip-selector'); 70881 this.categorySelector= this.dfComp.find('#category-selector'); 70882 this.radius = this.dfComp.find('#radius'); 70883 70884 this.selectInputsList = this.dfComp.find('select.input-elem'); 70885 this.textInputsList = this.dfComp.find('input.input-elem'); 70886 70887 this.buInfo = this.dfComp.find('#bu-info'); 70888 this.itemsPerPage = this.dfComp.find('#itemsPerPage').val(); 70889 this.searchBox = this.dfComp.find('#searchbox'); 70890 this.distributorCnt = this.dfComp.find('#distributor-count'); 70891 this.showQueryParams = this.dfComp.find('#showQueryParams'); 70892 this.productPageView = this.dfComp.find('#productPageView'); 70893 70894 this.resultData = this.dfComp.find("#resultdata"); 70895 this.dfFiltersObjList=[]; 70896 this.productsListURL = '/dupont/molykoteProductNamesListNew'; 70897 70898 this.location_url = window.location.hash; 70899 this.hash = new URLSearchParams(this.location_url.substring(1)); 70900 this.showhide_queryParams=this.showQueryParams.val(); 70901 70902 70903 this.productJsonData = {}; 70904 this.validationCounter=0; 70905 70906 this.allProductsJsonFromPages=[]; 70907 70908 this.brandSelector.val(this.brandSelector.data('default')); 70909 this.categorySelector.val(this.categorySelector.data('default')); 70910 /* To Hide Blue bar in Kalrez template*/ 70911 this.dfComp.parents('.dupont-container-fluid').find('.curve-bordered').css('display','none'); 70912 /* */ 70913 this.customPrdListJsonPath = this.dfComp.find('#customProductList').val(); 70914 } 70915 70916} 70917distributorFinderComp.prototype.init =function(){ 70918 if(this.dfComp.length>0){ 70919 this.attachDataList(); /* Attaches Products List and States List */ 70920 this.addSelectizeToElements(); 70921 this.addListJStoDFResults(); 70922 } 70923} 70924distributorFinderComp.prototype.attachDataList =function(){ 70925 70926 this.getJsonPATHofProductPagePaths(this.getProductsListFromProdPages); 70927 //this.getProductsJSONData(this.addStatesList, this.updateDefaultValues, this.fillInputDataFromHash); /*States Data is Available in Products Json coming from Sales Force*/ 70928 70929} 70930distributorFinderComp.prototype.getProductsListFromProdPages =function(callback, self,cfPath){ 70931 70932 let products_list = []; 70933 this.productsList=[]; 70934 70935 let buName = self.buInfo.val(); 70936 const hash = new URLSearchParams(self.location_url.substring(1)); 70937 70938 let searchParams ={ 70939 'contentFragmentPath': cfPath, 70940 'bu':buName 70941 }; 70942 70943 if(cfPath){ 70944 searchParams = { 70945 'contentFragmentPath': cfPath, 70946 'bu':buName 70947 } 70948 }else{ 70949 searchParams={} 70950 } 70951 $.ajax({ 70952 type: "GET", 70953 url: self.productsListURL, 70954 data: searchParams, 70955 contentType: false, 70956 cache: false, 70957 success: function (data) { 70958 if(data=='failed'){ 70959 data="[]"; 70960 } 70961 self.allProductsJsonFromPages= JSON.parse(data); 70962 products_list = $.map(JSON.parse(data), function (value, key) { 70963 if(self.brandSelector.parents('.distributor-finder_param').css('display')=='block'){ 70964 if((value.brand.toLowerCase()==self.brandSelector.val().toLowerCase()) || (value.brand.toLowerCase() == '') || self.brandSelector.val()==''){ 70965 return { label: value.productName, tpCode: value.tpCode } 70966 } 70967 }else{ 70968 return { label: value.productName, tpCode: value.tpCode } 70969 } 70970 70971 }); 70972 self.productsList = products_list; 70973 callback(self,products_list); /* Autocomplete Call Back*/ 70974 70975 products_list.forEach(item=>{ 70976 if(item.tpCode==self.productSelector.data('default')){ 70977 self.productSelector.val(item.label); 70978 self.productSelector.parents('.distributor-finder_param').find('.err-msg').hide(); 70979 } 70980 if(item.tpCode==hash.get('tpCode')){ 70981 self.productSelector.val(item.label); 70982 self.productSelector.parents('.distributor-finder_param').find('.err-msg').hide(); 70983 } 70984 }); 70985 if(self.customPrdListJsonPath){ 70986 self.getProductsListFromCustomList(self); 70987 } 70988 self.getProductsJSONData(self.addStatesList, self.updateDefaultValues , self.fillInputDataFromHash); 70989 70990 }, 70991 error: function (data) { 70992 //alert("failure"); 70993 console.log(data); 70994 } 70995 }); 70996} 70997 70998distributorFinderComp.prototype.getProductsListFromCustomList =function(self){ 70999 let products_list = []; 71000 71001 const hash = new URLSearchParams(self.location_url.substring(1)); 71002 71003 fetch(self.customPrdListJsonPath) 71004 .then(res=>res.json()) 71005 .then(result=>{ 71006 result.forEach(function(v){ 71007 self.allProductsJsonFromPages.push(v); 71008 }); 71009 71010 products_list = $.map(result, function (value, key) { 71011 if(self.brandSelector.parents('.distributor-finder_param').css('display')=='block'){ 71012 if((value.brand.toLowerCase()==self.brandSelector.val().toLowerCase()) || (value.brand.toLowerCase() == '') || self.brandSelector.val()==''){ 71013 return { label: value.productName, tpCode: value.tpCode } 71014 } 71015 }else{ 71016 return { label: value.productName, tpCode: value.tpCode } 71017 } 71018 71019 }); 71020 71021 products_list.forEach(function(v){ 71022 self.productsList.push(v); 71023 }); 71024 71025 self.autoComplete(self, self.productsList); /* Autocomplete Call Back*/ 71026 71027 self.productsList.forEach(item=>{ 71028 if(item.tpCode==self.productSelector.data('default')){ 71029 self.productSelector.val(item.label); 71030 self.productSelector.parents('.distributor-finder_param').find('.err-msg').hide(); 71031 } 71032 if(item.tpCode==hash.get('tpCode')){ 71033 self.productSelector.val(item.label); 71034 self.productSelector.parents('.distributor-finder_param').find('.err-msg').hide(); 71035 } 71036 }); 71037 71038 }) 71039 .catch((error) => { 71040 console.log('Error while fetching Custom Products List Data from JSON Path',error); 71041 }); 71042} 71043distributorFinderComp.prototype.getJsonPATHofProductPagePaths =function(gtPrListFrmPrdPages_callback){ 71044 let self = this; 71045 let prodPagesPath_list = [];//this.productsPageRootPath.val(); 71046 let productsPageRootPathJson = this.productsPageRootPath.val(); 71047 71048 71049 fetch(productsPageRootPathJson) 71050 .then(res=>res.json()) 71051 .then(result=>{ 71052 //console.log(Object.values(result)); 71053 71054 prodPagesPath_list= Object.values(result).map((item)=>item.rootPath+'#'+item.mbrand).filter(ite=>ite).toString(); 71055 gtPrListFrmPrdPages_callback(self.autoComplete,self,prodPagesPath_list); 71056 71057 //console.log('prodPagesPath_list Data',prodPagesPath_list); 71058 //self.getProductsListFromProdPages(self.autoComplete); 71059 }) 71060 .catch((error) => { 71061 console.log('Error while fetching Data from Products Path Path',error); 71062 gtPrListFrmPrdPages_callback(self.autoComplete,self,''); 71063 }); 71064} 71065distributorFinderComp.prototype.autoComplete =function(self,pr_list){ 71066 let theme_class= self.dfComp.hasClass('theme-red') ? 'theme-red':''; 71067 self.productSelector.autocomplete({source: []}); 71068 self.productSelector.autocomplete({ 71069 source: pr_list, 71070 select: function (event, ui) { 71071 //self.productSelector.val(ui.item.tpCode); 71072 self.productSelectorHidden.val(ui.item.tpCode); 71073 self.productSelector.val(ui.item.label); 71074 71075 self.productSelector.blur(); 71076 self.productSelector.parents('.distributor-finder_param').next().find('select').focus(); 71077 }, 71078 autofocus: true, 71079 classes: { 71080 "ui-autocomplete": "dist-product-search"+' '+theme_class, 71081 } 71082 }) 71083} 71084distributorFinderComp.prototype.getProductsJSONData =function(addStates_clbk , updDefaultvals_clbk, fillDatafromparams_clbk){ 71085 let self=this; 71086 let damJsonPath = $('.distributor-finder').data('jsonpath'); 71087 let jsonPath = damJsonPath+'/productdata.json'; 71088 //let jsonPath = '/apps/dupont-foundation/components/content/distributorfinder_new/clientlibs/source/js/productdata.json'; 71089 71090 fetch(jsonPath) 71091 .then(res => res.json()) 71092 .then(result => { 71093 self.productJsonData = result; 71094 //console.log(self.productJsonData); 71095 //self.addCountriesList(); 71096 if(self.hash.size>0){ 71097 self.countrySelector[0].selectize.setValue(self.hash.get('country')); 71098 } 71099 addStates_clbk(self); 71100 self.stateSelector[0].selectize.setValue(self.stateSelector.data('default')); 71101 if(self.hash.size>0 && self.hash.get('state')){ 71102 self.stateSelector[0].selectize.setValue(self.hash.get('state')); 71103 } 71104 71105 self.addCountiesList(self); 71106 self.countySelector[0].selectize.setValue(self.countySelector.data('default')); 71107 if(self.hash.size>0 && self.hash.get('county')){ 71108 self.countySelector[0].selectize.setValue(self.hash.get('county')); 71109 } 71110 71111 71112 updDefaultvals_clbk(self); 71113 fillDatafromparams_clbk(self); 71114 71115 if(self.hash.size>0){ 71116 self.updateProductsList(self); 71117 } 71118 if(window.location.hash.length>1){ 71119 self.getDistributorJSONData(self.showResults, window.location.hash.slice(1)); 71120 } 71121 self.bindEvents(); 71122 71123 }) 71124 .catch((error) => { 71125 console.log('Error While getting Products Json',error) 71126 }); 71127} 71128/*Temporary code to add countries from sample Json if Product json is not working in Dam*/ 71129distributorFinderComp.prototype.addCountriesList =function(){ 71130 let self=this;
71131 let countriesData= self.productJsonData.listOfCountries; 71132 let $select = self.countrySelector.selectize(); 71133 let selectizeCountry = $select[0].selectize; 71134 71135 if(self.countrySelector.children().length<2){ 71136 selectizeCountry.addOption({value: '', text: 'Please select county'}); 71137 for(countryobj of countriesData){ 71138 //if(countryobj.countryCode=='IN' || countryobj.countryCode=='US') 71139 selectizeCountry.addOption({value: countryobj.countryCode, text: countryobj.countryName}); 71140 } 71141 } 71142} 71143distributorFinderComp.prototype.addStatesList =function(self){ 71144 let selectedCountryCode = self.countrySelector.val(); 71145 71146 if(selectedCountryCode==='US'){ 71147 let $selectstate = self.stateSelector.selectize(); 71148 let selectizestate = $selectstate[0].selectize; 71149 71150 // self.stateSelector.parents('.distributor-finder_param').removeClass('d-none'); 71151 // self.zipSelector.parents('.distributor-finder_param').removeClass('d-none'); 71152 self.stateSelector.parents('.distributor-finder_param').show(); 71153 self.countySelector.parents('.distributor-finder_param').show(); 71154 self.zipSelector.parents('.distributor-finder_param').show(); 71155 71156 let countriesList = self.productJsonData.listOfCountries; 71157 71158 selectizestate.clearOptions(); 71159 for (countryObj of countriesList) { 71160 if (self.countrySelector.val() == countryObj.countryCode) { 71161 for (stateObj of countryObj.stateDetails) { 71162 selectizestate.addOption({ value: stateObj.Code, text: stateObj.Name }); 71163 //$("#state-selector")[0].add(new Option(stateObj.stateName,stateObj.stateCode)); 71164 } 71165 } 71166 } 71167 self.stateSelector[0].selectize.setValue(self.stateSelector.data('default')); 71168 }else{ 71169 self.stateSelector[0].selectize.setValue(''); 71170 self.countySelector[0].selectize.setValue(''); 71171 self.zipSelector.val(''); 71172 self.stateSelector.parents('.distributor-finder_param').hide(); 71173 self.countySelector.parents('.distributor-finder_param').hide(); 71174 self.zipSelector.parents('.distributor-finder_param').hide(); 71175 } 71176} 71177distributorFinderComp.prototype.addCountiesList =function(self){ 71178 let countriesList = self.productJsonData.listOfCountries; 71179 71180 let $selectcounty = self.countySelector.selectize(); 71181 let selectizecounty = $selectcounty[0].selectize; 71182 71183 self.countySelector[0].selectize.setValue(''); 71184 self.countySelector[0].selectize.clearOptions(); 71185 for (countryObj of countriesList) { 71186 if (self.countrySelector.val() == countryObj.countryCode) { 71187 if(countryObj.stateDetails) 71188 for (stateObj of countryObj.stateDetails) { 71189 if(self.stateSelector.val()==stateObj.Code){ 71190 if(stateObj.countyDetails) 71191 for(countyObj of stateObj.countyDetails){ 71192 self.countySelector[0].selectize.addOption({ value: countyObj.Name, text: countyObj.Name }); 71193 } 71194 } 71195 } 71196 } 71197 } 71198 71199} 71200distributorFinderComp.prototype.addSelectizeToElements =function(){ 71201 this.dfFiltersObjList = this.selectElementsList.selectize({ 71202 sortField: [ 71203 { 71204 field: 'text', 71205 direction: 'asc' 71206 } 71207 ] 71208 }); 71209} 71210distributorFinderComp.prototype.bindEvents =function(){ 71211 let self=this; 71212 this.getResultsBtn.on('click', $.proxy(this.getDistributorJSONData, this, self.showResults, '')); 71213 this.clearResultsBtn.on('click', $.proxy(this.clearResults, this)); 71214 this.countrySelector.on('change', $.proxy(this.addStatesList, this, self)); 71215 this.stateSelector.on('change', $.proxy(this.addCountiesList, this, self)); 71216 this.onChangeEvents(); 71217 this.productSelector.on('search', $.proxy(this.clearHiddenInputValue, this)); 71218 this.dFScrollTopBtn.on('click',$.proxy(this.scrollToResultsTop, this));
71219 this.zipSelector.on('keyup',$.proxy(this.enableGetResultsBtnonZip, this)); 71220 this.brandSelector.on('change', $.proxy(this.resetProductsList, this, self)); 71221 this.brandSelector.on('change', $.proxy(this.updateProductsList, this, self)); 71222 71223} 71224distributorFinderComp.prototype.resetProductsList =function(self){ 71225 self.productSelectorHidden.val(''); 71226 self.productSelector.val(''); 71227} 71228distributorFinderComp.prototype.updateProductsList =function(self){ 71229 let productsList=[]; 71230 71231 productsList=self.allProductsJsonFromPages.filter(item=>{ 71232 return ( (item.brand.toLowerCase()==self.brandSelector.val().toLowerCase()) || (item.brand.toLowerCase()=='') || self.brandSelector.val()=='') 71233 }).map(item=>{ 71234 return { label: item.productName, tpCode: item.tpCode } 71235 }); 71236 self.autoComplete(self, productsList); 71237 71238 productsList.forEach(item=>{ 71239 if(item.tpCode==self.productSelector.data('default')){ 71240 self.productSelector.val(item.label); 71241 self.productSelector.parents('.distributor-finder_param').find('.err-msg').hide(); 71242 } 71243 if(self.hash.get('tpCode') && item.tpCode==self.hash.get('tpCode')){ 71244 self.productSelector.val(item.label); 71245 self.productSelector.parents('.distributor-finder_param').find('.err-msg').hide(); 71246 } 71247 }); 71248 71249} 71250distributorFinderComp.prototype.enableGetResultsBtnonZip =function(e){ 71251 if(e.target.value==this.zipSelector.data('valp')){ 71252 this.getResultsBtn.addClass('disabled'); 71253 }else{ 71254 this.getResultsBtn.removeClass('disabled'); 71255 } 71256 this.isAnyValueChanged(); 71257} 71258distributorFinderComp.prototype.scrollToResultsTop =function(e){ 71259 $('html, body').animate({ scrollTop: this.distResultBlock.offset().top-325 }, 500) 71260} 71261distributorFinderComp.prototype.clearHiddenInputValue =function(e){ 71262 if('' == e.target.value) { 71263 this.productSelectorHidden.val(''); 71264 this.getResultsBtn.removeClass('disabled'); 71265 // this.isAnyValueChanged(); 71266 } 71267} 71268 71269distributorFinderComp.prototype.addListJStoDFResults =function(){ 71270 let self=this; 71271 let listClass = 'distributor-finder_res-list'; 71272 let itemName = 'distributor-finder_res-item-name'; 71273 this.distributorListNew = new List(listClass, { 71274 valueNames: [itemName], 71275 page: this.itemsPerPage, 71276 pagination: [{ 71277 paginationClass: 'pagination', 71278 innerWindow: 2, 71279 outerWindow: 2 71280 }] 71281 }); 71282 71283 this.distributorListNew.on('searchComplete', function () { 71284 self.distributorCnt.html(self.distributorListNew.update().matchingItems.length); 71285 }) 71286 71287 this.distributorListNew.on('updated', function () { 71288 $('#page-prev, #page-next').show(); 71289 //hide next & prev when not needed 71290 setTimeout(function () { 71291 71292 if ($('.pagination').children().length < 2) $('#page-prev, #page-next').hide(); 71293 else if ($('.pagination li:first-child').hasClass('active')) $('#page-prev').hide(); 71294 else if ($('.pagination li:last-child').hasClass('active')) $('#page-next').hide(); 71295 }, 0); 71296 }) 71297 71298 this.searchBox[0].onkeyup = function (e) { 71299 self.distributorListNew.search(e.target.value) 71300 } 71301 71302 this.pageNext.on('click', function(){ 71303 $('.pagination .active').next().trigger('click'); 71304 $('html, body').animate({ scrollTop: $(".distributor-finder_res").offset().top }, 500) 71305 }) 71306 this.pagePrev.on('click', function(){ 71307 $('.pagination .active').prev().trigger('click'); 71308 $('html, body').animate({ scrollTop: $(".distributor-finder_res").offset().top }, 500) 71309 }) 71310} 71311distributorFinderComp.prototype.showResults =function(self){ 71312 self.distributorListNew.clear(); 71313 self.distResultBlock.show(); 71314 self.resultData.append(self.dfData); 71315 if(!self.dfComp.hasClass('product-page-view')){ 71316 self.scrollToResultsTop(); 71317 } 71318 71319 if(self.itemsPerPage){ 71320 //self.addListJStoDFResults(); 71321 71322 self.distributorListNew.reIndex(); 71323 self.distributorListNew.update(); 71324 self.distributorListNew.show(1, self.itemsPerPage); 71325 self.distributorCnt.html(self.distributorListNew.size()); 71326 } 71327 if(self.distributorListNew.size()<=5){ 71328 self.paginationContainer.hide(); 71329 //self.resSearchInput.hide(); 71330 }else{ 71331 self.paginationContainer.show(); 71332 //self.resSearchInput.show(); 71333 } 71334 71335 if(self.distributorListNew.size()<=1){ 71336 self.resSearchInput.hide(); 71337 }else{ 71338 self.resSearchInput.show(); 71339 } 71340 71341 71342 71343} 71344distributorFinderComp.prototype.getDistributorJSONData =function(showResults_clbk, formparams ){ 71345 let validationCounter = this.validateInputValues(); 71346 if(this.dfComp.hasClass('product-page-view')){ 71347 validationCounter=0; 71348 } 71349 if(validationCounter>0){ 71350 return false;
71351 }else{ 71352 let self=this; 71353 let valid = true; 71354 let frm = this.distributorFinderForm; 71355 71356 if(this.zipSelector.val()==''){ 71357 this.radius.val(''); 71358 }else{ 71359 this.radius.val(this.radius.data('default')); 71360 } 71361 71362 let hash=''; 71363 if(self.showhide_queryParams=='false'){ 71364 hash=self.distributorFinderForm.serialize(); 71365 }else{ 71366 hash=''; 71367 } 71368 71369 71370 if(formparams){ 71371 formdata = formparams; 71372 }else{ 71373 formdata = frm.serialize(); 71374 } 71375 //console.log('FormData',formdata); 71376 //$('.distributor-finder_param .error.err-msg').addClass('d-none'); 71377 71378 if (this.productSelector[0].getAttribute('required') === 'true' && !this.productSelector.val()) { 71379 this.productSelector.parents('.product-selector-div').siblings('.error.err-msg').removeClass('d-none'); 71380 valid = false; 71381 } 71382 if (valid) { 71383 /*ajax here*/ 71384 71385 this.getResultsBtn.addClass('loading'); 71386 this.distResultBlockWrapper.find('.progress-bar-wrapper').show(); 71387 $.ajax({ 71388 type: 'POST', 71389 url: frm.attr('action'), 71390 data: formdata, 71391 success: function (data) { 71392 self.dfData = data; 71393 showResults_clbk(self); 71394 }, 71395 error: function (data) { 71396 //alert('An error occurred.'); 71397 console.log(data); 71398 }, 71399 complete: function (data) { 71400 self.distResultBlockWrapper.find('.progress-bar-wrapper').hide(); 71401 self.getResultsBtn.removeClass('loading'); 71402 self.getResultsBtn.addClass('disabled'); 71403 self.enableBtnOnFilterValChange(); 71404 self.searchBox.val(''); 71405 window.location.hash = hash; 71406 if(!self.dfComp.find(".distributor-finder_filter").is(":hidden")){ 71407 self.triggerAnalytics(); 71408 } 71409 } 71410 }); 71411 } 71412 } 71413} 71414distributorFinderComp.prototype.triggerAnalytics =function(){ 71415 71416 const selectedIndustry =this.dfComp.find("#industry-selector").find(":selected").text(); 71417 const selectedProduct = this.dfComp.find("#product-selector").val(); 71418 const selectedCountry = this.dfComp.find("#country-selector").find(":selected").text(); 71419 const selectedState = this.dfComp.find("#state-selector").find(":selected").text(); 71420 const zipCode = this.dfComp.find("#zip-selector").val(); 71421 const selectedCounty = this.dfComp.find("#county-selector").find(":selected").text(); 71422 const resultsCount = this.dfComp.find("#distributor-count").text(); 71423 const selectedBrand = this.dfComp.find("#brand-selector").find(":selected").text(); 71424 71425 digitalData['distributorFinder'] = { 71426 'industry':selectedIndustry, 71427 'product':selectedProduct, 71428 'country':selectedCountry, 71429 'state':selectedState, 71430 'zip':zipCode, 71431 'county':selectedCounty, 71432 'resultsCount':resultsCount, 71433 'brand':selectedBrand 71434 71435 }; 71436 if(_satellite){ 71437 _satellite.track("Distributor_Search"); 71438 } 71439 71440}; 71441distributorFinderComp.prototype.clearResults =function(){ 71442 //this.updateDefaultValues(this); 71443 this.validateInputValues(); 71444 this.productSelector.val(''); 71445 this.dfFiltersObjList.each(function (i, v) { 71446 if (!$(v).closest('.col-sm-6').hasClass('d-none')) v.selectize.clear(); 71447 }); 71448 71449 this.enableBtnOnFilterValChange(); 71450 71451 this.stateSelector[0].selectize.clearOptions(); 71452 this.countySelector[0].selectize.clearOptions(); 71453 this.zipSelector.val(); 71454 71455 this.dfFilterBlk.find('.error.err-msg').hide(); 71456 //this.distResultBlockWrapper.find('.progress-bar-wrapper').hide(); 71457 71458 this.distributorListNew.clear(); 71459 this.distResultBlock.hide(); 71460 71461 this.distributorListNew.reIndex(); 71462 this.distributorListNew.update(); 71463 window.location.hash = ''; 71464} 71465 71466distributorFinderComp.prototype.fillInputDataFromHash =function(self){ 71467 //let self=this; 71468 let mktpCode = ""; 71469 let paramValues = {}; 71470 71471 if (self.location_url.length > 1 ){ 71472 self.location_url.slice(1).split('&').forEach(function (v, i) { 71473 paramValues[v.split('=')[0]] = decodeURIComponent(v.split('=')[1]) 71474 if (v.split('=')[0] == "tpCode") { 71475 mktpCode = decodeURIComponent(v.split('=')[1]); 71476 self.productSelectorHidden.val(mktpCode); 71477 } 71478 if (v.split('=')[0] == "zip") { 71479 self.zipSelector.val(decodeURIComponent(v.split('=')[1])); 71480 } 71481 if (v.split('=')[0] == "productTitle") { 71482 self.productSelector.val(decodeURIComponent(v.split('=')[1])); 71483 } 71484 }) 71485 self.dfFiltersObjList.each(function (i) { 71486 self.dfFiltersObjList[i].selectize.setValue(paramValues[self.dfFiltersObjList[i].name]) 71487 }); 71488 } 71489 71490} 71491distributorFinderComp.prototype.addRequiredtoElems =function(){ 71492 71493} 71494distributorFinderComp.prototype.updateDefaultValues =function(selfval){ 71495 let self=this; 71496 selfval.dfFiltersObjList.each(function (i,v) { 71497 // this.dfFiltersObjList[i].selectize.setValue(paramValues[this.dfFiltersObjList[i].name]) 71498 if($(v).data('default')){ 71499 v.selectize.setValue($(v).data('default')); 71500 } 71501 }); 71502 selfval.enableProductPageView(); 71503} 71504distributorFinderComp.prototype.productPageView =function(selfval){
71505 if(!this.showFilters){ 71506 this.distFinderFiltersBlk.show(); 71507 }else{ 71508 this.distFinderFiltersBlk.hide(); 71509 } 71510} 71511distributorFinderComp.prototype.validateInputValues =function(self){ 71512 let validationCounter=0; 71513 $('#state-selector').parents('.distributor-finder_param').css('display'); 71514 71515 this.selectInputsList.each(function(){ 71516 let isVisible = $(this).parents('.distributor-finder_param').css('display')=='block' ? true :false ; 71517 if($(this).data('required') && $(this).val()==='' && isVisible){ 71518 $(this).parents('.distributor-finder_param').find('.err-msg').show(); 71519 validationCounter++; 71520 }else{ 71521 $(this).parents('.distributor-finder_param').find('.err-msg').hide(); 71522 } 71523 }); 71524 this.textInputsList.each(function(){ 71525 let isVisible = $(this).parents('.distributor-finder_param').css('display')=='block' ? true :false ; 71526 if($(this).data('required') && $(this).val()==='' && isVisible){ 71527 $(this).parents('.distributor-finder_param').find('.err-msg').show(); 71528 validationCounter++; 71529 }else{ 71530 $(this).parents('.distributor-finder_param').find('.err-msg').hide(); 71531 } 71532 }) 71533 71534 return validationCounter; 71535 71536} 71537distributorFinderComp.prototype.onChangeEvents =function(){ 71538 let self=this; 71539 let previous=''; 71540 this.selectElementsList.each(function(){ 71541 $(this).on('change',function(){ 71542 if($(this).data('required') && $(this).val()===''){ 71543 $(this).parents('.distributor-finder_param').find('.err-msg').show(); 71544 }else{ 71545 $(this).parents('.distributor-finder_param').find('.err-msg').hide(); 71546 } 71547 }) 71548 }); 71549 this.textInputsList.each(function(){ 71550 $(this).on('change',function(){ 71551 if($(this).data('required') && $(this).val()===''){ 71552 $(this).parents('.distributor-finder_param').find('.err-msg').show(); 71553 }else{ 71554 $(this).parents('.distributor-finder_param').find('.err-msg').hide(); 71555 } 71556 }) 71557 }) 71558 71559 this.selectElementsList.each(function(){ 71560 $(this).change(function() { 71561 71562 if($(this).attr('data-valp')==this.value){ 71563 //self.getResultsBtn.addClass('disabled'); 71564 }else{ 71565 self.getResultsBtn.removeClass('disabled'); 71566 } 71567 previous = this.value; 71568 71569 self.isAnyValueChanged(); 71570 }); 71571 }); 71572 this.textInputsList.each(function(){ 71573 $(this).change(function() { 71574 71575 if($(this).attr('data-valp')==this.value){ 71576 //self.getResultsBtn.addClass('disabled'); 71577 }else{ 71578 self.getResultsBtn.removeClass('disabled'); 71579 } 71580 previous = this.value; 71581 self.isAnyValueChanged(); 71582 }); 71583 }) 71584 71585} 71586distributorFinderComp.prototype.enableProductPageView =function(){ 71587 if(this.dfComp.hasClass('product-page-view')){ 71588 //this.distFinderFiltersBlk.hide(); 71589 if (window.location.hash.length > 1 ){ 71590 this.getDistributorJSONData(this.showResults, window.location.hash.slice(1)); 71591 }else{ 71592 this.getDistributorJSONData(this.showResults, ''); 71593 } 71594 71595 } 71596} 71597distributorFinderComp.prototype.enableBtnOnFilterValChange=function(){ 71598 let self=this; 71599 this.selectElementsList.each(function(){ 71600 $(this).attr('data-valp',$(this).val()); 71601 }); 71602 this.textInputsList.each(function(){ 71603 $(this).attr('data-valp',$(this).val()); 71604 }) 71605} 71606distributorFinderComp.prototype.isAnyValueChanged=function(){ 71607 let self=this; 71608 this.selectElementsList.each(function(){ 71609 let prev = $(this).attr('data-valp'); 71610 let current = $(this).val(); 71611 if(prev!=current){ 71612 self.getResultsBtn.removeClass('disabled'); 71613 } 71614 }); 71615 this.textInputsList.each(function(){ 71616 let prev = $(this).attr('data-valp'); 71617 let current = $(this).val(); 71618 if(prev!=current){ 71619 self.getResultsBtn.removeClass('disabled'); 71620 } 71621 }); 71622} 71623 71624let dfCompObj = new distributorFinderComp(); 71625dfCompObj.init(); 71626 71627/*global window, parent, navigator, $, DFV, DFCountries */ 71628$('.generic-form-container form').ready(function () { 71629 "use strict"; 71630 71631 window.DFV = { 71632 wrapper: $('.corporateForm form'), 71633 init: function () { 71634 // DFV.WebCentralCode.includeFields(); 71635 //Add more apprends or include on top of the form here 71636 }, 71637 submit: function () { 71638 //DFV.genericValidation.joinCheckboxes(); 71639 if ($("#optIn").is(':checked')) { 71640 71641 71642 $("#optIn").val("1"); 71643 DFV.genericValidation.optIn(); 71644 } 71645 71646 //DFV.genericValidation.companyCheck(); 71647 DFV.genericValidation.checkRedirectUrl(); 71648 // Populating Origin Tracking Code 71649 // $('input[name=00N30000002RIVW]').val((sessionStorage.getItem('otc') != null) ? sessionStorage.getItem('otc'): ''); 71650 if(DFV.genericValidation.emailCheck()){ 71651 return true; 71652 } else{ 71653 return false;
71654 } 71655 71656 //Add more validations here 71657 }, 71658 submitRouting: function () { 71659 var submitResult = DFV.submit(); 71660 if (typeof (DFCountries) !== 'undefined' && typeof (DFCountries.countries) !== 'undefined') { 71661 DFV.routingValidation.routing(DFCountries.countries); 71662 } 71663 return submitResult; 71664 //Add more validations here 71665 } 71666 }; 71667 71668 (function ($, DFV) { 71669 function elementExist(element) { 71670 return element.length !== 0; 71671 } 71672 71673 function getInputByName(name, checked) { 71674 return DFV.wrapper.find('input[name="' + name + '"]' + (checked ? ':checked' : '')); 71675 } 71676 71677 function getSelectByName(name) { 71678 return DFV.wrapper.find('select[name="' + name + '"]'); 71679 } 71680 71681 function getInputByNameValue(name, checked) { 71682 var item = getInputByName(name, checked); 71683 return elementExist(item) && item.val() !== '' ? item.val() : null; 71684 } 71685 71686 function addField(object) { 71687 var item, 71688 newItem; 71689 71690 item = DFV.wrapper.find('input[name="' + object.name + '"]'); 71691 71692 if (!elementExist(item)) { 71693 newItem = $('<input>').attr({ 71694 type: 'hidden', 71695 id: object.name, 71696 name: object.name, 71697 value: object.value 71698 }); 71699 71700 DFV.wrapper.append(newItem); 71701 } else { 71702 item.attr({ 71703 value: object.value 71704 }); 71705 } 71706 } 71707 71708 function getQueryParameterByName(name) { 71709 name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); 71710 var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), 71711 results = regex.exec(location.search); 71712 return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); 71713 } 71714 71715 71716 DFV.WebCentralCode = { 71717 includeFields: function () { 71718 //Populating Origin URL 71719 /*addField({ 71720 name: '00N30000001Yh27', 71721 value: parent.document.referrer 71722 }); 71723 71724 //Populating Origin Form 71725 addField({ 71726 name: '00N30000008QxPj', 71727 value: window.location.hostname + window.location.pathname 71728 }); 71729 71730 //Populating Direction 71731 addField({ 71732 name: '00N30000001UjbA', 71733 value: "Inbound" 71734 }); 71735 71736 //Populating Origin Channel Type 71737 addField({ 71738 name: '00N30000001Gow6', 71739 value: "Website" 71740 }); 71741 71742 //Populating Extended Data 71743 addField({ 71744 name: '00N300000067cCK', 71745 value: "Web2L_CentralCode_V1" 71746 });*/ 71747 71748 /* Temporally commented since the field is already 71749 * populated with Form Builder 71750 // Populating Origin Name 71751 if (!getInputByNameValue('00N30000001V0Js')) { 71752 addField({ 71753 name: '00N30000001V0Js', 71754 value: windowLocation.hostname + '/' + path.substring(0, path.indexOf(('/'), path.indexOf('/') + 1)) 71755 }); 71756 } 71757 */ 71758 }, 71759 71760 }; 71761 71762 DFV.genericValidation = { 71763 joinCheckboxes: function () { 71764 var item, 71765 checkboxes = {}, 71766 key, 71767 name, 71768 value; 71769 71770 DFV.wrapper.find('input:checked').each(function () { 71771 name = $(this).attr("name"); 71772 value = $(this).val(); 71773 71774 if (value.toLowerCase() === 'other') { 71775 item = DFV.wrapper.find('input[type="text"][name="' + name + '_input"]'); 71776 value = (elementExist(item) && item.val() !== "") ? item.val() : value; 71777 } 71778 71779 if (checkboxes[name]) { 71780 checkboxes[name].values += ';' + value; 71781 } else { 71782 checkboxes[name] = { 71783 input: name.slice(0, name.lastIndexOf("_")), 71784 values: value 71785 }; 71786 } 71787 }); 71788 71789 for (key in checkboxes) { 71790 if (checkboxes.hasOwnProperty(key)) { 71791 addField({ 71792 name: checkboxes[key].input, 71793 value: checkboxes[key].values 71794 }); 71795 } 71796 } 71797 }, 71798 71799 emailCheck: function () { 71800 var item1 = getInputByName('email', false); 71801 var item2 = getInputByName('confirm_email', false); 71802 71803 if (getInputByNameValue('email', false) && getInputByNameValue('confirm_email', false)) { 71804 if(getInputByNameValue('email', false) != getInputByNameValue('confirm_email', false)){ 71805 $('#confirm_email_error').html('Emails do not match'); 71806 $('#confirm_email_error').css('display', 'inline-block'); 71807 71808 return false;
71809 } else { 71810 return true; 71811 } 71812 } else { 71813 return true; 71814 } 71815 }, 71816 71817 optIn: function () { 71818 var item = getInputByName('00N30000001Tvd8', true), 71819 multipleCampaign = getInputByNameValue('00N30000003vYTt'), 71820 campaignID = getInputByNameValue('opt-in_campaign_id'), 71821 memberStatus = getInputByNameValue('member_status_value'), 71822 differentOptInName = getInputByNameValue('opt-in_different_name'), 71823 campaign2 = getInputByNameValue('campaign2'), 71824 hiddenName; 71825 71826 71827 71828 /* if (elementExist(item) && multipleCampaign) { 71829 getInputByName('00N30000003vYTt', false).val(multipleCampaign + ';' + campaign2); 71830 }*/ 71831 71832 if ( elementExist(item) && getInputByName('00N30000003vYTt') ) { 71833 getInputByName('00N30000003vYTt').val(getInputByNameValue('oid')+campaignID+':in'); 71834 } 71835 if (elementExist(item) && campaignID) { 71836 71837 //Different Opt-in 71838 if (differentOptInName) { 71839 hiddenName = getInputByNameValue(differentOptInName); 71840 71841 if (hiddenName) { 71842 addField({ 71843 name: differentOptInName, 71844 value: item.val() 71845 }); 71846 } 71847 } 71848 71849 //Standard opt-in 71850 if (!multipleCampaign) { 71851 addField({ 71852 name: 'Campaign_ID', 71853 value: campaignID 71854 }); 71855 } 71856 71857 addField({ 71858 name: 'member_status_value', 71859 value: memberStatus 71860 }); 71861 } 71862 }, 71863 71864 checkRedirectUrl: function() { 71865 var thanks2= $('#redirectFullURL2').val(); 71866 if($('#00N30000001Tvd8-0').is(":checked") && $('#00N30000001Tvd8-0').length > 0 ){ 71867 if(thanks2.length > 7) { 71868 $('.generic-form-container input[name=redirect_page]').attr('value', $('#redirectFullURL2').val()); 71869 } 71870 } 71871 } 71872 }; 71873 71874 DFV.routingValidation = { 71875 routing: function (countryqueue) { 71876 var element = getSelectByName('00N30000001UlfP'), 71877 itemSelected = elementExist(element) && element.val() !== '' ? element.val() : null, 71878 key; 71879 71880 if (itemSelected) { 71881 for (key in countryqueue) { 71882 if (countryqueue.hasOwnProperty(key) && ((countryqueue[key].abbr).toUpperCase() === itemSelected.toUpperCase())) { 71883 addField({ 71884 name: '00N30000001V1vY', 71885 value: countryqueue[key].region 71886 }); 71887 71888 addField({ 71889 name: '00N30000001H5sV', 71890 value: countryqueue[key].queue 71891 }); 71892 break; 71893 } 71894 } 71895 } 71896 } 71897 }; 71898 }($, DFV)); 71899 71900 DFV.init(); 71901}); 71902 71903$(document).ready(function () { 71904 $('.generic-form-container form').ready(function () { 71905 var vars = [], hash; 71906 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 71907 for(var i = 0; i < hashes.length; i++){ 71908 hash = hashes[i].split('='); 71909 if (hash[0].indexOf("checkbox") >= 0){ 71910 vars[hash[0]] = hash[1]; 71911 var loopTrue = true; 71912 var index = 0; 71913 while(loopTrue){ 71914 var idCheck = $("#"+hash[0] +'-'+index ); 71915 var valueCB = idCheck.val(); 71916 var spValuesHash = hash[1].split("%3B"); 71917 71918 for (var item in spValuesHash) { 71919 if(spValuesHash[item] == valueCB){ 71920 idCheck.prop('checked', true); 71921 } 71922 } 71923 71924 index++; 71925 if($("#"+hash[0] +'-'+index ).length === 0){ 71926 loopTrue = false;
71927 } 71928 } 71929 } 71930 } 71931 }); 71932}); 71933function check_spam(className) { 71934 71935 var red_elems = document.getElementsByClassName(className); 71936 71937 var spam = false; 71938 71939 for(var i=0;i<red_elems.length;i++) { 71940 71941 if(spam) 71942 break; 71943 71944 var input_type = red_elems[i].type; 71945 71946 switch (input_type) { 71947 71948 case "checkbox": 71949 if(red_elems[i].value) 71950 spam = true; 71951 break; 71952 71953 case "text": 71954 if(red_elems[i].value) 71955 spam = true; 71956 break; 71957 71958 case "email": 71959 if(red_elems[i].value) 71960 spam = true; 71961 break; 71962 71963 case "password": 71964 if(red_elems[i].value) 71965 spam = true; 71966 break; 71967 71968 default: 71969 console.log("not defined case"); 71970 console.log(input_type); 71971 } 71972 71973 } 71974 71975 return spam; 71976} 71977$(document).ready(function() { 71978 71979 $("#corpdccSubmit").on("click", function(event) { 71980 71981 event.preventDefault(); 71982 var marketingId = _satellite.getVisitorId().getMarketingCloudVisitorID(); 71983 /*console.log( "marketingId--------------"+marketingId); 71984 $('.dccform input[name=Web_Visitor_ID]').attr('value',marketingId); */ 71985 71986 if(check_spam('redundant')) { 71987 //document.getElementById('inputDescription').value = "spam detected"; 71988 71989 marketingId = marketingId+ "----spam detected" ; 71990 71991 $('.dccform input[name=Web_Visitor_ID]').attr('value',marketingId); 71992 71993 71994 console.log("spam detected"); 71995 } 71996 DFV.submit(); 71997 71998 var flag = 1; 71999 var phoneno = /^(?=.*?[0-9])[0-9+()-\s]+$/; 72000 var pattern = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 72001 var captchaErr = false; 72002 72003 72004 72005 $("form select.requireField,form input.requireField,form textarea.requireField").each(function(index) { 72006 72007 if (!$(this).val() || $(this).val() == "-Select-") { 72008 72009 $(this).closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 72010 $(this).closest('.customFieldset').find('span.errormessage').show(); 72011 $(this).closest('.requireField').addClass("requireFieldBorder"); 72012 flag = 0; 72013 72014 72015 } else { 72016 72017 $(this).closest('.customFieldset').find('span.errormessage').removeClass("requiredtext_form"); 72018 $(this).closest('.customFieldset').find('span.errormessage').hide(); 72019 72020 $(this).closest('.requireField').removeClass("requireFieldBorder"); 72021 72022 72023 72024 72025 } 72026 72027 72028 72029 }); 72030 72031 //var phoneno = /^[0-9]*(?:\.\d{1,2})?$/; 72032 if ($(".requireField#phone").length) { 72033 72034 if (!$(".requireField#phone").val() || !$(".requireField#phone").val().trim().match(phoneno)) { 72035 72036 $(".requireField#phone").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 72037 $(".requireField#phone").closest('.customFieldset').find('span.errormessage').show(); 72038 $(".requireField#phone").addClass("requireFieldBorder"); 72039 72040 flag = 0; 72041 72042 } else { 72043 $(".requireField#phone").closest('.customFieldset').find('span.errormessage').hide(); 72044 $(".requireField#phone").removeClass("requireFieldBorder"); 72045 72046 72047 } 72048 } 72049 72050 if ($("#phone").length) { 72051 72052 if ($("#phone").val() && !$("#phone").val().trim().match(phoneno)) { 72053 72054 $("#phone").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 72055 $("#phone").closest('.customFieldset').find('span.errormessage').show(); 72056 $("#phone").addClass("requireFieldBorder"); 72057 72058 flag = 0; 72059 72060 } else { 72061 $("#phone").closest('.customFieldset').find('span.errormessage').hide(); 72062 $("#phone").removeClass("requireFieldBorder"); 72063 72064 72065 } 72066 } 72067 72068 if ($("#email.requireField").length) { 72069 72070 if ($(".requireField#email").length && !$(".requireField#email").val().match(pattern)) { 72071 72072 $(".requireField#email").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 72073 $(".requireField#email").closest('.customFieldset').find('span.errormessage').show(); 72074 $(".requireField#email").addClass("requireFieldBorder"); 72075 72076 flag = 0; 72077 72078 } 72079 else{ 72080 $("#email").closest('.customFieldset').find('span.errormessage ').hide(); 72081 $(".requireField#email").removeClass("requireFieldBorder"); 72082 } 72083 } 72084 72085 if($(".requireField#confemail").length){ 72086 72087 if ($(".requireField#email").val() != $(".requireField#confemail").val()) { 72088 72089 72090 72091 $(".requireField#confemail").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 72092 $(".requireField#confemail").closest('.customFieldset').find('span.errormessage').show(); 72093 $(".requireField#email").addClass("requireFieldBorder"); 72094 72095 72096 flag = 0; 72097 72098 } else { 72099 72100 $(".requireField#confemail").closest('.customFieldset').find('span.errormessage').hide(); 72101 $(".requireField#email").removeClass("requireFieldBorder"); 72102 72103 72104 } 72105 } 72106 72107 72108 72109 /* if($( "#confirmcheck.requireField" ).length){ 72110 72111 var cnt = $("input[name='confirmcheck']:checked").length 72112 72113 if (cnt < 1) 72114 { 72115 72116 $(".requireField#confirmcheck").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 72117 $(".requireField#confirmcheck").closest('.customFieldset').find('span.errormessage').show(); 72118 72119 flag = 0; 72120 } 72121 else 72122 $("#confirmcheck" ).closest('.customFieldset').find('span.errormessage ').hide(); 72123 } 72124 else 72125 { 72126 $("#confirmcheck" ).closest('.customFieldset').find('span.errormessage ').hide(); 72127 }*/ 72128 72129 72130 72131 //Radio button validation 72132 72133 if ($(".inradioBtn").length) { 72134 72135 var cnt = $("input[name='Optin']:checked").length 72136 72137 72138 if (cnt < 1) { 72139 72140 $(".inradioBtn").closest('.customFieldset').find('span.errormessage').addClass("requiredtext_form"); 72141 $(".inradioBtn").closest('.customFieldset').find('span.errormessage').show(); 72142 $(".inradioBtn").addClass("requireFieldBorder"); 72143 72144 flag = 0; 72145 } else 72146 $(".inradioBtn").closest('.customFieldset').find('span.errormessage ').hide(); 72147 $(".inradioBtn").removeClass("requireFieldBorder"); 72148 } else { 72149 $(".inradioBtn").closest('.customFieldset').find('span.errormessage ').hide(); 72150 $(".inradioBtn").removeClass("requireFieldBorder"); 72151 } 72152 72153 if($(".g-recaptcha").length>0){ 72154 if(!$($(".g-recaptcha")[0]).attr('validated')){ 72155 captchaErr = true; 72156 $("#response-div").html("Recaptcha is required!"); 72157 } 72158 72159 } 72160 72161 72162 72163 if ($(".errormessage").is(":visible") || captchaErr) { 72164 var errorEl = $('span.errormessage:visible'); 72165 if (errorEl && errorEl.length > 0) { 72166 var labels = []; 72167 $.each(errorEl, function(index, el) { 72168 var labelEl = $(el).closest('.form-group').find('label'); 72169 labels.push($(labelEl).contents().not($(labelEl).children()).text().trim()); 72170 72171 }); 72172 digitalData.form.formError = labels.join(","); 72173 } 72174 console.log("form error message"); 72175 _satellite.track("formerror"); 72176 return; 72177 72178 } else { 72179 console.log("form submit"); 72180 digitalData.form.formPlatform = "Eloqua"; 72181 _satellite.track("formend"); 72182 if (sessionStorage.getItem('items') != null) { 72183 sessionStorage.removeItem('items', ''); 72184 } 72185 72186 var formData = new FormData($(this).closest('form')[0]); 72187 $(".successButton").attr("disabled", "disabled"); 72188 $.ajax({ 72189 type: "POST", 72190 enctype: "multipart/form-data", 72191 url: $("form").attr("action"), 72192 data: formData, 72193 processData: false, 72194 contentType: false, 72195 success: function(result) { 72196 $(".image_gif").hide(); 72197 var html = jQuery('html'); 72198 var scrollPosition = html.data('scroll-position'); 72199 html.css('overflow', html.data('previous-overflow')); 72200 window.scrollTo(scrollPosition[0], scrollPosition[1]); 72201 console.log("result=" + result); 72202 $(".successButton").attr("disabled", "disabled"); 72203 $(".successButton").addClass("success"); 72204 $(".successButton").val("Submitted Successfully"); 72205 digitalData.form.formPlatform = "Eloqua"; 72206 _satellite.track("formend"); 72207 $(".result .success").show(); 72208 }, 72209 beforeSend: function() { 72210 $(".image_gif").show(); 72211 var scrollPosition = [ 72212 self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, 72213 self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop 72214 ]; 72215 var html = jQuery('html'); // it would make more sense to apply this to body, but IE7 won't have that 72216 html.data('scroll-position', scrollPosition); 72217 html.data('previous-overflow', html.css('overflow')); 72218 html.css('overflow', 'hidden'); 72219 window.scrollTo(scrollPosition[0], scrollPosition[1]); 72220 }, 72221 error: function(error) { 72222 $(".image_gif").hide(); 72223 var html = jQuery('html'); 72224 var scrollPosition = html.data('scroll-position'); 72225 html.css('overflow', html.data('previous-overflow')); 72226 window.scrollTo(scrollPosition[0], scrollPosition[1]); 72227 console.log("Error +" + error); 72228 submitCount = 0; 72229 //Manage Error CSS 72230 $(".successButton").removeAttr("disabled"); 72231 $(".successButton").val("Send"); 72232 $(".result .error").show(); 72233 } 72234 }); 72235 72236 } 72237 }); 72238 72239 72240 var redirectFullURL = $('.dccform input[name=redirect_FullURL]').attr('value'); 72241 //console.log("form test"); 72242 //console.log(redirectFullURL, "redirectFullURL"); 72243 if (redirectFullURL && redirectFullURL.indexOf('http:') < 0 && redirectFullURL.indexOf('https:') < 0) { 72244 var currentUrl = window.location.href; 72245 var splitCurrentParts = currentUrl.split("/"); 72246 redirectFullURL = splitCurrentParts[0] + redirectFullURL; 72247 } 72248 72249 $('.dccform input[name=redirect_page]').attr('value', redirectFullURL); 72250 $('.dccform input[name=redirect_FullURL2]').attr('value', redirectFullURL); 72251 $('.dccform input[name=redirect_FullURL]').attr('value', redirectFullURL); 72252 72253 72254 72255 $('.comments-star').hide(); 72256 $('#subjectOfqtnPrv').change(function() { 72257 var comment = $('#comments'); 72258 if ($(this)[0].value == 'Other') { 72259 comment.addClass('requireField'); 72260 $('.comments-star').show(); 72261 } else { 72262 72263 comment.removeClass('requireField'); 72264
72265 comment.next().removeClass("requiredtext_form"); 72266 comment.next().hide(); 72267 72268 comment.next().removeClass("requireFieldBorder"); 72269 $('.comments-star').hide(); 72270 } 72271 }) 72272 72273}); 72274 72275$(document).ready(function() { 72276 72277var jsonData = ""; 72278 72279 $.ajax({ 72280 type: 'GET', 72281 url: '/dupont/dcccontactusform/result', 72282 cache:false, 72283 dataType:'json', 72284 data: { 72285 resourcePath: $('#resourcePath').val() 72286 }, 72287 success: function(listItems) { 72288 72289 jsonData = listItems; 72290 for( var i = 0; i < listItems.length; i++) { 72291 var obj = listItems[i]; 72292 var stringtoappend = '<option value="' + obj.recordTypes + '" class="'+obj.salesForceInstance+'">' + obj.salesForceInstance + '</option>'; 72293 $('#saleforceInstanceId').append(stringtoappend); 72294 72295 } 72296 72297 72298 72299 } 72300 }); 72301 72302 $("#saleforceInstanceId").change(function () { 72303 var selectedText = $(this).find("option:selected").text(); 72304 var selectedValue = $(this).val(); 72305 var tRecordTypes = selectedValue.slice(0, -1); 72306 var array = tRecordTypes.split("|,"); 72307 $('#recordTypeId').html(""); 72308 if(!selectedValue) 72309 $('#recordTypeId').append('<option value="">Record Type</option>'); 72310 72311 for(i=0;i<array.length;i++){ 72312 var stringtoappend = '<option data-value='+ array[i]+'>' + array[i] + '</option>'; 72313 $('#recordTypeId').append(stringtoappend); 72314 } 72315 72316 72317 hiddenFeildsRoleidAddition(); 72318 }); 72319 72320 72321 function getRecordTypes(recordTypes,salesForceInstance) { 72322 72323 console.log('--------> '+recordTypes); 72324 /*var tEffectsData = recordTypes.slice(0, -1); 72325 var array = tEffectsData.split("|,"); 72326 var recordTypeIdArray = '<option>' + array + '</option>'; 72327 72328 $('#recordTypeId').append(recordTypeIdArray);*/ 72329 72330 72331 } 72332 $("input[type=hidden]").each(function(){ if($(this).val().indexOf("Null-") >-1 ){ $(this).val("") } }); 72333 hiddenFeildsRoleidAddition(); 72334 //hiddenFeildsAddition(); 72335 $("#saleforceInstanceId").on("change", function() { 72336 // hiddenFeildsAddition(); 72337 }) 72338 $("#recordTypeId").on("change", function() { 72339 hiddenFeildsRoleidAddition(); 72340 }) 72341 function hiddenFeildsAddition() { 72342 72343 var SelectedValue = $("#saleforceInstanceId").val(); 72344 $("#saleforceInstanceId option").each( 72345 function() { 72346 var x = $(this).val(); 72347 if (x) { 72348 x = "#" + x; 72349 $(x).hide(); 72350 $(x + " input").prop("disabled", true); 72351 } 72352 }); 72353 if(SelectedValue){ 72354 var SelectedValue = "#" + SelectedValue; 72355 $(SelectedValue).show(); 72356 $("form").attr("action",$(SelectedValue).children("div").data("actionurl")) 72357 $(SelectedValue + " input").prop("disabled", false); 72358 } 72359 72360 } 72361 72362 function hiddenFeildsRoleidAddition() { 72363 72364 var SelectedValue = $("#recordTypeId option:selected").text().split(" "); 72365 72366 if(SelectedValue.length>1){ 72367 SelectedValue = SelectedValue.join('_'); 72368 72369 } 72370 $("#recordTypeId option").each( 72371 function() { 72372 var x = $(this).text(); 72373 if(x.indexOf(" ") != -1) 72374 x = x.split(" ").join('_').replace("&","and"); 72375 72376 if (x) { 72377 x = "." + x; 72378 $(x).hide(); 72379 $(x + " input").prop("disabled", true); 72380 } 72381 }); 72382 var arr;$("#saleforceInstanceId option").each(function(){ arr = $(this).val().split("|").join().split(","); 72383 arr.forEach(function(value,index){ var classnames = value.split(" ").join("_"); if(classnames){ classnames = ("."+classnames).replace("&","and");$(classnames + " input").prop("disabled", true); };}) 72384 }); 72385 72386 72387 if(SelectedValue.indexOf("&") != -1) SelectedValue = SelectedValue.replace("&","and"); 72388 if(SelectedValue && SelectedValue[0] != '' ){ 72389 var SelectedValue = "." + SelectedValue; 72390 $(SelectedValue).show(); 72391 if($(SelectedValue).children("div:not(.namesoffeilds)")) {$("form").attr("action",$(SelectedValue).children("div:not(.namesoffeilds)").data("actionurl"))}; 72392 $(SelectedValue + " input").prop("disabled", false); 72393 var nameOfFeilds = $(SelectedValue+">.namesoffeilds").data("names");
72394 if(nameOfFeilds){ 72395 nameOfFeilds = nameOfFeilds.split(","); 72396 72397 nameOfFeilds.forEach(function(value,index){ 72398 72399 var idname = value.split(":"); 72400 $("#"+idname[0]).attr("name",idname[1]); 72401 72402 }); 72403 } 72404 72405 } 72406 72407 72408 } 72409 72410 $('select.form-control.corporate-dropDown').selectize({}); 72411 var selectContact; 72412 var selectizeContact; 72413 if ($("#countryContact").length != 0) { 72414 selectContact = $("#countryContact").selectize(); 72415 selectizeContact = selectContact[0].selectize; 72416 if ($("#countryContact").attr('data-country') != '' && $("#countryContact").attr('data-country') != undefined && $("#countryContact").attr('data-country') != null) { 72417 selectizeContact.setValue($("#countryContact").attr('data-country')); 72418 } 72419 } 72420 72421 72422 72423}); 72424 72425$(document).ready(function(){ 72426 72427 var totalNumberOfEvents = $('#water-event-pagination .list-item').length; 72428 var eventTitle=$('#water-event-pagination .event-overall-number').text() || " events"; 72429 72430 72431 var pageSize = 10; 72432 72433 var numberOfpage = totalNumberOfEvents/pageSize; 72434 72435 numberOfpage = Math.ceil(numberOfpage); 72436 72437 72438 for (var i = 1; i <= numberOfpage; i++) { 72439 72440 $("#divPages").append('<div class="page-item"><a class="page-link" href="#.">' + i + '</a></div>'); 72441 72442 } 72443 72444 var totalPagenum = $("#divPages .page-item").length; 72445 72446 if(totalPagenum == 1) 72447 { 72448 $('#water-event-pagination #divPages').css('display','none'); 72449 72450 }else{ 72451 72452 $('#water-event-pagination #divPages').css('display','flex'); 72453 } 72454 72455 72456 if(totalPagenum >10) 72457 { 72458 $("#divPages .page-item").hide(); 72459 for(var n=1;n<=10;n++) 72460 { 72461 $("#divPages .page-item:nth-child("+n+")").show(); 72462 } 72463 72464 $("#water-event-pagination .event-overall-number").html("Showing 1 - 10 of "+ totalNumberOfEvents +" "+eventTitle); 72465 } 72466 else{ 72467 $("#event-prev").hide(); 72468 $("#event-next").hide(); 72469 72470 $("#water-event-pagination .event-overall-number").html("Showing 1 - "+ totalNumberOfEvents +" of "+ totalNumberOfEvents +" "+eventTitle); 72471 } 72472 72473 $("#water-event-pagination .list-item").hide(); 72474 for(var j=1;j<=pageSize;j++) 72475 { 72476 $("#water-event-pagination .list-item:nth-child("+j+")").show(); 72477 } 72478 72479 displayevent(); 72480 72481 $("#event-next").click(function(){ 72482 72483 var currentPage = parseInt($('#divPages .page-item .page-link.active').text(),10); 72484 72485 var new_page = currentPage + 1; 72486 72487 72488 if(new_page>=2){ 72489 72490 $("#event-prev").show(); 72491 } 72492 72493 72494 72495 $("#water-event-pagination .list-item").hide(); 72496
72497 for (var k = (new_page * pageSize) - (pageSize-1); k <= (new_page * pageSize); k++) 72498 { 72499 $("#water-event-pagination .list-item:nth-child("+k+")").show(); 72500 } 72501 72502 72503 var initialNumber = (new_page * pageSize) - (pageSize-1); 72504 //var lastNumber = (new_page * pageSize); 72505 72506 var availablleNumber = $('#water-event-pagination .list-item').filter(function() { 72507 return $(this).css('display') === 'block'; 72508 }).length; 72509 72510 var lastNumber = availablleNumber + initialNumber - 1; 72511 72512 $("#water-event-pagination .event-overall-number").html("Showing "+ initialNumber +" - "+ lastNumber +" of "+ totalNumberOfEvents +" events"); 72513 72514 72515 $("#divPages .page-item .page-link").removeClass('active'); 72516 72517 $("#divPages .page-item:nth-child(" + new_page + ") .page-link").addClass('active'); 72518 72519 72520 if($("#divPages .page-item:nth-child(" + new_page + ")").css("display") === 'none') 72521 { 72522 72523 $("#divPages .page-item:nth-child(" + new_page + ")").css("display","block"); 72524 72525 $(this).find('page-link').addClass('active'); 72526 72527 var hideitem = new_page-10; 72528 72529 $("#divPages .page-item:nth-child(" + hideitem + ")").css("display","none").removeClass('selected'); 72530 72531 displayevent(); 72532 } 72533 72534 72535 var lastItem = $("#divPages .page-item.selected:last-child").text(); 72536 72537 if(lastItem == numberOfpage && ($("#divPages .page-item.selected:last-child .page-link")).hasClass('active') ){ 72538 72539 $("#event-next").hide(); 72540 $("#event-prev").show(); 72541 72542 } 72543 72544 }); 72545 72546 72547 72548 72549 $("#event-prev").click(function(){ 72550 72551 72552 var currentPage = parseInt($('#divPages .page-item .page-link.active').text(),10); 72553 72554 var new_page = currentPage - 1; 72555 72556 72557 if(new_page<=(numberOfpage-1)){ 72558 72559 $("#event-next").show(); 72560 } 72561 72562 72563 $("#water-event-pagination .list-item").hide(); 72564
72565 for (var k = (new_page * pageSize) - (pageSize-1); k <= (new_page * pageSize); k++) 72566 { 72567 $("#water-event-pagination .list-item:nth-child("+k+")").show(); 72568 } 72569 72570 72571 var initialNumber = (new_page * pageSize) - (pageSize-1); 72572 //var lastNumber = (new_page * pageSize); 72573 72574 var availablleNumber = $('#water-event-pagination .list-item').filter(function() { 72575 return $(this).css('display') === 'block'; 72576 }).length; 72577 72578 var lastNumber = availablleNumber + initialNumber - 1; 72579 72580 $("#water-event-pagination .event-overall-number").html("Showing "+ initialNumber +" - "+ lastNumber +" of "+ totalNumberOfEvents +" events"); 72581 72582 72583 72584 $("#divPages .page-item .page-link").removeClass('active'); 72585 72586 $("#divPages .page-item:nth-child(" + new_page + ") .page-link").addClass('active'); 72587 72588 72589 if($("#divPages .page-item:nth-child(" + new_page + ")").css("display") === 'none') 72590 { 72591 72592 $("#divPages .page-item:nth-child(" + new_page + ")").css("display","block"); 72593 72594 $(this).find('page-link').addClass('active'); 72595 72596 var hideitem = new_page+10; 72597 72598 $("#divPages .page-item:nth-child(" + hideitem + ")").css("display","none").removeClass('selected'); 72599 72600 displayevent(); 72601 } 72602 72603 72604 var firstItem = $("#divPages .page-item.selected:first-child").text(); 72605 72606 if(firstItem == 1 && ($("#divPages .page-item.selected:first-child .page-link")).hasClass('active') ){ 72607 72608 $("#event-next").show(); 72609 $("#event-prev").hide(); 72610 72611 } 72612 72613 }); 72614 72615 72616 $("#divPages .page-item").click(function(){ 72617 72618 $('#divPages .page-link').removeClass('active'); 72619 72620 var currentPage = $(this).text(); 72621 72622 if(currentPage>=2){ 72623 72624 $("#event-prev").show(); 72625 } 72626 72627 if(currentPage<=(numberOfpage-1)){ 72628 72629 $("#event-next").show(); 72630 } 72631 72632 if(currentPage == numberOfpage){ 72633 72634 $("#event-next").hide(); 72635 $("#event-prev").show(); 72636 72637 } 72638 72639 if(currentPage == 1){ 72640 72641 $("#event-next").show(); 72642 $("#event-prev").hide(); 72643 72644 } 72645 72646 $(this).find('.page-link').addClass('active'); 72647 72648 $("#water-event-pagination .list-item").hide(); 72649 72650 72651 72652 for (var k = (currentPage * pageSize) - (pageSize-1); k <= (currentPage * pageSize); k++) 72653 { 72654 $("#water-event-pagination .list-item:nth-child("+k+")").show(); 72655 } 72656 72657 72658 var initialNumber = (currentPage * pageSize) - (pageSize-1); 72659 //var lastNumber = (currentPage * pageSize); 72660 72661 var availablleNumber = $('#water-event-pagination .list-item').filter(function() { 72662 return $(this).css('display') === 'block'; 72663 }).length; 72664 72665 var lastNumber = availablleNumber + initialNumber - 1; 72666 72667 72668 $("#water-event-pagination .event-overall-number").html("Showing "+ initialNumber +" - "+ lastNumber +" of "+ totalNumberOfEvents +" events"); 72669 72670 }); 72671 72672 72673 $('#divPages .page-item:first-child .page-link').addClass('active'); 72674 72675 72676 //var startNumber = $("#water-event-pagination .list-item").length 72677 72678 // $("#water-event-pagination .event-overall-number").html("Showing 1-10 of "+ totalNumberOfEvents +" events"); 72679 72680 72681 72682 }); 72683 72684 72685 72686function displayevent() 72687{ 72688 $("#divPages .page-item").each(function(){ 72689 if( $(this).css('display') === 'block') { 72690 $(this).addClass('selected'); 72691 } 72692 else{ 72693 $(this).removeClass('selected'); 72694 } 72695 }); 72696} 72697$(function() { 72698 var contactComps = $(".component-contact"); 72699 $.each(contactComps, function(ind, val) { 72700 var contactImages = $(val).find('.profile-image'); 72701 var imgFound = false; 72702 72703 $.each(contactImages, function(i, v) { 72704 72705 if ($(v).attr('src') != undefined) { 72706 imgFound = true; 72707 72708 } 72709 72710 }); 72711 72712 if (!imgFound) { 72713 $(val).addClass('without-image'); 72714 } 72715 72716 72717 }); 72718}); 72719 72720$(function() { 72721 72722 /*Category Container Component*/ 72723 let catContainer = function(compId) { 72724 this.catComp = $($('.' + compId)[0]); 72725 if (this.catComp.length > 0) { 72726 this.mobImg = this.catComp.find('.img-container').attr('data-mobimg'); 72727 this.deskImg = this.catComp.find('.img-container').attr('data-deskimg'); 72728 } 72729 72730 } 72731 72732 catContainer.prototype.init = function() { 72733 if (this.catComp.length && this.mobImg) { 72734 let self = this; 72735 this.setBgImage(); 72736 $(window).resize(function(){ 72737 self.setBgImage(); 72738 }) 72739 } 72740 } 72741 72742 catContainer.prototype.setBgImage = function() { 72743 if(window.innerWidth <= 576 && this.mobImg){ 72744 this.catComp.find('.img-container').css('background-image','url('+this.mobImg+')'); 72745 }else{ 72746 this.catComp.find('.img-container').css('background-image','url('+this.deskImg+')'); 72747 } 72748 } 72749 72750 $.each($('.category-bgImage'), function(i, v) { 72751 $(v).addClass("cbgi-" + i); 72752 (new catContainer("cbgi-" + i)).init(); 72753 72754 }); 72755 72756}); 72757
vendor: 23,794 bytes, lines 72758-72772
72758/* 72759 * jQuery carouFredSel 6.2.1 72760 * Demo's and documentation: 72761 * caroufredsel.dev7studios.com 72762 * 72763 * Copyright (c) 2013 Fred Heusschen 72764 * www.frebsite.nl 72765 * 72766 * Dual licensed under the MIT and GPL licenses. 72767 * http://en.wikipedia.org/wiki/MIT_License 72768 * http://en.wikipedia.org/wiki/GNU_General_Public_License 72769 */ 72770 72771 72772(function($){function sc_setScroll(a,b,c){return"transition"==c.transition&&"swing"==b&&(b="ease"),{anims:[],duration:a,orgDuration:a,easing:b,startTime:getTime()}}function sc_startScroll(a,b){for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e&&e[0][b.transition](e[1],a.duration,a.easing,e[2])}}function sc_stopScroll(a,b){is_boolean(b)||(b=!0),is_object(a.pre)&&sc_stopScroll(a.pre,b);for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e[0].stop(!0),b&&(e[0].css(e[1]),is_function(e[2])&&e[2]())}is_object(a.post)&&sc_stopScroll(a.post,b)}function sc_afterScroll(a,b,c){switch(b&&b.remove(),c.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":a.css("opacity",1),a.css("filter","")}}function sc_fireCallbacks(a,b,c,d,e){if(b[c]&&b[c].call(a,d),e[c].length)for(var f=0,g=e[c].length;g>f;f++)e[c][f].call(a,d);return[]}function sc_fireQueue(a,b,c){return b.length&&(a.trigger(cf_e(b[0][0],c),b[0][1]),b.shift()),b}function sc_hideHiddenItems(a){a.each(function(){var a=$(this);a.data("_cfs_isHidden",a.is(":hidden")).hide()})}function sc_showHiddenItems(a){a&&a.each(function(){var a=$(this);a.data("_cfs_isHidden")||a.show()})}function sc_clearTimers(a){return a.auto&&clearTimeout(a.auto),a.progress&&clearInterval(a.progress),a}function sc_mapCallbackArguments(a,b,c,d,e,f,g){return{width:g.width,height:g.height,items:{old:a,skipped:b,visible:c},scroll:{items:d,direction:e,duration:f}}}function sc_getDuration(a,b,c,d){var e=a.duration;return"none"==a.fx?0:("auto"==e?e=b.scroll.duration/b.scroll.items*c:10>e&&(e=d/e),1>e?0:("fade"==a.fx&&(e/=2),Math.round(e)))}function nv_showNavi(a,b,c){var d=is_number(a.items.minimum)?a.items.minimum:a.items.visible+1;if("show"==b||"hide"==b)var e=b;else if(d>b){debug(c,"Not enough items ("+b+" total, "+d+" needed): Hiding navigation.");var e="hide"}else var e="show";var f="show"==e?"removeClass":"addClass",g=cf_c("hidden",c);a.auto.button&&a.auto.button[e]()[f](g),a.prev.button&&a.prev.button[e]()[f](g),a.next.button&&a.next.button[e]()[f](g),a.pagination.container&&a.pagination.container[e]()[f](g)}function nv_enableNavi(a,b,c){if(!a.circular&&!a.infinite){var d="removeClass"==b||"addClass"==b?b:!1,e=cf_c("disabled",c);if(a.auto.button&&d&&a.auto.button[d](e),a.prev.button){var f=d||0==b?"addClass":"removeClass";a.prev.button[f](e)}if(a.next.button){var f=d||b==a.items.visible?"addClass":"removeClass";a.next.button[f](e)}}}function go_getObject(a,b){return is_function(b)?b=b.call(a):is_undefined(b)&&(b={}),b}function go_getItemsObject(a,b){return b=go_getObject(a,b),is_number(b)?b={visible:b}:"variable"==b?b={visible:b,width:b,height:b}:is_object(b)||(b={}),b}function go_getScrollObject(a,b){return b=go_getObject(a,b),is_number(b)?b=50>=b?{items:b}:{duration:b}:is_string(b)?b={easing:b}:is_object(b)||(b={}),b}function go_getNaviObject(a,b){if(b=go_getObject(a,b),is_string(b)){var c=cf_getKeyCode(b);b=-1==c?$(b):c}return b}function go_getAutoObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={button:b}:is_boolean(b)?b={play:b}:is_number(b)&&(b={timeoutDuration:b}),b.progress&&(is_string(b.progress)||is_jquery(b.progress))&&(b.progress={bar:b.progress}),b}function go_complementAutoObject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_boolean(b.play)||(b.play=!0),is_number(b.delay)||(b.delay=0),is_undefined(b.pauseOnEvent)&&(b.pauseOnEvent=!0),is_boolean(b.pauseOnResize)||(b.pauseOnResize=!0),is_number(b.timeoutDuration)||(b.timeoutDuration=10>b.duration?2500:5*b.duration),b.progress&&(is_function(b.progress.bar)&&(b.progress.bar=b.progress.bar.call(a)),is_string(b.progress.bar)&&(b.progress.bar=$(b.progress.bar)),b.progress.bar?(is_function(b.progress.updater)||(b.progress.updater=$.fn.carouFredSel.progressbarUpdater),is_number(b.progress.interval)||(b.progress.interval=50)):b.progress=!1),b}function go_getPrevNextObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={button:b}:is_number(b)&&(b={key:b}),b}function go_complementPrevNextObject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_string(b.key)&&(b.key=cf_getKeyCode(b.key)),b}function go_getPaginationObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={container:b}:is_boolean(b)&&(b={keys:b}),b}function go_complementPaginationObject(a,b){return is_function(b.container)&&(b.container=b.container.call(a)),is_string(b.container)&&(b.container=$(b.container)),is_number(b.items)||(b.items=!1),is_boolean(b.keys)||(b.keys=!1),is_function(b.anchorBuilder)||is_false(b.anchorBuilder)||(b.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder),is_number(b.deviation)||(b.deviation=0),b}function go_getSwipeObject(a,b){return is_function(b)&&(b=b.call(a)),is_undefined(b)&&(b={onTouch:!1}),is_true(b)?b={onTouch:b}:is_number(b)&&(b={items:b}),b}function go_complementSwipeObject(a,b){return is_boolean(b.onTouch)||(b.onTouch=!0),is_boolean(b.onMouse)||(b.onMouse=!1),is_object(b.options)||(b.options={}),is_boolean(b.options.triggerOnTouchEnd)||(b.options.triggerOnTouchEnd=!1),b}function go_getMousewheelObject(a,b){return is_function(b)&&(b=b.call(a)),is_true(b)?b={}:is_number(b)?b={items:b}:is_undefined(b)&&(b=!1),b}function go_complementMousewheelObject(a,b){return b}function gn_getItemIndex(a,b,c,d,e){if(is_string(a)&&(a=$(a,e)),is_object(a)&&(a=$(a,e)),is_jquery(a)?(a=e.children().index(a),is_boolean(c)||(c=!1)):is_boolean(c)||(c=!0),is_number(a)||(a=0),is_number(b)||(b=0),c&&(a+=d.first),a+=b,d.total>0){for(;a>=d.total;)a-=d.total;for(;0>a;)a+=d.total}return a}function gn_getVisibleItemsPrev(a,b,c){for(var d=0,e=0,f=c;f>=0;f--){var g=a.eq(f);if(d+=g.is(":visible")?g[b.d.outerWidth](!0):0,d>b.maxDimension)return e;0==f&&(f=a.length),e++}}function gn_getVisibleItemsPrevFilter(a,b,c){return gn_getItemsPrevFilter(a,b.items.filter,b.items.visibleConf.org,c)}function gn_getScrollItemsPrevFilter(a,b,c,d){return gn_getItemsPrevFilter(a,b.items.filter,d,c)}function gn_getItemsPrevFilter(a,b,c,d){for(var e=0,f=0,g=d,h=a.length;g>=0;g--){if(f++,f==h)return f;var i=a.eq(g);if(i.is(b)&&(e++,e==c))return f;0==g&&(g=h)}}function gn_getVisibleOrg(a,b){return b.items.visibleConf.org||a.children().slice(0,b.items.visible).filter(b.items.filter).length}function gn_getVisibleItemsNext(a,b,c){for(var d=0,e=0,f=c,g=a.length-1;g>=f;f++){var h=a.eq(f);if(d+=h.is(":visible")?h[b.d.outerWidth](!0):0,d>b.maxDimension)return e;if(e++,e==g+1)return e;f==g&&(f=-1)}}function gn_getVisibleItemsNextTestCircular(a,b,c,d){var e=gn_getVisibleItemsNext(a,b,c);return b.circular||c+e>d&&(e=d-c),e}function gn_getVisibleItemsNextFilter(a,b,c){return gn_getItemsNextFilter(a,b.items.filter,b.items.visibleConf.org,c,b.circular)}function gn_getScrollItemsNextFilter(a,b,c,d){return gn_getItemsNextFilter(a,b.items.filter,d+1,c,b.circular)-1}function gn_getItemsNextFilter(a,b,c,d){for(var f=0,g=0,h=d,i=a.length-1;i>=h;h++){if(g++,g>=i)return g;var j=a.eq(h);if(j.is(b)&&(f++,f==c))return g;h==i&&(h=-1)}}function gi_getCurrentItems(a,b){return a.slice(0,b.items.visible)}function gi_getOldItemsPrev(a,b,c){return a.slice(c,b.items.visibleConf.old+c)}function gi_getNewItemsPrev(a,b){return a.slice(0,b.items.visible)}function gi_getOldItemsNext(a,b){return a.slice(0,b.items.visibleConf.old)}function gi_getNewItemsNext(a,b,c){return a.slice(c,b.items.visible+c)}function sz_storeMargin(a,b,c){b.usePadding&&(is_string(c)||(c="_cfs_origCssMargin"),a.each(function(){var a=$(this),d=parseInt(a.css(b.d.marginRight),10);is_number(d)||(d=0),a.data(c,d)}))}function sz_resetMargin(a,b,c){if(b.usePadding){var d=is_boolean(c)?c:!1;is_number(c)||(c=0),sz_storeMargin(a,b,"_cfs_tempCssMargin"),a.each(function(){var a=$(this);a.css(b.d.marginRight,d?a.data("_cfs_tempCssMargin"):c+a.data("_cfs_origCssMargin"))})}}function sz_storeOrigCss(a){a.each(function(){var a=$(this);a.data("_cfs_origCss",a.attr("style")||"")})}function sz_restoreOrigCss(a){a.each(function(){var a=$(this);a.attr("style",a.data("_cfs_origCss")||"")})}function sz_setResponsiveSizes(a,b){var d=(a.items.visible,a.items[a.d.width]),e=a[a.d.height],f=is_percentage(e);b.each(function(){var b=$(this),c=d-ms_getPaddingBorderMargin(b,a,"Width");b[a.d.width](c),f&&b[a.d.height](ms_getPercentage(c,e))})}function sz_setSizes(a,b){var c=a.parent(),d=a.children(),e=gi_getCurrentItems(d,b),f=cf_mapWrapperSizes(ms_getSizes(e,b,!0),b,!1);if(c.css(f),b.usePadding){var g=b.padding,h=g[b.d[1]];b.align&&0>h&&(h=0);var i=e.last();i.css(b.d.marginRight,i.data("_cfs_origCssMargin")+h),a.css(b.d.top,g[b.d[0]]),a.css(b.d.left,g[b.d[3]])}return a.css(b.d.width,f[b.d.width]+2*ms_getTotalSize(d,b,"width")),a.css(b.d.height,ms_getLargestSize(d,b,"height")),f}function ms_getSizes(a,b,c){return[ms_getTotalSize(a,b,"width",c),ms_getLargestSize(a,b,"height",c)]}function ms_getLargestSize(a,b,c,d){return is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d?b[b.d[c]]:is_number(b.items[b.d[c]])?b.items[b.d[c]]:(c=c.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",ms_getTrueLargestSize(a,b,c))}function ms_getTrueLargestSize(a,b,c){for(var d=0,e=0,f=a.length;f>e;e++){var g=a.eq(e),h=g.is(":visible")?g[b.d[c]](!0):0;h>d&&(d=h)}return d}function ms_getTotalSize(a,b,c,d){if(is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d)return b[b.d[c]];if(is_number(b.items[b.d[c]]))return b.items[b.d[c]]*a.length;for(var e=c.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",f=0,g=0,h=a.length;h>g;g++){var i=a.eq(g);f+=i.is(":visible")?i[b.d[e]](!0):0}return f}function ms_getParentSize(a,b,c){var d=a.is(":visible");d&&a.hide();var e=a.parent()[b.d[c]]();return d&&a.show(),e}function ms_getMaxDimension(a,b){return is_number(a[a.d.width])?a[a.d.width]:b}function ms_hasVariableSizes(a,b,c){for(var d=!1,e=!1,f=0,g=a.length;g>f;f++){var h=a.eq(f),i=h.is(":visible")?h[b.d[c]](!0):0;d===!1?d=i:d!=i&&(e=!0),0==d&&(e=!0)}return e}function ms_getPaddingBorderMargin(a,b,c){return a[b.d["outer"+c]](!0)-a[b.d[c.toLowerCase()]]()}function ms_getPercentage(a,b){if(is_percentage(b)){if(b=parseInt(b.slice(0,-1),10),!is_number(b))return a;a*=b/100}return a}function cf_e(a,b,c,d,e){return is_boolean(c)||(c=!0),is_boolean(d)||(d=!0),is_boolean(e)||(e=!1),c&&(a=b.events.prefix+a),d&&(a=a+"."+b.events.namespace),d&&e&&(a+=b.serialNumber),a}function cf_c(a,b){return is_string(b.classnames[a])?b.classnames[a]:a}function cf_mapWrapperSizes(a,b,c){is_boolean(c)||(c=!0);var d=b.usePadding&&c?b.padding:[0,0,0,0],e={};return e[b.d.width]=a[0]+d[1]+d[3],e[b.d.height]=a[1]+d[0]+d[2],e}function cf_sortParams(a,b){for(var c=[],d=0,e=a.length;e>d;d++)for(var f=0,g=b.length;g>f;f++)if(b[f].indexOf(typeof a[d])>-1&&is_undefined(c[f])){c[f]=a[d];break}return c}function cf_getPadding(a){if(is_undefined(a))return[0,0,0,0];if(is_number(a))return[a,a,a,a];if(is_string(a)&&(a=a.split("px").join("").split("em").join("").split(" ")),!is_array(a))return[0,0,0,0];for(var b=0;4>b;b++)a[b]=parseInt(a[b],10);switch(a.length){case 0:return[0,0,0,0];case 1:return[a[0],a[0],a[0],a[0]];case 2:return[a[0],a[1],a[0],a[1]];case 3:return[a[0],a[1],a[2],a[1]];default:return[a[0],a[1],a[2],a[3]]}}function cf_getAlignPadding(a,b){var c=is_number(b[b.d.width])?Math.ceil(b[b.d.width]-ms_getTotalSize(a,b,"width")):0;switch(b.align){case"left":return[0,c];case"right":return[c,0];case"center":default:return[Math.ceil(c/2),Math.floor(c/2)]}}function cf_getDimensions(a){for(var b=[["width","innerWidth","outerWidth","height","innerHeight","outerHeight","left","top","marginRight",0,1,2,3],["height","innerHeight","outerHeight","width","innerWidth","outerWidth","top","left","marginBottom",3,2,1,0]],c=b[0].length,d="right"==a.direction||"left"==a.direction?0:1,e={},f=0;c>f;f++)e[b[0][f]]=b[d][f];return e}function cf_getAdjust(a,b,c,d){var e=a;if(is_function(c))e=c.call(d,e);else if(is_string(c)){var f=c.split("+"),g=c.split("-");if(g.length>f.length)var h=!0,i=g[0],j=g[1];else var h=!1,i=f[0],j=f[1];switch(i){case"even":e=1==a%2?a-1:a;break;case"odd":e=0==a%2?a-1:a;break;default:e=a}j=parseInt(j,10),is_number(j)&&(h&&(j=-j),e+=j)}return(!is_number(e)||1>e)&&(e=1),e}function cf_getItemsAdjust(a,b,c,d){return cf_getItemAdjustMinMax(cf_getAdjust(a,b,c,d),b.items.visibleConf)}function cf_getItemAdjustMinMax(a,b){return is_number(b.min)&&b.min>a&&(a=b.min),is_number(b.max)&&a>b.max&&(a=b.max),1>a&&(a=1),a}function cf_getSynchArr(a){is_array(a)||(a=[[a]]),is_array(a[0])||(a=[a]);for(var b=0,c=a.length;c>b;b++)is_string(a[b][0])&&(a[b][0]=$(a[b][0])),is_boolean(a[b][1])||(a[b][1]=!0),is_boolean(a[b][2])||(a[b][2]=!0),is_number(a[b][3])||(a[b][3]=0);return a}function cf_getKeyCode(a){return"right"==a?39:"left"==a?37:"up"==a?38:"down"==a?40:-1}function cf_setCookie(a,b,c){if(a){var d=b.triggerHandler(cf_e("currentPosition",c));$.fn.carouFredSel.cookie.set(a,d)}}function cf_getCookie(a){var b=$.fn.carouFredSel.cookie.get(a);return""==b?0:b}function in_mapCss(a,b){for(var c={},d=0,e=b.length;e>d;d++)c[b[d]]=a.css(b[d]);return c}function in_complementItems(a,b,c,d){return is_object(a.visibleConf)||(a.visibleConf={}),is_object(a.sizesConf)||(a.sizesConf={}),0==a.start&&is_number(d)&&(a.start=d),is_object(a.visible)?(a.visibleConf.min=a.visible.min,a.visibleConf.max=a.visible.max,a.visible=!1):is_string(a.visible)?("variable"==a.visible?a.visibleConf.variable=!0:a.visibleConf.adjust=a.visible,a.visible=!1):is_function(a.visible)&&(a.visibleConf.adjust=a.visible,a.visible=!1),is_string(a.filter)||(a.filter=c.filter(":hidden").length>0?":visible":"*"),a[b.d.width]||(b.responsive?(debug(!0,"Set a "+b.d.width+" for the items!"),a[b.d.width]=ms_getTrueLargestSize(c,b,"outerWidth")):a[b.d.width]=ms_hasVariableSizes(c,b,"outerWidth")?"variable":c[b.d.outerWidth](!0)),a[b.d.height]||(a[b.d.height]=ms_hasVariableSizes(c,b,"outerHeight")?"variable":c[b.d.outerHeight](!0)),a.sizesConf.width=a.width,a.sizesConf.height=a.height,a}function in_complementVisibleItems(a,b){return"variable"==a.items[a.d.width]&&(a.items.visibleConf.variable=!0),a.items.visibleConf.variable||(is_number(a[a.d.width])?a.items.visible=Math.floor(a[a.d.width]/a.items[a.d.width]):(a.items.visible=Math.floor(b/a.items[a.d.width]),a[a.d.width]=a.items.visible*a.items[a.d.width],a.items.visibleConf.adjust||(a.align=!1)),("Infinity"==a.items.visible||1>a.items.visible)&&(debug(!0,'Not a valid number of visible items: Set to "variable".'),a.items.visibleConf.variable=!0)),a}function in_complementPrimarySize(a,b,c){return"auto"==a&&(a=ms_getTrueLargestSize(c,b,"outerWidth")),a}function in_complementSecondarySize(a,b,c){return"auto"==a&&(a=ms_getTrueLargestSize(c,b,"outerHeight")),a||(a=b.items[b.d.height]),a}function in_getAlignPadding(a,b){var c=cf_getAlignPadding(gi_getCurrentItems(b,a),a);return a.padding[a.d[1]]=c[1],a.padding[a.d[3]]=c[0],a}function in_getResponsiveValues(a,b){var d=cf_getItemAdjustMinMax(Math.ceil(a[a.d.width]/a.items[a.d.width]),a.items.visibleConf);d>b.length&&(d=b.length);var e=Math.floor(a[a.d.width]/d);return a.items.visible=d,a.items[a.d.width]=e,a[a.d.width]=d*e,a}function bt_pauseOnHoverConfig(a){if(is_string(a))var b=a.indexOf("immediate")>-1?!0:!1,c=a.indexOf("resume")>-1?!0:!1;else var b=c=!1;return[b,c]}function bt_mousesheelNumber(a){return is_number(a)?a:null}function is_null(a){return null===a}function is_undefined(a){return is_null(a)||a===void 0||""===a||"undefined"===a}function is_array(a){return a instanceof Array}function is_jquery(a){return a instanceof jQuery}function is_object(a){return(a instanceof Object||"object"==typeof a)&&!is_null(a)&&!is_jquery(a)&&!is_array(a)&&!is_function(a)}function is_number(a){return(a instanceof Number||"number"==typeof a)&&!isNaN(a)}function is_string(a){return(a instanceof String||"string"==typeof a)&&!is_undefined(a)&&!is_true(a)&&!is_false(a)}function is_function(a){return a instanceof Function||"function"==typeof a}function is_boolean(a){return a instanceof Boolean||"boolean"==typeof a||is_true(a)||is_false(a)}function is_true(a){return a===!0||"true"===a}function is_false(a){return a===!1||"false"===a}function is_percentage(a){return is_string(a)&&"%"==a.slice(-1)}function getTime(){return(new Date).getTime()}function deprecated(a,b){debug(!0,a+" is DEPRECATED, support for it will be removed. Use "+b+" instead.")}function debug(a,b){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){if(is_object(a)){var c=" ("+a.selector+")";a=a.debug}else var c="";if(!a)return!1;b=is_string(b)?"carouFredSel"+c+": "+b:["carouFredSel"+c+":",b],window.console.log(b)}return!1}$.fn.carouFredSel||($.fn.caroufredsel=$.fn.carouFredSel=function(options,configs){if(0==this.length)return debug(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){$(this).carouFredSel(options,configs)});var $cfs=this,$tt0=this[0],starting_position=!1;$cfs.data("_cfs_isCarousel")&&(starting_position=$cfs.triggerHandler("_cfs_triggerEvent","currentPosition"),$cfs.trigger("_cfs_triggerEvent",["destroy",!0]));var FN={};FN._init=function(a,b,c){a=go_getObject($tt0,a),a.items=go_getItemsObject($tt0,a.items),a.scroll=go_getScrollObject($tt0,a.scroll),a.auto=go_getAutoObject($tt0,a.auto),a.prev=go_getPrevNextObject($tt0,a.prev),a.next=go_getPrevNextObject($tt0,a.next),a.pagination=go_getPaginationObject($tt0,a.pagination),a.swipe=go_getSwipeObject($tt0,a.swipe),a.mousewheel=go_getMousewheelObject($tt0,a.mousewheel),b&&(opts_orig=$.extend(!0,{},$.fn.carouFredSel.defaults,a)),opts=$.extend(!0,{},$.fn.carouFredSel.defaults,a),opts.d=cf_getDimensions(opts),crsl.direction="up"==opts.direction||"left"==opts.direction?"next":"prev";var d=$cfs.children(),e=ms_getParentSize($wrp,opts,"width");if(is_true(opts.cookie)&&(opts.cookie="caroufredsel_cookie_"+conf.serialNumber),opts.maxDimension=ms_getMaxDimension(opts,e),opts.items=in_complementItems(opts.items,opts,d,c),opts[opts.d.width]=in_complementPrimarySize(opts[opts.d.width],opts,d),opts[opts.d.height]=in_complementSecondarySize(opts[opts.d.height],opts,d),opts.responsive&&(is_percentage(opts[opts.d.width])||(opts[opts.d.width]="100%")),is_percentage(opts[opts.d.width])&&(crsl.upDateOnWindowResize=!0,crsl.primarySizePercentage=opts[opts.d.width],opts[opts.d.width]=ms_getPercentage(e,crsl.primarySizePercentage),opts.items.visible||(opts.items.visibleConf.variable=!0)),opts.responsive?(opts.usePadding=!1,opts.padding=[0,0,0,0],opts.align=!1,opts.items.visibleConf.variable=!1):(opts.items.visible||(opts=in_complementVisibleItems(opts,e)),opts[opts.d.width]||(!opts.items.visibleConf.variable&&is_number(opts.items[opts.d.width])&&"*"==opts.items.filter?(opts[opts.d.width]=opts.items.visible*opts.items[opts.d.width],opts.align=!1):opts[opts.d.width]="variable"),is_undefined(opts.align)&&(opts.align=is_number(opts[opts.d.width])?"center":!1),opts.items.visibleConf.variable&&(opts.items.visible=gn_getVisibleItemsNext(d,opts,0))),"*"==opts.items.filter||opts.items.visibleConf.variable||(opts.items.visibleConf.org=opts.items.visible,opts.items.visible=gn_getVisibleItemsNextFilter(d,opts,0)),opts.items.visible=cf_getItemsAdjust(opts.items.visible,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts.responsive)opts.items.visibleConf.min||(opts.items.visibleConf.min=opts.items.visible),opts.items.visibleConf.max||(opts.items.visibleConf.max=opts.items.visible),opts=in_getResponsiveValues(opts,d,e);else switch(opts.padding=cf_getPadding(opts.padding),"top"==opts.align?opts.align="left":"bottom"==opts.align&&(opts.align="right"),opts.align){case"center":case"left":case"right":"variable"!=opts[opts.d.width]&&(opts=in_getAlignPadding(opts,d),opts.usePadding=!0);break;default:opts.align=!1,opts.usePadding=0==opts.padding[0]&&0==opts.padding[1]&&0==opts.padding[2]&&0==opts.padding[3]?!1:!0}is_number(opts.scroll.duration)||(opts.scroll.duration=500),is_undefined(opts.scroll.items)&&(opts.scroll.items=opts.responsive||opts.items.visibleConf.variable||"*"!=opts.items.filter?"visible":opts.items.visible),opts.auto=$.extend(!0,{},opts.scroll,opts.auto),opts.prev=$.extend(!0,{},opts.scroll,opts.prev),opts.next=$.extend(!0,{},opts.scroll,opts.next),opts.pagination=$.extend(!0,{},opts.scroll,opts.pagination),opts.auto=go_complementAutoObject($tt0,opts.auto),opts.prev=go_complementPrevNextObject($tt0,opts.prev),opts.next=go_complementPrevNextObject($tt0,opts.next),opts.pagination=go_complementPaginationObject($tt0,opts.pagination),opts.swipe=go_complementSwipeObject($tt0,opts.swipe),opts.mousewheel=go_complementMousewheelObject($tt0,opts.mousewheel),opts.synchronise&&(opts.synchronise=cf_getSynchArr(opts.synchronise)),opts.auto.onPauseStart&&(opts.auto.onTimeoutStart=opts.auto.onPauseStart,deprecated("auto.onPauseStart","auto.onTimeoutStart")),opts.auto.onPausePause&&(opts.auto.onTimeoutPause=opts.auto.onPausePause,deprecated("auto.onPausePause","auto.onTimeoutPause")),opts.auto.onPauseEnd&&(opts.auto.onTimeoutEnd=opts.auto.onPauseEnd,deprecated("auto.onPauseEnd","auto.onTimeoutEnd")),opts.auto.pauseDuration&&(opts.auto.timeoutDuration=opts.auto.pauseDuration,deprecated("auto.pauseDuration","auto.timeoutDuration"))},FN._build=function(){$cfs.data("_cfs_isCarousel",!0);var a=$cfs.children(),b=in_mapCss($cfs,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),c="relative";switch(b.position){case"absolute":case"fixed":c=b.position}"parent"==conf.wrapper?sz_storeOrigCss($wrp):$wrp.css(b),$wrp.css({overflow:"hidden",position:c}),sz_storeOrigCss($cfs),$cfs.data("_cfs_origCssZindex",b.zIndex),$cfs.css({textAlign:"left","float":"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),sz_storeMargin(a,opts),sz_storeOrigCss(a),opts.responsive&&sz_setResponsiveSizes(opts,a)},FN._bind_events=function(){FN._unbind_events(),$cfs.bind(cf_e("stop",conf),function(a,b){return a.stopPropagation(),crsl.isStopped||opts.auto.button&&opts.auto.button.addClass(cf_c("stopped",conf)),crsl.isStopped=!0,opts.auto.play&&(opts.auto.play=!1,$cfs.trigger(cf_e("pause",conf),b)),!0}),$cfs.bind(cf_e("finish",conf),function(a){return a.stopPropagation(),crsl.isScrolling&&sc_stopScroll(scrl),!0}),$cfs.bind(cf_e("pause",conf),function(a,b,c){if(a.stopPropagation(),tmrs=sc_clearTimers(tmrs),b&&crsl.isScrolling){scrl.isStopped=!0;var d=getTime()-scrl.startTime;scrl.duration-=d,scrl.pre&&(scrl.pre.duration-=d),scrl.post&&(scrl.post.duration-=d),sc_stopScroll(scrl,!1)}if(crsl.isPaused||crsl.isScrolling||c&&(tmrs.timePassed+=getTime()-tmrs.startTime),crsl.isPaused||opts.auto.button&&opts.auto.button.addClass(cf_c("paused",conf)),crsl.isPaused=!0,opts.auto.onTimeoutPause){var e=opts.auto.timeoutDuration-tmrs.timePassed,f=100-Math.ceil(100*e/opts.auto.timeoutDuration);opts.auto.onTimeoutPause.call($tt0,f,e)}return!0}),$cfs.bind(cf_e("play",conf),function(a,b,c,d){a.stopPropagation(),tmrs=sc_clearTimers(tmrs);var e=[b,c,d],f=["string","number","boolean"],g=cf_sortParams(e,f);if(b=g[0],c=g[1],d=g[2],"prev"!=b&&"next"!=b&&(b=crsl.direction),is_number(c)||(c=0),is_boolean(d)||(d=!1),d&&(crsl.isStopped=!1,opts.auto.play=!0),!opts.auto.play)return a.stopImmediatePropagation(),debug(conf,"Carousel stopped: Not scrolling.");crsl.isPaused&&opts.auto.button&&(opts.auto.button.removeClass(cf_c("stopped",conf)),opts.auto.button.removeClass(cf_c("paused",conf))),crsl.isPaused=!1,tmrs.startTime=getTime();var h=opts.auto.timeoutDuration+c;
72772var dur2;var per
vendor: 27,619 bytes, lines 72772-72773
72772c;return dur2=h-tmrs.timePassed,perc=100-Math.ceil(100*dur2/h),opts.auto.progress&&(tmrs.progress=setInterval(function(){var a=getTime()-tmrs.startTime+tmrs.timePassed,b=Math.ceil(100*a/h);opts.auto.progress.updater.call(opts.auto.progress.bar[0],b)},opts.auto.progress.interval)),tmrs.auto=setTimeout(function(){opts.auto.progress&&opts.auto.progress.updater.call(opts.auto.progress.bar[0],100),opts.auto.onTimeoutEnd&&opts.auto.onTimeoutEnd.call($tt0,perc,dur2),crsl.isScrolling?$cfs.trigger(cf_e("play",conf),b):$cfs.trigger(cf_e(b,conf),opts.auto)},dur2),opts.auto.onTimeoutStart&&opts.auto.onTimeoutStart.call($tt0,perc,dur2),!0}),$cfs.bind(cf_e("resume",conf),function(a){return a.stopPropagation(),scrl.isStopped?(scrl.isStopped=!1,crsl.isPaused=!1,crsl.isScrolling=!0,scrl.startTime=getTime(),sc_startScroll(scrl,conf)):$cfs.trigger(cf_e("play",conf)),!0}),$cfs.bind(cf_e("prev",conf)+" "+cf_e("next",conf),function(a,b,c,d,e){if(a.stopPropagation(),crsl.isStopped||$cfs.is(":hidden"))return a.stopImmediatePropagation(),debug(conf,"Carousel stopped or hidden: Not scrolling.");var f=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(f>itms.total)return a.stopImmediatePropagation(),debug(conf,"Not enough items ("+itms.total+" total, "+f+" needed): Not scrolling.");var g=[b,c,d,e],h=["object","number/string","function","boolean"],i=cf_sortParams(g,h);b=i[0],c=i[1],d=i[2],e=i[3];var j=a.type.slice(conf.events.prefix.length);if(is_object(b)||(b={}),is_function(d)&&(b.onAfter=d),is_boolean(e)&&(b.queue=e),b=$.extend(!0,{},opts[j],b),b.conditions&&!b.conditions.call($tt0,j))return a.stopImmediatePropagation(),debug(conf,'Callback "conditions" returned false.');if(!is_number(c)){if("*"!=opts.items.filter)c="visible";else for(var k=[c,b.items,opts[j].items],i=0,l=k.length;l>i;i++)if(is_number(k[i])||"page"==k[i]||"visible"==k[i]){c=k[i];break}switch(c){case"page":return a.stopImmediatePropagation(),$cfs.triggerHandler(cf_e(j+"Page",conf),[b,d]);case"visible":opts.items.visibleConf.variable||"*"!=opts.items.filter||(c=opts.items.visible)}}if(scrl.isStopped)return $cfs.trigger(cf_e("resume",conf)),$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]]),a.stopImmediatePropagation(),debug(conf,"Carousel resumed scrolling.");if(b.duration>0&&crsl.isScrolling)return b.queue&&("last"==b.queue&&(queu=[]),("first"!=b.queue||0==queu.length)&&$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]])),a.stopImmediatePropagation(),debug(conf,"Carousel currently scrolling.");if(tmrs.timePassed=0,$cfs.trigger(cf_e("slide_"+j,conf),[b,c]),opts.synchronise)for(var m=opts.synchronise,n=[b,c],o=0,l=m.length;l>o;o++){var p=j;m[o][2]||(p="prev"==p?"next":"prev"),m[o][1]||(n[0]=m[o][0].triggerHandler("_cfs_triggerEvent",["configuration",p])),n[1]=c+m[o][3],m[o][0].trigger("_cfs_triggerEvent",["slide_"+p,n])}return!0}),$cfs.bind(cf_e("slide_prev",conf),function(a,b,c){a.stopPropagation();var d=$cfs.children();if(!opts.circular&&0==itms.first)return opts.infinite&&$cfs.trigger(cf_e("next",conf),itms.total-1),a.stopImmediatePropagation();if(sz_resetMargin(d,opts),!is_number(c)){if(opts.items.visibleConf.variable)c=gn_getVisibleItemsPrev(d,opts,itms.total-1);else if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getVisibleOrg($cfs,opts);c=gn_getScrollItemsPrevFilter(d,opts,itms.total-1,e)}else c=opts.items.visible;c=cf_getAdjust(c,opts,b.items,$tt0)}if(opts.circular||itms.total-c<itms.first&&(c=itms.total-itms.first),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){var f=cf_getItemsAdjust(gn_getVisibleItemsNext(d,opts,itms.total-c),opts,opts.items.visibleConf.adjust,$tt0);f>=opts.items.visible+c&&itms.total>c&&(c++,f=cf_getItemsAdjust(gn_getVisibleItemsNext(d,opts,itms.total-c),opts,opts.items.visibleConf.adjust,$tt0)),opts.items.visible=f}else if("*"!=opts.items.filter){var f=gn_getVisibleItemsNextFilter(d,opts,itms.total-c);opts.items.visible=cf_getItemsAdjust(f,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(d,opts,!0),0==c)return a.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+c+" items backward."),itms.first+=c;itms.first>=itms.total;)itms.first-=itms.total;opts.circular||(0==itms.first&&b.onEnd&&b.onEnd.call($tt0,"prev"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),$cfs.children().slice(itms.total-c,itms.total).prependTo($cfs),itms.total<opts.items.visible+c&&$cfs.children().slice(0,opts.items.visible+c-itms.total).clone(!0).appendTo($cfs);var d=$cfs.children(),g=gi_getOldItemsPrev(d,opts,c),h=gi_getNewItemsPrev(d,opts),i=d.eq(c-1),j=g.last(),k=h.last();sz_resetMargin(d,opts);var l=0,m=0;if(opts.align){var n=cf_getAlignPadding(h,opts);l=n[0],m=n[1]}var o=0>l?opts.padding[opts.d[3]]:0,p=!1,q=$();if(c>opts.items.visible&&(q=d.slice(opts.items.visibleConf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,i=k,sc_hideHiddenItems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_getTotalSize(d.slice(0,c),opts,"width"),u=cf_mapWrapperSizes(ms_getSizes(h,opts,!0),opts,!opts.usePadding),v=0,w={},x={},y={},z={},A={},B={},C={},D=sc_getDuration(b,opts,c,t);switch(b.fx){case"cover":case"cover-fade":v=ms_getTotalSize(d.slice(0,opts.items.visible),opts,"width")}p&&(opts.items[opts.d.width]=r),sz_resetMargin(d,opts,!0),m>=0&&sz_resetMargin(j,opts,opts.padding[opts.d[1]]),l>=0&&sz_resetMargin(i,opts,opts.padding[opts.d[3]]),opts.align&&(opts.padding[opts.d[1]]=m,opts.padding[opts.d[3]]=l),B[opts.d.left]=-(t-o),C[opts.d.left]=-(v-o),x[opts.d.left]=u[opts.d.width];var E=function(){},F=function(){},G=function(){},H=function(){},I=function(){},J=function(){},K=function(){},L=function(){},M=function(){},N=function(){},O=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendTo($wrp)}switch(b.fx){case"crossfade":case"uncover":case"uncover-fade":s.children().slice(0,c).remove(),s.children().slice(opts.items.visibleConf.old).remove();break;case"cover":case"cover-fade":s.children().slice(opts.items.visible).remove(),s.css(C)}if($cfs.css(B),scrl=sc_setScroll(D,b.easing,conf),w[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0,("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(E=function(){$wrp.css(u)},F=function(){scrl.anims.push([$wrp,u])}),opts.usePadding){switch(k.not(i).length&&(y[opts.d.marginRight]=i.data("_cfs_origCssMargin"),0>l?i.css(y):(K=function(){i.css(y)},L=function(){scrl.anims.push([i,y])})),b.fx){case"cover":case"cover-fade":s.children().eq(c-1).css(y)}k.not(j).length&&(z[opts.d.marginRight]=j.data("_cfs_origCssMargin"),G=function(){j.css(z)},H=function(){scrl.anims.push([j,z])}),m>=0&&(A[opts.d.marginRight]=k.data("_cfs_origCssMargin")+opts.padding[opts.d[1]],I=function(){k.css(A)},J=function(){scrl.anims.push([k,A])})}O=function(){$cfs.css(w)};var P=opts.items.visible+c-itms.total;N=function(){if(P>0&&($cfs.children().slice(itms.total).remove(),g=$($cfs.children().slice(itms.total-(opts.items.visible-P)).get().concat($cfs.children().slice(0,P).get()))),sc_showHiddenItems(p),opts.usePadding){var a=$cfs.children().eq(opts.items.visible+c-1);a.css(opts.d.marginRight,a.data("_cfs_origCssMargin"))}};var Q=sc_mapCallbackArguments(g,q,h,c,"prev",D,u);switch(M=function(){sc_afterScroll($cfs,s,b),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,b,"onAfter",Q,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,b,"onBefore",Q,clbk),b.fx){case"none":$cfs.css(w),E(),G(),I(),K(),O(),N(),M();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){E(),G(),I(),K(),O(),N(),scrl=sc_setScroll(D,b.easing,conf),scrl.anims.push([$cfs,{opacity:1},M]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},M]),F(),G(),I(),K(),O(),N();break;case"cover":scrl.anims.push([s,w,function(){G(),I(),K(),O(),N(),M()}]),F();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]),scrl.anims.push([s,w,function(){G(),I(),K(),O(),N(),M()}]),F();break;case"uncover":scrl.anims.push([s,x,M]),F(),G(),I(),K(),O(),N();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([s,x,M]),F(),G(),I(),K(),O(),N();break;default:scrl.anims.push([$cfs,w,function(){N(),M()}]),F(),H(),J(),L()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,u]),!0 72773}),$cfs.bind(cf_e("slide_next",conf),function(a,b,c){a.stopPropagation();var d=$cfs.children();if(!opts.circular&&itms.first==opts.items.visible)return opts.infinite&&$cfs.trigger(cf_e("prev",conf),itms.total-1),a.stopImmediatePropagation();if(sz_resetMargin(d,opts),!is_number(c)){if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getVisibleOrg($cfs,opts);c=gn_getScrollItemsNextFilter(d,opts,0,e)}else c=opts.items.visible;c=cf_getAdjust(c,opts,b.items,$tt0)}var f=0==itms.first?itms.total:itms.first;if(!opts.circular){if(opts.items.visibleConf.variable)var g=gn_getVisibleItemsNext(d,opts,c),e=gn_getVisibleItemsPrev(d,opts,f-1);else var g=opts.items.visible,e=opts.items.visible;c+g>f&&(c=f-e)}if(opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){for(var g=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(d,opts,c,f),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible-c>=g&&itms.total>c;)c++,g=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(d,opts,c,f),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible=g}else if("*"!=opts.items.filter){var g=gn_getVisibleItemsNextFilter(d,opts,c);opts.items.visible=cf_getItemsAdjust(g,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(d,opts,!0),0==c)return a.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+c+" items forward."),itms.first-=c;0>itms.first;)itms.first+=itms.total;opts.circular||(itms.first==opts.items.visible&&b.onEnd&&b.onEnd.call($tt0,"next"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),itms.total<opts.items.visible+c&&$cfs.children().slice(0,opts.items.visible+c-itms.total).clone(!0).appendTo($cfs);var d=$cfs.children(),h=gi_getOldItemsNext(d,opts),i=gi_getNewItemsNext(d,opts,c),j=d.eq(c-1),k=h.last(),l=i.last();sz_resetMargin(d,opts);var m=0,n=0;if(opts.align){var o=cf_getAlignPadding(i,opts);m=o[0],n=o[1]}var p=!1,q=$();if(c>opts.items.visibleConf.old&&(q=d.slice(opts.items.visibleConf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,j=k,sc_hideHiddenItems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_getTotalSize(d.slice(0,c),opts,"width"),u=cf_mapWrapperSizes(ms_getSizes(i,opts,!0),opts,!opts.usePadding),v=0,w={},x={},y={},z={},A={},B=sc_getDuration(b,opts,c,t);switch(b.fx){case"uncover":case"uncover-fade":v=ms_getTotalSize(d.slice(0,opts.items.visibleConf.old),opts,"width")}p&&(opts.items[opts.d.width]=r),opts.align&&0>opts.padding[opts.d[1]]&&(opts.padding[opts.d[1]]=0),sz_resetMargin(d,opts,!0),sz_resetMargin(k,opts,opts.padding[opts.d[1]]),opts.align&&(opts.padding[opts.d[1]]=n,opts.padding[opts.d[3]]=m),A[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0;var C=function(){},D=function(){},E=function(){},F=function(){},G=function(){},H=function(){},I=function(){},J=function(){},K=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendTo($wrp),s.children().slice(opts.items.visibleConf.old).remove()}switch(b.fx){case"crossfade":case"cover":case"cover-fade":$cfs.css("zIndex",1),s.css("zIndex",0)}if(scrl=sc_setScroll(B,b.easing,conf),w[opts.d.left]=-t,x[opts.d.left]=-v,0>m&&(w[opts.d.left]+=m),("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(C=function(){$wrp.css(u)},D=function(){scrl.anims.push([$wrp,u])}),opts.usePadding){var L=l.data("_cfs_origCssMargin");n>=0&&(L+=opts.padding[opts.d[1]]),l.css(opts.d.marginRight,L),j.not(k).length&&(z[opts.d.marginRight]=k.data("_cfs_origCssMargin")),E=function(){k.css(z)},F=function(){scrl.anims.push([k,z])};var M=j.data("_cfs_origCssMargin");m>0&&(M+=opts.padding[opts.d[3]]),y[opts.d.marginRight]=M,G=function(){j.css(y)},H=function(){scrl.anims.push([j,y])}}K=function(){$cfs.css(A)};var N=opts.items.visible+c-itms.total;J=function(){N>0&&$cfs.children().slice(itms.total).remove();var a=$cfs.children().slice(0,c).appendTo($cfs).last();if(N>0&&(i=gi_getCurrentItems(d,opts)),sc_showHiddenItems(p),opts.usePadding){if(itms.total<opts.items.visible+c){var b=$cfs.children().eq(opts.items.visible-1);b.css(opts.d.marginRight,b.data("_cfs_origCssMargin")+opts.padding[opts.d[1]])}a.css(opts.d.marginRight,a.data("_cfs_origCssMargin"))}};var O=sc_mapCallbackArguments(h,q,i,c,"next",B,u);switch(I=function(){$cfs.css("zIndex",$cfs.data("_cfs_origCssZindex")),sc_afterScroll($cfs,s,b),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,b,"onAfter",O,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,b,"onBefore",O,clbk),b.fx){case"none":$cfs.css(w),C(),E(),G(),K(),J(),I();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){C(),E(),G(),K(),J(),scrl=sc_setScroll(B,b.easing,conf),scrl.anims.push([$cfs,{opacity:1},I]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},I]),D(),E(),G(),K(),J();break;case"cover":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([$cfs,A,I]),D(),E(),G(),J();break;case"cover-fade":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,A,I]),D(),E(),G(),J();break;case"uncover":scrl.anims.push([s,x,I]),D(),E(),G(),K(),J();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([s,x,I]),D(),E(),G(),K(),J();break;default:scrl.anims.push([$cfs,w,function(){K(),J(),I()}]),D(),F(),H()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,u]),!0}),$cfs.bind(cf_e("slideTo",conf),function(a,b,c,d,e,f,g){a.stopPropagation();var h=[b,c,d,e,f,g],i=["string/number/object","number","boolean","object","string","function"],j=cf_sortParams(h,i);return e=j[3],f=j[4],g=j[5],b=gn_getItemIndex(j[0],j[1],j[2],itms,$cfs),0==b?!1:(is_object(e)||(e=!1),"prev"!=f&&"next"!=f&&(f=opts.circular?itms.total/2>=b?"next":"prev":0==itms.first||itms.first>b?"next":"prev"),"prev"==f&&(b=itms.total-b),$cfs.trigger(cf_e(f,conf),[e,b,g]),!0)}),$cfs.bind(cf_e("prevPage",conf),function(a,b,c){a.stopPropagation();var d=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[d-1,b,"prev",c])}),$cfs.bind(cf_e("nextPage",conf),function(a,b,c){a.stopPropagation();var d=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[d+1,b,"next",c])}),$cfs.bind(cf_e("slideToPage",conf),function(a,b,c,d,e){a.stopPropagation(),is_number(b)||(b=$cfs.triggerHandler(cf_e("currentPage",conf)));var f=opts.pagination.items||opts.items.visible,g=Math.ceil(itms.total/f)-1;return 0>b&&(b=g),b>g&&(b=0),$cfs.triggerHandler(cf_e("slideTo",conf),[b*f,0,!0,c,d,e])}),$cfs.bind(cf_e("jumpToStart",conf),function(a,b){if(a.stopPropagation(),b=b?gn_getItemIndex(b,0,!0,itms,$cfs):0,b+=itms.first,0!=b){if(itms.total>0)for(;b>itms.total;)b-=itms.total;$cfs.prepend($cfs.children().slice(b,itms.total))}return!0}),$cfs.bind(cf_e("synchronise",conf),function(a,b){if(a.stopPropagation(),b)b=cf_getSynchArr(b);else{if(!opts.synchronise)return debug(conf,"No carousel to synchronise.");b=opts.synchronise}for(var c=$cfs.triggerHandler(cf_e("currentPosition",conf)),d=!0,e=0,f=b.length;f>e;e++)b[e][0].triggerHandler(cf_e("slideTo",conf),[c,b[e][3],!0])||(d=!1);return d}),$cfs.bind(cf_e("queue",conf),function(a,b,c){return a.stopPropagation(),is_function(b)?b.call($tt0,queu):is_array(b)?queu=b:is_undefined(b)||queu.push([b,c]),queu}),$cfs.bind(cf_e("insertItem",conf),function(a,b,c,d,e){a.stopPropagation();var f=[b,c,d,e],g=["string/object","string/number/object","boolean","number"],h=cf_sortParams(f,g);if(b=h[0],c=h[1],d=h[2],e=h[3],is_object(b)&&!is_jquery(b)?b=$(b):is_string(b)&&(b=$(b)),!is_jquery(b)||0==b.length)return debug(conf,"Not a valid object.");is_undefined(c)&&(c="end"),sz_storeMargin(b,opts),sz_storeOrigCss(b);var i=c,j="before";"end"==c?d?(0==itms.first?(c=itms.total-1,j="after"):(c=itms.first,itms.first+=b.length),0>c&&(c=0)):(c=itms.total-1,j="after"):c=gn_getItemIndex(c,e,d,itms,$cfs);var k=$cfs.children().eq(c);return k.length?k[j](b):(debug(conf,"Correct insert-position not found! Appending item to the end."),$cfs.append(b)),"end"==i||d||itms.first>c&&(itms.first+=b.length),itms.total=$cfs.children().length,itms.first>=itms.total&&(itms.first-=itms.total),$cfs.trigger(cf_e("updateSizes",conf)),$cfs.trigger(cf_e("linkAnchors",conf)),!0}),$cfs.bind(cf_e("removeItem",conf),function(a,b,c,d){a.stopPropagation();var e=[b,c,d],f=["string/number/object","boolean","number"],g=cf_sortParams(e,f);if(b=g[0],c=g[1],d=g[2],b instanceof $&&b.length>1)return i=$(),b.each(function(){var e=$cfs.trigger(cf_e("removeItem",conf),[$(this),c,d]);e&&(i=i.add(e))}),i;if(is_undefined(b)||"end"==b)i=$cfs.children().last();else{b=gn_getItemIndex(b,d,c,itms,$cfs);var i=$cfs.children().eq(b);i.length&&itms.first>b&&(itms.first-=i.length)}return i&&i.length&&(i.detach(),itms.total=$cfs.children().length,$cfs.trigger(cf_e("updateSizes",conf))),i}),$cfs.bind(cf_e("onBefore",conf)+" "+cf_e("onAfter",conf),function(a,b){a.stopPropagation();var c=a.type.slice(conf.events.prefix.length);return is_array(b)&&(clbk[c]=b),is_function(b)&&clbk[c].push(b),clbk[c]}),$cfs.bind(cf_e("currentPosition",conf),function(a,b){if(a.stopPropagation(),0==itms.first)var c=0;else var c=itms.total-itms.first;return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("currentPage",conf),function(a,b){a.stopPropagation();var e,c=opts.pagination.items||opts.items.visible,d=Math.ceil(itms.total/c-1);return e=0==itms.first?0:itms.first<itms.total%c?0:itms.first!=c||opts.circular?Math.round((itms.total-itms.first)/c):d,0>e&&(e=0),e>d&&(e=d),is_function(b)&&b.call($tt0,e),e}),$cfs.bind(cf_e("currentVisible",conf),function(a,b){a.stopPropagation();var c=gi_getCurrentItems($cfs.children(),opts);return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("slice",conf),function(a,b,c,d){if(a.stopPropagation(),0==itms.total)return!1;var e=[b,c,d],f=["number","number","function"],g=cf_sortParams(e,f);if(b=is_number(g[0])?g[0]:0,c=is_number(g[1])?g[1]:itms.total,d=g[2],b+=itms.first,c+=itms.first,items.total>0){for(;b>itms.total;)b-=itms.total;for(;c>itms.total;)c-=itms.total;for(;0>b;)b+=itms.total;for(;0>c;)c+=itms.total}var i,h=$cfs.children();return i=c>b?h.slice(b,c):$(h.slice(b,itms.total).get().concat(h.slice(0,c).get())),is_function(d)&&d.call($tt0,i),i}),$cfs.bind(cf_e("isPaused",conf)+" "+cf_e("isStopped",conf)+" "+cf_e("isScrolling",conf),function(a,b){a.stopPropagation();var c=a.type.slice(conf.events.prefix.length),d=crsl[c];return is_function(b)&&b.call($tt0,d),d}),$cfs.bind(cf_e("configuration",conf),function(e,a,b,c){e.stopPropagation();var reInit=!1;if(is_function(a))a.call($tt0,opts);else if(is_object(a))opts_orig=$.extend(!0,{},opts_orig,a),b!==!1?reInit=!0:opts=$.extend(!0,{},opts,a);else if(!is_undefined(a))if(is_function(b)){var val=eval("opts."+a);is_undefined(val)&&(val=""),b.call($tt0,val)}else{if(is_undefined(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0),eval("opts_orig."+a+" = b"),c!==!1?reInit=!0:eval("opts."+a+" = b")}if(reInit){sz_resetMargin($cfs.children(),opts),FN._init(opts_orig),FN._bind_buttons();var sz=sz_setSizes($cfs,opts);$cfs.trigger(cf_e("updatePageStatus",conf),[!0,sz])}return opts}),$cfs.bind(cf_e("linkAnchors",conf),function(a,b,c){return a.stopPropagation(),is_undefined(b)?b=$("body"):is_string(b)&&(b=$(b)),is_jquery(b)&&0!=b.length?(is_string(c)||(c="a.caroufredsel"),b.find(c).each(function(){var a=this.hash||"";a.length>0&&-1!=$cfs.children().index($(a))&&$(this).unbind("click").click(function(b){b.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),a)})}),!0):debug(conf,"Not a valid object.")}),$cfs.bind(cf_e("updatePageStatus",conf),function(a,b){if(a.stopPropagation(),opts.pagination.container){var d=opts.pagination.items||opts.items.visible,e=Math.ceil(itms.total/d);b&&(opts.pagination.anchorBuilder&&(opts.pagination.container.children().remove(),opts.pagination.container.each(function(){for(var a=0;e>a;a++){var b=$cfs.children().eq(gn_getItemIndex(a*d,0,!0,itms,$cfs));$(this).append(opts.pagination.anchorBuilder.call(b[0],a+1))}})),opts.pagination.container.each(function(){$(this).children().unbind(opts.pagination.event).each(function(a){$(this).bind(opts.pagination.event,function(b){b.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[a*d,-opts.pagination.deviation,!0,opts.pagination])})})}));var f=$cfs.triggerHandler(cf_e("currentPage",conf))+opts.pagination.deviation;return f>=e&&(f=0),0>f&&(f=e-1),opts.pagination.container.each(function(){$(this).children().removeClass(cf_c("selected",conf)).eq(f).addClass(cf_c("selected",conf))}),!0}}),$cfs.bind(cf_e("updateSizes",conf),function(){var b=opts.items.visible,c=$cfs.children(),d=ms_getParentSize($wrp,opts,"width");if(itms.total=c.length,crsl.primarySizePercentage?(opts.maxDimension=d,opts[opts.d.width]=ms_getPercentage(d,crsl.primarySizePercentage)):opts.maxDimension=ms_getMaxDimension(opts,d),opts.responsive?(opts.items.width=opts.items.sizesConf.width,opts.items.height=opts.items.sizesConf.height,opts=in_getResponsiveValues(opts,c,d),b=opts.items.visible,sz_setResponsiveSizes(opts,c)):opts.items.visibleConf.variable?b=gn_getVisibleItemsNext(c,opts,0):"*"!=opts.items.filter&&(b=gn_getVisibleItemsNextFilter(c,opts,0)),!opts.circular&&0!=itms.first&&b>itms.first){if(opts.items.visibleConf.variable)var e=gn_getVisibleItemsPrev(c,opts,itms.first)-itms.first;else if("*"!=opts.items.filter)var e=gn_getVisibleItemsPrevFilter(c,opts,itms.first)-itms.first;else var e=opts.items.visible-itms.first;debug(conf,"Preventing non-circular: sliding "+e+" items backward."),$cfs.trigger(cf_e("prev",conf),e)}opts.items.visible=cf_getItemsAdjust(b,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts=in_getAlignPadding(opts,c);var f=sz_setSizes($cfs,opts);return $cfs.trigger(cf_e("updatePageStatus",conf),[!0,f]),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),f}),$cfs.bind(cf_e("destroy",conf),function(a,b){return a.stopPropagation(),tmrs=sc_clearTimers(tmrs),$cfs.data("_cfs_isCarousel",!1),$cfs.trigger(cf_e("finish",conf)),b&&$cfs.trigger(cf_e("jumpToStart",conf)),sz_restoreOrigCss($cfs.children()),sz_restoreOrigCss($cfs),FN._unbind_events(),FN._unbind_buttons(),"parent"==conf.wrapper?sz_restoreOrigCss($wrp):$wrp.replaceWith($cfs),!0}),$cfs.bind(cf_e("debug",conf),function(){return debug(conf,"Carousel width: "+opts.width),debug(conf,"Carousel height: "+opts.height),debug(conf,"Item widths: "+opts.items.width),debug(conf,"Item heights: "+opts.items.height),debug(conf,"Number of items visible: "+opts.items.visible),opts.auto.play&&debug(conf,"Number of items scrolled automatically: "+opts.auto.items),opts.prev.button&&debug(conf,"Number of items scrolled backward: "+opts.prev.items),opts.next.button&&debug(conf,"Number of items scrolled forward: "+opts.next.items),conf.debug}),$cfs.bind("_cfs_triggerEvent",function(a,b,c){return a.stopPropagation(),$cfs.triggerHandler(cf_e(b,conf),c)})},FN._unbind_events=function(){$cfs.unbind(cf_e("",conf)),$cfs.unbind(cf_e("",conf,!1)),$cfs.unbind("_cfs_triggerEvent")},FN._bind_buttons=function(){if(FN._unbind_buttons(),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),opts.auto.pauseOnHover){var a=bt_pauseOnHoverConfig(opts.auto.pauseOnHover);$wrp.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.auto.button&&opts.auto.button.bind(cf_e(opts.auto.event,conf,!1),function(a){a.preventDefault();var b=!1,c=null;crsl.isPaused?b="play":opts.auto.pauseOnEvent&&(b="pause",c=bt_pauseOnHoverConfig(opts.auto.pauseOnEvent)),b&&$cfs.trigger(cf_e(b,conf),c)}),opts.prev.button&&(opts.prev.button.bind(cf_e(opts.prev.event,conf,!1),function(a){a.preventDefault(),$cfs.trigger(cf_e("prev",conf))}),opts.prev.pauseOnHover)){var a=bt_pauseOnHoverConfig(opts.prev.pauseOnHover);opts.prev.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.next.button&&(opts.next.button.bind(cf_e(opts.next.event,conf,!1),function(a){a.preventDefault(),$cfs.trigger(cf_e("next",conf))}),opts.next.pauseOnHover)){var a=bt_pauseOnHoverConfig(opts.next.pauseOnHover);opts.next.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.pagination.container&&opts.pagination.pauseOnHover){var a=bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);opts.pagination.container.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if((opts.prev.key||opts.next.key)&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keyCode;b==opts.next.key&&(a.preventDefault(),$cfs.trigger(cf_e("next",conf))),b==opts.prev.key&&(a.preventDefault(),$cfs.trigger(cf_e("prev",conf)))}),opts.pagination.keys&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keyCode;b>=49&&58>b&&(b=(b-49)*opts.items.visible,itms.total>=b&&(a.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[b,0,!0,opts.pagination])))}),$.fn.swipe){var b="ontouchstart"in window;if(b&&opts.swipe.onTouch||!b&&opts.swipe.onMouse){var c=$.extend(!0,{},opts.prev,opts.swipe),d=$.extend(!0,{},opts.next,opts.swipe),e=function(){$cfs.trigger(cf_e("prev",conf),[c])},f=function(){$cfs.trigger(cf_e("next",conf),[d])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeUp=f,opts.swipe.options.swipeDown=e;break;default:opts.swipe.options.swipeLeft=f,opts.swipe.options.swipeRight=e}crsl.swipe&&$cfs.swipe("destroy"),$wrp.swipe(opts.swipe.options),$wrp.css("cursor","move"),crsl.swipe=!0}}if($.fn.mousewheel&&opts.mousewheel){var g=$.extend(!0,{},opts.prev,opts.mousewheel),h=$.extend(!0,{},opts.next,opts.mousewheel);crsl.mousewheel&&$wrp.unbind(cf_e("mousewheel",conf,!1)),$wrp.bind(cf_e("mousewheel",conf,!1),function(a,b){a.preventDefault(),b>0?$cfs.trigger(cf_e("prev",conf),[g]):$cfs.trigger(cf_e("next",conf),[h])}),crsl.mousewheel=!0}if(opts.auto.play&&$cfs.trigger(cf_e("play",conf),opts.auto.delay),crsl.upDateOnWindowResize){var i=function(){$cfs.trigger(cf_e("finish",conf)),opts.auto.pauseOnResize&&!crsl.isPaused&&$cfs.trigger(cf_e("play",conf)),sz_resetMargin($cfs.children(),opts),$cfs.trigger(cf_e("updateSizes",conf))},j=$(window),k=null;if($.debounce&&"debounce"==conf.onWindowResize)k=$.debounce(200,i);else if($.throttle&&"throttle"==conf.onWindowResize)k=$.throttle(300,i);else{var l=0,m=0;k=function(){var a=j.width(),b=j.height();(a!=l||b!=m)&&(i(),l=a,m=b)}}j.bind(cf_e("resize",conf,!1,!0,!0),k)}},FN._unbind_buttons=function(){var b=(cf_e("",conf),cf_e("",conf,!1));
vendor: 2,171 bytes, line 72773
72773var ns3; ns3=cf_e("",conf,!1,!0,!0),$(document).unbind(ns3),$(window).unbind(ns3),$wrp.unbind(b),opts.auto.button&&opts.auto.button.unbind(b),opts.prev.button&&opts.prev.button.unbind(b),opts.next.button&&opts.next.button.unbind(b),opts.pagination.container&&(opts.pagination.container.unbind(b),opts.pagination.anchorBuilder&&opts.pagination.container.children().remove()),crsl.swipe&&($cfs.swipe("destroy"),$wrp.css("cursor","default"),crsl.swipe=!1),crsl.mousewheel&&(crsl.mousewheel=!1),nv_showNavi(opts,"hide",conf),nv_enableNavi(opts,"removeClass",conf)},is_boolean(configs)&&(configs={debug:configs});var crsl={direction:"next",isPaused:!0,isScrolling:!1,isStopped:!1,mousewheel:!1,swipe:!1},itms={total:$cfs.children().length,first:0},tmrs={auto:null,progress:null,startTime:getTime(),timePassed:0},scrl={isStopped:!1,duration:0,startTime:0,easing:"",anims:[]},clbk={onBefore:[],onAfter:[]},queu=[],conf=$.extend(!0,{},$.fn.carouFredSel.configs,configs),opts={},opts_orig=$.extend(!0,{},options),$wrp="parent"==conf.wrapper?$cfs.parent():$cfs.wrap("<"+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent();if(conf.selector=$cfs.selector,conf.serialNumber=$.fn.carouFredSel.serialNumber++,conf.transition=conf.transition&&$.fn.transition?"transition":"animate",FN._init(opts_orig,!0,starting_position),FN._build(),FN._bind_events(),FN._bind_buttons(),is_array(opts.items.start))var start_arr=opts.items.start;else{var start_arr=[];0!=opts.items.start&&start_arr.push(opts.items.start)}if(opts.cookie&&start_arr.unshift(parseInt(cf_getCookie(opts.cookie),10)),start_arr.length>0)for(var a=0,l=start_arr.length;l>a;a++){var s=start_arr[a];if(0!=s){if(s===!0){if(s=window.location.hash,1>s.length)continue}else"random"===s&&(s=Math.floor(Math.random()*itms.total));if($cfs.triggerHandler(cf_e("slideTo",conf),[s,0,!0,{fx:"none"}]))break}}var siz=sz_setSizes($cfs,opts),itm=gi_getCurrentItems($cfs.children(),opts);return opts.onCreate&&opts.onCreate.call($tt0,{width:siz.width,height:siz.height,items:itm}),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,siz]),$cfs.trigger(cf_e("linkAnchors",conf)),conf.debug&&$cfs.trigger(cf_e("debug",conf)),$cfs}
72773,$.fn.carouFredSel.serialNumber=1,$.fn.carouFredSel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!1,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseOnHover:!1,event:"click",queue:!1}},$.fn.carouFredSel.configs={debug:!1,transition:!1,onWindowResize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},$.fn.carouFredSel.pageAnchorBuilder=function(a){return'<a href="#"><span>'+a+"</span></a>"},$.fn.carouFredSel.progressbarUpdater=function(a){$(this).css("width",a+"%")},$.fn.carouFredSel.cookie={get:function(a){a+="=";for(var b=document.cookie.split(";"),c=0,d=b.length;d>c;c++){for(var e=b[c];" "==e.charAt(0);)e=e.slice(1);if(0==e.indexOf(a))return e.slice(a.length)}return 0},set:function(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+1e3*60*60*24*c),d="; expires="+e.toGMTString()}document.cookie=a+"="+b+d+"; path=/"},remove:function(a){$.fn.carouFredSel.cookie.set(a,"",-1)}},$.extend($.easing,{quadratic:function(a){var b=a*a;return a*(-b*a+4*b-6*a+4)},cubic:function(a){return a*(4*a*a-9*a+6)},elastic:function(a){var b=a*a;return a*(33*b*b-106*b*a+126*b-67*a+15)}}))})(jQuery); 72774$(function() { 72775 if ($('.simple-carousel-slick').length < 1) { 72776 return; 72777 } 72778 $('.simple-carousel-slick').slick({ 72779 speed: 10000, 72780 autoplay: true, 72781 arrows: false, 72782 autoplaySpeed: 0, 72783 cssEase: 'linear', 72784 slidesToShow: 1, 72785 slidesToScroll: 1, 72786 variableWidth: true, 72787 draggable: false, 72788 swipe: false 72789 }); 72790}); 72791 $(document).on('click', '.boxclose', function() { 72792 $('#wsFullVideo').modal('hide'); 72793 }); 72794$(function () { 72795 72796 if ($('.corporate-action-bar').hasClass('no-carousel')) { 72797 $('.brands-carousel').find('#carousel').removeAttr('id'); 72798 $('.brands-carousel .row.no-gutters').removeClass('row no-gutters').addClass('container'); 72799 $('.brands-carousel .col-12').removeClass('col-12'); 72800 return; 72801 } 72802 if (!$('.brands-carousel #carousel').carouFredSel) { return; } 72803 72804 $('.brands-carousel #carousel').carouFredSel({ 72805 align: false, 72806 width: '100%', 72807 scroll: { 72808 items: 1, 72809 duration: 10000, 72810 timeoutDuration: 0, 72811 easing: 'linear', 72812 pauseOnHover: 'immediate' 72813 } 72814 }); 72815 72816 $('.brands-carousel #carousel div img').on('click', function (e) { 72817 var noFilter = $('.brands-carousel #carousel').find('.no-filter'); 72818 72819 if (isTouchDevice()) { 72820 //Handle if click in the same logo 72821 if ($(this).hasClass('no-filter')) { 72822 $(this).removeClass('no-filter'); 72823 $('.brands-carousel #carousel').trigger('resume'); 72824 } else { 72825 if (noFilter.length) { 72826 noFilter.removeClass('no-filter'); 72827 $('.brands-carousel #carousel').trigger('resume'); 72828 } else { 72829 $(this).addClass('no-filter'); 72830 $('.brands-carousel #carousel').trigger('pause', true); 72831 } 72832 } 72833 } 72834 }); 72835 72836 $('.brands-carousel #carousel div > img').on('mouseover', function (e) { 72837 if (!isTouchDevice()) { 72838 $(this).toggleClass('no-filter'); 72839 } 72840 }); 72841 72842 $('.brands-carousel #carousel div > img').on('mouseleave', function (e) { 72843 if (!isTouchDevice()) { 72844 $('.brands-carousel #carousel div > img.no-filter').removeClass('no-filter'); 72845 } 72846 }); 72847}); 72848 72849 72850 72851 72852//touch device detection 72853function isTouchDevice() { 72854 var prefixes = ' -webkit- -moz- -o- -ms- '.split(' '); 72855 var mq = function (query) { 72856 return window.matchMedia(query).matches; 72857 } 72858 72859 if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { 72860 return true; 72861 } 72862 72863 var query = ['(', prefixes.join('touch-enabled),('), 'heartz', ')'].join(''); 72864 return mq(query); 72865} 72866$(function () { 72867 if (!$('.image-hover-carousel #carousel').carouFredSel) { return; } 72868 $('.image-hover-carousel #carousel').carouFredSel({ 72869 align: false, 72870 width: '100%', 72871 height: 420, 72872 responsive: true, 72873 padding: [10, 0, 0, 0], 72874 scroll: { 72875 items: 1, 72876 duration: 10000, 72877 timeoutDuration: 0, 72878 easing: 'linear', 72879 pauseOnHover: 'immediate' 72880 }, 72881 items: { 72882 width: '90%', 72883 } 72884 }); 72885 72886 $('.image-hover-carousel #carousel > div').on('click', function (e) { 72887 var noFilter = $('.image-hover-carousel #carousel').find('.card-descrip'); 72888 72889 if (isTouchDevice()) { 72890 //Handle if click in the same logo 72891 if ($(this).hasClass('card-descrip')) { 72892 $(this).removeClass('card-descrip'); 72893 $('.image-hover-carousel #carousel').trigger('resume'); 72894 } else { 72895 if (noFilter.length) { 72896 noFilter.removeClass('card-descrip'); 72897 $('.image-hover-carousel #carousel').trigger('resume'); 72898 } else { 72899 $(this).addClass('card-descrip'); 72900 $('.image-hover-carousel #carousel').trigger('pause', true); 72901 } 72902 } 72903 } 72904 }); 72905 72906 $('.image-hover-carousel #carousel > div').on('mouseover', function (e) { 72907 if (!isTouchDevice()) { 72908 $(this).addClass('card-descrip'); 72909 } 72910 }); 72911 72912 $('.image-hover-carousel #carousel > div').on('mouseleave', function (e) { 72913 if (!isTouchDevice()) { 72914 $('.image-hover-carousel #carousel > div').removeClass('card-descrip'); 72915 } 72916 }); 72917}); 72918function FeaturedCarouselOne(el) { 72919 this.el = el; 72920 this.sliderEl = el.find(".featured-carousel-one--slider"); 72921 this.trackEl = el.find(".featured-carousel-one--track"); 72922 this.modalEl = el.find(".featured-carousel-one--modal-container"); 72923 72924 this.initCarousel(); 72925 this.initEvents(); 72926 this.setExpandability(); 72927} 72928 72929FeaturedCarouselOne.prototype.initCarousel = function() { 72930 this.sliderEl.slick({ 72931 centerMode: true, 72932 centerPadding: "0px", 72933 slidesToShow: 1.25, 72934 infinite: false, 72935 mobileFirst: true, 72936 touchThreshold: 10, 72937 waitForAnimate: false, 72938 speed: 333, 72939 prevArrow: 72940 '<button type="button" class="slick-prev"><svg width="75" height="75" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path fill-opacity=".95" fill="#E1E1E1" d="M75 0H0v75h75z"/><g stroke="#212121" stroke-linecap="round" stroke-width="2"><path d="M10.744 38.5H65M23.878 52L11.004 39.127a.886.886 0 0 1 0-1.253L23.878 25"/></g></g></svg></button>', 72941 nextArrow: 72942 '<button type="button" class="slick-next"><svg width="75" height="75" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path fill-opacity=".95" fill="#E1E1E1" d="M0 0h75v75H0z"/><g stroke="#212121" stroke-linecap="round" stroke-width="2"><path d="M64.256 38.5H10M51.122 52l12.874-12.873a.886.886 0 0 0 0-1.253L51.122 25"/></g></g></svg></button>', 72943 responsive: [ 72944 { 72945 breakpoint: 767, 72946 settings: { 72947 slidesToShow: 1.25 72948 } 72949 }, 72950 { 72951 breakpoint: 1023, 72952 settings: { 72953 slidesToShow: 1.5 72954 } 72955 } 72956 ] 72957 }); 72958}; 72959 72960FeaturedCarouselOne.prototype.initEvents = function() { 72961 var self = this; 72962 72963 this.sliderEl.on("beforeChange", function( 72964 event, 72965 slick, 72966 currentSlide, 72967 nextSlide 72968 ) { 72969 self.el 72970 .find(".featured-carousel-one--thumb")
72971 .css("transform", "translateX(" + nextSlide * 100 + "%)"); 72972 }); 72973 72974 this.el.on( 72975 "click", 72976 ".featured-carousel-one--open-button", 72977 this.expandCurrentSlide.bind(this) 72978 ); 72979 72980 this.el.on( 72981 "click", 72982 ".featured-carousel-one--close-button", 72983 this.collapseCurrentSlide.bind(this) 72984 ); 72985 72986 window.addEventListener("resize", function() { 72987 setTimeout(self.setExpandability.bind(self), 500); 72988 }); 72989}; 72990 72991FeaturedCarouselOne.prototype.setExpandability = function() { 72992 console.log("adfsd"); 72993 this.sliderEl.find(".featured-carousel-one--slide").each(function(index, el) { 72994 var contentEl = el.querySelector(".featured-carousel-one--slide-content"); 72995 72996 el.classList.toggle( 72997 "featured-carousel-one--slide_expandable", 72998 contentEl.scrollHeight > contentEl.offsetHeight 72999 ); 73000 }); 73001}; 73002 73003FeaturedCarouselOne.prototype.expandCurrentSlide = function() { 73004 var isMobile = matchMedia("(max-width: 767px)").matches; 73005 73006 var self = this; 73007 var currentSlide = this.sliderEl.find(".slick-current"); 73008 var expandedSlide = currentSlide.clone(); 73009 73010 // expandedSlide.removeClass("slick-slide slick-current slick-center"); 73011 expandedSlide.removeAttr("tabindex"); 73012 expandedSlide.removeAttr("aria-hidden"); 73013 73014 this.modalEl.html(expandedSlide); 73015 73016 requestAnimationFrame(function() { 73017 if (isMobile) { 73018 // set slide to be expanded to current slide's position, then animate to full screen 73019 var currentBounds = currentSlide.get(0).getBoundingClientRect(); 73020 73021 expandedSlide.addClass("featured-carousel-one--slide_expanded").css({ 73022 top: currentBounds.y, 73023 left: currentBounds.x, 73024 width: currentBounds.width, 73025 height: currentBounds.height, 73026 maxHeight: currentBounds.height 73027 }); 73028 73029 requestAnimationFrame(function() { 73030 expandedSlide.css({ 73031 top: "", 73032 left: "", 73033 width: "", 73034 height: "", 73035 maxHeight: "" 73036 }); 73037 }); 73038 } else { 73039 // fix image width, animate slide to full width 73040 requestAnimationFrame(function() { 73041 expandedSlide.addClass("featured-carousel-one--slide_expanded"); 73042 73043 requestAnimationFrame(function() { 73044 expandedSlide.css("width", ""); 73045 }); 73046 73047 var expandedSlideImage = expandedSlide.find( 73048 ".featured-carousel-one--slide-image" 73049 ); 73050 var expandedSlideImageWidth = expandedSlideImage.width(); 73051 73052 expandedSlideImage.css({ 73053 flex: "0 0 " + expandedSlideImageWidth + "px", 73054 transition: "none" 73055 }); 73056 }); 73057 } 73058 }); 73059 73060 // hide open buttons and slides/track, show close buttons 73061 requestAnimationFrame(function() { 73062 currentSlide 73063 .add(expandedSlide) 73064 .find(".featured-carousel-one--open-button") 73065 .addClass("featured-carousel-one--hidden"); 73066 73067 currentSlide 73068 .add(expandedSlide) 73069 .find(".featured-carousel-one--close-button") 73070 .removeClass("featured-carousel-one--hidden"); 73071 73072 self.sliderEl.add(self.trackEl).addClass("featured-carousel-one--hidden"); 73073 }); 73074}; 73075 73076FeaturedCarouselOne.prototype.collapseCurrentSlide = function() { 73077 var isMobile = matchMedia("(max-width: 767px)").matches; 73078 var currentSlide = this.sliderEl.find(".slick-current"); 73079 var expandedSlide = this.modalEl.find(".featured-carousel-one--slide"); 73080 73081 if (isMobile) { 73082 // animate to current slide's bounds, then remove 73083 var currentBounds = currentSlide.get(0).getBoundingClientRect(); 73084 73085 expandedSlide 73086 .removeClass("featured-carousel-one--slide_expanded") 73087 .css({ 73088 top: currentBounds.y, 73089 left: currentBounds.x, 73090 width: currentBounds.width, 73091 height: currentBounds.height 73092 }) 73093 .one("transitionend", function() { 73094 expandedSlide.remove(); 73095 }); 73096 } else { 73097 // animate to current slide's width and image's width, then remove 73098 var newSlideWidth = currentSlide.width(); 73099 var newSlideImageWidth = currentSlide 73100 .find(".featured-carousel-one--slide-image") 73101 .width(); 73102 73103 expandedSlide 73104 .removeClass("featured-carousel-one--slide_expanded") 73105 .css({ width: newSlideWidth }) 73106 .one("transitionend", function() { 73107 expandedSlide.remove(); 73108 }); 73109 73110 expandedSlide.find(".featured-carousel-one--slide-image").css({ 73111 flex: "0 0 " + newSlideImageWidth + "px", 73112 transition: "" 73113 }); 73114 } 73115 73116 // show open buttons and slides/track, hide close buttons 73117 currentSlide 73118 .add(expandedSlide) 73119 .find(".featured-carousel-one--open-button") 73120 .removeClass("featured-carousel-one--hidden"); 73121 73122 currentSlide 73123 .add(expandedSlide) 73124 .find(".featured-carousel-one--close-button") 73125 .addClass("featured-carousel-one--hidden"); 73126 73127 this.sliderEl.add(this.trackEl).removeClass("featured-carousel-one--hidden"); 73128}; 73129 73130$(document).ready(function(){ 73131 $(".featured-carousel-one").each(function() { 73132 new FeaturedCarouselOne($(this)); 73133 }); 73134}); 73135 73136 73137 73138$(function () { 73139 73140 if (!$(".component-featured-carousel-v2").length > 1) { 73141 return; 73142 } 73143 73144 $(".featured-carousel-slick").slick({ 73145 slidesToShow: 2, 73146 infinite: false, 73147 touchThreshold: 10, 73148 waitForAnimate: false, 73149 speed: 333, 73150 arrows: true, 73151 prevArrow: '<div class="c-arrow c-prev hide"></div>', 73152 nextArrow: '<div class="c-arrow c-next"></div>', 73153 responsive: [ 73154 { 73155 breakpoint: 960, 73156 settings: { 73157 slidesToShow: 1.1, 73158 swipe: true,
73159 arrows: false 73160 } 73161 }, 73162 { 73163 breakpoint: 1023, 73164 settings: { 73165 slidesToShow: 2, 73166 swipe: false, 73167 arrows: true 73168 } 73169 } 73170 ] 73171 }); 73172 73173 73174 var setProgressBarStart = function () { 73175 var statusBar = document.querySelector('.carousel-progress > .completed'); 73176 73177 var total = ($(".featured-carousel-slick .slick-slide").length - 1); 73178 73179 if (window.innerWidth < 960) { 73180 total = ($(".featured-carousel-slick .slick-slide").length); 73181 } 73182 73183 if (statusBar) { 73184 statusBar.style.width = Math.ceil(100 / total) + '%'; 73185 } 73186 } 73187 73188 // progress bar 73189 $(".featured-carousel-slick").on("afterChange", function ( 73190 event, 73191 slick, 73192 currentSlide 73193 ) { 73194 var total = (window.innerWidth >= 960) ? ($(".featured-carousel-slick .slick-slide").length - 1) : $(".featured-carousel-slick .slick-slide").length; 73195 73196 var progress = 0; 73197 var statusBar = document.querySelector(' .carousel-progress > .completed'); 73198 var percentage = Math.ceil(100 / total); 73199 73200 progress = currentSlide; 73201 statusBar.style.width = Math.ceil(100 / total) + '%'; 73202 statusBar.style.left = (currentSlide * percentage) + '%'; 73203 73204 73205 if (progress === 0) { 73206 $(".c-prev").addClass("hide"); 73207 $(".c-next").removeClass("hide"); 73208 } else if (progress === (total - 1)) { 73209 $(".c-next").addClass("hide"); 73210 $(".c-prev").removeClass("hide"); 73211 } else { 73212 $(".c-next").removeClass("hide"); 73213 $(".c-prev").removeClass("hide"); 73214 } 73215 73216 73217 }); 73218 73219 setTimeout(function () { 73220 setProgressBarStart(); 73221 }, 100); 73222}); 73223 73224(function () { 73225 73226 init(); 73227 function init(){ 73228 $('.water-card-carousel').each(function(index, elem){ 73229 let options = $(elem).data(); 73230 73231 $(elem).owlCarousel({ 73232 responsiveClass:true, 73233 responsive:{ 73234 0:{ 73235 items:1, 73236 margin: 30, 73237 stagePadding: 0 73238 }, 73239 480:{ 73240 items:1, 73241 margin: 30, 73242 stagePadding: 20 73243 }, 73244 768:{ 73245 items:2, 73246 margin: 30, 73247 stagePadding: 20 73248 }, 73249 992:{ 73250 items:3, 73251 margin: 30, 73252 stagePadding: 40 73253 }, 73254 1200:{ 73255 items:3, 73256 margin: 30, 73257 stagePadding: 40 73258 } 73259 }, 73260 slideBy:1, 73261 loop: false, 73262 autoWidth: true, 73263 mergeFit: true, 73264 dots:true, 73265 nav: false 73266 }); 73267 }); 73268 73269 var dots = $('.carousel-dots'); 73270 var totalDots = $(".carousel-dots").length; 73271 73272 dots.each( function( index ) { 73273 var indexTo = 0; 73274 if(index < totalDots-1){ 73275 indexTo = index + 1; 73276 } 73277 $(this).attr( 'data-position', indexTo ); 73278 }); 73279 73280 $(document).on('click', '.carousel-dots', function() { 73281 var position = $(this).data('position'); 73282 $('.owl-carousel').trigger('to.owl.carousel', position ); 73283 }); 73284 } 73285 73286 /*$(window).resize(function(){ 73287 calculateStageWidth(); 73288 }); 73289 73290 function calculateStageWidth(){ 73291 $(".water-card-carousel").each(function(index, elem){ 73292 var listItems = $(this).find(".owl-item"); 73293 var totalItems = listItems.length; 73294 var screenWidth = $(window).width(); 73295 73296 var cardWidth = 750; 73297 var padding = 94; 73298 if(screenWidth < 1200 && screenWidth > 991){ 73299 cardWidth = 615.16; 73300 }else if (screenWidth < 992 && screenWidth > 767){ 73301 cardWidth = 470; 73302 }else if(screenWidth < 767){ 73303 cardWidth = 255; 73304 } 73305 73306 if(screenWidth < 1024){ 73307 padding = 33; 73308 } 73309 73310 73311 var totalPadding = padding * 2; 73312 var totalWidth = (cardWidth * totalItems) + (30 * totalItems) + totalPadding; 73313 console.log("totalWidth="+totalWidth); 73314 73315 $(this).find(".owl-stage-outer").css("width", totalWidth+"px"); 73316 $(this).find(".owl-stage").css("width", totalWidth+"px"); 73317 }); 73318 } 73319 73320 calculateStageWidth();*/ 73321 73322 })(); 73323$(document).ready(function () { 73324 $(".slick-listing.3colview").slick({ 73325 slidesToShow: 3, 73326 slidesToScroll: 1, 73327 arrows: true, 73328 infinite: false, 73329 autoplay: false, 73330 responsive: [ 73331 { 73332 breakpoint: 768, 73333 settings: 'unslick', 73334 }, 73335 { 73336 breakpoint: 991, 73337 settings: { 73338 slidesToShow: 2, 73339 slidesToScroll: 1,
73340 arrows: false, 73341 infinite: false, 73342 autoplay: false, 73343 }, 73344 }, 73345 ], 73346 }); 73347 $(".prev-btn").click(function () { 73348 $(".slick-listing.3colview").slick("slickPrev"); 73349 }); 73350 73351 $(".next-btn").click(function () { 73352 $(".slick-listing.3colview").slick("slickNext"); 73353 }); 73354 $(".prev-btn").addClass("slick-disabled"); 73355 $(".slick-listing.3colview").on("afterChange", function () { 73356 if ($(".slick-prev").hasClass("slick-disabled")) { 73357 $(".prev-btn").addClass("slick-disabled"); 73358 } else { 73359 $(".prev-btn").removeClass("slick-disabled"); 73360 } 73361 if ($(".slick-next").hasClass("slick-disabled")) { 73362 $(".next-btn").addClass("slick-disabled"); 73363 } else { 73364 $(".next-btn").removeClass("slick-disabled"); 73365 } 73366 }); 73367}); 73368 73369 73370 73371 $(document).ready(function () { 73372 $(".slick-listing.4colview").slick({ 73373 slidesToShow: 4, 73374 slidesToScroll: 1, 73375 arrows: true, 73376 infinite: false, 73377 autoplay: false, 73378 responsive: [ 73379 { 73380 breakpoint: 767, 73381 settings: 'unslick', 73382 }, 73383 { 73384 breakpoint: 991, 73385 settings: { 73386 slidesToShow: 3, 73387 slidesToScroll: 1, 73388 arrows: false, 73389 infinite: false, 73390 autoplay: false, 73391 }, 73392 }, 73393 ], 73394 }); 73395 $(".prev-btn").click(function () { 73396 $(".slick-listing.4colview").slick("slickPrev"); 73397 }); 73398 73399 $(".next-btn").click(function () { 73400 $(".slick-listing.4colview").slick("slickNext"); 73401 }); 73402 $(".prev-btn").addClass("slick-disabled"); 73403 $(".slick-listing.4colview").on("afterChange", function () { 73404 if ($(".slick-prev").hasClass("slick-disabled")) { 73405 $(".prev-btn").addClass("slick-disabled"); 73406 } else { 73407 $(".prev-btn").removeClass("slick-disabled"); 73408 } 73409 if ($(".slick-next").hasClass("slick-disabled")) { 73410 $(".next-btn").addClass("slick-disabled"); 73411 } else { 73412 $(".next-btn").removeClass("slick-disabled"); 73413 } 73414 }); 73415}); 73416 73417/*Gets the maximum height of the element among array of DOM objects */ 73418var get_carouselTitleMaxHt_c1 =function(elem){ 73419 return Math.max.apply(null, $(elem).map(function(){ 73420 return $(this).height(); 73421 }) 73422 .get()); 73423}; 73424/* End */ 73425 73426 73427$(window).on('load',function(){ 73428 gsr_caroselTitleEqHt_c1(); 73429}); 73430window.addEventListener("resize", function(){ 73431 $('.grt-crl-first .crou-heding').height('unset'); 73432 gsr_caroselTitleEqHt_c1(); 73433}); 73434 73435 73436function gsr_caroselTitleEqHt_c1(){ 73437 $('.grt-crl-first').each((index,elem)=>{ 73438 let card_title_list = $(elem).find('.crou-heding'); 73439 let max_ht = get_carouselTitleMaxHt_c1(card_title_list); 73440 73441 card_title_list.each( (ind,item) => { 73442 $(item).removeAttr("style"); 73443 $(item).height(max_ht); 73444 }) 73445 }); 73446}; 73447 73448$(document).ready(function () { 73449 $(".slick-listing-two").slick({ 73450 slidesToShow: 3, 73451 slidesToScroll: 1, 73452 arrows: true, 73453 infinite: false, 73454 autoplay: false, 73455 settings: 'unslick', 73456 responsive: [ 73457 { 73458 breakpoint: 768, 73459 settings: { 73460 slidesToShow: 1, 73461 slidesToScroll: 1, 73462 dots: true, 73463 }, 73464 }, 73465 ], 73466 }); 73467 $(".prev-btn").click(function () { 73468 $(".slick-listing-two").slick("slickPrev"); 73469 }); 73470 73471 $(".next-btn").click(function () { 73472 $(".slick-listing-two").slick("slickNext"); 73473 }); 73474 $(".prev-btn").addClass("slick-disabled"); 73475 $(".slick-listing-two").on("afterChange", function () { 73476 if ($(".slick-prev").hasClass("slick-disabled")) { 73477 $(".prev-btn").addClass("slick-disabled"); 73478 } else { 73479 $(".prev-btn").removeClass("slick-disabled"); 73480 } 73481 if ($(".slick-next").hasClass("slick-disabled")) { 73482 $(".next-btn").addClass("slick-disabled"); 73483 } else { 73484 $(".next-btn").removeClass("slick-disabled"); 73485 } 73486 }); 73487}); 73488 73489 73490/*Gets the maximum height of the element among array of DOM objects */ 73491var get_carouselTitleMaxHt =function(elem){ 73492 return Math.max.apply(null, $(elem).map(function(){ 73493 return $(this).height(); 73494 }) 73495 .get()); 73496}; 73497/* End */ 73498 73499 73500$(window).on('load',function(){ 73501 gsr_caroselTitleEqHt(); 73502}); 73503window.addEventListener("resize", function(){ 73504 $('.grt-crl-second .crou-heding-two').height('unset'); 73505 gsr_caroselTitleEqHt(); 73506}); 73507 73508 73509function gsr_caroselTitleEqHt(){ 73510 $('.grt-crl-second').each((index,elem)=>{ 73511 let card_title_list = $(elem).find('.crou-heding-two'); 73512 let max_ht = get_carouselTitleMaxHt(card_title_list); 73513
73514 card_title_list.each( (ind,item) => { 73515 $(item).removeAttr("style"); 73516 $(item).height(max_ht); 73517 $(item).parents('.slick-list').siblings('.slick-dots').css('bottom',$(item).outerHeight()+23); 73518 }) 73519 }); 73520}; 73521 73522 73523setTimeout(() => { 73524 $('.grt-crl-second .grt-crl-heading').each(function(){ 73525 if($(this).siblings('.slick-slider').length){ 73526 $(this).show(); 73527 }else{ 73528 $(this).hide(); 73529 }; 73530 }) 73531 }, "500"); 73532$(document).ready(function () { 73533 $(".slick-listing-grt-mult").slick({ 73534 slidesToShow: 1, 73535 slidesToScroll: 1, 73536 arrows: true, 73537 infinite: false, 73538 autoplay: false, 73539 responsive: [ 73540 { 73541 breakpoint: 767, 73542 settings: { 73543 slidesToShow: 1, 73544 infinite: true, 73545 dots: true, 73546 arrows: false 73547 } 73548 } 73549 ] 73550 }); 73551 $(".prev-btn").click(function () { 73552 $(".slick-listing-grt-mult").slick("slickPrev"); 73553 }); 73554 73555 $(".next-btn").click(function () { 73556 $(".slick-listing-grt-mult").slick("slickNext"); 73557 }); 73558 $(".prev-btn").addClass("slick-disabled"); 73559 $(".slick-listing-grt-mult").on("afterChange", function () { 73560 if ($(".slick-prev").hasClass("slick-disabled")) { 73561 $(".prev-btn").addClass("slick-disabled"); 73562 } else { 73563 $(".prev-btn").removeClass("slick-disabled"); 73564 } 73565 if ($(".slick-next").hasClass("slick-disabled")) { 73566 $(".next-btn").addClass("slick-disabled"); 73567 } else { 73568 $(".next-btn").removeClass("slick-disabled"); 73569 } 73570 }); 73571}); 73572 73573 73574 73575 73576 73577$(document).ready(function () { 73578 73579 $('.grt-g-c').each(function(){ 73580 let ps_acc_no = $(this).find('.gsr-btn-location').attr('data-ps-account'); 73581 if(ps_acc_no){ 73582 var metaTag = '<meta name="ps-account" content="'+ps_acc_no+'">'; 73583 $('head').find("[name='ps-account']").remove(); 73584 $('head').append(metaTag); 73585 } 73586 }); 73587 73588 $(window).on('load resize orientationchange', function() { 73589 $(".slick-listing-grt-img-vid-part").each(function(){ 73590 var $carousel = $(this); 73591 /* Initializes a slick carousel only on mobile screens */ 73592 // slick on mobile 73593 if ($(window).width() >= 768) { 73594 if ($carousel.hasClass('slick-initialized')) { 73595 $carousel.slick('unslick'); 73596 } 73597 } 73598 else{ 73599 if (!$carousel.hasClass('slick-initialized')) { 73600 $carousel.slick({ 73601 slidesToShow: 1, 73602 slidesToScroll: 1, 73603 arrows: true, 73604 infinite: false, 73605 autoplay: false, 73606 responsive: [ 73607 { 73608 breakpoint: 9999, 73609 settings: "unslick" 73610 }, 73611 { 73612 breakpoint: 767, 73613 settings: { 73614 slidesToShow: 1, 73615 infinite: true, 73616 dots: true 73617 } 73618 } 73619 ] 73620 }); 73621 } 73622 } 73623 }); 73624 }); 73625 73626 73627 $(".prev-btn").click(function () { 73628 $(".slick-listing-grt-img-vid-part").slick("slickPrev"); 73629 }); 73630 73631 $(".next-btn").click(function () { 73632 $(".slick-listing-grt-img-vid-part").slick("slickNext"); 73633 }); 73634 $(".prev-btn").addClass("slick-disabled"); 73635 $(".slick-listing-grt-img-vid-part").on("afterChange", function () { 73636 if ($(".slick-prev").hasClass("slick-disabled")) { 73637 $(".prev-btn").addClass("slick-disabled"); 73638 } else { 73639 $(".prev-btn").removeClass("slick-disabled"); 73640 } 73641 if ($(".slick-next").hasClass("slick-disabled")) { 73642 $(".next-btn").addClass("slick-disabled"); 73643 } else { 73644 $(".next-btn").removeClass("slick-disabled"); 73645 } 73646 }); 73647 73648 let getmaxHeightImageBlock =function(){ 73649 if($(window).width()>=768){ 73650 let slick_itemsCount = $('.slick-listing-grt-img-vid-part .grt-slic-list-img-vid-crgp').length; 73651 73652 if(slick_itemsCount>6){ 73653 $('.grt-g-c').each(function(e){ 73654 let slick_list = $(this).find('.slick-listing-grt-img-vid-part'); 73655 let slick_item = $(this).find('.slick-listing-grt-img-vid-part').find('.grt-slic-list-img-vid-crgp:nth-child(-n + 6)'); 73656 let height = 0; 73657 slick_item.each((i,v)=> { 73658 height += $(v).outerHeight(true); 73659 }); 73660 slick_list.css({maxHeight: height/2 + "px", overflowY: 'scroll'}); 73661 }); 73662 } 73663 } 73664 } 73665 getmaxHeightImageBlock(); 73666 73667 $(window).resize(function () { 73668 getmaxHeightImageBlock(); 73669 }); 73670 73671 $('.slick-listing-grt-img-vid-part .grt-mul-img-vid-crgp-all').each(function(e){ 73672 if($(this).attr('src') && $(this).attr('src').includes('youtube')){ 73673 $(this).css('background-color','black'); 73674 } 73675 if($(this).attr('src') && $(this).attr('src').includes('/_jcr_content/renditions/cq5dam.thumbnail.319.319.png')){ 73676 var lastindex = $(this).attr('src').split("/_jcr_content/renditions/cq5dam.thumbnail.319.319.png")[0].lastIndexOf('/'); 73677 var fileName = lastindex > -1 ? $(this).attr('src').substr(lastindex+1, $(this).attr('src').length): ""; 73678 var dmThumbnailURL="https://dupont.scene7.com/is/image/Dupont/"+fileName.split(".")[0]+"?fmt=png-alpha"; 73679 console.log("dmThumbnailURL=========================="+dmThumbnailURL); 73680 $(this).attr('src',dmThumbnailURL); 73681 $(this).css('background-color','black'); 73682 } 73683 }); 73684 73685 73686}); 73687// Fancybox Configuration 73688 73689 73690$("[data-fancybox]").fancybox({ 73691 thumbs : false, 73692 hash : false, 73693 loop : true, 73694 keyboard : true, 73695 toolbar : true, 73696 animationEffect : false, 73697 arrows : true, 73698 clickContent : false, 73699 zoom : false 73700}); 73701 73702function careerbar(element) { 73703 this.el = element; 73704 this.navBarEl = $('.component-navigation').first(); 73705 this.shareIconsEl = this.el.find('.component-careerbar--contain-share .share-on').first(); 73706 this.navIconsTargetEl = this.navBarEl.find('.component-navigation--logo').first(); 73707 this.lastScrollY = $(window).scrollTop(); 73708 this.minimunScroll = 50; 73709 this.setupNavForIcons(); 73710 this.initializeEvents(); 73711} 73712 73713careerbar.prototype.setupNavForIcons = function () { 73714 if (this.navIconsTargetEl) { 73715 this.navIconsTargetEl.append('<div class="navigationShare career-cta">' + this.shareIconsEl.html() + '</div>'); 73716 } 73717}; 73718 73719 73720careerbar.prototype.checkScroll = function (e) { 73721 var self = this, 73722 scrollY = $(window).scrollTop(), 73723 windowW = $(window).width(), 73724 scrollMax = ($(document).height() - $(window).height()), 73725 isSafari = (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1); 73726 scrollY = scrollY < 0 ? 0 : scrollY; 73727 if (windowW >= 1024) { 73728 73729 var scrollElastic = (isSafari) ? document.body.scrollTop : window.scrollY; 73730 this.navIconsTargetEl.removeClass('showShare'); 73731 var absScrollDiff = Math.abs(scrollY - this.lastScrollY); 73732 if(absScrollDiff < this.minimunScroll && scrollY !== 0) { 73733 return; 73734 } 73735 if (scrollElastic > 0 && scrollElastic < scrollMax) { 73736 if (scrollY > this.lastScrollY) { 73737 this.el.addClass('scroll-postop'); 73738 self.el.removeClass('scroll-postop-out').addClass('scroll-postop-in'); 73739 this.navBarEl.addClass('scroll-out').removeClass('scroll-in'); 73740 } else { 73741 if(self.el.hasClass('scroll-postop-in') && self.navBarEl.hasClass('scroll-in')){ 73742 self.el.removeClass('scroll-postop-in').addClass('scroll-postop-out'); 73743 } 73744 setTimeout(function () { 73745 if(self.navBarEl.hasClass('scroll-in')){ 73746 self.el.removeClass('scroll-postop scroll-postop-in scroll-postop-out'); 73747 } 73748 }, 400); 73749 this.navBarEl.removeClass('scroll-out').addClass('scroll-in'); 73750 } 73751 this.lastScrollY = scrollY; 73752 } 73753 } else { 73754 if(this.navBarEl.hasClass('scroll-out')){ 73755 this.navBarEl.removeClass('scroll-out').addClass('scroll-in'); 73756 this.el.removeClass('scroll-postop scroll-postop-in scroll-postop-out'); 73757 } 73758 if (this.navIconsTargetEl) { 73759 if (scrollY > this.lastScrollY) { 73760 this.navIconsTargetEl.addClass('showShare'); 73761 this.navIconsTargetEl.addClass('scroll-postop'); 73762 } else { 73763 this.navIconsTargetEl.removeClass('showShare'); 73764 this.navIconsTargetEl.removeClass('scroll-postop'); 73765 } 73766 73767 this.lastScrollY = scrollY; 73768 } 73769 } 73770}; 73771 73772careerbar.prototype.initializeEvents = function () { 73773 73774 var supportsOrientationChange = "onorientationchange" in window, 73775 orientationEvent = supportsOrientationChange ? "orientationchange" : "resize", 73776 self = this; 73777 73778 $(window).on("scroll", this.checkScroll.bind(this)); 73779 $(window).on(orientationEvent, this.checkScroll.bind(this)); 73780 $(window).resize(this.checkScroll.bind(this)); 73781}; 73782 73783$(function () { 73784 $(".component-careerbar").each(function () { 73785 new careerbar($(this)); 73786 }); 73787}); 73788 73789//new WOW().init(); 73790 73791$(function () { 73792 73793 var wtbView = function (cl) { 73794 73795 this.el = $($('.' + cl)[0]); 73796 this.accID = this.el.find('.cards-title-desc').attr('data-ps-account'); 73797 73798 if(this.accID){ 73799 73800 var metaTag = '<meta name="ps-account" content="'+this.accID+'">'; 73801 $('head').find("[name='ps-account']").remove(); 73802 $('head').append(metaTag); 73803 } 73804 73805 }; 73806 73807 wtbView.prototype.setImgContainer = function () { 73808 73809 var imgs = this.el.find('.card-img'); 73810 73811 $.each(imgs, function (i, v) { 73812 73813 var aspectRatio = 0; 73814 73815 if ($(v).attr('src')) { 73816 73817 $(v).on('load', function () { 73818
73819 if (v.naturalHeight && v.naturalWidth) { 73820 73821 aspectRatio = v.naturalWidth / v.naturalHeight; 73822 }; 73823 73824 if (aspectRatio >= 1) { 73825 73826 $(v).addClass('box-img').parent().removeClass('img-placeholder'); 73827 } 73828 else { 73829 $(v).addClass('can-img').parent().removeClass('img-placeholder'); 73830 } 73831 }).each(function () { 73832 73833 if (this.complete) { 73834 73835 $(this).trigger('load') 73836 }; 73837 73838 }); 73839 73840 73841 } 73842 73843 }); 73844 }; 73845 73846 73847 $.each($('.wtb-view'), function (i, v) { 73848 $(v).addClass("wtb-" + i); 73849 (new wtbView("wtb-" + i)).setImgContainer(); 73850 73851 }); 73852 73853}); 73854 73855//new WOW().init(); 73856 73857$(function () { 73858 var cardsbgView = function (cl) { 73859 73860 this.el = $($('.' + cl)[0]); 73861 this.el.find('.card .grt-buy-btn').each(function (i, v) { 73862 let accID = $(this).attr('data-ps-account'); 73863 if(accID){ 73864 var metaTag = '<meta name="ps-account" content="'+this.accID+'">'; 73865 $('head').find("[name='ps-account']").remove(); 73866 $('head').append(metaTag); 73867 } 73868 }); 73869 }; 73870 73871 $.each($('.gs_cardWithbg'), function (i, v) { 73872 $(v).addClass("gs_card-" + i); 73873 (new cardsbgView("gs_card-" + i)); 73874 }); 73875 73876}); 73877 73878function BioBar(element) { 73879 this.el = element; 73880 this.navBarEl = $('.component-navigation').first(); 73881 this.shareIconsEl = this.el.find('.component-biobar--contain-share .share-on').first(); 73882 this.navIconsTargetEl = this.navBarEl.find('.component-navigation--logo').first(); 73883 this.lastScrollY = $(window).scrollTop(); 73884 this.minimunScroll = 50; 73885 this.setupNavForIcons(); 73886 this.initializeEvents(); 73887} 73888 73889BioBar.prototype.setupNavForIcons = function () { 73890 if (this.navIconsTargetEl) { 73891 this.navIconsTargetEl.append('<div class="navigationShare icon-aligner">' + this.shareIconsEl.html() + '</div>'); 73892 } 73893}; 73894 73895 73896BioBar.prototype.checkScroll = function (e) { 73897 var self = this, 73898 scrollY = $(window).scrollTop(), 73899 windowW = $(window).width(), 73900 scrollMax = ($(document).height() - $(window).height()), 73901 isSafari = (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1); 73902 scrollY = scrollY < 0 ? 0 : scrollY; 73903 if (windowW >= 1024) { 73904 73905 var scrollElastic = (isSafari) ? document.body.scrollTop : window.scrollY; 73906 this.navIconsTargetEl.removeClass('showShare'); 73907 var absScrollDiff = Math.abs(scrollY - this.lastScrollY); 73908 if(absScrollDiff < this.minimunScroll && scrollY !== 0) { 73909 return; 73910 } 73911 if (scrollElastic > 0 && scrollElastic < scrollMax) { 73912 if (scrollY > this.lastScrollY) { 73913 this.el.addClass('scroll-postop'); 73914 self.el.removeClass('scroll-postop-out').addClass('scroll-postop-in'); 73915 this.navBarEl.addClass('scroll-out').removeClass('scroll-in'); 73916 } else { 73917 if(self.el.hasClass('scroll-postop-in') && self.navBarEl.hasClass('scroll-in')){ 73918 self.el.removeClass('scroll-postop-in').addClass('scroll-postop-out'); 73919 } 73920 setTimeout(function () { 73921 if(self.navBarEl.hasClass('scroll-in')){ 73922 self.el.removeClass('scroll-postop scroll-postop-in scroll-postop-out'); 73923 } 73924 }, 400); 73925 this.navBarEl.removeClass('scroll-out').addClass('scroll-in'); 73926 } 73927 this.lastScrollY = scrollY; 73928 } 73929 } else { 73930 if(this.navBarEl.hasClass('scroll-out')){ 73931 this.navBarEl.removeClass('scroll-out').addClass('scroll-in'); 73932 this.el.removeClass('scroll-postop scroll-postop-in scroll-postop-out'); 73933 } 73934 if (this.navIconsTargetEl) { 73935 if (scrollY > this.lastScrollY) { 73936 this.navIconsTargetEl.addClass('showShare'); 73937 this.navIconsTargetEl.addClass('scroll-postop'); 73938 } else { 73939 this.navIconsTargetEl.removeClass('showShare'); 73940 this.navIconsTargetEl.removeClass('scroll-postop'); 73941 } 73942 73943 this.lastScrollY = scrollY; 73944 } 73945 } 73946}; 73947 73948BioBar.prototype.initializeEvents = function () { 73949 73950 var supportsOrientationChange = "onorientationchange" in window, 73951 orientationEvent = supportsOrientationChange ? "orientationchange" : "resize", 73952 self = this; 73953 73954 $(window).on("scroll", this.checkScroll.bind(this)); 73955 $(window).on(orientationEvent, this.checkScroll.bind(this)); 73956 $(window).resize(this.checkScroll.bind(this)); 73957}; 73958 73959$(function () { 73960 $(".component-biobar").each(function () { 73961 new BioBar($(this)); 73962 }); 73963}); 73964
73965function bgVideoHeader(element) { 73966 this.el = element; 73967 this.addEventListeners(); 73968} 73969 73970bgVideoHeader.prototype.addEventListeners = function(){ 73971 var self = this; 73972 73973 this.el.find(".bgVideo-cta").on("click", self.openModal.bind(self)); 73974 this.el.find(".button-close").on("click", self.closeModal.bind(self)); 73975} 73976 73977bgVideoHeader.prototype.createModalWindowIFrame = function( source ) { 73978 var bodyEl = $('body'), 73979 htmlEl = $('html'); 73980 73981 var modalHtml = '<div class="bgVideo-header-modal iframe"><iframe class="iframe iframe-hidden" src="' + source + '" width="100%" height="100%" frameborder="0" allow="autoplay" allowfullscreen></iframe><div class="bgVideo-button-close button-close iframe-hidden">X</div></div>'; 73982 73983 htmlEl.css({'overflow-y':'hidden'}); 73984 bodyEl.append(modalHtml); 73985 73986 bodyEl.find('.bgVideo-button-close').on("click", this.closeModal.bind(this)); 73987}; 73988 73989 73990bgVideoHeader.prototype.createModalWindowVideo = function( source ) { 73991 var bodyEl = $('body'), 73992 htmlEl = $('html'); 73993 73994 var modalHtml = '<div class="bgVideo-header-modal modal-video video"><video controls autoplay id="bgVideoHeaderModalVideo"><source src="' + source + '" type="video/mp4" /></video><div class="bgVideo-button-close button-close iframe-hidden">X</div></div>'; 73995 73996 htmlEl.css({'overflow-y':'hidden'}); 73997 bodyEl.append(modalHtml); 73998 videoCaptions(source); 73999 bodyEl.find('.bgVideo-button-close').on("click", this.closeModal.bind(this)); 74000 var config = { 74001 displayDuration: true, 74002 invertTime: true, 74003 controls: ['play-large', 'play', 'progress', 'current-time', 'duration','mute', 'volume', 'fullscreen'] 74004 }; 74005 74006 this.player = new Plyr('#bgVideoHeaderModalVideo', config); 74007 this.loadPlayer(); 74008}; 74009 74010bgVideoHeader.prototype.trackVideoPlayback = function( duration, eVar, val ) { 74011 if(!window.s) { // if analytics object is not present, ignore this. 74012 return; 74013 } 74014 74015 var vidName = this.el.data('videoname') || 'Video Name Not Defined'; 74016 74017 if(vidName.indexOf('/content/dam') > 0) { 74018 vidName = vidName.substr( vidName.lastIndexOf("/") ); 74019 } 74020 74021 window.s.clearVars(); 74022 window.s[eVar] = val; 74023 window.s['eVar102'] = vidName; 74024 window.s.tl(); 74025}; 74026 74027bgVideoHeader.prototype.loadPlayer = function() { 74028 if (!document.getElementsByClassName('modal-video')[0]) { 74029 return; 74030 } 74031 74032 this.player.on('loadeddata', function(event){this.player.currentTime = 0; }.bind(this)); 74033 74034 this.player.on('play', function(event) { 74035 var isFullscreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen; 74036 var isAndroid = navigator.userAgent.match(/android/i); 74037 74038 if (!isFullscreen && isAndroid) { 74039 this.player.fullscreen.enter(); 74040 } 74041 }); 74042 74043 var videoEl = document.getElementById('bgVideoHeaderModalVideo'); 74044 var self = this; 74045 var playbackTracks = {'zero': false, 'twofive': false, 'fivezero': false, 'sevenfive': false, 'end': false}; 74046 74047 videoEl.ontimeupdate = function(){ 74048 74049 var currentPerc = Math.floor((videoEl.currentTime / videoEl.duration)*100); 74050 74051 if(currentPerc == 0 && playbackTracks.zero === false) { 74052 self.trackVideoPlayback( 0, 'eVar97', 'Video Play' ); 74053 playbackTracks.zero = true; 74054 } 74055 74056 if(currentPerc == 25 && !playbackTracks.twofive) { 74057 self.trackVideoPlayback( 25, 'eVar98', 'Video 25% Reproduction' ); 74058 playbackTracks.twofive= true; 74059 if(window.gtag) { 74060 // DOUBLECLICK 74061 gtag('event', 'conversion', { 74062 'allow_custom_scripts': true, 74063 'send_to': 'DC-9390887/landing/5-dup0+standard' 74064 }); 74065 74066 // YOUTUBE 74067 gtag('event', 'conversion', {'send_to': 'AW-751059179/LqPwCIWGr54BEOuBkeYC'}); 74068 74069 // GOOGLE SEARCH 74070 gtag('event', 'conversion', {'send_to': 'AW-751083955/phjRCO3jt54BELPDkuYC'}); 74071 } 74072 74073 // FACEBOOK 74074 if(window.fbq) { 74075 fbq('track', 'bgVideoLP1QComplete'); 74076 } 74077 74078 // LINKEDIN 74079 $('body').append('<img src="https://dc.ads.linkedin.com/collect/?pid=1219953&conversionId=1108401&fmt=gif" width="1" height="1" alt="" style="display:none;"/>'); 74080 } 74081 74082 if(currentPerc == 50 && !playbackTracks.fivezero) { 74083 self.trackVideoPlayback( 50, 'eVar99', 'Video 50% Reproduction' ); 74084 playbackTracks.fivezero= true; 74085 74086 if(window.gtag) { 74087 // DOUBLECLICK 74088 gtag('event', 'conversion', { 74089 'allow_custom_scripts': true, 74090 'send_to': 'DC-9390887/landing/6-dup0+standard' 74091 }); 74092 74093 // YOUTUBE 74094 gtag('event', 'conversion', {'send_to': 'AW-751059179/ntDdCK2Hr54BEOuBkeYC'}); 74095 74096 // GOOGLE SEARCH 74097 gtag('event', 'conversion', {'send_to': 'AW-751083955/DWHeCKa_pZ4BELPDkuYC'}); 74098 } 74099 74100 // FACEBOOK 74101 if(window.fbq) { 74102 fbq('track', 'bgVideoLP2QComplete'); 74103 } 74104 74105 // LINKEDIN 74106 $('body').append('<img src="https://dc.ads.linkedin.com/collect/?pid=1219953&conversionId=1108409&fmt=gif" width="1" height="1" alt="" style="display:none;"/>'); 74107 74108 } 74109 74110 if(currentPerc == 79 && !playbackTracks.sevenfive) { 74111 self.trackVideoPlayback( 75, 'eVar100', 'Video 75% Reproduction' ); 74112 playbackTracks.sevenfive = true; 74113 74114 if(window.gtag) { 74115 // DOUBLECLICK 74116 gtag('event', 'conversion', { 74117 'allow_custom_scripts': true, 74118 'send_to': 'DC-9390887/landing/7-dup0+standard' 74119 }); 74120 74121 // YOUTUBE 74122 gtag('event', 'conversion', {'send_to': 'AW-751059179/YrtKCLy2p54BEOuBkeYC'}); 74123 74124 // GOOGLE SEARCH 74125 gtag('event', 'conversion', {'send_to': 'AW-751083955/Bc8JCN6GrZ4BELPDkuYC'}); 74126 } 74127 74128 // FACEBOOK 74129 if(window.fbq) { 74130 fbq('track', 'bgVideoLP3QComplete'); 74131 } 74132 74133 // LINKEDIN 74134 $('body').append('<img src="https://dc.ads.linkedin.com/collect/?pid=1219953&conversionId=1108417&fmt=gif" width="1" height="1" alt="" style="display:none;"/>'); 74135 74136 74137 } 74138 74139 if(currentPerc >= 99 && !playbackTracks.end) { 74140 self.trackVideoPlayback( 100, 'eVar101', 'Video 100% Reproduction' ); 74141 playbackTracks.end= true; 74142 74143 if(window.gtag) { 74144 // DOUBLECLICK 74145 gtag('event', 'conversion', { 74146 'allow_custom_scripts': true, 74147 'send_to': 'DC-9390887/landing/8-dup0+standard' 74148 }); 74149 74150 // YOUTUBE 74151 gtag('event', 'conversion', {'send_to': 'AW-751059179/MoFrCI2Ir54BEOuBkeYC'}); 74152 74153 // GOOGLE SEARCH 74154 gtag('event', 'conversion', {'send_to': 'AW-751083955/K36eCO2GrZ4BELPDkuYC'}); 74155 } 74156 74157 // FACEBOOK 74158 if(window.fbq) { 74159 fbq('track', 'bgVideoLPVideoComplete'); 74160 } 74161 74162 // LINKEDIN 74163 $('body').append('<img src="https://dc.ads.linkedin.com/collect/?pid=1219953&conversionId=1108425&fmt=gif" width="1" height="1" alt="" style="display:none;"/>'); 74164 74165 } 74166 74167 } 74168 74169 74170 74171 //Get Video Duration 74172 var durationInterval = setInterval(function() { 74173 if (this.player.media.readyState > 0) { 74174 var minutes = Math.trunc((this.player.media.duration / 60) % 60, 10); 74175 minutes = '0' + minutes; 74176 var seconds = Math.trunc(this.player.media.duration % 60, 10); 74177 seconds = '0' + seconds; 74178 74179 document.getElementsByClassName('plyr__time--duration')[0].innerText = minutes.slice(-2) + ":" + seconds.slice(-2) 74180 clearInterval(durationInterval); 74181 } 74182 }.bind(this), 200); 74183} 74184 74185 74186 74187bgVideoHeader.prototype.openModal = function(event) { 74188 event.preventDefault(); 74189 var source = this.el.data('modalsrc') || '', 74190 self = this; 74191 74192 if( source && source != null) { 74193 74194 // GA tracking 74195 if(window.gtag) { 74196 74197 // DOUBLECLICK 74198 gtag('event', 'conversion', { 74199 'allow_custom_scripts': true, 74200 'send_to': 'DC-9390887/landing/4-dup0+standard' 74201 }); 74202 74203 // YOUTUBE 74204 var callbackwatchclick = function () { 74205 74206 }; 74207 gtag('event', 'conversion', { 74208 'send_to': 'AW-751059179/1WfFCJizp54BEOuBkeYC', 74209 'event_callback': callbackwatchclick 74210 }); 74211 gtag('event', 'conversion', { 74212 'send_to': 'AW-751083955/1hTbCLCUt54BELPDkuYC', 74213 'event_callback': callbackwatchclick 74214 }); 74215 } 74216 74217 if(window.fbq) { 74218 fbq('track', 'bgVideoLPHeroButtonPlay'); 74219 } 74220 74221 $('body').append('<img src="https://dc.ads.linkedin.com/collect/?pid=1219953&conversionId=1058697&fmt=gif" width="1" height="1" alt="" style="display:none;"/>'); 74222 74223 74224 if(source.indexOf( '/content/dam' ) >= 0) { 74225 this.createModalWindowVideo( source ); 74226 return; 74227 } 74228 74229 this.createModalWindowIFrame( source ); 74230 return; 74231 } 74232 74233 74234}; 74235 74236 74237bgVideoHeader.prototype.closeModal= function(event) { 74238 $('.bgVideo-header-modal').each(function() { 74239 $(this).remove(); 74240 }); 74241 74242 $('html').css({'overflow-y':'scroll'}); 74243 74244 74245 return false;
74246}; 74247 74248 74249$(function() { 74250 $(".bgVideo-header").each(function() { 74251 new bgVideoHeader($(this)); 74252 }); 74253}); 74254$('.bgVideo-header a[data-toggle="dupontModal"]').click(function(e) { 74255 e.preventDefault(); 74256 74257 var videoURL = $(this).attr("href"); 74258 74259 var modalHTML = '<div id="wsFullVideo" class="fullDialog modal fade">'+ 74260 '<div class="modal-dialog">'+ 74261 74262 '<div class="modal-content embed-responsive embed-resonsive-16by9">'+ 74263 '<div class="modal-body">' + 74264 '<span onclick="document.getElementById("wsFullVideo").style.display="none">×</span>'+ 74265 '<iframe class="videoInFrame" src="' + videoURL + '" frameborder="0" allowfullscreen allow="autoplay" autoplay="autoplay"></iframe>'+ 74266 '</div>'+ 74267 '</div>'+ 74268 '</div>'+ 74269 '</div>'; 74270 74271 74272 $("body").append(modalHTML); 74273 74274 $("#wsFullVideo").modal('toggle'); 74275 74276 addCallbacks(); 74277}); 74278 74279function addCallbacks(){ 74280 $('#wsFullVideo').on('hidden.bs.modal', function () { 74281 $(".fullDialog").remove(); 74282 $('.src-desktop').get(0).play() 74283 }); 74284 74285 $('#wsFullVideo').on('shown.bs.modal', function (e) { 74286 $('.src-desktop').get(0).pause(); 74287 $('.videoInFrame').contents().find('video').attr("autoplay","autoplay"); 74288 setTimeout( 74289 function() 74290 { 74291 $('.videoInFrame').contents().find('video').get(0).play() 74292 }, 4000); 74293 74294 }); 74295 74296} 74297 74298 74299 74300/** 74301 * Countable is a script to allow for live paragraph-, word- and character- 74302 * counting on an HTML element. 74303 * 74304 * @author Sacha Schmid (<https://github.com/RadLikeWhoa>) 74305 * @version 3.0.1 74306 * @license MIT 74307 * @see <http://radlikewhoa.github.io/Countable/> 74308 */ 74309 74310/** 74311 * Note: For the purpose of this internal documentation, arguments of the type 74312 * {Nodes} are to be interpreted as either {NodeList} or {Element}. 74313 */ 74314 74315(function (global) { 74316 74317 /** 74318 * @private 74319 * 74320 * `liveElements` holds all elements that have the live-counting 74321 * functionality bound to them. 74322 */ 74323 74324 let liveElements = [] 74325 const each = Array.prototype.forEach 74326 74327 /** 74328 * `ucs2decode` function from the punycode.js library. 74329 * 74330 * Creates an array containing the decimal code points of each Unicode 74331 * character in the string. While JavaScript uses UCS-2 internally, this 74332 * function will convert a pair of surrogate halves (each of which UCS-2 74333 * exposes as separate characters) into a single code point, matching 74334 * UTF-16. 74335 * 74336 * @see <http://goo.gl/8M09r> 74337 * @see <http://goo.gl/u4UUC> 74338 * 74339 * @param {String} string The Unicode input string (UCS-2). 74340 * 74341 * @return {Array} The new array of code points. 74342 */ 74343 74344 function decode (string) { 74345 const output = [] 74346 let counter = 0 74347 const length = string.length 74348 74349 while (counter < length) { 74350 const value = string.charCodeAt(counter++) 74351 74352 if (value >= 0xD800 && value <= 0xDBFF && counter < length) { 74353 74354 // It's a high surrogate, and there is a next character. 74355 74356 const extra = string.charCodeAt(counter++) 74357 74358 if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. 74359 output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000) 74360 } else { 74361 74362 // It's an unmatched surrogate; only append this code unit, in case the 74363 // next code unit is the high surrogate of a surrogate pair. 74364 74365 output.push(value) 74366 counter-- 74367 } 74368 } else { 74369 output.push(value) 74370 } 74371 } 74372 74373 return output 74374 } 74375 74376 /** 74377 * `validateArguments` validates the arguments given to each function call. 74378 * Errors are logged to the console as warnings, but Countable fails 74379 * silently. 74380 * 74381 * @private 74382 * 74383 * @param {Nodes|String} targets A (collection of) element(s) or a single 74384 * string to validate. 74385 * 74386 * @param {Function} callback The callback function to validate. 74387 * 74388 * @return {Boolean} Returns whether all arguments are vaild. 74389 */ 74390 74391 function validateArguments (targets, callback) { 74392 const nodes = Object.prototype.toString.call(targets) 74393 const targetsValid = typeof targets === 'string' || ((nodes === '[object NodeList]' || nodes === '[object HTMLCollection]') || targets.nodeType === 1) 74394 const callbackValid = typeof callback === 'function' 74395 74396 if (!targetsValid) console.error('Countable: Not a valid target') 74397 if (!callbackValid) console.error('Countable: Not a valid callback function') 74398
74399 return targetsValid && callbackValid 74400 } 74401 74402 /** 74403 * `count` trims an element's value, optionally strips HTML tags and counts 74404 * paragraphs, sentences, words, characters and characters plus spaces. 74405 * 74406 * @private 74407 * 74408 * @param {Node|String} target The target for the count. 74409 * 74410 * @param {Object} options The options to use for the counting. 74411 * 74412 * @return {Object} The object containing the number of paragraphs, 74413 * sentences, words, characters and characters 74414 * plus spaces. 74415 */ 74416 74417 function count (target, options) { 74418 let original = '' + (typeof target === 'string' ? target : ('value' in target ? target.value : target.textContent)) 74419 options = options || {} 74420 74421 /** 74422 * The initial implementation to allow for HTML tags stripping was created 74423 * @craniumslows while the current one was created by @Rob--W. 74424 * 74425 * @see <http://goo.gl/Exmlr> 74426 * @see <http://goo.gl/gFQQh> 74427 */ 74428 74429 if (options.stripTags) original = original.replace(/<\/?[a-z][^>]*>/gi, '') 74430 74431 if (options.ignore) { 74432 each.call(options.ignore, function (i) { 74433 original = original.replace(i, '') 74434 }) 74435 } 74436 74437 const trimmed = original.trim() 74438 74439 /** 74440 * Most of the performance improvements are based on the works of @epmatsw. 74441 * 74442 * @see <http://goo.gl/SWOLB> 74443 */ 74444 74445 return { 74446 paragraphs: trimmed ? (trimmed.match(options.hardReturns ? /\n{2,}/g : /\n+/g) || []).length + 1 : 0, 74447 sentences: trimmed ? (trimmed.match(/[.?!â¦]+./g) || []).length + 1 : 0, 74448 words: trimmed ? (trimmed.replace(/['";:,.?¿\-!¡]+/g, '').match(/\S+/g) || []).length : 0, 74449 characters: trimmed ? decode(trimmed.replace(/\s/g, '')).length : 0, 74450 all: decode(original).length 74451 } 74452 } 74453 74454 /** 74455 * This is the main object that will later be exposed to other scripts. It 74456 * holds all the public methods that can be used to enable the Countable 74457 * functionality. 74458 * 74459 * Some methods accept an optional options parameter. This includes the 74460 * following options. 74461 * 74462 * {Boolean} hardReturns Use two returns to seperate a paragraph 74463 * instead of one. (default: false) 74464 * {Boolean} stripTags Strip HTML tags before counting the values. 74465 * (default: false) 74466 * {Array<Char>} ignore A list of characters that should be removed 74467 * ignored when calculating the counters. 74468 * (default: ) 74469 */ 74470 74471 const Countable = { 74472 74473 /** 74474 * The `on` method binds the counting handler to all given elements. The 74475 * event is either `oninput` or `onkeydown`, based on the capabilities of 74476 * the browser. 74477 * 74478 * @param {Nodes} elements All elements that should receive the 74479 * Countable functionality. 74480 * 74481 * @param {Function} callback The callback to fire whenever the 74482 * element's value changes. The callback is 74483 * called with the relevant element bound 74484 * to `this` and the counted values as the 74485 * single parameter. 74486 * 74487 * @param {Object} [options] An object to modify Countable's 74488 * behaviour. 74489 * 74490 * @return {Object} Returns the Countable object to allow for chaining. 74491 */ 74492 74493 on: function (elements, callback, options) { 74494 if (!validateArguments(elements, callback)) return 74495 74496 if (!Array.isArray(elements)) { 74497 elements = [ elements ] 74498 } 74499 74500 each.call(elements, function (e) { 74501 const handler = function () { 74502 callback.call(e, count(e, options)) 74503 } 74504 74505 liveElements.push({ element: e, handler: handler }) 74506 74507 handler() 74508 74509 e.addEventListener('input', handler) 74510 }) 74511 74512 return this 74513 }, 74514 74515 /** 74516 * The `off` method removes the Countable functionality from all given 74517 * elements. 74518 * 74519 * @param {Nodes} elements All elements whose Countable functionality 74520 * should be unbound. 74521 * 74522 * @return {Object} Returns the Countable object to allow for chaining. 74523 */ 74524 74525 off: function (elements) { 74526 if (!validateArguments(elements, function () {})) return 74527 74528 if (!Array.isArray(elements)) { 74529 elements = [ elements ] 74530 } 74531 74532 liveElements.filter(function (e) { 74533 return elements.indexOf(e.element) !== -1 74534 }
74534).forEach(function (e) { 74535 e.element.removeEventListener('input', e.handler) 74536 }) 74537 74538 liveElements = liveElements.filter(function (e) { 74539 return elements.indexOf(e.element) === -1 74540 }) 74541 74542 return this 74543 }, 74544 74545 /** 74546 * The `count` method works mostly like the `live` method, but no events are 74547 * bound, the functionality is only executed once. 74548 * 74549 * @param {Nodes|String} targets All elements that should be counted. 74550 * 74551 * @param {Function} callback The callback to fire whenever the 74552 * element's value changes. The callback 74553 * is called with the relevant element 74554 * bound to `this` and the counted values 74555 * as the single parameter. 74556 * 74557 * @param {Object} [options] An object to modify Countable's 74558 * behaviour. 74559 * 74560 * @return {Object} Returns the Countable object to allow for chaining. 74561 */ 74562 74563 count: function (targets, callback, options) { 74564 if (!validateArguments(targets, callback)) return 74565 74566 if (!Array.isArray(targets)) { 74567 targets = [ targets ] 74568 } 74569 74570 each.call(targets, function (e) { 74571 callback.call(e, count(e, options)) 74572 }) 74573 74574 return this 74575 }, 74576 74577 /** 74578 * The `enabled` method checks if the live-counting functionality is bound 74579 * to an element. 74580 * 74581 * @param {Node} element All elements that should be checked for the 74582 * Countable functionality. 74583 * 74584 * @return {Boolean} A boolean value representing whether Countable 74585 * functionality is bound to all given elements. 74586 */ 74587 74588 enabled: function (elements) { 74589 if (elements.length === undefined) { 74590 elements = [ elements ] 74591 } 74592 74593 return liveElements.filter(function (e) { 74594 return elements.indexOf(e.element) !== -1 74595 }).length === elements.length 74596 } 74597 74598 } 74599 74600 /** 74601 * Expose Countable depending on the module system used across the 74602 * application. (Node / CommonJS, AMD, global) 74603 */ 74604 74605 if (typeof exports === 'object') { 74606 module.exports = Countable 74607 } else if (typeof define === 'function' && define.amd) { 74608 define(function () { return Countable }) 74609 } else { 74610 global.Countable = Countable 74611 } 74612}(this)); 74613$(function() { 74614 74615 74616 var setReadTime = function() { 74617 this.bodyCopyBlocks = $('.bodycopy, .news-bodycopy').find('[id*="bodycopy"]'); 74618 this.readTimeContainer = $('.article-header-bottom-text > span'); 74619 this.averageReadCountPerMin = 200; 74620 }; 74621 74622 setReadTime.prototype.countWords = function(textBlocks) { 74623 74624 var totalwordsCount = 0; 74625 $.each(textBlocks, function(ind, val) { 74626 Countable.on(val, function(counter) { 74627 totalwordsCount += counter.words; 74628 74629 }) 74630 }); 74631 this.getReadTime(totalwordsCount); 74632 74633 }; 74634 74635 setReadTime.prototype.getReadTime = function(wordCount) { 74636 var self = this; 74637 var readingTime = Math.ceil(wordCount / self.averageReadCountPerMin); 74638 //console.log('readingTime',readingTime); 74639 this.setTimeinArticleHeader(readingTime); 74640 74641 }; 74642 74643 setReadTime.prototype.setTimeinArticleHeader = function(readTime) { 74644 74645 $(this.readTimeContainer).text( readTime + " min read"); 74646 }; 74647 74648 74649 let setReadTimeObj = new setReadTime(); 74650 74651 setReadTimeObj.countWords(setReadTimeObj.bodyCopyBlocks); 74652 74653 74654 74655}); 74656 74657// make the jquery contains case insensitive 74658$.expr[":"].contains = $.expr.createPseudo(function (arg) { 74659 return function (elem) { 74660 return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0; 74661 }; 74662}); 74663 74664 74665function AlphabeticalSubnav(el) { 74666 this.el = el; 74667 this.searchField = this.el.find('input[type="text"]').first(); 74668 this.alphabetList = this.el.find('.alphabet-list a'); 74669 this.MIN_LENGTH = 3; 74670 74671 this.initComponent(); 74672 this.initEvents(); 74673 this.initScroll(el); 74674 74675} 74676 74677AlphabeticalSubnav.prototype.initScroll = function (el) { 74678 74679 $(window).scroll(function(){ 74680 74681 var alphabetList=$(el.find('.alphabet-list')[0]); 74682 var defaultHeight=200; 74683 var tabletBreakPoint=768; 74684 if(window.innerWidth<tabletBreakPoint){ 74685 if($(window).scrollTop()+defaultHeight>=$(el).offset().top){ 74686 if($(window).scrollTop()>=($(el).height()+defaultHeight)){
74687 alphabetList.hide(); 74688 } 74689 else{ 74690 alphabetList.show(); 74691 } 74692 74693 } 74694 else{ 74695 alphabetList.hide(); 74696 } 74697 } 74698 }); 74699 74700}; 74701 74702AlphabeticalSubnav.prototype.initComponent = function () { 74703 this.checkListsForActive(); 74704}; 74705 74706AlphabeticalSubnav.prototype.checkListsForActive = function () { 74707 var self = this; 74708 var items = self.el.find(".alphabet-item"); 74709 74710 items.each(function () { 74711 var itemid = $(this).data("itemid"), 74712 enabledlen = $(this).find(".enabled").length, 74713 navEl = self.el.find('a[href="#' + itemid + '"]'); 74714 74715 if (enabledlen === 0) { 74716 $(this).hide(); 74717 navEl.addClass('disabled'); 74718 } else { 74719 $(this).show(); 74720 navEl.removeClass('disabled'); 74721 } 74722 }); 74723 74724 74725}; 74726 74727AlphabeticalSubnav.prototype.updateSearch = function (event) { 74728 74729 var self = this, 74730 fld = event.target, 74731 val = fld.value; 74732 74733 self.el.find(".disabled").removeClass("disabled"); 74734 self.el.find(".enabled").removeClass("enabled"); 74735 74736 if (val.length >= self.MIN_LENGTH) { 74737 self.el.find("a:not(:contains(" + val + "))").addClass("disabled"); 74738 self.el.find("a:contains(" + val + ")").addClass("enabled"); 74739 self.checkListsForActive(); 74740 } else { 74741 self.el.find('a').addClass('enabled'); 74742 self.checkListsForActive(); 74743 } 74744 74745 74746 74747}; 74748 74749AlphabeticalSubnav.prototype.navItemClick = function (event) { 74750 var elem = $(event.target), 74751 href = elem.attr('href').substr(1), 74752 scrollToEl = this.el.find('[data-itemid="' + href + '"]').first(); 74753 74754 if (!elem.hasClass('disabled')) { 74755 74756 74757 $("html, body").animate({ scrollTop: (scrollToEl.offset().top - $($('.alphabet-list')[0]).offset().top+$('html').scrollTop())}); 74758 } 74759 event.preventDefault(); 74760}; 74761 74762AlphabeticalSubnav.prototype.initEvents = function () { 74763 var self = this; 74764 74765 // input on change 74766 this.searchField.on("input", this.updateSearch.bind(self)); 74767 74768 // click of items in alphabet list 74769 this.alphabetList.each(function (i) { 74770 $(this).on("click", self.navItemClick.bind(self)); 74771 }); 74772}; 74773 74774$(function () { 74775 $('.alphabet-items').append($('[data-itemid=num]')); 74776 $(".component-alphabeticalsubnav").each(function () { 74777 new AlphabeticalSubnav($(this)); 74778 }); 74779}); 74780 74781function ActionBar(element) { 74782 this.el = element; 74783 this.navBarEl = $('.component-navigation').first(); 74784 this.featuredBrandsEl = this.el.find('.component-actionbar--contain-brands').first(); 74785 this.shareIconsEl = this.el.find('.component-actionbar--contain-share .share-on').first(); 74786 this.navIconsTargetEl = this.navBarEl.find('.component-navigation--logo').first(); 74787 this.lastScrollY = $(window).scrollTop(); 74788 this.minimunScroll = 50; 74789 this.setupNavForIcons(); 74790 this.initializeEvents(); 74791} 74792 74793ActionBar.prototype.setupNavForIcons = function () { 74794 if (this.navIconsTargetEl) { 74795 this.navIconsTargetEl.append('<div class="navigationShare">' + this.shareIconsEl.html() + '</div>'); 74796 } 74797}; 74798 74799ActionBar.prototype.onFeaturedBrandsClick = function (e) { 74800 if ($(window).width() < 1024) { 74801 this.featuredBrandsEl.toggleClass('open'); 74802 } 74803}; 74804 74805ActionBar.prototype.checkScroll = function (e) { 74806 var self = this, 74807 scrollY = $(window).scrollTop(), 74808 windowW = $(window).width(), 74809 scrollMax = ($(document).height() - $(window).height()), 74810 isSafari = (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1); 74811 scrollY = scrollY < 0 ? 0 : scrollY; 74812 if (windowW >= 1024) { 74813 74814 var scrollElastic = (isSafari) ? document.body.scrollTop : window.scrollY; 74815 this.navIconsTargetEl.removeClass('showShare'); 74816 var absScrollDiff = Math.abs(scrollY - this.lastScrollY); 74817 if(absScrollDiff < this.minimunScroll && scrollY !== 0) { 74818 return; 74819 } 74820 if (scrollElastic > 0 && scrollElastic < scrollMax) { 74821 if (scrollY > this.lastScrollY) { 74822 this.el.addClass('scroll-postop'); 74823 self.el.removeClass('scroll-postop-out').addClass('scroll-postop-in'); 74824 this.navBarEl.addClass('scroll-out').removeClass('scroll-in'); 74825 } else { 74826 if(self.el.hasClass('scroll-postop-in') && self.navBarEl.hasClass('scroll-in')){ 74827 self.el.removeClass('scroll-postop-in').addClass('scroll-postop-out'); 74828 } 74829 setTimeout(function () { 74830 if(self.navBarEl.hasClass('scroll-in')){ 74831 self.el.removeClass('scroll-postop scroll-postop-in scroll-postop-out'); 74832 } 74833 }, 400); 74834 this.navBarEl.removeClass('scroll-out').addClass('scroll-in'); 74835 } 74836 this.lastScrollY = scrollY; 74837 } 74838 } else { 74839 if(this.navBarEl.hasClass('scroll-out')){ 74840 this.navBarEl.removeClass('scroll-out').addClass('scroll-in'); 74841 this.el.removeClass('scroll-postop scroll-postop-in scroll-postop-out'); 74842 } 74843 if (this.navIconsTargetEl) { 74844 if (scrollY > this.lastScrollY) { 74845 this.navIconsTargetEl.addClass('showShare'); 74846 this.navIconsTargetEl.addClass('scroll-postop'); 74847 } else { 74848 this.navIconsTargetEl.removeClass('showShare'); 74849 this.navIconsTargetEl.removeClass('scroll-postop'); 74850 } 74851 74852 this.lastScrollY = scrollY; 74853 } 74854 } 74855}; 74856 74857ActionBar.prototype.initializeEvents = function () { 74858 74859 var supportsOrientationChange = "onorientationchange" in window, 74860 orientationEvent = supportsOrientationChange ? "orientationchange" : "resize", 74861 self = this; 74862 74863 this.featuredBrandsEl.on("click", this.onFeaturedBrandsClick.bind(this)); 74864 $(window).on("scroll", this.checkScroll.bind(this)); 74865 $(window).on(orientationEvent, this.checkScroll.bind(this)); 74866 $(window).resize(this.checkScroll.bind(this)); 74867}; 74868 74869$(function () { 74870 $(".component-actionbar").each(function () { 74871 new ActionBar($(this)); 74872 }); 74873}); 74874$(document).ready(function(){ 74875 if(window.location.href.indexOf("event") != -1) 74876 { 74877 $(".component-actionbar--pageinfo .category").text("Events"); 74878 } 74879}); 74880 74881function AccordionComponent(elm) { 74882 this.elm = elm; 74883 this.init(); 74884} 74885AccordionComponent.prototype.openAccordion = function(accordion) { 74886 accordion.toggleClass("active"); 74887 var panel = accordion.next(".panel")[0]; 74888 if(panel){ 74889 if (panel.style.maxHeight) { 74890 panel.style.maxHeight = null; 74891 } else { 74892 panel.style.maxHeight = panel.scrollHeight + "px"; 74893 } 74894 } 74895} 74896AccordionComponent.prototype.closeAccordions = function() { 74897 $(".accordion").removeClass("active"); 74898 $(".panel").each(function() { 74899 if (this.style.maxHeight) { 74900 this.style.maxHeight = null; 74901 } 74902 }); 74903} 74904AccordionComponent.prototype.init = function(){ 74905 var self = this; 74906 this.elm.on("click",function(){ 74907 if (!$(this).hasClass("active")) { 74908 self.closeAccordions(); 74909 } 74910 self.openAccordion($(this)); 74911 }) 74912} 74913$(function() { 74914 new AccordionComponent($(".accordion")); 74915}); 74916 74917 74918/*Open view accordion code starts*/ 74919 74920$(function() { 74921 74922 var openAccordionComp = function(el){ 74923 this.el = $($('.'+el)[0]); 74924 74925 } 74926 74927 openAccordionComp.prototype.init = function(){ 74928 74929 this.el.on('click','.accordion__title', $.proxy(this.accordionCl
74929ickHandler, this)); 74930 } 74931 74932 openAccordionComp.prototype.accordionClickHandler = function(evnt){ 74933 evnt.preventDefault(); 74934 var acc = $(evnt.currentTarget); 74935 if(acc.hasClass('collapsed')){ 74936 acc.removeClass('collapsed'); 74937 $(acc.siblings()[0]).show(); 74938 }else{ 74939 acc.addClass('collapsed'); 74940 $(acc.siblings()[0]).hide(); 74941 } 74942 74943 } 74944 74945 $.each($('.ac-open-view'),function(i,v) { 74946 $(v).addClass("acop-"+i); 74947 (new openAccordionComp("acop-"+i)).init(); 74948 }); 74949}); 74950/*Open view accordion code ends*/ 74951/**for default view**/ 74952$(document).ready(function() { 74953 $(document).on("click", ".default-accordian .accordion__title", function() { 74954 $(".default-accordian .accordion__title").not(this).addClass("collapsed"); 74955 $(".default-accordian .collapseacc").addClass("collapse"); 74956 $(this).toggleClass("collapsed"); 74957 if(!$(this).hasClass("collapsed")) 74958 $(this).next().toggleClass("collapse"); 74959 $('html, body').animate({ scrollTop: $(this).offset().top-250 }, 10); 74960 }); 74961}); 74962 74963$(function() { 74964 74965 var accAnimComp = function(cl) { 74966 74967 this.el = $($('.' + cl)[0]); 74968 74969 $($(this.el.find('.accordion__item')[0]).find('.collapse')[0]).addClass('show'); 74970 74971 74972 74973 74974 }; 74975 74976 accAnimComp.prototype.scrollTrack = function() { 74977 74978 var self = this; 74979 74980 this.doAnimate(); 74981 74982 $(window).scroll(function() { 74983 74984 self.doAnimate(); 74985 74986 74987 }) 74988 74989 74990 }; 74991 74992 accAnimComp.prototype.doAnimate = function() { 74993 74994 var scrollTop = $(window).scrollTop(); 74995 var sbHeight = window.innerHeight * (window.innerHeight / document.body.offsetHeight); 74996 this.elScrollTop = this.el.offset().top; 74997 74998 if((scrollTop)>=(this.elScrollTop-window.innerHeight+150)){ 74999 if(!this.el.hasClass('animate')){ 75000 this.el.addClass('animate'); 75001 } 75002 } 75003 }; 75004 75005 75006 $.each($('.accordion-with-animation'), function(i, v) { 75007 75008 var isAnimate = $(v).attr('data-is-animate'); 75009 $(v).addClass("acc-anim-" + i); 75010 75011 75012 75013 if(isAnimate){ 75014 75015 (new accAnimComp("acc-anim-" + i)).scrollTrack(); 75016 } 75017 75018 }); 75019 75020/*Added to show first accordion open*/ 75021 $.each($('.accordion-with-animation'), function(i, v) { 75022 75023 if($(v).parent().hasClass('replace-with-cap-symbol')){ 75024 $($(v).find(".accordion__title")[0]).click(); 75025 } 75026 75027 75028 }); 75029 75030 75031}); 75032$( document ).ready(function() { 75033 if(window.location.href.indexOf("/products/vespel") != -1 || window.location.href.indexOf("/products/actronal") != -1 || window.location.href.indexOf("/products/kalrez") != -1 || digitalData.page.aemPageurl.indexOf("/products/actronal") != -1 && $(".accordion").length() != 0){ 75034 $(".accordion").each(function(){ 75035 if($(this).html().indexOf("<h5>Product Details</h5>") != -1){ 75036 $(this).hide();$(this).next().hide(); 75037 } 75038 }); 75039 console.log("product details removed"); 75040} 75041 75042}); 75043 75044 75045$(document).ready(function () { 75046 75047 $('.accordion-filter-viewmore').hide(); 75048 var btvalue; 75049 var btFinval; 75050 var flag = false; 75051 var str = window.location.href; 75052 var k = str.indexOf("?"); 75053 if (k > 0 && str.substring(k + 1).length != 0 && str.substring(k + 1) != "wcmmode=disabled") { 75054 flag = true; 75055 } 75056 75057 $('.content-container').find('.card').hide(); 75058 75059 if (!flag) { 75060 try{ 75061 //$('.content-container div').first().show(); 75062 //var k = $('.acc-right-buttons button').first().attr('value'); 75063 $('.content-container').find('.card').show(); 75064 //$('.acc-right-buttons button').first().addClass('active'); 75065 btFinval = $('.content-container div').first().attr('id'); 75066 myFunction(); 75067 }catch(e){ 75068 console.log(e); 75069 } 75070 } 75071 75072 else { 75073 function getUrlVars() { 75074 75075 var vars = [], hash; 75076 75077 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 75078 75079 for (var i = 0; i < hashes.length; i++) { 75080 75081 hash = hashes[i].split('='); 75082 75083 vars.push(hash[0]); 75084 75085 vars[hash[0]] = hash[1]; 75086 75087 } 75088 75089 return vars; 75090 75091 } 75092 75093 var fields = getUrlVars(); 75094 75095 for (var j = 0; j < fields.length; j++) { 75096 var key = fields[j]; 75097 var value = fields[key]; 75098 if (key == "filter") { 75099 document.getElementById(value).style.display="block"; 75100 //$('.content-container').find('#' + value.replace('/','\\\/')).show(); 75101 btFinval = value; 75102 myFunction(); 75103 75104 75105 75106 $(document.getElementById(value)).find('.btn-link').first().find('i').removeClass('fa-plus'); 75107 $(document.getElementById(value)).find('.btn-link').first().find('i').addClass('fa-minus'); 75108 $(document.getElementById(value)).find('.collapse').first().addClass('show'); 75109 $(document.getElementById(value)).find('.btn-link').first().removeClass('collapsed'); 75110 var btnClicks = $('.acc-right-buttons button'); 75111 for (var i = 0; i < btnClicks.length; i++) { 75112 var className = $(btnClicks[i]).attr('value'); 75113 var classNameFinal = className.replaceAll(" ", ""); 75114 75115 if (value == classNameFinal) { 75116 $(btnClicks[i]).addClass('active'); 75117 } 75118 } 75119 } 75120 } 75121 } 75122 75123 $(".eduhub-accordion-filters .btn-click").click(function (event) { 75124 event.preventDefault(); 75125 btvalue = $(this).attr('value'); 75126 if($(this).hasClass('active')) 75127 { 75128 75129 $('.accordion_border').css('display', 'block'); 75130 $('.acc-right-buttons button').removeClass('active'); 75131 $('.content-container').find('.card').show(); 75132 $('.content-container').find('.collapse').removeClass('show'); 75133 $('.content-container').find('.btn-link').addClass('collapsed'); 75134 $('.content-container').find('.collapse').first().addClass('show'); 75135 $('.content-container').find('.btn-link').first().removeClass('collapsed'); 75136 $('.content-container .btn-link').find('i').removeClass('fa-minus'); 75137 $('.content-container .btn-link').find('i').addClass('fa-plus'); 75138 $('.content-container .btn-link').first().find('i').removeClass('fa-plus'); 75139 $('.content-container .btn-link').first().find('i').addClass('fa-minus'); 75140 btFinval = btvalue; 75141 myFunction(); 75142 75143 } 75144 else 75145 { 75146 $('.acc-right-buttons button').removeClass('active'); 75147 $(this).addClass('active'); 75148 $('.content-container').find('.card').hide(); 75149 document.getElementById(btvalue).style.display="block"; 75150 btFinval = btvalue; 75151 myFunction(); 75152 $(document.getElementById(btvalue)).find('.btn-link').first().find('i').removeClass('fa-plus'); 75153 $(document.getElementById(btvalue)).find('.btn-link').first().find('i').addClass('fa-minus'); 75154 $(document.getElementById(btvalue)).find('.collapse').first().addClass('show'); 75155 $(document.getElementById(btvalue)).find('.btn-link').first().removeClass('collapsed'); 75156 $('.accordion_border').css('display', 'none'); 75157 $(document.getElementById(btvalue)).parents('.accordion_border').css('display', 'block'); 75158 } 75159 75160 75161 }); 75162 75163 75164 function myFunction() { 75165 75166 $(document.getElementById(btFinval)).find('.accordion-viewmore').click(function () { 75167 //$('#' + btFinval + ' .accordion-viewmore').click(function () { 75168 75169 $(document.getElementById(btFinval)).find('.card-wrap:hidden').slice(0, 1).show(); 75170 75171 if ($(document.getElementById(btFinval)).find('.card-wrap').length == $(document.getElementById(btFinval)).find('.card-wrap:visible').length) { 75172 75173 $(document.getElementById(btFinval)).find('.accordion-viewmore').hide(); 75174 75175 } 75176 75177 }); 75178 75179 if ($(document.getElementById(btFinval)).find('.card-wrap').length > 4) { 75180 $(document.getElementById(btFinval)).find('.accordion-filter-viewmore').show(); 75181 // $('.accordion-filter-viewmore').show(); 75182 75183 } else { 75184 $(document.getElementById(btFinval)).find('.accordion-filter-viewmore').hide(); 75185 // $('.accordion-filter-viewmore').hide(); 75186 } 75187 75188 75189 75190 } 75191 75192 75193 75194 }); 75195 75196$(document).ready(function() { 75197 $(".card-view").each(function(){if($(this).text().trim() == ""){$(this).hide(); }}); 75198 init();
75199 function init(){ 75200 let arrowRightSVG = 'Right'; 75201 let arrowLeftSVG = 'Left'; 75202 75203 $('.water-card-rt-view-carousel:not(.no-carousel .water-card-rt-view-carousel)').each(function(index, elem){ 75204 let options = $(elem).data(); 75205 let itemCount = $(elem).find('.card-view').length; 75206 $(elem).owlCarousel({ 75207 responsiveClass:true, 75208 responsive:{ 75209 0:{ 75210 items:1, 75211 margin: 30, 75212 stagePadding: 0 75213 }, 75214 480:{ 75215 items:1, 75216 margin: 30, 75217 stagePadding: 20 75218 }, 75219 768:{ 75220 items:2, 75221 margin: 30, 75222 stagePadding: 20 75223 }, 75224 992:{ 75225 items:3, 75226 margin: 30, 75227 stagePadding: 40 75228 }, 75229 1200:{ 75230 items:3, 75231 margin: 30, 75232 stagePadding: 40, 75233 mouseDrag: itemCount <= 3 ? false : true 75234 } 75235 }, 75236 slideBy:'1', 75237 autoWidth: true, 75238 mergeFit: true, 75239 loop: false, 75240 dots: false, 75241 nav: false 75242 }); 75243 }); 75244 } 75245 75246 75247 $('.dupont-water-rt-card-carousal:not(.no-carousel)').each(function(index, elem){ 75248 75249 var carousalContext = this; 75250 75251 $(this).find('.owl-carousel').on('dragged.owl.carousel', function(event) { 75252 manageArrows(this, ""); 75253 }); 75254 75255 // go to next item 75256 75257 $(this).find('.slider-next').click(function() { 75258 $(this).parent().parent().find('.owl-carousel').trigger('next.owl.carousel'); 75259 manageArrows($(this).parent().parent().find('.owl-carousel'), "next"); 75260 }); 75261 75262 // go to previous item 75263 $(this).find('.slider-prev').click(function() { 75264 $(this).parent().parent().find('.owl-carousel').trigger('prev.owl.carousel'); 75265 manageArrows($(this).parent().parent().find('.owl-carousel'), "prev"); 75266 }); 75267 75268 if((jQuery(window).width() > 991 && $(this).find('.owl-item').length <= 3)) $(this).find('.slider-nav').hide(); 75269 75270 }); 75271 75272 function manageArrows(elem, action){ 75273 if($(elem).find(".owl-item:first-child").hasClass("active")){ 75274 $(".slider-next").attr("src", "https://dupont.scene7.com/is/image/Dupont/right-carousel-arrow-active@2x?fmt=png-alpha"); 75275 $(".slider-prev").attr("src", "https://dupont.scene7.com/is/image/Dupont/left-carousel-arrow-inactive@2x?fmt=png-alpha"); 75276 }else if($(elem).find(".owl-item:last-child").hasClass("active")){ 75277 if(action == "next"){ 75278 var count = $(elem).find(".owl-item").length; 75279 $(elem).trigger('to.owl.carousel', [count-1, 500]); 75280 $(".slider-next").addClass("disabled"); 75281 $(".slider-prev").removeClass("disabled"); 75282 $(".slider-next").attr("src", "https://dupont.scene7.com/is/image/Dupont/right-carousel-arrow-inactive@2x?fmt=png-alpha"); 75283 $(".slider-prev").attr("src", "https://dupont.scene7.com/is/image/Dupont/left-carousel-arrow-active@2x?fmt=png-alpha"); 75284 }else if(action=="prev"){ 75285 $(".slider-next").removeClass("disabled"); 75286 $(".slider-prev").removeClass("disabled"); 75287 $(".slider-next").attr("src", "https://dupont.scene7.com/is/image/Dupont/right-carousel-arrow-active@2x?fmt=png-alpha"); 75288 $(".slider-prev").attr("src", "https://dupont.scene7.com/is/image/Dupont/left-carousel-arrow-active@2x?fmt=png-alpha"); 75289 }else{ 75290 $(".slider-next").addClass("disabled"); 75291 $(".slider-prev").removeClass("disabled"); 75292 $(".slider-next").attr("src", "https://dupont.scene7.com/is/image/Dupont/right-carousel-arrow-inactive@2x?fmt=png-alpha"); 75293 $(".slider-prev").attr("src", "https://dupont.scene7.com/is/image/Dupont/left-carousel-arrow-active@2x?fmt=png-alpha"); 75294 } 75295 }else{ 75296 $(".slider-next").removeClass("disabled"); 75297 $(".slider-prev").removeClass("disabled"); 75298 $(".slider-next").attr("src", "https://dupont.scene7.com/is/image/Dupont/right-carousel-arrow-active@2x?fmt=png-alpha"); 75299 $(".slider-prev").attr("src", "https://dupont.scene7.com/is/image/Dupont/left-carousel-arrow-active@2x?fmt=png-alpha"); 75300 } 75301 } 75302 75303 75304 $('.related-load-more').click(function (e) { 75305 e.preventDefault(); 75306 $(this).closest('.no-carousel').addClass('loaded-more'); 75307 }) 75308 $('.dupont-water-rt-card-carousal.no-carousel').each(function(){ 75309 if($(this).find('.card-view').length <= 3) $(this).addClass('loaded-more'); 75310 }) 75311 75312}) 75313 75314$(function() { 75315 75316 var toUpBGComp = function(cl) { 75317 75318 this.el = $($('.' + cl)[0]); 75319 75320 if(this.el.find('.twoup-title-col').text().trim()==''){ 75321 75322 this.el.find('.twoup-title-col').addClass('no-show'); 75323 } 75324 75325 }; 75326 75327 toUpBGComp.prototype.scrollTrack = function() { 75328 75329 var self = this; 75330 75331 this.doAnimate(); 75332 75333 $(window).scroll(function() { 75334 75335 self.doAnimate(); 75336 75337 75338 }) 75339 75340 }; 75341 75342 toUpBGComp.prototype.doAnimate = function() { 75343 75344 var scrollTop = $(window).scrollTop(); 75345 var sbHeight = window.innerHeight * (window.innerHeight / document.body.offsetHeight); 75346 this.elScrollTop = this.el.offset().top; 75347 75348 if((scrollTop)>=(this.elScrollTop-window.innerHeight+150)){ 75349 if(!this.el.hasClass('animate')){ 75350 this.el.addClass('animate'); 75351 } 75352 } 75353 }; 75354 75355 75356 $.each($('.twoup-wrap'), function(i, v) { 75357 75358 var isAnimate = $(v).attr('data-is-animate'); 75359 $(v).addClass("2upBg-" + i); 75360 75361 if(isAnimate){ 75362 75363 (new toUpBGComp("2upBg-" + i)).scrollTrack(); 75364 } 75365 75366 }); 75367 75368 75369 75370}); 75371 75372$(document).ready(function() { 75373 75374 /* $( ".footer-edu .footer-list li" ).hover( 75375 function() { 75376 $('.footer-edu .list-title').removeClass( "list-title-highlight" ); 75377 }, function() { 75378 $('.footer-edu .list-title').addClass( "list-title-highlight" ); 75379 } 75380 ); 75381*/ 75382 75383}); 75384 75385!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,
vendor: 6,594 bytes, line 75385
75385sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.o
vendor: 3,442 bytes, line 75385
75385ptions.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!=0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t;if(e=this.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.
75385slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each(function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1}),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:
75385parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s&&i(this).attr({"aria-describedby":"slick-slide-control"+e.instanceUid+s})}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.$slides.eq(s).attr("tabindex",0);e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"}
75385,e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0}
vendor: 5,619 bytes, line 75385
75385,100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,e,t])})},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t])},r.src=t})}var t,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),t=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,l=s,d=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)r<0&&(r=n.slideCount-1),t=(t=t.add(d.eq(r))).add(d.eq(l)),r--,l++;e(t),n.slideCount<=n.options.slidesToShow?e(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?e(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&e(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},e.prototype.setCSS=function(i){var e,t,o=this,s={};
75385!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}
75385):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+
75385o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=(l=a.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight();!0!==t?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)}},e.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")}
75385,e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),void 0!==t)return t;return o}}); 75386 75387/********author:1377267 for removing youtubecookie*********/ 75388 75389var defaultCookie = document.cookie.match(new RegExp('(^| )notice_gdpr_prefs=([^;]+)')); 75390 75391 if (((defaultCookie && defaultCookie[2]=="0:") || !defaultCookie || (defaultCookie && defaultCookie[2]=="0,1:")) && document.title.indexOf("-auth") == -1 ){ 75392 75393 document.cookie = 'YSC=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;domain=.youtube.com;' 75394 document.cookie = 'VISITOR_INFO1_LIV=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;domain=.youtube.com;' 75395 75396 var galleryElements = document.querySelectorAll('.videocarouselhref,.hrefHiddenDivStory'); 75397 75398 [].slice.call( galleryElements ).forEach(function ( divelement ) { 75399 if (/youtube\.com|youtu\.be/.test(divelement.getAttribute("data-href")) ) {divelement.parentElement.innerHTML = "<div style='text-align: center;margin: auto;width: 50%;'>To view this third-party content, please give consent to advertising cookies from the cookie preferences in footer section.</div>";} 75400 }); 75401 75402 var elements = document.getElementsByTagName("a"); 75403 var selections = [...elements].filter(element => !element.closest("li")); 75404 selections =[...selections].filter(element => !element.closest('.social-icons')); 75405 75406 for (var i = 0; i < selections.length; i++) { 75407 if (/youtube\.com|youtu\.be/.test(selections[i].getAttribute("href")) ) { 75408 if(selections[i].parentNode){ 75409 selections[i].parentNode.innerHTML="<div>To view this third-party content, please give consent to advertising cookies from the cookie preferences in footer section.</>"; selections[i].setAttribute('href',"#"); 75410 } 75411 } 75412 } 75413 //$('a').filter(function(){ return /youtube\.com|youtu\.be/.test(this.href); }).remove(); 75414 75415 //$(".video-wrapper").html("<h3 style='color:white'>Please Accept cookies from footer to watch the video</h3>"); 75416 75417 var divs = document.getElementsByClassName( 'youTubevideoply' ); 75418 75419 [].slice.call( divs ).forEach(function ( div ) { 75420 div.parentElement.style.backgroundColor = "transparent"; 75421 div.innerHTML = "<h4>To view this third-party content, please give consent to advertising cookies from the cookie preferences in footer section.</h4>"; 75422 }); 75423 } 75424/****************/ 75425var GetElqContentPersonalizationValue; 75426$(document).ready(function(){ 75427 $(".dupont-list").each(function(){ 75428 $(this).find(".listComponent-Element").hide(); 75429 var showMoreCount=$(this).find('.displayItems').val(); 75430 if(showMoreCount==undefined || showMoreCount=="" ){ 75431 $(this).find(".listComponent-Element").show(); 75432 $(this).find(".loadMore").hide(); 75433 } 75434 $(this).find(".listComponent-Element").slice(0, $(this).find('.displayItems').val()).show(); 75435 75436 if($(this).find(".listComponent-Element").length <= $(this).find('.displayItems').val()){ 75437 $(this).find(".loadMore").hide(); 75438 } 75439 $(this).find(".loadMore").on("click", function(e){ 75440 e.preventDefault(); 75441 $(this).parents(".dupont-list").find(".listComponent-Element:hidden").fadeIn(); 75442 if($(this).parents(".dupont-list").find(".listComponent-Element:hidden").length == 0) { 75443 $(this).fadeOut('slow'); 75444 } 75445 }); 75446 }); 75447 }); 75448 75449 75450 $(document).ready(function($) { 75451 applyOFI(true, true); 75452}); 75453 75454function applyOFI(forced, viaUrl) {
75455 //var btn = document.querySelector('button'); 75456 //btn.disabled = true; 75457 try{ 75458 objectFitImages(false, { 75459 watchMQ: true, 75460 skipTest: forced 75461 }); 75462 75463 }catch(e){ 75464 console.log(e); 75465 } 75466} 75467 75468 75469/*lazy load images*/ 75470//(function(){ 75471 75472/* 75473START 75474Author: Aashutosh Sharma(ph1560) 75475Changes Done: Addition of Code of lazy loading on Img tag 75476Date: 26th July 2022 75477*/ 75478 75479document.addEventListener("DOMContentLoaded", function() { 75480 var lazyloadImages; 75481 if ('IntersectionObserver' in window) { 75482 const observer = new IntersectionObserver(observerCallback, { threshold: 0.2 }); 75483 const bgImages = document.querySelectorAll('[style*=background]:not([style*=background-color])'); 75484 bgImages.forEach(bg => { 75485 bg.classList.add('no-background'); 75486 observer.observe(bg); 75487 }); 75488 75489 function observerCallback(entries, observer) { 75490 entries.forEach((entry) => { 75491 if (!entry.isIntersecting) { 75492 return; 75493 } 75494 entry.target.classList.remove('no-background'); 75495 observer.unobserve(entry.target); 75496 }); 75497 } 75498 75499 lazyloadImages = document.querySelectorAll("img"); 75500 var imageObserver = new IntersectionObserver(function(entries, observer) { 75501 entries.forEach(function(entry) { 75502 if (entry.isIntersecting) { 75503 var image = entry.target; 75504 if(image.dataset.src != null && image.dataset.src != undefined) 75505 image.src = image.dataset.src; 75506 imageObserver.unobserve(image); 75507 } 75508 }); 75509 }); 75510 75511 lazyloadImages.forEach(function(image) { 75512 imageObserver.observe(image); 75513 }); 75514 75515 }else{ 75516 var lazyloadThrottleTimeout; 75517 lazyloadImages = document.querySelectorAll("img"); 75518 75519 function lazyload () { 75520 if(lazyloadThrottleTimeout) { 75521 clearTimeout(lazyloadThrottleTimeout); 75522 } 75523 75524 lazyloadThrottleTimeout = setTimeout(function() { 75525 var scrollTop = window.pageYOffset; 75526 lazyloadImages.forEach(function(img) { 75527 if(img.offsetTop < (window.innerHeight + scrollTop) && (image.dataset.src != null && image.dataset.src != undefined)) { 75528 img.src = img.dataset.src; 75529 } 75530 }); 75531 if(lazyloadImages.length == 0) { 75532 document.removeEventListener("scroll", lazyload); 75533 window.removeEventListener("resize", lazyload); 75534 window.removeEventListener("orientationChange", lazyload); 75535 } 75536 }, 20); 75537 } 75538 75539 document.addEventListener("scroll", lazyload); 75540 window.addEventListener("resize", lazyload); 75541 window.addEventListener("orientationChange", lazyload); 75542 } 75543 document.body.classList.add('lazy-load-bg-imgs') 75544}); 75545/*END*/ 75546 75547/**code to remove russia from forms**/ 75548$(document).ready(function(){ $("select>option").each(function(){if(this.text=="RUSSIAN FEDERATION" || this.text=="RUSSIA" ){this.remove()}}); }); 75549/***for multicta***/ 75550$(document).ready($(".multicta").each(function(){if($(this).data("href")[0] == "#"){var k = $(this);$(this).attr("href",k.data("href"))} })); 75551 75552/**********to replace s_campaign with local storage***********/ 75553var urlParamssrc = new URLSearchParams(window.location.search); 75554var myParamsrc = urlParamssrc.get('src'); 75555if(myParamsrc){ 75556 75557localStorage.setItem("src_tracking_code", myParamsrc); 75558} 75559 75560var storeHref = ""; 75561 $("a").bind("click", function(){ 75562 storeHref = this.href; 75563 return true; 75564 }); 75565window.addEventListener('beforeunload', function (event) { 75566 if(window.history.length > 1 && 75567 storeHref.indexOf(window.location.host) == -1){ 75568 localStorage.removeItem("src_tracking_code"); 75569 } 75570}); 75571/**********to remove empty heading tags***********/ 75572// Select all heading levels from h1 to h6 75573$(document).ready(function(){ 75574var emtyheadingsheadings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
75575emtyheadingsheadings.forEach(emtyheadingsheadings => { 75576 // .trim() handles headings that only contain spaces or line breaks 75577 if (emtyheadingsheadings.textContent.trim() === '' && !emtyheadingsheadings.classList.contains('animated-title')) { 75578 emtyheadingsheadings.remove(); 75579 } 75580}); 75581}); 75582 75583$('a[data-toggle="dupontBSModal"]').click(function(e) { 75584 e.preventDefault(); 75585 75586 var videoURL = $(this).attr("href"); 75587 75588 var modalHTML = '<div id="wsFullVideo" class="fullDialog modal fade">'+ 75589 '<div class="modal-dialog">'+ 75590 '<div class="modal-content embed-responsive embed-resonsive-16by9">'+ 75591 '<div class="modal-body">' + 75592 '<iframe class="videoInFrame" src="' + videoURL + '" frameborder="0" allowfullscreen allow="autoplay"></iframe>'+ 75593 '</div>'+ 75594 '</div>'+ 75595 '</div>'+ 75596 '<div class="boxclose" title="Close"></div></div>'; 75597 75598 75599 $("body").append(modalHTML); 75600 75601 $("#wsFullVideo").modal('toggle'); 75602 75603 addCallbacks(); 75604 75605 return false; 75606}); 75607 75608function addCallbacks(){ 75609 $('#wsFullVideo').on('hidden.bs.modal', function () { 75610 $(".fullDialog").remove(); 75611 }); 75612 75613 $('#wsFullVideo').on('shown.bs.modal', function (e) { 75614 75615 }); 75616} 75617function videoCaptions(val) { 75618 $('video').on('loadstart', function (evnt) { 75619 75620 let videoEL = $(evnt.currentTarget); 75621 let videoFilePath = $(this).attr('src') ? $(this).attr('src') : $(this).find('source').attr('src'); 75622 if (videoFilePath && videoFilePath != '#') { 75623 if (videoFilePath.indexOf('/content/dam/') != -1) { 75624 videoFilePath = videoFilePath; 75625 } else if (videoFilePath.indexOf('dupont.scene7.com') != -1) { 75626 videoFilePath = videoEL.data('content-path') ? videoEL.data('content-path') : val; 75627 } 75628 } 75629 //videoFilePath = videoFilePath.indexOf('/content/dam')!=-1 ? videoFilePath : 'scene7'; 75630 videoEL.find('track.d_vdo_captions_track').remove(); 75631 75632 if (videoFilePath && videoFilePath != '#') { 75633 let pagePathUrl = digitalData.page.aemPageurl; 75634 //console.log("videoFilePath", videoFilePath); 75635 let page_data = { 75636 pagePath: pagePathUrl, 75637 videoPath: videoFilePath 75638 }; 75639 75640 $.ajax({ 75641 url: "/dupont/getSubtitles", 75642 type: "GET", 75643 data: page_data, 75644 dataType: 'json', 75645 success: function (data) { 75646 //console.log(data); 75647 if (data.langSubtitlePath || data.enSubtitlePath) { 75648 videoEL.find('track.d_vdo_captions_track').remove(); 75649 if (data.langSubtitlePath) { 75650 videoEL.append('<track class="d_vdo_captions_track" kind="captions" srclang="' + data.pageLanguage + '" label="' + data.pageLanguageLabel + '" src="' + data.langSubtitlePath + '" default>'); 75651 } 75652 if (data.enSubtitlePath !== data.langSubtitlePath) { 75653 if (data.enSubtitlePath) { 75654 videoEL.append('<track class="d_vdo_captions_track" kind="captions" srclang="en" label="English" src="' + data.enSubtitlePath + '" >'); 75655 } 75656 } 75657 /*Other Player COntrols */ 75658 if (videoEL.parent().hasClass('plyr__video-wrapper')) { 75659 videoEL.parent().closest('.plyr').addClass('plyr--captions-active plyr--captions-enabled'); 75660 videoEL.parent().siblings('.plyr__controls').find('[data-plyr="captions"]').addClass('plyr--captions-enabled'); 75661 } 75662 } 75663 }, 75664 error: function (jqXHR, textStatus, errorThrown) { 75665 console.log(textStatus, errorThrown); 75666 } 75667 }); 75668 } 75669 75670 }); 75671} 75672 75673videoCaptions(); 75674 75675!function(t,e){"object"==typeof exports?module.exports=exports=e():"function"==typeof define&&define.amd?define([],e):t.CryptoJS=e()}(this,function(){var n,o,s,a,h,t,e,l,r,i,c,f,d,u,p,S,x,b,A,H,z,_,v,g,y,B,w,k,m,C,D,E,R,M,F,P,W,O,I,U=U||function(h){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),!(i=!(i=!(i="undefined"!=typeof globalThis&&globalThis.crypto?globalThis.crypto:i)&&"undefined"!=typeof window&&window.msCrypto?window.msCrypto:i)&&"undefined"!=typeof global&&global.crypto?global.crypto:i)&&"function"==typeof require)try{i=require("crypto")}catch(t){}var r=Object.create||function(t){return e.prototype=t,t=new e,e.prototype=null,t};function e(){}var t={},n=t.lib={},o=n.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.a
vendor: 34,632 bytes, line 75675
75675pply(this,arguments)}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},l=n.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o<n;o++){var s=r[o>>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(var c=0;c<n;c+=4)e[i+c>>>2]=r[c>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=h.ceil(e/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")}());return new l.init(e,t)}}),s=t.enc={},c=s.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i+=2)r[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new l.init(r,e/2)}},a=s.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new l.init(r,e)}},f=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(a.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return a.parse(unescape(encodeURIComponent(t)))}},d=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e,r=this._data,i=r.words,n=r.sigBytes,o=this.blockSize,s=n/(4*o),c=(s=t?h.ceil(s):h.max((0|s)-this._minBufferSize,0))*o,n=h.min(4*c,n);if(c){for(var a=0;a<c;a+=o)this._doProcessBlock(i,a);e=i.splice(0,c),r.sigBytes-=n}return new l.init(e,n)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),u=(n.Hasher=d.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(r){return function(t,e){return new r.init(e).finalize(t)}},_createHmacHelper:function(r){return function(t,e){return new u.HMAC.init(r,e).finalize(t)}}}),t.algo={});return t}(Math);function K(t,e,r){return t&e|~t&r}function X(t,e,r){return t&r|e&~r}function L(t,e){return t<<e|t>>>32-e}function j(t,e,r,i){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,i.encryptBlock(n,0);for(var s=0;s<r;s++)t[e+s]^=n[s]}function T(t){var e,r,i;return 255==(t>>24&255)?(r=t>>8&255,i=255&t,255===(e=t>>16&255)?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=i):t+=1<<24,t}function N(){for(var t=this._X,e=this._C,r=0;r<8;r++)E[r]=e[r];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<E[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<E[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<E[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<E[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<E[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<E[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<E[6]>>>0?1:0)|0,this._b=e[7]>>>0<E[7]>>>0?1:0;for(r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,o=i>>>16;R[r]=((n*n>>>17)+n*o>>>15)+o*o^((4294901760&i)*i|0)+((65535&i)*i|0)}t[0]=R[0]+(R[7]<<16|R[7]>>>16)+(R[6]<<16|R[6]>>>16)|0,t[1]=R[1]+(R[0]<<8|R[0]>>>24)+R[7]|0,t[2]=R[2]+(R[1]<<16|R[1]>>>16)+(R[0]<<16|R[0]>>>16)|0,t[3]=R[3]+(R[2]<<8|R[2]>>>24)+R[1]|0,t[4]=R[4]+(R[3]<<16|R[3]>>>16)+(R[2]<<16|R[2]>>>16)|0,t[5]=R[5]+(R[4]<<8|R[4]>>>24)+R[3]|0,t[6]=R[6]+(R[5]<<16|R[5]>>>16)+(R[4]<<16|R[4]>>>16)|0,t[7]=R[7]+(R[6]<<8|R[6]>>>24)+R[5]|0}function q(){for(var t=this._X,e=this._C,r=0;r<8;r++)O[r]=e[r];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<O[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<O[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<O[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<O[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<O[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<O[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<O[6]>>>0?1:0)|0,this._b=e[7]>>>0<O[7]>>>0?1:0;for(r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,o=i>>>16;I[r]=((n*n>>>17)+n*o>>>15)+o*o^((4294901760&i)*i|0)+((65535&i)*i|0)}t[0]=I[0]+(I[7]<<16|I[7]>>>16)+(I[6]<<16|I[6]>>>16)|0,t[1]=I[1]+(I[0]<<8|I[0]>>>24)+I[7]|0,t[2]=I[2]+(I[1]<<16|I[1]>>>16)+(I[0]<<16|I[0]>>>16)|0,t[3]=I[3]+(I[2]<<8|I[2]>>>24)+I[1]|0,t[4]=I[4]+(I[3]<<16|I[3]>>>16)+(I[2]<<16|I[2]>>>16)|0,t[5]=I[5]+(I[4]<<8|I[4]>>>24)+I[3]|0,t[6]=I[6]+(I[5]<<16|I[5]>>>16)+(I[4]<<16|I[4]>>>16)|0,t[7]=I[7]+(I[6]<<8|I[6]>>>24)+I[5]|0}return F=(M=U).lib,n=F.Base,o=F.WordArray,(M=M.x64={}).Word=n.extend({init:function(t,e){this.high=t,this.low=e}}),M.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],i=0;i<e;i++){var n=t[i];r.push(n.high),r.push(n.low)}return o.create(r,this.sigBytes)},clone:function(){for(var t=n.clone.call(this),e=t.words=this.words.slice(0),r=e.length,i=0;i<r;i++)e[i]=e[i].clone();return t}}),"function"==typeof ArrayBuffer&&(P=U.lib.WordArray,s=P.init,(P.init=function(t){if((t=(t=t instanceof ArrayBuffer?new Uint8Array(t):t)instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t)instanceof Uint8Array){for(var e=t.byteLength,r=[],i=0;i<e;i++)r[i>>>2]|=t[i]<<24-i%4*8;s.call(this,r,e)}else s.apply(this,arguments)}).prototype=P),function(){var t=U,n=t.lib.WordArray,t=t.enc;t.Utf16=t.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n+=2){var o=e[n>>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>1]|=t.charCodeAt(i)<<16-i%2*16;return n.create(r,2*e)}};function s(t){return t<<8&4278255360|t>>>8&16711935}t.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n+=2){var o=s(e[n>>>2]>>>16-n%4*8&65535);i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>1]|=s(t.charCodeAt(i)<<16-i%2*16);return n.create(r,2*e)}}}(),a=(w=U).lib.WordArray,w.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,i=this._map;t.clamp();for(var n=[],o=0;o<r;o+=3)for(var s=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,c=0;c<4&&o+.75*c<r;c++)n.push(i.charAt(s>>>6*(3-c)&63));var a=i.charAt(64);if(a)for(;n.length%4;)n.push(a);return n.join("")},parse:function(t){var e=t.length,r=this._map;if(!(i=this._reverseMap))for(var i=this._reverseMap=[],n=0;n<r.length;n++)i[r.charCodeAt(n)]=n;var o=r.charAt(64);return!o||-1!==(o=t.indexOf(o))&&(e=o),function(t,e,r){for(var i=[],n=0,o=0;o<e;o++){var s,c;o%4&&(s=r[t.charCodeAt(o-1)]<<o%4*2,c=r[t.charCodeAt(o)]>>>6-o%4*2,c=s|c,i[n>>>2]|=c<<24-n%4*8,n++)}return a.create(i,n)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},h=(F=U).lib.WordArray,F.enc.Base64url={stringify:function(t,e=!0){var r=t.words,i=t.sigBytes,n=e?this._safe_map:this._map;t.clamp();for(var o=[],s=0;s<i;s+=3)for(var c=(r[s>>>2]>>>24-s%4*8&255)<<16|(r[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|r[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<i;a++)o.push(n.charAt(c>>>6*(3-a)&63));var h=n.charAt(64);if(h)for(;o.length%4;)o.push(h);return o.join("")},parse:function(t,e=!0){var r=t.length,i=e?this._safe_map:this._map;if(!(n=this._reverseMap))for(var n=this._reverseMap=[],o=0;o<i.length;o++)n[i.charCodeAt(o)]=o;e=i.charAt(64);return!e||-1!==(e=t.indexOf(e))&&(r=e),function(t,e,r){for(var i=[],n=0,o=0;o<e;o++){var s,c;o%4&&(s=r[t.charCodeAt(o-1)]<<o%4*2,c=r[t.charCodeAt(o)]>>>6-o%4*2,c=s|c,i[n>>>2]|=c<<24-n%4*8,n++)}return h.create(i,n)}(t,r,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},function(a){var t=U,e=t.lib,r=e.WordArray,i=e.Hasher,e=t.algo,A=[];!function(){for(var t=0;t<64;t++)A[t]=4294967296*a.abs(a.sin(t+1))|0}();e=e.MD5=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,s=t[e+0],c=t[e+1],a=t[e+2],h=t[e+3],l=t[e+4],f=t[e+5],d=t[e+6],u=t[e+7],p=t[e+8],_=t[e+9],y=t[e+10],v=t[e+11],g=t[e+12],B=t[e+13],w=t[e+14],k=t[e+15],m=H(m=o[0],b=o[1],x=o[2],S=o[3],s,7,A[0]),S=H(S,m,b,x,c,12,A[1]),x=H(x,S,m,b,a,17,A[2]),b=H(b,x,S,m,h,22,A[3]);m=H(m,b,x,S,l,7,A[4]),S=H(S,m,b,x,f,12,A[5]),x=H(x,S,m,b,d,17,A[6]),b=H(b,x,S,m,u,22,A[7]),m=H(m,b,x,S,p,7,A[8]),S=H(S,m,b,x,_,12,A[9]),x=H(x,S,m,b,y,17,A[10]),b=H(b,x,S,m,v,22,A[11]),m=H(m,b,x,S,g,7,A[12]),S=H(S,m,b,x,B,12,A[13]),x=H(x,S,m,b,w,17,A[14]),m=z(m,b=H(b,x,S,m,k,22,A[15]),x,S,c,5,A[16]),S=z(S,m,b,x,d,9,A[17]),x=z(x,S,m,b,v,14,A[18]),b=z(b,x,S,m,s,20,A[19]),m=z(m,b,x,S,f,5,A[20]),S=z(S,m,b,x,y,9,A[21]),x=z(x,S,m,b,k,14,A[22]),b=z(b,x,S,m,l,20,A[23]),m=z(m,b,x,S,_,5,A[24]),S=z(S,m,b,x,w,9,A[25]),x=z(x,S,m,b,h,14,A[26]),b=z(b,x,S,m,p,20,A[27]),m=z(m,b,x,S,B,5,A[28]),S=z(S,m,b,x,a,9,A[29]),x=z(x,S,m,b,u,14,A[30]),m=C(m,b=z(b,x,S,m,g,20,A[31]),x,S,f,4,A[32]),S=C(S,m,b,x,p,11,A[33]),x=C(x,S,m,b,v,16,A[34]),b=C(b,x,S,m,w,23,A[35]),m=C(m,b,x,S,c,4,A[36]),S=C(S,m,b,x,l,11,A[37]),x=C(x,S,m,b,u,16,A[38]),b=C(b,x,S,m,y,23,A[39]),m=C(m,b,x,S,B,4,A[40]),S=C(S,m,b,x,s,11,A[41]),x=C(x,S,m,b,h,16,A[42]),b=C(b,x,S,m,d,23,A[43]),m=C(m,b,x,S,_,4,A[44]),S=C(S,m,b,x,g,11,A[45]),x=C(x,S,m,b,k,16,A[46]),m=D(m,b=C(b,x,S,m,a,23,A[47]),x,S,s,6,A[48]),S=D(S,m,b,x,u,10,A[49]),x=D(x,S,m,b,w,15,A[50]),b=D(b,x,S,m,f,21,A[51]),m=D(m,b,x,S,g,6,A[52]),S=D(S,m,b,x,h,10,A[53]),x=D(x,S,m,b,y,15,A[54]),b=D(b,x,S,m,c,21,A[55]),m=D(m,b,x,S,p,6,A[56]),S=D(S,m,b,x,k,10,A[57]),x=D(x,S,m,b,d,15,A[58]),b=D(b,x,S,m,B,21,A[59]),m=D(m,b,x,S,l,6,A[60]),S=D(S,m,b,x,v,10,A[61]),x=D(x,S,m,b,a,15,A[62]),b=D(b,x,S,m,_,21,A[63]),o[0]=o[0]+m|0,o[1]=o[1]+b|0,o[2]=o[2]+x|0,o[3]=o[3]+S|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32;var n=a.floor(r/4294967296),r=r;e[15+(64+i>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e[14+(64+i>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var e=this._hash,o=e.words,s=0;s<4;s++){var c=o[s];o[s]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return e},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});function H(t,e,r,i,n,o,s){s=t+(e&r|~e&i)+n+s;return(s<<o|s>>>32-o)+e}function z(t,e,r,i,n,o,s){s=t+(e&i|r&~i)+n+s;return(s<<o|s>>>32-o)+e}function C(t,e,r,i,n,o,s){s=t+(e^r^i)+n+s;return(s<<o|s>>>32-o)+e}function D(t,e,r,i,n,o,s){s=t+(r^(e|~i))+n+s;return(s<<o|s>>>32-o)+e}t.MD5=i._createHelper(e),t.HmacMD5=i._createHmacHelper(e)}(Math),P=(M=U).lib,t=P.WordArray,e=P.Hasher,P=M.algo,l=[],P=P.SHA1=e.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],c=r[4],a=0;a<80;a++){a<16?l[a]=0|t[e+a]:(h=l[a-3]^l[a-8]^l[a-14]^l[a-16],l[a]=h<<1|h>>>31);var h=(i<<5|i>>>27)+c+l[a];h+=a<20?1518500249+(n&o|~n&s):a<40?1859775393+(n^o^s):a<60?(n&o|n&s|o&s)-1894007588:(n^o^s)-899497514,c=s,s=o,o=n<<30|n>>>2,n=i,i=h}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(64+i>>>9<<4)]=Math.floor(r/4294967296),e[15+(64+i>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t}}),M.SHA1=e._createHelper(P),M.HmacSHA1=e._createHmacHelper(P),function(n){var t=U,e=t.lib,r=e.WordArray,i=e.Hasher,e=t.algo,o=[],p=[];!function(){function t(t){return 4294967296*(t-(0|t))|0}for(var e=2,r=0;r<64;)!function(t){for(var e=n.sqrt(t),r=2;r<=e;r++)if(!(t%r))return;return 1}(e)||(r<8&&(o[r]=t(n.pow(e,.5))),p[r]=t(n.pow(e,1/3)),r++),e++}();var _=[],e=e.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],c=r[4],a=r[5],h=r[6],l=r[7],f=0;f<64;f++){f<16?_[f]=0|t[e+f]:(d=_[f-15],u=_[f-2],_[f]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+_[f-7]+((u<<15|u>>>17)^(u<<13|u>>>19)^u>>>10)+_[f-16]);var d=i&n^i&o^n&o,u=l+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&a^~c&h)+p[f]+_[f],l=h,h=a,a=c,c=s+u|0,s=o,o=n,n=i,i=u+(((i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22))+d)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0,r[5]=r[5]+a|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(64+i>>>9<<4)]=n.floor(r/4294967296),e[15+(64+i>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA256=i._createHelper(e),t.HmacSHA256=i._createHmacHelper(e)}(Math),r=(w=U).lib.WordArray,F=w.algo,i=F.SHA256,F=F.SHA224=i.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=i._doFinalize.call(this);return t.sigBytes-=4,t}}),w.SHA224=i._createHelper(F),w.HmacSHA224=i._createHmacHelper(F),function(){var t=U,e=t.lib.Hasher,r=t.x64,i=r.Word,n=r.WordArray,r=t.algo;function o(){return i.create.apply(i,arguments)}var t1=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],e1=[];!function(){for(var t=0;t<80;t++)e1[t]=o()}();r=r.SHA512=e.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],c=r[4],a=r[5],h=r[6],l=r[7],f=i.high,d=i.low,u=n.high,p=n.low,_=o.high,y=o.low,v=s.high,g=s.low,B=c.high,w=c.low,k=a.high,m=a.low,S=h.high,x=h.low,b=l.high,r=l.low,A=f,H=d,z=u,C=p,D=_,E=y,R=v,M=g,F=B,P=w,W=k,O=m,I=S,U=x,K=b,X=r,L=0;L<80;L++){var j,T,N=e1[L];L<16?(T=N.high=0|t[e+2*L],j=N.low=0|t[e+2*L+1]):($=(q=e1[L-15]).high,J=q.low,G=(Q=e1[L-2]).high,V=Q.low,Z=(Y=e1[L-7]).high,q=Y.low,Y=(Q=e1[L-16]).high,T=(T=(($>>>1|J<<31)^($>>>8|J<<24)^$>>>7)+Z+((j=(Z=(J>>>1|$<<31)^(J>>>8|$<<24)^(J>>>7|$<<25))+q)>>>0<Z>>>0?1:0))+((G>>>19|V<<13)^(G<<3|V>>>29)^G>>>6)+((j+=J=(V>>>19|G<<13)^(V<<3|G>>>29)^(V>>>6|G<<26))>>>0<J>>>0?1:0),j+=$=Q.low,N.high=T=T+Y+(j>>>0<$>>>0?1:0),N.low=j);var q=F&W^~F&I,Z=P&O^~P&U,V=A&z^A&D^z&D,G=(H>>>28|A<<4)^(H<<30|A>>>2)^(H<<25|A>>>7),J=t1[L],Q=J.high,Y=J.low,$=X+((P>>>14|F<<18)^(P>>>18|F<<14)^(P<<23|F>>>9)),N=K+((F>>>14|P<<18)^(F>>>18|P<<14)^(F<<23|P>>>9))+($>>>0<X>>>0?1:0),J=G+(H&C^H&E^C&E),K=I,X=U,I=W,U=O,W=F,O=P,F=R+(N=(N=(N=N+q+(($=$+Z)>>>0<Z>>>0?1:0))+Q+(($=$+Y)>>>0<Y>>>0?1:0))+T+(($=$+j)>>>0<j>>>0?1:0))+((P=M+$|0)>>>0<M>>>0?1:0)|0,R=D,M=E,D=z,E=C,z=A,C=H,A=N+(((A>>>28|H<<4)^(A<<30|H>>>2)^(A<<25|H>>>7))+V+(J>>>0<G>>>0?1:0))+((H=$+J|0)>>>0<$>>>0?1:0)|0}d=i.low=d+H,i.high=f+A+(d>>>0<H>>>0?1:0),p=n.low=p+C,n.high=u+z+(p>>>0<C>>>0?1:0),y=o.low=y+E,o.high=_+D+(y>>>0<E>>>0?1:0),g=s.low=g+M,s.high=v+R+(g>>>0<M>>>0?1:0),w=c.low=w+P,c.high=B+F+(w>>>0<P>>>0?1:0),m=a.low=m+O,a.high=k+W+(m>>>0<O>>>0?1:0),x=h.low=x+U,h.high=S+I+(x>>>0<U>>>0?1:0),r=l.low=r+X,l.high=b+K+(r>>>0<X>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(128+i>>>10<<5)]=Math.floor(r/4294967296),e[31+(128+i>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(r),t.HmacSHA512=e._createHmacHelper(r)}(),P=(M=U).x64,c=P.Word,f=P.WordArray,P=M.algo,d=P.SHA512,P=P.SHA384=d.extend({_doReset:function(){this._hash=new f.init([new c.init(3418070365,3238371032),new c.init(1654270250,914150663),new c.init(2438529370,812702999),new c.init(355462360,4144912697),new c.init(1731405415,4290775857),new c.init(2394180231,1750603025),new c.init(3675008525,1694076839),new c.init(1203062813,3204075428)])},_doFinalize:function(){var t=d._doFinalize.call(this);return t.sigBytes-=16,t}}),M.SHA384=d._createHelper(P),M.HmacSHA384=d._createHmacHelper(P),function(l){var t=U,e=t.lib,f=e.WordArray,i=e.Hasher,d=t.x64.Word,e=t.algo,A=[],H=[],z=[];!function(){for(var t=1,e=0,r=0;r<24;r++){A[t+5*e]=(r+1)*(r+2)/2%64;var i=(2*t+3*e)%5;t=e%5,e=i}for(t=0;t<5;t++)for(e=0;e<5;e++)H[t+5*e]=e+(2*t+3*e)%5*5;for(var n=1,o=0;o<24;o++){for(var s,c=0,a=0,h=0;h<7;h++)1&n&&((s=(1<<h)-1)<32?a^=1<<s:c^=1<<s-32),128&n?n=n<<1^113:n<<=1;z[o]=d.create(c,a)}}();var C=[];!function(){for(var t=0;t<25;t++)C[t]=d.create()}();e=e.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new d.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var r=this._state,i=this.blockSize/2,n=0;n<i;n++){var o=t[e+2*n],s=t[e+2*n+1],o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);(m=r[n]).high^=s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),m.low^=o}for(var c=0;c<24;c++){for(var a=0;a<5;a++){for(var h=0,l=0,f=0;f<5;f++)h^=(m=r[a+5*f]).high,l^=m.low;var d=C[a];d.high=h,d.low=l}for(a=0;a<5;a++)for(var u=C[(a+4)%5],p=C[(a+1)%5],_=p.high,p=p.low,h=u.high^(_<<1|p>>>31),l=u.low^(p<<1|_>>>31),f=0;f<5;f++)(m=r[a+5*f]).high^=h,m.low^=l;for(var y=1;y<25;y++){var v=(m=r[y]).high,g=m.low,B=A[y];l=B<32?(h=v<<B|g>>>32-B,g<<B|v>>>32-B):(h=g<<B-32|v>>>64-B,v<<B-32|g>>>64-B);B=C[H[y]];B.high=h,B.low=l}var w=C[0],k=r[0];w.high=k.high,w.low=k.low;for(a=0;a<5;a++)for(f=0;f<5;f++){var m=r[y=a+5*f],S=C[y],x=C[(a+1)%5+5*f],b=C[(a+2)%5+5*f];m.high=S.high^~x.high&b.high,m.low=S.low^~x.low&b.low}m=r[0],k=z[c];m.high^=k.high,m.low^=k.low}},_doFinalize:function(){var t=this._data,e=t.words,r=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;e[r>>>5]|=1<<24-r%32,e[(l.ceil((1+r)/i)*i>>>5)-1]|=128,t.sigBytes=4*e.length,this._process();for(var n=this._state,e=this.cfg.outputLength/8,o=e/8,s=[],c=0;c<o;c++){var a=n[c],h=a.high,a=a.low,h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8);s.push(a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)),s.push(h)}return new f.init(s,e)},clone:function(){for(var t=i.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});t.SHA3=i._createHelper(e),t.HmacSHA3=i._createHmacHelper(e)}(Math),Math,F=(w=U).lib,u=F.WordArray,p=F.Hasher,F=w.algo,S=u.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),x=u.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),b=u.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),A=u.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),H=u.create([0,1518500249,1859775393,2400959708,2840853838]),z=u.create([1352829926,1548603684,1836072691,2053994217,0]),F=F.RIPEMD160=p.extend({_doReset:function(){this._hash=u.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}for(var o,s,c,a,h,l,f=this._hash.words,d=H.words,u=z.words,p=S.words,_=x.words,y=b.words,v=A.words,g=o=f[0],B=s=f[1],w=c=f[2],k=a=f[3],m=h=f[4],r=0;r<80;r+=1)l=o+t[e+p[r]]|0,l+=r<16?(s^c^a)+d[0]:r<32?K(s,c,a)+d[1]:r<48?((s|~c)^a)+d[2]:r<64?X(s,c,a)+d[3]:(s^(c|~a))+d[4],l=(l=L(l|=0,y[r]))+h|0,o=h,h=a,a=L(c,10),c=s,s=l,l=g+t[e+_[r]]|0,l+=r<16?(B^(w|~k))+u[0]:r<32?X(B,w,k)+u[1]:r<48?((B|~w)^k)+u[2]:r<64?K(B,w,k)+u[3]:(B^w^k)+u[4],l=(l=L(l|=0,v[r]))+m|0,g=m,m=k,k=L(w,10),w=B,B=l;l=f[1]+c+k|0,f[1]=f[2]+a+m|0,f[2]=f[3]+h+g|0,f[3]=f[4]+o+B|0,f[4]=f[0]+s+w|0,f[0]=l},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(64+i>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var e=this._hash,n=e.words,o=0;o<5;o++){var s=n[o];n[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return e},clone:function(){var t=p.clone.call(this);return t._hash=this._hash.clone(),t}}),w.RIPEMD160=p._createHelper(F),w.HmacRIPEMD160=p._createHmacHelper(F),P=(M=U).lib.Base,_=M.enc.Utf8,M.algo.HMAC=P.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=_.parse(e));var r=t.blockSize,i=4*r;(e=e.sigBytes>i?t.finalize(e):e).clamp();for(var t=this._oKey=e.clone(),e=this._iKey=e.clone(),n=t.words,o=e.words,s=0;s<r;s++)n[s]^=1549556828,o[s]^=909522486;t.sigBytes=e.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,t=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(t))}}),F=(w=U).lib,M=F.Base,v=F.WordArray,P=w.algo,F=P.SHA1,g=P.HMAC,y=P.PBKDF2=M.extend({cfg:M.extend({keySize:4,hasher:F,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,i=g.create(r.hasher,t),n=v.create(),o=v.create([1]),s=n.words,c=o.words,a=r.keySize,h=r.iterations;s.length<a;){var l=i.update(e).finalize(o);i.reset();for(var f=l.words,d=f.length,u=l,p=1;p<h;p++){u=i.finalize(u),i.reset();for(var _=u.words,y=0;y<d;y++)f[y]^=_[y]}n.concat(l),c[0]++}return n.sigBytes=4*a,n}}),w.PBKDF2=function(t,e,r){return y.create(r).compute(t,e)},M=(P=U).lib,F=M.Base,B=M.WordArray,w=P.algo,M=w.MD5,k=w.EvpKDF=F.extend({cfg:F.extend({keySize:4,hasher:M,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,i=this.cfg,n=i.hasher.create(),o=B.create(),s=o.words,c=i.keySize,a=i.iterations;s.length<c;){r&&n.update(r),r=n.update(t).finalize(e),n.reset();for(var h=1;h<a;h++)r=n.finalize(r),n.reset();o.concat(r)}return o.sigBytes=4*c,o}}),P.EvpKDF=function(t,e,r){return k.create(r).compute(t,e)},U.lib.Cipher||function(){var t=U,e=t.lib,r=e.Base,s=e.WordArray,i=e.BufferedBlockAlgorithm,n=t.enc,o=(n.Utf8,n.Base64),c=t.algo.EvpKDF,a=e.Cipher=i.extend({cfg:r.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(i){return{encrypt:function(t,e,r){return h(e).encrypt(i,t,e,r)},decrypt:function(t,e,r){return h(e).decrypt(i,t,e,r)}}}});function h(t){return"string"==typeof t?p:u}e.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=t.mode={},n=e.BlockCipherMode=r.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),n=l.CBC=((l=n.extend()).Encryptor=l.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize;f.call(this,t,e,i),r.encryptBlock(t,e),this._prevBlock=t.slice(e,e+i)}}),l.Decryptor=l.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=t.slice(e,e+i);r.decryptBlock(t,e),f.call(this,t,e,i),this._prevBlock=n}}),l);function f(t,e,r){var i,n=this._iv;n?(i=n,this._iv=void 0):i=this._prevBlock;for(var o=0;o<r;o++)t[e+o]^=i[o]}var l=(t.pad={}).Pkcs7={pad:function(t,e){for(var e=4*e,r=e-t.sigBytes%e,i=r<<24|r<<16|r<<8|r,n=[],o=0;o<r;o+=4)n.push(i);e=s.create(n,r);t.concat(e)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},d=(e.BlockCipher=a.extend({cfg:a.cfg.extend({mode:n,padding:l}),reset:function(){var t;a.reset.call(this);var e=this.cfg,r=e.iv,e=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=e.createEncryptor:(t=e.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(e,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),e.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),l=(t.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,t=t.salt,e=t?s.create([1398893684,1701076831]).concat(t).concat(e):e;return e.toString(o)},parse:function(t){var e,r=o.parse(t),t=r.words;return 1398893684==t[0]&&1701076831==t[1]&&(e=s.create(t.slice(2,4)),t.splice(0,4),r.sigBytes-=16),d.create({ciphertext:r,salt:e})}},u=e.SerializableCipher=r.extend({cfg:r.extend({format:l}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),e=n.finalize(e),n=n.cfg;return d.create({ciphertext:e,key:r,iv:n.iv,algorithm:t,mode:n.mode,padding:n.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),t=(t.kdf={}).OpenSSL={execute:function(t,e,r,i){i=i||s.random(8);t=c.create({keySize:e+r}).compute(t,i),r=s.create(t.words.slice(e),4*r);return t.sigBytes=4*e,d.create({key:t,iv:r,salt:i})}},p=e.PasswordBasedCipher=u.extend({cfg:u.cfg.extend({kdf:t}),encrypt:function(t,e,r,i){r=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize);i.iv=r.iv;i=u.encrypt.call(this,t,e,r.key,i);return i.mixIn(r),i},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);r=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=r.iv,u.decrypt.call(this,t,e,r.key,i)}})}(),U.mode.CFB=((F=U.lib.BlockCipherMode.extend()).Encryptor=F.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize;j.call(this,t,e,i,r),this._prevBlock=t.slice(e,e+i)}}),F.Decryptor=F.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=t.slice(e,e+i);j.call(this,t,e,i,r),this._prevBlock=n}}),F),U.mode.CTR=(M=U.lib.BlockCipherMode.extend(),P=M.Encryptor=M.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0);var s=o.slice(0);r.encryptBlock(s,0),o[i-1]=o[i-1]+1|0;for(var c=0;c<i;c++)t[e+c]^=s[c]}}),M.Decryptor=P,M),U.mode.CTRGladman=(F=U.lib.BlockCipherMode.extend(),P=F.Encryptor=F.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0),0===((n=o)[0]=T(n[0]))&&(n[1]=T(n[1]));var s=o.slice(0);r.encryptBlock(s,0);for(var c=0;c<i;c++)t[e+c]^=s[c]}}),F.Decryptor=P,F),U.mode.OFB=(M=U.lib.BlockCipherMode.extend(),P=M.Encryptor=M.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._keystream;n&&(o=this._keystream=n.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var s=0;s<i;s++)t[e+s]^=o[s]}}),M.Decryptor=P,M),U.mode.ECB=((F=U.lib.BlockCipherMode.extend()).Encryptor=F.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),F.Decryptor=F.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),F),U.pad.AnsiX923={pad:function(t,e){var r=t.sigBytes,e=4*e,e=e-r%e,r=r+e-1;t.clamp(),t.words[r>>>2]|=e<<24-r%4*8,t.sigBytes+=e},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},U.pad.Iso10126={pad:function(t,e){e*=4,e-=t.sigBytes%e;t.concat(U.lib.WordArray.random(e-1)).concat(U.lib.WordArray.create([e<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},U.pad.Iso97971={pad:function(t,e){t.concat(U.lib.WordArray.create([2147483648],1)),U.pad.ZeroPadding.pad(t,e)},unpad:function(t){U.pad.ZeroPadding.unpad(t),t.sigBytes--}},U.pad.ZeroPadding={pad:function(t,e){e*=4;t.clamp(),t.sigBytes+=e-(t.sigBytes%e||e)},unpad:function(t){for(var e=t.words,r=t.sigBytes-1,r=t.sigBytes-1;0<=r;r--)if(e[r>>>2]>>>24-r%4*8&255){t.sigBytes=r+1;break}}},U.pad.NoPadding={pad:function(){},unpad:function(){}},m=(P=U).lib.CipherParams,C=P.enc.Hex,P.format.Hex={stringify:function(t){return t.ciphertext.toString(C)},parse:function(t){t=C.parse(t);return m.create({ciphertext:t})}},function(){var t=U,e=t.lib.BlockCipher,r=t.algo,h=[],l=[],f=[],d=[],u=[],p=[],_=[],y=[],v=[],g=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=0,i=0,e=0;e<256;e++){var n=i^i<<1^i<<2^i<<3^i<<4;h[r]=n=n>>>8^255&n^99;var o=t[l[n]=r],s=t[o],c=t[s],a=257*t[n]^16843008*n;f[r]=a<<24|a>>>8,d[r]=a<<16|a>>>16,u[r]=a<<8|a>>>24,p[r]=a,_[n]=(a=16843009*c^65537*s^257*o^16843008*r)<<24|a>>>8,y[n]=a<<16|a>>>16,v[n]=a<<8|a>>>24,g[n]=a,r?(r=o^t[t[t[c^o]]],i^=t[t[i]]):r=i=1}}();var B=[0,1,2,4,8,16,32,64,128,27,54],r=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,i=4*(1+(this._nRounds=6+r)),n=this._keySchedule=[],o=0;o<i;o++)o<r?n[o]=e[o]:(a=n[o-1],o%r?6<r&&o%r==4&&(a=h[a>>>24]<<24|h[a>>>16&255]<<16|h[a>>>8&255]<<8|h[255&a]):(a=h[(a=a<<8|a>>>24)>>>24]<<24|h[a>>>16&255]<<16|h[a>>>8&255]<<8|h[255&a],a^=B[o/r|0]<<24),n[o]=n[o-r]^a);for(var s=this._invKeySchedule=[],c=0;c<i;c++){var a,o=i-c;a=c%4?n[o]:n[o-4],s[c]=c<4||o<=4?a:_[h[a>>>24]]^y[h[a>>>16&255]]^v[h[a>>>8&255]]^g[h[255&a]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,f,d,u,p,h)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,_,y,v,g,l);r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,o,s,c){for(var a=this._nRounds,h=t[e]^r[0],l=t[e+1]^r[1],f=t[e+2]^r[2],d=t[e+3]^r[3],u=4,p=1;p<a;p++)var _=i[h>>>24]^n[l>>>16&255]^o[f>>>8&255]^s[255&d]^r[u++],y=i[l>>>24]^n[f>>>16&255]^o[d>>>8&255]^s[255&h]^r[u++],v=i[f>>>24]^n[d>>>16&255]^o[h>>>8&255]^s[255&l]^r[u++],g=i[d>>>24]^n[h>>>16&255]^o[l>>>8&255]^s[255&f]^r[u++],h=_,l=y,f=v,d=g;_=(c[h>>>24]<<24|c[l>>>16&255]<<16|c[f>>>8&255]<<8|c[255&d])^r[u++],y=(c[l>>>24]<<24|c[f>>>16&255]<<16|c[d>>>8&255]<<8|c[255&h])^r[u++],v=(c[f>>>24]<<24|c[d>>>16&255]<<16|c[h>>>8&255]<<8|c[255&l])^r[u++],g=(c[d>>>24]<<24|c[h>>>16&255]<<16|c[l>>>8&255]<<8|c[255&f])^r[u++];t[e]=_,t[e+1]=y,t[e+2]=v,t[e+3]=g},keySize:8});t.AES=e._createHelper(r)}(),function(){var t=U,e=t.lib,i=e.WordArray,r=e.BlockCipher,e=t.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],l=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],f=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d
vendor: 7,629 bytes, line 75675
75675=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],
vendor: 5,989 bytes, lines 75675-75710
75675u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],n=e.DES=r.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var i=h[r]-1;e[r]=t[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],o=0;o<16;o++){for(var s=n[o]=[],c=f[o],r=0;r<24;r++)s[r/6|0]|=e[(l[r]-1+c)%28]<<31-r%6,s[4+(r/6|0)]|=e[28+(l[r+24]-1+c)%28]<<31-r%6;s[0]=s[0]<<1|s[0]>>>31;for(r=1;r<7;r++)s[r]=s[r]>>>4*(r-1)+3;s[7]=s[7]<<5|s[7]>>>27}for(var a=this._invSubKeys=[],r=0;r<16;r++)a[r]=n[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],p.call(this,4,252645135),p.call(this,16,65535),_.call(this,2,858993459),_.call(this,8,16711935),p.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],o=this._lBlock,s=this._rBlock,c=0,a=0;a<8;a++)c|=d[a][((s^n[a])&u[a])>>>0];this._lBlock=s,this._rBlock=o^c}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,p.call(this,1,1431655765),_.call(this,8,16711935),_.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(t,e){e=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=e,this._lBlock^=e<<t}function _(t,e){e=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=e,this._rBlock^=e<<t}t.DES=r._createHelper(n);e=e.TripleDES=r.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),r=t.length<4?t.slice(0,2):t.slice(2,4),t=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=n.createEncryptor(i.create(e)),this._des2=n.createEncryptor(i.create(r)),this._des3=n.createEncryptor(i.create(t))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=r._createHelper(e)}(),function(){var t=U,e=t.lib.StreamCipher,r=t.algo,i=r.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,i=this._S=[],n=0;n<256;n++)i[n]=n;for(var n=0,o=0;n<256;n++){var s=n%r,s=e[s>>>2]>>>24-s%4*8&255,o=(o+i[n]+s)%256,s=i[n];i[n]=i[o],i[o]=s}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=n.call(this)},keySize:8,ivSize:0});function n(){for(var t=this._S,e=this._i,r=this._j,i=0,n=0;n<4;n++){var r=(r+t[e=(e+1)%256])%256,o=t[e];t[e]=t[r],t[r]=o,i|=t[(t[e]+t[r])%256]<<24-8*n}return this._i=e,this._j=r,i}t.RC4=e._createHelper(i);r=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;0<t;t--)n.call(this)}});t.RC4Drop=e._createHelper(r)}(),F=(M=U).lib.StreamCipher,P=M.algo,D=[],E=[],R=[],P=P.Rabbit=F.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);for(var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]],r=this._b=0;r<4;r++)N.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(e){var o=e.words,s=o[0],c=o[1],e=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),o=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),s=e>>>16|4294901760&o,c=o<<16|65535&e;n[0]^=e,n[1]^=s,n[2]^=o,n[3]^=c,n[4]^=e,n[5]^=s,n[6]^=o,n[7]^=c;for(r=0;r<4;r++)N.call(this)}},_doProcessBlock:function(t,e){var r=this._X;N.call(this),D[0]=r[0]^r[5]>>>16^r[3]<<16,D[1]=r[2]^r[7]>>>16^r[5]<<16,D[2]=r[4]^r[1]>>>16^r[7]<<16,D[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)D[i]=16711935&(D[i]<<8|D[i]>>>24)|4278255360&(D[i]<<24|D[i]>>>8),t[e+i]^=D[i]},blockSize:4,ivSize:2}),M.Rabbit=F._createHelper(P),F=(M=U).lib.StreamCipher,P=M.algo,W=[],O=[],I=[],P=P.RabbitLegacy=F.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]],n=this._b=0;n<4;n++)q.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,s=o[0],t=o[1],e=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),o=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8),s=e>>>16|4294901760&o,t=o<<16|65535&e;i[0]^=e,i[1]^=s,i[2]^=o,i[3]^=t,i[4]^=e,i[5]^=s,i[6]^=o,i[7]^=t;for(n=0;n<4;n++)q.call(this)}},_doProcessBlock:function(t,e){var r=this._X;q.call(this),W[0]=r[0]^r[5]>>>16^r[3]<<16,W[1]=r[2]^r[7]>>>16^r[5]<<16,W[2]=r[4]^r[1]>>>16^r[7]<<16,W[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)W[i]=16711935&(W[i]<<8|W[i]>>>24)|4278255360&(W[i]<<24|W[i]>>>8),t[e+i]^=W[i]},blockSize:4,ivSize:2}),M.RabbitLegacy=F._createHelper(P),U}); 75676 75677 75678let encryptionJS = function() { 75679 75680 this.keySize = 256; 75681 this.ivSize = 128; 75682 this.iterationCount = 1989; 75683 75684} 75685 75686 encryptionJS.prototype.getkeySize = function() { 75687 return this.keySize; 75688 } 75689 75690 encryptionJS.prototype.setkeySize = function(value) { 75691 this.keySize = value; 75692 } 75693 75694 encryptionJS.prototype.getiterationCount = function() { 75695 return this.iterationCount; 75696 } 75697 75698 encryptionJS.prototype.setiterationCount = function(value) { 75699 this.iterationCount = value; 75700 } 75701 75702 encryptionJS.prototype.generateKey = function(salt, passPhrase) { 75703 return CryptoJS.PBKDF2(passPhrase, CryptoJS.enc.Hex.parse(salt), { 75704 keySize: this.keySize / 32, 75705 iterations: this.iterationCount 75706 }) 75707 } 75708 75709 encryptionJS.prototype.encryptWithIvSalt = function(salt, iv, passPhrase, plainText) { 75710 let key = this.generateKey(salt, passPhrase);
75711 let encrypted = CryptoJS.AES.encrypt(plainText, key, { 75712 iv: CryptoJS.enc.Hex.parse(iv) 75713 }); 75714 return encrypted.ciphertext.toString(CryptoJS.enc.Base64); 75715 } 75716 75717 encryptionJS.prototype.decryptWithIvSalt = function(salt, iv, passPhrase, cipherText) { 75718 let key = this.generateKey(salt, passPhrase); 75719 let cipherParams = CryptoJS.lib.CipherParams.create({ 75720 ciphertext: CryptoJS.enc.Base64.parse(cipherText) 75721 }); 75722 let decrypted = CryptoJS.AES.decrypt(cipherParams, key, { 75723 iv: CryptoJS.enc.Hex.parse(iv) 75724 }); 75725 return decrypted.toString(CryptoJS.enc.Utf8); 75726 } 75727 75728 encryptionJS.prototype.encrypt = function(passPhrase, plainText) { 75729 let iv = CryptoJS.lib.WordArray.random(this.ivSize / 8).toString(CryptoJS.enc.Hex); 75730 let salt = CryptoJS.lib.WordArray.random(this.keySize / 8).toString(CryptoJS.enc.Hex); 75731 let ciphertext = this.encryptWithIvSalt(salt, iv, passPhrase, plainText); 75732 return salt + iv + ciphertext; 75733 } 75734 75735 encryptionJS.prototype.decrypt = function(passPhrase, cipherText) { 75736 let ivLength = this.ivSize / 4; 75737 let saltLength = this.keySize / 4; 75738 let salt = cipherText.substr(0, saltLength); 75739 let iv = cipherText.substr(saltLength, ivLength); 75740 let encrypted = cipherText.substring(ivLength + saltLength); 75741 return this.decryptWithIvSalt(salt, iv, passPhrase, encrypted); 75742 } 75743 75744 let eJsObj = new encryptionJS(); 75745 75746//} 75747 75748//const aesUtil = new AESUtil(); 75749 75750//let encrypted = eJsObj.encrypt("mypassword123", "plain text"); 75751//console.log("Encryted text>> ::", encrypted) 75752//let decrypted = eJsObj.decrypt("mypassword123", encrypted); 75753//console.log("Decryted text>> ::", decrypted) 75754
vendor: 63,051 bytes, lines 75755-75767
75755/*! 75756 75757JSZip v3.10.1 - A JavaScript class for generating and reading zip files 75758<http://stuartk.com/jszip> 75759 75760(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com> 75761Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. 75762 75763JSZip uses the library pako released under the MIT license : 75764https://github.com/nodeca/pako/blob/main/LICENSE 75765*/ 75766 75767!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=e()}}(function(){return function s(a,o,h){function u(r,e){if(!o[r]){if(!a[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(l)return l(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var i=o[r]={exports:{}};a[r][0].call(i.exports,function(e){var t=a[r][1][e];return u(t||e)},i,i.exports,s,a,o,h)}return o[r].exports}for(var l="function"==typeof require&&require,e=0;e<h.length;e++)u(h[e]);return u}({1:[function(e,t,r){"use strict";var d=e("./utils"),c=e("./support"),p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,n,i,s,a,o,h=[],u=0,l=e.length,f=l,c="string"!==d.getTypeOf(e);u<e.length;)f=l-u,n=c?(t=e[u++],r=u<l?e[u++]:0,u<l?e[u++]:0):(t=e.charCodeAt(u++),r=u<l?e.charCodeAt(u++):0,u<l?e.charCodeAt(u++):0),i=t>>2,s=(3&t)<<4|r>>4,a=1<f?(15&r)<<2|n>>6:64,o=2<f?63&n:64,h.push(p.charAt(i)+p.charAt(s)+p.charAt(a)+p.charAt(o));return h.join("")},r.decode=function(e){var t,r,n,i,s,a,o=0,h=0,u="data:";if(e.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var l,f=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===p.charAt(64)&&f--,e.charAt(e.length-2)===p.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(l=c.uint8array?new Uint8Array(0|f):new Array(0|f);o<e.length;)t=p.indexOf(e.charAt(o++))<<2|(i=p.indexOf(e.charAt(o++)))>>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(o++)))>>2,n=(3&s)<<6|(a=p.indexOf(e.charAt(o++))),l[h++]=t,64!==s&&(l[h++]=r),64!==a&&(l[h++]=n);return l}},{"./support":30,"./utils":32}],2:[function(e,t,r){"use strict";var n=e("./external"),i=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){"use strict";var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){"use strict";var n=e("./utils");var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^i[255&(e^t[a])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^i[255&(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){"use strict";var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),s=e("./utils"),a=e("./stream/GenericWorker"),o=n?"uint8array":"array";function h(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",s.inherits(h,a),h.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,e.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(e){return new h("Deflate",e)},r.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){"use strict";function A(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function n(e,t,r,n,i,s){var a,o,h=e.file,u=e.compression,l=s!==O.utf8encode,f=I.transformTo("string",s(h.name)),c=I.transformTo("string",O.utf8encode(h.name)),d=h.comment,p=I.transformTo("string",s(d)),m=I.transformTo("string",O.utf8encode(d)),_=c.length!==h.name.length,g=m.length!==d.length,b="",v="",y="",w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),l||!_&&!g||(S|=2048);var z=0,C=0;w&&(z|=16),"UNIX"===i?(C=798,z|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,w)):(C=20,z|=function(e){return 63&(e||0)}(h.dosPermissions)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v=A(1,1)+A(B(f),4)+c,b+="up"+A(v.length,2)+v),g&&(y=A(1,1)+A(B(p),4)+m,b+="uc"+A(y.length,2)+y);var E="";return E+="\n\0",E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+"\0\0\0\0"+A(z,4)+A(n,4)+f+b+p}}var I=e("../utils"),i=e("../stream/GenericWorker"),O=e("../utf8"),B=e("../crc32"),R=e("../signature");function s(e,t,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(s,i),s.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},s.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=n(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},s.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=n(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return R.DATA_DESCRIPTOR+A(e.crc32,4)+A(e.compressedSize,4)+A(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},s.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,n=function(e,t,r,n,i){var s=I.transformTo("string",i(n));return R.CENTRAL_DIRECTORY_END+"\0\0\0\0"+A(e,2)+A(e,2)+A(t,4)+A(r,4)+A(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},s.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},s.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},s.prototype.error=function(e){var t=this._sources;if(!i.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},s.prototype.lock=function(){i.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=s},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){"use strict";var u=e("../compressions"),n=e("./ZipFileWorker");r.generateWorker=function(e,a,t){var o=new n(a.streamFiles,t,a.platform,a.encodeFileName),h=0;try{e.forEach(function(e,t){h++;var r=function(e,t){var r=e||t,n=u[r];if(!n)throw new Error(r+" is not a valid compression method !");return n}(t.options.compression,a.compression),n=t.options.compressionOptions||a.compressionOptions||{},i=t.dir,s=t.date;t._compressWorker(r,n).withStreamInfo("file",{name:e,dir:i,date:s,comment:t.comment||"",unixPermissions:t.unixPermissions,dosPermissions:t.dosPermissions}).pipe(o)}),o.entriesCount=h}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.10.1",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){"use strict";var u=e("./utils"),i=e("./external"),n=e("./utf8"),s=e("./zipEntries"),a=e("./stream/Crc32Probe"),l=e("./nodejsUtils");function f(n){return new i.Promise(function(e,t){var r=n.decompressed.getContentWorker().pipe(new a);r.on("error",function(e){t(e)}).on("end",function(){r.streamInfo.crc32!==n.decompressed.crc32?t(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}t.exports=function(e,o){var h=this;return o=u.extend(o||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:n.utf8decode}),l.isNode&&l.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):u.prepareContent("the loaded zip file",e,!0,o.optimizedBinaryString,o.base64).then(function(e){var t=new s(o);return t.load(e),t}).then(function(e){var t=[i.Promise.resolve(e)],r=e.files;if(o.checkCRC32)for(var n=0;n<r.length;n++)t.push(f(r[n]));return i.Promise.all(t)}).then(function(e){for(var t=e.shift(),r=t.files,n=0;n<r.length;n++){var i=r[n],s=i.fileNameStr,a=u.resolve(i.fileNameStr);h.file(a,i.decompressed,{binary:!0,optimizedBinaryString:!0,date:i.date,dir:i.dir,comment:i.fileCommentStr.length?i.fileCommentStr:null,unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions,createFolders:o.createFolders}),i.dir||(h.file(a).unsafeOriginalName=s)}return t.zipComment.length&&(h.comment=t.zipComment),h})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../stream/GenericWorker");function s(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(s,i),s.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},s.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){"use strict";var i=e("readable-stream").Readable;function n(e,t,r){i.call(this,t),this._helper=e;var n=this;e.on("data",function(e,t){n.push(e)||n._helper.pause(),r&&r(t)}).on("error",function(e){n.emit("error",e)}).on("end",function(){n.push(null)})}e("../utils").inherits(n,i),n.prototype._read=function(){this._helper.resume()},t.exports=n},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){"use strict";t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){"use strict";function s(e,t,r){var n,i=u.getTypeOf(t),s=u.extend(r||{},f);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=g(e)),s.createFolders&&(n=_(e))&&b.call(this,n,!0);var a="string"===i&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!a),(t instanceof c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string");var o=null;o=t instanceof c||t instanceof l?t:p.isNode&&p.isStream(t)?new m(e,t):u.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var h=new d(e,o,s);this.files[e]=h}var i=e("./utf8"),u=e("./utils"),l=e("./stream/GenericWorker"),a=e("./stream/StreamHelper"),f=e("./defaults"),c=e("./compressedObject"),d=e("./zipObject"),o=e("./generate"),p=e("./nodejsUtils"),m=e("./nodejs/NodejsStreamInputAdapter"),_=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},g=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},b=function(e,t){return t=void 0!==t?t:f.createFolders,e=g(e),this.files[e]||s.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function h(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var n={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(r){var n=[];return this.forEach(function(e,t){r(e,t)&&n.push(t)}),n},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,s.call(this,e,t,r),this;if(h(e)){var n=e;return this.filter(function(e,t){return!t.dir&&n.test(e)})}var i=this.files[this.root+e];return i&&!i.dir?i:null},folder:function(r){if(!r)return this;if(h(r))return this.filter(function(e,t){return t.dir&&r.test(e)});var e=this.root+r,t=b.call(this,e),n=this.clone();return n.root=t.name,n},remove:function(r){r=this.root+r;var e=this.files[r];if(e||("/"!==r.slice(-1)&&(r+="/"),e=this.files[r]),e&&!e.dir)delete this.files[r];else for(var t=this.filter(function(e,t){return t.name.slice(0,r.length)===r}),n=0;n<t.length;n++)delete this.files[t[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=u.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");u.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=o.generateWorker(this,r,n)}catch(e){(t=new l("error")).error(e)}return new a(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=n},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){"use strict";t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),s=this.length-4;0<=s;--s)if(this.data[s]===t&&this.data[s+1]===r&&this.data[s+2]===n&&this.data[s+3]===i)return s-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),s=this.readData(4);return t===s[0]&&r===s[1]&&n===s[2]&&i===s[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){"use strict";var n=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){"use strict";var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){"use strict";var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../support"),s=e("./ArrayReader"),a=e("./StringReader"),o=e("./NodeBufferReader"),h=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new h(n.transformTo("uint8array",e)):new s(n.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK��",r.CENTRAL_FILE_HEADER="PK��",r.CENTRAL_DIRECTORY_END="PK��",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK��",r.ZIP64_CENTRAL_DIRECTORY_END="PK��",r.DATA_DESCRIPTOR="PK�\b"},{}],24:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../utils");function s(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,t,r){"use strict";var h=e("../utils"),i=e("./ConvertWorker"),s=e("./GenericWorker"),u=e("../base64"),n=e("../support"),a=e("../external"),o=null;if(n.nodestream)try{o=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,o){return new a.Promise(function(t,r){var n=[],i=e._internalType,s=e._outputType,a=e._mimeType;e.on("data",function(e,t){n.push(e),o&&o(t)}).on("error",function(e){n=[],r(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return h.newBlob(h.transformTo("arraybuffer",t),r);case"base64":return u.encode(t);default:return h.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r<t.length;r++)s+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(s),r=0;r<t.length;r++)i.set(t[r],n),n+=t[r].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(i,n),a);t(e)}catch(e){r(e)}n=[]}).resume()})}function f(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=t,this._mimeType=r,h.checkSupport(n),this._worker=e.pipe(new i(n)),e.lock()}catch(e){this._worker=new s("error"),this._worker.error(e)}}f.prototype={accumulate:function(e){return l(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,function(e){t.call(r,e.data,e.meta)}):this._worker.on(e,function(){h.delay(t,arguments,r)}),this},resume:function(){return h.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(h.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new o(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer="undefined"!=typeof Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=0===new Blob([n],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=0===i.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,s){"use strict";for(var o=e("./utils"),h=e("./support"),r=e("./nodejsUtils"),n=e("./stream/GenericWorker"),u=new Array(256),i=0;i<256;i++)u[i]=252<=i?6:248<=i?5:240<=i?4:224<=i?3:192<=i?2:1;u[254]=u[254]=1;function a(){n.call(this,"utf-8 decode"),this.leftOver=null}function l(){n.call(this,"utf-8 encode")}s.utf8encode=function(e){return h.nodebuffer?r.newBufferFrom(e,"utf-8"):function(e){var t,r,n,i,s,a=e.length,o=0;for(i=0;i<a;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=h.uint8array?new Uint8Array(o):new Array(o),i=s=0;s<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[s++]=r:(r<2048?t[s++]=192|r>>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return h.nodebuffer?o.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,n,i,s=e.length,a=new Array(2*s);for(t=r=0;t<s;)if((n=e[t++])<128)a[r++]=n;else if(4<(i=u[n]))a[r++]=65533,t+=i-1;else{for(n&=2===i?31:3===i?15:7;1<i&&t<s;)n=n<<6|63&e[t++],i--;1<i?a[r++]=65533:n<65536?a[r++]=n:(n-=65536,a[r++]=55296|n>>10&1023,a[r++]=56320|1023&n)}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(e=o.transformTo(h.uint8array?"uint8array":"array",e))},o.inherits(a,n),a.prototype.processChunk=function(e){var t=o.transformTo(h.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&&(h.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=a,o.inherits(l,n),l.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,a){"use strict";var o=e("./support"),h=e("./base64"),r=e("./nodejsUtils"),u=e("./external");function n(e){return e}function l(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}e("setimmediate"),a.newBlob=function(t,r){a.checkSupport("blob");try{return new Blob([t],{type:r})}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(r)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var i={stringifyByChunk:function(e,t,r){var n=[],i=0,s=e.length;if(s<=r)return String.fromCharCode.apply(null,e);for(;i<s;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,s)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,s)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(e){return!1}}()}};function s(e){var t=65536,r=a.getTypeOf(e),n=!0;if("uint8array"===r?n=i.applyCanBeUsed.uint8array:"nodebuffer"===r&&(n=i.applyCanBeUsed.nodebuffer),n)for(;1<t;)try{return i.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return i.stringifyByChar(e)}function f(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}a.applyFromCharCode=s;var c={};c.string={string:n,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return c.string.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:function(e){return l(e,r.allocBuffer(e.length))}},c.array={string:s,array:n,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return r.newBufferFrom(e)}},c.arraybuffer={string:function(e){return s(new Uint8Array(e))},array:function(e){return f(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:n,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return r.newBufferFrom(new Uint8Array(e))}},c.uint8array={string:s,array:function(e){return f(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:n,nodebuffer:function(e){return r.newBufferFrom(e)}},c.nodebuffer={string:s,array:function(e){return f(e,new Array(e.length))},arraybuffer:function(e){return c.nodebuffer.uint8array(e).buffer},uint8array:function(e){return f(e,new Uint8Array(e.length))},nodebuffer:n},a.transformTo=function(e,t){if(t=t||"",!e)return t;a.checkSupport(e);var r=a.getTypeOf(t);return c[r][e](t)},a.resolve=function(e){for(var t=e.split("/"),r=[],n=0;n<t.length;n++){var i=t[n];"."===i||""===i&&0!==n&&n!==t.length-1||(".."===i?r.pop():r.push(i))}return r.join("/")},a.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":o.nodebuffer&&r.isBuffer(e)?"nodebuffer":o.uint8array&&e instanceof Uint8Array?"uint8array":o.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},a.checkSupport=function(e){if(!o[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},a.MAX_VALUE_16BITS=65535,a.MAX_VALUE_32BITS=-1,a.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},a.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[])})},a.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},a.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},a.prepareContent=function(r,e,n,i,s){return u.Promise.resolve(e).then(function(n){return o.blob&&(n instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(n)))&&"undefined"!=typeof FileReader?new u.Promise(function(t,r){var e=new FileReader;e.onload=function(e){t(e.target.result)},e.onerror=function(e){r(e.target.error)},e.readAsArrayBuffer(n)}):n}).then(function(e){var t=a.getTypeOf(e);return t?("arraybuffer"===t?e=a.transformTo("uint8array",e):"string"===t&&(s?e=h.decode(e):n&&!0!==i&&(e=function(e){return l(e,o.uint8array?new Uint8Array(e.length):new Array(e.length))}(e))),e):u.Promise.reject(new Error("Can't read the data of '"+r+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),s=e("./signature"),a=e("./zipEntry"),o=e("./support");function h(e){this.files=[],this.loadOptions=e}h.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=o.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(e<0)throw!this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(e);var t=e;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,s.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),s=e("./utils"),i=e("./compressedObject"),a=e("./crc32"),o=e("./utf8"),h=e("./compressions"),u=e("./support");function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in h)if(Object.prototype.hasOwnProperty.call(h,t)&&h[t].magic===e)return h[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=s.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var i=s.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)?null:a(this.fileName)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)?null:a(this.fileComment)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null}},t.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){"use strict";function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var s=e("./stream/StreamHelper"),i=e("./stream/DataWorker"),a=e("./utf8"),o=e("./compressedObject"),h=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var i=!this._dataBinary;i&&!n&&(t=t.pipe(new a.Utf8EncodeWorker)),!i&&n&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new h("error")).error(e)}return new s(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof o&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof h?this._data:new i(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<u.length;f++)n.prototype[u[f]]=l;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,l,t){(function(t){"use strict";var r,n,e=t.MutationObserver||t.WebKitMutationObserver;if(e){var i=0,s=new e(u),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){u(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(u,0)};else{var o=new t.MessageChannel;o.port1.onmessage=u,r=function(){o.port2.postMessage(0)}}var h=[];function u(){var e,t;n=!0;for(var r=h.length;r;){for(t=h,h=[],e=-1;++e<r;)t[e]();r=h.length}n=!1}l.exports=function(e){1!==h.push(e)||n||r()}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){"use strict";var i=e("immediate");function u(){}var l={},s=["REJECTED"],a=["FULFILLED"],n=["PENDING"];function o(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=n,this.queue=[],this.outcome=void 0,e!==u&&d(this,e)}function h(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(t,r,n){i(function(){var e;try{e=r(n)}catch(e){return l.reject(t,e)}e===t?l.reject(t,new TypeError("Cannot resolve promise with itself")):l.resolve(t,e)})}function c(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,l.reject(t,e))}function i(e){r||(r=!0,l.resolve(t,e))}var s=p(function(){e(i,n)});"error"===s.status&&n(s.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=o).prototype.finally=function(t){if("function"!=typeof t)return this;var r=this.constructor;return this.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})})},o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var r=new this.constructor(u);this.state!==n?f(r,this.state===a?e:t,this.outcome):this.queue.push(new h(r,e,t));return r},h.prototype.callFulfilled=function(e){l.resolve(this.promise,e)},h.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)},h.prototype.callRejected=function(e){l.reject(this.promise,e)},h.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)},l.resolve=function(e,t){var r=p(c,t);if("error"===r.status)return l.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},l.reject=function(e,t){e.state=s,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},o.resolve=function(e){if(e instanceof this)return e;return l.resolve(new this(u),e)},o.reject=function(e){var t=new this(u);return l.reject(t,e)},o.all=function(e){var r=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);var s=new Array(n),a=0,t=-1,o=new this(u);for(;++t<n;)h(e[t],t);return o;function h(e,t){r.resolve(e).then(function(e){s[t]=e,++a!==n||i||(i=!0,l.resolve(o,s))},function(e){i||(i=!0,l.reject(o,e))})}},o.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);var i=-1,s=new this(u);for(;++i<r;)a=e[i],t.resolve(a).then(function(e){n||(n=!0,l.resolve(s,e))},function(e){n||(n=!0,l.reject(s,e))});var a;return s}},{immediate:36}],38:[function(e,t,r){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){"use strict";var a=e("./zlib/deflate"),o=e("./utils/common"),h=e("./utils/strings"),i=e("./zlib/messages"),s=e("./zlib/zstream"),u=Object.prototype.toString,l=0,f=-1,c=0,d=8;function p(e){if(!(this instanceof p))return new p(e);this.options=o.assign({level:f,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==l)throw new Error(i[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?h.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,n))!==l)throw new Error(i[r]);this._dict_set=!0}}function n(e,t){var r=new p(t);if(r.push(e,!0),r.err)throw r.msg||i[r.err];return r.result}p.prototype.push=function(e,t){var r,n,i=this.strm,s=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=h.string2buf(e):"[object ArrayBuffer]"===u.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new o.Buf8(s),i.next_out=0,i.avail_out=s),1!==(r=a.deflate(i,n))&&r!==l)return this.onEnd(r),!(this.ended=!0);0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(h.buf2binstring(o.shrinkBuf(i.output,i.next_out))):this.onData(o.shrinkBuf(i.output,i.next_out)))}while((0<i.avail_in||0===i.avail_out)&&1!==r);return 4===n?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===l):2!==n||(this.onEnd(l),!(i.avail_out=0))},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=p,r.deflate=n,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,n(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,n(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){"use strict";var c=e("./zlib/inflate"),d=e("./utils/common"),p=e("./utils/strings"),m=e("./zlib/constants"),n=e("./zlib/messages"),i=e("./zlib/zstream"),s=e("./zlib/gzheader"),_=Object.prototype.toString;function a(e){if(!(this instanceof a))return new a(e);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new i,this.strm.avail_out=0;var r=c.inflateInit2(this.strm,t.windowBits);if(r!==m.Z_OK)throw new Error(n[r]);this.header=new s,c.inflateGetHeader(this.strm,this.header)}function o(e,t){var r=new a(t);if(r.push(e,!0),r.err)throw r.msg||n[r.err];return r.result}a.prototype.push=function(e,t){var r,n,i,s,a,o,h=this.strm,u=this.options.chunkSize,l=this.options.dictionary,f=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?m.Z_FINISH:m.Z_NO_FLUSH,"string"==typeof e?h.input=p.binstring2buf(e):"[object ArrayBuffer]"===_.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new d.Buf8(u),h.next_out=0,h.avail_out=u),(r=c.inflate(h,m.Z_NO_FLUSH))===m.Z_NEED_DICT&&l&&(o="string"==typeof l?p.string2buf(l):"[object ArrayBuffer]"===_.call(l)?new Uint8Array(l):l,r=c.inflateSetDictionary(this.strm,o)),r===m.Z_BUF_ERROR&&!0===f&&(r=m.Z_OK,f=!1),r!==m.Z_STREAM_END&&r!==m.Z_OK)return this.onEnd(r),!(this.ended=!0);h.next_out&&(0!==h.avail_out&&r!==m.Z_STREAM_END&&(0!==h.avail_in||n!==m.Z_FINISH&&n!==m.Z_SYNC_FLUSH)||("string"===this.options.to?(i=p.utf8border(h.output,h.next_out),s=h.next_out-i,a=p.buf2string(h.output,i),h.next_out=s,h.avail_out=u-s,s&&d.arraySet(h.output,h.output,i,s,0),this.onData(a)):this.onData(d.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(f=!0)}while((0<h.avail_in||0===h.avail_out)&&r!==m.Z_STREAM_END);return r===m.Z_STREAM_END&&(n=m.Z_FINISH),n===m.Z_FINISH?(r=c.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===m.Z_OK):n!==m.Z_SYNC_FLUSH||(this.onEnd(m.Z_OK),!(h.avail_out=0))},a.prototype.onData=function(e){this.chunks.push(e)},a.prototype.onEnd=function(e){e===m.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=a,r.inflate=o,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,o(e,t)},r.ungzip=o},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){var t,r,n,i,s,a;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),t=i=0,r=e.length;t<r;t++)s=e[t],a.set(s,i),i+=s.length;return a}},s={arraySet:function(e,t,r,n,i){for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,s))},r.setTyped(n)},{}],42:[function(e,t,r){"use strict";var h=e("./common"),i=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var u=new h.Buf8(256),n=0;n<256;n++)u[n]=252<=n?6:248<=n?5:240<=n?4:224<=n?3:192<=n?2:1;function l(e,t){if(t<65537&&(e.subarray&&s||!e.subarray&&i))return String.fromCharCode.apply(null,h.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}u[254]=u[254]=1,r.string2buf=function(e){var t,r,n,i,s,a=e.length,o=0;for(i=0;i<a;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=new h.Buf8(o),i=s=0;s<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[s++]=r:(r<2048?t[s++]=192|r>>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new h.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,s,a=t||e.length,o=new Array(2*a);for(r=n=0;r<a;)if((i=e[r++])<128)o[n++]=i;else if(4<(s=u[i]))o[n++]=65533,r+=s-1;else{for(i&=2===s?31:3===s?15:7;1<s&&r<a;)i=i<<6|63&e[r++],s--;1<s?o[n++]=65533:i<65536?o[n++]=i:(i-=65536,o[n++]=55296|i>>10&1023,o[n++]=56320|1023&i)}return l(o,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3<r?2e3:r;s=s+(i=i+t[n++]|0)|0,--a;);i%=65521,s%=65521}return i|s<<16|0}},{}],44:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){"use strict";var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^i[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,r){"use strict";var h,c=e("../utils/common"),u=e("./trees"),d=e("./adler32"),p=e("./crc32"),n=e("./messages"),l=0,f=4,m=0,_=-2,g=-1,b=4,i=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(e,t){return e.msg=n[t],t}function T(e){return(e<<1)-(4<e?9:0)}function D(e){for(var t=e.length;0<=--t;)e[t]=0}function F(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(c.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function N(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function U(e,t){e.pending_buf[e.pending++]=t}function P(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function L(e,t){var r,n,i=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match,h=e.strstart>e.w_size-z?e.strstart-(e.w_size-z):0,u=e.window,l=e.w_mask,f=e.prev,c=e.strstart+S,d=u[s+a-1],p=u[s+a];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(u[(r=t)+a]===p&&u[r+a-1]===d&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&s<c);if(n=S-(c-s),s=c-S,a<n){if(e.match_start=t,o<=(a=n))break;d=u[s+a-1],p=u[s+a]}}}while((t=f[t&l])>h&&0!=--i);return a<=e.lookahead?a:e.lookahead}function j(e){var t,r,n,i,s,a,o,h,u,l,f=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-z)){for(c.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=r=e.hash_size;n=e.head[--t],e.head[t]=f<=n?n-f:0,--r;);for(t=r=f;n=e.prev[--t],e.prev[t]=f<=n?n-f:0,--r;);i+=f}if(0===e.strm.avail_in)break;if(a=e.strm,o=e.window,h=e.strstart+e.lookahead,u=i,l=void 0,l=a.avail_in,u<l&&(l=u),r=0===l?0:(a.avail_in-=l,c.arraySet(o,a.input,a.next_in,l,h),1===a.state.wrap?a.adler=d(a.adler,o,l,h):2===a.state.wrap&&(a.adler=p(a.adler,o,l,h)),a.next_in+=l,a.total_in+=l,l),e.lookahead+=r,e.lookahead+e.insert>=x)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+x-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<x)););}while(e.lookahead<z&&0!==e.strm.avail_in)}function Z(e,t){for(var r,n;;){if(e.lookahead<z){if(j(e),e.lookahead<z&&t===l)return A;if(0===e.lookahead)break}if(r=0,e.lookahead>=x&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-z&&(e.match_length=L(e,r)),e.match_length>=x)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;
vendor: 6,292 bytes, line 75767
75767else n=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=e.strstart<x-1?e.strstart:x-1,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}function W(e,t){for(var r,n,i;;){if(e.lookahead<z){if(j(e),e.lookahead<z&&t===l)return A;if(0===e.lookahead)break}if(r=0,e.lookahead>=x&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=x-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-z&&(e.match_length=L(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===x&&4096<e.strstart-e.match_start)&&(e.match_length=x-1)),e.prev_length>=x&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-x,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+x-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=x-1,e.strstart++,n&&(N(e,!1),0===e.strm.avail_out))return A}else if(e.match_available){if((n=u._tr_tally(e,0,e.window[e.strstart-1]))&&N(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return A}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=u._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<x-1?e.strstart:x-1,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}function M(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new c.Buf16(2*w),this.dyn_dtree=new c.Buf16(2*(2*a+1)),this.bl_tree=new c.Buf16(2*(2*o+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new c.Buf16(k+1),this.heap=new c.Buf16(2*s+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new c.Buf16(2*s+1),D(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function G(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=i,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?C:E,e.adler=2===t.wrap?0:1,t.last_flush=l,u._tr_init(t),m):R(e,_)}function K(e){var t=G(e);return t===m&&function(e){e.window_size=2*e.w_size,D(e.head),e.max_lazy_match=h[e.level].max_lazy,e.good_match=h[e.level].good_length,e.nice_match=h[e.level].nice_length,e.max_chain_length=h[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=x-1,e.match_available=0,e.ins_h=0}(e.state),t}function Y(e,t,r,n,i,s){if(!e)return _;var a=1;if(t===g&&(t=6),n<0?(a=0,n=-n):15<n&&(a=2,n-=16),i<1||y<i||r!==v||n<8||15<n||t<0||9<t||s<0||b<s)return R(e,_);8===n&&(n=9);var o=new H;return(e.state=o).strm=e,o.wrap=a,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+x-1)/x),o.window=new c.Buf8(2*o.w_size),o.head=new c.Buf16(o.hash_size),o.prev=new c.Buf16(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new c.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=s,o.method=r,K(e)}h=[new M(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(j(e),0===e.lookahead&&t===l)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,N(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start>=e.w_size-z&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(e,t){return Y(e,t,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?_:(e.state.gzhead=t,m):_},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5<t||t<0)return e?R(e,_):_;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||666===n.status&&t!==f)return R(e,0===e.avail_out?-5:_);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===C)if(2===n.wrap)e.adler=0,U(n,31),U(n,139),U(n,8),n.gzhead?(U(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),U(n,255&n.gzhead.time),U(n,n.gzhead.time>>8&255),U(n,n.gzhead.time>>16&255),U(n,n.gzhead.time>>24&255),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(U(n,255&n.gzhead.extra.length),U(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(U(n,0),U(n,0),U(n,0),U(n,0),U(n,0),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,3),n.status=E);else{var a=v+(n.w_bits-8<<4)<<8;a|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=E,P(n,a),0!==n.strstart&&(P(n,e.adler>>>16),P(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;
vendor: 28,287 bytes, line 75767
75767n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending!==n.pending_buf_size));)U(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,U(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,U(n,s)}while(0!==s);n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&F(e),n.pending+2<=n.pending_buf_size&&(U(n,255&e.adler),U(n,e.adler>>8&255),e.adler=0,n.status=E)):n.status=E),0!==n.pending){if(F(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&&T(t)<=T(r)&&t!==f)return R(e,-5);if(666===n.status&&0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==l&&666!==n.status){var o=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(j(e),0===e.lookahead)){if(t===l)return A;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=S){if(j(e),e.lookahead<=S&&t===l)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0<e.strstart&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+S;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<s);e.match_length=S-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):h[n.level].func(n,t);if(o!==O&&o!==B||(n.status=666),o===A||o===O)return 0===e.avail_out&&(n.last_flush=-1),m;if(o===I&&(1===t?u._tr_align(n):5!==t&&(u._tr_stored_block(n,0,0,!1),3===t&&(D(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),F(e),0===e.avail_out))return n.last_flush=-1,m}return t!==f?m:n.wrap<=0?1:(2===n.wrap?(U(n,255&e.adler),U(n,e.adler>>8&255),U(n,e.adler>>16&255),U(n,e.adler>>24&255),U(n,255&e.total_in),U(n,e.total_in>>8&255),U(n,e.total_in>>16&255),U(n,e.total_in>>24&255)):(P(n,e.adler>>>16),P(n,65535&e.adler)),F(e),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?m:1)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==C&&69!==t&&73!==t&&91!==t&&103!==t&&t!==E&&666!==t?R(e,_):(e.state=null,t===E?R(e,-3):m):_},r.deflateSetDictionary=function(e,t){var r,n,i,s,a,o,h,u,l=t.length;if(!e||!e.state)return _;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==C||r.lookahead)return _;for(1===s&&(e.adler=d(e.adler,t,l,0)),r.wrap=0,l>=r.w_size&&(0===s&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new c.Buf8(r.w_size),c.arraySet(u,t,l-r.w_size,r.w_size,0),t=u,l=r.w_size),a=e.avail_in,o=e.next_in,h=e.input,e.avail_in=l,e.next_in=0,e.input=t,j(r);r.lookahead>=x;){for(n=r.strstart,i=r.lookahead-(x-1);r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+x-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--i;);r.strstart=n,r.lookahead=x-1,j(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=x-1,r.match_available=0,e.next_in=o,e.input=h,e.avail_in=a,r.wrap=s,m},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,i,s,a,o,h,u,l,f,c,d,p,m,_,g,b,v,y,w,k,x,S,z,C;r=e.state,n=e.next_in,z=e.input,i=n+(e.avail_in-5),s=e.next_out,C=e.output,a=s-(t-e.avail_out),o=s+(e.avail_out-257),h=r.dmax,u=r.wsize,l=r.whave,f=r.wnext,c=r.window,d=r.hold,p=r.bits,m=r.lencode,_=r.distcode,g=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;e:do{p<15&&(d+=z[n++]<<p,p+=8,d+=z[n++]<<p,p+=8),v=m[d&g];t:for(;;){if(d>>>=y=v>>>24,p-=y,0===(y=v>>>16&255))C[s++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(d&(1<<y)-1)];continue t}if(32&y){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&v,(y&=15)&&(p<y&&(d+=z[n++]<<p,p+=8),w+=d&(1<<y)-1,d>>>=y,p-=y),p<15&&(d+=z[n++]<<p,p+=8,d+=z[n++]<<p,p+=8),v=_[d&b];r:for(;;){if(d>>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(d&(1<<y)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&v,p<(y&=15)&&(d+=z[n++]<<p,(p+=8)<y&&(d+=z[n++]<<p,p+=8)),h<(k+=d&(1<<y)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=y,p-=y,(y=s-a)<k){if(l<(y=k-y)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=c,(x=0)===f){if(x+=u-y,y<w){for(w-=y;C[s++]=c[x++],--y;);x=s-k,S=C}}else if(f<y){if(x+=u+f-y,(y-=f)<w){for(w-=y;C[s++]=c[x++],--y;);if(x=0,f<w){for(w-=y=f;C[s++]=c[x++],--y;);x=s-k,S=C}}}else if(x+=f-y,y<w){for(w-=y;C[s++]=c[x++],--y;);x=s-k,S=C}for(;2<w;)C[s++]=S[x++],C[s++]=S[x++],C[s++]=S[x++],w-=3;w&&(C[s++]=S[x++],1<w&&(C[s++]=S[x++]))}else{for(x=s-k;C[s++]=C[x++],C[s++]=C[x++],C[s++]=C[x++],2<(w-=3););w&&(C[s++]=C[x++],1<w&&(C[s++]=C[x++]))}break}}break}}while(n<i&&s<o);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=s<o?o-s+257:257-(s-o),r.hold=d,r.bits=p}},{}],49:[function(e,t,r){"use strict";var I=e("../utils/common"),O=e("./adler32"),B=e("./crc32"),R=e("./inffast"),T=e("./inftrees"),D=1,F=2,N=0,U=-2,P=1,n=852,i=592;function L(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new I.Buf32(n),t.distcode=t.distdyn=new I.Buf32(i),t.sane=1,t.back=-1,N):U}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):U}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?U:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,o(e))):U}function u(e,t){var r,n;return e?(n=new s,(e.state=n).window=null,(r=h(e,t))!==N&&(e.state=null),r):U}var l,f,c=!0;function j(e){if(c){var t;for(l=new I.Buf32(512),f=new I.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(T(D,e.lens,0,288,l,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;T(F,e.lens,0,32,f,0,e.work,{bits:5}),c=!1}e.lencode=l,e.lenbits=9,e.distcode=f,e.distbits=5}function Z(e,t,r,n){var i,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new I.Buf8(s.wsize)),n>=s.wsize?(I.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),I.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(I.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}r.inflateReset=o,r.inflateReset2=h,r.inflateResetKeep=a,r.inflateInit=function(e){return u(e,15)},r.inflateInit2=u,r.inflate=function(e,t){var r,n,i,s,a,o,h,u,l,f,c,d,p,m,_,g,b,v,y,w,k,x,S,z,C=0,E=new I.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return U;12===(r=e.state).mode&&(r.mode=13),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,f=o,c=h,x=N;e:for(;;)switch(r.mode){case P:if(0===r.wrap){r.mode=13;break}for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(2&r.wrap&&35615===u){E[r.check=0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<k,e.adler=r.check=1,r.mode=512&u?10:12,l=u=0;break;case 2:for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(r.flags=u,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.head&&(r.head.time=u),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(d=r.length)&&(d=o),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,n,s,d,k)),512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&d<o;);if(512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k)),k&&d<o;);if(512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,k)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;l<16;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(u!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}l=u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}e.adler=r.check=L(u),l=u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){u>>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}switch(r.last=1&u,l-=1,3&(u>>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,l-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(o<d&&(d=o),h<d&&(d=h),0===d)break e;I.arraySet(i,n,s,d,a),o-=d,s+=d,h-=d,a+=d,r.length-=d;break}r.mode=12;break;case 17:for(;l<14;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(r.nlen=257+(31&u),u>>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;l<3;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.lens[A[r.have++]]=7&u,u>>>=3,l-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;g=(C=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(b<16)u>>>=_,l-=_,r.lens[r.have++]=b;else{if(16===b){for(z=_+2;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(u>>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],d=3+(3&u),u>>>=2,l-=2}else if(17===b){for(z=_+3;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}l-=_,k=0,d=3+(7&(u>>>=_)),u>>>=3,l-=3}else{for(z=_+7;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}l-=_,k=0,d=11+(127&(u>>>=_)),u>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=h){e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,R(e,c),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(g&&0==(240&g)){for(v=_,y=g,w=b;g=(C=r.lencode[w+((u&(1<<v+y)-1)>>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}u>>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<<r.distbits)-1])>>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(0==(240&g)){for(v=_,y=g,w=b;g=(C=r.distcode[w+((u&(1<<v+y)-1)>>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}u>>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,64&g){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l<z;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===h)break e;if(d=c-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=a-r.offset,d=r.length;for(h<d&&(d=h),h-=d,r.length-=d;i[a++]=m[p++],--d;);0===r.length&&(r.mode=21);break;case 26:if(0===h)break e;i[a++]=r.length,h--,r.mode=21;break;case 27:if(r.wrap){for(;l<32;){if(0===o)break e;o--,u|=n[s++]<<l,l+=8}if(c-=h,e.total_out+=c,r.total+=c,c&&(e.adler=r.check=r.flags?B(r.check,i,c,a-c):O(r.check,i,c,a-c)),c=h,(r.flags?u:L(u))!==r.check){e.msg="incorrect data check",r.mode=30;break}l=u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;l<32;){if(0===o)break e;o--,u+=n[s++]<<l,l+=8}if(u!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}l=u=0}r.mode=29;case 29:x=1;break e;case 30:x=-3;break e;case 31:return-4;case 32:default:return U}return e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,(r.wsize||c!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&Z(e,e.output,e.next_out,c-e.avail_out)?(r.mode=31,-4):(f-=e.avail_in,c-=e.avail_out,e.total_in+=f,e.total_out+=c,r.total+=c,r.wrap&&c&&(e.adler=r.check=r.flags?B(r.check,i,c,e.next_out-c):O(r.check,i,c,e.next_out-c)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==f&&0===c||4===t)&&x===N&&(x=-5),x)},r.inflateEnd=function(e){if(!e||!e.state)return U;var t=e.state;return t.window&&(t.window=null),e.state=null,N},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?U:((r.head=t).done=!1,N):U},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?U:11===r.mode&&O(1,t,n,0)!==r.check?-3:Z(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,N):U},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){"use strict";var D=e("../utils/common"),F=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],N=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],U=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],P=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,n,i,s,a,o){var h,u,l,f,c,d,p,m,_,g=o.bits,b=0,v=0,y=0,w=0,k=0,x=0,S=0,z=0,C=0,E=0,A=null,I=0,O=new D.Buf16(16),B=new D.Buf16(16),R=null,T=0;for(b=0;b<=15;b++)O[b]=0;for(v=0;v<n;v++)O[t[r+v]]++;for(k=g,w=15;1<=w&&0===O[w];w--);if(w<k&&(k=w),0===w)return i[s++]=20971520,i[s++]=20971520,o.bits=1,0;for(y=1;y<w&&0===O[y];y++);for(k<y&&(k=y),b=z=1;b<=15;b++)if(z<<=1,(z-=O[b])<0)return-1;if(0<z&&(0===e||1!==w))return-1;for(B[1]=0,b=1;b<15;b++)B[b+1]=B[b]+O[b];for(v=0;v<n;v++)0!==t[r+v]&&(a[B[t[r+v]]++]=v);if(d=0===e?(A=R=a,19):1===e?(A=F,I-=257,R=N,T-=257,256):(A=U,R=P,-1),b=y,c=s,S=v=E=0,l=-1,f=(C=1<<(x=k))-1,1===e&&852<C||2===e&&592<C)return 1;for(;;){for(p=b-S,_=a[v]<d?(m=0,a[v]):a[v]>d?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<<b-S,y=u=1<<x;i[c+(E>>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<<b-1;E&h;)h>>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=t[r+a[v]]}if(k<b&&(E&f)!==l){for(0===S&&(S=k),c+=y,z=1<<(x=b-S);x+S<w&&!((z-=O[x+S])<=0);)x++,z<<=1;if(C+=1<<x,1===e&&852<C||2===e&&592<C)return 1;i[l=E&f]=k<<24|x<<16|c-s|0}}return 0!==E&&(i[c+E]=b-S<<24|64<<16|0),o.bits=k,0}},{"../utils/common":41}],51:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){"use strict";var i=e("../utils/common"),o=0,h=1;function n(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,a=29,u=256,l=u+1+a,f=30,c=19,_=2*l+1,g=15,d=16,p=7,m=256,b=16,v=17,y=18,w=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],k=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],S=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],z=new Array(2*(l+2));n(z);var C=new Array(2*f);n(C);var E=new Array(512);n(E);var A=new Array(256);n(A);var I=new Array(a);n(I);var O,B,R,T=new Array(f);function D(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function N(e){return e<256?E[e]:E[256+(e>>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function P(e,t,r){e.bi_valid>d-r?(e.bi_buf|=t<<e.bi_valid&65535,U(e,e.bi_buf),e.bi_buf=t>>d-e.bi_valid,e.bi_valid+=r-d):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function L(e,t,r){P(e,r[2*t],r[2*t+1])}function j(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function Z(e,t,r){var n,i,s=new Array(g+1),a=0;for(n=1;n<=g;n++)s[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=j(s[o]++,o))}}function W(e){var t;for(t=0;t<l;t++)e.dyn_ltree[2*t]=0;for(t=0;t<f;t++)e.dyn_dtree[2*t]=0;for(t=0;t<c;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*m]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function M(e){8<e.bi_valid?U(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function H(e,t,r,n){var i=2*t,s=2*r;return e[i]<e[s]||e[i]===e[s]&&n[t]<=n[r]}function G(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&H(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!H(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function K(e,t,r){var n,i,s,a,o=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],i=e.pending_buf[e.l_buf+o],o++,0===n?L(e,i,t):(L(e,(s=A[i])+u+1,t),0!==(a=w[s])&&P(e,i-=I[s],a),L(e,s=N(--n),r),0!==(a=k[s])&&P(e,n-=T[s],a)),o<e.last_lit;);L(e,m,t)}function Y(e,t){var r,n,i,s=t.dyn_tree,a=t.stat_desc.static_tree,o=t.stat_desc.has_stree,h=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=_,r=0;r<h;r++)0!==s[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len<2;)s[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,o&&(e.static_len-=a[2*i+1]);for(t.max_code=u,r=e.heap_len>>1;1<=r;r--)G(e,s,r);for(i=h;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,G(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,a,o,h=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=g;s++)e.bl_count[s]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<_;r++)p<(s=h[2*h[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),h[2*n+1]=s,u<n||(e.bl_count[s]++,a=0,d<=n&&(a=c[n-d]),o=h[2*n],e.opt_len+=o*(s+a),f&&(e.static_len+=o*(l[2*n+1]+a)));if(0!==m){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,m-=2}while(0<m);for(s=p;0!==s;s--)for(n=e.bl_count[s];0!==n;)u<(i=e.heap[--r])||(h[2*i+1]!==s&&(e.opt_len+=(s-h[2*i+1])*h[2*i],h[2*i+1]=s),n--)}}(e,t),Z(s,u,e.bl_count)}function X(e,t,r){var n,i,s=-1,a=t[1],o=0,h=7,u=4;for(0===a&&(h=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++o<h&&i===a||(o<u?e.bl_tree[2*i]+=o:0!==i?(i!==s&&e.bl_tree[2*i]++,e.bl_tree[2*b]++):o<=10?e.bl_tree[2*v]++:e.bl_tree[2*y]++,s=i,u=(o=0)===a?(h=138,3):i===a?(h=6,3):(h=7,4))}function V(e,t,r){var n,i,s=-1,a=t[1],o=0,h=7,u=4;for(0===a&&(h=138,u=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++o<h&&i===a)){if(o<u)for(;L(e,i,e.bl_tree),0!=--o;);else 0!==i?(i!==s&&(L(e,i,e.bl_tree),o--),L(e,b,e.bl_tree),P(e,o-3,2)):o<=10?(L(e,v,e.bl_tree),P(e,o-3,3)):(L(e,y,e.bl_tree),P(e,o-11,7));s=i,u=(o=0)===a?(h=138,3):i===a?(h=6,3):(h=7,4)}}n(T);var q=!1;function J(e,t,r,n){P(e,(s<<1)+(n?1:0),3),function(e,t,r,n){M(e),n&&(U(e,r),U(e,~r)),i.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}r._tr_init=function(e){q||(function(){var e,t,r,n,i,s=new Array(g+1);for(n=r=0;n<a-1;n++)for(I[n]=r,e=0;e<1<<w[n];e++)A[r++]=n;for(A[r-1]=n,n=i=0;n<16;n++)for(T[n]=i,e=0;e<1<<k[n];e++)E[i++]=n;for(i>>=7;n<f;n++)for(T[n]=i<<7,e=0;e<1<<k[n]-7;e++)E[256+i++]=n;for(t=0;t<=g;t++)s[t]=0;for(e=0;e<=143;)z[2*e+1]=8,e++,s[8]++;for(;e<=255;)z[2*e+1]=9,e++,s[9]++;for(;e<=279;)z[2*e+1]=7,e++,s[7]++;for(;e<=287;)z[2*e+1]=8,e++,s[8]++;for(Z(z,l+1,s),e=0;e<f;e++)C[2*e+1]=5,C[2*e]=j(e,5);O=new D(z,w,u+1,l,g),B=new D(C,k,0,f,g),R=new D(new Array(0),x,0,c,p)}(),q=!0),e.l_desc=new F(e.dyn_ltree,O),e.d_desc=new F(e.dyn_dtree,B),e.bl_desc=new F(e.bl_tree,R),e.bi_buf=0,e.bi_valid=0,W(e)},r._tr_stored_block=J,r._tr_flush_block=function(e,t,r,n){var i,s,a=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(t=32;t<u;t++)if(0!==e.dyn_ltree[2*t])return h;return o}(e)),Y(e,e.l_desc),Y(e,e.d_desc),a=function(e){var t;for(X(e,e.dyn_ltree,e.l_desc.max_code),X(e,e.dyn_dtree,e.d_desc.max_code),Y(e,e.bl_desc),t=c-1;3<=t&&0===e.bl_tree[2*S[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?J(e,t,r,n):4===e.strategy||s===i?(P(e,2+(n?1:0),3),K(e,z,C)):(P(e,4+(n?1:0),3),function(e,t,r,n){var i;for(P(e,t-257,5),P(e,r-1,5),P(e,n-4,4),i=0;i<n;i++)P(e,e.bl_tree[2*S[i]+1],3);V(e,e.dyn_ltree,t-1),V(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),K(e,e.dyn_ltree,e.dyn_dtree)),W(e),n&&M(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(A[r]+u+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){P(e,2,3),L(e,m,z),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){(function(e){!function(r,n){"use strict";if(!r.setImmediate){var i,s,t,a,o=1,h={},u=!1,l=r.document,e=Object.getPrototypeOf&&Object.getPrototypeOf(r);e=e&&e.setTimeout?e:r,i="[object process]"==={}.toString.call(r.process)?function(e){process.nextTick(function(){c(e)})}:function(){if(r.postMessage&&!r.importScripts){var e=!0,t=r.onmessage;return r.onmessage=function(){e=!1},r.postMessage("","*"),r.onmessage=t,e}}()?(a="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",d,!1):r.attachEvent("onmessage",d),function(e){r.postMessage(a+e,"*")}):r.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){c(e.data)},function(e){t.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(s=l.documentElement,function(e){var t=l.createElement("script");t.onreadystatechange=function(){c(e),t.onreadystatechange=null,s.removeChild(t),t=null},s.appendChild(t)}):function(e){setTimeout(c,0,e)},e.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var n={callback:e,args:t};return h[o]=n,i(o),o++},e.clearImmediate=f}function f(e){delete h[e]}function c(e){if(u)setTimeout(c,0,e);else{var t=h[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{f(e),u=!1}}}}function d(e){e.source===r&&"string"==typeof e.data&&0===e.data.indexOf(a)&&c(+e.data.slice(a.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)});
75767 75768!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){return function o(i,f,u){function s(n,e){if(!f[n]){if(!i[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(a)return a(n,!0);throw new Error("Cannot find module '"+n+"'")}var r=f[n]={exports:{}};i[n][0].call(r.exports,function(e){var t=i[n][1][e];return s(t||e)}
75768,r,r.exports,o,i,f,u)}return f[n].exports}for(var a="function"==typeof require&&require,e=0;e<u.length;e++)s(u[e]);return s}({1:[function(e,t,n){"use strict";var u={};function r(){try{return new window.XMLHttpRequest}catch(e){}}u._getBinaryFromXHR=function(e){return e.response||e.responseText};var s="undefined"!=typeof window&&window.ActiveXObject?function(){return r()||function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:r;u.getBinaryContent=function(t,n){var e,r,o,i;"function"==typeof(n=n||{})?(i=n,n={}):"function"==typeof n.callback&&(i=n.callback),i||"undefined"==typeof Promise?(r=function(e){i(null,e)},o=function(e){i(e,null)}):e=new Promise(function(e,t){r=e,o=t});try{var f=s();f.open("GET",t,!0),"responseType"in f&&(f.responseType="arraybuffer"),f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined"),f.onreadystatechange=function(e){if(4===f.readyState)if(200===f.status||0===f.status)try{r(u._getBinaryFromXHR(f))}catch(e){o(new Error(e))}else o(new Error("Ajax error for "+t+" : "+this.status+" "+this.statusText))},n.progress&&(f.onprogress=function(e){n.progress({path:t,originalEvent:e,percent:e.loaded/e.total*100,loaded:e.loaded,total:e.total})}),f.send()}catch(e){o(new Error(e),null)}return e},t.exports=u},{}]},{},[1])(1)}); 75769(function(a,b){if("function"==typeof define&&define.amd)define([],b);else if("undefined"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Depricated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b),e.responseType="blob",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error("could not download file")},e.send()}function d(a){var b=new XMLHttpRequest;return b.open("HEAD",a,!1),b.send(),200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");
75769b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=f.saveAs||"object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(a,b,d,e){if(e=e||open("","_blank"),e&&(e.document.title=e.document.body.innerText="downloading..."),"string"==typeof a)return c(a,b,d);var g="application/octet-stream"===a.type,h=/constructor/i.test(f.HTMLElement)||f.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||g&&h)&&"object"==typeof FileReader){var j=new FileReader;j.onloadend=function(){var a=j.result;a=i?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),e?e.location.href=a:location=a,e=null},j.readAsDataURL(a)}else{var k=f.URL||f.webkitURL,l=k.createObjectURL(a);e?e.location=l:location.href=l,e=null,setTimeout(function(){k.revokeObjectURL(l)},4E4)}};f.saveAs=a.saveAs=a,"undefined"!=typeof module&&(module.exports=a)}); 75770 75771//# sourceMappingURL=FileSaver.min.js.map 75772var rc_zip = new JSZip(); 75773 75774function rc_Download_Zip(UrlsList) { 75775 var zipFilename = "DuPont_RC_Documents.zip"; 75776 var count = 0; 75777 if(UrlsList.length > 1){ 75778 UrlsList.forEach(function(url) { 75779 var filename = url.replace(/.*\//g, ""); 75780 JSZipUtils.getBinaryContent(url, function(err, data) { 75781 if (err) { 75782 throw err; // or handle the error 75783 alert("Encountered a problem in downloading files"); 75784 } 75785 75786 rc_zip.file(filename, data, { 75787 binary: true, 75788 createFolders: true 75789 }); 75790 count++; 75791 if (count == UrlsList.length) { 75792 rc_zip.generateAsync({ 75793 type: "blob" 75794 }) 75795 .then(function(blob) { 75796 console.log("<<<<<Zip prepared>>>>>"); 75797 $(".doc-loader").removeClass('show'); 75798 saveAs(blob, zipFilename); 75799 75800 }); 75801 } 75802 }); 75803 }); 75804 }else{ 75805 75806 setTimeout(function(){ 75807 $(".doc-loader").removeClass('show'); 75808 saveAs(UrlsList[0], (UrlsList[0]).substring(UrlsList[0].lastIndexOf('/')+1, UrlsList[0].length)); 75809 },100); 75810 75811 75812 } 75813 75814}
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.