Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- function a(b) {
- return b.replace(/<.[^<>]*?>/g, " ").replace(/ | /gi, " ").replace(/[.(),;:!?%#$'"_+=\/-]*/g, "");
- }
- jQuery.validator.addMethod("maxWords", function(c, b, d) {
- return this.optional(b) || a(c).match(/\b\w+\b/g).length <= d;
- }, jQuery.validator.format("Please enter {0} words or less."));
- jQuery.validator.addMethod("minWords", function(c, b, d) {
- return this.optional(b) || a(c).match(/\b\w+\b/g).length >= d;
- }, jQuery.validator.format("Please enter at least {0} words."));
- jQuery.validator.addMethod("rangeWords", function(e, b, f) {
- var d = a(e);
- var c = /\b\w+\b/g;
- return this.optional(b) || d.match(c).length >= f[0] && d.match(c).length <= f[1];
- }, jQuery.validator.format("Please enter between {0} and {1} words."));
- })();
- jQuery.validator.addMethod("letterswithbasicpunc", function(b, a) {
- return this.optional(a) || /^[a-z\-.,()'\"\s]+$/i.test(b);
- }, "Letters or punctuation only please");
- jQuery.validator.addMethod("alphanumeric", function(b, a) {
- return this.optional(a) || /^\w+$/i.test(b);
- }, "Letters, numbers, and underscores only please");
- jQuery.validator.addMethod("lettersonly", function(b, a) {
- return this.optional(a) || /^[a-z]+$/i.test(b);
- }, "Letters only please");
- jQuery.validator.addMethod("nowhitespace", function(b, a) {
- return this.optional(a) || /^\S+$/i.test(b);
- }, "No white space please");
- jQuery.validator.addMethod("ziprange", function(b, a) {
- return this.optional(a) || /^90[2-5]\d\{2\}-\d{4}$/.test(b);
- }, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");
- jQuery.validator.addMethod("zipcodeUS", function(b, a) {
- return this.optional(a) || /\d{5}-\d{4}$|^\d{5}$/.test(b);
- }, "The specified US ZIP Code is invalid");
- jQuery.validator.addMethod("integer", function(b, a) {
- return this.optional(a) || /^-?\d+$/.test(b);
- }, "A positive or negative non-decimal number please");
- jQuery.validator.addMethod("vinUS", function(o) {
- if (o.length != 17) {
- return false;
- }
- var h, a, l, j, b, k;
- var c = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ];
- var m = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ];
- var g = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ];
- var e = 0;
- for (h = 0; h < 17; h++) {
- j = g[h];
- l = o.slice(h, h + 1);
- if (h == 8) {
- k = l;
- }
- if (!isNaN(l)) {
- l *= j;
- } else {
- for (a = 0; a < c.length; a++) {
- if (l.toUpperCase() === c[a]) {
- l = m[a];
- l *= j;
- if (isNaN(k) && a == 8) {
- k = c[a];
- }
- break;
- }
- }
- }
- e += l;
- }
- b = e % 11;
- if (b == 10) {
- b = "X";
- }
- if (b == k) {
- return true;
- }
- return false;
- }, "The specified vehicle identification number (VIN) is invalid.");
- jQuery.validator.addMethod("dateITA", function(e, c) {
- var a = false;
- var g = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
- if (g.test(e)) {
- var i = e.split("/");
- var d = parseInt(i[0], 10);
- var b = parseInt(i[1], 10);
- var f = parseInt(i[2], 10);
- var h = new Date(f, b - 1, d);
- if (h.getFullYear() == f && h.getMonth() == b - 1 && h.getDate() == d) {
- a = true;
- } else {
- a = false;
- }
- } else {
- a = false;
- }
- return this.optional(c) || a;
- }, "Please enter a correct date");
- jQuery.validator.addMethod("dateNL", function(b, a) {
- return this.optional(a) || /^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(b);
- }, "Vul hier een geldige datum in.");
- jQuery.validator.addMethod("time", function(b, a) {
- return this.optional(a) || /^([0-1]\d|2[0-3]):([0-5]\d)$/.test(b);
- }, "Please enter a valid time, between 00:00 and 23:59");
- jQuery.validator.addMethod("time12h", function(b, a) {
- return this.optional(a) || /^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$/i.test(b);
- }, "Please enter a valid time, between 00:00 am and 12:00 pm");
- jQuery.validator.addMethod("phoneUS", function(a, b) {
- a = a.replace(/\s+/g, "");
- return this.optional(b) || a.length > 9 && a.match(/^(\+?1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
- }, "Please specify a valid phone number");
- jQuery.validator.addMethod("phoneUK", function(a, b) {
- a = a.replace(/\(|\)|\s+|-/g, "");
- return this.optional(b) || a.length > 9 && a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:(?:\d{5}\)?\s?\d{4,5})|(?:\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3}))|(?:\d{3}\)?\s?\d{3}\s?\d{3,4})|(?:\d{2}\)?\s?\d{4}\s?\d{4}))$/);
- }, "Please specify a valid phone number");
- jQuery.validator.addMethod("mobileUK", function(a, b) {
- a = a.replace(/\s+|-/g, "");
- return this.optional(b) || a.length > 9 && a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[45789]\d{2}|624)\s?\d{3}\s?\d{3})$/);
- }, "Please specify a valid mobile number");
- jQuery.validator.addMethod("phonesUK", function(a, b) {
- a = a.replace(/\s+|-/g, "");
- return this.optional(b) || a.length > 9 && a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[45789]\d{8}|624\d{6})))$/);
- }, "Please specify a valid uk phone number");
- jQuery.validator.addMethod("postcodeUK", function(a, b) {
- a = a.toUpperCase().replace(/\s+/g, "");
- return this.optional(b) || a.match(/^([^QZ][^IJZ]{0,1}\d{1,2})(\d[^CIKMOV]{2})$/) || a.match(/^([^QV]\d[ABCDEFGHJKSTUW])(\d[^CIKMOV]{2})$/) || a.match(/^([^QV][^IJZ]\d[ABEHMNPRVWXY])(\d[^CIKMOV]{2})$/) || a.match(/^(GIR)(0AA)$/) || a.match(/^(BFPO)(\d{1,4})$/) || a.match(/^(BFPO)(C\/O\d{1,3})$/);
- }, "Please specify a valid postcode");
- jQuery.validator.addMethod("strippedminlength", function(b, a, c) {
- return jQuery(b).text().length >= c;
- }, jQuery.validator.format("Please enter at least {0} characters"));
- jQuery.validator.addMethod("email2", function(b, a, c) {
- return this.optional(a) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(b);
- }, jQuery.validator.messages.email);
- jQuery.validator.addMethod("url2", function(b, a, c) {
- return this.optional(a) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(b);
- }, jQuery.validator.messages.url);
- jQuery.validator.addMethod("creditcardtypes", function(b, a, c) {
- if (/[^0-9-]+/.test(b)) {
- return false;
- }
- b = b.replace(/\D/g, "");
- var d = 0;
- if (c.mastercard) {
- d |= 1;
- }
- if (c.visa) {
- d |= 2;
- }
- if (c.amex) {
- d |= 4;
- }
- if (c.dinersclub) {
- d |= 8;
- }
- if (c.enroute) {
- d |= 16;
- }
- if (c.discover) {
- d |= 32;
- }
- if (c.jcb) {
- d |= 64;
- }
- if (c.unknown) {
- d |= 128;
- }
- if (c.all) {
- d = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128;
- }
- if (d & 1 && /^(5[12345])/.test(b)) {
- return b.length == 16;
- }
- if (d & 2 && /^(4)/.test(b)) {
- return b.length == 16;
- }
- if (d & 4 && /^(3[47])/.test(b)) {
- return b.length == 15;
- }
- if (d & 8 && /^(3(0[012345]|[68]))/.test(b)) {
- return b.length == 14;
- }
- if (d & 16 && /^(2(014|149))/.test(b)) {
- return b.length == 15;
- }
- if (d & 32 && /^(6011)/.test(b)) {
- return b.length == 16;
- }
- if (d & 64 && /^(3)/.test(b)) {
- return b.length == 16;
- }
- if (d & 64 && /^(2131|1800)/.test(b)) {
- return b.length == 15;
- }
- if (d & 128) {
- return true;
- }
- return false;
- }, "Please enter a valid credit card number.");
- jQuery.validator.addMethod("ipv4", function(b, a, c) {
- return this.optional(a) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(b);
- }, "Please enter a valid IP v4 address.");
- jQuery.validator.addMethod("ipv6", function(b, a, c) {
- return this.optional(a) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(b);
- }, "Please enter a valid IP v6 address.");
- jQuery.validator.addMethod("pattern", function(b, a, c) {
- if (this.optional(a)) {
- return true;
- }
- if (typeof c === "string") {
- c = new RegExp("^(?:" + c + ")$");
- }
- return c.test(b);
- }, "Invalid format.");
- jQuery.validator.addMethod("require_from_group", function(g, f, d) {
- var e = this;
- var b = d[1];
- var c = $(b, f.form).filter(function() {
- return e.elementValue(this);
- }).length >= d[0];
- if (!$(f).data("being_validated")) {
- var a = $(b, f.form);
- a.data("being_validated", true);
- a.valid();
- a.data("being_validated", false);
- }
- return c;
- }, jQuery.format("Please fill at least {0} of these fields."));
- jQuery.validator.addMethod("skip_or_fill_minimum", function(f, d, b) {
- var c = this;
- numberRequired = b[0];
- selector = b[1];
- var g = $(selector, d.form).filter(function() {
- return c.elementValue(this);
- }).length;
- var e = g >= numberRequired || g === 0;
- if (!$(d).data("being_validated")) {
- var a = $(selector, d.form);
- a.data("being_validated", true);
- a.valid();
- a.data("being_validated", false);
- }
- return e;
- }, jQuery.format("Please either skip these fields or fill at least {0} of them."));
- jQuery.validator.addMethod("accept", function(e, c, g) {
- var f = typeof g === "string" ? g.replace(/,/g, "|") : "image/*", d = this.optional(c), b, a;
- if (d) {
- return d;
- }
- if ($(c).attr("type") === "file") {
- f = f.replace("*", ".*");
- if (c.files && c.files.length) {
- for (b = 0; b < c.files.length; b++) {
- a = c.files[b];
- if (!a.type.match(new RegExp(".?(" + f + ")$", "i"))) {
- return false;
- }
- }
- }
- }
- return true;
- }, jQuery.format("Please enter a value with a valid mimetype."));
- jQuery.validator.addMethod("extension", function(b, a, c) {
- c = typeof c === "string" ? c.replace(/,/g, "|") : "png|jpe?g|gif";
- return this.optional(a) || b.match(new RegExp(".(" + c + ")$", "i"));
- }, jQuery.format("Please enter a value with a valid extension."));
- var _gaq = _gaq || [];
- _gaq.push([ "_setAccount", sellerTracking.googleAnalyticsId ]);
- _gaq.push([ "_trackPageview" ]);
- (function() {
- var ga = document.createElement("script");
- ga.type = "text/javascript";
- ga.async = true;
- ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
- var s = document.getElementsByTagName("script")[0];
- s.parentNode.insertBefore(ga, s);
- })();
- if (window.location.hostname === "seller.flipkart.com") {
- var pageURL = window.location.href;
- window.onerror = function(message, url, linenumber) {
- if (_gaq && _gaq.push) {
- _gaq.push([ "_trackEvent", "JavascriptError on " + window.location.hostname, pageURL, message + " on line " + linenumber + " for " + url + " for sellerId " + FK.getSellerId() ]);
- }
- };
- }
- function pushToGa(category, action, label, val) {
- if (whiteListedGACategory.length === 0 || whiteListedGACategory.length > 0 && whiteListedGACategory.indexOf(category) > -1) {
- _gaq.push([ "_trackEvent", category, action, label ]);
- }
- }
- var FKSP = FKSP || {};
- FKSP.SnoopyAnalytics = function(identifier, org, channel) {
- var config;
- function track(event) {
- var oThis = this;
- if (!event.entity) throw new Error("Entity must be defined");
- if (!event.category) throw new Error("Category must be defined");
- config.event.action = !event.action ? "CLICK" : config.event.action;
- config.event.entity = event.entity;
- config.event.data_category = event.category;
- oThis.flowCounter = 0;
- if (oThis.previousPage !== _getHash()) {
- oThis.flowCounter++;
- oThis.previousPage = _getHash();
- }
- config.event.value = JSON.stringify(event.value || {});
- config.event.page_load_id = _getHash() || "Landing Page";
- config.event.event_no = String(oThis.flowCounter);
- config.event.flow_id = String(oThis.flowCounter);
- config.event.source = window.localStorage.source || "Direct";
- config.event.medium = window.localStorage.medium || null;
- config.event.term = window.localStorage.term || null;
- config.event.campaign = window.localStorage.campaign || null;
- config.timestamp = new Date().getTime();
- _callAPI(config);
- }
- function _getHash(url) {
- url = url || _getUrl();
- var oUrl = _parseUrl(url);
- return oUrl.hash;
- }
- function _getUrl(thisWindow) {
- thisWindow = thisWindow || window;
- return thisWindow.location.href;
- }
- function _parseUrl(url) {
- var a = document.createElement("a"), protocol, hostname, port;
- a.href = url;
- protocol = a.protocol || location.protocol;
- hostname = a.hostname || location.hostname;
- port = a.port || location.port;
- return {
- source: url,
- protocol: protocol.replace(":", ""),
- host: hostname,
- port: port,
- query: a.search,
- hash: a.hash.replace("#", ""),
- path: a.pathname.replace(/^([^/])/, "/$1"),
- segments: a.pathname.replace(/^\//, "").split("/"),
- params: function() {
- var params = {}, paramKeyValue, paramsKeyValue, paramsLength, paramIndex;
- paramsKeyValue = a.search.replace(/^.*\?/, "").split("&");
- paramsLength = paramsKeyValue.length;
- for (paramIndex = 0; paramIndex < paramsLength; paramIndex++) {
- if (!paramsKeyValue[paramIndex]) {
- continue;
- }
- paramKeyValue = paramsKeyValue[paramIndex].split("=");
- params[paramKeyValue[0]] = paramKeyValue[1];
- }
- return params;
- }()
- };
- }
- function _callAPI(data) {
- var xhr = new XMLHttpRequest();
- xhr.open("POST", "snoopyIngestion");
- xhr.setRequestHeader("Content-Type", "application/json; charset=UTF-8");
- xhr.send(JSON.stringify(data));
- }
- function _init() {
- if (!identifier) throw new Error("Identifier must be defined");
- config = {
- type: identifier,
- event: {
- org: !org ? "SP" : org,
- channel: !channel ? "web" : channel
- }
- };
- }
- _init();
- return {
- track: track
- };
- }(function() {
- var $continueAnyway = $("#continue-anyway"), $browserCompatibilityModal = $("#browser-compatibility"), $blackOverlay = $("#black-overlay"), $header = $("header"), isLocalStorageSupported = supports_local_storage();
- var upgradeHtml = '<div id="upgrade-browser">This browser is not supported by Flipkart Marketplace, please ' + '<a id="upgrade">upgrade</a>' + " to one of the supported browsers.</div>";
- function showModal() {
- $blackOverlay.removeClass("hide");
- $browserCompatibilityModal.removeClass("hide");
- }
- function hideModal() {
- $blackOverlay.addClass("hide");
- $browserCompatibilityModal.addClass("hide");
- }
- function removeUpgradeHeader() {
- $("#upgrade-browser").remove();
- }
- function addUpgradeHeader() {
- $header.append(upgradeHtml);
- $("#upgrade").click(function(e) {
- showModal();
- removeUpgradeHeader();
- });
- }
- function supports_local_storage() {
- try {
- return "localStorage" in window && window["localStorage"] !== null;
- } catch (e) {
- return false;
- }
- }
- $continueAnyway.click(function(e) {
- hideModal();
- addUpgradeHeader();
- $header.scrollTop(0);
- if (isLocalStorageSupported) {
- localStorage.setItem("clickedUpdateBrowser", "true");
- }
- });
- (function() {
- if (isLocalStorageSupported === true) {
- var hasClickedUpdateBrowser = localStorage.getItem("clickedUpdateBrowser");
- if (hasClickedUpdateBrowser === "true" && allowContinueIfIncompatible) {
- hideModal();
- addUpgradeHeader();
- } else {
- showModal();
- }
- } else {
- showModal();
- }
- })();
- })();
- (function(root, factory) {
- if (typeof define === "function" && define.amd) {
- define([ "$" ], factory);
- } else if (typeof exports === "object") {
- module.exports = factory(require("jquery"));
- } else {
- root.fk_omniAnalytics = factory(root.$);
- }
- })(this, function($) {
- var fk_omniAnalytics = {
- track: function(eventData, event) {
- var s = window.s || s;
- window.digitalData = window.digitalData || {};
- if (eventData) {
- $.extend(true, window.digitalData, eventData);
- }
- var isLoginPage = false;
- isLoginPage = window.digitalData && window.digitalData && window.digitalData.page && window.digitalData.page.pageName && window.digitalData.page.pageName == "seller: Login Page";
- var sellerIdOnSellerObjPresent = isLoginPage ? "" : window.seller && window.seller.sellerId;
- var sellerIdOnFkPresent = isLoginPage ? "" : window.FK && window.FK.getSellerId && window.FK.getSellerId();
- if (sellerIdOnSellerObjPresent || sellerIdOnFkPresent) {
- if (sellerIdOnSellerObjPresent) {
- $.extend(true, window.digitalData, {
- user: {
- sellerID: sellerIdOnSellerObjPresent
- }
- });
- } else if (sellerIdOnFkPresent) {
- $.extend(true, window.digitalData, {
- user: {
- sellerID: sellerIdOnFkPresent
- }
- });
- }
- }
- if (window._satellite && event) {
- if (s && typeof s.manageVars === "function") {
- s.manageVars("clearVars");
- }
- _satellite.track(event);
- }
- }
- };
- return fk_omniAnalytics;
- });
- (function() {
- var digitalData = {}, eventName;
- digitalData = {
- page: {
- pageName: "seller: Login Page",
- section: "Login Page",
- subSection: "Login Page",
- subSubSection: "Login Page",
- contentHierarchy: "Login Page"
- }
- };
- eventName = "pageload";
- window.fk_omniAnalytics.track(digitalData, eventName);
- })();
- var FK = window.FK || {};
- FK.sellerObject = {};
- FK.mainStart = FK.mainStart || new Date().getTime();
- FK.localStart = new Date().getTime();
- var monthNames = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
- var banks, bankBranches;
- FK.getTemplate = function() {
- var cache = {};
- return function(name) {
- if (typeof cache[name] === "undefined") {
- $.ajax("templates/" + name + ".jade", {
- async: false,
- success: function(data) {
- cache[name] = jade.compile(data);
- }
- });
- }
- return cache[name];
- };
- }();
- FK.addPageContent = function(data, textStatus, jqXHR) {
- "use strict";
- $("outer-tab-content").html(data);
- $("#processingContainer").hide();
- };
- FK.getSellerId = function() {
- var queryObject = FK.searchToObject();
- if (queryObject.hasOwnProperty("sellerId")) {
- this.debug(queryObject.sellerId);
- return queryObject.sellerId;
- } else {
- return $.cookie("sellerId") || "abc";
- }
- };
- FK.getSellerIdFromQuery = function() {
- return FK.searchToObject().sellerId;
- };
- FK.getSellerObjectBySellerId = function(callback) {
- $.ajax({
- type: "GET",
- cache: false,
- headers: {
- "cache-control": "no-cache",
- pragma: "no-cache"
- },
- url: "seller/" + FK.getSellerId(),
- success: function(result) {
- callback(result);
- },
- error: function(err) {
- callback(null, err);
- }
- });
- };
- FK.getCityByPincode = function(pincode, callback) {
- $.ajax("onboarding/fkl/" + encodeURIComponent(pincode) + "/get_city", {
- success: function(response) {
- if (JSON.parse(response).code === 1e3) {
- var city = JSON.parse(response).data;
- callback(city, null);
- }
- },
- error: function(error) {
- callback(null, error);
- }
- });
- };
- FK.getPincodeServiceability = function(pincode, callback) {
- $.ajax("onboarding/fkl/" + encodeURIComponent(pincode) + "/check_serviceability", {
- success: function(result) {
- callback(result, null);
- },
- error: function(error) {
- callback(null, error);
- }
- });
- };
- FK.getSellerBank = function(callback) {
- $.ajax({
- type: "GET",
- headers: {
- "cache-control": "no-cache"
- },
- url: encodeURI("seller/" + FK.getSellerId() + "/bank"),
- success: function(data) {
- callback(data);
- },
- error: function(err) {
- callback(null, err);
- }
- });
- };
- FK.getBanks = function(callback, bankName) {
- $.ajax({
- type: "GET",
- url: encodeURI("manageProfile/banks"),
- success: function(data) {
- banks = data;
- callback(data);
- FK.getStatesByBankName(bankName, setBankStatesDropdown);
- }
- });
- };
- FK.getStatesByBankName = function(bank, callback) {
- var bankId = FK.getBankId(bank);
- $.ajax({
- type: "GET",
- url: encodeURI("manageProfile/banks?bankId=" + bankId),
- success: function(data) {
- callback(data);
- if (sellerBankState) {
- FK.getCitiesByBankAndState(bank, sellerBankState, setBankCitiesDropdown);
- }
- }
- });
- };
- FK.getCitiesByBankName = function(bank, callback) {
- var bankId = FK.getBankId(bank);
- $.ajax({
- type: "GET",
- url: encodeURI("manageProfile/banks?bankId=" + bankId),
- success: function(data) {
- callback(data);
- if (sellerBankCity) {
- FK.getBankBranches(bank, sellerBankCity, setBankBranchesDropdown);
- }
- }
- });
- };
- FK.getCitiesByBankAndState = function(bank, state, callback) {
- var bankId = FK.getBankId(bank);
- $.ajax({
- type: "GET",
- url: encodeURI("manageProfile/banks?bankId=" + bankId + "&state=" + state),
- success: function(data) {
- callback(data);
- if (sellerBankCity) {
- FK.getBankBranches(bank, sellerBankCity, setBankBranchesDropdown);
- }
- }
- });
- };
- FK.getBankBranches = function(bank, city, callback) {
- var bankId = FK.getBankId(bank);
- $.ajax({
- type: "GET",
- url: encodeURI("manageProfile/banks?bankId=" + bankId + "&city=" + city),
- success: function(data) {
- bankBranches = data;
- callback(data);
- }
- });
- };
- FK.getBankId = function(bankName) {
- var i = 0, bankId;
- while (i < banks.length && !(banks[i].name === bankName)) {
- i++;
- }
- bankId = banks[i].id;
- return bankId;
- };
- FK.removeCookies = function() {
- $.removeCookie("is_login");
- $.removeCookie("sellerId");
- FK.loggedIn = false;
- };
- FK.logout = function() {
- FK.debug("LogOut Called");
- $.ajax({
- type: "GET",
- url: "logout",
- success: function(result) {
- if (result) {
- var url = "/";
- $(location).attr("href", url);
- }
- }
- });
- FK.removeCookies();
- return false;
- };
- FK.isDefined = function(v) {
- return v != null && typeof v !== "undefined";
- };
- FK.apply = function(o, c, defaults) {
- if (defaults) {
- FK.apply(o, defaults);
- }
- if (o && c && typeof c == "object") {
- for (var p in c) {
- if (FK.isDefined(c[p])) {
- o[p] = c[p];
- }
- }
- }
- return o;
- };
- FK.applyIf = function(o, c) {
- if (o) {
- for (var p in c) {
- if (!FK.isDefined(o[p])) {
- o[p] = c[p];
- }
- }
- }
- return o;
- };
- FK.extend = function(b, opts) {
- if (typeof b === "function") {
- return function(config) {
- var props = {};
- if (opts != undefined) {
- for (var key in opts) {
- if (opts.hasOwnProperty(key)) {
- props[key] = {
- value: opts[key],
- enumerable: true,
- writable: true
- };
- }
- }
- }
- var parent = new b();
- var obj = Object.create(parent, props);
- if (obj.init && typeof obj.init === "function") obj.init(config);
- return obj;
- };
- }
- return false;
- };
- FK.Bus = function() {
- var map = {};
- return {
- on: function(token, listener) {
- map[token] = listener;
- },
- fire: function(token, data) {
- map[token](data);
- }
- };
- }();
- FK.searchToObject = function() {
- var pairs = window.location.search.substring(1).split("&"), obj = {}, pair, i;
- for (i = 0; i < pairs.length; i++) {
- if (pairs[i] === "") continue;
- pair = pairs[i].split("=");
- obj[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
- }
- return obj;
- };
- FK.formToJSON = function($form) {
- if (!($form instanceof jQuery)) {
- $form = $($form);
- }
- var o = {};
- var a = $form.serializeArray();
- $.each(a, function() {
- if (o[this.name] !== undefined) {
- if (!o[this.name].push) {
- o[this.name] = [ o[this.name] ];
- }
- o[this.name].push(this.value || "");
- } else {
- o[this.name] = this.value || "";
- }
- });
- return o;
- };
- function rawurlencode(str) {
- str = (str + "").toString();
- return encodeURIComponent(str).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
- }
- FK.encodePassword = function(plainTextPassword) {
- var y = rawurlencode(plainTextPassword);
- var map = [ [ "@", "%40" ], [ "*", "%2A" ], [ "/", "%2F" ], [ "+", "%2B" ], [ "%7E", "~" ] ];
- var i;
- for (i = 0; i < map.length; i++) {
- y = y.replace(map[i][1], map[i][0]);
- }
- y = $.trim(y);
- return MD5(y);
- };
- FK.debug = function(msg) {
- if ("undefined" != typeof console) {
- console.log(msg);
- }
- };
- FK.disableSellerMenu = function() {
- $("#listings, #accountingLinkAnchor, #ordersLinkAnchor").addClass("disabled").click(function(e) {
- e.preventDefault();
- });
- $("#accountingCaret, #ordersCaret").addClass("disabled");
- };
- FK.nullLinkHandler = function(e) {
- e.preventDefault();
- };
- if (typeof String.prototype.trim !== "function") {
- String.prototype.trim = function() {
- return this.replace(/^\s+|\s+$/g, "");
- };
- }
- if (!Function.prototype.bind) {
- Function.prototype.bind = function(oThis) {
- if (typeof this !== "function") {
- throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
- }
- var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function() {}, fBound = function() {
- return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
- };
- fNOP.prototype = this.prototype;
- fBound.prototype = new fNOP();
- return fBound;
- };
- }
- FK.setUpWarnings = function() {
- var sellerChecklist = {};
- var featureConfigs = jQuery.parseJSON($("#featureConfigsDashboard").val()), bankAccountVerificationActive = featureConfigs && featureConfigs.bankAccountVerification || false;
- if (bankAccountVerificationActive) {
- $.ajax({
- type: "GET",
- headers: {
- "cache-control": "no-cache"
- },
- url: "seller/" + FK.getSellerId() + "/status?sellerId=" + FK.getSellerId(),
- success: function(data) {
- sellerChecklist = data.data.checklist;
- $.ajax({
- type: "GET",
- headers: {
- "cache-control": "no-cache"
- },
- url: "manageProfile/verification/bankAccount/transferData?sellerId=" + FK.getSellerId(),
- success: function(transferData) {
- var latestTransferData = jQuery.parseJSON(transferData);
- if (latestTransferData.content && latestTransferData.content.length > 0 && latestTransferData.content[0].disbursement_status === "SCHEDULED") {
- FK.alert.persist("Please go to your Profile and confirm your Bank Account.", "bank-info");
- } else if (latestTransferData.code == 1e3) {
- if (!(sellerChecklist.bank == "verification_success")) {
- if (latestTransferData.data && latestTransferData.data.length > 0 && latestTransferData.data[0].state == "INITIATED") {
- FK.alert.persist("Please go to your Profile and confirm your Bank Account.", "bank-info");
- }
- }
- }
- }
- });
- }
- });
- }
- };
- FK.alert = {
- _alert: function(message, classes) {
- var a = $('<div class="alert ' + classes + '" data-target="#message-area">' + '<button type="button" class="close" data-dismiss="alert">×</button>' + message + "</div>"), $messageArea = $("#message-area");
- if (a.hasClass("persistent-message")) {
- a.find(".close").remove();
- }
- if (classes.indexOf("error") != -1) {
- $messageArea.find(".alert-error").remove();
- }
- $("#message-area").append(a).show();
- a.alert().trigger("fk.alert");
- if (classes.indexOf("alert-success") > -1) {
- setTimeout(function() {
- a.alert("close");
- }, 5e3);
- }
- },
- error: function(message, helper) {
- this._alert(message, "alert-error " + helper);
- },
- success: function(message) {
- this._alert(message, "alert-success");
- },
- information: function(message) {
- this._alert(message, "alert-info");
- },
- warning: function(message) {
- "use strict";
- this._alert(message, "alert-warning");
- },
- persist: function(message, type) {
- "use strict";
- this._alert(message, "alert-warning persistent-message " + type);
- },
- remove: function(type) {
- "use strict";
- $("#message-area").find("." + type).remove();
- },
- allowLink: function(message, type) {
- "use strict";
- this._alert(message, "alert-" + type + " with-link");
- }
- };
- FK.getQueryParameterByName = function(name) {
- var match = RegExp("[?&]" + name + "=([^&]*)").exec(window.location.search);
- return match && decodeURIComponent(match[1].replace(/\+/g, " "));
- };
- FK.getUrlParameterByName = function(name) {
- var match = RegExp(name + "\\/(.+)").exec(window.location.href);
- return match && decodeURIComponent(match[1].replace(/\+/g, " "));
- };
- FK.getAllUrlParameterByName = function(name) {
- var match = RegExp(name + "\\/([a-zA-Z0-9-_]*)").exec(window.location.href);
- return match && decodeURIComponent(match[1].replace(/\+/g, " "));
- };
- FK.formatDate = function(date) {
- if (date == "-" || date == null) return;
- var date = new Date(date);
- return monthNames[date.getMonth()] + " " + date.getDate() + ", " + +date.getFullYear();
- };
- FK.activateRateCardLink = function(ordDate) {
- var activate = false;
- var limitDate = "2016-06-20";
- if (!ordDate) return activate;
- var oDate = new Date(ordDate);
- var dd = oDate.getDate();
- var mm = oDate.getMonth() + 1;
- var yyyy = oDate.getFullYear();
- dd = dd < 10 ? dd = "0" + dd : dd;
- mm = mm < 10 ? mm = "0" + mm : mm;
- var orderDate = yyyy + "-" + mm + "-" + dd;
- if (orderDate >= limitDate) {
- activate = true;
- }
- return activate;
- };
- FK.autoCommaMoneyValues = function(amount) {
- "use strict";
- if (typeof amount !== "string") {
- amount = amount.toString();
- }
- var delimiter = ",", a = amount.split(".", 2), d = a[1], i = parseInt(a[0]), minus = "", n = new String(i), nn = "";
- if (isNaN(i)) {
- return "";
- }
- if (i < 0) {
- minus = "-";
- }
- i = Math.abs(i);
- a = [];
- nn = n.substr(n.length - 3);
- a.unshift(nn);
- n = n.substr(0, n.length - 3);
- while (n.length > 2) {
- nn = n.substr(n.length - 2);
- a.unshift(nn);
- n = n.substr(0, n.length - 2);
- }
- if (n.length > 0) {
- a.unshift(n);
- }
- n = a.join(delimiter);
- if (d === undefined || d.length < 1) {
- amount = n;
- } else {
- amount = n + "." + d;
- }
- amount = minus + amount;
- return amount;
- };
- FK.checkBulkRTS = function() {
- FK.checkProcessingStatus();
- };
- FK.checkProcessingStatus = function() {
- $.ajax({
- url: "onboarding/seller/" + FK.getSellerId() + "/bulk_rts/is_processed",
- dataType: "json",
- success: function(data, textStatus, jqXHR) {
- if (data.code == 1e3) {
- if (data.data.processed === "DONE") {
- $("#orders-acknowledged").trigger({
- type: "processed_rts",
- error_count: data.data.error_count,
- success_count: data.data.success_count,
- order_item_ids: data.data.order_item_ids
- });
- } else if (data.data.processed === "PROCESSING") {
- $("#orders-acknowledged").trigger("processing_rts");
- FK.alert.information("Please refresh your page to check if the uploaded file has been processed.");
- }
- }
- }
- });
- };
- FK.getQueryParams = function(params) {
- var value = "";
- for (var key in params) {
- if (params[key]) {
- value += "&" + key + "=" + params[key];
- }
- }
- return value;
- };
- FK.getErrorsURLInBulkRTS = function(e) {
- "use strict";
- var td = new Date();
- var csv_errors = FK.getQueryParams({
- url: encodeURIComponent("/proxy/seller/" + FK.getSellerId() + "/bulk_rts/errors"),
- fields: "orderId,orderItemId,orderCreatedDate,sku,imei,productId,quantity,invoiceNo,invoiceDate,invoiceAmount,taxAmount,status,errors",
- headerFields: "Order Id,Order Item Id,Order Date,SKU,IMEI,Product Id,Quantity,Invoice No,Invoice Date,Invoice Amount,Tax Amount,Status,ERRORS",
- root: "data.errors",
- filename: "errors-confirmed-orders-" + td.getFullYear() + "-" + (td.getMonth() + 1) + "-" + td.getDate()
- });
- return csv_errors;
- };
- FK.compareByField = function(prop) {
- return function(a, b) {
- if (a[prop] < b[prop]) {
- return -1;
- } else if (a[prop] > b[prop]) {
- return 1;
- } else {
- return 0;
- }
- };
- };
- $(function() {
- $("#forgotPasswordLink").click(function() {
- $("#forgotPasswordError").hide();
- $("#forgotPasswordSuccess").hide();
- $("#forgotPasswordForm")[0].reset();
- });
- $("#forgotPasswordForm").validate({
- rules: {
- forgotPasswordEmail: {
- email: true,
- required: true
- }
- },
- messages: {
- forgotPasswordEmail: {
- email: "Please enter a valid email address"
- }
- },
- submitHandler: function(form) {
- $("#forgotPasswordButton").data("type", "button");
- $("#forgotPasswordButton").html('<img src="images/btn-primary-loader.gif">');
- $.ajax({
- type: "POST",
- data: $(form).serialize(),
- url: "/forgot",
- success: function(data) {
- $("#forgotPasswordButton").data("type", "submit");
- $("#forgotPasswordButton").html("Send Email");
- $("#forgotPasswordError").hide();
- $("#forgotPasswordSuccess").html("The link to create a new password has been sent to your email address at " + $("#emailId").val() + ". Please check your inbox").show();
- },
- error: function(err) {
- $("#forgotPasswordButton").data("type", "submit");
- $("#forgotPasswordButton").html("Send Email");
- err = jQuery.parseJSON(err.responseText);
- if (err.code === 1008) {
- $("#forgotPasswordSuccess").hide();
- $("#forgotPasswordError").html("Account does not exist").show();
- } else {
- $("#forgotPasswordSuccess").hide();
- $("#forgotPasswordError").html("Something went wrong. Please try again").show();
- }
- }
- });
- return false;
- }
- });
- });
- (function(l, f) {
- function m() {
- var a = e.elements;
- return "string" == typeof a ? a.split(" ") : a;
- }
- function i(a) {
- var b = n[a[o]];
- b || (b = {}, h++, a[o] = h, n[h] = b);
- return b;
- }
- function p(a, b, c) {
- b || (b = f);
- if (g) return b.createElement(a);
- c || (c = i(b));
- b = c.cache[a] ? c.cache[a].cloneNode() : r.test(a) ? (c.cache[a] = c.createElem(a)).cloneNode() : c.createElem(a);
- return b.canHaveChildren && !s.test(a) ? c.frag.appendChild(b) : b;
- }
- function t(a, b) {
- if (!b.cache) b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment,
- b.frag = b.createFrag();
- a.createElement = function(c) {
- return !e.shivMethods ? b.createElem(c) : p(c, a, b);
- };
- a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + m().join().replace(/\w+/g, function(a) {
- b.createElem(a);
- b.frag.createElement(a);
- return 'c("' + a + '")';
- }) + ");return n}")(e, b.frag);
- }
- function q(a) {
- a || (a = f);
- var b = i(a);
- if (e.shivCSS && !j && !b.hasCSS) {
- var c, d = a;
- c = d.createElement("p");
- d = d.getElementsByTagName("head")[0] || d.documentElement;
- c.innerHTML = "x<style>article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
- c = d.insertBefore(c.lastChild, d.firstChild);
- b.hasCSS = !!c;
- }
- g || t(a, b);
- return a;
- }
- var k = l.html5 || {}, s = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, r = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, j, o = "_html5shiv", h = 0, n = {}, g;
- (function() {
- try {
- var a = f.createElement("a");
- a.innerHTML = "<xyz></xyz>";
- j = "hidden" in a;
- var b;
- if (!(b = 1 == a.childNodes.length)) {
- f.createElement("a");
- var c = f.createDocumentFragment();
- b = "undefined" == typeof c.cloneNode || "undefined" == typeof c.createDocumentFragment || "undefined" == typeof c.createElement;
- }
- g = b;
- } catch (d) {
- g = j = !0;
- }
- })();
- var e = {
- elements: k.elements || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video",
- version: "3.6.2",
- shivCSS: !1 !== k.shivCSS,
- supportsUnknownElements: g,
- shivMethods: !1 !== k.shivMethods,
- type: "default",
- shivDocument: q,
- createElement: p,
- createDocumentFragment: function(a, b) {
- a || (a = f);
- if (g) return a.createDocumentFragment();
- for (var b = b || i(a), c = b.frag.cloneNode(), d = 0, e = m(), h = e.length; d < h; d++) c.createElement(e[d]);
- return c;
- }
- };
- l.html5 = e;
- q(f);
- })(this, document);
- $(function() {
- var ajaxCallTimeout = 2e3;
- var queryString = location.search;
- $("#contactModalClose").on("click", function() {
- $("#contactSSSuccess").hide();
- $("#contactSSError").hide();
- $("#altEmailLabel").hide();
- $("#alt-emailId").hide();
- $("#alt-emailId").next("label").hide();
- $("#contactSS").text(" Submit");
- $("#contactSS").removeAttr("disabled");
- $("#contactSSForm").trigger("reset");
- });
- $(".start-selling-btn").each(function() {
- $(this).attr("href", $(this).attr("href") + queryString);
- });
- $("#edit-submit").on("click", function() {
- _gaq.push([ "_trackEvent", "SLP", "Login", "Login" ]);
- });
- $("#edit-submit--2").on("click", function() {
- _gaq.push([ "_trackEvent", "SLP", "Start_Selling", "Register_today" ]);
- });
- $("#rcb").on("click", function() {
- if (!$("#rcb").is(":checked")) {
- $("#phoneNumber").next("label").hide();
- }
- });
- $(".slp_seller_form").each(function() {
- $(this).validate({
- rules: {
- email: {
- required: true,
- email: true
- },
- phone: {
- required: true,
- phoneNumber: true
- }
- }
- });
- });
- $(".slp_seller_form").on("submit", function(event) {
- event.preventDefault();
- if ($(this).valid()) {
- var formData = $(this).serializeArray();
- for (var i = 0; i < formData.length; i++) {
- sessionSetItem(formData[i].name, formData[i].value);
- }
- location.href = "/index.html#signUp/accountCreation/new" + queryString;
- }
- });
- var sessionSetItem = function(key, value) {
- var appData = sessionStorage.getItem("__appData");
- if (appData == null) {
- appData = {};
- } else {
- appData = JSON.parse(appData);
- }
- appData[key] = value;
- return sessionStorage.setItem("__appData", JSON.stringify(appData));
- };
- $.validator.addMethod("phoneNumber", function(value, element) {
- if (this.optional(element)) {
- return true;
- }
- return /^[1-9][0-9]{9}$/.test(value);
- }, "Please enter a valid phone number");
- $.validator.addMethod("alternativeEmail", function(value, element) {
- if (this.optional(element)) {
- return true;
- }
- return /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(value);
- }, "Please enter a valid Email Id");
- $.ajax("/sellerRegistrationConfigs", {
- success: function(sellerRegistrationConfigsResponse) {
- var responseJson = jQuery.parseJSON(sellerRegistrationConfigsResponse).data;
- ajaxCallTimeout = responseJson.configs.ajaxCallTimeOut;
- }
- });
- $.ajax("/accessControl", {
- timeout: ajaxCallTimeout,
- success: function(responseData) {
- var responseJson = jQuery.parseJSON(responseData).data;
- var accessControl = responseJson.invitationOnly;
- if (!accessControl) {
- $("#startSellingButton").show();
- $("#signUpLink").show();
- $("#division").show();
- } else {
- $("#sellerInvitationText").show();
- }
- }
- });
- $("#loginInModalLink").click(function() {
- $("#loginError").hide();
- $("#password").val("");
- $("#username").val("");
- $(".contactSellerSupport").hide();
- });
- $(".issueSelect").click(function() {
- var radioValue = $("input[name='issue']:checked").val();
- if (radioValue == 3) {
- $("#altEmailLabel").show();
- $("#alt-emailId").show();
- } else {
- $("#altEmailLabel").hide();
- $("#alt-emailId").hide();
- $("#alt-emailId").next("label").hide();
- }
- });
- function sendLoginEventsForSnoopy(statusCode) {
- var statusCodeMappings = {
- 1e3: "LOGIN_SUCCEEDED",
- 1003: "INVALID_LOGIN_ID",
- 1012: "PASSWORD_INVALID",
- 1031: "ATTEMPT_EXCEEDED",
- 1032: "ACCOUNT_NOT_ACTIVE",
- 1002: "VALIDATION_FAILED",
- 500: "LOGIN_FAILED",
- default: "LOGIN_FAILED"
- };
- var snoopyHelper = FKSP.SnoopyAnalytics("SDDB"), incidentSubmit = {
- entity: {
- name: "Login Errors",
- child: {
- name: "Landing page",
- child: {
- name: statusCodeMappings[statusCode] || statusCodeMappings["default"]
- }
- }
- },
- category: "Login Errors"
- };
- snoopyHelper.track(incidentSubmit);
- }
- function handleLogin(passwordFieldId, password, formId) {
- $.ajax({
- type: "POST",
- data: $(formId).serialize(),
- url: "/login",
- timeout: ajaxCallTimeout,
- success: function(data) {
- var response = data || {};
- if (response.code == 1e3) {
- if (response.data.sellerId) {
- $.cookie("sellerId", response.data.sellerId, {
- path: "/"
- });
- }
- $.cookie("is_login", "true", {
- path: "/"
- });
- $.ajax({
- type: "GET",
- url: "getFeaturesForSeller",
- timeout: ajaxCallTimeout,
- success: updateFeatureStore,
- error: doLogin
- });
- function updateFeatureStore(features) {
- var appData = localStorage.getItem("__appData");
- try {
- if (appData == null || appData === "") {
- throw new Error("invalidJSONString", appData);
- }
- appData = JSON.parse(appData);
- } catch (ex) {
- console.debug(ex);
- appData = {};
- }
- appData["sellerConfig"] = features;
- localStorage.setItem("__appData", JSON.stringify(appData));
- if (features.enableBeta) {
- $.cookie("beta", "true", {
- path: "/",
- expires: 30
- });
- } else {
- $.removeCookie("beta");
- }
- doLogin();
- }
- function doLogin() {
- if (response.data.sellerId) {
- $.cookie("sellerId", response.data.sellerId, {
- path: "/"
- });
- } else {
- window.location.href = "index.html#multi-seller-select";
- return;
- }
- if (response.data.isOnBehalf) {
- if (response.data.onBehalfHomePage) {
- window.location.href = response.data.onBehalfHomePage;
- } else {
- window.location.href = "index.html#dashboard/listings-management?listingState=ACTIVE";
- }
- } else {
- if (response.data.redirectState === 5) {
- var referral_url = FK.searchToObject("referral_url").referral_url;
- var path_regex = /^(?:\/{1}(?:([^\/\\?#]+)))+(?:\/)?(?:\?([^#]*))?(?:#(.*))?$/;
- if (referral_url && path_regex.test(referral_url)) {
- window.location.href = referral_url + window.location.hash;
- } else {
- if (response.data.newStatus === "ONBOARDING") {
- window.location.href = "index.html#dashboard/onboarding/summary";
- } else {
- window.location.href = "index.html#dashboard/home-page";
- }
- }
- } else {
- if (!response.data.task || response.data.task === "mobileVerification") {
- window.location.href = "index.html#dashboard/onboarding/mobileVerification";
- } else {
- window.location.href = "index.html#dashboard/onboarding";
- }
- }
- }
- }
- } else if (response.code == 500) {
- $(".login-err").html("Something went wrong, please try again.").show();
- $(".contactSellerSupport").show();
- $(passwordFieldId).val("");
- } else {
- $(".login-err").html(response.message).show();
- $(".contactSellerSupport").show();
- $(passwordFieldId).val("");
- }
- sendLoginEventsForSnoopy(response.code);
- },
- error: function(error) {
- $(".login-err").html("Something went wrong, please try again.").show();
- $(".contactSellerSupport").show();
- $("#password").val("");
- sendLoginEventsForSnoopy();
- return false;
- }
- });
- }
- function handler(a) {
- var password = $("#password").val();
- handleLogin("#password", password, "#loginForm");
- return false;
- }
- function handlerNew(a) {
- var password = $("#password").val();
- handleLogin("#password", password, "#slp_login_form");
- return false;
- }
- function handlerSmall(a) {
- var password = $("#password-small").val();
- handleLogin("#password-small", password, "#loginForm-small");
- return false;
- }
- $("#loginForm-small").validate({
- rules: {
- username: {
- required: true,
- allowedCharacters: true
- },
- password: {
- required: true
- }
- },
- messages: {
- username: {
- required: ""
- },
- password: {
- required: ""
- }
- },
- submitHandler: handlerSmall
- });
- $("#loginForm").validate({
- rules: {
- username: {
- required: true,
- allowedCharacters: true
- },
- password: {
- required: true
- }
- },
- messages: {
- username: {
- required: ""
- },
- password: {
- required: ""
- }
- },
- submitHandler: handler,
- errorPlacement: function(error, element) {
- error.appendTo($("#errorContainer"));
- }
- });
- $("#slp_login_form").validate({
- rules: {
- username: {
- required: true,
- allowedCharacters: true
- },
- password: {
- required: true
- }
- },
- messages: {
- username: {
- required: ""
- },
- password: {
- required: ""
- }
- },
- submitHandler: handlerNew,
- errorPlacement: function(error, element) {
- error.appendTo($("#errorContainer"));
- }
- });
- $("#forgotPasswordForm").validate({
- rules: {
- forgotPasswordEmail: {
- email: true,
- required: true
- }
- },
- messages: {
- forgotPasswordEmail: {
- email: "Please enter a valid email address"
- }
- },
- submitHandler: function(form) {
- $.ajax({
- type: "POST",
- data: $(form).serialize(),
- url: "/forgot",
- timeout: ajaxCallTimeout,
- success: function(data) {
- $("#forgotPasswordError").hide();
- $("#forgotPasswordSuccess").html("An email is sent to " + $("#emailId").val() + ". Please check your email.").show();
- },
- error: function(err) {
- err = jQuery.parseJSON(err.responseText);
- if (err.text) {
- var text = JSON.parse(err.text);
- }
- if (err.code === 1008) {
- $("#forgotPasswordSuccess").hide();
- $("#forgotPasswordError").html("Account does not exist").show();
- } else if (err.statusCode === 400) {
- $("#forgotPasswordSuccess").hide();
- $("#forgotPasswordError").html(text.errors[0].message).show();
- } else {
- $("#forgotPasswordSuccess").hide();
- $("#forgotPasswordError").html("Something went wrong. Please try again").show();
- }
- }
- });
- return false;
- }
- });
- $("#contactSSForm").validate({
- rules: {
- registeredEmail: {
- email: true,
- required: true
- },
- alternativeEmail: {
- email: "#issue[value='3']:checked" || false,
- required: "#issue[value='3']:checked" || false
- },
- phoneNumber: {
- phoneNumber: true,
- required: "#rcb:checked" || false
- },
- issueDesc: {
- required: true
- }
- },
- messages: {
- registeredEmail: {
- email: "Please enter a valid email address"
- },
- alternativeEmail: {
- email: "Please enter a valid email address"
- },
- phoneNumber: {
- phoneNumber: "Please enter a valid phone number"
- }
- },
- submitHandler: function(form) {
- $("#contactSS").text(" Submitting...");
- $("#contactSS").attr("disabled", true);
- var snoopyHelper = FKSP.SnoopyAnalytics("SDDB"), incidentSubmit = {
- entity: {
- name: "Incident Creation",
- child: {
- name: "Landing page",
- child: {
- name: "Unable to login? - Popup",
- child: {
- name: "Submit - Incident"
- }
- }
- }
- },
- category: "Incident Creation"
- };
- snoopyHelper.track(incidentSubmit);
- $.ajax({
- type: "POST",
- data: $(form).serialize(),
- url: "/napi/srm/preLoginIncident",
- timeout: ajaxCallTimeout,
- success: function(data) {
- $("#contactSSError").hide();
- $("#contactSS").text(" Submitted");
- if (data.result && data.result.attemptStart) {
- var startDate = new Date(data.result.attemptStart), date = startDate.toLocaleDateString(), rcbTime = startDate.toLocaleTimeString(), time = date + " : " + rcbTime;
- $("#contactSSSuccess").html(data.result.incidentId + " is Successfully Created. Seller support executive will call you by " + time).show();
- } else if (data.result.callSlotNotAvailable) {
- $("#contactSSSuccess").html(data.result.issueId + " is Successfully Created. Seller support executive will get in touch with you on your email id as no slots found for a callback.").show();
- } else {
- $("#contactSSSuccess").html(data.result.issueId + " is successfully created. Seller support executive will get in touch with you on your email id.").show();
- }
- },
- error: function(err) {
- $("#contactSS").text(" Submit");
- $("#contactSS").removeAttr("disabled");
- err = jQuery.parseJSON(err.responseText);
- if (err.text) {
- var text = JSON.parse(err.text);
- }
- if (err.error.statusCode === 1008) {
- $("#contactSSSuccess").hide();
- $("#contactSSError").html("Account does not exist").show();
- } else if (err.error.statusCode === 400) {
- var errMsg = typeof err.error.error.errors[0].message === "undefined" ? "" : err.error.error.errors[0].message, errCode = typeof err.error.error.errors[0].code === "undefined" ? "" : err.error.error.errors[0].code;
- if (errMsg) {
- $("#contactSSSuccess").hide();
- $("#contactSSError").html(errMsg).show();
- }
- } else {
- $("#contactSSSuccess").hide();
- $("#contactSSError").html("Something went wrong. Please try again").show();
- }
- }
- });
- return false;
- }
- });
- });
- if (typeof JSON !== "object") {
- JSON = {};
- }
- (function() {
- "use strict";
- function f(n) {
- return n < 10 ? "0" + n : n;
- }
- if (typeof Date.prototype.toJSON !== "function") {
- Date.prototype.toJSON = function(key) {
- return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null;
- };
- String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(key) {
- return this.valueOf();
- };
- }
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
- "\b": "\\b",
- "\t": "\\t",
- "\n": "\\n",
- "\f": "\\f",
- "\r": "\\r",
- '"': '\\"',
- "\\": "\\\\"
- }, rep;
- function quote(string) {
- escapable.lastIndex = 0;
- return escapable.test(string) ? '"' + string.replace(escapable, function(a) {
- var c = meta[a];
- return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' : '"' + string + '"';
- }
- function str(key, holder) {
- var i, k, v, length, mind = gap, partial, value = holder[key];
- if (value && typeof value === "object" && typeof value.toJSON === "function") {
- value = value.toJSON(key);
- }
- if (typeof rep === "function") {
- value = rep.call(holder, key, value);
- }
- switch (typeof value) {
- case "string":
- return quote(value);
- case "number":
- return isFinite(value) ? String(value) : "null";
- case "boolean":
- case "null":
- return String(value);
- case "object":
- if (!value) {
- return "null";
- }
- gap += indent;
- partial = [];
- if (Object.prototype.toString.apply(value) === "[object Array]") {
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || "null";
- }
- v = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]";
- gap = mind;
- return v;
- }
- if (rep && typeof rep === "object") {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- if (typeof rep[i] === "string") {
- k = rep[i];
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ": " : ":") + v);
- }
- }
- }
- } else {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ": " : ":") + v);
- }
- }
- }
- }
- v = partial.length === 0 ? "{}" : gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial.join(",") + "}";
- gap = mind;
- return v;
- }
- }
- if (typeof JSON.stringify !== "function") {
- JSON.stringify = function(value, replacer, space) {
- var i;
- gap = "";
- indent = "";
- if (typeof space === "number") {
- for (i = 0; i < space; i += 1) {
- indent += " ";
- }
- } else if (typeof space === "string") {
- indent = space;
- }
- rep = replacer;
- if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
- throw new Error("JSON.stringify");
- }
- return str("", {
- "": value
- });
- };
- }
- if (typeof JSON.parse !== "function") {
- JSON.parse = function(text, reviver) {
- var j;
- function walk(holder, key) {
- var k, v, value = holder[key];
- if (value && typeof value === "object") {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- } else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
- text = String(text);
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function(a) {
- return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
- if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
- j = eval("(" + text + ")");
- return typeof reviver === "function" ? walk({
- "": j
- }, "") : j;
- }
- throw new SyntaxError("JSON.parse");
- };
- }
- })();
- window.Modernizr = function(a, b, c) {
- function D(a) {
- j.cssText = a;
- }
- function E(a, b) {
- return D(n.join(a + ";") + (b || ""));
- }
- function F(a, b) {
- return typeof a === b;
- }
- function G(a, b) {
- return !!~("" + a).indexOf(b);
- }
- function H(a, b) {
- for (var d in a) {
- var e = a[d];
- if (!G(e, "-") && j[e] !== c) return b == "pfx" ? e : !0;
- }
- return !1;
- }
- function I(a, b, d) {
- for (var e in a) {
- var f = b[a[e]];
- if (f !== c) return d === !1 ? a[e] : F(f, "function") ? f.bind(d || b) : f;
- }
- return !1;
- }
- function J(a, b, c) {
- var d = a.charAt(0).toUpperCase() + a.slice(1), e = (a + " " + p.join(d + " ") + d).split(" ");
- return F(b, "string") || F(b, "undefined") ? H(e, b) : (e = (a + " " + q.join(d + " ") + d).split(" "),
- I(e, b, c));
- }
- function K() {
- e.input = function(c) {
- for (var d = 0, e = c.length; d < e; d++) u[c[d]] = c[d] in k;
- return u.list && (u.list = !!b.createElement("datalist") && !!a.HTMLDataListElement),
- u;
- }("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),
- e.inputtypes = function(a) {
- for (var d = 0, e, f, h, i = a.length; d < i; d++) k.setAttribute("type", f = a[d]),
- e = k.type !== "text", e && (k.value = l, k.style.cssText = "position:absolute;visibility:hidden;",
- /^range$/.test(f) && k.style.WebkitAppearance !== c ? (g.appendChild(k), h = b.defaultView,
- e = h.getComputedStyle && h.getComputedStyle(k, null).WebkitAppearance !== "textfield" && k.offsetHeight !== 0,
- g.removeChild(k)) : /^(search|tel)$/.test(f) || (/^(url|email)$/.test(f) ? e = k.checkValidity && k.checkValidity() === !1 : e = k.value != l)),
- t[a[d]] = !!e;
- return t;
- }("search tel url email datetime date month week time datetime-local number range color".split(" "));
- }
- var d = "2.6.2", e = {}, f = !0, g = b.documentElement, h = "modernizr", i = b.createElement(h), j = i.style, k = b.createElement("input"), l = ":)", m = {}.toString, n = " -webkit- -moz- -o- -ms- ".split(" "), o = "Webkit Moz O ms", p = o.split(" "), q = o.toLowerCase().split(" "), r = {
- svg: "http://www.w3.org/2000/svg"
- }, s = {}, t = {}, u = {}, v = [], w = v.slice, x, y = function(a, c, d, e) {
- var f, i, j, k, l = b.createElement("div"), m = b.body, n = m || b.createElement("body");
- if (parseInt(d, 10)) while (d--) j = b.createElement("div"), j.id = e ? e[d] : h + (d + 1),
- l.appendChild(j);
- return f = [ "­", '<style id="s', h, '">', a, "</style>" ].join(""), l.id = h,
- (m ? l : n).innerHTML += f, n.appendChild(l), m || (n.style.background = "", n.style.overflow = "hidden",
- k = g.style.overflow, g.style.overflow = "hidden", g.appendChild(n)), i = c(l, a),
- m ? l.parentNode.removeChild(l) : (n.parentNode.removeChild(n), g.style.overflow = k),
- !!i;
- }, z = function(b) {
- var c = a.matchMedia || a.msMatchMedia;
- if (c) return c(b).matches;
- var d;
- return y("@media " + b + " { #" + h + " { position: absolute; } }", function(b) {
- d = (a.getComputedStyle ? getComputedStyle(b, null) : b.currentStyle)["position"] == "absolute";
- }), d;
- }, A = function() {
- function d(d, e) {
- e = e || b.createElement(a[d] || "div"), d = "on" + d;
- var f = d in e;
- return f || (e.setAttribute || (e = b.createElement("div")), e.setAttribute && e.removeAttribute && (e.setAttribute(d, ""),
- f = F(e[d], "function"), F(e[d], "undefined") || (e[d] = c), e.removeAttribute(d))),
- e = null, f;
- }
- var a = {
- select: "input",
- change: "input",
- submit: "form",
- reset: "form",
- error: "img",
- load: "img",
- abort: "img"
- };
- return d;
- }(), B = {}.hasOwnProperty, C;
- !F(B, "undefined") && !F(B.call, "undefined") ? C = function(a, b) {
- return B.call(a, b);
- } : C = function(a, b) {
- return b in a && F(a.constructor.prototype[b], "undefined");
- }, Function.prototype.bind || (Function.prototype.bind = function(b) {
- var c = this;
- if (typeof c != "function") throw new TypeError();
- var d = w.call(arguments, 1), e = function() {
- if (this instanceof e) {
- var a = function() {};
- a.prototype = c.prototype;
- var f = new a(), g = c.apply(f, d.concat(w.call(arguments)));
- return Object(g) === g ? g : f;
- }
- return c.apply(b, d.concat(w.call(arguments)));
- };
- return e;
- }), s.flexbox = function() {
- return J("flexWrap");
- }, s.canvas = function() {
- var a = b.createElement("canvas");
- return !!a.getContext && !!a.getContext("2d");
- }, s.canvastext = function() {
- return !!e.canvas && !!F(b.createElement("canvas").getContext("2d").fillText, "function");
- }, s.webgl = function() {
- return !!a.WebGLRenderingContext;
- }, s.touch = function() {
- var c;
- return "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 : y([ "@media (", n.join("touch-enabled),("), h, ")", "{#modernizr{top:9px;position:absolute}}" ].join(""), function(a) {
- c = a.offsetTop === 9;
- }), c;
- }, s.geolocation = function() {
- return "geolocation" in navigator;
- }, s.postmessage = function() {
- return !!a.postMessage;
- }, s.websqldatabase = function() {
- return !!a.openDatabase;
- }, s.indexedDB = function() {
- return !!J("indexedDB", a);
- }, s.hashchange = function() {
- return A("hashchange", a) && (b.documentMode === c || b.documentMode > 7);
- }, s.history = function() {
- return !!a.history && !!history.pushState;
- }, s.draganddrop = function() {
- var a = b.createElement("div");
- return "draggable" in a || "ondragstart" in a && "ondrop" in a;
- }, s.websockets = function() {
- return "WebSocket" in a || "MozWebSocket" in a;
- }, s.rgba = function() {
- return D("background-color:rgba(150,255,150,.5)"), G(j.backgroundColor, "rgba");
- }, s.hsla = function() {
- return D("background-color:hsla(120,40%,100%,.5)"), G(j.backgroundColor, "rgba") || G(j.backgroundColor, "hsla");
- }, s.multiplebgs = function() {
- return D("background:url(https://),url(https://),red url(https://)"), /(url\s*\(.*?){3}/.test(j.background);
- }, s.backgroundsize = function() {
- return J("backgroundSize");
- }, s.borderimage = function() {
- return J("borderImage");
- }, s.borderradius = function() {
- return J("borderRadius");
- }, s.boxshadow = function() {
- return J("boxShadow");
- }, s.textshadow = function() {
- return b.createElement("div").style.textShadow === "";
- }, s.opacity = function() {
- return E("opacity:.55"), /^0.55$/.test(j.opacity);
- }, s.cssanimations = function() {
- return J("animationName");
- }, s.csscolumns = function() {
- return J("columnCount");
- }, s.cssgradients = function() {
- var a = "background-image:", b = "gradient(linear,left top,right bottom,from(#9f9),to(white));", c = "linear-gradient(left top,#9f9, white);";
- return D((a + "-webkit- ".split(" ").join(b + a) + n.join(c + a)).slice(0, -a.length)),
- G(j.backgroundImage, "gradient");
- }, s.cssreflections = function() {
- return J("boxReflect");
- }, s.csstransforms = function() {
- return !!J("transform");
- }, s.csstransforms3d = function() {
- var a = !!J("perspective");
- return a && "webkitPerspective" in g.style && y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}", function(b, c) {
- a = b.offsetLeft === 9 && b.offsetHeight === 3;
- }), a;
- }, s.csstransitions = function() {
- return J("transition");
- }, s.fontface = function() {
- var a;
- return y('@font-face {font-family:"font";src:url("https://")}', function(c, d) {
- var e = b.getElementById("smodernizr"), f = e.sheet || e.styleSheet, g = f ? f.cssRules && f.cssRules[0] ? f.cssRules[0].cssText : f.cssText || "" : "";
- a = /src/i.test(g) && g.indexOf(d.split(" ")[0]) === 0;
- }), a;
- }, s.generatedcontent = function() {
- var a;
- return y([ "#", h, "{font:0/0 a}#", h, ':after{content:"', l, '";visibility:hidden;font:3px/1 a}' ].join(""), function(b) {
- a = b.offsetHeight >= 3;
- }), a;
- }, s.video = function() {
- var a = b.createElement("video"), c = !1;
- try {
- if (c = !!a.canPlayType) c = new Boolean(c), c.ogg = a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ""),
- c.h264 = a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ""), c.webm = a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "");
- } catch (d) {}
- return c;
- }, s.audio = function() {
- var a = b.createElement("audio"), c = !1;
- try {
- if (c = !!a.canPlayType) c = new Boolean(c), c.ogg = a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
- c.mp3 = a.canPlayType("audio/mpeg;").replace(/^no$/, ""), c.wav = a.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""),
- c.m4a = (a.canPlayType("audio/x-m4a;") || a.canPlayType("audio/aac;")).replace(/^no$/, "");
- } catch (d) {}
- return c;
- }, s.localstorage = function() {
- try {
- return localStorage.setItem(h, h), localStorage.removeItem(h), !0;
- } catch (a) {
- return !1;
- }
- }, s.sessionstorage = function() {
- try {
- return sessionStorage.setItem(h, h), sessionStorage.removeItem(h), !0;
- } catch (a) {
- return !1;
- }
- }, s.webworkers = function() {
- return !!a.Worker;
- }, s.applicationcache = function() {
- return !!a.applicationCache;
- }, s.svg = function() {
- return !!b.createElementNS && !!b.createElementNS(r.svg, "svg").createSVGRect;
- }, s.inlinesvg = function() {
- var a = b.createElement("div");
- return a.innerHTML = "<svg/>", (a.firstChild && a.firstChild.namespaceURI) == r.svg;
- }, s.smil = function() {
- return !!b.createElementNS && /SVGAnimate/.test(m.call(b.createElementNS(r.svg, "animate")));
- }, s.svgclippaths = function() {
- return !!b.createElementNS && /SVGClipPath/.test(m.call(b.createElementNS(r.svg, "clipPath")));
- };
- for (var L in s) C(s, L) && (x = L.toLowerCase(), e[x] = s[L](), v.push((e[x] ? "" : "no-") + x));
- return e.input || K(), e.addTest = function(a, b) {
- if (typeof a == "object") for (var d in a) C(a, d) && e.addTest(d, a[d]); else {
- a = a.toLowerCase();
- if (e[a] !== c) return e;
- b = typeof b == "function" ? b() : b, typeof f != "undefined" && f && (g.className += " " + (b ? "" : "no-") + a),
- e[a] = b;
- }
- return e;
- }, D(""), i = k = null, function(a, b) {
- function k(a, b) {
- var c = a.createElement("p"), d = a.getElementsByTagName("head")[0] || a.documentElement;
- return c.innerHTML = "x<style>" + b + "</style>", d.insertBefore(c.lastChild, d.firstChild);
- }
- function l() {
- var a = r.elements;
- return typeof a == "string" ? a.split(" ") : a;
- }
- function m(a) {
- var b = i[a[g]];
- return b || (b = {}, h++, a[g] = h, i[h] = b), b;
- }
- function n(a, c, f) {
- c || (c = b);
- if (j) return c.createElement(a);
- f || (f = m(c));
- var g;
- return f.cache[a] ? g = f.cache[a].cloneNode() : e.test(a) ? g = (f.cache[a] = f.createElem(a)).cloneNode() : g = f.createElem(a),
- g.canHaveChildren && !d.test(a) ? f.frag.appendChild(g) : g;
- }
- function o(a, c) {
- a || (a = b);
- if (j) return a.createDocumentFragment();
- c = c || m(a);
- var d = c.frag.cloneNode(), e = 0, f = l(), g = f.length;
- for (;e < g; e++) d.createElement(f[e]);
- return d;
- }
- function p(a, b) {
- b.cache || (b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment,
- b.frag = b.createFrag()), a.createElement = function(c) {
- return r.shivMethods ? n(c, a, b) : b.createElem(c);
- }, a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + l().join().replace(/\w+/g, function(a) {
- return b.createElem(a), b.frag.createElement(a), 'c("' + a + '")';
- }) + ");return n}")(r, b.frag);
- }
- function q(a) {
- a || (a = b);
- var c = m(a);
- return r.shivCSS && !f && !c.hasCSS && (c.hasCSS = !!k(a, "article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),
- j || p(a, c), a;
- }
- var c = a.html5 || {}, d = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, e = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, f, g = "_html5shiv", h = 0, i = {}, j;
- (function() {
- try {
- var a = b.createElement("a");
- a.innerHTML = "<xyz></xyz>", f = "hidden" in a, j = a.childNodes.length == 1 || function() {
- b.createElement("a");
- var a = b.createDocumentFragment();
- return typeof a.cloneNode == "undefined" || typeof a.createDocumentFragment == "undefined" || typeof a.createElement == "undefined";
- }();
- } catch (c) {
- f = !0, j = !0;
- }
- })();
- var r = {
- elements: c.elements || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
- shivCSS: c.shivCSS !== !1,
- supportsUnknownElements: j,
- shivMethods: c.shivMethods !== !1,
- type: "default",
- shivDocument: q,
- createElement: n,
- createDocumentFragment: o
- };
- a.html5 = r, q(b);
- }(this, b), e._version = d, e._prefixes = n, e._domPrefixes = q, e._cssomPrefixes = p,
- e.mq = z, e.hasEvent = A, e.testProp = function(a) {
- return H([ a ]);
- }, e.testAllProps = J, e.testStyles = y, e.prefixed = function(a, b, c) {
- return b ? J(a, b, c) : J(a, "pfx");
- }, g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + v.join(" ") : ""),
- e;
- }(this, this.document), function(a, b, c) {
- function d(a) {
- return "[object Function]" == o.call(a);
- }
- function e(a) {
- return "string" == typeof a;
- }
- function f() {}
- function g(a) {
- return !a || "loaded" == a || "complete" == a || "uninitialized" == a;
- }
- function h() {
- var a = p.shift();
- q = 1, a ? a.t ? m(function() {
- ("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1);
- }, 0) : (a(), h()) : q = 0;
- }
- function i(a, c, d, e, f, i, j) {
- function k(b) {
- if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null,
- b)) {
- "img" != a && m(function() {
- t.removeChild(l);
- }, 50);
- for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload();
- }
- }
- var j = j || B.errorTimeout, l = b.createElement(a), o = 0, r = 0, u = {
- t: d,
- s: c,
- e: f,
- a: i,
- x: j
- };
- 1 === y[c] && (r = 1, y[c] = []), "object" == a ? l.data = c : (l.src = c, l.type = a),
- l.width = l.height = "0", l.onerror = l.onload = l.onreadystatechange = function() {
- k.call(this, r);
- }, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n),
- m(k, j)) : y[c].push(l));
- }
- function j(a, b, c, d, f) {
- return q = 0, b = b || "j", e(a) ? i("c" == b ? v : u, a, b, this.i++, c, d, f) : (p.splice(this.i++, 0, a),
- 1 == p.length && h()), this;
- }
- function k() {
- var a = B;
- return a.loader = {
- load: j,
- i: 0
- }, a;
- }
- var l = b.documentElement, m = a.setTimeout, n = b.getElementsByTagName("script")[0], o = {}.toString, p = [], q = 0, r = "MozAppearance" in l.style, s = r && !!b.createRange().compareNode, t = s ? l : n.parentNode, l = a.opera && "[object Opera]" == o.call(a.opera), l = !!b.attachEvent && !l, u = r ? "object" : l ? "script" : "img", v = l ? "script" : u, w = Array.isArray || function(a) {
- return "[object Array]" == o.call(a);
- }, x = [], y = {}, z = {
- timeout: function(a, b) {
- return b.length && (a.timeout = b[0]), a;
- }
- }, A, B;
- B = function(a) {
- function b(a) {
- var a = a.split("!"), b = x.length, c = a.pop(), d = a.length, c = {
- url: c,
- origUrl: c,
- prefixes: a
- }, e, f, g;
- for (f = 0; f < d; f++) g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g));
- for (f = 0; f < b; f++) c = x[f](c);
- return c;
- }
- function g(a, e, f, g, h) {
- var i = b(a), j = i.autoCallback;
- i.url.split(".").pop().split("?").shift(), i.bypass || (e && (e = d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]),
- i.instead ? i.instead(a, e, f, g, h) : (y[i.url] ? i.noexec = !0 : y[i.url] = 1,
- f.load(i.url, i.forceCSS || !i.forceJS && "css" == i.url.split(".").pop().split("?").shift() ? "c" : c, i.noexec, i.attrs, i.timeout),
- (d(e) || d(j)) && f.load(function() {
- k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2;
- })));
- }
- function h(a, b) {
- function c(a, c) {
- if (a) {
- if (e(a)) c || (j = function() {
- var a = [].slice.call(arguments);
- k.apply(this, a), l();
- }), g(a, j, b, 0, h); else if (Object(a) === a) for (n in m = function() {
- var b = 0, c;
- for (c in a) a.hasOwnProperty(c) && b++;
- return b;
- }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function() {
- var a = [].slice.call(arguments);
- k.apply(this, a), l();
- } : j[n] = function(a) {
- return function() {
- var b = [].slice.call(arguments);
- a && a.apply(this, b), l();
- };
- }(k[n])), g(a[n], j, b, n, h));
- } else !c && l();
- }
- var h = !!a.test, i = a.load || a.both, j = a.callback || f, k = j, l = a.complete || f, m, n;
- c(h ? a.yep : a.nope, !!i), i && c(i);
- }
- var i, j, l = this.yepnope.loader;
- if (e(a)) g(a, 0, l, 0); else if (w(a)) for (i = 0; i < a.length; i++) j = a[i],
- e(j) ? g(j, 0, l, 0) : w(j) ? B(j) : Object(j) === j && h(j, l); else Object(a) === a && h(a, l);
- }, B.addPrefix = function(a, b) {
- z[a] = b;
- }, B.addFilter = function(a) {
- x.push(a);
- }, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading",
- b.addEventListener("DOMContentLoaded", A = function() {
- b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete";
- }, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function(a, c, d, e, i, j) {
- var k = b.createElement("script"), l, o, e = e || B.errorTimeout;
- k.src = a;
- for (o in d) k.setAttribute(o, d[o]);
- c = j ? h : c || f, k.onreadystatechange = k.onload = function() {
- !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null);
- }, m(function() {
- l || (l = 1, c(1));
- }, e), i ? k.onload() : n.parentNode.insertBefore(k, n);
- }, a.yepnope.injectCss = function(a, c, d, e, g, i) {
- var e = b.createElement("link"), j, c = i ? h : c || f;
- e.href = a, e.rel = "stylesheet", e.type = "text/css";
- for (j in d) e.setAttribute(j, d[j]);
- g || (n.parentNode.insertBefore(e, n), m(c, 0));
- };
- }(this, document), Modernizr.load = function() {
- yepnope.apply(window, [].slice.call(arguments, 0));
- };
- (function() {
- var unableToLogin = document.getElementById("contactSSId"), snoopyHelper = FKSP.SnoopyAnalytics("SDDB"), contactSSModal = document.getElementById(unableToLogin.getAttribute("data-target").substr(1)), unableToLoginEvent = {
- entity: {
- name: "Incident Creation",
- child: {
- name: "Landing page",
- child: {
- name: "Login Form",
- child: {
- name: "Unable to login?"
- }
- }
- }
- },
- category: "Incident Creation"
- }, popUpFailureEvent = {
- entity: {
- name: "Incident Creation",
- child: {
- name: "Landing page",
- child: {
- name: "Unable to login?",
- child: {
- name: "Popup couldn't open"
- }
- }
- }
- },
- category: "Incident Creation"
- };
- if (unableToLogin && contactSSModal) {
- unableToLogin.addEventListener("click", function() {
- snoopyHelper.track(unableToLoginEvent);
- setTimeout(function() {
- if (contactSSModal.style.display !== "block") {
- snoopyHelper.track(popUpFailureEvent);
- }
- }, 1500);
- });
- }
- })();
- !function(e) {
- var t = {};
- function n(o) {
- if (t[o]) return t[o].exports;
- var r = t[o] = {
- i: o,
- l: !1,
- exports: {}
- };
- return e[o].call(r.exports, r, r.exports, n), r.l = !0, r.exports;
- }
- n.m = e, n.c = t, n.d = function(e, t, o) {
- n.o(e, t) || Object.defineProperty(e, t, {
- enumerable: !0,
- get: o
- });
- }, n.r = function(e) {
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
- value: "Module"
- }), Object.defineProperty(e, "__esModule", {
- value: !0
- });
- }, n.t = function(e, t) {
- if (1 & t && (e = n(e)), 8 & t) return e;
- if (4 & t && "object" == typeof e && e && e.__esModule) return e;
- var o = Object.create(null);
- if (n.r(o), Object.defineProperty(o, "default", {
- enumerable: !0,
- value: e
- }), 2 & t && "string" != typeof e) for (var r in e) n.d(o, r, function(t) {
- return e[t];
- }.bind(null, r));
- return o;
- }, n.n = function(e) {
- var t = e && e.__esModule ? function() {
- return e.default;
- } : function() {
- return e;
- };
- return n.d(t, "a", t), t;
- }, n.o = function(e, t) {
- return Object.prototype.hasOwnProperty.call(e, t);
- }, n.p = "", n(n.s = "./sw.js");
- }({
- "./node_modules/fbjs/lib/ExecutionEnvironment.js": function(e, t, n) {
- "use strict";
- var o = !("undefined" == typeof window || !window.document || !window.document.createElement), r = {
- canUseDOM: o,
- canUseWorkers: "undefined" != typeof Worker,
- canUseEventListeners: o && !(!window.addEventListener && !window.attachEvent),
- canUseViewport: o && !!window.screen,
- isInWorker: !o
- };
- e.exports = r;
- },
- "./node_modules/fk-cp-bandwidth/dist/BandwidthCompute.js": function(e, t, n) {
- "use strict";
- Object.defineProperty(t, "__esModule", {
- value: !0
- });
- var o = function() {
- function e(e, t) {
- for (var n = 0; n < t.length; n++) {
- var o = t[n];
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),
- Object.defineProperty(e, o.key, o);
- }
- }
- return function(t, n, o) {
- return n && e(t.prototype, n), o && e(t, o), t;
- };
- }();
- var r = function() {
- function e() {
- !function(e, t) {
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
- }(this, e), this.currentNetInfo = null, this.isEnvWindow = "undefined" != typeof window,
- this.isEnvSW = "undefined" != typeof ServiceWorkerGlobalScope, this.hasNetInfoSupported = "undefined" != typeof navigator && "connection" in navigator && void 0 !== navigator.connection.downlink,
- this.hasResourceTimingSupported = "undefined" != typeof performance && performance.getEntriesByName,
- this.downlinkRoundUpFactor = 25, this.computeMethods = {
- NETINFO: "NETINFO",
- RTAPI: "RTAPI",
- FDW: "FDW"
- };
- }
- return o(e, [ {
- key: "loadCache",
- value: function() {
- return caches.open(e.bandwidthCache).then(function(e) {
- var t = new Request("https://www.flipkart.com/netinfo");
- return e.match(t);
- }).then(function(e) {
- return e.json();
- }).then(function(e) {
- return e;
- }).catch(function() {
- return null;
- });
- }
- }, {
- key: "writeToCache",
- value: function(t) {
- return caches.open(e.bandwidthCache).then(function(e) {
- var n = new Request("https://www.flipkart.com/netinfo"), o = new Response(JSON.stringify(t));
- return e.put(n, o);
- }).catch(function() {
- return null;
- });
- }
- }, {
- key: "clearCache",
- value: function() {
- return caches.delete(e.bandwidthCache);
- }
- }, {
- key: "initializeNetInfo",
- value: function() {
- return {
- downlink: 0,
- downlinkMax: 1 / 0,
- effectiveType: null,
- rtt: 1 / 0,
- type: null,
- sessionCount: 0
- };
- }
- }, {
- key: "getCurrentNetInfo",
- value: function() {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = navigator.connection, n = this.initializeNetInfo();
- for (var o in this.currentNetInfo = n, n) n.hasOwnProperty(o) && void 0 !== t[o] && (n[o] = t[o]);
- return n.downlink *= 1e3, n.computeMethod = this.computeMethods.NETINFO, e.onChange && ("function" != typeof e.onChange ? console.warn('"onChange" property on config object should be a function !') : this.currentNetInfo.onChange = e.onChange),
- n;
- }
- }, {
- key: "getResouceTimingInformation",
- value: function() {
- var t = performance.getEntries().filter(function(t) {
- return t.name.includes(e.imageURL);
- })[0];
- if (t) {
- var n = t.domainLookupEnd - t.domainLookupStart + (t.connectEnd - t.connectStart) + (t.responseStart - t.requestStart) + (t.responseEnd - t.responseStart);
- t.networkDuration = n;
- }
- return t;
- }
- }, {
- key: "fetchTestFile",
- value: function() {
- var t = this;
- return new Promise(function(n) {
- var o = Date.now();
- fetch(e.imageURL).then(function(e) {
- var r = Date.now(), i = null;
- t.hasResourceTimingSupported || ((i = {}).transferSize = 8 * e.headers.get("content-length") / 1e3,
- i.duration = (r - o) / 1e3), n(i);
- });
- });
- }
- }, {
- key: "roundOffToClosestMultipleof25",
- value: function(e) {
- if (e < 0) return 0;
- var t = e % 25;
- return t > 12 ? e + (25 - t) : e - t;
- }
- }, {
- key: "compute",
- value: function(e) {
- var t = this;
- return new Promise(function(n) {
- var o = void 0;
- t.isEnvSW ? t.hasNetInfoSupported ? n(t.getCurrentNetInfo(e)) : t.fetchTestFile().then(function(e) {
- return o = t.initializeNetInfo(), t.loadCache().then(function(n) {
- n && (o = n);
- var r = o.downlink, i = o.sessionCount;
- if (r *= i, o.sessionCount++, t.hasResourceTimingSupported) {
- o.computeMethod = t.computeMethods.RTAPI;
- var a = t.getResouceTimingInformation();
- r += 8 * a.transferSize / 1e3 / (a.networkDuration / 1e3);
- } else o.computeMethod = t.computeMethods.FDW, r += e.transferSize / e.duration;
- return r = t.roundOffToClosestMultipleof25(Math.round(r)), o.downlink = r / (i + 1),
- t.currentNetInfo = o, o;
- }).then(function(e) {
- return t.writeToCache(e);
- }).then(function() {
- n(o);
- }).catch(function() {
- n(null);
- });
- }) : n(null);
- });
- }
- } ]), e;
- }();
- r.bandwidthCache = "BandwidthCache", r.imageURL = "https://rukminim1.flixcart.com/image/275/275/j7qi9ow0/bedsheet/w/e/y/ivyrose-8901633329624-flat-bombay-dyeing-original-imaexwy3ncqh663q.jpeg?q=80",
- t.default = new r();
- },
- "./node_modules/fk-cp-bandwidth/index.js": function(e, t, n) {
- e.exports = n("./node_modules/fk-cp-bandwidth/dist/BandwidthCompute.js");
- },
- "./node_modules/lodash/_baseGet.js": function(e, t, n) {
- var o = n("./node_modules/lodash/_castPath.js"), r = n("./node_modules/lodash/_toKey.js");
- e.exports = function(e, t) {
- for (var n = 0, i = (t = o(t, e)).length; null != e && n < i; ) e = e[r(t[n++])];
- return n && n == i ? e : void 0;
- };
- },
- "./node_modules/lodash/_castPath.js": function(e, t, n) {
- var o = n("./node_modules/lodash/isArray.js"), r = n("./node_modules/lodash/_isKey.js"), i = n("./node_modules/lodash/_stringToPath.js"), a = n("./node_modules/lodash/toString.js");
- e.exports = function(e, t) {
- return o(e) ? e : r(e, t) ? [ e ] : i(a(e));
- };
- },
- "./node_modules/lodash/_isKey.js": function(e, t, n) {
- var o = n("./node_modules/lodash/isArray.js"), r = n("./node_modules/lodash/isSymbol.js"), i = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, a = /^\w*$/;
- e.exports = function(e, t) {
- if (o(e)) return !1;
- var n = typeof e;
- return !("number" != n && "symbol" != n && "boolean" != n && null != e && !r(e)) || a.test(e) || !i.test(e) || null != t && e in Object(t);
- };
- },
- "./node_modules/lodash/_memoizeCapped.js": function(e, t) {
- e.exports = function(e) {
- return e;
- };
- },
- "./node_modules/lodash/_stringToPath.js": function(e, t, n) {
- var o = /^\./, r = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, i = /\\(\\)?/g, a = n("./node_modules/lodash/_memoizeCapped.js")(function(e) {
- var t = [];
- return o.test(e) && t.push(""), e.replace(r, function(e, n, o, r) {
- t.push(o ? r.replace(i, "$1") : n || e);
- }), t;
- });
- e.exports = a;
- },
- "./node_modules/lodash/_toKey.js": function(e, t) {
- e.exports = function(e) {
- return e;
- };
- },
- "./node_modules/lodash/get.js": function(e, t, n) {
- var o = n("./node_modules/lodash/_baseGet.js");
- e.exports = function(e, t, n) {
- var r = null == e ? void 0 : o(e, t);
- return void 0 === r ? n : r;
- };
- },
- "./node_modules/lodash/isArray.js": function(e, t) {
- var n = Array.isArray;
- e.exports = n;
- },
- "./node_modules/lodash/isSymbol.js": function(e, t) {
- e.exports = function() {
- return !1;
- };
- },
- "./node_modules/lodash/toString.js": function(e, t) {
- e.exports = function(e) {
- return e;
- };
- },
- "./node_modules/serviceworker-cache-polyfill/index.js": function(e, t) {
- !function() {
- var e = Cache.prototype.addAll, t = navigator.userAgent.match(/(Firefox|Chrome)\/(\d+\.)/);
- if (t) var n = t[1], o = parseInt(t[2]);
- e && (!t || "Firefox" === n && o >= 46 || "Chrome" === n && o >= 50) || (Cache.prototype.addAll = function(e) {
- var t = this;
- function n(e) {
- this.name = "NetworkError", this.code = 19, this.message = e;
- }
- return n.prototype = Object.create(Error.prototype), Promise.resolve().then(function() {
- if (arguments.length < 1) throw new TypeError();
- return e = e.map(function(e) {
- return e instanceof Request ? e : String(e);
- }), Promise.all(e.map(function(e) {
- "string" == typeof e && (e = new Request(e));
- var t = new URL(e.url).protocol;
- if ("http:" !== t && "https:" !== t) throw new n("Invalid scheme");
- return fetch(e.clone());
- }));
- }).then(function(o) {
- if (o.some(function(e) {
- return !e.ok;
- })) throw new n("Incorrect response status");
- return Promise.all(o.map(function(n, o) {
- return t.put(e[o], n);
- }));
- }).then(function() {});
- }, Cache.prototype.add = function(e) {
- return this.addAll([ e ]);
- });
- }();
- },
- "./node_modules/sw-toolbox/lib/helpers.js": function(e, t, n) {
- "use strict";
- var o, r = n("./node_modules/sw-toolbox/lib/options.js"), i = n("./node_modules/sw-toolbox/lib/idb-cache-expiration.js");
- function a(e, t) {
- ((t = t || {}).debug || r.debug) && console.log("[sw-toolbox] " + e);
- }
- function s(e) {
- var t;
- return e && e.cache && (t = e.cache.name), t = t || r.cache.name, caches.open(t);
- }
- function c(e) {
- var t = Array.isArray(e);
- if (t && e.forEach(function(e) {
- "string" == typeof e || e instanceof Request || (t = !1);
- }), !t) throw new TypeError("The precache method expects either an array of strings and/or Requests or a Promise that resolves to an array of strings and/or Requests.");
- return e;
- }
- e.exports = {
- debug: a,
- fetchAndCache: function(e, t) {
- var n = (t = t || {}).successResponses || r.successResponses;
- return fetch(e.clone()).then(function(c) {
- return "GET" === e.method && n.test(c.status) && s(t).then(function(n) {
- n.put(e, c).then(function() {
- var s = t.cache || r.cache;
- (s.maxEntries || s.maxAgeSeconds) && s.name && function(e, t, n) {
- var r = function(e, t, n) {
- var o = e.url, r = n.maxAgeSeconds, s = n.maxEntries, c = n.name, u = Date.now();
- return a("Updating LRU order for " + o + ". Max entries is " + s + ", max age is " + r),
- i.getDb(c).then(function(e) {
- return i.setTimestampForUrl(e, o, u);
- }).then(function(e) {
- return i.expireEntries(e, s, r, u);
- }).then(function(e) {
- a("Successfully updated IDB.");
- var n = e.map(function(e) {
- return t.delete(e);
- });
- return Promise.all(n).then(function() {
- a("Done with cache cleanup.");
- });
- }).catch(function(e) {
- a(e);
- });
- }.bind(null, e, t, n);
- o = o ? o.then(r) : r();
- }(e, n, s);
- });
- }), c.clone();
- });
- },
- openCache: s,
- renameCache: function(e, t, n) {
- return a("Renaming cache: [" + e + "] to [" + t + "]", n), caches.delete(t).then(function() {
- return Promise.all([ caches.open(e), caches.open(t) ]).then(function(t) {
- var n = t[0], o = t[1];
- return n.keys().then(function(e) {
- return Promise.all(e.map(function(e) {
- return n.match(e).then(function(t) {
- return o.put(e, t);
- });
- }));
- }).then(function() {
- return caches.delete(e);
- });
- });
- });
- },
- cache: function(e, t) {
- return s(t).then(function(t) {
- return t.add(e);
- });
- },
- uncache: function(e, t) {
- return s(t).then(function(t) {
- return t.delete(e);
- });
- },
- precache: function(e) {
- e instanceof Promise || c(e), r.preCacheItems = r.preCacheItems.concat(e);
- },
- validatePrecacheInput: c
- };
- },
- "./node_modules/sw-toolbox/lib/idb-cache-expiration.js": function(e, t, n) {
- "use strict";
- var o = "sw-toolbox-", r = 1, i = "store", a = "url", s = "timestamp", c = {};
- e.exports = {
- getDb: function(e) {
- return e in c || (c[e] = function(e) {
- return new Promise(function(t, n) {
- var c = indexedDB.open(o + e, r);
- c.onupgradeneeded = function() {
- c.result.createObjectStore(i, {
- keyPath: a
- }).createIndex(s, s, {
- unique: !1
- });
- }, c.onsuccess = function() {
- t(c.result);
- }, c.onerror = function() {
- n(c.error);
- };
- });
- }(e)), c[e];
- },
- setTimestampForUrl: function(e, t, n) {
- return new Promise(function(o, r) {
- var a = e.transaction(i, "readwrite");
- a.objectStore(i).put({
- url: t,
- timestamp: n
- }), a.oncomplete = function() {
- o(e);
- }, a.onabort = function() {
- r(a.error);
- };
- });
- },
- expireEntries: function(e, t, n, o) {
- return function(e, t, n) {
- return t ? new Promise(function(o, r) {
- var c = 1e3 * t, u = [], l = e.transaction(i, "readwrite"), p = l.objectStore(i);
- p.index(s).openCursor().onsuccess = function(e) {
- var t = e.target.result;
- if (t && n - c > t.value[s]) {
- var o = t.value[a];
- u.push(o), p.delete(o), t.continue();
- }
- }, l.oncomplete = function() {
- o(u);
- }, l.onabort = r;
- }) : Promise.resolve([]);
- }(e, n, o).then(function(n) {
- return function(e, t) {
- return t ? new Promise(function(n, o) {
- var r = [], c = e.transaction(i, "readwrite"), u = c.objectStore(i), l = u.index(s), p = l.count();
- l.count().onsuccess = function() {
- var e = p.result;
- e > t && (l.openCursor().onsuccess = function(n) {
- var o = n.target.result;
- if (o) {
- var i = o.value[a];
- r.push(i), u.delete(i), e - r.length > t && o.continue();
- }
- });
- }, c.oncomplete = function() {
- n(r);
- }, c.onabort = o;
- }) : Promise.resolve([]);
- }(e, t).then(function(e) {
- return n.concat(e);
- });
- });
- }
- };
- },
- "./node_modules/sw-toolbox/lib/listeners.js": function(e, t, n) {
- "use strict";
- n("./node_modules/serviceworker-cache-polyfill/index.js");
- var o = n("./node_modules/sw-toolbox/lib/helpers.js"), r = n("./node_modules/sw-toolbox/lib/router.js"), i = n("./node_modules/sw-toolbox/lib/options.js");
- function a(e) {
- return e.reduce(function(e, t) {
- return e.concat(t);
- }, []);
- }
- e.exports = {
- fetchListener: function(e) {
- var t = r.match(e.request);
- t ? e.respondWith(t(e.request)) : r.default && "GET" === e.request.method && 0 === e.request.url.indexOf("http") && e.respondWith(r.default(e.request));
- },
- activateListener: function(e) {
- o.debug("activate event fired");
- var t = i.cache.name + "$$$inactive$$$";
- e.waitUntil(o.renameCache(t, i.cache.name));
- },
- installListener: function(e) {
- var t = i.cache.name + "$$$inactive$$$";
- o.debug("install event fired"), o.debug("creating cache [" + t + "]"), e.waitUntil(o.openCache({
- cache: {
- name: t
- }
- }).then(function(e) {
- return Promise.all(i.preCacheItems).then(a).then(o.validatePrecacheInput).then(function(t) {
- return o.debug("preCache list: " + (t.join(", ") || "(none)")), e.addAll(t);
- });
- }));
- }
- };
- },
- "./node_modules/sw-toolbox/lib/options.js": function(e, t, n) {
- "use strict";
- var o;
- o = self.registration ? self.registration.scope : self.scope || new URL("./", self.location).href,
- e.exports = {
- cache: {
- name: "$$$toolbox-cache$$$" + o + "$$$",
- maxAgeSeconds: null,
- maxEntries: null
- },
- debug: !1,
- networkTimeoutSeconds: null,
- preCacheItems: [],
- successResponses: /^0|([123]\d\d)|(40[14567])|410$/
- };
- },
- "./node_modules/sw-toolbox/lib/route.js": function(e, t, n) {
- "use strict";
- var o = new URL("./", self.location).pathname, r = n("./node_modules/sw-toolbox/node_modules/path-to-regexp/index.js"), i = function(e, t, n, i) {
- t instanceof RegExp ? this.fullUrlRegExp = t : (0 !== t.indexOf("/") && (t = o + t),
- this.keys = [], this.regexp = r(t, this.keys)), this.method = e, this.options = i,
- this.handler = n;
- };
- i.prototype.makeHandler = function(e) {
- var t;
- if (this.regexp) {
- var n = this.regexp.exec(e);
- t = {}, this.keys.forEach(function(e, o) {
- t[e.name] = n[o + 1];
- });
- }
- return function(e) {
- return this.handler(e, t, this.options);
- }.bind(this);
- }, e.exports = i;
- },
- "./node_modules/sw-toolbox/lib/router.js": function(e, t, n) {
- "use strict";
- var o = n("./node_modules/sw-toolbox/lib/route.js"), r = n("./node_modules/sw-toolbox/lib/helpers.js");
- var i = function(e, t) {
- for (var n = e.entries(), o = n.next(), r = []; !o.done; ) {
- new RegExp(o.value[0]).test(t) && r.push(o.value[1]), o = n.next();
- }
- return r;
- }, a = function() {
- this.routes = new Map(), this.routes.set(RegExp, new Map()), this.default = null;
- };
- [ "get", "post", "put", "delete", "head", "any" ].forEach(function(e) {
- a.prototype[e] = function(t, n, o) {
- return this.add(e, t, n, o);
- };
- }), a.prototype.add = function(e, t, n, i) {
- var a;
- i = i || {}, a = t instanceof RegExp ? RegExp : (a = i.origin || self.location.origin) instanceof RegExp ? a.source : function(e) {
- return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
- }(a), e = e.toLowerCase();
- var s = new o(e, t, n, i);
- this.routes.has(a) || this.routes.set(a, new Map());
- var c = this.routes.get(a);
- c.has(e) || c.set(e, new Map());
- var u = c.get(e), l = s.regexp || s.fullUrlRegExp;
- u.has(l.source) && r.debug('"' + t + '" resolves to same regex as existing route.'),
- u.set(l.source, s);
- }, a.prototype.matchMethod = function(e, t) {
- var n = new URL(t), o = n.origin, r = n.pathname;
- return this._match(e, i(this.routes, o), r) || this._match(e, [ this.routes.get(RegExp) ], t);
- }, a.prototype._match = function(e, t, n) {
- if (0 === t.length) return null;
- for (var o = 0; o < t.length; o++) {
- var r = t[o], a = r && r.get(e.toLowerCase());
- if (a) {
- var s = i(a, n);
- if (s.length > 0) return s[0].makeHandler(n);
- }
- }
- return null;
- }, a.prototype.match = function(e) {
- return this.matchMethod(e.method, e.url) || this.matchMethod("any", e.url);
- }, e.exports = new a();
- },
- "./node_modules/sw-toolbox/lib/strategies/cacheFirst.js": function(e, t, n) {
- "use strict";
- var o = n("./node_modules/sw-toolbox/lib/helpers.js");
- e.exports = function(e, t, n) {
- return o.debug("Strategy: cache first [" + e.url + "]", n), o.openCache(n).then(function(t) {
- return t.match(e).then(function(t) {
- return t || o.fetchAndCache(e, n);
- });
- });
- };
- },
- "./node_modules/sw-toolbox/lib/strategies/cacheOnly.js": function(e, t, n) {
- "use strict";
- var o = n("./node_modules/sw-toolbox/lib/helpers.js");
- e.exports = function(e, t, n) {
- return o.debug("Strategy: cache only [" + e.url + "]", n), o.openCache(n).then(function(t) {
- return t.match(e);
- });
- };
- },
- "./node_modules/sw-toolbox/lib/strategies/fastest.js": function(e, t, n) {
- "use strict";
- var o = n("./node_modules/sw-toolbox/lib/helpers.js"), r = n("./node_modules/sw-toolbox/lib/strategies/cacheOnly.js");
- e.exports = function(e, t, n) {
- return o.debug("Strategy: fastest [" + e.url + "]", n), new Promise(function(i, a) {
- var s = !1, c = [], u = function(e) {
- c.push(e.toString()), s ? a(new Error('Both cache and network failed: "' + c.join('", "') + '"')) : s = !0;
- }, l = function(e) {
- e instanceof Response ? i(e) : u("No result returned");
- };
- o.fetchAndCache(e.clone(), n).then(l, u), r(e, t, n).then(l, u);
- });
- };
- },
- "./node_modules/sw-toolbox/lib/strategies/index.js": function(e, t, n) {
- e.exports = {
- networkOnly: n("./node_modules/sw-toolbox/lib/strategies/networkOnly.js"),
- networkFirst: n("./node_modules/sw-toolbox/lib/strategies/networkFirst.js"),
- cacheOnly: n("./node_modules/sw-toolbox/lib/strategies/cacheOnly.js"),
- cacheFirst: n("./node_modules/sw-toolbox/lib/strategies/cacheFirst.js"),
- fastest: n("./node_modules/sw-toolbox/lib/strategies/fastest.js")
- };
- },
- "./node_modules/sw-toolbox/lib/strategies/networkFirst.js": function(e, t, n) {
- "use strict";
- var o = n("./node_modules/sw-toolbox/lib/options.js"), r = n("./node_modules/sw-toolbox/lib/helpers.js");
- e.exports = function(e, t, n) {
- var i = (n = n || {}).successResponses || o.successResponses, a = n.networkTimeoutSeconds || o.networkTimeoutSeconds;
- return r.debug("Strategy: network first [" + e.url + "]", n), r.openCache(n).then(function(t) {
- var o, s, c = [];
- if (a) {
- var u = new Promise(function(n) {
- o = setTimeout(function() {
- t.match(e).then(function(e) {
- e && n(e);
- });
- }, 1e3 * a);
- });
- c.push(u);
- }
- var l = r.fetchAndCache(e, n).then(function(e) {
- if (o && clearTimeout(o), i.test(e.status)) return e;
- throw r.debug("Response was an HTTP error: " + e.statusText, n), s = e, new Error("Bad response");
- }).catch(function(o) {
- return r.debug("Network or response error, fallback to cache [" + e.url + "]", n),
- t.match(e).then(function(e) {
- if (e) return e;
- if (s) return s;
- throw o;
- });
- });
- return c.push(l), Promise.race(c);
- });
- };
- },
- "./node_modules/sw-toolbox/lib/strategies/networkOnly.js": function(e, t, n) {
- "use strict";
- var o = n("./node_modules/sw-toolbox/lib/helpers.js");
- e.exports = function(e, t, n) {
- return o.debug("Strategy: network only [" + e.url + "]", n), fetch(e);
- };
- },
- "./node_modules/sw-toolbox/lib/sw-toolbox.js": function(e, t, n) {
- "use strict";
- var o = n("./node_modules/sw-toolbox/lib/options.js"), r = n("./node_modules/sw-toolbox/lib/router.js"), i = n("./node_modules/sw-toolbox/lib/helpers.js"), a = n("./node_modules/sw-toolbox/lib/strategies/index.js"), s = n("./node_modules/sw-toolbox/lib/listeners.js");
- i.debug("Service Worker Toolbox is loading"), self.addEventListener("install", s.installListener),
- self.addEventListener("activate", s.activateListener), self.addEventListener("fetch", s.fetchListener),
- e.exports = {
- networkOnly: a.networkOnly,
- networkFirst: a.networkFirst,
- cacheOnly: a.cacheOnly,
- cacheFirst: a.cacheFirst,
- fastest: a.fastest,
- router: r,
- options: o,
- cache: i.cache,
- uncache: i.uncache,
- precache: i.precache
- };
- },
- "./node_modules/sw-toolbox/node_modules/isarray/index.js": function(e, t) {
- e.exports = Array.isArray || function(e) {
- return "[object Array]" == Object.prototype.toString.call(e);
- };
- },
- "./node_modules/sw-toolbox/node_modules/path-to-regexp/index.js": function(e, t, n) {
- var o = n("./node_modules/sw-toolbox/node_modules/isarray/index.js");
- e.exports = h, e.exports.parse = i, e.exports.compile = function(e, t) {
- return c(i(e, t));
- }, e.exports.tokensToFunction = c, e.exports.tokensToRegExp = f;
- var r = new RegExp([ "(\\\\.)", "([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))" ].join("|"), "g");
- function i(e, t) {
- for (var n, o = [], i = 0, a = 0, s = "", c = t && t.delimiter || "/"; null != (n = r.exec(e)); ) {
- var p = n[0], d = n[1], f = n.index;
- if (s += e.slice(a, f), a = f + p.length, d) s += d[1]; else {
- var h = e[a], m = n[2], _ = n[3], E = n[4], v = n[5], y = n[6], T = n[7];
- s && (o.push(s), s = "");
- var g = null != m && null != h && h !== m, w = "+" === y || "*" === y, k = "?" === y || "*" === y, A = n[2] || c, S = E || v;
- o.push({
- name: _ || i++,
- prefix: m || "",
- delimiter: A,
- optional: k,
- repeat: w,
- partial: g,
- asterisk: !!T,
- pattern: S ? l(S) : T ? ".*" : "[^" + u(A) + "]+?"
- });
- }
- }
- return a < e.length && (s += e.substr(a)), s && o.push(s), o;
- }
- function a(e) {
- return encodeURI(e).replace(/[\/?#]/g, function(e) {
- return "%" + e.charCodeAt(0).toString(16).toUpperCase();
- });
- }
- function s(e) {
- return encodeURI(e).replace(/[?#]/g, function(e) {
- return "%" + e.charCodeAt(0).toString(16).toUpperCase();
- });
- }
- function c(e) {
- for (var t = new Array(e.length), n = 0; n < e.length; n++) "object" == typeof e[n] && (t[n] = new RegExp("^(?:" + e[n].pattern + ")$"));
- return function(n, r) {
- for (var i = "", c = n || {}, u = (r || {}).pretty ? a : encodeURIComponent, l = 0; l < e.length; l++) {
- var p = e[l];
- if ("string" != typeof p) {
- var d, f = c[p.name];
- if (null == f) {
- if (p.optional) {
- p.partial && (i += p.prefix);
- continue;
- }
- throw new TypeError('Expected "' + p.name + '" to be defined');
- }
- if (o(f)) {
- if (!p.repeat) throw new TypeError('Expected "' + p.name + '" to not repeat, but received `' + JSON.stringify(f) + "`");
- if (0 === f.length) {
- if (p.optional) continue;
- throw new TypeError('Expected "' + p.name + '" to not be empty');
- }
- for (var h = 0; h < f.length; h++) {
- if (d = u(f[h]), !t[l].test(d)) throw new TypeError('Expected all "' + p.name + '" to match "' + p.pattern + '", but received `' + JSON.stringify(d) + "`");
- i += (0 === h ? p.prefix : p.delimiter) + d;
- }
- } else {
- if (d = p.asterisk ? s(f) : u(f), !t[l].test(d)) throw new TypeError('Expected "' + p.name + '" to match "' + p.pattern + '", but received "' + d + '"');
- i += p.prefix + d;
- }
- } else i += p;
- }
- return i;
- };
- }
- function u(e) {
- return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g, "\\$1");
- }
- function l(e) {
- return e.replace(/([=!:$\/()])/g, "\\$1");
- }
- function p(e, t) {
- return e.keys = t, e;
- }
- function d(e) {
- return e.sensitive ? "" : "i";
- }
- function f(e, t, n) {
- o(t) || (n = t || n, t = []);
- for (var r = (n = n || {}).strict, i = !1 !== n.end, a = "", s = 0; s < e.length; s++) {
- var c = e[s];
- if ("string" == typeof c) a += u(c); else {
- var l = u(c.prefix), f = "(?:" + c.pattern + ")";
- t.push(c), c.repeat && (f += "(?:" + l + f + ")*"), a += f = c.optional ? c.partial ? l + "(" + f + ")?" : "(?:" + l + "(" + f + "))?" : l + "(" + f + ")";
- }
- }
- var h = u(n.delimiter || "/"), m = a.slice(-h.length) === h;
- return r || (a = (m ? a.slice(0, -h.length) : a) + "(?:" + h + "(?=$))?"), a += i ? "$" : r && m ? "" : "(?=" + h + "|$)",
- p(new RegExp("^" + a, d(n)), t);
- }
- function h(e, t, n) {
- return o(t) || (n = t || n, t = []), n = n || {}, e instanceof RegExp ? function(e, t) {
- var n = e.source.match(/\((?!\?)/g);
- if (n) for (var o = 0; o < n.length; o++) t.push({
- name: o,
- prefix: null,
- delimiter: null,
- optional: !1,
- repeat: !1,
- partial: !1,
- asterisk: !1,
- pattern: null
- });
- return p(e, t);
- }(e, t) : o(e) ? function(e, t, n) {
- for (var o = [], r = 0; r < e.length; r++) o.push(h(e[r], t, n).source);
- return p(new RegExp("(?:" + o.join("|") + ")", d(n)), t);
- }(e, t, n) : function(e, t, n) {
- return f(i(e, n), t, n);
- }(e, t, n);
- }
- },
- "./sw.js": function(e, t, n) {
- "use strict";
- n.r(t);
- var o, r, i, a, s, c, u = n("./node_modules/sw-toolbox/lib/sw-toolbox.js"), l = n.n(u), p = n("./node_modules/fbjs/lib/ExecutionEnvironment.js"), d = n.n(p);
- function f(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n, e;
- }
- !function(e) {
- e.NETBANKING = "NET_OPTIONS", e.CREDIT_CARD = "CREDIT", e.CASH_DELIVERY = "COD",
- e.CARD_ON_DELIVERY = "DOD", e.PHONEPE_WALLET = "SCLP_WALLET", e.PHONEPE_WALLET_2 = "PHONEPE_WALLET",
- e.PHONEPE_UPI = "PHONEPE", e.GIFT_CARD_WALLET = "QC_SCLP", e.EGV = "EGV", e.SAVED_CARD = "SAVED_CARD",
- e.EMI = "EMI_OPTIONS", e.BNPL = "FLIPKART_CREDIT", e.EMI_CREDIT_CARD = "EMI_CREDIT",
- e.PREFERRED_NET = "PREFERRED_NET";
- }(a = a || (a = {})), function(e) {
- e.LINKED_VOUCHERS = "LINKED_VOUCHERS", e.PREFERRED = "PREFERRED", e.OTHERS = "OTHERS",
- e.NEW_VOUCHERS = "NEW_VOUCHERS";
- }(s = s || (s = {})), function(e) {
- e.PRE_APPROVED = "preapproved", e.NO_COST = "no_cost", e.INTEREST = "interest",
- e.DEBIT_CARD = "debit-card", e.CREDIT_CARD = "credit-card", e.CONSUMER_LOAN = "consumer-loan",
- e.NET_DEBIT = "net-debit", e.CONSUMER_DURABLE_LOAN = "consumer-durable-loan";
- }(c = c || (c = {}));
- var h;
- !function(e) {
- e.NO_STATUS_CODE = "NO_STATUS_CODE", e.KNOWN_PAYMENT_ERROR = "KNOWN_PAYMENT_ERROR",
- e.JSON_PARSING_ERROR = "JSON_PARSING_ERROR", e.NON_200_SUCCESS_RESPONSE = "NON_200_SUCCESS_RESPONSE",
- e.PAYMENT_OPTIONS_LOAD_ERROR = "PAYMENT_OPTIONS_LOAD_ERROR";
- }(h = h || (h = {}));
- var m;
- new RegExp("\\d{16}"), new RegExp("\\d{6}");
- !function(e) {
- e.PAYMENT_OPTIONS = "PAYMENT_OPTIONS", e.WALLET_SELECT = "WALLET_SELECT", e.WALLET_UNSELECT = "WALLET_UNSELECT",
- e.SUBMIT_PAY = "SUBMIT_PAY", e.PAY_WITH_DETAILS = "PAY_WITH_DETAILS", e.PROCESS_FULL_PAYMENT = "PROCESS_FULL_PAYMENT",
- e.INSTRUMENT_CHECK = "INSTRUMENT_CHECK", e.NET_BANK_LIST = "NET_BANK_LIST", e.EMI_OPTIONS_LIST = "EMI_OPTIONS_LIST",
- e.EMI_FAQ_TERMS = "EMI_FAQ_TERMS", e.EMI_TENURES = "EMI_TENURES", e.EMI_CARDS = "EMI_CARDS",
- e.ADD_EGV = "ADD_EGV", e.PAYZIPPY_TERMS = "PAYZIPPY_TERMS", e.PHONE_PE_STATUS = "PHONE_PE_STATUS",
- e.CAPTCHA = "CAPTCHA", e.OTP = "OTP", e.OTP_AUTH = "OTP_AUTH", e.RESEND_OTP = "RESEND_OTP",
- e.OTP_FALLBACK_MODE = "OTP_FALLBACK_MODE", e.ITEM_LEVEL_BREAK_UP = "ITEM_LEVEL_BREAK_UP";
- }(m = m || (m = {}));
- var _, E, v, y, T, g;
- m.PAYMENT_OPTIONS, m.WALLET_SELECT, m.WALLET_UNSELECT, m.SUBMIT_PAY, m.PROCESS_FULL_PAYMENT,
- m.ADD_EGV, m.CAPTCHA, f(o = {}, m.PAYMENT_OPTIONS, "/fkpay/api/v1/payments/options?token={token_id}"),
- f(o, m.WALLET_SELECT, "/fkpay/api/v1/payments/select"), f(o, m.WALLET_UNSELECT, "/fkpay/api/v1/payments/decline"),
- f(o, m.SUBMIT_PAY, "/fkpay/api/v1/payments/pay?token={token_id}&instrument={instrument}"),
- f(o, m.PAY_WITH_DETAILS, "/fkpay/api/v1/payments/paywithdetails?token={token_id}"),
- f(o, m.PROCESS_FULL_PAYMENT, "/fkpay/api/v1/payments/complete"), f(o, m.INSTRUMENT_CHECK, "/fkpay/api/v1/payments/instrumentcheck?token={token_id}"),
- f(o, m.NET_BANK_LIST, "/fkpay/api/v1/payments/net/options?token={token_id}"), f(o, m.EMI_OPTIONS_LIST, "/fkpay/api/v1/payments/emi/banks?token={token_id}"),
- f(o, m.EMI_FAQ_TERMS, "/fkpay/api/v1/emi/terms?token={token_id}"), f(o, m.EMI_TENURES, "/fkpay/api/v2/payments/emi/tenures?token={token_id}"),
- f(o, m.EMI_CARDS, "/fkpay/api/v1/payments/emi/cards"), f(o, m.ADD_EGV, "/fkpay/api/v1/payments/egv?token={token_id}"),
- f(o, m.PAYZIPPY_TERMS, "/fkpay/api/v1/terms"), f(o, m.PHONE_PE_STATUS, "/fkpay/api/v1/payments/pgresponse"),
- f(o, m.CAPTCHA, "/fkpay/api/v1/payments/captcha/{token_id}?token={token_id}"), f(o, m.OTP, "/fkpay/api/v1/payments/otp/modes/{token_id}"),
- f(o, m.OTP_AUTH, "/fkpay/api/v1/payments/pg/complete"), f(o, m.RESEND_OTP, "/fkpay/api/v1/payments/otp/resend/{token_id}"),
- f(o, m.OTP_FALLBACK_MODE, "/fkpay/api/v1/payments/otp/fallback/{token_id}"), f(o, m.ITEM_LEVEL_BREAK_UP, "/fkpay/api/v1/payments/emi/itemview"),
- f(r = {}, m.PAYMENT_OPTIONS, "/fkpay/api/v1/payments/options?token={token_id}"),
- f(r, m.WALLET_SELECT, "/fkpay/api/v1/payments/select"), f(r, m.WALLET_UNSELECT, "/fkpay/api/v1/payments/decline"),
- f(r, m.SUBMIT_PAY, "/fkpay/api/v2/payments/pay?token={token_id}&instrument={instrument}"),
- f(r, m.PAY_WITH_DETAILS, "/fkpay/api/v2/payments/paywithdetails?token={token_id}"),
- f(r, m.PROCESS_FULL_PAYMENT, "/fkpay/api/v1/payments/complete"), f(r, m.INSTRUMENT_CHECK, "/fkpay/api/v1/payments/instrumentcheck?token={token_id}"),
- f(r, m.NET_BANK_LIST, "/fkpay/api/v1/payments/net/options?token={token_id}"), f(r, m.EMI_OPTIONS_LIST, "/fkpay/api/v1/payments/emi/banks?token={token_id}"),
- f(r, m.EMI_FAQ_TERMS, "/fkpay/api/v1/emi/terms?token={token_id}"), f(r, m.EMI_TENURES, "/fkpay/api/v2/payments/emi/tenures?token={token_id}"),
- f(r, m.EMI_CARDS, "/fkpay/api/v1/payments/emi/cards"), f(r, m.ADD_EGV, "/fkpay/api/v1/payments/egv?token={token_id}"),
- f(r, m.PAYZIPPY_TERMS, "/fkpay/api/v1/terms"), f(r, m.PHONE_PE_STATUS, "/fkpay/api/v1/payments/pgresponse"),
- f(r, m.CAPTCHA, "/fkpay/api/v1/payments/captcha/{token_id}?token={token_id}"), f(r, m.OTP, "/fkpay/api/v1/payments/otp/modes/{token_id}"),
- f(r, m.OTP_AUTH, "/fkpay/api/v1/payments/pg/complete"), f(r, m.RESEND_OTP, "/fkpay/api/v1/payments/otp/resend/{token_id}"),
- f(r, m.OTP_FALLBACK_MODE, "/fkpay/api/v1/payments/otp/fallback/{token_id}"), f(r, m.ITEM_LEVEL_BREAK_UP, "/fkpay/api/v1/payments/emi/itemview"),
- f(i = {}, m.PAYMENT_OPTIONS, "/fkpay/api/v3/payments/options?token={token_id}"),
- f(i, m.WALLET_SELECT, "/fkpay/api/v3/payments/select"), f(i, m.WALLET_UNSELECT, "/fkpay/api/v3/payments/decline"),
- f(i, m.SUBMIT_PAY, "/fkpay/api/v3/payments/pay?token={token_id}&instrument={instrument}"),
- f(i, m.PAY_WITH_DETAILS, "/fkpay/api/v3/payments/paywithdetails?token={token_id}"),
- f(i, m.PROCESS_FULL_PAYMENT, "/fkpay/api/v3/payments/complete"), f(i, m.INSTRUMENT_CHECK, "/fkpay/api/v3/payments/instrumentcheck?token={token_id}"),
- f(i, m.NET_BANK_LIST, "/fkpay/api/v1/payments/net/options?token={token_id}"), f(i, m.EMI_OPTIONS_LIST, "/fkpay/api/v1/payments/emi/banks?token={token_id}"),
- f(i, m.EMI_FAQ_TERMS, "/fkpay/api/v1/emi/terms?token={token_id}"), f(i, m.EMI_TENURES, "/fkpay/api/v2/payments/emi/tenures?token={token_id}"),
- f(i, m.EMI_CARDS, "/fkpay/api/v1/payments/emi/cards"), f(i, m.ADD_EGV, "/fkpay/api/v3/payments/egv?token={token_id}"),
- f(i, m.PAYZIPPY_TERMS, "/fkpay/api/v1/terms"), f(i, m.PHONE_PE_STATUS, "/fkpay/api/v1/payments/pgresponse"),
- f(i, m.CAPTCHA, "/fkpay/api/v3/payments/captcha/{token_id}?token={token_id}"), f(i, m.OTP, "/fkpay/api/v1/payments/otp/modes/{token_id}"),
- f(i, m.OTP_AUTH, "/fkpay/api/v1/payments/pg/complete"), f(i, m.RESEND_OTP, "/fkpay/api/v1/payments/otp/resend/{token_id}"),
- f(i, m.OTP_FALLBACK_MODE, "/fkpay/api/v1/payments/otp/fallback/{token_id}"), f(i, m.ITEM_LEVEL_BREAK_UP, "/fkpay/api/v1/payments/emi/itemview");
- !function(e) {
- e.CASHBACK_ON_CARD = "CASHBACK_ON_CARD", e.CASHBACK_IN_WALLET = "CASHBACK_IN_WALLET",
- e.INSTANT_DISCOUNT = "INSTANT_DISCOUNT";
- }(_ = _ || (_ = {})), function(e) {
- e.EMI_FULL_INTEREST_WAIVER = "EMI_FULL_INTEREST_WAIVER", e.NBFC_ZERO_INTEREST = "NBFC_ZERO_INTEREST",
- e.PBO = "PBO";
- }(E = E || (E = {})), function(e) {
- e.APPLICABLE = "APPLICABLE", e.EXHAUSTED = "EXHAUSTED", e.PARTLY_EXHAUSTED = "PARTLY_EXHAUSTED",
- e.FAILED = "FAILED";
- }(v = v || (v = {})), function(e) {
- e.EMI_PAYMENT = "EMI_PAYMENT", e.FULL_PAYMENT = "FULL_PAYMENT";
- }(y = y || (y = {})), function(e) {
- e.BAJAJFINSERV = "BAJAJFINSERV";
- }(T = T || (T = {})), function(e) {
- e.FLIPKART = "FLIPKART", e.PHONEPE = "PHONEPE";
- }(g = g || (g = {}));
- var w, k;
- !function(e) {
- e.BNPL = "pay_later", e.DEFAULT = "default";
- }(w = w || (w = {})), function(e) {
- e.CH_DC = "payments.flipkart.com", e.NM_DC = "www.payzippy.com";
- }(k = k || (k = {}));
- var A = d.a.canUseDOM, S = {
- "X-user-agent": ("undefined" != typeof navigator ? navigator.userAgent : "StandardUA") + " FKUA/website/41/website/Desktop",
- "Content-Type": "application/json"
- };
- A || Object.assign(S, {
- compress: !0,
- Connection: "keep-alive",
- "Keep-Alive": "timeout=600"
- });
- var b = A ? "https" : "http", P = Object.assign({}, {
- headers: S
- }, {
- protocol: b,
- hostname: "www.flipkart.com",
- credentials: "include",
- fk_api_timeout: A ? 3e4 : 4e3
- }), O = Object.assign({}, S, {
- "x-device-source": "web"
- });
- delete O["X-user-agent"];
- Object.assign({}, {
- headers: O
- }, {
- protocol: b,
- hostname: k.NM_DC,
- credentials: "include",
- fk_api_timeout: A ? 3e4 : 4e3
- });
- var R = n("./node_modules/sw-toolbox/lib/helpers.js"), x = n.n(R);
- !function() {
- for (var e = [], t = 0; t < 64; ) e[t] = 0 | 4294967296 * Math.abs(Math.sin(++t));
- }();
- var C, N, I = "KrWcJnCSZFBLFR39DtHYySjcDCHg2LeC3sxdx7646n7iy7oy";
- function L(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n, e;
- }
- !function(e) {
- e.GROCERY_STORE_LINK = "/grocery-supermart-store?marketplace=GROCERY", e.CONTINUE_SHOPPING_LINK = "/?otracker=Cart_Continue%20shopping",
- e.CHECKOUT_URL = "/checkout/init", e.CONNEKT_BASE_URL = "connekt.flipkart.net",
- e.CONNEKT_STAGE_PATHNAME_PREFIX = "/connekt", e.VIP_LANDING_URL = "/plus";
- }(C = C || (C = {})), function(e) {
- e.SFL = "SFL", e.CHECKOUT = "CHECKOUT";
- }(N = N || (N = {}));
- var j = {
- cacheFirst: function(e, t, n) {
- var o = e.url.replace(/sqid=([^&]*)/, "").replace(/ssid=([^&]*)/, "");
- return x.a.openCache(n).then(function(t) {
- return D(o, t, n, "get", e);
- }).catch(function(e) {
- throw new Error(e);
- });
- },
- cachePost: function(e, t, n) {
- return M(e.clone()).then(function(t) {
- return x.a.openCache(n).then(function(o) {
- return D(t, o, n, "post", e);
- });
- }).catch(function(e) {
- throw new Error(e);
- });
- },
- webpushCallBack: function(e, t, n) {
- var o = {
- type: "PN",
- eventType: e,
- timestamp: new Date().getTime(),
- messageId: t.messageId,
- contextId: t.contextId,
- cargo: n
- }, r = {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- "x-api-key": I
- },
- body: JSON.stringify(o)
- }, i = "https://" + C.CONNEKT_BASE_URL + "/v1/push/callback/openweb/fkwebsite/" + t.deviceId;
- return fetch(i, r);
- },
- uncache: function(e, t) {
- return function() {
- x.a.uncache(e, t);
- };
- }
- };
- function M(e) {
- return e.json().then(function(t) {
- var n = JSON.stringify(t).replace(/"(ssid|sqid)":".*?"/g, ""), o = function(e) {
- var t = 0;
- if (0 === e.length) return t;
- for (var n = 0; n < e.length; n++) t = (t << 5) - t + e.charCodeAt(n), t &= t;
- return t;
- }(e.url + n);
- return e.url + "?payload=" + o;
- });
- }
- function D(e, t, n) {
- var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "get", r = arguments[4], i = 1e3 * n.cache.maxAgeSeconds, a = new Request(e + (e.indexOf("?") > -1 ? "&" : "?") + "$cached$timestamp$");
- return Promise.all([ t.match(e), t.match(a) ]).then(function(n) {
- var s = n[0], c = n[1];
- return s && c && Date.now() < parseInt(c.headers.get("created-time"), 10) + i ? s : "get" === o ? fetch(r).then(function(n) {
- return 200 === n.status && (t.put(e, n.clone()), t.put(a, new Response(null, {
- headers: L({}, "created-time", Date.now())
- }))), n;
- }) : function(e) {
- return M(e.clone()).then(function(t) {
- return fetch(e).then(function(e) {
- return {
- url: t,
- response: e.clone()
- };
- });
- });
- }(r).then(function(n) {
- return n.response.ok && (t.put(a, new Response(null, {
- headers: L({}, "created-time", Date.now())
- })), t.put(e, n.response.clone())), n.response;
- });
- });
- }
- var U = n("./node_modules/lodash/get.js"), F = n.n(U).a, H = n("./node_modules/fk-cp-bandwidth/index.js"), B = n.n(H), W = {};
- [ "static", "mainBundles", "layouts", "pincodes", "fonts", "widgets", "sherlock", "facets", "summary", "swatches", "autosuggest", "searchSummary", "product", "reco", "lc", "self-serve", "reviews" ].forEach(function(e) {
- W[e] = e + 8;
- });
- self.addEventListener("message", function(e) {
- "BANDWIDTH_COMPUTE" === e.data && V();
- });
- var Y = 0, K = 3, $ = 5e3;
- function V() {
- return B.a.compute().then(function(e) {
- if (Y++, e && e.downlink > 0 || Y > K) return Y = 0, q({
- type: "BANDWIDTH",
- data: e
- });
- setTimeout(V, $);
- }).catch(function(e) {
- ++Y < K ? setTimeout(V, $) : Y = 0;
- });
- }
- var q = function(e) {
- return self.clients.matchAll().then(function(t) {
- return Promise.all(t.map(function(t) {
- return t.postMessage(JSON.stringify(e));
- }));
- }).catch(G);
- }, G = function(e) {
- throw e;
- };
- self.addEventListener("install", function(e) {
- e.waitUntil(self.skipWaiting());
- }), self.addEventListener("activate", function(e) {
- e.waitUntil(self.clients.claim()), e.waitUntil(caches.keys().then(function(e) {
- var t = Object.keys(W).map(function(e) {
- return W[e];
- });
- return Promise.all(e.map(function(e) {
- return -1 === t.indexOf(e) && -1 === e.indexOf("$$$inactive$$$") ? caches.delete(e) : Promise.resolve();
- }));
- }));
- }), self.addEventListener("push", function(e) {
- if (e.data) try {
- var t = e.data.json(), n = t.payload;
- if (n) {
- var o = F(n, [ "title" ]), r = {
- body: n.body,
- icon: n.icon,
- image: n.image,
- tag: "notification",
- data: t
- };
- n.actions && n.actions.length > 0 && (r.actions = [], n.actions.forEach(function(e) {
- r.actions.push({
- icon: e.icon,
- title: e.title,
- action: e.action
- });
- })), e.waitUntil(Promise.all([ self.registration.showNotification(o, r), j.webpushCallBack("RECEIVED", t) ]));
- }
- } catch (e) {
- G(e);
- }
- }), self.addEventListener("notificationclick", function(e) {
- e.notification.close();
- var t = void 0;
- if (e.action) {
- var n = F(e, [ "notification", "data", "payload", "actions" ]);
- if (n && Array.isArray(n)) {
- var o = n.filter(function(t) {
- return e.action === t.action;
- });
- 1 === o.length && (t = F(o, [ 0, "landingUrl" ]));
- }
- } else t = F(e, [ "notification", "data", "payload", "landingUrl" ]);
- t ? e.waitUntil(Promise.all([ clients.openWindow(t), j.webpushCallBack("READ", e.notification.data) ])) : e.waitUntil(self.skipWaiting());
- }), self.addEventListener("notificationclose", function(e) {
- e.waitUntil(j.webpushCallBack("DISMISS", e.notification.data));
- }), navigator.userAgent.indexOf("Firefox/44.0") > -1 && self.addEventListener("fetch", function(e) {
- e.respondWith(fetch(e.request));
- });
- var J = {
- cache: {
- maxEntries: 15
- },
- origin: "https://" + P.hostname
- };
- l.a.router.get("/lc/getData*", j.cacheFirst, Object.assign({}, J, {
- cache: {
- name: W.lc,
- maxAgeSeconds: 1800
- }
- })), l.a.router.post("/api/1/product/smart-browse", j.cachePost, Object.assign({}, J, {
- cache: {
- name: W.sherlock,
- maxAgeSeconds: 45
- }
- })), l.a.router.get("/api/1/product/smart-browse/facets*", j.cacheFirst, Object.assign({}, J, {
- cache: {
- name: W.facets,
- maxAgeSeconds: 45
- }
- })), l.a.router.get("/api/4/product/swatch", j.cacheFirst, Object.assign({}, J, {
- cache: {
- name: W.swatches,
- maxAgeSeconds: 120
- }
- })), l.a.router.post("/api/3/page/dynamic/product-reviews", j.cachePost, Object.assign({}, J, {
- cache: {
- name: W.reviews,
- maxAgeSeconds: 120
- }
- })), l.a.router.get("/api/3/product/reviews", j.cacheFirst, Object.assign({}, J, {
- cache: {
- name: W.reviews,
- maxAgeSeconds: 120
- }
- })), l.a.router.get("/api/3/product/aspect-reviews", j.cacheFirst, Object.assign({}, J, {
- cache: {
- name: W.reviews,
- maxAgeSeconds: 120
- }
- })), l.a.router.post("/api/3/product/summary", j.cachePost, Object.assign({}, J, {
- cache: {
- name: W.summary,
- maxAgeSeconds: 45
- }
- })), l.a.router.get("/api/3/user/autosuggest/pincodes", j.cacheFirst, Object.assign({}, J, {
- cache: {
- name: W.pincodes,
- maxAgeSeconds: 86400
- }
- })), l.a.router.get("/api/1/self-serve/return/tnc/*", j.cacheFirst, Object.assign({}, J, {
- cache: {
- name: W["self-serve"],
- maxAgeSeconds: 86400
- }
- })), l.a.router.get("/fk-cp-zion/fonts/(.*)", l.a.fastest, {
- origin: "https://img1a.flixcart.com",
- cache: {
- name: W.fonts,
- maxEntries: 5
- }
- });
- }
- });
- function toggleCurrent(elem) {
- var parent_li = elem.closest("li");
- parent_li.siblings("li.current").removeClass("current");
- parent_li.siblings().find("li.current").removeClass("current");
- parent_li.find("> ul li.current").removeClass("current");
- parent_li.toggleClass("current");
- }
- $(document).ready(function() {
- $(document).on("click", "[data-toggle='wy-nav-top']", function() {
- $("[data-toggle='wy-nav-shift']").toggleClass("shift");
- $("[data-toggle='rst-versions']").toggleClass("shift");
- });
- $(document).on("click", ".wy-menu-vertical .current ul li a", function() {
- var target = $(this);
- $("[data-toggle='wy-nav-shift']").removeClass("shift");
- $("[data-toggle='rst-versions']").toggleClass("shift");
- toggleCurrent(target);
- if (typeof window.SphinxRtdTheme != "undefined") {
- window.SphinxRtdTheme.StickyNav.hashChange();
- }
- });
- $(document).on("click", "[data-toggle='rst-current-version']", function() {
- $("[data-toggle='rst-versions']").toggleClass("shift-up");
- });
- $("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
- $(".wy-menu-vertical ul").siblings("a").each(function() {
- var link = $(this);
- expand = $('<span class="toctree-expand"></span>');
- expand.on("click", function(ev) {
- toggleCurrent(link);
- ev.stopPropagation();
- return false;
- });
- link.prepend(expand);
- });
- });
- window.SphinxRtdTheme = function(jquery) {
- var stickyNav = function() {
- var navBar, win, winScroll = false, linkScroll = false, winPosition = 0, enable = function() {
- init();
- reset();
- win.on("hashchange", reset);
- win.on("scroll", function() {
- if (!linkScroll) {
- winScroll = true;
- }
- });
- setInterval(function() {
- if (winScroll) {
- winScroll = false;
- var newWinPosition = win.scrollTop(), navPosition = navBar.scrollTop(), newNavPosition = navPosition + (newWinPosition - winPosition);
- navBar.scrollTop(newNavPosition);
- winPosition = newWinPosition;
- }
- }, 25);
- }, init = function() {
- navBar = jquery("nav.wy-nav-side:first");
- win = jquery(window);
- }, reset = function() {
- var anchor = encodeURI(window.location.hash);
- if (anchor) {
- try {
- var link = $(".wy-menu-vertical").find('[href="' + anchor + '"]');
- $(".wy-menu-vertical li.toctree-l1 li.current").removeClass("current");
- link.closest("li.toctree-l2").addClass("current");
- link.closest("li.toctree-l3").addClass("current");
- link.closest("li.toctree-l4").addClass("current");
- } catch (err) {
- console.log("Error expanding nav for anchor", err);
- }
- }
- }, hashChange = function() {
- linkScroll = true;
- win.one("hashchange", function() {
- linkScroll = false;
- });
- };
- jquery(init);
- return {
- enable: enable,
- hashChange: hashChange
- };
- }();
- return {
- StickyNav: stickyNav
- };
- }($);
- (function() {
- function q(a, c, d) {
- if (a === c) return a !== 0 || 1 / a == 1 / c;
- if (a == null || c == null) return a === c;
- if (a._chain) a = a._wrapped;
- if (c._chain) c = c._wrapped;
- if (a.isEqual && b.isFunction(a.isEqual)) return a.isEqual(c);
- if (c.isEqual && b.isFunction(c.isEqual)) return c.isEqual(a);
- var e = l.call(a);
- if (e != l.call(c)) return false;
- switch (e) {
- case "[object String]":
- return a == String(c);
- case "[object Number]":
- return a != +a ? c != +c : a == 0 ? 1 / a == 1 / c : a == +c;
- case "[object Date]":
- case "[object Boolean]":
- return +a == +c;
- case "[object RegExp]":
- return a.source == c.source && a.global == c.global && a.multiline == c.multiline && a.ignoreCase == c.ignoreCase;
- }
- if (typeof a != "object" || typeof c != "object") return false;
- for (var f = d.length; f--; ) if (d[f] == a) return true;
- d.push(a);
- var f = 0, g = true;
- if (e == "[object Array]") {
- if (f = a.length, g = f == c.length) for (;f--; ) if (!(g = f in a == f in c && q(a[f], c[f], d))) break;
- } else {
- if ("constructor" in a != "constructor" in c || a.constructor != c.constructor) return false;
- for (var h in a) if (b.has(a, h) && (f++, !(g = b.has(c, h) && q(a[h], c[h], d)))) break;
- if (g) {
- for (h in c) if (b.has(c, h) && !f--) break;
- g = !f;
- }
- }
- d.pop();
- return g;
- }
- var r = this, G = r._, n = {}, k = Array.prototype, o = Object.prototype, i = k.slice, H = k.unshift, l = o.toString, I = o.hasOwnProperty, w = k.forEach, x = k.map, y = k.reduce, z = k.reduceRight, A = k.filter, B = k.every, C = k.some, p = k.indexOf, D = k.lastIndexOf, o = Array.isArray, J = Object.keys, s = Function.prototype.bind, b = function(a) {
- return new m(a);
- };
- if (typeof exports !== "undefined") {
- if (typeof module !== "undefined" && module.exports) exports = module.exports = b;
- exports._ = b;
- } else r._ = b;
- b.VERSION = "1.3.1";
- var j = b.each = b.forEach = function(a, c, d) {
- if (a != null) if (w && a.forEach === w) a.forEach(c, d); else if (a.length === +a.length) for (var e = 0, f = a.length; e < f; e++) {
- if (e in a && c.call(d, a[e], e, a) === n) break;
- } else for (e in a) if (b.has(a, e) && c.call(d, a[e], e, a) === n) break;
- };
- b.map = b.collect = function(a, c, b) {
- var e = [];
- if (a == null) return e;
- if (x && a.map === x) return a.map(c, b);
- j(a, function(a, g, h) {
- e[e.length] = c.call(b, a, g, h);
- });
- if (a.length === +a.length) e.length = a.length;
- return e;
- };
- b.reduce = b.foldl = b.inject = function(a, c, d, e) {
- var f = arguments.length > 2;
- a == null && (a = []);
- if (y && a.reduce === y) return e && (c = b.bind(c, e)), f ? a.reduce(c, d) : a.reduce(c);
- j(a, function(a, b, i) {
- f ? d = c.call(e, d, a, b, i) : (d = a, f = true);
- });
- if (!f) throw new TypeError("Reduce of empty array with no initial value");
- return d;
- };
- b.reduceRight = b.foldr = function(a, c, d, e) {
- var f = arguments.length > 2;
- a == null && (a = []);
- if (z && a.reduceRight === z) return e && (c = b.bind(c, e)), f ? a.reduceRight(c, d) : a.reduceRight(c);
- var g = b.toArray(a).reverse();
- e && !f && (c = b.bind(c, e));
- return f ? b.reduce(g, c, d, e) : b.reduce(g, c);
- };
- b.find = b.detect = function(a, c, b) {
- var e;
- E(a, function(a, g, h) {
- if (c.call(b, a, g, h)) return e = a, true;
- });
- return e;
- };
- b.filter = b.select = function(a, c, b) {
- var e = [];
- if (a == null) return e;
- if (A && a.filter === A) return a.filter(c, b);
- j(a, function(a, g, h) {
- c.call(b, a, g, h) && (e[e.length] = a);
- });
- return e;
- };
- b.reject = function(a, c, b) {
- var e = [];
- if (a == null) return e;
- j(a, function(a, g, h) {
- c.call(b, a, g, h) || (e[e.length] = a);
- });
- return e;
- };
- b.every = b.all = function(a, c, b) {
- var e = true;
- if (a == null) return e;
- if (B && a.every === B) return a.every(c, b);
- j(a, function(a, g, h) {
- if (!(e = e && c.call(b, a, g, h))) return n;
- });
- return e;
- };
- var E = b.some = b.any = function(a, c, d) {
- c || (c = b.identity);
- var e = false;
- if (a == null) return e;
- if (C && a.some === C) return a.some(c, d);
- j(a, function(a, b, h) {
- if (e || (e = c.call(d, a, b, h))) return n;
- });
- return !!e;
- };
- b.include = b.contains = function(a, c) {
- var b = false;
- if (a == null) return b;
- return p && a.indexOf === p ? a.indexOf(c) != -1 : b = E(a, function(a) {
- return a === c;
- });
- };
- b.invoke = function(a, c) {
- var d = i.call(arguments, 2);
- return b.map(a, function(a) {
- return (b.isFunction(c) ? c || a : a[c]).apply(a, d);
- });
- };
- b.pluck = function(a, c) {
- return b.map(a, function(a) {
- return a[c];
- });
- };
- b.max = function(a, c, d) {
- if (!c && b.isArray(a)) return Math.max.apply(Math, a);
- if (!c && b.isEmpty(a)) return -Infinity;
- var e = {
- computed: -Infinity
- };
- j(a, function(a, b, h) {
- b = c ? c.call(d, a, b, h) : a;
- b >= e.computed && (e = {
- value: a,
- computed: b
- });
- });
- return e.value;
- };
- b.min = function(a, c, d) {
- if (!c && b.isArray(a)) return Math.min.apply(Math, a);
- if (!c && b.isEmpty(a)) return Infinity;
- var e = {
- computed: Infinity
- };
- j(a, function(a, b, h) {
- b = c ? c.call(d, a, b, h) : a;
- b < e.computed && (e = {
- value: a,
- computed: b
- });
- });
- return e.value;
- };
- b.shuffle = function(a) {
- var b = [], d;
- j(a, function(a, f) {
- f == 0 ? b[0] = a : (d = Math.floor(Math.random() * (f + 1)), b[f] = b[d], b[d] = a);
- });
- return b;
- };
- b.sortBy = function(a, c, d) {
- return b.pluck(b.map(a, function(a, b, g) {
- return {
- value: a,
- criteria: c.call(d, a, b, g)
- };
- }).sort(function(a, b) {
- var c = a.criteria, d = b.criteria;
- return c < d ? -1 : c > d ? 1 : 0;
- }), "value");
- };
- b.groupBy = function(a, c) {
- var d = {}, e = b.isFunction(c) ? c : function(a) {
- return a[c];
- };
- j(a, function(a, b) {
- var c = e(a, b);
- (d[c] || (d[c] = [])).push(a);
- });
- return d;
- };
- b.sortedIndex = function(a, c, d) {
- d || (d = b.identity);
- for (var e = 0, f = a.length; e < f; ) {
- var g = e + f >> 1;
- d(a[g]) < d(c) ? e = g + 1 : f = g;
- }
- return e;
- };
- b.toArray = function(a) {
- return !a ? [] : a.toArray ? a.toArray() : b.isArray(a) ? i.call(a) : b.isArguments(a) ? i.call(a) : b.values(a);
- };
- b.size = function(a) {
- return b.toArray(a).length;
- };
- b.first = b.head = function(a, b, d) {
- return b != null && !d ? i.call(a, 0, b) : a[0];
- };
- b.initial = function(a, b, d) {
- return i.call(a, 0, a.length - (b == null || d ? 1 : b));
- };
- b.last = function(a, b, d) {
- return b != null && !d ? i.call(a, Math.max(a.length - b, 0)) : a[a.length - 1];
- };
- b.rest = b.tail = function(a, b, d) {
- return i.call(a, b == null || d ? 1 : b);
- };
- b.compact = function(a) {
- return b.filter(a, function(a) {
- return !!a;
- });
- };
- b.flatten = function(a, c) {
- return b.reduce(a, function(a, e) {
- if (b.isArray(e)) return a.concat(c ? e : b.flatten(e));
- a[a.length] = e;
- return a;
- }, []);
- };
- b.without = function(a) {
- return b.difference(a, i.call(arguments, 1));
- };
- b.uniq = b.unique = function(a, c, d) {
- var d = d ? b.map(a, d) : a, e = [];
- b.reduce(d, function(d, g, h) {
- if (0 == h || (c === true ? b.last(d) != g : !b.include(d, g))) d[d.length] = g,
- e[e.length] = a[h];
- return d;
- }, []);
- return e;
- };
- b.union = function() {
- return b.uniq(b.flatten(arguments, true));
- };
- b.intersection = b.intersect = function(a) {
- var c = i.call(arguments, 1);
- return b.filter(b.uniq(a), function(a) {
- return b.every(c, function(c) {
- return b.indexOf(c, a) >= 0;
- });
- });
- };
- b.difference = function(a) {
- var c = b.flatten(i.call(arguments, 1));
- return b.filter(a, function(a) {
- return !b.include(c, a);
- });
- };
- b.zip = function() {
- for (var a = i.call(arguments), c = b.max(b.pluck(a, "length")), d = Array(c), e = 0; e < c; e++) d[e] = b.pluck(a, "" + e);
- return d;
- };
- b.indexOf = function(a, c, d) {
- if (a == null) return -1;
- var e;
- if (d) return d = b.sortedIndex(a, c), a[d] === c ? d : -1;
- if (p && a.indexOf === p) return a.indexOf(c);
- for (d = 0, e = a.length; d < e; d++) if (d in a && a[d] === c) return d;
- return -1;
- };
- b.lastIndexOf = function(a, b) {
- if (a == null) return -1;
- if (D && a.lastIndexOf === D) return a.lastIndexOf(b);
- for (var d = a.length; d--; ) if (d in a && a[d] === b) return d;
- return -1;
- };
- b.range = function(a, b, d) {
- arguments.length <= 1 && (b = a || 0, a = 0);
- for (var d = arguments[2] || 1, e = Math.max(Math.ceil((b - a) / d), 0), f = 0, g = Array(e); f < e; ) g[f++] = a,
- a += d;
- return g;
- };
- var F = function() {};
- b.bind = function(a, c) {
- var d, e;
- if (a.bind === s && s) return s.apply(a, i.call(arguments, 1));
- if (!b.isFunction(a)) throw new TypeError();
- e = i.call(arguments, 2);
- return d = function() {
- if (!(this instanceof d)) return a.apply(c, e.concat(i.call(arguments)));
- F.prototype = a.prototype;
- var b = new F(), g = a.apply(b, e.concat(i.call(arguments)));
- return Object(g) === g ? g : b;
- };
- };
- b.bindAll = function(a) {
- var c = i.call(arguments, 1);
- c.length == 0 && (c = b.functions(a));
- j(c, function(c) {
- a[c] = b.bind(a[c], a);
- });
- return a;
- };
- b.memoize = function(a, c) {
- var d = {};
- c || (c = b.identity);
- return function() {
- var e = c.apply(this, arguments);
- return b.has(d, e) ? d[e] : d[e] = a.apply(this, arguments);
- };
- };
- b.delay = function(a, b) {
- var d = i.call(arguments, 2);
- return setTimeout(function() {
- return a.apply(a, d);
- }, b);
- };
- b.defer = function(a) {
- return b.delay.apply(b, [ a, 1 ].concat(i.call(arguments, 1)));
- };
- b.throttle = function(a, c) {
- var d, e, f, g, h, i = b.debounce(function() {
- h = g = false;
- }, c);
- return function() {
- d = this;
- e = arguments;
- var b;
- f || (f = setTimeout(function() {
- f = null;
- h && a.apply(d, e);
- i();
- }, c));
- g ? h = true : a.apply(d, e);
- i();
- g = true;
- };
- };
- b.debounce = function(a, b) {
- var d;
- return function() {
- var e = this, f = arguments;
- clearTimeout(d);
- d = setTimeout(function() {
- d = null;
- a.apply(e, f);
- }, b);
- };
- };
- b.once = function(a) {
- var b = false, d;
- return function() {
- if (b) return d;
- b = true;
- return d = a.apply(this, arguments);
- };
- };
- b.wrap = function(a, b) {
- return function() {
- var d = [ a ].concat(i.call(arguments, 0));
- return b.apply(this, d);
- };
- };
- b.compose = function() {
- var a = arguments;
- return function() {
- for (var b = arguments, d = a.length - 1; d >= 0; d--) b = [ a[d].apply(this, b) ];
- return b[0];
- };
- };
- b.after = function(a, b) {
- return a <= 0 ? b() : function() {
- if (--a < 1) return b.apply(this, arguments);
- };
- };
- b.keys = J || function(a) {
- if (a !== Object(a)) throw new TypeError("Invalid object");
- var c = [], d;
- for (d in a) b.has(a, d) && (c[c.length] = d);
- return c;
- };
- b.values = function(a) {
- return b.map(a, b.identity);
- };
- b.functions = b.methods = function(a) {
- var c = [], d;
- for (d in a) b.isFunction(a[d]) && c.push(d);
- return c.sort();
- };
- b.extend = function(a) {
- j(i.call(arguments, 1), function(b) {
- for (var d in b) a[d] = b[d];
- });
- return a;
- };
- b.defaults = function(a) {
- j(i.call(arguments, 1), function(b) {
- for (var d in b) a[d] == null && (a[d] = b[d]);
- });
- return a;
- };
- b.clone = function(a) {
- return !b.isObject(a) ? a : b.isArray(a) ? a.slice() : b.extend({}, a);
- };
- b.tap = function(a, b) {
- b(a);
- return a;
- };
- b.isEqual = function(a, b) {
- return q(a, b, []);
- };
- b.isEmpty = function(a) {
- if (b.isArray(a) || b.isString(a)) return a.length === 0;
- for (var c in a) if (b.has(a, c)) return false;
- return true;
- };
- b.isElement = function(a) {
- return !!(a && a.nodeType == 1);
- };
- b.isArray = o || function(a) {
- return l.call(a) == "[object Array]";
- };
- b.isObject = function(a) {
- return a === Object(a);
- };
- b.isArguments = function(a) {
- return l.call(a) == "[object Arguments]";
- };
- if (!b.isArguments(arguments)) b.isArguments = function(a) {
- return !(!a || !b.has(a, "callee"));
- };
- b.isFunction = function(a) {
- return l.call(a) == "[object Function]";
- };
- b.isString = function(a) {
- return l.call(a) == "[object String]";
- };
- b.isNumber = function(a) {
- return l.call(a) == "[object Number]";
- };
- b.isNaN = function(a) {
- return a !== a;
- };
- b.isBoolean = function(a) {
- return a === true || a === false || l.call(a) == "[object Boolean]";
- };
- b.isDate = function(a) {
- return l.call(a) == "[object Date]";
- };
- b.isRegExp = function(a) {
- return l.call(a) == "[object RegExp]";
- };
- b.isNull = function(a) {
- return a === null;
- };
- b.isUndefined = function(a) {
- return a === void 0;
- };
- b.has = function(a, b) {
- return I.call(a, b);
- };
- b.noConflict = function() {
- r._ = G;
- return this;
- };
- b.identity = function(a) {
- return a;
- };
- b.times = function(a, b, d) {
- for (var e = 0; e < a; e++) b.call(d, e);
- };
- b.escape = function(a) {
- return ("" + a).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/");
- };
- b.mixin = function(a) {
- j(b.functions(a), function(c) {
- K(c, b[c] = a[c]);
- });
- };
- var L = 0;
- b.uniqueId = function(a) {
- var b = L++;
- return a ? a + b : b;
- };
- b.templateSettings = {
- evaluate: /<%([\s\S]+?)%>/g,
- interpolate: /<%=([\s\S]+?)%>/g,
- escape: /<%-([\s\S]+?)%>/g
- };
- var t = /.^/, u = function(a) {
- return a.replace(/\\\\/g, "\\").replace(/\\'/g, "'");
- };
- b.template = function(a, c) {
- var d = b.templateSettings, d = "var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('" + a.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(d.escape || t, function(a, b) {
- return "',_.escape(" + u(b) + "),'";
- }).replace(d.interpolate || t, function(a, b) {
- return "'," + u(b) + ",'";
- }).replace(d.evaluate || t, function(a, b) {
- return "');" + u(b).replace(/[\r\n\t]/g, " ") + ";__p.push('";
- }).replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\t/g, "\\t") + "');}return __p.join('');", e = new Function("obj", "_", d);
- return c ? e(c, b) : function(a) {
- return e.call(this, a, b);
- };
- };
- b.chain = function(a) {
- return b(a).chain();
- };
- var m = function(a) {
- this._wrapped = a;
- };
- b.prototype = m.prototype;
- var v = function(a, c) {
- return c ? b(a).chain() : a;
- }, K = function(a, c) {
- m.prototype[a] = function() {
- var a = i.call(arguments);
- H.call(a, this._wrapped);
- return v(c.apply(b, a), this._chain);
- };
- };
- b.mixin(b);
- j("pop,push,reverse,shift,sort,splice,unshift".split(","), function(a) {
- var b = k[a];
- m.prototype[a] = function() {
- var d = this._wrapped;
- b.apply(d, arguments);
- var e = d.length;
- (a == "shift" || a == "splice") && e === 0 && delete d[0];
- return v(d, this._chain);
- };
- });
- j([ "concat", "join", "slice" ], function(a) {
- var b = k[a];
- m.prototype[a] = function() {
- return v(b.apply(this._wrapped, arguments), this._chain);
- };
- });
- m.prototype.chain = function() {
- this._chain = true;
- return this;
- };
- m.prototype.value = function() {
- return this._wrapped;
- };
- }).call(this);
- function validateImei(count, imeiNos, imeiString) {
- return count === 0 || imeiString.length > 0;
- }
- jQuery.validator.addMethod("imeiCount", function(value, element) {
- "use strict";
- var imeiNos = value.split(",");
- function noEmptyStrings(arr) {
- var i, n;
- for (i = 0, n = imeiNos.length; i < n; i++) {
- if (arr[i].length === 0) {
- return false;
- }
- }
- return true;
- }
- var count = parseInt($(element).attr("imei-count"), 10);
- return validateImei(count, imeiNos, value);
- }, "Incorrect number of serial/imei numbers(numbers must be separated by a comma ',')");
- jQuery.validator.addMethod("mobileDigits", function(value, element) {
- return this.optional(element) || /^[0-9+]+$/.test(value);
- }, "Mobile number contains invalid characters");
- jQuery.validator.addMethod("mobileLength", function(value, element) {
- if (value.indexOf("+91") == 0) {
- return value.length == 13;
- } else if (value.indexOf("0") == 0) {
- return value.length == 11;
- } else if (value.indexOf("+") >= 0) {
- return false;
- } else {
- return value.length == 10;
- }
- }, "Please enter a valid 10-digit number");
- jQuery.validator.addMethod("displayNameCharacters", function(value, element) {
- return this.optional(element) || /^[a-zA-Z0-9]{3,22}$/.test(value);
- }, "Display name contains invalid characters");
- jQuery.validator.addMethod("invoiceValidation", function(value, element) {
- return this.optional(element) || /^(?=.*\d)[a-zA-Z\d\\/#-]{1,29}$/.test(value);
- }, "Invoice number contains invalid charachters");
- jQuery.validator.addMethod("doesNotHaveFlipKart", function(value, element) {
- "use strict";
- var name = value.toLowerCase();
- return name.indexOf("flip") === -1 && name.indexOf("kart") === -1;
- }, "Display name cannot have 'flip' or 'kart'");
- jQuery.validator.addMethod("panFormat", function(value, element) {
- return this.optional(element) || /^[A-Za-z]{3}[CHFATBLJGPchfatbljgp]{1}[A-Za-z]{1}\d{4}[A-Za-z]{1}$/.test(value);
- }, "PAN ID must belong to a company, firm, trust, or local authority");
- jQuery.validator.addMethod("noURLinDescription", function(value, element) {
- return this.optional(element) || !/(https:\/\/|http:\/\/|www|\w\w+\.com|\w\w+\.org|\w\w+\.in|\w\w+\.net)/.test(value);
- }, "Links not allowed in description");
- jQuery.validator.addMethod("passwordCheck", function(value, element) {
- return this.optional(element) || /\d/.test(value) && /[a-zA-Z]/.test(value);
- }, "Your password should contain atleast one digit and one alphabet");
- jQuery.validator.addMethod("passwordLength", function(value, element) {
- return value.length >= 4;
- }, "Your password must be at least 4 characters long");
- jQuery.validator.addMethod("letters", function(value, element) {
- return this.optional(element) || /^[a-zA-Z]+$/.test(value);
- }, "This field should contain only letters and no spaces");
- jQuery.validator.addMethod("sameAsOldPassword", function(value, element) {
- return $("#oldPassword").val() !== value;
- }, "Enter a different password");
- jQuery.validator.addMethod("notAccountNumber", function(value, element) {
- return this.optional(element) || /^(?=.*[a-zA-Z]).+$/.test(value);
- }, "You seem to have entered your account number instead of account name");
- jQuery.validator.addMethod("taxLessThanAmt", function(value, element) {
- var taxAmt = parseFloat(value), invAmt = parseFloat($(element).parents("fieldset").find(".invoice-amount").val());
- return taxAmt <= invAmt;
- }, "Tax is more than invoice amount");
- jQuery.validator.addMethod("startDateLessThan", function(value, element) {
- var endDateString = $("#toDate").val();
- var startDate = moment(value, "DD/MM/YYYY");
- var endDate = moment(endDateString, "DD/MM/YYYY");
- if (endDate.isAfter(startDate) || endDate.isSame(startDate)) return true; else return false;
- }, "Start Date should be less than End Date and start date and end date is mandatory");
- jQuery.validator.addMethod("uploadTin", function(value, element) {
- if (value !== $("#vatIdStatic").text() && value !== $("#invoiceCSTNumberLabel").text()) {
- $(".cst-file").show();
- } else {
- $(".cst-file").hide();
- }
- return true;
- }, "Please upload your new CST certificate");
- (function() {
- var t = [].indexOf || function(t) {
- for (var e = 0, n = this.length; e < n; e++) {
- if (e in this && this[e] === t) return e;
- }
- return -1;
- }, e = [].slice;
- (function(t, e) {
- if (typeof define === "function" && define.amd) {
- return define("waypoints", [ "jquery" ], function(n) {
- return e(n, t);
- });
- } else {
- return e(t.jQuery, t);
- }
- })(window, function(n, r) {
- var i, o, l, s, f, u, c, a, h, d, p, y, v, w, g, m;
- i = n(r);
- a = t.call(r, "ontouchstart") >= 0;
- s = {
- horizontal: {},
- vertical: {}
- };
- f = 1;
- c = {};
- u = "waypoints-context-id";
- p = "resize.waypoints";
- y = "scroll.waypoints";
- v = 1;
- w = "waypoints-waypoint-ids";
- g = "waypoint";
- m = "waypoints";
- o = function() {
- function t(t) {
- var e = this;
- this.$element = t;
- this.element = t[0];
- this.didResize = false;
- this.didScroll = false;
- this.id = "context" + f++;
- this.oldScroll = {
- x: t.scrollLeft(),
- y: t.scrollTop()
- };
- this.waypoints = {
- horizontal: {},
- vertical: {}
- };
- this.element[u] = this.id;
- c[this.id] = this;
- t.bind(y, function() {
- var t;
- if (!(e.didScroll || a)) {
- e.didScroll = true;
- t = function() {
- e.doScroll();
- return e.didScroll = false;
- };
- return r.setTimeout(t, n[m].settings.scrollThrottle);
- }
- });
- t.bind(p, function() {
- var t;
- if (!e.didResize) {
- e.didResize = true;
- t = function() {
- n[m]("refresh");
- return e.didResize = false;
- };
- return r.setTimeout(t, n[m].settings.resizeThrottle);
- }
- });
- }
- t.prototype.doScroll = function() {
- var t, e = this;
- t = {
- horizontal: {
- newScroll: this.$element.scrollLeft(),
- oldScroll: this.oldScroll.x,
- forward: "right",
- backward: "left"
- },
- vertical: {
- newScroll: this.$element.scrollTop(),
- oldScroll: this.oldScroll.y,
- forward: "down",
- backward: "up"
- }
- };
- if (a && (!t.vertical.oldScroll || !t.vertical.newScroll)) {
- n[m]("refresh");
- }
- n.each(t, function(t, r) {
- var i, o, l;
- l = [];
- o = r.newScroll > r.oldScroll;
- i = o ? r.forward : r.backward;
- n.each(e.waypoints[t], function(t, e) {
- var n, i;
- if (r.oldScroll < (n = e.offset) && n <= r.newScroll) {
- return l.push(e);
- } else if (r.newScroll < (i = e.offset) && i <= r.oldScroll) {
- return l.push(e);
- }
- });
- l.sort(function(t, e) {
- return t.offset - e.offset;
- });
- if (!o) {
- l.reverse();
- }
- return n.each(l, function(t, e) {
- if (e.options.continuous || t === l.length - 1) {
- return e.trigger([ i ]);
- }
- });
- });
- return this.oldScroll = {
- x: t.horizontal.newScroll,
- y: t.vertical.newScroll
- };
- };
- t.prototype.refresh = function() {
- var t, e, r, i = this;
- r = n.isWindow(this.element);
- e = this.$element.offset();
- this.doScroll();
- t = {
- horizontal: {
- contextOffset: r ? 0 : e.left,
- contextScroll: r ? 0 : this.oldScroll.x,
- contextDimension: this.$element.width(),
- oldScroll: this.oldScroll.x,
- forward: "right",
- backward: "left",
- offsetProp: "left"
- },
- vertical: {
- contextOffset: r ? 0 : e.top,
- contextScroll: r ? 0 : this.oldScroll.y,
- contextDimension: r ? n[m]("viewportHeight") : this.$element.height(),
- oldScroll: this.oldScroll.y,
- forward: "down",
- backward: "up",
- offsetProp: "top"
- }
- };
- return n.each(t, function(t, e) {
- return n.each(i.waypoints[t], function(t, r) {
- var i, o, l, s, f;
- i = r.options.offset;
- l = r.offset;
- o = n.isWindow(r.element) ? 0 : r.$element.offset()[e.offsetProp];
- if (n.isFunction(i)) {
- i = i.apply(r.element);
- } else if (typeof i === "string") {
- i = parseFloat(i);
- if (r.options.offset.indexOf("%") > -1) {
- i = Math.ceil(e.contextDimension * i / 100);
- }
- }
- r.offset = o - e.contextOffset + e.contextScroll - i;
- if (r.options.onlyOnScroll && l != null || !r.enabled) {
- return;
- }
- if (l !== null && l < (s = e.oldScroll) && s <= r.offset) {
- return r.trigger([ e.backward ]);
- } else if (l !== null && l > (f = e.oldScroll) && f >= r.offset) {
- return r.trigger([ e.forward ]);
- } else if (l === null && e.oldScroll >= r.offset) {
- return r.trigger([ e.forward ]);
- }
- });
- });
- };
- t.prototype.checkEmpty = function() {
- if (n.isEmptyObject(this.waypoints.horizontal) && n.isEmptyObject(this.waypoints.vertical)) {
- this.$element.unbind([ p, y ].join(" "));
- return delete c[this.id];
- }
- };
- return t;
- }();
- l = function() {
- function t(t, e, r) {
- var i, o;
- if (r.offset === "bottom-in-view") {
- r.offset = function() {
- var t;
- t = n[m]("viewportHeight");
- if (!n.isWindow(e.element)) {
- t = e.$element.height();
- }
- return t - n(this).outerHeight();
- };
- }
- this.$element = t;
- this.element = t[0];
- this.axis = r.horizontal ? "horizontal" : "vertical";
- this.callback = r.handler;
- this.context = e;
- this.enabled = r.enabled;
- this.id = "waypoints" + v++;
- this.offset = null;
- this.options = r;
- e.waypoints[this.axis][this.id] = this;
- s[this.axis][this.id] = this;
- i = (o = this.element[w]) != null ? o : [];
- i.push(this.id);
- this.element[w] = i;
- }
- t.prototype.trigger = function(t) {
- if (!this.enabled) {
- return;
- }
- if (this.callback != null) {
- this.callback.apply(this.element, t);
- }
- if (this.options.triggerOnce) {
- return this.destroy();
- }
- };
- t.prototype.disable = function() {
- return this.enabled = false;
- };
- t.prototype.enable = function() {
- this.context.refresh();
- return this.enabled = true;
- };
- t.prototype.destroy = function() {
- delete s[this.axis][this.id];
- delete this.context.waypoints[this.axis][this.id];
- return this.context.checkEmpty();
- };
- t.getWaypointsByElement = function(t) {
- var e, r;
- r = t[w];
- if (!r) {
- return [];
- }
- e = n.extend({}, s.horizontal, s.vertical);
- return n.map(r, function(t) {
- return e[t];
- });
- };
- return t;
- }();
- d = {
- init: function(t, e) {
- var r;
- e = n.extend({}, n.fn[g].defaults, e);
- if ((r = e.handler) == null) {
- e.handler = t;
- }
- this.each(function() {
- var t, r, i, s;
- t = n(this);
- i = (s = e.context) != null ? s : n.fn[g].defaults.context;
- if (!n.isWindow(i)) {
- i = t.closest(i);
- }
- i = n(i);
- r = c[i[0][u]];
- if (!r) {
- r = new o(i);
- }
- return new l(t, r, e);
- });
- n[m]("refresh");
- return this;
- },
- disable: function() {
- return d._invoke.call(this, "disable");
- },
- enable: function() {
- return d._invoke.call(this, "enable");
- },
- destroy: function() {
- return d._invoke.call(this, "destroy");
- },
- prev: function(t, e) {
- return d._traverse.call(this, t, e, function(t, e, n) {
- if (e > 0) {
- return t.push(n[e - 1]);
- }
- });
- },
- next: function(t, e) {
- return d._traverse.call(this, t, e, function(t, e, n) {
- if (e < n.length - 1) {
- return t.push(n[e + 1]);
- }
- });
- },
- _traverse: function(t, e, i) {
- var o, l;
- if (t == null) {
- t = "vertical";
- }
- if (e == null) {
- e = r;
- }
- l = h.aggregate(e);
- o = [];
- this.each(function() {
- var e;
- e = n.inArray(this, l[t]);
- return i(o, e, l[t]);
- });
- return this.pushStack(o);
- },
- _invoke: function(t) {
- this.each(function() {
- var e;
- e = l.getWaypointsByElement(this);
- return n.each(e, function(e, n) {
- n[t]();
- return true;
- });
- });
- return this;
- }
- };
- n.fn[g] = function() {
- var t, r;
- r = arguments[0], t = 2 <= arguments.length ? e.call(arguments, 1) : [];
- if (d[r]) {
- return d[r].apply(this, t);
- } else if (n.isFunction(r)) {
- return d.init.apply(this, arguments);
- } else if (n.isPlainObject(r)) {
- return d.init.apply(this, [ null, r ]);
- } else if (!r) {
- return n.error("jQuery Waypoints needs a callback function or handler option.");
- } else {
- return n.error("The " + r + " method does not exist in jQuery Waypoints.");
- }
- };
- n.fn[g].defaults = {
- context: r,
- continuous: true,
- enabled: true,
- horizontal: false,
- offset: 0,
- triggerOnce: false
- };
- h = {
- refresh: function() {
- return n.each(c, function(t, e) {
- return e.refresh();
- });
- },
- viewportHeight: function() {
- var t;
- return (t = r.innerHeight) != null ? t : i.height();
- },
- aggregate: function(t) {
- var e, r, i;
- e = s;
- if (t) {
- e = (i = c[n(t)[0][u]]) != null ? i.waypoints : void 0;
- }
- if (!e) {
- return [];
- }
- r = {
- horizontal: [],
- vertical: []
- };
- n.each(r, function(t, i) {
- n.each(e[t], function(t, e) {
- return i.push(e);
- });
- i.sort(function(t, e) {
- return t.offset - e.offset;
- });
- r[t] = n.map(i, function(t) {
- return t.element;
- });
- return r[t] = n.unique(r[t]);
- });
- return r;
- },
- above: function(t) {
- if (t == null) {
- t = r;
- }
- return h._filter(t, "vertical", function(t, e) {
- return e.offset <= t.oldScroll.y;
- });
- },
- below: function(t) {
- if (t == null) {
- t = r;
- }
- return h._filter(t, "vertical", function(t, e) {
- return e.offset > t.oldScroll.y;
- });
- },
- left: function(t) {
- if (t == null) {
- t = r;
- }
- return h._filter(t, "horizontal", function(t, e) {
- return e.offset <= t.oldScroll.x;
- });
- },
- right: function(t) {
- if (t == null) {
- t = r;
- }
- return h._filter(t, "horizontal", function(t, e) {
- return e.offset > t.oldScroll.x;
- });
- },
- enable: function() {
- return h._invoke("enable");
- },
- disable: function() {
- return h._invoke("disable");
- },
- destroy: function() {
- return h._invoke("destroy");
- },
- extendFn: function(t, e) {
- return d[t] = e;
- },
- _invoke: function(t) {
- var e;
- e = n.extend({}, s.vertical, s.horizontal);
- return n.each(e, function(e, n) {
- n[t]();
- return true;
- });
- },
- _filter: function(t, e, r) {
- var i, o;
- i = c[n(t)[0][u]];
- if (!i) {
- return [];
- }
- o = [];
- n.each(i.waypoints[e], function(t, e) {
- if (r(i, e)) {
- return o.push(e);
- }
- });
- o.sort(function(t, e) {
- return t.offset - e.offset;
- });
- return n.map(o, function(t) {
- return t.element;
- });
- }
- };
- n[m] = function() {
- var t, n;
- n = arguments[0], t = 2 <= arguments.length ? e.call(arguments, 1) : [];
- if (h[n]) {
- return h[n].apply(null, t);
- } else {
- return h.aggregate.call(null, n);
- }
- };
- n[m].settings = {
- resizeThrottle: 100,
- scrollThrottle: 30
- };
- return i.on("load.waypoints", function() {
- return n[m]("refresh");
- });
- });
- }).call(this);
Add Comment
Please, Sign In to add comment