@telsho/react-google-flight-datepicker 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,660 +1,1394 @@
1
- "use strict";var Mt=Object.create;var Ge=Object.defineProperty,zt=Object.defineProperties,Lt=Object.getOwnPropertyDescriptor,Et=Object.getOwnPropertyDescriptors,St=Object.getOwnPropertyNames,Be=Object.getOwnPropertySymbols,Pt=Object.getPrototypeOf,je=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable;var ot=(e,t,o)=>t in e?Ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,v=(e,t)=>{for(var o in t||(t={}))je.call(t,o)&&ot(e,o,t[o]);if(Be)for(var o of Be(t))ct.call(t,o)&&ot(e,o,t[o]);return e},w=(e,t)=>zt(e,Et(t));var He=(e,t)=>{var o={};for(var a in e)je.call(e,a)&&t.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&Be)for(var a of Be(e))t.indexOf(a)<0&&ct.call(e,a)&&(o[a]=e[a]);return o};var Kt=(e,t)=>{for(var o in t)Ge(e,o,{get:t[o],enumerable:!0})},at=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of St(t))!je.call(e,i)&&i!==o&&Ge(e,i,{get:()=>t[i],enumerable:!(a=Lt(t,i))||a.enumerable});return e};var F=(e,t,o)=>(o=e!=null?Mt(Pt(e)):{},at(t||!e||!e.__esModule?Ge(o,"default",{value:e,enumerable:!0}):o,e)),$t=e=>at(Ge({},"__esModule",{value:!0}),e);var ro={};Kt(ro,{RangeDatePicker:()=>Ot,SingleDatePicker:()=>Ut});module.exports=$t(ro);var b=require("react"),M=F(require("dayjs")),Zt=F(require("classnames")),Rt=F(require("dayjs/plugin/localeData"));var gt=F(require("dayjs"));function Fe(e,t,o){let a=[],i=new Date(e,t,1),d=new Date(e,t+1,0).getDate(),A=1,g=i.getDay()===0?1:7-i.getDay()+1;for(o==="sunday"&&(g=7-i.getDay());A<=d;)a.push({start:A,days:g-A+1}),A=g+1,g+=7,g=A===1&&g===8?1:g,g>d&&(g=d);return{totalWeek:a,totalDay:d}}function Qe(e,t){let o=[...Array(7)].map((a,i)=>(0,gt.default)().day(i).format(t==="dd"?"dd":t==="ddd"?"ddd":"dddd"));if(e==="sunday"){let a=o.pop();a&&o.unshift(a)}return o}function it(e,t){let o;return function(...i){let r=()=>{o=null,e.apply(this,i)};o&&clearTimeout(o),o=setTimeout(r,t)}}var k=require("react"),Ze=F(require("dayjs"));var pe=require("react/jsx-runtime"),lt=(0,k.createContext)(null),rt=(0,k.createContext)(null),nt=(0,k.createContext)(null),dt=(0,k.createContext)(null),_t=(0,k.createContext)(null),T=()=>{let e=(0,k.useContext)(lt);if(!e)throw new Error("useDateState must be used within DatePickerProvider");return e},N=()=>{let e=(0,k.useContext)(rt);if(!e)throw new Error("useDatePickerConfig must be used within DatePickerProvider");return e},xe=()=>{let e=(0,k.useContext)(nt);if(!e)throw new Error("useUIState must be used within DatePickerProvider");return e},Y=()=>{let e=(0,k.useContext)(dt);if(!e)throw new Error("useDisplayCustomization must be used within DatePickerProvider");return e};var qt=async e=>{if(e==="en")return!0;try{return await import(`dayjs/locale/${e}.js`),!0}catch(t){return console.error(`Failed to load locale ${e}:`,t),!1}},It=({children:e,dateState:t,config:o,uiState:a,display:i,locale:r="en"})=>{let[d,A]=(0,k.useState)({currentLocale:"en",isLocaleReady:r==="en"});return(0,k.useEffect)(()=>{r!=="en"?(A(g=>w(v({},g),{isLocaleReady:!1})),qt(r).then(g=>{g?(Ze.default.locale(r),A({currentLocale:r,isLocaleReady:!0})):(Ze.default.locale("en"),A({currentLocale:"en",isLocaleReady:!0}))})):(Ze.default.locale("en"),A({currentLocale:"en",isLocaleReady:!0}))},[r]),d.isLocaleReady?(0,pe.jsx)(_t.Provider,{value:d,children:(0,pe.jsx)(lt.Provider,{value:t,children:(0,pe.jsx)(rt.Provider,{value:o,children:(0,pe.jsx)(nt.Provider,{value:a,children:(0,pe.jsx)(dt.Provider,{value:i,children:e})})})})}):null};var fo=require("react");var Me=require("react/jsx-runtime"),eo=e=>(0,Me.jsx)("svg",w(v({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),{children:(0,Me.jsx)("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 002 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"})})),Re=eo;var me=require("react"),st=F(require("classnames")),ke=F(require("dayjs"));var Do=require("react");var ze=require("react/jsx-runtime"),to=e=>(0,ze.jsx)("svg",w(v({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),{children:(0,ze.jsx)("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})})),Oe=to;var Fo=require("react");var Le=require("react/jsx-runtime"),oo=e=>(0,Le.jsx)("svg",w(v({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),{children:(0,Le.jsx)("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})})),Ue=oo;var L=require("react/jsx-runtime"),Ee=({type:e,showIcon:t=!1,tabIndex:o=0,nonFocusable:a=!1})=>{let[i,r]=(0,me.useState)(null),[d,A]=(0,me.useState)(!1),[g,s]=(0,me.useState)(!1),{fromDate:n,toDate:m,inputFocus:D,handleClickDateInput:Q,handleChangeDate:f}=T(),{isSingle:B,minDate:X,maxDate:h,dateFormat:c}=N(),{startDatePlaceholder:y,endDatePlaceholder:C}=Y(),G=e==="from"?n:m,P=e==="from"?y:C;(0,me.useEffect)(()=>{if(G){let U=G.clone().locale(ke.default.locale()).format("ddd, DD MMM");c&&(U=G.format(c)),r(U);let O=X?(0,ke.default)(X):null,Z=h?(0,ke.default)(h):null;O!=null&&O.add(1,"day").isAfter(G,"date")||e==="to"&&n&&G.isBefore(n.add(1,"day"),"date")?A(!0):A(!1),Z!=null&&Z.subtract(1,"day").isBefore(G,"date")?s(!0):s(!1)}else r(null)},[G,n,X,h,c,e]);let z=V=>{V.stopPropagation(),G&&f(G.subtract(1,"day"),e)},oe=V=>{V.stopPropagation(),G&&f(G.add(1,"day"),e)},p=()=>{Q(e)};return(0,L.jsxs)("div",{className:(0,st.default)("date",{"is-focus":D===e&&!B,"is-single":B}),role:"button",tabIndex:a?-1:o,onClick:p,id:`${e}-date-input-button`,children:[t&&(0,L.jsx)(Re,{className:"icon-calendar",viewBox:"0 0 24 24"}),(0,L.jsx)("div",{className:"selected-date",children:i!=null?i:(0,L.jsx)("div",{className:"date-placeholder",children:P})}),i&&(0,L.jsxs)("div",{className:"change-date-group",children:[(0,L.jsx)("button",{type:"button",className:"btn-outline change-date-button",onClick:z,tabIndex:a?-1:0,disabled:d,children:(0,L.jsx)(Oe,{viewBox:"0 0 24 24",className:"icon-arrow"})}),(0,L.jsx)("button",{type:"button",className:"btn-outline change-date-button",onClick:oe,tabIndex:a?-1:0,disabled:g,children:(0,L.jsx)(Ue,{viewBox:"0 0 24 24",className:"icon-arrow"})})]})]})};var ie=require("react/jsx-runtime"),Je=({showIcon:e=!1,nonFocusable:t=!1})=>{let{isSingle:o}=N(),{dateInputSeperator:a}=Y();return(0,ie.jsxs)("div",{className:"date-picker-input",children:[e&&(0,ie.jsx)(Re,{className:"icon-calendar mobile",viewBox:"0 0 24 24"}),(0,ie.jsxs)("div",{className:"date-picker-date-group",children:[(0,ie.jsx)(Ee,{type:"from",tabIndex:t?-1:0,showIcon:!0,nonFocusable:t}),!o&&a&&(0,ie.jsx)("div",{className:"date-input-separator",children:a}),!o&&(0,ie.jsx)(Ee,{type:"to",tabIndex:t?-1:0,showIcon:!1,nonFocusable:t})]})]})};var At=require("react-dom");var ve=require("react"),Ct=()=>{let[e,t]=(0,ve.useState)(!1);return(0,ve.useEffect)(()=>{t(!0)},[]),e};var bt=require("react/jsx-runtime"),co=({children:e=null,isMobile:t=!1})=>Ct()?t?(0,At.createPortal)((0,bt.jsx)("div",{children:e}),document.body):e:null,ut=co;var Ae=require("react"),Ft=F(require("classnames"));var Po=require("react");var Se=require("react/jsx-runtime"),ao=e=>(0,Se.jsx)("svg",w(v({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 492 492"},e),{children:(0,Se.jsx)("path",{d:"M464.3 207.4l.8.2H136l103.5-103.7c5-5.1 7.8-12 7.8-19.2 0-7.2-2.7-14-7.8-19l-16.1-16.2c-5-5-11.8-7.8-19-7.8-7.2 0-14 2.8-19 7.8L7.8 227C2.8 232 0 238.8 0 246c0 7.3 2.8 14 7.8 19.2l177.5 177.4c5 5 11.8 7.8 19 7.8 7.2 0 14-2.8 19-7.8l16-16.1a26.6 26.6 0 000-37.7L134.8 284.4h330a27.9 27.9 0 0027.3-27.6V234a27.3 27.3 0 00-27.7-26.6z"})})),pt=ao;var te=F(require("react")),E=F(require("dayjs")),Dt=require("react-window"),ht=F(require("react-virtualized-auto-sizer"));var yt=require("react"),Gt=F(require("classnames")),Xt=F(require("dayjs"));var xt=require("react"),mt=F(require("classnames")),ft=F(require("dayjs"));var ee=require("react"),Pe=F(require("classnames"));var Ce=require("react/jsx-runtime"),Ke=(0,ee.forwardRef)(({dateIndex:e,dateValue:t,isEndDay:o,selected:a,hovered:i,disabled:r,totalDay:d,highlight:A,handleHoverDay:g,subText:s},n)=>{let m=(0,ee.useRef)(null),{onSelectDate:D,onHoverDate:Q}=T(),f=c=>{c.stopPropagation(),c.preventDefault(),!r&&D(t)},B=()=>{r||(Q(t),g(t))},X=(0,ee.useCallback)(()=>{if(!n||typeof n=="function")return;let c=n.current;c&&m.current&&(c.style.left=`${m.current.offsetLeft-c.offsetWidth+135}px`,c.style.top=`${m.current.offsetTop-c.offsetHeight-15}px`,c.style.visibility="visible")},[n]),h=(0,ee.useCallback)(()=>{if(!n||typeof n=="function")return;let c=n.current;c&&(c.style.visibility="hidden")},[n]);return(0,ee.useEffect)(()=>{let c=m.current;return c&&(c.addEventListener("mouseover",X),c.addEventListener("mouseleave",h)),()=>{c&&(c.removeEventListener("mouseover",X),c.removeEventListener("mouseleave",h))}},[X,h]),(0,Ce.jsxs)("div",{className:(0,Pe.default)("day",{selected:a,hovered:i,disabled:r,highlight:A,end:o,"has-subtext":!!s}),onClick:f,onMouseEnter:B,role:"button",tabIndex:-1,"data-day-index":e,"data-date-value":t.valueOf(),ref:m,children:[i&&!(o&&e===d)&&!(e===1&&a&&!o)&&(0,Ce.jsx)("div",{className:(0,Pe.default)("background-day",{"first-day":e===1,"last-day":e===d})}),(0,Ce.jsxs)("div",{className:"day-content",children:[(0,Ce.jsx)("div",{className:"text-day",children:e}),s&&(0,Ce.jsx)("div",{className:"sub-text",style:{position:"relative",zIndex:3,color:a&&!i?"#fff":"#666"},children:s})]})]})});Ke.displayName="Day";var $e=require("react/jsx-runtime"),_e=(0,xt.forwardRef)(({isFirst:e,week:t,month:o,year:a,totalDay:i,weekIndex:r,handleHoverDay:d},A)=>{let{fromDate:g,toDate:s,hoverDate:n}=T(),{minDate:m,maxDate:D,isSingle:Q,highlightToday:f}=N(),{subTextDict:B}=Y(),X=()=>Array.from({length:t.days},(h,c)=>{var U;let y=c+t.start,C=(0,ft.default)(`${a}-${o+1}-${y}`),G=m&&C.isBefore(m,"date")||D&&C.isAfter(D,"date"),P=g&&C.isSame(g,"date")||s&&C.isSame(s,"date"),z=!1,oe=f&&C.isSame(new Date,"date");g&&!g.isSame(s,"date")&&!Q&&(s&&!g.isAfter(C,"date")&&!s.isBefore(C,"date")&&(z=!0),!s&&!C.isBefore(g,"date")&&!(n&&n.isBefore(C,"date"))&&g.isBefore(n,"date")&&(z=!0));let p=s&&C.isSame(s,"date")||!s&&n&&C.isSame(n,"date"),V=B?(U=B[C.format("YYYY-MM-DD")])!=null?U:"\xA0":"";return(0,$e.jsx)(Ke,{dateIndex:y,dateValue:C,selected:P,hovered:z,highlight:oe,disabled:G,isEndDay:p,totalDay:i,handleHoverDay:d,subText:V,ref:A},c)});return(0,$e.jsx)("div",{className:(0,mt.default)("week",{first:e}),children:X()})});_e.displayName="Week";var le=require("react/jsx-runtime"),Xe=(0,yt.forwardRef)(({month:e,year:t,hidden:o=!1,isAnimating:a=!1,handleHoverDay:i,className:r},d)=>{let{startWeekDay:A,weekDayFormat:g,monthFormat:s,singleCalendar:n}=N(),m=()=>{let{totalWeek:f,totalDay:B}=Fe(t,e,A);return f.map(X=>{let h=`${t}-${e}-${X.start}`;return(0,le.jsx)(_e,{week:X,month:e,year:t,isFirst:X===f[0],totalDay:B,weekIndex:f.indexOf(X),handleHoverDay:i,ref:d},h)})},D=()=>Qe(A,g).map(B=>(0,le.jsx)("div",{className:"weekday",children:B},`weekday-${B.toLowerCase()}`)),Q=()=>{let f=(0,Xt.default)(`${t}-${e+1}-1`);return s?f.format(s):f.format("MMMM - YYYY")};return(0,le.jsxs)("div",{className:(0,Gt.default)("month-calendar",{isAnimating:a,hidden:o,single:n},r),"data-month-index":e+1,children:[(0,le.jsx)("div",{className:"month-name",children:Q()}),(0,le.jsx)("div",{className:"weekdays",children:D()}),(0,le.jsx)("div",{className:"week-container",children:m()})]})});Xe.displayName="MonthCalendar";var S=require("react/jsx-runtime"),Bt=()=>{let[e,t]=(0,te.useState)(2400),o=(0,te.useRef)(null),{fromDate:a}=T(),{startWeekDay:i,minDate:r,maxDate:d,weekDayFormat:A}=N(),{complsOpen:g}=xe(),{tooltip:s,subTextDict:n}=Y(),m=r?(0,E.default)(r).year():1900,D=r?(0,E.default)(r).month():0;(0,te.useEffect)(()=>{if(d){let c=r?(0,E.default)(r):(0,E.default)("1900-01-01");t((0,E.default)(d).diff(c,"month")+1)}},[d,r]),(0,te.useEffect)(()=>{if(o.current&&g){let c=a?(0,E.default)(a):(0,E.default)(),y=c.diff((0,E.default)("1900-01-01"),"month");r&&(y=c.diff((0,E.default)(r),"month")),o.current.scrollToItem(y+1,"smart")}},[g,a,r]);let Q=c=>{let y=c+D,C=m+Math.floor(y/12),G=y%12;return{year:C,month:G}},f=te.default.memo(({index:c,style:y})=>{let{year:C,month:G}=Q(c);return(0,S.jsx)("div",{style:y,children:(0,S.jsx)(Xe,{month:G,year:C,hidden:!1,isAnimating:!1,handleHoverDay:()=>{}})})});f.displayName="CalendarRow";let B=c=>{let{year:y,month:C}=Q(c),{totalWeek:G}=Fe(y,C,i||"monday");return G.length*48+34},X=()=>(0,S.jsx)(ht.default,{children:({height:c,width:y})=>(0,S.jsx)(Dt.VariableSizeList,{ref:o,width:y,height:c-36,itemCount:e,itemSize:B,children:f})});return(0,S.jsx)("div",{className:"calendar-wrapper",children:(0,S.jsxs)("div",{className:"calendar-content",children:[(0,S.jsx)("div",{className:"weekdays mobile",children:Qe(i||"monday",A).map((y,C)=>(0,S.jsx)("div",{className:"weekday",children:y},C))}),X()]})})};var u=require("react"),fe=F(require("classnames")),De=F(require("dayjs"));var j=require("react/jsx-runtime"),go=()=>{let[e,t]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{t(!0)},[]),e},Ht=({dateChanged:e=null})=>{let t=go(),o=(0,u.useRef)(null),a=(0,u.useRef)(null),[i,r]=(0,u.useState)(0),[d,A]=(0,u.useState)([]),[g,s]=(0,u.useState)(null),[n,m]=(0,u.useState)(!1),[D,Q]=(0,u.useState)(!1),[f,B]=(0,u.useState)(0),[X,h]=(0,u.useState)(null),[c,y]=(0,u.useState)(!1),{fromDate:C}=T(),{minDate:G,maxDate:P,singleCalendar:z}=N(),{complsOpen:oe}=xe(),{tooltip:p}=Y(),V=(0,u.useCallback)(I=>[I.subtract(1,"month"),I,I.add(1,"month"),I.add(2,"month")],[]);(0,u.useEffect)(()=>{if(!t||!o.current)return;let I=()=>{let J=o.current.offsetWidth,R=window.getComputedStyle(o.current),$=z?J+parseInt(R.marginLeft)-8:J/2;B($)};I();let x=new ResizeObserver(I);return x.observe(o.current),()=>x.disconnect()},[t,z]),(0,u.useEffect)(()=>{s(C!=null?C:(0,De.default)())},[oe,C]),(0,u.useEffect)(()=>{if(!g)return;let I=G?(0,De.default)(G):null,x=P?(0,De.default)(P):null;m(!!(I&&g.isBefore(I.add(1,"month"),"month"))),Q(!!(x&&g.isAfter(x.subtract(2,"month"),"month"))),A(V(g))},[g,G,P,V]),(0,u.useEffect)(()=>{if(!e||!g)return;let I=e.diff(g,"month");I<-1&&Z(),I>1&&O()},[e,g]);let U=(0,u.useCallback)(I=>()=>{if(I==="next"&&D||I==="prev"&&n||c)return;y(!0),r(I==="next"?-f:f);let x=setTimeout(()=>{s(J=>{let R=I==="next"?J.add(1,"month"):J.subtract(1,"month");return A(V(R)),R}),r(0),y(!1)},200);return()=>clearTimeout(x)},[D,n,c,f,V]),[O,Z]=(0,u.useMemo)(()=>[U("next"),U("prev")],[U]),ce=(0,u.useCallback)(()=>{if(!t||!o.current)return;let x=o.current.querySelector(".day.selected, .month-calendar:not(.hidden) .day:not(.disabled)");x==null||x.focus()},[t]),ne=(0,u.useCallback)(I=>{var Ie,ue;let x=I.target,J=x.getAttribute("data-day-index");if(!J)return;I.preventDefault();let R=x.closest(".calendar-wrapper"),$=parseInt((Ie=x.dataset.dateValue)!=null?Ie:"0"),de=(0,De.default)($),Ye=de.endOf("month").date(),_=parseInt(J);switch(I.key){case"ArrowLeft":_--;break;case"ArrowUp":_-=7;break;case"ArrowRight":_++;break;case"ArrowDown":_+=7;break;case" ":x.click();return;default:return}if(_>0&&_<=Ye)(ue=R==null?void 0:R.querySelector(`[data-day-index="${_}"]`))==null||ue.focus();else{let q=de.add(_-parseInt(J),"day"),ae=q.diff(g,"month");ae>1&&!D&&O(),ae<0&&!n&&Z(),setTimeout(()=>{var se;(se=R==null?void 0:R.querySelector(`[data-month-index="${q.month()+1}"] [data-day-index="${q.date()}"]`))==null||se.focus()},200)}},[g,D,n,O,Z]),Te=(0,u.useMemo)(()=>{var x;if(!p||!t)return null;let I=typeof p=="function"?p((x=X==null?void 0:X.toDate())!=null?x:new Date):p;return(0,j.jsx)("div",{id:"day-tooltip",className:"tooltip-text",ref:a,children:I})},[p,X,t]),K=(0,u.useMemo)(()=>d.map((I,x)=>{let J=x===1||x===2,R=c&&i<0&&x===3,$=c&&i>0&&x===0;return(0,j.jsx)(Xe,{hidden:!J&&!R&&!$,isAnimating:R||$,month:I.month(),year:I.year(),handleHoverDay:h,ref:a,className:(0,fe.default)({"slide-next":R,"slide-prev":$})},`${I.year()}-${I.month()}`)}),[d,c,i]);return(0,j.jsxs)("div",{className:"relative",children:[Te,(0,j.jsxs)("div",{className:(0,fe.default)("calendar-wrapper",{single:z}),ref:o,onKeyDown:ne,role:"grid","aria-label":"Calendar",children:[(0,j.jsx)("div",{className:(0,fe.default)("calendar-content",{isAnimating:c}),style:{transform:`translateX(${i}px)`},children:K}),(0,j.jsxs)("div",{className:"calendar-flippers",children:[(0,j.jsx)("button",{className:(0,fe.default)("flipper-button",{disabled:n}),onClick:Z,onKeyDown:I=>I.key===" "&&Z(),disabled:n,"aria-label":"Previous month",children:(0,j.jsx)(Oe,{viewBox:"0 0 24 24"})}),(0,j.jsx)("button",{className:(0,fe.default)("flipper-button",{disabled:D}),onClick:O,onKeyDown:I=>I.key===" "&&O(),disabled:D,"aria-label":"Next month",onBlur:ce,children:(0,j.jsx)(Ue,{viewBox:"0 0 24 24"})})]})]})]})};var W=require("react/jsx-runtime"),Qt=({containerRef:e})=>{let[t,o]=(0,Ae.useState)(!1),[a,i]=(0,Ae.useState)(null),r=(0,Ae.useRef)(null),d=e||r,{handleChangeDate:A,handleReset:g}=T(),{singleCalendar:s,expandDirection:n}=N(),{complsOpen:m,isMobile:D,toggleDialog:Q}=xe(),{hideDialogHeader:f,hideDialogFooter:B}=Y(),X=(h,c)=>{i(h),A(h,c)};return(0,Ae.useEffect)(()=>{m&&!t&&o(!0),m&&setTimeout(()=>{var c;let h=(c=d.current)==null?void 0:c.querySelector("#start-date-input-button");h&&h.focus()},50)},[m,d,t]),(0,W.jsxs)("div",{className:(0,Ft.default)("dialog-date-picker",{open:m,hide:!m&&t,single:s&&!D,"expand-left":n==="left","expand-right":n==="right"}),ref:d,children:[!f&&(0,W.jsxs)("div",{className:"dialog-header",children:[(0,W.jsx)("button",{type:"button",className:"btn-outline back-button",onClick:Q,children:(0,W.jsx)(pt,{viewBox:"0 0 492 492"})}),(0,W.jsx)(Je,{showIcon:!0,nonFocusable:!m}),(0,W.jsx)("button",{type:"button",className:"btn-outline reset-button",onClick:g,children:"Reset"})]}),(0,W.jsx)("div",{className:"dialog-content",children:D?(0,W.jsx)(Bt,{}):(0,W.jsx)(Ht,{dateChanged:a})}),!B&&(0,W.jsxs)("div",{className:"dialog-footer",children:[(0,W.jsx)("button",{type:"button",className:"submit-button",onClick:Q,tabIndex:0,children:"Done"}),(0,W.jsx)("button",{type:"button",className:"btn-outline reset-button mobile",onClick:g,children:"Reset"})]})]})};var io=`.react-google-flight-datepicker {
2
- font-size: 1rem;
3
- display: contents;
4
- /** RESPONSIVE MOBILE */
5
- }
6
- .react-google-flight-datepicker > * {
7
- box-sizing: border-box;
8
- }
9
- .react-google-flight-datepicker .date-picker-demo {
10
- width: 400px;
11
- }
12
- .react-google-flight-datepicker .btn-outline {
13
- background-color: transparent;
14
- background-repeat: no-repeat;
15
- border: none;
16
- cursor: pointer;
17
- overflow: hidden;
18
- }
19
- .react-google-flight-datepicker .date-picker {
20
- position: relative;
21
- border-radius: 4px;
22
- background: white;
23
- padding: 6px;
24
- }
25
- .react-google-flight-datepicker .date-picker.disabled {
26
- opacity: 0.6;
27
- cursor: default;
28
- }
29
- .react-google-flight-datepicker .date-picker-input {
30
- width: 100%;
31
- display: flex;
32
- justify-content: space-between;
33
- border: 1px solid #dadce0;
34
- border-radius: 4px;
35
- color: #3c4043;
36
- height: 56px;
37
- letter-spacing: 0.2px;
38
- font-size: 1rem;
39
- align-items: center;
40
- overflow: visible;
41
- }
42
- .react-google-flight-datepicker .date-picker-input svg {
43
- min-width: 24px;
44
- min-height: 24px;
45
- }
46
- .react-google-flight-datepicker .date-picker-date-group {
47
- position: relative;
48
- display: flex;
49
- justify-content: space-between;
50
- height: 100%;
51
- flex-grow: 1;
52
- }
53
- .react-google-flight-datepicker .date {
54
- display: flex;
55
- align-items: center;
56
- height: 100%;
57
- position: relative;
58
- border-radius: 2px 0 0 2px;
59
- padding: 0 13px;
60
- flex-grow: 1;
61
- width: 50%;
62
- background: white;
63
- border-radius: 4px;
64
- }
65
- .react-google-flight-datepicker .date.is-single::before {
66
- display: none;
67
- }
68
- .react-google-flight-datepicker .date:first-child::before {
69
- content: "";
70
- position: absolute;
71
- right: 0;
72
- top: 50%;
73
- transform: translate(0, -50%);
74
- width: 1px;
75
- height: 70%;
76
- background: #dadce0;
77
- }
78
- .react-google-flight-datepicker .selected-date {
79
- display: flex;
80
- flex: 1 1 0px;
81
- align-items: center;
82
- height: 100%;
83
- font-size: 0.9rem;
84
- line-height: normal;
85
- overflow: hidden;
86
- text-overflow: ellipsis;
87
- white-space: nowrap;
88
- }
89
- .react-google-flight-datepicker .date-placeholder {
90
- color: rgba(0, 0, 0, 0.56);
91
- }
92
- .react-google-flight-datepicker .change-date-group {
93
- width: 48px;
94
- display: flex;
95
- }
96
- .react-google-flight-datepicker .change-date-group .change-date-button {
97
- height: 40px;
98
- color: #5f6368;
99
- cursor: pointer;
100
- padding: 8px 0;
101
- flex-grow: 1;
102
- }
103
- .react-google-flight-datepicker .change-date-group .change-date-button:disabled {
104
- cursor: default;
105
- }
106
- .react-google-flight-datepicker .change-date-group .change-date-button:disabled .icon-arrow {
107
- fill: #93989e;
108
- }
109
- .react-google-flight-datepicker .icon-calendar {
110
- width: 24px;
111
- height: 24px;
112
- fill: #1a73e8;
113
- margin-right: 12px;
114
- }
115
- .react-google-flight-datepicker .icon-calendar.mobile {
116
- display: none;
117
- }
118
- .react-google-flight-datepicker .icon-arrow {
119
- width: 24px;
120
- height: 24px;
121
- fill: #5f6368;
122
- }
123
- @keyframes showPopup {
124
- 0% {
125
- transform: scale(0.7);
126
- opacity: 0;
127
- }
128
- 100% {
129
- transform: scale(1);
130
- opacity: 1;
131
- }
132
- }
133
- @keyframes hidePopup {
134
- 0% {
135
- transform: scale(1);
136
- opacity: 1;
137
- }
138
- 100% {
139
- transform: scale(0.7);
140
- opacity: 0;
141
- visibility: hidden;
142
- }
143
- }
144
- .react-google-flight-datepicker .dialog-date-picker {
145
- background: #fff;
146
- border-radius: 5px;
147
- box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
148
- min-width: 200px;
149
- position: absolute;
150
- top: -2px;
151
- left: -2px;
152
- z-index: 120;
153
- height: max-content;
154
- width: 770px;
155
- margin-bottom: 50px;
156
- transform-origin: top left;
157
- opacity: 0;
158
- transform: scale(0);
159
- }
160
- .react-google-flight-datepicker .dialog-date-picker.single {
161
- width: 385px;
162
- }
163
- .react-google-flight-datepicker .dialog-date-picker.open {
164
- animation: showPopup 0.2s forwards;
165
- }
166
- .react-google-flight-datepicker .dialog-date-picker.hide {
167
- animation: hidePopup 0.2s forwards;
168
- }
169
- .react-google-flight-datepicker .dialog-date-picker.expand-right {
170
- left: -2px;
171
- right: auto;
172
- transform-origin: top left;
173
- }
174
- .react-google-flight-datepicker .dialog-date-picker.expand-left {
175
- left: auto;
176
- right: -2px;
177
- transform-origin: top right;
178
- }
179
- .react-google-flight-datepicker .dialog-header {
180
- padding: 8px 8px 8px 24px;
181
- display: flex;
182
- justify-content: space-between;
183
- align-items: center;
184
- }
185
- .react-google-flight-datepicker .dialog-header .date-picker-input {
186
- height: 48px;
187
- width: 50%;
188
- }
189
- .react-google-flight-datepicker .date:focus,
190
- .react-google-flight-datepicker .date.is-focus {
191
- background-color: #f4f8ff;
192
- }
193
- .react-google-flight-datepicker .date:focus::after,
194
- .react-google-flight-datepicker .date.is-focus::after {
195
- content: "";
196
- margin: -1px;
197
- border: 2px solid #1a73e8;
198
- border-radius: 4px;
199
- position: absolute;
200
- pointer-events: none;
201
- top: 0;
202
- bottom: 0;
203
- left: 0;
204
- right: 0;
205
- z-index: 5;
206
- }
207
- .react-google-flight-datepicker .back-button {
208
- display: none;
209
- }
210
- .react-google-flight-datepicker .dialog-content {
211
- border-bottom: 1px solid #dadce0;
212
- border-top: 1px solid #dadce0;
213
- position: relative;
214
- }
215
- .react-google-flight-datepicker .reset-button {
216
- font-size: 0.9rem;
217
- padding: 0 8px;
218
- height: 36px;
219
- border-radius: 4px;
220
- border: none;
221
- color: #5f6368;
222
- min-width: 64px;
223
- }
224
- .react-google-flight-datepicker .reset-button:hover {
225
- background-color: #fafafa;
226
- }
227
- .react-google-flight-datepicker .reset-button.mobile {
228
- display: none;
229
- }
230
- .react-google-flight-datepicker .calendar-wrapper {
231
- margin: 12px 38px 8px;
232
- overflow: hidden;
233
- min-height: 353px;
234
- }
235
- .react-google-flight-datepicker .calendar-wrapper.single {
236
- margin-left: 36px;
237
- margin-right: 36px;
238
- }
239
- .react-google-flight-datepicker .tooltip-text {
240
- position: absolute;
241
- background-color: #4285f4;
242
- color: #fff;
243
- text-align: center;
244
- border-radius: 6px;
245
- padding: 5px 15px;
246
- z-index: 999;
247
- width: 120px;
248
- max-width: 120px;
249
- word-break: break-word;
250
- visibility: hidden;
251
- }
252
- .react-google-flight-datepicker .tooltip-text::before {
253
- z-index: 1001;
254
- border: 6px solid transparent;
255
- background: transparent;
256
- content: "";
257
- margin-left: -6px;
258
- margin-bottom: -12px;
259
- border-top-color: #4285f4;
260
- position: absolute;
261
- bottom: 0;
262
- left: 50%;
263
- }
264
- .react-google-flight-datepicker .calendar-content {
265
- display: flex;
266
- padding: 0 2px;
267
- position: relative;
268
- overflow: hidden;
269
- }
270
- .react-google-flight-datepicker .calendar-content.isAnimating {
271
- transition: transform 0.2s ease;
272
- overflow: initial;
273
- }
274
- .react-google-flight-datepicker .month-calendar {
275
- width: 308px;
276
- color: #3c4043;
277
- margin-right: 43px;
278
- }
279
- .react-google-flight-datepicker .month-calendar.hidden {
280
- position: absolute;
281
- visibility: hidden;
282
- z-index: -1;
283
- opacity: 0;
284
- }
285
- .react-google-flight-datepicker .month-calendar.isAnimating {
286
- position: absolute;
287
- left: -350px;
288
- }
289
- .react-google-flight-datepicker .month-calendar .month-calendar.slide-next {
290
- position: absolute;
291
- left: 350px;
292
- }
293
- .react-google-flight-datepicker .month-calendar .month-calendar.slide-prev {
294
- position: absolute;
295
- left: -350px;
296
- }
297
- .react-google-flight-datepicker .month-name {
298
- text-align: center;
299
- font-size: 1rem;
300
- margin-bottom: 10px;
301
- }
302
- .react-google-flight-datepicker .weekdays {
303
- width: 100%;
304
- font-size: 0.9rem;
305
- color: rgba(0, 0, 0, 0.54);
306
- display: flex;
307
- }
308
- .react-google-flight-datepicker .weekdays .weekday {
309
- display: flex;
310
- align-items: center;
311
- justify-content: center;
312
- height: 36px;
313
- margin: 0;
314
- flex-grow: 1;
315
- }
316
- .react-google-flight-datepicker .week {
317
- display: flex;
318
- justify-content: flex-start;
319
- }
320
- .react-google-flight-datepicker .week.first {
321
- justify-content: flex-end;
322
- }
323
- .react-google-flight-datepicker .day {
324
- display: flex;
325
- justify-content: center;
326
- align-items: center;
327
- cursor: pointer;
328
- height: 44px;
329
- margin: 2px 0;
330
- text-align: center;
331
- width: 44px;
332
- vertical-align: top;
333
- position: relative;
334
- border-radius: 50%;
335
- }
336
- .react-google-flight-datepicker .day .background-day {
337
- bottom: 0;
338
- opacity: 0;
339
- pointer-events: none;
340
- position: absolute;
341
- top: 0;
342
- width: 10px;
343
- z-index: 1;
344
- }
345
- .react-google-flight-datepicker .day .background-day.first-day {
346
- background: linear-gradient(to right, #fff, #daedfd);
347
- left: -10px;
348
- }
349
- .react-google-flight-datepicker .day .background-day.last-day {
350
- background: linear-gradient(to left, #fff, #daedfd);
351
- right: -10px;
352
- }
353
- .react-google-flight-datepicker .day::after {
354
- border-radius: 100%;
355
- bottom: 0;
356
- content: "";
357
- height: 44px;
358
- left: 0;
359
- margin: auto;
360
- position: absolute;
361
- right: 0;
362
- top: 0;
363
- width: 44px;
364
- z-index: 2;
365
- }
366
- .react-google-flight-datepicker .day:hover::after {
367
- background-color: #fff;
368
- border: 2px solid #4285f4;
369
- bottom: -2px;
370
- left: -2px;
371
- right: -2px;
372
- top: -2px;
373
- }
374
- .react-google-flight-datepicker .day.selected {
375
- color: white;
376
- }
377
- .react-google-flight-datepicker .day.selected:hover {
378
- color: #000;
379
- }
380
- .react-google-flight-datepicker .day.selected::after {
381
- background-color: #4285f4;
382
- border-radius: 100%;
383
- }
384
- .react-google-flight-datepicker .day.selected:hover::after {
385
- background-color: #fff;
386
- }
387
- .react-google-flight-datepicker .day.highlight::before {
388
- content: "";
389
- width: 44px;
390
- height: 44px;
391
- position: absolute;
392
- left: 50%;
393
- top: 50%;
394
- transform: translate(-50%, -50%);
395
- background-color: rgba(247, 237, 122, 0.8196078431);
396
- border-radius: 50%;
397
- }
398
- .react-google-flight-datepicker .day.hovered {
399
- background-color: #d9edfd;
400
- position: relative;
401
- border-radius: unset;
402
- }
403
- .react-google-flight-datepicker .day.hovered .background-day {
404
- opacity: 1;
405
- }
406
- .react-google-flight-datepicker .day.hovered.end {
407
- background: linear-gradient(90deg, #d9edfd 50%, #fff 50%);
408
- }
409
- .react-google-flight-datepicker .day.hovered:hover {
410
- background-color: #d9edfd;
411
- }
412
- .react-google-flight-datepicker .day.hovered:hover::after {
413
- border-radius: 100%;
414
- background-color: #fff;
415
- }
416
- .react-google-flight-datepicker .day.selected.hovered {
417
- background: linear-gradient(90deg, #fff 50%, #d9edfd 50%);
418
- color: #fff;
419
- }
420
- .react-google-flight-datepicker .day.selected.hovered.end {
421
- background: linear-gradient(90deg, #d9edfd 50%, #fff 50%);
422
- }
423
- .react-google-flight-datepicker .day.selected.hovered:hover {
424
- color: #000;
425
- }
426
- .react-google-flight-datepicker .day.selected.hovered::after {
427
- border-radius: 100%;
428
- background-color: #4285f4;
429
- }
430
- .react-google-flight-datepicker .day.selected.hovered:hover::after {
431
- background-color: #fff;
432
- }
433
- .react-google-flight-datepicker .day.disabled {
434
- pointer-events: none;
435
- color: rgba(0, 0, 0, 0.26);
436
- }
437
- .react-google-flight-datepicker .day.disabled.selected {
438
- color: #fff;
439
- }
440
- .react-google-flight-datepicker .day .text-day {
441
- position: relative;
442
- z-index: 3;
443
- }
444
- .react-google-flight-datepicker .day-content {
445
- display: flex;
446
- flex-direction: column;
447
- align-items: center;
448
- gap: 2px;
449
- }
450
- .react-google-flight-datepicker .sub-text {
451
- font-size: 0.75em;
452
- color: #666;
453
- text-align: center;
454
- }
455
- .react-google-flight-datepicker .day.has-subtext {
456
- padding-bottom: 4px;
457
- }
458
- .react-google-flight-datepicker .calendar-flippers {
459
- position: absolute;
460
- top: 0;
461
- left: 0;
462
- bottom: 0;
463
- right: 0;
464
- display: flex;
465
- justify-content: space-between;
466
- align-items: center;
467
- pointer-events: none;
468
- }
469
- .react-google-flight-datepicker .flipper-button {
470
- background-color: #fff;
471
- border-radius: 100%;
472
- box-shadow: 0 0 4px rgba(0, 0, 0, 0.12), 0 4px 4px rgba(0, 0, 0, 0.24);
473
- cursor: pointer;
474
- height: 40px;
475
- width: 40px;
476
- display: flex;
477
- justify-content: center;
478
- align-items: center;
479
- margin: 0 -20px;
480
- pointer-events: all;
481
- border: none;
482
- outline: none;
483
- }
484
- .react-google-flight-datepicker .flipper-button:focus:hover {
485
- outline: none;
486
- box-shadow: 0 0 4px rgba(0, 0, 0, 0.12), 0 4px 4px rgba(0, 0, 0, 0.24), 0 0 0 2px rgba(0, 0, 0, 0.1);
487
- }
488
- .react-google-flight-datepicker .flipper-button svg {
489
- width: 24px;
490
- height: 24px;
491
- }
492
- .react-google-flight-datepicker .flipper-button.disabled {
493
- cursor: default;
494
- }
495
- .react-google-flight-datepicker .flipper-button.disabled svg {
496
- fill: #93989e;
497
- }
498
- .react-google-flight-datepicker .dialog-footer {
499
- align-items: center;
500
- display: flex;
501
- flex-direction: row-reverse;
502
- padding: 8px;
503
- }
504
- .react-google-flight-datepicker .dialog-footer .submit-button {
505
- border-radius: 8px;
506
- padding: 10px 8px;
507
- border: none;
508
- line-height: 16px;
509
- text-transform: uppercase;
510
- color: #fff;
511
- background: #4285f4;
512
- height: 36px;
513
- min-width: 88px;
514
- font-weight: 500;
515
- font-size: 0.9rem;
516
- cursor: pointer;
517
- }
518
- @media screen and (max-width: 768px) {
519
- .react-google-flight-datepicker .date-picker-demo {
520
- width: 100%;
521
- }
522
- .react-google-flight-datepicker .date-picker-input {
523
- height: 40px;
524
- border: none;
525
- border-radius: 0;
526
- position: relative;
527
- }
528
- .react-google-flight-datepicker .date {
529
- border: 1px solid #dadce0;
530
- border-radius: 5px;
531
- padding: 0 10px;
532
- flex-grow: 1;
533
- }
534
- .react-google-flight-datepicker .date:nth-child(2) {
535
- margin-left: 10px;
536
- }
537
- .react-google-flight-datepicker .date.is-focus {
538
- height: 40px;
539
- }
540
- .react-google-flight-datepicker .date:first-child::before {
541
- display: none;
542
- }
543
- .react-google-flight-datepicker .icon-calendar {
544
- display: none;
545
- }
546
- .react-google-flight-datepicker .icon-calendar.mobile {
547
- display: block;
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
548
17
  }
549
- .react-google-flight-datepicker .reset-button {
550
- display: none;
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/lib/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ RangeDatePicker: () => RangeDatePicker,
34
+ SingleDatePicker: () => SingleDatePicker
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+
38
+ // src/lib/components/DatePicker/BaseDatePicker.tsx
39
+ var import_react10 = require("react");
40
+ var import_dayjs8 = __toESM(require("dayjs"));
41
+ var import_classnames7 = __toESM(require("classnames"));
42
+ var import_localeData = __toESM(require("dayjs/plugin/localeData"));
43
+
44
+ // src/lib/helpers/index.ts
45
+ var import_dayjs = __toESM(require("dayjs"));
46
+ function getMonthInfo(year, month, startDay) {
47
+ const weeks = [];
48
+ const firstDate = new Date(year, month, 1);
49
+ const lastDate = new Date(year, month + 1, 0);
50
+ const numDays = lastDate.getDate();
51
+ let start = 1;
52
+ let end = firstDate.getDay() === 0 ? 1 : 7 - firstDate.getDay() + 1;
53
+ if (startDay === "sunday") {
54
+ end = 7 - firstDate.getDay();
551
55
  }
552
- .react-google-flight-datepicker .reset-button.mobile {
553
- display: block;
554
- color: rgba(0, 0, 0, 0.87);
555
- min-width: 88px;
556
- font-weight: 500;
56
+ while (start <= numDays) {
57
+ weeks.push({ start, days: end - start + 1 });
58
+ start = end + 1;
59
+ end += 7;
60
+ end = start === 1 && end === 8 ? 1 : end;
61
+ if (end > numDays) {
62
+ end = numDays;
63
+ }
557
64
  }
558
- .react-google-flight-datepicker .change-date-group,
559
- .react-google-flight-datepicker .divider,
560
- .react-google-flight-datepicker .calendar-flippers,
561
- .react-google-flight-datepicker .weekdays {
562
- display: none;
65
+ return { totalWeek: weeks, totalDay: numDays };
66
+ }
67
+ function getWeekDay(startWeekDay, weekDayFormat) {
68
+ const days = [...Array(7)].map(
69
+ (_, i) => (0, import_dayjs.default)().day(i).format(weekDayFormat === "dd" ? "dd" : weekDayFormat === "ddd" ? "ddd" : "dddd")
70
+ );
71
+ if (startWeekDay === "sunday") {
72
+ const last = days.pop();
73
+ if (last) {
74
+ days.unshift(last);
75
+ }
563
76
  }
564
- .react-google-flight-datepicker .back-button {
565
- display: block;
566
- width: 56px;
567
- height: 100%;
568
- margin-right: 16px;
569
- padding: 0;
77
+ return days;
78
+ }
79
+ function debounce(func, wait) {
80
+ let timeout;
81
+ return function executedFunction(...args) {
82
+ const later = () => {
83
+ timeout = null;
84
+ func.apply(this, args);
85
+ };
86
+ if (timeout) {
87
+ clearTimeout(timeout);
88
+ }
89
+ timeout = setTimeout(later, wait);
90
+ };
91
+ }
92
+
93
+ // src/lib/components/DatePicker/DatePickerProvider.tsx
94
+ var import_react = require("react");
95
+ var import_dayjs2 = __toESM(require("dayjs"));
96
+ var import_jsx_runtime = require("react/jsx-runtime");
97
+ var DateStateContext = (0, import_react.createContext)(null);
98
+ var DatePickerConfigContext = (0, import_react.createContext)(null);
99
+ var UIStateContext = (0, import_react.createContext)(null);
100
+ var DisplayContext = (0, import_react.createContext)(null);
101
+ var LocaleContext = (0, import_react.createContext)(null);
102
+ var useDateState = () => {
103
+ const context = (0, import_react.useContext)(DateStateContext);
104
+ if (!context) throw new Error("useDateState must be used within DatePickerProvider");
105
+ return context;
106
+ };
107
+ var useDatePickerConfig = () => {
108
+ const context = (0, import_react.useContext)(DatePickerConfigContext);
109
+ if (!context) throw new Error("useDatePickerConfig must be used within DatePickerProvider");
110
+ return context;
111
+ };
112
+ var useUIState = () => {
113
+ const context = (0, import_react.useContext)(UIStateContext);
114
+ if (!context) throw new Error("useUIState must be used within DatePickerProvider");
115
+ return context;
116
+ };
117
+ var useDisplayCustomization = () => {
118
+ const context = (0, import_react.useContext)(DisplayContext);
119
+ if (!context) throw new Error("useDisplayCustomization must be used within DatePickerProvider");
120
+ return context;
121
+ };
122
+ var loadLocale = async (locale) => {
123
+ if (locale === "en") return true;
124
+ try {
125
+ await import(`dayjs/locale/${locale}.js`);
126
+ return true;
127
+ } catch (error) {
128
+ console.error(`Failed to load locale ${locale}:`, error);
129
+ return false;
570
130
  }
571
- .react-google-flight-datepicker .back-button svg {
572
- width: 20px;
573
- height: 20px;
574
- fill: rgba(0, 0, 0, 0.7);
131
+ };
132
+ var DatePickerProvider = ({
133
+ children,
134
+ dateState,
135
+ config,
136
+ uiState,
137
+ display,
138
+ locale = "en"
139
+ }) => {
140
+ const [localeState, setLocaleState] = (0, import_react.useState)({
141
+ currentLocale: "en",
142
+ isLocaleReady: locale === "en"
143
+ });
144
+ (0, import_react.useEffect)(() => {
145
+ if (locale !== "en") {
146
+ setLocaleState((prev) => ({ ...prev, isLocaleReady: false }));
147
+ loadLocale(locale).then((success) => {
148
+ if (success) {
149
+ import_dayjs2.default.locale(locale);
150
+ setLocaleState({
151
+ currentLocale: locale,
152
+ isLocaleReady: true
153
+ });
154
+ } else {
155
+ import_dayjs2.default.locale("en");
156
+ setLocaleState({
157
+ currentLocale: "en",
158
+ isLocaleReady: true
159
+ });
160
+ }
161
+ });
162
+ } else {
163
+ import_dayjs2.default.locale("en");
164
+ setLocaleState({
165
+ currentLocale: "en",
166
+ isLocaleReady: true
167
+ });
168
+ }
169
+ }, [locale]);
170
+ if (!localeState.isLocaleReady) {
171
+ return null;
575
172
  }
576
- .react-google-flight-datepicker .dialog-date-picker {
577
- border-radius: 0;
578
- width: 100%;
579
- height: 100%;
580
- max-height: 100%;
581
- position: fixed;
582
- left: 0;
583
- right: 0;
584
- bottom: 10px;
585
- top: 100%;
586
- display: flex;
587
- flex-direction: column;
588
- opacity: 1;
589
- transform: none;
590
- z-index: 999999999;
173
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LocaleContext.Provider, { value: localeState, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DateStateContext.Provider, { value: dateState, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DatePickerConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DisplayContext.Provider, { value: display, children }) }) }) }) });
174
+ };
175
+
176
+ // src/lib/assets/svg/calendar.svg
177
+ var React2 = __toESM(require("react"));
178
+ var import_jsx_runtime2 = require("react/jsx-runtime");
179
+ var SvgCalendar = (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 002 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z" }) });
180
+ var calendar_default = SvgCalendar;
181
+
182
+ // src/lib/components/DatePicker/DateInput.tsx
183
+ var import_react2 = require("react");
184
+ var import_classnames = __toESM(require("classnames"));
185
+ var import_dayjs3 = __toESM(require("dayjs"));
186
+
187
+ // src/lib/assets/svg/prev.svg
188
+ var React3 = __toESM(require("react"));
189
+ var import_jsx_runtime3 = require("react/jsx-runtime");
190
+ var SvgPrev = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" }) });
191
+ var prev_default = SvgPrev;
192
+
193
+ // src/lib/assets/svg/next.svg
194
+ var React4 = __toESM(require("react"));
195
+ var import_jsx_runtime4 = require("react/jsx-runtime");
196
+ var SvgNext = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }) });
197
+ var next_default = SvgNext;
198
+
199
+ // src/lib/components/DatePicker/DateInput.tsx
200
+ var import_jsx_runtime5 = require("react/jsx-runtime");
201
+ var DateInput = ({
202
+ type,
203
+ showIcon = false,
204
+ tabIndex = 0,
205
+ nonFocusable = false
206
+ }) => {
207
+ const [formattedDate, setFormattedDate] = (0, import_react2.useState)(null);
208
+ const [disablePrev, setDisablePrev] = (0, import_react2.useState)(false);
209
+ const [disableNext, setDisableNext] = (0, import_react2.useState)(false);
210
+ const {
211
+ fromDate,
212
+ toDate,
213
+ inputFocus,
214
+ handleClickDateInput,
215
+ handleChangeDate
216
+ } = useDateState();
217
+ const {
218
+ isSingle,
219
+ minDate,
220
+ maxDate,
221
+ dateFormat
222
+ } = useDatePickerConfig();
223
+ const {
224
+ startDatePlaceholder,
225
+ endDatePlaceholder
226
+ } = useDisplayCustomization();
227
+ const value = type === "from" ? fromDate : toDate;
228
+ const placeholder = type === "from" ? startDatePlaceholder : endDatePlaceholder;
229
+ (0, import_react2.useEffect)(() => {
230
+ if (value) {
231
+ let formattedValue = value.clone().locale(import_dayjs3.default.locale());
232
+ let text = formattedValue.format("ddd, DD MMM");
233
+ if (dateFormat) {
234
+ text = value.format(dateFormat);
235
+ }
236
+ setFormattedDate(text);
237
+ const minDateDayjs = minDate ? (0, import_dayjs3.default)(minDate) : null;
238
+ const maxDateDayjs = maxDate ? (0, import_dayjs3.default)(maxDate) : null;
239
+ if (minDateDayjs?.add(1, "day").isAfter(value, "date") || type === "to" && fromDate && value.isBefore(fromDate.add(1, "day"), "date")) {
240
+ setDisablePrev(true);
241
+ } else {
242
+ setDisablePrev(false);
243
+ }
244
+ if (maxDateDayjs?.subtract(1, "day").isBefore(value, "date")) {
245
+ setDisableNext(true);
246
+ } else {
247
+ setDisableNext(false);
248
+ }
249
+ } else {
250
+ setFormattedDate(null);
251
+ }
252
+ }, [value, fromDate, minDate, maxDate, dateFormat, type]);
253
+ const prevDate = (e) => {
254
+ e.stopPropagation();
255
+ if (value) {
256
+ handleChangeDate(value.subtract(1, "day"), type);
257
+ }
258
+ };
259
+ const nextDate = (e) => {
260
+ e.stopPropagation();
261
+ if (value) {
262
+ handleChangeDate(value.add(1, "day"), type);
263
+ }
264
+ };
265
+ const handleClick = () => {
266
+ handleClickDateInput(type);
267
+ };
268
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
269
+ "div",
270
+ {
271
+ className: (0, import_classnames.default)("date", {
272
+ "is-focus": inputFocus === type && !isSingle,
273
+ "is-single": isSingle
274
+ }),
275
+ role: "button",
276
+ tabIndex: nonFocusable ? -1 : tabIndex,
277
+ onClick: handleClick,
278
+ id: `${type}-date-input-button`,
279
+ children: [
280
+ showIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(calendar_default, { className: "icon-calendar", viewBox: "0 0 24 24" }),
281
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "selected-date", children: formattedDate ?? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "date-placeholder", children: placeholder }) }),
282
+ formattedDate && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "change-date-group", children: [
283
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
284
+ "button",
285
+ {
286
+ type: "button",
287
+ className: "btn-outline change-date-button",
288
+ onClick: prevDate,
289
+ tabIndex: nonFocusable ? -1 : 0,
290
+ disabled: disablePrev,
291
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(prev_default, { viewBox: "0 0 24 24", className: "icon-arrow" })
292
+ }
293
+ ),
294
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
295
+ "button",
296
+ {
297
+ type: "button",
298
+ className: "btn-outline change-date-button",
299
+ onClick: nextDate,
300
+ tabIndex: nonFocusable ? -1 : 0,
301
+ disabled: disableNext,
302
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(next_default, { viewBox: "0 0 24 24", className: "icon-arrow" })
303
+ }
304
+ )
305
+ ] })
306
+ ]
307
+ }
308
+ );
309
+ };
310
+
311
+ // src/lib/components/DatePicker/DateInputGroup.tsx
312
+ var import_jsx_runtime6 = require("react/jsx-runtime");
313
+ var DateInputGroup = ({
314
+ showIcon = false,
315
+ nonFocusable = false
316
+ }) => {
317
+ const { isSingle } = useDatePickerConfig();
318
+ const { dateInputSeperator } = useDisplayCustomization();
319
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "date-picker-input", children: [
320
+ showIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(calendar_default, { className: "icon-calendar mobile", viewBox: "0 0 24 24" }),
321
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "date-picker-date-group", children: [
322
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
323
+ DateInput,
324
+ {
325
+ type: "from",
326
+ tabIndex: nonFocusable ? -1 : 0,
327
+ showIcon: true,
328
+ nonFocusable
329
+ }
330
+ ),
331
+ !isSingle && dateInputSeperator && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "date-input-separator", children: dateInputSeperator }),
332
+ !isSingle && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
333
+ DateInput,
334
+ {
335
+ type: "to",
336
+ tabIndex: nonFocusable ? -1 : 0,
337
+ showIcon: false,
338
+ nonFocusable
339
+ }
340
+ )
341
+ ] })
342
+ ] });
343
+ };
344
+
345
+ // src/lib/components/DatePicker/DialogWrapper.tsx
346
+ var import_react_dom = require("react-dom");
347
+
348
+ // src/lib/hooks/useClientSide.ts
349
+ var import_react3 = require("react");
350
+ var useClientSide = () => {
351
+ const [isClient, setIsClient] = (0, import_react3.useState)(false);
352
+ (0, import_react3.useEffect)(() => {
353
+ if (typeof window !== "undefined" && typeof document !== "undefined") {
354
+ setIsClient(true);
355
+ } else {
356
+ console.warn("Client-side context not available");
357
+ }
358
+ }, []);
359
+ return isClient;
360
+ };
361
+
362
+ // src/lib/components/DatePicker/DialogWrapper.tsx
363
+ var import_jsx_runtime7 = require("react/jsx-runtime");
364
+ var DialogWrapper = ({
365
+ children = null,
366
+ isMobile = false
367
+ }) => {
368
+ const isClient = useClientSide();
369
+ if (!isClient) return null;
370
+ return isMobile ? (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children }), document.body) : children;
371
+ };
372
+ var DialogWrapper_default = DialogWrapper;
373
+
374
+ // src/lib/components/DatePicker/Dialog.tsx
375
+ var import_react9 = require("react");
376
+ var import_classnames6 = __toESM(require("classnames"));
377
+
378
+ // src/lib/assets/svg/back.svg
379
+ var React6 = __toESM(require("react"));
380
+ var import_jsx_runtime8 = require("react/jsx-runtime");
381
+ var SvgBack = (props) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 492 492", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M464.3 207.4l.8.2H136l103.5-103.7c5-5.1 7.8-12 7.8-19.2 0-7.2-2.7-14-7.8-19l-16.1-16.2c-5-5-11.8-7.8-19-7.8-7.2 0-14 2.8-19 7.8L7.8 227C2.8 232 0 238.8 0 246c0 7.3 2.8 14 7.8 19.2l177.5 177.4c5 5 11.8 7.8 19 7.8 7.2 0 14-2.8 19-7.8l16-16.1a26.6 26.6 0 000-37.7L134.8 284.4h330a27.9 27.9 0 0027.3-27.6V234a27.3 27.3 0 00-27.7-26.6z" }) });
382
+ var back_default = SvgBack;
383
+
384
+ // src/lib/components/DatePicker/DialogContentMobile.tsx
385
+ var import_react7 = __toESM(require("react"));
386
+ var import_dayjs6 = __toESM(require("dayjs"));
387
+ var import_react_window = require("react-window");
388
+ var import_react_virtualized_auto_sizer = __toESM(require("react-virtualized-auto-sizer"));
389
+
390
+ // src/lib/components/DatePicker/MonthCalendar.tsx
391
+ var import_react6 = require("react");
392
+ var import_classnames4 = __toESM(require("classnames"));
393
+ var import_dayjs5 = __toESM(require("dayjs"));
394
+
395
+ // src/lib/components/DatePicker/Week.tsx
396
+ var import_react5 = require("react");
397
+ var import_classnames3 = __toESM(require("classnames"));
398
+ var import_dayjs4 = __toESM(require("dayjs"));
399
+
400
+ // src/lib/components/DatePicker/Day.tsx
401
+ var import_react4 = require("react");
402
+ var import_classnames2 = __toESM(require("classnames"));
403
+ var import_jsx_runtime9 = require("react/jsx-runtime");
404
+ var Day = (0, import_react4.forwardRef)(({
405
+ dateIndex,
406
+ dateValue,
407
+ isEndDay,
408
+ selected,
409
+ hovered,
410
+ disabled,
411
+ totalDay,
412
+ highlight,
413
+ handleHoverDay,
414
+ subText
415
+ }, ref) => {
416
+ const dayRef = (0, import_react4.useRef)(null);
417
+ const { onSelectDate, onHoverDate } = useDateState();
418
+ const selectDate = (e) => {
419
+ e.stopPropagation();
420
+ e.preventDefault();
421
+ if (disabled) return;
422
+ onSelectDate(dateValue);
423
+ };
424
+ const handleHoverDate = () => {
425
+ if (disabled) return;
426
+ onHoverDate(dateValue);
427
+ handleHoverDay(dateValue);
428
+ };
429
+ const handleTooltipPosition = (0, import_react4.useCallback)(() => {
430
+ if (!ref || typeof ref === "function") return;
431
+ const element = ref.current;
432
+ if (element && dayRef.current) {
433
+ element.style.left = `${dayRef.current.offsetLeft - element.offsetWidth + 135}px`;
434
+ element.style.top = `${dayRef.current.offsetTop - element.offsetHeight - 15}px`;
435
+ element.style.visibility = "visible";
436
+ }
437
+ }, [ref]);
438
+ const handleTooltipHidden = (0, import_react4.useCallback)(() => {
439
+ if (!ref || typeof ref === "function") return;
440
+ const element = ref.current;
441
+ if (element) {
442
+ element.style.visibility = "hidden";
443
+ }
444
+ }, [ref]);
445
+ (0, import_react4.useEffect)(() => {
446
+ const currentRef = dayRef.current;
447
+ if (currentRef) {
448
+ currentRef.addEventListener("mouseover", handleTooltipPosition);
449
+ currentRef.addEventListener("mouseleave", handleTooltipHidden);
450
+ }
451
+ return () => {
452
+ if (currentRef) {
453
+ currentRef.removeEventListener("mouseover", handleTooltipPosition);
454
+ currentRef.removeEventListener("mouseleave", handleTooltipHidden);
455
+ }
456
+ };
457
+ }, [handleTooltipPosition, handleTooltipHidden]);
458
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
459
+ "div",
460
+ {
461
+ className: (0, import_classnames2.default)("day", {
462
+ selected,
463
+ hovered,
464
+ disabled,
465
+ highlight,
466
+ end: isEndDay,
467
+ "has-subtext": !!subText
468
+ }),
469
+ onClick: selectDate,
470
+ onMouseEnter: handleHoverDate,
471
+ role: "button",
472
+ tabIndex: -1,
473
+ "data-day-index": dateIndex,
474
+ "data-date-value": dateValue.valueOf(),
475
+ ref: dayRef,
476
+ children: [
477
+ hovered && !(isEndDay && dateIndex === totalDay) && !(dateIndex === 1 && selected && !isEndDay) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
478
+ "div",
479
+ {
480
+ className: (0, import_classnames2.default)("background-day", {
481
+ "first-day": dateIndex === 1,
482
+ "last-day": dateIndex === totalDay
483
+ })
484
+ }
485
+ ),
486
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "day-content", children: [
487
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-day", children: dateIndex }),
488
+ subText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
489
+ "div",
490
+ {
491
+ className: "sub-text",
492
+ style: {
493
+ position: "relative",
494
+ zIndex: 3,
495
+ color: selected && !hovered ? "#fff" : "#666"
496
+ },
497
+ children: subText
498
+ }
499
+ )
500
+ ] })
501
+ ]
502
+ }
503
+ );
504
+ });
505
+ Day.displayName = "Day";
506
+
507
+ // src/lib/components/DatePicker/Week.tsx
508
+ var import_jsx_runtime10 = require("react/jsx-runtime");
509
+ var Week = (0, import_react5.forwardRef)(({
510
+ isFirst,
511
+ week,
512
+ month,
513
+ year,
514
+ totalDay,
515
+ weekIndex,
516
+ handleHoverDay
517
+ }, ref) => {
518
+ const {
519
+ fromDate,
520
+ toDate,
521
+ hoverDate
522
+ } = useDateState();
523
+ const {
524
+ minDate,
525
+ maxDate,
526
+ isSingle,
527
+ highlightToday
528
+ } = useDatePickerConfig();
529
+ const { subTextDict } = useDisplayCustomization();
530
+ const generateDay = () => {
531
+ return Array.from({ length: week.days }, (_, index) => {
532
+ const dateIndex = index + week.start;
533
+ const dateValue = (0, import_dayjs4.default)(`${year}-${month + 1}-${dateIndex}`);
534
+ const disabled = minDate && dateValue.isBefore(minDate, "date") || maxDate && dateValue.isAfter(maxDate, "date");
535
+ const selected = fromDate && dateValue.isSame(fromDate, "date") || toDate && dateValue.isSame(toDate, "date");
536
+ let hovered = false;
537
+ const highlight = highlightToday && dateValue.isSame((0, import_dayjs4.default)(), "date");
538
+ if (fromDate && !fromDate.isSame(toDate, "date") && !isSingle) {
539
+ if (toDate && !fromDate.isAfter(dateValue, "date") && !toDate.isBefore(dateValue, "date")) {
540
+ hovered = true;
541
+ }
542
+ if (!toDate && !dateValue.isBefore(fromDate, "date") && !(hoverDate && hoverDate.isBefore(dateValue, "date")) && fromDate.isBefore(hoverDate, "date")) {
543
+ hovered = true;
544
+ }
545
+ }
546
+ const isEndDate = toDate && dateValue.isSame(toDate, "date") || !toDate && hoverDate && dateValue.isSame(hoverDate, "date");
547
+ const subText = !subTextDict ? "" : subTextDict[dateValue.format("YYYY-MM-DD")] ?? "\xA0";
548
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
549
+ Day,
550
+ {
551
+ dateIndex,
552
+ dateValue,
553
+ selected,
554
+ hovered,
555
+ highlight,
556
+ disabled,
557
+ isEndDay: isEndDate,
558
+ totalDay,
559
+ handleHoverDay,
560
+ subText,
561
+ ref
562
+ },
563
+ index
564
+ );
565
+ });
566
+ };
567
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_classnames3.default)("week", { first: isFirst }), children: generateDay() });
568
+ });
569
+ Week.displayName = "Week";
570
+
571
+ // src/lib/components/DatePicker/MonthCalendar.tsx
572
+ var import_jsx_runtime11 = require("react/jsx-runtime");
573
+ var MonthCalendar = (0, import_react6.forwardRef)(({
574
+ month,
575
+ year,
576
+ hidden = false,
577
+ isAnimating = false,
578
+ handleHoverDay,
579
+ className
580
+ }, ref) => {
581
+ const {
582
+ startWeekDay,
583
+ weekDayFormat,
584
+ monthFormat,
585
+ singleCalendar
586
+ } = useDatePickerConfig();
587
+ const generateWeek = () => {
588
+ const { totalWeek, totalDay } = getMonthInfo(year, month, startWeekDay);
589
+ return totalWeek.map((week) => {
590
+ const weekKey = `${year}-${month}-${week.start}`;
591
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
592
+ Week,
593
+ {
594
+ week,
595
+ month,
596
+ year,
597
+ isFirst: week === totalWeek[0],
598
+ totalDay,
599
+ weekIndex: totalWeek.indexOf(week),
600
+ handleHoverDay,
601
+ ref
602
+ },
603
+ weekKey
604
+ );
605
+ });
606
+ };
607
+ const generateWeekDay = () => {
608
+ const arrWeekDay = getWeekDay(startWeekDay, weekDayFormat);
609
+ return arrWeekDay.map((day) => {
610
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "weekday", children: day }, `weekday-${day.toLowerCase()}`);
611
+ });
612
+ };
613
+ const getMonthDisplay = () => {
614
+ const date = (0, import_dayjs5.default)(`${year}-${month + 1}-1`);
615
+ return monthFormat ? date.format(monthFormat) : date.format("MMMM - YYYY");
616
+ };
617
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
618
+ "div",
619
+ {
620
+ className: (0, import_classnames4.default)("month-calendar", {
621
+ isAnimating,
622
+ hidden,
623
+ single: singleCalendar
624
+ }, className),
625
+ "data-month-index": month + 1,
626
+ children: [
627
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "month-name", children: getMonthDisplay() }),
628
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "weekdays", children: generateWeekDay() }),
629
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "week-container", children: generateWeek() })
630
+ ]
631
+ }
632
+ );
633
+ });
634
+ MonthCalendar.displayName = "MonthCalendar";
635
+
636
+ // src/lib/components/DatePicker/DialogContentMobile.tsx
637
+ var import_jsx_runtime12 = require("react/jsx-runtime");
638
+ var DialogContentMobile = () => {
639
+ const [rowCount, setRowCount] = (0, import_react7.useState)(2400);
640
+ const listRef = (0, import_react7.useRef)(null);
641
+ const {
642
+ fromDate
643
+ } = useDateState();
644
+ const {
645
+ startWeekDay,
646
+ minDate,
647
+ maxDate,
648
+ weekDayFormat
649
+ } = useDatePickerConfig();
650
+ const {
651
+ complsOpen
652
+ } = useUIState();
653
+ const {
654
+ tooltip,
655
+ subTextDict
656
+ } = useDisplayCustomization();
657
+ const minYear = minDate ? (0, import_dayjs6.default)(minDate).year() : 1900;
658
+ const minMonth = minDate ? (0, import_dayjs6.default)(minDate).month() : 0;
659
+ (0, import_react7.useEffect)(() => {
660
+ if (maxDate) {
661
+ const _minDate = minDate ? (0, import_dayjs6.default)(minDate) : (0, import_dayjs6.default)("1900-01-01");
662
+ setRowCount((0, import_dayjs6.default)(maxDate).diff(_minDate, "month") + 1);
663
+ }
664
+ }, [maxDate, minDate]);
665
+ (0, import_react7.useEffect)(() => {
666
+ if (listRef.current && complsOpen) {
667
+ const date = fromDate ? (0, import_dayjs6.default)(fromDate) : (0, import_dayjs6.default)();
668
+ let monthDiff = date.diff((0, import_dayjs6.default)("1900-01-01"), "month");
669
+ if (minDate) {
670
+ monthDiff = date.diff((0, import_dayjs6.default)(minDate), "month");
671
+ }
672
+ listRef.current.scrollToItem(monthDiff + 1, "smart");
673
+ }
674
+ }, [complsOpen, fromDate, minDate]);
675
+ const getMonthYearFromIndex = (index) => {
676
+ const _index = index + minMonth;
677
+ const year = minYear + Math.floor(_index / 12);
678
+ const month = _index % 12;
679
+ return { year, month };
680
+ };
681
+ const Row = import_react7.default.memo(({ index, style }) => {
682
+ const { year, month } = getMonthYearFromIndex(index);
683
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
684
+ MonthCalendar,
685
+ {
686
+ month,
687
+ year,
688
+ hidden: false,
689
+ isAnimating: false,
690
+ handleHoverDay: () => {
691
+ }
692
+ }
693
+ ) });
694
+ });
695
+ Row.displayName = "CalendarRow";
696
+ const getItemSize = (index) => {
697
+ const { year, month } = getMonthYearFromIndex(index);
698
+ const { totalWeek } = getMonthInfo(year, month, startWeekDay || "monday");
699
+ return totalWeek.length * 48 + 34;
700
+ };
701
+ const renderMonthCalendars = () => {
702
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_virtualized_auto_sizer.default, { children: ({ height, width }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
703
+ import_react_window.VariableSizeList,
704
+ {
705
+ ref: listRef,
706
+ width,
707
+ height: height - 36,
708
+ itemCount: rowCount,
709
+ itemSize: getItemSize,
710
+ children: Row
711
+ }
712
+ ) });
713
+ };
714
+ const generateWeekDay = () => {
715
+ const arrWeekDay = getWeekDay(startWeekDay || "monday", weekDayFormat);
716
+ return arrWeekDay.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "weekday", children: day }, index));
717
+ };
718
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "calendar-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "calendar-content", children: [
719
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "weekdays mobile", children: generateWeekDay() }),
720
+ renderMonthCalendars()
721
+ ] }) });
722
+ };
723
+
724
+ // src/lib/components/DatePicker/DialogContentDesktop.tsx
725
+ var import_react8 = require("react");
726
+ var import_classnames5 = __toESM(require("classnames"));
727
+ var import_dayjs7 = __toESM(require("dayjs"));
728
+ var import_jsx_runtime13 = require("react/jsx-runtime");
729
+ var useClientSide2 = () => {
730
+ const [isClient, setIsClient] = (0, import_react8.useState)(false);
731
+ (0, import_react8.useEffect)(() => {
732
+ setIsClient(true);
733
+ }, []);
734
+ return isClient;
735
+ };
736
+ var DialogContentDesktop = ({
737
+ dateChanged = null
738
+ }) => {
739
+ const isClient = useClientSide2();
740
+ const containerRef = (0, import_react8.useRef)(null);
741
+ const tooltipRef = (0, import_react8.useRef)(null);
742
+ const [translateAmount, setTranslateAmount] = (0, import_react8.useState)(0);
743
+ const [monthArray, setMonthArray] = (0, import_react8.useState)([]);
744
+ const [focusDate, setFocusDate] = (0, import_react8.useState)(null);
745
+ const [disablePrev, setDisablePrev] = (0, import_react8.useState)(false);
746
+ const [disableNext, setDisableNext] = (0, import_react8.useState)(false);
747
+ const [wrapperWidth, setWrapperWidth] = (0, import_react8.useState)(0);
748
+ const [dayValue, setDayValue] = (0, import_react8.useState)(null);
749
+ const [isAnimating, setIsAnimating] = (0, import_react8.useState)(false);
750
+ const { fromDate } = useDateState();
751
+ const { minDate, maxDate, singleCalendar } = useDatePickerConfig();
752
+ const { complsOpen } = useUIState();
753
+ const { tooltip } = useDisplayCustomization();
754
+ const getArrayMonth = (0, import_react8.useCallback)((date) => [
755
+ date.subtract(1, "month"),
756
+ date,
757
+ date.add(1, "month"),
758
+ date.add(2, "month")
759
+ ], []);
760
+ (0, import_react8.useEffect)(() => {
761
+ if (!isClient || !containerRef.current) return;
762
+ const updateDimensions = () => {
763
+ const width = containerRef.current.offsetWidth;
764
+ const style = window.getComputedStyle(containerRef.current);
765
+ const translateValue = singleCalendar ? width + parseInt(style.marginLeft) - 8 : width / 2;
766
+ setWrapperWidth(translateValue);
767
+ };
768
+ updateDimensions();
769
+ const resizeObserver = new ResizeObserver(updateDimensions);
770
+ resizeObserver.observe(containerRef.current);
771
+ return () => resizeObserver.disconnect();
772
+ }, [isClient, singleCalendar]);
773
+ (0, import_react8.useEffect)(() => {
774
+ setFocusDate(fromDate ?? (0, import_dayjs7.default)());
775
+ }, [complsOpen, fromDate]);
776
+ (0, import_react8.useEffect)(() => {
777
+ if (!focusDate) return;
778
+ const minDayjs = minDate ? (0, import_dayjs7.default)(minDate) : null;
779
+ const maxDayjs = maxDate ? (0, import_dayjs7.default)(maxDate) : null;
780
+ setDisablePrev(
781
+ Boolean(
782
+ minDayjs && focusDate.isBefore(minDayjs.add(1, "month"), "month")
783
+ )
784
+ );
785
+ setDisableNext(
786
+ Boolean(
787
+ maxDayjs && focusDate.isAfter(maxDayjs.subtract(2, "month"), "month")
788
+ )
789
+ );
790
+ setMonthArray(getArrayMonth(focusDate));
791
+ }, [focusDate, minDate, maxDate, getArrayMonth]);
792
+ (0, import_react8.useEffect)(() => {
793
+ if (!dateChanged || !focusDate) return;
794
+ const monthDiff = dateChanged.diff(focusDate, "month");
795
+ if (monthDiff < -1) decreaseCurrentMonth();
796
+ if (monthDiff > 1) increaseCurrentMonth();
797
+ }, [dateChanged, focusDate]);
798
+ const handleMonthChange = (0, import_react8.useCallback)((direction) => () => {
799
+ if (direction === "next" && disableNext || direction === "prev" && disablePrev || isAnimating) return;
800
+ setIsAnimating(true);
801
+ setTranslateAmount(direction === "next" ? -wrapperWidth : wrapperWidth);
802
+ const timer = setTimeout(() => {
803
+ setFocusDate((prev) => {
804
+ const newDate = direction === "next" ? prev.add(1, "month") : prev.subtract(1, "month");
805
+ setMonthArray(getArrayMonth(newDate));
806
+ return newDate;
807
+ });
808
+ setTranslateAmount(0);
809
+ setIsAnimating(false);
810
+ }, 200);
811
+ return () => clearTimeout(timer);
812
+ }, [disableNext, disablePrev, isAnimating, wrapperWidth, getArrayMonth]);
813
+ const [increaseCurrentMonth, decreaseCurrentMonth] = (0, import_react8.useMemo)(
814
+ () => [handleMonthChange("next"), handleMonthChange("prev")],
815
+ [handleMonthChange]
816
+ );
817
+ const focusOnCalendar = (0, import_react8.useCallback)(() => {
818
+ if (!isClient || !containerRef.current) return;
819
+ const selector = ".day.selected, .month-calendar:not(.hidden) .day:not(.disabled)";
820
+ const focusTarget = containerRef.current.querySelector(selector);
821
+ focusTarget?.focus();
822
+ }, [isClient]);
823
+ const handleKeyDown = (0, import_react8.useCallback)((e) => {
824
+ const target = e.target;
825
+ const dayIndex = target.getAttribute("data-day-index");
826
+ if (!dayIndex) return;
827
+ e.preventDefault();
828
+ const calendarContainer = target.closest(".calendar-wrapper");
829
+ const dateValue = parseInt(target.dataset.dateValue ?? "0");
830
+ const date = (0, import_dayjs7.default)(dateValue);
831
+ const lastDate = date.endOf("month").date();
832
+ let newIndex = parseInt(dayIndex);
833
+ switch (e.key) {
834
+ case "ArrowLeft":
835
+ newIndex--;
836
+ break;
837
+ case "ArrowUp":
838
+ newIndex -= 7;
839
+ break;
840
+ case "ArrowRight":
841
+ newIndex++;
842
+ break;
843
+ case "ArrowDown":
844
+ newIndex += 7;
845
+ break;
846
+ case " ":
847
+ target.click();
848
+ return;
849
+ default:
850
+ return;
851
+ }
852
+ if (newIndex > 0 && newIndex <= lastDate) {
853
+ calendarContainer?.querySelector(`[data-day-index="${newIndex}"]`)?.focus();
854
+ } else {
855
+ const newDate = date.add(newIndex - parseInt(dayIndex), "day");
856
+ const monthDiff = newDate.diff(focusDate, "month");
857
+ if (monthDiff > 1 && !disableNext) increaseCurrentMonth();
858
+ if (monthDiff < 0 && !disablePrev) decreaseCurrentMonth();
859
+ setTimeout(() => {
860
+ calendarContainer?.querySelector(
861
+ `[data-month-index="${newDate.month() + 1}"] [data-day-index="${newDate.date()}"]`
862
+ )?.focus();
863
+ }, 200);
864
+ }
865
+ }, [focusDate, disableNext, disablePrev, increaseCurrentMonth, decreaseCurrentMonth]);
866
+ const renderTooltip = (0, import_react8.useMemo)(() => {
867
+ if (!tooltip || !isClient) return null;
868
+ const content = typeof tooltip === "function" ? tooltip(dayValue?.toDate() ?? /* @__PURE__ */ new Date()) : tooltip;
869
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { id: "day-tooltip", className: "tooltip-text", ref: tooltipRef, children: content });
870
+ }, [tooltip, dayValue, isClient]);
871
+ const calendarMonths = (0, import_react8.useMemo)(
872
+ () => monthArray.map((date, index) => {
873
+ const isVisible = index === 1 || index === 2;
874
+ const isSlidingNext = isAnimating && translateAmount < 0 && index === 3;
875
+ const isSlidingPrev = isAnimating && translateAmount > 0 && index === 0;
876
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
877
+ MonthCalendar,
878
+ {
879
+ hidden: !isVisible && !isSlidingNext && !isSlidingPrev,
880
+ isAnimating: isSlidingNext || isSlidingPrev,
881
+ month: date.month(),
882
+ year: date.year(),
883
+ handleHoverDay: setDayValue,
884
+ ref: tooltipRef,
885
+ className: (0, import_classnames5.default)({ "slide-next": isSlidingNext, "slide-prev": isSlidingPrev })
886
+ },
887
+ `${date.year()}-${date.month()}`
888
+ );
889
+ }),
890
+ [monthArray, isAnimating, translateAmount]
891
+ );
892
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative", children: [
893
+ renderTooltip,
894
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
895
+ "div",
896
+ {
897
+ className: (0, import_classnames5.default)("calendar-wrapper", { single: singleCalendar }),
898
+ ref: containerRef,
899
+ onKeyDown: handleKeyDown,
900
+ role: "grid",
901
+ "aria-label": "Calendar",
902
+ children: [
903
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
904
+ "div",
905
+ {
906
+ className: (0, import_classnames5.default)("calendar-content", { isAnimating }),
907
+ style: { transform: `translateX(${translateAmount}px)` },
908
+ children: calendarMonths
909
+ }
910
+ ),
911
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "calendar-flippers", children: [
912
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
913
+ "button",
914
+ {
915
+ className: (0, import_classnames5.default)("flipper-button", { disabled: disablePrev }),
916
+ onClick: decreaseCurrentMonth,
917
+ onKeyDown: (e) => e.key === " " && decreaseCurrentMonth(),
918
+ disabled: disablePrev,
919
+ "aria-label": "Previous month",
920
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(prev_default, { viewBox: "0 0 24 24" })
921
+ }
922
+ ),
923
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
924
+ "button",
925
+ {
926
+ className: (0, import_classnames5.default)("flipper-button", { disabled: disableNext }),
927
+ onClick: increaseCurrentMonth,
928
+ onKeyDown: (e) => e.key === " " && increaseCurrentMonth(),
929
+ disabled: disableNext,
930
+ "aria-label": "Next month",
931
+ onBlur: focusOnCalendar,
932
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(next_default, { viewBox: "0 0 24 24" })
933
+ }
934
+ )
935
+ ] })
936
+ ]
937
+ }
938
+ )
939
+ ] });
940
+ };
941
+
942
+ // src/lib/components/DatePicker/Dialog.tsx
943
+ var import_jsx_runtime14 = require("react/jsx-runtime");
944
+ var Dialog = ({
945
+ containerRef: externalRef
946
+ }) => {
947
+ const [hideAnimation, setHideAnimation] = (0, import_react9.useState)(false);
948
+ const [dateChanged, setDateChanged] = (0, import_react9.useState)(null);
949
+ const defaultRef = (0, import_react9.useRef)(null);
950
+ const containerRef = externalRef || defaultRef;
951
+ const {
952
+ handleChangeDate,
953
+ handleReset
954
+ } = useDateState();
955
+ const {
956
+ singleCalendar,
957
+ expandDirection
958
+ } = useDatePickerConfig();
959
+ const {
960
+ complsOpen,
961
+ isMobile,
962
+ toggleDialog
963
+ } = useUIState();
964
+ const {
965
+ hideDialogHeader,
966
+ hideDialogFooter
967
+ } = useDisplayCustomization();
968
+ const onChangeDate = (date, type) => {
969
+ setDateChanged(date);
970
+ handleChangeDate(date, type);
971
+ };
972
+ (0, import_react9.useEffect)(() => {
973
+ if (complsOpen && !hideAnimation) {
974
+ setHideAnimation(true);
975
+ }
976
+ if (complsOpen) {
977
+ setTimeout(() => {
978
+ const startDateInput = containerRef.current?.querySelector(
979
+ "#start-date-input-button"
980
+ );
981
+ if (startDateInput) {
982
+ startDateInput.focus();
983
+ }
984
+ }, 50);
985
+ }
986
+ }, [complsOpen, containerRef, hideAnimation]);
987
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
988
+ "div",
989
+ {
990
+ className: (0, import_classnames6.default)("dialog-date-picker", {
991
+ "open": complsOpen,
992
+ "hide": !complsOpen && hideAnimation,
993
+ "single": singleCalendar && !isMobile,
994
+ "expand-left": expandDirection === "left",
995
+ "expand-right": expandDirection === "right"
996
+ }),
997
+ ref: containerRef,
998
+ children: [
999
+ !hideDialogHeader && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dialog-header", children: [
1000
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1001
+ "button",
1002
+ {
1003
+ type: "button",
1004
+ className: "btn-outline back-button",
1005
+ onClick: toggleDialog,
1006
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(back_default, { viewBox: "0 0 492 492" })
1007
+ }
1008
+ ),
1009
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1010
+ DateInputGroup,
1011
+ {
1012
+ showIcon: true,
1013
+ nonFocusable: !complsOpen
1014
+ }
1015
+ ),
1016
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1017
+ "button",
1018
+ {
1019
+ type: "button",
1020
+ className: "btn-outline reset-button",
1021
+ onClick: handleReset,
1022
+ children: "Reset"
1023
+ }
1024
+ )
1025
+ ] }),
1026
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dialog-content", children: isMobile ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogContentMobile, {}) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1027
+ DialogContentDesktop,
1028
+ {
1029
+ dateChanged
1030
+ }
1031
+ ) }),
1032
+ !hideDialogFooter && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dialog-footer", children: [
1033
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1034
+ "button",
1035
+ {
1036
+ type: "button",
1037
+ className: "submit-button",
1038
+ onClick: toggleDialog,
1039
+ tabIndex: 0,
1040
+ children: "Done"
1041
+ }
1042
+ ),
1043
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1044
+ "button",
1045
+ {
1046
+ type: "button",
1047
+ className: "btn-outline reset-button mobile",
1048
+ onClick: handleReset,
1049
+ children: "Reset"
1050
+ }
1051
+ )
1052
+ ] })
1053
+ ]
1054
+ }
1055
+ );
1056
+ };
1057
+
1058
+ // src/lib/components/DatePicker/BaseDatePicker.tsx
1059
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1060
+ import_dayjs8.default.extend(import_localeData.default);
1061
+ var BaseDatePicker = ({
1062
+ startDate = null,
1063
+ endDate = null,
1064
+ className = "",
1065
+ disabled = false,
1066
+ startDatePlaceholder,
1067
+ endDatePlaceholder,
1068
+ onChange,
1069
+ onFocus = () => {
1070
+ },
1071
+ startWeekDay = "monday",
1072
+ minDate = null,
1073
+ maxDate = null,
1074
+ weekDayFormat = "dd",
1075
+ dateFormat = "",
1076
+ monthFormat = "",
1077
+ highlightToday = false,
1078
+ dateInputSeperator = null,
1079
+ hideDialogHeader = false,
1080
+ hideDialogFooter = false,
1081
+ hideDialogAfterSelectEndDate = false,
1082
+ isOpen = false,
1083
+ onCloseCalendar,
1084
+ tooltip = "",
1085
+ subTextDict = null,
1086
+ expandDirection = "right",
1087
+ locale = "en",
1088
+ isSingle = false,
1089
+ singleCalendar = false
1090
+ }) => {
1091
+ const [complsOpen, setComplsOpen] = (0, import_react10.useState)(isOpen);
1092
+ const [inputFocus, setInputFocus] = (0, import_react10.useState)(
1093
+ isSingle ? "from" : null
1094
+ );
1095
+ const [fromDate, setFromDate] = (0, import_react10.useState)(
1096
+ startDate ? (0, import_dayjs8.default)(startDate) : void 0
1097
+ );
1098
+ const [toDate, setToDate] = (0, import_react10.useState)(
1099
+ endDate ? (0, import_dayjs8.default)(endDate) : void 0
1100
+ );
1101
+ const [hoverDate, setHoverDate] = (0, import_react10.useState)();
1102
+ const [isMobile, setIsMobile] = (0, import_react10.useState)(false);
1103
+ const [isFirstTime, setIsFirstTime] = (0, import_react10.useState)(false);
1104
+ const isClient = useClientSide();
1105
+ const containerRef = (0, import_react10.useRef)(null);
1106
+ const fromDateRef = (0, import_react10.useRef)(null);
1107
+ const toDateRef = (0, import_react10.useRef)(null);
1108
+ const handleResize = (0, import_react10.useCallback)(() => {
1109
+ if (!isClient) return;
1110
+ setIsMobile(window.innerWidth < 768);
1111
+ }, [isClient]);
1112
+ const notifyChange = () => {
1113
+ const _startDate = fromDateRef.current ? fromDateRef.current.toDate() : null;
1114
+ const _endDate = !isSingle && toDateRef.current ? toDateRef.current.toDate() : null;
1115
+ if (isSingle) {
1116
+ onChange(_startDate, null);
1117
+ } else {
1118
+ onChange(_startDate, _endDate);
1119
+ }
1120
+ };
1121
+ const debounceNotifyChange = debounce(notifyChange, 20);
1122
+ const updateFromDate = (dateValue, shouldNotifyChange = false) => {
1123
+ setFromDate(dateValue || void 0);
1124
+ fromDateRef.current = dateValue || null;
1125
+ if (shouldNotifyChange) {
1126
+ debounceNotifyChange();
1127
+ }
1128
+ };
1129
+ const updateToDate = (dateValue, shouldNotifyChange = false) => {
1130
+ if (!isSingle) {
1131
+ setToDate(dateValue || void 0);
1132
+ toDateRef.current = dateValue || null;
1133
+ if (shouldNotifyChange) {
1134
+ debounceNotifyChange();
1135
+ }
1136
+ }
1137
+ };
1138
+ (0, import_react10.useLayoutEffect)(() => {
1139
+ if (!isClient) return;
1140
+ handleResize();
1141
+ window.addEventListener("resize", handleResize);
1142
+ return () => window.removeEventListener("resize", handleResize);
1143
+ }, [isClient, handleResize]);
1144
+ (0, import_react10.useEffect)(() => {
1145
+ if (!isClient) return;
1146
+ setIsFirstTime(true);
1147
+ const handleDocumentClick = (e) => {
1148
+ if (containerRef.current && e.target instanceof Node && !containerRef.current.contains(e.target) && window.innerWidth >= 768) {
1149
+ setComplsOpen(false);
1150
+ }
1151
+ };
1152
+ document.addEventListener("click", handleDocumentClick);
1153
+ return () => document.removeEventListener("click", handleDocumentClick);
1154
+ }, [isClient]);
1155
+ (0, import_react10.useEffect)(() => {
1156
+ const _startDateJs = startDate ? (0, import_dayjs8.default)(startDate) : null;
1157
+ fromDateRef.current = _startDateJs;
1158
+ updateFromDate(_startDateJs, false);
1159
+ }, [startDate]);
1160
+ (0, import_react10.useEffect)(() => {
1161
+ if (!isSingle) {
1162
+ const _endDateJs = endDate ? (0, import_dayjs8.default)(endDate) : null;
1163
+ toDateRef.current = _endDateJs;
1164
+ updateToDate(_endDateJs, false);
1165
+ }
1166
+ }, [endDate, isSingle]);
1167
+ (0, import_react10.useEffect)(() => {
1168
+ if (!complsOpen && isFirstTime) {
1169
+ const _startDate = fromDateRef.current?.toDate() || null;
1170
+ const _endDate = toDateRef.current?.toDate() || null;
1171
+ if (isSingle) {
1172
+ onCloseCalendar(_startDate, null);
1173
+ } else {
1174
+ onCloseCalendar(_startDate, _endDate);
1175
+ }
1176
+ }
1177
+ }, [complsOpen, isFirstTime, isSingle, onCloseCalendar]);
1178
+ (0, import_react10.useEffect)(() => {
1179
+ setComplsOpen(isOpen);
1180
+ }, [isOpen]);
1181
+ (0, import_react10.useEffect)(() => {
1182
+ if (isFirstTime) {
1183
+ const input = inputFocus === "from" ? "Start Date" : inputFocus === "to" ? "End Date" : "";
1184
+ onFocus(input);
1185
+ }
1186
+ }, [inputFocus, isFirstTime, onFocus]);
1187
+ const toggleDialog = () => {
1188
+ setComplsOpen(!complsOpen);
1189
+ };
1190
+ const handleClickDateInput = (focusInput) => {
1191
+ if (disabled || !isSingle && focusInput === "to" && !fromDate) {
1192
+ return;
1193
+ }
1194
+ if (!complsOpen) {
1195
+ setComplsOpen(true);
1196
+ }
1197
+ setInputFocus(focusInput);
1198
+ };
1199
+ const onSelectDate = (0, import_react10.useCallback)(
1200
+ (date) => {
1201
+ const minDayjs = minDate ? (0, import_dayjs8.default)(minDate) : null;
1202
+ const maxDayjs = maxDate ? (0, import_dayjs8.default)(maxDate) : null;
1203
+ if (minDayjs && minDayjs.isAfter(date, "date") || maxDayjs && maxDayjs.isBefore(date, "date")) {
1204
+ return;
1205
+ }
1206
+ if (isSingle) {
1207
+ updateFromDate(date, true);
1208
+ if (hideDialogAfterSelectEndDate) {
1209
+ setTimeout(() => setComplsOpen(false), 50);
1210
+ }
1211
+ } else if (inputFocus === "from" || fromDate && date.isBefore(fromDate, "date")) {
1212
+ updateFromDate(date, true);
1213
+ if (toDate && date.isAfter(toDate, "date")) {
1214
+ updateToDate(null, true);
1215
+ }
1216
+ setInputFocus("to");
1217
+ } else {
1218
+ updateToDate(date, true);
1219
+ setInputFocus(null);
1220
+ if (hideDialogAfterSelectEndDate) {
1221
+ setTimeout(() => setComplsOpen(false), 50);
1222
+ }
1223
+ }
1224
+ },
1225
+ [
1226
+ minDate,
1227
+ maxDate,
1228
+ isSingle,
1229
+ hideDialogAfterSelectEndDate,
1230
+ inputFocus,
1231
+ fromDate,
1232
+ toDate
1233
+ ]
1234
+ );
1235
+ const onHoverDate = (date) => {
1236
+ setHoverDate(date);
1237
+ };
1238
+ const handleReset = () => {
1239
+ setHoverDate(void 0);
1240
+ updateFromDate(null, true);
1241
+ if (!isSingle) {
1242
+ updateToDate(null, true);
1243
+ }
1244
+ setInputFocus("from");
1245
+ };
1246
+ const handleChangeDate = (0, import_react10.useCallback)(
1247
+ (date, type) => {
1248
+ const minDayjs = minDate ? (0, import_dayjs8.default)(minDate) : null;
1249
+ const maxDayjs = maxDate ? (0, import_dayjs8.default)(maxDate) : null;
1250
+ if (minDayjs && minDayjs.isAfter(date, "date") || maxDayjs && maxDayjs.isBefore(date, "date")) {
1251
+ return;
1252
+ }
1253
+ if (type === "from" || isSingle) {
1254
+ setInputFocus("from");
1255
+ updateFromDate(date, true);
1256
+ if (!isSingle && toDate && date.isAfter(toDate, "date")) {
1257
+ updateToDate(null, true);
1258
+ }
1259
+ } else {
1260
+ setInputFocus("to");
1261
+ updateToDate(date, true);
1262
+ }
1263
+ },
1264
+ [minDate, maxDate, isSingle, toDate, inputFocus]
1265
+ );
1266
+ const dateState = {
1267
+ fromDate,
1268
+ toDate,
1269
+ hoverDate,
1270
+ inputFocus,
1271
+ onSelectDate,
1272
+ onHoverDate,
1273
+ handleChangeDate,
1274
+ handleReset,
1275
+ handleClickDateInput
1276
+ };
1277
+ const config = {
1278
+ isSingle,
1279
+ startWeekDay,
1280
+ minDate: minDate ? (0, import_dayjs8.default)(minDate).toDate() : null,
1281
+ maxDate: maxDate ? (0, import_dayjs8.default)(maxDate).toDate() : null,
1282
+ weekDayFormat,
1283
+ dateFormat,
1284
+ monthFormat,
1285
+ highlightToday,
1286
+ singleCalendar,
1287
+ expandDirection,
1288
+ locale
1289
+ };
1290
+ const uiState = {
1291
+ complsOpen,
1292
+ isMobile,
1293
+ disabled,
1294
+ toggleDialog
1295
+ };
1296
+ const display = {
1297
+ startDatePlaceholder,
1298
+ endDatePlaceholder,
1299
+ dateInputSeperator,
1300
+ hideDialogHeader,
1301
+ hideDialogFooter,
1302
+ hideDialogAfterSelectEndDate,
1303
+ tooltip,
1304
+ subTextDict
1305
+ };
1306
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "react-google-flight-datepicker", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1307
+ "div",
1308
+ {
1309
+ className: (0, import_classnames7.default)("date-picker", className, {
1310
+ disabled
1311
+ }),
1312
+ ref: containerRef,
1313
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1314
+ DatePickerProvider,
1315
+ {
1316
+ dateState,
1317
+ config,
1318
+ uiState,
1319
+ display,
1320
+ locale,
1321
+ children: [
1322
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DateInputGroup, {}),
1323
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogWrapper_default, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Dialog, {}) })
1324
+ ]
1325
+ }
1326
+ )
1327
+ }
1328
+ ) });
1329
+ };
1330
+ var BaseDatePicker_default = BaseDatePicker;
1331
+
1332
+ // src/lib/components/DatePicker/ClientOnly.tsx
1333
+ var import_react11 = require("react");
1334
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1335
+ var ClientOnly = ({ children }) => {
1336
+ const [hasMounted, setHasMounted] = (0, import_react11.useState)(false);
1337
+ (0, import_react11.useEffect)(() => {
1338
+ setHasMounted(true);
1339
+ }, []);
1340
+ if (!hasMounted) return null;
1341
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children });
1342
+ };
1343
+
1344
+ // src/lib/components/DatePicker/RangeDatePicker.tsx
1345
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1346
+ var RangeDatePicker = ({
1347
+ onChange = () => {
1348
+ },
1349
+ onCloseCalendar = () => {
1350
+ },
1351
+ startDatePlaceholder = "Start date",
1352
+ endDatePlaceholder = "End date",
1353
+ ...props
1354
+ }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ClientOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1355
+ BaseDatePicker_default,
1356
+ {
1357
+ ...props,
1358
+ isSingle: false,
1359
+ startDate: props.startDate,
1360
+ endDate: props.endDate,
1361
+ startDatePlaceholder,
1362
+ endDatePlaceholder,
1363
+ onChange,
1364
+ onCloseCalendar
591
1365
  }
592
- .react-google-flight-datepicker .dialog-date-picker.open {
593
- transition: all 0.2s ease-out;
594
- transform: translate(0, -100%);
595
- animation: none;
1366
+ ) });
1367
+
1368
+ // src/lib/components/DatePicker/SingleDatePicker.tsx
1369
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1370
+ var SingleDatePicker = ({
1371
+ onChange = () => {
1372
+ },
1373
+ onCloseCalendar = () => {
1374
+ },
1375
+ startDatePlaceholder = "Date",
1376
+ ...props
1377
+ }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ClientOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1378
+ BaseDatePicker_default,
1379
+ {
1380
+ ...props,
1381
+ endDate: null,
1382
+ isSingle: true,
1383
+ startDate: props.startDate,
1384
+ startDatePlaceholder,
1385
+ onChange: (date) => onChange(date),
1386
+ onCloseCalendar: (date) => onCloseCalendar(date)
596
1387
  }
597
- .react-google-flight-datepicker .dialog-date-picker.hide {
598
- transition: all 0.2s ease-in;
599
- transform: translate(0, 0);
600
- animation: none;
601
- }
602
- .react-google-flight-datepicker .dialog-header {
603
- padding: 8px;
604
- box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.24);
605
- z-index: 50;
606
- }
607
- .react-google-flight-datepicker .dialog-header .date-picker-input {
608
- height: 40px;
609
- width: 100%;
610
- }
611
- .react-google-flight-datepicker .dialog-content {
612
- border: none;
613
- overflow: hidden;
614
- height: 100%;
615
- }
616
- .react-google-flight-datepicker .calendar-wrapper {
617
- margin: 0;
618
- height: 100%;
619
- display: flex;
620
- }
621
- .react-google-flight-datepicker .calendar-content {
622
- padding: 0;
623
- width: 100%;
624
- height: 100%;
625
- flex-direction: column;
626
- flex-grow: 1;
627
- }
628
- .react-google-flight-datepicker .weekdays.mobile {
629
- display: flex;
630
- background-color: #f3f3f3;
631
- }
632
- .react-google-flight-datepicker .month-calendar {
633
- width: 100%;
634
- display: flex;
635
- flex-direction: column;
636
- }
637
- .react-google-flight-datepicker .day {
638
- width: 14.2857142857%;
639
- max-width: 14.2857142857%;
640
- }
641
- .react-google-flight-datepicker .day.selected:hover, .react-google-flight-datepicker .day.hovered:hover {
642
- color: #fff !important;
643
- }
644
- .react-google-flight-datepicker .day.selected:hover::after, .react-google-flight-datepicker .day.hovered:hover::after {
645
- background-color: #4285f4 !important;
646
- }
647
- .react-google-flight-datepicker .month-name {
648
- text-align: left;
649
- margin-left: 10px;
650
- margin-bottom: 0px;
651
- margin-top: 25px;
652
- font-weight: bold;
653
- }
654
- .react-google-flight-datepicker .dialog-footer {
655
- box-shadow: 0 0 4px rgba(0, 0, 0, 0.12), 0 4px 4px rgba(0, 0, 0, 0.24);
656
- padding: 15px 8px;
657
- }
658
- }
659
- /*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VSb290IjoiQzpcXFVzZXJzXFxFbGlhc1xcRG9jdW1lbnRzXFxyZWFjdC1nb29nbGUtZmxpZ2h0LWRhdGVwaWNrZXJcXHNyY1xcbGliXFxjb21wb25lbnRzXFxEYXRlUGlja2VyIiwic291cmNlcyI6WyJzdHlsZXMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFO0VBQ0E7QUE2bEJBOztBQTNsQkE7RUFDRTs7QUFHRjtFQUNFOztBQUdGO0VBQ0U7RUFDQTtFQUNBO0VBQ0E7RUFDQTs7QUFHRjtFQUNFO0VBQ0E7RUFDQTtFQUNBOztBQUVBO0VBQ0U7RUFDQTs7QUFJSjtFQUNFO0VBQ0E7RUFDQTtFQUNBO0VBQ0E7RUFDQTtFQUNBO0VBQ0E7RUFDQTtFQUNBO0VBQ0E7O0FBR0E7RUFDRTtFQUNBOztBQUlKO0VBQ0U7RUFDQTtFQUNBO0VBQ0E7RUFDQTs7QUFHRjtFQUNFO0VBQ0E7RUFDQTtFQUNBO0VBQ0E7RUFDQTtFQUNBO0VBQ0E7RUFDQTtFQUNBOztBQUVBO0VBQ0U7O0FBSUo7RUFDRTtFQUNBO0VBQ0E7RUFDQTtFQUNBO0VBQ0E7RUFDQTtFQUNBOztBQUdGO0VBQ0U7RUFDQTtFQUNBO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heTogZmxleDtcclxuICAgIGp1c3RpZnktY29udGVudDogZmxleC1zdGFydDtcclxuXHJcbiAgICAmLmZpcnN0IHtcclxuICAgICAganVzdGlmeS1jb250ZW50OiBmbGV4LWVuZDtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIC5kYXkge1xyXG4gICAgZGlzcGxheTogZmxleDtcclxuICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xyXG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcclxuICAgIGN1cnNvcjogcG9pbnRlcjtcclxuICAgIGhlaWdodDogNDRweDtcclxuICAgIG1hcmdpbjogMnB4IDA7XHJcbiAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XHJcbiAgICB3aWR0aDogNDRweDtcclxuICAgIHZlcnRpY2FsLWFsaWduOiB0b3A7XHJcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XHJcbiAgICBib3JkZXItcmFkaXVzOiA1MCU7XHJcblxyXG4gICAgLmJhY2tncm91bmQtZGF5IHtcclxuICAgICAgYm90dG9tOiAwO1xyXG4gICAgICBvcGFjaXR5OiAwO1xyXG4gICAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcclxuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xyXG4gICAgICB0b3A6IDA7XHJcbiAgICAgIHdpZHRoOiAxMHB4O1xyXG4gICAgICB6LWluZGV4OiAxO1xyXG5cclxuICAgICAgJi5maXJzdC1kYXkge1xyXG4gICAgICAgIGJhY2tncm91bmQ6IGxpbmVhci1ncmFkaWVudCh0byByaWdodCwgI2ZmZiwgI2RhZWRmZCk7XHJcbiAgICAgICAgbGVmdDogLTEwcHg7XHJcbiAgICAgIH1cclxuXHJcbiAgICAgICYubGFzdC1kYXkge1xyXG4gICAgICAgIGJhY2tncm91bmQ6IGxpbmVhci1ncmFkaWVudCh0byBsZWZ0LCAjZmZmLCAjZGFlZGZkKTtcclxuICAgICAgICByaWdodDogLTEwcHg7XHJcbiAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAmOjphZnRlciB7XHJcbiAgICAgIGJvcmRlci1yYWRpdXM6IDEwMCU7XHJcbiAgICAgIGJvdHRvbTogMDtcclxuICAgICAgY29udGVudDogJyc7XHJcbiAgICAgIGhlaWdodDogNDRweDtcclxuICAgICAgbGVmdDogMDtcclxuICAgICAgbWFyZ2luOiBhdXRvO1xyXG4gICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XHJcbiAgICAgIHJpZ2h0OiAwO1xyXG4gICAgICB0b3A6IDA7XHJcbiAgICAgIHdpZHRoOiA0NHB4O1xyXG4gICAgICB6LWluZGV4OiAyO1xyXG4gICAgfVxyXG5cclxuICAgICY6aG92ZXI6OmFmdGVyIHtcclxuICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjtcclxuICAgICAgYm9yZGVyOiAycHggc29saWQgIzQyODVmNDtcclxuICAgICAgYm90dG9tOiAtMnB4O1xyXG4gICAgICBsZWZ0OiAtMnB4O1xyXG4gICAgICByaWdodDogLTJweDtcclxuICAgICAgdG9wOiAtMnB4O1xyXG4gICAgfVxyXG5cclxuICAgICYuc2VsZWN0ZWQge1xyXG4gICAgICBjb2xvcjogd2hpdGU7XHJcblxyXG4gICAgICAmOmhvdmVyIHtcclxuICAgICAgICBjb2xvcjogIzAwMDtcclxuICAgICAgfVxyXG5cclxuICAgICAgJjo6YWZ0ZXIge1xyXG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6ICM0Mjg1ZjQ7XHJcbiAgICAgICAgYm9yZGVyLXJhZGl1czogMTAwJTtcclxuICAgICAgfVxyXG5cclxuICAgICAgJjpob3Zlcjo6YWZ0ZXIge1xyXG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZmY7XHJcbiAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAmLmhpZ2hsaWdodDo6YmVmb3JlIHtcclxuICAgICAgY29udGVudDogJyc7XHJcbiAgICAgIHdpZHRoOiA0NHB4O1xyXG4gICAgICBoZWlnaHQ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yXG4gICAgICAgIHRyYW5zaXRpb246IGFsbCAwLjJzIGVhc2Utb3V0O1xyXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlKDAsIC0xMDAlKTtcclxuICAgICAgICBhbmltYXRpb246IG5vbmU7XHJcbiAgICAgIH1cclxuXHJcbiAgICAgICYuaGlkZSB7XHJcbiAgICAgICAgdHJhbnNpdGlvbjogYWxsIDAuMnMgZWFzZS1pbjtcclxuICAgICAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZSgwLCAwKTtcclxuICAgICAgICBhbmltYXRpb246IG5vbmU7XHJcbiAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAuZGlhbG9nLWhlYWRlciB7XHJcbiAgICAgIHBhZGRpbmc6IDhweDtcclxuICAgICAgYm94LXNoYWRvdzogMCAwIDJweCByZ2JhKDAsIDAsIDAsIDAuMTIpLCAwIDJweCAycHggcmdiYSgwLCAwLCAwLCAwLjI0KTtcclxuICAgICAgei1pbmRleDogNTA7XHJcblxyXG4gICAgICAuZGF0ZS1waWNrZXItaW5wdXQge1xyXG4gICAgICAgIGhlaWdodDogNDBweDtcclxuICAgICAgICB3aWR0aDogMTAwJTtcclxuICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC5kaWFsb2ctY29udGVudCB7XHJcbiAgICAgIGJvcmRlcjogbm9uZTtcclxuICAgICAgb3ZlcmZsb3c6IGhpZGRlbjtcclxuICAgICAgaGVpZ2h0OiAxMDAlO1xyXG4gICAgfVxyXG5cclxuICAgIC5jYWxlbmRhci13cmFwcGVyIHtcclxuICAgICAgbWFyZ2luOiAwO1xyXG4gICAgICBoZWlnaHQ6IDEwMCU7XHJcbiAgICAgIGRpc3BsYXk6IGZsZXg7XHJcbiAgICB9XHJcblxyXG4gICAgLmNhbGVuZGFyLWNvbnRlbnQge1xyXG4gICAgICBwYWRkaW5nOiAwO1xyXG4gICAgICB3aWR0aDogMTAwJTtcclxuICAgICAgaGVpZ2h0OiAxMDAlO1xy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cmdiYSgwLCAwLCAwLCAwLjI0KTtcclxuICAgICAgcGFkZGluZzogMTVweCA4cHg7XHJcbiAgICB9XHJcbiAgfVxyXG59XHJcbiJdfQ== */`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(io));var re=require("react/jsx-runtime");M.default.extend(Rt.default);var lo=({startDate:e=null,endDate:t=null,className:o="",disabled:a=!1,startDatePlaceholder:i,endDatePlaceholder:r,onChange:d,onFocus:A=()=>{},startWeekDay:g="monday",minDate:s=null,maxDate:n=null,weekDayFormat:m="dd",dateFormat:D="",monthFormat:Q="",highlightToday:f=!1,dateInputSeperator:B=null,hideDialogHeader:X=!1,hideDialogFooter:h=!1,hideDialogAfterSelectEndDate:c=!1,isOpen:y=!1,onCloseCalendar:C,tooltip:G="",subTextDict:P=null,expandDirection:z="right",locale:oe="en",isSingle:p=!1,singleCalendar:V=!1})=>{let[U,O]=(0,b.useState)(y),[Z,ce]=(0,b.useState)(p?"from":null),[ne,Te]=(0,b.useState)(e?(0,M.default)(e):void 0),[K,I]=(0,b.useState)(t?(0,M.default)(t):void 0),[x,J]=(0,b.useState)(),[R,$]=(0,b.useState)(!1),[de,Ye]=(0,b.useState)(!1),Ie=(()=>{let[l,H]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{H(!0)},[]),l})(),ue=(0,b.useRef)(null),q=(0,b.useRef)(null),ae=(0,b.useRef)(null),se=(0,b.useCallback)(()=>{Ie&&$(window.innerWidth<768)},[Ie]),tt=it(()=>{let l=q.current?q.current.toDate():null,H=!p&&ae.current?ae.current.toDate():null;p?d(l,null):d(l,H)},20),ye=(l,H=!1)=>{Te(l||void 0),q.current=l||null,H&&tt()},be=(l,H=!1)=>{p||(I(l||void 0),ae.current=l||null,H&&tt())};(0,b.useLayoutEffect)(()=>{if(Ie)return se(),window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)},[Ie,se]),(0,b.useEffect)(()=>{Ye(!0);let l=H=>{ue.current&&H.target instanceof Node&&!ue.current.contains(H.target)&&window.innerWidth>=768&&O(!1)};return document.addEventListener("click",l),()=>document.removeEventListener("click",l)},[]),(0,b.useEffect)(()=>{let l=e?(0,M.default)(e):null;q.current=l,ye(l,!1)},[e]),(0,b.useEffect)(()=>{if(!p){let l=t?(0,M.default)(t):null;ae.current=l,be(l,!1)}},[t,p]),(0,b.useEffect)(()=>{var l,H;if(!U&&de){let ge=((l=q.current)==null?void 0:l.toDate())||null,he=((H=ae.current)==null?void 0:H.toDate())||null;p?C(ge,null):C(ge,he)}},[U,de,p,C]),(0,b.useEffect)(()=>{O(y)},[y]),(0,b.useEffect)(()=>{de&&A(Z==="from"?"Start Date":Z==="to"?"End Date":"")},[Z,de,A]);let kt=()=>{O(!U)},Jt=l=>{a||!p&&l==="to"&&!ne||(U||O(!0),ce(l))},vt=(0,b.useCallback)(l=>{let H=s?(0,M.default)(s):null,ge=n?(0,M.default)(n):null;H&&H.isAfter(l,"date")||ge&&ge.isBefore(l,"date")||(p?(ye(l,!0),c&&setTimeout(()=>O(!1),50)):Z==="from"||ne&&l.isBefore(ne,"date")?(ye(l,!0),K&&l.isAfter(K,"date")&&be(null,!0),ce("to")):(be(l,!0),ce(null),c&&setTimeout(()=>O(!1),50)))},[s,n,p,c,Z,ne,K]),wt=l=>{J(l)},Nt=()=>{J(void 0),ye(null,!0),p||be(null,!0),ce("from")},Wt=(0,b.useCallback)((l,H)=>{let ge=s?(0,M.default)(s):null,he=n?(0,M.default)(n):null;ge&&ge.isAfter(l,"date")||he&&he.isBefore(l,"date")||(H==="from"||p?(ce("from"),ye(l,!0),!p&&K&&l.isAfter(K,"date")&&be(null,!0)):(ce("to"),be(l,!0)))},[s,n,p,K,Z]),Vt={fromDate:ne,toDate:K,hoverDate:x,inputFocus:Z,onSelectDate:vt,onHoverDate:wt,handleChangeDate:Wt,handleReset:Nt,handleClickDateInput:Jt},Tt={isSingle:p,startWeekDay:g,minDate:s?(0,M.default)(s).toDate():null,maxDate:n?(0,M.default)(n).toDate():null,weekDayFormat:m,dateFormat:D,monthFormat:Q,highlightToday:f,singleCalendar:V,expandDirection:z,locale:oe},Yt={complsOpen:U,isMobile:R,disabled:a,toggleDialog:kt},jt={startDatePlaceholder:i,endDatePlaceholder:r,dateInputSeperator:B,hideDialogHeader:X,hideDialogFooter:h,hideDialogAfterSelectEndDate:c,tooltip:G,subTextDict:P};return(0,re.jsx)("div",{className:"react-google-flight-datepicker",children:(0,re.jsx)("div",{className:(0,Zt.default)("date-picker",o,{disabled:a}),ref:ue,children:(0,re.jsxs)(It,{dateState:Vt,config:Tt,uiState:Yt,display:jt,locale:oe,children:[(0,re.jsx)(Je,{}),(0,re.jsx)(ut,{children:(0,re.jsx)(Qt,{})})]})})})},we=lo;var Ne=require("react"),Ve=require("react/jsx-runtime"),We=({children:e})=>{let[t,o]=(0,Ne.useState)(!1);return(0,Ne.useEffect)(()=>{o(!0)},[]),t?(0,Ve.jsx)(Ve.Fragment,{children:e}):null};var qe=require("react/jsx-runtime"),Ot=r=>{var d=r,{onChange:e=()=>{},onCloseCalendar:t=()=>{},startDatePlaceholder:o="Start date",endDatePlaceholder:a="End date"}=d,i=He(d,["onChange","onCloseCalendar","startDatePlaceholder","endDatePlaceholder"]);return(0,qe.jsx)(We,{children:(0,qe.jsx)(we,w(v({},i),{isSingle:!1,startDate:i.startDate,endDate:i.endDate,startDatePlaceholder:o,endDatePlaceholder:a,onChange:e,onCloseCalendar:t}))})};var et=require("react/jsx-runtime"),Ut=i=>{var r=i,{onChange:e=()=>{},onCloseCalendar:t=()=>{},startDatePlaceholder:o="Date"}=r,a=He(r,["onChange","onCloseCalendar","startDatePlaceholder"]);return(0,et.jsx)(We,{children:(0,et.jsx)(we,w(v({},a),{endDate:null,isSingle:!0,startDate:a.startDate,startDatePlaceholder:o,onChange:d=>e(d),onCloseCalendar:d=>t(d)}))})};
1388
+ ) });
1389
+ // Annotate the CommonJS export names for ESM import in node:
1390
+ 0 && (module.exports = {
1391
+ RangeDatePicker,
1392
+ SingleDatePicker
1393
+ });
660
1394
  //# sourceMappingURL=index.js.map