@stackloop/ui 3.1.0 → 3.2.1
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/README.md +26 -1
- package/dist/CountrySelect.d.ts +16 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1018 -972
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("react"),b=require("framer-motion"),v=require("lucide-react");function Ae(r){var t,o,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(t=0;t<s;t++)r[t]&&(o=Ae(r[t]))&&(a&&(a+=" "),a+=o)}else for(o in r)r[o]&&(a&&(a+=" "),a+=o);return a}function Je(){for(var r,t,o=0,a="",s=arguments.length;o<s;o++)(r=arguments[o])&&(t=Ae(r))&&(a&&(a+=" "),a+=t);return a}const Xe=(r,t)=>{const o=new Array(r.length+t.length);for(let a=0;a<r.length;a++)o[a]=r[a];for(let a=0;a<t.length;a++)o[r.length+a]=t[a];return o},Ze=(r,t)=>({classGroupId:r,validator:t}),Me=(r=new Map,t=null,o)=>({nextPart:r,validators:t,classGroupId:o}),le="-",ve=[],Qe="arbitrary..",er=r=>{const t=tr(r),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=r;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return rr(i);const n=i.split(le),l=n[0]===""&&n.length>1?1:0;return Te(n,l,t)},getConflictingClassGroupIds:(i,n)=>{if(n){const l=a[i],m=o[i];return l?m?Xe(m,l):l:m||ve}return o[i]||ve}}},Te=(r,t,o)=>{if(r.length-t===0)return o.classGroupId;const s=r[t],d=o.nextPart.get(s);if(d){const m=Te(r,t+1,d);if(m)return m}const i=o.validators;if(i===null)return;const n=t===0?r.join(le):r.slice(t).join(le),l=i.length;for(let m=0;m<l;m++){const c=i[m];if(c.validator(n))return c.classGroupId}},rr=r=>r.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=r.slice(1,-1),o=t.indexOf(":"),a=t.slice(0,o);return a?Qe+a:void 0})(),tr=r=>{const{theme:t,classGroups:o}=r;return ar(o,t)},ar=(r,t)=>{const o=Me();for(const a in r){const s=r[a];he(s,o,a,t)}return o},he=(r,t,o,a)=>{const s=r.length;for(let d=0;d<s;d++){const i=r[d];or(i,t,o,a)}},or=(r,t,o,a)=>{if(typeof r=="string"){sr(r,t,o);return}if(typeof r=="function"){nr(r,t,o,a);return}ir(r,t,o,a)},sr=(r,t,o)=>{const a=r===""?t:Re(t,r);a.classGroupId=o},nr=(r,t,o,a)=>{if(lr(r)){he(r(a),t,o,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Ze(o,r))},ir=(r,t,o,a)=>{const s=Object.entries(r),d=s.length;for(let i=0;i<d;i++){const[n,l]=s[i];he(l,Re(t,n),o,a)}},Re=(r,t)=>{let o=r;const a=t.split(le),s=a.length;for(let d=0;d<s;d++){const i=a[d];let n=o.nextPart.get(i);n||(n=Me(),o.nextPart.set(i,n)),o=n}return o},lr=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,dr=r=>{if(r<1)return{get:()=>{},set:()=>{}};let t=0,o=Object.create(null),a=Object.create(null);const s=(d,i)=>{o[d]=i,t++,t>r&&(t=0,a=o,o=Object.create(null))};return{get(d){let i=o[d];if(i!==void 0)return i;if((i=a[d])!==void 0)return s(d,i),i},set(d,i){d in o?o[d]=i:s(d,i)}}},be="!",Ce=":",cr=[],je=(r,t,o,a,s)=>({modifiers:r,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:a,isExternal:s}),mr=r=>{const{prefix:t,experimentalParseClassName:o}=r;let a=s=>{const d=[];let i=0,n=0,l=0,m;const c=s.length;for(let C=0;C<c;C++){const h=s[C];if(i===0&&n===0){if(h===Ce){d.push(s.slice(l,C)),l=C+1;continue}if(h==="/"){m=C;continue}}h==="["?i++:h==="]"?i--:h==="("?n++:h===")"&&n--}const x=d.length===0?s:s.slice(l);let j=x,N=!1;x.endsWith(be)?(j=x.slice(0,-1),N=!0):x.startsWith(be)&&(j=x.slice(1),N=!0);const w=m&&m>l?m-l:void 0;return je(d,N,j,w)};if(t){const s=t+Ce,d=a;a=i=>i.startsWith(s)?d(i.slice(s.length)):je(cr,!1,i,void 0,!0)}if(o){const s=a;a=d=>o({className:d,parseClassName:s})}return a},ur=r=>{const t=new Map;return r.orderSensitiveModifiers.forEach((o,a)=>{t.set(o,1e6+a)}),o=>{const a=[];let s=[];for(let d=0;d<o.length;d++){const i=o[d],n=i[0]==="[",l=t.has(i);n||l?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(i)):s.push(i)}return s.length>0&&(s.sort(),a.push(...s)),a}},pr=r=>({cache:dr(r.cacheSize),parseClassName:mr(r),sortModifiers:ur(r),...er(r)}),xr=/\s+/,br=(r,t)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:d}=t,i=[],n=r.trim().split(xr);let l="";for(let m=n.length-1;m>=0;m-=1){const c=n[m],{isExternal:x,modifiers:j,hasImportantModifier:N,baseClassName:w,maybePostfixModifierPosition:C}=o(c);if(x){l=c+(l.length>0?" "+l:l);continue}let h=!!C,k=a(h?w.substring(0,C):w);if(!k){if(!h){l=c+(l.length>0?" "+l:l);continue}if(k=a(w),!k){l=c+(l.length>0?" "+l:l);continue}h=!1}const P=j.length===0?"":j.length===1?j[0]:d(j).join(":"),z=N?P+be:P,M=z+k;if(i.indexOf(M)>-1)continue;i.push(M);const L=s(k,h);for(let G=0;G<L.length;++G){const T=L[G];i.push(z+T)}l=c+(l.length>0?" "+l:l)}return l},hr=(...r)=>{let t=0,o,a,s="";for(;t<r.length;)(o=r[t++])&&(a=Ie(o))&&(s&&(s+=" "),s+=a);return s},Ie=r=>{if(typeof r=="string")return r;let t,o="";for(let a=0;a<r.length;a++)r[a]&&(t=Ie(r[a]))&&(o&&(o+=" "),o+=t);return o},fr=(r,...t)=>{let o,a,s,d;const i=l=>{const m=t.reduce((c,x)=>x(c),r());return o=pr(m),a=o.cache.get,s=o.cache.set,d=n,n(l)},n=l=>{const m=a(l);if(m)return m;const c=br(l,o);return s(l,c),c};return d=i,(...l)=>d(hr(...l))},gr=[],D=r=>{const t=o=>o[r]||gr;return t.isThemeGetter=!0,t},ze=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yr=/^\d+\/\d+$/,wr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vr=/\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$/,Cr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Nr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,X=r=>yr.test(r),R=r=>!!r&&!Number.isNaN(Number(r)),_=r=>!!r&&Number.isInteger(Number(r)),ue=r=>r.endsWith("%")&&R(r.slice(0,-1)),q=r=>wr.test(r),kr=()=>!0,Sr=r=>vr.test(r)&&!Cr.test(r),Le=()=>!1,Ar=r=>jr.test(r),Mr=r=>Nr.test(r),Tr=r=>!g(r)&&!y(r),Rr=r=>Z(r,Be,Le),g=r=>ze.test(r),J=r=>Z(r,De,Sr),pe=r=>Z(r,Gr,R),Ne=r=>Z(r,Ge,Le),Ir=r=>Z(r,Ee,Mr),se=r=>Z(r,Fe,Ar),y=r=>Pe.test(r),ee=r=>Q(r,De),zr=r=>Q(r,Er),ke=r=>Q(r,Ge),Pr=r=>Q(r,Be),Lr=r=>Q(r,Ee),ne=r=>Q(r,Fe,!0),Z=(r,t,o)=>{const a=ze.exec(r);return a?a[1]?t(a[1]):o(a[2]):!1},Q=(r,t,o=!1)=>{const a=Pe.exec(r);return a?a[1]?t(a[1]):o:!1},Ge=r=>r==="position"||r==="percentage",Ee=r=>r==="image"||r==="url",Be=r=>r==="length"||r==="size"||r==="bg-size",De=r=>r==="length",Gr=r=>r==="number",Er=r=>r==="family-name",Fe=r=>r==="shadow",Br=()=>{const r=D("color"),t=D("font"),o=D("text"),a=D("font-weight"),s=D("tracking"),d=D("leading"),i=D("breakpoint"),n=D("container"),l=D("spacing"),m=D("radius"),c=D("shadow"),x=D("inset-shadow"),j=D("text-shadow"),N=D("drop-shadow"),w=D("blur"),C=D("perspective"),h=D("aspect"),k=D("ease"),P=D("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...M(),y,g],G=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],f=()=>[y,g,l],E=()=>[X,"full","auto",...f()],B=()=>[_,"none","subgrid",y,g],p=()=>["auto",{span:["full",_,y,g]},_,y,g],I=()=>[_,"auto",y,g],V=()=>["auto","min","max","fr",y,g],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...f()],Y=()=>[X,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...f()],A=()=>[r,y,g],$=()=>[...M(),ke,Ne,{position:[y,g]}],fe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ge=()=>["auto","cover","contain",Pr,Rr,{size:[y,g]}],ce=()=>[ue,ee,J],U=()=>["","none","full",m,y,g],K=()=>["",R,ee,J],re=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>[R,ue,ke,Ne],we=()=>["","none",w,y,g],te=()=>["none",R,y,g],ae=()=>["none",R,y,g],me=()=>[R,y,g],oe=()=>[X,"full",...f()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[kr],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[Tr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",R],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",X,g,y,h]}],container:["container"],columns:[{columns:[R,g,y,n]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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"],sr:["sr-only","not-sr-only"],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:L()}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[_,"auto",y,g]}],basis:[{basis:[X,"full","auto",n,...f()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[R,X,"auto","initial","none",g]}],grow:[{grow:["",R,y,g]}],shrink:[{shrink:["",R,y,g]}],order:[{order:[_,"first","last","none",y,g]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:p()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:p()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:f()}],"gap-x":[{"gap-x":f()}],"gap-y":[{"gap-y":f()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":f()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":f()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[n,"screen",...Y()]}],"min-w":[{"min-w":[n,"screen","none",...Y()]}],"max-w":[{"max-w":[n,"screen","none","prose",{screen:[i]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",o,ee,J]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,y,pe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ue,g]}],"font-family":[{font:[zr,g,t]}],"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:[s,y,g]}],"line-clamp":[{"line-clamp":[R,"none",y,pe]}],leading:[{leading:[d,...f()]}],"list-image":[{"list-image":["none",y,g]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",y,g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[R,"from-font","auto",y,J]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[R,"auto",y,g]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:f()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",y,g]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",y,g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:fe()}],"bg-size":[{bg:ge()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},_,y,g],radial:["",y,g],conic:[_,y,g]},Lr,Ir]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"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:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[R,y,g]}],"outline-w":[{outline:["",R,ee,J]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",c,ne,se]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",x,ne,se]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[R,J]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",j,ne,se]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[R,y,g]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[R]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[y,g]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[R]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:fe()}],"mask-size":[{mask:ge()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",y,g]}],filter:[{filter:["","none",y,g]}],blur:[{blur:we()}],brightness:[{brightness:[R,y,g]}],contrast:[{contrast:[R,y,g]}],"drop-shadow":[{"drop-shadow":["","none",N,ne,se]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",R,y,g]}],"hue-rotate":[{"hue-rotate":[R,y,g]}],invert:[{invert:["",R,y,g]}],saturate:[{saturate:[R,y,g]}],sepia:[{sepia:["",R,y,g]}],"backdrop-filter":[{"backdrop-filter":["","none",y,g]}],"backdrop-blur":[{"backdrop-blur":we()}],"backdrop-brightness":[{"backdrop-brightness":[R,y,g]}],"backdrop-contrast":[{"backdrop-contrast":[R,y,g]}],"backdrop-grayscale":[{"backdrop-grayscale":["",R,y,g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R,y,g]}],"backdrop-invert":[{"backdrop-invert":["",R,y,g]}],"backdrop-opacity":[{"backdrop-opacity":[R,y,g]}],"backdrop-saturate":[{"backdrop-saturate":[R,y,g]}],"backdrop-sepia":[{"backdrop-sepia":["",R,y,g]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":f()}],"border-spacing-x":[{"border-spacing-x":f()}],"border-spacing-y":[{"border-spacing-y":f()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",y,g]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[R,"initial",y,g]}],ease:[{ease:["linear","initial",k,y,g]}],delay:[{delay:[R,y,g]}],animate:[{animate:["none",P,y,g]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,y,g]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[y,g,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",y,g]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-pe":[{"scroll-pe":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"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",y,g]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[R,ee,J,pe]}],stroke:[{stroke:["none",...A()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Dr=fr(Br);function u(...r){return Dr(Je(r))}const de=S.forwardRef(({variant:r="primary",size:t="md",loading:o,icon:a,animate:s=!0,className:d,children:i,disabled:n,...l},m)=>{const c=s!==!1,x="inline-flex items-center justify-center gap-2 font-medium rounded-md transition-all duration-200 touch-target disabled:opacity-50 disabled:cursor-not-allowed active:scale-[0.98] flex-shrink-0 whitespace-nowrap",j={primary:"bg-primary text-white hover:bg-primary-dark active:bg-primary-dark/90 shadow-sm",secondary:"bg-secondary text-foreground hover:bg-border active:bg-border-dark",outline:"bg-transparent text-primary border-2 border-primary hover:bg-secondary active:bg-border",ghost:"bg-transparent text-primary hover:bg-secondary active:bg-border",danger:"bg-error text-white hover:bg-red-600 active:bg-red-700 shadow-sm"},N={sm:"px-3 py-2 text-sm min-h-[2.25rem]",md:"px-4 py-2.5 text-base min-h-[2.75rem]",lg:"px-6 py-3.5 text-lg min-h-[3.25rem]"};return e.jsxs(b.motion.button,{ref:m,whileTap:c?{scale:n||o?1:.98}:void 0,className:u(x,j[r],N[t],d),disabled:n||o,...l,children:[o?e.jsx(v.Loader2,{className:u("h-5 w-5",c&&"animate-spin")}):a?e.jsx("span",{className:"flex-shrink-0",children:a}):null,i]})});de.displayName="Button";const Oe=S.forwardRef(({label:r,error:t,hint:o,leftIcon:a,rightIcon:s,animate:d=!0,className:i,type:n,...l},m)=>{const c=d!==!1,[x,j]=S.useState(!1),N=n==="password",w=N&&x?"text":n;return e.jsxs("div",{className:"w-full space-y-1.5",children:[r&&e.jsxs("label",{className:"block text-sm font-medium text-foreground",children:[r,l.required&&e.jsx("span",{className:"text-error ml-1",children:"*"})]}),e.jsxs("div",{className:"relative",children:[a&&e.jsx("div",{className:"absolute flex items-center pointer-events-none text-primary",style:{left:"14px",top:"50%",transform:"translateY(-50%)"},children:a}),e.jsx("input",{ref:m,type:w,className:u("w-full rounded-md border transition-all duration-200","bg-background text-foreground placeholder:text-foreground/50","focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent","disabled:bg-secondary disabled:cursor-not-allowed","touch-target text-base",t&&"border-error focus:ring-error",!t&&"border-border",i),style:{paddingTop:"12px",paddingBottom:"12px",paddingLeft:a?"44px":"16px",paddingRight:s||N?"44px":"16px"},...l}),N&&e.jsx(b.motion.button,{type:"button",onClick:()=>j(!x),className:"absolute text-primary hover:text-primary-dark transition-colors",style:{right:"14px",top:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-label":x?"Hide password":"Show password",whileTap:c?{scale:.9,y:"-50%"}:void 0,animate:{y:"-50%"},transition:c?{duration:.1}:{duration:0},children:x?e.jsx(v.EyeOff,{className:"w-5 h-5"}):e.jsx(v.Eye,{className:"w-5 h-5"})}),s&&!N&&e.jsx("div",{className:"absolute flex items-center pointer-events-none text-primary",style:{right:"14px",top:"50%",transform:"translateY(-50%)"},children:s})]}),t&&e.jsx(b.motion.p,{...c?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"text-sm text-error",children:t}),o&&!t&&e.jsx("p",{className:"text-sm text-primary/70",children:o})]})});Oe.displayName="Input";const Ue=S.forwardRef(({label:r,error:t,helperText:o,className:a,required:s,animate:d=!0,...i},n)=>{const l=d!==!1;return e.jsxs(b.motion.div,{...l?{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3}}:{},className:"w-full",children:[r&&e.jsxs("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:[r,s&&e.jsx("span",{className:"text-error ml-1",children:"*"})]}),e.jsx("textarea",{ref:n,className:u("w-full px-4 py-3 bg-background border border-border rounded-md","text-foreground placeholder:text-foreground/50","focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent","disabled:bg-secondary disabled:opacity-50 disabled:cursor-not-allowed","transition-all duration-200 resize-vertical","text-base touch-target",t&&"border-error focus:ring-error",a),...i}),t&&e.jsx(b.motion.p,{...l?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"mt-1 text-sm text-error",children:t}),o&&!t&&e.jsx("p",{className:"mt-1 text-sm text-primary/70",children:o})]})});Ue.displayName="Textarea";const Ve=S.forwardRef(({label:r,description:t,className:o,checked:a,defaultChecked:s,onChange:d,animate:i=!0,...n},l)=>{const m=i!==!1,[c,x]=S.useState(s||!1),j=a!==void 0?a:c,N=w=>{a===void 0&&x(w.target.checked),d?.(w.target.checked)};return e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[e.jsxs("div",{className:"relative flex-shrink-0 mt-0.5",children:[e.jsx("input",{ref:l,type:"checkbox",className:"sr-only peer",checked:j,onChange:N,...n}),e.jsx(b.motion.div,{className:u("w-6 h-6 rounded-md border-2 transition-all duration-200","peer-focus:ring-2 peer-focus:ring-primary peer-focus:ring-offset-2","peer-disabled:opacity-50 peer-disabled:cursor-not-allowed","flex items-center justify-center",j?"bg-primary border-primary":"border-border bg-secondary",o),whileTap:m?{scale:.95}:void 0,children:e.jsx(v.Check,{className:u("w-4 h-4 text-white transition-opacity duration-200",j?"opacity-100":"opacity-0")})})]}),(r||t)&&e.jsxs("div",{className:"flex-1 space-y-0.5",children:[r&&e.jsx("div",{className:"text-base font-medium text-foreground group-hover:text-primary transition-colors",children:r}),t&&e.jsx("div",{className:"text-sm text-primary/70",children:t})]})]})});Ve.displayName="Checkbox";const Fr=({options:r,value:t,onChange:o,name:a,disabled:s,className:d,animate:i=!0})=>{const n=i!==!1;return e.jsx("div",{className:u("flex flex-wrap gap-2",d),children:r.map(l=>{const m=t===l.value;return e.jsxs("label",{className:"relative cursor-pointer",children:[e.jsx("input",{type:"radio",name:a,value:l.value,checked:m,onChange:c=>o?.(c.target.value),disabled:s,className:"sr-only peer"}),e.jsxs(b.motion.div,{whileTap:n?{scale:s?1:.95}:void 0,className:u("px-4 py-2.5 rounded-full border-2 transition-all duration-200","flex items-center gap-2 min-h-[2.75rem]","peer-focus:ring-2 peer-focus:ring-primary peer-focus:ring-offset-2","peer-disabled:opacity-50 peer-disabled:cursor-not-allowed",m?"bg-primary border-primary text-white":"bg-background border-border text-primary hover:border-border-dark"),children:[l.icon&&e.jsx("span",{className:"flex-shrink-0",children:l.icon}),e.jsx("span",{className:"font-medium text-base",children:l.label})]})]},l.value)})})},Ke=S.forwardRef(({label:r,description:t,className:o,checked:a,onChange:s,animate:d=!0,...i},n)=>{const l=d!==!1,m=c=>{s?.(c.target.checked)};return e.jsxs("label",{className:"flex items-center justify-between gap-4 cursor-pointer group",children:[(r||t)&&e.jsxs("div",{className:"flex-1 space-y-0.5",children:[r&&e.jsx("div",{className:"text-base font-medium text-foreground",children:r}),t&&e.jsx("div",{className:"text-sm text-primary/70",children:t})]}),e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsx("input",{ref:n,type:"checkbox",onChange:m,className:"sr-only peer",checked:a,...i}),e.jsx("div",{className:u("w-12 h-7 rounded-full transition-all duration-200 relative","peer-focus:ring-2 peer-focus:ring-primary peer-focus:ring-offset-2","peer-disabled:opacity-50 peer-disabled:cursor-not-allowed",a?"bg-primary":"bg-border-dark",o),children:e.jsx(b.motion.div,{className:"absolute top-1 w-5 h-5 bg-white rounded-full shadow-sm",style:{left:a?"24px":"4px"},animate:l?{left:a?"24px":"4px"}:void 0,transition:l?{type:"spring",stiffness:500,damping:30}:{duration:0}})})]})]})});Ke.displayName="Toggle";const Or=({value:r,onChange:t,min:o=0,max:a=100,step:s=1,label:d,showValue:i=!0,unit:n="%",disabled:l,className:m,animate:c=!0})=>{const x=c!==!1,[j,N]=S.useState(!1),w=(r-o)/(a-o)*100;return e.jsxs("div",{className:u("w-full space-y-2",m),children:[(d||i)&&e.jsxs("div",{className:"flex items-center justify-between",children:[d&&e.jsx("label",{className:"text-sm font-medium text-primary",children:d}),i&&e.jsxs("span",{className:"text-sm font-semibold text-primary",children:[r,n]})]}),e.jsxs("div",{className:"relative h-12 flex items-center",children:[e.jsx("div",{className:"relative w-full h-2 bg-border rounded-full overflow-hidden",children:e.jsx(b.motion.div,{className:"absolute left-0 top-0 h-full bg-primary rounded-full",style:{width:`${w}%`},initial:!1,animate:x?{width:`${w}%`}:void 0,transition:x?{type:"spring",stiffness:300,damping:30}:{duration:0}})}),e.jsx("input",{type:"range",min:o,max:a,step:s,value:r,onChange:C=>t(Number(C.target.value)),onMouseDown:()=>N(!0),onMouseUp:()=>N(!1),onTouchStart:()=>N(!0),onTouchEnd:()=>N(!1),disabled:l,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer disabled:cursor-not-allowed",style:{zIndex:10}}),e.jsx(b.motion.div,{className:u("absolute w-6 h-6 bg-background border-2 border-primary rounded-full shadow-md","pointer-events-none",l&&"opacity-50"),style:{left:`calc(${w}% - 12px)`},animate:x?{scale:j?1.2:1}:void 0,transition:x?{type:"spring",stiffness:300,damping:20}:{duration:0}})]})]})},Ur=({value1:r,value2:t,onChange:o,label1:a,label2:s,min:d=0,max:i=100,step:n=1,unit:l="%",disabled:m,className:c,animate:x=!0})=>{const j=x!==!1,N=r+t,w=N>0?r/N*100:50,C=N>0?t/N*100:50,h=k=>{const P=i-k;o(k,Math.max(d,Math.min(i,P)))};return e.jsxs("div",{className:u("w-full space-y-3",c),children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm font-medium text-primary",children:a}),e.jsxs("span",{className:"text-sm font-semibold text-primary",children:[r,l]})]}),e.jsxs("div",{className:"relative h-10 flex items-center",children:[e.jsx("div",{className:"w-full h-2 bg-border rounded-full overflow-hidden",children:e.jsx(b.motion.div,{className:"h-full bg-primary",initial:!1,animate:j?{width:`${w}%`}:void 0,transition:j?{type:"spring",stiffness:300,damping:30}:{duration:0}})}),e.jsx("input",{type:"range",min:d,max:i,step:n,value:r,onChange:k=>h(Number(k.target.value)),disabled:m,className:"absolute inset-0 w-full opacity-0 cursor-pointer disabled:cursor-not-allowed"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm font-medium text-primary",children:s}),e.jsxs("span",{className:"text-sm font-semibold text-success",children:[t,l]})]}),e.jsxs("div",{className:"relative h-10 flex items-center",children:[e.jsx("div",{className:"w-full h-2 bg-border rounded-full overflow-hidden",children:e.jsx(b.motion.div,{className:"h-full bg-success",initial:!1,animate:j?{width:`${C}%`}:void 0,transition:j?{type:"spring",stiffness:300,damping:30}:{duration:0}})}),e.jsx("input",{type:"range",min:d,max:i,step:n,value:t,onChange:k=>h(i-Number(k.target.value)),disabled:m,className:"absolute inset-0 w-full opacity-0 cursor-pointer disabled:cursor-not-allowed"})]})]}),e.jsxs("div",{className:"text-xs text-primary/70 text-center",children:["Total: ",N,l]})]})},Vr=({options:r,value:t,onChange:o,placeholder:a="Select an option",label:s,error:d,searchable:i=!1,clearable:n=!0,disabled:l,className:m,animate:c=!0})=>{const x=c!==!1,[j,N]=S.useState(!1),[w,C]=S.useState(""),h=S.useRef(null),k=r.find(M=>M.value===t),P=i?r.filter(M=>M.label.toLowerCase().includes(w.toLowerCase())):r;S.useEffect(()=>{const M=L=>{h.current&&!h.current.contains(L.target)&&(N(!1),C(""))};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]);const z=M=>{o(M),N(!1),C("")};return e.jsxs("div",{ref:h,className:u("relative w-full",m),children:[s&&e.jsx("label",{className:"block mb-1.5 text-sm font-medium text-foreground",children:s}),e.jsxs("button",{type:"button",onClick:()=>!l&&N(!j),disabled:l,className:u("w-full px-4 py-3 rounded-md border transition-all duration-200","bg-background text-left flex items-center justify-between gap-2","focus:outline-none focus:ring-2 focus:ring-primary","disabled:bg-secondary disabled:cursor-not-allowed","touch-target",d&&"border-error",!d&&"border-border",j&&"ring-2 ring-primary"),children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[k?.icon&&e.jsx("span",{className:"flex-shrink-0",children:k.icon}),e.jsx("span",{className:u("truncate",!k&&"text-foreground/50"),children:k?.label||a})]}),e.jsx(v.ChevronDown,{className:u("w-5 h-5 text-primary transition-transform flex-shrink-0",j&&"rotate-180")})]}),x?e.jsx(b.AnimatePresence,{children:j?e.jsxs(b.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"absolute right-0 z-50 mt-2 w-max min-w-48 max-w-none bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[i&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(v.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search...",value:w,onChange:M=>C(M.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-primary"}),w&&e.jsx("button",{onClick:()=>C(""),className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(v.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsxs("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:[n&&e.jsx("button",{type:"button",onClick:()=>z(""),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","text-foreground/70 italic",!t&&"bg-border text-foreground"),children:e.jsx("span",{children:"None"})}),P.length>0?P.map(M=>e.jsxs("button",{onClick:()=>z(M.value),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors",M.value===t&&"bg-border text-foreground"),children:[M.icon&&e.jsx("span",{className:"flex-shrink-0",children:M.icon}),e.jsx("span",{children:M.label})]},M.value)):e.jsx("div",{className:"px-4 py-6 text-center text-primary/70 text-sm",children:"No options found"})]})]}):null}):j&&e.jsxs(b.motion.div,{className:"absolute right-0 z-50 mt-2 w-max min-w-48 max-w-none bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[i&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(v.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search...",value:w,onChange:M=>C(M.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-primary"}),w&&e.jsx("button",{onClick:()=>C(""),className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(v.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsxs("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:[n&&e.jsx("button",{type:"button",onClick:()=>z(""),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","text-foreground/70 italic",!t&&"bg-border text-foreground"),children:e.jsx("span",{children:"None"})}),P.length>0?P.map(M=>e.jsxs("button",{onClick:()=>z(M.value),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors",M.value===t&&"bg-border text-foreground"),children:[M.icon&&e.jsx("span",{className:"flex-shrink-0",children:M.icon}),e.jsx("span",{children:M.label})]},M.value)):e.jsx("div",{className:"px-4 py-6 text-center text-primary/70 text-sm",children:"No options found"})]})]}),d&&e.jsx(b.motion.p,{...x?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"mt-1.5 text-sm text-error",children:d})]})},We=S.forwardRef(({options:r,value:t,onChange:o,placeholder:a="Select an option",label:s,error:d,hint:i,searchable:n=!1,clearable:l=!0,disabled:m,required:c,className:x,animate:j=!0},N)=>{const w=j!==!1,[C,h]=S.useState(!1),[k,P]=S.useState(""),z=S.useRef(null),M=r.find(T=>T.value===t),L=n?r.filter(T=>T.label.toLowerCase().includes(k.toLowerCase())):r;S.useEffect(()=>{const T=f=>{z.current&&!z.current.contains(f.target)&&(h(!1),P(""))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const G=T=>{o(T),h(!1),P("")};return e.jsxs("div",{ref:N,className:u("w-full space-y-1.5",x),children:[s&&e.jsxs("label",{className:"block text-sm font-medium text-foreground",children:[s,c&&e.jsx("span",{className:"text-error ml-1",children:"*"})]}),e.jsxs("div",{ref:z,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>!m&&h(!C),disabled:m,"aria-haspopup":"listbox","aria-expanded":C,"aria-required":c,className:u("w-full px-4 py-3 rounded-md border transition-all duration-200","bg-background text-left flex items-center justify-between gap-2","focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent","disabled:bg-secondary disabled:cursor-not-allowed","touch-target text-base",d&&"border-error focus:ring-error",!d&&"border-border",C&&"ring-2 ring-primary"),children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[M?.icon&&e.jsx("span",{className:"flex-shrink-0",children:M.icon}),e.jsx("span",{className:u("truncate",!M&&"text-foreground/50"),children:M?.label||a})]}),e.jsx(v.ChevronDown,{className:u("w-5 h-5 text-primary transition-transform flex-shrink-0",C&&"rotate-180")})]}),w?e.jsx(b.AnimatePresence,{children:C?e.jsxs(b.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},role:"listbox",className:"absolute right-0 z-50 mt-2 w-max min-w-48 max-w-none bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[n&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(v.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search...",value:k,onChange:T=>P(T.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary","aria-label":"Search options"}),k&&e.jsx("button",{type:"button",onClick:()=>P(""),className:"absolute right-2 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:e.jsx(v.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsxs("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:[l&&e.jsx("button",{type:"button",role:"option","aria-selected":!t,onClick:()=>G(""),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","text-foreground/70 italic",!t&&"bg-border text-foreground font-medium"),children:e.jsx("span",{children:"None"})}),L.length>0?L.map(T=>e.jsxs("button",{type:"button",role:"option","aria-selected":T.value===t,onClick:()=>!T.disabled&&G(T.value),disabled:T.disabled,className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",T.value===t&&"bg-border text-foreground font-medium"),children:[T.icon&&e.jsx("span",{className:"flex-shrink-0",children:T.icon}),e.jsx("span",{children:T.label})]},T.value)):e.jsx("div",{className:"px-4 py-6 text-center text-primary/70 text-sm",children:"No options found"})]})]}):null}):C&&e.jsxs(b.motion.div,{role:"listbox",className:"absolute right-0 z-50 mt-2 w-max min-w-48 max-w-none bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[n&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(v.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search...",value:k,onChange:T=>P(T.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary","aria-label":"Search options"}),k&&e.jsx("button",{type:"button",onClick:()=>P(""),className:"absolute right-2 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:e.jsx(v.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsxs("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:[l&&e.jsx("button",{type:"button",role:"option","aria-selected":!t,onClick:()=>G(""),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","text-foreground/70 italic",!t&&"bg-border text-foreground font-medium"),children:e.jsx("span",{children:"None"})}),L.length>0?L.map(T=>e.jsxs("button",{type:"button",role:"option","aria-selected":T.value===t,onClick:()=>!T.disabled&&G(T.value),disabled:T.disabled,className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",T.value===t&&"bg-border text-foreground font-medium"),children:[T.icon&&e.jsx("span",{className:"flex-shrink-0",children:T.icon}),e.jsx("span",{children:T.label})]},T.value)):e.jsx("div",{className:"px-4 py-6 text-center text-primary/70 text-sm",children:"No options found"})]})]})]}),d&&e.jsx(b.motion.p,{...w?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"text-sm text-error",children:d}),i&&!d&&e.jsx("p",{className:"text-sm text-primary/70",children:i})]})});We.displayName="Select";const Kr=({value:r,onChange:t,label:o,placeholder:a="Select date",error:s,disabled:d,minDate:i,maxDate:n,className:l,animate:m=!0})=>{const c=m!==!1,[x,j]=S.useState(!1),[N,w]=S.useState(r||new Date),C=S.useRef(null);S.useEffect(()=>{const p=I=>{C.current&&!C.current.contains(I.target)&&j(!1)};return x&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[x]);const h=["January","February","March","April","May","June","July","August","September","October","November","December"],k=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],P=p=>{const I=p.getFullYear(),V=p.getMonth(),W=new Date(I,V,1),H=new Date(I,V+1,0).getDate(),Y=W.getDay(),A=[];for(let $=0;$<Y;$++)A.push(null);for(let $=1;$<=H;$++)A.push(new Date(I,V,$));return A},z=()=>{w(new Date(N.getFullYear(),N.getMonth()-1,1))},M=()=>{w(new Date(N.getFullYear(),N.getMonth()+1,1))},L=p=>{t(p),j(!1)},G=p=>!!(i&&p<i||n&&p>n),T=(p,I)=>!p||!I?!1:p.getDate()===I.getDate()&&p.getMonth()===I.getMonth()&&p.getFullYear()===I.getFullYear(),f=p=>p?T(p,new Date):!1,E=p=>p?p.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"",B=P(N);return e.jsxs("div",{ref:C,className:u("relative w-full",l),children:[o&&e.jsx("label",{className:"block mb-1.5 text-sm font-medium text-foreground",children:o}),e.jsxs("button",{type:"button",onClick:()=>!d&&j(!x),disabled:d,className:u("w-full px-4 py-3 rounded-md border transition-all duration-200","bg-background text-left flex items-center justify-between gap-2","focus:outline-none focus:ring-2 focus:ring-primary","disabled:bg-secondary disabled:cursor-not-allowed","touch-target",s&&"border-error",!s&&"border-border",x&&"ring-2 ring-primary"),children:[e.jsx("span",{className:u("truncate",!r&&"text-foreground/50"),children:r?E(r):a}),e.jsx(v.Calendar,{className:"w-5 h-5 text-primary flex-shrink-0"})]}),c?e.jsx(b.AnimatePresence,{children:x?e.jsxs(b.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"absolute z-50 w-80 mt-2 bg-background rounded-md border border-border shadow-lg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("button",{type:"button",onClick:z,className:"p-2 hover:bg-secondary rounded-lg transition-colors",children:e.jsx(v.ChevronLeft,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"font-semibold text-foreground",children:[h[N.getMonth()]," ",N.getFullYear()]}),e.jsx("button",{type:"button",onClick:M,className:"p-2 hover:bg-secondary rounded-lg transition-colors",children:e.jsx(v.ChevronRight,{className:"w-5 h-5 text-primary"})})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:k.map(p=>e.jsx("div",{className:"text-center text-xs font-medium text-primary/70 py-2",children:p},p))}),e.jsx("div",{className:"grid grid-cols-7 gap-1",children:B.map((p,I)=>{if(!p)return e.jsx("div",{className:"aspect-square"},`empty-${I}`);const V=T(p,r||null),W=f(p),F=G(p);return e.jsx(b.motion.button,{type:"button",whileTap:c?{scale:F?1:.95}:void 0,onClick:()=>!F&&L(p),disabled:F,className:u("aspect-square rounded-lg flex items-center justify-center","text-sm font-medium transition-all duration-200","hover:bg-secondary",V&&"bg-primary text-white hover:bg-primary-dark",W&&!V&&"border-2 border-primary text-primary",F&&"text-border-dark cursor-not-allowed hover:bg-transparent",!V&&!W&&!F&&"text-foreground"),children:p.getDate()},p.toISOString())})}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsx("button",{type:"button",onClick:()=>L(new Date),className:"w-full py-2 text-sm font-medium text-primary hover:bg-secondary rounded-lg transition-colors",children:"Today"})})]}):null}):x&&e.jsxs("div",{className:"absolute z-50 w-80 mt-2 bg-background rounded-md border border-border shadow-lg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("button",{type:"button",onClick:z,className:"p-2 hover:bg-secondary rounded-lg transition-colors",children:e.jsx(v.ChevronLeft,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"font-semibold text-foreground",children:[h[N.getMonth()]," ",N.getFullYear()]}),e.jsx("button",{type:"button",onClick:M,className:"p-2 hover:bg-secondary rounded-lg transition-colors",children:e.jsx(v.ChevronRight,{className:"w-5 h-5 text-primary"})})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:k.map(p=>e.jsx("div",{className:"text-center text-xs font-medium text-primary/70 py-2",children:p},p))}),e.jsx("div",{className:"grid grid-cols-7 gap-1",children:B.map((p,I)=>{if(!p)return e.jsx("div",{className:"aspect-square"},`empty-${I}`);const V=T(p,r||null),W=f(p),F=G(p);return e.jsx("button",{type:"button",onClick:()=>!F&&L(p),disabled:F,className:u("aspect-square rounded-lg flex items-center justify-center","text-sm font-medium transition-all duration-200","hover:bg-secondary",V&&"bg-primary text-white hover:bg-primary-dark",W&&!V&&"border-2 border-primary text-primary",F&&"text-border-dark cursor-not-allowed hover:bg-transparent",!V&&!W&&!F&&"text-foreground"),children:p.getDate()},p.toISOString())})}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsx("button",{type:"button",onClick:()=>L(new Date),className:"w-full py-2 text-sm font-medium text-primary hover:bg-secondary rounded-lg transition-colors",children:"Today"})})]}),s&&e.jsx(b.motion.p,{...c?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"mt-1.5 text-sm text-error",children:s})]})},Wr=({children:r,variant:t="default",padding:o="md",className:a,onClick:s,hover:d=!1,animate:i=!0})=>{const n=i!==!1,l={default:"bg-background border border-border",outlined:"bg-transparent border-2 border-border-dark",elevated:"bg-background border-2 border-border shadow-card"},m={none:"p-0",sm:"p-3",md:"p-4 sm:p-6",lg:"p-6 sm:p-8"},c=s?b.motion.button:b.motion.div;return e.jsx(c,{...n?{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3}}:{},whileHover:n&&(d||s)?{y:-2,boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1)"}:void 0,whileTap:n&&s?{scale:.98}:void 0,className:u("rounded-lg transition-all duration-200",l[t],m[o],s&&"cursor-pointer w-full text-left",a),onClick:s,children:r})},Hr=({children:r,className:t})=>e.jsx("div",{className:u("mb-4",t),children:r}),Yr=({children:r,className:t})=>e.jsx("h3",{className:u("text-lg font-semibold text-foreground",t),children:r}),$r=({children:r,className:t})=>e.jsx("p",{className:u("text-sm text-foreground/70 mt-1",t),children:r}),qr=({children:r,className:t})=>e.jsx("div",{className:t,children:r}),_r=({isOpen:r,onClose:t,children:o,title:a,position:s="right",className:d,animate:i=!0})=>{const n=i!==!1;S.useEffect(()=>{const m=c=>{c.key==="Escape"&&t()};return r&&(document.addEventListener("keydown",m),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",m),document.body.style.overflow="unset"}},[r,t]);const l=r?e.jsxs(e.Fragment,{children:[e.jsx(b.motion.div,{...n?{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}}:{},className:"fixed inset-0 z-40 bg-black/50 backdrop-blur-sm",onClick:t}),e.jsxs(b.motion.div,{...n?{initial:{x:s==="left"?"-100%":"100%"},animate:{x:0},exit:{x:s==="left"?"-100%":"100%"},transition:{type:"spring",damping:30,stiffness:300}}:{},className:u("fixed top-0 z-50 h-full w-[400px] sm:w-[480px] bg-background shadow-xl",s==="left"?"left-0 border-r":"right-0 border-l","border-border",d),children:[a&&e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[e.jsx("h2",{className:"text-xl font-semibold text-foreground",children:a}),e.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:bg-secondary transition-colors","aria-label":"Close drawer",children:e.jsx(v.X,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"overflow-y-auto h-[calc(100%-5rem)] p-6",children:o})]})]}):null;return n?e.jsx(b.AnimatePresence,{children:l}):l},Jr=({isOpen:r,onClose:t,children:o,title:a,size:s="md",className:d,animate:i=!0})=>{const n=i!==!1,l=S.useRef(null);S.useEffect(()=>{const x=j=>{j.key==="Escape"&&t()};return r&&(document.addEventListener("keydown",x),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",x),document.body.style.overflow="unset"}},[r,t]);const m={sm:"max-w-lg",md:"max-w-2xl",lg:"max-w-4xl",xl:"max-w-6xl",full:"max-w-full mx-4"},c=r?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:x=>{x.target===x.currentTarget&&t()},children:e.jsxs(b.motion.div,{ref:l,...n?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2}}:{},className:u("bg-background border border-border rounded-lg shadow-2xl w-full max-h-[90vh] overflow-hidden flex flex-col",m[s],d),children:[a&&e.jsxs("div",{className:"px-6 py-4 border-b border-border flex items-center justify-between",children:[e.jsx("h2",{className:"text-xl font-semibold text-foreground",children:a}),e.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:bg-secondary transition-colors","aria-label":"Close modal",children:e.jsx(v.X,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"overflow-y-auto flex-1",children:o})]})}):null;return n?e.jsx(b.AnimatePresence,{children:c}):c},Xr=({children:r,className:t})=>e.jsx("div",{className:u("px-6 py-4",t),children:r}),Zr=({children:r,className:t})=>e.jsx("div",{className:u("px-6 py-4 border-t border-border flex items-center justify-end gap-3 bg-background sticky bottom-0",t),children:r}),Qr=({isOpen:r,onClose:t,title:o,children:a,showCloseButton:s=!1,className:d,animate:i=!0})=>{const n=i!==!1;S.useEffect(()=>(r?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[r]);const l=r?e.jsxs(e.Fragment,{children:[e.jsx(b.motion.div,{...n?{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}:{},onClick:t,className:"fixed inset-0 bg-black/50 z-40"}),e.jsxs(b.motion.div,{...n?{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:300}}:{},className:u("fixed bottom-0 left-0 right-0 z-50","bg-white rounded-t-3xl shadow-2xl","max-h-[90vh] flex flex-col",d),children:[e.jsx("div",{className:"flex justify-center pt-3 pb-2",children:e.jsx("div",{className:"w-12 h-1.5 bg-border-dark rounded-full"})}),(o||s)&&e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 ",children:[o&&e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:o}),s&&e.jsx("button",{onClick:t,className:"p-2 rounded-full hover:bg-secondary transition-colors",children:e.jsx(v.X,{className:"w-5 h-5 text-primary"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:a})]})]}):null;return n?e.jsx(b.AnimatePresence,{children:l}):l};function et({data:r,columns:t,loading:o=!1,onRowClick:a,keyExtractor:s,className:d,animate:i=!0}){const n=i!==!1,[l,m]=S.useState(null),[c,x]=S.useState("asc"),j=w=>{l===w?x(c==="asc"?"desc":"asc"):(m(w),x("asc"))},N=l?[...r].sort((w,C)=>{const h=w[l],k=C[l];return h<k?c==="asc"?-1:1:h>k?c==="asc"?1:-1:0}):r;return o?e.jsx("div",{className:u("border border-border rounded-lg overflow-hidden",d),children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"border-b border-border",children:e.jsx("tr",{children:t.map((w,C)=>e.jsx("th",{className:"px-6 py-4 text-left",children:e.jsx("div",{className:u("h-4 bg-border rounded w-24",n&&"animate-pulse")})},C))})}),e.jsx("tbody",{children:[...Array(5)].map((w,C)=>e.jsx("tr",{className:"border-b border-border",children:t.map((h,k)=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:u("h-4 bg-secondary rounded",n&&"animate-pulse")})},k))},C))})]})})}):e.jsx(b.motion.div,{...n?{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3}}:{},className:u("border border-border rounded-lg overflow-hidden",d),children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"border-b border-border",children:e.jsx("tr",{children:t.map((w,C)=>e.jsx("th",{className:u("px-6 py-4 text-left text-sm font-semibold text-foreground",w.width,w.sortable&&"cursor-pointer transition-colors"),onClick:()=>w.sortable&&j(w.key),children:e.jsxs("div",{className:"flex items-center gap-2",children:[w.header,w.sortable&&e.jsx("span",{className:"text-primary/50 hover:text-primary transition-colors",children:l===w.key?c==="asc"?e.jsx(v.ArrowUp,{className:"w-4 h-4"}):e.jsx(v.ArrowDown,{className:"w-4 h-4"}):e.jsx(v.ChevronsUpDown,{className:"w-4 h-4"})})]})},C))})}),e.jsx("tbody",{children:N.map((w,C)=>e.jsx(b.motion.tr,{...n?{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.2,delay:C*.05}}:{},onClick:()=>a&&a(w),className:u("border-b border-border transition-colors",a&&"cursor-pointer hover:bg-secondary"),children:t.map((h,k)=>e.jsx("td",{className:u("px-6 py-4 text-sm text-foreground/70",h.width),style:h.width?{width:h.width}:void 0,title:h.truncate&&!h.render?String(w[h.key]??""):void 0,children:h.truncate&&!h.render?e.jsx("div",{className:"truncate",children:String(w[h.key]??"")}):h.render?h.render(w):String(w[h.key]??"")},k))},s(w)))})]})})})}const rt=({currentPage:r,totalPages:t,onPageChange:o,totalItems:a,itemsPerPage:s,className:d,animate:i=!0})=>{const n=i!==!1,m=Array.from({length:t},(c,x)=>x+1).slice(Math.max(0,r-2),Math.min(t,r+1));return e.jsxs(b.motion.div,{...n?{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3}}:{},className:u("flex items-center justify-between gap-4 flex-wrap",d),children:[e.jsx("div",{className:"text-sm text-foreground/70",children:a&&s&&e.jsxs("span",{children:["Showing ",Math.min((r-1)*s+1,a)," to"," ",Math.min(r*s,a)," of ",a," results"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{variant:"secondary",size:"sm",disabled:r===1,onClick:()=>o(r-1),icon:e.jsx(v.ChevronLeft,{className:"w-4 h-4"}),animate:i,children:"Previous"}),e.jsxs("div",{className:"flex items-center gap-1",children:[r>3&&e.jsxs(e.Fragment,{children:[e.jsx(b.motion.button,{whileHover:n?{scale:1.05}:void 0,whileTap:n?{scale:.95}:void 0,onClick:()=>o(1),className:"w-10 h-10 rounded-md hover:bg-secondary border border-border text-sm transition-colors",children:"1"}),e.jsx("span",{className:"text-primary/50 px-1",children:"..."})]}),m.map(c=>e.jsx(b.motion.button,{whileHover:n?{scale:1.05}:void 0,whileTap:n?{scale:.95}:void 0,onClick:()=>o(c),className:u("w-10 h-10 rounded-md text-sm border transition-all",c===r?"bg-primary text-white border-primary shadow-sm":"hover:bg-secondary border-border"),children:c},c)),r<t-2&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-primary/50 px-1",children:"..."}),e.jsx(b.motion.button,{whileHover:n?{scale:1.05}:void 0,whileTap:n?{scale:.95}:void 0,onClick:()=>o(t),className:"w-10 h-10 rounded-md hover:bg-secondary border border-border text-sm transition-colors",children:t})]})]}),e.jsx(de,{variant:"secondary",size:"sm",disabled:r===t,onClick:()=>o(r+1),icon:e.jsx(v.ChevronRight,{className:"w-4 h-4"}),animate:i,children:"Next"})]})]})},He=({icon:r,onClick:t,label:o,actions:a,variant:s="primary",position:d="bottom-right",disabled:i,className:n,animate:l=!0})=>{const m=l!==!1,[c,x]=S.useState(!1),j={"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2"},N={primary:"bg-primary text-white hover:bg-primary-dark shadow-lg",secondary:"bg-background text-primary border-2 border-primary hover:bg-secondary shadow-md"},w={primary:"bg-primary text-white",success:"bg-success text-white",danger:"bg-error text-white",warning:"bg-warning text-white"},C=()=>{a&&a.length>0?x(!c):t&&t()};return e.jsxs("div",{className:u(j[d],"z-50",n),children:[m?e.jsx(b.AnimatePresence,{children:c&&a?e.jsx(b.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute bottom-20 right-0 flex flex-col gap-3 mb-2",children:a.map((h,k)=>e.jsxs(b.motion.div,{initial:{opacity:0,y:20,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.8},transition:{delay:k*.05},className:"flex items-center gap-3",children:[e.jsx("span",{className:u("bg-background border border-border rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap shadow-lg",h.labelClassName),style:h.labelStyle,children:h.label}),e.jsx(b.motion.button,{whileHover:m?{scale:1.1}:void 0,whileTap:m?{scale:.9}:void 0,onClick:()=>{h.onClick(),x(!1)},className:u("w-12 h-12 rounded-full shadow-lg flex items-center justify-center transition-all",w[h.variant||"primary"]),children:h.icon})]},k))}):null}):c&&a&&e.jsx("div",{className:"absolute bottom-20 right-0 flex flex-col gap-3 mb-2",children:a.map((h,k)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:u("bg-background border border-border rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap shadow-lg",h.labelClassName),style:h.labelStyle,children:h.label}),e.jsx("button",{onClick:()=>{h.onClick(),x(!1)},className:u("w-12 h-12 rounded-full shadow-lg flex items-center justify-center transition-all",w[h.variant||"primary"]),children:h.icon})]},k))}),e.jsxs(b.motion.button,{whileTap:m?{scale:i?1:.9}:void 0,whileHover:m?{scale:i?1:1.05}:void 0,onClick:C,disabled:i,className:u("z-30 rounded-full p-4 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","flex items-center gap-2",N[s],o?"px-6":"w-16 h-16 justify-center",c&&"rotate-45"),children:[e.jsx("span",{className:"flex-shrink-0",children:r||(c?e.jsx(v.X,{className:"w-6 h-6"}):e.jsx(v.Plus,{className:"w-6 h-6"}))}),o&&e.jsx("span",{className:"font-medium",children:o})]})]})},tt=He,at=({steps:r,currentStep:t,className:o,animate:a=!0})=>{const s=a!==!1,d=r[t];return e.jsxs("div",{className:u("w-full",o),children:[e.jsx("div",{className:"hidden md:block",children:e.jsx("div",{className:"relative flex items-center mb-2",children:r.map((i,n)=>{const l=n<t,m=n===t,c=n>t;return e.jsxs(S.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(b.motion.div,{initial:!1,animate:s?{scale:m?1.05:1}:void 0,className:u("w-12 h-12 rounded-full flex items-center justify-center","font-semibold text-base transition-all duration-300","ring-4 ring-white",(l||m)&&"bg-primary text-white shadow-lg",c&&"bg-border text-muted-foreground"),children:l?e.jsx(v.Check,{className:"w-6 h-6 stroke-[3]"}):e.jsx("span",{children:n+1})}),e.jsxs("div",{className:"mt-3 text-center max-w-[120px]",children:[e.jsx("span",{className:u("text-sm font-semibold block",m&&"text-primary",l&&"text-primary",c&&"text-primary/50"),children:i.label}),i.description&&e.jsx("p",{className:u("text-xs mt-1 leading-tight",m&&"text-primary",l&&"text-primary/70",c&&"text-primary/50"),children:i.description})]})]}),n<r.length-1&&e.jsx("div",{className:"flex-1 relative",style:{marginTop:"-48px",marginLeft:"4px",marginRight:"4px"},children:e.jsx("div",{className:"h-1.5 bg-border rounded-full overflow-hidden",children:e.jsx(b.motion.div,{initial:!1,style:{width:n<t?"100%":"0%"},animate:s?{width:n<t?"100%":"0%"}:void 0,transition:s?{duration:.4,ease:"easeInOut"}:{duration:0},className:"h-full bg-primary rounded-full"})})})]},n)})})}),e.jsxs("div",{className:"md:hidden",children:[e.jsx("div",{className:"flex items-center justify-center gap-2 mb-3",children:r.map((i,n)=>{const l=n<t,m=n===t;return e.jsx(b.motion.div,{initial:!1,style:{backgroundColor:l||m?"var(--color-primary)":"var(--color-border-dark)"},animate:s?{scale:m?1.2:1}:void 0,className:u("rounded-full transition-all duration-300",m?"w-3 h-3":"w-2 h-2",(l||m)&&"shadow-sm")},n)})}),e.jsx(b.motion.div,{...s?{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3}}:{},className:"text-center",children:e.jsx("p",{className:"text-sm font-semibold text-foreground",children:d?.label})},t)]})]})},ot=({children:r,variant:t="default",size:o="md",className:a,dot:s=!1,animate:d=!0})=>{const i=d!==!1,n={default:"bg-secondary text-primary border border-border",primary:"bg-primary/10 text-primary border border-primary/20",success:"bg-success/10 text-success border border-success/20",warning:"bg-warning/10 text-warning border border-warning/20",danger:"bg-error/10 text-error border border-error/20",info:"bg-info/10 text-info border border-info/20"},l={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},m={default:"bg-primary",primary:"bg-primary",success:"bg-success",warning:"bg-warning",danger:"bg-error",info:"bg-info"};return e.jsxs(b.motion.span,{...i?{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2}}:{},className:u("inline-flex items-center gap-1.5 rounded-lg font-medium",n[t],l[o],a),children:[s&&e.jsx("span",{className:u("w-1.5 h-1.5 rounded-full",m[t])}),r]})},st=({isOffline:r,className:t,animate:o=!0})=>{const a=o!==!1;return r?e.jsxs(b.motion.div,{...a?{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10}}:{},className:u("inline-flex items-center gap-2 px-3 py-1.5 rounded-full","bg-warning text-white text-sm font-medium shadow-sm",t),children:[e.jsx(v.WifiOff,{className:"w-4 h-4"}),e.jsx("span",{children:"Offline Mode"})]}):null},nt=({status:r,count:t,className:o,animate:a=!0})=>{const s=a!==!1,d=s?e.jsx(b.motion.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},children:e.jsx(v.Wifi,{className:"w-4 h-4"})}):e.jsx(v.Wifi,{className:"w-4 h-4"}),n={synced:{icon:e.jsx(v.Wifi,{className:"w-4 h-4"}),label:"Synced",color:"bg-success text-white"},syncing:{icon:d,label:"Syncing...",color:"bg-info text-white"},unsynced:{icon:e.jsx(v.WifiOff,{className:"w-4 h-4"}),label:t?`${t} Unsynced`:"Unsynced",color:"bg-warning text-white"},error:{icon:e.jsx(v.WifiOff,{className:"w-4 h-4"}),label:"Sync Error",color:"bg-error text-white"}}[r];return e.jsxs(b.motion.div,{...s?{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1}}:{},className:u("inline-flex items-center gap-2 px-3 py-1.5 rounded-full","text-sm font-medium shadow-sm",n.color,o),children:[n.icon,e.jsx("span",{children:n.label})]})},it={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-2",lg:"w-12 h-12 border-3",xl:"w-16 h-16 border-4"},lt={primary:"border-primary border-t-transparent",secondary:"border-secondary border-t-transparent",white:"border-white border-t-transparent"},Ye=({size:r="md",variant:t="primary",className:o,label:a,animate:s=!0})=>{const d=s!==!1,i=d?b.motion.div:"div";return e.jsxs("div",{className:u("inline-flex flex-col items-center gap-2",o),children:[e.jsx(i,{className:u("rounded-full",it[r],lt[t]),...d?{animate:{rotate:360},transition:{duration:.8,repeat:1/0,ease:"linear"}}:{},role:"status","aria-label":a||"Loading"}),a&&e.jsx("span",{className:"text-sm text-foreground/70",children:a})]})};Ye.displayName="Spinner";const $e=S.createContext(void 0),dt=()=>{const r=S.useContext($e);if(!r)throw new Error("useToast must be used within ToastProvider");return r},ct={success:"bg-success/10 border-success text-success backdrop-blur-2xl",error:"bg-error/10 border-error text-error backdrop-blur-2xl",warning:"bg-warning/10 border-warning text-warning backdrop-blur-2xl",info:"bg-info/10 border-info text-info backdrop-blur-2xl",default:"bg-background border-border text-foreground backdrop-blur-2xl"},mt={success:v.CheckCircle,error:v.AlertCircle,warning:v.AlertTriangle,info:v.Info,default:null},ut={"top-left":"top-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-center":"bottom-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4"},Se=({toast:r,onRemove:t,animate:o=!0})=>{const a=o!==!1,s=r.variant||"default",d=mt[s],i=typeof r.message=="string"?r.message:String(r.message),n=a?b.motion.div:"div";return e.jsxs(n,{...a?{layout:!0,initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,x:100,scale:.95},transition:{duration:.2}}:{},className:u("flex items-start gap-3 p-4 rounded-md border shadow-lg min-w-[320px] max-w-md",ct[s]),children:[d&&e.jsx(d,{className:"w-5 h-5 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium leading-relaxed",children:i}),r.action&&e.jsx("button",{onClick:r.action.onClick,className:"mt-2 text-xs font-semibold hover:underline",children:r.action.label})]}),e.jsx("button",{onClick:()=>t(r.id),className:"flex-shrink-0 hover:opacity-70 transition-opacity","aria-label":"Close notification",children:e.jsx(v.X,{className:"w-4 h-4"})})]})},qe=({children:r,position:t="top-right",maxToasts:o=5,animate:a=!0})=>{const s=a!==!1,[d,i]=S.useState([]),n=S.useCallback(m=>{i(c=>c.filter(x=>x.id!==m))},[]),l=S.useCallback(m=>{if(typeof m.message!="string"){console.error("Toast message must be a string, received:",m.message);return}const c=Math.random().toString(36).substring(2,9),x=m.duration??5e3;i(j=>[...j,{...m,id:c}].slice(-o)),x>0&&setTimeout(()=>{n(c)},x)},[o,n]);return e.jsxs($e.Provider,{value:{toasts:d,addToast:l,removeToast:n},children:[r,e.jsx("div",{className:u("fixed z-[100] flex flex-col gap-2",ut[t]),children:s?e.jsx(b.AnimatePresence,{mode:"popLayout",children:d.map(m=>e.jsx(Se,{toast:m,onRemove:n,animate:s},m.id))}):d.map(m=>e.jsx(Se,{toast:m,onRemove:n,animate:s},m.id))})]})};qe.displayName="ToastProvider";const pt=({onCapture:r,onRemove:t,preview:o,label:a="Take Photo",disabled:s,className:d,animate:i=!0})=>{const n=i!==!1,l=S.useRef(null),m=c=>{const x=c.target.files?.[0];x&&r(x)};return e.jsxs("div",{className:u("w-full",d),children:[a&&e.jsx("label",{className:"block mb-2 text-sm font-medium text-primary",children:a}),o?e.jsxs("div",{className:"relative rounded-lg overflow-hidden border-2 border-border",children:[e.jsx("img",{src:o,alt:"Preview",className:"w-full h-48 object-cover"}),t&&e.jsx("button",{onClick:t,className:"absolute top-2 right-2 p-2 bg-error text-white rounded-full shadow-lg hover:bg-red-600",children:e.jsx(v.X,{className:"w-4 h-4"})})]}):e.jsxs(b.motion.button,{type:"button",whileTap:n?{scale:s?1:.98}:void 0,onClick:()=>l.current?.click(),disabled:s,className:u("w-full p-4 rounded-lg border-2 border-border","flex items-center justify-center gap-3","bg-secondary hover:bg-border hover:border-border-dark","transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed"),children:[e.jsx(v.Camera,{className:"w-6 h-6 text-primary"}),e.jsx("span",{className:"font-medium text-foreground",children:"Capture Photo"})]}),e.jsx("input",{ref:l,type:"file",accept:"image/*",capture:"environment",onChange:m,className:"hidden",disabled:s})]})},xt=({onUpload:r,accept:t="*/*",multiple:o=!1,label:a="Upload Files",disabled:s,className:d,animate:i=!0})=>{const n=i!==!1,l=S.useRef(null),m=c=>{c&&r(Array.from(c))};return e.jsxs("div",{className:u("w-full",d),children:[a&&e.jsx("label",{className:"block mb-2 text-sm font-medium text-primary",children:a}),e.jsxs(b.motion.button,{type:"button",whileTap:n?{scale:s?1:.98}:void 0,onClick:()=>!s&&l.current?.click(),disabled:s,className:u("w-full p-4 rounded-lg border-2 border-border","flex items-center justify-center gap-3","bg-secondary hover:bg-border hover:border-border-dark","transition-all duration-200 cursor-pointer","disabled:opacity-50 disabled:cursor-not-allowed"),children:[e.jsx(v.Upload,{className:"w-6 h-6 text-primary"}),e.jsx("span",{className:"font-medium text-foreground",children:o?"Upload Files":"Upload File"})]}),e.jsx("input",{ref:l,type:"file",accept:t,multiple:o,onChange:c=>m(c.target.files),className:"hidden",disabled:s})]})},bt=({onRecordingComplete:r,label:t="Record Audio",maxDuration:o=300,disabled:a,className:s,animate:d=!0})=>{const i=d!==!1,[n,l]=S.useState(!1),[m,c]=S.useState(!1),[x,j]=S.useState(0),[N,w]=S.useState(null),C=S.useRef(null),h=S.useRef([]),k=S.useRef(null),P=async()=>{try{const f=await navigator.mediaDevices.getUserMedia({audio:!0}),E=new MediaRecorder(f);C.current=E,h.current=[],E.ondataavailable=B=>{B.data.size>0&&h.current.push(B.data)},E.onstop=()=>{const B=new Blob(h.current,{type:"audio/webm"}),p=URL.createObjectURL(B);w(p),r(B),f.getTracks().forEach(I=>I.stop())},E.start(),l(!0),j(0),k.current=setInterval(()=>{j(B=>B>=o?(L(),B):B+1)},1e3)}catch(f){console.error("Error accessing microphone:",f)}},z=()=>{C.current?.state==="recording"&&(C.current.pause(),c(!0),k.current&&clearInterval(k.current))},M=()=>{C.current?.state==="paused"&&(C.current.resume(),c(!1),k.current=setInterval(()=>{j(f=>Math.min(f+1,o))},1e3))},L=()=>{C.current&&(C.current.stop(),l(!1),c(!1),k.current&&(clearInterval(k.current),k.current=null))},G=()=>{w(null),j(0)},T=f=>{const E=Math.floor(f/60),B=f%60;return`${E.toString().padStart(2,"0")}:${B.toString().padStart(2,"0")}`};return e.jsxs("div",{className:u("w-full",s),children:[t&&e.jsx("label",{className:"block mb-2 text-sm font-medium text-primary",children:t}),e.jsxs("div",{className:"p-4 md:p-6 bg-background rounded-lg border-2 border-border space-y-4",children:[!N&&e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(b.motion.button,{type:"button",whileTap:i?{scale:a?1:.95}:void 0,onClick:n?m?M:z:P,disabled:a,className:u("w-16 h-16 md:w-20 md:h-20 rounded-full flex items-center justify-center","transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed",n?u("bg-warning text-white",i&&"animate-pulse"):"bg-primary text-white hover:bg-primary-dark"),children:n?m?e.jsx(v.Play,{className:"w-6 h-6 md:w-8 md:h-8"}):e.jsx(v.Pause,{className:"w-6 h-6 md:w-8 md:h-8"}):e.jsx(v.Mic,{className:"w-6 h-6 md:w-8 md:h-8"})}),n&&!m&&e.jsx(b.motion.div,{className:"absolute top-0 right-0 w-4 h-4 bg-error rounded-full border-2 border-white",animate:i?{scale:[1,1.2,1]}:void 0,transition:i?{repeat:1/0,duration:1.5}:{duration:0}})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xl md:text-2xl font-mono font-semibold text-foreground",children:T(x)}),e.jsx("p",{className:"text-xs md:text-sm text-primary/70 mt-1",children:n?m?"Paused":"Recording...":"Tap to record"})]}),n&&e.jsxs(b.motion.button,{...i?{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1}}:{},type:"button",onClick:L,className:"px-4 py-2 text-sm bg-error text-white rounded-full font-medium hover:bg-red-600 flex items-center gap-2",children:[e.jsx(v.Square,{className:"w-4 h-4"}),"Stop"]})]}),N&&e.jsxs(b.motion.div,{...i?{initial:{opacity:0},animate:{opacity:1}}:{},className:"space-y-3",children:[e.jsx("audio",{src:N,controls:!0,className:"w-full"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm text-primary/70",children:["Duration: ",T(x)]}),e.jsxs("button",{type:"button",onClick:G,className:"flex items-center gap-2 px-3 py-1.5 text-sm text-error hover:bg-red-50 rounded-lg transition-colors",children:[e.jsx(v.Trash2,{className:"w-4 h-4"}),"Delete"]})]})]})]})]})},ie=[{iso2:"AF",name:"Afghanistan",dialCode:"+93"},{iso2:"AL",name:"Albania",dialCode:"+355"},{iso2:"DZ",name:"Algeria",dialCode:"+213"},{iso2:"AS",name:"American Samoa",dialCode:"+1-684"},{iso2:"AD",name:"Andorra",dialCode:"+376"},{iso2:"AO",name:"Angola",dialCode:"+244"},{iso2:"AI",name:"Anguilla",dialCode:"+1-264"},{iso2:"AQ",name:"Antarctica",dialCode:"+672"},{iso2:"AG",name:"Antigua and Barbuda",dialCode:"+1-268"},{iso2:"AR",name:"Argentina",dialCode:"+54"},{iso2:"AM",name:"Armenia",dialCode:"+374"},{iso2:"AW",name:"Aruba",dialCode:"+297"},{iso2:"AU",name:"Australia",dialCode:"+61"},{iso2:"AT",name:"Austria",dialCode:"+43"},{iso2:"AZ",name:"Azerbaijan",dialCode:"+994"},{iso2:"BS",name:"Bahamas",dialCode:"+1-242"},{iso2:"BH",name:"Bahrain",dialCode:"+973"},{iso2:"BD",name:"Bangladesh",dialCode:"+880"},{iso2:"BB",name:"Barbados",dialCode:"+1-246"},{iso2:"BY",name:"Belarus",dialCode:"+375"},{iso2:"BE",name:"Belgium",dialCode:"+32"},{iso2:"BZ",name:"Belize",dialCode:"+501"},{iso2:"BJ",name:"Benin",dialCode:"+229"},{iso2:"BM",name:"Bermuda",dialCode:"+1-441"},{iso2:"BT",name:"Bhutan",dialCode:"+975"},{iso2:"BO",name:"Bolivia",dialCode:"+591"},{iso2:"BA",name:"Bosnia and Herzegovina",dialCode:"+387"},{iso2:"BW",name:"Botswana",dialCode:"+267"},{iso2:"BR",name:"Brazil",dialCode:"+55"},{iso2:"IO",name:"British Indian Ocean Territory",dialCode:"+246"},{iso2:"BN",name:"Brunei",dialCode:"+673"},{iso2:"BG",name:"Bulgaria",dialCode:"+359"},{iso2:"BF",name:"Burkina Faso",dialCode:"+226"},{iso2:"BI",name:"Burundi",dialCode:"+257"},{iso2:"KH",name:"Cambodia",dialCode:"+855"},{iso2:"CM",name:"Cameroon",dialCode:"+237"},{iso2:"CA",name:"Canada",dialCode:"+1"},{iso2:"CV",name:"Cape Verde",dialCode:"+238"},{iso2:"KY",name:"Cayman Islands",dialCode:"+1-345"},{iso2:"CF",name:"Central African Republic",dialCode:"+236"},{iso2:"TD",name:"Chad",dialCode:"+235"},{iso2:"CL",name:"Chile",dialCode:"+56"},{iso2:"CN",name:"China",dialCode:"+86"},{iso2:"CX",name:"Christmas Island",dialCode:"+61"},{iso2:"CC",name:"Cocos (Keeling) Islands",dialCode:"+61"},{iso2:"CO",name:"Colombia",dialCode:"+57"},{iso2:"KM",name:"Comoros",dialCode:"+269"},{iso2:"CG",name:"Congo",dialCode:"+242"},{iso2:"CD",name:"Congo, Democratic Republic",dialCode:"+243"},{iso2:"CK",name:"Cook Islands",dialCode:"+682"},{iso2:"CR",name:"Costa Rica",dialCode:"+506"},{iso2:"CI",name:"Cote d'Ivoire",dialCode:"+225"},{iso2:"HR",name:"Croatia",dialCode:"+385"},{iso2:"CU",name:"Cuba",dialCode:"+53"},{iso2:"CY",name:"Cyprus",dialCode:"+357"},{iso2:"CZ",name:"Czech Republic",dialCode:"+420"},{iso2:"DK",name:"Denmark",dialCode:"+45"},{iso2:"DJ",name:"Djibouti",dialCode:"+253"},{iso2:"DM",name:"Dominica",dialCode:"+1-767"},{iso2:"DO",name:"Dominican Republic",dialCode:"+1-809"},{iso2:"EC",name:"Ecuador",dialCode:"+593"},{iso2:"EG",name:"Egypt",dialCode:"+20"},{iso2:"SV",name:"El Salvador",dialCode:"+503"},{iso2:"GQ",name:"Equatorial Guinea",dialCode:"+240"},{iso2:"ER",name:"Eritrea",dialCode:"+291"},{iso2:"EE",name:"Estonia",dialCode:"+372"},{iso2:"ET",name:"Ethiopia",dialCode:"+251"},{iso2:"FK",name:"Falkland Islands",dialCode:"+500"},{iso2:"FO",name:"Faroe Islands",dialCode:"+298"},{iso2:"FJ",name:"Fiji",dialCode:"+679"},{iso2:"FI",name:"Finland",dialCode:"+358"},{iso2:"FR",name:"France",dialCode:"+33"},{iso2:"GF",name:"French Guiana",dialCode:"+594"},{iso2:"PF",name:"French Polynesia",dialCode:"+689"},{iso2:"GA",name:"Gabon",dialCode:"+241"},{iso2:"GM",name:"Gambia",dialCode:"+220"},{iso2:"GE",name:"Georgia",dialCode:"+995"},{iso2:"DE",name:"Germany",dialCode:"+49"},{iso2:"GH",name:"Ghana",dialCode:"+233"},{iso2:"GI",name:"Gibraltar",dialCode:"+350"},{iso2:"GR",name:"Greece",dialCode:"+30"},{iso2:"GL",name:"Greenland",dialCode:"+299"},{iso2:"GD",name:"Grenada",dialCode:"+1-473"},{iso2:"GP",name:"Guadeloupe",dialCode:"+590"},{iso2:"GU",name:"Guam",dialCode:"+1-671"},{iso2:"GT",name:"Guatemala",dialCode:"+502"},{iso2:"GG",name:"Guernsey",dialCode:"+44-1481"},{iso2:"GN",name:"Guinea",dialCode:"+224"},{iso2:"GW",name:"Guinea-Bissau",dialCode:"+245"},{iso2:"GY",name:"Guyana",dialCode:"+592"},{iso2:"HT",name:"Haiti",dialCode:"+509"},{iso2:"HN",name:"Honduras",dialCode:"+504"},{iso2:"HK",name:"Hong Kong",dialCode:"+852"},{iso2:"HU",name:"Hungary",dialCode:"+36"},{iso2:"IS",name:"Iceland",dialCode:"+354"},{iso2:"IN",name:"India",dialCode:"+91"},{iso2:"ID",name:"Indonesia",dialCode:"+62"},{iso2:"IR",name:"Iran",dialCode:"+98"},{iso2:"IQ",name:"Iraq",dialCode:"+964"},{iso2:"IE",name:"Ireland",dialCode:"+353"},{iso2:"IM",name:"Isle of Man",dialCode:"+44-1624"},{iso2:"IL",name:"Israel",dialCode:"+972"},{iso2:"IT",name:"Italy",dialCode:"+39"},{iso2:"JM",name:"Jamaica",dialCode:"+1-876"},{iso2:"JP",name:"Japan",dialCode:"+81"},{iso2:"JE",name:"Jersey",dialCode:"+44-1534"},{iso2:"JO",name:"Jordan",dialCode:"+962"},{iso2:"KZ",name:"Kazakhstan",dialCode:"+7"},{iso2:"KE",name:"Kenya",dialCode:"+254"},{iso2:"KI",name:"Kiribati",dialCode:"+686"},{iso2:"KP",name:"Korea, North",dialCode:"+850"},{iso2:"KR",name:"Korea, South",dialCode:"+82"},{iso2:"KW",name:"Kuwait",dialCode:"+965"},{iso2:"KG",name:"Kyrgyzstan",dialCode:"+996"},{iso2:"LA",name:"Laos",dialCode:"+856"},{iso2:"LV",name:"Latvia",dialCode:"+371"},{iso2:"LB",name:"Lebanon",dialCode:"+961"},{iso2:"LS",name:"Lesotho",dialCode:"+266"},{iso2:"LR",name:"Liberia",dialCode:"+231"},{iso2:"LY",name:"Libya",dialCode:"+218"},{iso2:"LI",name:"Liechtenstein",dialCode:"+423"},{iso2:"LT",name:"Lithuania",dialCode:"+370"},{iso2:"LU",name:"Luxembourg",dialCode:"+352"},{iso2:"MO",name:"Macau",dialCode:"+853"},{iso2:"MK",name:"North Macedonia",dialCode:"+389"},{iso2:"MG",name:"Madagascar",dialCode:"+261"},{iso2:"MW",name:"Malawi",dialCode:"+265"},{iso2:"MY",name:"Malaysia",dialCode:"+60"},{iso2:"MV",name:"Maldives",dialCode:"+960"},{iso2:"ML",name:"Mali",dialCode:"+223"},{iso2:"MT",name:"Malta",dialCode:"+356"},{iso2:"MH",name:"Marshall Islands",dialCode:"+692"},{iso2:"MQ",name:"Martinique",dialCode:"+596"},{iso2:"MR",name:"Mauritania",dialCode:"+222"},{iso2:"MU",name:"Mauritius",dialCode:"+230"},{iso2:"YT",name:"Mayotte",dialCode:"+262"},{iso2:"MX",name:"Mexico",dialCode:"+52"},{iso2:"FM",name:"Micronesia",dialCode:"+691"},{iso2:"MD",name:"Moldova",dialCode:"+373"},{iso2:"MC",name:"Monaco",dialCode:"+377"},{iso2:"MN",name:"Mongolia",dialCode:"+976"},{iso2:"ME",name:"Montenegro",dialCode:"+382"},{iso2:"MS",name:"Montserrat",dialCode:"+1-664"},{iso2:"MA",name:"Morocco",dialCode:"+212"},{iso2:"MZ",name:"Mozambique",dialCode:"+258"},{iso2:"MM",name:"Myanmar",dialCode:"+95"},{iso2:"NA",name:"Namibia",dialCode:"+264"},{iso2:"NR",name:"Nauru",dialCode:"+674"},{iso2:"NP",name:"Nepal",dialCode:"+977"},{iso2:"NL",name:"Netherlands",dialCode:"+31"},{iso2:"NC",name:"New Caledonia",dialCode:"+687"},{iso2:"NZ",name:"New Zealand",dialCode:"+64"},{iso2:"NI",name:"Nicaragua",dialCode:"+505"},{iso2:"NE",name:"Niger",dialCode:"+227"},{iso2:"NG",name:"Nigeria",dialCode:"+234"},{iso2:"NU",name:"Niue",dialCode:"+683"},{iso2:"NF",name:"Norfolk Island",dialCode:"+672"},{iso2:"MP",name:"Northern Mariana Islands",dialCode:"+1-670"},{iso2:"NO",name:"Norway",dialCode:"+47"},{iso2:"OM",name:"Oman",dialCode:"+968"},{iso2:"PK",name:"Pakistan",dialCode:"+92"},{iso2:"PW",name:"Palau",dialCode:"+680"},{iso2:"PS",name:"Palestine",dialCode:"+970"},{iso2:"PA",name:"Panama",dialCode:"+507"},{iso2:"PG",name:"Papua New Guinea",dialCode:"+675"},{iso2:"PY",name:"Paraguay",dialCode:"+595"},{iso2:"PE",name:"Peru",dialCode:"+51"},{iso2:"PH",name:"Philippines",dialCode:"+63"},{iso2:"PN",name:"Pitcairn",dialCode:"+64"},{iso2:"PL",name:"Poland",dialCode:"+48"},{iso2:"PT",name:"Portugal",dialCode:"+351"},{iso2:"PR",name:"Puerto Rico",dialCode:"+1-787"},{iso2:"QA",name:"Qatar",dialCode:"+974"},{iso2:"RE",name:"Reunion",dialCode:"+262"},{iso2:"RO",name:"Romania",dialCode:"+40"},{iso2:"RU",name:"Russia",dialCode:"+7"},{iso2:"RW",name:"Rwanda",dialCode:"+250"},{iso2:"BL",name:"Saint Barthelemy",dialCode:"+590"},{iso2:"SH",name:"Saint Helena",dialCode:"+290"},{iso2:"KN",name:"Saint Kitts and Nevis",dialCode:"+1-869"},{iso2:"LC",name:"Saint Lucia",dialCode:"+1-758"},{iso2:"MF",name:"Saint Martin",dialCode:"+590"},{iso2:"PM",name:"Saint Pierre and Miquelon",dialCode:"+508"},{iso2:"VC",name:"Saint Vincent and the Grenadines",dialCode:"+1-784"},{iso2:"WS",name:"Samoa",dialCode:"+685"},{iso2:"SM",name:"San Marino",dialCode:"+378"},{iso2:"ST",name:"Sao Tome and Principe",dialCode:"+239"},{iso2:"SA",name:"Saudi Arabia",dialCode:"+966"},{iso2:"SN",name:"Senegal",dialCode:"+221"},{iso2:"RS",name:"Serbia",dialCode:"+381"},{iso2:"SC",name:"Seychelles",dialCode:"+248"},{iso2:"SL",name:"Sierra Leone",dialCode:"+232"},{iso2:"SG",name:"Singapore",dialCode:"+65"},{iso2:"SX",name:"Sint Maarten",dialCode:"+1-721"},{iso2:"SK",name:"Slovakia",dialCode:"+421"},{iso2:"SI",name:"Slovenia",dialCode:"+386"},{iso2:"SB",name:"Solomon Islands",dialCode:"+677"},{iso2:"SO",name:"Somalia",dialCode:"+252"},{iso2:"ZA",name:"South Africa",dialCode:"+27"},{iso2:"GS",name:"South Georgia and the South Sandwich Islands",dialCode:"+500"},{iso2:"SS",name:"South Sudan",dialCode:"+211"},{iso2:"ES",name:"Spain",dialCode:"+34"},{iso2:"LK",name:"Sri Lanka",dialCode:"+94"},{iso2:"SD",name:"Sudan",dialCode:"+249"},{iso2:"SR",name:"Suriname",dialCode:"+597"},{iso2:"SJ",name:"Svalbard and Jan Mayen",dialCode:"+47"},{iso2:"SZ",name:"Swaziland",dialCode:"+268"},{iso2:"SE",name:"Sweden",dialCode:"+46"},{iso2:"CH",name:"Switzerland",dialCode:"+41"},{iso2:"SY",name:"Syria",dialCode:"+963"},{iso2:"TW",name:"Taiwan",dialCode:"+886"},{iso2:"TJ",name:"Tajikistan",dialCode:"+992"},{iso2:"TZ",name:"Tanzania",dialCode:"+255"},{iso2:"TH",name:"Thailand",dialCode:"+66"},{iso2:"TL",name:"Timor-Leste",dialCode:"+670"},{iso2:"TG",name:"Togo",dialCode:"+228"},{iso2:"TK",name:"Tokelau",dialCode:"+690"},{iso2:"TO",name:"Tonga",dialCode:"+676"},{iso2:"TT",name:"Trinidad and Tobago",dialCode:"+1-868"},{iso2:"TN",name:"Tunisia",dialCode:"+216"},{iso2:"TR",name:"Turkey",dialCode:"+90"},{iso2:"TM",name:"Turkmenistan",dialCode:"+993"},{iso2:"TC",name:"Turks and Caicos Islands",dialCode:"+1-649"},{iso2:"TV",name:"Tuvalu",dialCode:"+688"},{iso2:"UG",name:"Uganda",dialCode:"+256"},{iso2:"UA",name:"Ukraine",dialCode:"+380"},{iso2:"AE",name:"United Arab Emirates",dialCode:"+971"},{iso2:"GB",name:"United Kingdom",dialCode:"+44"},{iso2:"US",name:"United States",dialCode:"+1"},{iso2:"UY",name:"Uruguay",dialCode:"+598"},{iso2:"UZ",name:"Uzbekistan",dialCode:"+998"},{iso2:"VU",name:"Vanuatu",dialCode:"+678"},{iso2:"VA",name:"Vatican City",dialCode:"+379"},{iso2:"VE",name:"Venezuela",dialCode:"+58"},{iso2:"VN",name:"Vietnam",dialCode:"+84"},{iso2:"VG",name:"British Virgin Islands",dialCode:"+1-284"},{iso2:"VI",name:"US Virgin Islands",dialCode:"+1-340"},{iso2:"WF",name:"Wallis and Futuna",dialCode:"+681"},{iso2:"EH",name:"Western Sahara",dialCode:"+212"},{iso2:"YE",name:"Yemen",dialCode:"+967"},{iso2:"ZM",name:"Zambia",dialCode:"+260"},{iso2:"ZW",name:"Zimbabwe",dialCode:"+263"}],xe=r=>{const t=r.toUpperCase().split("").map(o=>127397+o.charCodeAt(0));return String.fromCodePoint(...t)},ht=()=>{if(typeof navigator>"u")return null;const t=(navigator.language||"").match(/[-_](\w{2})$/);return t?t[1].toUpperCase():null},_e=({value:r,onChange:t,country:o,defaultCountry:a="US",autoDetect:s=!0,onCountryChange:d,label:i,error:n,hint:l,searchable:m=!0,showFlags:c=!0,animate:x=!0,disabled:j,className:N,placeholder:w,...C})=>{const h=x!==!1,[k,P]=S.useState(!1),[z,M]=S.useState(""),[L,G]=S.useState(a),T=S.useRef(null);S.useEffect(()=>{o&&G(o.toUpperCase())},[o]),S.useEffect(()=>{if(!o&&s){const p=ht();p&&G(p)}},[s,o]),S.useEffect(()=>{const p=I=>{T.current&&!T.current.contains(I.target)&&(P(!1),M(""))};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const f=S.useMemo(()=>{const p=(o||L||a).toUpperCase();return ie.find(I=>I.iso2===p)||ie[0]},[o,L,a]),E=S.useMemo(()=>{if(!m||!z.trim())return ie;const p=z.toLowerCase();return ie.filter(I=>I.name.toLowerCase().includes(p)||I.iso2.toLowerCase().includes(p)||I.dialCode.replace(/\s/g,"").includes(p.replace(/\s/g,"")))},[z,m]),B=p=>{o||G(p.iso2),d?.(p),P(!1),M("")};return e.jsxs("div",{ref:T,className:u("w-full space-y-1.5",N),children:[i&&e.jsx("label",{className:"block text-sm font-medium text-foreground",children:i}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:u("flex items-stretch rounded-md border transition-all duration-200 bg-background","focus-within:ring-2 focus-within:ring-primary focus-within:border-transparent","disabled:bg-secondary disabled:cursor-not-allowed",n?"border-error":"border-border"),children:[e.jsxs("button",{type:"button",onClick:()=>!j&&P(!k),disabled:j,className:u("flex items-center gap-2 px-3 py-2 text-left","border-r border-border/70","hover:bg-secondary transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),"aria-haspopup":"listbox","aria-expanded":k,children:[c&&e.jsx("span",{className:"text-base","aria-hidden":!0,children:xe(f.iso2)}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:f.dialCode}),e.jsx(v.ChevronDown,{className:u("w-4 h-4 text-primary transition-transform",k&&"rotate-180")})]}),e.jsx("input",{type:"tel",inputMode:"tel",value:r??"",onChange:p=>t?.(p.target.value),placeholder:w||"Phone number",disabled:j,className:u("flex-1 px-4 py-2.5 text-base bg-transparent text-foreground","placeholder:text-foreground/50 focus:outline-none","disabled:opacity-50 disabled:cursor-not-allowed"),...C})]}),h?e.jsx(b.AnimatePresence,{children:k?e.jsxs(b.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},role:"listbox",className:"absolute right-0 z-50 mt-2 w-max min-w-56 max-w-none bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[m&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(v.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search country or code",value:z,onChange:p=>M(p.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"}),z&&e.jsx("button",{type:"button",onClick:()=>M(""),className:"absolute right-2 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:e.jsx(v.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsx("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:E.map(p=>e.jsxs("button",{type:"button",role:"option","aria-selected":p.iso2===f.iso2,onClick:()=>B(p),className:u("w-full px-3 py-2 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors",p.iso2===f.iso2&&"bg-border text-foreground"),children:[c&&e.jsx("span",{className:"text-base","aria-hidden":!0,children:xe(p.iso2)}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:p.name}),e.jsx("span",{className:"ml-auto text-xs text-primary/70",children:p.dialCode})]},p.iso2))})]}):null}):k&&e.jsxs("div",{role:"listbox",className:"absolute right-0 z-50 mt-2 w-max min-w-56 max-w-none bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[m&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(v.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search country or code",value:z,onChange:p=>M(p.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"}),z&&e.jsx("button",{type:"button",onClick:()=>M(""),className:"absolute right-2 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:e.jsx(v.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsx("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:E.map(p=>e.jsxs("button",{type:"button",role:"option","aria-selected":p.iso2===f.iso2,onClick:()=>B(p),className:u("w-full px-3 py-2 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors",p.iso2===f.iso2&&"bg-border text-foreground"),children:[c&&e.jsx("span",{className:"text-base","aria-hidden":!0,children:xe(p.iso2)}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:p.name}),e.jsx("span",{className:"ml-auto text-xs text-primary/70",children:p.dialCode})]},p.iso2))})]})]}),n&&e.jsx(b.motion.p,{...h?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"text-sm text-error",children:n}),l&&!n&&e.jsx("p",{className:"text-sm text-primary/70",children:l})]})};_e.displayName="PhoneInput";const ft=({items:r,onRemove:t,onView:o,columns:a=3,className:s,animate:d=!0})=>{const i=d!==!1,n={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4"},l=c=>{if(!c)return"";const x=c/1024;return x<1024?`${x.toFixed(1)} KB`:`${(x/1024).toFixed(1)} MB`},m=c=>{switch(c){case"document":return e.jsx(v.FileText,{className:"w-8 h-8 text-primary"});case"audio":return e.jsx(v.FileText,{className:"w-8 h-8 text-primary"});default:return e.jsx(v.Image,{className:"w-8 h-8 text-primary"})}};return r.length===0?null:e.jsx("div",{className:u("w-full",s),children:e.jsx("div",{className:u("grid gap-3",n[a]),children:r.map(c=>e.jsxs(b.motion.div,{...i?{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}}:{},className:"relative group",children:[e.jsx("div",{onClick:()=>o?.(c),className:u("aspect-square rounded-lg overflow-hidden border-2 border-border","flex items-center justify-center","cursor-pointer hover:border-border-dark transition-all",c.type==="image"?"bg-border":"bg-secondary"),children:c.type==="image"?e.jsx("img",{src:c.url,alt:c.name,className:"w-full h-full object-cover"}):e.jsxs("div",{className:"flex flex-col items-center gap-2 p-3",children:[m(c.type),e.jsx("p",{className:"text-xs text-center text-primary line-clamp-2",children:c.name})]})}),t&&e.jsx(b.motion.button,{...i?{initial:{opacity:0},whileHover:{opacity:1}}:{},className:"absolute -top-2 -right-2 p-1.5 bg-error text-white rounded-full shadow-lg hover:bg-red-600 opacity-0 group-hover:opacity-100 transition-opacity",onClick:x=>{x.stopPropagation(),t(c.id)},children:e.jsx(v.X,{className:"w-4 h-4"})}),c.size&&e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-black/60 text-white text-xs p-1.5 backdrop-blur-sm",children:[e.jsx("p",{className:"truncate",children:c.name}),e.jsx("p",{className:"text-white/70",children:l(c.size)})]})]},c.id))})})},gt=({text:r="Built by StackLoop",showHeart:t=!0,href:o,position:a="fixed",backgroundColor:s="bg-gray-900",textColor:d="text-gray-400",className:i=""})=>{const n=t?e.jsxs(e.Fragment,{children:["Built with ",e.jsx("span",{className:"text-red-500 mx-1",children:"❤️"})," by ",r.replace(/^Built by /,"")]}):r,l=o?e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:`${d} hover:text-white transition-colors duration-200 text-sm`,children:n}):e.jsx("span",{className:`${d} text-sm`,children:n});return e.jsx("div",{className:`${a} bottom-0 left-0 right-0 ${s} ${i}`,style:{zIndex:40},children:e.jsx("div",{className:"flex items-center justify-center py-2 px-4",children:l})})};exports.AudioRecorder=bt;exports.Badge=ot;exports.BottomSheet=Qr;exports.Button=de;exports.CameraCapture=pt;exports.Card=Wr;exports.CardContent=qr;exports.CardDescription=$r;exports.CardHeader=Hr;exports.CardTitle=Yr;exports.Checkbox=Ve;exports.CreditBar=gt;exports.DatePicker=Kr;exports.Drawer=_r;exports.Dropdown=Vr;exports.DualSlider=Ur;exports.FAB=tt;exports.FileUploader=xt;exports.FloatingActionButton=He;exports.Input=Oe;exports.Modal=Jr;exports.ModalContent=Xr;exports.ModalFooter=Zr;exports.OfflineBadge=st;exports.Pagination=rt;exports.PhoneInput=_e;exports.RadioPills=Fr;exports.Select=We;exports.Slider=Or;exports.Spinner=Ye;exports.StepProgress=at;exports.SyncIndicator=nt;exports.Table=et;exports.Textarea=Ue;exports.ThumbnailGrid=ft;exports.ToastProvider=qe;exports.Toggle=Ke;exports.cn=u;exports.useToast=dt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("react"),b=require("framer-motion"),C=require("lucide-react");function Me(r){var t,o,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(t=0;t<s;t++)r[t]&&(o=Me(r[t]))&&(a&&(a+=" "),a+=o)}else for(o in r)r[o]&&(a&&(a+=" "),a+=o);return a}function Xe(){for(var r,t,o=0,a="",s=arguments.length;o<s;o++)(r=arguments[o])&&(t=Me(r))&&(a&&(a+=" "),a+=t);return a}const Ze=(r,t)=>{const o=new Array(r.length+t.length);for(let a=0;a<r.length;a++)o[a]=r[a];for(let a=0;a<t.length;a++)o[r.length+a]=t[a];return o},Qe=(r,t)=>({classGroupId:r,validator:t}),Te=(r=new Map,t=null,o)=>({nextPart:r,validators:t,classGroupId:o}),le="-",Ce=[],er="arbitrary..",rr=r=>{const t=ar(r),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=r;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return tr(i);const n=i.split(le),l=n[0]===""&&n.length>1?1:0;return Re(n,l,t)},getConflictingClassGroupIds:(i,n)=>{if(n){const l=a[i],m=o[i];return l?m?Ze(m,l):l:m||Ce}return o[i]||Ce}}},Re=(r,t,o)=>{if(r.length-t===0)return o.classGroupId;const s=r[t],d=o.nextPart.get(s);if(d){const m=Re(r,t+1,d);if(m)return m}const i=o.validators;if(i===null)return;const n=t===0?r.join(le):r.slice(t).join(le),l=i.length;for(let m=0;m<l;m++){const c=i[m];if(c.validator(n))return c.classGroupId}},tr=r=>r.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=r.slice(1,-1),o=t.indexOf(":"),a=t.slice(0,o);return a?er+a:void 0})(),ar=r=>{const{theme:t,classGroups:o}=r;return or(o,t)},or=(r,t)=>{const o=Te();for(const a in r){const s=r[a];he(s,o,a,t)}return o},he=(r,t,o,a)=>{const s=r.length;for(let d=0;d<s;d++){const i=r[d];sr(i,t,o,a)}},sr=(r,t,o,a)=>{if(typeof r=="string"){nr(r,t,o);return}if(typeof r=="function"){ir(r,t,o,a);return}lr(r,t,o,a)},nr=(r,t,o)=>{const a=r===""?t:Ie(t,r);a.classGroupId=o},ir=(r,t,o,a)=>{if(dr(r)){he(r(a),t,o,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Qe(o,r))},lr=(r,t,o,a)=>{const s=Object.entries(r),d=s.length;for(let i=0;i<d;i++){const[n,l]=s[i];he(l,Ie(t,n),o,a)}},Ie=(r,t)=>{let o=r;const a=t.split(le),s=a.length;for(let d=0;d<s;d++){const i=a[d];let n=o.nextPart.get(i);n||(n=Te(),o.nextPart.set(i,n)),o=n}return o},dr=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,cr=r=>{if(r<1)return{get:()=>{},set:()=>{}};let t=0,o=Object.create(null),a=Object.create(null);const s=(d,i)=>{o[d]=i,t++,t>r&&(t=0,a=o,o=Object.create(null))};return{get(d){let i=o[d];if(i!==void 0)return i;if((i=a[d])!==void 0)return s(d,i),i},set(d,i){d in o?o[d]=i:s(d,i)}}},be="!",je=":",mr=[],Ne=(r,t,o,a,s)=>({modifiers:r,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:a,isExternal:s}),ur=r=>{const{prefix:t,experimentalParseClassName:o}=r;let a=s=>{const d=[];let i=0,n=0,l=0,m;const c=s.length;for(let j=0;j<c;j++){const h=s[j];if(i===0&&n===0){if(h===je){d.push(s.slice(l,j)),l=j+1;continue}if(h==="/"){m=j;continue}}h==="["?i++:h==="]"?i--:h==="("?n++:h===")"&&n--}const x=d.length===0?s:s.slice(l);let N=x,v=!1;x.endsWith(be)?(N=x.slice(0,-1),v=!0):x.startsWith(be)&&(N=x.slice(1),v=!0);const w=m&&m>l?m-l:void 0;return Ne(d,v,N,w)};if(t){const s=t+je,d=a;a=i=>i.startsWith(s)?d(i.slice(s.length)):Ne(mr,!1,i,void 0,!0)}if(o){const s=a;a=d=>o({className:d,parseClassName:s})}return a},pr=r=>{const t=new Map;return r.orderSensitiveModifiers.forEach((o,a)=>{t.set(o,1e6+a)}),o=>{const a=[];let s=[];for(let d=0;d<o.length;d++){const i=o[d],n=i[0]==="[",l=t.has(i);n||l?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(i)):s.push(i)}return s.length>0&&(s.sort(),a.push(...s)),a}},xr=r=>({cache:cr(r.cacheSize),parseClassName:ur(r),sortModifiers:pr(r),...rr(r)}),br=/\s+/,hr=(r,t)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:d}=t,i=[],n=r.trim().split(br);let l="";for(let m=n.length-1;m>=0;m-=1){const c=n[m],{isExternal:x,modifiers:N,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:j}=o(c);if(x){l=c+(l.length>0?" "+l:l);continue}let h=!!j,k=a(h?w.substring(0,j):w);if(!k){if(!h){l=c+(l.length>0?" "+l:l);continue}if(k=a(w),!k){l=c+(l.length>0?" "+l:l);continue}h=!1}const P=N.length===0?"":N.length===1?N[0]:d(N).join(":"),z=v?P+be:P,M=z+k;if(i.indexOf(M)>-1)continue;i.push(M);const L=s(k,h);for(let E=0;E<L.length;++E){const T=L[E];i.push(z+T)}l=c+(l.length>0?" "+l:l)}return l},fr=(...r)=>{let t=0,o,a,s="";for(;t<r.length;)(o=r[t++])&&(a=ze(o))&&(s&&(s+=" "),s+=a);return s},ze=r=>{if(typeof r=="string")return r;let t,o="";for(let a=0;a<r.length;a++)r[a]&&(t=ze(r[a]))&&(o&&(o+=" "),o+=t);return o},gr=(r,...t)=>{let o,a,s,d;const i=l=>{const m=t.reduce((c,x)=>x(c),r());return o=xr(m),a=o.cache.get,s=o.cache.set,d=n,n(l)},n=l=>{const m=a(l);if(m)return m;const c=hr(l,o);return s(l,c),c};return d=i,(...l)=>d(fr(...l))},yr=[],D=r=>{const t=o=>o[r]||yr;return t.isThemeGetter=!0,t},Pe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Le=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wr=/^\d+\/\d+$/,vr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cr=/\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$/,jr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Nr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,X=r=>wr.test(r),R=r=>!!r&&!Number.isNaN(Number(r)),_=r=>!!r&&Number.isInteger(Number(r)),ue=r=>r.endsWith("%")&&R(r.slice(0,-1)),q=r=>vr.test(r),Sr=()=>!0,Ar=r=>Cr.test(r)&&!jr.test(r),Ee=()=>!1,Mr=r=>Nr.test(r),Tr=r=>kr.test(r),Rr=r=>!g(r)&&!y(r),Ir=r=>Q(r,De,Ee),g=r=>Pe.test(r),J=r=>Q(r,Fe,Ar),pe=r=>Q(r,Gr,R),ke=r=>Q(r,Ge,Ee),zr=r=>Q(r,Be,Tr),ne=r=>Q(r,Oe,Mr),y=r=>Le.test(r),re=r=>ee(r,Fe),Pr=r=>ee(r,Br),Se=r=>ee(r,Ge),Lr=r=>ee(r,De),Er=r=>ee(r,Be),ie=r=>ee(r,Oe,!0),Q=(r,t,o)=>{const a=Pe.exec(r);return a?a[1]?t(a[1]):o(a[2]):!1},ee=(r,t,o=!1)=>{const a=Le.exec(r);return a?a[1]?t(a[1]):o:!1},Ge=r=>r==="position"||r==="percentage",Be=r=>r==="image"||r==="url",De=r=>r==="length"||r==="size"||r==="bg-size",Fe=r=>r==="length",Gr=r=>r==="number",Br=r=>r==="family-name",Oe=r=>r==="shadow",Dr=()=>{const r=D("color"),t=D("font"),o=D("text"),a=D("font-weight"),s=D("tracking"),d=D("leading"),i=D("breakpoint"),n=D("container"),l=D("spacing"),m=D("radius"),c=D("shadow"),x=D("inset-shadow"),N=D("text-shadow"),v=D("drop-shadow"),w=D("blur"),j=D("perspective"),h=D("aspect"),k=D("ease"),P=D("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...M(),y,g],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],f=()=>[y,g,l],G=()=>[X,"full","auto",...f()],B=()=>[_,"none","subgrid",y,g],p=()=>["auto",{span:["full",_,y,g]},_,y,g],I=()=>[_,"auto",y,g],V=()=>["auto","min","max","fr",y,g],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...f()],$=()=>[X,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...f()],A=()=>[r,y,g],Y=()=>[...M(),Se,ke,{position:[y,g]}],ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ye=()=>["auto","cover","contain",Lr,Ir,{size:[y,g]}],ce=()=>[ue,re,J],U=()=>["","none","full",m,y,g],K=()=>["",R,re,J],te=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>[R,ue,Se,ke],ve=()=>["","none",w,y,g],ae=()=>["none",R,y,g],oe=()=>["none",R,y,g],me=()=>[R,y,g],se=()=>[X,"full",...f()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[Sr],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[Rr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",R],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",X,g,y,h]}],container:["container"],columns:[{columns:[R,g,y,n]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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"],sr:["sr-only","not-sr-only"],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:L()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[_,"auto",y,g]}],basis:[{basis:[X,"full","auto",n,...f()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[R,X,"auto","initial","none",g]}],grow:[{grow:["",R,y,g]}],shrink:[{shrink:["",R,y,g]}],order:[{order:[_,"first","last","none",y,g]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:p()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:p()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:f()}],"gap-x":[{"gap-x":f()}],"gap-y":[{"gap-y":f()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":f()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":f()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[n,"screen",...$()]}],"min-w":[{"min-w":[n,"screen","none",...$()]}],"max-w":[{"max-w":[n,"screen","none","prose",{screen:[i]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",o,re,J]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,y,pe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ue,g]}],"font-family":[{font:[Pr,g,t]}],"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:[s,y,g]}],"line-clamp":[{"line-clamp":[R,"none",y,pe]}],leading:[{leading:[d,...f()]}],"list-image":[{"list-image":["none",y,g]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",y,g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[R,"from-font","auto",y,J]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[R,"auto",y,g]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:f()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",y,g]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",y,g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:ge()}],"bg-size":[{bg:ye()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},_,y,g],radial:["",y,g],conic:[_,y,g]},Er,zr]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"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:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[R,y,g]}],"outline-w":[{outline:["",R,re,J]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",c,ie,ne]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",x,ie,ne]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[R,J]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",N,ie,ne]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[R,y,g]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[R]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[y,g]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[R]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:ge()}],"mask-size":[{mask:ye()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",y,g]}],filter:[{filter:["","none",y,g]}],blur:[{blur:ve()}],brightness:[{brightness:[R,y,g]}],contrast:[{contrast:[R,y,g]}],"drop-shadow":[{"drop-shadow":["","none",v,ie,ne]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",R,y,g]}],"hue-rotate":[{"hue-rotate":[R,y,g]}],invert:[{invert:["",R,y,g]}],saturate:[{saturate:[R,y,g]}],sepia:[{sepia:["",R,y,g]}],"backdrop-filter":[{"backdrop-filter":["","none",y,g]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[R,y,g]}],"backdrop-contrast":[{"backdrop-contrast":[R,y,g]}],"backdrop-grayscale":[{"backdrop-grayscale":["",R,y,g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R,y,g]}],"backdrop-invert":[{"backdrop-invert":["",R,y,g]}],"backdrop-opacity":[{"backdrop-opacity":[R,y,g]}],"backdrop-saturate":[{"backdrop-saturate":[R,y,g]}],"backdrop-sepia":[{"backdrop-sepia":["",R,y,g]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":f()}],"border-spacing-x":[{"border-spacing-x":f()}],"border-spacing-y":[{"border-spacing-y":f()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",y,g]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[R,"initial",y,g]}],ease:[{ease:["linear","initial",k,y,g]}],delay:[{delay:[R,y,g]}],animate:[{animate:["none",P,y,g]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,y,g]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[y,g,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",y,g]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-pe":[{"scroll-pe":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"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",y,g]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[R,re,J,pe]}],stroke:[{stroke:["none",...A()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Fr=gr(Dr);function u(...r){return Fr(Xe(r))}const de=S.forwardRef(({variant:r="primary",size:t="md",loading:o,icon:a,animate:s=!0,className:d,children:i,disabled:n,...l},m)=>{const c=s!==!1,x="inline-flex items-center justify-center gap-2 font-medium rounded-md transition-all duration-200 touch-target disabled:opacity-50 disabled:cursor-not-allowed active:scale-[0.98] flex-shrink-0 whitespace-nowrap",N={primary:"bg-primary text-white hover:bg-primary-dark active:bg-primary-dark/90 shadow-sm",secondary:"bg-secondary text-foreground hover:bg-border active:bg-border-dark",outline:"bg-transparent text-primary border-2 border-primary hover:bg-secondary active:bg-border",ghost:"bg-transparent text-primary hover:bg-secondary active:bg-border",danger:"bg-error text-white hover:bg-red-600 active:bg-red-700 shadow-sm"},v={sm:"px-3 py-2 text-sm min-h-[2.25rem]",md:"px-4 py-2.5 text-base min-h-[2.75rem]",lg:"px-6 py-3.5 text-lg min-h-[3.25rem]"};return e.jsxs(b.motion.button,{ref:m,whileTap:c?{scale:n||o?1:.98}:void 0,className:u(x,N[r],v[t],d),disabled:n||o,...l,children:[o?e.jsx(C.Loader2,{className:u("h-5 w-5",c&&"animate-spin")}):a?e.jsx("span",{className:"flex-shrink-0",children:a}):null,i]})});de.displayName="Button";const Ue=S.forwardRef(({label:r,error:t,hint:o,leftIcon:a,rightIcon:s,animate:d=!0,className:i,type:n,...l},m)=>{const c=d!==!1,[x,N]=S.useState(!1),v=n==="password",w=v&&x?"text":n;return e.jsxs("div",{className:"w-full space-y-1.5",children:[r&&e.jsxs("label",{className:"block text-sm font-medium text-foreground",children:[r,l.required&&e.jsx("span",{className:"text-error ml-1",children:"*"})]}),e.jsxs("div",{className:"relative",children:[a&&e.jsx("div",{className:"absolute flex items-center pointer-events-none text-primary",style:{left:"14px",top:"50%",transform:"translateY(-50%)"},children:a}),e.jsx("input",{ref:m,type:w,className:u("w-full rounded-md border transition-all duration-200","bg-background text-foreground placeholder:text-foreground/50","focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent","disabled:bg-secondary disabled:cursor-not-allowed","touch-target text-base",t&&"border-error focus:ring-error",!t&&"border-border",i),style:{paddingTop:"12px",paddingBottom:"12px",paddingLeft:a?"44px":"16px",paddingRight:s||v?"44px":"16px"},...l}),v&&e.jsx(b.motion.button,{type:"button",onClick:()=>N(!x),className:"absolute text-primary hover:text-primary-dark transition-colors",style:{right:"14px",top:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},"aria-label":x?"Hide password":"Show password",whileTap:c?{scale:.9,y:"-50%"}:void 0,animate:{y:"-50%"},transition:c?{duration:.1}:{duration:0},children:x?e.jsx(C.EyeOff,{className:"w-5 h-5"}):e.jsx(C.Eye,{className:"w-5 h-5"})}),s&&!v&&e.jsx("div",{className:"absolute flex items-center pointer-events-none text-primary",style:{right:"14px",top:"50%",transform:"translateY(-50%)"},children:s})]}),t&&e.jsx(b.motion.p,{...c?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"text-sm text-error",children:t}),o&&!t&&e.jsx("p",{className:"text-sm text-primary/70",children:o})]})});Ue.displayName="Input";const Ve=S.forwardRef(({label:r,error:t,helperText:o,className:a,required:s,animate:d=!0,...i},n)=>{const l=d!==!1;return e.jsxs(b.motion.div,{...l?{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3}}:{},className:"w-full",children:[r&&e.jsxs("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:[r,s&&e.jsx("span",{className:"text-error ml-1",children:"*"})]}),e.jsx("textarea",{ref:n,className:u("w-full px-4 py-3 bg-background border border-border rounded-md","text-foreground placeholder:text-foreground/50","focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent","disabled:bg-secondary disabled:opacity-50 disabled:cursor-not-allowed","transition-all duration-200 resize-vertical","text-base touch-target",t&&"border-error focus:ring-error",a),...i}),t&&e.jsx(b.motion.p,{...l?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"mt-1 text-sm text-error",children:t}),o&&!t&&e.jsx("p",{className:"mt-1 text-sm text-primary/70",children:o})]})});Ve.displayName="Textarea";const Ke=S.forwardRef(({label:r,description:t,className:o,checked:a,defaultChecked:s,onChange:d,animate:i=!0,...n},l)=>{const m=i!==!1,[c,x]=S.useState(s||!1),N=a!==void 0?a:c,v=w=>{a===void 0&&x(w.target.checked),d?.(w.target.checked)};return e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[e.jsxs("div",{className:"relative flex-shrink-0 mt-0.5",children:[e.jsx("input",{ref:l,type:"checkbox",className:"sr-only peer",checked:N,onChange:v,...n}),e.jsx(b.motion.div,{className:u("w-6 h-6 rounded-md border-2 transition-all duration-200","peer-focus:ring-2 peer-focus:ring-primary peer-focus:ring-offset-2","peer-disabled:opacity-50 peer-disabled:cursor-not-allowed","flex items-center justify-center",N?"bg-primary border-primary":"border-border bg-secondary",o),whileTap:m?{scale:.95}:void 0,children:e.jsx(C.Check,{className:u("w-4 h-4 text-white transition-opacity duration-200",N?"opacity-100":"opacity-0")})})]}),(r||t)&&e.jsxs("div",{className:"flex-1 space-y-0.5",children:[r&&e.jsx("div",{className:"text-base font-medium text-foreground group-hover:text-primary transition-colors",children:r}),t&&e.jsx("div",{className:"text-sm text-primary/70",children:t})]})]})});Ke.displayName="Checkbox";const Or=({options:r,value:t,onChange:o,name:a,disabled:s,className:d,animate:i=!0})=>{const n=i!==!1;return e.jsx("div",{className:u("flex flex-wrap gap-2",d),children:r.map(l=>{const m=t===l.value;return e.jsxs("label",{className:"relative cursor-pointer",children:[e.jsx("input",{type:"radio",name:a,value:l.value,checked:m,onChange:c=>o?.(c.target.value),disabled:s,className:"sr-only peer"}),e.jsxs(b.motion.div,{whileTap:n?{scale:s?1:.95}:void 0,className:u("px-4 py-2.5 rounded-full border-2 transition-all duration-200","flex items-center gap-2 min-h-[2.75rem]","peer-focus:ring-2 peer-focus:ring-primary peer-focus:ring-offset-2","peer-disabled:opacity-50 peer-disabled:cursor-not-allowed",m?"bg-primary border-primary text-white":"bg-background border-border text-primary hover:border-border-dark"),children:[l.icon&&e.jsx("span",{className:"flex-shrink-0",children:l.icon}),e.jsx("span",{className:"font-medium text-base",children:l.label})]})]},l.value)})})},We=S.forwardRef(({label:r,description:t,className:o,checked:a,onChange:s,animate:d=!0,...i},n)=>{const l=d!==!1,m=c=>{s?.(c.target.checked)};return e.jsxs("label",{className:"flex items-center justify-between gap-4 cursor-pointer group",children:[(r||t)&&e.jsxs("div",{className:"flex-1 space-y-0.5",children:[r&&e.jsx("div",{className:"text-base font-medium text-foreground",children:r}),t&&e.jsx("div",{className:"text-sm text-primary/70",children:t})]}),e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsx("input",{ref:n,type:"checkbox",onChange:m,className:"sr-only peer",checked:a,...i}),e.jsx("div",{className:u("w-12 h-7 rounded-full transition-all duration-200 relative","peer-focus:ring-2 peer-focus:ring-primary peer-focus:ring-offset-2","peer-disabled:opacity-50 peer-disabled:cursor-not-allowed",a?"bg-primary":"bg-border-dark",o),children:e.jsx(b.motion.div,{className:"absolute top-1 w-5 h-5 bg-white rounded-full shadow-sm",style:{left:a?"24px":"4px"},animate:l?{left:a?"24px":"4px"}:void 0,transition:l?{type:"spring",stiffness:500,damping:30}:{duration:0}})})]})]})});We.displayName="Toggle";const Ur=({value:r,onChange:t,min:o=0,max:a=100,step:s=1,label:d,showValue:i=!0,unit:n="%",disabled:l,className:m,animate:c=!0})=>{const x=c!==!1,[N,v]=S.useState(!1),w=(r-o)/(a-o)*100;return e.jsxs("div",{className:u("w-full space-y-2",m),children:[(d||i)&&e.jsxs("div",{className:"flex items-center justify-between",children:[d&&e.jsx("label",{className:"text-sm font-medium text-primary",children:d}),i&&e.jsxs("span",{className:"text-sm font-semibold text-primary",children:[r,n]})]}),e.jsxs("div",{className:"relative h-12 flex items-center",children:[e.jsx("div",{className:"relative w-full h-2 bg-border rounded-full overflow-hidden",children:e.jsx(b.motion.div,{className:"absolute left-0 top-0 h-full bg-primary rounded-full",style:{width:`${w}%`},initial:!1,animate:x?{width:`${w}%`}:void 0,transition:x?{type:"spring",stiffness:300,damping:30}:{duration:0}})}),e.jsx("input",{type:"range",min:o,max:a,step:s,value:r,onChange:j=>t(Number(j.target.value)),onMouseDown:()=>v(!0),onMouseUp:()=>v(!1),onTouchStart:()=>v(!0),onTouchEnd:()=>v(!1),disabled:l,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer disabled:cursor-not-allowed",style:{zIndex:10}}),e.jsx(b.motion.div,{className:u("absolute w-6 h-6 bg-background border-2 border-primary rounded-full shadow-md","pointer-events-none",l&&"opacity-50"),style:{left:`calc(${w}% - 12px)`},animate:x?{scale:N?1.2:1}:void 0,transition:x?{type:"spring",stiffness:300,damping:20}:{duration:0}})]})]})},Vr=({value1:r,value2:t,onChange:o,label1:a,label2:s,min:d=0,max:i=100,step:n=1,unit:l="%",disabled:m,className:c,animate:x=!0})=>{const N=x!==!1,v=r+t,w=v>0?r/v*100:50,j=v>0?t/v*100:50,h=k=>{const P=i-k;o(k,Math.max(d,Math.min(i,P)))};return e.jsxs("div",{className:u("w-full space-y-3",c),children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm font-medium text-primary",children:a}),e.jsxs("span",{className:"text-sm font-semibold text-primary",children:[r,l]})]}),e.jsxs("div",{className:"relative h-10 flex items-center",children:[e.jsx("div",{className:"w-full h-2 bg-border rounded-full overflow-hidden",children:e.jsx(b.motion.div,{className:"h-full bg-primary",initial:!1,animate:N?{width:`${w}%`}:void 0,transition:N?{type:"spring",stiffness:300,damping:30}:{duration:0}})}),e.jsx("input",{type:"range",min:d,max:i,step:n,value:r,onChange:k=>h(Number(k.target.value)),disabled:m,className:"absolute inset-0 w-full opacity-0 cursor-pointer disabled:cursor-not-allowed"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm font-medium text-primary",children:s}),e.jsxs("span",{className:"text-sm font-semibold text-success",children:[t,l]})]}),e.jsxs("div",{className:"relative h-10 flex items-center",children:[e.jsx("div",{className:"w-full h-2 bg-border rounded-full overflow-hidden",children:e.jsx(b.motion.div,{className:"h-full bg-success",initial:!1,animate:N?{width:`${j}%`}:void 0,transition:N?{type:"spring",stiffness:300,damping:30}:{duration:0}})}),e.jsx("input",{type:"range",min:d,max:i,step:n,value:t,onChange:k=>h(i-Number(k.target.value)),disabled:m,className:"absolute inset-0 w-full opacity-0 cursor-pointer disabled:cursor-not-allowed"})]})]}),e.jsxs("div",{className:"text-xs text-primary/70 text-center",children:["Total: ",v,l]})]})},Kr=({options:r,value:t,onChange:o,placeholder:a="Select an option",label:s,error:d,searchable:i=!1,clearable:n=!0,disabled:l,className:m,animate:c=!0})=>{const x=c!==!1,[N,v]=S.useState(!1),[w,j]=S.useState(""),h=S.useRef(null),k=r.find(M=>M.value===t),P=i?r.filter(M=>M.label.toLowerCase().includes(w.toLowerCase())):r;S.useEffect(()=>{const M=L=>{h.current&&!h.current.contains(L.target)&&(v(!1),j(""))};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]);const z=M=>{o(M),v(!1),j("")};return e.jsxs("div",{ref:h,className:u("relative w-full",m),children:[s&&e.jsx("label",{className:"block mb-1.5 text-sm font-medium text-foreground",children:s}),e.jsxs("button",{type:"button",onClick:()=>!l&&v(!N),disabled:l,className:u("w-full px-4 py-3 rounded-md border transition-all duration-200","bg-background text-left flex items-center justify-between gap-2","focus:outline-none focus:ring-2 focus:ring-primary","disabled:bg-secondary disabled:cursor-not-allowed","touch-target",d&&"border-error",!d&&"border-border",N&&"ring-2 ring-primary"),children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[k?.icon&&e.jsx("span",{className:"flex-shrink-0",children:k.icon}),e.jsx("span",{className:u("truncate",!k&&"text-foreground/50"),children:k?.label||a})]}),e.jsx(C.ChevronDown,{className:u("w-5 h-5 text-primary transition-transform flex-shrink-0",N&&"rotate-180")})]}),x?e.jsx(b.AnimatePresence,{children:N?e.jsxs(b.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"absolute right-0 z-50 mt-2 w-max min-w-48 max-w-full bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[i&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(C.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search...",value:w,onChange:M=>j(M.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-primary"}),w&&e.jsx("button",{onClick:()=>j(""),className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(C.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsxs("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:[n&&e.jsx("button",{type:"button",onClick:()=>z(""),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","text-foreground/70 italic",!t&&"bg-border text-foreground"),children:e.jsx("span",{children:"None"})}),P.length>0?P.map(M=>e.jsxs("button",{onClick:()=>z(M.value),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors",M.value===t&&"bg-border text-foreground"),children:[M.icon&&e.jsx("span",{className:"flex-shrink-0",children:M.icon}),e.jsx("span",{children:M.label})]},M.value)):e.jsx("div",{className:"px-4 py-6 text-center text-primary/70 text-sm",children:"No options found"})]})]}):null}):N&&e.jsxs(b.motion.div,{className:"absolute right-0 z-50 mt-2 w-max min-w-48 max-w-full bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[i&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(C.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search...",value:w,onChange:M=>j(M.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-primary"}),w&&e.jsx("button",{onClick:()=>j(""),className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(C.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsxs("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:[n&&e.jsx("button",{type:"button",onClick:()=>z(""),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","text-foreground/70 italic",!t&&"bg-border text-foreground"),children:e.jsx("span",{children:"None"})}),P.length>0?P.map(M=>e.jsxs("button",{onClick:()=>z(M.value),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors",M.value===t&&"bg-border text-foreground"),children:[M.icon&&e.jsx("span",{className:"flex-shrink-0",children:M.icon}),e.jsx("span",{children:M.label})]},M.value)):e.jsx("div",{className:"px-4 py-6 text-center text-primary/70 text-sm",children:"No options found"})]})]}),d&&e.jsx(b.motion.p,{...x?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"mt-1.5 text-sm text-error",children:d})]})},fe=S.forwardRef(({options:r,value:t,onChange:o,placeholder:a="Select an option",label:s,error:d,hint:i,searchable:n=!1,clearable:l=!0,disabled:m,required:c,className:x,animate:N=!0},v)=>{const w=N!==!1,[j,h]=S.useState(!1),[k,P]=S.useState(""),z=S.useRef(null),M=r.find(T=>T.value===t),L=n?r.filter(T=>T.label.toLowerCase().includes(k.toLowerCase())):r;S.useEffect(()=>{const T=f=>{z.current&&!z.current.contains(f.target)&&(h(!1),P(""))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const E=T=>{o(T),h(!1),P("")};return e.jsxs("div",{ref:v,className:u("w-full space-y-1.5",x),children:[s&&e.jsxs("label",{className:"block text-sm font-medium text-foreground",children:[s,c&&e.jsx("span",{className:"text-error ml-1",children:"*"})]}),e.jsxs("div",{ref:z,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>!m&&h(!j),disabled:m,"aria-haspopup":"listbox","aria-expanded":j,"aria-required":c,className:u("w-full px-4 py-3 rounded-md border transition-all duration-200","bg-background text-left flex items-center justify-between gap-2","focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent","disabled:bg-secondary disabled:cursor-not-allowed","touch-target text-base",d&&"border-error focus:ring-error",!d&&"border-border",j&&"ring-2 ring-primary"),children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[M?.icon&&e.jsx("span",{className:"flex-shrink-0",children:M.icon}),e.jsx("span",{className:u("truncate",!M&&"text-foreground/50"),children:M?.label||a})]}),e.jsx(C.ChevronDown,{className:u("w-5 h-5 text-primary transition-transform flex-shrink-0",j&&"rotate-180")})]}),w?e.jsx(b.AnimatePresence,{children:j?e.jsxs(b.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},role:"listbox",className:"absolute right-0 z-50 mt-2 w-max min-w-48 max-w-full bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[n&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(C.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search...",value:k,onChange:T=>P(T.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary","aria-label":"Search options"}),k&&e.jsx("button",{type:"button",onClick:()=>P(""),className:"absolute right-2 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:e.jsx(C.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsxs("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:[l&&e.jsx("button",{type:"button",role:"option","aria-selected":!t,onClick:()=>E(""),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","text-foreground/70 italic",!t&&"bg-border text-foreground font-medium"),children:e.jsx("span",{children:"None"})}),L.length>0?L.map(T=>e.jsxs("button",{type:"button",role:"option","aria-selected":T.value===t,onClick:()=>!T.disabled&&E(T.value),disabled:T.disabled,className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",T.value===t&&"bg-border text-foreground font-medium"),children:[T.icon&&e.jsx("span",{className:"flex-shrink-0",children:T.icon}),e.jsx("span",{children:T.label})]},T.value)):e.jsx("div",{className:"px-4 py-6 text-center text-primary/70 text-sm",children:"No options found"})]})]}):null}):j&&e.jsxs(b.motion.div,{role:"listbox",className:"absolute right-0 z-50 mt-2 w-max min-w-48 max-w-full bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[n&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(C.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search...",value:k,onChange:T=>P(T.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary","aria-label":"Search options"}),k&&e.jsx("button",{type:"button",onClick:()=>P(""),className:"absolute right-2 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:e.jsx(C.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsxs("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:[l&&e.jsx("button",{type:"button",role:"option","aria-selected":!t,onClick:()=>E(""),className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","text-foreground/70 italic",!t&&"bg-border text-foreground font-medium"),children:e.jsx("span",{children:"None"})}),L.length>0?L.map(T=>e.jsxs("button",{type:"button",role:"option","aria-selected":T.value===t,onClick:()=>!T.disabled&&E(T.value),disabled:T.disabled,className:u("w-full px-4 py-3 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",T.value===t&&"bg-border text-foreground font-medium"),children:[T.icon&&e.jsx("span",{className:"flex-shrink-0",children:T.icon}),e.jsx("span",{children:T.label})]},T.value)):e.jsx("div",{className:"px-4 py-6 text-center text-primary/70 text-sm",children:"No options found"})]})]})]}),d&&e.jsx(b.motion.p,{...w?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"text-sm text-error",children:d}),i&&!d&&e.jsx("p",{className:"text-sm text-primary/70",children:i})]})});fe.displayName="Select";const Z=[{iso2:"AF",name:"Afghanistan",dialCode:"+93"},{iso2:"AL",name:"Albania",dialCode:"+355"},{iso2:"DZ",name:"Algeria",dialCode:"+213"},{iso2:"AS",name:"American Samoa",dialCode:"+1-684"},{iso2:"AD",name:"Andorra",dialCode:"+376"},{iso2:"AO",name:"Angola",dialCode:"+244"},{iso2:"AI",name:"Anguilla",dialCode:"+1-264"},{iso2:"AQ",name:"Antarctica",dialCode:"+672"},{iso2:"AG",name:"Antigua and Barbuda",dialCode:"+1-268"},{iso2:"AR",name:"Argentina",dialCode:"+54"},{iso2:"AM",name:"Armenia",dialCode:"+374"},{iso2:"AW",name:"Aruba",dialCode:"+297"},{iso2:"AU",name:"Australia",dialCode:"+61"},{iso2:"AT",name:"Austria",dialCode:"+43"},{iso2:"AZ",name:"Azerbaijan",dialCode:"+994"},{iso2:"BS",name:"Bahamas",dialCode:"+1-242"},{iso2:"BH",name:"Bahrain",dialCode:"+973"},{iso2:"BD",name:"Bangladesh",dialCode:"+880"},{iso2:"BB",name:"Barbados",dialCode:"+1-246"},{iso2:"BY",name:"Belarus",dialCode:"+375"},{iso2:"BE",name:"Belgium",dialCode:"+32"},{iso2:"BZ",name:"Belize",dialCode:"+501"},{iso2:"BJ",name:"Benin",dialCode:"+229"},{iso2:"BM",name:"Bermuda",dialCode:"+1-441"},{iso2:"BT",name:"Bhutan",dialCode:"+975"},{iso2:"BO",name:"Bolivia",dialCode:"+591"},{iso2:"BA",name:"Bosnia and Herzegovina",dialCode:"+387"},{iso2:"BW",name:"Botswana",dialCode:"+267"},{iso2:"BR",name:"Brazil",dialCode:"+55"},{iso2:"IO",name:"British Indian Ocean Territory",dialCode:"+246"},{iso2:"BN",name:"Brunei",dialCode:"+673"},{iso2:"BG",name:"Bulgaria",dialCode:"+359"},{iso2:"BF",name:"Burkina Faso",dialCode:"+226"},{iso2:"BI",name:"Burundi",dialCode:"+257"},{iso2:"KH",name:"Cambodia",dialCode:"+855"},{iso2:"CM",name:"Cameroon",dialCode:"+237"},{iso2:"CA",name:"Canada",dialCode:"+1"},{iso2:"CV",name:"Cape Verde",dialCode:"+238"},{iso2:"KY",name:"Cayman Islands",dialCode:"+1-345"},{iso2:"CF",name:"Central African Republic",dialCode:"+236"},{iso2:"TD",name:"Chad",dialCode:"+235"},{iso2:"CL",name:"Chile",dialCode:"+56"},{iso2:"CN",name:"China",dialCode:"+86"},{iso2:"CX",name:"Christmas Island",dialCode:"+61"},{iso2:"CC",name:"Cocos (Keeling) Islands",dialCode:"+61"},{iso2:"CO",name:"Colombia",dialCode:"+57"},{iso2:"KM",name:"Comoros",dialCode:"+269"},{iso2:"CG",name:"Congo",dialCode:"+242"},{iso2:"CD",name:"Congo, Democratic Republic",dialCode:"+243"},{iso2:"CK",name:"Cook Islands",dialCode:"+682"},{iso2:"CR",name:"Costa Rica",dialCode:"+506"},{iso2:"CI",name:"Cote d'Ivoire",dialCode:"+225"},{iso2:"HR",name:"Croatia",dialCode:"+385"},{iso2:"CU",name:"Cuba",dialCode:"+53"},{iso2:"CY",name:"Cyprus",dialCode:"+357"},{iso2:"CZ",name:"Czech Republic",dialCode:"+420"},{iso2:"DK",name:"Denmark",dialCode:"+45"},{iso2:"DJ",name:"Djibouti",dialCode:"+253"},{iso2:"DM",name:"Dominica",dialCode:"+1-767"},{iso2:"DO",name:"Dominican Republic",dialCode:"+1-809"},{iso2:"EC",name:"Ecuador",dialCode:"+593"},{iso2:"EG",name:"Egypt",dialCode:"+20"},{iso2:"SV",name:"El Salvador",dialCode:"+503"},{iso2:"GQ",name:"Equatorial Guinea",dialCode:"+240"},{iso2:"ER",name:"Eritrea",dialCode:"+291"},{iso2:"EE",name:"Estonia",dialCode:"+372"},{iso2:"ET",name:"Ethiopia",dialCode:"+251"},{iso2:"FK",name:"Falkland Islands",dialCode:"+500"},{iso2:"FO",name:"Faroe Islands",dialCode:"+298"},{iso2:"FJ",name:"Fiji",dialCode:"+679"},{iso2:"FI",name:"Finland",dialCode:"+358"},{iso2:"FR",name:"France",dialCode:"+33"},{iso2:"GF",name:"French Guiana",dialCode:"+594"},{iso2:"PF",name:"French Polynesia",dialCode:"+689"},{iso2:"GA",name:"Gabon",dialCode:"+241"},{iso2:"GM",name:"Gambia",dialCode:"+220"},{iso2:"GE",name:"Georgia",dialCode:"+995"},{iso2:"DE",name:"Germany",dialCode:"+49"},{iso2:"GH",name:"Ghana",dialCode:"+233"},{iso2:"GI",name:"Gibraltar",dialCode:"+350"},{iso2:"GR",name:"Greece",dialCode:"+30"},{iso2:"GL",name:"Greenland",dialCode:"+299"},{iso2:"GD",name:"Grenada",dialCode:"+1-473"},{iso2:"GP",name:"Guadeloupe",dialCode:"+590"},{iso2:"GU",name:"Guam",dialCode:"+1-671"},{iso2:"GT",name:"Guatemala",dialCode:"+502"},{iso2:"GG",name:"Guernsey",dialCode:"+44-1481"},{iso2:"GN",name:"Guinea",dialCode:"+224"},{iso2:"GW",name:"Guinea-Bissau",dialCode:"+245"},{iso2:"GY",name:"Guyana",dialCode:"+592"},{iso2:"HT",name:"Haiti",dialCode:"+509"},{iso2:"HN",name:"Honduras",dialCode:"+504"},{iso2:"HK",name:"Hong Kong",dialCode:"+852"},{iso2:"HU",name:"Hungary",dialCode:"+36"},{iso2:"IS",name:"Iceland",dialCode:"+354"},{iso2:"IN",name:"India",dialCode:"+91"},{iso2:"ID",name:"Indonesia",dialCode:"+62"},{iso2:"IR",name:"Iran",dialCode:"+98"},{iso2:"IQ",name:"Iraq",dialCode:"+964"},{iso2:"IE",name:"Ireland",dialCode:"+353"},{iso2:"IM",name:"Isle of Man",dialCode:"+44-1624"},{iso2:"IL",name:"Israel",dialCode:"+972"},{iso2:"IT",name:"Italy",dialCode:"+39"},{iso2:"JM",name:"Jamaica",dialCode:"+1-876"},{iso2:"JP",name:"Japan",dialCode:"+81"},{iso2:"JE",name:"Jersey",dialCode:"+44-1534"},{iso2:"JO",name:"Jordan",dialCode:"+962"},{iso2:"KZ",name:"Kazakhstan",dialCode:"+7"},{iso2:"KE",name:"Kenya",dialCode:"+254"},{iso2:"KI",name:"Kiribati",dialCode:"+686"},{iso2:"KP",name:"Korea, North",dialCode:"+850"},{iso2:"KR",name:"Korea, South",dialCode:"+82"},{iso2:"KW",name:"Kuwait",dialCode:"+965"},{iso2:"KG",name:"Kyrgyzstan",dialCode:"+996"},{iso2:"LA",name:"Laos",dialCode:"+856"},{iso2:"LV",name:"Latvia",dialCode:"+371"},{iso2:"LB",name:"Lebanon",dialCode:"+961"},{iso2:"LS",name:"Lesotho",dialCode:"+266"},{iso2:"LR",name:"Liberia",dialCode:"+231"},{iso2:"LY",name:"Libya",dialCode:"+218"},{iso2:"LI",name:"Liechtenstein",dialCode:"+423"},{iso2:"LT",name:"Lithuania",dialCode:"+370"},{iso2:"LU",name:"Luxembourg",dialCode:"+352"},{iso2:"MO",name:"Macau",dialCode:"+853"},{iso2:"MK",name:"North Macedonia",dialCode:"+389"},{iso2:"MG",name:"Madagascar",dialCode:"+261"},{iso2:"MW",name:"Malawi",dialCode:"+265"},{iso2:"MY",name:"Malaysia",dialCode:"+60"},{iso2:"MV",name:"Maldives",dialCode:"+960"},{iso2:"ML",name:"Mali",dialCode:"+223"},{iso2:"MT",name:"Malta",dialCode:"+356"},{iso2:"MH",name:"Marshall Islands",dialCode:"+692"},{iso2:"MQ",name:"Martinique",dialCode:"+596"},{iso2:"MR",name:"Mauritania",dialCode:"+222"},{iso2:"MU",name:"Mauritius",dialCode:"+230"},{iso2:"YT",name:"Mayotte",dialCode:"+262"},{iso2:"MX",name:"Mexico",dialCode:"+52"},{iso2:"FM",name:"Micronesia",dialCode:"+691"},{iso2:"MD",name:"Moldova",dialCode:"+373"},{iso2:"MC",name:"Monaco",dialCode:"+377"},{iso2:"MN",name:"Mongolia",dialCode:"+976"},{iso2:"ME",name:"Montenegro",dialCode:"+382"},{iso2:"MS",name:"Montserrat",dialCode:"+1-664"},{iso2:"MA",name:"Morocco",dialCode:"+212"},{iso2:"MZ",name:"Mozambique",dialCode:"+258"},{iso2:"MM",name:"Myanmar",dialCode:"+95"},{iso2:"NA",name:"Namibia",dialCode:"+264"},{iso2:"NR",name:"Nauru",dialCode:"+674"},{iso2:"NP",name:"Nepal",dialCode:"+977"},{iso2:"NL",name:"Netherlands",dialCode:"+31"},{iso2:"NC",name:"New Caledonia",dialCode:"+687"},{iso2:"NZ",name:"New Zealand",dialCode:"+64"},{iso2:"NI",name:"Nicaragua",dialCode:"+505"},{iso2:"NE",name:"Niger",dialCode:"+227"},{iso2:"NG",name:"Nigeria",dialCode:"+234"},{iso2:"NU",name:"Niue",dialCode:"+683"},{iso2:"NF",name:"Norfolk Island",dialCode:"+672"},{iso2:"MP",name:"Northern Mariana Islands",dialCode:"+1-670"},{iso2:"NO",name:"Norway",dialCode:"+47"},{iso2:"OM",name:"Oman",dialCode:"+968"},{iso2:"PK",name:"Pakistan",dialCode:"+92"},{iso2:"PW",name:"Palau",dialCode:"+680"},{iso2:"PS",name:"Palestine",dialCode:"+970"},{iso2:"PA",name:"Panama",dialCode:"+507"},{iso2:"PG",name:"Papua New Guinea",dialCode:"+675"},{iso2:"PY",name:"Paraguay",dialCode:"+595"},{iso2:"PE",name:"Peru",dialCode:"+51"},{iso2:"PH",name:"Philippines",dialCode:"+63"},{iso2:"PN",name:"Pitcairn",dialCode:"+64"},{iso2:"PL",name:"Poland",dialCode:"+48"},{iso2:"PT",name:"Portugal",dialCode:"+351"},{iso2:"PR",name:"Puerto Rico",dialCode:"+1-787"},{iso2:"QA",name:"Qatar",dialCode:"+974"},{iso2:"RE",name:"Reunion",dialCode:"+262"},{iso2:"RO",name:"Romania",dialCode:"+40"},{iso2:"RU",name:"Russia",dialCode:"+7"},{iso2:"RW",name:"Rwanda",dialCode:"+250"},{iso2:"BL",name:"Saint Barthelemy",dialCode:"+590"},{iso2:"SH",name:"Saint Helena",dialCode:"+290"},{iso2:"KN",name:"Saint Kitts and Nevis",dialCode:"+1-869"},{iso2:"LC",name:"Saint Lucia",dialCode:"+1-758"},{iso2:"MF",name:"Saint Martin",dialCode:"+590"},{iso2:"PM",name:"Saint Pierre and Miquelon",dialCode:"+508"},{iso2:"VC",name:"Saint Vincent and the Grenadines",dialCode:"+1-784"},{iso2:"WS",name:"Samoa",dialCode:"+685"},{iso2:"SM",name:"San Marino",dialCode:"+378"},{iso2:"ST",name:"Sao Tome and Principe",dialCode:"+239"},{iso2:"SA",name:"Saudi Arabia",dialCode:"+966"},{iso2:"SN",name:"Senegal",dialCode:"+221"},{iso2:"RS",name:"Serbia",dialCode:"+381"},{iso2:"SC",name:"Seychelles",dialCode:"+248"},{iso2:"SL",name:"Sierra Leone",dialCode:"+232"},{iso2:"SG",name:"Singapore",dialCode:"+65"},{iso2:"SX",name:"Sint Maarten",dialCode:"+1-721"},{iso2:"SK",name:"Slovakia",dialCode:"+421"},{iso2:"SI",name:"Slovenia",dialCode:"+386"},{iso2:"SB",name:"Solomon Islands",dialCode:"+677"},{iso2:"SO",name:"Somalia",dialCode:"+252"},{iso2:"ZA",name:"South Africa",dialCode:"+27"},{iso2:"GS",name:"South Georgia and the South Sandwich Islands",dialCode:"+500"},{iso2:"SS",name:"South Sudan",dialCode:"+211"},{iso2:"ES",name:"Spain",dialCode:"+34"},{iso2:"LK",name:"Sri Lanka",dialCode:"+94"},{iso2:"SD",name:"Sudan",dialCode:"+249"},{iso2:"SR",name:"Suriname",dialCode:"+597"},{iso2:"SJ",name:"Svalbard and Jan Mayen",dialCode:"+47"},{iso2:"SZ",name:"Swaziland",dialCode:"+268"},{iso2:"SE",name:"Sweden",dialCode:"+46"},{iso2:"CH",name:"Switzerland",dialCode:"+41"},{iso2:"SY",name:"Syria",dialCode:"+963"},{iso2:"TW",name:"Taiwan",dialCode:"+886"},{iso2:"TJ",name:"Tajikistan",dialCode:"+992"},{iso2:"TZ",name:"Tanzania",dialCode:"+255"},{iso2:"TH",name:"Thailand",dialCode:"+66"},{iso2:"TL",name:"Timor-Leste",dialCode:"+670"},{iso2:"TG",name:"Togo",dialCode:"+228"},{iso2:"TK",name:"Tokelau",dialCode:"+690"},{iso2:"TO",name:"Tonga",dialCode:"+676"},{iso2:"TT",name:"Trinidad and Tobago",dialCode:"+1-868"},{iso2:"TN",name:"Tunisia",dialCode:"+216"},{iso2:"TR",name:"Turkey",dialCode:"+90"},{iso2:"TM",name:"Turkmenistan",dialCode:"+993"},{iso2:"TC",name:"Turks and Caicos Islands",dialCode:"+1-649"},{iso2:"TV",name:"Tuvalu",dialCode:"+688"},{iso2:"UG",name:"Uganda",dialCode:"+256"},{iso2:"UA",name:"Ukraine",dialCode:"+380"},{iso2:"AE",name:"United Arab Emirates",dialCode:"+971"},{iso2:"GB",name:"United Kingdom",dialCode:"+44"},{iso2:"US",name:"United States",dialCode:"+1"},{iso2:"UY",name:"Uruguay",dialCode:"+598"},{iso2:"UZ",name:"Uzbekistan",dialCode:"+998"},{iso2:"VU",name:"Vanuatu",dialCode:"+678"},{iso2:"VA",name:"Vatican City",dialCode:"+379"},{iso2:"VE",name:"Venezuela",dialCode:"+58"},{iso2:"VN",name:"Vietnam",dialCode:"+84"},{iso2:"VG",name:"British Virgin Islands",dialCode:"+1-284"},{iso2:"VI",name:"US Virgin Islands",dialCode:"+1-340"},{iso2:"WF",name:"Wallis and Futuna",dialCode:"+681"},{iso2:"EH",name:"Western Sahara",dialCode:"+212"},{iso2:"YE",name:"Yemen",dialCode:"+967"},{iso2:"ZM",name:"Zambia",dialCode:"+260"},{iso2:"ZW",name:"Zimbabwe",dialCode:"+263"}],Wr=r=>{const t=r.toUpperCase().split("").map(o=>127397+o.charCodeAt(0));return String.fromCodePoint(...t)},He=({value:r,onChange:t,onCountryChange:o,label:a="Country",placeholder:s="Select country",searchable:d=!0,clearable:i=!0,showFlags:n=!0,disabled:l,animate:m=!0,className:c})=>{const x=S.useMemo(()=>Z.map(v=>({label:v.name,value:v.iso2,icon:n?e.jsx("span",{className:"text-base","aria-hidden":!0,children:Wr(v.iso2)}):void 0})),[n]),N=v=>{t?.(v);const w=Z.find(j=>j.iso2===v);w&&o?.(w)};return e.jsx(fe,{label:a,placeholder:s,options:x,value:r,onChange:N,searchable:d,clearable:i,disabled:l,animate:m,className:c})};He.displayName="CountrySelect";const Hr=({value:r,onChange:t,label:o,placeholder:a="Select date",error:s,disabled:d,minDate:i,maxDate:n,className:l,animate:m=!0})=>{const c=m!==!1,[x,N]=S.useState(!1),[v,w]=S.useState(r||new Date),j=S.useRef(null);S.useEffect(()=>{const p=I=>{j.current&&!j.current.contains(I.target)&&N(!1)};return x&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[x]);const h=["January","February","March","April","May","June","July","August","September","October","November","December"],k=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],P=p=>{const I=p.getFullYear(),V=p.getMonth(),W=new Date(I,V,1),H=new Date(I,V+1,0).getDate(),$=W.getDay(),A=[];for(let Y=0;Y<$;Y++)A.push(null);for(let Y=1;Y<=H;Y++)A.push(new Date(I,V,Y));return A},z=()=>{w(new Date(v.getFullYear(),v.getMonth()-1,1))},M=()=>{w(new Date(v.getFullYear(),v.getMonth()+1,1))},L=p=>{t(p),N(!1)},E=p=>!!(i&&p<i||n&&p>n),T=(p,I)=>!p||!I?!1:p.getDate()===I.getDate()&&p.getMonth()===I.getMonth()&&p.getFullYear()===I.getFullYear(),f=p=>p?T(p,new Date):!1,G=p=>p?p.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"",B=P(v);return e.jsxs("div",{ref:j,className:u("relative w-full",l),children:[o&&e.jsx("label",{className:"block mb-1.5 text-sm font-medium text-foreground",children:o}),e.jsxs("button",{type:"button",onClick:()=>!d&&N(!x),disabled:d,className:u("w-full px-4 py-3 rounded-md border transition-all duration-200","bg-background text-left flex items-center justify-between gap-2","focus:outline-none focus:ring-2 focus:ring-primary","disabled:bg-secondary disabled:cursor-not-allowed","touch-target",s&&"border-error",!s&&"border-border",x&&"ring-2 ring-primary"),children:[e.jsx("span",{className:u("truncate",!r&&"text-foreground/50"),children:r?G(r):a}),e.jsx(C.Calendar,{className:"w-5 h-5 text-primary flex-shrink-0"})]}),c?e.jsx(b.AnimatePresence,{children:x?e.jsxs(b.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"absolute z-50 w-80 mt-2 bg-background rounded-md border border-border shadow-lg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("button",{type:"button",onClick:z,className:"p-2 hover:bg-secondary rounded-lg transition-colors",children:e.jsx(C.ChevronLeft,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"font-semibold text-foreground",children:[h[v.getMonth()]," ",v.getFullYear()]}),e.jsx("button",{type:"button",onClick:M,className:"p-2 hover:bg-secondary rounded-lg transition-colors",children:e.jsx(C.ChevronRight,{className:"w-5 h-5 text-primary"})})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:k.map(p=>e.jsx("div",{className:"text-center text-xs font-medium text-primary/70 py-2",children:p},p))}),e.jsx("div",{className:"grid grid-cols-7 gap-1",children:B.map((p,I)=>{if(!p)return e.jsx("div",{className:"aspect-square"},`empty-${I}`);const V=T(p,r||null),W=f(p),F=E(p);return e.jsx(b.motion.button,{type:"button",whileTap:c?{scale:F?1:.95}:void 0,onClick:()=>!F&&L(p),disabled:F,className:u("aspect-square rounded-lg flex items-center justify-center","text-sm font-medium transition-all duration-200","hover:bg-secondary",V&&"bg-primary text-white hover:bg-primary-dark",W&&!V&&"border-2 border-primary text-primary",F&&"text-border-dark cursor-not-allowed hover:bg-transparent",!V&&!W&&!F&&"text-foreground"),children:p.getDate()},p.toISOString())})}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsx("button",{type:"button",onClick:()=>L(new Date),className:"w-full py-2 text-sm font-medium text-primary hover:bg-secondary rounded-lg transition-colors",children:"Today"})})]}):null}):x&&e.jsxs("div",{className:"absolute z-50 w-80 mt-2 bg-background rounded-md border border-border shadow-lg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("button",{type:"button",onClick:z,className:"p-2 hover:bg-secondary rounded-lg transition-colors",children:e.jsx(C.ChevronLeft,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"font-semibold text-foreground",children:[h[v.getMonth()]," ",v.getFullYear()]}),e.jsx("button",{type:"button",onClick:M,className:"p-2 hover:bg-secondary rounded-lg transition-colors",children:e.jsx(C.ChevronRight,{className:"w-5 h-5 text-primary"})})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:k.map(p=>e.jsx("div",{className:"text-center text-xs font-medium text-primary/70 py-2",children:p},p))}),e.jsx("div",{className:"grid grid-cols-7 gap-1",children:B.map((p,I)=>{if(!p)return e.jsx("div",{className:"aspect-square"},`empty-${I}`);const V=T(p,r||null),W=f(p),F=E(p);return e.jsx("button",{type:"button",onClick:()=>!F&&L(p),disabled:F,className:u("aspect-square rounded-lg flex items-center justify-center","text-sm font-medium transition-all duration-200","hover:bg-secondary",V&&"bg-primary text-white hover:bg-primary-dark",W&&!V&&"border-2 border-primary text-primary",F&&"text-border-dark cursor-not-allowed hover:bg-transparent",!V&&!W&&!F&&"text-foreground"),children:p.getDate()},p.toISOString())})}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsx("button",{type:"button",onClick:()=>L(new Date),className:"w-full py-2 text-sm font-medium text-primary hover:bg-secondary rounded-lg transition-colors",children:"Today"})})]}),s&&e.jsx(b.motion.p,{...c?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"mt-1.5 text-sm text-error",children:s})]})},$r=({children:r,variant:t="default",padding:o="md",className:a,onClick:s,hover:d=!1,animate:i=!0})=>{const n=i!==!1,l={default:"bg-background border border-border",outlined:"bg-transparent border-2 border-border-dark",elevated:"bg-background border-2 border-border shadow-card"},m={none:"p-0",sm:"p-3",md:"p-4 sm:p-6",lg:"p-6 sm:p-8"},c=s?b.motion.button:b.motion.div;return e.jsx(c,{...n?{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3}}:{},whileHover:n&&(d||s)?{y:-2,boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1)"}:void 0,whileTap:n&&s?{scale:.98}:void 0,className:u("rounded-lg transition-all duration-200",l[t],m[o],s&&"cursor-pointer w-full text-left",a),onClick:s,children:r})},Yr=({children:r,className:t})=>e.jsx("div",{className:u("mb-4",t),children:r}),qr=({children:r,className:t})=>e.jsx("h3",{className:u("text-lg font-semibold text-foreground",t),children:r}),_r=({children:r,className:t})=>e.jsx("p",{className:u("text-sm text-foreground/70 mt-1",t),children:r}),Jr=({children:r,className:t})=>e.jsx("div",{className:t,children:r}),Xr=({isOpen:r,onClose:t,children:o,title:a,position:s="right",className:d,animate:i=!0})=>{const n=i!==!1;S.useEffect(()=>{const m=c=>{c.key==="Escape"&&t()};return r&&(document.addEventListener("keydown",m),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",m),document.body.style.overflow="unset"}},[r,t]);const l=r?e.jsxs(e.Fragment,{children:[e.jsx(b.motion.div,{...n?{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}}:{},className:"fixed inset-0 z-40 bg-black/50 backdrop-blur-sm",onClick:t}),e.jsxs(b.motion.div,{...n?{initial:{x:s==="left"?"-100%":"100%"},animate:{x:0},exit:{x:s==="left"?"-100%":"100%"},transition:{type:"spring",damping:30,stiffness:300}}:{},className:u("fixed top-0 z-50 h-full w-[400px] sm:w-[480px] bg-background shadow-xl",s==="left"?"left-0 border-r":"right-0 border-l","border-border",d),children:[a&&e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[e.jsx("h2",{className:"text-xl font-semibold text-foreground",children:a}),e.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:bg-secondary transition-colors","aria-label":"Close drawer",children:e.jsx(C.X,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"overflow-y-auto h-[calc(100%-5rem)] p-6",children:o})]})]}):null;return n?e.jsx(b.AnimatePresence,{children:l}):l},Zr=({isOpen:r,onClose:t,children:o,title:a,size:s="md",className:d,animate:i=!0})=>{const n=i!==!1,l=S.useRef(null);S.useEffect(()=>{const x=N=>{N.key==="Escape"&&t()};return r&&(document.addEventListener("keydown",x),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",x),document.body.style.overflow="unset"}},[r,t]);const m={sm:"max-w-lg",md:"max-w-2xl",lg:"max-w-4xl",xl:"max-w-6xl",full:"max-w-full mx-4"},c=r?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:x=>{x.target===x.currentTarget&&t()},children:e.jsxs(b.motion.div,{ref:l,...n?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2}}:{},className:u("bg-background border border-border rounded-lg shadow-2xl w-full max-h-[90vh] overflow-hidden flex flex-col",m[s],d),children:[a&&e.jsxs("div",{className:"px-6 py-4 border-b border-border flex items-center justify-between",children:[e.jsx("h2",{className:"text-xl font-semibold text-foreground",children:a}),e.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:bg-secondary transition-colors","aria-label":"Close modal",children:e.jsx(C.X,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"overflow-y-auto flex-1",children:o})]})}):null;return n?e.jsx(b.AnimatePresence,{children:c}):c},Qr=({children:r,className:t})=>e.jsx("div",{className:u("px-6 py-4",t),children:r}),et=({children:r,className:t})=>e.jsx("div",{className:u("px-6 py-4 border-t border-border flex items-center justify-end gap-3 bg-background sticky bottom-0",t),children:r}),rt=({isOpen:r,onClose:t,title:o,children:a,showCloseButton:s=!1,className:d,animate:i=!0})=>{const n=i!==!1;S.useEffect(()=>(r?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[r]);const l=r?e.jsxs(e.Fragment,{children:[e.jsx(b.motion.div,{...n?{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}:{},onClick:t,className:"fixed inset-0 bg-black/50 z-40"}),e.jsxs(b.motion.div,{...n?{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:300}}:{},className:u("fixed bottom-0 left-0 right-0 z-50","bg-white rounded-t-3xl shadow-2xl","max-h-[90vh] flex flex-col",d),children:[e.jsx("div",{className:"flex justify-center pt-3 pb-2",children:e.jsx("div",{className:"w-12 h-1.5 bg-border-dark rounded-full"})}),(o||s)&&e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 ",children:[o&&e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:o}),s&&e.jsx("button",{onClick:t,className:"p-2 rounded-full hover:bg-secondary transition-colors",children:e.jsx(C.X,{className:"w-5 h-5 text-primary"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:a})]})]}):null;return n?e.jsx(b.AnimatePresence,{children:l}):l};function tt({data:r,columns:t,loading:o=!1,onRowClick:a,keyExtractor:s,className:d,animate:i=!0}){const n=i!==!1,[l,m]=S.useState(null),[c,x]=S.useState("asc"),N=w=>{l===w?x(c==="asc"?"desc":"asc"):(m(w),x("asc"))},v=l?[...r].sort((w,j)=>{const h=w[l],k=j[l];return h<k?c==="asc"?-1:1:h>k?c==="asc"?1:-1:0}):r;return o?e.jsx("div",{className:u("border border-border rounded-lg overflow-hidden",d),children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"border-b border-border",children:e.jsx("tr",{children:t.map((w,j)=>e.jsx("th",{className:"px-6 py-4 text-left",children:e.jsx("div",{className:u("h-4 bg-border rounded w-24",n&&"animate-pulse")})},j))})}),e.jsx("tbody",{children:[...Array(5)].map((w,j)=>e.jsx("tr",{className:"border-b border-border",children:t.map((h,k)=>e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:u("h-4 bg-secondary rounded",n&&"animate-pulse")})},k))},j))})]})})}):e.jsx(b.motion.div,{...n?{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3}}:{},className:u("border border-border rounded-lg overflow-hidden",d),children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"border-b border-border",children:e.jsx("tr",{children:t.map((w,j)=>e.jsx("th",{className:u("px-6 py-4 text-left text-sm font-semibold text-foreground",w.width,w.sortable&&"cursor-pointer transition-colors"),onClick:()=>w.sortable&&N(w.key),children:e.jsxs("div",{className:"flex items-center gap-2",children:[w.header,w.sortable&&e.jsx("span",{className:"text-primary/50 hover:text-primary transition-colors",children:l===w.key?c==="asc"?e.jsx(C.ArrowUp,{className:"w-4 h-4"}):e.jsx(C.ArrowDown,{className:"w-4 h-4"}):e.jsx(C.ChevronsUpDown,{className:"w-4 h-4"})})]})},j))})}),e.jsx("tbody",{children:v.map((w,j)=>e.jsx(b.motion.tr,{...n?{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.2,delay:j*.05}}:{},onClick:()=>a&&a(w),className:u("border-b border-border transition-colors",a&&"cursor-pointer hover:bg-secondary"),children:t.map((h,k)=>e.jsx("td",{className:u("px-6 py-4 text-sm text-foreground/70",h.width),style:h.width?{width:h.width}:void 0,title:h.truncate&&!h.render?String(w[h.key]??""):void 0,children:h.truncate&&!h.render?e.jsx("div",{className:"truncate",children:String(w[h.key]??"")}):h.render?h.render(w):String(w[h.key]??"")},k))},s(w)))})]})})})}const at=({currentPage:r,totalPages:t,onPageChange:o,totalItems:a,itemsPerPage:s,className:d,animate:i=!0})=>{const n=i!==!1,m=Array.from({length:t},(c,x)=>x+1).slice(Math.max(0,r-2),Math.min(t,r+1));return e.jsxs(b.motion.div,{...n?{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3}}:{},className:u("flex items-center justify-between gap-4 flex-wrap",d),children:[e.jsx("div",{className:"text-sm text-foreground/70",children:a&&s&&e.jsxs("span",{children:["Showing ",Math.min((r-1)*s+1,a)," to"," ",Math.min(r*s,a)," of ",a," results"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{variant:"secondary",size:"sm",disabled:r===1,onClick:()=>o(r-1),icon:e.jsx(C.ChevronLeft,{className:"w-4 h-4"}),animate:i,children:"Previous"}),e.jsxs("div",{className:"flex items-center gap-1",children:[r>3&&e.jsxs(e.Fragment,{children:[e.jsx(b.motion.button,{whileHover:n?{scale:1.05}:void 0,whileTap:n?{scale:.95}:void 0,onClick:()=>o(1),className:"w-10 h-10 rounded-md hover:bg-secondary border border-border text-sm transition-colors",children:"1"}),e.jsx("span",{className:"text-primary/50 px-1",children:"..."})]}),m.map(c=>e.jsx(b.motion.button,{whileHover:n?{scale:1.05}:void 0,whileTap:n?{scale:.95}:void 0,onClick:()=>o(c),className:u("w-10 h-10 rounded-md text-sm border transition-all",c===r?"bg-primary text-white border-primary shadow-sm":"hover:bg-secondary border-border"),children:c},c)),r<t-2&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-primary/50 px-1",children:"..."}),e.jsx(b.motion.button,{whileHover:n?{scale:1.05}:void 0,whileTap:n?{scale:.95}:void 0,onClick:()=>o(t),className:"w-10 h-10 rounded-md hover:bg-secondary border border-border text-sm transition-colors",children:t})]})]}),e.jsx(de,{variant:"secondary",size:"sm",disabled:r===t,onClick:()=>o(r+1),icon:e.jsx(C.ChevronRight,{className:"w-4 h-4"}),animate:i,children:"Next"})]})]})},$e=({icon:r,onClick:t,label:o,actions:a,variant:s="primary",position:d="bottom-right",disabled:i,className:n,animate:l=!0})=>{const m=l!==!1,[c,x]=S.useState(!1),N={"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2"},v={primary:"bg-primary text-white hover:bg-primary-dark shadow-lg",secondary:"bg-background text-primary border-2 border-primary hover:bg-secondary shadow-md"},w={primary:"bg-primary text-white",success:"bg-success text-white",danger:"bg-error text-white",warning:"bg-warning text-white"},j=()=>{a&&a.length>0?x(!c):t&&t()};return e.jsxs("div",{className:u(N[d],"z-50",n),children:[m?e.jsx(b.AnimatePresence,{children:c&&a?e.jsx(b.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute bottom-20 right-0 flex flex-col gap-3 mb-2",children:a.map((h,k)=>e.jsxs(b.motion.div,{initial:{opacity:0,y:20,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.8},transition:{delay:k*.05},className:"flex items-center gap-3",children:[e.jsx("span",{className:u("bg-background border border-border rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap shadow-lg",h.labelClassName),style:h.labelStyle,children:h.label}),e.jsx(b.motion.button,{whileHover:m?{scale:1.1}:void 0,whileTap:m?{scale:.9}:void 0,onClick:()=>{h.onClick(),x(!1)},className:u("w-12 h-12 rounded-full shadow-lg flex items-center justify-center transition-all",w[h.variant||"primary"]),children:h.icon})]},k))}):null}):c&&a&&e.jsx("div",{className:"absolute bottom-20 right-0 flex flex-col gap-3 mb-2",children:a.map((h,k)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:u("bg-background border border-border rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap shadow-lg",h.labelClassName),style:h.labelStyle,children:h.label}),e.jsx("button",{onClick:()=>{h.onClick(),x(!1)},className:u("w-12 h-12 rounded-full shadow-lg flex items-center justify-center transition-all",w[h.variant||"primary"]),children:h.icon})]},k))}),e.jsxs(b.motion.button,{whileTap:m?{scale:i?1:.9}:void 0,whileHover:m?{scale:i?1:1.05}:void 0,onClick:j,disabled:i,className:u("z-30 rounded-full p-4 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","flex items-center gap-2",v[s],o?"px-6":"w-16 h-16 justify-center",c&&"rotate-45"),children:[e.jsx("span",{className:"flex-shrink-0",children:r||(c?e.jsx(C.X,{className:"w-6 h-6"}):e.jsx(C.Plus,{className:"w-6 h-6"}))}),o&&e.jsx("span",{className:"font-medium",children:o})]})]})},ot=$e,st=({steps:r,currentStep:t,className:o,animate:a=!0})=>{const s=a!==!1,d=r[t];return e.jsxs("div",{className:u("w-full",o),children:[e.jsx("div",{className:"hidden md:block",children:e.jsx("div",{className:"relative flex items-center mb-2",children:r.map((i,n)=>{const l=n<t,m=n===t,c=n>t;return e.jsxs(S.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(b.motion.div,{initial:!1,animate:s?{scale:m?1.05:1}:void 0,className:u("w-12 h-12 rounded-full flex items-center justify-center","font-semibold text-base transition-all duration-300","ring-4 ring-white",(l||m)&&"bg-primary text-white shadow-lg",c&&"bg-border text-muted-foreground"),children:l?e.jsx(C.Check,{className:"w-6 h-6 stroke-[3]"}):e.jsx("span",{children:n+1})}),e.jsxs("div",{className:"mt-3 text-center max-w-[120px]",children:[e.jsx("span",{className:u("text-sm font-semibold block",m&&"text-primary",l&&"text-primary",c&&"text-primary/50"),children:i.label}),i.description&&e.jsx("p",{className:u("text-xs mt-1 leading-tight",m&&"text-primary",l&&"text-primary/70",c&&"text-primary/50"),children:i.description})]})]}),n<r.length-1&&e.jsx("div",{className:"flex-1 relative",style:{marginTop:"-48px",marginLeft:"4px",marginRight:"4px"},children:e.jsx("div",{className:"h-1.5 bg-border rounded-full overflow-hidden",children:e.jsx(b.motion.div,{initial:!1,style:{width:n<t?"100%":"0%"},animate:s?{width:n<t?"100%":"0%"}:void 0,transition:s?{duration:.4,ease:"easeInOut"}:{duration:0},className:"h-full bg-primary rounded-full"})})})]},n)})})}),e.jsxs("div",{className:"md:hidden",children:[e.jsx("div",{className:"flex items-center justify-center gap-2 mb-3",children:r.map((i,n)=>{const l=n<t,m=n===t;return e.jsx(b.motion.div,{initial:!1,style:{backgroundColor:l||m?"var(--color-primary)":"var(--color-border-dark)"},animate:s?{scale:m?1.2:1}:void 0,className:u("rounded-full transition-all duration-300",m?"w-3 h-3":"w-2 h-2",(l||m)&&"shadow-sm")},n)})}),e.jsx(b.motion.div,{...s?{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3}}:{},className:"text-center",children:e.jsx("p",{className:"text-sm font-semibold text-foreground",children:d?.label})},t)]})]})},nt=({children:r,variant:t="default",size:o="md",className:a,dot:s=!1,animate:d=!0})=>{const i=d!==!1,n={default:"bg-secondary text-primary border border-border",primary:"bg-primary/10 text-primary border border-primary/20",success:"bg-success/10 text-success border border-success/20",warning:"bg-warning/10 text-warning border border-warning/20",danger:"bg-error/10 text-error border border-error/20",info:"bg-info/10 text-info border border-info/20"},l={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},m={default:"bg-primary",primary:"bg-primary",success:"bg-success",warning:"bg-warning",danger:"bg-error",info:"bg-info"};return e.jsxs(b.motion.span,{...i?{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2}}:{},className:u("inline-flex items-center gap-1.5 rounded-lg font-medium",n[t],l[o],a),children:[s&&e.jsx("span",{className:u("w-1.5 h-1.5 rounded-full",m[t])}),r]})},it=({isOffline:r,className:t,animate:o=!0})=>{const a=o!==!1;return r?e.jsxs(b.motion.div,{...a?{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10}}:{},className:u("inline-flex items-center gap-2 px-3 py-1.5 rounded-full","bg-warning text-white text-sm font-medium shadow-sm",t),children:[e.jsx(C.WifiOff,{className:"w-4 h-4"}),e.jsx("span",{children:"Offline Mode"})]}):null},lt=({status:r,count:t,className:o,animate:a=!0})=>{const s=a!==!1,d=s?e.jsx(b.motion.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},children:e.jsx(C.Wifi,{className:"w-4 h-4"})}):e.jsx(C.Wifi,{className:"w-4 h-4"}),n={synced:{icon:e.jsx(C.Wifi,{className:"w-4 h-4"}),label:"Synced",color:"bg-success text-white"},syncing:{icon:d,label:"Syncing...",color:"bg-info text-white"},unsynced:{icon:e.jsx(C.WifiOff,{className:"w-4 h-4"}),label:t?`${t} Unsynced`:"Unsynced",color:"bg-warning text-white"},error:{icon:e.jsx(C.WifiOff,{className:"w-4 h-4"}),label:"Sync Error",color:"bg-error text-white"}}[r];return e.jsxs(b.motion.div,{...s?{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1}}:{},className:u("inline-flex items-center gap-2 px-3 py-1.5 rounded-full","text-sm font-medium shadow-sm",n.color,o),children:[n.icon,e.jsx("span",{children:n.label})]})},dt={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-2",lg:"w-12 h-12 border-3",xl:"w-16 h-16 border-4"},ct={primary:"border-primary border-t-transparent",secondary:"border-secondary border-t-transparent",white:"border-white border-t-transparent"},Ye=({size:r="md",variant:t="primary",className:o,label:a,animate:s=!0})=>{const d=s!==!1,i=d?b.motion.div:"div";return e.jsxs("div",{className:u("inline-flex flex-col items-center gap-2",o),children:[e.jsx(i,{className:u("rounded-full",dt[r],ct[t]),...d?{animate:{rotate:360},transition:{duration:.8,repeat:1/0,ease:"linear"}}:{},role:"status","aria-label":a||"Loading"}),a&&e.jsx("span",{className:"text-sm text-foreground/70",children:a})]})};Ye.displayName="Spinner";const qe=S.createContext(void 0),mt=()=>{const r=S.useContext(qe);if(!r)throw new Error("useToast must be used within ToastProvider");return r},ut={success:"bg-success/10 border-success text-success backdrop-blur-2xl",error:"bg-error/10 border-error text-error backdrop-blur-2xl",warning:"bg-warning/10 border-warning text-warning backdrop-blur-2xl",info:"bg-info/10 border-info text-info backdrop-blur-2xl",default:"bg-background border-border text-foreground backdrop-blur-2xl"},pt={success:C.CheckCircle,error:C.AlertCircle,warning:C.AlertTriangle,info:C.Info,default:null},xt={"top-left":"top-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-center":"bottom-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4"},Ae=({toast:r,onRemove:t,animate:o=!0})=>{const a=o!==!1,s=r.variant||"default",d=pt[s],i=typeof r.message=="string"?r.message:String(r.message),n=a?b.motion.div:"div";return e.jsxs(n,{...a?{layout:!0,initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,x:100,scale:.95},transition:{duration:.2}}:{},className:u("flex items-start gap-3 p-4 rounded-md border shadow-lg min-w-[320px] max-w-md",ut[s]),children:[d&&e.jsx(d,{className:"w-5 h-5 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium leading-relaxed",children:i}),r.action&&e.jsx("button",{onClick:r.action.onClick,className:"mt-2 text-xs font-semibold hover:underline",children:r.action.label})]}),e.jsx("button",{onClick:()=>t(r.id),className:"flex-shrink-0 hover:opacity-70 transition-opacity","aria-label":"Close notification",children:e.jsx(C.X,{className:"w-4 h-4"})})]})},_e=({children:r,position:t="top-right",maxToasts:o=5,animate:a=!0})=>{const s=a!==!1,[d,i]=S.useState([]),n=S.useCallback(m=>{i(c=>c.filter(x=>x.id!==m))},[]),l=S.useCallback(m=>{if(typeof m.message!="string"){console.error("Toast message must be a string, received:",m.message);return}const c=Math.random().toString(36).substring(2,9),x=m.duration??5e3;i(N=>[...N,{...m,id:c}].slice(-o)),x>0&&setTimeout(()=>{n(c)},x)},[o,n]);return e.jsxs(qe.Provider,{value:{toasts:d,addToast:l,removeToast:n},children:[r,e.jsx("div",{className:u("fixed z-[100] flex flex-col gap-2",xt[t]),children:s?e.jsx(b.AnimatePresence,{mode:"popLayout",children:d.map(m=>e.jsx(Ae,{toast:m,onRemove:n,animate:s},m.id))}):d.map(m=>e.jsx(Ae,{toast:m,onRemove:n,animate:s},m.id))})]})};_e.displayName="ToastProvider";const bt=({onCapture:r,onRemove:t,preview:o,label:a="Take Photo",disabled:s,className:d,animate:i=!0})=>{const n=i!==!1,l=S.useRef(null),m=c=>{const x=c.target.files?.[0];x&&r(x)};return e.jsxs("div",{className:u("w-full",d),children:[a&&e.jsx("label",{className:"block mb-2 text-sm font-medium text-primary",children:a}),o?e.jsxs("div",{className:"relative rounded-lg overflow-hidden border-2 border-border",children:[e.jsx("img",{src:o,alt:"Preview",className:"w-full h-48 object-cover"}),t&&e.jsx("button",{onClick:t,className:"absolute top-2 right-2 p-2 bg-error text-white rounded-full shadow-lg hover:bg-red-600",children:e.jsx(C.X,{className:"w-4 h-4"})})]}):e.jsxs(b.motion.button,{type:"button",whileTap:n?{scale:s?1:.98}:void 0,onClick:()=>l.current?.click(),disabled:s,className:u("w-full p-4 rounded-lg border-2 border-border","flex items-center justify-center gap-3","bg-secondary hover:bg-border hover:border-border-dark","transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed"),children:[e.jsx(C.Camera,{className:"w-6 h-6 text-primary"}),e.jsx("span",{className:"font-medium text-foreground",children:"Capture Photo"})]}),e.jsx("input",{ref:l,type:"file",accept:"image/*",capture:"environment",onChange:m,className:"hidden",disabled:s})]})},ht=({onUpload:r,accept:t="*/*",multiple:o=!1,label:a="Upload Files",disabled:s,className:d,animate:i=!0})=>{const n=i!==!1,l=S.useRef(null),m=c=>{c&&r(Array.from(c))};return e.jsxs("div",{className:u("w-full",d),children:[a&&e.jsx("label",{className:"block mb-2 text-sm font-medium text-primary",children:a}),e.jsxs(b.motion.button,{type:"button",whileTap:n?{scale:s?1:.98}:void 0,onClick:()=>!s&&l.current?.click(),disabled:s,className:u("w-full p-4 rounded-lg border-2 border-border","flex items-center justify-center gap-3","bg-secondary hover:bg-border hover:border-border-dark","transition-all duration-200 cursor-pointer","disabled:opacity-50 disabled:cursor-not-allowed"),children:[e.jsx(C.Upload,{className:"w-6 h-6 text-primary"}),e.jsx("span",{className:"font-medium text-foreground",children:o?"Upload Files":"Upload File"})]}),e.jsx("input",{ref:l,type:"file",accept:t,multiple:o,onChange:c=>m(c.target.files),className:"hidden",disabled:s})]})},ft=({onRecordingComplete:r,label:t="Record Audio",maxDuration:o=300,disabled:a,className:s,animate:d=!0})=>{const i=d!==!1,[n,l]=S.useState(!1),[m,c]=S.useState(!1),[x,N]=S.useState(0),[v,w]=S.useState(null),j=S.useRef(null),h=S.useRef([]),k=S.useRef(null),P=async()=>{try{const f=await navigator.mediaDevices.getUserMedia({audio:!0}),G=new MediaRecorder(f);j.current=G,h.current=[],G.ondataavailable=B=>{B.data.size>0&&h.current.push(B.data)},G.onstop=()=>{const B=new Blob(h.current,{type:"audio/webm"}),p=URL.createObjectURL(B);w(p),r(B),f.getTracks().forEach(I=>I.stop())},G.start(),l(!0),N(0),k.current=setInterval(()=>{N(B=>B>=o?(L(),B):B+1)},1e3)}catch(f){console.error("Error accessing microphone:",f)}},z=()=>{j.current?.state==="recording"&&(j.current.pause(),c(!0),k.current&&clearInterval(k.current))},M=()=>{j.current?.state==="paused"&&(j.current.resume(),c(!1),k.current=setInterval(()=>{N(f=>Math.min(f+1,o))},1e3))},L=()=>{j.current&&(j.current.stop(),l(!1),c(!1),k.current&&(clearInterval(k.current),k.current=null))},E=()=>{w(null),N(0)},T=f=>{const G=Math.floor(f/60),B=f%60;return`${G.toString().padStart(2,"0")}:${B.toString().padStart(2,"0")}`};return e.jsxs("div",{className:u("w-full",s),children:[t&&e.jsx("label",{className:"block mb-2 text-sm font-medium text-primary",children:t}),e.jsxs("div",{className:"p-4 md:p-6 bg-background rounded-lg border-2 border-border space-y-4",children:[!v&&e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(b.motion.button,{type:"button",whileTap:i?{scale:a?1:.95}:void 0,onClick:n?m?M:z:P,disabled:a,className:u("w-16 h-16 md:w-20 md:h-20 rounded-full flex items-center justify-center","transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed",n?u("bg-warning text-white",i&&"animate-pulse"):"bg-primary text-white hover:bg-primary-dark"),children:n?m?e.jsx(C.Play,{className:"w-6 h-6 md:w-8 md:h-8"}):e.jsx(C.Pause,{className:"w-6 h-6 md:w-8 md:h-8"}):e.jsx(C.Mic,{className:"w-6 h-6 md:w-8 md:h-8"})}),n&&!m&&e.jsx(b.motion.div,{className:"absolute top-0 right-0 w-4 h-4 bg-error rounded-full border-2 border-white",animate:i?{scale:[1,1.2,1]}:void 0,transition:i?{repeat:1/0,duration:1.5}:{duration:0}})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xl md:text-2xl font-mono font-semibold text-foreground",children:T(x)}),e.jsx("p",{className:"text-xs md:text-sm text-primary/70 mt-1",children:n?m?"Paused":"Recording...":"Tap to record"})]}),n&&e.jsxs(b.motion.button,{...i?{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1}}:{},type:"button",onClick:L,className:"px-4 py-2 text-sm bg-error text-white rounded-full font-medium hover:bg-red-600 flex items-center gap-2",children:[e.jsx(C.Square,{className:"w-4 h-4"}),"Stop"]})]}),v&&e.jsxs(b.motion.div,{...i?{initial:{opacity:0},animate:{opacity:1}}:{},className:"space-y-3",children:[e.jsx("audio",{src:v,controls:!0,className:"w-full"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm text-primary/70",children:["Duration: ",T(x)]}),e.jsxs("button",{type:"button",onClick:E,className:"flex items-center gap-2 px-3 py-1.5 text-sm text-error hover:bg-red-50 rounded-lg transition-colors",children:[e.jsx(C.Trash2,{className:"w-4 h-4"}),"Delete"]})]})]})]})]})},xe=r=>{const t=r.toUpperCase().split("").map(o=>127397+o.charCodeAt(0));return String.fromCodePoint(...t)},gt=()=>{if(typeof navigator>"u")return null;const t=(navigator.language||"").match(/[-_](\w{2})$/);return t?t[1].toUpperCase():null},Je=({value:r,onChange:t,country:o,defaultCountry:a="US",autoDetect:s=!0,onCountryChange:d,label:i,error:n,hint:l,searchable:m=!0,showFlags:c=!0,animate:x=!0,disabled:N,className:v,placeholder:w,...j})=>{const h=x!==!1,[k,P]=S.useState(!1),[z,M]=S.useState(""),[L,E]=S.useState(a),T=S.useRef(null);S.useEffect(()=>{o&&E(o.toUpperCase())},[o]),S.useEffect(()=>{if(!o&&s){const p=gt();p&&E(p)}},[s,o]),S.useEffect(()=>{const p=I=>{T.current&&!T.current.contains(I.target)&&(P(!1),M(""))};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const f=S.useMemo(()=>{const p=(o||L||a).toUpperCase();return Z.find(I=>I.iso2===p)||Z[0]},[o,L,a]),G=S.useMemo(()=>{if(!m||!z.trim())return Z;const p=z.toLowerCase();return Z.filter(I=>I.name.toLowerCase().includes(p)||I.iso2.toLowerCase().includes(p)||I.dialCode.replace(/\s/g,"").includes(p.replace(/\s/g,"")))},[z,m]),B=p=>{o||E(p.iso2),d?.(p),P(!1),M("")};return e.jsxs("div",{ref:T,className:u("w-full space-y-1.5",v),children:[i&&e.jsx("label",{className:"block text-sm font-medium text-foreground",children:i}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:u("flex items-stretch rounded-md border transition-all duration-200 bg-background","focus-within:ring-2 focus-within:ring-primary focus-within:border-transparent","disabled:bg-secondary disabled:cursor-not-allowed",n?"border-error":"border-border"),children:[e.jsxs("button",{type:"button",onClick:()=>!N&&P(!k),disabled:N,className:u("flex items-center gap-2 px-3 py-2 text-left","border-r border-border/70","hover:bg-secondary transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),"aria-haspopup":"listbox","aria-expanded":k,children:[c&&e.jsx("span",{className:"text-base","aria-hidden":!0,children:xe(f.iso2)}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:f.dialCode}),e.jsx(C.ChevronDown,{className:u("w-4 h-4 text-primary transition-transform",k&&"rotate-180")})]}),e.jsx("input",{type:"tel",inputMode:"tel",value:r??"",onChange:p=>t?.(p.target.value),placeholder:w||"Phone number",disabled:N,className:u("flex-1 px-4 py-2.5 text-base bg-transparent text-foreground","placeholder:text-foreground/50 focus:outline-none","disabled:opacity-50 disabled:cursor-not-allowed"),...j})]}),h?e.jsx(b.AnimatePresence,{children:k?e.jsxs(b.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},role:"listbox",className:"absolute right-0 z-50 mt-2 w-max min-w-56 max-w-none bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[m&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(C.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search country or code",value:z,onChange:p=>M(p.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"}),z&&e.jsx("button",{type:"button",onClick:()=>M(""),className:"absolute right-2 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:e.jsx(C.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsx("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:G.map(p=>e.jsxs("button",{type:"button",role:"option","aria-selected":p.iso2===f.iso2,onClick:()=>B(p),className:u("w-full px-3 py-2 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors",p.iso2===f.iso2&&"bg-border text-foreground"),children:[c&&e.jsx("span",{className:"text-base","aria-hidden":!0,children:xe(p.iso2)}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:p.name}),e.jsx("span",{className:"ml-auto text-xs text-primary/70",children:p.dialCode})]},p.iso2))})]}):null}):k&&e.jsxs("div",{role:"listbox",className:"absolute right-0 z-50 mt-2 w-max min-w-56 max-w-none bg-background rounded-md border border-border shadow-lg max-h-80 overflow-hidden",children:[m&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(C.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary/50"}),e.jsx("input",{type:"text",placeholder:"Search country or code",value:z,onChange:p=>M(p.target.value),className:"w-full pl-10 pr-8 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"}),z&&e.jsx("button",{type:"button",onClick:()=>M(""),className:"absolute right-2 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:e.jsx(C.X,{className:"w-4 h-4 text-primary/50 hover:text-primary"})})]})}),e.jsx("div",{className:"overflow-y-auto max-h-64 p-2 space-y-1",children:G.map(p=>e.jsxs("button",{type:"button",role:"option","aria-selected":p.iso2===f.iso2,onClick:()=>B(p),className:u("w-full px-3 py-2 text-left flex items-center gap-2 rounded-sm cursor-pointer","hover:bg-secondary transition-colors",p.iso2===f.iso2&&"bg-border text-foreground"),children:[c&&e.jsx("span",{className:"text-base","aria-hidden":!0,children:xe(p.iso2)}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:p.name}),e.jsx("span",{className:"ml-auto text-xs text-primary/70",children:p.dialCode})]},p.iso2))})]})]}),n&&e.jsx(b.motion.p,{...h?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0}}:{},className:"text-sm text-error",children:n}),l&&!n&&e.jsx("p",{className:"text-sm text-primary/70",children:l})]})};Je.displayName="PhoneInput";const yt=({items:r,onRemove:t,onView:o,columns:a=3,className:s,animate:d=!0})=>{const i=d!==!1,n={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4"},l=c=>{if(!c)return"";const x=c/1024;return x<1024?`${x.toFixed(1)} KB`:`${(x/1024).toFixed(1)} MB`},m=c=>{switch(c){case"document":return e.jsx(C.FileText,{className:"w-8 h-8 text-primary"});case"audio":return e.jsx(C.FileText,{className:"w-8 h-8 text-primary"});default:return e.jsx(C.Image,{className:"w-8 h-8 text-primary"})}};return r.length===0?null:e.jsx("div",{className:u("w-full",s),children:e.jsx("div",{className:u("grid gap-3",n[a]),children:r.map(c=>e.jsxs(b.motion.div,{...i?{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}}:{},className:"relative group",children:[e.jsx("div",{onClick:()=>o?.(c),className:u("aspect-square rounded-lg overflow-hidden border-2 border-border","flex items-center justify-center","cursor-pointer hover:border-border-dark transition-all",c.type==="image"?"bg-border":"bg-secondary"),children:c.type==="image"?e.jsx("img",{src:c.url,alt:c.name,className:"w-full h-full object-cover"}):e.jsxs("div",{className:"flex flex-col items-center gap-2 p-3",children:[m(c.type),e.jsx("p",{className:"text-xs text-center text-primary line-clamp-2",children:c.name})]})}),t&&e.jsx(b.motion.button,{...i?{initial:{opacity:0},whileHover:{opacity:1}}:{},className:"absolute -top-2 -right-2 p-1.5 bg-error text-white rounded-full shadow-lg hover:bg-red-600 opacity-0 group-hover:opacity-100 transition-opacity",onClick:x=>{x.stopPropagation(),t(c.id)},children:e.jsx(C.X,{className:"w-4 h-4"})}),c.size&&e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-black/60 text-white text-xs p-1.5 backdrop-blur-sm",children:[e.jsx("p",{className:"truncate",children:c.name}),e.jsx("p",{className:"text-white/70",children:l(c.size)})]})]},c.id))})})},wt=({text:r="Built by StackLoop",showHeart:t=!0,href:o,position:a="fixed",backgroundColor:s="bg-gray-900",textColor:d="text-gray-400",className:i=""})=>{const n=t?e.jsxs(e.Fragment,{children:["Built with ",e.jsx("span",{className:"text-red-500 mx-1",children:"❤️"})," by ",r.replace(/^Built by /,"")]}):r,l=o?e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:`${d} hover:text-white transition-colors duration-200 text-sm`,children:n}):e.jsx("span",{className:`${d} text-sm`,children:n});return e.jsx("div",{className:`${a} bottom-0 left-0 right-0 ${s} ${i}`,style:{zIndex:40},children:e.jsx("div",{className:"flex items-center justify-center py-2 px-4",children:l})})};exports.AudioRecorder=ft;exports.Badge=nt;exports.BottomSheet=rt;exports.Button=de;exports.CameraCapture=bt;exports.Card=$r;exports.CardContent=Jr;exports.CardDescription=_r;exports.CardHeader=Yr;exports.CardTitle=qr;exports.Checkbox=Ke;exports.CountrySelect=He;exports.CreditBar=wt;exports.DatePicker=Hr;exports.Drawer=Xr;exports.Dropdown=Kr;exports.DualSlider=Vr;exports.FAB=ot;exports.FileUploader=ht;exports.FloatingActionButton=$e;exports.Input=Ue;exports.Modal=Zr;exports.ModalContent=Qr;exports.ModalFooter=et;exports.OfflineBadge=it;exports.Pagination=at;exports.PhoneInput=Je;exports.RadioPills=Or;exports.Select=fe;exports.Slider=Ur;exports.Spinner=Ye;exports.StepProgress=st;exports.SyncIndicator=lt;exports.Table=tt;exports.Textarea=Ve;exports.ThumbnailGrid=yt;exports.ToastProvider=_e;exports.Toggle=We;exports.cn=u;exports.useToast=mt;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|