componentables 0.1.21 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),w=require("react"),Ie=require("react-loader-spinner"),Te=require("react-dom"),X=require("react-toastify");function fe(e){var r,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(t=fe(e[r]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function Oe(){for(var e,r,t=0,o="",a=arguments.length;t<a;t++)(e=arguments[t])&&(r=fe(e))&&(o&&(o+=" "),o+=r);return o}const ie="-",_e=e=>{const r=Fe(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{const n=i.split(ie);return n[0]===""&&n.length!==1&&n.shift(),he(n,r)||$e(i)},getConflictingClassGroupIds:(i,n)=>{const c=t[i]||[];return n&&o[i]?[...c,...o[i]]:c}}},he=(e,r)=>{if(e.length===0)return r.classGroupId;const t=e[0],o=r.nextPart.get(t),a=o?he(e.slice(1),o):void 0;if(a)return a;if(r.validators.length===0)return;const l=e.join(ie);return r.validators.find(({validator:i})=>i(l))?.classGroupId},ce=/^\[(.+)\]$/,$e=e=>{if(ce.test(e)){const r=ce.exec(e)[1],t=r?.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},Fe=e=>{const{theme:r,prefix:t}=e,o={nextPart:new Map,validators:[]};return Ve(Object.entries(e.classGroups),t).forEach(([l,i])=>{ae(i,o,l,r)}),o},ae=(e,r,t,o)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?r:de(r,a);l.classGroupId=t;return}if(typeof a=="function"){if(Re(a)){ae(a(o),r,t,o);return}r.validators.push({validator:a,classGroupId:t});return}Object.entries(a).forEach(([l,i])=>{ae(i,de(r,l),t,o)})})},de=(e,r)=>{let t=e;return r.split(ie).forEach(o=>{t.nextPart.has(o)||t.nextPart.set(o,{nextPart:new Map,validators:[]}),t=t.nextPart.get(o)}),t},Re=e=>e.isThemeGetter,Ve=(e,r)=>r?e.map(([t,o])=>{const a=o.map(l=>typeof l=="string"?r+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([i,n])=>[r+i,n])):l);return[t,a]}):e,Be=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=new Map,o=new Map;const a=(l,i)=>{t.set(l,i),r++,r>e&&(r=0,o=t,t=new Map)};return{get(l){let i=t.get(l);if(i!==void 0)return i;if((i=o.get(l))!==void 0)return a(l,i),i},set(l,i){t.has(l)?t.set(l,i):a(l,i)}}},xe="!",Ge=e=>{const{separator:r,experimentalParseClassName:t}=e,o=r.length===1,a=r[0],l=r.length,i=n=>{const c=[];let u=0,b=0,k;for(let p=0;p<n.length;p++){let v=n[p];if(u===0){if(v===a&&(o||n.slice(p,p+l)===r)){c.push(n.slice(b,p)),b=p+l;continue}if(v==="/"){k=p;continue}}v==="["?u++:v==="]"&&u--}const h=c.length===0?n:n.substring(b),y=h.startsWith(xe),m=y?h.substring(1):h,x=k&&k>b?k-b:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:m,maybePostfixModifierPosition:x}};return t?n=>t({className:n,parseClassName:i}):i},We=e=>{if(e.length<=1)return e;const r=[];let t=[];return e.forEach(o=>{o[0]==="["?(r.push(...t.sort(),o),t=[]):t.push(o)}),r.push(...t.sort()),r},He=e=>({cache:Be(e.cacheSize),parseClassName:Ge(e),..._e(e)}),Ue=/\s+/,Ye=(e,r)=>{const{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:a}=r,l=[],i=e.trim().split(Ue);let n="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:b,hasImportantModifier:k,baseClassName:h,maybePostfixModifierPosition:y}=t(u);let m=!!y,x=o(m?h.substring(0,y):h);if(!x){if(!m){n=u+(n.length>0?" "+n:n);continue}if(x=o(h),!x){n=u+(n.length>0?" "+n:n);continue}m=!1}const p=We(b).join(":"),v=k?p+xe:p,f=v+x;if(l.includes(f))continue;l.push(f);const E=a(x,m);for(let z=0;z<E.length;++z){const M=E[z];l.push(v+M)}n=u+(n.length>0?" "+n:n)}return n};function Je(){let e=0,r,t,o="";for(;e<arguments.length;)(r=arguments[e++])&&(t=ye(r))&&(o&&(o+=" "),o+=t);return o}const ye=e=>{if(typeof e=="string")return e;let r,t="";for(let o=0;o<e.length;o++)e[o]&&(r=ye(e[o]))&&(t&&(t+=" "),t+=r);return t};function Ke(e,...r){let t,o,a,l=i;function i(c){const u=r.reduce((b,k)=>k(b),e());return t=He(u),o=t.cache.get,a=t.cache.set,l=n,n(c)}function n(c){const u=o(c);if(u)return u;const b=Ye(c,t);return a(c,b),b}return function(){return l(Je.apply(null,arguments))}}const P=e=>{const r=t=>t[e]||[];return r.isThemeGetter=!0,r},ve=/^\[(?:([a-z-]+):)?(.+)\]$/i,qe=/^\d+\/\d+$/,Ze=new Set(["px","full","screen"]),Xe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,er=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,rr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>q(e)||Ze.has(e)||qe.test(e),G=e=>Z(e,"length",dr),q=e=>!!e&&!Number.isNaN(Number(e)),se=e=>Z(e,"number",q),Q=e=>!!e&&Number.isInteger(Number(e)),or=e=>e.endsWith("%")&&q(e.slice(0,-1)),C=e=>ve.test(e),W=e=>Xe.test(e),sr=new Set(["length","size","percentage"]),nr=e=>Z(e,sr,we),ar=e=>Z(e,"position",we),lr=new Set(["image","url"]),ir=e=>Z(e,lr,pr),cr=e=>Z(e,"",ur),ee=()=>!0,Z=(e,r,t)=>{const o=ve.exec(e);return o?o[1]?typeof r=="string"?o[1]===r:r.has(o[1]):t(o[2]):!1},dr=e=>Qe.test(e)&&!er.test(e),we=()=>!1,ur=e=>rr.test(e),pr=e=>tr.test(e),mr=()=>{const e=P("colors"),r=P("spacing"),t=P("blur"),o=P("brightness"),a=P("borderColor"),l=P("borderRadius"),i=P("borderSpacing"),n=P("borderWidth"),c=P("contrast"),u=P("grayscale"),b=P("hueRotate"),k=P("invert"),h=P("gap"),y=P("gradientColorStops"),m=P("gradientColorStopPositions"),x=P("inset"),p=P("margin"),v=P("opacity"),f=P("padding"),E=P("saturate"),z=P("scale"),M=P("sepia"),D=P("skew"),g=P("space"),I=P("translate"),_=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",C,r],L=()=>[C,r],N=()=>["",B,G],A=()=>["auto",q,C],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],S=()=>["","0",C],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[q,C];return{cacheSize:500,separator:":",theme:{colors:[ee],spacing:[B,G],blur:["none","",W,C],brightness:F(),borderColor:[e],borderRadius:["none","","full",W,C],borderSpacing:L(),borderWidth:N(),contrast:F(),grayscale:S(),hueRotate:F(),invert:S(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[or,G],inset:U(),margin:U(),opacity:F(),padding:L(),saturate:F(),scale:F(),sepia:S(),skew:F(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",C]}],container:["container"],columns:[{columns:[W]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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:[...R(),C]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Q,C]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",C]}],grow:[{grow:S()}],shrink:[{shrink:S()}],order:[{order:["first","last","none",Q,C]}],"grid-cols":[{"grid-cols":[ee]}],"col-start-end":[{col:["auto",{span:["full",Q,C]},C]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[ee]}],"row-start-end":[{row:["auto",{span:[Q,C]},C]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",C]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",C]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[g]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[g]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",C,r]}],"min-w":[{"min-w":[C,r,"min","max","fit"]}],"max-w":[{"max-w":[C,r,"none","full","min","max","fit","prose",{screen:[W]},W]}],h:[{h:[C,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[C,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[C,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[C,r,"auto","min","max","fit"]}],"font-size":[{text:["base",W,G]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",se]}],"font-family":[{font:[ee]}],"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",C]}],"line-clamp":[{"line-clamp":["none",q,se]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",B,C]}],"list-image":[{"list-image":["none",C]}],"list-style-type":[{list:["none","disc","decimal",C]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",B,G]}],"underline-offset":[{"underline-offset":["auto",B,C]}],"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:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",C]}],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",C]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),ar]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ir]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:O()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[B,C]}],"outline-w":[{outline:[B,G]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[B,G]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",W,cr]}],"shadow-color":[{shadow:[ee]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",W,C]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[k]}],saturate:[{saturate:[E]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[k]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",C]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",C]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",C]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[Q,C]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",C]}],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","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",C]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",C]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[B,G,se]}],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","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"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-b","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-b":["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-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","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"]}}},br=Ke(mr);function d(...e){return br(Oe(e))}function ke(e){const r=parseInt(e.slice(1,3),16)/255,t=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,a=Math.max(r,t,o),l=Math.min(r,t,o);let i=0,n=0;const c=(a+l)/2;if(a!==l){const u=a-l;switch(n=c>.5?u/(2-a-l):u/(a+l),a){case r:i=((t-o)/u+(t<o?6:0))/6;break;case t:i=((o-r)/u+2)/6;break;case o:i=((r-t)/u+4)/6;break}}return[i*360,n*100,c*100]}function le(e,r,t){t/=100;const o=r*Math.min(t,1-t)/100,a=l=>{const i=(l+e/30)%12,n=t-o*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*n).toString(16).padStart(2,"0")};return`#${a(0)}${a(8)}${a(4)}`}function re(e){const[r,t,o]=ke(e);return{base:e,light:le(r,Math.max(0,t-10),Math.min(100,o+15)),dark:le(r,Math.min(100,t+10),Math.max(0,o-15))}}const T={colors:{primary:"#6366f1",primaryLight:"#818cf8",primaryDark:"#4f46e5",secondary:"#8b5cf6",secondaryLight:"#a78bfa",secondaryDark:"#7c3aed",danger:"#ef4444",dangerLight:"#f87171",dangerDark:"#dc2626",text:"#1f2937",textMuted:"#6b7280",textLight:"#9ca3af",border:"#e5e7eb",borderDark:"#d1d5db",background:"#ffffff",backgroundDark:"#f9fafb",backgroundLight:"#f3f4f6",disabled:"#e5e7eb",light:"#f9fafb",active:"#4338ca"}},je=w.createContext(T);function gr(){return w.useContext(je)}function ue(e){const r=document.documentElement;r.style.setProperty("--componentables-primary",e.colors.primary),r.style.setProperty("--componentables-primary-light",e.colors.primaryLight),r.style.setProperty("--componentables-primary-dark",e.colors.primaryDark),r.style.setProperty("--componentables-secondary",e.colors.secondary),r.style.setProperty("--componentables-secondary-light",e.colors.secondaryLight),r.style.setProperty("--componentables-secondary-dark",e.colors.secondaryDark),r.style.setProperty("--componentables-danger",e.colors.danger),r.style.setProperty("--componentables-danger-light",e.colors.dangerLight),r.style.setProperty("--componentables-danger-dark",e.colors.dangerDark),r.style.setProperty("--componentables-text",e.colors.text),r.style.setProperty("--componentables-text-muted",e.colors.textMuted),r.style.setProperty("--componentables-text-light",e.colors.textLight),r.style.setProperty("--componentables-border",e.colors.border),r.style.setProperty("--componentables-border-dark",e.colors.borderDark),r.style.setProperty("--componentables-background",e.colors.background),r.style.setProperty("--componentables-background-dark",e.colors.backgroundDark),r.style.setProperty("--componentables-background-light",e.colors.backgroundLight),r.style.setProperty("--componentables-disabled",e.colors.disabled),r.style.setProperty("--componentables-light",e.colors.light),r.style.setProperty("--componentables-active",e.colors.active)}function fr({children:e,theme:r}){const t=w.useMemo(()=>{const o=r?.colors||{},a=o.primary?re(o.primary):null,l=o.secondary?re(o.secondary):null,i=o.danger?re(o.danger):null;return{colors:{primary:o.primary||T.colors.primary,primaryLight:a?.light||T.colors.primaryLight,primaryDark:a?.dark||T.colors.primaryDark,secondary:o.secondary||T.colors.secondary,secondaryLight:l?.light||T.colors.secondaryLight,secondaryDark:l?.dark||T.colors.secondaryDark,danger:o.danger||T.colors.danger,dangerLight:i?.light||T.colors.dangerLight,dangerDark:i?.dark||T.colors.dangerDark,text:o.text||T.colors.text,textMuted:o.textMuted||T.colors.textMuted,textLight:o.textLight||T.colors.textLight,border:o.border||T.colors.border,borderDark:o.borderDark||T.colors.borderDark,background:o.background||T.colors.background,backgroundDark:o.backgroundDark||T.colors.backgroundDark,backgroundLight:o.backgroundLight||T.colors.backgroundLight,disabled:o.disabled||T.colors.disabled,light:o.light||T.colors.light,active:o.active||T.colors.active}}},[r]);return typeof window<"u"&&ue(t),w.useEffect(()=>{ue(t)},[t]),w.createElement(je.Provider,{value:t},e)}const hr={primary:"bg-primary text-white border-primary hover:bg-primary-dark hover:border-primary-dark active:bg-active",secondary:"bg-secondary text-white border-secondary hover:bg-secondary-dark hover:border-secondary-dark","primary-outline":"bg-transparent text-primary border-primary hover:bg-primary hover:text-white","secondary-outline":"bg-transparent text-secondary border-secondary hover:bg-secondary hover:text-white",ghost:"bg-transparent text-primary border-transparent hover:bg-primary hover:text-white hover:border-primary",light:"bg-light text-text border-border hover:bg-background-light",danger:"bg-transparent text-danger border-danger hover:text-white hover:bg-danger hover:border-danger active:bg-danger-dark",link:"bg-transparent text-secondary-light! underline hover:text-primary! border-0",dark:"bg-gray-800 text-white border-gray-800 hover:bg-gray-900 hover:border-gray-900"},xr={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",xl:"px-8 py-4 text-xl"};function Y({children:e,onClick:r,disabled:t=!1,type:o="button",variant:a="primary",size:l="md",fullWidth:i=!1,loading:n=!1,className:c="",...u}){return s.jsxs("button",{type:o,onClick:t||n?void 0:r,disabled:t||n,className:d("inline-flex shadow-md hover:shadow-lg cursor-pointer items-center justify-center font-medium rounded-lg border transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50",t||n?"bg-disabled text-text-muted border-disabled cursor-not-allowed hover:bg-disabled hover:border-disabled hover:text-text-muted":hr[a],xr[l],i&&"w-full",n&&"cursor-wait opacity-75",c),...u,children:[n&&s.jsxs("svg",{className:"w-4 h-4 mr-2 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e]})}function yr({id:e,name:r,type:t="text",value:o,onChange:a,placeholder:l,label:i,error:n,disabled:c=!1,required:u=!1,colorScheme:b="secondary",className:k="",...h}){const y=()=>{const x="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted";if(n)return d(x,"border-danger focus:border-danger focus:shadow-danger-light");switch(b){case"primary":return d(x,"text-primary border-primary focus:border-primary");case"secondary":default:return d(x,"text-secondary border-secondary focus:border-secondary")}},m=()=>b==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:d("mb-6",k),children:[i&&s.jsxs("label",{htmlFor:e,className:d("block mb-2 text-sm font-medium",m()),children:[i,u&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsx("input",{id:e,name:r,type:t,value:o,onChange:a,placeholder:l,disabled:c,required:u,className:y(),...h}),n&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:n})]})}function vr({id:e,name:r,value:t,onChange:o,placeholder:a,label:l,error:i,disabled:n=!1,required:c=!1,colorScheme:u="secondary",className:b="",rows:k=4,...h}){const y=()=>{const x="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted resize-none";if(i)return d(x,"border-danger focus:border-danger focus:shadow-danger-light");switch(u){case"primary":return d(x,"text-primary border-primary focus:border-primary");case"secondary":default:return d(x,"text-secondary border-secondary focus:border-secondary")}},m=()=>u==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:d("mb-6",b),children:[l&&s.jsxs("label",{htmlFor:e,className:d("block mb-2 text-sm font-medium",m()),children:[l,c&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsx("textarea",{id:e,name:r,value:t,onChange:o,placeholder:a,disabled:n,required:c,rows:k,className:y(),...h}),i&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:i})]})}const Ce={Input:yr,InputArea:vr};function wr({id:e,name:r,checked:t=!1,onChange:o,disabled:a=!1,label:l,colorScheme:i="secondary",size:n="md",className:c="",...u}){const[b,k]=w.useState(t);w.useEffect(()=>{k(t)},[t]);const h=()=>{if(a)return;const f=!b;k(f),o?.(f)},y=()=>({primary:{bg:"bg-primary",border:"border-primary",text:"text-primary"},secondary:{bg:"bg-secondary",border:"border-secondary",text:"text-secondary"}})[i],m=()=>{switch(n){case"sm":return"w-10 h-6";case"lg":return"w-16 h-8";case"md":default:return"w-13 h-7"}},x=()=>{switch(n){case"sm":return"w-5 h-5";case"lg":return"w-7 h-7";case"md":default:return"w-6 h-6"}},p=()=>{if(!b)return"translate-x-0";switch(n){case"sm":return"translate-x-5";case"lg":return"translate-x-8";case"md":default:return"translate-x-6"}},v=y();return s.jsxs("div",{className:d("flex items-center gap-3",a?"cursor-not-allowed":"cursor-pointer",c),onClick:h,children:[s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:"checkbox",id:e,name:r,checked:b,onChange:()=>{},disabled:a,className:"sr-only","aria-label":l||r,...u}),s.jsx("div",{className:d("block transition-all duration-300 rounded-full border-2",m(),b?d(v.bg,v.border):"bg-gray-200 border-gray-300",a?"opacity-50":"hover:shadow-md"),children:s.jsx("span",{className:d("absolute top-0.5 left-0.5 inline-block rounded-full bg-white transition-all duration-300 shadow-sm",x(),p())})})]}),l&&s.jsx("span",{className:d("text-sm font-medium select-none",v.text,a&&"opacity-50"),children:l})]})}const Ne=({size:e=40,wrapperStyle:r={},wrapperClass:t="",ariaLabel:o="Cargando...",label:a="Cargando...",visible:l=!0,direction:i="column"})=>{const n={display:"flex",flexDirection:i,justifyContent:"center",alignItems:"center",minHeight:"100px",...r};return s.jsxs("div",{style:n,className:t,children:[s.jsx("label",{children:a}),s.jsx(Ie.Oval,{visible:l,height:e,width:e,ariaLabel:o,wrapperStyle:{},wrapperClass:"",secondaryColor:"#cdae90",color:"#cdae90"})]})},{Input:ne}=Ce,kr=({title:e="Iniciar Sesión",showForgotPassword:r=!0,onlyForgotPassword:t=!1,className:o="",onLogin:a,onForgotPassword:l})=>{const[i,n]=w.useState({email:"",password:""}),[c,u]=w.useState({}),[b,k]=w.useState(!1),[h,y]=w.useState(t?"forgot":"login"),m=(D,g)=>{switch(D){case"email":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(g)?"":"Por favor ingresa un email válido";case"password":return g.length>=6?"":"La contraseña debe tener al menos 6 caracteres";default:return""}},x=D=>{const{name:g,value:I}=D.target;n(_=>({..._,[g]:I})),c[g]&&u(_=>({..._,[g]:""}))},p=()=>{const D={},g=m("email",i.email);if(g&&(D.email=g),h==="login"){const I=m("password",i.password);I&&(D.password=I)}return u(D),Object.keys(D).length===0},v=async D=>{if(D.preventDefault(),!!p()){k(!0);try{switch(h){case"login":a&&await a({email:i.email,password:i.password});break;case"forgot":l&&await l(i.email);break}}catch(g){console.error("Login error:",g)}finally{k(!1)}}},f=D=>{y(D),u({}),n({email:i.email,password:""})},E=()=>{switch(h){case"forgot":return s.jsx(ne,{id:"email",type:"email",name:"email",placeholder:"Ingresa tu email",label:"Email",value:i.email,onChange:x,error:c.email,disabled:b,colorScheme:"secondary"});default:return s.jsxs(s.Fragment,{children:[s.jsx(ne,{id:"email",type:"email",name:"email",placeholder:"Ingresa tu email",label:"Email",value:i.email,onChange:x,error:c.email,disabled:b,colorScheme:"secondary"}),s.jsx(ne,{id:"password",type:"password",name:"password",placeholder:"Ingresa tu contraseña",label:"Contraseña",value:i.password,onChange:x,error:c.password,disabled:b,colorScheme:"secondary"})]})}},z=()=>{switch(h){case"forgot":return t?"Cambiar Contraseña":"Recuperar Contraseña";default:return e}},M=()=>{if(b)return s.jsx(Ne,{size:20,wrapperStyle:{minHeight:"auto"}});switch(h){case"forgot":return"Enviar Enlace";default:return"Entrar"}};return s.jsx("div",{className:`flex justify-center items-center min-h-[90vh] p-6 bg-background sm:p-4 ${o||""}`,children:s.jsxs("div",{className:"w-full max-w-100 p-12 bg-white rounded-2xl shadow-lg animate-[fadeIn_0.3s_ease-out] sm:p-8",children:[s.jsx("h2",{className:"text-center mb-12 text-3xl font-semibold text-primary sm:text-2xl sm:mb-8",children:z()}),s.jsx("div",{className:"space-y-4 mb-6",children:E()}),s.jsx("form",{onSubmit:v,children:s.jsx(Y,{type:"submit",disabled:b,loading:b,fullWidth:!0,variant:"primary",size:"lg",className:"mb-6",children:!b&&M()})}),h==="login"&&r&&s.jsx(Y,{type:"button",onClick:()=>f("forgot"),variant:"link",size:"sm",fullWidth:!0,className:"shadow-none! !hover:shadow-none",children:"¿Olvidaste tu contraseña?"}),h==="forgot"&&!t&&s.jsx(Y,{type:"button",onClick:()=>f("login"),variant:"link",size:"sm",fullWidth:!0,className:"shadow-none! !hover:shadow-none",children:"Volver al inicio de sesión"})]})})};var Me={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pe=w.createContext&&w.createContext(Me),jr=["attr","size","title"];function Cr(e,r){if(e==null)return{};var t=Nr(e,r),o,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)o=l[a],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}function Nr(e,r){if(e==null)return{};var t={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function te(){return te=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},te.apply(this,arguments)}function me(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,o)}return t}function oe(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?me(Object(t),!0).forEach(function(o){Mr(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):me(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function Mr(e,r,t){return r=Sr(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Sr(e){var r=Er(e,"string");return typeof r=="symbol"?r:r+""}function Er(e,r){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var o=t.call(e,r);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Se(e){return e&&e.map((r,t)=>w.createElement(r.tag,oe({key:t},r.attr),Se(r.child)))}function H(e){return r=>w.createElement(Lr,te({attr:oe({},e.attr)},r),Se(e.child))}function Lr(e){var r=t=>{var{attr:o,size:a,title:l}=e,i=Cr(e,jr),n=a||t.size||"1em",c;return t.className&&(c=t.className),e.className&&(c=(c?c+" ":"")+e.className),w.createElement("svg",te({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,i,{className:c,style:oe(oe({color:e.color||t.color},t.style),e.style),height:n,width:n,xmlns:"http://www.w3.org/2000/svg"}),l&&w.createElement("title",null,l),e.children)};return pe!==void 0?w.createElement(pe.Consumer,null,t=>r(t)):r(Me)}function zr(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},child:[]}]})(e)}const Ee=(e,r=500)=>{const[t,o]=w.useState(e);return w.useEffect(()=>{const a=setTimeout(()=>{o(e)},r);return()=>clearTimeout(a)},[e,r]),t},Dr=()=>({showToast:(r,t)=>{const o={position:"bottom-right",autoClose:2e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!1,progress:void 0};switch(r){case"success":X.toast.success(t,o);break;case"error":X.toast.error(t,o);break;case"warning":X.toast.warning(t,o);break;case"info":X.toast.info(t,o);break;default:X.toast(t,o);break}}});function Ar(e=768){const[r,t]=w.useState(()=>typeof window>"u"?!1:window.innerWidth<e);return w.useEffect(()=>{if(typeof window>"u")return;const o=()=>{t(window.innerWidth<e)};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[e]),r}function Pr({value:e,onChange:r,placeholder:t="Search...",disabled:o=!1,colorScheme:a="secondary",label:l,className:i="",debounceDelay:n=500,...c}){const[u,b]=w.useState(e||""),k=Ee(u,n),h=w.useCallback(r,[r]);w.useEffect(()=>{h(k)},[k,h]);const y=()=>{const p="w-full px-4 py-2.5 pl-10 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted";switch(a){case"primary":return d(p,"text-primary border-primary focus:border-primary");case"secondary":default:return d(p,"text-secondary border-secondary focus:border-secondary")}},m=()=>a==="primary"?"text-primary":"text-secondary",x=()=>a==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:d("mb-0",i),children:[l&&s.jsx("label",{className:d("block mb-2 text-sm font-medium",x()),children:l}),s.jsxs("div",{className:"relative w-full",children:[s.jsx(zr,{className:d("absolute left-3 top-1/2 -translate-y-1/2 text-base pointer-events-none",m())}),s.jsx("input",{type:"text",value:u,onChange:p=>b(p.target.value),placeholder:t,disabled:o,className:y(),...c})]})]})}function Ir(e){return H({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function Tr(e){return H({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(e)}function Or({labelPage:e="Page",labelOf:r="of",setPagination:t,totalPages:o,currentPage:a,showLabel:l=!0,className:i="",isLoading:n=!1,fetchPage:c}){const u=parseInt(String(a))===1||parseInt(String(o))===0||n,b=parseInt(String(a))===parseInt(String(o))||parseInt(String(o))===0||n,k=()=>{n||(c?c(a-1):t&&t(y=>({...y,page:y.page-1})))},h=()=>{n||(c?c(a+1):t&&t(y=>({...y,page:y.page+1})))};return s.jsxs("div",{className:d("flex justify-center items-center mt-8",i),children:[s.jsx(Y,{disabled:u,onClick:k,variant:"secondary",children:s.jsx(Ir,{size:14})}),s.jsx("h5",{className:"font-bold mx-2.5 text-text",children:`${l?e:""} ${a}${l?` ${r} `:" / "}${o}`}),s.jsx(Y,{disabled:b,onClick:h,variant:"primary",children:s.jsx(Tr,{size:14})})]})}function Le(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(e)}function _r(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function $r(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M456.69 421.39 362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8 124.95 124.95 0 0 1-124.8-124.8z"},child:[]}]})(e)}function Fr({title:e,subtitle:r,children:t,defaultExpanded:o=!1,expanded:a,onToggle:l,className:i="",colorScheme:n="primary",icon:c,disabled:u=!1,headerExtra:b}){const[k,h]=w.useState(o),y=a!==void 0?a:k,m=()=>{if(u)return;const f=!y;a===void 0&&h(f),l?.(f)},x=()=>n==="primary"?"border-primary":"border-secondary",p=()=>n==="primary"?"text-primary":"text-secondary",v=()=>n==="primary"?"hover:bg-primary/5":"hover:bg-secondary/5";return s.jsxs("div",{className:d("w-full rounded-lg border-2 bg-background transition-all duration-300",x(),y&&"shadow-lg",i),children:[s.jsxs("button",{type:"button",onClick:m,disabled:u,className:d("w-full flex cursor-pointer items-center justify-between p-4 text-left transition-all duration-300 rounded-lg",!u&&v(),u&&"opacity-50"),"aria-expanded":y,children:[s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[c&&s.jsx("div",{className:d("shrink-0",p()),children:c}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:d("text-base font-medium truncate",p()),children:e}),r&&s.jsx("p",{className:"text-sm text-text-muted truncate mt-0.5",children:r})]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[b&&s.jsx("div",{onClick:f=>f.stopPropagation(),children:b}),s.jsx("div",{className:d("h-5 w-5 transition-transform duration-300",p(),y&&"rotate-180"),children:s.jsx(Le,{className:"h-5 w-5"})})]})]}),s.jsx("div",{className:d("overflow-hidden transition-all duration-300 ease-in-out",y?"max-h-500 opacity-100":"max-h-0 opacity-0"),children:s.jsx("div",{className:d("p-4 pt-0 border-t-0",x()),children:s.jsx("div",{className:"border-t border-border pt-4",children:t})})})]})}function Rr({children:e,className:r=""}){return s.jsx("div",{className:d("py-4",r),children:e})}function Vr({options:e,value:r,onChange:t,children:o,className:a="",colorScheme:l="primary",variant:i="underline"}){const[n,c]=w.useState(r??e[0]?.value??""),u=r!==void 0?r:n,b=m=>{r===void 0&&c(m),t?.(m)},k=(m,x)=>{const p=u===m,v="px-4 py-3 cursor-pointer text-sm font-medium transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed";if(x)return d(v,"text-text-muted");switch(i){case"filled":return d(v,"rounded-lg",p?l==="primary"?"bg-primary text-white":"bg-secondary text-white":"text-text-muted hover:bg-background-light");case"pills":return d(v,"rounded-full",p?l==="primary"?"bg-primary/10 text-primary border-2 border-primary":"bg-secondary/10 text-secondary border-2 border-secondary":"text-text-muted hover:bg-background-light border-2 border-transparent");case"underline":default:return d(v,"border-b-2 flex items-center gap-2",p?l==="primary"?"border-primary text-primary":"border-secondary text-secondary":"border-transparent text-gray-500 hover:text-gray-700")}},h=()=>{switch(i){case"filled":return"flex gap-1 p-1 bg-background-light rounded-lg";case"pills":return"flex gap-2 flex-wrap";case"underline":default:return"flex gap-2 border-b border-gray-200"}},y=w.Children.toArray(o).find(m=>w.isValidElement(m)?m.props.value===u:!1);return s.jsxs("div",{className:d("w-full",a),children:[s.jsx("div",{className:h(),role:"tablist",children:e.map(m=>s.jsxs("button",{type:"button",role:"tab","aria-selected":u===m.value,"aria-controls":`tabpanel-${m.value}`,disabled:m.disabled,onClick:()=>!m.disabled&&b(m.value),className:k(m.value,m.disabled),children:[m.icon&&s.jsx("span",{className:"shrink-0",children:m.icon}),m.label]},m.value))}),s.jsx("div",{role:"tabpanel",id:`tabpanel-${u}`,children:y})]})}function be(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"},child:[]}]})(e)}function ge(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},child:[]}]})(e)}const ze=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],De=["Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],Ae=["January","February","March","April","May","June","July","August","September","October","November","December"],Pe=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];function Br(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function Gr(e){const r=new Date(e.getFullYear(),e.getMonth(),1).getDay();return r===0?6:r-1}function Wr({value:e,onChange:r,disabled:t=!1,className:o="",colorScheme:a="secondary",lang:l="en",...i}){const[n,c]=w.useState(e||new Date),u={en:"en-US",es:"es-ES"},b={en:ze,es:De},k={en:Ae,es:Pe},h=Br(n),y=Gr(n),m=[];for(let g=0;g<y;g++)m.push(null);for(let g=1;g<=h;g++){const I=new Date(n.getFullYear(),n.getMonth(),g,12,0,0);m.push(I)}const x=()=>{c(new Date(n.getFullYear(),n.getMonth()-1,1,12,0,0))},p=()=>{c(new Date(n.getFullYear(),n.getMonth()+1,1,12,0,0))},v=()=>{c(new Date(n.getFullYear()-1,n.getMonth(),1,12,0,0))},f=()=>{c(new Date(n.getFullYear()+1,n.getMonth(),1,12,0,0))},E=g=>{if(g&&!t){const I=new Date(g.getFullYear(),g.getMonth(),g.getDate(),12,0,0);c(I),r?.(I)}},M=(()=>{switch(a){case"primary":return{header:"text-primary",selected:"bg-primary text-white",hover:"hover:bg-primary/10",button:"text-primary border-primary hover:bg-primary/20"};case"secondary":default:return{header:"text-secondary",selected:"bg-secondary text-white",hover:"hover:bg-secondary/10",button:"text-secondary border-secondary hover:bg-secondary/20"}}})(),D=g=>g&&e?g.toDateString()===e.toDateString():!1;return s.jsxs("div",{className:d("w-full max-w-sm bg-background border-2 border-border rounded-lg p-6 shadow-md",o),...i,children:[s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:d("flex items-center justify-between mb-4",M.header),children:[s.jsx("button",{type:"button",onClick:v,disabled:t,className:d("p-2 rounded-lg border transition-all duration-300",M.button,t&&"opacity-50 cursor-not-allowed"),children:s.jsx(be,{size:18})}),s.jsx("h2",{className:"font-semibold text-lg",children:n.getFullYear()}),s.jsx("button",{type:"button",onClick:f,disabled:t,className:d("p-2 rounded-lg border transition-all duration-300",M.button,t&&"opacity-50 cursor-not-allowed"),children:s.jsx(ge,{size:18})})]}),s.jsxs("div",{className:d("flex items-center justify-between",M.header),children:[s.jsx("button",{type:"button",onClick:x,disabled:t,className:d("p-2 rounded-lg border transition-all duration-300",M.button,t&&"opacity-50 cursor-not-allowed"),children:s.jsx(be,{size:18})}),s.jsx("h2",{className:"font-semibold text-lg",children:k[l][n.getMonth()]}),s.jsx("button",{type:"button",onClick:p,disabled:t,className:d("p-2 rounded-lg border transition-all duration-300",M.button,t&&"opacity-50 cursor-not-allowed"),children:s.jsx(ge,{size:18})})]})]}),s.jsx("div",{className:"grid grid-cols-7 gap-2 mb-4",children:b[l].map(g=>s.jsx("div",{className:d("text-center text-sm font-medium py-2",M.header),children:g},g))}),s.jsx("div",{className:"grid grid-cols-7 gap-2",children:m.map((g,I)=>s.jsx("button",{type:"button",onClick:()=>E(g),disabled:!g||t,className:d("p-2 rounded-lg text-sm font-medium transition-all duration-300",g?d("cursor-pointer",M.hover,D(g)?M.selected:"text-text border border-transparent hover:border-border",t&&"opacity-50 cursor-not-allowed"):"cursor-default"),children:g?g.getDate():""},I))}),e&&s.jsx("div",{className:d("mt-6 p-3 rounded-lg bg-background-dark border border-border text-center text-sm font-medium",M.header),children:e.toLocaleDateString(u[l],{year:"numeric",month:"long",day:"numeric"})})]})}function Hr({headers:e,data:r,loading:t,loadingText:o="Loading...",actions:a,actionsHeader:l="Actions",onRowClick:i,className:n="",rowClassName:c="",cellClassName:u="",headerClassName:b="",emptyText:k="No data available",showCount:h=!0,countText:y=x=>`Showing ${x} record${x!==1?"s":""}`,keyExtractor:m=(x,p)=>x._id||x.id||p}){if(t)return s.jsx("div",{className:"flex justify-center items-center min-h-50",children:s.jsx("div",{className:"text-lg text-text-light",children:o})});if(r.length===0)return s.jsx("div",{className:"flex justify-center items-center min-h-50",children:s.jsx("div",{className:"text-lg text-text-muted",children:k})});const x=(p,v)=>{const f=v.toLowerCase().replace(/\s+/g,"_");let E=p[f];if(E===void 0){const z=[f.replace(/_/g,""),v.toLowerCase().replace(/\s+/g,""),f.replace(/_([a-z])/g,(M,D)=>D.toUpperCase())];for(const M of z)if(p[M]!==void 0){E=p[M];break}}if(E===void 0){const z=v.toLowerCase().split(" "),M=Object.keys(p).find(D=>z.some(g=>D.toLowerCase().includes(g)));M&&(E=p[M])}return E!=null?String(E):"N/A"};return s.jsxs("div",{className:d("overflow-x-auto",n),children:[s.jsxs("table",{className:"w-full border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b-2 border-border",children:[e.map((p,v)=>s.jsx("th",{className:d("text-left py-3 px-4 font-semibold text-text",b),children:p},v)),a&&s.jsx("th",{className:d("text-center py-3 px-4 font-semibold text-text",b),children:l})]})}),s.jsx("tbody",{children:r.map((p,v)=>s.jsxs("tr",{className:d("border-b border-border-dark hover:bg-background-light transition-colors",i&&"cursor-pointer",c),onClick:()=>i?.(p),children:[e.map((f,E)=>s.jsx("td",{className:d("py-4 px-4",u),children:s.jsx("div",{className:"text-text-light",children:x(p,f)})},E)),a&&s.jsx("td",{className:d("py-4 px-4",u),children:s.jsx("div",{className:"flex gap-2 justify-center",children:a.map((f,E)=>{const z=M=>{M?.stopPropagation(),f.onClick?.(p)};if(f.component){const M=f.component;return s.jsxs(M,{onClick:z,className:f.className||"",...f.props||{},children:[f.icon&&s.jsx("span",{className:"inline-block",children:w.createElement(f.icon)}),f.label&&f.label]},E)}return s.jsxs(Y,{onClick:z,className:f.className||"",...f.props||{},children:[f.icon&&s.jsx("span",{className:"inline-block",children:w.createElement(f.icon)}),f.label&&f.label]},E)})})})]},m(p,v)))})]}),h&&r.length>0&&s.jsx("div",{className:"mt-6 text-center text-text-light text-sm",children:y(r.length)})]})}function Ur({label:e,options:r,value:t="",onChange:o,multiple:a=!1,className:l="",searchable:i=!1,onSearchInputCustom:n,placeholder:c="Select...",disabled:u=!1,error:b,required:k=!1,colorScheme:h="primary",noResultsText:y="No results found",searchPlaceholder:m="Search...",...x}){const[p,v]=w.useState(!1),[f,E]=w.useState(""),[z,M]=w.useState({top:0,left:0,openUpward:!1}),D=Array.isArray(t)?t:t?[t]:[],[g,I]=w.useState(D.map(j=>r.find(S=>S.value===j)).filter(Boolean)),_=w.useRef(null),V=w.useRef(null),U=()=>{const j="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed";if(b)return d(j,"border-danger focus:border-danger");switch(h){case"primary":return d(j,"text-primary border-primary focus:border-primary");case"secondary":default:return d(j,"text-secondary border-secondary focus:border-secondary")}},L=()=>h==="primary"?"text-primary":"text-secondary";w.useEffect(()=>{const S=(Array.isArray(t)?t:t!==""&&t!==null&&t!==void 0?[t]:[]).map($=>r.find(F=>F.value===$)).filter(Boolean);I(S)},[t,r]),w.useEffect(()=>{p&&i&&V.current&&V.current.focus()},[p,i]);const N=w.useCallback(()=>{if(!_.current)return;const j=_.current.getBoundingClientRect(),S=window.innerHeight,$=250,K=S-j.bottom<$&&j.top>$;M({top:K?j.top:j.bottom,left:j.left,width:j.width,openUpward:K})},[]);w.useEffect(()=>{function j($){_.current&&!_.current.contains($.target)&&v(!1)}function S(){p&&N()}return document.addEventListener("mousedown",j),window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{document.removeEventListener("mousedown",j),window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[p,N]);const A=j=>{const S=r.find(F=>F.value===j);if(!S)return;let $;a?($=g.some(K=>K.value===j)?g.filter(K=>K.value!==j):[...g,S],I($),o($)):($=[S],I($),o(S),v(!1),E(""))},R=j=>{E(j),n?.(j)},O=i?r.filter(j=>j.label.toLowerCase().includes(f.toLowerCase())):r,J=()=>g.length===0?c:a?g.length===1?g[0].label:`${g.length} selected`:g[0]?.label||c;return s.jsxs("div",{className:d("mb-6",l),children:[e&&s.jsxs("label",{className:d("block mb-2 text-sm font-medium",L()),children:[e,k&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsxs("div",{ref:_,className:"relative w-full",children:[s.jsxs("button",{type:"button",onClick:j=>{j.preventDefault(),j.stopPropagation(),p||N(),v(!p)},className:d(U(),"inline-flex items-center justify-between cursor-pointer h-auto min-h-14",u&&"cursor-not-allowed",p&&"ring-1"),disabled:u,...x,children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[g.length>0&&g[0].hex&&s.jsx("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:g[0].hex}}),s.jsx("span",{className:g.length>0?"":"text-text-muted",children:J()})]}),s.jsx("div",{className:d("h-5 w-5 transition-transform duration-200",p&&"rotate-180"),children:s.jsx(Le,{className:"h-5 w-5"})})]}),p&&s.jsxs("div",{className:d("fixed z-9999 rounded-lg border-2 bg-white shadow-xl",b?"border-danger":h==="primary"?"border-primary":"border-secondary"),style:{top:`${z.top+(z.openUpward?0:8)}px`,left:`${z.left}px`,width:`${z.width}px`,transform:z.openUpward?"translateY(-100%)":"none"},children:[i&&s.jsx("div",{className:"border-b border-border p-3",children:s.jsxs("div",{className:"relative",children:[s.jsx($r,{className:"absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 transform text-text-muted"}),s.jsx("input",{ref:V,type:"text",value:f,onChange:j=>R(j.target.value),placeholder:m,className:d("w-full rounded-lg border-2 py-2 pr-10 pl-10 text-sm transition-all duration-300 focus:outline-none focus:ring-1",h==="primary"?"border-primary text-primary":"border-secondary text-secondary")}),f&&s.jsx("button",{type:"button",onClick:()=>E(""),className:"absolute top-1/2 right-3 h-4 w-4 -translate-y-1/2 transform text-text-muted hover:text-text",children:s.jsx(_r,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"max-h-60 overflow-y-auto py-1",children:[O.map(j=>s.jsx("button",{type:"button",onClick:()=>A(j.value??""),className:d("w-full px-4 py-3 text-left text-sm transition-colors",g.some(S=>S.value===j.value)?h==="primary"?"bg-primary/10 text-primary font-medium":"bg-secondary/10 text-secondary font-medium":"text-text hover:bg-background-light"),children:s.jsxs("div",{className:"flex items-center gap-3",children:[a&&s.jsx("div",{className:d("flex h-4 w-4 items-center justify-center rounded border-2 transition-colors",g.some(S=>S.value===j.value)?h==="primary"?"border-primary bg-primary":"border-secondary bg-secondary":"border-border"),children:g.some(S=>S.value===j.value)&&s.jsx("svg",{className:"h-3 w-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}),j.hex&&s.jsx("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:j.hex}}),s.jsx("span",{children:j.label})]})},j.value)),O.length===0&&f&&r.length>0&&s.jsx("div",{className:"px-4 py-3",children:s.jsx("span",{className:"text-sm text-text-muted",children:y})})]})]})]}),b&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:b})]})}const Yr=({id:e,name:r,onFilesSelected:t,placeholder:o="Arrastra y suelta archivos aquí o haz clic para seleccionar",labelSelectedFiles:a="archivo:",label:l,error:i,disabled:n=!1,required:c=!1,colorScheme:u="secondary",className:b="",accept:k="*/*",multiple:h=!1,...y})=>{const m=w.useRef(null),[x,p]=w.useState(!1),[v,f]=w.useState([]),E=()=>{const N="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed cursor-pointer min-h-[120px]";if(i)return d(N,"border-danger focus:border-danger focus:ring-1 focus:ring-danger");switch(u){case"primary":return d(N,"border-primary focus:border-primary focus:ring-1 focus:ring-primary hover:border-primary-dark");case"secondary":default:return d(N,"border-secondary focus:border-secondary focus:ring-1 focus:ring-secondary hover:border-secondary-dark")}},z=()=>{switch(u){case"primary":return"text-primary";case"secondary":default:return"text-secondary"}},M=N=>{N.preventDefault(),N.stopPropagation(),n||(N.type==="dragenter"||N.type==="dragover"?p(!0):N.type==="dragleave"&&p(!1))},D=N=>{if(N.preventDefault(),N.stopPropagation(),p(!1),n)return;const A=N.dataTransfer.files;I(A)},g=N=>{const A=N.target.files;A&&I(A)},I=N=>{const A=Array.from(N);if(k!=="*/*"){const R=A.filter(O=>_(O,k));if(R.length===0){console.warn("No valid files selected");return}f(h?R:[R[0]]),t(h?R:[R[0]])}else f(h?A:[A[0]]),t(h?A:[A[0]])},_=(N,A)=>A.split(",").map(O=>O.trim()).some(O=>{if(O.startsWith("."))return N.name.toLowerCase().endsWith(O.toLowerCase());if(O.includes("/")){const[J,j]=O.split("/"),S=N.type.split("/")[0];return j==="*"?S===J:N.type===O}return!1}),V=()=>{n||m.current?.click()},U=N=>{const A=v.filter((R,O)=>O!==N);f(A),t(A)},L=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),V())};return s.jsxs("div",{className:`mb-6 ${b}`,children:[l&&s.jsxs("label",{className:`block mb-2 text-sm font-medium ${z()}`,children:[l,c&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsxs("div",{className:d(E(),x&&"bg-background-light border-2-dashed"),onDragEnter:M,onDragLeave:M,onDragOver:M,onDrop:D,onClick:V,onKeyDown:L,role:"button",tabIndex:n?-1:0,children:[s.jsx("input",{ref:m,id:e,name:r,type:"file",onChange:g,disabled:n,required:c,accept:k,multiple:h,className:"hidden",...y}),s.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[s.jsx("svg",{className:`w-8 h-8 mb-2 ${u==="primary"?"text-primary":"text-secondary"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),s.jsx("p",{className:`text-sm ${z()}`,children:o})]})]}),s.jsxs("div",{className:"mt-4 space-y-2",children:[s.jsxs("p",{className:`text-sm font-medium ${z()}`,children:[v.length," ",a,"(s) seleccionado(s):"]}),s.jsx("ul",{className:"space-y-1",children:v.map((N,A)=>s.jsxs("li",{className:"flex items-center justify-between p-2 bg-light rounded border border-border",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[s.jsxs("svg",{className:"w-4 h-4 text-text-muted shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:[s.jsx("path",{d:"M8 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM15 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z"}),s.jsx("path",{d:"M3 4a1 1 0 00-1 1v10a1 1 0 001 1h1.05a2.5 2.5 0 014.9 0H10a1 1 0 001-1V5a1 1 0 00-1-1H3zM14 7a1 1 0 00-1 1v6.05A2.5 2.5 0 0115.95 10H17a1 1 0 001-1v-3a1 1 0 00-1-1h-3z"})]}),s.jsx("span",{className:"text-sm text-text truncate",children:N.name})]}),s.jsx("button",{onClick:R=>{R.stopPropagation(),U(A)},className:"ml-2 text-danger hover:text-danger-dark shrink-0",type:"button",children:"✕"})]},A))})]}),i&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:i})]})},Jr=({text:e,className:r="",variant:t="default",visible:o=!0,...a})=>{if(!o)return null;const l={default:"bg-gray-200 text-gray-800",primary:"bg-primary text-white",secondary:"bg-secondary text-white",secondaryDark:"bg-secondary-dark text-white",danger:"bg-danger text-white",warning:"bg-warning text-white"},i="inline-flex items-center px-3 py-1 rounded-full text-xs font-bold uppercase shadow-md",n=l[t]||l.default;return s.jsx("div",{className:`${i} ${n} ${r}`,...a,children:e})};function Kr({isOpen:e,onClose:r,title:t,children:o,size:a="md",className:l="",overlayClassName:i="",showCloseButton:n=!0,closeOnOverlayClick:c=!0,closeOnEscape:u=!0}){if(w.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),w.useEffect(()=>{if(!u||!e)return;const y=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[e,r,u]),!e)return null;const b={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"},k=()=>{c&&r()},h=s.jsx("div",{className:d("fixed inset-0 bg-black/40 flex items-center justify-center z-9999 p-4",i),onClick:k,role:"dialog","aria-modal":"true","aria-labelledby":t?"modal-title":void 0,children:s.jsxs("div",{className:d("relative bg-white rounded-xl shadow-2xl max-h-[90vh] flex flex-col w-full transition-all duration-300",b[a],l),onClick:y=>y.stopPropagation(),children:[(t||n)&&s.jsxs("div",{className:"flex justify-between items-center px-6 py-5 border-b border-border rounded-t-xl shrink-0",children:[t&&s.jsx("h2",{id:"modal-title",className:"text-xl sm:text-2xl font-bold text-primary m-0",children:t}),n&&s.jsx("button",{className:"flex items-center justify-center w-8 h-8 text-text-muted hover:text-text hover:bg-background-light transition-colors duration-200 rounded-lg",onClick:r,"aria-label":"Cerrar modal",type:"button",children:s.jsx("span",{className:"text-2xl font-light leading-none",children:"×"})})]}),s.jsx("div",{className:"p-6 overflow-y-auto flex-1",children:o})]})});return Te.createPortal(h,document.body)}function qr({id:e,name:r,checked:t=!1,onChange:o,disabled:a=!1,required:l=!1,colorScheme:i="secondary",variant:n="solid",label:c,className:u="",...b}){const k=(h,y)=>{const m="checkbox-input size-4 shrink-0 rounded transition-all duration-300 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-opacity-50 disabled:cursor-not-allowed disabled:opacity-50";if(h==="outline")switch(y){case"primary":return`${m} checkbox-outline checkbox-primary`;case"secondary":default:return`${m} checkbox-outline checkbox-secondary`}else switch(y){case"primary":return`${m} checkbox-solid checkbox-primary`;case"secondary":default:return`${m} checkbox-solid checkbox-secondary`}};return c?s.jsxs("div",{className:`flex items-center gap-2 ${u}`,children:[s.jsx("input",{id:e,name:r,type:"checkbox",checked:t,onChange:o,disabled:a,required:l,className:k(n,i),...b}),s.jsxs("label",{htmlFor:e,className:"text-sm text-text cursor-pointer font-medium",children:[c,l&&s.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}):s.jsx("input",{id:e,name:r,type:"checkbox",checked:t,onChange:o,disabled:a,required:l,className:`${k(n,i)} ${u}`,style:{accentColor:"white"},...b})}const{Input:Zr,InputArea:Xr}=Ce;exports.Badge=Jr;exports.Button=Y;exports.Calendar=Wr;exports.Checkbox=qr;exports.Dropdown=Ur;exports.EN_DEFAULT_DAY_NAMES=ze;exports.EN_DEFAULT_MONTH_NAMES=Ae;exports.ES_DEFAULT_DAY_NAMES=De;exports.ES_DEFAULT_MONTH_NAMES=Pe;exports.ExpandableCard=Fr;exports.FileDropZone=Yr;exports.Input=Zr;exports.InputArea=Xr;exports.Loader=Ne;exports.Login=kr;exports.Modal=Kr;exports.Pagination=Or;exports.SearchInput=Pr;exports.TabPanel=Rr;exports.Table=Hr;exports.Tabs=Vr;exports.ThemeProvider=fr;exports.Toggle=wr;exports.cn=d;exports.defaultTheme=T;exports.generateColorVariants=re;exports.hexToHsl=ke;exports.hslToHex=le;exports.useDebounce=Ee;exports.useIsMobile=Ar;exports.useTheme=gr;exports.useToast=Dr;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),v=require("react"),Ie=require("react-loader-spinner"),Oe=require("react-dom"),Q=require("react-toastify");function he(e){var r,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(r=0;r<n;r++)e[r]&&(t=he(e[r]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function _e(){for(var e,r,t=0,o="",n=arguments.length;t<n;t++)(e=arguments[t])&&(r=he(e))&&(o&&(o+=" "),o+=r);return o}const ce="-",$e=e=>{const r=Fe(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{const a=i.split(ce);return a[0]===""&&a.length!==1&&a.shift(),xe(a,r)||Re(i)},getConflictingClassGroupIds:(i,a)=>{const d=t[i]||[];return a&&o[i]?[...d,...o[i]]:d}}},xe=(e,r)=>{if(e.length===0)return r.classGroupId;const t=e[0],o=r.nextPart.get(t),n=o?xe(e.slice(1),o):void 0;if(n)return n;if(r.validators.length===0)return;const l=e.join(ce);return r.validators.find(({validator:i})=>i(l))?.classGroupId},de=/^\[(.+)\]$/,Re=e=>{if(de.test(e)){const r=de.exec(e)[1],t=r?.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},Fe=e=>{const{theme:r,prefix:t}=e,o={nextPart:new Map,validators:[]};return Be(Object.entries(e.classGroups),t).forEach(([l,i])=>{le(i,o,l,r)}),o},le=(e,r,t,o)=>{e.forEach(n=>{if(typeof n=="string"){const l=n===""?r:ue(r,n);l.classGroupId=t;return}if(typeof n=="function"){if(Ve(n)){le(n(o),r,t,o);return}r.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(([l,i])=>{le(i,ue(r,l),t,o)})})},ue=(e,r)=>{let t=e;return r.split(ce).forEach(o=>{t.nextPart.has(o)||t.nextPart.set(o,{nextPart:new Map,validators:[]}),t=t.nextPart.get(o)}),t},Ve=e=>e.isThemeGetter,Be=(e,r)=>r?e.map(([t,o])=>{const n=o.map(l=>typeof l=="string"?r+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([i,a])=>[r+i,a])):l);return[t,n]}):e,Ge=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=new Map,o=new Map;const n=(l,i)=>{t.set(l,i),r++,r>e&&(r=0,o=t,t=new Map)};return{get(l){let i=t.get(l);if(i!==void 0)return i;if((i=o.get(l))!==void 0)return n(l,i),i},set(l,i){t.has(l)?t.set(l,i):n(l,i)}}},ye="!",We=e=>{const{separator:r,experimentalParseClassName:t}=e,o=r.length===1,n=r[0],l=r.length,i=a=>{const d=[];let u=0,b=0,j;for(let p=0;p<a.length;p++){let w=a[p];if(u===0){if(w===n&&(o||a.slice(p,p+l)===r)){d.push(a.slice(b,p)),b=p+l;continue}if(w==="/"){j=p;continue}}w==="["?u++:w==="]"&&u--}const h=d.length===0?a:a.substring(b),y=h.startsWith(ye),m=y?h.substring(1):h,x=j&&j>b?j-b:void 0;return{modifiers:d,hasImportantModifier:y,baseClassName:m,maybePostfixModifierPosition:x}};return t?a=>t({className:a,parseClassName:i}):i},He=e=>{if(e.length<=1)return e;const r=[];let t=[];return e.forEach(o=>{o[0]==="["?(r.push(...t.sort(),o),t=[]):t.push(o)}),r.push(...t.sort()),r},Ue=e=>({cache:Ge(e.cacheSize),parseClassName:We(e),...$e(e)}),Ye=/\s+/,Je=(e,r)=>{const{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:n}=r,l=[],i=e.trim().split(Ye);let a="";for(let d=i.length-1;d>=0;d-=1){const u=i[d],{modifiers:b,hasImportantModifier:j,baseClassName:h,maybePostfixModifierPosition:y}=t(u);let m=!!y,x=o(m?h.substring(0,y):h);if(!x){if(!m){a=u+(a.length>0?" "+a:a);continue}if(x=o(h),!x){a=u+(a.length>0?" "+a:a);continue}m=!1}const p=He(b).join(":"),w=j?p+ye:p,f=w+x;if(l.includes(f))continue;l.push(f);const L=n(x,m);for(let z=0;z<L.length;++z){const S=L[z];l.push(w+S)}a=u+(a.length>0?" "+a:a)}return a};function Ke(){let e=0,r,t,o="";for(;e<arguments.length;)(r=arguments[e++])&&(t=we(r))&&(o&&(o+=" "),o+=t);return o}const we=e=>{if(typeof e=="string")return e;let r,t="";for(let o=0;o<e.length;o++)e[o]&&(r=we(e[o]))&&(t&&(t+=" "),t+=r);return t};function qe(e,...r){let t,o,n,l=i;function i(d){const u=r.reduce((b,j)=>j(b),e());return t=Ue(u),o=t.cache.get,n=t.cache.set,l=a,a(d)}function a(d){const u=o(d);if(u)return u;const b=Je(d,t);return n(d,b),b}return function(){return l(Ke.apply(null,arguments))}}const P=e=>{const r=t=>t[e]||[];return r.isThemeGetter=!0,r},ve=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ze=/^\d+\/\d+$/,Xe=new Set(["px","full","screen"]),Qe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,er=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=e=>Z(e)||Xe.has(e)||Ze.test(e),W=e=>X(e,"length",ur),Z=e=>!!e&&!Number.isNaN(Number(e)),ne=e=>X(e,"number",Z),ee=e=>!!e&&Number.isInteger(Number(e)),or=e=>e.endsWith("%")&&Z(e.slice(0,-1)),N=e=>ve.test(e),H=e=>Qe.test(e),nr=new Set(["length","size","percentage"]),ar=e=>X(e,nr,je),lr=e=>X(e,"position",je),ir=new Set(["image","url"]),cr=e=>X(e,ir,mr),dr=e=>X(e,"",pr),re=()=>!0,X=(e,r,t)=>{const o=ve.exec(e);return o?o[1]?typeof r=="string"?o[1]===r:r.has(o[1]):t(o[2]):!1},ur=e=>er.test(e)&&!rr.test(e),je=()=>!1,pr=e=>tr.test(e),mr=e=>sr.test(e),br=()=>{const e=P("colors"),r=P("spacing"),t=P("blur"),o=P("brightness"),n=P("borderColor"),l=P("borderRadius"),i=P("borderSpacing"),a=P("borderWidth"),d=P("contrast"),u=P("grayscale"),b=P("hueRotate"),j=P("invert"),h=P("gap"),y=P("gradientColorStops"),m=P("gradientColorStopPositions"),x=P("inset"),p=P("margin"),w=P("opacity"),f=P("padding"),L=P("saturate"),z=P("scale"),S=P("sepia"),D=P("skew"),g=P("space"),I=P("translate"),$=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto",N,r],E=()=>[N,r],C=()=>["",G,W],A=()=>["auto",Z,N],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],k=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",N],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Z,N];return{cacheSize:500,separator:":",theme:{colors:[re],spacing:[G,W],blur:["none","",H,N],brightness:F(),borderColor:[e],borderRadius:["none","","full",H,N],borderSpacing:E(),borderWidth:C(),contrast:F(),grayscale:M(),hueRotate:F(),invert:M(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[or,W],inset:Y(),margin:Y(),opacity:F(),padding:E(),saturate:F(),scale:F(),sepia:M(),skew:F(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[H]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:[...V(),N]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ee,N]}],basis:[{basis:Y()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",ee,N]}],"grid-cols":[{"grid-cols":[re]}],"col-start-end":[{col:["auto",{span:["full",ee,N]},N]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[re]}],"row-start-end":[{row:["auto",{span:[ee,N]},N]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[g]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[g]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,r]}],"min-w":[{"min-w":[N,r,"min","max","fit"]}],"max-w":[{"max-w":[N,r,"none","full","min","max","fit","prose",{screen:[H]},H]}],h:[{h:[N,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,r,"auto","min","max","fit"]}],"font-size":[{text:["base",H,W]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ne]}],"font-family":[{font:[re]}],"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",N]}],"line-clamp":[{"line-clamp":["none",Z,ne]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",G,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",G,W]}],"underline-offset":[{"underline-offset":["auto",G,N]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],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",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),lr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ar]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},cr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[..._(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:_()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[G,N]}],"outline-w":[{outline:[G,W]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[G,W]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",H,dr]}],"shadow-color":[{shadow:[re]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",H,N]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[j]}],saturate:[{saturate:[L]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[j]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[L]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[ee,N]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],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","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[G,W,ne]}],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","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"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-b","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-b":["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-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","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"]}}},gr=qe(br);function c(...e){return gr(_e(e))}function ke(e){const r=parseInt(e.slice(1,3),16)/255,t=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,n=Math.max(r,t,o),l=Math.min(r,t,o);let i=0,a=0;const d=(n+l)/2;if(n!==l){const u=n-l;switch(a=d>.5?u/(2-n-l):u/(n+l),n){case r:i=((t-o)/u+(t<o?6:0))/6;break;case t:i=((o-r)/u+2)/6;break;case o:i=((r-t)/u+4)/6;break}}return[i*360,a*100,d*100]}function ie(e,r,t){t/=100;const o=r*Math.min(t,1-t)/100,n=l=>{const i=(l+e/30)%12,a=t-o*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*a).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`}function te(e){const[r,t,o]=ke(e);return{base:e,light:ie(r,Math.max(0,t-10),Math.min(100,o+15)),dark:ie(r,Math.min(100,t+10),Math.max(0,o-15))}}const O={colors:{primary:"#6366f1",primaryLight:"#818cf8",primaryDark:"#4f46e5",secondary:"#8b5cf6",secondaryLight:"#a78bfa",secondaryDark:"#7c3aed",danger:"#ef4444",dangerLight:"#f87171",dangerDark:"#dc2626",text:"#1f2937",textMuted:"#6b7280",textLight:"#9ca3af",border:"#e5e7eb",borderDark:"#d1d5db",background:"#ffffff",backgroundDark:"#f9fafb",backgroundLight:"#f3f4f6",disabled:"#e5e7eb",light:"#f9fafb",active:"#4338ca"}},Ne=v.createContext(O);function fr(){return v.useContext(Ne)}function pe(e){const r=document.documentElement;r.style.setProperty("--componentables-primary",e.colors.primary),r.style.setProperty("--componentables-primary-light",e.colors.primaryLight),r.style.setProperty("--componentables-primary-dark",e.colors.primaryDark),r.style.setProperty("--componentables-secondary",e.colors.secondary),r.style.setProperty("--componentables-secondary-light",e.colors.secondaryLight),r.style.setProperty("--componentables-secondary-dark",e.colors.secondaryDark),r.style.setProperty("--componentables-danger",e.colors.danger),r.style.setProperty("--componentables-danger-light",e.colors.dangerLight),r.style.setProperty("--componentables-danger-dark",e.colors.dangerDark),r.style.setProperty("--componentables-text",e.colors.text),r.style.setProperty("--componentables-text-muted",e.colors.textMuted),r.style.setProperty("--componentables-text-light",e.colors.textLight),r.style.setProperty("--componentables-border",e.colors.border),r.style.setProperty("--componentables-border-dark",e.colors.borderDark),r.style.setProperty("--componentables-background",e.colors.background),r.style.setProperty("--componentables-background-dark",e.colors.backgroundDark),r.style.setProperty("--componentables-background-light",e.colors.backgroundLight),r.style.setProperty("--componentables-disabled",e.colors.disabled),r.style.setProperty("--componentables-light",e.colors.light),r.style.setProperty("--componentables-active",e.colors.active)}function hr({children:e,theme:r}){const t=v.useMemo(()=>{const o=r?.colors||{},n=o.primary?te(o.primary):null,l=o.secondary?te(o.secondary):null,i=o.danger?te(o.danger):null;return{colors:{primary:o.primary||O.colors.primary,primaryLight:n?.light||O.colors.primaryLight,primaryDark:n?.dark||O.colors.primaryDark,secondary:o.secondary||O.colors.secondary,secondaryLight:l?.light||O.colors.secondaryLight,secondaryDark:l?.dark||O.colors.secondaryDark,danger:o.danger||O.colors.danger,dangerLight:i?.light||O.colors.dangerLight,dangerDark:i?.dark||O.colors.dangerDark,text:o.text||O.colors.text,textMuted:o.textMuted||O.colors.textMuted,textLight:o.textLight||O.colors.textLight,border:o.border||O.colors.border,borderDark:o.borderDark||O.colors.borderDark,background:o.background||O.colors.background,backgroundDark:o.backgroundDark||O.colors.backgroundDark,backgroundLight:o.backgroundLight||O.colors.backgroundLight,disabled:o.disabled||O.colors.disabled,light:o.light||O.colors.light,active:o.active||O.colors.active}}},[r]);return typeof window<"u"&&pe(t),v.useEffect(()=>{pe(t)},[t]),v.createElement(Ne.Provider,{value:t},e)}const xr={primary:"bg-primary text-white border-primary hover:bg-primary-dark hover:border-primary-dark active:bg-active",secondary:"bg-secondary text-white border-secondary hover:bg-secondary-dark hover:border-secondary-dark","primary-outline":"bg-transparent text-primary border-primary hover:bg-primary hover:text-white","secondary-outline":"bg-transparent text-secondary border-secondary hover:bg-secondary hover:text-white",ghost:"bg-transparent text-primary border-transparent hover:bg-primary hover:text-white hover:border-primary",light:"bg-light text-text border-border hover:bg-background-light",danger:"bg-transparent text-danger border-danger hover:text-white hover:bg-danger hover:border-danger active:bg-danger-dark",link:"bg-transparent text-secondary-light! underline hover:text-primary! border-0",dark:"bg-gray-800 text-white border-gray-800 hover:bg-gray-900 hover:border-gray-900"},yr={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",xl:"px-8 py-4 text-xl"};function J({children:e,onClick:r,disabled:t=!1,type:o="button",variant:n="primary",size:l="md",fullWidth:i=!1,loading:a=!1,className:d="",...u}){return s.jsxs("button",{type:o,onClick:t||a?void 0:r,disabled:t||a,className:c("inline-flex shadow-md hover:shadow-lg cursor-pointer items-center justify-center font-medium rounded-lg border transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50",t||a?"bg-disabled text-text-muted border-disabled cursor-not-allowed hover:bg-disabled hover:border-disabled hover:text-text-muted":xr[n],yr[l],i&&"w-full",a&&"cursor-wait opacity-75",d),...u,children:[a&&s.jsxs("svg",{className:"w-4 h-4 mr-2 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e]})}function wr({id:e,name:r,type:t="text",value:o,onChange:n,placeholder:l,label:i,error:a,disabled:d=!1,required:u=!1,colorScheme:b="secondary",className:j="",...h}){const y=()=>{const x="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted";if(a)return c(x,"border-danger focus:border-danger focus:shadow-danger-light");switch(b){case"primary":return c(x,"text-primary border-primary focus:border-primary");case"secondary":default:return c(x,"text-secondary border-secondary focus:border-secondary")}},m=()=>b==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:c("mb-6",j),children:[i&&s.jsxs("label",{htmlFor:e,className:c("block mb-2 text-sm font-medium",m()),children:[i,u&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsx("input",{id:e,name:r,type:t,value:o,onChange:n,placeholder:l,disabled:d,required:u,className:y(),...h}),a&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:a})]})}function vr({id:e,name:r,value:t,onChange:o,placeholder:n,label:l,error:i,disabled:a=!1,required:d=!1,colorScheme:u="secondary",className:b="",rows:j=4,...h}){const y=()=>{const x="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted resize-none";if(i)return c(x,"border-danger focus:border-danger focus:shadow-danger-light");switch(u){case"primary":return c(x,"text-primary border-primary focus:border-primary");case"secondary":default:return c(x,"text-secondary border-secondary focus:border-secondary")}},m=()=>u==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:c("mb-6",b),children:[l&&s.jsxs("label",{htmlFor:e,className:c("block mb-2 text-sm font-medium",m()),children:[l,d&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsx("textarea",{id:e,name:r,value:t,onChange:o,placeholder:n,disabled:a,required:d,rows:j,className:y(),...h}),i&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:i})]})}const Ce={Input:wr,InputArea:vr};function jr({id:e,name:r,checked:t=!1,onChange:o,disabled:n=!1,label:l,colorScheme:i="secondary",size:a="md",className:d="",...u}){const[b,j]=v.useState(t);v.useEffect(()=>{j(t)},[t]);const h=()=>{if(n)return;const f=!b;j(f),o?.(f)},y=()=>({primary:{bg:"bg-primary",border:"border-primary",text:"text-primary"},secondary:{bg:"bg-secondary",border:"border-secondary",text:"text-secondary"}})[i],m=()=>{switch(a){case"sm":return"w-10 h-6";case"lg":return"w-16 h-8";case"md":default:return"w-13 h-7"}},x=()=>{switch(a){case"sm":return"w-5 h-5";case"lg":return"w-7 h-7";case"md":default:return"w-6 h-6"}},p=()=>{if(!b)return"translate-x-0";switch(a){case"sm":return"translate-x-5";case"lg":return"translate-x-8";case"md":default:return"translate-x-6"}},w=y();return s.jsxs("div",{className:c("flex items-center gap-3",n?"cursor-not-allowed":"cursor-pointer",d),onClick:h,children:[s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:"checkbox",id:e,name:r,checked:b,onChange:()=>{},disabled:n,className:"sr-only","aria-label":l||r,...u}),s.jsx("div",{className:c("block transition-all duration-300 rounded-full border-2",m(),b?c(w.bg,w.border):"bg-gray-200 border-gray-300",n?"opacity-50":"hover:shadow-md"),children:s.jsx("span",{className:c("absolute top-0.5 left-0.5 inline-block rounded-full bg-white transition-all duration-300 shadow-sm",x(),p())})})]}),l&&s.jsx("span",{className:c("text-sm font-medium select-none",w.text,n&&"opacity-50"),children:l})]})}const Se=({size:e=40,wrapperStyle:r={},wrapperClass:t="",ariaLabel:o="Cargando...",label:n="Cargando...",visible:l=!0,direction:i="column"})=>{const a={display:"flex",flexDirection:i,justifyContent:"center",alignItems:"center",minHeight:"100px",...r};return s.jsxs("div",{style:a,className:t,children:[s.jsx("label",{children:n}),s.jsx(Ie.Oval,{visible:l,height:e,width:e,ariaLabel:o,wrapperStyle:{},wrapperClass:"",secondaryColor:"#cdae90",color:"#cdae90"})]})},{Input:ae}=Ce,kr=({title:e="Iniciar Sesión",showForgotPassword:r=!0,onlyForgotPassword:t=!1,className:o="",onLogin:n,onForgotPassword:l})=>{const[i,a]=v.useState({email:"",password:""}),[d,u]=v.useState({}),[b,j]=v.useState(!1),[h,y]=v.useState(t?"forgot":"login"),m=(D,g)=>{switch(D){case"email":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(g)?"":"Por favor ingresa un email válido";case"password":return g.length>=6?"":"La contraseña debe tener al menos 6 caracteres";default:return""}},x=D=>{const{name:g,value:I}=D.target;a($=>({...$,[g]:I})),d[g]&&u($=>({...$,[g]:""}))},p=()=>{const D={},g=m("email",i.email);if(g&&(D.email=g),h==="login"){const I=m("password",i.password);I&&(D.password=I)}return u(D),Object.keys(D).length===0},w=async D=>{if(D.preventDefault(),!!p()){j(!0);try{switch(h){case"login":n&&await n({email:i.email,password:i.password});break;case"forgot":l&&await l(i.email);break}}catch(g){console.error("Login error:",g)}finally{j(!1)}}},f=D=>{y(D),u({}),a({email:i.email,password:""})},L=()=>{switch(h){case"forgot":return s.jsx(ae,{id:"email",type:"email",name:"email",placeholder:"Ingresa tu email",label:"Email",value:i.email,onChange:x,error:d.email,disabled:b,colorScheme:"secondary"});default:return s.jsxs(s.Fragment,{children:[s.jsx(ae,{id:"email",type:"email",name:"email",placeholder:"Ingresa tu email",label:"Email",value:i.email,onChange:x,error:d.email,disabled:b,colorScheme:"secondary"}),s.jsx(ae,{id:"password",type:"password",name:"password",placeholder:"Ingresa tu contraseña",label:"Contraseña",value:i.password,onChange:x,error:d.password,disabled:b,colorScheme:"secondary"})]})}},z=()=>{switch(h){case"forgot":return t?"Cambiar Contraseña":"Recuperar Contraseña";default:return e}},S=()=>{if(b)return s.jsx(Se,{size:20,wrapperStyle:{minHeight:"auto"}});switch(h){case"forgot":return"Enviar Enlace";default:return"Entrar"}};return s.jsx("div",{className:`flex justify-center items-center min-h-[90vh] p-6 bg-background sm:p-4 ${o||""}`,children:s.jsxs("div",{className:"w-full max-w-100 p-12 bg-white rounded-2xl shadow-lg animate-[fadeIn_0.3s_ease-out] sm:p-8",children:[s.jsx("h2",{className:"text-center mb-12 text-3xl font-semibold text-primary sm:text-2xl sm:mb-8",children:z()}),s.jsxs("form",{onSubmit:w,children:[s.jsx("div",{className:"space-y-4 mb-6",children:L()}),s.jsx(J,{type:"submit",disabled:b,loading:b,fullWidth:!0,variant:"primary",size:"lg",className:"mb-6",children:!b&&S()})]}),h==="login"&&r&&s.jsx(J,{type:"button",onClick:()=>f("forgot"),variant:"link",size:"sm",fullWidth:!0,className:"shadow-none! !hover:shadow-none",children:"¿Olvidaste tu contraseña?"}),h==="forgot"&&!t&&s.jsx(J,{type:"button",onClick:()=>f("login"),variant:"link",size:"sm",fullWidth:!0,className:"shadow-none! !hover:shadow-none",children:"Volver al inicio de sesión"})]})})};var Me={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},me=v.createContext&&v.createContext(Me),Nr=["attr","size","title"];function Cr(e,r){if(e==null)return{};var t=Sr(e,r),o,n;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)o=l[n],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}function Sr(e,r){if(e==null)return{};var t={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},se.apply(this,arguments)}function be(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function oe(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?be(Object(t),!0).forEach(function(o){Mr(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):be(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function Mr(e,r,t){return r=Lr(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Lr(e){var r=Er(e,"string");return typeof r=="symbol"?r:r+""}function Er(e,r){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var o=t.call(e,r);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Le(e){return e&&e.map((r,t)=>v.createElement(r.tag,oe({key:t},r.attr),Le(r.child)))}function U(e){return r=>v.createElement(zr,se({attr:oe({},e.attr)},r),Le(e.child))}function zr(e){var r=t=>{var{attr:o,size:n,title:l}=e,i=Cr(e,Nr),a=n||t.size||"1em",d;return t.className&&(d=t.className),e.className&&(d=(d?d+" ":"")+e.className),v.createElement("svg",se({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,i,{className:d,style:oe(oe({color:e.color||t.color},t.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),l&&v.createElement("title",null,l),e.children)};return me!==void 0?v.createElement(me.Consumer,null,t=>r(t)):r(Me)}function Dr(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},child:[]}]})(e)}const Ee=(e,r=500)=>{const[t,o]=v.useState(e);return v.useEffect(()=>{const n=setTimeout(()=>{o(e)},r);return()=>clearTimeout(n)},[e,r]),t},Ar=()=>({showToast:(r,t)=>{const o={position:"bottom-right",autoClose:2e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!1,progress:void 0};switch(r){case"success":Q.toast.success(t,o);break;case"error":Q.toast.error(t,o);break;case"warning":Q.toast.warning(t,o);break;case"info":Q.toast.info(t,o);break;default:Q.toast(t,o);break}}});function Pr(e=768){const[r,t]=v.useState(()=>typeof window>"u"?!1:window.innerWidth<e);return v.useEffect(()=>{if(typeof window>"u")return;const o=()=>{t(window.innerWidth<e)};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[e]),r}function Tr({value:e,onChange:r,placeholder:t="Search...",disabled:o=!1,colorScheme:n="secondary",label:l,className:i="",debounceDelay:a=500,...d}){const[u,b]=v.useState(e||""),j=Ee(u,a),h=v.useCallback(r,[r]);v.useEffect(()=>{h(j)},[j,h]);const y=()=>{const p="w-full px-4 py-2.5 pl-10 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted";switch(n){case"primary":return c(p,"text-primary border-primary focus:border-primary");case"secondary":default:return c(p,"text-secondary border-secondary focus:border-secondary")}},m=()=>n==="primary"?"text-primary":"text-secondary",x=()=>n==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:c("mb-0",i),children:[l&&s.jsx("label",{className:c("block mb-2 text-sm font-medium",x()),children:l}),s.jsxs("div",{className:"relative w-full",children:[s.jsx(Dr,{className:c("absolute left-3 top-1/2 -translate-y-1/2 text-base pointer-events-none",m())}),s.jsx("input",{type:"text",value:u,onChange:p=>b(p.target.value),placeholder:t,disabled:o,className:y(),...d})]})]})}function Ir(e){return U({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function Or(e){return U({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(e)}function _r({labelPage:e="Page",labelOf:r="of",setPagination:t,totalPages:o,currentPage:n,showLabel:l=!0,className:i="",isLoading:a=!1,fetchPage:d}){const u=parseInt(String(n))===1||parseInt(String(o))===0||a,b=parseInt(String(n))===parseInt(String(o))||parseInt(String(o))===0||a,j=()=>{a||(d?d(n-1):t&&t(y=>({...y,page:y.page-1})))},h=()=>{a||(d?d(n+1):t&&t(y=>({...y,page:y.page+1})))};return s.jsxs("div",{className:c("flex justify-center items-center mt-8",i),children:[s.jsx(J,{disabled:u,onClick:j,variant:"secondary",children:s.jsx(Ir,{size:14})}),s.jsx("h5",{className:"font-bold mx-2.5 text-text",children:`${l?e:""} ${n}${l?` ${r} `:" / "}${o}`}),s.jsx(J,{disabled:b,onClick:h,variant:"primary",children:s.jsx(Or,{size:14})})]})}function ze(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(e)}function $r(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function Rr(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M456.69 421.39 362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8 124.95 124.95 0 0 1-124.8-124.8z"},child:[]}]})(e)}function Fr({title:e,subtitle:r,children:t,defaultExpanded:o=!1,expanded:n,onToggle:l,className:i="",colorScheme:a="primary",icon:d,disabled:u=!1,headerExtra:b}){const[j,h]=v.useState(o),y=n!==void 0?n:j,m=()=>{if(u)return;const f=!y;n===void 0&&h(f),l?.(f)},x=()=>a==="primary"?"border-primary":"border-secondary",p=()=>a==="primary"?"text-primary":"text-secondary",w=()=>a==="primary"?"hover:bg-primary/5":"hover:bg-secondary/5";return s.jsxs("div",{className:c("w-full rounded-lg border-2 bg-background transition-all duration-300",x(),y&&"shadow-lg",i),children:[s.jsxs("button",{type:"button",onClick:m,disabled:u,className:c("w-full flex cursor-pointer items-center justify-between p-4 text-left transition-all duration-300 rounded-lg",!u&&w(),u&&"opacity-50"),"aria-expanded":y,children:[s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[d&&s.jsx("div",{className:c("shrink-0",p()),children:d}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:c("text-base font-medium truncate",p()),children:e}),r&&s.jsx("p",{className:"text-sm text-text-muted truncate mt-0.5",children:r})]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[b&&s.jsx("div",{onClick:f=>f.stopPropagation(),children:b}),s.jsx("div",{className:c("h-5 w-5 transition-transform duration-300",p(),y&&"rotate-180"),children:s.jsx(ze,{className:"h-5 w-5"})})]})]}),s.jsx("div",{className:c("overflow-hidden transition-all duration-300 ease-in-out",y?"max-h-500 opacity-100":"max-h-0 opacity-0"),children:s.jsx("div",{className:c("p-4 pt-0 border-t-0",x()),children:s.jsx("div",{className:"border-t border-border pt-4",children:t})})})]})}function Vr({children:e,className:r=""}){return s.jsx("div",{className:c("py-4",r),children:e})}function Br({options:e,value:r,onChange:t,children:o,className:n="",colorScheme:l="primary",variant:i="underline"}){const[a,d]=v.useState(r??e[0]?.value??""),u=r!==void 0?r:a,b=m=>{r===void 0&&d(m),t?.(m)},j=(m,x)=>{const p=u===m,w="px-4 py-3 cursor-pointer text-sm font-medium transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed";if(x)return c(w,"text-text-muted");switch(i){case"filled":return c(w,"rounded-lg",p?l==="primary"?"bg-primary text-white":"bg-secondary text-white":"text-text-muted hover:bg-background-light");case"pills":return c(w,"rounded-full",p?l==="primary"?"bg-primary/10 text-primary border-2 border-primary":"bg-secondary/10 text-secondary border-2 border-secondary":"text-text-muted hover:bg-background-light border-2 border-transparent");case"underline":default:return c(w,"border-b-2 flex items-center gap-2",p?l==="primary"?"border-primary text-primary":"border-secondary text-secondary":"border-transparent text-gray-500 hover:text-gray-700")}},h=()=>{switch(i){case"filled":return"flex gap-1 p-1 bg-background-light rounded-lg";case"pills":return"flex gap-2 flex-wrap";case"underline":default:return"flex gap-2 border-b border-gray-200"}},y=v.Children.toArray(o).find(m=>v.isValidElement(m)?m.props.value===u:!1);return s.jsxs("div",{className:c("w-full",n),children:[s.jsx("div",{className:h(),role:"tablist",children:e.map(m=>s.jsxs("button",{type:"button",role:"tab","aria-selected":u===m.value,"aria-controls":`tabpanel-${m.value}`,disabled:m.disabled,onClick:()=>!m.disabled&&b(m.value),className:j(m.value,m.disabled),children:[m.icon&&s.jsx("span",{className:"shrink-0",children:m.icon}),m.label]},m.value))}),s.jsx("div",{role:"tabpanel",id:`tabpanel-${u}`,children:y})]})}function ge(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"},child:[]}]})(e)}function fe(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},child:[]}]})(e)}const De=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ae=["Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],Pe=["January","February","March","April","May","June","July","August","September","October","November","December"],Te=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];function Gr(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function Wr(e){const r=new Date(e.getFullYear(),e.getMonth(),1).getDay();return r===0?6:r-1}function Hr({value:e,onChange:r,disabled:t=!1,className:o="",colorScheme:n="secondary",lang:l="en",...i}){const[a,d]=v.useState(e||new Date),u={en:"en-US",es:"es-ES"},b={en:De,es:Ae},j={en:Pe,es:Te},h=Gr(a),y=Wr(a),m=[];for(let g=0;g<y;g++)m.push(null);for(let g=1;g<=h;g++){const I=new Date(a.getFullYear(),a.getMonth(),g,12,0,0);m.push(I)}const x=()=>{d(new Date(a.getFullYear(),a.getMonth()-1,1,12,0,0))},p=()=>{d(new Date(a.getFullYear(),a.getMonth()+1,1,12,0,0))},w=()=>{d(new Date(a.getFullYear()-1,a.getMonth(),1,12,0,0))},f=()=>{d(new Date(a.getFullYear()+1,a.getMonth(),1,12,0,0))},L=g=>{if(g&&!t){const I=new Date(g.getFullYear(),g.getMonth(),g.getDate(),12,0,0);d(I),r?.(I)}},S=(()=>{switch(n){case"primary":return{header:"text-primary",selected:"bg-primary text-white",hover:"hover:bg-primary/10",button:"text-primary border-primary hover:bg-primary/20"};case"secondary":default:return{header:"text-secondary",selected:"bg-secondary text-white",hover:"hover:bg-secondary/10",button:"text-secondary border-secondary hover:bg-secondary/20"}}})(),D=g=>g&&e?g.toDateString()===e.toDateString():!1;return s.jsxs("div",{className:c("w-full max-w-sm bg-background border-2 border-border rounded-lg p-6 shadow-md",o),...i,children:[s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:c("flex items-center justify-between mb-4",S.header),children:[s.jsx("button",{type:"button",onClick:w,disabled:t,className:c("p-2 rounded-lg border transition-all duration-300",S.button,t&&"opacity-50 cursor-not-allowed"),children:s.jsx(ge,{size:18})}),s.jsx("h2",{className:"font-semibold text-lg",children:a.getFullYear()}),s.jsx("button",{type:"button",onClick:f,disabled:t,className:c("p-2 rounded-lg border transition-all duration-300",S.button,t&&"opacity-50 cursor-not-allowed"),children:s.jsx(fe,{size:18})})]}),s.jsxs("div",{className:c("flex items-center justify-between",S.header),children:[s.jsx("button",{type:"button",onClick:x,disabled:t,className:c("p-2 rounded-lg border transition-all duration-300",S.button,t&&"opacity-50 cursor-not-allowed"),children:s.jsx(ge,{size:18})}),s.jsx("h2",{className:"font-semibold text-lg",children:j[l][a.getMonth()]}),s.jsx("button",{type:"button",onClick:p,disabled:t,className:c("p-2 rounded-lg border transition-all duration-300",S.button,t&&"opacity-50 cursor-not-allowed"),children:s.jsx(fe,{size:18})})]})]}),s.jsx("div",{className:"grid grid-cols-7 gap-2 mb-4",children:b[l].map(g=>s.jsx("div",{className:c("text-center text-sm font-medium py-2",S.header),children:g},g))}),s.jsx("div",{className:"grid grid-cols-7 gap-2",children:m.map((g,I)=>s.jsx("button",{type:"button",onClick:()=>L(g),disabled:!g||t,className:c("p-2 rounded-lg text-sm font-medium transition-all duration-300",g?c("cursor-pointer",S.hover,D(g)?S.selected:"text-text border border-transparent hover:border-border",t&&"opacity-50 cursor-not-allowed"):"cursor-default"),children:g?g.getDate():""},I))}),e&&s.jsx("div",{className:c("mt-6 p-3 rounded-lg bg-background-dark border border-border text-center text-sm font-medium",S.header),children:e.toLocaleDateString(u[l],{year:"numeric",month:"long",day:"numeric"})})]})}function Ur({headers:e,data:r,loading:t,loadingText:o="Loading...",actions:n,actionsHeader:l="Actions",onRowClick:i,className:a="",rowClassName:d="",cellClassName:u="",headerClassName:b="",emptyText:j="No data available",showCount:h=!0,countText:y=x=>`Showing ${x} record${x!==1?"s":""}`,keyExtractor:m=(x,p)=>x._id||x.id||p}){if(t)return s.jsx("div",{className:"flex justify-center items-center min-h-50",children:s.jsx("div",{className:"text-lg text-text-light",children:o})});if(r.length===0)return s.jsx("div",{className:"flex justify-center items-center min-h-50",children:s.jsx("div",{className:"text-lg text-text-muted",children:j})});const x=(p,w)=>{const f=w.toLowerCase().replace(/\s+/g,"_");let L=p[f];if(L===void 0){const z=[f.replace(/_/g,""),w.toLowerCase().replace(/\s+/g,""),f.replace(/_([a-z])/g,(S,D)=>D.toUpperCase())];for(const S of z)if(p[S]!==void 0){L=p[S];break}}if(L===void 0){const z=w.toLowerCase().split(" "),S=Object.keys(p).find(D=>z.some(g=>D.toLowerCase().includes(g)));S&&(L=p[S])}return L!=null?String(L):"N/A"};return s.jsxs("div",{className:c("overflow-x-auto",a),children:[s.jsxs("table",{className:"w-full border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b-2 border-border",children:[e.map((p,w)=>s.jsx("th",{className:c("text-left py-3 px-4 font-semibold text-text",b),children:p},w)),n&&s.jsx("th",{className:c("text-center py-3 px-4 font-semibold text-text",b),children:l})]})}),s.jsx("tbody",{children:r.map((p,w)=>s.jsxs("tr",{className:c("border-b border-border-dark hover:bg-background-light transition-colors",i&&"cursor-pointer",d),onClick:()=>i?.(p),children:[e.map((f,L)=>s.jsx("td",{className:c("py-4 px-4",u),children:s.jsx("div",{className:"text-text-light",children:x(p,f)})},L)),n&&s.jsx("td",{className:c("py-4 px-4",u),children:s.jsx("div",{className:"flex gap-2 justify-center",children:n.map((f,L)=>{const z=S=>{S?.stopPropagation(),f.onClick?.(p)};if(f.component){const S=f.component;return s.jsxs(S,{onClick:z,className:f.className||"",...f.props||{},children:[f.icon&&s.jsx("span",{className:"inline-block",children:v.createElement(f.icon)}),f.label&&f.label]},L)}return s.jsxs(J,{onClick:z,className:f.className||"",...f.props||{},children:[f.icon&&s.jsx("span",{className:"inline-block",children:v.createElement(f.icon)}),f.label&&f.label]},L)})})})]},m(p,w)))})]}),h&&r.length>0&&s.jsx("div",{className:"mt-6 text-center text-text-light text-sm",children:y(r.length)})]})}function Yr({label:e,options:r,value:t="",onChange:o,multiple:n=!1,className:l="",searchable:i=!1,onSearchInputCustom:a,placeholder:d="Select...",disabled:u=!1,error:b,required:j=!1,colorScheme:h="primary",noResultsText:y="No results found",searchPlaceholder:m="Search...",...x}){const[p,w]=v.useState(!1),[f,L]=v.useState(""),[z,S]=v.useState({top:0,left:0,openUpward:!1}),D=Array.isArray(t)?t:t?[t]:[],[g,I]=v.useState(D.map(k=>r.find(M=>M.value===k)).filter(Boolean)),$=v.useRef(null),B=v.useRef(null),Y=()=>{const k="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed";if(b)return c(k,"border-danger focus:border-danger");switch(h){case"primary":return c(k,"text-primary border-primary focus:border-primary");case"secondary":default:return c(k,"text-secondary border-secondary focus:border-secondary")}},E=()=>h==="primary"?"text-primary":"text-secondary";v.useEffect(()=>{const M=(Array.isArray(t)?t:t!==""&&t!==null&&t!==void 0?[t]:[]).map(R=>r.find(F=>F.value===R)).filter(Boolean);I(M)},[t,r]),v.useEffect(()=>{p&&i&&B.current&&B.current.focus()},[p,i]);const C=v.useCallback(()=>{if(!$.current)return;const k=$.current.getBoundingClientRect(),M=window.innerHeight,R=250,q=M-k.bottom<R&&k.top>R;S({top:q?k.top:k.bottom,left:k.left,width:k.width,openUpward:q})},[]);v.useEffect(()=>{function k(R){$.current&&!$.current.contains(R.target)&&w(!1)}function M(){p&&C()}return document.addEventListener("mousedown",k),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),()=>{document.removeEventListener("mousedown",k),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[p,C]);const A=k=>{const M=r.find(F=>F.value===k);if(!M)return;let R;n?(R=g.some(q=>q.value===k)?g.filter(q=>q.value!==k):[...g,M],I(R),o(R)):(R=[M],I(R),o(M),w(!1),L(""))},V=k=>{L(k),a?.(k)},_=i?r.filter(k=>k.label.toLowerCase().includes(f.toLowerCase())):r,K=()=>g.length===0?d:n?g.length===1?g[0].label:`${g.length} selected`:g[0]?.label||d;return s.jsxs("div",{className:c("mb-6",l),children:[e&&s.jsxs("label",{className:c("block mb-2 text-sm font-medium",E()),children:[e,j&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsxs("div",{ref:$,className:"relative w-full",children:[s.jsxs("button",{type:"button",onClick:k=>{k.preventDefault(),k.stopPropagation(),p||C(),w(!p)},className:c(Y(),"inline-flex items-center justify-between cursor-pointer h-auto min-h-14",u&&"cursor-not-allowed",p&&"ring-1"),disabled:u,...x,children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[g.length>0&&g[0].hex&&s.jsx("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:g[0].hex}}),s.jsx("span",{className:g.length>0?"":"text-text-muted",children:K()})]}),s.jsx("div",{className:c("h-5 w-5 transition-transform duration-200",p&&"rotate-180"),children:s.jsx(ze,{className:"h-5 w-5"})})]}),p&&s.jsxs("div",{className:c("fixed z-9999 rounded-lg border-2 bg-white shadow-xl",b?"border-danger":h==="primary"?"border-primary":"border-secondary"),style:{top:`${z.top+(z.openUpward?0:8)}px`,left:`${z.left}px`,width:`${z.width}px`,transform:z.openUpward?"translateY(-100%)":"none"},children:[i&&s.jsx("div",{className:"border-b border-border p-3",children:s.jsxs("div",{className:"relative",children:[s.jsx(Rr,{className:"absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 transform text-text-muted"}),s.jsx("input",{ref:B,type:"text",value:f,onChange:k=>V(k.target.value),placeholder:m,className:c("w-full rounded-lg border-2 py-2 pr-10 pl-10 text-sm transition-all duration-300 focus:outline-none focus:ring-1",h==="primary"?"border-primary text-primary":"border-secondary text-secondary")}),f&&s.jsx("button",{type:"button",onClick:()=>L(""),className:"absolute top-1/2 right-3 h-4 w-4 -translate-y-1/2 transform text-text-muted hover:text-text",children:s.jsx($r,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"max-h-60 overflow-y-auto py-1",children:[_.map(k=>s.jsx("button",{type:"button",onClick:()=>A(k.value??""),className:c("w-full px-4 py-3 text-left text-sm transition-colors",g.some(M=>M.value===k.value)?h==="primary"?"bg-primary/10 text-primary font-medium":"bg-secondary/10 text-secondary font-medium":"text-text hover:bg-background-light"),children:s.jsxs("div",{className:"flex items-center gap-3",children:[n&&s.jsx("div",{className:c("flex h-4 w-4 items-center justify-center rounded border-2 transition-colors",g.some(M=>M.value===k.value)?h==="primary"?"border-primary bg-primary":"border-secondary bg-secondary":"border-border"),children:g.some(M=>M.value===k.value)&&s.jsx("svg",{className:"h-3 w-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}),k.hex&&s.jsx("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:k.hex}}),s.jsx("span",{children:k.label})]})},k.value)),_.length===0&&f&&r.length>0&&s.jsx("div",{className:"px-4 py-3",children:s.jsx("span",{className:"text-sm text-text-muted",children:y})})]})]})]}),b&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:b})]})}const Jr=({id:e,name:r,onFilesSelected:t,placeholder:o="Arrastra y suelta archivos aquí o haz clic para seleccionar",labelSelectedFiles:n="archivo:",label:l,error:i,disabled:a=!1,required:d=!1,colorScheme:u="secondary",className:b="",accept:j="*/*",multiple:h=!1,...y})=>{const m=v.useRef(null),[x,p]=v.useState(!1),[w,f]=v.useState([]),L=()=>{const C="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed cursor-pointer min-h-[120px]";if(i)return c(C,"border-danger focus:border-danger focus:ring-1 focus:ring-danger");switch(u){case"primary":return c(C,"border-primary focus:border-primary focus:ring-1 focus:ring-primary hover:border-primary-dark");case"secondary":default:return c(C,"border-secondary focus:border-secondary focus:ring-1 focus:ring-secondary hover:border-secondary-dark")}},z=()=>{switch(u){case"primary":return"text-primary";case"secondary":default:return"text-secondary"}},S=C=>{C.preventDefault(),C.stopPropagation(),a||(C.type==="dragenter"||C.type==="dragover"?p(!0):C.type==="dragleave"&&p(!1))},D=C=>{if(C.preventDefault(),C.stopPropagation(),p(!1),a)return;const A=C.dataTransfer.files;I(A)},g=C=>{const A=C.target.files;A&&I(A)},I=C=>{const A=Array.from(C);if(j!=="*/*"){const V=A.filter(_=>$(_,j));if(V.length===0){console.warn("No valid files selected");return}f(h?V:[V[0]]),t(h?V:[V[0]])}else f(h?A:[A[0]]),t(h?A:[A[0]])},$=(C,A)=>A.split(",").map(_=>_.trim()).some(_=>{if(_.startsWith("."))return C.name.toLowerCase().endsWith(_.toLowerCase());if(_.includes("/")){const[K,k]=_.split("/"),M=C.type.split("/")[0];return k==="*"?M===K:C.type===_}return!1}),B=()=>{a||m.current?.click()},Y=C=>{const A=w.filter((V,_)=>_!==C);f(A),t(A)},E=C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),B())};return s.jsxs("div",{className:`mb-6 ${b}`,children:[l&&s.jsxs("label",{className:`block mb-2 text-sm font-medium ${z()}`,children:[l,d&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsxs("div",{className:c(L(),x&&"bg-background-light border-2-dashed"),onDragEnter:S,onDragLeave:S,onDragOver:S,onDrop:D,onClick:B,onKeyDown:E,role:"button",tabIndex:a?-1:0,children:[s.jsx("input",{ref:m,id:e,name:r,type:"file",onChange:g,disabled:a,required:d,accept:j,multiple:h,className:"hidden",...y}),s.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[s.jsx("svg",{className:`w-8 h-8 mb-2 ${u==="primary"?"text-primary":"text-secondary"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),s.jsx("p",{className:`text-sm ${z()}`,children:o})]})]}),s.jsxs("div",{className:"mt-4 space-y-2",children:[s.jsxs("p",{className:`text-sm font-medium ${z()}`,children:[w.length," ",n,"(s) seleccionado(s):"]}),s.jsx("ul",{className:"space-y-1",children:w.map((C,A)=>s.jsxs("li",{className:"flex items-center justify-between p-2 bg-light rounded border border-border",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[s.jsxs("svg",{className:"w-4 h-4 text-text-muted shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:[s.jsx("path",{d:"M8 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM15 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z"}),s.jsx("path",{d:"M3 4a1 1 0 00-1 1v10a1 1 0 001 1h1.05a2.5 2.5 0 014.9 0H10a1 1 0 001-1V5a1 1 0 00-1-1H3zM14 7a1 1 0 00-1 1v6.05A2.5 2.5 0 0115.95 10H17a1 1 0 001-1v-3a1 1 0 00-1-1h-3z"})]}),s.jsx("span",{className:"text-sm text-text truncate",children:C.name})]}),s.jsx("button",{onClick:V=>{V.stopPropagation(),Y(A)},className:"ml-2 text-danger hover:text-danger-dark shrink-0",type:"button",children:"✕"})]},A))})]}),i&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:i})]})},Kr=({text:e,className:r="",variant:t="default",visible:o=!0,...n})=>{if(!o)return null;const l={default:"bg-gray-200 text-gray-800",primary:"bg-primary text-white",secondary:"bg-secondary text-white",secondaryDark:"bg-secondary-dark text-white",danger:"bg-danger text-white",warning:"bg-warning text-white"},i="inline-flex items-center px-3 py-1 rounded-full text-xs font-bold uppercase shadow-md",a=l[t]||l.default;return s.jsx("div",{className:`${i} ${a} ${r}`,...n,children:e})};function qr({isOpen:e,onClose:r,title:t,children:o,size:n="md",className:l="",overlayClassName:i="",showCloseButton:a=!0,closeOnOverlayClick:d=!0,closeOnEscape:u=!0}){if(v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),v.useEffect(()=>{if(!u||!e)return;const y=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[e,r,u]),!e)return null;const b={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"},j=()=>{d&&r()},h=s.jsx("div",{className:c("fixed inset-0 bg-black/40 flex items-center justify-center z-9999 p-4",i),onClick:j,role:"dialog","aria-modal":"true","aria-labelledby":t?"modal-title":void 0,children:s.jsxs("div",{className:c("relative bg-white rounded-xl shadow-2xl max-h-[90vh] flex flex-col w-full transition-all duration-300",b[n],l),onClick:y=>y.stopPropagation(),children:[(t||a)&&s.jsxs("div",{className:"flex justify-between items-center px-6 py-5 border-b border-border rounded-t-xl shrink-0",children:[t&&s.jsx("h2",{id:"modal-title",className:"text-xl sm:text-2xl font-bold text-primary m-0",children:t}),a&&s.jsx("button",{className:"flex items-center justify-center w-8 h-8 text-text-muted hover:text-text hover:bg-background-light transition-colors duration-200 rounded-lg",onClick:r,"aria-label":"Cerrar modal",type:"button",children:s.jsx("span",{className:"text-2xl font-light leading-none",children:"×"})})]}),s.jsx("div",{className:"p-6 overflow-y-auto flex-1",children:o})]})});return Oe.createPortal(h,document.body)}function Zr({id:e,name:r,checked:t=!1,onChange:o,disabled:n=!1,required:l=!1,colorScheme:i="secondary",variant:a="solid",label:d,className:u="",...b}){const j=(h,y)=>{const m="checkbox-input size-4 shrink-0 rounded transition-all duration-300 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-opacity-50 disabled:cursor-not-allowed disabled:opacity-50";if(h==="outline")switch(y){case"primary":return`${m} checkbox-outline checkbox-primary`;case"secondary":default:return`${m} checkbox-outline checkbox-secondary`}else switch(y){case"primary":return`${m} checkbox-solid checkbox-primary`;case"secondary":default:return`${m} checkbox-solid checkbox-secondary`}};return d?s.jsxs("div",{className:`flex items-center gap-2 ${u}`,children:[s.jsx("input",{id:e,name:r,type:"checkbox",checked:t,onChange:o,disabled:n,required:l,className:j(a,i),...b}),s.jsxs("label",{htmlFor:e,className:"text-sm text-text cursor-pointer font-medium",children:[d,l&&s.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}):s.jsx("input",{id:e,name:r,type:"checkbox",checked:t,onChange:o,disabled:n,required:l,className:`${j(a,i)} ${u}`,style:{accentColor:"white"},...b})}const Xr={pulse:"cmp-skeleton-pulse",wave:"cmp-skeleton-wave",none:""},T=({className:e="",animation:r="pulse"})=>{const t=/(^|\s)rounded/.test(e);return s.jsx("div",{className:c("bg-gray-200",Xr[r],!t&&"rounded-md",e)})},Qr=({count:e=6,className:r="",animation:t="pulse"})=>s.jsx("div",{className:c("divide-y divide-gray-200",r),children:Array.from({length:e}).map((o,n)=>s.jsxs("div",{className:"flex items-center justify-between py-3",children:[s.jsxs("div",{className:"flex flex-col gap-1.5 min-w-0",children:[s.jsx(T,{className:"h-4 w-40",animation:t}),s.jsx(T,{className:"h-3 w-28",animation:t})]}),s.jsx(T,{className:"h-4 w-12 shrink-0 ml-3",animation:t})]},n))}),et=({animation:e})=>s.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl shadow-sm flex items-stretch overflow-hidden",children:[s.jsx(T,{className:"shrink-0 w-36 h-[120px] rounded-none",animation:e}),s.jsxs("div",{className:"flex-1 p-4 min-w-0 flex flex-col justify-center gap-2",children:[s.jsx(T,{className:"h-5 w-1/3",animation:e}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(T,{className:"h-4 w-16 rounded-full",animation:e}),s.jsx(T,{className:"h-4 w-20 rounded-full",animation:e}),s.jsx(T,{className:"h-4 w-24 rounded-full",animation:e})]}),s.jsx(T,{className:"h-3 w-2/3",animation:e})]}),s.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-4 border-l border-gray-100",children:[s.jsx(T,{className:"h-8 w-8",animation:e}),s.jsx(T,{className:"h-8 w-8",animation:e}),s.jsx(T,{className:"h-8 w-8",animation:e})]})]}),rt=({count:e=6,className:r="",animation:t="pulse"})=>s.jsx("div",{className:c("flex flex-col gap-3",r),children:Array.from({length:e}).map((o,n)=>s.jsx(et,{animation:t},n))}),tt={2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"},st={video:"aspect-video",square:"aspect-square","4/3":"aspect-4/3",auto:""},ot=({aspect:e,animation:r})=>s.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden flex flex-col",children:[s.jsx(T,{className:c("w-full rounded-none",st[e]||"h-40"),animation:r}),s.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[s.jsx(T,{className:"h-5 w-4/5 mb-2",animation:r}),s.jsx(T,{className:"h-3 w-full mb-1.5",animation:r}),s.jsx(T,{className:"h-3 w-2/3 mb-3",animation:r}),s.jsxs("div",{className:"mt-auto flex items-center justify-between",children:[s.jsx(T,{className:"h-3 w-16",animation:r}),s.jsx(T,{className:"h-8 w-24 rounded-lg",animation:r})]})]})]}),nt=({count:e=6,columns:r=3,aspect:t="4/3",className:o="",animation:n="pulse"})=>s.jsx("div",{className:c("grid gap-6",tt[r],o),children:Array.from({length:e}).map((l,i)=>s.jsx(ot,{aspect:t,animation:n},i))}),at=({rows:e=8,columns:r=6,className:t="",animation:o="pulse"})=>s.jsxs("div",{className:c("w-full",t),children:[s.jsx("div",{className:"flex gap-4 border-b border-gray-200 pb-3 mb-3",children:Array.from({length:r}).map((n,l)=>s.jsx(T,{className:"h-4 flex-1",animation:o},l))}),Array.from({length:e}).map((n,l)=>s.jsx("div",{className:"flex gap-4 py-3 border-b border-gray-100 last:border-0",children:Array.from({length:r}).map((i,a)=>s.jsx(T,{className:"h-4 flex-1",animation:o},a))},l))]}),lt=({count:e=3,className:r="",animation:t="pulse"})=>s.jsx("div",{className:c("space-y-4",r),children:Array.from({length:e}).map((o,n)=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between mb-1",children:[s.jsx(T,{className:"h-3 w-32",animation:t}),s.jsx(T,{className:"h-3 w-10",animation:t})]}),s.jsx(T,{className:"h-2 w-full rounded-full",animation:t})]},n))}),{Input:it,InputArea:ct}=Ce;exports.Badge=Kr;exports.Button=J;exports.Calendar=Hr;exports.Checkbox=Zr;exports.Dropdown=Yr;exports.EN_DEFAULT_DAY_NAMES=De;exports.EN_DEFAULT_MONTH_NAMES=Pe;exports.ES_DEFAULT_DAY_NAMES=Ae;exports.ES_DEFAULT_MONTH_NAMES=Te;exports.ExpandableCard=Fr;exports.FileDropZone=Jr;exports.Input=it;exports.InputArea=ct;exports.Loader=Se;exports.Login=kr;exports.Modal=qr;exports.Pagination=_r;exports.SearchInput=Tr;exports.Skeleton=T;exports.SkeletonBars=lt;exports.SkeletonCardList=rt;exports.SkeletonGrid=nt;exports.SkeletonList=Qr;exports.SkeletonTable=at;exports.TabPanel=Vr;exports.Table=Ur;exports.Tabs=Br;exports.ThemeProvider=hr;exports.Toggle=jr;exports.cn=c;exports.defaultTheme=O;exports.generateColorVariants=te;exports.hexToHsl=ke;exports.hslToHex=ie;exports.useDebounce=Ee;exports.useIsMobile=Pr;exports.useTheme=fr;exports.useToast=Ar;
2
2
  //# sourceMappingURL=index.cjs.map