PageSourceSearch

https://medibhai.com/assets/vendor/jquery-steps/jquery.steps.min.js

js medibhai.com collected 2026-10-02 01:37:14 UTC 20,647 bytes, 525 lines download raw bytes

1/*!
2 * jQuery Steps v1.1.0 - 09/04/2014
3 * Copyright (c) 2014 Rafael Staib (http://www.jquery-steps.com)
4 * Licensed under MIT http://www.opensource.org/licenses/MIT
5 */
6! function(a, b) {
7    function c(a, b) {
8        o(a).push(b)
9    }
10
11    function d(d, e, f) {
12        var g = d.children(e.headerTag),
13            h = d.children(e.bodyTag);
14        g.length > h.length ? R(Z, "contents") : g.length < h.length && R(Z, "titles");
15        var i = e.startIndex;
16        if (f.stepCount = g.length, e.saveState && a.cookie) {
17            var j = a.cookie(U + q(d)),
18                k = parseInt(j, 0);
19            !isNaN(k) && k < f.stepCount && (i = k)
20        }
21        f.currentIndex = i, g.each(function(e) {
22            var f = a(this),
23                g = h.eq(e),
24                i = g.data("mode"),
25                j = null == i ? $.html : r($, /^\s*$/.test(i) || isNaN(i) ? i : parseInt(i, 0)),
26                k = j === $.html || g.data("url") === b ? "" : g.data("url"),
27                l = j !== $.html && "1" === g.data("loaded"),
28                m = a.extend({}, bb, {
29                    title: f.html(),
30                    content: j === $.html ? g.html() : "",
31                    contentUrl: k,
32                    contentMode: j,
33                    contentLoaded: l
34                });
35            c(d, m)
36        })
37    }
38
39    function e(a) {
40        a.triggerHandler("canceled")
41    }
42
43    function f(a, b) {
44        return a.currentIndex - b
45    }
46
47    function g(b, c) {
48        var d = i(b);
49        b.unbind(d).removeData("uid").removeData("options").removeData("state").removeData("steps").removeData("eventNamespace").find(".actions a").unbind(d), b.removeClass(c.clearFixCssClass + " vertical");
50        var e = b.find(".content > *");
51        e.removeData("loaded").removeData("mode").removeData("url"), e.removeAttr("id").removeAttr("role").removeAttr("tabindex").removeAttr("class").removeAttr("style")._removeAria("labelledby")._removeAria("hidden"), b.find(".content > [data-mode='async'],.content > [data-mode='iframe']").empty();
52        var f = a('<{0} class="{1}"></{0}>'.format(b.get(0).tagName, b.attr("class"))),
53            g = b._id();
54        return null != g && "" !== g && f._id(g), f.html(b.find(".content").html()), b.after(f), b.remove(), f
55    }
56
57    function h(a, b) {
58        var c = a.find(".steps li").eq(b.currentIndex);
59        a.triggerHandler("finishing", [b.currentIndex]) ? (c.addClass("done").removeClass("error"), a.triggerHandler("finished", [b.currentIndex])) : c.addClass("error")
60    }
61
62    function i(a) {
63        var b = a.data("eventNamespace");
64        return null == b && (b = "." + q(a), a.data("eventNamespace", b)), b
65    }
66
67    function j(a, b) {
68        var c = q(a);
69        return a.find("#" + c + V + b)
70    }
71
72    function k(a, b) {
73        var c = q(a);
74        return a.find("#" + c + W + b)
75    }
76
77    function l(a, b) {
78        var c = q(a);
79        return a.find("#" + c + X + b)
80    }
81
82    function m(a) {
83        return a.data("options")
84    }
85
86    function n(a) {
87        return a.data("state")
88    }
89
90    function o(a) {
91        return a.data("steps")
92    }
93
94    function p(a, b) {
95        var c = o(a);
96        return (0 > b || b >= c.length) && R(Y), c[b]
97    }
98
99    function q(a) {
100        var b = a.data("uid");
101        return null == b && (b = a._id(), null == b && (b = "steps-uid-".concat(T), a._id(b)), T++, a.data("uid", b)), b
102    }
103
104    function r(a, c) {
105        if (S("enumType", a), S("keyOrValue", c), "string" == typeof c) {
106            var d = a[c];
107            return d === b && R("The enum key '{0}' does not exist.", c), d
108        }
109        if ("number" == typeof c) {
110            for (var e in a)
111                if (a[e] === c) return c;
112            R("Invalid enum value '{0}'.", c)
113        } else R("Invalid key or value type.")
114    }
115
116    function s(a, b, c) {
117        return B(a, b, c, v(c, 1))
118    }
119
120    function t(a, b, c) {
121        return B(a, b, c, f(c, 1))
122    }
123
124    function u(a, b, c, d) {
125        if ((0 > d || d >= c.stepCount) && R(Y), !(b.forceMoveForward && d < c.currentIndex)) {
126            var e = c.currentIndex;
127            return a.triggerHandler("stepChanging", [c.currentIndex, d]) ? (c.currentIndex = d, O(a, b, c), E(a, b, c, e), D(a, b, c), A(a, b, c), P(a, b, c, d, e, function() {
128                a.triggerHandler("stepChanged", [d, e])
129            })) : a.find(".steps li").eq(e).addClass("error"), !0
130        }
131    }
132
133    function v(a, b) {
134        return a.currentIndex + b
135    }
136
137    function w(b) {
138        var c = a.extend(!0, {}, cb, b);
139        return this.each(function() {
140            var b = a(this),
141                e = {
142                    currentIndex: c.startIndex,
143                    currentStep: null,
144                    stepCount: 0,
145                    transitionElement: null
146                };
147            b.data("options", c), b.data("state", e), b.data("steps", []), d(b, c, e), J(b, c, e), G(b, c), c.autoFocus && 0 === T && j(b, c.startIndex).focus(), b.triggerHandler("init", [c.startIndex])
148        })
149    }
150
151    function x(b, c, d, e, f) {
152        (0 > e || e > d.stepCount) && R(Y), f = a.extend({}, bb, f), y(b, e, f), d.currentIndex !== d.stepCount && d.currentIndex >= e && (d.currentIndex++, O(b, c, d)), d.stepCount++;
153        var g = b.find(".content"),
154            h = a("<{0}>{1}</{0}>".format(c.headerTag, f.title)),
155            i = a("<{0}></{0}>".format(c.bodyTag));
156        return (null == f.contentMode || f.contentMode === $.html) && i.html(f.content), 0 === e ? g.prepend(i).prepend(h) : k(b, e - 1).after(i).after(h), K(b, d, i, e), N(b, c, d, h, e), F(b, c, d, e), e === d.currentIndex && E(b, c, d), D(b, c, d), b
157    }
158
159    function y(a, b, c) {
160        o(a).splice(b, 0, c)
161    }
162
163    function z(b) {
164        var c = a(this),
165            d = m(c),
166            e = n(c);
167        if (d.suppressPaginationOnFocus && c.find(":focus").is(":input")) return b.preventDefault(), !1;
168        var f = {
169            left: 37,
170            right: 39
171        };
172        b.keyCode === f.left ? (b.preventDefault(), t(c, d, e)) : b.keyCode === f.right && (b.preventDefault(), s(c, d, e))
173    }
174
175    function A(b, c, d) {
176        if (d.stepCount > 0) {
177            var e = d.currentIndex,
178                f = p(b, e);
179            if (!c.enableContentCache || !f.contentLoaded) switch (r($, f.contentMode)) {
180                case $.iframe:
181                    b.find(".content > .body").eq(d.currentIndex).empty().html('<iframe src="' + f.contentUrl + '" frameborder="0" scrolling="no" />').data("loaded", "1");
182                    break;
183                case $.async:
184                    var g = k(b, e)._aria("busy", "true").empty().append(M(c.loadingTemplate, {
185                        text: c.labels.loading
186                    }));
187                    a.ajax({
188                        url: f.contentUrl,
189                        cache: !1
190                    }).done(function(a) {
191                        g.empty().html(a)._aria("busy", "false").data("loaded", "1"), b.triggerHandler("contentLoaded", [e])
192                    })
193            }
194        }
195    }
196
197    function B(a, b, c, d) {
198        var e = c.currentIndex;
199        if (d >= 0 && d < c.stepCount && !(b.forceMoveForward && d < c.currentIndex)) {
200            var f = j(a, d),
201                g = f.parent(),
202                h = g.hasClass("disabled");
203            return g._enableAria(), f.click(), e === c.currentIndex && h ? (g._enableAria(!1), !1) : !0
204        }
205        return !1
206    }
207
208    function C(b) {
209        b.preventDefault();
210        var c = a(this),
211            d = c.parent().parent().parent().parent(),
212            f = m(d),
213            g = n(d),
214            i = c.attr("href");
215        switch (i.substring(i.lastIndexOf("#") + 1)) {
216            case "cancel":
217                e(d);
218                break;
219            case "finish":
220                h(d, g);
221                break;
222            case "next":
223                s(d, f, g);
224                break;
225            case "previous":
226                t(d, f, g)
227        }
228    }
229
230    function D(a, b, c) {
231        if (b.enablePagination) {
232            var d = a.find(".actions a[href$='#finish']").parent(),
233                e = a.find(".actions a[href$='#next']").parent();
234            if (!b.forceMoveForward) {
235                var f = a.find(".actions a[href$='#previous']").parent();
236                f._enableAria(c.currentIndex > 0)
237            }
238            b.enableFinishButton && b.showFinishButtonAlways ? (d._enableAria(c.stepCount > 0), e._enableAria(c.stepCount > 1 && c.stepCount > c.currentIndex + 1)) : (d._showAria(b.enableFinishButton && c.stepCount === c.currentIndex + 1), e._showAria(0 === c.stepCount || c.stepCount > c.currentIndex + 1)._enableAria(c.stepCount > c.currentIndex + 1 || !b.enableFinishButton))
239        }
240    }
241
242    function E(b, c, d, e) {
243        var f = j(b, d.currentIndex),
244            g = a('<span class="current-info audible">' + c.labels.current + " </span>"),
245            h = b.find(".content > .title");
246        if (null != e) {
247            var i = j(b, e);
248            i.parent().addClass("done").removeClass("error")._selectAria(!1), h.eq(e).removeClass("current").next(".body").removeClass("current"), g = i.find(".current-info"), f.focus()
249        }
250        f.prepend(g).parent()._selectAria().removeClass("done")._enableAria(), h.eq(d.currentIndex).addClass("current").next(".body").addClass("current")
251    }
252
253    function F(a, b, c, d) {
254        for (var e = q(a), f = d; f < c.stepCount; f++) {
255            var g = e + V + f,
256                h = e + W + f,
257                i = e + X + f,
258                j = a.find(".title").eq(f)._id(i);
259            a.find(".steps a").eq(f)._id(g)._aria("controls", h).attr("href", "#" + i).html(M(b.titleTemplate, {
260                index: f + 1,
261                title: j.html()
262            })), a.find(".body").eq(f)._id(h)._aria("labelledby", i)
263        }
264    }
265
266    function G(a, b) {
267        var c = i(a);
268        a.bind("canceled" + c, b.onCanceled), a.bind("contentLoaded" + c, b.onContentLoaded), a.bind("finishing" + c, b.onFinishing), a.bind("finished" + c, b.onFinished), a.bind("init" + c, b.onInit), a.bind("stepChanging" + c, b.onStepChanging), a.bind("stepChanged" + c, b.onStepChanged), b.enableKeyNavigation && a.bind("keyup" + c, z), a.find(".actions a").bind("click" + c, C)
269    }
270
271    function H(a, b, c, d) {
272        return 0 > d || d >= c.stepCount || c.currentIndex === d ? !1 : (I(a, d), c.currentIndex > d && (c.currentIndex--, O(a, b, c)), c.stepCount--, l(a, d).remove(), k(a, d).remove(), j(a, d).parent().remove(), 0 === d && a.find(".steps li").first().addClass("first"), d === c.stepCount && a.find(".steps li").eq(d).addClass("last"), F(a, b, c, d), D(a, b, c), !0)
273    }
274
275    function I(a, b) {
276        o(a).splice(b, 1)
277    }
278
279    function J(b, c, d) {
280        var e = '<{0} class="{1}">{2}</{0}>',
281            f = r(_, c.stepsOrientation),
282            g = f === _.vertical ? " vertical" : "",
283            h = a(e.format(c.contentContainerTag, "content " + c.clearFixCssClass, b.html())),
284            i = a(e.format(c.stepsContainerTag, "steps " + c.clearFixCssClass, '<ul role="tablist"></ul>')),
285            j = h.children(c.headerTag),
286            k = h.children(c.bodyTag);
287        b.attr("role", "application").empty().append(i).append(h).addClass(c.cssClass + " " + c.clearFixCssClass + g), k.each(function(c) {
288            K(b, d, a(this), c)
289        }), j.each(function(e) {
290            N(b, c, d, a(this), e)
291        }), E(b, c, d), L(b, c, d)
292    }
293
294    function K(a, b, c, d) {
295        var e = q(a),
296            f = e + W + d,
297            g = e + X + d;
298        c._id(f).attr("role", "tabpanel")._aria("labelledby", g).addClass("body")._showAria(b.currentIndex === d)
299    }
300
301    function L(a, b, c) {
302        if (b.enablePagination) {
303            var d = '<{0} class="actions {1}"><ul role="menu" aria-label="{2}">{3}</ul></{0}>',
304                e = '<li><a href="#{0}" role="menuitem">{1}</a></li>',
305                f = "";
306            b.forceMoveForward || (f += e.format("previous", b.labels.previous)), f += e.format("next", b.labels.next), b.enableFinishButton && (f += e.format("finish", b.labels.finish)), b.enableCancelButton && (f += e.format("cancel", b.labels.cancel)), a.append(d.format(b.actionContainerTag, b.clearFixCssClass, b.labels.pagination, f)), D(a, b, c), A(a, b, c)
307        }
308    }
309
310    function M(a, c) {
311        for (var d = a.match(/#([a-z]*)#/gi), e = 0; e < d.length; e++) {
312            var f = d[e],
313                g = f.substring(1, f.length - 1);
314            c[g] === b && R("The key '{0}' does not exist in the substitute collection!", g), a = a.replace(f, c[g])
315        }
316        return a
317    }
318
319    function N(b, c, d, e, f) {
320        var g = q(b),
321            h = g + V + f,
322            j = g + W + f,
323            k = g + X + f,
324            l = b.find(".steps > ul"),
325            m = M(c.titleTemplate, {
326                index: f + 1,
327                title: e.html()
328            }),
329            n = a('<li role="tab"><a id="' + h + '" href="#' + k + '" aria-controls="' + j + '">' + m + "</a></li>");
330        n._enableAria(c.enableAllSteps || d.currentIndex > f), d.currentIndex > f && n.addClass("done"), e._id(k).attr("tabindex", "-1").addClass("title"), 0 === f ? l.prepend(n) : l.find("li").eq(f - 1).after(n), 0 === f && l.find("li").removeClass("first").eq(f).addClass("first"), f === d.stepCount - 1 && l.find("li").removeClass("last").eq(f).addClass("last"), n.children("a").bind("click" + i(b), Q)
331    }
332
333    function O(b, c, d) {
334        c.saveState && a.cookie && a.cookie(U + q(b), d.currentIndex)
335    }
336
337    function P(b, c, d, e, f, g) {
338        var h = b.find(".content > .body"),
339            i = r(ab, c.transitionEffect),
340            j = c.transitionEffectSpeed,
341            k = h.eq(e),
342            l = h.eq(f);
343        switch (i) {
344            case ab.fade:
345            case ab.slide:
346                var m = i === ab.fade ? "fadeOut" : "slideUp",
347                    o = i === ab.fade ? "fadeIn" : "slideDown";
348                d.transitionElement = k, l[m](j, function() {
349                    var b = a(this)._showAria(!1).parent().parent(),
350                        c = n(b);
351                    c.transitionElement && (c.transitionElement[o](j, function() {
352                        a(this)._showAria()
353                    }).promise().done(g), c.transitionElement = null)
354                });
355                break;
356            case ab.slideLeft:
357                var p = l.outerWidth(!0),
358                    q = e > f ? -p : p,
359                    s = e > f ? p : -p;
360                a.when(l.animate({
361                    left: q
362                }, j, function() {
363                    a(this)._showAria(!1)
364                }), k.css("left", s + "px")._showAria().animate({
365                    left: 0
366                }, j)).done(g);
367                break;
368            default:
369                a.when(l._showAria(!1), k._showAria()).done(g)
370        }
371    }
372
373    function Q(b) {
374        b.preventDefault();
375        var c = a(this),
376            d = c.parent().parent().parent().parent(),
377            e = m(d),
378            f = n(d),
379            g = f.currentIndex;
380        if (c.parent().is(":not(.disabled):not(.current)")) {
381            var h = c.attr("href"),
382                i = parseInt(h.substring(h.lastIndexOf("-") + 1), 0);
383            u(d, e, f, i)
384        }
385        return g === f.currentIndex ? (j(d, g).focus(), !1) : void 0
386    }
387
388    function R(a) {
389        throw arguments.length > 1 && (a = a.format(Array.prototype.slice.call(arguments, 1))), new Error(a)
390    }
391
392    function S(a, b) {
393        null == b && R("The argument '{0}' is null or undefined.", a)
394    }
395    a.fn.extend({
396        _aria: function(a, b) {
397            return this.attr("aria-" + a, b)
398        },
399        _removeAria: function(a) {
400            return this.removeAttr("aria-" + a)
401        },
402        _enableAria: function(a) {
403            return null == a || a ? this.removeClass("disabled")._aria("disabled", "false") : this.addClass("disabled")._aria("disabled", "true")
404        },
405        _showAria: function(a) {
406            return null == a || a ? this.show()._aria("hidden", "false") : this.hide()._aria("hidden", "true")
407        },
408        _selectAria: function(a) {
409            return null == a || a ? this.addClass("current")._aria("selected", "true") : this.removeClass("current")._aria("selected", "false")
410        },
411        _id: function(a) {
412            return a ? this.attr("id", a) : this.attr("id")
413        }
414    }), String.prototype.format || (String.prototype.format = function() {
415        for (var b = 1 === arguments.length && a.isArray(arguments[0]) ? arguments[0] : arguments, c = this, d = 0; d < b.length; d++) {
416            var e = new RegExp("\\{" + d + "\\}", "gm");
417            c = c.replace(e, b[d])
418        }
419        return c
420    });
421    var T = 0,
422        U = "jQu3ry_5teps_St@te_",
423        V = "-t-",
424        W = "-p-",
425        X = "-h-",
426        Y = "Index out of range.",
427        Z = "One or more corresponding step {0} are missing.";
428    a.fn.steps = function(b) {
429        return a.fn.steps[b] ? a.fn.steps[b].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof b && b ? void a.error("Method " + b + " does not exist on jQuery.steps") : w.apply(this, arguments)
430    }, a.fn.steps.add = function(a) {
431        var b = n(this);
432        return x(this, m(this), b, b.stepCount, a)
433    }, a.fn.steps.destroy = function() {
434        return g(this, m(this))
435    }, a.fn.steps.finish = function() {
436        h(this, n(this))
437    }, a.fn.steps.getCurrentIndex = function() {
438        return n(this).currentIndex
439    }, a.fn.steps.getCurrentStep = function() {
440        return p(this, n(this).currentIndex)
441    }, a.fn.steps.getStep = function(a) {
442        return p(this, a)
443    }, a.fn.steps.insert = function(a, b) {
444        return x(this, m(this), n(this), a, b)
445    }, a.fn.steps.next = function() {
446        return s(this, m(this), n(this))
447    }, a.fn.steps.previous = function() {
448        return t(this, m(this), n(this))
449    }, a.fn.steps.remove = function(a) {
450        return H(this, m(this), n(this), a)
451    }, a.fn.steps.setStep = function() {
452        throw new Error("Not yet implemented!")
453    }, a.fn.steps.skip = function() {
454        throw new Error("Not yet implemented!")
455    };
456    var $ = a.fn.steps.contentMode = {
457            html: 0,
458            iframe: 1,
459            async: 2
460        },
461        _ = a.fn.steps.stepsOrientation = {
462            horizontal: 0,
463            vertical: 1
464        },
465        ab = a.fn.steps.transitionEffect = {
466            none: 0,
467            fade: 1,
468            slide: 2,
469            slideLeft: 3
470        },
471        bb = a.fn.steps.stepModel = {
472            title: "",
473            content: "",
474            contentUrl: "",
475            contentMode: $.html,
476            contentLoaded: !1
477        },
478        cb = a.fn.steps.defaults = {
479            headerTag: "h1",
480            bodyTag: "div",
481            contentContainerTag: "div",
482            actionContainerTag: "div",
483            stepsContainerTag: "div",
484            cssClass: "wizard",
485            clearFixCssClass: "clearfix",
486            stepsOrientation: _.horizontal,
487            titleTemplate: '<span class="number">#index#.</span> #title#',
488            loadingTemplate: '<span class="spinner"></span> #text#',
489            autoFocus: !1,
490            enableAllSteps: !1,
491            enableKeyNavigation: !0,
492            enablePagination: !0,
493            suppressPaginationOnFocus: !0,
494            enableContentCache: !0,
495            enableCancelButton: !1,
496            enableFinishButton: !0,
497            preloadContent: !1,
498            showFinishButtonAlways: !1,
499            forceMoveForward: !1,
500            saveState: !1,
501            startIndex: 0,
502            transitionEffect: ab.none,
503            transitionEffectSpeed: 200,
504            onStepChanging: function() {
505                return !0
506            },
507            onStepChanged: function() {},
508            onCanceled: function() {},
509            onFinishing: function() {
510                return !0
511            },
512            onFinished: function() {},
513            onContentLoaded: function() {},
514            onInit: function() {},
515            labels: {
516                cancel: "Cancel",
517                current: "current step:",
518                pagination: "Pagination",
519                finish: "Finish",
520                next: "Next",
521                previous: "Previous",
522                loading: "Loading ..."
523            }
524        }
525}(jQuery);

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.