UNPKG

react-nepali-date-picker-lite

Version:
989 lines (985 loc) 42.8 kB
import "./index.css"; import oe, { forwardRef as wt, useState as He, useRef as Ct, useEffect as Ue } from "react"; var ge = { exports: {} }, X = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Je; function St() { if (Je) return X; Je = 1; var t = oe, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 }; function p(m, I, C) { var y, b = {}, T = null, P = null; C !== void 0 && (T = "" + C), I.key !== void 0 && (T = "" + I.key), I.ref !== void 0 && (P = I.ref); for (y in I) u.call(I, y) && !d.hasOwnProperty(y) && (b[y] = I[y]); if (m && m.defaultProps) for (y in I = m.defaultProps, I) b[y] === void 0 && (b[y] = I[y]); return { $$typeof: n, type: m, key: T, ref: P, props: b, _owner: o.current }; } return X.Fragment = a, X.jsx = p, X.jsxs = p, X; } var Q = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var $e; function Ot() { return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() { var t = oe, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), m = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), R = Symbol.iterator, F = "@@iterator"; function W(e) { if (e === null || typeof e != "object") return null; var r = R && e[R] || e[F]; return typeof r == "function" ? r : null; } var E = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function _(e) { { for (var r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), c = 1; c < r; c++) s[c - 1] = arguments[c]; Y("error", e, s); } } function Y(e, r, s) { { var c = E.ReactDebugCurrentFrame, v = c.getStackAddendum(); v !== "" && (r += "%s", s = s.concat([v])); var g = s.map(function(h) { return String(h); }); g.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, g); } } var z = !1, B = !1, M = !1, S = !1, N = !1, x; x = Symbol.for("react.module.reference"); function nt(e) { return !!(typeof e == "string" || typeof e == "function" || e === u || e === d || N || e === o || e === C || e === y || S || e === P || z || B || M || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === b || e.$$typeof === p || e.$$typeof === m || e.$$typeof === I || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. e.$$typeof === x || e.getModuleId !== void 0)); } function at(e, r, s) { var c = e.displayName; if (c) return c; var v = r.displayName || r.name || ""; return v !== "" ? s + "(" + v + ")" : s; } function De(e) { return e.displayName || "Context"; } function A(e) { if (e == null) return null; if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null; if (typeof e == "string") return e; switch (e) { case u: return "Fragment"; case a: return "Portal"; case d: return "Profiler"; case o: return "StrictMode"; case C: return "Suspense"; case y: return "SuspenseList"; } if (typeof e == "object") switch (e.$$typeof) { case m: var r = e; return De(r) + ".Consumer"; case p: var s = e; return De(s._context) + ".Provider"; case I: return at(e, e.render, "ForwardRef"); case b: var c = e.displayName || null; return c !== null ? c : A(e.type) || "Memo"; case T: { var v = e, g = v._payload, h = v._init; try { return A(h(g)); } catch { return null; } } } return null; } var G = Object.assign, $ = 0, je, Te, Ne, xe, Ee, Me, Re; function we() { } we.__reactDisabledLog = !0; function st() { { if ($ === 0) { je = console.log, Te = console.info, Ne = console.warn, xe = console.error, Ee = console.group, Me = console.groupCollapsed, Re = console.groupEnd; var e = { configurable: !0, enumerable: !0, value: we, writable: !0 }; Object.defineProperties(console, { info: e, log: e, warn: e, error: e, group: e, groupCollapsed: e, groupEnd: e }); } $++; } } function it() { { if ($--, $ === 0) { var e = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: G({}, e, { value: je }), info: G({}, e, { value: Te }), warn: G({}, e, { value: Ne }), error: G({}, e, { value: xe }), group: G({}, e, { value: Ee }), groupCollapsed: G({}, e, { value: Me }), groupEnd: G({}, e, { value: Re }) }); } $ < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var ce = E.ReactCurrentDispatcher, le; function ee(e, r, s) { { if (le === void 0) try { throw Error(); } catch (v) { var c = v.stack.trim().match(/\n( *(at )?)/); le = c && c[1] || ""; } return ` ` + le + e; } } var de = !1, te; { var ot = typeof WeakMap == "function" ? WeakMap : Map; te = new ot(); } function Ce(e, r) { if (!e || de) return ""; { var s = te.get(e); if (s !== void 0) return s; } var c; de = !0; var v = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var g; g = ce.current, ce.current = null, st(); try { if (r) { var h = function() { throw Error(); }; if (Object.defineProperty(h.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(h, []); } catch (k) { c = k; } Reflect.construct(e, [], h); } else { try { h.call(); } catch (k) { c = k; } e.call(h.prototype); } } else { try { throw Error(); } catch (k) { c = k; } e(); } } catch (k) { if (k && c && typeof k.stack == "string") { for (var f = k.stack.split(` `), w = c.stack.split(` `), D = f.length - 1, j = w.length - 1; D >= 1 && j >= 0 && f[D] !== w[j]; ) j--; for (; D >= 1 && j >= 0; D--, j--) if (f[D] !== w[j]) { if (D !== 1 || j !== 1) do if (D--, j--, j < 0 || f[D] !== w[j]) { var O = ` ` + f[D].replace(" at new ", " at "); return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && te.set(e, O), O; } while (D >= 1 && j >= 0); break; } } } finally { de = !1, ce.current = g, it(), Error.prepareStackTrace = v; } var U = e ? e.displayName || e.name : "", Fe = U ? ee(U) : ""; return typeof e == "function" && te.set(e, Fe), Fe; } function ut(e, r, s) { return Ce(e, !1); } function ct(e) { var r = e.prototype; return !!(r && r.isReactComponent); } function re(e, r, s) { if (e == null) return ""; if (typeof e == "function") return Ce(e, ct(e)); if (typeof e == "string") return ee(e); switch (e) { case C: return ee("Suspense"); case y: return ee("SuspenseList"); } if (typeof e == "object") switch (e.$$typeof) { case I: return ut(e.render); case b: return re(e.type, r, s); case T: { var c = e, v = c._payload, g = c._init; try { return re(g(v), r, s); } catch { } } } return ""; } var ne = Object.prototype.hasOwnProperty, Se = {}, Oe = E.ReactDebugCurrentFrame; function ae(e) { if (e) { var r = e._owner, s = re(e.type, e._source, r ? r.type : null); Oe.setExtraStackFrame(s); } else Oe.setExtraStackFrame(null); } function lt(e, r, s, c, v) { { var g = Function.call.bind(ne); for (var h in e) if (g(e, h)) { var f = void 0; try { if (typeof e[h] != "function") { var w = Error((c || "React class") + ": " + s + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw w.name = "Invariant Violation", w; } f = e[h](r, h, c, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (D) { f = D; } f && !(f instanceof Error) && (ae(v), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", s, h, typeof f), ae(null)), f instanceof Error && !(f.message in Se) && (Se[f.message] = !0, ae(v), _("Failed %s type: %s", s, f.message), ae(null)); } } } var dt = Array.isArray; function fe(e) { return dt(e); } function ft(e) { { var r = typeof Symbol == "function" && Symbol.toStringTag, s = r && e[Symbol.toStringTag] || e.constructor.name || "Object"; return s; } } function ht(e) { try { return Ae(e), !1; } catch { return !0; } } function Ae(e) { return "" + e; } function ke(e) { if (ht(e)) return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ft(e)), Ae(e); } var V = E.ReactCurrentOwner, bt = { key: !0, ref: !0, __self: !0, __source: !0 }, Pe, ze, he; he = {}; function vt(e) { if (ne.call(e, "ref")) { var r = Object.getOwnPropertyDescriptor(e, "ref").get; if (r && r.isReactWarning) return !1; } return e.ref !== void 0; } function yt(e) { if (ne.call(e, "key")) { var r = Object.getOwnPropertyDescriptor(e, "key").get; if (r && r.isReactWarning) return !1; } return e.key !== void 0; } function gt(e, r) { if (typeof e.ref == "string" && V.current && r && V.current.stateNode !== r) { var s = A(V.current.type); he[s] || (_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', A(V.current.type), e.ref), he[s] = !0); } } function pt(e, r) { { var s = function() { Pe || (Pe = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r)); }; s.isReactWarning = !0, Object.defineProperty(e, "key", { get: s, configurable: !0 }); } } function mt(e, r) { { var s = function() { ze || (ze = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r)); }; s.isReactWarning = !0, Object.defineProperty(e, "ref", { get: s, configurable: !0 }); } } var _t = function(e, r, s, c, v, g, h) { var f = { // This tag allows us to uniquely identify this as a React Element $$typeof: n, // Built-in properties that belong on the element type: e, key: r, ref: s, props: h, // Record the component responsible for creating this element. _owner: g }; return f._store = {}, Object.defineProperty(f._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(f, "_self", { configurable: !1, enumerable: !1, writable: !1, value: c }), Object.defineProperty(f, "_source", { configurable: !1, enumerable: !1, writable: !1, value: v }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f; }; function It(e, r, s, c, v) { { var g, h = {}, f = null, w = null; s !== void 0 && (ke(s), f = "" + s), yt(r) && (ke(r.key), f = "" + r.key), vt(r) && (w = r.ref, gt(r, v)); for (g in r) ne.call(r, g) && !bt.hasOwnProperty(g) && (h[g] = r[g]); if (e && e.defaultProps) { var D = e.defaultProps; for (g in D) h[g] === void 0 && (h[g] = D[g]); } if (f || w) { var j = typeof e == "function" ? e.displayName || e.name || "Unknown" : e; f && pt(h, j), w && mt(h, j); } return _t(e, f, w, v, c, V.current, h); } } var be = E.ReactCurrentOwner, We = E.ReactDebugCurrentFrame; function H(e) { if (e) { var r = e._owner, s = re(e.type, e._source, r ? r.type : null); We.setExtraStackFrame(s); } else We.setExtraStackFrame(null); } var ve; ve = !1; function ye(e) { return typeof e == "object" && e !== null && e.$$typeof === n; } function Ye() { { if (be.current) { var e = A(be.current.type); if (e) return ` Check the render method of \`` + e + "`."; } return ""; } } function Dt(e) { { if (e !== void 0) { var r = e.fileName.replace(/^.*[\\\/]/, ""), s = e.lineNumber; return ` Check your code at ` + r + ":" + s + "."; } return ""; } } var Be = {}; function jt(e) { { var r = Ye(); if (!r) { var s = typeof e == "string" ? e : e.displayName || e.name; s && (r = ` Check the top-level render call using <` + s + ">."); } return r; } } function Ge(e, r) { { if (!e._store || e._store.validated || e.key != null) return; e._store.validated = !0; var s = jt(r); if (Be[s]) return; Be[s] = !0; var c = ""; e && e._owner && e._owner !== be.current && (c = " It was passed a child from " + A(e._owner.type) + "."), H(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, c), H(null); } } function Ze(e, r) { { if (typeof e != "object") return; if (fe(e)) for (var s = 0; s < e.length; s++) { var c = e[s]; ye(c) && Ge(c, r); } else if (ye(e)) e._store && (e._store.validated = !0); else if (e) { var v = W(e); if (typeof v == "function" && v !== e.entries) for (var g = v.call(e), h; !(h = g.next()).done; ) ye(h.value) && Ge(h.value, r); } } } function Tt(e) { { var r = e.type; if (r == null || typeof r == "string") return; var s; if (typeof r == "function") s = r.propTypes; else if (typeof r == "object" && (r.$$typeof === I || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. r.$$typeof === b)) s = r.propTypes; else return; if (s) { var c = A(r); lt(s, e.props, "prop", c, e); } else if (r.PropTypes !== void 0 && !ve) { ve = !0; var v = A(r); _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown"); } typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function Nt(e) { { for (var r = Object.keys(e.props), s = 0; s < r.length; s++) { var c = r[s]; if (c !== "children" && c !== "key") { H(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), H(null); break; } } e.ref !== null && (H(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), H(null)); } } function Le(e, r, s, c, v, g) { { var h = nt(e); if (!h) { var f = ""; (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var w = Dt(v); w ? f += w : f += Ye(); var D; e === null ? D = "null" : fe(e) ? D = "array" : e !== void 0 && e.$$typeof === n ? (D = "<" + (A(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : D = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, f); } var j = It(e, r, s, v, g); if (j == null) return j; if (h) { var O = r.children; if (O !== void 0) if (c) if (fe(O)) { for (var U = 0; U < O.length; U++) Ze(O[U], e); Object.freeze && Object.freeze(O); } else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else Ze(O, e); } return e === u ? Nt(j) : Tt(j), j; } } function xt(e, r, s) { return Le(e, r, s, !0); } function Et(e, r, s) { return Le(e, r, s, !1); } var Mt = Et, Rt = xt; Q.Fragment = u, Q.jsx = Mt, Q.jsxs = Rt; }()), Q; } process.env.NODE_ENV === "production" ? ge.exports = St() : ge.exports = Ot(); var l = ge.exports; const At = "_daybutton_azht3_1", kt = "_daynormal_azht3_21", Pt = "_daydiasbled_azht3_39", zt = "_dayselected_azht3_47", Wt = "_today_azht3_61", K = { daybutton: At, daynormal: kt, daydiasbled: Pt, dayselected: zt, today: Wt }; class L { constructor() { this.bs_date_eq = "09/17/2000", this.ad_date_eq = "01/01/1944", this.bs = [], this.bs[2e3] = [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2001] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2002] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2003] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2004] = [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2005] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2006] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2007] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2008] = [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], this.bs[2009] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2010] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2011] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2012] = [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], this.bs[2013] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2014] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2015] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2016] = [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], this.bs[2017] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2018] = [31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2019] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2020] = [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2021] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2022] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], this.bs[2023] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2024] = [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2025] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2026] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2027] = [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2028] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2029] = [31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], this.bs[2030] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2031] = [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2032] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2033] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2034] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2035] = [30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], this.bs[2036] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2037] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2038] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2039] = [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], this.bs[2040] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2041] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2042] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2043] = [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], this.bs[2044] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2045] = [31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2046] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2047] = [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2048] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2049] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], this.bs[2050] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2051] = [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2052] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2053] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], this.bs[2054] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2055] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2056] = [31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], this.bs[2057] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2058] = [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2059] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2060] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2061] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2062] = [30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31], this.bs[2063] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2064] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2065] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2066] = [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], this.bs[2067] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2068] = [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2069] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2070] = [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], this.bs[2071] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2072] = [31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], this.bs[2073] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], this.bs[2074] = [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2075] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2076] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], this.bs[2077] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], this.bs[2078] = [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2079] = [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], this.bs[2080] = [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], this.bs[2081] = [31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30], this.bs[2082] = [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30], this.bs[2083] = [31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30], this.bs[2084] = [31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30], this.bs[2085] = [31, 32, 31, 32, 30, 31, 30, 30, 29, 30, 30, 30], this.bs[2086] = [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30], this.bs[2087] = [31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30], this.bs[2088] = [30, 31, 32, 32, 30, 31, 30, 30, 29, 30, 30, 30], this.bs[2089] = [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30], this.bs[2090] = [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30], this.count_ad_days = nr, this.count_bs_days = ar, this.add_bs_days = ir, this.add_ad_days = sr, this.bs2ad = or, this.ad2bs = ur; } } function Yt(t, n) { var a = new L(); return a.add_bs_days(t, n); } function Bt(t, n) { var a = new L(); return a.count_bs_days(t, n) + 2; } function Z(t) { return t = parseInt(t, 10), 10 > t ? "0" + t : "" + t; } function me() { var t = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; return t; } function Gt(t) { var n = _e(); return t > 11 ? "Inavlid Month" : n[t]; } function _e() { var t = ["Baisakh", "Jestha", "Ashar", "Shrawan", "Bhadra", "Ashoj", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"]; return t; } function Zt() { var t = ["आ", "सो", "मं", "बु", "बि", "शु", "श"]; return t; } function Qe() { return ["बैशाख", "जेठ", "अषाढ", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मङ्सिर", "पौष", "माघ", "फाल्गुन", "चैत्र"]; } function Lt(t) { t = parseInt(t, 10); var n = Qe(); return n[t]; } function Ft() { var t = /* @__PURE__ */ new Date(), n = t.getDay(), a = Array(7); return a[0] = "Sunday", a[1] = "Monday", a[2] = "Tuesday", a[3] = "Wednesday", a[4] = "Thursday", a[5] = "Friday", a[6] = "Saturday", a[n]; } function Ke(t) { var n = et(t), a = n.split("-"), u = a[2], o = a[1], d = a[0], p = new Date(d, o - 1, u), m = p.getDay(); return m; } function Ht(t) { var n = t.split("-"), a = n[2], u = n[1], o = n[0], d = new Date(o, u - 1, a), p = d.getDay(), m = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; return m[p]; } function qe(t, n) { var a = new L(); return a.bs[t][n]; } function Ut(t, n) { var a = new Date(t, n, 0); return a.getDate(); } function Jt(t) { var n = new L(); return n.ad2bs(Ie(t)); } function et(t) { var n = new L(); return n.bs2ad(Ie(t)); } function q() { var t = new L(); return t.ad2bs(tt("/")); } function $t() { var t = me(), n = /* @__PURE__ */ new Date(), a = n.getDate(), u = n.getMonth() + 1, o = n.getYear(), d = 1e3 > o ? o + 1900 : o; return a + " " + t[u] + ", " + d; } function tt(t) { var n = /* @__PURE__ */ new Date(), a = n.getDate(), u = n.getMonth() + 1, o = n.getFullYear(); return u + t + a + t + o; } function Ie(t) { var n = t.split("-"), a = n[2], u = n[1], o = n[0]; return u + "/" + a + "/" + o; } function Vt(t) { var n = me(), a = t.split("-"), u = a[2], o = a[1], d = a[0]; return u + " " + n[o] + ", " + d; } function Xt(t) { var n = _e(), a = t.split("-"), u = a[2], o = a[1], d = a[0]; return u + " " + n[o] + ", " + d; } function Qt() { var t = /* @__PURE__ */ new Date(), n = t.getFullYear(); return n; } function Kt() { var t = /* @__PURE__ */ new Date(), n = t.getMonth() + 1; return n; } function qt() { var t = /* @__PURE__ */ new Date(), n = t.getDate(); return n; } class ue { constructor() { for (i = 0; i < ue.arguments.length; i++) this[i + 1] = ue.arguments[i]; } } function J(t) { t = "" + t; for (var n = "", a = 0; a < t.length; a++) n += rt(t[a]); return n; } function rt(t) { switch (t) { case "०": return 0; case "१": return 1; case "२": return 2; case "३": return 3; case "४": return 4; case "५": return 5; case "६": return 6; case "७": return 7; case "८": return 8; case "९": return 9; case "0": return "०"; case "1": return "१"; case "2": return "२"; case "3": return "३"; case "4": return "४"; case "5": return "५"; case "6": return "६"; case "7": return "७"; case "8": return "८"; case "9": return "९"; } } function er() { const t = q().split("-"); return parseInt(t[0], 10); } function tr() { const t = q().split("-"); return parseInt(t[1], 10) - 1; } function rr() { const t = q().split("-"); return parseInt(t[2], 10); } function se(t) { const n = t.split("-"); return parseInt(n[0], 10); } function ie(t) { const n = t.split("-"); return parseInt(n[1], 10) - 1; } function pe(t) { const n = t.split("-"); return parseInt(n[2], 10); } function nr(t, n) { var a = 864e5, u = t.split("/"), o = n.split("/"); u[2] = +u[2], u[1] = +u[1], u[0] = +u[0], o[2] = +o[2], o[1] = +o[1], o[0] = +o[0]; var d = new Date(u[2], u[0] - 1, u[1]), p = new Date(o[2], o[0] - 1, o[1]), m = Math.ceil((p.getTime() - d.getTime()) / a); return m; } function ar(t, n) { var a = t.split("/"), u = n.split("/"), o = +a[2], d = +a[0], p = +a[1], m = +u[2], I = +u[0], C = +u[1], y = 0, b = 0; for (b = o; m >= b; b++) y += cr(this.bs[b]); for (b = 0; d > b; b++) y -= this.bs[o][b]; for (y += this.bs[o][11], b = I - 1; 12 > b; b++) y -= this.bs[m][b]; return y -= p + 1, y += C - 1; } function sr(t, n) { var a = new Date(t); a.setDate(a.getDate() + n); const u = a.getMonth() + 1, o = a.getDate(); return a.getFullYear() + "-" + (u < 10 ? "0" + u : u) + "-" + (o < 10 ? "0" + o : o); } function ir(t, n) { var a = t.split("/"), u = +a[2], o = +a[0], d = +a[1]; for (d += n; d > this.bs[u][o - 1]; ) d -= this.bs[u][o - 1], o++, o > 12 && (o = 1, u++); return u + "-" + (10 > o ? "0" + o : o) + "-" + (10 > d ? "0" + d : d); } function or(t) { const n = this.count_bs_days(this.bs_date_eq, t); return this.add_ad_days(this.ad_date_eq, n); } function ur(t) { const n = this.count_ad_days(this.ad_date_eq, t); return this.add_bs_days(this.bs_date_eq, n); } const cr = function(t) { for (var n = 0, a = t.length; a; n += t[--a]) ; return n; }, yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, AD2BS: Jt, BS2AD: et, BsAddDays: Yt, BsDatesDiff: Bt, NepaliDateConverter: L, convertNos: rt, englishNo2Nep: J, get2DigitNo: Z, getAdDateInWords: Vt, getBSMonths: Gt, getBsDayFromDate: Ht, getBsday: pe, getBsmonth: ie, getBsyear: se, getCurrentBsday: rr, getCurrentBsmonth: tr, getCurrentBsyear: er, getCurrentDay: qt, getCurrentDayName: Ft, getCurrentMonth: Kt, getCurrentYear: Qt, getDateInNo: tt, getDateInWords: $t, getDaynumberFromBsDate: Ke, getMonths: me, getNepaliDate: q, getNepaliDateInWords: Xt, getNepaliDaysShort: Zt, getNepaliFormat: Ie, getNepaliMonth: Lt, getNepaliMonths: _e, getNepaliMonthsInNepali: Qe, makeArray: ue, numberOfBsDays: qe, numberOfDays: Ut }, Symbol.toStringTag, { value: "Module" })), Ve = ({ onSelect: t, className: n, day: a, engday: u, setIsOpen: o, month: d, year: p, setInputdate: m, format: I, disabled: C }) => { const y = () => { m(`${p}-${Z(parseInt(d) + 1)}-${Z(u)}`), t && t(`${p}-${Z(parseInt(d) + 1)}-${Z(u)}`), o(!1); }; return /* @__PURE__ */ l.jsx("button", { disabled: C, className: `${K.daybutton} ${n} ${C ? K.daydiasbled : ""}`, onClick: y, children: a }); }; const Xe = ({ options: t, value: n, setValue: a, year: u }) => /* @__PURE__ */ l.jsx("select", { className: "datepicker-select", value: n, onChange: (o) => { a(o.target.value); }, children: t.map( (o, d) => u ? /* @__PURE__ */ l.jsx("option", { value: J(o), children: o }, d) : /* @__PURE__ */ l.jsx("option", { value: d, children: o }, d) ) }), lr = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiB2aWV3Qm94PSIwIDAgMjU2IDI1NiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+Cgo8ZGVmcz4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zdHJva2UtbWl0ZXJsaW1pdDogMTA7IGZpbGw6IHJnYig3MSw3MCw2OCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHRyYW5zZm9ybT0iIG1hdHJpeCgxIDAgMCAxIDAgMCkgIiBzdHJva2UtbGluZWNhcD0icm91bmQiIC8+CjwvZz4KPC9zdmc+", fr = ({ year: t, month: n, setyear: a, setmonth: u }) => { const o = ["बैशाख", "जेठ", "असार", "श्रावण", "भदौ", "आश्विन", "कार्तिक", "मंसिर", "पुष", "माघ", "फाल्गुन", "चैत्र"], d = []; for (let p = 2e3; p <= 2090; p++) d.push(J(p)); return /* @__PURE__ */ l.jsxs("div", { className: "picker-header-container", children: [ /* @__PURE__ */ l.jsx("div", { className: `prev-btn ${t <= 2e3 ? "hide" : ""}`, onClick: () => { n == 0 ? (u(11), a(t - 1)) : u(n - 1); }, children: /* @__PURE__ */ l.jsx("img", { src: lr, height: 15, alt: "Previous Button" }) }), /* @__PURE__ */ l.jsx("div", { className: "month-select", children: /* @__PURE__ */ l.jsx(Xe, { options: o, value: n, setValue: u }) }), /* @__PURE__ */ l.jsx("div", { className: "year-select", children: /* @__PURE__ */ l.jsx(Xe, { options: d, year: !0, value: t, setValue: a }) }), /* @__PURE__ */ l.jsx("div", { className: `next-btn ${t >= 2090 ? "hide" : ""}`, onClick: () => { n == 11 ? (u(0), a(t + 1)) : u(n + 1); }, children: /* @__PURE__ */ l.jsx("img", { src: dr, height: 15, alt: "Next Button" }) }) ] }); }, hr = ({ onSelect: t, Month: n, setInputdate: a, maxdate: u, inputdate: o, setIsOpen: d, format: p }) => { const m = q(), I = se(m), C = ie(m), y = pe(m), b = o || m, [T, P] = oe.useState(se(b)), [R, F] = oe.useState(n || ie(b)); var W = Ke(`${T}-${parseInt(R) + 1}-1`), E = qe(T, R); const _ = 7; var Y = Math.ceil((E + W) / _); const z = (M) => { const S = `${M.year}-${Z(parseInt(M.month) + 1)}-${Z(M.engday)}`; return u && S && S > u ? /* @__PURE__ */ l.jsx(Ve, { disabled: !0, ...M }) : /* @__PURE__ */ l.jsx(Ve, { ...M }); }, B = []; for (let M = 0; M < Y; M++) { const S = []; for (let N = 1; N <= _; N++) { const x = M * _ + N - W; M === 0 && N <= W ? S.push(/* @__PURE__ */ l.jsx("td", {}, x)) : x <= E ? T == I && R == C && x == y ? S.push(/* @__PURE__ */ l.jsx("td", { children: /* @__PURE__ */ l.jsx(z, { onSelect: t, format: p, day: J(x), setIsOpen: d, engday: x, setInputdate: a, year: T, month: R, className: K.today }) }, x)) : T == se(b) && R == ie(b) && x == pe(b) ? S.push(/* @__PURE__ */ l.jsx("td", { children: /* @__PURE__ */ l.jsx(z, { onSelect: t, format: p, day: J(x), setIsOpen: d, engday: x, setInputdate: a, year: T, month: R, className: K.dayselected }) }, x)) : S.push(/* @__PURE__ */ l.jsx("td", { children: /* @__PURE__ */ l.jsx(z, { onSelect: t, format: p, day: J(x), setIsOpen: d, engday: x, setInputdate: a, year: T, month: R, className: K.daynormal }) }, x)) : S.push(/* @__PURE__ */ l.jsx("td", {}, x)); } B.push(/* @__PURE__ */ l.jsx("tr", { children: S }, M)); } return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [ /* @__PURE__ */ l.jsx("div", { children: /* @__PURE__ */ l.jsx(fr, { year: T, month: R, setyear: P, setmonth: F }) }), /* @__PURE__ */ l.jsx("div", { className: "datepicker-table", children: /* @__PURE__ */ l.jsx("table", { children: /* @__PURE__ */ l.jsxs("tbody", { children: [ /* @__PURE__ */ l.jsxs("tr", { children: [ /* @__PURE__ */ l.jsx("th", { children: "आ" }), /* @__PURE__ */ l.jsx("th", { children: "सो" }), /* @__PURE__ */ l.jsx("th", { children: "मं" }), /* @__PURE__ */ l.jsx("th", { children: "बु" }), /* @__PURE__ */ l.jsx("th", { children: "बि" }), /* @__PURE__ */ l.jsx("th", { children: "श" }), /* @__PURE__ */ l.jsx("th", { children: "शं" }) ] }), B ] }) }) }) ] }); }; const gr = wt(({ inputprops: t, disabled: n, className: a, month: u, value: o, maxdate: d, format: p, renderInput: m, onChange: I, name: C, onSelect: y, ...b }, T) => { const [P, R] = He(!1), F = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, W = (N) => { if (N && N != "") return F.test(N) ? N : (console.error("Invalid Date Format!"), ""); }, [E, _] = He(o || ""), Y = Ct(null); Ue(() => { _(W(o) || ""); }, [o]); const z = (N) => { Y.current && !Y.current.contains(N.target) && R(!1); }; Ue(() => (document.addEventListener("mousedown", z), E != "" && E && (F.test(E) || _("")), () => { document.removeEventListener("mousedown", z); }), []); const B = () => { n || R(!0); }, M = (N) => { _(N.target.value); }, S = (N) => { y && y(N), I && I(N); }; return /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsxs("div", { style: { position: "relative", display: "inline-block" }, className: a, ref: Y, children: [ m ? m({ value: E, onChange: M, onFocus: B, readOnly: !0, ref: T, ...b }) : /* @__PURE__ */ l.jsx("input", { ref: T, disabled: n, type: "text", onChange: M, ...b, value: E, onFocus: B, readOnly: !0, ...t }), P && /* @__PURE__ */ l.jsx("div", { className: "picker-container", children: /* @__PURE__ */ l.jsx(hr, { Month: u, onSelect: S, maxdate: d, format: p, inputdate: E, setIsOpen: R, setInputdate: _ }) }) ] }) }); }); export { yr as NepaliDateConverter, gr as NepaliDatePicker }; //# sourceMappingURL=index.js.map