PageSourceSearch

https://machranga.co.in/frontend/vendor/countdown/countdown.min.js

js machranga.co.in collected 2026-10-02 01:55:41 UTC 6,069 bytes, 126 lines download raw bytes

vendor: 6,069 bytes, lines 1-126
1! function (a) {
2    "use strict";
3    "function" == typeof define && define.amd ? define(["jquery"], a) : a(jQuery)
4}(function (a) {
5    "use strict";
6
7    function b(a) {
8        if (a instanceof Date) return a;
9        if (String(a).match(g)) return String(a).match(/^[0-9]*$/) && (a = Number(a)), String(a).match(/\-/) && (a = String(a).replace(/\-/g, "/")), new Date(a);
10        throw new Error("Couldn't cast `" + a + "` to a date object.")
11    }
12
13    function c(a) {
14        var b = a.toString().replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
15        return new RegExp(b)
16    }
17
18    function d(a) {
19        return function (b) {
20            var d = b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);
21            if (d)
22                for (var f = 0, g = d.length; f < g; ++f) {
23                    var h = d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),
24                        j = c(h[0]),
25                        k = h[1] || "",
26                        l = h[3] || "",
27                        m = null;
28                    h = h[2], i.hasOwnProperty(h) && (m = i[h], m = Number(a[m])), null !== m && ("!" === k && (m = e(l, m)), "" === k && m < 10 && (m = "0" + m.toString()), b = b.replace(j, m.toString()))
29                }
30            return b = b.replace(/%%/, "%")
31        }
32    }
33
34    function e(a, b) {
35        var c = "s",
36            d = "";
37        return a && (a = a.replace(/(:|;|\s)/gi, "").split(/\,/), 1 === a.length ? c = a[0] : (d = a[0], c = a[1])), Math.abs(b) > 1 ? c : d
38    }
39    var f = [],
40        g = [],
41        h = {
42            precision: 100,
43            elapse: !1,
44            defer: !1
45        };
46    g.push(/^[0-9]*$/.source), g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source), g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source), g = new RegExp(g.join("|"));
47    var i = {
48            Y: "years",
49            m: "months",
50            n: "daysToMonth",
51            d: "daysToWeek",
52            w: "weeks",
53            W: "weeksToMonth",
54            H: "hours",
55            M: "minutes",
56            S: "seconds",
57            D: "totalDays",
58            I: "totalHours",
59            N: "totalMinutes",
60            T: "totalSeconds"
61        },
62        j = function (b, c, d) {
63            this.el = b, this.$el = a(b), this.interval = null, this.offset = {}, this.options = a.extend({}, h), this.firstTick = !0, this.instanceNumber = f.length, f.push(this), this.$el.data("countdown-instance", this.instanceNumber), d && ("function" == typeof d ? (this.$el.on("update.countdown", d), this.$el.on("stoped.countdown", d), this.$el.on("finish.countdown", d)) : this.options = a.extend({}, h, d)), this.setFinalDate(c), this.options.defer === !1 && this.start()
64        };
65    a.extend(j.prototype, {
66        start: function () {
67            null !== this.interval && clearInterval(this.interval);
68            var a = this;
69            this.update(), this.interval = setInterval(function () {
70                a.update.call(a)
71            }, this.options.precision)
72        },
73        stop: function () {
74            clearInterval(this.interval), this.interval = null, this.dispatchEvent("stoped")
75        },
76        toggle: function () {
77            this.interval ? this.stop() : this.start()
78        },
79        pause: function () {
80            this.stop()
81        },
82        resume: function () {
83            this.start()
84        },
85        remove: function () {
86            this.stop.call(this), f[this.instanceNumber] = null, delete this.$el.data().countdownInstance
87        },
88        setFinalDate: function (a) {
89            this.finalDate = b(a)
90        },
91        update: function () {
92            if (0 === this.$el.closest("html").length) return void this.remove();
93            var a, b = new Date;
94            return a = this.finalDate.getTime() - b.getTime(), a = Math.ceil(a / 1e3), a = !this.options.elapse && a < 0 ? 0 : Math.abs(a), this.totalSecsLeft === a || this.firstTick ? void(this.firstTick = !1) : (this.totalSecsLeft = a, this.elapsed = b >= this.finalDate, this.offset = {
95                seconds: this.totalSecsLeft % 60,
96                minutes: Math.floor(this.totalSecsLeft / 60) % 60,
97                hours: Math.floor(this.totalSecsLeft / 60 / 60) % 24,
98                days: Math.floor(this.totalSecsLeft / 60 / 60 / 24) % 7,
99                daysToWeek: Math.floor(this.totalSecsLeft / 60 / 60 / 24) % 7,
100                daysToMonth: Math.floor(this.totalSecsLeft / 60 / 60 / 24 % 30.4368),
101                weeks: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 7),
102                weeksToMonth: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 7) % 4,
103                months: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 30.4368),
104                years: Math.abs(this.finalDate.getFullYear() - b.getFullYear()),
105                totalDays: Math.floor(this.totalSecsLeft / 60 / 60 / 24),
106                totalHours: Math.floor(this.totalSecsLeft / 60 / 60),
107                totalMinutes: Math.floor(this.totalSecsLeft / 60),
108                totalSeconds: this.totalSecsLeft
109            }, void(this.options.elapse || 0 !== this.totalSecsLeft ? this.dispatchEvent("update") : (this.stop(), this.dispatchEvent("finish"))))
110        },
111        dispatchEvent: function (b) {
112            var c = a.Event(b + ".countdown");
113            c.finalDate = this.finalDate, c.elapsed = this.elapsed, c.offset = a.extend({}, this.offset), c.strftime = d(this.offset), this.$el.trigger(c)
114        }
115    }), a.fn.countdown = function () {
116        var b = Array.prototype.slice.call(arguments, 0);
117        return this.each(function () {
118            var c = a(this).data("countdown-instance");
119            if (void 0 !== c) {
120                var d = f[c],
121                    e = b[0];
122                j.prototype.hasOwnProperty(e) ? d[e].apply(d, b.slice(1)) : null === String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i) ? (d.setFinalDate.call(d, e), d.start()) : a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi, e))
123            } else new j(this, b[0], b[1])
124        })
125    }
126});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.