PageSourceSearch

https://www.iran-booking.com/js/kamadatepicker.min.js

js iran-booking.com collected 2026-09-24 12:17:56 UTC 22,659 bytes, 644 lines download raw bytes

1/*! kamadatepicker - version 1.5.3 */ !(function (t) {
2  var e = {};
3  function o(n) {
4    if (e[n]) return e[n].exports;
5    var a = (e[n] = { i: n, l: !1, exports: {} });
6    return t[n].call(a.exports, a, a.exports, o), (a.l = !0), a.exports;
7  }
8  (o.m = t),
9    (o.c = e),
10    (o.d = function (t, e, n) {
11      o.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n });
12    }),
13    (o.r = function (t) {
14      "undefined" != typeof Symbol &&
15        Symbol.toStringTag &&
16        Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }),
17        Object.defineProperty(t, "__esModule", { value: !0 });
18    }),
19    (o.t = function (t, e) {
20      if ((1 & e && (t = o(t)), 8 & e)) return t;
21      if (4 & e && "object" == typeof t && t && t.__esModule) return t;
22      var n = Object.create(null);
23      if (
24        (o.r(n),
25        Object.defineProperty(n, "default", { enumerable: !0, value: t }),
26        2 & e && "string" != typeof t)
27      )
28        for (var a in t)
29          o.d(
30            n,
31            a,
32            function (e) {
33              return t[e];
34            }.bind(null, a)
35          );
36      return n;
37    }),
38    (o.n = function (t) {
39      var e =
40        t && t.__esModule
41          ? function () {
42              return t.default;
43            }
44          : function () {
45              return t;
46            };
47      return o.d(e, "a", e), e;
48    }),
49    (o.o = function (t, e) {
50      return Object.prototype.hasOwnProperty.call(t, e);
51    }),
52    (o.p = ""),
53    o((o.s = 0));
54})([
55  function (t, e, o) {
56    t.exports = o(1);
57  },
58  function (t, e, o) {
59    function n(t) {
60      return (n =
61        "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
62          ? function (t) {
63              return typeof t;
64            }
65          : function (t) {
66              return t &&
67                "function" == typeof Symbol &&
68                t.constructor === Symbol &&
69                t !== Symbol.prototype
70                ? "symbol"
71                : typeof t;
72            })(t);
73    }
74    o(2),
75      (window.kamaDatepicker = function (t, e) {
76        if (
77          -1 === ["string", "object"].indexOf(n(t)) ||
78          ("object" === n(t) && null === t) ||
79          ("strinf" == typeof t && 0 === t.length)
80        )
81          return void console.error(
82            "kamadatepicker error: input ID is not an object, string or is an empty strong!"
83          );
84        var o,
85          a,
86          r,
87          i,
88          d,
89          l,
90          s,
91          c,
92          p,
93          u,
94          f = e || {},
95          y = !1,
96          g = !1,
97          b = [
98            "Ù ",
99            "Ù¡",
100            "Ù¢",
101            "Ù£",
102            "Û´",
103            "Ûµ",
104            "Û¶",
105            "Ù§",
106            "Ù¨",
107            "Ù©",
108            "١٠",
109            "١١",
110            "١٢",
111            "١٣",
112            "Ù¡Û´",
113            "Ù¡Ûµ",
114            "Ù¡Û¶",
115            "Ù¡Ù§",
116            "١٨",
117            "١٩",
118            "٢٠",
119            "٢١",
120            "٢٢",
121            "٢٣",
122            "Ù¢Û´",
123            "Ù¢Ûµ",
124            "Ù¢Û¶",
125            "Ù¢Ù§",
126            "٢٨",
127            "٢٩",
128            "٣٠",
129            "٣١",
130            "٣٢",
131          ];
132        (f.placeholder = void 0 !== f.placeholder ? f.placeholder : ""),
133          (f.twodigit = void 0 === f.twodigit || f.twodigit),
134          (f.closeAfterSelect =
135            void 0 === f.closeAfterSelect || f.closeAfterSelect),
136          (f.nextButtonIcon = void 0 !== f.nextButtonIcon && f.nextButtonIcon),
137          (f.previousButtonIcon =
138            void 0 !== f.previousButtonIcon && f.previousButtonIcon),
139          (f.buttonsColor = void 0 !== f.buttonsColor && f.buttonsColor),
140          (f.forceFarsiDigits =
141            void 0 !== f.forceFarsiDigits && f.forceFarsiDigits),
142          (f.markToday = void 0 !== f.markToday && f.markToday),
143          (f.markHolidays = void 0 !== f.markHolidays && f.markHolidays),
144          (f.highlightSelectedDay =
145            void 0 !== f.highlightSelectedDay && f.highlightSelectedDay),
146          (f.sync = void 0 !== f.sync && f.sync),
147          (f.gotoToday = void 0 !== f.gotoToday && f.gotoToday),
148          (f.pastYearsCount = isNaN(f.pastYearsCount) ? 95 : f.pastYearsCount),
149          (f.futureYearsCount = isNaN(f.futureYearsCount)
150            ? 6
151            : f.futureYearsCount),
152          (f.holidays = f.holidays || [
153            { month: 1, day: 1 },
154            { month: 1, day: 2 },
155            { month: 1, day: 3 },
156            { month: 1, day: 4 },
157            { month: 1, day: 12 },
158            { month: 1, day: 13 },
159            { month: 3, day: 14 },
160            { month: 3, day: 15 },
161            { month: 11, day: 22 },
162            { month: 12, day: 29 },
163          ]),
164          (f.disableHolidays =
165            void 0 !== f.disableHolidays && f.disableHolidays),
166          "string" == typeof t
167            ? (u = $("#" + t))
168            : ((u = $(t)),
169              (t = (function () {
170                var t, e;
171                for (t = "", e = 0; e < 32; e++)
172                  (8 != e && 12 != e && 16 != e && 20 != e) || (t += "-"),
173                    (t += Math.floor(16 * Math.random())
174                      .toString(16)
175                      .toUpperCase());
176                return t;
177              })()));
178        void 0 === u.attr("placeholder") &&
179          u.attr("placeholder", f.placeholder);
180        u.wrap(
181          "<div id='bd-root-" + t + "' style='position: relative;'></div>"
182        ),
183          u.after(
184            "<div id='bd-main-" +
185              t +
186              "' class='bd-main bd-hide' style='position: absolute; direction: rtl;'></div>"
187          );
188        var v = $("#bd-main-" + t);
189        v.append("<div class='bd-calendar'></div>");
190        var h = v.find(".bd-calendar");
191        h.append("<div class='bd-title'></div>");
192        var m = h.find(".bd-title");
193        h.append(
194          "<table class='bd-table' dir='rtl' cellspacing='0' cellpadding='0'></table>"
195        ),
196          f.swapNextPrev
197            ? m.append(
198                "<button id='bd-prev-" +
199                  t +
200                  "' class='bd-prev' type='button' title='ماه قبلی' data-toggle='tooltip'><span>قبلی</span></button>"
201              )
202            : m.append(
203                "<button id='bd-next-" +
204                  t +
205                  "' class='bd-next' type='button' title='ماه بعدی' data-toggle='tooltip'><span>بعدی</span></button>"
206              );
207        m.append(
208          "<div class='bd-dropdown'></div><div class='bd-dropdown'></div>"
209        ),
210          m
211            .find(".bd-dropdown:nth-child(2)")
212            .append(
213              "<select id='bd-month-" + t + "' class='bd-month'></select>"
214            ),
215          m
216            .find(".bd-dropdown:nth-child(3)")
217            .append("<select id='bd-year-" + t + "' class='bd-year'></select>"),
218          f.swapNextPrev
219            ? m.append(
220                "<button id='bd-next-" +
221                  t +
222                  "' class='bd-next' type='button' title='ماه بعدی' data-toggle='tooltip'><span>بعدی</span></button>"
223              )
224            : m.append(
225                "<button id='bd-prev-" +
226                  t +
227                  "' class='bd-prev' type='button' title='ماه قبلی' data-toggle='tooltip'><span>قبلی</span></button>"
228              );
229        var x = $("#bd-next-" + t);
230        f.nextButtonIcon &&
231          (x.find("span").css("display", "none"),
232          -1 !== f.nextButtonIcon.indexOf(".")
233            ? x.css("background-image", "url(" + f.nextButtonIcon + ")")
234            : x.addClass(f.nextButtonIcon));
235        var I = $("#bd-month-" + t);
236        $.each(
237          {
238            1: "فروردین",
239            2: "اردیبهشت",
240            3: "خرداد",
241            4: "تیر",
242            5: "مرداد",
243            6: "شهریور",
244            7: "مهر",
245            8: "آبان",
246            9: "آذر",
247            10: "دی",
248            11: "بهمن",
249            12: "اسفند",
250          },
251          function (t, e) {
252            I.append($("<option></option>").attr("value", t).text(e));
253          }
254        );
255        var C = $("#bd-year-" + t),
256          w = $("#bd-prev-" + t);
257        f.nextButtonIcon &&
258          (w.find("span").css("display", "none"),
259          -1 !== f.previousButtonIcon.indexOf(".")
260            ? w.css("background-image", "url(" + f.previousButtonIcon + ")")
261            : w.addClass(f.previousButtonIcon));
262        f.buttonsColor &&
263          (x.css("color", f.buttonsColor),
264          x.find("span").css("color", f.buttonsColor),
265          w.css("color", f.buttonsColor),
266          w.find("span").css("color", f.buttonsColor));
267        h.find(".bd-table").append("<thead><tr></tr></thead>"),
268          $.each(
269            {
270              شنبه: "ش",
271              یکشنبه: "ی",
272              دوشنبه: "د",
273              "سه شنبه": "س",
274              چهارشنبه: "چ",
275              "پنج شنبه": "پ",
276              جمعه: "ج",
277            },
278            function (t, e) {
279              h.find(".bd-table thead tr").append($("<th></th>").text(e));
280            }
281          ),
282          h
283            .find(".bd-table")
284            .append(
285              "<tbody id='bd-table-days-" +
286                t +
287                "' class='bd-table-days'></tbody>"
288            );
289        var S = $("#bd-table-days-" + t);
290        if (f.gotoToday) {
291          h.append("<div class='bd-goto-today'>برو به امروز</div>");
292          var H = h.find(".bd-goto-today");
293        }
294        function k() {
295          var e,
296            o,
297            n,
298            a,
299            r,
300            i = document.querySelector("#bd-main-".concat(t)),
301            d = 1 === u.length ? u[0] : u;
302          if ((d.offsetHeight, i.offsetHeight, "top" === f.position))
303            i.style.top = "".concat(-1 * i.offsetHeight, "px");
304          else if ("auto" === f.position) {
305            var l;
306            f.parentId && (l = document.querySelector("#".concat(f.parentId))),
307              (f.parentId && l) ||
308                (l = document.querySelector("#bd-root-".concat(t)));
309            var s = ((e = d), (o = c(l)), (n = c(e)), Math.abs(o.y - n.y));
310            l.offsetHeight - s - (d.offsetHeight + i.offsetHeight) > 0
311              ? (i.style.top = "".concat(d.offsetHeight, "px"))
312              : s - (d.offsetHeight + i.offsetHeight) > 0
313              ? (i.style.top = "".concat(-1 * i.offsetHeight, "px"))
314              : (i.style.top = "".concat(d.offsetHeight, "px"));
315          } else i.style.top = "".concat(d.offsetHeight, "px");
316          function c(t) {
317            var e = t.getBoundingClientRect(),
318              o = e.top;
319            return { x: e.left, y: o };
320          }
321          ((a = i.getBoundingClientRect()),
322          ((r = {}).top = a.top < 0),
323          (r.left = a.left < 0),
324          (r.bottom =
325            a.bottom >
326            (window.innerHeight || document.documentElement.clientHeight)),
327          (r.right =
328            a.right >
329            (window.innerWidth || document.documentElement.clientWidth)),
330          (r.any = r.top || r.left || r.bottom || r.right),
331          (r.all = r.top && r.left && r.bottom && r.right),
332          r).left && (i.style.left = 0);
333        }
334        u
335          .on("focus", function () {
336            v.removeClass("bd-hide"),
337              f.sync && !1 === g && (F(), (g = !0)),
338              k();
339          })
340          .on("blur", function () {
341            0 == y
342              ? (v.addClass("bd-hide"), (g = !1))
343              : ((y = !1), u.focus(), event.preventDefault());
344          }),
345          v.on("mousedown", function (t) {
346            y = !0;
347          }),
348          I.on("change", function () {
349            (a = parseInt(this.value)),
350              (s = _(o, a)),
351              (l = q(o, a)),
352              R(s, l),
353              k();
354          }),
355          C.on("change", function () {
356            (o = parseInt(this.value)),
357              (s = _(o, a)),
358              (l = q(o, a)),
359              R(s, l),
360              k();
361          });
362        var D = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
363          B = [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29];
364        function O(t, e, o) {
365          return Y(
366            (function (t, e, o) {
367              var n = j(t);
368              return (
369                T(n.gy, 3, n.march) + 31 * (e - 1) - M(e, 7) * (e - 7) + o - 1
370              );
371            })(t, e, o)
372          );
373        }
374        function j(t) {
375          var e,
376            o,
377            n,
378            a,
379            r,
380            i,
381            d = [
382              -61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060,
383              2097, 2192, 2262, 2324, 2394, 2456, 3178,
384            ],
385            l = d.length,
386            s = t + 621,
387            c = -14,
388            p = d[0];
389          if (p > t || t >= d[l - 1])
390            throw new Error("Invalid Jalaali year " + t);
391          for (i = 1; l > i && ((o = (e = d[i]) - p), !(e > t)); i += 1)
392            (c = c + 8 * M(o, 33) + M(P(o, 33), 4)), (p = e);
393          return (
394            (c = c + 8 * M((r = t - p), 33) + M(P(r, 33) + 3, 4)),
395            4 === P(o, 33) && o - r == 4 && (c += 1),
396            (a = 20 + c - (M(s, 4) - M(3 * (M(s, 100) + 1), 4) - 150)),
397            6 > o - r && (r = r - o + 33 * M(o + 4, 33)),
398            -1 === (n = P(P(r + 1, 33) - 1, 4)) && (n = 4),
399            { leap: n, gy: s, march: a }
400          );
401        }
402        function T(t, e, o) {
403          var n =
404            M(1461 * (t + M(e - 8, 6) + 100100), 4) +
405            M(153 * P(e + 9, 12) + 2, 5) +
406            o -
407            34840408;
408          return n - M(3 * M(t + 100100 + M(e - 8, 6), 100), 4) + 752;
409        }
410        function Y(t) {
411          var e, o, n, a;
412          return (
413            (e =
414              (e = 4 * t + 139361631) +
415              4 * M(3 * M(4 * t + 183187720, 146097), 4) -
416              3908),
417            (o = 5 * M(P(e, 1461), 4) + 308),
418            (n = M(P(o, 153), 5) + 1),
419            (a = P(M(o, 153), 12) + 1),
420            { gy: M(e, 1461) - 100100 + M(8 - a, 6), gm: a, gd: n }
421          );
422        }
423        function M(t, e) {
424          return ~~(t / e);
425        }
426        function P(t, e) {
427          return t - ~~(t / e) * e;
428        }
429        var F = function () {
430            var t = N(u.val());
431            "" !== t &&
432              ((t = t.split("/")),
433              I.val(parseInt(t[1])),
434              I.trigger("change"),
435              C.val(parseInt(t[0])),
436              C.trigger("change"),
437              f.highlightSelectedDay &&
438                (v.find(".bd-selected-day").removeClass("bd-selected-day"),
439                v.find(".day-" + parseInt(t[2])).addClass("bd-selected-day")));
440          },
441          N = function (t) {
442            return "" === t
443              ? ""
444              : ((t = t.split("/"))[1].length < 2 &&
445                  t[1] < 10 &&
446                  (t[1] = "0" + t[1]),
447                t[2].length < 2 && t[2] < 10 && (t[2] = "0" + t[2]),
448                (t = t.join("/")));
449          },
450          _ = function (t, e) {
451            return e < 7
452              ? 31
453              : e < 12 ||
454                (function (t) {
455                  var e;
456                  return t > 1243 && t < 1473
457                    ? 1 == (e = t % 33) ||
458                        5 == e ||
459                        9 == e ||
460                        13 == e ||
461                        17 == e ||
462                        22 == e ||
463                        26 == e ||
464                        30 == e
465                    : "unknown";
466                })(t)
467              ? 30
468              : 29;
469          };
470        (c = new Date()),
471          (p = (function (t, e, o) {
472            for (
473              var n = (t = parseInt(t)) - 1600,
474                a = (e = parseInt(e)) - 1,
475                r = (o = parseInt(o)) - 1,
476                i =
477                  365 * n +
478                  parseInt((n + 3) / 4) -
479                  parseInt((n + 99) / 100) +
480                  parseInt((n + 399) / 400),
481                d = 0;
482              a > d;
483              ++d
484            )
485              i += D[d];
486            a > 1 && ((n % 4 == 0 && n % 100 != 0) || n % 400 == 0) && ++i;
487            var l = (i += r) - 79,
488              s = parseInt(l / 12053);
489            l %= 12053;
490            var c = 979 + 33 * s + 4 * parseInt(l / 1461);
491            for (
492              (l %= 1461) >= 366 &&
493                ((c += parseInt((l - 1) / 365)), (l = (l - 1) % 365)),
494                d = 0;
495              11 > d && l >= B[d];
496              ++d
497            )
498              l -= B[d];
499            return [c, d + 1, l + 1];
500          })(c.getFullYear(), c.getMonth() + 1, c.getDate()));
501        for (var A = [], E = 0; E < 3; E++) A[E] = p[E];
502        (r = p[0]),
503          (i = p[1]),
504          (d = p[2]),
505          (o = A[0]),
506          (a = A[1]),
507          A[2],
508          I.val(a),
509          (function (t) {
510            C.find("option").remove();
511            for (var e = 0; e < f.pastYearsCount + f.futureYearsCount; e++) {
512              var o = t - f.pastYearsCount + e + "";
513              if (f.forceFarsiDigits)
514                for (var n = 0; n < 10; n++) {
515                  var a = new RegExp(n, "g");
516                  o = o.replace(a, b[n]);
517                }
518              C.append(
519                $("<option>", { value: t - f.pastYearsCount + e, text: o })
520              );
521            }
522          })(o),
523          C.val(o),
524          (s = _(o, a));
525        var q = function (t, e) {
526          var o,
527            n = O(t, e, 1);
528          return (
529            (n = new Date(n.gy + "/" + n.gm + "/" + n.gd)),
530            (o = n.getDay()) < 6 ? o + 1 : 0
531          );
532        };
533        l = q(o, a);
534        var R = function (e, n) {
535          S.empty();
536          for (var l = 1, s = 1; l <= e; ) {
537            S.append($("<tr>", { class: "tr-" + s }));
538            for (var c = 0; c < 7; c++) {
539              if (1 == l)
540                for (var p = 0; p < n; )
541                  $("#bd-table-days-" + t + " .tr-1").append(
542                    $("<td>", { class: "bd-empty-cell" })
543                  ),
544                    p++,
545                    c++;
546              if (c < 7 && l <= e) {
547                var y =
548                  '<td><button class="day day-' +
549                  l +
550                  '" type="button">' +
551                  (f.forceFarsiDigits ? b[l] : l) +
552                  "</button></td>";
553                if (f.markToday && l == d && i == a && r == o) {
554                  var g = y.indexOf("day day-");
555                  y = y.slice(0, g) + " bd-today " + y.slice(g);
556                }
557                if (f.markHolidays) {
558                  var h = !1;
559                  if (6 == c) h = !0;
560                  else
561                    for (var m = 0; m < f.holidays.length; m++) {
562                      var x = f.holidays[m];
563                      if (
564                        ((x.year && o === x.year) || !x.year) &&
565                        l === x.day &&
566                        a === x.month
567                      ) {
568                        h = !0;
569                        break;
570                      }
571                    }
572                  if (h) {
573                    var I = y.indexOf("day day-");
574                    if (
575                      ((y = y.slice(0, I) + " bd-holiday " + y.slice(I)),
576                      f.disableHolidays)
577                    ) {
578                      var C = y.indexOf('type="button"');
579                      y = y.slice(0, C) + " disabled " + y.slice(C);
580                    }
581                  }
582                }
583                $("#bd-table-days-" + t + " .tr-" + s).append(y), l++;
584              }
585            }
586            s++;
587          }
588          if (f.highlightSelectedDay) {
589            var w = u.val();
590            (w = w.split("/"))[0] == o &&
591              w[1] == a &&
592              (v.find(".bd-selected-day").removeClass("bd-selected-day"),
593              v.find(".day-" + parseInt(w[2])).addClass("bd-selected-day"));
594          }
595        };
596        u.parent().on("click", "button.day", function () {
597          var t =
598            o +
599            "/" +
600            a +
601            "/" +
602            $(this)
603              .attr("class")
604              .split(" ")
605              [$(this).attr("class").split(" ").indexOf("day") + 1].split(
606                "-"
607              )[1];
608          f.twodigit && (t = N(t)),
609            u.val(t),
610            u.trigger("change"),
611            f.closeAfterSelect && ((y = !1), u.trigger("blur")),
612            f.highlightSelectedDay &&
613              (v.find(".bd-selected-day").removeClass("bd-selected-day"),
614              $(this).addClass("bd-selected-day"));
615        }),
616          x.on("click", function () {
617            I.val() < 12
618              ? (I.val(parseInt(I.val()) + 1), I.trigger("change"))
619              : C.val() != C[0].options[C[0].options.length - 1].value &&
620                (I.val(1),
621                I.trigger("change"),
622                C.val(parseInt(C.val()) + 1),
623                C.trigger("change"));
624          }),
625          w.on("click", function () {
626            I.val() > 1
627              ? (I.val(parseInt(I.val()) - 1), I.trigger("change"))
628              : C.val() != C[0].options[0].value &&
629                (I.val(12),
630                I.trigger("change"),
631                C.val(parseInt(C.val()) - 1),
632                C.trigger("change"));
633          }),
634          f.gotoToday &&
635            H.on("click", function () {
636              I.val(i), I.trigger("change"), C.val(r), C.trigger("change");
637            });
638        R(s, l),
639          "function" == typeof $().modal &&
640            $('[data-toggle="tooltip"]').tooltip();
641      });
642  },
643  function (t, e, o) {},
644]);

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.