UNPKG

react-nepali-date-picker-lite

Version:
30 lines (26 loc) 32.3 kB
(function(P,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],C):(P=typeof globalThis<"u"?globalThis:P||self,C(P["react-nepali-date-picker-lite"]={},P.React))})(this,function(P,C){"use strict";var De=document.createElement("style");De.textContent=`._daybutton_azht3_1{background:none;border-radius:50%;height:30px;width:30px;text-align:center;box-shadow:none;cursor:pointer}._daynormal_azht3_21{border:none;color:#7f7f7f}._daynormal_azht3_21:hover,._daydiasbled_azht3_39{background-color:#d7d7d7}._dayselected_azht3_47{border:none;background-color:#486dd3!important;box-shadow:0 2px 3px 2px #d7d7d7;color:#fff}._today_azht3_61{border-color:#486dd3!important;border-width:2px!important;background:none;color:#486dd3}.picker-header-container{height:45px;display:flex}.prev-btn{padding:5px;height:29px;width:29px;display:flex;justify-content:center;align-items:center}.next-btn{padding:5px;height:29px;width:29px;display:flex;justify-content:center;align-items:center;margin-left:auto}.month-select,.year-select{margin:auto;padding:3px 0;display:flex;justify-content:center;align-items:center}.hide{display:none}.datepicker-select{height:30px;width:75px;border:none;color:#494949;border-bottom:2px solid #d7d7d7;font-size:medium;outline:none;text-align:center;word-wrap:normal;font-family:inherit}.datepicker-select::-webkit-scrollbar{width:5px;border-radius:8px}.datepicker-select::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:8px}.datepicker-selectt::-webkit-scrollbar-track{background-color:#f1f1f1;border-radius:8px}.Nepali-date-picker{padding:5px;border:1px solid #ccc;cursor:pointer}.picker-container{position:absolute;border:1px solid #ccc;padding:10px;z-index:99999;border-radius:8px;background-color:#fff;width:290px}table td,th{padding:.32rem .3rem} `,document.head.appendChild(De);var le={exports:{}},Q={};/** * @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 nt(){if(je)return Q;je=1;var t=C,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,x,S){var y,b={},j=null,W=null;S!==void 0&&(j=""+S),x.key!==void 0&&(j=""+x.key),x.ref!==void 0&&(W=x.ref);for(y in x)u.call(x,y)&&!d.hasOwnProperty(y)&&(b[y]=x[y]);if(m&&m.defaultProps)for(y in x=m.defaultProps,x)b[y]===void 0&&(b[y]=x[y]);return{$$typeof:n,type:m,key:j,ref:W,props:b,_owner:o.current}}return Q.Fragment=a,Q.jsx=p,Q.jsxs=p,Q}var $={};/** * @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 Te;function at(){return Te||(Te=1,process.env.NODE_ENV!=="production"&&function(){var t=C,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"),x=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),M=Symbol.iterator,J="@@iterator";function Z(e){if(e===null||typeof e!="object")return null;var r=M&&e[M]||e[J];return typeof r=="function"?r:null}var N=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];L("error",e,s)}}function L(e,r,s){{var c=N.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 Y=!1,F=!1,E=!1,O=!1,T=!1,w;w=Symbol.for("react.module.reference");function zt(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===d||T||e===o||e===S||e===y||O||e===W||Y||F||E||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===b||e.$$typeof===p||e.$$typeof===m||e.$$typeof===x||e.$$typeof===w||e.getModuleId!==void 0))}function Pt(e,r,s){var c=e.displayName;if(c)return c;var v=r.displayName||r.name||"";return v!==""?s+"("+v+")":s}function ke(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 S:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var r=e;return ke(r)+".Consumer";case p:var s=e;return ke(s._context)+".Provider";case x:return Pt(e,e.render,"ForwardRef");case b:var c=e.displayName||null;return c!==null?c:A(e.type)||"Memo";case j:{var v=e,g=v._payload,h=v._init;try{return A(h(g))}catch{return null}}}return null}var H=Object.assign,ee=0,Ae,ze,Pe,We,Ye,Be,Ge;function Ze(){}Ze.__reactDisabledLog=!0;function Wt(){{if(ee===0){Ae=console.log,ze=console.info,Pe=console.warn,We=console.error,Ye=console.group,Be=console.groupCollapsed,Ge=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ze,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ee++}}function Yt(){{if(ee--,ee===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},e,{value:Ae}),info:H({},e,{value:ze}),warn:H({},e,{value:Pe}),error:H({},e,{value:We}),group:H({},e,{value:Ye}),groupCollapsed:H({},e,{value:Be}),groupEnd:H({},e,{value:Ge})})}ee<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ve=N.ReactCurrentDispatcher,ye;function se(e,r,s){{if(ye===void 0)try{throw Error()}catch(v){var c=v.stack.trim().match(/\n( *(at )?)/);ye=c&&c[1]||""}return` `+ye+e}}var ge=!1,ie;{var Bt=typeof WeakMap=="function"?WeakMap:Map;ie=new Bt}function Le(e,r){if(!e||ge)return"";{var s=ie.get(e);if(s!==void 0)return s}var c;ge=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=ve.current,ve.current=null,Wt();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(z){c=z}Reflect.construct(e,[],h)}else{try{h.call()}catch(z){c=z}e.call(h.prototype)}}else{try{throw Error()}catch(z){c=z}e()}}catch(z){if(z&&c&&typeof z.stack=="string"){for(var f=z.stack.split(` `),R=c.stack.split(` `),I=f.length-1,D=R.length-1;I>=1&&D>=0&&f[I]!==R[D];)D--;for(;I>=1&&D>=0;I--,D--)if(f[I]!==R[D]){if(I!==1||D!==1)do if(I--,D--,D<0||f[I]!==R[D]){var k=` `+f[I].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&ie.set(e,k),k}while(I>=1&&D>=0);break}}}finally{ge=!1,ve.current=g,Yt(),Error.prepareStackTrace=v}var X=e?e.displayName||e.name:"",rt=X?se(X):"";return typeof e=="function"&&ie.set(e,rt),rt}function Gt(e,r,s){return Le(e,!1)}function Zt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function oe(e,r,s){if(e==null)return"";if(typeof e=="function")return Le(e,Zt(e));if(typeof e=="string")return se(e);switch(e){case S:return se("Suspense");case y:return se("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case x:return Gt(e.render);case b:return oe(e.type,r,s);case j:{var c=e,v=c._payload,g=c._init;try{return oe(g(v),r,s)}catch{}}}return""}var ue=Object.prototype.hasOwnProperty,Fe={},He=N.ReactDebugCurrentFrame;function ce(e){if(e){var r=e._owner,s=oe(e.type,e._source,r?r.type:null);He.setExtraStackFrame(s)}else He.setExtraStackFrame(null)}function Lt(e,r,s,c,v){{var g=Function.call.bind(ue);for(var h in e)if(g(e,h)){var f=void 0;try{if(typeof e[h]!="function"){var R=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 R.name="Invariant Violation",R}f=e[h](r,h,c,s,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(I){f=I}f&&!(f instanceof Error)&&(ce(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),ce(null)),f instanceof Error&&!(f.message in Fe)&&(Fe[f.message]=!0,ce(v),_("Failed %s type: %s",s,f.message),ce(null))}}}var Ft=Array.isArray;function pe(e){return Ft(e)}function Ht(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,s=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s}}function Ut(e){try{return Ue(e),!1}catch{return!0}}function Ue(e){return""+e}function Je(e){if(Ut(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ht(e)),Ue(e)}var te=N.ReactCurrentOwner,Jt={key:!0,ref:!0,__self:!0,__source:!0},Ve,Xe,me;me={};function Vt(e){if(ue.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Xt(e){if(ue.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qt(e,r){if(typeof e.ref=="string"&&te.current&&r&&te.current.stateNode!==r){var s=A(te.current.type);me[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(te.current.type),e.ref),me[s]=!0)}}function $t(e,r){{var s=function(){Ve||(Ve=!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 Kt(e,r){{var s=function(){Xe||(Xe=!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 qt=function(e,r,s,c,v,g,h){var f={$$typeof:n,type:e,key:r,ref:s,props:h,_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 er(e,r,s,c,v){{var g,h={},f=null,R=null;s!==void 0&&(Je(s),f=""+s),Xt(r)&&(Je(r.key),f=""+r.key),Vt(r)&&(R=r.ref,Qt(r,v));for(g in r)ue.call(r,g)&&!Jt.hasOwnProperty(g)&&(h[g]=r[g]);if(e&&e.defaultProps){var I=e.defaultProps;for(g in I)h[g]===void 0&&(h[g]=I[g])}if(f||R){var D=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&$t(h,D),R&&Kt(h,D)}return qt(e,f,R,v,c,te.current,h)}}var _e=N.ReactCurrentOwner,Qe=N.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,s=oe(e.type,e._source,r?r.type:null);Qe.setExtraStackFrame(s)}else Qe.setExtraStackFrame(null)}var xe;xe=!1;function Ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function $e(){{if(_e.current){var e=A(_e.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function tr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),s=e.lineNumber;return` Check your code at `+r+":"+s+"."}return""}}var Ke={};function rr(e){{var r=$e();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 qe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var s=rr(r);if(Ke[s])return;Ke[s]=!0;var c="";e&&e._owner&&e._owner!==_e.current&&(c=" It was passed a child from "+A(e._owner.type)+"."),V(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),V(null)}}function et(e,r){{if(typeof e!="object")return;if(pe(e))for(var s=0;s<e.length;s++){var c=e[s];Ie(c)&&qe(c,r)}else if(Ie(e))e._store&&(e._store.validated=!0);else if(e){var v=Z(e);if(typeof v=="function"&&v!==e.entries)for(var g=v.call(e),h;!(h=g.next()).done;)Ie(h.value)&&qe(h.value,r)}}}function nr(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===x||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&&!xe){xe=!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 ar(e){{for(var r=Object.keys(e.props),s=0;s<r.length;s++){var c=r[s];if(c!=="children"&&c!=="key"){V(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c),V(null);break}}e.ref!==null&&(V(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function tt(e,r,s,c,v,g){{var h=zt(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 R=tr(v);R?f+=R:f+=$e();var I;e===null?I="null":pe(e)?I="array":e!==void 0&&e.$$typeof===n?(I="<"+(A(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):I=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",I,f)}var D=er(e,r,s,v,g);if(D==null)return D;if(h){var k=r.children;if(k!==void 0)if(c)if(pe(k)){for(var X=0;X<k.length;X++)et(k[X],e);Object.freeze&&Object.freeze(k)}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 et(k,e)}return e===u?ar(D):nr(D),D}}function sr(e,r,s){return tt(e,r,s,!0)}function ir(e,r,s){return tt(e,r,s,!1)}var or=ir,ur=sr;$.Fragment=u,$.jsx=or,$.jsxs=ur}()),$}process.env.NODE_ENV==="production"?le.exports=nt():le.exports=at();var l=le.exports;const K={daybutton:"_daybutton_azht3_1",daynormal:"_daynormal_azht3_21",daydiasbled:"_daydiasbled_azht3_39",dayselected:"_dayselected_azht3_47",today:"_today_azht3_61"};class B{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=Dt,this.count_bs_days=jt,this.add_bs_days=wt,this.add_ad_days=Tt,this.bs2ad=Nt,this.ad2bs=Et}}function st(t,n){var a=new B;return a.add_bs_days(t,n)}function it(t,n){var a=new B;return a.count_bs_days(t,n)+2}function G(t){return t=parseInt(t,10),10>t?"0"+t:""+t}function de(){var t=["January","February","March","April","May","June","July","August","September","October","November","December"];return t}function ot(t){var n=fe();return t>11?"Inavlid Month":n[t]}function fe(){var t=["Baisakh","Jestha","Ashar","Shrawan","Bhadra","Ashoj","Kartik","Mangsir","Poush","Magh","Falgun","Chaitra"];return t}function ut(){var t=["आ","सो","मं","बु","बि","शु","श"];return t}function we(){return["बैशाख","जेठ","अषाढ","श्रावण","भाद्र","आश्विन","कार्तिक","मङ्सिर","पौष","माघ","फाल्गुन","चैत्र"]}function ct(t){t=parseInt(t,10);var n=we();return n[t]}function lt(){var t=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 Ne(t){var n=Me(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 dt(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 Ee(t,n){var a=new B;return a.bs[t][n]}function ft(t,n){var a=new Date(t,n,0);return a.getDate()}function ht(t){var n=new B;return n.ad2bs(he(t))}function Me(t){var n=new B;return n.bs2ad(he(t))}function q(){var t=new B;return t.ad2bs(Re("/"))}function bt(){var t=de(),n=new Date,a=n.getDate(),u=n.getMonth()+1,o=n.getYear(),d=1e3>o?o+1900:o;return a+" "+t[u]+", "+d}function Re(t){var n=new Date,a=n.getDate(),u=n.getMonth()+1,o=n.getFullYear();return u+t+a+t+o}function he(t){var n=t.split("-"),a=n[2],u=n[1],o=n[0];return u+"/"+a+"/"+o}function vt(t){var n=de(),a=t.split("-"),u=a[2],o=a[1],d=a[0];return u+" "+n[o]+", "+d}function yt(t){var n=fe(),a=t.split("-"),u=a[2],o=a[1],d=a[0];return u+" "+n[o]+", "+d}function gt(){var t=new Date,n=t.getFullYear();return n}function pt(){var t=new Date,n=t.getMonth()+1;return n}function mt(){var t=new Date,n=t.getDate();return n}class re{constructor(){for(i=0;i<re.arguments.length;i++)this[i+1]=re.arguments[i]}}function U(t){t=""+t;for(var n="",a=0;a<t.length;a++)n+=Ce(t[a]);return n}function Ce(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 _t(){const t=q().split("-");return parseInt(t[0],10)}function xt(){const t=q().split("-");return parseInt(t[1],10)-1}function It(){const t=q().split("-");return parseInt(t[2],10)}function ne(t){const n=t.split("-");return parseInt(n[0],10)}function ae(t){const n=t.split("-");return parseInt(n[1],10)-1}function be(t){const n=t.split("-");return parseInt(n[2],10)}function Dt(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 jt(t,n){var a=t.split("/"),u=n.split("/"),o=+a[2],d=+a[0],p=+a[1],m=+u[2],x=+u[0],S=+u[1],y=0,b=0;for(b=o;m>=b;b++)y+=Mt(this.bs[b]);for(b=0;d>b;b++)y-=this.bs[o][b];for(y+=this.bs[o][11],b=x-1;12>b;b++)y-=this.bs[m][b];return y-=p+1,y+=S-1}function Tt(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 wt(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 Nt(t){const n=this.count_bs_days(this.bs_date_eq,t);return this.add_ad_days(this.ad_date_eq,n)}function Et(t){const n=this.count_ad_days(this.ad_date_eq,t);return this.add_bs_days(this.bs_date_eq,n)}const Mt=function(t){for(var n=0,a=t.length;a;n+=t[--a]);return n},Rt=Object.freeze(Object.defineProperty({__proto__:null,AD2BS:ht,BS2AD:Me,BsAddDays:st,BsDatesDiff:it,NepaliDateConverter:B,convertNos:Ce,englishNo2Nep:U,get2DigitNo:G,getAdDateInWords:vt,getBSMonths:ot,getBsDayFromDate:dt,getBsday:be,getBsmonth:ae,getBsyear:ne,getCurrentBsday:It,getCurrentBsmonth:xt,getCurrentBsyear:_t,getCurrentDay:mt,getCurrentDayName:lt,getCurrentMonth:pt,getCurrentYear:gt,getDateInNo:Re,getDateInWords:bt,getDaynumberFromBsDate:Ne,getMonths:de,getNepaliDate:q,getNepaliDateInWords:yt,getNepaliDaysShort:ut,getNepaliFormat:he,getNepaliMonth:ct,getNepaliMonths:fe,getNepaliMonthsInNepali:we,makeArray:re,numberOfBsDays:Ee,numberOfDays:ft},Symbol.toStringTag,{value:"Module"})),Se=({onSelect:t,className:n,day:a,engday:u,setIsOpen:o,month:d,year:p,setInputdate:m,format:x,disabled:S})=>{const y=()=>{m(`${p}-${G(parseInt(d)+1)}-${G(u)}`),t&&t(`${p}-${G(parseInt(d)+1)}-${G(u)}`),o(!1)};return l.jsx("button",{disabled:S,className:`${K.daybutton} ${n} ${S?K.daydiasbled:""}`,onClick:y,children:a})},br="",vr="",Oe=({options:t,value:n,setValue:a,year:u})=>l.jsx("select",{className:"datepicker-select",value:n,onChange:o=>{a(o.target.value)},children:t.map((o,d)=>u?l.jsx("option",{value:U(o),children:o},d):l.jsx("option",{value:d,children:o},d))}),Ct="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiB2aWV3Qm94PSIwIDAgMjU2IDI1NiIgeG1sOn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XR0OyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogMTA7IGZpbGw6IHJnYig3MSw3MCw2OCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHRyYW5zZm9ybT0iIG1hdHJpeCgxIDAgMCAxIDAgMCkgIiBzdHJva2UtbGluZWNhcD0icm91bmQiIC8+CjwvZz4KPC9zdmc+",Ot=({year:t,month:n,setyear:a,setmonth:u})=>{const o=["बैशाख","जेठ","असार","श्रावण","भदौ","आश्विन","कार्तिक","मंसिर","पुष","माघ","फाल्गुन","चैत्र"],d=[];for(let p=2e3;p<=2090;p++)d.push(U(p));return l.jsxs("div",{className:"picker-header-container",children:[l.jsx("div",{className:`prev-btn ${t<=2e3?"hide":""}`,onClick:()=>{n==0?(u(11),a(t-1)):u(n-1)},children:l.jsx("img",{src:Ct,height:15,alt:"Previous Button"})}),l.jsx("div",{className:"month-select",children:l.jsx(Oe,{options:o,value:n,setValue:u})}),l.jsx("div",{className:"year-select",children:l.jsx(Oe,{options:d,year:!0,value:t,setValue:a})}),l.jsx("div",{className:`next-btn ${t>=2090?"hide":""}`,onClick:()=>{n==11?(u(0),a(t+1)):u(n+1)},children:l.jsx("img",{src:St,height:15,alt:"Next Button"})})]})},kt=({onSelect:t,Month:n,setInputdate:a,maxdate:u,inputdate:o,setIsOpen:d,format:p})=>{const m=q(),x=ne(m),S=ae(m),y=be(m),b=o||m,[j,W]=C.useState(ne(b)),[M,J]=C.useState(n||ae(b));var Z=Ne(`${j}-${parseInt(M)+1}-1`),N=Ee(j,M);const _=7;var L=Math.ceil((N+Z)/_);const Y=E=>{const O=`${E.year}-${G(parseInt(E.month)+1)}-${G(E.engday)}`;return u&&O&&O>u?l.jsx(Se,{disabled:!0,...E}):l.jsx(Se,{...E})},F=[];for(let E=0;E<L;E++){const O=[];for(let T=1;T<=_;T++){const w=E*_+T-Z;E===0&&T<=Z?O.push(l.jsx("td",{},w)):w<=N?j==x&&M==S&&w==y?O.push(l.jsx("td",{children:l.jsx(Y,{onSelect:t,format:p,day:U(w),setIsOpen:d,engday:w,setInputdate:a,year:j,month:M,className:K.today})},w)):j==ne(b)&&M==ae(b)&&w==be(b)?O.push(l.jsx("td",{children:l.jsx(Y,{onSelect:t,format:p,day:U(w),setIsOpen:d,engday:w,setInputdate:a,year:j,month:M,className:K.dayselected})},w)):O.push(l.jsx("td",{children:l.jsx(Y,{onSelect:t,format:p,day:U(w),setIsOpen:d,engday:w,setInputdate:a,year:j,month:M,className:K.daynormal})},w)):O.push(l.jsx("td",{},w))}F.push(l.jsx("tr",{children:O},E))}return l.jsxs(l.Fragment,{children:[l.jsx("div",{children:l.jsx(Ot,{year:j,month:M,setyear:W,setmonth:J})}),l.jsx("div",{className:"datepicker-table",children:l.jsx("table",{children:l.jsxs("tbody",{children:[l.jsxs("tr",{children:[l.jsx("th",{children:"आ"}),l.jsx("th",{children:"सो"}),l.jsx("th",{children:"मं"}),l.jsx("th",{children:"बु"}),l.jsx("th",{children:"बि"}),l.jsx("th",{children:"श"}),l.jsx("th",{children:"शं"})]}),F]})})})]})},yr="",At=C.forwardRef(({inputprops:t,disabled:n,className:a,month:u,value:o,maxdate:d,format:p,renderInput:m,onChange:x,name:S,onSelect:y,...b},j)=>{const[W,M]=C.useState(!1),J=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Z=T=>{if(T&&T!="")return J.test(T)?T:(console.error("Invalid Date Format!"),"")},[N,_]=C.useState(o||""),L=C.useRef(null);C.useEffect(()=>{_(Z(o)||"")},[o]);const Y=T=>{L.current&&!L.current.contains(T.target)&&M(!1)};C.useEffect(()=>(document.addEventListener("mousedown",Y),N!=""&&N&&(J.test(N)||_("")),()=>{document.removeEventListener("mousedown",Y)}),[]);const F=()=>{n||M(!0)},E=T=>{_(T.target.value)},O=T=>{y&&y(T),x&&x(T)};return l.jsx(l.Fragment,{children:l.jsxs("div",{style:{position:"relative",display:"inline-block"},className:a,ref:L,children:[m?m({value:N,onChange:E,onFocus:F,readOnly:!0,ref:j,...b}):l.jsx("input",{ref:j,disabled:n,type:"text",onChange:E,...b,value:N,onFocus:F,readOnly:!0,...t}),W&&l.jsx("div",{className:"picker-container",children:l.jsx(kt,{Month:u,onSelect:O,maxdate:d,format:p,inputdate:N,setIsOpen:M,setInputdate:_})})]})})});P.NepaliDateConverter=Rt,P.NepaliDatePicker=At,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}); //# sourceMappingURL=index.umd.cjs.map