@fabio.caffarello/react-design-system 1.14.2 → 1.15.0
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 +73 -8
- package/dist/index.cjs +688 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17061 -392
- package/dist/index.js.map +1 -1
- package/dist/react-design-system.css +1 -1
- package/dist/styles/index.cjs +2 -0
- package/dist/styles/index.js +2 -0
- package/dist/{components → styles}/index.js.map +1 -1
- package/dist/ui/styles-entry.d.ts +1 -0
- package/package.json +2 -22
- package/dist/components/index.cjs +0 -2
- package/dist/components/index.js +0 -158
- package/dist/components-B08xLmiA.cjs +0 -689
- package/dist/components-B08xLmiA.cjs.map +0 -1
- package/dist/components-DEuqI-ld.js +0 -12572
- package/dist/components-DEuqI-ld.js.map +0 -1
- package/dist/primitives/index.cjs +0 -2
- package/dist/primitives/index.cjs.map +0 -1
- package/dist/primitives/index.js +0 -2874
- package/dist/primitives/index.js.map +0 -1
- package/dist/providers/index.cjs +0 -2
- package/dist/providers/index.cjs.map +0 -1
- package/dist/providers/index.js +0 -19
- package/dist/providers/index.js.map +0 -1
- package/dist/tokens/index.cjs +0 -2
- package/dist/tokens/index.cjs.map +0 -1
- package/dist/tokens/index.js +0 -1606
- package/dist/tokens/index.js.map +0 -1
- /package/dist/{components → styles}/index.cjs.map +0 -0
|
@@ -1,689 +0,0 @@
|
|
|
1
|
-
"use strict";var na=Object.defineProperty,aa=Object.defineProperties;var oa=Object.getOwnPropertyDescriptors;var xt=Object.getOwnPropertySymbols;var ur=Object.prototype.hasOwnProperty,fr=Object.prototype.propertyIsEnumerable;var dr=(e,s,t)=>s in e?na(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,I=(e,s)=>{for(var t in s||(s={}))ur.call(s,t)&&dr(e,t,s[t]);if(xt)for(var t of xt(s))fr.call(s,t)&&dr(e,t,s[t]);return e},F=(e,s)=>aa(e,oa(s));var B=(e,s)=>{var t={};for(var n in e)ur.call(e,n)&&s.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&xt)for(var n of xt(e))s.indexOf(n)<0&&fr.call(e,n)&&(t[n]=e[n]);return t};var bt=(e,s,t)=>new Promise((n,a)=>{var o=l=>{try{u(t.next(l))}catch(c){a(c)}},i=l=>{try{u(t.throw(l))}catch(c){a(c)}},u=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,i);u((t=t.apply(e,s)).next())});const b=require("./tokens/index.cjs"),L=require("./primitives/index.cjs"),d=require("react"),$e=require("react-dom");function Rr(e){var s,t,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(s=0;s<a;s++)e[s]&&(t=Rr(e[s]))&&(n&&(n+=" "),n+=t)}else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Tr(){for(var e,s,t=0,n="",a=arguments.length;t<a;t++)(e=arguments[t])&&(s=Rr(e))&&(n&&(n+=" "),n+=s);return n}const ia=(e,s)=>{const t=new Array(e.length+s.length);for(let n=0;n<e.length;n++)t[n]=e[n];for(let n=0;n<s.length;n++)t[e.length+n]=s[n];return t},la=(e,s)=>({classGroupId:e,validator:s}),Ar=(e=new Map,s=null,t)=>({nextPart:e,validators:s,classGroupId:t}),St="-",mr=[],ca="arbitrary..",da=e=>{const s=fa(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return ua(i);const u=i.split(St),l=u[0]===""&&u.length>1?1:0;return Ir(u,l,s)},getConflictingClassGroupIds:(i,u)=>{if(u){const l=n[i],c=t[i];return l?c?ia(c,l):l:c||mr}return t[i]||mr}}},Ir=(e,s,t)=>{if(e.length-s===0)return t.classGroupId;const a=e[s],o=t.nextPart.get(a);if(o){const c=Ir(e,s+1,o);if(c)return c}const i=t.validators;if(i===null)return;const u=s===0?e.join(St):e.slice(s).join(St),l=i.length;for(let c=0;c<l;c++){const f=i[c];if(f.validator(u))return f.classGroupId}},ua=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=e.slice(1,-1),t=s.indexOf(":"),n=s.slice(0,t);return n?ca+n:void 0})(),fa=e=>{const{theme:s,classGroups:t}=e;return ma(t,s)},ma=(e,s)=>{const t=Ar();for(const n in e){const a=e[n];hs(a,t,n,s)}return t},hs=(e,s,t,n)=>{const a=e.length;for(let o=0;o<a;o++){const i=e[o];pa(i,s,t,n)}},pa=(e,s,t,n)=>{if(typeof e=="string"){ga(e,s,t);return}if(typeof e=="function"){ha(e,s,t,n);return}xa(e,s,t,n)},ga=(e,s,t)=>{const n=e===""?s:Mr(s,e);n.classGroupId=t},ha=(e,s,t,n)=>{if(ba(e)){hs(e(n),s,t,n);return}s.validators===null&&(s.validators=[]),s.validators.push(la(t,e))},xa=(e,s,t,n)=>{const a=Object.entries(e),o=a.length;for(let i=0;i<o;i++){const[u,l]=a[i];hs(l,Mr(s,u),t,n)}},Mr=(e,s)=>{let t=e;const n=s.split(St),a=n.length;for(let o=0;o<a;o++){const i=n[o];let u=t.nextPart.get(i);u||(u=Ar(),t.nextPart.set(i,u)),t=u}return t},ba=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,va=e=>{if(e<1)return{get:()=>{},set:()=>{}};let s=0,t=Object.create(null),n=Object.create(null);const a=(o,i)=>{t[o]=i,s++,s>e&&(s=0,n=t,t=Object.create(null))};return{get(o){let i=t[o];if(i!==void 0)return i;if((i=n[o])!==void 0)return a(o,i),i},set(o,i){o in t?t[o]=i:a(o,i)}}},cs="!",pr=":",ya=[],gr=(e,s,t,n,a)=>({modifiers:e,hasImportantModifier:s,baseClassName:t,maybePostfixModifierPosition:n,isExternal:a}),wa=e=>{const{prefix:s,experimentalParseClassName:t}=e;let n=a=>{const o=[];let i=0,u=0,l=0,c;const f=a.length;for(let y=0;y<f;y++){const j=a[y];if(i===0&&u===0){if(j===pr){o.push(a.slice(l,y)),l=y+1;continue}if(j==="/"){c=y;continue}}j==="["?i++:j==="]"?i--:j==="("?u++:j===")"&&u--}const p=o.length===0?a:a.slice(l);let m=p,x=!1;p.endsWith(cs)?(m=p.slice(0,-1),x=!0):p.startsWith(cs)&&(m=p.slice(1),x=!0);const v=c&&c>l?c-l:void 0;return gr(o,x,m,v)};if(s){const a=s+pr,o=n;n=i=>i.startsWith(a)?o(i.slice(a.length)):gr(ya,!1,i,void 0,!0)}if(t){const a=n;n=o=>t({className:o,parseClassName:a})}return n},ja=e=>{const s=new Map;return e.orderSensitiveModifiers.forEach((t,n)=>{s.set(t,1e6+n)}),t=>{const n=[];let a=[];for(let o=0;o<t.length;o++){const i=t[o],u=i[0]==="[",l=s.has(i);u||l?(a.length>0&&(a.sort(),n.push(...a),a=[]),n.push(i)):a.push(i)}return a.length>0&&(a.sort(),n.push(...a)),n}},ka=e=>I({cache:va(e.cacheSize),parseClassName:wa(e),sortModifiers:ja(e)},da(e)),Sa=/\s+/,Na=(e,s)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:o}=s,i=[],u=e.trim().split(Sa);let l="";for(let c=u.length-1;c>=0;c-=1){const f=u[c],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:y}=t(f);if(p){l=f+(l.length>0?" "+l:l);continue}let j=!!y,h=n(j?v.substring(0,y):v);if(!h){if(!j){l=f+(l.length>0?" "+l:l);continue}if(h=n(v),!h){l=f+(l.length>0?" "+l:l);continue}j=!1}const w=m.length===0?"":m.length===1?m[0]:o(m).join(":"),C=x?w+cs:w,g=C+h;if(i.indexOf(g)>-1)continue;i.push(g);const S=a(h,j);for(let N=0;N<S.length;++N){const A=S[N];i.push(C+A)}l=f+(l.length>0?" "+l:l)}return l},Ca=(...e)=>{let s=0,t,n,a="";for(;s<e.length;)(t=e[s++])&&(n=Dr(t))&&(a&&(a+=" "),a+=n);return a},Dr=e=>{if(typeof e=="string")return e;let s,t="";for(let n=0;n<e.length;n++)e[n]&&(s=Dr(e[n]))&&(t&&(t+=" "),t+=s);return t},$a=(e,...s)=>{let t,n,a,o;const i=l=>{const c=s.reduce((f,p)=>p(f),e());return t=ka(c),n=t.cache.get,a=t.cache.set,o=u,u(l)},u=l=>{const c=n(l);if(c)return c;const f=Na(l,t);return a(l,f),f};return o=i,(...l)=>o(Ca(...l))},Ea=[],ae=e=>{const s=t=>t[e]||Ea;return s.isThemeGetter=!0,s},_r=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ra=/^\d+\/\d+$/,Ta=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Aa=/\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$/,Ia=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ma=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Da=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,He=e=>Ra.test(e),Q=e=>!!e&&!Number.isNaN(Number(e)),Re=e=>!!e&&Number.isInteger(Number(e)),Qt=e=>e.endsWith("%")&&Q(e.slice(0,-1)),Se=e=>Ta.test(e),_a=()=>!0,za=e=>Aa.test(e)&&!Ia.test(e),Fr=()=>!1,Fa=e=>Ma.test(e),Pa=e=>Da.test(e),La=e=>!H(e)&&!q(e),Oa=e=>Ze(e,Or,Fr),H=e=>_r.test(e),Fe=e=>Ze(e,Wr,za),es=e=>Ze(e,qa,Q),hr=e=>Ze(e,Pr,Fr),Wa=e=>Ze(e,Lr,Pa),vt=e=>Ze(e,Vr,Fa),q=e=>zr.test(e),rt=e=>Je(e,Wr),Va=e=>Je(e,Ga),xr=e=>Je(e,Pr),Ba=e=>Je(e,Or),Ha=e=>Je(e,Lr),yt=e=>Je(e,Vr,!0),Ze=(e,s,t)=>{const n=_r.exec(e);return n?n[1]?s(n[1]):t(n[2]):!1},Je=(e,s,t=!1)=>{const n=zr.exec(e);return n?n[1]?s(n[1]):t:!1},Pr=e=>e==="position"||e==="percentage",Lr=e=>e==="image"||e==="url",Or=e=>e==="length"||e==="size"||e==="bg-size",Wr=e=>e==="length",qa=e=>e==="number",Ga=e=>e==="family-name",Vr=e=>e==="shadow",Ka=()=>{const e=ae("color"),s=ae("font"),t=ae("text"),n=ae("font-weight"),a=ae("tracking"),o=ae("leading"),i=ae("breakpoint"),u=ae("container"),l=ae("spacing"),c=ae("radius"),f=ae("shadow"),p=ae("inset-shadow"),m=ae("text-shadow"),x=ae("drop-shadow"),v=ae("blur"),y=ae("perspective"),j=ae("aspect"),h=ae("ease"),w=ae("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],g=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...g(),q,H],N=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],k=()=>[q,H,l],$=()=>[He,"full","auto",...k()],E=()=>[Re,"none","subgrid",q,H],R=()=>["auto",{span:["full",Re,q,H]},Re,q,H],M=()=>[Re,"auto",q,H],z=()=>["auto","min","max","fr",q,H],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...k()],G=()=>[He,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],O=()=>[e,q,H],ne=()=>[...g(),xr,hr,{position:[q,H]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",Ba,Oa,{size:[q,H]}],V=()=>[Qt,rt,Fe],X=()=>["","none","full",c,q,H],J=()=>["",Q,rt,Fe],K=()=>["solid","dashed","dotted","double"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[Q,Qt,xr,hr],se=()=>["","none",v,q,H],oe=()=>["none",Q,q,H],le=()=>["none",Q,q,H],ue=()=>[Q,q,H],je=()=>[He,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Se],breakpoint:[Se],color:[_a],container:[Se],"drop-shadow":[Se],ease:["in","out","in-out"],font:[La],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Se],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Se],shadow:[Se],spacing:["px",Q],text:[Se],"text-shadow":[Se],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",He,H,q,j]}],container:["container"],columns:[{columns:[Q,H,q,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:S()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Re,"auto",q,H]}],basis:[{basis:[He,"full","auto",u,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Q,He,"auto","initial","none",H]}],grow:[{grow:["",Q,q,H]}],shrink:[{shrink:["",Q,q,H]}],order:[{order:[Re,"first","last","none",q,H]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[u,"screen",...G()]}],"min-w":[{"min-w":[u,"screen","none",...G()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[i]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",t,rt,Fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,q,es]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qt,H]}],"font-family":[{font:[Va,H,s]}],"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:[a,q,H]}],"line-clamp":[{"line-clamp":[Q,"none",q,es]}],leading:[{leading:[o,...k()]}],"list-image":[{"list-image":["none",q,H]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",q,H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[Q,"from-font","auto",q,Fe]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[Q,"auto",q,H]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q,H]}],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",q,H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Re,q,H],radial:["",q,H],conic:[Re,q,H]},Ha,Wa]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Q,q,H]}],"outline-w":[{outline:["",Q,rt,Fe]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",f,yt,vt]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",p,yt,vt]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[Q,Fe]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",m,yt,vt]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[Q,q,H]}],"mix-blend":[{"mix-blend":[...Y(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Y()}],"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":[Q]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[q,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"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":g()}],"mask-image-conic-pos":[{"mask-conic":[Q]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",q,H]}],filter:[{filter:["","none",q,H]}],blur:[{blur:se()}],brightness:[{brightness:[Q,q,H]}],contrast:[{contrast:[Q,q,H]}],"drop-shadow":[{"drop-shadow":["","none",x,yt,vt]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",Q,q,H]}],"hue-rotate":[{"hue-rotate":[Q,q,H]}],invert:[{invert:["",Q,q,H]}],saturate:[{saturate:[Q,q,H]}],sepia:[{sepia:["",Q,q,H]}],"backdrop-filter":[{"backdrop-filter":["","none",q,H]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[Q,q,H]}],"backdrop-contrast":[{"backdrop-contrast":[Q,q,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Q,q,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Q,q,H]}],"backdrop-invert":[{"backdrop-invert":["",Q,q,H]}],"backdrop-opacity":[{"backdrop-opacity":[Q,q,H]}],"backdrop-saturate":[{"backdrop-saturate":[Q,q,H]}],"backdrop-sepia":[{"backdrop-sepia":["",Q,q,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",q,H]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Q,"initial",q,H]}],ease:[{ease:["linear","initial",h,q,H]}],delay:[{delay:[Q,q,H]}],animate:[{animate:["none",w,q,H]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,q,H]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[q,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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",q,H]}],"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":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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",q,H]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[Q,rt,Fe,es]}],stroke:[{stroke:["none",...O()]}],"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"]}},Ya=$a(Ka);function D(...e){return Ya(Tr(e))}const br=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vr=Tr,Ua=(e,s)=>t=>{var n;if((s==null?void 0:s.variants)==null)return vr(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:a,defaultVariants:o}=s,i=Object.keys(a).map(c=>{const f=t==null?void 0:t[c],p=o==null?void 0:o[c];if(f===null)return null;const m=br(f)||br(p);return a[c][m]}),u=t&&Object.entries(t).reduce((c,f)=>{let[p,m]=f;return m===void 0||(c[p]=m),c},{}),l=s==null||(n=s.compoundVariants)===null||n===void 0?void 0:n.reduce((c,f)=>{let v=f,{class:p,className:m}=v,x=B(v,["class","className"]);return Object.entries(x).every(y=>{let[j,h]=y;return Array.isArray(h)?h.includes(I(I({},o),u)[j]):I(I({},o),u)[j]===h})?[...c,p,m]:c},[]);return vr(e,i,l,t==null?void 0:t.class,t==null?void 0:t.className)},lt=(e,s)=>{const t=Ua(e,s);return(n=>{const a=t(n);return D(a)})};var wt={exports:{}},nt={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var yr;function Xa(){if(yr)return nt;yr=1;var e=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function t(n,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:o}}return nt.Fragment=s,nt.jsx=t,nt.jsxs=t,nt}var at={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var wr;function Za(){return wr||(wr=1,process.env.NODE_ENV!=="production"&&(function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===R?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case j:return"Fragment";case w:return"Profiler";case h:return"StrictMode";case N:return"Suspense";case A:return"SuspenseList";case E:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case y:return"Portal";case g:return T.displayName||"Context";case C:return(T._context.displayName||"Context")+".Consumer";case S:var V=T.render;return T=T.displayName,T||(T=V.displayName||V.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case k:return V=T.displayName||null,V!==null?V:e(T.type)||"Memo";case $:V=T._payload,T=T._init;try{return e(T(V))}catch(X){}}return null}function s(T){return""+T}function t(T){try{var V=!1}catch(K){V=!0}if(V){V=console;var X=V.error,J=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return X.call(V,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",J),s(T)}}function n(T){if(T===j)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===$)return"<...>";try{var V=e(T);return V?"<"+V+">":"<...>"}catch(X){return"<...>"}}function a(){var T=M.A;return T===null?null:T.getOwner()}function o(){return Error("react-stack-top-frame")}function i(T){if(z.call(T,"key")){var V=Object.getOwnPropertyDescriptor(T,"key").get;if(V&&V.isReactWarning)return!1}return T.key!==void 0}function u(T,V){function X(){U||(U=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",V))}X.isReactWarning=!0,Object.defineProperty(T,"key",{get:X,configurable:!0})}function l(){var T=e(this.type);return G[T]||(G[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function c(T,V,X,J,K,Y){var W=X.ref;return T={$$typeof:v,type:T,key:V,props:X,_owner:J},(W!==void 0?W:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:l}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function f(T,V,X,J,K,Y){var W=V.children;if(W!==void 0)if(J)if(_(W)){for(J=0;J<W.length;J++)p(W[J]);Object.freeze&&Object.freeze(W)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(W);if(z.call(V,"key")){W=e(T);var se=Object.keys(V).filter(function(le){return le!=="key"});J=0<se.length?"{key: someKey, "+se.join(": ..., ")+": ...}":"{key: someKey}",te[W+J]||(se=0<se.length?"{"+se.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
-
let props = %s;
|
|
19
|
-
<%s {...props} />
|
|
20
|
-
React keys must be passed directly to JSX without using spread:
|
|
21
|
-
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,J,W,se,W),te[W+J]=!0)}if(W=null,X!==void 0&&(t(X),W=""+X),i(V)&&(t(V.key),W=""+V.key),"key"in V){X={};for(var oe in V)oe!=="key"&&(X[oe]=V[oe])}else X=V;return W&&u(X,typeof T=="function"?T.displayName||T.name||"Unknown":T),c(T,W,X,a(),K,Y)}function p(T){m(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===$&&(T._payload.status==="fulfilled"?m(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function m(T){return typeof T=="object"&&T!==null&&T.$$typeof===v}var x=d,v=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),g=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),R=Symbol.for("react.client.reference"),M=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,_=Array.isArray,P=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(T){return T()}};var U,G={},O=x.react_stack_bottom_frame.bind(x,o)(),ne=P(n(o)),te={};at.Fragment=j,at.jsx=function(T,V,X){var J=1e4>M.recentlyCreatedOwnerStacks++;return f(T,V,X,!1,J?Error("react-stack-top-frame"):O,J?P(n(T)):ne)},at.jsxs=function(T,V,X){var J=1e4>M.recentlyCreatedOwnerStacks++;return f(T,V,X,!0,J?Error("react-stack-top-frame"):O,J?P(n(T)):ne)}})()),at}var jr;function Ja(){return jr||(jr=1,process.env.NODE_ENV==="production"?wt.exports=Xa():wt.exports=Za()),wt.exports}var r=Ja();const xs=d.createContext(void 0);function bs(){const e=d.useContext(xs);if(!e)throw new Error("Toast components must be used within a ToastProvider");return e}function Qa(){return d.useContext(xs)}const It=d.createContext(void 0);function Qe(){const e=d.useContext(It);if(!e)throw new Error("Dialog components must be used within a Dialog component");return e}function eo(){return d.useContext(It)}function Br({children:e,open:s,defaultOpen:t=!1,onOpenChange:n,titleId:a,descriptionId:o}){const[i,u]=d.useState(t),l=d.useRef(null),c=s!==void 0?s:i,f=m=>{s===void 0&&u(m),n==null||n(m)};d.useEffect(()=>{if(c)l.current=document.activeElement;else{const m=setTimeout(()=>{var x;(x=l.current)==null||x.focus()},0);return()=>clearTimeout(m)}},[c]),d.useEffect(()=>(c?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[c]);const p={isOpen:c,onOpenChange:f,onClose:()=>f(!1),titleId:a,descriptionId:o};return r.jsx(It.Provider,{value:p,children:e})}/**
|
|
23
|
-
* @license lucide-react v0.552.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const to=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),so=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,t,n)=>n?n.toUpperCase():t.toLowerCase()),kr=e=>{const s=so(e);return s.charAt(0).toUpperCase()+s.slice(1)},Hr=(...e)=>e.filter((s,t,n)=>!!s&&s.trim()!==""&&n.indexOf(s)===t).join(" ").trim(),ro=e=>{for(const s in e)if(s.startsWith("aria-")||s==="role"||s==="title")return!0};/**
|
|
28
|
-
* @license lucide-react v0.552.0 - ISC
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the ISC license.
|
|
31
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/var no={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
33
|
-
* @license lucide-react v0.552.0 - ISC
|
|
34
|
-
*
|
|
35
|
-
* This source code is licensed under the ISC license.
|
|
36
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const ao=d.forwardRef((c,l)=>{var f=c,{color:e="currentColor",size:s=24,strokeWidth:t=2,absoluteStrokeWidth:n,className:a="",children:o,iconNode:i}=f,u=B(f,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return d.createElement("svg",I(I(F(I({ref:l},no),{width:s,height:s,stroke:e,strokeWidth:n?Number(t)*24/Number(s):t,className:Hr("lucide",a)}),!o&&!ro(u)&&{"aria-hidden":"true"}),u),[...i.map(([p,m])=>d.createElement(p,m)),...Array.isArray(o)?o:[o]])});/**
|
|
38
|
-
* @license lucide-react v0.552.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const ee=(e,s)=>{const t=d.forwardRef((i,o)=>{var u=i,{className:n}=u,a=B(u,["className"]);return d.createElement(ao,I({ref:o,iconNode:s,className:Hr(`lucide-${to(kr(e))}`,`lucide-${e}`,n)},a))});return t.displayName=kr(e),t};/**
|
|
43
|
-
* @license lucide-react v0.552.0 - ISC
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the ISC license.
|
|
46
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const oo=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],io=ee("arrow-up-down",oo);/**
|
|
48
|
-
* @license lucide-react v0.552.0 - ISC
|
|
49
|
-
*
|
|
50
|
-
* This source code is licensed under the ISC license.
|
|
51
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const lo=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],co=ee("calendar",lo);/**
|
|
53
|
-
* @license lucide-react v0.552.0 - ISC
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the ISC license.
|
|
56
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const uo=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ds=ee("check",uo);/**
|
|
58
|
-
* @license lucide-react v0.552.0 - ISC
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the ISC license.
|
|
61
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const fo=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vs=ee("chevron-down",fo);/**
|
|
63
|
-
* @license lucide-react v0.552.0 - ISC
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the ISC license.
|
|
66
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const mo=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],it=ee("chevron-left",mo);/**
|
|
68
|
-
* @license lucide-react v0.552.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const po=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Le=ee("chevron-right",po);/**
|
|
73
|
-
* @license lucide-react v0.552.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const go=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ys=ee("circle-alert",go);/**
|
|
78
|
-
* @license lucide-react v0.552.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the ISC license.
|
|
81
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const ho=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Nt=ee("circle-check",ho);/**
|
|
83
|
-
* @license lucide-react v0.552.0 - ISC
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the ISC license.
|
|
86
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const xo=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],bo=ee("clock",xo);/**
|
|
88
|
-
* @license lucide-react v0.552.0 - ISC
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const vo=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],yo=ee("command",vo);/**
|
|
93
|
-
* @license lucide-react v0.552.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const wo=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],jo=ee("download",wo);/**
|
|
98
|
-
* @license lucide-react v0.552.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* This source code is licensed under the ISC license.
|
|
101
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const ko=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],So=ee("ellipsis-vertical",ko);/**
|
|
103
|
-
* @license lucide-react v0.552.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const No=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Co=ee("eye-off",No);/**
|
|
108
|
-
* @license lucide-react v0.552.0 - ISC
|
|
109
|
-
*
|
|
110
|
-
* This source code is licensed under the ISC license.
|
|
111
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const $o=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Eo=ee("eye",$o);/**
|
|
113
|
-
* @license lucide-react v0.552.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const Ro=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],To=ee("file",Ro);/**
|
|
118
|
-
* @license lucide-react v0.552.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const Ao=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Io=ee("funnel",Ao);/**
|
|
123
|
-
* @license lucide-react v0.552.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const Mo=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Do=ee("grip-vertical",Mo);/**
|
|
128
|
-
* @license lucide-react v0.552.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const _o=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],zo=ee("info",_o);/**
|
|
133
|
-
* @license lucide-react v0.552.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const Fo=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qr=ee("loader-circle",Fo);/**
|
|
138
|
-
* @license lucide-react v0.552.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const Po=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Lo=ee("menu",Po);/**
|
|
143
|
-
* @license lucide-react v0.552.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const Oo=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Wo=ee("panel-left-close",Oo);/**
|
|
148
|
-
* @license lucide-react v0.552.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const Vo=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Bo=ee("panel-left-open",Vo);/**
|
|
153
|
-
* @license lucide-react v0.552.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const Ho=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],us=ee("search",Ho);/**
|
|
158
|
-
* @license lucide-react v0.552.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const qo=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],qe=ee("star",qo);/**
|
|
163
|
-
* @license lucide-react v0.552.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const Go=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ko=ee("triangle-alert",Go);/**
|
|
168
|
-
* @license lucide-react v0.552.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const Yo=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Uo=ee("upload",Yo);/**
|
|
173
|
-
* @license lucide-react v0.552.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const Xo=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fe=ee("x",Xo),Ct=d.memo(function(c){var f=c,{variant:s="default",padding:t="medium",className:n="",onClick:a,"aria-label":o,"aria-labelledby":i,children:u}=f,l=B(f,["variant","padding","className","onClick","aria-label","aria-labelledby","children"]);const p=lt(D("bg-surface-base",b.getRadiusClass("lg"),"border","border-line-default","shadow-sm"),{variants:{variant:{default:"",hover:D("hover:shadow-md","transition-shadow","cursor-pointer"),selected:D("border-line-brand","shadow-md")},padding:{none:"",small:b.getSpacingClass("xs","p"),medium:b.getSpacingClass("base","p"),large:b.getSpacingClass("lg","p")}},defaultVariants:{variant:"default",padding:"medium"}}),m=d.useMemo(()=>a!==void 0||s==="hover",[a,s]),x=m?"button":void 0,v=m?0:void 0,y=D(p({variant:s,padding:t}),n),j=d.useCallback(h=>{m&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),a==null||a())},[m,a]);return r.jsx("div",F(I({className:y,role:x,tabIndex:v,onClick:a,onKeyDown:j,"aria-label":o,"aria-labelledby":i},l),{children:u}))});Ct.displayName="Card";const Mt=d.createContext(void 0);function ws(){const e=d.useContext(Mt);if(e===void 0)throw new Error("useFormContext must be used within a Form component with react-hook-form integration");return e}function Zo(){return d.useContext(Mt)}function Gr({form:e,loading:s=!1,children:t}){const n={form:e,loading:s};return r.jsx(Mt.Provider,{value:n,children:t})}function Jo(u){var l=u,{children:e,onSubmit:s,loading:t=!1,error:n=null,success:a=null,className:o=""}=l,i=B(l,["children","onSubmit","loading","error","success","className"]);const c=D(b.getSpacingClass("lg","gap"),"flex","flex-col",o);if("form"in i&&i.form!==void 0){const y=i,{form:h,onSubmit:w,onSubmitError:C}=y,g=B(y,["form","onSubmit","onSubmitError"]),S=h.handleSubmit(N=>bt(null,null,function*(){try{yield w(N)}catch(A){C==null||C(A)}}),N=>{C==null||C(N)});return r.jsx(Gr,{form:h,loading:t,children:r.jsxs("form",F(I({className:c,onSubmit:S,noValidate:!0},g),{children:[e,n&&r.jsx("div",{role:"alert",className:D(b.getSpacingClass("md","p"),b.getTypographySizeFromFontSize("sm"),"text-error-dark","bg-error-bg","border","border-error",b.getRadiusClass("md")),children:n}),a&&r.jsx("div",{role:"alert",className:D(b.getSpacingClass("md","p"),b.getTypographySizeFromFontSize("sm"),"text-success-dark","bg-success-bg","border","border-success",b.getRadiusClass("md")),children:a})]}))})}const p=i.onSubmit||s,j=i,{onSubmit:m}=j,x=B(j,["onSubmit"]),v=h=>{h.preventDefault(),p&&!t&&p(h)};return r.jsxs("form",F(I({className:c,onSubmit:v,noValidate:!0},x),{children:[e,n&&r.jsx("div",{role:"alert",className:D(b.getSpacingClass("md","p"),b.getTypographySizeFromFontSize("sm"),"text-error-dark","bg-error-bg","border","border-error",b.getRadiusClass("md")),children:n}),a&&r.jsx("div",{role:"alert",className:D(b.getSpacingClass("md","p"),b.getTypographySizeFromFontSize("sm"),"text-success-dark","bg-success-bg","border","border-success",b.getRadiusClass("md")),children:a})]}))}function Qo({name:e,label:s,children:t,rules:n,className:a=""}){var m;const{form:o}=ws();if(!o)throw new Error("FormField must be used within a Form component with react-hook-form integration");const{register:i,formState:{errors:u},watch:l}=o,c=i(e,n),f=(m=u[e])==null?void 0:m.message,p=l(e);return r.jsxs("div",{className:D("flex","flex-col",b.getSpacingClass("sm","gap"),a),children:[s&&r.jsx(L.Label,{htmlFor:e,className:D("block",b.getTypographySizeFromFontSize("sm"),b.getTypographyWeightFromFontWeight("medium"),"text-fg-primary"),children:s}),t({name:e,register:x=>i(x,n),error:f,value:p,onChange:c.onChange,onBlur:c.onBlur}),f&&r.jsx(L.ErrorMessage,{message:f})]})}var ei=e=>e.type==="checkbox",ti=e=>e instanceof Date,Ce=e=>e==null;const si=e=>typeof e=="object";var Ee=e=>!Ce(e)&&!Array.isArray(e)&&si(e)&&!ti(e),ri=e=>{const s=e.constructor&&e.constructor.prototype;return Ee(s)&&s.hasOwnProperty("isPrototypeOf")},Kr=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined";function Pe(e){if(e instanceof Date)return new Date(e);const s=typeof FileList!="undefined"&&e instanceof FileList;if(Kr&&(e instanceof Blob||s))return e;const t=Array.isArray(e);if(!t&&!(Ee(e)&&ri(e)))return e;const n=t?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=Pe(e[a]));return n}var js=e=>/^\w*$/.test(e),ye=e=>e===void 0,Yr=e=>Array.isArray(e)?e.filter(Boolean):[],ks=e=>Yr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),be=(e,s,t)=>{if(!s||!Ee(e))return t;const n=(js(s)?[s]:ks(s)).reduce((a,o)=>Ce(a)?a:a[o],e);return ye(n)||n===e?ye(e[s])?t:e[s]:n},Ur=e=>typeof e=="boolean",ni=e=>typeof e=="function",$t=(e,s,t)=>{let n=-1;const a=js(s)?[s]:ks(s),o=a.length,i=o-1;for(;++n<o;){const u=a[n];let l=t;if(n!==i){const c=e[u];l=Ee(c)||Array.isArray(c)?c:isNaN(+a[n+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=l,e=e[u]}};const Ke={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ne={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Xr=d.createContext(null);Xr.displayName="HookFormControlContext";const ai=()=>d.useContext(Xr),oi=typeof window!="undefined"?d.useLayoutEffect:d.useEffect;var Ae=e=>typeof e=="string";const ii=d.createContext(null);ii.displayName="HookFormContext";var li=(e,s,t,n,a)=>s?F(I({},t[e]),{types:F(I({},t[e]&&t[e].types?t[e].types:{}),{[n]:a||!0})}):{},ve=e=>Array.isArray(e)?e:[e],Et=e=>Ee(e)&&!Object.keys(e).length,ci=e=>e.type==="file",di=e=>{if(!Kr)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},ui=e=>e.type==="radio";function fi(e,s){const t=s.slice(0,-1).length;let n=0;for(;n<t;)e=ye(e)?n++:e[s[n++]];return e}function mi(e){for(const s in e)if(e.hasOwnProperty(s)&&!ye(e[s]))return!1;return!0}function Zr(e,s){const t=Array.isArray(s)?s:js(s)?[s]:ks(s),n=t.length===1?e:fi(e,t),a=t.length-1,o=t[a];return n&&delete n[o],a!==0&&(Ee(n)&&Et(n)||Array.isArray(n)&&mi(n))&&Zr(e,t.slice(0,-1)),e}var Jr=e=>e instanceof RegExp,jt=e=>({isOnSubmit:!e||e===Ke.onSubmit,isOnBlur:e===Ke.onBlur,isOnChange:e===Ke.onChange,isOnAll:e===Ke.all,isOnTouch:e===Ke.onTouched}),pi=(e,s,t)=>s.watchAll||s.watch.has(e)||[...s.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length)));const fs=(e,s,t,n)=>{for(const o of Object.keys(e)){const i=be(e,o);if(i){const a=i,{_f:u}=a,l=B(a,["_f"]);if(u){if(u.refs&&u.refs[0]&&s(u.refs[0],o))return!0;if(u.ref&&s(u.ref,u.name))return!0;if(fs(l,s))break}else if(Ee(l)&&fs(l,s))break}}};var gi=(e,s,t)=>{const n=ve(be(e,t));return $t(n,"root",s[t]),$t(e,t,n),e};function Sr(e,s,t="validate"){if(Ae(e)||Array.isArray(e)&&e.every(Ae)||Ur(e)&&!e)return{type:t,message:Ae(e)?e:"",ref:s}}var Ge=e=>Ee(e)&&!Jr(e)?e:{value:e,message:""},hi=(e,s,t,n,a,o)=>bt(null,null,function*(){const{ref:i,refs:u,required:l,maxLength:c,minLength:f,min:p,max:m,pattern:x,validate:v,name:y,valueAsNumber:j,mount:h}=e._f,w=be(t,y);if(!h||s.has(y))return{};const C=u?u[0]:i,g=$=>{a&&C.reportValidity&&(C.setCustomValidity(Ur($)?"":$||""),C.reportValidity())},S={};ui(i),ei(i);const N=(j||ci(i))&&ye(i.value)&&ye(w)||di(i)&&i.value===""||w===""||Array.isArray(w)&&!w.length,A=li.bind(null,y,n,S),k=($,E,R,M=Ne.maxLength,z=Ne.minLength)=>{const _=$?E:R;S[y]=I({type:$?M:z,message:_,ref:i},A($?M:z,_))};if(!Array.isArray(w)||!w.length){const{value:$,message:E}=Ae(l)?{value:!!l,message:l}:Ge(l);if($&&(S[y]=I({type:Ne.required,message:E,ref:C},A(Ne.required,E)),!n))return g(E),S}if(!N&&(!Ce(p)||!Ce(m))){let $,E;const R=Ge(m),M=Ge(p);if(!Ce(w)&&!isNaN(w)){const z=i.valueAsNumber||w&&+w;Ce(R.value)||($=z>R.value),Ce(M.value)||(E=z<M.value)}else{const z=i.valueAsDate||new Date(w),_=G=>new Date(new Date().toDateString()+" "+G),P=i.type=="time",U=i.type=="week";Ae(R.value)&&w&&($=P?_(w)>_(R.value):U?w>R.value:z>new Date(R.value)),Ae(M.value)&&w&&(E=P?_(w)<_(M.value):U?w<M.value:z<new Date(M.value))}if(($||E)&&(k(!!$,R.message,M.message,Ne.max,Ne.min),!n))return g(S[y].message),S}if((c||f)&&!N&&(Ae(w)||Array.isArray(w))){const $=Ge(c),E=Ge(f),R=!Ce($.value)&&w.length>+$.value,M=!Ce(E.value)&&w.length<+E.value;if((R||M)&&(k(R,$.message,E.message),!n))return g(S[y].message),S}if(x&&!N&&Ae(w)){const{value:$,message:E}=Ge(x);if(Jr($)&&!w.match($)&&(S[y]=I({type:Ne.pattern,message:E,ref:i},A(Ne.pattern,E)),!n))return g(E),S}if(v){if(ni(v)){const $=yield v(w,t),E=Sr($,C);if(E&&(S[y]=I(I({},E),A(Ne.validate,E.message)),!n))return g(E.message),S}else if(Ee(v)){let $={};for(const E in v){if(!Et($)&&!n)break;const R=Sr(yield v[E](w,t),C,E);R&&($=I(I({},R),A(E,R.message)),g(R.message),n&&(S[y]=$))}if(!Et($)&&(S[y]=I({ref:C},$),!n))return S}}return g(!0),S}),Te=()=>{if(typeof crypto!="undefined"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance=="undefined"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const t=(Math.random()*16+e)%16|0;return(s=="x"?t:t&3|8).toString(16)})},ts=(e,s,t={})=>t.shouldFocus||ye(t.shouldFocus)?t.focusName||`${e}.${ye(t.focusIndex)?s:t.focusIndex}.`:"",ss=(e,s)=>[...e,...ve(s)],rs=e=>Array.isArray(e)?e.map(()=>{}):void 0;function ns(e,s,t){return[...e.slice(0,s),...ve(t),...e.slice(s)]}var as=(e,s,t)=>Array.isArray(e)?(ye(e[t])&&(e[t]=void 0),e.splice(t,0,e.splice(s,1)[0]),e):[],os=(e,s)=>[...ve(s),...ve(e)];function xi(e,s){let t=0;const n=[...e];for(const a of s)n.splice(a-t,1),t++;return Yr(n).length?n:[]}var is=(e,s)=>ye(s)?[]:xi(e,ve(s).sort((t,n)=>t-n)),ls=(e,s,t)=>{[e[s],e[t]]=[e[t],e[s]]},Nr=(e,s,t)=>(e[s]=t,e);function bi(e){const s=ai(),{control:t=s,name:n,keyName:a="id",shouldUnregister:o,rules:i}=e,[u,l]=d.useState(t._getFieldArray(n)),c=d.useRef(t._getFieldArray(n).map(Te)),f=d.useRef(!1);t._names.array.add(n),d.useMemo(()=>i&&u.length>=0&&t.register(n,i),[t,n,u.length,i]),oi(()=>t._subjects.array.subscribe({next:({values:g,name:S})=>{if(S===n||!S){const N=be(g,n);Array.isArray(N)&&(l(N),c.current=N.map(Te))}}}).unsubscribe,[t,n]);const p=d.useCallback(g=>{f.current=!0,t._setFieldArray(n,g)},[t,n]),m=(g,S)=>{const N=ve(Pe(g)),A=ss(t._getFieldArray(n),N);t._names.focus=ts(n,A.length-1,S),c.current=ss(c.current,N.map(Te)),p(A),l(A),t._setFieldArray(n,A,ss,{argA:rs(g)})},x=(g,S)=>{const N=ve(Pe(g)),A=os(t._getFieldArray(n),N);t._names.focus=ts(n,0,S),c.current=os(c.current,N.map(Te)),p(A),l(A),t._setFieldArray(n,A,os,{argA:rs(g)})},v=g=>{const S=is(t._getFieldArray(n),g);c.current=is(c.current,g),p(S),l(S),!Array.isArray(be(t._fields,n))&&$t(t._fields,n,void 0),t._setFieldArray(n,S,is,{argA:g})},y=(g,S,N)=>{const A=ve(Pe(S)),k=ns(t._getFieldArray(n),g,A);t._names.focus=ts(n,g,N),c.current=ns(c.current,g,A.map(Te)),p(k),l(k),t._setFieldArray(n,k,ns,{argA:g,argB:rs(S)})},j=(g,S)=>{const N=t._getFieldArray(n);ls(N,g,S),ls(c.current,g,S),p(N),l(N),t._setFieldArray(n,N,ls,{argA:g,argB:S},!1)},h=(g,S)=>{const N=t._getFieldArray(n);as(N,g,S),as(c.current,g,S),p(N),l(N),t._setFieldArray(n,N,as,{argA:g,argB:S},!1)},w=(g,S)=>{const N=Pe(S),A=Nr(t._getFieldArray(n),g,N);c.current=[...A].map((k,$)=>!k||$===g?Te():c.current[$]),p(A),l([...A]),t._setFieldArray(n,A,Nr,{argA:g,argB:N},!0,!1)},C=g=>{const S=ve(Pe(g));c.current=S.map(Te),p([...S]),l([...S]),t._setFieldArray(n,[...S],N=>N,{},!0,!1)};return d.useEffect(()=>{if(t._state.action=!1,pi(n,t._names)&&t._subjects.state.next(I({},t._formState)),f.current&&(!jt(t._options.mode).isOnSubmit||t._formState.isSubmitted)&&!jt(t._options.reValidateMode).isOnSubmit)if(t._options.resolver)t._runSchema([n]).then(g=>{t._updateIsValidating([n]);const S=be(g.errors,n),N=be(t._formState.errors,n);(N?!S&&N.type||S&&(N.type!==S.type||N.message!==S.message):S&&S.type)&&(S?$t(t._formState.errors,n,S):Zr(t._formState.errors,n),t._subjects.state.next({errors:t._formState.errors}))});else{const g=be(t._fields,n);g&&g._f&&!(jt(t._options.reValidateMode).isOnSubmit&&jt(t._options.mode).isOnSubmit)&&hi(g,t._names.disabled,t._formValues,t._options.criteriaMode===Ke.all,t._options.shouldUseNativeValidation).then(S=>!Et(S)&&t._subjects.state.next({errors:gi(t._formState.errors,S,n)}))}t._subjects.state.next({name:n,values:Pe(t._formValues)}),t._names.focus&&fs(t._fields,(g,S)=>{if(t._names.focus&&S.startsWith(t._names.focus)&&g.focus)return g.focus(),1}),t._names.focus="",t._setValid(),f.current=!1},[u,n,t]),d.useEffect(()=>(!be(t._formValues,n)&&t._setFieldArray(n),()=>{const g=(S,N)=>{const A=be(t._fields,S);A&&A._f&&(A._f.mount=N)};t._options.shouldUnregister||o?t.unregister(n):g(n,!1)}),[n,t,a,o]),{swap:d.useCallback(j,[p,n,t]),move:d.useCallback(h,[p,n,t]),prepend:d.useCallback(x,[p,n,t]),append:d.useCallback(m,[p,n,t]),remove:d.useCallback(v,[p,n,t]),insert:d.useCallback(y,[p,n,t]),update:d.useCallback(w,[p,n,t]),replace:d.useCallback(C,[p,n,t]),fields:d.useMemo(()=>u.map((g,S)=>F(I({},g),{[a]:c.current[S]||Te()})),[u,a])}}function vi(e){const{form:s}=ws();if(!s)throw new Error("useFormFieldArray must be used within a Form component with react-hook-form integration");return bi(F(I({},e),{control:s.control}))}function Qr(a){var o=a,{items:e,separator:s="/",className:t=""}=o,n=B(o,["items","separator","className"]);const i=["flex","items-center",b.getSpacingClass("sm","space-x"),b.getTypographySize("bodySmall")],u=D(...i,t);return r.jsx("nav",F(I({"aria-label":"Breadcrumb",className:u},n),{children:r.jsx("ol",{className:D("flex","items-center",b.getSpacingClass("sm","space-x")),children:e.map((l,c)=>{const f=c===e.length-1;return r.jsxs("li",{className:"flex items-center",children:[c>0&&r.jsx("span",{className:D(b.getSpacingClass("sm","mx"),"text-fg-tertiary"),"aria-hidden":"true",children:s}),f?r.jsx("span",{className:D("text-fg-primary",b.getTypographyWeight("label")),"aria-current":"page",children:l.label}):l.href?r.jsx("a",{href:l.href,className:D("inline-flex","items-center",b.getSpacingClass("xs","px"),b.getSpacingClass("xs","pt"),"border-b-2","border-transparent",b.getTypographySize("bodySmall"),b.getTypographyWeight("label"),"transition-colors","text-fg-secondary","hover:border-line-emphasis","hover:text-fg-primary"),children:l.label}):r.jsx("span",{className:"text-fg-secondary",children:l.label})]},c)})})}))}function en(l){var c=l,{currentPage:e,totalPages:s,onPageChange:t,totalItems:n,itemsPerPage:a,showPageInfo:o=!0,className:i=""}=c,u=B(c,["currentPage","totalPages","onPageChange","totalItems","itemsPerPage","showPageInfo","className"]);const f=()=>{e>1&&t(e-1)},p=()=>{e<s&&t(e+1)},m=h=>{h>=1&&h<=s&&h!==e&&t(h)},x=()=>{const h=[];if(s<=5)for(let C=1;C<=s;C++)h.push(C);else if(e<=3){for(let C=1;C<=4;C++)h.push(C);h.push("ellipsis"),h.push(s)}else if(e>=s-2){h.push(1),h.push("ellipsis");for(let C=s-3;C<=s;C++)h.push(C)}else{h.push(1),h.push("ellipsis");for(let C=e-1;C<=e+1;C++)h.push(C);h.push("ellipsis"),h.push(s)}return h},v=n&&a?(e-1)*a+1:void 0,y=n&&a?Math.min(e*a,n):void 0,j=D("flex","items-center","justify-between",b.getSpacingClass("base","px"),b.getSpacingClass("md","py"),i);return r.jsxs("nav",F(I({className:j,"aria-label":"Pagination"},u),{children:[r.jsxs("div",{className:D("flex","items-center",b.getSpacingClass("sm","gap")),children:[r.jsx(L.Button,{variant:"secondary",onClick:f,disabled:e===1,size:"sm",children:"Previous"}),r.jsx("div",{className:D("flex","items-center",b.getSpacingClass("xs","gap")),children:x().map((h,w)=>{if(h==="ellipsis")return r.jsx("span",{className:D(b.getSpacingClass("sm","px"),"text-fg-tertiary"),children:"..."},`ellipsis-${w}`);const C=h,g=C===e;return r.jsx(L.Button,{variant:g?"primary":"ghost",onClick:()=>m(C),size:"sm","aria-current":g?"page":void 0,"aria-label":`Go to page ${C}`,children:C},C)})}),r.jsx(L.Button,{variant:"secondary",onClick:p,disabled:e===s,size:"sm",children:"Next"})]}),o&&n&&a&&r.jsxs("div",{className:D(b.getTypographySizeFromFontSize("sm"),"text-fg-primary"),children:["Showing ",v," to ",y," of ",n," results"]})]}))}function tn(l){var c=l,{title:e,message:s,actionLabel:t,onAction:n,illustration:a,variant:o="default",className:i=""}=c,u=B(c,["title","message","actionLabel","onAction","illustration","variant","className"]);const f=D("flex","flex-col","items-center","justify-center","text-center",b.getSpacingClass("xl","py"),b.getSpacingClass("base","px"),i),p=o==="withAction"||t&&n,m=o==="withIllustration"||a;return r.jsxs("div",F(I({className:f,role:"status","aria-live":"polite","aria-label":`${e}. ${s}`},u),{children:[m&&a&&r.jsx("div",{className:D(b.getSpacingClass("base","mb")),"aria-hidden":"true",children:a}),r.jsx(L.Text,{as:"h3",className:D(b.getTypographySize("h4"),b.getTypographyWeightFromFontWeight("semibold"),"text-fg-primary",b.getSpacingClass("sm","mb")),children:e}),r.jsx(L.Text,{as:"p",className:D(b.getTypographySize("bodySmall"),"text-fg-secondary",b.getSpacingClass("md","mb"),"max-w-sm"),children:s}),p&&t&&n&&r.jsx(L.Button,{variant:"primary",onClick:n,children:t})]}))}function sn(u){var l=u,{trigger:e,items:s,align:t="right",variant:n="default",className:a="","aria-label":o}=l,i=B(l,["trigger","items","align","variant","className","aria-label"]);const[c,f]=d.useState(!1),[p,m]=d.useState(-1),x=d.useRef(null),v=d.useRef(null),y=d.useRef(null),j=d.useRef([]),h=`dropdown-menu-${Math.random().toString(36).substr(2,9)}`,w=`dropdown-trigger-${Math.random().toString(36).substr(2,9)}`;d.useEffect(()=>{const k=$=>{x.current&&!x.current.contains($.target)&&(f(!1),m(-1))};return c&&(document.addEventListener("mousedown",k),setTimeout(()=>{var E;const $=s.findIndex(R=>!R.disabled);$>=0&&(m($),(E=j.current[$])==null||E.focus())},0)),()=>{document.removeEventListener("mousedown",k)}},[c,s]),d.useEffect(()=>{if(!c)return;const k=E=>{var z,_,P,U;const R=s.map((G,O)=>({item:G,index:O})).filter(({item:G})=>!G.disabled),M=R.findIndex(({index:G})=>G===p);switch(E.key){case"ArrowDown":{E.preventDefault();const G=M<R.length-1?R[M+1].index:R[0].index;m(G),(z=j.current[G])==null||z.focus();break}case"ArrowUp":{E.preventDefault();const G=M>0?R[M-1].index:R[R.length-1].index;m(G),(_=j.current[G])==null||_.focus();break}case"Home":{E.preventDefault();const G=R[0].index;m(G),(P=j.current[G])==null||P.focus();break}case"End":{E.preventDefault();const G=R[R.length-1].index;m(G),(U=j.current[G])==null||U.focus();break}case"Enter":case" ":E.preventDefault(),p>=0&&!s[p].disabled&&C(s[p]);break;case"Escape":E.preventDefault(),f(!1),m(-1),setTimeout(()=>{var G;(G=v.current)==null||G.focus()},0);break}},$=y.current;if($){const E=k;return $.addEventListener("keydown",E),()=>{$.removeEventListener("keydown",E)}}},[c,p,s]);const C=k=>{k.disabled||(k.onClick(),f(!1),m(-1),setTimeout(()=>{var $;($=v.current)==null||$.focus()},0))},g=()=>{f(!c),m(-1)},S=k=>{(k.key==="Enter"||k.key===" "||k.key==="ArrowDown")&&(k.preventDefault(),f(!0))},N=t==="right"?"right-0":"left-0",A=d.isValidElement(e)?d.cloneElement(e,{onClick:k=>{g(),e.props.onClick&&e.props.onClick(k)},onKeyDown:k=>{S(k),e.props.onKeyDown&&e.props.onKeyDown(k)},"aria-haspopup":"menu","aria-expanded":c,"aria-controls":h,"aria-label":o||e.props["aria-label"]||"Open menu",id:w,ref:k=>{v.current=k,typeof e.ref=="function"?e.ref(k):e.ref&&(e.ref.current=k)}}):r.jsx("div",{ref:v,onClick:g,onKeyDown:S,role:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,"aria-controls":h,"aria-label":o||"Open menu",id:w,children:e});return r.jsxs("div",F(I({className:D("relative","inline-block",a),ref:x},i),{children:[A,c&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:D("fixed","inset-0","z-10"),onClick:()=>{f(!1),m(-1)},"aria-hidden":"true"}),r.jsx("div",{ref:y,id:h,className:D("absolute","z-20",b.getSpacingClass("sm","mt"),"w-48",b.getRadiusClass("md"),b.getShadowClass("lg"),"bg-surface-overlay","ring-1","ring-line-strong","ring-opacity-5",N),role:"menu","aria-orientation":"vertical","aria-labelledby":w,"aria-activedescendant":p>=0?`${h}-item-${p}`:void 0,children:r.jsx("div",{className:D(b.getSpacingClass("xs","py")),role:"none",children:s.map((k,$)=>{const E=D("block",b.getSpacingClass("base","px"),b.getSpacingClass("xs","py"),b.getTypographySize("bodySmall"),"w-full","text-left","focus:outline-none",k.disabled?D("text-fg-disabled","cursor-not-allowed","opacity-50"):k.variant==="danger"?D("text-error-dark","hover:bg-error-bg-emphasis","focus:bg-error-bg-emphasis"):D("text-fg-primary","hover:bg-surface-hover","focus:bg-surface-hover"));return r.jsx("button",{id:`${h}-item-${$}`,ref:R=>{j.current[$]=R},type:"button",className:E,onClick:()=>C(k),disabled:k.disabled,role:"menuitem","aria-disabled":k.disabled,tabIndex:k.disabled?-1:p===$?0:-1,children:k.label},$)})})})]})]}))}const rn=d.createContext(void 0);function nn(){const e=d.useContext(rn);if(!e)throw new Error("DatePicker components must be used within a DatePicker component");return e}function ms({children:e,mode:s="single",value:t,defaultValue:n,onValueChange:a,minDate:o,maxDate:i,disabledDates:u,locale:l}){const c=()=>{if(t!==void 0)return null;if(n){if(s==="single"&&n instanceof Date)return n;if(s==="range"&&typeof n=="object"&&"start"in n)return null}return null},f=()=>t!==void 0?null:n&&s==="range"&&typeof n=="object"&&"start"in n?n:{start:null,end:null},[p,m]=d.useState(c()),[x,v]=d.useState(f()),y=s==="single"?t instanceof Date?t:p:null,j=s==="range"?t&&typeof t=="object"&&"start"in t?t:x:null,C={selectedDate:y,selectedRange:j,mode:s,onDateChange:g=>{s==="single"&&(t===void 0&&m(g),a==null||a(g))},onRangeChange:g=>{s==="range"&&(t===void 0&&v(g),a==null||a(g))},minDate:o,maxDate:i,disabledDates:u,locale:l};return r.jsx(rn.Provider,{value:C,children:e})}function ot(e,s="yyyy-MM-dd"){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return s.replace("yyyy",String(t)).replace("MM",n).replace("dd",a).replace("MM/dd/yyyy",`${n}/${a}/${t}`).replace("dd/MM/yyyy",`${a}/${n}/${t}`)}function Cr(e){if(!e)return null;const s=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(s){const[,a,o,i]=s,u=new Date(parseInt(a),parseInt(o)-1,parseInt(i));if(!isNaN(u.getTime()))return u}const t=e.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(t){const[,a,o,i]=t,u=new Date(parseInt(i),parseInt(a)-1,parseInt(o));if(!isNaN(u.getTime()))return u}const n=e.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(n){const[,a,o,i]=n,u=new Date(parseInt(i),parseInt(o)-1,parseInt(a));if(!isNaN(u.getTime()))return u}return null}function Ss(u){var l=u,{placeholder:e="Select date",format:s="yyyy-MM-dd",showCalendarButton:t=!0,"aria-label":n,onFocus:a,className:o=""}=l,i=B(l,["placeholder","format","showCalendarButton","aria-label","onFocus","className"]);const{selectedDate:c,selectedRange:f,mode:p,onDateChange:m}=nn(),[x,v]=d.useState(""),[y,j]=d.useState(!1),h=d.useRef(null);d.useEffect(()=>{p==="single"&&c?v(ot(c,s)):p==="range"&&f?f.start&&f.end?v(`${ot(f.start,s)} - ${ot(f.end,s)}`):f.start?v(ot(f.start,s)):v(""):v("")},[c,f,p,s]);const w=S=>{const N=S.target.value;if(v(N),p==="single"){const A=Cr(N);m(A)}},C=()=>{if(j(!1),x&&p==="single"){const S=Cr(x);S&&v(ot(S,s))}},g=()=>{var S;(S=h.current)==null||S.focus()};return r.jsx("div",F(I({className:`relative ${o}`},i),{children:r.jsx(L.Input,{ref:h,type:"text",value:x,onChange:w,onFocus:()=>{j(!0),a==null||a()},onBlur:C,placeholder:e,"aria-label":n||e,rightIcon:t?r.jsx(L.Button,{variant:"iconOnly",size:"sm",onClick:g,"aria-label":"Open calendar",type:"button",children:r.jsx(co,{className:"h-4 w-4"})}):void 0})}))}function yi(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function wi(e){return new Date(e.getFullYear(),e.getMonth(),1).getDay()}function Ye(e,s){return!e||!s?!1:e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()&&e.getDate()===s.getDate()}function ji(e,s){return e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()}function ki(e,s,t){if(!s||!t)return!1;const n=e.getTime();return n>=s.getTime()&&n<=t.getTime()}function $r(e,s,t,n){return!!(s&&e<s||t&&e>t||n!=null&&n.some(a=>Ye(e,a)))}const Si=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ni=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ns(a){var o=a,{month:e,onMonthChange:s,className:t=""}=o,n=B(o,["month","onMonthChange","className"]);const{selectedDate:i,selectedRange:u,mode:l,onDateChange:c,onRangeChange:f,minDate:p,maxDate:m,disabledDates:x}=nn(),[v,y]=d.useState(e||i||(u==null?void 0:u.start)||new Date),j=d.useRef(null),[h,w]=d.useState(null);d.useEffect(()=>{e&&y(e)},[e]);const C=yi(v),g=wi(v),S=[];for(let E=0;E<g;E++)S.push(null);for(let E=1;E<=C;E++)S.push(new Date(v.getFullYear(),v.getMonth(),E));const N=E=>{if(!$r(E,p,m,x)){if(l==="single")c(E);else if(l==="range"){const R=u||{start:null,end:null};!R.start||R.start&&R.end?f({start:E,end:null}):R.start&&!R.end&&(E<R.start?f({start:E,end:R.start}):f({start:R.start,end:E}))}}},A=()=>{const E=new Date(v.getFullYear(),v.getMonth()-1,1);y(E),s==null||s(E)},k=()=>{const E=new Date(v.getFullYear(),v.getMonth()+1,1);y(E),s==null||s(E)},$=(E,R)=>{let M=null;switch(E.key){case"ArrowLeft":E.preventDefault(),M=new Date(R.getFullYear(),R.getMonth(),R.getDate()-1);break;case"ArrowRight":E.preventDefault(),M=new Date(R.getFullYear(),R.getMonth(),R.getDate()+1);break;case"ArrowUp":E.preventDefault(),M=new Date(R.getFullYear(),R.getMonth(),R.getDate()-7);break;case"ArrowDown":E.preventDefault(),M=new Date(R.getFullYear(),R.getMonth(),R.getDate()+7);break;case"Home":E.preventDefault(),M=new Date(R.getFullYear(),R.getMonth(),1);break;case"End":E.preventDefault(),M=new Date(R.getFullYear(),R.getMonth()+1,0);break;case"Enter":case" ":E.preventDefault(),N(R);return}M&&(ji(M,v)||y(new Date(M.getFullYear(),M.getMonth(),1)),w(M))};return r.jsxs("div",F(I({ref:j,className:`p-4 ${t}`,role:"grid","aria-label":"Calendar"},n),{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx(L.Button,{variant:"iconOnly",size:"sm",onClick:A,"aria-label":"Previous month",children:r.jsx(it,{className:"h-4 w-4"})}),r.jsxs("div",{className:"text-sm font-semibold",children:[Ni[v.getMonth()]," ",v.getFullYear()]}),r.jsx(L.Button,{variant:"iconOnly",size:"sm",onClick:k,"aria-label":"Next month",children:r.jsx(Le,{className:"h-4 w-4"})})]}),r.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:Si.map(E=>r.jsx("div",{className:"text-center text-xs font-medium text-fg-tertiary py-1",children:E},E))}),r.jsx("div",{className:"grid grid-cols-7 gap-1",children:S.map((E,R)=>{if(!E)return r.jsx("div",{className:"aspect-square"},`empty-${R}`);const M=l==="single"?Ye(E,i):Ye(E,(u==null?void 0:u.start)||null)||Ye(E,(u==null?void 0:u.end)||null),z=l==="range"&&u?ki(E,u.start,u.end):!1,_=$r(E,p,m,x),P=Ye(E,new Date),U=h&&Ye(E,h);return r.jsx("button",{type:"button",onClick:()=>N(E),onKeyDown:G=>$(G,E),disabled:_,className:`
|
|
178
|
-
aspect-square
|
|
179
|
-
text-sm
|
|
180
|
-
${b.getRadiusClass("md")}
|
|
181
|
-
transition-colors
|
|
182
|
-
focus:outline-none
|
|
183
|
-
focus:ring-2
|
|
184
|
-
focus:ring-offset-1
|
|
185
|
-
${_?"text-fg-disabled cursor-not-allowed":M?"bg-surface-brand text-fg-inverse font-semibold":z?"bg-surface-brand-muted text-fg-brand-emphasis":P?"border-2 border-line-brand font-semibold":U?"bg-surface-brand-muted":"hover:bg-surface-active"}
|
|
186
|
-
`,"aria-label":E.toDateString(),"aria-selected":M,"aria-disabled":_,children:E.getDate()},E.toISOString())})})]}))}function Dt({children:e,mode:s="single",value:t,defaultValue:n,onValueChange:a,minDate:o,maxDate:i,disabledDates:u,placeholder:l,format:c,showCalendarButton:f=!0,"aria-label":p,className:m=""}){const[x,v]=d.useState(!1),y=d.useRef(null),j=d.useRef(null);return d.useEffect(()=>{if(!x)return;const h=w=>{var N,A,k,$;const C=w.target,g=(A=(N=y.current)==null?void 0:N.contains(C))!=null?A:!1,S=($=(k=j.current)==null?void 0:k.contains(C))!=null?$:!1;!g&&!S&&v(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[x]),d.useEffect(()=>{if(!x)return;const h=w=>{w.key==="Escape"&&v(!1)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[x]),e?r.jsx(ms,{mode:s,value:t,defaultValue:n,onValueChange:a,minDate:o,maxDate:i,disabledDates:u,children:e}):r.jsx("div",{ref:y,className:`relative ${m}`,children:r.jsxs(ms,{mode:s,value:t,defaultValue:n,onValueChange:a,minDate:o,maxDate:i,disabledDates:u,children:[r.jsx(Ss,{placeholder:l,format:c,showCalendarButton:f,"aria-label":p,onFocus:()=>v(!0)}),x&&r.jsx(an,{containerRef:y,popupRef:j,children:r.jsx(Ns,{})})]})})}function an({children:e,containerRef:s,popupRef:t}){const n=d.useRef(null),a=t||n,[o,i]=d.useState(null);if(d.useEffect(()=>{if(s!=null&&s.current){const l=s.current.getBoundingClientRect();i({top:l.bottom+window.scrollY+8,left:l.left+window.scrollX})}},[s]),!o)return null;const u=r.jsx("div",{ref:a,className:`
|
|
187
|
-
fixed ${b.getZIndexClass("popover")}
|
|
188
|
-
bg-surface-overlay
|
|
189
|
-
${b.getRadiusClass("lg")}
|
|
190
|
-
${b.getShadowClass("xl")}
|
|
191
|
-
border border-line-default
|
|
192
|
-
`,role:"dialog","aria-modal":"false","aria-label":"Date picker calendar",style:{top:`${o.top}px`,left:`${o.left}px`},children:e});return typeof window!="undefined"?$e.createPortal(u,document.body):u}Dt.Input=Ss;Dt.Calendar=Ns;Dt.Popup=an;const Ci=Dt,_t=d.createContext(void 0);function zt(){const e=d.useContext(_t);if(e===void 0)throw new Error("useTabsContext must be used within a Tabs component");return e}function $i(){return d.useContext(_t)}function on({defaultValue:e,value:s,onValueChange:t,orientation:n="horizontal",activationMode:a="automatic",children:o}){const[i,u]=d.useState(e||""),l=s!==void 0,c=l?s:i,f=d.useCallback(m=>{l||u(m),t==null||t(m)},[l,t]),p={value:c,onValueChange:f,orientation:n,activationMode:a};return r.jsx(_t.Provider,{value:p,children:o})}function ln(a){var o=a,{children:e,className:s="",variant:t="default"}=o,n=B(o,["children","className","variant"]);const{orientation:i}=zt(),u=d.useRef(null);d.useEffect(()=>{const f=u.current;if(!f)return;const p=m=>{var j;const x=Array.from(f.querySelectorAll('[role="tab"]:not([disabled])')),v=x.findIndex(h=>h===document.activeElement);if(v===-1)return;let y=v;i==="horizontal"?m.key==="ArrowRight"?(m.preventDefault(),y=(v+1)%x.length):m.key==="ArrowLeft"&&(m.preventDefault(),y=(v-1+x.length)%x.length):m.key==="ArrowDown"?(m.preventDefault(),y=(v+1)%x.length):m.key==="ArrowUp"&&(m.preventDefault(),y=(v-1+x.length)%x.length),m.key==="Home"?(m.preventDefault(),y=0):m.key==="End"&&(m.preventDefault(),y=x.length-1),y!==v&&((j=x[y])==null||j.focus())};return f.addEventListener("keydown",p),()=>f.removeEventListener("keydown",p)},[i]);const l=t==="compact"&&i==="vertical"?"flex":"inline-flex",c=D(i==="vertical"?"flex-col":"flex-row",b.getSpacingClass("xs","gap"));return r.jsx("div",F(I({ref:u,role:"tablist","aria-orientation":i,className:D(l,c,b.getSpacingClass("xs","p"),"bg-surface-muted",b.getRadiusClass("md"),s)},n),{children:e}))}function cn(u){var l=u,{value:e,children:s,disabled:t=!1,className:n="",onClick:a,onKeyDown:o}=l,i=B(l,["value","children","disabled","className","onClick","onKeyDown"]);const{value:c,onValueChange:f,orientation:p,activationMode:m}=zt(),x=c===e,v=h=>{t||((m==="automatic"||x)&&f(e),a==null||a(h))},y=h=>{var w;m==="automatic"&&!t&&!x&&f(e),(w=i.onFocus)==null||w.call(i,h)},j=h=>{if(!t&&!(h.key==="ArrowRight"||h.key==="ArrowLeft"||h.key==="ArrowDown"||h.key==="ArrowUp"||h.key==="Home"||h.key==="End")){if(m==="manual"&&(h.key==="Enter"||h.key===" ")){h.preventDefault(),f(e);return}o==null||o(h)}};return r.jsx("button",F(I({type:"button",role:"tab","aria-selected":x,"aria-controls":`tabpanel-${e}`,id:`tab-${e}`,tabIndex:t?-1:x?0:-1,disabled:t,onClick:v,onFocus:y,onKeyDown:j,className:D("inline-flex","items-center","justify-center",b.getSpacingClass("sm","px"),b.getSpacingClass("xs","py"),b.getTypographySize("bodySmall"),b.getTypographyWeight("label"),"transition-colors","focus:outline-none","focus:ring-2","focus:ring-line-focus","focus:ring-offset-2",b.getRadiusClass("sm"),x?D("bg-surface-brand","text-fg-inverse"):D("text-fg-tertiary","hover:bg-surface-active"),t?"opacity-50 cursor-not-allowed":"cursor-pointer",n)},i),{children:s}))}function dn(o){var i=o,{value:e,children:s,forceMount:t=!1,className:n=""}=i,a=B(i,["value","children","forceMount","className"]);const{value:u}=zt(),l=u===e;return!l&&!t?null:r.jsx("div",F(I({role:"tabpanel",id:`tabpanel-${e}`,"aria-labelledby":`tab-${e}`,hidden:!l,className:`
|
|
193
|
-
mt-2
|
|
194
|
-
focus:outline-none
|
|
195
|
-
${n}
|
|
196
|
-
`},a),{children:s}))}function Ft(t){var n=t,{children:e}=n,s=B(n,["children"]);return r.jsx(on,F(I({},s),{children:e}))}Ft.List=ln;Ft.Trigger=cn;Ft.Content=dn;const Ei=Ft,Pt=d.forwardRef(function(m,p){var x=m,{onSearch:s,onClear:t,loading:n=!1,showClearButton:a=!0,debounceMs:o=300,value:i,defaultValue:u,onChange:l,className:c=""}=x,f=B(x,["onSearch","onClear","loading","showClearButton","debounceMs","value","defaultValue","onChange","className"]);const[v,y]=d.useState(typeof u=="string"?u:""),[j,h]=d.useState(null),w=i!==void 0,C=w?i:v,g=C!=null&&String(C).length>0,S=k=>{const $=k.target.value;w||y($),l==null||l(k),j&&clearTimeout(j);const E=setTimeout(()=>{s==null||s($)},o);h(E)},N=()=>{w||y("");const k={target:{value:""},currentTarget:{value:""}};l==null||l(k),t==null||t(),s==null||s("")},A=k=>{var $;k.key==="Enter"&&s&&s(String(C||"")),($=f.onKeyDown)==null||$.call(f,k)};return r.jsx("div",{className:D("relative",c),children:r.jsx(L.Input,F(I({ref:p},f),{type:"search",value:C,onChange:S,onKeyDown:A,leftIcon:n?r.jsx("div",{className:"animate-spin",children:r.jsx(us,{className:"h-4 w-4"})}):r.jsx(us,{className:"h-4 w-4"}),rightIcon:a&&g&&!n?r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:N,className:"h-auto p-1","aria-label":"Clear search",children:r.jsx(fe,{className:"h-4 w-4"})}):void 0,className:D(b.getSpacingClass("lg","pr"))}))})});Pt.displayName="SearchInput";const Cs=d.forwardRef(function({option:s,isHighlighted:t,onSelect:n},a){const o=()=>{s.disabled||n(s)};return r.jsxs("div",{ref:a,role:"option","aria-selected":t,"aria-disabled":s.disabled,onClick:o,className:`
|
|
197
|
-
flex
|
|
198
|
-
items-center
|
|
199
|
-
gap-2
|
|
200
|
-
${b.getSpacingClass("sm","px")}
|
|
201
|
-
${b.getSpacingClass("sm","py")}
|
|
202
|
-
text-sm
|
|
203
|
-
cursor-pointer
|
|
204
|
-
transition-colors
|
|
205
|
-
${t?"bg-surface-active":""}
|
|
206
|
-
${s.disabled?"opacity-50 cursor-not-allowed":"hover:bg-surface-hover"}
|
|
207
|
-
`,children:[s.icon&&r.jsx("span",{className:"flex-shrink-0",children:s.icon}),r.jsx("span",{className:"flex-1",children:s.label})]})});Cs.displayName="AutocompleteOption";const Lt=d.forwardRef(function({options:s,highlightedIndex:t,onSelect:n,loading:a=!1,emptyMessage:o="No options found",containerRef:i,showSelectAll:u=!1,allSelected:l=!1,onSelectAll:c,onDeselectAll:f},p){const[m,x]=d.useState({top:0,left:0,width:0});d.useEffect(()=>{if(i.current){const y=i.current.getBoundingClientRect();x({top:y.bottom+window.scrollY+4,left:y.left+window.scrollX,width:y.width})}},[i]);const v=r.jsx("div",{ref:p,role:"listbox",className:`
|
|
208
|
-
absolute
|
|
209
|
-
${b.getZIndexClass("popover")}
|
|
210
|
-
bg-surface-overlay
|
|
211
|
-
${b.getRadiusClass("md")}
|
|
212
|
-
${b.getShadowClass("lg")}
|
|
213
|
-
border
|
|
214
|
-
border-line-default
|
|
215
|
-
max-h-60
|
|
216
|
-
overflow-y-auto
|
|
217
|
-
${b.getSpacingClass("xs","py")}
|
|
218
|
-
`,style:{top:`${m.top}px`,left:`${m.left}px`,width:`${m.width}px`},children:a?r.jsx("div",{className:`
|
|
219
|
-
${b.getSpacingClass("md","p")}
|
|
220
|
-
text-sm
|
|
221
|
-
text-fg-tertiary
|
|
222
|
-
text-center
|
|
223
|
-
`,children:"Loading..."}):s.length===0?r.jsx("div",{className:`
|
|
224
|
-
${b.getSpacingClass("md","p")}
|
|
225
|
-
text-sm
|
|
226
|
-
text-fg-tertiary
|
|
227
|
-
text-center
|
|
228
|
-
`,children:o}):r.jsxs(r.Fragment,{children:[u&&r.jsx("div",{className:`
|
|
229
|
-
${b.getSpacingClass("sm","px")}
|
|
230
|
-
${b.getSpacingClass("sm","py")}
|
|
231
|
-
text-sm
|
|
232
|
-
font-medium
|
|
233
|
-
cursor-pointer
|
|
234
|
-
hover:bg-surface-hover
|
|
235
|
-
border-b
|
|
236
|
-
border-line-default
|
|
237
|
-
`,onClick:l?f:c,children:l?"Deselect All":"Select All"}),s.map((y,j)=>r.jsx(Cs,{option:y,isHighlighted:j===t,onSelect:n},y.value))]})});return typeof window!="undefined"?$e.createPortal(v,document.body):null});Lt.displayName="AutocompleteList";const un=d.forwardRef(function({options:s,value:t,defaultValue:n,onChange:a,onSelect:o,placeholder:i="Type to search...",loading:u=!1,disabled:l=!1,emptyMessage:c="No options found",debounceMs:f=300,filterOptions:p,className:m="",inputClassName:x="",size:v="md"},y){const[j,h]=d.useState(typeof n=="string"?n:""),[w,C]=d.useState(!1),[g,S]=d.useState(-1),[N,A]=d.useState(""),k=d.useRef(null),$=d.useRef(null),E=d.useRef(null),R=d.useRef(null),M=t!==void 0,z=M?t:j,P=N.trim()?p?p(s,N):s.filter(T=>T.label.toLowerCase().includes(N.toLowerCase())):s,U=P.length>0,G=T=>{const V=T.target.value;A(V),M||h(V),a==null||a(V),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{C(!0),S(-1)},f)},O=T=>{var V;T.disabled||(M||h(T.value),A(T.label),C(!1),S(-1),a==null||a(T.value),o==null||o(T),(V=$.current)==null||V.focus())},ne=T=>{if(!w||P.length===0){(T.key==="ArrowDown"||T.key==="Enter")&&C(!0);return}switch(T.key){case"ArrowDown":T.preventDefault(),S(V=>V<P.length-1?V+1:0);break;case"ArrowUp":T.preventDefault(),S(V=>V>0?V-1:P.length-1);break;case"Enter":T.preventDefault(),g>=0&&g<P.length&&O(P[g]);break;case"Escape":T.preventDefault(),C(!1),S(-1);break}};d.useEffect(()=>{if(!w)return;const T=V=>{k.current&&!k.current.contains(V.target)&&(C(!1),S(-1))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[w]),d.useEffect(()=>{if(g>=0&&E.current){const T=E.current.querySelectorAll('[role="option"]');T[g]&&typeof T[g].scrollIntoView=="function"&&T[g].scrollIntoView({block:"nearest",behavior:"smooth"})}},[g]),d.useEffect(()=>{if(z){const T=s.find(V=>V.value===z);A(T?T.label:z)}else A("")},[z,s]);const te=w&&(U||u||c);return r.jsxs("div",{ref:k,className:`relative ${m}`,children:[r.jsx(L.Input,{ref:$||y,value:N,onChange:G,onKeyDown:ne,onFocus:()=>C(!0),placeholder:i,disabled:l,size:v,rightIcon:u?r.jsx(qr,{className:"h-4 w-4 animate-spin"}):r.jsx(vs,{className:`h-4 w-4 transition-transform ${w?"rotate-180":""}`}),className:x}),te&&r.jsx(Lt,{ref:E,options:P,highlightedIndex:g,onSelect:O,loading:u,emptyMessage:c,containerRef:k})]})});un.displayName="Autocomplete";const fn=d.forwardRef(function({options:s,value:t,defaultValue:n=[],onChange:a,onSelect:o,placeholder:i="Select options...",loading:u=!1,disabled:l=!1,emptyMessage:c="No options found",maxSelected:f,showSelectAll:p=!1,className:m="",inputClassName:x="",size:v="md"},y){const[j,h]=d.useState(n),[w,C]=d.useState(!1),[g,S]=d.useState(-1),[N,A]=d.useState(""),k=d.useRef(null),$=d.useRef(null),E=d.useRef(null),R=t!==void 0,M=R?t:j,z=s.filter(K=>M.includes(K.value)),P=(()=>{let K=s;return N.trim()&&(K=s.filter(Y=>Y.label.toLowerCase().includes(N.toLowerCase()))),K})(),U=P.length>0,G=K=>{const Y=K.target.value;A(Y),C(!0),S(-1)},O=K=>{if(K.disabled||f&&M.length>=f&&!M.includes(K.value))return;const Y=M.includes(K.value)?M.filter(W=>W!==K.value):[...M,K.value];R||h(Y),a==null||a(Y),o==null||o(s.filter(W=>Y.includes(W.value))),A("")},ne=()=>{const K=P.filter(W=>!W.disabled).map(W=>W.value),Y=[...new Set([...M,...K])];R||h(Y),a==null||a(Y),o==null||o(s.filter(W=>Y.includes(W.value)))},te=()=>{const K=P.map(W=>W.value),Y=M.filter(W=>!K.includes(W));R||h(Y),a==null||a(Y),o==null||o(s.filter(W=>Y.includes(W.value)))},T=K=>{const Y=M.filter(W=>W!==K);R||h(Y),a==null||a(Y),o==null||o(s.filter(W=>Y.includes(W.value)))},V=K=>{if(!w||P.length===0){(K.key==="ArrowDown"||K.key==="Enter")&&C(!0),K.key==="Backspace"&&N===""&&M.length>0&&T(M[M.length-1]);return}switch(K.key){case"ArrowDown":K.preventDefault(),S(Y=>Y<P.length-1?Y+1:0);break;case"ArrowUp":K.preventDefault(),S(Y=>Y>0?Y-1:P.length-1);break;case"Enter":K.preventDefault(),g>=0&&g<P.length&&O(P[g]);break;case"Escape":K.preventDefault(),C(!1),S(-1);break}};d.useEffect(()=>{if(!w)return;const K=Y=>{k.current&&!k.current.contains(Y.target)&&(C(!1),S(-1),A(""))};return document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[w]);const X=P.filter(K=>!K.disabled).every(K=>M.includes(K.value)),J=w&&(U||u||c);return r.jsxs("div",{ref:k,className:D("relative",m),children:[r.jsxs("div",{className:D("flex","flex-wrap",b.getSpacingClass("sm","gap"),b.getSpacingClass("sm","p"),"border","border-line-default",b.getRadiusClass("md"),"min-h-10","focus-within:outline-none","focus-within:ring-2","focus-within:ring-offset-2","focus-within:border-line-brand","focus-within:ring-line-brand"),children:[z.map(K=>r.jsx(L.Chip,{onRemove:()=>T(K.value),size:v==="sm"?"sm":v==="lg"?"lg":"md",children:K.label},K.value)),r.jsx("input",{ref:K=>{typeof y=="function"?y(K):y&&(y.current=K),$.current=K},type:"text",value:N,onChange:G,onKeyDown:V,onFocus:()=>C(!0),placeholder:M.length===0?i:"",disabled:l,className:D("flex-1","min-w-32","outline-none","bg-transparent",x)})]}),J&&r.jsx(Lt,{ref:E,options:P.map(K=>F(I({},K),{icon:M.includes(K.value)?r.jsx(ds,{className:D("h-4","w-4","text-fg-brand")}):K.icon})),highlightedIndex:g,onSelect:O,loading:u,emptyMessage:c,containerRef:k,showSelectAll:p&&P.length>0,allSelected:X,onSelectAll:ne,onDeselectAll:te})]})});fn.displayName="MultiSelect";function Ri({value:e,defaultValue:s=0,max:t=5,size:n="md",variant:a="filled",readOnly:o=!1,allowHalf:i=!1,showValue:u=!1,onChange:l,onHover:c,className:f="",icon:p,emptyIcon:m}){const[x,v]=d.useState(s),[y,j]=d.useState(null),h=e!==void 0,w=y!=null?y:h?e:x,C={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},g=k=>{o||(h||v(k),l==null||l(k))},S=k=>{o||(j(k),c==null||c(k))},N=()=>{o||j(null)},A=k=>{const $=k+1,E=i&&w>=$-.5&&w<$,R=w>=$,M=D(C[n],b.getAnimationClass("base"),!o&&"cursor-pointer",R||E?"text-fg-warning":"text-fg-disabled"),z=p||r.jsx(qe,{className:M,fill:R?"currentColor":"none"}),_=m||r.jsx(qe,{className:M,fill:"none"});return r.jsx("span",{className:"relative inline-block",onClick:()=>g($),onMouseEnter:()=>S($),onMouseLeave:N,role:o?void 0:"button",tabIndex:o?void 0:0,"aria-label":`Rate ${$} out of ${t}`,onKeyDown:P=>{!o&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),g($))},children:E?r.jsxs("span",{className:"relative inline-block",children:[r.jsx("span",{className:"absolute inset-0 overflow-hidden",style:{width:"50%"},children:a==="filled"?r.jsx(qe,{className:M,fill:"currentColor"}):z}),a==="filled"?r.jsx(qe,{className:M,fill:"none"}):_]}):R?a==="filled"?r.jsx(qe,{className:M,fill:"currentColor"}):z:a==="filled"?r.jsx(qe,{className:M,fill:"none"}):_},k)};return r.jsxs("div",{className:D("inline-flex","items-center",b.getSpacingClass("xs","gap"),f),children:[r.jsx("div",{className:D("flex","items-center"),role:o?"img":void 0,"aria-label":o?`Rating: ${w} out of ${t}`:void 0,children:Array.from({length:t},(k,$)=>A($))}),u&&r.jsxs("span",{className:D(b.getSpacingClass("sm","ml"),b.getTypographySizeFromFontSize("sm"),"text-fg-secondary"),children:[w.toFixed(i?1:0),"/",t]})]})}function Ti({accept:e,multiple:s=!1,maxSize:t,maxFiles:n,onFilesChange:a,onFileRemove:o,showPreview:i=!0,showProgress:u=!1,disabled:l=!1,className:c="",label:f,description:p}){const[m,x]=d.useState([]),[v,y]=d.useState(!1),j=d.useRef(null),h=R=>{if(R===0)return"0 Bytes";const M=1024,z=["Bytes","KB","MB","GB"],_=Math.floor(Math.log(R)/Math.log(M));return Math.round(R/Math.pow(M,_)*100)/100+" "+z[_]},w=R=>t&&R.size>t?`File size exceeds ${h(t)}`:null,C=R=>{const M=Array.from(R),z=[];return M.forEach(_=>{const P=w(_),U=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,G={file:_,id:U,error:P,progress:u?0:void 0};if(i&&_.type.startsWith("image/")){const O=new FileReader;O.onload=ne=>{x(te=>te.map(T=>{var V;return T.id===U?F(I({},T),{preview:(V=ne.target)==null?void 0:V.result}):T}))},O.readAsDataURL(_)}z.push(G)}),z},g=R=>{const M=s?[...m,...R]:R,z=n?M.slice(0,n):M;x(z),a==null||a(z)},S=R=>{if(R.preventDefault(),y(!1),l)return;const M=R.dataTransfer.files;if(M.length>0){const z=C(M);g(z)}},N=R=>{R.preventDefault(),l||y(!0)},A=R=>{R.preventDefault(),y(!1)},k=R=>{if(R.target.files&&R.target.files.length>0){const M=C(R.target.files);g(M)}j.current&&(j.current.value="")},$=R=>{const M=m.filter(z=>z.id!==R);x(M),a==null||a(M),o==null||o(R)},E=()=>{var R;l||(R=j.current)==null||R.click()};return r.jsxs("div",{className:D(b.getSpacingClass("lg","gap"),"flex","flex-col",c),children:[(f||p)&&r.jsxs("div",{children:[f&&r.jsx("label",{className:D("block",b.getTypographySizeFromFontSize("sm"),b.getTypographyWeightFromFontWeight("medium"),"text-fg-primary",b.getSpacingClass("xs","mb")),children:f}),p&&r.jsx("p",{className:D(b.getTypographySizeFromFontSize("sm"),"text-fg-secondary"),children:p})]}),r.jsxs("div",{onDrop:S,onDragOver:N,onDragLeave:A,onClick:E,className:D("relative","border-2","border-dashed",v?"border-line-brand":"border-line-default",b.getRadiusClass("lg"),b.getSpacingClass("lg","p"),"text-center","cursor-pointer",b.getAnimationClass("base"),"focus:border-line-focus",l?"opacity-50 cursor-not-allowed":D("hover:border-line-strong","focus:outline-none","focus:ring-2","focus:ring-offset-2")),role:"button",tabIndex:l?-1:0,"aria-label":"Upload files","aria-disabled":l,children:[r.jsx("input",{ref:j,type:"file",accept:e,multiple:s,onChange:k,disabled:l,className:"hidden"}),r.jsxs("div",{className:D("flex","flex-col","items-center",b.getSpacingClass("sm","gap")),children:[r.jsx(Uo,{className:D("h-8","w-8",v?"text-fg-brand":"text-fg-secondary")}),r.jsxs("div",{children:[r.jsx("span",{className:D(b.getTypographySizeFromFontSize("sm"),b.getTypographyWeightFromFontWeight("medium"),"text-fg-primary"),children:v?"Drop files here":"Click to upload or drag and drop"}),e&&r.jsxs("p",{className:D(b.getTypographySizeFromFontSize("xs"),"text-fg-secondary",b.getSpacingClass("xs","mt")),children:["Accepted: ",e]}),t&&r.jsxs("p",{className:D(b.getTypographySizeFromFontSize("xs"),"text-fg-secondary"),children:["Max size: ",h(t)]})]})]})]}),m.length>0&&r.jsx("div",{className:D("flex","flex-col",b.getSpacingClass("sm","gap")),children:m.map(R=>r.jsxs("div",{className:D("flex","items-center",b.getSpacingClass("md","gap"),b.getSpacingClass("base","p"),"border","border-line-default",b.getRadiusClass("md"),R.error?"bg-error-bg":"bg-surface-muted"),children:[i&&R.preview?r.jsx("img",{src:R.preview,alt:R.file.name,className:D("w-12","h-12","object-cover",b.getRadiusClass("md"))}):r.jsx(To,{className:D("h-8","w-8","text-fg-secondary")}),r.jsxs("div",{className:D("flex-1","min-w-0"),children:[r.jsx("p",{className:D(b.getTypographySizeFromFontSize("sm"),b.getTypographyWeightFromFontWeight("medium"),"text-fg-primary","truncate"),children:R.file.name}),r.jsx("p",{className:D(b.getTypographySizeFromFontSize("xs"),"text-fg-secondary"),children:h(R.file.size)}),R.error&&r.jsxs("div",{className:D("flex","items-center",b.getSpacingClass("xs","gap"),b.getSpacingClass("xs","mt")),children:[r.jsx(ys,{className:D("h-3","w-3","text-fg-error")}),r.jsx("span",{className:D(b.getTypographySizeFromFontSize("xs"),"text-fg-error"),children:R.error})]}),u&&R.progress!==void 0&&r.jsx("div",{className:D(b.getSpacingClass("sm","mt")),children:r.jsx(L.Progress,{value:R.progress,size:"sm"})})]}),!R.error&&!u&&r.jsx(Nt,{className:D("h-5","w-5","text-fg-success")}),r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:M=>{M.stopPropagation(),$(R.id)},className:"h-auto p-1","aria-label":`Remove ${R.file.name}`,children:r.jsx(fe,{className:"h-4 w-4"})})]},R.id))})]})}function $s({trigger:e,children:s,open:t,defaultOpen:n=!1,onOpenChange:a,placement:o="bottom",showCloseButton:i=!1,title:u,closeOnClickOutside:l=!0,closeOnEscape:c=!0,className:f="",triggerClassName:p="",contentClassName:m=""}){const[x,v]=d.useState(n),y=d.useRef(null),j=d.useRef(null),[h,w]=d.useState({top:0,left:0}),C=t!==void 0,g=C?t:x,S=d.useCallback(()=>{if(!y.current||!j.current)return;const $=y.current.getBoundingClientRect(),E=j.current.getBoundingClientRect(),R=window.scrollY,M=window.scrollX;let z=0,_=0;o.startsWith("top")?(z=$.top+R-E.height-8,o==="top-start"?_=$.left+M:o==="top-end"?_=$.right+M-E.width:_=$.left+M+($.width-E.width)/2):o.startsWith("bottom")?(z=$.bottom+R+8,o==="bottom-start"?_=$.left+M:o==="bottom-end"?_=$.right+M-E.width:_=$.left+M+($.width-E.width)/2):o.startsWith("left")?(_=$.left+M-E.width-8,o==="left-start"?z=$.top+R:o==="left-end"?z=$.bottom+R-E.height:z=$.top+R+($.height-E.height)/2):o.startsWith("right")&&(_=$.right+M+8,o==="right-start"?z=$.top+R:o==="right-end"?z=$.bottom+R-E.height:z=$.top+R+($.height-E.height)/2);const P=8;z=Math.max(P,Math.min(z,window.innerHeight+R-E.height-P)),_=Math.max(P,Math.min(_,window.innerWidth+M-E.width-P)),w({top:z,left:_})},[o]);d.useEffect(()=>{if(g){S();const $=()=>S(),E=()=>S();return window.addEventListener("resize",$),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",E,!0)}}},[g,o,S]),d.useEffect(()=>{g&&j.current&&setTimeout(S,0)},[g,S]);const N=d.useCallback($=>{C||v($),a==null||a($)},[C,a]),A=d.useCallback(()=>{N(!1)},[N]);d.useEffect(()=>{if(g&&c){const $=E=>{E.key==="Escape"&&A()};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)}},[g,c,A]),d.useEffect(()=>{if(g&&l){const $=E=>{j.current&&y.current&&!j.current.contains(E.target)&&!y.current.contains(E.target)&&A()};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)}},[g,l,A]);const k=g?r.jsxs("div",{ref:j,className:`
|
|
238
|
-
absolute
|
|
239
|
-
${b.getZIndexClass("popover")}
|
|
240
|
-
bg-surface-overlay
|
|
241
|
-
${b.getRadiusClass("lg")}
|
|
242
|
-
${b.getShadowClass("lg")}
|
|
243
|
-
border
|
|
244
|
-
border-line-default
|
|
245
|
-
min-w-48
|
|
246
|
-
max-w-96
|
|
247
|
-
${b.getAnimationClass("base")}
|
|
248
|
-
${m}
|
|
249
|
-
`,style:{top:`${h.top}px`,left:`${h.left}px`},role:"dialog","aria-modal":"false",children:[(u||i)&&r.jsxs("div",{className:`
|
|
250
|
-
flex
|
|
251
|
-
items-center
|
|
252
|
-
justify-between
|
|
253
|
-
${b.getSpacingClass("base","px")}
|
|
254
|
-
${b.getSpacingClass("md","py")}
|
|
255
|
-
border-b
|
|
256
|
-
border-line-default
|
|
257
|
-
`,children:[u&&r.jsx("h3",{className:`${b.getTypographySize("bodySmall")} ${b.getTypographyWeight("h5")} text-fg-primary`,children:u}),i&&r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:A,className:"h-auto p-1","aria-label":"Close popover",children:r.jsx(fe,{className:"h-4 w-4"})})]}),r.jsx("div",{className:`
|
|
258
|
-
${b.getSpacingClass("base","p")}
|
|
259
|
-
${u||i?"":b.getSpacingClass("md","p")}
|
|
260
|
-
`,children:s})]}):null;return r.jsxs("div",{className:`inline-block ${f}`,children:[r.jsx("div",{ref:y,className:p,onClick:()=>N(!g),children:e}),typeof window!="undefined"&&$e.createPortal(k,document.body)]})}function Ai({value:e,defaultValue:s,format:t="24h",onChange:n,disabled:a=!1,label:o,error:i=!1,helperText:u,className:l=""}){const[c,f]=d.useState(s||""),[p,m]=d.useState(12),[x,v]=d.useState(0),[y,j]=d.useState("AM"),h=e!==void 0,w=h?e:c,C=d.useCallback(z=>{if(!z)return{hours:12,minutes:0,amPm:"AM"};if(t==="24h"){const[_,P]=z.split(":").map(Number);return{hours:_||12,minutes:P||0,amPm:"AM"}}else{const _=z.match(/(\d+):(\d+)\s*(AM|PM)/i);return _?{hours:parseInt(_[1]),minutes:parseInt(_[2]),amPm:_[3].toUpperCase()}:{hours:12,minutes:0,amPm:"AM"}}},[t]),g=(z,_,P)=>{if(t==="24h")return`${String(z).padStart(2,"0")}:${String(_).padStart(2,"0")}`;{const U=P==="PM"&&z!==12?z+12:P==="AM"&&z===12?0:z;return`${String(U===0?12:U>12?U-12:U).padStart(2,"0")}:${String(_).padStart(2,"0")} ${P||"AM"}`}};d.useEffect(()=>{if(w){const z=C(w);m(z.hours),v(z.minutes),j(z.amPm)}},[w,C]);const S=z=>{const _=t==="24h"?Math.max(0,Math.min(23,z)):Math.max(1,Math.min(12,z));m(_);const P=g(_,x,t==="12h"?y:void 0);h||f(P),n==null||n(P)},N=z=>{const _=Math.max(0,Math.min(59,z));v(_);const P=g(p,_,t==="12h"?y:void 0);h||f(P),n==null||n(P)},A=()=>{const z=y==="AM"?"PM":"AM";j(z);const _=g(p,x,z);h||f(_),n==null||n(_)},k=()=>{if(t==="24h")S((p+1)%24);else{const z=p===12?1:p+1;S(z)}},$=()=>{if(t==="24h")S(p===0?23:p-1);else{const z=p===1?12:p-1;S(z)}},E=()=>{N((x+1)%60)},R=()=>{N(x===0?59:x-1)},M=r.jsx("div",{className:`${b.getSpacingClass("base","p")} min-w-48`,children:r.jsxs("div",{className:"flex items-center justify-center gap-4",children:[r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:k,disabled:a,"aria-label":"Increment hours",children:"↑"}),r.jsx("div",{className:"text-2xl font-mono font-semibold w-12 text-center",children:String(p).padStart(2,"0")}),r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:$,disabled:a,"aria-label":"Decrement hours",children:"↓"})]}),r.jsx("div",{className:"text-2xl font-semibold",children:":"}),r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:E,disabled:a,"aria-label":"Increment minutes",children:"↑"}),r.jsx("div",{className:"text-2xl font-mono font-semibold w-12 text-center",children:String(x).padStart(2,"0")}),r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:R,disabled:a,"aria-label":"Decrement minutes",children:"↓"})]}),t==="12h"&&r.jsxs("div",{className:"flex flex-col gap-2 ml-2",children:[r.jsx(L.Button,{variant:y==="AM"?"primary":"outline",size:"sm",onClick:()=>A(),disabled:a,children:"AM"}),r.jsx(L.Button,{variant:y==="PM"?"primary":"outline",size:"sm",onClick:()=>A(),disabled:a,children:"PM"})]})]})});return r.jsx("div",{className:l,children:r.jsx($s,{trigger:r.jsx(L.Input,{label:o,value:w||g(p,x,t==="12h"?y:void 0),readOnly:!0,disabled:a,error:i,helperText:u,leftIcon:r.jsx(bo,{className:"h-4 w-4"}),className:"cursor-pointer"}),placement:"bottom-start",showCloseButton:!0,title:"Select Time",children:M})})}function Ii({value:e,defaultValue:s="#000000",format:t="hex",onChange:n,presets:a,showInput:o=!0,disabled:i=!1,label:u,className:l=""}){const[c,f]=d.useState(s),[p,m]=d.useState({r:0,g:0,b:0}),x=e!==void 0,v=x?e:c,y=N=>{const A=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(N);return A?{r:parseInt(A[1],16),g:parseInt(A[2],16),b:parseInt(A[3],16)}:{r:0,g:0,b:0}},j=(N,A,k)=>"#"+[N,A,k].map($=>{const E=$.toString(16);return E.length===1?"0"+E:E}).join("");d.useEffect(()=>{if(v){const N=y(v);m(N)}},[v]);const h=N=>{const A=N.target.value;(/^#[0-9A-F]{6}$/i.test(A)||A==="")&&(x||f(A),n==null||n(A),A&&m(y(A)))},w=(N,A)=>{const k=F(I({},p),{[N]:Math.max(0,Math.min(255,A))});m(k);const $=j(k.r,k.g,k.b);x||f($),n==null||n($)},g=a||["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#808080","#ffa500"],S=r.jsxs("div",{className:`${b.getSpacingClass("base","p")} min-w-[280px]`,children:[r.jsx("div",{className:`
|
|
261
|
-
w-full
|
|
262
|
-
h-32
|
|
263
|
-
${b.getRadiusClass("md")}
|
|
264
|
-
${b.getShadowClass("sm")}
|
|
265
|
-
mb-4
|
|
266
|
-
border
|
|
267
|
-
border-line-default
|
|
268
|
-
`,style:{backgroundColor:v}}),r.jsxs("div",{className:"space-y-3 mb-4",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-medium text-fg-secondary mb-1",children:["Red: ",p.r]}),r.jsx("input",{type:"range",min:"0",max:"255",value:p.r,onChange:N=>w("r",parseInt(N.target.value)),disabled:i,className:"w-full"})]}),r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-medium text-fg-secondary mb-1",children:["Green: ",p.g]}),r.jsx("input",{type:"range",min:"0",max:"255",value:p.g,onChange:N=>w("g",parseInt(N.target.value)),disabled:i,className:"w-full"})]}),r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-medium text-fg-secondary mb-1",children:["Blue: ",p.b]}),r.jsx("input",{type:"range",min:"0",max:"255",value:p.b,onChange:N=>w("b",parseInt(N.target.value)),disabled:i,className:"w-full"})]})]}),o&&r.jsx("div",{className:"mb-4",children:r.jsx(L.Input,{label:"Hex",value:v,onChange:h,disabled:i,placeholder:"#000000",className:"font-mono"})}),g.length>0&&r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-fg-secondary mb-2",children:"Presets"}),r.jsx("div",{className:"grid grid-cols-10 gap-1",children:g.map((N,A)=>r.jsx("button",{type:"button",onClick:()=>{i||(x||f(N),n==null||n(N),m(y(N)))},disabled:i,className:`
|
|
269
|
-
w-6
|
|
270
|
-
h-6
|
|
271
|
-
${b.getRadiusClass("sm")}
|
|
272
|
-
border
|
|
273
|
-
border-line-emphasis
|
|
274
|
-
hover:scale-110
|
|
275
|
-
${b.getShadowClass("sm")}
|
|
276
|
-
${v.toLowerCase()===N.toLowerCase()?"ring-2 ring-offset-1 ring-line-brand":""}
|
|
277
|
-
`,style:{backgroundColor:N},"aria-label":`Select color ${N}`},A))})]})]});return r.jsx("div",{className:l,children:r.jsx($s,{trigger:r.jsxs("div",{className:"flex items-center gap-2",children:[u&&r.jsx("label",{className:"text-sm font-medium text-fg-secondary",children:u}),r.jsx("div",{className:`
|
|
278
|
-
w-10
|
|
279
|
-
h-10
|
|
280
|
-
${b.getRadiusClass("md")}
|
|
281
|
-
border
|
|
282
|
-
border-line-emphasis
|
|
283
|
-
${b.getShadowClass("sm")}
|
|
284
|
-
cursor-pointer
|
|
285
|
-
${i?"opacity-50 cursor-not-allowed":""}
|
|
286
|
-
`,style:{backgroundColor:v}}),o&&r.jsx(L.Input,{value:v,onChange:h,disabled:i,placeholder:"#000000",className:"w-24 font-mono"})]}),placement:"bottom-start",showCloseButton:!0,title:"Pick a Color",children:S})})}const mn=d.createContext(void 0);function Mi({children:e,value:s}){return r.jsx(mn.Provider,{value:s,children:e})}function Di(){const e=d.useContext(mn);if(!e)throw new Error("Drawer components must be used within Drawer");return e}function Es({children:e,className:s="",showCloseButton:t=!1}){const{isOpen:n,closeDrawer:a,position:o,size:i,closeOnOverlayClick:u,closeOnEscape:l}=Di();if(d.useEffect(()=>{if(n&&l){const m=x=>{x.key==="Escape"&&a()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)}},[n,l,a]),d.useEffect(()=>{if(n)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[n]),!n)return null;const c={sm:o==="left"||o==="right"?"w-64":"h-64",md:o==="left"||o==="right"?"w-96":"h-96",lg:o==="left"||o==="right"?"w-[32rem]":"h-[32rem]",xl:o==="left"||o==="right"?"w-[42rem]":"h-[42rem]",full:o==="left"||o==="right"?"w-full":"h-full"},f={left:"left-0 top-0 bottom-0",right:"right-0 top-0 bottom-0",top:"top-0 left-0 right-0",bottom:"bottom-0 left-0 right-0"},p=r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`
|
|
287
|
-
fixed
|
|
288
|
-
inset-0
|
|
289
|
-
bg-scrim
|
|
290
|
-
${b.getZIndexClass("modal")}
|
|
291
|
-
${b.getAnimationClass("base")}
|
|
292
|
-
${n?"opacity-100":"opacity-0"}
|
|
293
|
-
`,onClick:u?a:void 0,"aria-hidden":"true"}),r.jsxs("div",{className:`
|
|
294
|
-
fixed
|
|
295
|
-
${f[o]}
|
|
296
|
-
${c[i]}
|
|
297
|
-
${o==="left"||o==="right"?"max-w-[90vw]":"max-h-[90vh]"}
|
|
298
|
-
bg-surface-overlay
|
|
299
|
-
${b.getShadowClass("xl")}
|
|
300
|
-
${b.getZIndexClass("modal")}
|
|
301
|
-
${b.getAnimationClass("base")}
|
|
302
|
-
flex
|
|
303
|
-
flex-col
|
|
304
|
-
${s}
|
|
305
|
-
`,role:"dialog","aria-modal":"true",onClick:m=>m.stopPropagation(),children:[t&&r.jsx("div",{className:`
|
|
306
|
-
flex
|
|
307
|
-
justify-end
|
|
308
|
-
${b.getSpacingClass("sm","p")}
|
|
309
|
-
border-b
|
|
310
|
-
border-line-default
|
|
311
|
-
`,children:r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:a,className:"h-auto p-1","aria-label":"Close drawer",children:r.jsx(fe,{className:"h-4 w-4"})})}),e]})]});return typeof window!="undefined"?$e.createPortal(p,document.body):null}function pn(n){var a=n,{children:e,className:s=""}=a,t=B(a,["children","className"]);return r.jsx("div",F(I({className:`
|
|
312
|
-
${b.getSpacingClass("lg","p")}
|
|
313
|
-
border-b
|
|
314
|
-
border-line-default
|
|
315
|
-
${s}
|
|
316
|
-
`},t),{children:e}))}function gn(n){var a=n,{children:e,className:s=""}=a,t=B(a,["children","className"]);return r.jsx("div",F(I({className:`
|
|
317
|
-
${b.getSpacingClass("lg","p")}
|
|
318
|
-
border-t
|
|
319
|
-
border-line-default
|
|
320
|
-
flex
|
|
321
|
-
justify-end
|
|
322
|
-
${b.getSpacingClass("sm","gap")}
|
|
323
|
-
${s}
|
|
324
|
-
`},t),{children:e}))}function ct({children:e,open:s,defaultOpen:t=!1,onOpenChange:n,position:a="right",size:o="md",closeOnOverlayClick:i=!0,closeOnEscape:u=!0}){const[l,c]=d.useState(t),f=s!==void 0,p=f?s:l,m=v=>{f||c(v),n==null||n(v)},x=()=>{m(!1)};return r.jsx(Mi,{value:{isOpen:p,closeDrawer:x,position:a,size:o,closeOnOverlayClick:i,closeOnEscape:u},children:e})}ct.Content=Es;ct.Header=pn;ct.Footer=gn;const hn=d.createContext(void 0);function _i({children:e,value:s}){return r.jsx(hn.Provider,{value:s,children:e})}function Rs(){const e=d.useContext(hn);if(!e)throw new Error("Menu components must be used within Menu");return e}const Ts=d.forwardRef(function(i,o){var u=i,{children:s,asChild:t=!1,onClick:n}=u,a=B(u,["children","asChild","onClick"]);const{isOpen:l,setIsOpen:c}=Rs(),f=p=>{n==null||n(p),t||c(!l)};return r.jsx("div",F(I({ref:o,onClick:f,role:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":l},a),{children:s}))});Ts.displayName="MenuTrigger";function xn({children:e,className:s="",align:t="start"}){const{isOpen:n,closeMenu:a,placement:o}=Rs(),i=d.useRef(null),u=d.useRef(null),[l,c]=d.useState({top:0,left:0});if(d.useEffect(()=>{if(n){const p=document.querySelector('[aria-haspopup="menu"]');u.current=p}},[n]),d.useEffect(()=>{if(n&&i.current&&u.current){const p=()=>{const v=u.current.getBoundingClientRect(),y=i.current.getBoundingClientRect(),j=window.scrollY,h=window.scrollX;let w=0,C=0;o==="bottom"?(w=v.bottom+j+4,t==="start"?C=v.left+h:t==="end"?C=v.right+h-y.width:C=v.left+h+(v.width-y.width)/2):o==="top"?(w=v.top+j-y.height-4,t==="start"?C=v.left+h:t==="end"?C=v.right+h-y.width:C=v.left+h+(v.width-y.width)/2):o==="right"?(C=v.right+h+4,t==="start"?w=v.top+j:t==="end"?w=v.bottom+j-y.height:w=v.top+j+(v.height-y.height)/2):o==="left"&&(C=v.left+h-y.width-4,t==="start"?w=v.top+j:t==="end"?w=v.bottom+j-y.height:w=v.top+j+(v.height-y.height)/2);const g=8;w=Math.max(g,Math.min(w,window.innerHeight+j-y.height-g)),C=Math.max(g,Math.min(C,window.innerWidth+h-y.width-g)),c({top:w,left:C})};p();const m=()=>p(),x=()=>p();return window.addEventListener("resize",m),window.addEventListener("scroll",x,!0),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",x,!0)}}},[n,o,t]),d.useEffect(()=>{if(n){const p=m=>{m.key==="Escape"&&a()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)}},[n,a]),d.useEffect(()=>{if(n){const p=m=>{i.current&&u.current&&!i.current.contains(m.target)&&!u.current.contains(m.target)&&a()};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)}},[n,a]),!n)return null;const f=r.jsx("div",{ref:i,role:"menu",className:`
|
|
325
|
-
absolute
|
|
326
|
-
${b.getZIndexClass("popover")}
|
|
327
|
-
bg-surface-overlay
|
|
328
|
-
${b.getRadiusClass("md")}
|
|
329
|
-
${b.getShadowClass("lg")}
|
|
330
|
-
border
|
|
331
|
-
border-line-default
|
|
332
|
-
min-w-40
|
|
333
|
-
${b.getSpacingClass("xs","py")}
|
|
334
|
-
${s}
|
|
335
|
-
`,style:{top:`${l.top}px`,left:`${l.left}px`},children:e});return typeof window!="undefined"?$e.createPortal(f,document.body):null}const As=d.forwardRef(function(p,f){var m=p,{children:s,icon:t,rightIcon:n,disabled:a=!1,onClick:o,onSelect:i,hasSubmenu:u=!1,className:l=""}=m,c=B(m,["children","icon","rightIcon","disabled","onClick","onSelect","hasSubmenu","className"]);const{closeMenu:x}=Rs(),v=j=>{a||(o==null||o(j),i==null||i(j),!u&&!j.defaultPrevented&&x())},y=j=>{a||(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),v(j))};return r.jsxs("div",F(I({ref:f,role:"menuitem",tabIndex:a?-1:0,"aria-disabled":a,onClick:v,onKeyDown:y,className:`
|
|
336
|
-
flex
|
|
337
|
-
items-center
|
|
338
|
-
gap-2
|
|
339
|
-
${b.getSpacingClass("sm","px")}
|
|
340
|
-
${b.getSpacingClass("sm","py")}
|
|
341
|
-
${b.getTypographySize("bodySmall")}
|
|
342
|
-
text-fg-primary
|
|
343
|
-
cursor-pointer
|
|
344
|
-
transition-colors
|
|
345
|
-
hover:bg-surface-hover
|
|
346
|
-
focus:bg-surface-hover
|
|
347
|
-
focus:outline-none
|
|
348
|
-
${a?"opacity-50 cursor-not-allowed":""}
|
|
349
|
-
${l}
|
|
350
|
-
`},c),{children:[t&&r.jsx("span",{className:"shrink-0",children:t}),r.jsx("span",{className:"flex-1",children:s}),u&&r.jsx(Le,{className:"h-4 w-4 text-fg-secondary shrink-0"}),n&&!u&&r.jsx("span",{className:"shrink-0",children:n})]}))});As.displayName="MenuItem";function bn(t){var n=t,{className:e=""}=n,s=B(n,["className"]);return r.jsx("div",I({role:"separator",className:`
|
|
351
|
-
h-px
|
|
352
|
-
bg-line-default
|
|
353
|
-
${b.getSpacingClass("sm","my")}
|
|
354
|
-
${e}
|
|
355
|
-
`},s))}function dt({children:e,open:s,defaultOpen:t=!1,onOpenChange:n,placement:a="bottom"}){const[o,i]=d.useState(t),u=s!==void 0,l=u?s:o,c=p=>{u||i(p),n==null||n(p)},f=()=>{c(!1)};return r.jsx(_i,{value:{isOpen:l,setIsOpen:c,closeMenu:f,placement:a},children:e})}dt.Trigger=Ts;dt.Content=xn;dt.Item=As;dt.Separator=bn;function zi({items:e,type:s="single",defaultOpen:t,onValueChange:n,className:a=""}){const o=()=>t===void 0?[]:Array.isArray(t)?t:[t],[i,u]=d.useState(o),l=c=>{var p;if((p=e.find(m=>m.id===c))!=null&&p.disabled)return;let f;s==="single"?f=i.includes(c)?[]:[c]:f=i.includes(c)?i.filter(m=>m!==c):[...i,c],u(f),n==null||n(s==="single"?f[0]||"":f)};return r.jsx("div",{className:`${b.getSpacingClass("xs","space-y")} ${a}`,children:e.map(c=>{const f=i.includes(c.id),p=c.disabled;return r.jsxs("div",{className:`border border-line-default ${b.getRadiusClass("md")} overflow-hidden`,children:[r.jsxs("button",{type:"button",onClick:()=>l(c.id),disabled:p,className:`
|
|
356
|
-
w-full
|
|
357
|
-
flex
|
|
358
|
-
items-center
|
|
359
|
-
justify-between
|
|
360
|
-
${b.getSpacingClass("base","px")}
|
|
361
|
-
${b.getSpacingClass("md","py")}
|
|
362
|
-
${b.getTypographyClasses("label")}
|
|
363
|
-
text-left
|
|
364
|
-
text-fg-primary
|
|
365
|
-
bg-surface-base
|
|
366
|
-
hover:bg-surface-hover
|
|
367
|
-
focus:outline-none
|
|
368
|
-
focus:ring-2
|
|
369
|
-
focus:ring-offset-2
|
|
370
|
-
focus:ring-line-focus
|
|
371
|
-
${b.getAnimationClass("base")}
|
|
372
|
-
${p?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
373
|
-
`,"aria-expanded":f,"aria-controls":`accordion-content-${c.id}`,"aria-disabled":p,children:[r.jsx("span",{children:c.title}),r.jsx(vs,{className:`
|
|
374
|
-
${b.getSpacingClass("sm","ml")}
|
|
375
|
-
${b.getAnimationClass("base")}
|
|
376
|
-
${f?"transform rotate-180":""}
|
|
377
|
-
${p?"opacity-50":""}
|
|
378
|
-
`,"aria-hidden":"true"})]}),r.jsx("div",{id:`accordion-content-${c.id}`,className:`
|
|
379
|
-
overflow-hidden
|
|
380
|
-
${b.getAnimationClass("base")}
|
|
381
|
-
${f?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"}
|
|
382
|
-
`,"aria-hidden":!f,children:r.jsx("div",{className:`
|
|
383
|
-
${b.getSpacingClass("base","px")}
|
|
384
|
-
${b.getSpacingClass("md","py")}
|
|
385
|
-
text-fg-secondary
|
|
386
|
-
`,children:c.content})})]},c.id)})})}const vn=d.createContext(void 0);function ps({children:e,mobileMenuOpen:s,onMobileMenuChange:t,defaultMobileMenuOpen:n=!1}){const[a,o]=d.useState(n),i=s!==void 0,u=i?s:a,l=d.useCallback(m=>{i||o(m),t==null||t(m)},[i,t]),c=d.useCallback(()=>{l(!u)},[u,l]),f=d.useCallback(()=>{l(!0)},[l]),p=d.useCallback(()=>{l(!1)},[l]);return r.jsx(vn.Provider,{value:{isMobileMenuOpen:u,toggleMobileMenu:c,setMobileMenuOpen:l,openMobileMenu:f,closeMobileMenu:p},children:e})}function Is(){const e=d.useContext(vn);if(!e)throw new Error("useHeaderContext must be used within HeaderProvider");return e}function yn(n){var a=n,{children:e,className:s}=a,t=B(a,["children","className"]);return r.jsx("div",{className:"flex-shrink-0",children:r.jsx(L.NavLink,F(I({href:t.href||"/",variant:"default",className:D("flex items-center font-semibold text-lg",s)},t),{children:e}))})}function wn({children:e,className:s}){return r.jsx("nav",{className:D("flex-1 flex items-center justify-center gap-4","hidden md:flex",s),"aria-label":"Main navigation",children:e})}function jn({children:e,className:s}){return r.jsx("div",{className:D("flex-shrink-0 flex items-center gap-2",s),children:e})}function kn({className:e,icon:s,closeIcon:t,variant:n="ghost",size:a="md"}){const{isMobileMenuOpen:o,toggleMobileMenu:i}=Is(),u=s||r.jsx(Lo,{className:"h-5 w-5"}),l=t||r.jsx(fe,{className:"h-5 w-5"});return r.jsx(L.Button,{variant:n,size:a,onClick:i,className:D("md:hidden",e),"aria-label":o?"Close menu":"Open menu","aria-expanded":o,children:o?l:u})}function Sn({children:e,className:s}){const{isMobileMenuOpen:t,closeMobileMenu:n}=Is();return r.jsx(ct,{open:t,onOpenChange:a=>{a||n()},position:"left",size:"sm",closeOnOverlayClick:!0,closeOnEscape:!0,children:r.jsx(Es,{className:D("p-4",s),children:r.jsx("nav",{className:"flex flex-col gap-2","aria-label":"Mobile navigation",children:e})})})}const Fi={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"},Ie=d.forwardRef((l,u)=>{var c=l,{className:e,maxWidth:s="lg",paddingX:t="base",paddingY:n="base",center:a=!0,children:o}=c,i=B(c,["className","maxWidth","paddingX","paddingY","center","children"]);return r.jsx("div",F(I({ref:u,className:D("w-full",Fi[s],b.getSpacingClass(t,"px"),b.getSpacingClass(n,"py"),a&&"mx-auto",e)},i),{children:o}))});Ie.displayName="Container";const Xe=d.forwardRef((l,u)=>{var c=l,{className:e,spacing:s="base",align:t="stretch",justify:n="start",direction:a="column",children:o}=c,i=B(c,["className","spacing","align","justify","direction","children"]);const f=a==="column"?b.getSpacingClass(s,"gap-y"):b.getSpacingClass(s,"gap-x"),p={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},m={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};return r.jsx("div",F(I({ref:u,className:D("flex",a==="column"?"flex-col":"flex-row",f,p[t],m[n],e)},i),{children:o}))});Xe.displayName="Stack";const Pi=lt(D("w-full","bg-surface-base","transition-shadow","transition-colors"),{variants:{variant:{default:"",elevated:"shadow-sm",bordered:D("border-b","border-line-muted")}},defaultVariants:{variant:"default"}});function et(u){var l=u,{children:e,variant:s="default",sticky:t=!1,maxWidth:n="full",bare:a=!1,className:o}=l,i=B(l,["children","variant","sticky","maxWidth","bare","className"]);const c=r.jsx("div",{className:"flex items-center justify-between gap-4",children:e});return a?r.jsx(ps,{children:r.jsx("div",F(I({className:D(o)},i),{children:c}))}):r.jsx(ps,{children:r.jsx("header",F(I({className:D(Pi({variant:s}),t&&`sticky top-0 ${b.getZIndexClass("sticky")}`,t&&"backdrop-blur-sm bg-surface-base/95",o)},i),{children:r.jsx(Ie,{maxWidth:n,paddingX:"base",paddingY:"sm",children:c})}))})}et.Logo=yn;et.Navigation=wn;et.Actions=jn;et.Hamburger=kn;et.MobileMenu=Sn;const Er=lt(D("flex","items-center","gap-2"),{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col"},variant:{default:"",pills:"",tabs:""}},defaultVariants:{orientation:"horizontal",variant:"default"},compoundVariants:[{orientation:"vertical",variant:"default",class:"items-stretch"},{orientation:"vertical",variant:"pills",class:"items-stretch"},{orientation:"vertical",variant:"tabs",class:"items-stretch"}]});function Li(l){var c=l,{items:e,orientation:s="horizontal",variant:t="default",className:n,"aria-label":a="Main navigation",bare:o=!1,pathname:i}=c,u=B(c,["items","orientation","variant","className","aria-label","bare","pathname"]);let f=i;if(!f)try{const x=typeof require!="undefined"?require("next/navigation"):null;if(x!=null&&x.usePathname){const v=x.usePathname;f=v()}}catch(x){f=void 0}const p=d.useMemo(()=>e.map(x=>{if(x.active!==void 0)return x;if(f){const v=f===x.href||x.href!=="/"&&f.startsWith(`${x.href}/`);return F(I({},x),{active:v})}return F(I({},x),{active:!1})}),[e,f]),m=r.jsx(r.Fragment,{children:p.map((x,v)=>{const y=t==="pills"?"background":t==="tabs"?"underline":"default";return r.jsxs(L.NavLink,{href:x.href,active:x.active,disabled:x.disabled,variant:y,className:D("flex items-center gap-2",s==="vertical"&&"w-full justify-start",x.className),children:[x.icon&&r.jsx("span",{className:"flex-shrink-0","aria-hidden":"true",children:x.icon}),r.jsx("span",{children:x.label}),x.badge&&r.jsx("span",{className:"ml-auto",children:x.badge})]},x.href||v)})});return o?r.jsx("div",F(I({className:D(Er({orientation:s,variant:t}),n)},u),{children:m})):r.jsx("nav",F(I({className:D(Er({orientation:s,variant:t}),n),"aria-label":a},u),{children:m}))}function Oi(e){return r.jsx(Li,F(I({},e),{pathname:e.pathname}))}const Wi=lt(D("w-full","flex","flex-col","gap-2"),{variants:{variant:{default:D(b.getSpacingClass("base","mb")),compact:D(b.getSpacingClass("sm","mb"))}},defaultVariants:{variant:"default"}});function Vi(u){var l=u,{title:e,description:s,breadcrumb:t,actions:n,variant:a="default",className:o}=l,i=B(l,["title","description","breadcrumb","actions","variant","className"]);return r.jsxs("div",F(I({className:D(Wi({variant:a}),o)},i),{children:[t&&t.length>0&&r.jsx(Qr,{items:t}),r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx(L.Text,{variant:"heading",as:"h1",className:"mb-2 text-2xl font-bold",children:e}),s&&r.jsx(L.Text,{variant:"body",className:"text-fg-secondary",children:s})]}),n&&r.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:n})]})]}))}function Bi(n){var a=n,{onForgotPasswordClick:e,className:s}=a,t=B(a,["onForgotPasswordClick","className"]);return r.jsx("div",{className:D(b.getSpacingClass("base","p"),"bg-surface-muted",b.getRadiusClass("md"),s),children:r.jsxs("form",F(I({},t),{onSubmit:o=>{o.preventDefault(),t.onSubmit&&t.onSubmit(o)},className:D("space-y-4",t.className),children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(L.Label,{htmlFor:"login-email",variant:"required",children:"Your email"}),r.jsx(L.Input,{id:"login-email",placeholder:"myname@email.com",type:"email"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(L.Label,{htmlFor:"login-password",variant:"required",children:"Your password"}),r.jsx(L.Input,{id:"login-password",placeholder:"••••••••",type:"password"})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx(L.Button,{variant:"secondary",type:"button",onClick:e,children:"Forgot password?"}),r.jsx(L.Button,{variant:"regular",type:"submit",children:"Sign in"})]})]}))})}function Hi(c){var f=c,{isOpen:e,onClose:s,title:t,children:n,variant:a="default",showCloseButton:o=!0,footer:i,className:u=""}=f,l=B(f,["isOpen","onClose","title","children","variant","showCloseButton","footer","className"]);const p=d.useRef(null),m=d.useRef(null);if(d.useEffect(()=>{if(!e)return;m.current=document.activeElement;const w=setTimeout(()=>{var g;(g=p.current)==null||g.focus()},0),C=g=>{g.key==="Escape"&&s()};return document.addEventListener("keydown",C),()=>{var g;clearTimeout(w),document.removeEventListener("keydown",C),(g=m.current)==null||g.focus()}},[e,s]),d.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!e)return null;const x=["fixed","inset-0",b.getZIndexClass("modal"),"overflow-y-auto"],v=["fixed","inset-0","bg-scrim","transition-opacity"],j=["relative","bg-surface-overlay","rounded-lg","shadow-xl","my-8","mx-auto",{default:"max-w-md",large:"max-w-2xl",fullscreen:"max-w-full h-full"}[a],"p-6",u].filter(Boolean).join(" "),h=r.jsxs("div",{className:x.join(" "),role:"dialog","aria-modal":"true","aria-labelledby":t?"modal-title":void 0,onClick:w=>{w.target===w.currentTarget&&s()},children:[r.jsx("div",{className:v.join(" "),"aria-hidden":"true"}),r.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:r.jsxs("div",F(I({ref:p,tabIndex:-1,className:j,onClick:w=>w.stopPropagation()},l),{children:[t&&r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsx("h2",{id:"modal-title",className:"text-xl font-semibold text-fg-primary",children:t}),o&&r.jsx("button",{onClick:s,className:"text-fg-tertiary hover:text-fg-secondary focus:outline-none","aria-label":"Close modal",children:r.jsx(fe,{className:"h-6 w-6"})})]}),!t&&o&&r.jsx("div",{className:"flex justify-end mb-4",children:r.jsx("button",{onClick:s,className:"text-fg-tertiary hover:text-fg-secondary focus:outline-none","aria-label":"Close modal",children:r.jsx(fe,{className:"h-6 w-6"})})}),r.jsx("div",{className:"mb-4",children:n}),i&&r.jsx("div",{className:"flex justify-end gap-2 mt-4",children:i})]}))})]});return typeof window!="undefined"?$e.createPortal(h,document.body):h}const Ot=d.createContext(void 0);function we(){const e=d.useContext(Ot);if(e===void 0)throw new Error("useTableContext must be used within a Table component");return e}function qi(){const e=d.useContext(Ot);return e||void 0}function gs({columns:e,data:s,loading:t=!1,paginationMode:n,page:a,pageSize:o,total:i,onPageChange:u,onPageSizeChange:l,defaultPageSize:c=10,pageSizeOptions:f,sortColumn:p,sortDirection:m,onSort:x,defaultSortColumn:v,defaultSortDirection:y="asc",filters:j,filterValues:h,onFilter:w,initialFilterValues:C={},selectable:g=!1,selectedRows:S,onSelectionChange:N,rowId:A,actions:k,emptyMessage:$="No data available",emptyStateTitle:E,emptyStateMessage:R,emptyStateIllustration:M,emptyStateAction:z,onRowClick:_,resizable:P=!1,columnWidths:U,onColumnResize:G,virtualScrolling:O,virtualScrollingOptions:ne,children:te}){const T=d.useMemo(()=>n||(i!==void 0&&u?"server":"client"),[n,i,u]),V=a!==void 0,[X,J]=d.useState(1),[K,Y]=d.useState(c),W=V?a:X,se=o!=null?o:K,oe=d.useMemo(()=>T==="server"?i!=null?i:0:s.length,[T,i,s.length]),le=d.useMemo(()=>Math.ceil(oe/se),[oe,se]),ue=p!==void 0,[je,tt]=d.useState(v||""),[he,st]=d.useState(y),pe=ue?p:je,ft=ue?m||"asc":he,Ut=h!==void 0,[Xn,Zn]=d.useState(C),mt=Ut?h:Xn,Xt=S!==void 0,[Jn,Qn]=d.useState([]),xe=Xt?S:Jn,pt=d.useMemo(()=>!j||j.length===0?s:s.filter(Z=>j.every(re=>{const ie=mt[re.key];if(!ie||ie==="")return!0;const ht=Z[re.key];return re.type==="text"?String(ht||"").toLowerCase().includes(String(ie).toLowerCase()):String(ht)===String(ie)})),[s,j,mt]),Zt=d.useMemo(()=>{if(ue&&x||!pe)return pt;const Z=[...pt];return Z.sort((re,ie)=>{const ht=re[pe],ra=ie[pe],cr=String(ht||"").localeCompare(String(ra||""));return ft==="asc"?cr:-cr}),Z},[pt,pe,ft,x,ue]),ke=d.useMemo(()=>{if(T==="server")return Zt;const Z=(W-1)*se,re=Z+se;return Zt.slice(Z,re)},[Zt,T,W,se]),Ve=d.useCallback((Z,re)=>{var ie;return A?A(Z):((ie=Z==null?void 0:Z.id)==null?void 0:ie.toString())||re.toString()},[A]),gt=d.useMemo(()=>!g||ke.length===0?!1:ke.every((Z,re)=>{const ie=Ve(Z,re);return xe.includes(ie)}),[g,ke,xe,Ve]),tr=d.useMemo(()=>{if(!g)return!1;const Z=xe.length;return Z>0&&Z<ke.length},[g,xe.length,ke.length]),Be=d.useCallback(Z=>{V?u==null||u(Z):J(Z)},[V,u]),sr=d.useCallback(Z=>{l?l(Z):Y(Z),Be(1)},[l,Be]),rr=d.useCallback((Z,re)=>{ue?x==null||x(Z,re):(tt(Z),st(re))},[ue,x]),nr=d.useCallback(Z=>{Ut?w==null||w(Z):Zn(Z),Be(1)},[Ut,w,Be]),ze=d.useCallback(Z=>{Xt?N==null||N(Z):Qn(Z)},[Xt,N]),ar=d.useCallback(Z=>{const re=xe.includes(Z)?xe.filter(ie=>ie!==Z):[...xe,Z];ze(re)},[xe,ze]),or=d.useCallback(()=>{if(gt)ze([]);else{const Z=ke.map((re,ie)=>Ve(re,ie));ze(Z)}},[gt,ke,Ve,ze]),[ea,ta]=d.useState({}),Jt=U!==void 0,ir=Jt?U:ea,lr=d.useCallback((Z,re)=>{Jt?G==null||G(Z,re):ta(ie=>F(I({},ie),{[Z]:re}))},[Jt,G]),sa=d.useMemo(()=>({columns:e,data:s,paginatedData:ke,loading:t,paginationState:{page:W,pageSize:se,total:oe,totalPages:le},sortState:{column:pe,direction:ft},filterState:{values:mt,config:j||[]},selectionState:{selectedRows:xe,isAllSelected:gt,isIndeterminate:tr},paginationMode:T,selectable:g,rowId:A,actions:k,resizable:P,columnWidths:ir,virtualScrolling:O,emptyMessage:$,emptyStateTitle:E,emptyStateMessage:R,emptyStateIllustration:M,emptyStateAction:z,setPage:Be,setPageSize:sr,setSorting:rr,setFilters:nr,setSelection:ze,toggleRowSelection:ar,toggleSelectAll:or,getRowId:Ve,setColumnWidth:lr,onPageChange:u,onPageSizeChange:l,onSort:x,onFilter:w,onSelectionChange:N,onRowClick:_,onColumnResize:G}),[e,s,ke,t,W,se,oe,le,pe,ft,mt,j,xe,gt,tr,T,g,A,k,$,E,R,M,z,Be,sr,rr,nr,ze,ar,or,Ve,lr,u,l,x,w,N,_,G,P,ir,O]);return r.jsx(Ot.Provider,{value:sa,children:te})}function Ms(l){var c=l,{column:e,resizable:s=!1,width:t,onResize:n,minWidth:a=50,maxWidth:o,className:i=""}=c,u=B(c,["column","resizable","width","onResize","minWidth","maxWidth","className"]);const{sortState:f,setSorting:p,onSort:m}=we(),x=d.useRef(null),v=d.useRef(null),y=d.useRef(null),j=()=>{if(!e.sortable||!m&&!p)return;const N=f.column===e.key&&f.direction==="asc"?"desc":"asc";m?m(e.key,N):p(e.key,N)},h=N=>{g&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),j())},w=N=>{if(N.preventDefault(),N.stopPropagation(),!v.current||!n)return;const A=t||v.current.offsetWidth;y.current={x:N.clientX,width:A};const k=E=>{if(!y.current)return;const R=E.clientX-y.current.x,M=y.current.width+R,z=Math.max(a,o?Math.min(M,o):M);n(e.key,z)},$=()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",$),y.current=null};document.addEventListener("mousemove",k),document.addEventListener("mouseup",$)},C=f.column===e.key,g=e.sortable&&(m||p),S=C?f.direction:void 0;return r.jsx("th",F(I({ref:v,scope:"col",role:"columnheader","aria-sort":C?S==="asc"?"ascending":"descending":g?"none":void 0,className:`px-6 py-3 text-left text-xs font-medium text-fg-tertiary uppercase tracking-wider ${g?"cursor-pointer hover:bg-surface-active focus:bg-surface-active focus:outline-none focus:ring-2 focus:ring-line-focus focus:ring-offset-2 select-none":""} ${e.hiddenOnMobile?"hidden md:table-cell":""} ${i}`,onClick:g?j:void 0,onKeyDown:g?h:void 0,tabIndex:g?0:void 0,style:t?{width:`${t}px`,minWidth:`${t}px`}:void 0},u),{children:r.jsxs("div",{className:"flex items-center gap-2 relative",children:[r.jsx("span",{children:e.label}),C&&r.jsx("span",{className:"text-fg-tertiary","aria-hidden":"true",children:f.direction==="asc"?"↑":"↓"}),s&&n&&r.jsx("div",{ref:x,className:"absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-surface-brand transition-colors",onMouseDown:w,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${e.label} column`,style:{touchAction:"none"}})]})}))}function Ds(t){var n=t,{className:e=""}=n,s=B(n,["className"]);const{columns:a,selectable:o,selectionState:i,toggleSelectAll:u,actions:l,resizable:c,columnWidths:f,setColumnWidth:p}=we();return r.jsxs("tr",F(I({role:"row",className:e},s),{children:[o&&r.jsx("th",{scope:"col",role:"columnheader",className:"px-6 py-3 w-12","aria-label":"Select all",children:r.jsx(L.Checkbox,{checked:i.isAllSelected,onChange:u,"aria-label":"Select all rows",className:"my-0",indeterminate:i.isIndeterminate})}),a.map(m=>r.jsx(Ms,{column:m,resizable:c,width:f==null?void 0:f[m.key],onResize:p},m.key)),l&&r.jsx("th",{scope:"col",role:"columnheader",className:"px-6 py-3 text-right text-xs font-medium text-fg-tertiary uppercase tracking-wider w-12","aria-label":"Actions",children:r.jsx("span",{className:"sr-only",children:"Actions"})})]}))}function _s(t){var n=t,{className:e=""}=n,s=B(n,["className"]);return we(),r.jsx("thead",F(I({className:`bg-surface-subtle sticky top-0 ${b.getZIndexClass("sticky")} ${e}`},s),{children:r.jsx(Ds,{})}))}function zs(a){var o=a,{column:e,row:s,className:t=""}=o,n=B(o,["column","row","className"]);const i=e.key in s?s[e.key]:void 0;return r.jsx("td",F(I({className:`px-6 py-4 whitespace-nowrap text-sm text-fg-primary ${e.hiddenOnMobile?"hidden md:table-cell":""} ${t}`},n),{children:e.render?e.render(i,s):String(i!=null?i:"")}))}function Gi(o){var i=o,{actions:e,row:s,align:t="right",className:n=""}=i,a=B(i,["actions","row","align","className"]);const u=e.map(l=>({label:l.label,onClick:()=>l.onClick(s),variant:l.variant,disabled:l.disabled}));return r.jsx("div",F(I({className:`inline-flex ${n}`},a),{children:r.jsx(sn,{trigger:r.jsx(L.Button,{variant:"ghost",size:"sm","aria-label":"Row actions",className:"h-8 w-8 p-0",children:r.jsx(So,{className:"h-4 w-4"})}),items:u,align:t})}))}function Fs(a){var o=a,{row:e,align:s="right",className:t=""}=o,n=B(o,["row","align","className"]);const{actions:i}=we();if(!i)return null;const u=i(e);return u.length===0?null:r.jsx(Gi,I({row:e,actions:u,align:s,className:t},n))}function Rt(i){var u=i,{row:e,rowIndex:s,className:t="",onClick:n,style:a}=u,o=B(u,["row","rowIndex","className","onClick","style"]);const{columns:l,selectable:c,selectionState:f,toggleRowSelection:p,getRowId:m,actions:x,onRowClick:v}=we(),y=m(e,s),j=f.selectedRows.includes(y),h=w=>{n&&n(w),v&&v(e)};return r.jsxs("tr",F(I({role:"row","aria-selected":c?j:void 0,"aria-rowindex":s+1,className:`hover:bg-surface-hover ${j?"bg-surface-selected":""} ${t}`,onClick:h,style:a},o),{children:[c&&r.jsx("td",{className:"px-6 py-4",children:r.jsx(L.Checkbox,{checked:j,onChange:()=>p(y),"aria-label":`Select row ${y}`,className:"my-0"})}),l.map(w=>r.jsx(zs,{column:w,row:e},String(w.key))),x&&r.jsx("td",{className:"px-6 py-4 text-right",children:r.jsx(Fs,{row:e})})]}))}function Ps(t){var n=t,{className:e=""}=n,s=B(n,["className"]);const{emptyMessage:a,emptyStateTitle:o,emptyStateMessage:i,emptyStateIllustration:u,emptyStateAction:l}=we();return o||i||u?r.jsxs("div",F(I({className:e},s),{children:[r.jsx(tn,{title:o||"No data available",message:i||a||"No data available",variant:u?"withIllustration":"default",illustration:u}),l&&r.jsx("div",{className:"mt-4 flex justify-center",children:l})]})):r.jsx("div",F(I({className:`text-center text-fg-secondary ${e}`},s),{children:a||"No data available"}))}function Nn(e,s){const{itemHeight:t,containerHeight:n,overscan:a=5,enabled:o=!0}=s,[i,u]=d.useState(0),l=d.useRef(null),c=d.useMemo(()=>{if(!o||e.length===0)return e.map((y,j)=>({index:j,start:j*t,end:(j+1)*t,size:t}));const m=Math.max(0,Math.floor(i/t)-a),x=n?Math.min(e.length,Math.ceil((i+n)/t)+a):e.length,v=[];for(let y=m;y<x;y++)v.push({index:y,start:y*t,end:(y+1)*t,size:t});return v},[e,t,i,n,a,o]),f=e.length*t;return d.useEffect(()=>{if(!o||!l.current)return;const m=l.current,x=()=>{u(m.scrollTop)};return m.addEventListener("scroll",x,{passive:!0}),()=>m.removeEventListener("scroll",x)},[o]),{virtualItems:c,totalHeight:f,scrollOffset:i,setScrollOffset:u,scrollToIndex:m=>{if(!l.current)return;const x=m*t;l.current.scrollTop=x,u(x)},containerRef:l}}function Ls(n){var a=n,{children:e,className:s=""}=a,t=B(a,["children","className"]);var y,j;const{paginatedData:o,loading:i,columns:u,selectable:l,actions:c,virtualScrolling:f,virtualScrollingOptions:p}=we(),m=u.length+(l?1:0)+(c?1:0),x=Nn(o,{itemHeight:(p==null?void 0:p.itemHeight)||50,containerHeight:p==null?void 0:p.containerHeight,overscan:(p==null?void 0:p.overscan)||5,enabled:f||!1}),v=d.useMemo(()=>f&&x.virtualItems.length>0?x.virtualItems.map(h=>({row:o[h.index],index:h.index})).filter(h=>h.row!==void 0):o.map((h,w)=>({row:h,index:w})),[f,x.virtualItems,o]);return i?r.jsx("tbody",F(I({className:`bg-surface-base divide-y divide-line-default ${s}`},t),{children:Array.from({length:5}).map((h,w)=>r.jsx("tr",{children:Array.from({length:m}).map((C,g)=>r.jsx("td",{className:"px-6 py-4",children:r.jsx(L.Skeleton,{className:"h-4 w-full"})},g))},w))})):o.length===0?r.jsx("tbody",F(I({className:`bg-surface-base divide-y divide-line-default ${s}`},t),{children:r.jsx("tr",{children:r.jsx("td",{colSpan:m,className:"px-6 py-12",children:r.jsx(Ps,{})})})})):typeof e=="function"?r.jsx("tbody",F(I({className:`bg-surface-base divide-y divide-line-default ${s}`},t),{children:o.map((h,w)=>e(h,w))})):r.jsx("tbody",F(I({className:`bg-surface-base divide-y divide-line-default ${s}`,role:"rowgroup"},t),{children:f&&x.virtualItems.length>0&&v.length>0?r.jsxs(r.Fragment,{children:[((y=x.virtualItems[0])==null?void 0:y.start)>0&&r.jsx("tr",{style:{height:x.virtualItems[0].start},"aria-hidden":"true",children:r.jsx("td",{colSpan:m})}),v.map(({row:h,index:w})=>r.jsx(Rt,{row:h,rowIndex:w},w)),x.virtualItems.length>0&&r.jsx("tr",{style:{height:Math.max(0,x.totalHeight-(((j=x.virtualItems[x.virtualItems.length-1])==null?void 0:j.end)||0))},"aria-hidden":"true",children:r.jsx("td",{colSpan:m})})]}):v.map(({row:h,index:w})=>r.jsx(Rt,{row:h,rowIndex:w},w))}))}function Ki(i){var u=i,{filters:e,onFilter:s,initialValues:t={},showClearAll:n=!0,className:a=""}=u,o=B(u,["filters","onFilter","initialValues","showClearAll","className"]);const[l,c]=d.useState(t),[f,p]=d.useState(!1),m=Object.values(l).some(h=>h!==""&&h!==null&&h!==void 0),x=(h,w)=>{const C=F(I({},l),{[h]:w});c(C),s(C)},v=()=>{const h={};e.forEach(w=>{h[w.key]=""}),c(h),s(h)},y=h=>{const w=F(I({},l),{[h]:""});c(w),s(w)},j=Object.values(l).filter(h=>h!==""&&h!==null&&h!==void 0).length;return r.jsx("div",F(I({className:`bg-surface-base border-b border-line-default ${a}`},o),{children:r.jsxs("div",{className:"px-4 py-3 sm:px-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("button",{type:"button",onClick:()=>p(!f),className:"flex items-center gap-2 text-sm font-medium text-fg-secondary hover:text-fg-primary",children:[r.jsx(Io,{className:"h-4 w-4"}),r.jsx("span",{children:"Filters"}),j>0&&r.jsx("span",{className:`inline-flex items-center ${b.getSpacingClass("sm","px")} ${b.getSpacingClass("0.5","py")} rounded text-xs font-medium bg-surface-brand-muted text-fg-brand-emphasis`,children:j})]}),m&&n&&r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:v,className:"text-sm",children:"Clear all"})]}),f&&r.jsx("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(h=>{const w=l[h.key]||"";return r.jsxs("div",{className:"space-y-1",children:[r.jsx(L.Label,{htmlFor:`filter-${h.key}`,variant:"optional",children:h.label}),r.jsxs("div",{className:"relative",children:[h.type==="text"&&r.jsx(L.Input,{id:`filter-${h.key}`,type:"text",value:w,onChange:C=>x(h.key,C.target.value),placeholder:h.placeholder||`Filter by ${h.label.toLowerCase()}`,size:"sm",variant:"outlined"}),h.type==="select"&&r.jsxs("div",{className:"relative",children:[r.jsx(L.Select,{id:`filter-${h.key}`,options:[{value:"",label:`All ${h.label}`},...h.options||[]],value:w,onChange:C=>x(h.key,C.target.value)}),w&&r.jsx("button",{type:"button",onClick:()=>y(h.key),className:"absolute right-8 top-1/2 -translate-y-1/2 text-fg-tertiary hover:text-fg-secondary","aria-label":`Clear ${h.label} filter`,children:r.jsx(fe,{className:"h-4 w-4"})})]}),h.type==="date"&&r.jsx(L.Input,{id:`filter-${h.key}`,type:"date",value:w,onChange:C=>x(h.key,C.target.value),size:"sm",variant:"outlined"}),w&&h.type!=="select"&&r.jsx("button",{type:"button",onClick:()=>y(h.key),className:"absolute right-2 top-1/2 -translate-y-1/2 text-fg-tertiary hover:text-fg-secondary","aria-label":`Clear ${h.label} filter`,children:r.jsx(fe,{className:"h-4 w-4"})})]})]},h.key)})})]})}))}function Os(n){var a=n,{showClearAll:e=!0,className:s=""}=a,t=B(a,["showClearAll","className"]);const{filterState:o,setFilters:i}=we();return o.config.length===0?null:r.jsx(Ki,I({filters:o.config,onFilter:i,initialValues:o.values,showClearAll:e,className:s},t))}function Yi(f){var p=f,{page:e,pageSize:s,total:t,onPageChange:n,onPageSizeChange:a,pageSizeOptions:o=[10,25,50,100],showPageSizeSelector:i=!0,showPageInfo:u=!0,className:l=""}=p,c=B(p,["page","pageSize","total","onPageChange","onPageSizeChange","pageSizeOptions","showPageSizeSelector","showPageInfo","className"]);const m=Math.ceil(t/s),x=t===0?0:(e-1)*s+1,v=Math.min(e*s,t),y=()=>{e>1&&n(e-1)},j=()=>{e<m&&n(e+1)},h=()=>{e>1&&n(1)},w=()=>{e<m&&n(m)};return r.jsxs("div",F(I({className:`flex items-center justify-between px-4 py-3 bg-surface-base border-t border-line-default sm:px-6 ${l}`},c),{children:[r.jsxs("div",{className:"flex flex-1 justify-between sm:hidden",children:[r.jsx(L.Button,{variant:"outline",size:"sm",onClick:y,disabled:e===1,children:"Previous"}),r.jsx(L.Button,{variant:"outline",size:"sm",onClick:j,disabled:e>=m,children:"Next"})]}),r.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[u&&r.jsx("div",{children:r.jsxs(L.Text,{as:"p",className:"text-sm text-fg-secondary",children:["Showing ",r.jsx("span",{className:"font-medium",children:x})," to"," ",r.jsx("span",{className:"font-medium",children:v})," of"," ",r.jsx("span",{className:"font-medium",children:t})," results"]})}),r.jsxs("div",{className:"flex items-center gap-4",children:[i&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(L.Text,{as:"span",className:"text-sm text-fg-secondary",children:"Show:"}),r.jsx(L.Select,{options:o.map(C=>({value:C.toString(),label:C.toString()})),value:s.toString(),onChange:C=>{const g=parseInt(C.target.value);a(g),n(1)},className:"w-20"})]}),r.jsxs("nav",{className:"flex items-center gap-1","aria-label":"Pagination",children:[r.jsxs(L.Button,{variant:"ghost",size:"sm",onClick:h,disabled:e===1,"aria-label":"First page",children:[r.jsx(it,{className:"h-4 w-4"}),r.jsx(it,{className:"h-4 w-4 -ml-2"})]}),r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:y,disabled:e===1,"aria-label":"Previous page",children:r.jsx(it,{className:"h-4 w-4"})}),r.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,m)},(C,g)=>{let S;return m<=5||e<=3?S=g+1:e>=m-2?S=m-4+g:S=e-2+g,r.jsx(L.Button,{variant:e===S?"primary":"ghost",size:"sm",onClick:()=>n(S),className:"min-w-10","aria-label":`Page ${S}`,"aria-current":e===S?"page":void 0,children:S},S)})}),r.jsx(L.Button,{variant:"ghost",size:"sm",onClick:j,disabled:e>=m,"aria-label":"Next page",children:r.jsx(Le,{className:"h-4 w-4"})}),r.jsxs(L.Button,{variant:"ghost",size:"sm",onClick:w,disabled:e>=m,"aria-label":"Last page",children:[r.jsx(Le,{className:"h-4 w-4"}),r.jsx(Le,{className:"h-4 w-4 -ml-2"})]})]})]})]})]}))}function Ws(o){var i=o,{showPageSizeSelector:e=!0,showPageInfo:s=!0,pageSizeOptions:t,className:n=""}=i,a=B(i,["showPageSizeSelector","showPageInfo","pageSizeOptions","className"]);const{paginationState:u,setPage:l,setPageSize:c,paginationMode:f}=we();return f==="client"&&u.totalPages<=1?null:r.jsx(Yi,I({page:u.page,pageSize:u.pageSize,total:u.total,onPageChange:l,onPageSizeChange:c,pageSizeOptions:t,showPageSizeSelector:e,showPageInfo:s,className:n},a))}function de(e){const o=e,{className:s=""}=o,t=B(o,["className"]),n="children"in e&&e.children!==void 0,a=n?t:Ui(t);return n?r.jsx("div",{className:`bg-surface-base shadow rounded-lg overflow-hidden ${s}`,children:r.jsx(gs,F(I({},a),{children:e.children}))}):r.jsx("div",{className:`bg-surface-base shadow rounded-lg overflow-hidden ${s}`,children:r.jsxs(gs,F(I({},a),{children:[a.filters&&a.filters.length>0&&r.jsx(Os,{}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"min-w-full divide-y divide-line-default",role:"table","aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],"aria-rowcount":a.total||a.data.length,"aria-colcount":a.columns.length+(a.selectable?1:0)+(a.actions?1:0),children:[r.jsx(_s,{}),r.jsx(Ls,{})]})}),r.jsx(Ws,{})]}))})}function Ui(e){const{columns:s,data:t,loading:n,onSort:a,sortColumn:o,sortDirection:i,emptyMessage:u,emptyStateTitle:l,emptyStateMessage:c,emptyStateIllustration:f,emptyStateAction:p,pagination:m,filters:x,selectable:v,selectedRows:y,onSelectionChange:j,rowId:h,actions:w,onRowClick:C,paginationMode:g,defaultPageSize:S,resizable:N,columnWidths:A,onColumnResize:k,virtualScrolling:$,virtualScrollingOptions:E}=e;let R=g||"auto";return R==="auto"&&(R=m&&m.total!==void 0&&m.onPageChange?"server":"client"),{columns:s,data:t,loading:n,paginationMode:R,page:m==null?void 0:m.page,pageSize:m==null?void 0:m.pageSize,total:m==null?void 0:m.total,onPageChange:m==null?void 0:m.onPageChange,onPageSizeChange:m==null?void 0:m.onPageSizeChange,defaultPageSize:S||(m==null?void 0:m.pageSize)||10,pageSizeOptions:m==null?void 0:m.pageSizeOptions,sortColumn:o,sortDirection:i,onSort:a,filters:x==null?void 0:x.config,filterValues:x==null?void 0:x.initialValues,onFilter:x==null?void 0:x.onFilter,initialFilterValues:x==null?void 0:x.initialValues,selectable:v,selectedRows:y,onSelectionChange:j,rowId:h,actions:w,onRowClick:C,emptyMessage:u,emptyStateTitle:l,emptyStateMessage:c,emptyStateIllustration:f,emptyStateAction:p,resizable:N,columnWidths:A,onColumnResize:k,virtualScrolling:$,virtualScrollingOptions:E,children:r.jsx(r.Fragment,{})}}de.Header=_s;de.HeaderRow=Ds;de.HeaderCell=Ms;de.Body=Ls;de.Row=Rt;de.Cell=zs;de.Filters=Os;de.Pagination=Ws;de.EmptyState=Ps;de.Actions=Fs;function Xi(e={}){const{defaultWidths:s={},minWidth:t=50,maxWidth:n,resizable:a=!0}=e,[o,i]=d.useState(s),[u,l]=d.useState(!1),[c,f]=d.useState(null),p=d.useRef(null),m=d.useCallback((C,g)=>{const S=Math.max(t,n?Math.min(g,n):g);i(N=>F(I({},N),{[C]:S}))},[t,n]),x=d.useCallback(()=>{i(s)},[s]),v=d.useCallback((C,g,S)=>{a&&(l(!0),f(C),p.current={startX:g,startWidth:S})},[a]),y=d.useCallback(C=>{if(!u||!c||!p.current)return;const g=C-p.current.startX,S=p.current.startWidth+g;m(c,S)},[u,c,m]),j=d.useCallback(()=>{l(!1),f(null),p.current=null},[]),h=d.useRef(void 0),w=d.useRef(void 0);return typeof window!="undefined"&&(h.current=C=>{u&&y(C.clientX)},w.current=()=>{u&&j()},u?(document.addEventListener("mousemove",h.current),document.addEventListener("mouseup",w.current)):(h.current&&document.removeEventListener("mousemove",h.current),w.current&&document.removeEventListener("mouseup",w.current))),{columnWidths:o,setColumnWidth:m,resetColumnWidths:x,isResizing:u,resizingColumn:c,startResize:v,handleResize:y,endResize:j}}const Wt=d.createContext(null);function Zi(){return d.useContext(Wt)}function Me(){const e=d.useContext(Wt);if(!e)throw new Error("useSideNavbarThemeRequired must be used within SideNavbarThemeProvider");return e}const Ue={variant:"default",navigationWidth:"56px",contentWidth:"320px",animationDuration:300,animationEasing:"ease-in-out"};function Vs({children:e,variant:s=Ue.variant,navigationWidth:t=Ue.navigationWidth,contentWidth:n=Ue.contentWidth,animationDuration:a=Ue.animationDuration,animationEasing:o=Ue.animationEasing}){const i=d.useMemo(()=>({variant:s,navigationWidth:t,contentWidth:n,animationDuration:a,animationEasing:o}),[s,t,n,a,o]);return r.jsx(Wt.Provider,{value:i,children:e})}const Vt=d.createContext(null);function Ji(){return d.useContext(Vt)}function Oe(){const e=d.useContext(Vt);if(!e)throw new Error("useSideNavbarConfigRequired must be used within SideNavbarConfigProvider");return e}const ce={mode:"full",resizable:!1,minWidth:void 0,maxWidth:void 0,snapPoints:void 0,responsive:!1,mobileBreakpoint:768,mobileVariant:"collapse",overlayBackdrop:!0,persistState:!0,persistWidth:!1,storageKey:void 0,keyboardShortcut:"Ctrl+B",enableKeyboardShortcut:!0};function Bs({children:e,mode:s=ce.mode,resizable:t=ce.resizable,minWidth:n=ce.minWidth,maxWidth:a=ce.maxWidth,snapPoints:o=ce.snapPoints,responsive:i=ce.responsive,mobileBreakpoint:u=ce.mobileBreakpoint,mobileVariant:l=ce.mobileVariant,overlayBackdrop:c=ce.overlayBackdrop,persistState:f=ce.persistState,persistWidth:p=ce.persistWidth,storageKey:m=ce.storageKey,keyboardShortcut:x=ce.keyboardShortcut,enableKeyboardShortcut:v=ce.enableKeyboardShortcut}){const y=d.useMemo(()=>({mode:s,resizable:t,minWidth:n,maxWidth:a,snapPoints:o,responsive:i,mobileBreakpoint:u,mobileVariant:l,overlayBackdrop:c,persistState:f,persistWidth:p,storageKey:m,keyboardShortcut:x,enableKeyboardShortcut:v}),[s,t,n,a,o,i,u,l,c,f,p,m,x,v]);return r.jsx(Vt.Provider,{value:y,children:e})}const Bt=d.createContext(null);function Qi(){return d.useContext(Bt)}function De(){const e=d.useContext(Bt);if(!e)throw new Error("useSideNavbarStateRequired must be used within SideNavbarStateProvider");return e}function Tt(e){if(typeof e=="number")return e;const s=parseFloat(e);return isNaN(s)?0:e.endsWith("rem")||e.endsWith("em")?s*16:(e.endsWith("px"),s)}function Cn(e,s){return e===void 0||s===void 0?!0:e<s}function kt(e,s,t){let n=e;return s!==void 0&&(n=Math.max(n,s)),t!==void 0&&(n=Math.min(n,t)),n}const el=["ctrl","cmd","control","shift","alt","meta","option"];function $n(e){const s={key:"",ctrl:!1,shift:!1,alt:!1,meta:!1,isValid:!1};if(!e||typeof e!="string")return s;const t=e.trim();if(!t)return s;const n=t.split("+").map(l=>l.trim().toLowerCase()).filter(l=>l.length>0);if(n.length===0)return s;const a=new Set;let o="";for(let l=0;l<n.length;l++){const c=n[l];if(el.includes(c))a.add(c);else if(l===n.length-1)o=c;else return s}if(!o)return s;const i=a.has("ctrl")||a.has("cmd")||a.has("control"),u=a.has("alt")||a.has("option");return{key:o,ctrl:i,shift:a.has("shift"),alt:u,meta:a.has("meta"),isValid:!0}}function tl(e,s="windows"){if(!e.isValid)return"";const t=[];return s==="mac"?(e.ctrl&&t.push("⌘"),e.shift&&t.push("⇧"),e.alt&&t.push("⌥"),e.meta&&t.push("⌃"),t.push(e.key.toUpperCase()),t.join("")):(e.ctrl&&t.push("Ctrl"),e.shift&&t.push("Shift"),e.alt&&t.push("Alt"),e.meta&&t.push("Meta"),t.push(e.key.toUpperCase()),t.join("+"))}function En({initialWidth:e,minWidth:s,maxWidth:t,snapPoints:n,snapThreshold:a=20,onWidthChange:o,enabled:i=!0}){process.env.NODE_ENV==="development"&&(Cn(s,t)||console.warn("[useResize] Invalid bounds: minWidth must be less than maxWidth",{minWidth:s,maxWidth:t}));const u=kt(e,s,t),[l,c]=d.useState(u),[f,p]=d.useState(!1),m=d.useRef(0),x=d.useRef(u),v=d.useCallback(w=>{let C=kt(w,s,t);if(n&&n.length>0){const g=n.reduce((S,N)=>{const A=Math.abs(C-N),k=Math.abs(C-S);return A<k?N:S},n[0]);Math.abs(C-g)<=a&&(C=g)}c(C),o==null||o(C)},[s,t,n,a,o]),y=d.useCallback(w=>{if(!i||!f)return;const C=w.clientX-m.current,g=x.current+C;v(g)},[i,f,v]),j=d.useCallback(()=>{i&&(p(!1),m.current=0,x.current=l)},[i,l]),h=d.useCallback(w=>{i&&(w.preventDefault(),w.stopPropagation(),p(!0),m.current=w.clientX,x.current=l)},[i,l]);return d.useEffect(()=>{if(f)return document.addEventListener("mousemove",y),document.addEventListener("mouseup",j),document.body.style.userSelect="none",document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",j),document.body.style.userSelect="",document.body.style.cursor=""}},[f,y,j]),d.useEffect(()=>{f||c(kt(e,s,t))},[e,s,t,f]),{width:l,isResizing:f,startResize:h,setWidth:v}}function Rn({mobileBreakpoint:e=768,onMobileChange:s,enabled:t=!0}={}){const[n,a]=d.useState(typeof window!="undefined"?window.innerWidth:1024),[o,i]=d.useState(typeof window!="undefined"?window.innerWidth<e:!1),u=d.useCallback(()=>{if(!t||typeof window=="undefined")return;const l=window.innerWidth,c=l<e;a(l),c!==o&&(i(c),s==null||s(c))},[t,e,o,s]);return d.useEffect(()=>{if(!t||typeof window=="undefined")return;const l=window.innerWidth,c=l<e;a(l),i(c),window.addEventListener("resize",u);let f=null;return window.ResizeObserver&&(f=new ResizeObserver(()=>{u()}),f.observe(document.body)),()=>{window.removeEventListener("resize",u),f==null||f.disconnect()}},[t,e,u]),{isMobile:o,viewportWidth:n}}function Tn({isActive:e,containerRef:s,restoreFocus:t=!0,initialFocusRef:n}){const a=d.useRef(null);d.useEffect(()=>{if(e){if(a.current=document.activeElement,n!=null&&n.current)n.current.focus();else if(s.current){const i=s.current.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');i==null||i.focus()}}else t&&a.current&&(a.current.focus(),a.current=null)},[e,s,n,t]);const o=d.useCallback(i=>{if(!(!e||!s.current)&&i.key==="Tab"){const u=s.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),l=u[0],c=u[u.length-1];i.shiftKey?document.activeElement===l&&(i.preventDefault(),c==null||c.focus()):document.activeElement===c&&(i.preventDefault(),l==null||l.focus())}},[e,s]);d.useEffect(()=>{if(e)return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}},[e,o])}function An({key:e,ctrl:s=!1,shift:t=!1,alt:n=!1,meta:a=!1,onTrigger:o,enabled:i=!0,preventDefault:u=!0}){const l=d.useCallback(c=>{if(!i)return;const f=c.target;if((f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable)&&!s&&!a)return;const m=e.length===1?c.key.toLowerCase()===e.toLowerCase():c.key===e,x=s?c.ctrlKey||c.metaKey:!c.ctrlKey&&!c.metaKey,v=t?c.shiftKey:!c.shiftKey,y=n?c.altKey:!c.altKey,j=a?c.metaKey:!c.metaKey,h=s?(c.ctrlKey||c.metaKey)&&!a:x&&j;m&&h&&v&&y&&(u&&(c.preventDefault(),c.stopPropagation()),o())},[i,e,s,t,n,a,o,u]);d.useEffect(()=>{if(i)return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[i,l])}function Hs({children:e,defaultCollapsed:s=!1,collapsed:t,onCollapseChange:n,onWidthChange:a,onMobileChange:o,exclusiveGroups:i=!1}){const u=Me(),l=Oe(),c=d.useRef(null),f=t!==void 0,p=()=>{if(f)return t;if(l.storageKey&&l.persistState&&typeof window!="undefined"){const _=localStorage.getItem(`${l.storageKey}-collapsed`);if(_!==null)return _==="true"}return s},m=()=>{if(l.storageKey&&l.persistWidth&&typeof window!="undefined"){const _=localStorage.getItem(`${l.storageKey}-width`);if(_!==null){const P=parseInt(_,10);if(!isNaN(P))return P}}return Tt(u.contentWidth)},[x,v]=d.useState(p),[y,j]=d.useState({}),{isMobile:h}=Rn({mobileBreakpoint:l.mobileBreakpoint,onMobileChange:_=>{o==null||o(_),_&&l.mobileVariant==="collapse"&&!f&&v(!0)},enabled:l.responsive}),{width:w,isResizing:C,startResize:g,setWidth:S}=En({initialWidth:m(),minWidth:l.minWidth,maxWidth:l.maxWidth,snapPoints:l.snapPoints,onWidthChange:_=>{a==null||a(_),l.storageKey&&l.persistWidth&&typeof window!="undefined"&&localStorage.setItem(`${l.storageKey}-width`,String(_))},enabled:l.resizable&&!h});Tn({isActive:h&&l.mobileVariant==="overlay"&&!x,containerRef:c,restoreFocus:!0});const N=f?t:x,A=d.useCallback(_=>{f||v(_),n==null||n(_)},[f,n]),k=d.useCallback(()=>{A(!N)},[N,A]),$=$n(l.keyboardShortcut);An({key:$.key,ctrl:$.ctrl,shift:$.shift,alt:$.alt,meta:$.meta,onTrigger:k,enabled:l.enableKeyboardShortcut});const E=d.useCallback(_=>{S(_)},[S]),R=d.useCallback(_=>{j(i?P=>{const G=P[_]===!1,O={},ne=new Set([...Object.keys(P),_]);return G?ne.forEach(te=>{O[te]=!0}):ne.forEach(te=>{O[te]=te!==_}),O}:P=>F(I({},P),{[_]:!P[_]}))},[i]),M=d.useCallback((_,P)=>{j(U=>F(I({},U),{[_]:P}))},[]);d.useEffect(()=>{f&&t!==x&&v(t)},[f,t,x]),d.useEffect(()=>{l.storageKey&&l.persistState&&typeof window!="undefined"&&!f&&localStorage.setItem(`${l.storageKey}-collapsed`,String(x))},[l.storageKey,l.persistState,x,f]);const z=d.useMemo(()=>({collapsed:N,toggle:k,setCollapsed:A,currentWidth:w,setWidth:E,isMobile:h,isResizing:C,startResize:g,groupStates:y,toggleGroup:R,setGroupCollapsed:M,sidebarRef:c}),[N,k,A,w,E,h,C,g,y,R,M]);return r.jsx(Bt.Provider,{value:z,children:e})}function qs({children:e,variant:s,navigationWidth:t,contentWidth:n,animationDuration:a,animationEasing:o,mode:i,resizable:u,minWidth:l,maxWidth:c,snapPoints:f,responsive:p,mobileBreakpoint:m,mobileVariant:x,overlayBackdrop:v,persistState:y,persistWidth:j,storageKey:h,keyboardShortcut:w,enableKeyboardShortcut:C,defaultCollapsed:g,collapsed:S,onCollapseChange:N,onWidthChange:A,onMobileChange:k,exclusiveGroups:$}){return r.jsx(Vs,{variant:s,navigationWidth:t,contentWidth:n,animationDuration:a,animationEasing:o,children:r.jsx(Bs,{mode:i,resizable:u,minWidth:l,maxWidth:c,snapPoints:f,responsive:p,mobileBreakpoint:m,mobileVariant:x,overlayBackdrop:v,persistState:y,persistWidth:j,storageKey:h,keyboardShortcut:w,enableKeyboardShortcut:C,children:r.jsx(Hs,{defaultCollapsed:g,collapsed:S,onCollapseChange:N,onWidthChange:A,onMobileChange:k,exclusiveGroups:$,children:e})})})}const Ht=d.createContext(null);function Gs(){return d.useContext(Ht)}function Ks(){const e=d.useContext(Ht);if(!e)throw new Error("useSidebarSlotRequired must be used within SidebarSlotProvider");return e}function In({children:e,defaultSlot:s=null}){const[t,n]=d.useState(s),a=d.useRef(new Map),o=d.useCallback((l,c)=>{a.current.set(l,c)},[]),i=d.useCallback(l=>{a.current.delete(l)},[]),u=d.useMemo(()=>({activeSlot:t,setActiveSlot:n,slots:a.current,registerSlot:o,unregisterSlot:i}),[t,o,i]);return r.jsx(Ht.Provider,{value:u,children:e})}const qt=d.createContext(null);function sl(){return d.useContext(qt)}function Ys(){const e=d.useContext(qt);return e||{showMainToggle:!0,mainTogglePosition:"floating"}}function Us(t){var n=t,{className:e=""}=n,s=B(n,["className"]);const{currentWidth:a,setWidth:o,isResizing:i,startResize:u}=De(),{resizable:l}=Oe();return l?r.jsxs("div",F(I({className:`
|
|
387
|
-
group
|
|
388
|
-
absolute
|
|
389
|
-
top-0
|
|
390
|
-
right-0
|
|
391
|
-
w-1
|
|
392
|
-
h-full
|
|
393
|
-
cursor-col-resize
|
|
394
|
-
hover:bg-surface-brand/50
|
|
395
|
-
active:bg-surface-brand-emphasis
|
|
396
|
-
transition-colors
|
|
397
|
-
duration-150
|
|
398
|
-
z-10
|
|
399
|
-
flex
|
|
400
|
-
items-center
|
|
401
|
-
justify-center
|
|
402
|
-
${i?"bg-surface-brand-emphasis":""}
|
|
403
|
-
${e}
|
|
404
|
-
`,onMouseDown:u,role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":a,tabIndex:0,onKeyDown:c=>{if(c.key==="ArrowLeft"||c.key==="ArrowRight"){c.preventDefault();const f=c.key==="ArrowLeft"?-10:10;o(a+f)}}},s),{children:[r.jsx("div",{className:`
|
|
405
|
-
w-0.5
|
|
406
|
-
h-8
|
|
407
|
-
bg-line-strong
|
|
408
|
-
rounded-full
|
|
409
|
-
opacity-0
|
|
410
|
-
group-hover:opacity-100
|
|
411
|
-
transition-opacity
|
|
412
|
-
${i?"opacity-100":""}
|
|
413
|
-
`}),r.jsx(Do,{className:`
|
|
414
|
-
h-4
|
|
415
|
-
w-4
|
|
416
|
-
text-fg-tertiary
|
|
417
|
-
opacity-0
|
|
418
|
-
group-hover:opacity-100
|
|
419
|
-
transition-opacity
|
|
420
|
-
absolute
|
|
421
|
-
${i?"opacity-100":""}
|
|
422
|
-
`,"aria-hidden":"true"})]})):null}function Xs(o){var i=o,{visible:e,onBackdropClick:s,className:t="",style:n}=i,a=B(i,["visible","onBackdropClick","className","style"]);const{collapsed:u,setCollapsed:l,isMobile:c}=De(),{animationDuration:f}=Me(),{mobileVariant:p,overlayBackdrop:m}=Oe(),x=c&&p==="overlay",v=e!=null?e:x&&m&&!u,y=()=>{s?s():l(!0)};return v?r.jsx("div",I({className:`
|
|
423
|
-
fixed inset-0
|
|
424
|
-
bg-scrim
|
|
425
|
-
${b.getZIndexClass("modal-backdrop")}
|
|
426
|
-
${t}
|
|
427
|
-
`,style:I({animation:`fadeIn ${f}ms ease-in-out`},n),onClick:y,"aria-hidden":"true","data-testid":"side-navbar-backdrop"},a)):null}const rl={xs:"w-5 h-5",sm:"w-6 h-6",md:"w-8 h-8",lg:"w-10 h-10"},nl={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},al={floating:`absolute ${b.getZIndexClass("fixed")}`,top:"absolute top-2 right-2 z-10",bottom:"absolute bottom-2 right-2 z-10",inside:"relative z-10","navigation-top":"relative mt-2 mx-auto z-10","navigation-bottom":"relative mt-auto mb-2 mx-auto z-10"},ol={default:"bg-surface-raised border border-line-default shadow-sm hover:bg-surface-hover hover:shadow",ghost:"bg-transparent hover:bg-surface-hover border-0",outline:"bg-transparent border border-line-default hover:bg-surface-hover"},il={floating:"right",top:"bottom",bottom:"top",inside:"right","navigation-top":"right","navigation-bottom":"right"};function Zs(y){var j=y,{position:e="floating",offset:s,icon:t,expandIcon:n,collapseIcon:a,size:o="sm",variant:i="default",showTooltip:u=!0,tooltipPosition:l,keyboardShortcut:c,enableKeyboardShortcut:f,className:p="",style:m,"aria-label":x}=j,v=B(j,["position","offset","icon","expandIcon","collapseIcon","size","variant","showTooltip","tooltipPosition","keyboardShortcut","enableKeyboardShortcut","className","style","aria-label"]);var O,ne;const{collapsed:h,toggle:w}=De(),{animationDuration:C,animationEasing:g,navigationWidth:S,contentWidth:N,minWidth:A}=Me(),k=Oe(),$=c!=null?c:k.keyboardShortcut,E=f!=null?f:k.enableKeyboardShortcut,R=()=>{if(typeof t=="function")return t(h);if(t)return t;if(h&&n)return n;if(!h&&a)return a;const te=h?Bo:Wo;return r.jsx(te,{className:nl[o],style:{transition:"none",transform:"none",willChange:"auto"}})},M=h?"Expand sidebar":"Collapse sidebar",z=l!=null?l:il[e],_=u?`${h?"Expand":"Collapse"} sidebar${E?` (${$})`:""}`:void 0,P=s?{transform:`translate(${(O=s.x)!=null?O:0}px, ${(ne=s.y)!=null?ne:0}px)`}:{},U=e==="floating"?I({right:"-12px",top:"1rem",transform:"translateY(-50%)",transition:`right ${C}ms ${g}`},P):P,G=r.jsx("button",F(I({type:"button",onClick:w,className:`
|
|
428
|
-
${rl[o]}
|
|
429
|
-
${ol[i]}
|
|
430
|
-
rounded-full
|
|
431
|
-
flex items-center justify-center
|
|
432
|
-
text-fg-secondary hover:text-fg-primary
|
|
433
|
-
focus:outline-none focus:ring-2 focus:ring-line-focus focus:ring-offset-1
|
|
434
|
-
${e==="floating"?"":al[e]}
|
|
435
|
-
${p}
|
|
436
|
-
`,style:I(I(I(I({},e==="floating"?{position:"absolute",right:"-11px",left:"auto"}:{}),e!=="floating"?U:{}),e==="floating"?{zIndex:b.Z_INDEX_TOKENS.fixed.value}:{}),m),"aria-label":x||M,"aria-expanded":!h,"aria-controls":"side-navbar-sidebar","data-position":e},v),{children:R()}));if(e==="floating"){const te=u&&_?r.jsx(L.Tooltip,{content:_,position:z,preservePositioning:!0,children:G}):G;return r.jsx("div",{style:{position:"absolute",right:"0",top:"1rem",transform:"translateY(-50%)",zIndex:b.Z_INDEX_TOKENS.fixed.value},children:te})}return u&&_?r.jsx(L.Tooltip,{content:_,position:z,children:G}):G}const ll={default:"",compact:"text-sm",elevated:"shadow-lg",minimal:"border-0",bordered:"border-2"};function Mn(o){var i=o,{children:e,className:s="",style:t,"aria-label":n}=i,a=B(i,["children","className","style","aria-label"]);const u=De(),l=Me(),c=Oe(),f=Ys(),{collapsed:p,setCollapsed:m,currentWidth:x,isResizing:v,sidebarRef:y,isMobile:j}=u,{variant:h,navigationWidth:w,contentWidth:C,animationDuration:g,animationEasing:S}=l,{mode:N,resizable:A,mobileVariant:k,overlayBackdrop:$}=c,E=typeof w=="number"?`${w}px`:w,R=typeof C=="number"?`${C}px`:C,z=N==="navigation"||p?E:A?`${x}px`:R,[_,P]=d.useState(!1);d.useEffect(()=>{P(!0)},[]);const U=j&&k==="overlay",G=_&&U,O=G?`fixed left-0 top-0 ${b.getZIndexClass("fixed")}`:"relative";return r.jsxs(r.Fragment,{children:[_&&U&&$&&!p&&r.jsx(Xs,{}),r.jsxs("aside",F(I({ref:y,className:D(O,"flex","h-full","overflow-visible",ll[h],G&&p?"-translate-x-full":"translate-x-0",s),style:I({position:G?"fixed":"relative",backgroundColor:"var(--color-surface-subtle)",borderRight:"1px solid var(--color-line-default)",width:z,minWidth:z,transitionProperty:v?"none":"width, min-width, transform",transitionDuration:`${g}ms`,transitionTimingFunction:S},t),role:"complementary","aria-label":n||"Sidebar navigation","aria-expanded":N!=="navigation"?!p:void 0,"data-mode":N,"data-collapsed":p},a),{children:[A&&N!=="navigation"&&!p&&r.jsx(Us,{}),f.showMainToggle&&N!=="navigation"&&r.jsx(Zs,{position:f.mainTogglePosition}),r.jsx("div",{className:"flex h-full w-full overflow-visible",children:e})]}))]})}const Gt=d.createContext(null);function cl(){return d.useContext(Gt)}function Kt(){const e=d.useContext(Gt);if(!e)throw new Error("useNavbarRequired must be used within a SideNavbar.Navbar component");return e}function At(o){var i=o,{icon:e,size:s="sm",variant:t="ghost",className:n=""}=i,a=B(i,["icon","size","variant","className"]);const{collapsed:u,toggle:l}=Kt(),c=()=>{if(e)return typeof e=="function"?e(u):e;const x=u?Le:it;return r.jsx(x,{className:p[s],style:{transition:"none",transform:"none",willChange:"auto"}})},f={xs:"w-6 h-6",sm:"w-8 h-8",md:"w-10 h-10"},p={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5"},m={default:"bg-surface-base border border-line-default shadow-sm hover:bg-surface-hover",ghost:"hover:bg-surface-active",outline:"border border-line-emphasis hover:bg-surface-hover"};return r.jsx(L.Tooltip,{content:u?"Expand sidebar":"Collapse sidebar",position:"right",children:r.jsx("button",F(I({type:"button",onClick:l,className:`
|
|
437
|
-
flex
|
|
438
|
-
items-center
|
|
439
|
-
justify-center
|
|
440
|
-
rounded-md
|
|
441
|
-
text-fg-secondary
|
|
442
|
-
hover:text-fg-primary
|
|
443
|
-
focus:outline-none
|
|
444
|
-
focus:ring-2
|
|
445
|
-
focus:ring-line-focus
|
|
446
|
-
focus:ring-offset-1
|
|
447
|
-
${f[s]}
|
|
448
|
-
${m[t]}
|
|
449
|
-
[&:hover]:!transform-none
|
|
450
|
-
${n}
|
|
451
|
-
`,style:{willChange:"auto",transform:"none",transition:"none"},"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-expanded":!u},a),{children:c()}))})}const dl={sm:{container:"w-8 h-8",icon:"w-4 h-4",badge:"min-w-3.5 h-3.5 text-2xs"},md:{container:"w-10 h-10",icon:"w-5 h-5",badge:"min-w-5 h-5 text-xs"},lg:{container:"w-12 h-12",icon:"w-6 h-6",badge:"min-w-5 h-5 text-xs"}},ul={default:"bg-error",success:"bg-success",warning:"bg-warning",danger:"bg-error-dark"},fl={tooltip:"",inline:`flex-row ${b.getSpacingClass("sm","gap")} w-full ${b.getSpacingClass("md","px")}`,below:`flex-col ${b.getSpacingClass("1.5","gap")}`};function Dn(h){var w=h,{id:e,icon:s,label:t,labelMode:n,showLabel:a=!0,active:o=!1,showTooltip:i=!0,badge:u,badgeVariant:l="default",variant:c="default",size:f="md",href:p,target:m,onClick:x,disabled:v=!1,className:y=""}=w,j=B(w,["id","icon","label","labelMode","showLabel","active","showTooltip","badge","badgeVariant","variant","size","href","target","onClick","disabled","className"]);var U;const{activeItem:C,setActiveItem:g,labelMode:S}=Kt(),N=(U=n!=null?n:S)!=null?U:"tooltip",A=o||e&&C===e,k=dl[f],$=G=>{if(v){G.preventDefault();return}e&&g(e),x==null||x()},E=N!=="tooltip"&&a&&t&&r.jsx("span",{className:D("text-xs","flex-shrink-0","relative z-10",N==="below"&&"text-center",N==="inline"&&"truncate"),style:{willChange:"auto",transform:"none",zIndex:10},children:t}),R=D("relative","flex","items-center",N==="inline"?"justify-start":"justify-center",N==="below"&&"flex-col","rounded-lg","box-border","focus:outline-none","focus:ring-2","focus:ring-line-focus","focus:ring-offset-1","w-full","flex-shrink-0","min-w-0","[&>*]:!transition-none","[&>*]:!transform-none",N==="tooltip"?k.container:D(b.getSpacingClass("sm","px"),b.getSpacingClass("1.5","py")),N!=="tooltip"&&fl[N],v?"opacity-50 cursor-not-allowed":"cursor-pointer",y),M={default:A?"bg-surface-brand-muted text-fg-brand-emphasis":v?"text-fg-disabled":"text-fg-secondary hover:bg-surface-active hover:text-fg-primary [&:hover]:!transform-none",ghost:A?"text-fg-brand-emphasis":v?"text-fg-disabled":"text-fg-secondary hover:text-fg-primary [&:hover]:!transform-none",subtle:A?"bg-surface-active text-fg-primary":v?"text-fg-disabled":"text-fg-tertiary hover:bg-surface-hover hover:text-fg-primary [&:hover]:!transform-none"},z=r.jsxs(r.Fragment,{children:[r.jsx("span",{className:D("flex-shrink-0",k.icon,"[&>svg]:transition-none","[&>svg]:!transform-none","[&>svg]:!will-change-auto","box-border","flex items-center justify-center",`relative ${b.getZIndexClass("base")}`),style:{minWidth:k.icon==="w-4 h-4"?"1rem":k.icon==="w-5 h-5"?"1.25rem":"1.5rem",minHeight:k.icon==="w-4 h-4"?"1rem":k.icon==="w-5 h-5"?"1.25rem":"1.5rem",willChange:"auto",transform:"none",transition:"none",zIndex:N!=="tooltip"?0:"auto"},children:s}),E,u!=null&&r.jsx("span",{className:D("absolute","-top-1","-right-1","flex","items-center","justify-center","px-1","font-medium","text-fg-inverse","rounded-full",k.badge,ul[l]),children:u})]}),_={willChange:"auto",transform:"none",transition:"none"},P=p?r.jsx("a",{href:p,target:m,rel:m==="_blank"?"noopener noreferrer":void 0,onClick:$,className:D(R,M[c]),style:_,"aria-label":t,"aria-current":A?"page":void 0,"aria-disabled":v,children:z}):r.jsx("button",F(I({type:"button",onClick:$,disabled:v,className:D(R,M[c]),style:_,"aria-label":t,"aria-current":A?"page":void 0},j),{children:z}));return N==="tooltip"&&i&&t&&!v?r.jsx(L.Tooltip,{content:t,position:"right",children:P}):P}function _n(n){var a=n,{orientation:e="horizontal",className:s=""}=a,t=B(a,["orientation","className"]);return e==="vertical"?r.jsx("div",I({className:D("w-px","h-6","bg-line-default","mx-auto",s),role:"separator","aria-orientation":"vertical"},t)):r.jsx("div",I({className:D("w-full","h-px","bg-line-default","my-2","flex-shrink-0",s),role:"separator","aria-orientation":"horizontal",style:{willChange:"auto",transform:"none"}},t))}function zn(u){var l=u,{id:e,label:s,collapsible:t=!1,defaultCollapsed:n=!1,children:a,className:o}=l,i=B(l,["id","label","collapsible","defaultCollapsed","children","className"]);const[c,f]=d.useState(n);return r.jsxs("div",F(I({id:e,className:D("flex flex-col",o)},i),{children:[s&&r.jsx("div",{className:D(b.getSpacingClass("sm","px"),b.getSpacingClass("1.5","py"),"text-xs text-fg-tertiary uppercase tracking-wider",t&&"cursor-pointer hover:text-fg-secondary"),onClick:t?()=>f(!c):void 0,children:r.jsxs("div",{className:D("flex items-center",b.getSpacingClass("1.5","gap")),children:[" ",t&&r.jsx("span",{className:"shrink-0",children:c?r.jsx(Le,{className:"w-3 h-3",style:{transition:"none",transform:"none"}}):r.jsx(vs,{className:"w-3 h-3",style:{transition:"none",transform:"none"}})}),r.jsx("span",{children:s})]})}),!c&&r.jsxs("div",{className:"flex flex-col gap-2",children:[" ",a]})]}))}function We(f){var p=f,{children:e,showMainToggle:s,mainTogglePosition:t,showToggle:n=!1,togglePosition:a="bottom",labelMode:o="tooltip",expandedWidth:i=200,className:u="",style:l}=p,c=B(p,["children","showMainToggle","mainTogglePosition","showToggle","togglePosition","labelMode","expandedWidth","className","style"]);const m=De(),x=Me(),v=Oe(),y=Ys(),j=d.useRef(null),[h,w]=d.useState(null),[C,g]=d.useState(!1),S=s!=null?s:y.showMainToggle;t!=null||y.mainTogglePosition;const N=o==="inline"&&!m.collapsed,A=N?typeof i=="number"?`${i}px`:i:x.navigationWidth,k=d.useMemo(()=>({collapsed:m.collapsed,toggle:m.toggle,navbarRef:j,activeItem:h,setActiveItem:w,isHovered:C,showInternalToggle:n,togglePosition:a,labelMode:o}),[m.collapsed,m.toggle,h,C,n,a,o]);return S&&v.mode,r.jsx(Gt.Provider,{value:k,children:r.jsxs("nav",F(I({ref:j,className:D("relative","flex-shrink-0","flex","flex-col","h-full",N?"items-stretch":"items-center",u),style:I({position:"relative",backgroundColor:"var(--color-surface-raised)",borderRight:"1px solid var(--color-line-default)",width:A,transitionProperty:"width",transitionDuration:`${x.animationDuration}ms`,transitionTimingFunction:x.animationEasing},l),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"Side navigation"},c),{children:[n&&a==="top"&&r.jsx("div",{className:"flex-shrink-0 p-2",style:{borderBottom:"1px solid var(--color-line-default)"},children:r.jsx(At,{})}),r.jsx("div",{className:D("relative","flex-1","flex","flex-col","overflow-y-auto","overflow-x-hidden","p-2","gap-2","w-full","min-w-0",N?"items-stretch":"items-center","justify-start"),style:{zIndex:1},children:e}),n&&a==="bottom"&&r.jsx("div",{className:"flex-shrink-0 p-2",style:{borderTop:"1px solid var(--color-line-default)"},children:r.jsx(At,{})})]}))})}We.Toggle=At;We.Item=Dn;We.Separator=_n;We.Group=zn;We.displayName="Navbar";const Yt=d.createContext(null);function Fn(){return d.useContext(Yt)}function ut(){const e=d.useContext(Yt);if(!e)throw new Error("useSidebarRequired must be used within a SideNavbar.Sidebar component");return e}function Pn(u){var l=u,{title:e,subtitle:s,showBorder:t=!0,children:n,className:a="",style:o}=l,i=B(l,["title","subtitle","showBorder","children","className","style"]);const{collapsed:c,registerHeader:f,unregisterHeader:p}=ut();return d.useEffect(()=>(f(),()=>p()),[f,p]),c?null:r.jsx("div",F(I({className:`
|
|
452
|
-
flex-shrink-0
|
|
453
|
-
${b.getSpacingClass("md","px")}
|
|
454
|
-
${b.getSpacingClass("sm","py")}
|
|
455
|
-
${t?"border-b border-line-default":""}
|
|
456
|
-
bg-surface-subtle
|
|
457
|
-
${a}
|
|
458
|
-
`,style:o},i),{children:n||r.jsxs(r.Fragment,{children:[e&&r.jsx("h2",{className:`
|
|
459
|
-
${b.getTypographyClasses("h4")}
|
|
460
|
-
text-fg-primary
|
|
461
|
-
m-0
|
|
462
|
-
font-semibold
|
|
463
|
-
`,children:e}),s&&r.jsx("p",{className:`
|
|
464
|
-
${b.getTypographyClasses("bodySmall")}
|
|
465
|
-
text-fg-secondary
|
|
466
|
-
m-0
|
|
467
|
-
mt-1
|
|
468
|
-
`,children:s})]})}))}function Ln(i){var u=i,{scrollable:e=!0,padding:s="md",children:t,className:n="",style:a}=u,o=B(u,["scrollable","padding","children","className","style"]);const{collapsed:l,setScrollPosition:c}=ut();if(l)return null;const f=s!=="none"?b.getSpacingClass(s,"p"):"",p=e?"overflow-y-auto overflow-x-hidden":"overflow-hidden",m=e?{scrollbarWidth:b.SIDEBAR_TOKENS.content.scrollbar.width,scrollbarColor:`${b.SIDEBAR_TOKENS.content.scrollbar.color.thumb} ${b.SIDEBAR_TOKENS.content.scrollbar.color.track}`}:{},x=v=>{e&&c(v.currentTarget.scrollTop)};return r.jsx("div",F(I({className:`
|
|
469
|
-
flex-1
|
|
470
|
-
min-h-0
|
|
471
|
-
${p}
|
|
472
|
-
${f}
|
|
473
|
-
${n}
|
|
474
|
-
`,style:I(I({},m),a),onScroll:x},o),{children:t}))}function On(i){var u=i,{padding:e="md",showBorder:s=!0,children:t,className:n="",style:a}=u,o=B(u,["padding","showBorder","children","className","style"]);const{collapsed:l,registerFooter:c,unregisterFooter:f}=ut();if(d.useEffect(()=>(c(),()=>f()),[c,f]),l)return null;const p=e!=="none"?b.getSpacingClass(e,"p"):"";return r.jsx("div",F(I({className:`
|
|
475
|
-
flex-shrink-0
|
|
476
|
-
${p}
|
|
477
|
-
${s?"border-t border-line-default":""}
|
|
478
|
-
bg-surface-subtle
|
|
479
|
-
${n}
|
|
480
|
-
`,style:a},o),{children:t}))}function Wn(c){var f=c,{id:e,title:s,icon:t,actions:n,collapsible:a=!0,defaultCollapsed:o=!1,children:i,className:u=""}=f,l=B(f,["id","title","icon","actions","collapsible","defaultCollapsed","children","className"]);var N;const{collapsed:p,activeGroup:m,setActiveGroup:x}=ut(),{groupStates:v,toggleGroup:y,setGroupCollapsed:j}=De(),{animationDuration:h}=Me(),w=d.useRef(!1);if(d.useEffect(()=>{!w.current&&v[e]===void 0&&(w.current=!0,j(e,o))},[e,o,v,j]),p)return null;const C=(N=v[e])!=null?N:o,g=m===e,S=()=>{x(e),a&&y(e)};return r.jsxs("div",F(I({className:`
|
|
481
|
-
border-b
|
|
482
|
-
border-line-default
|
|
483
|
-
last:border-b-0
|
|
484
|
-
${u}
|
|
485
|
-
`},l),{children:[s&&r.jsxs("button",{type:"button",onClick:S,className:`
|
|
486
|
-
flex
|
|
487
|
-
items-center
|
|
488
|
-
justify-between
|
|
489
|
-
w-full
|
|
490
|
-
${b.getSpacingClass("md","px")}
|
|
491
|
-
${b.getSpacingClass("2.5","py")}
|
|
492
|
-
text-left
|
|
493
|
-
transition-colors
|
|
494
|
-
duration-150
|
|
495
|
-
${g?"bg-surface-active":"hover:bg-surface-active"}
|
|
496
|
-
${a?"cursor-pointer":"cursor-default"}
|
|
497
|
-
`,"aria-expanded":a?!C:void 0,"aria-controls":a?`sidebar-group-${e}`:void 0,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[t&&r.jsx("span",{className:"w-4 h-4 text-fg-tertiary",children:t}),r.jsx("span",{className:"text-sm font-medium text-fg-secondary",children:s})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[n,a&&r.jsx(ChevronDown,{className:`
|
|
498
|
-
w-4
|
|
499
|
-
h-4
|
|
500
|
-
text-fg-tertiary
|
|
501
|
-
transition-transform
|
|
502
|
-
${C?"-rotate-90":"rotate-0"}
|
|
503
|
-
`,style:{transitionDuration:`${h}ms`},"aria-hidden":"true"})]})]}),a?r.jsx(L.Collapsible,{open:!C,duration:h,children:r.jsx("div",{id:`sidebar-group-${e}`,className:"px-3 py-2",children:i})}):r.jsx("div",{className:"px-3 py-2",children:i})]}))}function Vn({id:e,children:s}){const{activeSlot:t,registerSlot:n,unregisterSlot:a}=Ks();return d.useEffect(()=>(n(e,s),()=>a(e)),[e,s,n,a]),t!==e?null:r.jsx(r.Fragment,{children:s})}function Bn({fallback:e=null}){const{activeSlot:s,slots:t}=Ks();return!s||!t.has(s)?r.jsx(r.Fragment,{children:e}):r.jsx(r.Fragment,{children:t.get(s)})}function _e(a){var o=a,{children:e,className:s="",style:t}=o,n=B(o,["children","className","style"]);const i=De(),u=Me(),l=d.useRef(null),[c,f]=d.useState(0),[p,m]=d.useState(!1),[x,v]=d.useState(!1),[y,j]=d.useState(null),h=d.useCallback(()=>m(!0),[]),w=d.useCallback(()=>m(!1),[]),C=d.useCallback(()=>v(!0),[]),g=d.useCallback(()=>v(!1),[]),S=d.useMemo(()=>({collapsed:i.collapsed,currentWidth:i.currentWidth,isMobile:i.isMobile,sidebarRef:l,scrollPosition:c,setScrollPosition:f,hasHeader:p,hasFooter:x,registerHeader:h,unregisterHeader:w,registerFooter:C,unregisterFooter:g,activeGroup:y,setActiveGroup:j}),[i.collapsed,i.currentWidth,i.isMobile,c,p,x,h,w,C,g,y]),N=Tt(u.contentWidth),A=Tt(u.navigationWidth),k=N-A;return r.jsx(Yt.Provider,{value:S,children:r.jsx("aside",F(I({ref:l,id:"side-navbar-sidebar",className:D("flex","flex-col","h-full","bg-surface-subtle","border-r","border-line-default","overflow-hidden",s),style:I({width:i.collapsed?0:k,opacity:i.collapsed?0:1,visibility:i.collapsed?"hidden":"visible",transitionProperty:"width, opacity, visibility",transitionDuration:`${u.animationDuration}ms`,transitionTimingFunction:u.animationEasing},t),"aria-hidden":i.collapsed},n),{children:e}))})}_e.Header=Pn;_e.Content=Ln;_e.Footer=On;_e.Group=Wn;_e.Slot=Vn;_e.SlotContent=Bn;function me($){var E=$,{mode:e="full",variant:s="default",navigationWidth:t="56px",width:n="320px",animationDuration:a=300,resizable:o=!1,minWidth:i,maxWidth:u,snapPoints:l,responsive:c=!1,mobileBreakpoint:f=768,mobileVariant:p="collapse",overlayBackdrop:m=!0,storageKey:x,persistWidth:v=!1,defaultCollapsed:y=!1,collapsed:j,onCollapseChange:h,onWidthChange:w,onMobileChange:C,exclusiveGroups:g=!1,showToggle:S=!0,togglePosition:N="floating",children:A}=E,k=B(E,["mode","variant","navigationWidth","width","animationDuration","resizable","minWidth","maxWidth","snapPoints","responsive","mobileBreakpoint","mobileVariant","overlayBackdrop","storageKey","persistWidth","defaultCollapsed","collapsed","onCollapseChange","onWidthChange","onMobileChange","exclusiveGroups","showToggle","togglePosition","children"]);const R=d.useMemo(()=>({showMainToggle:S,mainTogglePosition:N}),[S,N]);return r.jsx(qt.Provider,{value:R,children:r.jsx(qs,{variant:s,navigationWidth:t,contentWidth:n,animationDuration:a,mode:e,resizable:o,minWidth:i,maxWidth:u,snapPoints:l,responsive:c,mobileBreakpoint:f,mobileVariant:p,overlayBackdrop:m,storageKey:x,persistWidth:v,defaultCollapsed:y,collapsed:j,onCollapseChange:h,onWidthChange:w,onMobileChange:C,exclusiveGroups:g,children:r.jsx(Mn,F(I({},k),{children:A}))})})}me.Navbar=We;me.Sidebar=_e;me.Toggle=Zs;me.ResizeHandle=Us;me.Backdrop=Xs;me.Provider=qs;me.ThemeProvider=Vs;me.ConfigProvider=Bs;me.StateProvider=Hs;me.SlotProvider=In;function ml({defaultStates:e={},persist:s=!1,storageKey:t}={}){const n=()=>{if(s&&t&&typeof window!="undefined"){const c=localStorage.getItem(`${t}-groups`);if(c)try{const f=JSON.parse(c);return I(I({},e),f)}catch(f){}}return e},[a,o]=d.useState(n);d.useEffect(()=>{s&&t&&typeof window!="undefined"&&localStorage.setItem(`${t}-groups`,JSON.stringify(a))},[s,t,a]);const i=d.useCallback(c=>{o(f=>F(I({},f),{[c]:!f[c]}))},[]),u=d.useCallback((c,f)=>{o(p=>F(I({},p),{[c]:f}))},[]),l=d.useCallback(()=>{o(e)},[e]);return{groupStates:a,toggleGroup:i,setGroupCollapsed:u,resetGroups:l}}function pl(){const{activeItem:e,setActiveItem:s}=Kt(),t=Gs(),n=d.useCallback((a,o)=>{s(a),o&&(t!=null&&t.setActiveSlot)&&t.setActiveSlot(o)},[s,t]);return{activeItem:e,setActiveItem:s,navigate:n}}function gl(){var t,n,a,o;const e=Gs(),s=Fn();return{activeSlot:(t=e==null?void 0:e.activeSlot)!=null?t:null,setActiveSlot:(n=e==null?void 0:e.setActiveSlot)!=null?n:(()=>{}),scrollPosition:(a=s==null?void 0:s.scrollPosition)!=null?a:0,setScrollPosition:(o=s==null?void 0:s.setScrollPosition)!=null?o:(()=>{})}}function hl(){const e=useSideNavbarThemeRequired(),s=useSideNavbarConfigRequired(),t=useSideNavbarStateRequired();return{theme:e,config:s,state:t}}function Hn({children:e,asChild:s=!1}){const{onOpenChange:t}=Qe();return s&&d.isValidElement(e)?d.cloneElement(e,{onClick:n=>{t(!0),e.props.onClick&&e.props.onClick(n)}}):r.jsx("button",{type:"button",onClick:()=>t(!0),"aria-haspopup":"dialog",children:e})}function Js(i){var u=i,{children:e,size:s="md",closeOnOverlayClick:t=!0,closeOnEscape:n=!0,className:a=""}=u,o=B(u,["children","size","closeOnOverlayClick","closeOnEscape","className"]);const{isOpen:l,onClose:c,titleId:f,descriptionId:p}=Qe(),m=d.useRef(null),x=d.useRef(null);if(d.useEffect(()=>{if(!l)return;const h=setTimeout(()=>{var N;const g=(N=m.current)==null?void 0:N.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),S=g==null?void 0:g[0];S==null||S.focus()},0),w=g=>{n&&g.key==="Escape"&&c()},C=g=>{if(g.key!=="Tab"||!m.current)return;const S=Array.from(m.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(k=>!k.disabled&&k.offsetParent!==null);if(S.length===0){g.preventDefault();return}const N=S[0],A=S[S.length-1];g.shiftKey?document.activeElement===N&&(g.preventDefault(),A.focus()):document.activeElement===A&&(g.preventDefault(),N.focus())};return document.addEventListener("keydown",w),document.addEventListener("keydown",C),()=>{clearTimeout(h),document.removeEventListener("keydown",w),document.removeEventListener("keydown",C)}},[l,c,n]),!l)return null;const v={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-2xl",fullscreen:"max-w-full h-full m-0 rounded-none"},y=h=>{t&&h.target===x.current&&c()},j=r.jsxs("div",{className:`fixed inset-0 ${b.getZIndexClass("modal")} overflow-y-auto`,onClick:y,children:[r.jsx("div",{ref:x,className:"fixed inset-0 bg-scrim transition-opacity","aria-hidden":"true"}),r.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:r.jsx("div",F(I({ref:m,role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":p,className:`
|
|
504
|
-
relative ${b.getZIndexClass("modal")} w-full
|
|
505
|
-
${v[s]}
|
|
506
|
-
bg-surface-overlay
|
|
507
|
-
${b.getRadiusClass("lg")}
|
|
508
|
-
${b.getShadowClass("xl")}
|
|
509
|
-
${a}
|
|
510
|
-
`,tabIndex:-1},o),{children:e}))})]});return typeof window!="undefined"?$e.createPortal(j,document.body):j}function Qs(n){var a=n,{children:e,className:s=""}=a,t=B(a,["children","className"]);return r.jsx("div",F(I({className:`flex flex-col space-y-1.5 p-6 pb-4 ${s}`},t),{children:e}))}function qn(o){var i=o,{as:e="h2",children:s,className:t="",id:n}=i,a=B(i,["as","children","className","id"]);const u=Qe(),l=d.useId(),c=n||u.titleId||l;return r.jsx(e,F(I({id:c,className:`${b.getTypographyClasses("h3")} font-semibold leading-none tracking-tight ${t}`},a),{children:s}))}function Gn(a){var o=a,{children:e,className:s="",id:t}=o,n=B(o,["children","className","id"]);const i=Qe(),u=d.useId(),l=t||i.descriptionId||u;return r.jsx("p",F(I({id:l,className:`${b.getTypographyClasses("bodySmall")} text-fg-secondary ${s}`},n),{children:e}))}function er(n){var a=n,{children:e,className:s=""}=a,t=B(a,["children","className"]);return r.jsx("div",F(I({className:`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-6 pt-4 ${s}`},t),{children:e}))}function Kn({"aria-label":e="Close dialog",className:s="",asChild:t=!1,children:n}){const{onClose:a}=Qe();return t&&d.isValidElement(n)?d.cloneElement(n,{onClick:o=>{a(),n.props.onClick&&n.props.onClick(o)}}):r.jsx(L.Button,{variant:"iconOnly",size:"sm",onClick:a,className:`absolute right-4 top-4 ${s}`,"aria-label":e,children:r.jsx(fe,{className:"h-4 w-4"})})}function ge({children:e,open:s,defaultOpen:t,onOpenChange:n}){const a=d.useId(),o=d.useId();return r.jsx(Br,{open:s,defaultOpen:t,onOpenChange:n,titleId:a,descriptionId:o,children:e})}ge.Trigger=Hn;ge.Content=Js;ge.Header=Qs;ge.Title=qn;ge.Description=Gn;ge.Footer=er;ge.Close=Kn;function xl({open:e,defaultOpen:s,onOpenChange:t,title:n,description:a,confirmLabel:o="Confirm",cancelLabel:i="Cancel",variant:u="default",onConfirm:l,onCancel:c,children:f}){const p=()=>{l==null||l(),t==null||t(!1)},m=()=>{c==null||c(),t==null||t(!1)};return r.jsx(ge,{open:e,defaultOpen:s,onOpenChange:t,children:r.jsx(Js,{size:"sm",closeOnOverlayClick:!1,children:f||r.jsxs(r.Fragment,{children:[r.jsxs(Qs,{children:[r.jsx(ge.Title,{children:n}),a&&r.jsx(ge.Description,{children:a})]}),r.jsxs(er,{children:[r.jsx(L.Button,{variant:"outline",onClick:m,children:i}),r.jsx(L.Button,{variant:u==="destructive"?"error":"primary",onClick:p,children:o})]})]})})})}const bl={success:Nt,error:ys,warning:Ko,info:zo},vl={success:"border-success",error:"border-error",warning:"border-warning",info:"border-info"},yl={success:"text-fg-success",error:"text-fg-error",warning:"text-fg-warning",info:"text-fg-info"};function Yn(i){var u=i,{toast:e,onDismiss:s,position:t="top-right",className:n="",style:a}=u,o=B(u,["toast","onDismiss","position","className","style"]);const[l,c]=d.useState(!1),[f,p]=d.useState(!1),m=bl[e.variant];d.useEffect(()=>{if(e.duration===void 0)return;c(!0);const y=setTimeout(()=>{p(!0),setTimeout(()=>{s(e.id)},300)},e.duration);return()=>clearTimeout(y)},[e.duration,e.id,s]),d.useEffect(()=>{const y=setTimeout(()=>c(!0),10);return()=>clearTimeout(y)},[]);const x={"top-right":"top-4 right-4","top-left":"top-4 left-4","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","bottom-center":"bottom-4 left-1/2 -translate-x-1/2"},v=()=>{p(!0),setTimeout(()=>{s(e.id)},300)};return r.jsx("div",F(I({className:`
|
|
511
|
-
fixed ${x[t]} ${b.getZIndexClass("toast")}
|
|
512
|
-
w-full max-w-sm
|
|
513
|
-
transition-all duration-300 ease-in-out
|
|
514
|
-
${l&&!f?"opacity-100 translate-y-0":"opacity-0 -translate-y-2"}
|
|
515
|
-
${f?"opacity-0 translate-y-2":""}
|
|
516
|
-
${n}
|
|
517
|
-
`,style:a,role:"alert","aria-live":e.variant==="error"?"assertive":"polite","aria-atomic":"true"},o),{children:r.jsxs("div",{className:`
|
|
518
|
-
flex items-start gap-3
|
|
519
|
-
p-4
|
|
520
|
-
bg-surface-overlay
|
|
521
|
-
${b.getRadiusClass("lg")}
|
|
522
|
-
${b.getShadowClass("lg")}
|
|
523
|
-
border
|
|
524
|
-
${vl[e.variant]}
|
|
525
|
-
`,children:[r.jsx("div",{className:`flex-shrink-0 ${yl[e.variant]}`,children:r.jsx(m,{className:"h-5 w-5","aria-hidden":"true"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium text-fg-primary",children:e.title}),e.description&&r.jsx("div",{className:"mt-1 text-sm text-fg-secondary",children:e.description}),e.action&&r.jsx("div",{className:"mt-3",children:r.jsx(L.Button,{variant:"outline",size:"sm",onClick:()=>{var y;(y=e.action)==null||y.onClick(),v()},children:e.action.label})})]}),r.jsx(L.Button,{variant:"iconOnly",size:"sm",onClick:v,className:"flex-shrink-0","aria-label":"Dismiss notification",children:r.jsx(fe,{className:"h-4 w-4"})})]})}))}function wl({position:e="top-right",maxToasts:s}){const{toasts:t,removeToast:n}=bs(),a=s?t.slice(0,s):t;if(a.length===0)return null;const o=r.jsx("div",{className:`fixed inset-0 pointer-events-none ${b.getZIndexClass("toast")}`,"aria-live":"polite","aria-label":"Notifications",children:a.map((i,u)=>{const l=e.includes("top"),c=1+u*5;return r.jsx(Yn,{toast:i,onDismiss:n,position:e,style:{[l?"top":"bottom"]:`${c}rem`}},i.id)})});return typeof window!="undefined"?$e.createPortal(o,document.body):o}function jl(){const{addToast:e,removeToast:s,clearAll:t}=bs(),n=d.useCallback(c=>e({title:c.title,description:c.description,variant:c.variant||"info",duration:c.duration,action:c.action}),[e]),a=d.useCallback((c,f,p)=>n(I({title:c,description:f,variant:"success"},p)),[n]),o=d.useCallback((c,f,p)=>n(I({title:c,description:f,variant:"error"},p)),[n]),i=d.useCallback((c,f,p)=>n(I({title:c,description:f,variant:"warning"},p)),[n]),u=d.useCallback((c,f,p)=>n(I({title:c,description:f,variant:"info"},p)),[n]),l=d.useCallback((c,f,p,m="info",x)=>n({title:c,description:f,variant:m,duration:x,action:{label:"Undo",onClick:p}}),[n]);return{show:n,success:a,error:o,warning:i,info:u,withUndo:l,dismiss:s,clearAll:t}}function Un({steps:e,currentStep:s,defaultCurrentStep:t=0,onStepChange:n,onComplete:a,allowNavigation:o=!0,showStepNumbers:i=!0,orientation:u="horizontal",className:l=""}){const[c,f]=d.useState(t),p=s!==void 0,m=p?s:c,x=g=>g<m?"completed":g===m?"active":"pending",v=()=>{if(m<e.length-1){const g=m+1;p||f(g),n==null||n(g)}else a==null||a()},y=()=>{if(m>0){const g=m-1;p||f(g),n==null||n(g)}},j=g=>{o&&(e[g].disabled||(p||f(g),n==null||n(g)))},h=e[m],w=m===0,C=m===e.length-1;return u==="vertical"?r.jsxs("div",{className:`flex gap-4 ${l}`,children:[r.jsx("div",{className:"flex flex-col",children:e.map((g,S)=>{const N=g.status||x(S),A=S===m;return r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsx("button",{type:"button",onClick:()=>j(S),disabled:!o||g.disabled,className:`
|
|
526
|
-
flex
|
|
527
|
-
items-center
|
|
528
|
-
justify-center
|
|
529
|
-
w-10
|
|
530
|
-
h-10
|
|
531
|
-
${b.getRadiusClass("full")}
|
|
532
|
-
border-2
|
|
533
|
-
${b.getAnimationClass("base")}
|
|
534
|
-
${N==="completed"?"bg-success border-success text-fg-inverse":N==="active"?"bg-surface-brand border-line-brand text-fg-inverse":N==="error"?"bg-error border-error text-fg-inverse":"bg-surface-base border-line-emphasis text-fg-quaternary"}
|
|
535
|
-
${!o||g.disabled?"cursor-not-allowed opacity-50":"cursor-pointer"}
|
|
536
|
-
`,children:N==="completed"?r.jsx(ds,{className:"h-5 w-5"}):i?S+1:null}),S<e.length-1&&r.jsx("div",{className:`
|
|
537
|
-
w-0.5
|
|
538
|
-
h-12
|
|
539
|
-
mt-2
|
|
540
|
-
${N==="completed"?"bg-success":"bg-line-emphasis"}
|
|
541
|
-
`})]}),r.jsxs("div",{className:"flex-1 pb-8",children:[r.jsx("button",{type:"button",onClick:()=>j(S),disabled:!o||g.disabled,className:`
|
|
542
|
-
text-left
|
|
543
|
-
${A?"font-semibold":"font-medium"}
|
|
544
|
-
${N==="active"?"text-fg-brand-emphasis":"text-fg-secondary"}
|
|
545
|
-
${!o||g.disabled?"cursor-not-allowed opacity-50":"cursor-pointer"}
|
|
546
|
-
`,children:g.title}),g.description&&r.jsx("p",{className:"text-sm text-fg-tertiary mt-1",children:g.description})]})]},g.id)})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:`
|
|
547
|
-
${b.getSpacingClass("lg","p")}
|
|
548
|
-
border
|
|
549
|
-
border-line-default
|
|
550
|
-
${b.getRadiusClass("lg")}
|
|
551
|
-
bg-surface-base
|
|
552
|
-
`,children:h.content}),r.jsxs("div",{className:`flex justify-between mt-4 ${b.getSpacingClass("base","gap")}`,children:[r.jsx(L.Button,{variant:"outline",onClick:y,disabled:w,children:"Previous"}),r.jsx(L.Button,{variant:"primary",onClick:v,children:C?"Complete":"Next"})]})]})]}):r.jsxs("div",{className:`space-y-6 ${l}`,children:[r.jsx("div",{className:"flex items-center",children:e.map((g,S)=>{const N=g.status||x(S),A=S===m;return r.jsxs("div",{className:"flex items-center flex-1",children:[r.jsxs("div",{className:"flex flex-col items-center flex-1",children:[r.jsx("button",{type:"button",onClick:()=>j(S),disabled:!o||g.disabled,className:`
|
|
553
|
-
flex
|
|
554
|
-
items-center
|
|
555
|
-
justify-center
|
|
556
|
-
w-10
|
|
557
|
-
h-10
|
|
558
|
-
${b.getRadiusClass("full")}
|
|
559
|
-
border-2
|
|
560
|
-
${b.getAnimationClass("base")}
|
|
561
|
-
${N==="completed"?"bg-success border-success text-fg-inverse":N==="active"?"bg-surface-brand border-line-brand text-fg-inverse":N==="error"?"bg-error border-error text-fg-inverse":"bg-surface-base border-line-emphasis text-fg-quaternary"}
|
|
562
|
-
${!o||g.disabled?"cursor-not-allowed opacity-50":"cursor-pointer"}
|
|
563
|
-
`,children:N==="completed"?r.jsx(ds,{className:"h-5 w-5"}):i?S+1:null}),r.jsxs("div",{className:`mt-2 text-center ${b.getSpacingClass("sm","px")}`,children:[r.jsx("p",{className:`
|
|
564
|
-
text-sm
|
|
565
|
-
font-medium
|
|
566
|
-
${A?"text-fg-brand-emphasis":"text-fg-secondary"}
|
|
567
|
-
`,children:g.title}),g.description&&r.jsx("p",{className:"text-xs text-fg-tertiary mt-1",children:g.description})]})]}),S<e.length-1&&r.jsx("div",{className:`flex-1 mx-2 ${b.getSpacingClass("base","mx")}`,children:r.jsx(L.Separator,{className:`
|
|
568
|
-
${N==="completed"?"border-success":"border-line-emphasis"}
|
|
569
|
-
`})})]},g.id)})}),r.jsx("div",{className:`
|
|
570
|
-
${b.getSpacingClass("lg","p")}
|
|
571
|
-
border
|
|
572
|
-
border-line-default
|
|
573
|
-
${b.getRadiusClass("lg")}
|
|
574
|
-
bg-surface-base
|
|
575
|
-
`,children:h.content}),r.jsxs("div",{className:`flex justify-between ${b.getSpacingClass("base","gap")}`,children:[r.jsx(L.Button,{variant:"outline",onClick:y,disabled:w,children:"Previous"}),r.jsx(L.Button,{variant:"primary",onClick:v,children:C?"Complete":"Next"})]})]})}function kl({items:e,orientation:s="vertical",className:t=""}){return s==="horizontal"?r.jsx("div",{className:`flex items-start ${t}`,children:e.map((n,a)=>{const o=n.status||(a===0?"active":a<e.findIndex(u=>u.status==="active")?"completed":"default"),i=a===e.length-1;return r.jsx("div",{className:"flex items-start flex-1",children:r.jsxs("div",{className:"flex flex-col items-center flex-1",children:[r.jsx("div",{className:`
|
|
576
|
-
flex
|
|
577
|
-
items-center
|
|
578
|
-
justify-center
|
|
579
|
-
w-10
|
|
580
|
-
h-10
|
|
581
|
-
${b.getRadiusClass("full")}
|
|
582
|
-
border-2
|
|
583
|
-
${o==="completed"?"bg-success border-success text-fg-inverse":o==="active"?"bg-surface-brand border-line-brand text-fg-inverse":o==="error"?"bg-error border-error text-fg-inverse":"bg-surface-base border-line-emphasis text-fg-quaternary"}
|
|
584
|
-
`,children:n.icon||(o==="completed"?r.jsx(Nt,{className:"h-4 w-4"}):a+1)}),!i&&r.jsx("div",{className:`
|
|
585
|
-
w-full
|
|
586
|
-
h-0.5
|
|
587
|
-
mt-2
|
|
588
|
-
${o==="completed"?"bg-success":"bg-line-emphasis"}
|
|
589
|
-
`}),r.jsxs("div",{className:`mt-4 text-center ${b.getSpacingClass("base","px")}`,children:[n.timestamp&&r.jsx("p",{className:"text-xs text-fg-tertiary mb-1",children:n.timestamp}),r.jsx("h3",{className:"text-sm font-semibold text-fg-primary",children:n.title}),n.description&&r.jsx("p",{className:"text-xs text-fg-secondary mt-1",children:n.description}),n.content&&r.jsx("div",{className:"mt-2",children:n.content})]})]})},n.id)})}):r.jsx("div",{className:`space-y-0 ${t}`,children:e.map((n,a)=>{const o=n.status||(a===0?"active":a<e.findIndex(u=>u.status==="active")?"completed":"default"),i=a===e.length-1;return r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsx("div",{className:`
|
|
590
|
-
flex
|
|
591
|
-
items-center
|
|
592
|
-
justify-center
|
|
593
|
-
w-10
|
|
594
|
-
h-10
|
|
595
|
-
${b.getRadiusClass("full")}
|
|
596
|
-
border-2
|
|
597
|
-
${o==="completed"?"bg-success border-success text-fg-inverse":o==="active"?"bg-surface-brand border-line-brand text-fg-inverse":o==="error"?"bg-error border-error text-fg-inverse":"bg-surface-base border-line-emphasis text-fg-quaternary"}
|
|
598
|
-
`,children:n.icon||(o==="completed"?r.jsx(Nt,{className:"h-4 w-4"}):a+1)}),!i&&r.jsx("div",{className:`
|
|
599
|
-
w-0.5
|
|
600
|
-
flex-1
|
|
601
|
-
min-h-16
|
|
602
|
-
mt-2
|
|
603
|
-
${o==="completed"?"bg-success":"bg-line-emphasis"}
|
|
604
|
-
`})]}),r.jsxs("div",{className:"flex-1 pb-8",children:[n.timestamp&&r.jsx("p",{className:"text-xs text-fg-tertiary mb-1",children:n.timestamp}),r.jsx("h3",{className:`
|
|
605
|
-
text-base
|
|
606
|
-
font-semibold
|
|
607
|
-
${o==="active"?"text-fg-brand-emphasis":"text-fg-primary"}
|
|
608
|
-
`,children:n.title}),n.description&&r.jsx("p",{className:"text-sm text-fg-secondary mt-1",children:n.description}),n.content&&r.jsx("div",{className:"mt-3",children:n.content})]})]},n.id)})})}function Sl({items:e,open:s,defaultOpen:t=!1,onOpenChange:n,trigger:a,placeholder:o="Type a command or search...",emptyMessage:i="No commands found",className:u=""}){const[l,c]=d.useState(t),[f,p]=d.useState(""),[m,x]=d.useState(0),v=d.useRef(null),y=d.useRef(null),j=s!==void 0,h=j?s:l,w=e.filter(k=>{var z,_;if(!f)return!0;const $=f.toLowerCase(),E=k.label.toLowerCase().includes($),R=(z=k.description)==null?void 0:z.toLowerCase().includes($),M=(_=k.keywords)==null?void 0:_.some(P=>P.toLowerCase().includes($));return E||R||M}),C=w.reduce((k,$)=>{const E=$.group||"Other";return k[E]||(k[E]=[]),k[E].push($),k},{}),g=d.useCallback(k=>{j||c(k),n==null||n(k),k&&(p(""),x(0),setTimeout(()=>{var $;return($=v.current)==null?void 0:$.focus()},0))},[j,n]),S=k=>{k.action(),g(!1)},N=k=>{if(k.key==="Escape"){g(!1);return}if(k.key==="ArrowDown"){k.preventDefault(),x($=>Math.min($+1,w.length-1));return}if(k.key==="ArrowUp"){k.preventDefault(),x($=>Math.max($-1,0));return}if(k.key==="Enter"){k.preventDefault(),w[m]&&S(w[m]);return}};d.useEffect(()=>{if(y.current&&m>=0){const k=y.current.querySelector(`[data-index="${m}"]`);k&&typeof k.scrollIntoView=="function"&&k.scrollIntoView({block:"nearest",behavior:"smooth"})}},[m]),d.useEffect(()=>{x(0)},[f]),d.useEffect(()=>{const k=$=>{($.metaKey||$.ctrlKey)&&$.key==="k"&&($.preventDefault(),g(!h))};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[h,g]);const A=h?r.jsx("div",{className:`
|
|
609
|
-
fixed
|
|
610
|
-
inset-0
|
|
611
|
-
${b.getZIndexClass("modal-backdrop")}
|
|
612
|
-
bg-scrim
|
|
613
|
-
flex
|
|
614
|
-
items-start
|
|
615
|
-
justify-center
|
|
616
|
-
pt-[20vh]
|
|
617
|
-
${b.getAnimationClass("base")}
|
|
618
|
-
`,onClick:()=>g(!1),children:r.jsxs("div",{className:`
|
|
619
|
-
w-full
|
|
620
|
-
max-w-2xl
|
|
621
|
-
${b.getSpacingClass("base","mx")}
|
|
622
|
-
bg-surface-overlay
|
|
623
|
-
${b.getRadiusClass("lg")}
|
|
624
|
-
${b.getShadowClass("xl")}
|
|
625
|
-
${b.getZIndexClass("modal")}
|
|
626
|
-
${b.getAnimationClass("base")}
|
|
627
|
-
${u}
|
|
628
|
-
`,onClick:k=>k.stopPropagation(),children:[r.jsxs("div",{className:`
|
|
629
|
-
flex
|
|
630
|
-
items-center
|
|
631
|
-
gap-3
|
|
632
|
-
${b.getSpacingClass("base","p")}
|
|
633
|
-
border-b
|
|
634
|
-
border-line-default
|
|
635
|
-
`,children:[r.jsx(us,{className:"h-5 w-5 text-fg-secondary"}),r.jsx(L.Input,{ref:v,value:f,onChange:k=>p(k.target.value),onKeyDown:N,placeholder:o,className:"flex-1 border-0 focus:ring-0",autoFocus:!0}),r.jsxs("div",{className:`
|
|
636
|
-
flex
|
|
637
|
-
items-center
|
|
638
|
-
gap-1
|
|
639
|
-
${b.getSpacingClass("sm","px")}
|
|
640
|
-
${b.getSpacingClass("xs","py")}
|
|
641
|
-
${b.getRadiusClass("sm")}
|
|
642
|
-
bg-surface-muted
|
|
643
|
-
text-xs
|
|
644
|
-
text-fg-tertiary
|
|
645
|
-
`,children:[r.jsx(yo,{className:"h-3 w-3"}),r.jsx("span",{children:"K"})]})]}),r.jsx("div",{ref:y,className:`
|
|
646
|
-
max-h-96
|
|
647
|
-
overflow-y-auto
|
|
648
|
-
${b.getSpacingClass("sm","py")}
|
|
649
|
-
`,children:Object.keys(C).length===0?r.jsx("div",{className:`
|
|
650
|
-
${b.getSpacingClass("lg","p")}
|
|
651
|
-
text-center
|
|
652
|
-
text-sm
|
|
653
|
-
text-fg-secondary
|
|
654
|
-
`,children:i}):Object.entries(C).map(([k,$])=>r.jsxs("div",{children:[k!=="Other"&&r.jsx("div",{className:`
|
|
655
|
-
${b.getSpacingClass("sm","px")}
|
|
656
|
-
${b.getSpacingClass("xs","py")}
|
|
657
|
-
text-xs
|
|
658
|
-
font-semibold
|
|
659
|
-
text-fg-tertiary
|
|
660
|
-
uppercase
|
|
661
|
-
tracking-wider
|
|
662
|
-
`,children:k}),$.map((E,R)=>{const M=w.indexOf(E),z=M===m;return r.jsxs("button",{type:"button","data-index":M,onClick:()=>S(E),className:`
|
|
663
|
-
w-full
|
|
664
|
-
flex
|
|
665
|
-
items-center
|
|
666
|
-
gap-3
|
|
667
|
-
${b.getSpacingClass("base","px")}
|
|
668
|
-
${b.getSpacingClass("md","py")}
|
|
669
|
-
text-left
|
|
670
|
-
${b.getAnimationClass("base")}
|
|
671
|
-
${z?"bg-surface-brand-muted":"hover:bg-surface-hover"}
|
|
672
|
-
`,children:[E.icon&&r.jsx("div",{className:`
|
|
673
|
-
${z?"text-fg-brand-emphasis":"text-fg-secondary"}
|
|
674
|
-
`,children:E.icon}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:`
|
|
675
|
-
text-sm
|
|
676
|
-
font-medium
|
|
677
|
-
${z?"text-fg-brand-emphasis":"text-fg-primary"}
|
|
678
|
-
`,children:E.label}),E.description&&r.jsx("div",{className:`text-xs text-fg-tertiary ${b.getSpacingClass("0.5","mt")}`,children:E.description})]})]},E.id)})]},k))})]})}):null;return r.jsxs(r.Fragment,{children:[a?r.jsx("div",{onClick:()=>g(!0),children:a}):null,typeof window!="undefined"&&$e.createPortal(A,document.body)]})}function Nl({columns:e,data:s,loading:t=!1,onSort:n,sortColumn:a,sortDirection:o,multiSort:i=!1,groups:u=[],onGroupChange:l,groupable:c=!1,resizable:f=!0,reorderable:p=!1,onColumnReorder:m,columnWidths:x,onColumnResize:v,selectable:y=!1,selectedRows:j,onSelectionChange:h,rowId:w,exportable:C=!1,onExport:g,exportFormats:S=["csv","xlsx","json"],pagination:N,filters:A,actions:k,toolbarActions:$,virtualScrolling:E=!1,virtualScrollingOptions:R,emptyMessage:M,emptyStateTitle:z,emptyStateMessage:_,emptyStateIllustration:P,emptyStateAction:U,className:G=""}){const[O,ne]=d.useState(u),[te,T]=d.useState(x||{}),V=d.useMemo(()=>e.map(Y=>F(I({},Y),{width:te[Y.key]||Y.defaultWidth})),[e,te]),X=Y=>{g?g(Y):Y==="csv"?J(s,e):Y==="json"&&K(s)},J=(Y,W)=>{const se=W.filter(he=>he.exportable!==!1).map(he=>he.label||he.key),oe=Y.map(he=>W.filter(st=>st.exportable!==!1).map(st=>{const pe=he[st.key];return typeof pe=="string"&&pe.includes(",")?`"${pe}"`:pe})),le=[se.join(","),...oe.map(he=>he.join(","))].join(`
|
|
679
|
-
`),ue=new Blob([le],{type:"text/csv"}),je=URL.createObjectURL(ue),tt=document.createElement("a");tt.href=je,tt.download=`export-${Date.now()}.csv`,tt.click(),URL.revokeObjectURL(je)},K=Y=>{const W=JSON.stringify(Y,null,2),se=new Blob([W],{type:"application/json"}),oe=URL.createObjectURL(se),le=document.createElement("a");le.href=oe,le.download=`export-${Date.now()}.json`,le.click(),URL.revokeObjectURL(oe)};return r.jsxs("div",{className:`space-y-4 ${G}`,children:[(C||c||$)&&r.jsxs("div",{className:`
|
|
680
|
-
flex
|
|
681
|
-
items-center
|
|
682
|
-
justify-between
|
|
683
|
-
${b.getSpacingClass("base","p")}
|
|
684
|
-
bg-surface-base
|
|
685
|
-
border
|
|
686
|
-
border-line-default
|
|
687
|
-
rounded-lg
|
|
688
|
-
`,children:[r.jsx("div",{className:"flex items-center gap-2",children:c&&r.jsx(L.Button,{variant:"outline",size:"sm",leftIcon:r.jsx(io,{className:"h-4 w-4"}),children:"Group"})}),r.jsxs("div",{className:"flex items-center gap-2",children:[$,C&&r.jsx("div",{className:"flex items-center gap-1",children:S.map(Y=>r.jsx(L.Button,{variant:"outline",size:"sm",leftIcon:r.jsx(jo,{className:"h-4 w-4"}),onClick:()=>X(Y),children:Y.toUpperCase()},Y))})]})]}),r.jsx(de,{columns:V,data:s,loading:t,onSort:n,sortColumn:a,sortDirection:o,pagination:N,filters:A,selectable:y,selectedRows:j,onSelectionChange:h,rowId:w,actions:k,resizable:f,columnWidths:te,onColumnResize:(Y,W)=>{T(se=>F(I({},se),{[Y]:W})),v==null||v(Y,W)},virtualScrolling:E,virtualScrollingOptions:R,emptyMessage:M,emptyStateTitle:z,emptyStateMessage:_,emptyStateIllustration:P,emptyStateAction:U})]})}function Cl({columns:e,data:s,searchPlaceholder:t="Search...",enableSearch:n=!0,itemsPerPage:a=10,enablePagination:o=!0,actions:i,onRowClick:u,loading:l=!1,emptyMessage:c="No data available"}){const[f,p]=d.useState(""),[m,x]=d.useState(1),v=d.useMemo(()=>e.map(g=>{if(g.accessor||g.header){const S=g.key||(typeof g.accessor=="string"?g.accessor:String(g.accessor)),N=g.label||g.header||"";return F(I({},g),{key:S,label:N})}return g}),[e]),y=d.useMemo(()=>{if(!f.trim())return s;const g=f.toLowerCase();return s.filter(S=>v.some(N=>{const A=S[String(N.key)];return String(A).toLowerCase().includes(g)}))},[s,f,v]),j=d.useMemo(()=>{if(!o)return y;const g=(m-1)*a,S=g+a;return y.slice(g,S)},[y,m,a,o]),h=o?Math.ceil(y.length/a):1,w=g=>{x(g)},C=g=>{p(g),x(1)};return r.jsx(Ie,{maxWidth:"full",paddingX:"base",paddingY:"base",children:r.jsxs(Xe,{spacing:"md",children:[r.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n&&r.jsx("div",{className:"flex-1 max-w-md",children:r.jsx(Pt,{placeholder:t,value:f,onSearch:C})}),i&&r.jsx("div",{className:"flex gap-2",children:i})]}),r.jsx(de,{columns:v,data:j,loading:l,emptyMessage:c,onRowClick:u?g=>{const S=y.findIndex(N=>N===g);u(g,S>=0?S:j.findIndex(N=>N===g))}:void 0}),o&&h>1&&r.jsx("div",{className:"flex justify-center",children:r.jsx(en,{currentPage:m,totalPages:h,onPageChange:w})}),n&&r.jsxs("div",{className:"text-sm text-fg-secondary text-center",children:["Showing ",j.length," of ",y.length," results"]})]})})}function $l({steps:e,onComplete:s,allowBackNavigation:t=!0,showStepNumbers:n=!0}){const[a,o]=d.useState(0),[i,u]=d.useState({}),[l,c]=d.useState({}),f=()=>bt(null,null,function*(){const j=e[a];if(j.validate&&!(yield j.validate())){c(F(I({},l),{[a]:!0}));return}c(F(I({},l),{[a]:!1})),j.onSubmit&&(yield j.onSubmit(i)),a<e.length-1?o(a+1):s&&s(i)}),p=()=>{a>0&&t&&(o(a-1),c(F(I({},l),{[a-1]:!1})))},m=j=>{t&&j<a&&o(j)},x=e[a],v=a===e.length-1,y=l[a]===!0;return r.jsx(Ie,{maxWidth:"lg",paddingX:"base",paddingY:"lg",children:r.jsxs(Xe,{spacing:"lg",children:[r.jsx(Un,{steps:e.map((j,h)=>({id:j.id,title:j.title,content:j.content,description:j.description,status:h<a?"completed":h===a?y?"error":"active":"pending"})),currentStep:a,onStepChange:m,allowNavigation:t}),r.jsx("div",{className:"bg-surface-base rounded-lg border p-6",children:r.jsxs(Xe,{spacing:"md",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl font-semibold",children:x.title}),x.description&&r.jsx("p",{className:"text-fg-secondary mt-1",children:x.description})]}),y&&r.jsx("div",{className:"bg-error-bg border border-error-border rounded p-3",children:r.jsx("p",{className:"text-sm text-fg-error",children:"Please fix the errors before proceeding."})}),r.jsx("div",{className:"min-h-48",children:x.fields}),r.jsxs("div",{className:"flex justify-between pt-4 border-t",children:[r.jsx(L.Button,{variant:"outline",onClick:p,disabled:a===0,children:"Back"}),r.jsx(L.Button,{variant:"primary",onClick:f,children:v?"Complete":"Next"})]})]})})]})})}function El({items:e,searchFn:s,filterFn:t,renderItem:n,filters:a=[],searchPlaceholder:o="Search...",emptyMessage:i="No results found",showResultsCount:u=!0}){const[l,c]=d.useState(""),[f,p]=d.useState({}),m=d.useMemo(()=>{let j=e;if(l.trim()&&s){const h=l.toLowerCase();j=j.filter(w=>s(h,w))}return t&&Object.keys(f).length>0&&(j=j.filter(h=>t(f,h))),j},[e,l,f,s,t]),x=(j,h)=>{p(w=>F(I({},w),{[j]:h}))},v=()=>{p({}),c("")},y=l.trim().length>0||Object.keys(f).length>0;return r.jsx(Ie,{maxWidth:"full",paddingX:"base",paddingY:"base",children:r.jsxs(Xe,{spacing:"md",children:[r.jsx(Ct,{padding:"medium",children:r.jsxs(Xe,{spacing:"md",children:[r.jsx("div",{children:r.jsx(Pt,{placeholder:o,value:l,onSearch:c})}),a.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2",children:a.map(j=>{var h;return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(L.Text,{className:"text-fg-secondary text-sm",children:[j.label,":"]}),r.jsxs("select",{className:"px-3 py-1 border rounded text-sm",value:String(f[j.id]||""),onChange:w=>x(j.id,w.target.value||void 0),children:[r.jsx("option",{value:"",children:"All"}),(h=j.options)==null?void 0:h.map(w=>r.jsx("option",{value:String(w.value||""),children:w.label},w.id))]})]},j.id)})}),y&&r.jsx("div",{children:r.jsx(L.Button,{variant:"outline",size:"sm",onClick:v,children:"Clear Filters"})})]})}),u&&r.jsxs("div",{className:"text-sm text-fg-secondary",children:["Showing ",m.length," of ",e.length," results",y&&" (filtered)"]}),m.length===0?r.jsx(Ct,{padding:"large",children:r.jsx("div",{className:"text-center text-fg-secondary",children:r.jsx(L.Text,{children:i})})}):r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:m.map((j,h)=>r.jsx("div",{children:n(j,h)},h))})]})})}function Rl({sidebar:e,children:s,header:t,footer:n,defaultCollapsed:a=!1,sidebarProps:o}){return r.jsxs("div",{className:"flex h-screen overflow-hidden",children:[e&&r.jsx(me,F(I({defaultCollapsed:a},o),{children:e})),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[t&&r.jsx("header",{className:"border-b bg-surface-base",children:r.jsx(Ie,{maxWidth:"full",paddingX:"base",paddingY:"sm",children:t})}),r.jsx("main",{className:"flex-1 overflow-y-auto",children:r.jsx(Ie,{maxWidth:"xl",paddingX:"base",paddingY:"base",children:s})}),n&&r.jsx("footer",{className:"border-t bg-surface-base",children:r.jsx(Ie,{maxWidth:"full",paddingX:"base",paddingY:"sm",children:n})})]})]})}exports.Accordion=zi;exports.AlertDialog=xl;exports.Autocomplete=un;exports.AutocompleteList=Lt;exports.AutocompleteOption=Cs;exports.Breadcrumb=Qr;exports.Card=Ct;exports.CircleAlert=ys;exports.ColorPicker=Ii;exports.CommandPalette=Sl;exports.DashboardLayout=Rl;exports.DataGrid=Nl;exports.DataTablePattern=Cl;exports.DatePicker=Ci;exports.DatePickerCalendar=Ns;exports.DatePickerInput=Ss;exports.DatePickerProvider=ms;exports.Dialog=ge;exports.DialogClose=Kn;exports.DialogContent=Js;exports.DialogContext=It;exports.DialogDescription=Gn;exports.DialogFooter=er;exports.DialogHeader=Qs;exports.DialogProvider=Br;exports.DialogTitle=qn;exports.DialogTrigger=Hn;exports.Drawer=ct;exports.DrawerContent=Es;exports.DrawerFooter=gn;exports.DrawerHeader=pn;exports.Dropdown=sn;exports.EmptyState=tn;exports.Eye=Eo;exports.EyeOff=Co;exports.FileUpload=Ti;exports.Form=Jo;exports.FormContext=Mt;exports.FormField=Qo;exports.FormProvider=Gr;exports.FormWizardPattern=$l;exports.Header=et;exports.HeaderActions=jn;exports.HeaderHamburger=kn;exports.HeaderLogo=yn;exports.HeaderMobileMenu=Sn;exports.HeaderNavigation=wn;exports.HeaderProvider=ps;exports.LoaderCircle=qr;exports.LoginBox=Bi;exports.Menu=dt;exports.MenuContent=xn;exports.MenuItem=As;exports.MenuSeparator=bn;exports.MenuTrigger=Ts;exports.Modal=Hi;exports.MultiSelect=fn;exports.Navbar=We;exports.NavbarContext=Gt;exports.NavbarGroup=zn;exports.NavbarItem=Dn;exports.NavbarSeparator=_n;exports.NavbarToggle=At;exports.Navigation=Oi;exports.PageHeader=Vi;exports.Pagination=en;exports.Popover=$s;exports.Rating=Ri;exports.SearchAndFilterPattern=El;exports.SearchInput=Pt;exports.SideNavbar=me;exports.SideNavbarBackdrop=Xs;exports.SideNavbarConfigContext=Vt;exports.SideNavbarConfigProvider=Bs;exports.SideNavbarProvider=qs;exports.SideNavbarResizeHandle=Us;exports.SideNavbarRoot=Mn;exports.SideNavbarStateContext=Bt;exports.SideNavbarStateProvider=Hs;exports.SideNavbarThemeContext=Wt;exports.SideNavbarThemeProvider=Vs;exports.SideNavbarToggle=Zs;exports.SideNavbarToggleContext=qt;exports.Sidebar=_e;exports.SidebarContent=Ln;exports.SidebarContext=Yt;exports.SidebarFooter=On;exports.SidebarGroup=Wn;exports.SidebarHeader=Pn;exports.SidebarSlot=Vn;exports.SidebarSlotContent=Bn;exports.SidebarSlotContext=Ht;exports.SidebarSlotProvider=In;exports.Stepper=Un;exports.TableActions=Fs;exports.TableBody=Ls;exports.TableCell=zs;exports.TableComponent=de;exports.TableContext=Ot;exports.TableEmptyState=Ps;exports.TableFilters=Os;exports.TableHeader=_s;exports.TableHeaderCell=Ms;exports.TableHeaderRow=Ds;exports.TablePagination=Ws;exports.TableProvider=gs;exports.TableRow=Rt;exports.Tabs=Ei;exports.TabsContent=dn;exports.TabsContext=_t;exports.TabsList=ln;exports.TabsProvider=on;exports.TabsTrigger=cn;exports.TimePicker=Ai;exports.Timeline=kl;exports.Toast=Yn;exports.ToastContainer=wl;exports.ToastContext=xs;exports.X=fe;exports.clampWidth=kt;exports.cn=D;exports.cva=lt;exports.defaultConfigValues=ce;exports.defaultThemeValues=Ue;exports.formatKeyboardShortcut=tl;exports.jsxRuntimeExports=r;exports.parseKeyboardShortcut=$n;exports.parseWidthToPixels=Tt;exports.useColumnResizing=Xi;exports.useDialogContext=Qe;exports.useDialogContextOptional=eo;exports.useFocusManagement=Tn;exports.useFormContext=ws;exports.useFormContextOptional=Zo;exports.useFormFieldArray=vi;exports.useGroupState=ml;exports.useHeaderContext=Is;exports.useKeyboardShortcut=An;exports.useNavbar=cl;exports.useNavbarRequired=Kt;exports.useResize=En;exports.useResponsiveSidebar=Rn;exports.useSideNavbarCombined=hl;exports.useSideNavbarConfig=Ji;exports.useSideNavbarConfigRequired=Oe;exports.useSideNavbarContent=gl;exports.useSideNavbarNavigation=pl;exports.useSideNavbarState=Qi;exports.useSideNavbarStateRequired=De;exports.useSideNavbarTheme=Zi;exports.useSideNavbarThemeRequired=Me;exports.useSideNavbarToggleContext=sl;exports.useSideNavbarToggleContextRequired=Ys;exports.useSidebar=Fn;exports.useSidebarRequired=ut;exports.useSidebarSlot=Gs;exports.useSidebarSlotRequired=Ks;exports.useTableContext=we;exports.useTableContextOptional=qi;exports.useTabsContext=zt;exports.useTabsContextOptional=$i;exports.useToast=jl;exports.useToastContext=bs;exports.useToastContextOptional=Qa;exports.useVirtualScrolling=Nn;exports.validateWidthBounds=Cn;
|
|
689
|
-
//# sourceMappingURL=components-B08xLmiA.cjs.map
|