"use strict";const e=require("react/jsx-runtime"),n=require("react"),p=require("../global.module.cjs"),g=require("../tools/icons.cjs"),s=require("../tools/tools.cjs"),O=require("../lite.cjs"),j=new Date,b=function(N){const{as:D="div",className:x,dropOldClass:m,locale:i,onDateClick:d,selectedDate:u,style:h,variables:v,...k}=N,[o,M]=n.useState(j.getFullYear()),[l,w]=n.useState(j.getMonth()),[f,C]=n.useState(s.generateCalendar(o,l,[],6,1,void 0,u,i,!1,"month")),S=n.useMemo(()=>{const r=s.classx(!m&&"card card-body border-0 p-0",x),t=s.stylex((a,c)=>({tKey:s.convertBsKeyToVar(c)}),v,h);return{className:r,style:t}},[x,m,h,v]),y=n.useCallback(r=>{const t=new Date(o+r,l);M(t.getFullYear()),w(t.getMonth())},[l,o]),P=n.useCallback((r,t,a)=>{const c={...r,active:!0};C(q=>s.updateCalendarDataTypeActiveState(c,t,a,q)),d==null||d(c)},[d]);return n.useEffect(()=>{C(s.generateCalendar(o,l,[],6,1,void 0,u,i,!1,"month"))},[l,o,i,u]),e.jsx(D,{...k,...S,children:e.jsxs("div",{className:"list-group border-0 row-gap-1 px-3",children:[e.jsxs("div",{className:"row align-items-center position-relative text-center mb-2",children:[e.jsx("div",{className:"col px-1",onClick:()=>y(-1),children:e.jsx("div",{className:s.classxWithOptions(null,"user-select-none list-group-item list-group-item-action border-0 px-0 py-1 rounded text-secondary",p.treeStyles.brlCursorPointer),children:e.jsx(g.BiChevronLeft,{})})}),e.jsx("div",{className:"col px-1"}),e.jsx("div",{className:"col px-1"}),e.jsx("div",{className:"col px-1",onClick:()=>y(1),children:e.jsx("div",{className:s.classxWithOptions(null,"user-select-none list-group-item list-group-item-action border-0 px-0 py-1 rounded text-secondary",p.treeStyles.brlCursorPointer),children:e.jsx(g.BiChevronRight,{})})}),e.jsx("div",{className:"position-absolute top-50 start-50 translate-middle w-auto text-nowrap",children:O.format(new Date(o,l),"yyyy",{locale:i})})]}),f.rows.map((r,t)=>e.jsx("div",{className:"row text-center",children:r.map((a,c)=>e.jsx("div",{className:"col px-1",onClick:()=>P(a,t,c),children:e.jsx("div",{className:s.classxWithOptions(null,"position-relative list-group-item list-group-item-action px-0 py-1 rounded border-0",p.treeStyles.brlCursorPointer,a.active&&"active"),children:a.value})},a.value))},t))]})})};b.displayName="BRL.DatePickerMonth";exports.DatePickerMonth=b;
//# sourceMappingURL=date-picker-month.cjs.map
