cortex-react-components 2.17.2 → 2.17.3

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.
Files changed (109) hide show
  1. package/dist/{chunk-WIRQ5IRT.mjs → chunk-2GM2LPLB.mjs} +1 -1
  2. package/dist/{chunk-3HNU2NYP.mjs → chunk-2OOJ4ZFB.mjs} +1 -1
  3. package/dist/{chunk-ZEALRBXW.mjs → chunk-3ANJOET7.mjs} +1 -1
  4. package/dist/{chunk-7R47MHQE.mjs → chunk-4SRUEQTP.mjs} +1 -1
  5. package/dist/{chunk-CXOVEABI.mjs → chunk-7OMPPFGG.mjs} +1 -1
  6. package/dist/{chunk-75F3LJMX.mjs → chunk-BQQ4V4PX.mjs} +1 -1
  7. package/dist/{chunk-IBUT2LYD.mjs → chunk-EUMMM454.mjs} +1 -1
  8. package/dist/{chunk-GHOL5L32.mjs → chunk-F64CA5CH.mjs} +1 -1
  9. package/dist/{chunk-3Y7QG6VP.mjs → chunk-FEWOSBUJ.mjs} +1 -1
  10. package/dist/{chunk-2BRDNDUB.mjs → chunk-FYQBRCQM.mjs} +1 -1
  11. package/dist/{chunk-RJGYVDOU.mjs → chunk-GAZHKHGB.mjs} +1 -1
  12. package/dist/{chunk-RGOKBIQ5.mjs → chunk-GETYSIZV.mjs} +1 -1
  13. package/dist/{chunk-Z6HIWYMX.mjs → chunk-GQEGZKN6.mjs} +1 -1
  14. package/dist/{chunk-3NRXQBBS.mjs → chunk-HDKHF3EA.mjs} +1 -1
  15. package/dist/{chunk-C4RWEPVF.mjs → chunk-HKMNAXLM.mjs} +1 -1
  16. package/dist/{chunk-TKXBSTKU.mjs → chunk-KUFXQZI5.mjs} +1 -1
  17. package/dist/{chunk-PWFVXG44.mjs → chunk-KVLUT4U2.mjs} +1 -1
  18. package/dist/{chunk-5MWZTJYP.mjs → chunk-MO4HRQEL.mjs} +1 -1
  19. package/dist/{chunk-Q4SENBJV.mjs → chunk-NSWNM3O5.mjs} +1 -1
  20. package/dist/{chunk-KWYJ3XZI.mjs → chunk-O24GFE6Q.mjs} +1 -1
  21. package/dist/{chunk-GTZJWMZR.mjs → chunk-P6OSMPUQ.mjs} +1 -1
  22. package/dist/{chunk-FE7ZGUPU.mjs → chunk-PNUBVBSR.mjs} +1 -1
  23. package/dist/{chunk-AJQHGVZ5.mjs → chunk-PTZT4QJW.mjs} +1 -1
  24. package/dist/{chunk-OYE7B4PN.mjs → chunk-R5P4ZICA.mjs} +1 -1
  25. package/dist/{chunk-EM3T2XYC.mjs → chunk-R6AYIVIR.mjs} +1 -1
  26. package/dist/{chunk-Z2SJVYUM.mjs → chunk-RFRNTKO7.mjs} +1 -1
  27. package/dist/{chunk-P55W6AFU.mjs → chunk-RIRZRO6U.mjs} +1 -1
  28. package/dist/{chunk-TXVA6XJT.mjs → chunk-SRUG246N.mjs} +1 -1
  29. package/dist/{chunk-GCRVTTBJ.mjs → chunk-SX456QYL.mjs} +1 -1
  30. package/dist/{chunk-RSDUFAIB.mjs → chunk-T5HJS6OF.mjs} +1 -1
  31. package/dist/{chunk-723U74ZC.mjs → chunk-TNQS3NVB.mjs} +1 -1
  32. package/dist/{chunk-NINFDOV5.mjs → chunk-U3FYDDE2.mjs} +1 -1
  33. package/dist/{chunk-SH2SBOG7.mjs → chunk-UCPJ4KXN.mjs} +1 -1
  34. package/dist/{chunk-6OJBBMB5.mjs → chunk-UK7PR73C.mjs} +1 -1
  35. package/dist/{chunk-X3JZSN3W.mjs → chunk-UZSBX5GO.mjs} +1 -1
  36. package/dist/{chunk-XGIYNUGC.mjs → chunk-VNYUNZ3M.mjs} +1 -1
  37. package/dist/{chunk-2BR55L74.mjs → chunk-VRE6VCHX.mjs} +1 -1
  38. package/dist/chunk-VZBIMHCR.mjs +4 -0
  39. package/dist/components/Blocks/Banner.mjs +1 -1
  40. package/dist/components/Blocks/CallToAction.mjs +1 -1
  41. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  42. package/dist/components/Blocks/Content.mjs +1 -1
  43. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  44. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  45. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  46. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  47. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  48. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  49. package/dist/components/Blocks/index.mjs +1 -1
  50. package/dist/components/Cards/ContentCard.mjs +1 -1
  51. package/dist/components/Cards/FeatureCard.mjs +1 -1
  52. package/dist/components/Cards/index.mjs +1 -1
  53. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  54. package/dist/components/Foundary/RichText/index.mjs +1 -1
  55. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  56. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  57. package/dist/components/Foundary/Views/index.mjs +1 -1
  58. package/dist/components/Foundary/document-edit.mjs +1 -1
  59. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  60. package/dist/components/Foundary/document-preview.mjs +1 -1
  61. package/dist/components/Foundary/index.mjs +1 -1
  62. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  63. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  64. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  65. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  66. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  67. package/dist/components/Heros/RenderHero.mjs +1 -1
  68. package/dist/components/Heros/index.mjs +1 -1
  69. package/dist/components/Holidays/CalendarView.js +1 -1
  70. package/dist/components/Holidays/CalendarView.mjs +1 -1
  71. package/dist/components/Holidays/HolidayTracker.js +1 -1
  72. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  73. package/dist/components/Holidays/index.js +1 -1
  74. package/dist/components/Holidays/index.mjs +1 -1
  75. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  76. package/dist/components/Layouts/Print.mjs +1 -1
  77. package/dist/components/Layouts/SlideShow.mjs +1 -1
  78. package/dist/components/Layouts/index.mjs +1 -1
  79. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  80. package/dist/components/Payload/Media/index.mjs +1 -1
  81. package/dist/components/Payload/PayloadCard/index.mjs +1 -1
  82. package/dist/components/Payload/RichText/index.mjs +1 -1
  83. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  84. package/dist/components/Payload/index.mjs +1 -1
  85. package/dist/components/index.js +7 -7
  86. package/dist/components/index.mjs +1 -1
  87. package/dist/index.js +7 -7
  88. package/dist/index.mjs +1 -1
  89. package/dist/metafile-cjs.json +1 -1
  90. package/dist/metafile-esm.json +1 -1
  91. package/dist/pages/Blog.mjs +1 -1
  92. package/dist/pages/IndexPage.mjs +1 -1
  93. package/dist/pages/LandingPage.mjs +1 -1
  94. package/dist/pages/Page.mjs +1 -1
  95. package/dist/pages/Publish.mjs +1 -1
  96. package/dist/pages/Website.mjs +1 -1
  97. package/dist/sections/AboutSection.mjs +1 -1
  98. package/dist/sections/BlogDetail.mjs +1 -1
  99. package/dist/sections/BlogList.mjs +1 -1
  100. package/dist/sections/ContactSection.mjs +1 -1
  101. package/dist/sections/PageSections.mjs +1 -1
  102. package/dist/sections/PricingSection.mjs +1 -1
  103. package/dist/sections/ServiceDetail.mjs +1 -1
  104. package/dist/sections/ServiceDetailSection.mjs +1 -1
  105. package/dist/sections/ServiceSection.mjs +1 -1
  106. package/dist/sections/form/index.mjs +1 -1
  107. package/dist/sections/index.mjs +1 -1
  108. package/package.json +1 -1
  109. package/dist/chunk-RGZHZIKQ.mjs +0 -4
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";"use client";var wt=Object.create;var oe=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Ct=Object.getOwnPropertyNames;var Pt=Object.getPrototypeOf,kt=Object.prototype.hasOwnProperty;var Dt=(e,r)=>{for(var t in r)oe(e,t,{get:r[t],enumerable:!0})},Ie=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Ct(r))!kt.call(e,s)&&s!==t&&oe(e,s,{get:()=>r[s],enumerable:!(a=Nt(r,s))||a.enumerable});return e};var T=(e,r,t)=>(t=e!=null?wt(Pt(e)):{},Ie(r||!e||!e.__esModule?oe(t,"default",{value:e,enumerable:!0}):t,e)),Rt=e=>Ie(oe({},"__esModule",{value:!0}),e);var dr={};Dt(dr,{HolidayTracker:()=>cr});module.exports=Rt(dr);var ht=require("react"),yt=require("lucide-react"),E=require("lucide-react");var He=require("clsx");var xe="-",St=e=>{let r=Mt(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let l=c.split(xe);return l[0]===""&&l.length!==1&&l.shift(),Ee(l,r)||At(c)},getConflictingClassGroupIds:(c,l)=>{let p=t[c]||[];return l&&a[c]?[...p,...a[c]]:p}}},Ee=(e,r)=>{if(e.length===0)return r.classGroupId;let t=e[0],a=r.nextPart.get(t),s=a?Ee(e.slice(1),a):void 0;if(s)return s;if(r.validators.length===0)return;let n=e.join(xe);return r.validators.find(({validator:c})=>c(n))?.classGroupId},Fe=/^\[(.+)\]$/,At=e=>{if(Fe.test(e)){let r=Fe.exec(e)[1],t=r?.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},Mt=e=>{let{theme:r,prefix:t}=e,a={nextPart:new Map,validators:[]};return Lt(Object.entries(e.classGroups),t).forEach(([n,c])=>{ye(c,a,n,r)}),a},ye=(e,r,t,a)=>{e.forEach(s=>{if(typeof s=="string"){let n=s===""?r:Be(r,s);n.classGroupId=t;return}if(typeof s=="function"){if(Tt(s)){ye(s(a),r,t,a);return}r.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([n,c])=>{ye(c,Be(r,n),t,a)})})},Be=(e,r)=>{let t=e;return r.split(xe).forEach(a=>{t.nextPart.has(a)||t.nextPart.set(a,{nextPart:new Map,validators:[]}),t=t.nextPart.get(a)}),t},Tt=e=>e.isThemeGetter,Lt=(e,r)=>r?e.map(([t,a])=>{let s=a.map(n=>typeof n=="string"?r+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([c,l])=>[r+c,l])):n);return[t,s]}):e,zt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=new Map,a=new Map,s=(n,c)=>{t.set(n,c),r++,r>e&&(r=0,a=t,t=new Map)};return{get(n){let c=t.get(n);if(c!==void 0)return c;if((c=a.get(n))!==void 0)return s(n,c),c},set(n,c){t.has(n)?t.set(n,c):s(n,c)}}},Ge="!",It=e=>{let{separator:r,experimentalParseClassName:t}=e,a=r.length===1,s=r[0],n=r.length,c=l=>{let p=[],x=0,o=0,u;for(let f=0;f<l.length;f++){let C=l[f];if(x===0){if(C===s&&(a||l.slice(f,f+n)===r)){p.push(l.slice(o,f)),o=f+n;continue}if(C==="/"){u=f;continue}}C==="["?x++:C==="]"&&x--}let v=p.length===0?l:l.substring(o),P=v.startsWith(Ge),D=P?v.substring(1):v,i=u&&u>o?u-o:void 0;return{modifiers:p,hasImportantModifier:P,baseClassName:D,maybePostfixModifierPosition:i}};return t?l=>t({className:l,parseClassName:c}):c},Ft=e=>{if(e.length<=1)return e;let r=[],t=[];return e.forEach(a=>{a[0]==="["?(r.push(...t.sort(),a),t=[]):t.push(a)}),r.push(...t.sort()),r},Bt=e=>({cache:zt(e.cacheSize),parseClassName:It(e),...St(e)}),Et=/\s+/,Gt=(e,r)=>{let{parseClassName:t,getClassGroupId:a,getConflictingClassGroupIds:s}=r,n=[],c=e.trim().split(Et),l="";for(let p=c.length-1;p>=0;p-=1){let x=c[p],{modifiers:o,hasImportantModifier:u,baseClassName:v,maybePostfixModifierPosition:P}=t(x),D=!!P,i=a(D?v.substring(0,P):v);if(!i){if(!D){l=x+(l.length>0?" "+l:l);continue}if(i=a(v),!i){l=x+(l.length>0?" "+l:l);continue}D=!1}let f=Ft(o).join(":"),C=u?f+Ge:f,S=C+i;if(n.includes(S))continue;n.push(S);let O=s(i,D);for(let G=0;G<O.length;++G){let ee=O[G];n.push(C+ee)}l=x+(l.length>0?" "+l:l)}return l};function Vt(){let e=0,r,t,a="";for(;e<arguments.length;)(r=arguments[e++])&&(t=Ve(r))&&(a&&(a+=" "),a+=t);return a}var Ve=e=>{if(typeof e=="string")return e;let r,t="";for(let a=0;a<e.length;a++)e[a]&&(r=Ve(e[a]))&&(t&&(t+=" "),t+=r);return t};function _t(e,...r){let t,a,s,n=c;function c(p){let x=r.reduce((o,u)=>u(o),e());return t=Bt(x),a=t.cache.get,s=t.cache.set,n=l,l(p)}function l(p){let x=a(p);if(x)return x;let o=Gt(p,t);return s(p,o),o}return function(){return n(Vt.apply(null,arguments))}}var w=e=>{let r=t=>t[e]||[];return r.isThemeGetter=!0,r},_e=/^\[(?:([a-z-]+):)?(.+)\]$/i,$t=/^\Ye+\/\Ye+$/,jt=new Set(["px","full","screen"]),Ht=/^(\Ye+(\.\Ye+)?)?(xs|sm|md|lg|xl)$/,Ot=/\Ye+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|Ye|i|Ye|min|max))|\Ye(calc|min|max|clamp)\(.+\)|^0$/,Ut=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wt=/^(inset_)?-?((\Ye+)?\.?(\Ye+)[a-z]+|0)_-?((\Ye+)?\.?(\Ye+)[a-z]+|0)/,Yt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,L=e=>j(e)||jt.has(e)||$t.test(e),F=e=>H(e,"length",tr),j=e=>!!e&&!Number.isNaN(Number(e)),he=e=>H(e,"number",j),W=e=>!!e&&Number.isInteger(Number(e)),qt=e=>e.endsWith("%")&&j(e.slice(0,-1)),m=e=>_e.test(e),B=e=>Ht.test(e),Jt=new Set(["length","size","percentage"]),Kt=e=>H(e,Jt,$e),Xt=e=>H(e,"position",$e),Zt=new Set(["image","url"]),Qt=e=>H(e,Zt,or),er=e=>H(e,"",rr),Y=()=>!0,H=(e,r,t)=>{let a=_e.exec(e);return a?a[1]?typeof r=="string"?a[1]===r:r.has(a[1]):t(a[2]):!1},tr=e=>Ot.test(e)&&!Ut.test(e),$e=()=>!1,rr=e=>Wt.test(e),or=e=>Yt.test(e);var ar=()=>{let e=w("colors"),r=w("spacing"),t=w("blur"),a=w("brightness"),s=w("borderColor"),n=w("borderRadius"),c=w("borderSpacing"),l=w("borderWidth"),p=w("contrast"),x=w("grayscale"),o=w("hueRotate"),u=w("invert"),v=w("gap"),P=w("gradientColorStops"),D=w("gradientColorStopPositions"),i=w("inset"),f=w("margin"),C=w("opacity"),S=w("padding"),O=w("saturate"),G=w("scale"),ee=w("sepia"),Re=w("skew"),Se=w("space"),Ae=w("translate"),ge=()=>["auto","contain","none"],fe=()=>["auto","hidden","clip","visible","scroll"],be=()=>["auto",m,r],N=()=>[m,r],Me=()=>["",L,F],te=()=>["auto",j,m],Te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],Le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",m],ze=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[j,m];return{cacheSize:500,separator:":",theme:{colors:[Y],spacing:[L,F],blur:["none","",B,m],brightness:M(),borderColor:[e],borderRadius:["none","","full",B,m],borderSpacing:N(),borderWidth:Me(),contrast:M(),grayscale:U(),hueRotate:M(),invert:U(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[qt,F],inset:be(),margin:be(),opacity:M(),padding:N(),saturate:M(),scale:M(),sepia:U(),skew:M(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",m]}],container:["container"],columns:[{columns:[B]}],"break-after":[{"break-after":ze()}],"break-before":[{"break-before":ze()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Te(),m]}],overflow:[{overflow:fe()}],"overflow-x":[{"overflow-x":fe()}],"overflow-y":[{"overflow-y":fe()}],overscroll:[{overscroll:ge()}],"overscroll-x":[{"overscroll-x":ge()}],"overscroll-y":[{"overscroll-y":ge()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[i]}],"inset-x":[{"inset-x":[i]}],"inset-y":[{"inset-y":[i]}],start:[{start:[i]}],end:[{end:[i]}],top:[{top:[i]}],right:[{right:[i]}],bottom:[{bottom:[i]}],left:[{left:[i]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",W,m]}],basis:[{basis:be()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",m]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",W,m]}],"grid-cols":[{"grid-cols":[Y]}],"col-start-end":[{col:["auto",{span:["full",W,m]},m]}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":[Y]}],"row-start-end":[{row:["auto",{span:[W,m]},m]}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",m]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",m]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...ve()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ve(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ve(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],Ye:[{Ye:[f]}],Ue:[{Ue:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[Se]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Se]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",m,r]}],"min-w":[{"min-w":[m,r,"min","max","fit"]}],"max-w":[{"max-w":[m,r,"none","full","min","max","fit","prose",{screen:[B]},B]}],Ye:[{Ye:[m,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-Ye":[{"min-Ye":[m,r,"min","max","fit","svh","lvh","dvh"]}],"max-Ye":[{"max-Ye":[m,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[m,r,"auto","min","max","fit"]}],"font-size":[{text:["base",B,F]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",he]}],"font-family":[{font:[Y]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",m]}],"line-clamp":[{"line-clamp":["none",j,he]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",L,m]}],"list-image":[{"list-image":["none",m]}],"list-style-type":[{list:["none","disc","decimal",m]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",L,F]}],"underline-offset":[{"underline-offset":["auto",L,m]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",m]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",m]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Te(),Xt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Kt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","Ye","bl","l","tl"]},Qt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[D]}],"gradient-via-pos":[{via:[D]}],"gradient-to-pos":[{to:[D]}],"gradient-from":[{from:[P]}],"gradient-via":[{via:[P]}],"gradient-to":[{to:[P]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-Ye":[{"rounded-Ye":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-Ye":[{"border-Ye":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:re()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-Ye":[{"border-Ye":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[L,m]}],"outline-w":[{outline:[L,F]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[L,F]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",B,er]}],"shadow-color":[{shadow:[Y]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...Le(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Le()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[a]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",B,m]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[o]}],invert:[{invert:[u]}],saturate:[{saturate:[O]}],sepia:[{sepia:[ee]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[o]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[O]}],"backdrop-sepia":[{"backdrop-sepia":[ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",m]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",m]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",m]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-y":[{"scale-y":[G]}],rotate:[{rotate:[W,m]}],"translate-x":[{"translate-x":[Ae]}],"translate-y":[{"translate-y":[Ae]}],"skew-x":[{"skew-x":[Re]}],"skew-y":[{"skew-y":[Re]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",m]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","Ye-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",m]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-Ye":[{"scroll-Ye":N()}],"scroll-Ue":[{"scroll-Ue":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",m]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[L,F,he]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","Ye","Ue","mr","mb","ml"],mx:["mr","ml"],my:["Ue","mb"],size:["w","Ye"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-Ye","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-Ye":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-Ye","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-Ye"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-Ye","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-Ye"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-Ye","scroll-Ue","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-Ue","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var je=_t(ar);function y(...e){return je((0,He.clsx)(e))}var V=class{static toUtcMidnight(r){let t=new Date(r);return t.getUTCHours()===23&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0?new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+1)):new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))}};var Oe=require("@radix-ui/react-slot"),Ue=require("class-variance-authority"),We=T(require("react")),Ye=require("react/jsx-runtime"),ae=(0,Ue.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"Ye-10 px-4 py-2",icon:"Ye-10 w-10",lg:"Ye-11 rounded px-8",sm:"Ye-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),R=We.forwardRef(({asChild:e=!1,className:r,size:t,variant:a,...s},n)=>(0,Ye.jsx)(e?Oe.Slot:"button",{className:y(ae({className:r,size:t,variant:a})),ref:n,...s}));R.displayName="Button";var se=T(require("react")),z=T(require("@radix-ui/react-avatar"));var q=se.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(z.Root,{ref:t,className:y("relative flex Ye-10 w-10 shrink-0 overflow-hidden rounded-full",e),...r}));q.displayName=z.Root.displayName;var J=se.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(z.Image,{ref:t,className:y("aspect-square Ye-full w-full",e),...r}));J.displayName=z.Image.displayName;var K=se.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(z.Fallback,{ref:t,className:y("flex Ye-full w-full items-center justify-center rounded-full bg-muted",e),...r}));K.displayName=z.Fallback.displayName;var qe=[new Date(2025,0,1),new Date(2025,3,18),new Date(2025,3,21),new Date(2025,4,5),new Date(2025,4,26),new Date(2025,7,25),new Date(2025,11,25),new Date(2025,11,26),new Date(2026,0,1),new Date(2026,3,3),new Date(2026,3,6),new Date(2026,4,4),new Date(2026,4,25),new Date(2026,7,31),new Date(2026,11,25),new Date(2026,11,28)];var X=e=>{let r=e.getDay()===0,t=e.getDay()===6,a=qe.some(s=>s.toISOString()===e.toISOString());return r||t||a},Je=(e,r,t=!1)=>{let a=new Date(e),s=new Date(r),n=0;if(t&&!X(a))return .5;for(;a<=s;)X(a)||n++,a.setDate(a.getDate()+1);return n},Ke=(e,r)=>!e||!r?!1:e.toDateString()!==r.toDateString();function Xe(...e){return e.filter(Boolean).join(" ")}function Ze({currentDate:e,setCurrentDate:r,holidays:t,employees:a}){let s=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),n=()=>{r(new Date(e.getFullYear(),e.getMonth()-1,1))},c=()=>{r(new Date(e.getFullYear(),e.getMonth()+1,1))},l=()=>{r(new Date)},p=o=>o.toLocaleString("default",{weekday:"short"}).charAt(0),x=t.map(o=>({...o,startDate:V.toUtcMidnight(o.startDate).toISOString(),endDate:V.toUtcMidnight(o.endDate).toISOString()}));return console.log("employeeIds",a.map(o=>o.id)),(0,Ye.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,Ye.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,Ye.jsxs)("div",{className:"sm:flex-auto",children:[(0,Ye.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Ye.jsx)("p",{className:"Ue-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,Ye.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Ye.jsxs)(R,{onClick:n,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Ye.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,Ye.jsx)(yt.ChevronLeft,{className:"Ye-5 w-5","aria-hidden":"true"})]}),(0,Ye.jsx)(R,{variant:"outline",onClick:l,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Ye.jsxs)(R,{onClick:c,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Ye.jsx)("span",{className:"sr-only",children:"Next month"}),(0,Ye.jsx)(yt.ChevronRight,{className:"Ye-5 w-5","aria-hidden":"true"})]})]})]}),(0,Ye.jsx)("div",{className:"Ue-8 flow-root",children:(0,Ye.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,Ye.jsx)("div",{className:"max-Ye-[60vh] overflow-y-auto",children:(0,Ye.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Ye.jsx)("thead",{className:"sticky top-0 z-20 bg-white",children:(0,Ye.jsxs)("tr",{children:[(0,Ye.jsx)("th",{scope:"col",className:"sticky left-0 top-0 z-30 border-Ye border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(s)].map((o,u)=>{let v=new Date(e.getFullYear(),e.getMonth(),u+1);return(0,Ye.jsxs)("th",{scope:"col",className:`sticky top-0 z-10 border-Ye border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${X(v)?"bg-gray-200":""}`,children:[(0,Ye.jsx)("div",{children:p(v)}),(0,Ye.jsx)("div",{children:u+1})]},u)})]})}),(0,Ye.jsx)("tbody",{children:a.map((o,u)=>(0,Ye.jsxs)("tr",{children:[(0,Ye.jsx)("td",{className:Xe(u!==a.length-1?"border-gray-200":"","sticky left-0 z-10 bg-white border-r pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,Ye.jsxs)("div",{className:"flex items-center",children:[(0,Ye.jsxs)(q,{className:"Ye-11 w-11",children:[(0,Ye.jsx)(J,{src:o.image,alt:o.name}),(0,Ye.jsx)(K,{children:o.name.split(" ").map(v=>v[0]).join("")})]}),(0,Ye.jsx)("div",{className:"ml-4",children:(0,Ye.jsx)("div",{className:"font-medium text-accent",children:o.name})})]})}),[...Array(s)].map((v,P)=>{let D=new Date(e.getFullYear(),e.getMonth(),P+1,1),i=x.find(f=>f.userId===o.id&&new Date(f.startDate)<=D&&new Date(f.endDate)>=D);return(0,Ye.jsx)("td",{className:Xe(u!==a.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",X(D)?"bg-gray-200":"bg-white"),children:(0,Ye.jsx)("div",{className:`Ye-6 w-6 mx-auto rounded-full overflow-hidden ${i?i.status==="approved"?"bg-green-500":i.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:i?`${o.name}: ${i.status} (${i.startDate} - ${i.endDate}) - ${i.leaveType}`:"",children:i&&i.leaveType!=="Full Day"&&(0,Ye.jsx)("div",{className:`Ye-3 w-6 ${i.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${o.id}-${P}`)})]},o.id))})]})})})})]})}function et({currentDate:e,setCurrentDate:r,holidays:t}){let[a,s]=(0,ht.useState)(null);console.log("holidaysIds",t.map(o=>o.id));let n=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,c=Array.from({length:42},(o,u)=>{let v=new Date(e.getFullYear(),e.getMonth(),u-n+1);return{date:v,isCurrentMonth:v.getMonth()===e.getMonth(),isToday:v.toDateString()===new Date().toDateString(),holidays:t.filter(P=>new Date(P.startDate)<=v&&new Date(P.endDate)>=v)}}),l=()=>{r(new Date(e.getFullYear(),e.getMonth()-1,1))},p=()=>{r(new Date(e.getFullYear(),e.getMonth()+1,1))},x=()=>{r(new Date)};return(0,Ye.jsxs)("div",{className:"lg:flex lg:Ye-full lg:flex-col",children:[(0,Ye.jsxs)("header",{className:"flex items-center justify-between border-Ye border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Ye.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Ye.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Ye.jsx)("div",{className:"flex items-center",children:(0,Ye.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Ye.jsxs)(R,{onClick:l,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Ye.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,Ye.jsx)(yt.ChevronLeft,{className:"Ye-5 w-5","aria-hidden":"true"})]}),(0,Ye.jsx)(R,{variant:"outline",onClick:x,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Ye.jsxs)(R,{onClick:p,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Ye.jsx)("span",{className:"sr-only",children:"Next month"}),(0,Ye.jsx)(yt.ChevronRight,{className:"Ye-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Ye.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Ye.jsxs)("div",{className:"grid grid-cols-7 gap-px border-Ye border-gray-300 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["M",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"on"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ke"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["W",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ed"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"hu"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["F",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ri"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"at"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"un"})]})]}),(0,Ye.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Ye.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:c.map(o=>(0,Ye.jsxs)("div",{className:y(o.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Ye.jsx)("time",{dateTime:o.date.toISOString(),className:y("flex Ye-6 w-6 items-center justify-center rounded-full",o.isToday&&"bg-indigo-600 font-semibold text-white"),children:o.date.getDate()}),o.holidays.length>0&&(0,Ye.jsx)("ol",{className:"Ue-2 space-y-1 overflow-visible",children:o.holidays.map(u=>(0,Ye.jsx)("li",{className:"overflow-visible",children:(0,Ye.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${u.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:u.userName})},u.id))})]},o.date.toISOString()))}),(0,Ye.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:c.map(o=>(0,Ye.jsxs)("button",{type:"button",className:y(o.isCurrentMonth?"bg-white":"bg-gray-50",(o.date===a||o.isToday)&&"font-semibold",o.date===a&&"text-white",!o.date&&o.isToday&&"text-indigo-600",o.date!==a&&o.isCurrentMonth&&!o.isToday&&"text-gray-900",o.date!==a&&!o.isCurrentMonth&&!o.isToday&&"text-gray-500","flex Ye-14 flex-col px-3 py-2 hover:bg-gray-100 focus:z-10"),children:[(0,Ye.jsx)("time",{dateTime:o.date.toISOString(),className:y("ml-auto",o.date===a&&o.isToday&&"flex Ye-6 w-6 items-center justify-center rounded-full bg-indigo-600",o.date===a&&!o.isToday&&"flex Ye-6 w-6 items-center justify-center rounded-full bg-gray-900"),children:o.date.getDate()}),(0,Ye.jsxs)("span",{className:"sr-only",children:[o.holidays.length," holidays"]}),o.holidays.length>0&&(0,Ye.jsx)("span",{className:"-mx-0.5 Ue-auto flex flex-wrap-reverse",children:o.holidays.map(u=>(0,Ye.jsx)("span",{className:`mx-0.5 mb-1 Ye-1.5 w-1.5 rounded-full ${u.status==="approved"?"bg-green-500":"bg-gray-500"}`},u.id))})]},o.date.toISOString()))})]})]})]})}var tt=T(require("react")),we=T(require("@radix-ui/react-label"));var sr=(0,Ue.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Z=tt.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(we.Root,{ref:t,className:y(sr(),e),...r}));Z.displayName=we.Root.displayName;var at=require("react-day-picker");function ce({className:e,classNames:r,showOutsideDays:t=!0,...a}){return(0,Ye.jsx)(at.DayPicker,{showOutsideDays:t,weekStartsOn:1,className:y("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:y(ae({variant:"outline"}),"Ye-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full Ue-2",cell:y("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",a.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(ae({variant:"ghost"}),"Ye-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...r},...a})}ce.displayName="Calendar";var nt=T(require("react")),A=T(require("@radix-ui/react-popover"));var Ce=A.Root,Pe=A.Trigger;var de=nt.forwardRef(({className:e,align:r="center",sideOffset:t=4,...a},s)=>(0,Ye.jsx)(A.Portal,{children:(0,Ye.jsx)(A.Content,{ref:s,align:r,sideOffset:t,className:y("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));de.displayName=A.Content.displayName;var ke=require("date-fns"),it=require("next/navigation"),_=require("sonner");var nr=({options:e,value:r,onChange:t,disabled:a=[]})=>(0,Ye.jsx)("div",{className:"flex space-x-2",children:e.map((s,n)=>(0,Ye.jsx)(R,{type:"button",variant:r===s?"default":"outline",onClick:()=>t(s),disabled:a[n],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:s},s))});function lt({remainingDays:e,submitLeaveRequest:r}){let[t,a]=(0,ht.useState)(new Date),[s,n]=(0,ht.useState)(new Date),[c,l]=(0,ht.useState)("Full Day"),[p,x]=(0,ht.useState)(!1),[o,u]=(0,ht.useState)(1),v=(0,it.useRouter)();(0,ht.useEffect)(()=>{let i=Ke(t,s);x(i),i&&l("Full Day")},[t,s]),(0,ht.useEffect)(()=>{if(!t||!s){u(0);return}let i=Je(t,s,c!=="Full Day");u(i)},[t,s,c]);let P=i=>{l(i)};return(0,Ye.jsxs)("div",{className:"max-w-2xl",children:[(0,Ye.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,Ye.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,Ye.jsxs)("form",{onSubmit:async i=>{if(i.preventDefault(),!t||!s){_.toast.error("Please select both start and end dates");return}if(o>e){_.toast.error("You do not have enough leave days remaining");return}let f=new FormData;f.append("startDate",t.toISOString()),f.append("endDate",s.toISOString()),f.append("leaveType",c),f.append("duration",o.toString());let C=await(r||ir)(f);C.success?(_.toast.success(C.message),a(void 0),n(void 0),l("Full Day"),v.refresh()):_.toast.error(`Error: ${C.message}`)},className:"space-y-4",children:[(0,Ye.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Ye.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Ye.jsx)(Z,{htmlFor:"startDate",children:"Start Date"}),(0,Ye.jsxs)(Ce,{children:[(0,Ye.jsx)(Pe,{asChild:!0,children:(0,Ye.jsxs)(R,{variant:"outline",className:y("w-full justify-start text-left font-normal",!t&&"text-muted-foreground"),children:[(0,Ye.jsx)(yt.CalendarIcon,{className:"mr-2 Ye-4 w-4"}),t?(0,ke.format)(t,"PPP"):(0,Ye.jsx)("span",{children:"Pick a date"})]})}),(0,Ye.jsx)(de,{className:"w-auto p-0",align:"start",children:(0,Ye.jsx)(ce,{mode:"single",selected:t,onSelect:i=>{a(i),i&&(!s||i>s)&&n(i)},initialFocus:!0})})]})]}),(0,Ye.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Ye.jsx)(Z,{htmlFor:"endDate",children:"End Date"}),(0,Ye.jsxs)(Ce,{children:[(0,Ye.jsx)(Pe,{asChild:!0,children:(0,Ye.jsxs)(R,{variant:"outline",className:y("w-full justify-start text-left font-normal",!s&&"text-muted-foreground"),children:[(0,Ye.jsx)(yt.CalendarIcon,{className:"mr-2 Ye-4 w-4"}),s?(0,ke.format)(s,"PPP"):(0,Ye.jsx)("span",{children:"Pick a date"})]})}),(0,Ye.jsx)(de,{className:"w-auto p-0",align:"start",children:(0,Ye.jsx)(ce,{mode:"single",selected:s,onSelect:n,disabled:i=>t?i<t:!1,initialFocus:!0})})]})]})]}),(0,Ye.jsxs)("div",{className:"space-y-2",children:[(0,Ye.jsx)(Z,{children:"Leave Type"}),(0,Ye.jsx)(nr,{options:["Full Day","Morning","Afternoon"],value:c,onChange:P,disabled:[!1,p,p]})]}),(0,Ye.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",o]}),(0,Ye.jsx)(R,{disabled:o<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Ye.jsx)(_.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var ir=async e=>{let r={};return e.forEach((t,a)=>{r[a]=t}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};var Q=T(require("@radix-ui/react-checkbox")),dt=T(require("react")),pe=dt.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(Q.Root,{className:y("peer Ye-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:t,...r,children:(0,Ye.jsx)(Q.Indicator,{className:y("flex items-center justify-center text-current"),children:(0,Ye.jsx)(yt.Check,{className:"Ye-4 w-4"})})}));pe.displayName=Q.Root.displayName;var lr=(0,Ue.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function pt({className:e,variant:r,...t}){return(0,Ye.jsx)("div",{className:y(lr({variant:r}),e),...t})}function bt({leaveRequests:e,onApprove:r,onReject:t}){let[a,s]=(0,ht.useState)([]),n=(0,it.useRouter)(),c=()=>{a.length===e.length?s([]):s(e.map(o=>o.id))},l=o=>{s(u=>u.includes(o)?u.filter(v=>v!==o):[...u,o])},p=async()=>{let o=await r(a);o.success?($.toast.success(o.message),n.refresh()):$.toast.error(`Error: ${o.message}`),s([])},x=async()=>{let o=await t(a);o.success?($.toast.success(o.message),n.refresh()):$.toast.error(`Error: ${o.message}`),s([])};return(0,Ye.jsxs)("div",{className:"space-y-4",children:[(0,Ye.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Ye.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Ye.jsxs)("div",{className:"space-x-2",children:[(0,Ye.jsx)(R,{onClick:p,disabled:a.length===0,variant:"default",children:"Approve Selected"}),(0,Ye.jsx)(R,{onClick:x,disabled:a.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Ye.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,Ye.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,Ye.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,Ye.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ye.jsxs)("div",{className:"flex items-center",children:[(0,Ye.jsx)(pe,{id:"select-all",checked:a.length===e.length,onCheckedChange:c,className:"border-accent"}),(0,Ye.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,Ye.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[a.length," of ",e.length," selected"]})]})}),e.map(o=>(0,Ye.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,Ye.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ye.jsxs)("div",{className:"flex items-center",children:[(0,Ye.jsx)(pe,{id:`select-${o.id}`,checked:a.includes(o.id),onCheckedChange:()=>l(o.id),className:"border-accent"}),(0,Ye.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Ye.jsxs)(q,{className:"Ye-10 w-10",children:[(0,Ye.jsx)(J,{src:o.userImage,alt:o.userName}),(0,Ye.jsx)(K,{children:o.userName.split(" ").map(u=>u[0]).join("")})]}),(0,Ye.jsx)("div",{className:"ml-3",children:(0,Ye.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:o.userName})})]})]}),(0,Ye.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ye.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(o.startDate).toLocaleDateString(),o.startDate!==o.endDate&&` - ${new Date(o.endDate).toLocaleDateString()}`,o.leaveType!="Full Day"&&` (${o.leaveType})`,` - ${o.totalDays} day${o.totalDays!==1?"s":""}`]}),(0,Ye.jsx)(pt,{variant:o.status==="approved"?"default":o.status==="rejected"?"destructive":"secondary",children:o.status})]})]})},o.id))]})}),(0,Ye.jsx)($.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}function vt(...e){return e.filter(Boolean).join(" ")}function cr({holidays:e,currentUser:r,currentDate:t,leaveApprovals:a,employees:s,submitLeaveRequest:n,approveLeave:c,rejectLeave:l}){let[p,x]=(0,ht.useState)("Calendar View"),o=(0,it.useRouter)(),u=!1,v=V.toUtcMidnight((0,ke.parseISO)(t)),P=async i=>{let f=(0,ke.format)(i,"dd-MM-yyyy"),C=new URL(window.location.href);return C.searchParams.set("date",f),o.push(C.toString()),{success:!0}};if(u)return(0,Ye.jsx)("div",{className:"flex justify-center items-center Ye-screen",children:(0,Ye.jsx)("div",{className:"animate-spin rounded-full Ye-32 w-32 border-t-2 border-Ye-2 border-gray-900"})});let D=[{name:"Grid View",icon:E.Grid,current:p==="Grid View"},{name:"Calendar View",icon:E.CalendarDays,current:p==="Calendar View"},{name:"Request Leave",icon:E.PlusCircle,current:p==="Request Leave"},{name:"Approve Leave",icon:E.CheckSquare,current:p==="Approve Leave"}];return(0,Ye.jsxs)("div",{className:"container mx-auto p-4 Ye-full",children:[(0,Ye.jsxs)("div",{className:"mb-8",children:[(0,Ye.jsxs)("div",{className:"sm:hidden",children:[(0,Ye.jsx)("select",{value:p,onChange:i=>x(i.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:D.map(i=>(0,Ye.jsx)("option",{children:i.name},i.name))}),(0,Ye.jsx)(yt.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 Ye-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Ye.jsx)("div",{className:"hidden sm:block",children:(0,Ye.jsx)("div",{className:"border-Ye border-gray-200",children:(0,Ye.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:D.map(i=>(0,Ye.jsxs)("a",{onClick:()=>{(i.name!=="Approve Leave"||r.grade==="Manager"||r.grade==="Senior Manager"||r.grade==="Partner")&&x(i.name)},className:vt(i.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",i.name==="Approve Leave"&&r.grade!=="Manager"&&r.grade!=="Senior Manager"&&r.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-Ye-2 py-4 px-1 text-sm font-medium"),"aria-current":i.current?"page":void 0,children:[(0,Ye.jsx)(i.icon,{className:vt(i.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 mr-2 Ye-5 w-5"),"aria-hidden":"true"}),(0,Ye.jsx)("span",{children:i.name})]},i.name))})})})]}),p==="Grid View"&&(0,Ye.jsx)(Ze,{currentDate:v,setCurrentDate:P,holidays:e,employees:s}),p==="Calendar View"&&(0,Ye.jsx)(et,{currentDate:v,setCurrentDate:P,holidays:e}),p==="Request Leave"&&(0,Ye.jsx)(lt,{remainingDays:r.remainingLeaveDays,submitLeaveRequest:i=>n?n(i):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),p==="Approve Leave"&&(0,Ye.jsx)(bt,{leaveRequests:a,onApprove:i=>c?c(i):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:i=>l?l(i):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}0&&(module.exports={HolidayTracker});
4
+ "use strict";"use client";var wt=Object.create;var oe=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Ct=Object.getOwnPropertyNames;var Pt=Object.getPrototypeOf,kt=Object.prototype.hasOwnProperty;var Dt=(e,r)=>{for(var t in r)oe(e,t,{get:r[t],enumerable:!0})},Ie=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Ct(r))!kt.call(e,s)&&s!==t&&oe(e,s,{get:()=>r[s],enumerable:!(a=Nt(r,s))||a.enumerable});return e};var L=(e,r,t)=>(t=e!=null?wt(Pt(e)):{},Ie(r||!e||!e.__esModule?oe(t,"default",{value:e,enumerable:!0}):t,e)),Rt=e=>Ie(oe({},"__esModule",{value:!0}),e);var dr={};Dt(dr,{HolidayTracker:()=>cr});module.exports=Rt(dr);var ht=require("react"),yt=require("lucide-react"),G=require("lucide-react");var He=require("clsx");var xe="-",St=e=>{let r=At(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let l=c.split(xe);return l[0]===""&&l.length!==1&&l.shift(),Ee(l,r)||Mt(c)},getConflictingClassGroupIds:(c,l)=>{let p=t[c]||[];return l&&a[c]?[...p,...a[c]]:p}}},Ee=(e,r)=>{if(e.length===0)return r.classGroupId;let t=e[0],a=r.nextPart.get(t),s=a?Ee(e.slice(1),a):void 0;if(s)return s;if(r.validators.length===0)return;let n=e.join(xe);return r.validators.find(({validator:c})=>c(n))?.classGroupId},Fe=/^\[(.+)\]$/,Mt=e=>{if(Fe.test(e)){let r=Fe.exec(e)[1],t=r?.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},At=e=>{let{theme:r,prefix:t}=e,a={nextPart:new Map,validators:[]};return Lt(Object.entries(e.classGroups),t).forEach(([n,c])=>{ye(c,a,n,r)}),a},ye=(e,r,t,a)=>{e.forEach(s=>{if(typeof s=="string"){let n=s===""?r:Be(r,s);n.classGroupId=t;return}if(typeof s=="function"){if(Tt(s)){ye(s(a),r,t,a);return}r.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([n,c])=>{ye(c,Be(r,n),t,a)})})},Be=(e,r)=>{let t=e;return r.split(xe).forEach(a=>{t.nextPart.has(a)||t.nextPart.set(a,{nextPart:new Map,validators:[]}),t=t.nextPart.get(a)}),t},Tt=e=>e.isThemeGetter,Lt=(e,r)=>r?e.map(([t,a])=>{let s=a.map(n=>typeof n=="string"?r+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([c,l])=>[r+c,l])):n);return[t,s]}):e,zt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=new Map,a=new Map,s=(n,c)=>{t.set(n,c),r++,r>e&&(r=0,a=t,t=new Map)};return{get(n){let c=t.get(n);if(c!==void 0)return c;if((c=a.get(n))!==void 0)return s(n,c),c},set(n,c){t.has(n)?t.set(n,c):s(n,c)}}},Ge="!",It=e=>{let{separator:r,experimentalParseClassName:t}=e,a=r.length===1,s=r[0],n=r.length,c=l=>{let p=[],x=0,o=0,u;for(let f=0;f<l.length;f++){let C=l[f];if(x===0){if(C===s&&(a||l.slice(f,f+n)===r)){p.push(l.slice(o,f)),o=f+n;continue}if(C==="/"){u=f;continue}}C==="["?x++:C==="]"&&x--}let v=p.length===0?l:l.substring(o),D=v.startsWith(Ge),P=D?v.substring(1):v,i=u&&u>o?u-o:void 0;return{modifiers:p,hasImportantModifier:D,baseClassName:P,maybePostfixModifierPosition:i}};return t?l=>t({className:l,parseClassName:c}):c},Ft=e=>{if(e.length<=1)return e;let r=[],t=[];return e.forEach(a=>{a[0]==="["?(r.push(...t.sort(),a),t=[]):t.push(a)}),r.push(...t.sort()),r},Bt=e=>({cache:zt(e.cacheSize),parseClassName:It(e),...St(e)}),Et=/\s+/,Gt=(e,r)=>{let{parseClassName:t,getClassGroupId:a,getConflictingClassGroupIds:s}=r,n=[],c=e.trim().split(Et),l="";for(let p=c.length-1;p>=0;p-=1){let x=c[p],{modifiers:o,hasImportantModifier:u,baseClassName:v,maybePostfixModifierPosition:D}=t(x),P=!!D,i=a(P?v.substring(0,D):v);if(!i){if(!P){l=x+(l.length>0?" "+l:l);continue}if(i=a(v),!i){l=x+(l.length>0?" "+l:l);continue}P=!1}let f=Ft(o).join(":"),C=u?f+Ge:f,S=C+i;if(n.includes(S))continue;n.push(S);let O=s(i,P);for(let V=0;V<O.length;++V){let ee=O[V];n.push(C+ee)}l=x+(l.length>0?" "+l:l)}return l};function Vt(){let e=0,r,t,a="";for(;e<arguments.length;)(r=arguments[e++])&&(t=Ve(r))&&(a&&(a+=" "),a+=t);return a}var Ve=e=>{if(typeof e=="string")return e;let r,t="";for(let a=0;a<e.length;a++)e[a]&&(r=Ve(e[a]))&&(t&&(t+=" "),t+=r);return t};function _t(e,...r){let t,a,s,n=c;function c(p){let x=r.reduce((o,u)=>u(o),e());return t=Bt(x),a=t.cache.get,s=t.cache.set,n=l,l(p)}function l(p){let x=a(p);if(x)return x;let o=Gt(p,t);return s(p,o),o}return function(){return n(Vt.apply(null,arguments))}}var w=e=>{let r=t=>t[e]||[];return r.isThemeGetter=!0,r},_e=/^\[(?:([a-z-]+):)?(.+)\]$/i,$t=/^\Ye+\/\Ye+$/,jt=new Set(["px","full","screen"]),Ht=/^(\Ye+(\.\Ye+)?)?(xs|sm|md|lg|xl)$/,Ot=/\Ye+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|Ye|i|Ye|min|max))|\Ye(calc|min|max|clamp)\(.+\)|^0$/,Ut=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wt=/^(inset_)?-?((\Ye+)?\.?(\Ye+)[a-z]+|0)_-?((\Ye+)?\.?(\Ye+)[a-z]+|0)/,Yt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,z=e=>j(e)||jt.has(e)||$t.test(e),B=e=>H(e,"length",tr),j=e=>!!e&&!Number.isNaN(Number(e)),he=e=>H(e,"number",j),W=e=>!!e&&Number.isInteger(Number(e)),qt=e=>e.endsWith("%")&&j(e.slice(0,-1)),m=e=>_e.test(e),E=e=>Ht.test(e),Jt=new Set(["length","size","percentage"]),Kt=e=>H(e,Jt,$e),Xt=e=>H(e,"position",$e),Zt=new Set(["image","url"]),Qt=e=>H(e,Zt,or),er=e=>H(e,"",rr),Y=()=>!0,H=(e,r,t)=>{let a=_e.exec(e);return a?a[1]?typeof r=="string"?a[1]===r:r.has(a[1]):t(a[2]):!1},tr=e=>Ot.test(e)&&!Ut.test(e),$e=()=>!1,rr=e=>Wt.test(e),or=e=>Yt.test(e);var ar=()=>{let e=w("colors"),r=w("spacing"),t=w("blur"),a=w("brightness"),s=w("borderColor"),n=w("borderRadius"),c=w("borderSpacing"),l=w("borderWidth"),p=w("contrast"),x=w("grayscale"),o=w("hueRotate"),u=w("invert"),v=w("gap"),D=w("gradientColorStops"),P=w("gradientColorStopPositions"),i=w("inset"),f=w("margin"),C=w("opacity"),S=w("padding"),O=w("saturate"),V=w("scale"),ee=w("sepia"),Re=w("skew"),Se=w("space"),Me=w("translate"),ge=()=>["auto","contain","none"],fe=()=>["auto","hidden","clip","visible","scroll"],be=()=>["auto",m,r],N=()=>[m,r],Ae=()=>["",z,B],te=()=>["auto",j,m],Te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],Le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",m],ze=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>[j,m];return{cacheSize:500,separator:":",theme:{colors:[Y],spacing:[z,B],blur:["none","",E,m],brightness:T(),borderColor:[e],borderRadius:["none","","full",E,m],borderSpacing:N(),borderWidth:Ae(),contrast:T(),grayscale:U(),hueRotate:T(),invert:U(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[qt,B],inset:be(),margin:be(),opacity:T(),padding:N(),saturate:T(),scale:T(),sepia:U(),skew:T(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",m]}],container:["container"],columns:[{columns:[E]}],"break-after":[{"break-after":ze()}],"break-before":[{"break-before":ze()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Te(),m]}],overflow:[{overflow:fe()}],"overflow-x":[{"overflow-x":fe()}],"overflow-y":[{"overflow-y":fe()}],overscroll:[{overscroll:ge()}],"overscroll-x":[{"overscroll-x":ge()}],"overscroll-y":[{"overscroll-y":ge()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[i]}],"inset-x":[{"inset-x":[i]}],"inset-y":[{"inset-y":[i]}],start:[{start:[i]}],end:[{end:[i]}],top:[{top:[i]}],right:[{right:[i]}],bottom:[{bottom:[i]}],left:[{left:[i]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",W,m]}],basis:[{basis:be()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",m]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",W,m]}],"grid-cols":[{"grid-cols":[Y]}],"col-start-end":[{col:["auto",{span:["full",W,m]},m]}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":[Y]}],"row-start-end":[{row:["auto",{span:[W,m]},m]}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",m]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",m]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...ve()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ve(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ve(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],Ye:[{Ye:[f]}],Ue:[{Ue:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[Se]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Se]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",m,r]}],"min-w":[{"min-w":[m,r,"min","max","fit"]}],"max-w":[{"max-w":[m,r,"none","full","min","max","fit","prose",{screen:[E]},E]}],Ye:[{Ye:[m,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-Ye":[{"min-Ye":[m,r,"min","max","fit","svh","lvh","dvh"]}],"max-Ye":[{"max-Ye":[m,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[m,r,"auto","min","max","fit"]}],"font-size":[{text:["base",E,B]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",he]}],"font-family":[{font:[Y]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",m]}],"line-clamp":[{"line-clamp":["none",j,he]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",z,m]}],"list-image":[{"list-image":["none",m]}],"list-style-type":[{list:["none","disc","decimal",m]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",z,B]}],"underline-offset":[{"underline-offset":["auto",z,m]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",m]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",m]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Te(),Xt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Kt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","Ye","bl","l","tl"]},Qt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[P]}],"gradient-via-pos":[{via:[P]}],"gradient-to-pos":[{to:[P]}],"gradient-from":[{from:[D]}],"gradient-via":[{via:[D]}],"gradient-to":[{to:[D]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-Ye":[{"rounded-Ye":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-Ye":[{"border-Ye":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:re()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-Ye":[{"border-Ye":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[z,m]}],"outline-w":[{outline:[z,B]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[z,B]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",E,er]}],"shadow-color":[{shadow:[Y]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...Le(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Le()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[a]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",E,m]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[o]}],invert:[{invert:[u]}],saturate:[{saturate:[O]}],sepia:[{sepia:[ee]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[o]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[O]}],"backdrop-sepia":[{"backdrop-sepia":[ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",m]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",m]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",m]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[V]}],"scale-x":[{"scale-x":[V]}],"scale-y":[{"scale-y":[V]}],rotate:[{rotate:[W,m]}],"translate-x":[{"translate-x":[Me]}],"translate-y":[{"translate-y":[Me]}],"skew-x":[{"skew-x":[Re]}],"skew-y":[{"skew-y":[Re]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",m]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","Ye-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",m]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-Ye":[{"scroll-Ye":N()}],"scroll-Ue":[{"scroll-Ue":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",m]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[z,B,he]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","Ye","Ue","mr","mb","ml"],mx:["mr","ml"],my:["Ue","mb"],size:["w","Ye"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-Ye","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-Ye":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-Ye","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-Ye"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-Ye","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-Ye"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-Ye","scroll-Ue","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-Ue","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var je=_t(ar);function y(...e){return je((0,He.clsx)(e))}var M=class{static toUtcMidnight(r){let t=new Date(r);return t.getUTCHours()===23&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0?new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+1)):new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))}};var Oe=require("@radix-ui/react-slot"),Ue=require("class-variance-authority"),We=L(require("react")),Ye=require("react/jsx-runtime"),ae=(0,Ue.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"Ye-10 px-4 py-2",icon:"Ye-10 w-10",lg:"Ye-11 rounded px-8",sm:"Ye-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),R=We.forwardRef(({asChild:e=!1,className:r,size:t,variant:a,...s},n)=>(0,Ye.jsx)(e?Oe.Slot:"button",{className:y(ae({className:r,size:t,variant:a})),ref:n,...s}));R.displayName="Button";var se=L(require("react")),I=L(require("@radix-ui/react-avatar"));var q=se.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(I.Root,{ref:t,className:y("relative flex Ye-10 w-10 shrink-0 overflow-hidden rounded-full",e),...r}));q.displayName=I.Root.displayName;var J=se.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(I.Image,{ref:t,className:y("aspect-square Ye-full w-full",e),...r}));J.displayName=I.Image.displayName;var K=se.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(I.Fallback,{ref:t,className:y("flex Ye-full w-full items-center justify-center rounded-full bg-muted",e),...r}));K.displayName=I.Fallback.displayName;var qe=[new Date(2025,0,1),new Date(2025,3,18),new Date(2025,3,21),new Date(2025,4,5),new Date(2025,4,26),new Date(2025,7,25),new Date(2025,11,25),new Date(2025,11,26),new Date(2026,0,1),new Date(2026,3,3),new Date(2026,3,6),new Date(2026,4,4),new Date(2026,4,25),new Date(2026,7,31),new Date(2026,11,25),new Date(2026,11,28)];var X=e=>{let r=e.getDay()===0,t=e.getDay()===6,a=qe.some(s=>s.toISOString()===e.toISOString());return r||t||a},Je=(e,r,t=!1)=>{let a=new Date(e),s=new Date(r),n=0;if(t&&!X(a))return .5;for(;a<=s;)X(a)||n++,a.setDate(a.getDate()+1);return n},Ke=(e,r)=>!e||!r?!1:e.toDateString()!==r.toDateString();function Xe(...e){return e.filter(Boolean).join(" ")}function Ze({currentDate:e,setCurrentDate:r,holidays:t,employees:a}){let s=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),n=()=>{r(new Date(e.getFullYear(),e.getMonth()-1,1))},c=()=>{r(new Date(e.getFullYear(),e.getMonth()+1,1))},l=()=>{r(new Date)},p=o=>o.toLocaleString("default",{weekday:"short"}).charAt(0),x=t.map(o=>({...o,startDate:M.toUtcMidnight(o.startDate).toISOString(),endDate:M.toUtcMidnight(o.endDate).toISOString()}));return console.log("employeeIds",a.map(o=>o.id)),(0,Ye.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,Ye.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,Ye.jsxs)("div",{className:"sm:flex-auto",children:[(0,Ye.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Ye.jsx)("p",{className:"Ue-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,Ye.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Ye.jsxs)(R,{onClick:n,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Ye.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,Ye.jsx)(yt.ChevronLeft,{className:"Ye-5 w-5","aria-hidden":"true"})]}),(0,Ye.jsx)(R,{variant:"outline",onClick:l,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Ye.jsxs)(R,{onClick:c,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Ye.jsx)("span",{className:"sr-only",children:"Next month"}),(0,Ye.jsx)(yt.ChevronRight,{className:"Ye-5 w-5","aria-hidden":"true"})]})]})]}),(0,Ye.jsx)("div",{className:"Ue-8 flow-root",children:(0,Ye.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,Ye.jsx)("div",{className:"max-Ye-[60vh] overflow-y-auto",children:(0,Ye.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Ye.jsx)("thead",{className:"sticky top-0 z-20 bg-white",children:(0,Ye.jsxs)("tr",{children:[(0,Ye.jsx)("th",{scope:"col",className:"sticky left-0 top-0 z-30 border-Ye border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(s)].map((o,u)=>{let v=new Date(e.getFullYear(),e.getMonth(),u+1);return(0,Ye.jsxs)("th",{scope:"col",className:`sticky top-0 z-10 border-Ye border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${X(v)?"bg-gray-200":""}`,children:[(0,Ye.jsx)("div",{children:p(v)}),(0,Ye.jsx)("div",{children:u+1})]},u)})]})}),(0,Ye.jsx)("tbody",{children:a.map((o,u)=>(0,Ye.jsxs)("tr",{children:[(0,Ye.jsx)("td",{className:Xe(u!==a.length-1?"border-gray-200":"","sticky left-0 z-10 bg-white border-r pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,Ye.jsxs)("div",{className:"flex items-center",children:[(0,Ye.jsxs)(q,{className:"Ye-11 w-11",children:[(0,Ye.jsx)(J,{src:o.image,alt:o.name}),(0,Ye.jsx)(K,{children:o.name.split(" ").map(v=>v[0]).join("")})]}),(0,Ye.jsx)("div",{className:"ml-4",children:(0,Ye.jsx)("div",{className:"font-medium text-accent",children:o.name})})]})}),[...Array(s)].map((v,D)=>{let P=new Date(e.getFullYear(),e.getMonth(),D+1,1),i=x.find(f=>f.userId===o.id&&new Date(f.startDate)<=P&&new Date(f.endDate)>=P);return(0,Ye.jsx)("td",{className:Xe(u!==a.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",X(P)?"bg-gray-200":"bg-white"),children:(0,Ye.jsx)("div",{className:`Ye-6 w-6 mx-auto rounded-full overflow-hidden ${i?i.status==="approved"?"bg-green-500":i.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:i?`${o.name}: ${i.status} (${i.startDate} - ${i.endDate}) - ${i.leaveType}`:"",children:i&&i.leaveType!=="Full Day"&&(0,Ye.jsx)("div",{className:`Ye-3 w-6 ${i.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${o.id}-${D}`)})]},o.id))})]})})})})]})}function et({currentDate:e,setCurrentDate:r,holidays:t}){let[a,s]=(0,ht.useState)(null);console.log("holidaysIds",t.map(o=>o.id));let n=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,c=Array.from({length:42},(o,u)=>{let v=new Date(e.getFullYear(),e.getMonth(),u-n+1,e.getHours()),D=t.filter(P=>M.toUtcMidnight(new Date(P.startDate))<=v&&M.toUtcMidnight(new Date(P.endDate))>=v);return{date:v,isCurrentMonth:v.getMonth()===e.getMonth(),isToday:v.toDateString()===new Date().toDateString(),holidays:D}}),l=()=>{r(new Date(e.getFullYear(),e.getMonth()-1,1))},p=()=>{r(new Date(e.getFullYear(),e.getMonth()+1,1))},x=()=>{r(new Date)};return(0,Ye.jsxs)("div",{className:"lg:flex lg:Ye-full lg:flex-col",children:[(0,Ye.jsxs)("header",{className:"flex items-center justify-between border-Ye border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Ye.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Ye.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Ye.jsx)("div",{className:"flex items-center",children:(0,Ye.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Ye.jsxs)(R,{onClick:l,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Ye.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,Ye.jsx)(yt.ChevronLeft,{className:"Ye-5 w-5","aria-hidden":"true"})]}),(0,Ye.jsx)(R,{variant:"outline",onClick:x,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Ye.jsxs)(R,{onClick:p,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Ye.jsx)("span",{className:"sr-only",children:"Next month"}),(0,Ye.jsx)(yt.ChevronRight,{className:"Ye-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Ye.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Ye.jsxs)("div",{className:"grid grid-cols-7 gap-px border-Ye border-gray-300 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["M",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"on"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ke"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["W",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ed"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"hu"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["ht",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ri"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"at"})]}),(0,Ye.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Ye.jsx)("span",{className:"sr-only sm:not-sr-only",children:"un"})]})]}),(0,Ye.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Ye.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:c.map(o=>(0,Ye.jsxs)("div",{className:y(o.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Ye.jsx)("time",{dateTime:o.date.toISOString(),className:y("flex Ye-6 w-6 items-center justify-center rounded-full",o.isToday&&"bg-indigo-600 font-semibold text-white"),children:o.date.getDate()}),o.holidays.length>0&&(0,Ye.jsx)("ol",{className:"Ue-2 space-y-1 overflow-visible",children:o.holidays.map(u=>(0,Ye.jsx)("li",{className:"overflow-visible",children:(0,Ye.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${u.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:u.userName})},u.id))})]},o.date.toISOString()))}),(0,Ye.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:c.map(o=>(0,Ye.jsxs)("button",{type:"button",className:y(o.isCurrentMonth?"bg-white":"bg-gray-50",(o.date===a||o.isToday)&&"font-semibold",o.date===a&&"text-white",!o.date&&o.isToday&&"text-indigo-600",o.date!==a&&o.isCurrentMonth&&!o.isToday&&"text-gray-900",o.date!==a&&!o.isCurrentMonth&&!o.isToday&&"text-gray-500","flex Ye-14 flex-col px-3 py-2 hover:bg-gray-100 focus:z-10"),children:[(0,Ye.jsx)("time",{dateTime:o.date.toISOString(),className:y("ml-auto",o.date===a&&o.isToday&&"flex Ye-6 w-6 items-center justify-center rounded-full bg-indigo-600",o.date===a&&!o.isToday&&"flex Ye-6 w-6 items-center justify-center rounded-full bg-gray-900"),children:o.date.getDate()}),(0,Ye.jsxs)("span",{className:"sr-only",children:[o.holidays.length," holidays"]}),o.holidays.length>0&&(0,Ye.jsx)("span",{className:"-mx-0.5 Ue-auto flex flex-wrap-reverse",children:o.holidays.map(u=>(0,Ye.jsx)("span",{className:`mx-0.5 mb-1 Ye-1.5 w-1.5 rounded-full ${u.status==="approved"?"bg-green-500":"bg-gray-500"}`},u.id))})]},o.date.toISOString()))})]})]})]})}var tt=L(require("react")),we=L(require("@radix-ui/react-label"));var sr=(0,Ue.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Z=tt.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(we.Root,{ref:t,className:y(sr(),e),...r}));Z.displayName=we.Root.displayName;var at=require("react-day-picker");function ce({className:e,classNames:r,showOutsideDays:t=!0,...a}){return(0,Ye.jsx)(at.DayPicker,{showOutsideDays:t,weekStartsOn:1,className:y("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:y(ae({variant:"outline"}),"Ye-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full Ue-2",cell:y("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",a.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(ae({variant:"ghost"}),"Ye-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...r},...a})}ce.displayName="Calendar";var nt=L(require("react")),A=L(require("@radix-ui/react-popover"));var Ce=A.Root,Pe=A.Trigger;var de=nt.forwardRef(({className:e,align:r="center",sideOffset:t=4,...a},s)=>(0,Ye.jsx)(A.Portal,{children:(0,Ye.jsx)(A.Content,{ref:s,align:r,sideOffset:t,className:y("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));de.displayName=A.Content.displayName;var ke=require("date-fns"),it=require("next/navigation"),_=require("sonner");var nr=({options:e,value:r,onChange:t,disabled:a=[]})=>(0,Ye.jsx)("div",{className:"flex space-x-2",children:e.map((s,n)=>(0,Ye.jsx)(R,{type:"button",variant:r===s?"default":"outline",onClick:()=>t(s),disabled:a[n],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:s},s))});function lt({remainingDays:e,submitLeaveRequest:r}){let[t,a]=(0,ht.useState)(new Date),[s,n]=(0,ht.useState)(new Date),[c,l]=(0,ht.useState)("Full Day"),[p,x]=(0,ht.useState)(!1),[o,u]=(0,ht.useState)(1),v=(0,it.useRouter)();(0,ht.useEffect)(()=>{let i=Ke(t,s);x(i),i&&l("Full Day")},[t,s]),(0,ht.useEffect)(()=>{if(!t||!s){u(0);return}let i=Je(t,s,c!=="Full Day");u(i)},[t,s,c]);let D=i=>{l(i)};return(0,Ye.jsxs)("div",{className:"max-w-2xl",children:[(0,Ye.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Request Leave"}),(0,Ye.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,Ye.jsxs)("form",{onSubmit:async i=>{if(i.preventDefault(),!t||!s){_.toast.error("Please select both start and end dates");return}if(o>e){_.toast.error("You do not have enough leave days remaining");return}let f=new FormData;f.append("startDate",t.toISOString()),f.append("endDate",s.toISOString()),f.append("leaveType",c),f.append("duration",o.toString());let C=await(r||ir)(f);C.success?(_.toast.success(C.message),a(void 0),n(void 0),l("Full Day"),v.refresh()):_.toast.error(`Error: ${C.message}`)},className:"space-y-4",children:[(0,Ye.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Ye.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Ye.jsx)(Z,{htmlFor:"startDate",children:"Start Date"}),(0,Ye.jsxs)(Ce,{children:[(0,Ye.jsx)(Pe,{asChild:!0,children:(0,Ye.jsxs)(R,{variant:"outline",className:y("w-full justify-start text-left font-normal",!t&&"text-muted-foreground"),children:[(0,Ye.jsx)(yt.CalendarIcon,{className:"mr-2 Ye-4 w-4"}),t?(0,ke.format)(t,"PPP"):(0,Ye.jsx)("span",{children:"Pick a date"})]})}),(0,Ye.jsx)(de,{className:"w-auto p-0",align:"start",children:(0,Ye.jsx)(ce,{mode:"single",selected:t,onSelect:i=>{a(i),i&&(!s||i>s)&&n(i)},initialFocus:!0})})]})]}),(0,Ye.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Ye.jsx)(Z,{htmlFor:"endDate",children:"End Date"}),(0,Ye.jsxs)(Ce,{children:[(0,Ye.jsx)(Pe,{asChild:!0,children:(0,Ye.jsxs)(R,{variant:"outline",className:y("w-full justify-start text-left font-normal",!s&&"text-muted-foreground"),children:[(0,Ye.jsx)(yt.CalendarIcon,{className:"mr-2 Ye-4 w-4"}),s?(0,ke.format)(s,"PPP"):(0,Ye.jsx)("span",{children:"Pick a date"})]})}),(0,Ye.jsx)(de,{className:"w-auto p-0",align:"start",children:(0,Ye.jsx)(ce,{mode:"single",selected:s,onSelect:n,disabled:i=>t?i<t:!1,initialFocus:!0})})]})]})]}),(0,Ye.jsxs)("div",{className:"space-y-2",children:[(0,Ye.jsx)(Z,{children:"Leave Type"}),(0,Ye.jsx)(nr,{options:["Full Day","Morning","Afternoon"],value:c,onChange:D,disabled:[!1,p,p]})]}),(0,Ye.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",o]}),(0,Ye.jsx)(R,{disabled:o<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Ye.jsx)(_.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var ir=async e=>{let r={};return e.forEach((t,a)=>{r[a]=t}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};var Q=L(require("@radix-ui/react-checkbox")),dt=L(require("react")),pe=dt.forwardRef(({className:e,...r},t)=>(0,Ye.jsx)(Q.Root,{className:y("peer Ye-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:t,...r,children:(0,Ye.jsx)(Q.Indicator,{className:y("flex items-center justify-center text-current"),children:(0,Ye.jsx)(yt.Check,{className:"Ye-4 w-4"})})}));pe.displayName=Q.Root.displayName;var lr=(0,Ue.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function pt({className:e,variant:r,...t}){return(0,Ye.jsx)("div",{className:y(lr({variant:r}),e),...t})}function bt({leaveRequests:e,onApprove:r,onReject:t}){let[a,s]=(0,ht.useState)([]),n=(0,it.useRouter)(),c=()=>{a.length===e.length?s([]):s(e.map(o=>o.id))},l=o=>{s(u=>u.includes(o)?u.filter(v=>v!==o):[...u,o])},p=async()=>{let o=await r(a);o.success?($.toast.success(o.message),n.refresh()):$.toast.error(`Error: ${o.message}`),s([])},x=async()=>{let o=await t(a);o.success?($.toast.success(o.message),n.refresh()):$.toast.error(`Error: ${o.message}`),s([])};return(0,Ye.jsxs)("div",{className:"space-y-4",children:[(0,Ye.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Ye.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Ye.jsxs)("div",{className:"space-x-2",children:[(0,Ye.jsx)(R,{onClick:p,disabled:a.length===0,variant:"default",children:"Approve Selected"}),(0,Ye.jsx)(R,{onClick:x,disabled:a.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Ye.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,Ye.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,Ye.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,Ye.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ye.jsxs)("div",{className:"flex items-center",children:[(0,Ye.jsx)(pe,{id:"select-all",checked:a.length===e.length,onCheckedChange:c,className:"border-accent"}),(0,Ye.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,Ye.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[a.length," of ",e.length," selected"]})]})}),e.map(o=>(0,Ye.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,Ye.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ye.jsxs)("div",{className:"flex items-center",children:[(0,Ye.jsx)(pe,{id:`select-${o.id}`,checked:a.includes(o.id),onCheckedChange:()=>l(o.id),className:"border-accent"}),(0,Ye.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Ye.jsxs)(q,{className:"Ye-10 w-10",children:[(0,Ye.jsx)(J,{src:o.userImage,alt:o.userName}),(0,Ye.jsx)(K,{children:o.userName.split(" ").map(u=>u[0]).join("")})]}),(0,Ye.jsx)("div",{className:"ml-3",children:(0,Ye.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:o.userName})})]})]}),(0,Ye.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ye.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(o.startDate).toLocaleDateString(),o.startDate!==o.endDate&&` - ${new Date(o.endDate).toLocaleDateString()}`,o.leaveType!="Full Day"&&` (${o.leaveType})`,` - ${o.totalDays} day${o.totalDays!==1?"s":""}`]}),(0,Ye.jsx)(pt,{variant:o.status==="approved"?"default":o.status==="rejected"?"destructive":"secondary",children:o.status})]})]})},o.id))]})}),(0,Ye.jsx)($.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}function vt(...e){return e.filter(Boolean).join(" ")}function cr({holidays:e,currentUser:r,currentDate:t,leaveApprovals:a,employees:s,submitLeaveRequest:n,approveLeave:c,rejectLeave:l}){let[p,x]=(0,ht.useState)("Calendar View"),o=(0,it.useRouter)(),u=!1,v=M.toUtcMidnight((0,ke.parseISO)(t)),D=async i=>{let f=(0,ke.format)(i,"dd-MM-yyyy"),C=new URL(window.location.href);return C.searchParams.set("date",f),o.push(C.toString()),{success:!0}};if(u)return(0,Ye.jsx)("div",{className:"flex justify-center items-center Ye-screen",children:(0,Ye.jsx)("div",{className:"animate-spin rounded-full Ye-32 w-32 border-t-2 border-Ye-2 border-gray-900"})});let P=[{name:"Grid View",icon:G.Grid,current:p==="Grid View"},{name:"Calendar View",icon:G.CalendarDays,current:p==="Calendar View"},{name:"Request Leave",icon:G.PlusCircle,current:p==="Request Leave"},{name:"Approve Leave",icon:G.CheckSquare,current:p==="Approve Leave"}];return(0,Ye.jsxs)("div",{className:"container mx-auto p-4 Ye-full",children:[(0,Ye.jsxs)("div",{className:"mb-8",children:[(0,Ye.jsxs)("div",{className:"sm:hidden",children:[(0,Ye.jsx)("select",{value:p,onChange:i=>x(i.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:P.map(i=>(0,Ye.jsx)("option",{children:i.name},i.name))}),(0,Ye.jsx)(yt.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 Ye-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Ye.jsx)("div",{className:"hidden sm:block",children:(0,Ye.jsx)("div",{className:"border-Ye border-gray-200",children:(0,Ye.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:P.map(i=>(0,Ye.jsxs)("a",{onClick:()=>{(i.name!=="Approve Leave"||r.grade==="Manager"||r.grade==="Senior Manager"||r.grade==="Partner")&&x(i.name)},className:vt(i.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",i.name==="Approve Leave"&&r.grade!=="Manager"&&r.grade!=="Senior Manager"&&r.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-Ye-2 py-4 px-1 text-sm font-medium"),"aria-current":i.current?"page":void 0,children:[(0,Ye.jsx)(i.icon,{className:vt(i.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 mr-2 Ye-5 w-5"),"aria-hidden":"true"}),(0,Ye.jsx)("span",{children:i.name})]},i.name))})})})]}),p==="Grid View"&&(0,Ye.jsx)(Ze,{currentDate:v,setCurrentDate:D,holidays:e,employees:s}),p==="Calendar View"&&(0,Ye.jsx)(et,{currentDate:v,setCurrentDate:D,holidays:e}),p==="Request Leave"&&(0,Ye.jsx)(lt,{remainingDays:r.remainingLeaveDays,submitLeaveRequest:i=>n?n(i):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),p==="Approve Leave"&&(0,Ye.jsx)(bt,{leaveRequests:a,onApprove:i=>c?c(i):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:i=>l?l(i):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}0&&(module.exports={HolidayTracker});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a}from"../../chunk-OYE7B4PN.mjs";import"../../chunk-TZKQXT7Y.mjs";import"../../chunk-RGZHZIKQ.mjs";import"../../chunk-K3YZPHOE.mjs";import"../../chunk-MAAKU7PN.mjs";import"../../chunk-PC6TVU7J.mjs";import"../../chunk-LYPWYO4W.mjs";import"../../chunk-JHNVX4UB.mjs";import"../../chunk-7BXIU4ZM.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as HolidayTracker};
2
+ "use strict";import{a}from"../../chunk-R5P4ZICA.mjs";import"../../chunk-TZKQXT7Y.mjs";import"../../chunk-VZBIMHCR.mjs";import"../../chunk-K3YZPHOE.mjs";import"../../chunk-MAAKU7PN.mjs";import"../../chunk-PC6TVU7J.mjs";import"../../chunk-LYPWYO4W.mjs";import"../../chunk-JHNVX4UB.mjs";import"../../chunk-7BXIU4ZM.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as HolidayTracker};