@uxuissk/design-system 0.8.6 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sellsuki-ds.js +551 -550
- package/dist/sellsuki-ds.umd.cjs +34 -34
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/sellsuki-ds.umd.cjs
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(F,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("lucide-react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","lucide-react","react-dom"],e):(F=typeof globalThis<"u"?globalThis:F||self,e(F.SellsukiDS={},F.jsxRuntime,F.React,F.LucideReact,F.ReactDOM))})(this,(function(F,e,c,v,Ce){"use strict";const fo={sm:"h-8 px-3 gap-1.5",md:"h-9 px-4 gap-2",lg:"h-10 px-5 gap-2",xl:"h-11 px-6 gap-2.5"},ho={sm:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},xl:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}},Cr={sm:14,md:16,lg:18,xl:20},Fr={primary:"bg-primary text-primary-foreground border border-primary hover:bg-primary/90 active:bg-primary/80 shadow-elevation-sm",secondary:"bg-secondary text-secondary-foreground border border-secondary hover:bg-secondary/90 active:bg-secondary/80 shadow-elevation-sm",outline:"bg-transparent text-foreground border border-border hover:bg-muted active:bg-muted/80",ghost:"bg-transparent text-foreground border border-transparent hover:bg-muted active:bg-muted/80",destructive:"bg-destructive text-destructive-foreground border border-destructive hover:bg-destructive/90 active:bg-destructive/80 shadow-elevation-sm",link:"bg-transparent text-primary border border-transparent underline-offset-4 hover:underline px-0 h-auto"},Ze=c.forwardRef(({variant:r="primary",size:t="md",loading:o=!1,loadingText:a,leftIcon:s,rightIcon:n,fullWidth:l=!1,active:d=!1,disabled:i,children:h,className:b="",...x},w)=>{const f=i||o;return e.jsx("button",{ref:w,disabled:f,className:`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all duration-150
|
|
2
2
|
${fo[t]}
|
|
3
3
|
${Fr[r]}
|
|
4
4
|
${l?"w-full":""}
|
|
5
5
|
${d?"ring-2 ring-ring/30":""}
|
|
6
6
|
${f?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-pointer active:scale-[0.98]"}
|
|
7
7
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40
|
|
8
|
-
${
|
|
8
|
+
${b}
|
|
9
9
|
`,style:ho[t],...x,children:o?e.jsxs(e.Fragment,{children:[e.jsx(v.Loader2,{size:Cr[t],className:"animate-spin flex-shrink-0"}),a&&e.jsx("span",{children:a})]}):e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:"flex-shrink-0",children:s}),h&&e.jsx("span",{className:"inline-flex items-center gap-2",children:h}),n&&e.jsx("span",{className:"flex-shrink-0",children:n})]})})});Ze.displayName="DSButton";const Wr=c.forwardRef(({variant:r="ghost",size:t="md",loading:o=!1,icon:a,disabled:s,className:n="",...l},d)=>{const i=s||o,h={sm:"w-8 h-8",md:"w-9 h-9",lg:"w-10 h-10",xl:"w-11 h-11"};return e.jsx("button",{ref:d,disabled:i,className:`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all duration-150
|
|
10
10
|
${h[t]}
|
|
11
11
|
${Fr[r]}
|
|
12
12
|
${i?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-pointer active:scale-[0.98]"}
|
|
13
13
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40
|
|
14
14
|
${n}
|
|
15
|
-
`,...l,children:o?e.jsx(v.Loader2,{size:Cr[t],className:"animate-spin"}):a})});Wr.displayName="IconButton";function uo({children:r,className:t=""}){return e.jsx("div",{className:`inline-flex [&>button]:rounded-none [&>button:first-child]:rounded-l-[var(--radius-md)] [&>button:last-child]:rounded-r-[var(--radius-md)] [&>button:not(:last-child)]:border-r-0 ${t}`,children:r})}const Lr={sm:{wrapper:"h-9 px-2.5 gap-1.5",textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:14},md:{wrapper:"h-11 px-3 gap-2",textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16},lg:{wrapper:"h-13 px-4 gap-2.5",textStyle:{fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)"},icon:18}},Mr={default:{base:"border border-border bg-input-background",hover:"hover:border-foreground/30",focus:"ring-2 ring-ring/20 border-ring"},outlined:{base:"border-2 border-border bg-transparent",hover:"hover:border-foreground/40",focus:"ring-2 ring-ring/20 border-ring"},filled:{base:"border border-transparent bg-muted",hover:"hover:bg-muted/80",focus:"ring-2 ring-ring/20 border-ring bg-input-background"},ghost:{base:"border border-transparent bg-transparent",hover:"hover:bg-muted/50",focus:"ring-2 ring-ring/20 bg-input-background"}},Dr={default:"",error:"!border-destructive ring-destructive/20",success:"!border-chart-2 ring-chart-2/20",warning:"!border-chart-5 ring-chart-5/20"},Be={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},qe=c.forwardRef(({label:r,helperText:t,errorMessage:o,successMessage:a,size:s="md",variant:n="default",state:l="default",leftIcon:d,rightIcon:i,prefix:h,suffix:
|
|
15
|
+
`,...l,children:o?e.jsx(v.Loader2,{size:Cr[t],className:"animate-spin"}):a})});Wr.displayName="IconButton";function uo({children:r,className:t=""}){return e.jsx("div",{className:`inline-flex [&>button]:rounded-none [&>button:first-child]:rounded-l-[var(--radius-md)] [&>button:last-child]:rounded-r-[var(--radius-md)] [&>button:not(:last-child)]:border-r-0 ${t}`,children:r})}const Lr={sm:{wrapper:"h-9 px-2.5 gap-1.5",textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:14},md:{wrapper:"h-11 px-3 gap-2",textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16},lg:{wrapper:"h-13 px-4 gap-2.5",textStyle:{fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)"},icon:18}},Mr={default:{base:"border border-border bg-input-background",hover:"hover:border-foreground/30",focus:"ring-2 ring-ring/20 border-ring"},outlined:{base:"border-2 border-border bg-transparent",hover:"hover:border-foreground/40",focus:"ring-2 ring-ring/20 border-ring"},filled:{base:"border border-transparent bg-muted",hover:"hover:bg-muted/80",focus:"ring-2 ring-ring/20 border-ring bg-input-background"},ghost:{base:"border border-transparent bg-transparent",hover:"hover:bg-muted/50",focus:"ring-2 ring-ring/20 bg-input-background"}},Dr={default:"",error:"!border-destructive ring-destructive/20",success:"!border-chart-2 ring-chart-2/20",warning:"!border-chart-5 ring-chart-5/20"},Be={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},qe=c.forwardRef(({label:r,helperText:t,errorMessage:o,successMessage:a,size:s="md",variant:n="default",state:l="default",leftIcon:d,rightIcon:i,prefix:h,suffix:b,clearable:x=!1,showPasswordToggle:w=!1,loading:f=!1,fullWidth:p=!0,required:g=!1,showCount:y=!1,onClear:k,disabled:$,type:u="text",value:m,defaultValue:N,onChange:C,className:L="",...M},W)=>{const[D,T]=c.useState(!1),[A,S]=c.useState(!1),[z,E]=c.useState(N??""),I=m!==void 0?m:z,H=String(I).length,P=M.maxLength,_=Lr[s],Q=Mr[n],O=o?"error":l,Z=u==="password",oe=Z&&A?"text":u,X=c.useCallback(B=>{E(B.target.value),C==null||C(B)},[C]),re=c.useCallback(()=>{E(""),k==null||k()},[k]),U=String(I).length>0;return e.jsxs("div",{className:`${p?"w-full":"inline-flex flex-col"} ${L}`,children:[r&&e.jsxs("label",{className:"block mb-1.5 text-foreground",children:[r,g&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("div",{className:`flex items-center rounded-[var(--radius-md)] transition-all duration-150
|
|
16
16
|
${_.wrapper}
|
|
17
17
|
${Q.base}
|
|
18
|
-
${
|
|
19
|
-
${D
|
|
20
|
-
${
|
|
18
|
+
${$?"":Q.hover}
|
|
19
|
+
${D&&!$?Q.focus:""}
|
|
20
|
+
${$?"opacity-50 cursor-not-allowed":""}
|
|
21
21
|
${Dr[O]}
|
|
22
|
-
`,children:[d&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",children:d}),h&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",style:Be,children:h}),e.jsx("input",{ref:W,type:oe,disabled
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${k&&!
|
|
26
|
-
${
|
|
22
|
+
`,children:[d&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",children:d}),h&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",style:Be,children:h}),e.jsx("input",{ref:W,type:oe,disabled:$||f,value:I,onChange:X,onFocus:()=>T(!0),onBlur:()=>T(!1),className:"flex-1 min-w-0 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed",style:_.textStyle,...M}),b&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",style:Be,children:b}),x&&U&&!$&&e.jsx("button",{type:"button",onClick:re,className:"flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer p-0.5",children:e.jsx(v.X,{size:_.icon-2})}),Z&&w&&e.jsx("button",{type:"button",onClick:()=>S(!A),className:"flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer p-0.5",children:A?e.jsx(v.EyeOff,{size:_.icon}):e.jsx(v.Eye,{size:_.icon})}),i&&!Z&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",children:i}),f&&e.jsx("span",{className:"flex-shrink-0",children:e.jsx("span",{className:"block w-4 h-4 border-2 border-muted-foreground border-t-transparent rounded-full animate-spin"})})]}),y&&P&&e.jsxs("div",{className:"flex justify-end mt-1",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",color:H>=P?"var(--destructive)":"var(--muted-foreground)"},children:[H," / ",P]}),(t||o||a)&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[O==="error"&&e.jsx(v.AlertCircle,{size:12,className:"text-destructive flex-shrink-0"}),O==="success"&&e.jsx(v.CheckCircle2,{size:12,className:"text-chart-2 flex-shrink-0"}),e.jsx("span",{className:`${O==="error"?"text-destructive":O==="success"?"text-chart-2":"text-muted-foreground"}`,style:Be,children:o||a||t})]})]})});qe.displayName="DSInput";const Je=c.forwardRef(({label:r,helperText:t,errorMessage:o,successMessage:a,size:s="md",variant:n="default",state:l="default",showCharCount:d=!1,maxLength:i,required:h=!1,disabled:b,value:x,defaultValue:w,onChange:f,className:p="",...g},y)=>{const[k,$]=c.useState(!1),[u,m]=c.useState(String(w??"").length),N=Lr[s],C=Mr[n],L=o?"error":l,M=c.useCallback(W=>{m(W.target.value.length),f==null||f(W)},[f]);return e.jsxs("div",{className:`w-full ${p}`,children:[r&&e.jsxs("label",{className:"block mb-1.5 text-foreground",children:[r,h&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("div",{className:`transition-all duration-150 overflow-hidden rounded-[var(--radius-md)]
|
|
23
|
+
${C.base}
|
|
24
|
+
${b?"":C.hover}
|
|
25
|
+
${k&&!b?C.focus:""}
|
|
26
|
+
${b?"opacity-50 cursor-not-allowed":""}
|
|
27
27
|
${Dr[L]}
|
|
28
|
-
`,children:[e.jsx("textarea",{ref:
|
|
28
|
+
`,children:[e.jsx("textarea",{ref:y,disabled:b,value:x,defaultValue:w,maxLength:i,onChange:M,onFocus:()=>$(!0),onBlur:()=>$(!1),className:"w-full min-h-[100px] px-3 py-2.5 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground resize-y disabled:cursor-not-allowed",style:N.textStyle,...g}),d&&e.jsxs("div",{className:"flex justify-end px-3 py-1.5 border-t border-border text-muted-foreground bg-muted/20",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[u,i?` / ${i}`:""," chars"]})]}),(t||o||a)&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[L==="error"&&e.jsx(v.AlertCircle,{size:12,className:"text-destructive flex-shrink-0"}),L==="success"&&e.jsx(v.CheckCircle2,{size:12,className:"text-chart-2 flex-shrink-0"}),e.jsx("span",{className:`${L==="error"?"text-destructive":L==="success"?"text-chart-2":"text-muted-foreground"}`,style:Be,children:o||a||t})]})]})});Je.displayName="DSTextarea";const bo={info:{bg:"bg-primary/5",border:"border-primary/30",text:"text-primary",icon:e.jsx(v.Info,{size:18})},success:{bg:"bg-chart-2/5",border:"border-chart-2/30",text:"text-chart-2",icon:e.jsx(v.CheckCircle2,{size:18})},warning:{bg:"bg-chart-5/5",border:"border-chart-5/30",text:"text-chart-5",icon:e.jsx(v.AlertTriangle,{size:18})},error:{bg:"bg-destructive/5",border:"border-destructive/30",text:"text-destructive",icon:e.jsx(v.XCircle,{size:18})}};function Qe({variant:r="info",title:t,children:o,dismissible:a=!1,onDismiss:s,action:n,icon:l,className:d=""}){const[i,h]=c.useState(!0),b=bo[r];if(!i)return null;const x=()=>{h(!1),s==null||s()};return e.jsxs("div",{className:`flex gap-3 p-4 rounded-[var(--radius)] border ${b.bg} ${b.border} ${d}`,role:"alert",children:[e.jsx("span",{className:`flex-shrink-0 mt-0.5 ${b.text}`,children:l??b.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[t&&e.jsx("span",{className:`block ${b.text}`,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:t}),e.jsx("span",{className:"text-foreground block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:o}),n&&e.jsx("div",{className:"mt-2",children:n})]}),a&&e.jsx("button",{onClick:x,className:"flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer","aria-label":"Dismiss",children:e.jsx(v.X,{size:16})})]})}let Ar=[],je=[];function jr(){Ar.forEach(r=>r([...je]))}const ye={show:r=>{const t={...r,id:`toast-${Date.now()}-${Math.random().toString(36).slice(2)}`};je=[...je,t],jr(),setTimeout(()=>{ye.dismiss(t.id)},r.duration??4e3)},info:(r,t)=>ye.show({variant:"info",message:r,title:t}),success:(r,t)=>ye.show({variant:"success",message:r,title:t}),warning:(r,t)=>ye.show({variant:"warning",message:r,title:t}),error:(r,t)=>ye.show({variant:"error",message:r,title:t}),dismiss:r=>{je=je.filter(t=>t.id!==r),jr()}};function Er(){const[r,t]=c.useState([]),o=c.useRef(!1);return o.current||(o.current=!0,Ar.push(t)),r.length===0?null:e.jsx("div",{className:"fixed bottom-4 right-4 z-[200] flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:r.map(a=>e.jsx("div",{className:"pointer-events-auto animate-in slide-in-from-right fade-in duration-300",children:e.jsx(Qe,{variant:a.variant,title:a.title,dismissible:!0,onDismiss:()=>ye.dismiss(a.id),children:a.message})},a.id))})}const go={default:"bg-primary text-primary-foreground",secondary:"bg-secondary/15 text-secondary",outline:"bg-transparent border border-border text-foreground",destructive:"bg-destructive/15 text-destructive",success:"bg-chart-2/15 text-chart-2",warning:"bg-chart-5/15 text-chart-5"},po={sm:{className:"px-1.5 py-0.5 gap-1",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:400},iconSize:10},md:{className:"px-2.5 py-0.5 gap-1.5",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:400},iconSize:12},lg:{className:"px-3 py-1 gap-1.5",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:400},iconSize:14}},vo={default:"bg-primary-foreground",secondary:"bg-secondary",outline:"bg-foreground",destructive:"bg-destructive",success:"bg-chart-2",warning:"bg-chart-5"};function mo({children:r,variant:t="default",size:o="md",icon:a,dot:s,removable:n,onRemove:l,className:d=""}){const i=po[o];return e.jsxs("span",{className:`inline-flex items-center rounded-full whitespace-nowrap ${go[t]} ${i.className} ${d}`,style:{...i.style,lineHeight:"1.2"},children:[s&&e.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${vo[t]}`}),a&&e.jsx("span",{className:"flex-shrink-0",children:a}),e.jsx("span",{children:r}),n&&e.jsx("button",{onClick:l,className:"flex-shrink-0 hover:opacity-70 transition-opacity cursor-pointer rounded-full -mr-0.5","aria-label":"Remove",children:e.jsx(v.X,{size:i.iconSize})})]})}const xo={sm:{box:"w-4 h-4",icon:10,labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},md:{box:"w-5 h-5",icon:12,labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},lg:{box:"w-6 h-6",icon:14,labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}};function Fe({checked:r,indeterminate:t=!1,defaultChecked:o=!1,onChange:a,label:s,description:n,size:l="md",disabled:d=!1,error:i,className:h="",id:b}){const[x,w]=c.useState(o),f=r??x,p=xo[l],g=b??`cb-${c.useId()}`,y=()=>{if(d)return;const $=!f;r===void 0&&w($),a==null||a($)},k=f||t;return e.jsxs("div",{className:`inline-flex items-start gap-2.5 ${d?"opacity-50":""} ${h}`,children:[e.jsx("button",{id:g,role:"checkbox","aria-checked":t?"mixed":f,disabled:d,onClick:y,className:`${p.box} flex-shrink-0 rounded-[var(--radius-sm)] border-2 transition-all flex items-center justify-center cursor-pointer mt-0.5
|
|
29
29
|
${k?"bg-primary border-primary text-primary-foreground":i?"border-destructive bg-card":"border-border bg-card hover:border-primary/50"}
|
|
30
30
|
${d?"!cursor-not-allowed":""}
|
|
31
|
-
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:t?e.jsx(v.Minus,{size:p.icon,strokeWidth:3}):f?e.jsx(v.Check,{size:p.icon,strokeWidth:3}):null}),(s||n)&&e.jsxs("div",{className:"min-w-0",children:[s&&e.jsx("label",{htmlFor:g,className:`text-foreground block cursor-pointer ${d?"!cursor-not-allowed":""}`,style:p.labelStyle,onClick:
|
|
31
|
+
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:t?e.jsx(v.Minus,{size:p.icon,strokeWidth:3}):f?e.jsx(v.Check,{size:p.icon,strokeWidth:3}):null}),(s||n)&&e.jsxs("div",{className:"min-w-0",children:[s&&e.jsx("label",{htmlFor:g,className:`text-foreground block cursor-pointer ${d?"!cursor-not-allowed":""}`,style:p.labelStyle,onClick:y,children:s}),n&&e.jsx("span",{className:"text-muted-foreground block",style:p.descStyle,children:n}),i&&e.jsx("span",{className:"text-destructive block mt-0.5",style:p.descStyle,children:i})]})]})}function yo({label:r,children:t,direction:o="vertical",className:a=""}){return e.jsxs("fieldset",{className:`${a}`,children:[r&&e.jsx("legend",{className:"text-foreground mb-2 block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:r}),e.jsx("div",{className:`flex ${o==="vertical"?"flex-col gap-3":"flex-wrap gap-4"}`,children:t})]})}const Tr=c.createContext(null),wo={sm:{outer:"w-4 h-4",inner:"w-1.5 h-1.5",labelStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},md:{outer:"w-5 h-5",inner:"w-2 h-2",labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},lg:{outer:"w-6 h-6",inner:"w-2.5 h-2.5",labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}};function Ir({value:r,label:t,description:o,disabled:a,size:s,className:n=""}){const l=c.useContext(Tr),d=l?l.value===r:!1,i=a??(l==null?void 0:l.disabled)??!1,h=s??(l==null?void 0:l.size)??"md",b=wo[h],x=()=>{i||l==null||l.onChange(r)};return e.jsxs("div",{className:`inline-flex items-start gap-2.5 ${i?"opacity-50":""} ${n}`,children:[e.jsx("button",{role:"radio","aria-checked":d,disabled:i,onClick:x,className:`${b.outer} flex-shrink-0 rounded-full border-2 transition-all flex items-center justify-center cursor-pointer mt-0.5
|
|
32
32
|
${d?"border-primary":"border-border hover:border-primary/50"}
|
|
33
33
|
${i?"!cursor-not-allowed":""}
|
|
34
|
-
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:d&&e.jsx("span",{className:`${
|
|
34
|
+
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:d&&e.jsx("span",{className:`${b.inner} rounded-full bg-primary transition-transform scale-100`})}),(t||o)&&e.jsxs("div",{className:"min-w-0",children:[t&&e.jsx("span",{className:`text-foreground block cursor-pointer ${i?"!cursor-not-allowed":""}`,style:b.labelStyle,onClick:x,children:t}),o&&e.jsx("span",{className:"text-muted-foreground block",style:b.descStyle,children:o})]})]})}function No({name:r,value:t,defaultValue:o="",onChange:a,label:s,size:n="md",disabled:l=!1,direction:d="vertical",children:i,error:h,className:b=""}){const[x,w]=c.useState(o),f=t??x,p=g=>{t===void 0&&w(g),a==null||a(g)};return e.jsx(Tr.Provider,{value:{value:f,onChange:p,size:n,disabled:l,name:r},children:e.jsxs("fieldset",{className:b,role:"radiogroup",children:[s&&e.jsx("legend",{className:"text-foreground mb-2 block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:s}),e.jsx("div",{className:`flex ${d==="vertical"?"flex-col gap-3":"flex-wrap gap-4"}`,children:i}),h&&e.jsx("span",{className:"text-destructive block mt-1.5",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:h})]})})}const So=["Su","Mo","Tu","We","Th","Fr","Sa"],Ve=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ee(r,t){return r.getFullYear()===t.getFullYear()&&r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()}function Br(r,t,o){if(!t||!o)return!1;const a=r.getTime();return a>t.getTime()&&a<o.getTime()}function _r(r,t,o,a){return!!(t&&r<new Date(t.getFullYear(),t.getMonth(),t.getDate())||o&&r>new Date(o.getFullYear(),o.getMonth(),o.getDate())||a!=null&&a.some(s=>Ee(s,r)))}function ko(r,t){return new Date(r,t+1,0).getDate()}function Hr(r,t){const o=new Date(r,t,1).getDay(),a=ko(r,t),s=[];for(let n=0;n<o;n++)s.push(null);for(let n=1;n<=a;n++)s.push(new Date(r,t,n));return s}function _e(r,t){if(!r)return"";const o=String(r.getDate()).padStart(2,"0"),a=String(r.getMonth()+1).padStart(2,"0"),s=r.getFullYear();let n=`${o}/${a}/${s}`;if(t){const l=String(r.getHours()).padStart(2,"0"),d=String(r.getMinutes()).padStart(2,"0");n+=` ${l}:${d}`}return n}const $o={sm:{trigger:"h-8 px-2.5",text:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:14,cell:"w-7 h-7"},md:{trigger:"h-10 px-3",text:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16,cell:"w-9 h-9"},lg:{trigger:"h-12 px-4",text:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:18,cell:"w-10 h-10"}},zo={default:"bg-input-background border border-border",outlined:"bg-transparent border-2 border-border",filled:"bg-muted/30 border border-transparent",ghost:"bg-transparent border border-transparent"},Co={default:"focus-within:ring-2 focus-within:ring-ring/30 focus-within:border-primary",error:"ring-2 ring-destructive/30 border-destructive",success:"ring-2 ring-chart-2/30 border-chart-2"};function Fo({value:r=null,rangeValue:t,onChange:o,onRangeChange:a,mode:s="single",label:n,placeholder:l,helperText:d,errorMessage:i,successMessage:h,size:b="md",variant:x="default",state:w="default",disabled:f=!1,required:p=!1,clearable:g=!1,showTime:y=!1,minDate:k,maxDate:$,disabledDates:u,showToday:m=!0,footer:N,fullWidth:C=!1}){const[L,M]=c.useState(!1),[W,D]=c.useState(()=>r??new Date),[T,A]=c.useState("days"),[S,z]=c.useState(null),[E,I]=c.useState(()=>r?r.getHours():0),[H,P]=c.useState(()=>r?r.getMinutes():0),_=c.useRef(null),Q=c.useRef(null),O=c.useRef(null),[Z,oe]=c.useState(null),X=$o[b];c.useEffect(()=>{if(!L||!Q.current)return;const Y=()=>{const ee=Q.current.getBoundingClientRect(),be=s==="range"?560:300,te=y?390:360,ke=ee.left+be>window.innerWidth?Math.max(8,window.innerWidth-be-8):ee.left,ce=ee.bottom+6+te>window.innerHeight?ee.top-te-2:ee.bottom+6;oe({top:ce,left:ke})};return Y(),window.addEventListener("scroll",Y,!0),window.addEventListener("resize",Y),()=>{window.removeEventListener("scroll",Y,!0),window.removeEventListener("resize",Y)}},[L,s,y]),c.useEffect(()=>{function Y(ee){var ce,$e;const be=ee.target,te=((ce=_.current)==null?void 0:ce.contains(be))??!1,ke=(($e=O.current)==null?void 0:$e.contains(be))??!1;!te&&!ke&&(M(!1),A("days"))}return L&&document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[L]),c.useMemo(()=>Hr(W.getFullYear(),W.getMonth()),[W]);const re=c.useMemo(()=>new Date,[]),U=()=>D(new Date(W.getFullYear(),W.getMonth()-1,1)),B=()=>D(new Date(W.getFullYear(),W.getMonth()+1,1)),V=()=>D(new Date(W.getFullYear()-1,W.getMonth(),1)),J=()=>D(new Date(W.getFullYear()+1,W.getMonth(),1)),le=c.useCallback(Y=>{if(!_r(Y,k,$,u))if(s==="single"){let ee=new Date(Y);y&&ee.setHours(E,H),o==null||o(ee),y||(M(!1),A("days"))}else{const ee=t==null?void 0:t.start,be=t==null?void 0:t.end;!ee||ee&&be?a==null||a({start:Y,end:null}):(Y<ee?a==null||a({start:Y,end:ee}):a==null||a({start:ee,end:Y}),M(!1),A("days"))}},[s,o,a,t,k,$,u,y,E,H]),me=Y=>{Y.stopPropagation(),s==="single"?o==null||o(null):a==null||a({start:null,end:null})},Ie=()=>{const Y=new Date;if(D(Y),s==="single"){const ee=new Date(Y);y&&ee.setHours(E,H),o==null||o(ee),y||(M(!1),A("days"))}},q=()=>{if(r){const Y=new Date(r);Y.setHours(E,H),o==null||o(Y)}M(!1),A("days")},xe=c.useMemo(()=>s==="single"?_e(r,y):t!=null&&t.start&&(t!=null&&t.end)?`${_e(t.start)} – ${_e(t.end)}`:t!=null&&t.start?`${_e(t.start)} – ...`:"",[s,r,t,y]),Ne=s==="single"?!!r:!!(t!=null&&t.start||t!=null&&t.end),ue=w==="error"?e.jsx(v.AlertCircle,{size:X.icon,className:"text-destructive flex-shrink-0"}):w==="success"?e.jsx(v.CheckCircle2,{size:X.icon,className:"text-chart-2 flex-shrink-0"}):null,Me=w==="error"?i:w==="success"?h:d,Ke=w==="error"?"text-destructive":w==="success"?"text-chart-2":"text-muted-foreground",$r={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Se={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},ae={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},de=Math.floor(W.getFullYear()/12)*12;return e.jsxs("div",{className:`relative ${C?"w-full":""}`,ref:_,children:[n&&e.jsxs("label",{className:"block text-foreground mb-1.5",style:$r,children:[n,p&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("button",{ref:Q,type:"button",onClick:()=>!f&&M(!L),disabled:f,className:`
|
|
35
35
|
w-full flex items-center gap-2 rounded-[var(--radius-md)] transition-all cursor-pointer
|
|
36
36
|
${X.trigger}
|
|
37
37
|
${zo[x]}
|
|
38
|
-
${Co[
|
|
38
|
+
${Co[w]}
|
|
39
39
|
${f?"opacity-50 cursor-not-allowed":"hover:border-primary/50"}
|
|
40
|
-
`,style:X.text,children:[e.jsx(v.Calendar,{size:X.icon,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:`flex-1 text-left truncate ${Ne?"text-foreground":"text-muted-foreground"}`,children:Ne?xe:l||(s==="range"?"Select date range…":"Select date…")}),ue,g&&Ne&&!f&&e.jsx("span",{onClick:me,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:X.icon-2})})]}),Me&&e.jsx("p",{className:`mt-1.5 ${Ke}`,style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:Me}),L&&Z&&Ce.createPortal(e.jsxs("div",{ref:O,className:"bg-popover border border-border rounded-[var(--radius-md)] shadow-elevation-sm overflow-hidden",style:{position:"fixed",zIndex:9999,top:Z.top,left:Z.left,minWidth:s==="range"?"560px":"300px"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-card",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:V,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Previous year",children:e.jsx(v.ChevronsLeft,{size:16})}),e.jsx("button",{onClick:U,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Previous month",children:e.jsx(v.ChevronLeft,{size:16})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>A(T==="months"?"days":"months"),className:"px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",style:ae,children:Ve[W.getMonth()]}),e.jsx("button",{onClick:()=>A(T==="years"?"days":"years"),className:"px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",style:ae,children:W.getFullYear()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:B,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Next month",children:e.jsx(v.ChevronRight,{size:16})}),e.jsx("button",{onClick:J,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Next year",children:e.jsx(v.ChevronsRight,{size:16})})]})]}),T==="days"&&e.jsx("div",{className:`p-3 ${s==="range"?"flex gap-3":""}`,children:(s==="range"?[0,1]:[0]).map(Y=>{const ee=new Date(W.getFullYear(),W.getMonth()+Y,1),be=Hr(ee.getFullYear(),ee.getMonth());return e.jsxs("div",{className:"flex-1",children:[Y>0&&e.jsxs("div",{className:"text-center mb-2 text-foreground",style:ae,children:[Ve[ee.getMonth()]," ",ee.getFullYear()]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:So.map(te=>e.jsx("div",{className:"text-center text-muted-foreground py-1",style:Se,children:te},`${Y}-${te}`))}),e.jsx("div",{className:"grid grid-cols-7",children:be.map((te,ke)=>{if(!te)return e.jsx("div",{},`empty-${Y}-${ke}`);const ce=_r(te,k
|
|
40
|
+
`,style:X.text,children:[e.jsx(v.Calendar,{size:X.icon,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:`flex-1 text-left truncate ${Ne?"text-foreground":"text-muted-foreground"}`,children:Ne?xe:l||(s==="range"?"Select date range…":"Select date…")}),ue,g&&Ne&&!f&&e.jsx("span",{onClick:me,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:X.icon-2})})]}),Me&&e.jsx("p",{className:`mt-1.5 ${Ke}`,style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:Me}),L&&Z&&Ce.createPortal(e.jsxs("div",{ref:O,className:"bg-popover border border-border rounded-[var(--radius-md)] shadow-elevation-sm overflow-hidden",style:{position:"fixed",zIndex:9999,top:Z.top,left:Z.left,minWidth:s==="range"?"560px":"300px"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-card",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:V,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Previous year",children:e.jsx(v.ChevronsLeft,{size:16})}),e.jsx("button",{onClick:U,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Previous month",children:e.jsx(v.ChevronLeft,{size:16})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>A(T==="months"?"days":"months"),className:"px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",style:ae,children:Ve[W.getMonth()]}),e.jsx("button",{onClick:()=>A(T==="years"?"days":"years"),className:"px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",style:ae,children:W.getFullYear()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:B,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Next month",children:e.jsx(v.ChevronRight,{size:16})}),e.jsx("button",{onClick:J,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Next year",children:e.jsx(v.ChevronsRight,{size:16})})]})]}),T==="days"&&e.jsx("div",{className:`p-3 ${s==="range"?"flex gap-3":""}`,children:(s==="range"?[0,1]:[0]).map(Y=>{const ee=new Date(W.getFullYear(),W.getMonth()+Y,1),be=Hr(ee.getFullYear(),ee.getMonth());return e.jsxs("div",{className:"flex-1",children:[Y>0&&e.jsxs("div",{className:"text-center mb-2 text-foreground",style:ae,children:[Ve[ee.getMonth()]," ",ee.getFullYear()]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:So.map(te=>e.jsx("div",{className:"text-center text-muted-foreground py-1",style:Se,children:te},`${Y}-${te}`))}),e.jsx("div",{className:"grid grid-cols-7",children:be.map((te,ke)=>{if(!te)return e.jsx("div",{},`empty-${Y}-${ke}`);const ce=_r(te,k,$,u),$e=Ee(te,re),ze=s==="single"?r&&Ee(te,r):(t==null?void 0:t.start)&&Ee(te,t.start)||(t==null?void 0:t.end)&&Ee(te,t.end),De=s==="range"&&(Br(te,(t==null?void 0:t.start)??null,(t==null?void 0:t.end)??null)||(t==null?void 0:t.start)&&!(t!=null&&t.end)&&S&&Br(te,t.start,S>t.start?S:null));return e.jsx("button",{onClick:()=>le(te),onMouseEnter:()=>s==="range"&&z(te),disabled:ce,className:`
|
|
41
41
|
${X.cell} flex items-center justify-center rounded-[var(--radius-sm)] transition-all cursor-pointer
|
|
42
42
|
${ce?"opacity-30 cursor-not-allowed":"hover:bg-muted"}
|
|
43
43
|
${ze?"bg-primary text-primary-foreground hover:bg-primary/90":""}
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
py-2.5 rounded-[var(--radius-md)] transition-all cursor-pointer
|
|
51
51
|
${W.getFullYear()===Y?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"}
|
|
52
52
|
${Y===re.getFullYear()&&W.getFullYear()!==Y?"border border-primary text-primary":""}
|
|
53
|
-
`,style:ae,children:Y},Y))})]}),
|
|
54
|
-
${
|
|
53
|
+
`,style:ae,children:Y},Y))})]}),y&&s==="single"&&T==="days"&&e.jsxs("div",{className:"px-4 py-3 border-t border-border flex items-center gap-3",children:[e.jsx(v.Clock,{size:14,className:"text-muted-foreground"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"number",min:0,max:23,value:String(E).padStart(2,"0"),onChange:Y=>I(Math.max(0,Math.min(23,Number(Y.target.value)))),className:"w-10 text-center bg-input-background border border-border rounded-[var(--radius-sm)] py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-ring/30",style:ae}),e.jsx("span",{className:"text-muted-foreground",style:ae,children:":"}),e.jsx("input",{type:"number",min:0,max:59,value:String(H).padStart(2,"0"),onChange:Y=>P(Math.max(0,Math.min(59,Number(Y.target.value)))),className:"w-10 text-center bg-input-background border border-border rounded-[var(--radius-sm)] py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-ring/30",style:ae})]}),e.jsx("button",{onClick:q,className:"ml-auto px-3 py-1 rounded-[var(--radius-md)] bg-primary text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer",style:ae,children:"Apply"})]}),e.jsxs("div",{className:"px-4 py-2.5 border-t border-border bg-card flex items-center justify-between",children:[m?e.jsx("button",{onClick:Ie,className:"text-primary hover:underline cursor-pointer",style:ae,children:"Today"}):e.jsx("span",{}),N??e.jsx("button",{onClick:()=>{M(!1),A("days")},className:"text-muted-foreground hover:text-foreground cursor-pointer",style:ae,children:"Close"})]})]}),document.body)]})}const Wo={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[calc(100vw-2rem)] max-h-[calc(100vh-2rem)]"};function Pr({open:r,onClose:t,title:o,description:a,size:s="md",children:n,footer:l,closeOnOverlay:d=!0,showCloseButton:i=!0,className:h=""}){const b=c.useRef(null);return c.useEffect(()=>{if(!r)return;const x=w=>{w.key==="Escape"&&t()};return document.addEventListener("keydown",x),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",x),document.body.style.overflow=""}},[r,t]),c.useEffect(()=>{r&&b.current&&b.current.focus()},[r]),r?e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-foreground/40 backdrop-blur-sm animate-in fade-in duration-200",onClick:d?t:void 0}),e.jsxs("div",{ref:b,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":o?"modal-title":void 0,className:`relative w-full ${Wo[s]} bg-card rounded-[var(--radius-md)] shadow-elevation-sm border border-border animate-in zoom-in-95 fade-in duration-200 flex flex-col ${s==="full"?"h-full":"max-h-[85vh]"} ${h}`,children:[(o||i)&&e.jsxs("div",{className:"flex items-start justify-between gap-4 px-6 pt-6 pb-2 flex-shrink-0",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[o&&e.jsx("h4",{id:"modal-title",className:"text-foreground",children:o}),a&&e.jsx("span",{className:"text-muted-foreground block mt-0.5",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:a})]}),i&&e.jsx("button",{onClick:t,className:"flex-shrink-0 w-8 h-8 rounded-[var(--radius-sm)] flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer","aria-label":"Close",children:e.jsx(v.X,{size:16})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:n}),l&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-6 py-4 border-t border-border flex-shrink-0",children:l})]})]}):null}function Lo({open:r,onClose:t,onConfirm:o,title:a="Are you sure?",description:s="This action cannot be undone.",confirmLabel:n="Confirm",cancelLabel:l="Cancel",variant:d="default"}){const i={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsx(Pr,{open:r,onClose:t,title:a,description:s,size:"sm",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-4",children:[e.jsx("button",{onClick:t,className:"px-4 py-2 rounded-[var(--radius-md)] border border-border text-foreground hover:bg-muted transition-colors cursor-pointer",style:i,children:l}),e.jsx("button",{onClick:()=>{o(),t()},className:`px-4 py-2 rounded-[var(--radius-md)] text-primary-foreground transition-colors cursor-pointer ${d==="destructive"?"bg-destructive hover:bg-destructive/90":"bg-primary hover:bg-primary/90"}`,style:i,children:n})]})})}const Mo={sm:{btn:"min-w-[28px] h-7 px-1.5",icon:14,text:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},gap:"gap-1"},md:{btn:"min-w-[34px] h-9 px-2",icon:16,text:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},gap:"gap-1.5"},lg:{btn:"min-w-[42px] h-11 px-3",icon:18,text:{fontFamily:"var(--font-button)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},gap:"gap-2"}},Do={default:{base:"bg-transparent text-foreground border border-transparent",active:"bg-primary text-primary-foreground border-primary shadow-elevation-sm",hover:"hover:bg-muted"},outlined:{base:"bg-transparent text-foreground border border-border",active:"bg-primary text-primary-foreground border-primary shadow-elevation-sm",hover:"hover:bg-muted hover:border-muted"},filled:{base:"bg-muted/50 text-foreground border border-transparent",active:"bg-primary text-primary-foreground border-primary shadow-elevation-sm",hover:"hover:bg-muted"},minimal:{base:"bg-transparent text-foreground border border-transparent",active:"bg-accent text-accent-foreground border-accent",hover:"hover:text-primary"}};function Ao(r,t,o){return c.useMemo(()=>{if(o*2+5>=t)return Array.from({length:t},(h,b)=>b+1);const s=Math.max(r-o,1),n=Math.min(r+o,t),l=s>2,d=n<t-1;if(!l&&d){const h=3+2*o;return[...Array.from({length:h},(x,w)=>w+1),"dots-right",t]}if(l&&!d){const h=3+2*o;return[1,"dots-left",...Array.from({length:h},(x,w)=>t-h+w+1)]}return[1,"dots-left",...Array.from({length:n-s+1},(h,b)=>s+b),"dots-right",t]},[r,t,o])}function jo({currentPage:r,totalPages:t,onPageChange:o,siblingCount:a=1,showFirstLast:s=!1,showPrevNext:n=!0,showPageSize:l=!1,pageSizeOptions:d=[10,20,50,100],pageSize:i=10,onPageSizeChange:h,totalItems:b,size:x="md",variant:w="default",disabled:f=!1,showPageInfo:p=!1,showItemsInfo:g=!1,prevLabel:y,nextLabel:k}){const $=Ao(r,t,a),u=Mo[x],m=Do[w],N=c.useCallback(D=>{!f&&D>=1&&D<=t&&o(D)},[f,t,o]),C=(D,T)=>`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all cursor-pointer select-none
|
|
54
|
+
${u.btn}
|
|
55
55
|
${T?"opacity-40 pointer-events-none cursor-default":""}
|
|
56
|
-
${D?w.active:`${w.base} ${T?"":w.hover}`}`,L=u?(r-1)*i+1:0,M=u?Math.min(r*i,u):0,W={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[g&&u!==void 0&&e.jsxs("span",{className:"text-muted-foreground",style:W,children:[L,"–",M," of ",u]}),l&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:W,children:"Rows per page:"}),e.jsx("select",{value:i,onChange:D=>h==null?void 0:h(Number(D.target.value)),disabled:f,className:"bg-input-background text-foreground border border-border rounded-[var(--radius-md)] px-2 py-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring/30",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},children:d.map(D=>e.jsx("option",{value:D,children:D},D))})]})]}),e.jsxs("nav",{className:`flex items-center ${b.gap}`,"aria-label":"Pagination",role:"navigation",children:[s&&e.jsx("button",{onClick:()=>N(1),disabled:f||r<=1,className:F(!1,f||r<=1),style:b.text,"aria-label":"First page",title:"First page",children:e.jsx(v.ChevronsLeft,{size:b.icon})}),n&&e.jsx("button",{onClick:()=>N(r-1),disabled:f||r<=1,className:F(!1,f||r<=1),style:b.text,"aria-label":"Previous page",children:m??e.jsx(v.ChevronLeft,{size:b.icon})}),z.map((D,T)=>D==="dots-left"||D==="dots-right"?e.jsx("span",{className:`inline-flex items-center justify-center text-muted-foreground ${b.btn}`,style:b.text,children:e.jsx(v.MoreHorizontal,{size:b.icon})},D):e.jsx("button",{onClick:()=>N(D),disabled:f,className:F(D===r,f),style:b.text,"aria-label":`Page ${D}`,"aria-current":D===r?"page":void 0,children:D},D)),n&&e.jsx("button",{onClick:()=>N(r+1),disabled:f||r>=t,className:F(!1,f||r>=t),style:b.text,"aria-label":"Next page",children:k??e.jsx(v.ChevronRight,{size:b.icon})}),s&&e.jsx("button",{onClick:()=>N(t),disabled:f||r>=t,className:F(!1,f||r>=t),style:b.text,"aria-label":"Last page",title:"Last page",children:e.jsx(v.ChevronsRight,{size:b.icon})})]}),p&&e.jsxs("span",{className:"text-muted-foreground",style:W,children:["Page ",r," of ",t]})]})}const Eo={sm:{input:"h-8 px-8",icon:14,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},md:{input:"h-10 px-9",icon:16,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},lg:{input:"h-12 px-10",icon:18,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}},To={default:"bg-card border border-border focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",outlined:"bg-transparent border-2 border-border focus-within:border-primary",filled:"bg-muted/50 border border-transparent focus-within:border-ring focus-within:bg-card"};function Io({value:r,onChange:t,onSearch:o,placeholder:a="Search...",size:s="md",variant:n="default",loading:l=!1,suggestions:d=[],onSuggestionSelect:i,clearable:h=!0,disabled:u=!1,autoFocus:x=!1,debounce:y=0,className:f=""}){const[p,g]=c.useState(""),[m,k]=c.useState(!1),[z,b]=c.useState(-1),w=r??p,N=c.useRef(null),F=c.useRef(null),L=c.useRef(void 0),M=Eo[s],W=c.useCallback(S=>{r===void 0&&g(S),t==null||t(S),y>0&&(clearTimeout(L.current),L.current=setTimeout(()=>o==null?void 0:o(S),y))},[r,t,o,y]),D=S=>{S.key==="Enter"?z>=0&&d[z]?(i==null||i(d[z]),k(!1)):o==null||o(w):S.key==="ArrowDown"?(S.preventDefault(),b($=>Math.min($+1,d.length-1))):S.key==="ArrowUp"?(S.preventDefault(),b($=>Math.max($-1,-1))):S.key==="Escape"&&k(!1)};c.useEffect(()=>{const S=$=>{F.current&&!F.current.contains($.target)&&k(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),c.useEffect(()=>{k(d.length>0&&w.length>0),b(-1)},[d,w]);const T={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},A={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsxs("div",{ref:F,className:`relative ${f}`,children:[e.jsxs("div",{className:`relative rounded-[var(--radius-md)] transition-all ${To[n]} ${u?"opacity-50 pointer-events-none":""}`,children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",children:e.jsx(v.Search,{size:M.icon})}),e.jsx("input",{ref:N,type:"text",value:w,onChange:S=>W(S.target.value),onKeyDown:D,onFocus:()=>d.length>0&&w.length>0&&k(!0),placeholder:a,disabled:u,autoFocus:x,className:`w-full ${M.input} rounded-[var(--radius-md)] bg-transparent outline-none text-foreground placeholder:text-muted-foreground`,style:M.style}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[l&&e.jsx(v.Loader2,{size:M.icon,className:"animate-spin text-muted-foreground"}),h&&w&&!l&&e.jsx("button",{onClick:()=>{var S;W(""),(S=N.current)==null||S.focus()},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(v.X,{size:M.icon})})]})]}),m&&d.length>0&&e.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-popover border border-border rounded-[var(--radius-md)] shadow-elevation-sm z-50 overflow-hidden max-h-64 overflow-y-auto",style:{padding:"var(--Spacing--Spacing-sm)"},children:d.map((S,$)=>e.jsxs("button",{onClick:()=>{i==null||i(S),k(!1)},className:`w-full text-left flex items-center rounded-[var(--radius-sm)] transition-colors cursor-pointer ${$===z?"bg-[var(--Colors--Background--bg-brand-secondary)]":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)"},children:[S.icon&&e.jsx("span",{className:"text-muted-foreground flex-shrink-0",children:S.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-foreground block truncate",style:T,children:S.label}),S.description&&e.jsx("span",{className:"text-muted-foreground block truncate",style:{marginTop:"var(--Spacing--Spacing-xxs)",...A},children:S.description})]})]},S.id))})]})}const we={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function Or({columns:r,data:t,size:o="md",striped:a=!1,hoverable:s=!0,bordered:n=!1,selectable:l=!1,selectedRows:d,onSelectionChange:i,loading:h=!1,error:u,emptyMessage:x="No data available",stickyHeader:y=!1,flush:f=!1,className:p=""}){const[g,m]=c.useState(null),[k,z]=c.useState("asc"),[b,w]=c.useState(new Set),N=d??b,F=E=>{d||w(E),i==null||i(E)},L=c.useMemo(()=>g?[...t].sort((E,I)=>{const H=E[g],P=I[g];if(H==null)return 1;if(P==null)return-1;const _=typeof H=="string"?H.localeCompare(P):H-P;return k==="asc"?_:-_}):t,[t,g,k]),M=E=>{g===E?z(I=>I==="asc"?"desc":"asc"):(m(E),z("asc"))},W=t.length>0&&N.size===t.length,D=N.size>0&&!W,T=()=>{F(W?new Set:new Set(t.map((E,I)=>I)))},A=E=>{const I=new Set(N);I.has(E)?I.delete(E):I.add(E),F(I)},S={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},$={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};return e.jsx("div",{className:`${f?"":"rounded-[var(--radius-md)] border border-border"} overflow-hidden ${p}`,children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:y?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"border-b border-border",style:{backgroundColor:"color-mix(in srgb, var(--muted) 30%, var(--background) 70%)"},children:[l&&e.jsx("th",{className:`${we[o]} w-12`,children:e.jsx(Fe,{size:"sm",checked:W,indeterminate:D,onChange:T})}),r.map(E=>e.jsx("th",{className:`${we[o]} text-${E.align??"left"} text-foreground ${E.sortable?"cursor-pointer select-none hover:text-primary transition-colors":""} ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:{...$,width:E.width},onClick:()=>E.sortable&&M(E.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[E.header,E.sortable&&e.jsx("span",{className:"text-muted-foreground/50",children:g===E.key?k==="asc"?e.jsx(v.ChevronUp,{size:14}):e.jsx(v.ChevronDown,{size:14}):e.jsx(v.ChevronsUpDown,{size:12})})]})},E.key))]})}),e.jsx("tbody",{children:h?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${we[o]} text-center text-muted-foreground`,children:e.jsxs("div",{className:"flex items-center justify-center gap-2 py-8",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"}),e.jsx("span",{style:S,children:"Loading..."})]})})}):u?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${we[o]} text-center py-12`,children:e.jsx("div",{className:"flex flex-col items-center gap-2",children:e.jsx("span",{style:{...S,color:"var(--destructive)"},children:u})})})}):L.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${we[o]} text-center text-muted-foreground py-12`,children:e.jsx("span",{style:S,children:x})})}):L.map((E,I)=>{const H=N.has(I);return e.jsxs("tr",{className:`border-b border-border last:border-b-0 transition-colors ${H?"bg-primary/5":a&&I%2===1?"bg-muted/20":"bg-card"} ${s?"hover:bg-[var(--row-hover-bg)]":""}`,children:[l&&e.jsx("td",{className:`${we[o]} w-12`,children:e.jsx(Fe,{size:"sm",checked:H,onChange:()=>A(I)})}),r.map(P=>e.jsx("td",{className:`${we[o]} text-${P.align??"left"} text-foreground ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:S,children:P.render?P.render(E[P.key],E,I):E[P.key]},P.key))]},I)})})]})})})}const Bo={sm:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)",padding:"6px 12px"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",padding:"8px 16px"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-p)",padding:"10px 20px"}};function _o({tabs:r=[],variant:t="default",size:o="md",defaultTab:a,activeTab:s,onChange:n,fullWidth:l=!1,className:d=""}){var z,b;const[i,h]=c.useState(a??((z=r[0])==null?void 0:z.id)??""),u=s??i,x=c.useRef(null),[y,f]=c.useState({left:0,width:0}),p=w=>{s||h(w),n==null||n(w)};c.useEffect(()=>{if(t!=="underline"&&t!=="default")return;const w=x.current;if(!w)return;const N=w.querySelector(`[data-tab-id="${u}"]`);N&&f({left:N.offsetLeft,width:N.offsetWidth})},[u,t]);const g=(b=r.find(w=>w.id===u))==null?void 0:b.content,m=(()=>{switch(t){case"bordered":return"border border-border rounded-[var(--radius)] bg-muted/30 p-1 gap-1";case"pills":return"gap-1.5";case"underline":return"border-b border-border relative";default:return"border-b border-border relative"}})(),k=(w,N)=>{const F="relative flex items-center gap-1.5 transition-all cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring whitespace-nowrap";if(N)return`${F} opacity-40 !cursor-not-allowed`;switch(t){case"bordered":return`${F} rounded-[var(--radius-sm)] ${w?"bg-card text-foreground shadow-elevation-sm":"text-muted-foreground hover:text-foreground hover:bg-card/50"}`;case"pills":return`${F} rounded-[var(--radius)] ${w?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`;case"underline":return`${F} ${w?"text-primary":"text-muted-foreground hover:text-foreground"}`;default:return`${F} ${w?"text-primary":"text-muted-foreground hover:text-foreground"}`}};return e.jsxs("div",{className:d,children:[e.jsxs("div",{ref:x,className:`flex ${l?"":"inline-flex"} ${m}`,role:"tablist",children:[(t==="default"||t==="underline")&&e.jsx("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-all duration-200 rounded-full",style:{left:y.left,width:y.width}}),r.map(w=>{const N=u===w.id;return e.jsxs("button",{"data-tab-id":w.id,role:"tab","aria-selected":N,disabled:w.disabled,onClick:()=>!w.disabled&&p(w.id),className:`${k(N,!!w.disabled)} ${l?"flex-1 justify-center":""}`,style:Bo[o],children:[w.icon&&e.jsx("span",{className:"flex-shrink-0",children:w.icon}),e.jsx("span",{children:w.label}),w.badge!==void 0&&e.jsx("span",{className:`ml-1 rounded-full min-w-[18px] text-center inline-flex items-center justify-center ${N&&t==="pills"?"bg-primary-foreground/20 text-primary-foreground":"bg-muted text-muted-foreground"}`,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-caption)",lineHeight:"1",padding:"1px 6px"},children:w.badge})]},w.id)})]}),g&&e.jsx("div",{className:"pt-4",role:"tabpanel",children:g})]})}const Ho={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Po={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Re({title:r,children:t,open:o,onToggle:a,icon:s,disabled:n=!1}){return e.jsxs("div",{className:`border-b border-border last:border-b-0 ${n?"opacity-50":""}`,children:[e.jsxs("button",{onClick:n?void 0:a,disabled:n,className:`w-full flex items-center gap-3 px-4 py-3 text-left transition-colors ${n?"cursor-not-allowed":"hover:bg-muted/20 cursor-pointer"}`,children:[s&&e.jsx("span",{className:"text-primary flex-shrink-0",children:s}),e.jsx("span",{className:"flex-1 text-foreground",style:Ho,children:r}),e.jsx(v.ChevronDown,{size:16,className:`text-muted-foreground transition-transform ${o?"rotate-180":""}`})]}),e.jsx("div",{className:`overflow-hidden transition-all ${o?"max-h-96 opacity-100":"max-h-0 opacity-0"}`,children:e.jsx("div",{className:"px-4 pb-4 text-muted-foreground",style:Po,children:t})})]})}function Yr({type:r="single",items:t,defaultOpen:o,value:a,onChange:s,className:n=""}){const[l,d]=c.useState(typeof o=="string"?o:null),[i,h]=c.useState(Array.isArray(o)?new Set(o):new Set),u=a!==void 0,x=f=>u?r==="single"?a===f:Array.isArray(a)&&a.includes(f):r==="single"?l===f:i.has(f),y=f=>{if(r==="single"){const p=(u?a===f:l===f)?null:f;u||d(p),s==null||s(p)}else if(u){const p=Array.isArray(a)?a:[],g=p.includes(f)?p.filter(m=>m!==f):[...p,f];s==null||s(g)}else h(p=>{const g=new Set(p);return g.has(f)?g.delete(f):g.add(f),g})};return e.jsx("div",{className:`rounded-[var(--radius)] border border-border overflow-hidden ${n}`,children:t.map(f=>e.jsx(Re,{title:f.title,open:x(f.id),onToggle:()=>y(f.id),icon:f.icon,disabled:f.disabled,children:f.content},f.id))})}Yr.displayName="Accordion",Re.displayName="AccordionItem";const Gr=["bg-primary","bg-chart-2","bg-chart-5","bg-destructive","bg-secondary"],Oo={xs:{box:"w-6 h-6",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},sm:{box:"w-8 h-8",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},md:{box:"w-10 h-10",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},lg:{box:"w-14 h-14",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}},xl:{box:"w-20 h-20",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}}},Yo={xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"},Go={online:"bg-chart-2",offline:"bg-secondary",busy:"bg-destructive",away:"bg-chart-5"},Uo={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Ur({src:r,name:t,size:o="md",status:a,className:s=""}){const n=Oo[o],l=t?t.split(" ").map(i=>i[0]).join("").slice(0,2).toUpperCase():"?",d=t?Gr[t.length%Gr.length]:"bg-muted";return e.jsxs("div",{className:`relative inline-flex ${s}`,children:[r?e.jsx("img",{src:r,alt:t||"avatar",className:`${n.box} rounded-full object-cover`}):e.jsx("div",{className:`${n.box} rounded-full ${d} text-primary-foreground flex items-center justify-center`,style:n.font,children:l}),a&&e.jsx("span",{className:`absolute bottom-0 right-0 ${Yo[o]} ${Go[a]} rounded-full border-2 border-card`})]})}function Xr({children:r,max:t,className:o=""}){const a=c.Children.toArray(r),s=t?a.slice(0,t):a,n=t&&a.length>t?a.length-t:0;return e.jsxs("div",{className:`flex -space-x-2 ${o}`,children:[s.map((l,d)=>e.jsx("div",{className:"relative",style:{zIndex:s.length-d},children:l},d)),n>0&&e.jsxs("div",{className:"relative w-10 h-10 rounded-full bg-muted text-foreground flex items-center justify-center border-2 border-card",style:{...Uo,zIndex:0},children:["+",n]})]})}Ur.displayName="Avatar",Xr.displayName="AvatarGroup";const Xo={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}};function Ko({items:r,separator:t="chevron",size:o="md",maxItems:a}){const s=t==="slash"?e.jsx(v.Slash,{size:12,className:"text-muted-foreground"}):t==="dot"?e.jsx(v.Dot,{size:16,className:"text-muted-foreground"}):e.jsx(v.ChevronRight,{size:12,className:"text-muted-foreground"}),n=o==="sm"?"gap-1":o==="lg"?"gap-2.5":"gap-1.5",l=Xo[o];let d=r;if(a&&r.length>a){const i=r.slice(0,1),h=r.slice(-(a-1));d=[...i,{label:"…"},...h]}return e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsx("ol",{className:`flex items-center flex-wrap ${n}`,children:d.map((i,h)=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[h>0&&e.jsx("span",{className:"mx-0.5",children:s}),i.label==="…"?e.jsx("span",{className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-accent cursor-pointer",children:e.jsx(v.MoreHorizontal,{size:14})}):h===d.length-1?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground",style:{...l,fontWeight:"var(--weight-button)"},children:[i.icon,i.label]}):e.jsxs("a",{href:i.href||"#",onClick:u=>u.preventDefault(),className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground transition-colors",style:l,children:[i.icon,i.label]})]},h))})})}const Zo={none:"",sm:"shadow-elevation-sm",md:"shadow-elevation-sm",lg:"shadow-elevation-sm"};function Kr({children:r,className:t,hover:o,elevation:a="none"}){return e.jsx("div",{className:`rounded-[var(--radius-md)] border border-border bg-card overflow-hidden ${Zo[a]??""} ${o?"hover:border-primary/40 hover:shadow-elevation-sm transition-all cursor-pointer":""} ${t??""}`,children:r})}Kr.displayName="Card";function Zr({children:r,action:t}){return e.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[e.jsx("div",{children:r}),t]})}Zr.displayName="CardHeader";function qr({children:r}){return e.jsx("div",{className:"px-5 py-4",children:r})}qr.displayName="CardBody";function Jr({children:r}){return e.jsx("div",{className:"px-5 py-3 border-t border-border bg-muted/10 flex items-center gap-2",children:r})}Jr.displayName="CardFooter";const qo=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#0ea5e9","#e11d48","#991b1b","#9a3412","#854d0e","#166534","#155e75","#1e40af","#0369a1","#9f1239","#fca5a5","#fdba74","#fde047","#86efac","#67e8f9","#93c5fd","#bae6fd","#fecdd3"];function Jo(r){const t=parseInt(r.slice(1,3),16),o=parseInt(r.slice(3,5),16),a=parseInt(r.slice(5,7),16);return`rgb(${t}, ${o}, ${a})`}function Qo(r){const t=parseInt(r.slice(1,3),16)/255,o=parseInt(r.slice(3,5),16)/255,a=parseInt(r.slice(5,7),16)/255,s=Math.max(t,o,a),n=Math.min(t,o,a),l=(s+n)/2;if(s===n)return`hsl(0, 0%, ${Math.round(l*100)}%)`;const d=s-n,i=l>.5?d/(2-s-n):d/(s+n);let h=0;return s===t?h=((o-a)/d+(o<a?6:0))/6:s===o?h=((a-t)/d+2)/6:h=((t-o)/d+4)/6,`hsl(${Math.round(h*360)}, ${Math.round(i*100)}%, ${Math.round(l*100)}%)`}const Vo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ro={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Qr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ea({value:r,onChange:t,label:o,presets:a,showInput:s=!0,showFormats:n,size:l="md",disabled:d=!1}){const[i,h]=c.useState(!1),u=c.useRef(null),x=l==="sm"?"w-5 h-5":l==="lg"?"w-8 h-8":"w-6 h-6",y=a||qo,f=p=>{navigator.clipboard.writeText(p).then(()=>{h(!0),setTimeout(()=>h(!1),1500)})};return e.jsxs("div",{className:`space-y-3 ${d?"opacity-50 pointer-events-none":""}`,children:[o&&e.jsx("label",{className:"block text-foreground",style:Vo,children:o}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-md)] border border-border cursor-pointer overflow-hidden",style:{backgroundColor:r},onClick:()=>{var p;return(p=u.current)==null?void 0:p.click()}}),e.jsx("input",{ref:u,type:"color",value:r,onChange:p=>t(p.target.value),className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full"})]}),s&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:r,onChange:p=>{(/^#[0-9a-fA-F]{0,6}$/.test(p.target.value)||p.target.value==="#")&&t(p.target.value)},className:"w-24 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-background text-foreground outline-none focus:border-primary",style:Qr,maxLength:7}),e.jsx("button",{onClick:()=>f(r),className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer",children:i?e.jsx(v.Check,{size:14,className:"text-chart-2"}):e.jsx(v.Copy,{size:14})})]})]}),y.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.map(p=>e.jsx("button",{onClick:()=>t(p),className:`${x} rounded-[var(--radius-sm)] border-2 transition-transform hover:scale-110 cursor-pointer
|
|
57
|
-
${r===p?"border-foreground ring-1 ring-foreground/20":"border-transparent"}`,style:{backgroundColor:p},title:p},p))}),n&&e.jsx("div",{className:"space-y-1",children:[{label:"HEX",val:r.toUpperCase()},{label:"RGB",val:Jo(r)},{label:"HSL",val:Qo(r)}].map(p=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-8 text-muted-foreground",style:Ro,children:p.label}),e.jsx("code",{className:"text-foreground",style:Qr,children:p.val}),e.jsx("button",{onClick:()=>f(p.val),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.Copy,{size:12})})]},p.label))})]})}const ra={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Vr({label:r,orientation:t="horizontal",dashed:o,spacing:a="md",className:s=""}){const n={sm:"my-2",md:"my-4",lg:"my-8"},l=o?"border-dashed":"border-solid";return t==="vertical"?e.jsx("div",{className:`inline-block h-full min-h-[24px] border-l border-border ${l} mx-3 ${s}`}):r?e.jsxs("div",{className:`flex items-center gap-3 ${n[a]} ${s}`,children:[e.jsx("div",{className:`flex-1 border-t border-border ${l}`}),e.jsx("span",{className:"text-muted-foreground flex-shrink-0",style:ra,children:r}),e.jsx("div",{className:`flex-1 border-t border-border ${l}`})]}):e.jsx("hr",{className:`border-t border-border ${l} ${n[a]} ${s}`})}Vr.displayName="Divider";const ta={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Rr({open:r,onClose:t,title:o,children:a,side:s="right",size:n="md",footer:l,className:d=""}){if(!r)return null;const i={sm:"w-72",md:"w-96",lg:"w-[480px]"},h={sm:"h-48",md:"h-72",lg:"h-96"},
|
|
56
|
+
${D?m.active:`${m.base} ${T?"":m.hover}`}`,L=b?(r-1)*i+1:0,M=b?Math.min(r*i,b):0,W={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[g&&b!==void 0&&e.jsxs("span",{className:"text-muted-foreground",style:W,children:[L,"–",M," of ",b]}),l&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:W,children:"Rows per page:"}),e.jsx("select",{value:i,onChange:D=>h==null?void 0:h(Number(D.target.value)),disabled:f,className:"bg-input-background text-foreground border border-border rounded-[var(--radius-md)] px-2 py-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring/30",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},children:d.map(D=>e.jsx("option",{value:D,children:D},D))})]})]}),e.jsxs("nav",{className:`flex items-center ${u.gap}`,"aria-label":"Pagination",role:"navigation",children:[s&&e.jsx("button",{onClick:()=>N(1),disabled:f||r<=1,className:C(!1,f||r<=1),style:u.text,"aria-label":"First page",title:"First page",children:e.jsx(v.ChevronsLeft,{size:u.icon})}),n&&e.jsx("button",{onClick:()=>N(r-1),disabled:f||r<=1,className:C(!1,f||r<=1),style:u.text,"aria-label":"Previous page",children:y??e.jsx(v.ChevronLeft,{size:u.icon})}),$.map((D,T)=>D==="dots-left"||D==="dots-right"?e.jsx("span",{className:`inline-flex items-center justify-center text-muted-foreground ${u.btn}`,style:u.text,children:e.jsx(v.MoreHorizontal,{size:u.icon})},D):e.jsx("button",{onClick:()=>N(D),disabled:f,className:C(D===r,f),style:u.text,"aria-label":`Page ${D}`,"aria-current":D===r?"page":void 0,children:D},D)),n&&e.jsx("button",{onClick:()=>N(r+1),disabled:f||r>=t,className:C(!1,f||r>=t),style:u.text,"aria-label":"Next page",children:k??e.jsx(v.ChevronRight,{size:u.icon})}),s&&e.jsx("button",{onClick:()=>N(t),disabled:f||r>=t,className:C(!1,f||r>=t),style:u.text,"aria-label":"Last page",title:"Last page",children:e.jsx(v.ChevronsRight,{size:u.icon})})]}),p&&e.jsxs("span",{className:"text-muted-foreground",style:W,children:["Page ",r," of ",t]})]})}const Eo={sm:{input:"h-8 px-8",icon:14,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},md:{input:"h-10 px-9",icon:16,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},lg:{input:"h-12 px-10",icon:18,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}},To={default:"bg-card border border-border focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",outlined:"bg-transparent border-2 border-border focus-within:border-primary",filled:"bg-muted/50 border border-transparent focus-within:border-ring focus-within:bg-card"};function Io({value:r,onChange:t,onSearch:o,placeholder:a="Search...",size:s="md",variant:n="default",loading:l=!1,suggestions:d=[],onSuggestionSelect:i,clearable:h=!0,disabled:b=!1,autoFocus:x=!1,debounce:w=0,className:f=""}){const[p,g]=c.useState(""),[y,k]=c.useState(!1),[$,u]=c.useState(-1),m=r??p,N=c.useRef(null),C=c.useRef(null),L=c.useRef(void 0),M=Eo[s],W=c.useCallback(S=>{r===void 0&&g(S),t==null||t(S),w>0&&(clearTimeout(L.current),L.current=setTimeout(()=>o==null?void 0:o(S),w))},[r,t,o,w]),D=S=>{S.key==="Enter"?$>=0&&d[$]?(i==null||i(d[$]),k(!1)):o==null||o(m):S.key==="ArrowDown"?(S.preventDefault(),u(z=>Math.min(z+1,d.length-1))):S.key==="ArrowUp"?(S.preventDefault(),u(z=>Math.max(z-1,-1))):S.key==="Escape"&&k(!1)};c.useEffect(()=>{const S=z=>{C.current&&!C.current.contains(z.target)&&k(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),c.useEffect(()=>{k(d.length>0&&m.length>0),u(-1)},[d,m]);const T={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},A={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsxs("div",{ref:C,className:`relative ${f}`,children:[e.jsxs("div",{className:`relative rounded-[var(--radius-md)] transition-all ${To[n]} ${b?"opacity-50 pointer-events-none":""}`,children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",children:e.jsx(v.Search,{size:M.icon})}),e.jsx("input",{ref:N,type:"text",value:m,onChange:S=>W(S.target.value),onKeyDown:D,onFocus:()=>d.length>0&&m.length>0&&k(!0),placeholder:a,disabled:b,autoFocus:x,className:`w-full ${M.input} rounded-[var(--radius-md)] bg-transparent outline-none text-foreground placeholder:text-muted-foreground`,style:M.style}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[l&&e.jsx(v.Loader2,{size:M.icon,className:"animate-spin text-muted-foreground"}),h&&m&&!l&&e.jsx("button",{onClick:()=>{var S;W(""),(S=N.current)==null||S.focus()},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(v.X,{size:M.icon})})]})]}),y&&d.length>0&&e.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-popover border border-border rounded-[var(--radius-md)] shadow-elevation-sm z-50 overflow-hidden max-h-64 overflow-y-auto",style:{padding:"var(--Spacing--Spacing-sm)"},children:d.map((S,z)=>e.jsxs("button",{onClick:()=>{i==null||i(S),k(!1)},className:`w-full text-left flex items-center rounded-[var(--radius-sm)] transition-colors cursor-pointer ${z===$?"bg-[var(--Colors--Background--bg-brand-secondary)]":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)"},children:[S.icon&&e.jsx("span",{className:"text-muted-foreground flex-shrink-0",children:S.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-foreground block truncate",style:T,children:S.label}),S.description&&e.jsx("span",{className:"text-muted-foreground block truncate",style:{marginTop:"var(--Spacing--Spacing-xxs)",...A},children:S.description})]})]},S.id))})]})}const we={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function Or({columns:r,data:t,size:o="md",striped:a=!1,hoverable:s=!0,bordered:n=!1,selectable:l=!1,selectedRows:d,onSelectionChange:i,loading:h=!1,error:b,emptyMessage:x="No data available",stickyHeader:w=!1,flush:f=!1,className:p=""}){const[g,y]=c.useState(null),[k,$]=c.useState("asc"),[u,m]=c.useState(new Set),N=d??u,C=E=>{d||m(E),i==null||i(E)},L=c.useMemo(()=>g?[...t].sort((E,I)=>{const H=E[g],P=I[g];if(H==null)return 1;if(P==null)return-1;const _=typeof H=="string"?H.localeCompare(P):H-P;return k==="asc"?_:-_}):t,[t,g,k]),M=E=>{g===E?$(I=>I==="asc"?"desc":"asc"):(y(E),$("asc"))},W=t.length>0&&N.size===t.length,D=N.size>0&&!W,T=()=>{C(W?new Set:new Set(t.map((E,I)=>I)))},A=E=>{const I=new Set(N);I.has(E)?I.delete(E):I.add(E),C(I)},S={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},z={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};return e.jsx("div",{className:`${f?"":"rounded-[var(--radius-md)] border border-border"} overflow-hidden ${p}`,children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:w?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"border-b border-border",style:{backgroundColor:"color-mix(in srgb, var(--muted) 30%, var(--background) 70%)"},children:[l&&e.jsx("th",{className:`${we[o]} w-12`,children:e.jsx(Fe,{size:"sm",checked:W,indeterminate:D,onChange:T})}),r.map(E=>e.jsx("th",{className:`${we[o]} text-${E.align??"left"} text-foreground ${E.sortable?"cursor-pointer select-none hover:text-primary transition-colors":""} ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:{...z,width:E.width},onClick:()=>E.sortable&&M(E.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[E.header,E.sortable&&e.jsx("span",{className:"text-muted-foreground/50",children:g===E.key?k==="asc"?e.jsx(v.ChevronUp,{size:14}):e.jsx(v.ChevronDown,{size:14}):e.jsx(v.ChevronsUpDown,{size:12})})]})},E.key))]})}),e.jsx("tbody",{children:h?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${we[o]} text-center text-muted-foreground`,children:e.jsxs("div",{className:"flex items-center justify-center gap-2 py-8",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"}),e.jsx("span",{style:S,children:"Loading..."})]})})}):b?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${we[o]} text-center py-12`,children:e.jsx("div",{className:"flex flex-col items-center gap-2",children:e.jsx("span",{style:{...S,color:"var(--destructive)"},children:b})})})}):L.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${we[o]} text-center text-muted-foreground py-12`,children:e.jsx("span",{style:S,children:x})})}):L.map((E,I)=>{const H=N.has(I);return e.jsxs("tr",{className:`border-b border-border last:border-b-0 transition-colors ${H?"bg-primary/5":a&&I%2===1?"bg-muted/20":"bg-card"} ${s?"hover:bg-[var(--row-hover-bg)]":""}`,children:[l&&e.jsx("td",{className:`${we[o]} w-12`,children:e.jsx(Fe,{size:"sm",checked:H,onChange:()=>A(I)})}),r.map(P=>e.jsx("td",{className:`${we[o]} text-${P.align??"left"} text-foreground ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:S,children:P.render?P.render(E[P.key],E,I):E[P.key]},P.key))]},I)})})]})})})}const Bo={sm:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)",padding:"6px 12px"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",padding:"8px 16px"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-p)",padding:"10px 20px"}};function _o({tabs:r=[],variant:t="default",size:o="md",defaultTab:a,activeTab:s,onChange:n,fullWidth:l=!1,className:d=""}){var $,u;const[i,h]=c.useState(a??(($=r[0])==null?void 0:$.id)??""),b=s??i,x=c.useRef(null),[w,f]=c.useState({left:0,width:0}),p=m=>{s||h(m),n==null||n(m)};c.useEffect(()=>{if(t!=="underline"&&t!=="default")return;const m=x.current;if(!m)return;const N=m.querySelector(`[data-tab-id="${b}"]`);N&&f({left:N.offsetLeft,width:N.offsetWidth})},[b,t]);const g=(u=r.find(m=>m.id===b))==null?void 0:u.content,y=(()=>{switch(t){case"bordered":return"border border-border rounded-[var(--radius)] bg-muted/30 p-1 gap-1";case"pills":return"gap-1.5";case"underline":return"border-b border-border relative";default:return"border-b border-border relative"}})(),k=(m,N)=>{const C="relative flex items-center gap-1.5 transition-all cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring whitespace-nowrap";if(N)return`${C} opacity-40 !cursor-not-allowed`;switch(t){case"bordered":return`${C} rounded-[var(--radius-sm)] ${m?"bg-card text-foreground shadow-elevation-sm":"text-muted-foreground hover:text-foreground hover:bg-card/50"}`;case"pills":return`${C} rounded-[var(--radius)] ${m?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`;case"underline":return`${C} ${m?"text-primary":"text-muted-foreground hover:text-foreground"}`;default:return`${C} ${m?"text-primary":"text-muted-foreground hover:text-foreground"}`}};return e.jsxs("div",{className:d,children:[e.jsxs("div",{ref:x,className:`flex ${l?"":"inline-flex"} ${y}`,role:"tablist",children:[(t==="default"||t==="underline")&&e.jsx("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-all duration-200 rounded-full",style:{left:w.left,width:w.width}}),r.map(m=>{const N=b===m.id;return e.jsxs("button",{"data-tab-id":m.id,role:"tab","aria-selected":N,disabled:m.disabled,onClick:()=>!m.disabled&&p(m.id),className:`${k(N,!!m.disabled)} ${l?"flex-1 justify-center":""}`,style:Bo[o],children:[m.icon&&e.jsx("span",{className:"flex-shrink-0",children:m.icon}),e.jsx("span",{children:m.label}),m.badge!==void 0&&e.jsx("span",{className:`ml-1 rounded-full min-w-[18px] text-center inline-flex items-center justify-center ${N&&t==="pills"?"bg-primary-foreground/20 text-primary-foreground":"bg-muted text-muted-foreground"}`,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-caption)",lineHeight:"1",padding:"1px 6px"},children:m.badge})]},m.id)})]}),g&&e.jsx("div",{className:"pt-4",role:"tabpanel",children:g})]})}const Ho={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Po={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Re({title:r,children:t,open:o,onToggle:a,icon:s,disabled:n=!1}){return e.jsxs("div",{className:`border-b border-border last:border-b-0 ${n?"opacity-50":""}`,children:[e.jsxs("button",{onClick:n?void 0:a,disabled:n,className:`w-full flex items-center gap-3 px-4 py-3 text-left transition-colors ${n?"cursor-not-allowed":"hover:bg-muted/20 cursor-pointer"}`,children:[s&&e.jsx("span",{className:"text-primary flex-shrink-0",children:s}),e.jsx("span",{className:"flex-1 text-foreground",style:Ho,children:r}),e.jsx(v.ChevronDown,{size:16,className:`text-muted-foreground transition-transform ${o?"rotate-180":""}`})]}),e.jsx("div",{className:`overflow-hidden transition-all ${o?"max-h-96 opacity-100":"max-h-0 opacity-0"}`,children:e.jsx("div",{className:"px-4 pb-4 text-muted-foreground",style:Po,children:t})})]})}function Yr({type:r="single",items:t,defaultOpen:o,value:a,onChange:s,className:n=""}){const[l,d]=c.useState(typeof o=="string"?o:null),[i,h]=c.useState(Array.isArray(o)?new Set(o):new Set),b=a!==void 0,x=f=>b?r==="single"?a===f:Array.isArray(a)&&a.includes(f):r==="single"?l===f:i.has(f),w=f=>{if(r==="single"){const p=(b?a===f:l===f)?null:f;b||d(p),s==null||s(p)}else if(b){const p=Array.isArray(a)?a:[],g=p.includes(f)?p.filter(y=>y!==f):[...p,f];s==null||s(g)}else h(p=>{const g=new Set(p);return g.has(f)?g.delete(f):g.add(f),g})};return e.jsx("div",{className:`rounded-[var(--radius)] border border-border overflow-hidden ${n}`,children:t.map(f=>e.jsx(Re,{title:f.title,open:x(f.id),onToggle:()=>w(f.id),icon:f.icon,disabled:f.disabled,children:f.content},f.id))})}Yr.displayName="Accordion",Re.displayName="AccordionItem";const Gr=["bg-primary","bg-chart-2","bg-chart-5","bg-destructive","bg-secondary"],Oo={xs:{box:"w-6 h-6",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},sm:{box:"w-8 h-8",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},md:{box:"w-10 h-10",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},lg:{box:"w-14 h-14",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}},xl:{box:"w-20 h-20",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}}},Yo={xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"},Go={online:"bg-chart-2",offline:"bg-secondary",busy:"bg-destructive",away:"bg-chart-5"},Uo={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Ur({src:r,name:t,size:o="md",status:a,className:s=""}){const n=Oo[o],l=t?t.split(" ").map(i=>i[0]).join("").slice(0,2).toUpperCase():"?",d=t?Gr[t.length%Gr.length]:"bg-muted";return e.jsxs("div",{className:`relative inline-flex ${s}`,children:[r?e.jsx("img",{src:r,alt:t||"avatar",className:`${n.box} rounded-full object-cover`}):e.jsx("div",{className:`${n.box} rounded-full ${d} text-primary-foreground flex items-center justify-center`,style:n.font,children:l}),a&&e.jsx("span",{className:`absolute bottom-0 right-0 ${Yo[o]} ${Go[a]} rounded-full border-2 border-card`})]})}function Xr({children:r,max:t,className:o=""}){const a=c.Children.toArray(r),s=t?a.slice(0,t):a,n=t&&a.length>t?a.length-t:0;return e.jsxs("div",{className:`flex -space-x-2 ${o}`,children:[s.map((l,d)=>e.jsx("div",{className:"relative",style:{zIndex:s.length-d},children:l},d)),n>0&&e.jsxs("div",{className:"relative w-10 h-10 rounded-full bg-muted text-foreground flex items-center justify-center border-2 border-card",style:{...Uo,zIndex:0},children:["+",n]})]})}Ur.displayName="Avatar",Xr.displayName="AvatarGroup";const Xo={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}};function Ko({items:r,separator:t="chevron",size:o="md",maxItems:a}){const s=t==="slash"?e.jsx(v.Slash,{size:12,className:"text-muted-foreground"}):t==="dot"?e.jsx(v.Dot,{size:16,className:"text-muted-foreground"}):e.jsx(v.ChevronRight,{size:12,className:"text-muted-foreground"}),n=o==="sm"?"gap-1":o==="lg"?"gap-2.5":"gap-1.5",l=Xo[o];let d=r;if(a&&r.length>a){const i=r.slice(0,1),h=r.slice(-(a-1));d=[...i,{label:"…"},...h]}return e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsx("ol",{className:`flex items-center flex-wrap ${n}`,children:d.map((i,h)=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[h>0&&e.jsx("span",{className:"mx-0.5",children:s}),i.label==="…"?e.jsx("span",{className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-accent cursor-pointer",children:e.jsx(v.MoreHorizontal,{size:14})}):h===d.length-1?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground",style:{...l,fontWeight:"var(--weight-button)"},children:[i.icon,i.label]}):e.jsxs("a",{href:i.href||"#",onClick:b=>b.preventDefault(),className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground transition-colors",style:l,children:[i.icon,i.label]})]},h))})})}const Zo={none:"",sm:"shadow-elevation-sm",md:"shadow-elevation-sm",lg:"shadow-elevation-sm"};function Kr({children:r,className:t,hover:o,elevation:a="none"}){return e.jsx("div",{className:`rounded-[var(--radius-md)] border border-border bg-card overflow-hidden ${Zo[a]??""} ${o?"hover:border-primary/40 hover:shadow-elevation-sm transition-all cursor-pointer":""} ${t??""}`,children:r})}Kr.displayName="Card";function Zr({children:r,action:t}){return e.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[e.jsx("div",{children:r}),t]})}Zr.displayName="CardHeader";function qr({children:r}){return e.jsx("div",{className:"px-5 py-4",children:r})}qr.displayName="CardBody";function Jr({children:r}){return e.jsx("div",{className:"px-5 py-3 border-t border-border bg-muted/10 flex items-center gap-2",children:r})}Jr.displayName="CardFooter";const qo=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#0ea5e9","#e11d48","#991b1b","#9a3412","#854d0e","#166534","#155e75","#1e40af","#0369a1","#9f1239","#fca5a5","#fdba74","#fde047","#86efac","#67e8f9","#93c5fd","#bae6fd","#fecdd3"];function Jo(r){const t=parseInt(r.slice(1,3),16),o=parseInt(r.slice(3,5),16),a=parseInt(r.slice(5,7),16);return`rgb(${t}, ${o}, ${a})`}function Qo(r){const t=parseInt(r.slice(1,3),16)/255,o=parseInt(r.slice(3,5),16)/255,a=parseInt(r.slice(5,7),16)/255,s=Math.max(t,o,a),n=Math.min(t,o,a),l=(s+n)/2;if(s===n)return`hsl(0, 0%, ${Math.round(l*100)}%)`;const d=s-n,i=l>.5?d/(2-s-n):d/(s+n);let h=0;return s===t?h=((o-a)/d+(o<a?6:0))/6:s===o?h=((a-t)/d+2)/6:h=((t-o)/d+4)/6,`hsl(${Math.round(h*360)}, ${Math.round(i*100)}%, ${Math.round(l*100)}%)`}const Vo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ro={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Qr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ea({value:r,onChange:t,label:o,presets:a,showInput:s=!0,showFormats:n,size:l="md",disabled:d=!1}){const[i,h]=c.useState(!1),b=c.useRef(null),x=l==="sm"?"w-5 h-5":l==="lg"?"w-8 h-8":"w-6 h-6",w=a||qo,f=p=>{navigator.clipboard.writeText(p).then(()=>{h(!0),setTimeout(()=>h(!1),1500)})};return e.jsxs("div",{className:`space-y-3 ${d?"opacity-50 pointer-events-none":""}`,children:[o&&e.jsx("label",{className:"block text-foreground",style:Vo,children:o}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-md)] border border-border cursor-pointer overflow-hidden",style:{backgroundColor:r},onClick:()=>{var p;return(p=b.current)==null?void 0:p.click()}}),e.jsx("input",{ref:b,type:"color",value:r,onChange:p=>t(p.target.value),className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full"})]}),s&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:r,onChange:p=>{(/^#[0-9a-fA-F]{0,6}$/.test(p.target.value)||p.target.value==="#")&&t(p.target.value)},className:"w-24 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-background text-foreground outline-none focus:border-primary",style:Qr,maxLength:7}),e.jsx("button",{onClick:()=>f(r),className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer",children:i?e.jsx(v.Check,{size:14,className:"text-chart-2"}):e.jsx(v.Copy,{size:14})})]})]}),w.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.map(p=>e.jsx("button",{onClick:()=>t(p),className:`${x} rounded-[var(--radius-sm)] border-2 transition-transform hover:scale-110 cursor-pointer
|
|
57
|
+
${r===p?"border-foreground ring-1 ring-foreground/20":"border-transparent"}`,style:{backgroundColor:p},title:p},p))}),n&&e.jsx("div",{className:"space-y-1",children:[{label:"HEX",val:r.toUpperCase()},{label:"RGB",val:Jo(r)},{label:"HSL",val:Qo(r)}].map(p=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-8 text-muted-foreground",style:Ro,children:p.label}),e.jsx("code",{className:"text-foreground",style:Qr,children:p.val}),e.jsx("button",{onClick:()=>f(p.val),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.Copy,{size:12})})]},p.label))})]})}const ra={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Vr({label:r,orientation:t="horizontal",dashed:o,spacing:a="md",className:s=""}){const n={sm:"my-2",md:"my-4",lg:"my-8"},l=o?"border-dashed":"border-solid";return t==="vertical"?e.jsx("div",{className:`inline-block h-full min-h-[24px] border-l border-border ${l} mx-3 ${s}`}):r?e.jsxs("div",{className:`flex items-center gap-3 ${n[a]} ${s}`,children:[e.jsx("div",{className:`flex-1 border-t border-border ${l}`}),e.jsx("span",{className:"text-muted-foreground flex-shrink-0",style:ra,children:r}),e.jsx("div",{className:`flex-1 border-t border-border ${l}`})]}):e.jsx("hr",{className:`border-t border-border ${l} ${n[a]} ${s}`})}Vr.displayName="Divider";const ta={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Rr({open:r,onClose:t,title:o,children:a,side:s="right",size:n="md",footer:l,className:d=""}){if(!r)return null;const i={sm:"w-72",md:"w-96",lg:"w-[480px]"},h={sm:"h-48",md:"h-72",lg:"h-96"},b={right:`top-0 right-0 h-full ${i[n]} animate-[slideRight_0.2s_ease]`,left:`top-0 left-0 h-full ${i[n]} animate-[slideLeft_0.2s_ease]`,top:`top-0 left-0 w-full ${h[n]} animate-[slideTop_0.2s_ease]`,bottom:`bottom-0 left-0 w-full ${h[n]} animate-[slideBottom_0.2s_ease]`};return e.jsxs("div",{className:"fixed inset-0 z-50",children:[e.jsx("div",{className:"absolute inset-0 bg-foreground/20",onClick:t}),e.jsxs("div",{className:`absolute bg-card border border-border shadow-elevation-sm flex flex-col ${b[s]} ${d}`,children:[o&&e.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between flex-shrink-0",children:[e.jsx("span",{className:"text-foreground",style:ta,children:o}),e.jsx("button",{onClick:t,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:a}),l&&e.jsx("div",{className:"px-5 py-3 border-t border-border flex items-center gap-2 flex-shrink-0",children:l})]}),e.jsx("style",{children:`
|
|
58
58
|
@keyframes slideRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
|
|
59
59
|
@keyframes slideLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
|
|
60
60
|
@keyframes slideTop { from { transform: translateY(-100%); } to { transform: translateY(0); } }
|
|
61
61
|
@keyframes slideBottom { from { transform: translateY(100%); } to { transform: translateY(0); } }
|
|
62
|
-
`})]})}Rr.displayName="Drawer";const oa={sm:{trigger:"h-9 px-[var(--Spacing--Spacing-xl)] gap-[var(--Spacing--Spacing-sm)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-sm) var(--Spacing--Spacing-xl)"},textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},icon:14,avatarSize:20},md:{trigger:"h-11 px-[var(--Spacing--Spacing-2xl)] gap-[var(--Spacing--Spacing-lg)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)"},textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16,avatarSize:24},lg:{trigger:"h-13 px-[var(--Spacing--Spacing-3xl)] gap-[var(--Spacing--Spacing-xl)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-lg) var(--Spacing--Spacing-3xl)"},textStyle:{fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:18,avatarSize:28}},aa={default:{base:"border border-border bg-input-background",hover:"hover:border-foreground/30",focus:"ring-2 ring-ring/20 border-ring"},outlined:{base:"border-2 border-border bg-transparent",hover:"hover:border-foreground/40",focus:"ring-2 ring-ring/20 border-ring"},filled:{base:"border border-transparent bg-muted",hover:"hover:bg-muted/80",focus:"ring-2 ring-ring/20 border-ring bg-input-background"},ghost:{base:"border border-transparent bg-transparent",hover:"hover:bg-muted/50",focus:"ring-2 ring-ring/20 bg-input-background"}},sa={default:"",error:"!border-destructive ring-destructive/20",success:"!border-chart-2 ring-chart-2/20",warning:"!border-chart-5 ring-chart-5/20"},et=c.forwardRef(({options:r,value:t,defaultValue:o,onChange:a,placeholder:s="Select an option…",label:n,helperText:l,errorMessage:d,successMessage:i,size:h="md",variant:
|
|
62
|
+
`})]})}Rr.displayName="Drawer";const oa={sm:{trigger:"h-9 px-[var(--Spacing--Spacing-xl)] gap-[var(--Spacing--Spacing-sm)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-sm) var(--Spacing--Spacing-xl)"},textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},icon:14,avatarSize:20},md:{trigger:"h-11 px-[var(--Spacing--Spacing-2xl)] gap-[var(--Spacing--Spacing-lg)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)"},textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16,avatarSize:24},lg:{trigger:"h-13 px-[var(--Spacing--Spacing-3xl)] gap-[var(--Spacing--Spacing-xl)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-lg) var(--Spacing--Spacing-3xl)"},textStyle:{fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:18,avatarSize:28}},aa={default:{base:"border border-border bg-input-background",hover:"hover:border-foreground/30",focus:"ring-2 ring-ring/20 border-ring"},outlined:{base:"border-2 border-border bg-transparent",hover:"hover:border-foreground/40",focus:"ring-2 ring-ring/20 border-ring"},filled:{base:"border border-transparent bg-muted",hover:"hover:bg-muted/80",focus:"ring-2 ring-ring/20 border-ring bg-input-background"},ghost:{base:"border border-transparent bg-transparent",hover:"hover:bg-muted/50",focus:"ring-2 ring-ring/20 bg-input-background"}},sa={default:"",error:"!border-destructive ring-destructive/20",success:"!border-chart-2 ring-chart-2/20",warning:"!border-chart-5 ring-chart-5/20"},et=c.forwardRef(({options:r,value:t,defaultValue:o,onChange:a,placeholder:s="Select an option…",label:n,helperText:l,errorMessage:d,successMessage:i,size:h="md",variant:b="default",state:x="default",disabled:w=!1,loading:f=!1,searchable:p=!1,clearable:g=!1,multiple:y=!1,maxSelections:k,grouped:$=!1,required:u=!1,id:m,className:N="",showSelectAll:C=!1,tagLimit:L,creatable:M=!1,onCreateOption:W,createLabel:D='Create "{query}"',emptyState:T,footer:A,onSearch:S,searchDebounce:z=300,searchLoading:E=!1,renderOption:I},H)=>{const[P,_]=c.useState(!1),[Q,O]=c.useState(""),[Z,oe]=c.useState(-1),[X,re]=c.useState(o??(y?[]:"")),U=t??X,B=c.useRef(null),V=c.useRef(null),J=c.useRef(null),le=c.useRef(null),[me,Ie]=c.useState({top:0,left:0,width:0}),q=oa[h],xe=aa[b];c.useEffect(()=>{if(!P||!B.current)return;const j=()=>{const G=B.current.getBoundingClientRect();Ie({top:G.bottom+4,left:G.left,width:G.width})};return j(),window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[P]);const Ne=c.useCallback(j=>{O(j),S&&(le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{S(j)},z))},[S,z]);c.useEffect(()=>()=>{le.current&&clearTimeout(le.current)},[]);const ue=c.useMemo(()=>!Q||S?r:r.filter(j=>{var G;return j.label.toLowerCase().includes(Q.toLowerCase())||((G=j.description)==null?void 0:G.toLowerCase().includes(Q.toLowerCase()))}),[r,Q,S]),Me=c.useMemo(()=>{if(!$)return null;const j={};return ue.forEach(G=>{const K=G.group||"Other";j[K]||(j[K]=[]),j[K].push(G)}),j},[ue,$]),Ke=c.useMemo(()=>{var j;return y&&Array.isArray(U)?U.map(G=>{var K;return(K=r.find(Ae=>Ae.value===G))==null?void 0:K.label}).filter(Boolean):(j=r.find(G=>G.value===U))!=null&&j.label?[r.find(G=>G.value===U).label]:[]},[U,r,y]),$r=c.useCallback(j=>y&&Array.isArray(U)?U.includes(j):U===j,[U,y]),Se=c.useCallback(j=>{if(y){const G=Array.isArray(U)?[...U]:[],K=G.indexOf(j);if(K>-1)G.splice(K,1);else{if(k&&G.length>=k)return;G.push(j)}re(G),a==null||a(G)}else re(j),a==null||a(j),_(!1);O("")},[U,y,k,a]),ae=c.useMemo(()=>ue.filter(j=>!j.disabled).map(j=>j.value),[ue]),de=c.useMemo(()=>!y||!Array.isArray(U)?!1:ae.length>0&&ae.every(j=>U.includes(j)),[y,U,ae]),Y=c.useMemo(()=>!y||!Array.isArray(U)?!1:ae.some(j=>U.includes(j))&&!de,[y,U,ae,de]),ee=c.useCallback(()=>{if(y)if(de){const j=Array.isArray(U)?U.filter(G=>!ae.includes(G)):[];re(j),a==null||a(j)}else{const j=Array.isArray(U)?[...U]:[];for(const G of ae)if(!j.includes(G)){if(k&&j.length>=k)break;j.push(G)}re(j),a==null||a(j)}},[y,de,U,ae,k,a]),be=c.useCallback(()=>{Q.trim()&&(W==null||W(Q.trim()),O(""))},[Q,W]),te=c.useMemo(()=>!M||!Q.trim()?!1:!r.some(j=>j.label.toLowerCase()===Q.toLowerCase()),[M,Q,r]),ke=c.useCallback(j=>{j.stopPropagation();const G=y?[]:"";re(G),a==null||a(G)},[y,a]),ce=$?Object.values(Me||{}).flat():ue,$e=c.useCallback(j=>{var G;if(!(w||f))switch(j.key){case"ArrowDown":j.preventDefault(),P?oe(K=>K<ce.length-1?K+1:0):_(!0);break;case"ArrowUp":j.preventDefault(),oe(K=>K>0?K-1:ce.length-1);break;case"Enter":case" ":if(j.preventDefault(),P&&Z>=0){const K=ce[Z];K&&!K.disabled&&Se(K.value)}else _(!0);break;case"Escape":_(!1),(G=B.current)==null||G.focus();break}},[w,f,P,Z,ce,Se]);c.useEffect(()=>{const j=G=>{const K=G.target;B.current&&!B.current.contains(K)&&V.current&&!V.current.contains(K)&&(_(!1),O(""))};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]),c.useEffect(()=>{P&&p&&setTimeout(()=>{var j;return(j=J.current)==null?void 0:j.focus()},50),P&&oe(-1)},[P,p]);const ze=y?Array.isArray(U)&&U.length>0:!!U,De=d?"error":x,yn=()=>{const j=Ke,G=L&&L>0?L:j.length,K=j.slice(0,G),Ae=j.length-K.length;return e.jsxs("span",{className:"flex flex-wrap gap-1",children:[K.map(zr=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-[var(--radius-sm)] bg-[var(--Colors--Background--bg-brand-secondary)] text-[var(--Colors--Text--text-brand-primary)]",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[zr,e.jsx(v.X,{size:10,className:"cursor-pointer hover:text-destructive transition-colors",onClick:wn=>{wn.stopPropagation();const co=r.find(Nn=>Nn.label===zr);co&&Se(co.value)}})]},zr)),Ae>0&&e.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-[var(--radius-sm)] bg-muted text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:["+",Ae," more"]})]})},lo=(j,G)=>{const K=$r(j.value);return I?e.jsx("button",{type:"button",role:"option","aria-selected":K,disabled:j.disabled,className:`w-full ${q.option} transition-colors cursor-pointer
|
|
63
63
|
${K?"bg-[var(--Colors--Background--bg-brand-secondary)]":""}
|
|
64
64
|
${Z===G&&!K?"bg-[var(--Colors--Background--bg-primary_hover)]":""}
|
|
65
65
|
${j.disabled?"opacity-40 cursor-not-allowed":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}
|
|
@@ -67,29 +67,29 @@
|
|
|
67
67
|
${K?"bg-[var(--Colors--Background--bg-brand-secondary)] text-[var(--Colors--Text--text-brand-primary)]":""}
|
|
68
68
|
${Z===G&&!K?"bg-[var(--Colors--Background--bg-primary_hover)]":""}
|
|
69
69
|
${j.disabled?"opacity-40 cursor-not-allowed":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}
|
|
70
|
-
`,style:{...q.optionStyle,...q.textStyle},onClick:()=>!j.disabled&&Se(j.value),onMouseEnter:()=>oe(G),children:[
|
|
70
|
+
`,style:{...q.optionStyle,...q.textStyle},onClick:()=>!j.disabled&&Se(j.value),onMouseEnter:()=>oe(G),children:[y&&e.jsx("span",{className:`flex-shrink-0 w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center transition-colors
|
|
71
71
|
${K?"bg-primary border-primary":"border-border"}
|
|
72
|
-
`,children:K&&e.jsx(v.Check,{size:10,className:"text-primary-foreground"})}),j.avatar&&e.jsx("img",{src:j.avatar,alt:"",className:"flex-shrink-0 rounded-full object-cover",style:{width:q.avatarSize,height:q.avatarSize}}),j.icon&&e.jsx("span",{className:"flex-shrink-0",children:j.icon}),e.jsxs("span",{className:"flex-1 text-left",children:[e.jsx("span",{className:"block",children:j.label}),j.description&&e.jsx("span",{className:"block text-muted-foreground",style:{marginTop:"var(--Spacing--Spacing-xxs)",...q.descStyle},children:j.description})]}),!
|
|
72
|
+
`,children:K&&e.jsx(v.Check,{size:10,className:"text-primary-foreground"})}),j.avatar&&e.jsx("img",{src:j.avatar,alt:"",className:"flex-shrink-0 rounded-full object-cover",style:{width:q.avatarSize,height:q.avatarSize}}),j.icon&&e.jsx("span",{className:"flex-shrink-0",children:j.icon}),e.jsxs("span",{className:"flex-1 text-left",children:[e.jsx("span",{className:"block",children:j.label}),j.description&&e.jsx("span",{className:"block text-muted-foreground",style:{marginTop:"var(--Spacing--Spacing-xxs)",...q.descStyle},children:j.description})]}),!y&&K&&e.jsx(v.Check,{size:q.icon,className:"text-primary flex-shrink-0"})]},j.value)};let io=0;return e.jsxs("div",{ref:H,className:`relative w-full ${N}`,id:m,children:[n&&e.jsxs("label",{className:"block mb-1.5 text-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[n,u&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("button",{ref:B,type:"button",role:"combobox","aria-expanded":P,"aria-haspopup":"listbox",disabled:w||f,onClick:()=>!w&&!f&&_(!P),onKeyDown:$e,className:`w-full flex items-center rounded-[var(--radius-md)] transition-all duration-150 ${q.trigger}
|
|
73
73
|
${xe.base}
|
|
74
|
-
${!
|
|
74
|
+
${!w&&!f?xe.hover:""}
|
|
75
75
|
${P?xe.focus:""}
|
|
76
|
-
${
|
|
76
|
+
${w?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
77
77
|
${f?"opacity-70 cursor-wait":""}
|
|
78
78
|
${sa[De]}
|
|
79
|
-
`,style:q.textStyle,children:[f?e.jsx(v.Loader2,{size:q.icon,className:"animate-spin text-muted-foreground"}):null,e.jsx("span",{className:`flex-1 text-left min-w-0 ${
|
|
79
|
+
`,style:q.textStyle,children:[f?e.jsx(v.Loader2,{size:q.icon,className:"animate-spin text-muted-foreground"}):null,e.jsx("span",{className:`flex-1 text-left min-w-0 ${y?"":"truncate"} ${ze?"text-foreground":"text-muted-foreground"}`,children:ze?y?yn():Ke[0]:s}),g&&ze&&!w&&e.jsx(v.X,{size:q.icon,className:"flex-shrink-0 text-muted-foreground hover:text-foreground cursor-pointer transition-colors",onClick:ke}),e.jsx(v.ChevronDown,{size:q.icon,className:`flex-shrink-0 text-muted-foreground transition-transform duration-200 ${P?"rotate-180":""}`})]}),P&&Ce.createPortal(e.jsxs("div",{ref:V,role:"listbox",className:"fixed z-[9999] bg-popover border border-border rounded-[var(--radius)] shadow-elevation-sm overflow-hidden",style:{top:me.top,left:me.left,width:me.width||"auto"},children:[p&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(v.Search,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{ref:J,type:"text",value:Q,onChange:j=>Ne(j.target.value),placeholder:"Search\\u2026",className:"w-full pl-8 pr-3 py-1.5 bg-background border border-border rounded-[var(--radius-sm)] outline-none placeholder:text-muted-foreground focus:border-ring focus:ring-1 focus:ring-ring/20 transition-colors",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},onKeyDown:$e})]})}),y&&C&&ue.length>0&&e.jsxs("button",{type:"button",className:`w-full flex items-center gap-[var(--Spacing--Spacing-lg)] ${q.option} border-b border-border transition-colors hover:bg-[var(--Colors--Background--bg-primary_hover)] cursor-pointer`,style:{...q.optionStyle,...q.textStyle},onClick:ee,children:[e.jsxs("span",{className:`flex-shrink-0 w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center transition-colors
|
|
80
80
|
${de?"bg-primary border-primary":Y?"bg-primary/50 border-primary":"border-border"}
|
|
81
|
-
`,children:[de&&e.jsx(v.Check,{size:10,className:"text-primary-foreground"}),Y&&!de&&e.jsx("span",{className:"w-2 h-0.5 bg-primary-foreground rounded-full"})]}),e.jsx("span",{className:"text-foreground",children:de?"Deselect All":"Select All"}),e.jsxs("span",{className:"ml-auto text-muted-foreground",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:[Array.isArray(U)?U.length:0,"/",ue.filter(j=>!j.disabled).length]})]}),e.jsxs("div",{className:"max-h-60 overflow-y-auto p-1",children:[E?e.jsxs("div",{className:"flex items-center justify-center py-6 gap-2 text-muted-foreground",children:[e.jsx(v.Loader2,{size:16,className:"animate-spin"}),e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:"Searching\\u2026"})]}):ue.length===0&&!te?T?e.jsx("div",{className:"py-4 px-3",children:T}):e.jsxs("div",{className:"text-center py-6 text-muted-foreground flex flex-col items-center gap-2",children:[e.jsx(v.Inbox,{size:24,className:"opacity-40"}),e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:"No options found"})]})
|
|
82
|
-
${a?"opacity-50 pointer-events-none":""} ${f?"border-primary bg-primary/5":"border-border hover:border-primary/40"}`,children:
|
|
81
|
+
`,children:[de&&e.jsx(v.Check,{size:10,className:"text-primary-foreground"}),Y&&!de&&e.jsx("span",{className:"w-2 h-0.5 bg-primary-foreground rounded-full"})]}),e.jsx("span",{className:"text-foreground",children:de?"Deselect All":"Select All"}),e.jsxs("span",{className:"ml-auto text-muted-foreground",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:[Array.isArray(U)?U.length:0,"/",ue.filter(j=>!j.disabled).length]})]}),e.jsxs("div",{className:"max-h-60 overflow-y-auto p-1",children:[E?e.jsxs("div",{className:"flex items-center justify-center py-6 gap-2 text-muted-foreground",children:[e.jsx(v.Loader2,{size:16,className:"animate-spin"}),e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:"Searching\\u2026"})]}):ue.length===0&&!te?T?e.jsx("div",{className:"py-4 px-3",children:T}):e.jsxs("div",{className:"text-center py-6 text-muted-foreground flex flex-col items-center gap-2",children:[e.jsx(v.Inbox,{size:24,className:"opacity-40"}),e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:"No options found"})]}):$&&Me?Object.entries(Me).map(([j,G])=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1.5 text-muted-foreground",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},children:j}),G.map(K=>{const Ae=lo(K,io);return io++,Ae})]},j)):ue.map((j,G)=>lo(j,G)),te&&e.jsxs("button",{type:"button",className:`w-full flex items-center gap-[var(--Spacing--Spacing-lg)] ${q.option} text-primary transition-colors hover:bg-[var(--Colors--Background--bg-primary_hover)] cursor-pointer`,style:{...q.optionStyle,...q.textStyle},onClick:be,children:[e.jsx(v.Plus,{size:q.icon,className:"flex-shrink-0"}),e.jsx("span",{children:D.replace("{query}",Q.trim())})]})]}),(A||y&&k)&&e.jsxs("div",{className:"border-t border-border",children:[y&&k&&e.jsxs("div",{className:"px-3 py-2 text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[Array.isArray(U)?U.length:0," / ",k," selected"]}),A&&e.jsx("div",{className:"px-3 py-2",children:A})]})]}),document.body),(l||d||i)&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[De==="error"&&e.jsx(v.AlertCircle,{size:12,className:"text-destructive flex-shrink-0"}),e.jsx("span",{className:`${De==="error"?"text-destructive":De==="success"?"text-chart-2":"text-muted-foreground"}`,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:d||i||l})]})]})});et.displayName="Dropdown";const na={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},rt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function la({icon:r,title:t,description:o,action:a,secondaryAction:s,size:n="md"}){const l=n==="sm"?"w-10 h-10":n==="lg"?"w-16 h-16":"w-12 h-12",d=n==="sm"?"py-6 px-4":n==="lg"?"py-14 px-8":"py-10 px-6";return e.jsxs("div",{className:`flex flex-col items-center text-center ${d}`,children:[r&&e.jsx("div",{className:`${l} rounded-full bg-muted flex items-center justify-center mb-4`,children:e.jsx("span",{className:"text-muted-foreground",children:r})}),e.jsx("h4",{className:"text-foreground",children:t}),o&&e.jsx("p",{className:"text-muted-foreground mt-1.5 max-w-sm",style:na,children:o}),(a||s)&&e.jsxs("div",{className:"flex items-center gap-3 mt-5",children:[a&&e.jsxs("button",{onClick:a.onClick,className:"inline-flex items-center gap-2 px-4 py-2 rounded-[var(--radius-md)] bg-primary text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer",style:rt,children:[a.icon,a.label]}),s&&e.jsx("button",{onClick:s.onClick,className:"inline-flex items-center gap-2 px-4 py-2 rounded-[var(--radius-md)] border border-border text-foreground hover:bg-accent transition-colors cursor-pointer",style:rt,children:s.label})]})]})}const ia={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},He={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},tt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},da={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function ot(r){return r<1024?r+" B":r<1024*1024?(r/1024).toFixed(1)+" KB":(r/(1024*1024)).toFixed(1)+" MB"}function ca(r){return r.startsWith("image/")?e.jsx(v.Image,{size:16,className:"text-chart-2"}):r.startsWith("video/")?e.jsx(v.Film,{size:16,className:"text-chart-5"}):r.includes("pdf")||r.includes("document")?e.jsx(v.FileText,{size:16,className:"text-destructive"}):e.jsx(v.File,{size:16,className:"text-muted-foreground"})}function at({files:r,onRemove:t}){return e.jsx("div",{className:"space-y-2",children:r.map(o=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-[var(--radius-md)] border border-border bg-card",children:[ca(o.type),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-foreground truncate",style:ia,children:o.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:tt,children:ot(o.size)}),o.status==="uploading"&&e.jsx("div",{className:"flex-1 h-1 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${o.progress}%`}})}),o.status==="done"&&e.jsx(v.CheckCircle2,{size:12,className:"text-chart-2"})]})]}),e.jsx("button",{onClick:()=>t(o.id),className:"text-muted-foreground hover:text-destructive cursor-pointer",children:e.jsx(v.X,{size:14})})]},o.id))})}function fa({accept:r,maxSize:t,multiple:o,disabled:a,variant:s="dropzone",label:n,description:l,value:d,onChange:i,onUpload:h,onRemove:b}){const[x,w]=c.useState([]),[f,p]=c.useState(!1),g=c.useRef(null),y=d??x,k=u=>{if(!u)return;const m=Array.from(u);if(i&&i(m),d===void 0){const N=m.map(C=>({id:Math.random().toString(36).slice(2),name:C.name,size:C.size,type:C.type,progress:0,status:"uploading"}));w(C=>[...C,...N]),N.forEach(C=>{let L=0;const M=setInterval(()=>{L+=Math.random()*30+10,L>=100&&(L=100,clearInterval(M)),w(W=>W.map(D=>D.id===C.id?{...D,progress:Math.min(L,100),status:L>=100?"done":"uploading"}:D)),L>=100&&h&&h({...C,progress:100,status:"done"})},300)})}},$=u=>{b&&b(u),d===void 0&&w(m=>m.filter(N=>N.id!==u))};return s==="button"?e.jsxs("div",{className:"space-y-3",children:[n&&e.jsx("label",{className:"block text-foreground",style:He,children:n}),e.jsxs("button",{onClick:()=>{var u;return(u=g.current)==null?void 0:u.click()},disabled:a,className:`inline-flex items-center gap-2 px-4 py-2 rounded-[var(--radius-md)] border border-border bg-background text-foreground hover:bg-accent transition-colors cursor-pointer ${a?"opacity-50 pointer-events-none":""}`,style:da,children:[e.jsx(v.Upload,{size:14})," Choose File",o?"s":""]}),e.jsx("input",{ref:g,type:"file",className:"hidden",accept:r,multiple:o,onChange:u=>k(u.target.files)}),y.length>0&&e.jsx(at,{files:y,onRemove:$})]}):s==="avatar"?e.jsxs("div",{className:"space-y-2",children:[n&&e.jsx("label",{className:"block text-foreground",style:He,children:n}),e.jsx("div",{onClick:()=>{var u;return!a&&((u=g.current)==null?void 0:u.click())},className:`w-24 h-24 rounded-full border-2 border-dashed flex items-center justify-center cursor-pointer transition-colors
|
|
82
|
+
${a?"opacity-50 pointer-events-none":""} ${f?"border-primary bg-primary/5":"border-border hover:border-primary/40"}`,children:y.length>0&&y[y.length-1].status==="done"?e.jsx(v.CheckCircle2,{size:24,className:"text-chart-2"}):e.jsx(v.Upload,{size:20,className:"text-muted-foreground"})}),e.jsx("input",{ref:g,type:"file",className:"hidden",accept:r||"image/*",onChange:u=>k(u.target.files)})]}):e.jsxs("div",{className:"space-y-3",children:[n&&e.jsx("label",{className:"block text-foreground",style:He,children:n}),e.jsxs("div",{onDragOver:u=>{u.preventDefault(),p(!0)},onDragLeave:()=>p(!1),onDrop:u=>{u.preventDefault(),p(!1),k(u.dataTransfer.files)},onClick:()=>{var u;return!a&&((u=g.current)==null?void 0:u.click())},className:`relative flex flex-col items-center justify-center gap-2 px-6 py-10 rounded-[var(--radius-md)] border-2 border-dashed transition-all cursor-pointer
|
|
83
83
|
${a?"opacity-50 pointer-events-none":""}
|
|
84
|
-
${f?"border-primary bg-primary/5":"border-border hover:border-primary/40 hover:bg-accent/30"}`,children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(v.Upload,{size:20,className:"text-primary"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-foreground",style:He,children:[e.jsx("span",{className:"text-primary",children:"Click to upload"})," or drag and drop"]}),e.jsxs("p",{className:"text-muted-foreground",style:tt,children:[l||(r?`Accepted: ${r}`:"Any file type"),t&&` · Max ${ot(t)}`]})]})]}),e.jsx("input",{ref:g,type:"file",className:"hidden",accept:r,multiple:o,onChange:
|
|
85
|
-
${s===k&&o?"border-primary":"border-border"}`,children:e.jsx("div",{className:"w-20 h-20 bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:
|
|
86
|
-
${k===s?"border-primary-foreground":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:m.thumbnail||m.src,alt:m.alt,className:"w-full h-full object-cover"})},k))})]})]})}const ga={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},pa={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},va={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function ma({items:r,parentRect:t}){const o=c.useRef(null),[a,s]=c.useState({top:t.top,left:t.right+4});return c.useEffect(()=>{if(!o.current)return;const l=o.current.getBoundingClientRect();let d=t.top,i=t.right+4;i+l.width>window.innerWidth-8&&(i=t.left-l.width-4),d+l.height>window.innerHeight-8&&(d=window.innerHeight-l.height-8),s({top:d,left:i})},[t]),Ce.createPortal(e.jsx("div",{ref:o,className:"fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1",style:{top:a.top,left:a.left},children:r.map((n,l)=>e.jsx(st,{item:n},l))}),document.body)}function st({item:r}){const[t,o]=c.useState(!1),a=c.useRef(null),s=c.useRef(null);if(r.divider)return e.jsx("div",{className:"my-1 border-t border-border"});if(r.label)return e.jsx("div",{className:"px-3 py-1.5 text-muted-foreground",style:va,children:r.label});const n=r.children&&r.children.length>0,l=()=>{s.current&&clearTimeout(s.current),n&&o(!0)},d=()=>{s.current=setTimeout(()=>o(!1),150)};return e.jsxs("div",{ref:a,className:"relative",onMouseEnter:l,onMouseLeave:d,children:[e.jsxs("button",{onClick:()=>{var i;n||(i=r.onClick)==null||i.call(r)},disabled:r.disabled,className:`w-full flex items-center text-left rounded-[var(--radius-sm)] transition-colors cursor-pointer ${r.destructive?"text-destructive hover:bg-destructive/10":r.disabled?"text-muted-foreground opacity-50 cursor-not-allowed":"text-popover-foreground hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)",...ga},children:[r.icon&&e.jsx("span",{className:"flex-shrink-0",children:r.icon}),e.jsx("span",{className:"flex-1",children:r.text}),r.shortcut&&e.jsx("span",{className:"text-muted-foreground ml-4",style:pa,children:r.shortcut}),n&&e.jsx(v.ChevronRight,{size:14,className:"text-muted-foreground"})]}),n&&t&&a.current&&e.jsx(ma,{items:r.children,parentRect:a.current.getBoundingClientRect()})]})}function nt({items:r,open:t,onClose:o,triggerRef:a,className:s=""}){const n=c.useRef(null),[l,d]=c.useState({top:0,left:0});return c.useEffect(()=>{if(!t||!a.current)return;const i=a.current.getBoundingClientRect();let h=i.bottom+4,u=i.left;requestAnimationFrame(()=>{if(!n.current)return;const x=n.current.getBoundingClientRect();u+x.width>window.innerWidth-8&&(u=i.right-x.width),h+x.height>window.innerHeight-8&&(h=i.top-x.height-4),d({top:h,left:u})}),d({top:h,left:u})},[t,a]),c.useEffect(()=>{if(!t)return;const i=h=>{var u,x;(u=a.current)!=null&&u.contains(h.target)||(x=n.current)!=null&&x.contains(h.target)||o()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[t,o,a]),t?Ce.createPortal(e.jsxs("div",{ref:n,className:`fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1 animate-[fadeIn_0.15s_ease] ${s}`,style:{top:l.top,left:l.left},children:[r.map((i,h)=>e.jsx(st,{item:i},h)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}nt.displayName="Menu";const lt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},er={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},xa={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Pe={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function it({type:r="info",title:t,message:o,closable:a=!0,onClose:s,action:n,avatar:l,time:d,read:i}){const h={info:e.jsx(v.Info,{size:16,className:"text-primary"}),success:e.jsx(v.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(v.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(v.XCircle,{size:16,className:"text-destructive"})},u={info:"border-l-primary",success:"border-l-chart-2",warning:"border-l-chart-5",error:"border-l-destructive"};return e.jsxs("div",{className:`flex gap-3 px-4 py-3 rounded-[var(--radius-md)] border border-border bg-card border-l-[3px] ${u[r]} ${i===!1?"bg-primary/5":""}`,children:[l?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:er,children:e.jsx("span",{className:"text-primary",children:l.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:h[r]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("span",{className:"text-foreground",style:er,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d&&e.jsx("span",{className:"text-muted-foreground",style:xa,children:d}),i===!1&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),a&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:14})})]})]}),o&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:lt,children:o}),n&&e.jsxs("button",{onClick:n.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:Pe,children:[n.label," ",e.jsx(v.ExternalLink,{size:12})]})]})]})}function ya({items:r,onMarkRead:t,onMarkAllRead:o,onDismiss:a,onClearAll:s}){const[n,l]=c.useState(r),d=t!==void 0||o!==void 0,i=d?r:n,h=i.filter(f=>!f.read).length,u=()=>{o&&o(),d||l(f=>f.map(p=>({...p,read:!0})))},x=f=>{a&&a(f),d||l(p=>p.filter(g=>g.id!==f))},y=f=>{t&&t(f),d||l(p=>p.map(g=>g.id===f?{...g,read:!0}:g))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-md)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:er,children:"Notifications"}),h>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:Pe,children:h})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[h>0&&e.jsx("button",{onClick:u,className:"text-primary cursor-pointer",style:Pe,children:"Mark all read"}),i.length>0&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:Pe,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:i.map(f=>e.jsx("div",{className:`px-3 py-2 ${f.read?"":"bg-primary/5"}`,onClick:()=>!f.read&&y(f.id),children:e.jsx(it,{type:f.type,title:f.title,message:f.message,time:f.time,read:f.read,closable:!!a,onClose:()=>x(f.id)})},f.id))}),i.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(v.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:lt,children:"No notifications"})]})]})}const wa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Na({trigger:r,children:t,placement:o="bottom",title:a,open:s,onOpenChange:n}){const[l,d]=c.useState(!1),i=s!==void 0?s:l,h=y=>{n==null||n(y),s===void 0&&d(y)},u=c.useRef(null);c.useEffect(()=>{if(!i)return;const y=f=>{u.current&&!u.current.contains(f.target)&&h(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i]);const x={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};return e.jsxs("div",{className:"relative inline-block",ref:u,children:[e.jsx("div",{onClick:()=>h(!i),className:"cursor-pointer",children:r}),i&&e.jsx("div",{className:`absolute z-50 ${x[o]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card shadow-elevation-sm overflow-hidden",children:[a&&e.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:wa,children:a}),e.jsx("button",{onClick:()=>h(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const Sa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},ka={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function dt({value:r,max:t=100,size:o="md",color:a,label:s,showValue:n,indeterminate:l,className:d=""}){const i={sm:"h-1.5",md:"h-2.5",lg:"h-4"},h=l?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${d}`,children:[(s||n)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[s&&e.jsx("span",{className:"text-foreground",style:Sa,children:s}),n&&!l&&e.jsxs("span",{className:"text-muted-foreground",style:ka,children:[Math.round(h),"%"]})]}),e.jsx("div",{className:`w-full ${i[o]} rounded-full bg-muted overflow-hidden`,children:l?e.jsx("div",{className:"h-full w-1/3 rounded-full animate-[indeterminate_1.5s_infinite_ease-in-out]",style:{backgroundColor:a??"var(--primary)"}}):e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${h}%`,backgroundColor:a??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}dt.displayName="ProgressBar";const $a={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},za={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Ca({value:r=0,onChange:t,max:o=5,size:a="md",disabled:s,readOnly:n,icon:l="star",showValue:d,label:i}){const[h,u]=c.useState(0),x=a==="sm"?16:a==="lg"?28:20,y=a==="sm"?"gap-0.5":a==="lg"?"gap-1.5":"gap-1",f=l==="heart"?v.Heart:l==="thumb"?v.ThumbsUp:v.Star,p=l==="heart"?"text-destructive":"text-chart-5",g=Array.from({length:o},(m,k)=>k+1);return e.jsxs("div",{className:`inline-flex items-center ${y} ${s?"opacity-50 pointer-events-none":""}`,children:[i&&e.jsx("span",{className:"text-foreground mr-2",style:$a,children:i}),g.map(m=>{const k=m<=(h||r);return e.jsx("button",{type:"button",className:`transition-transform ${n||s?"":"cursor-pointer hover:scale-110"} ${k?p:"text-muted-foreground/40"}`,onMouseEnter:()=>!n&&!s&&u(m),onMouseLeave:()=>u(0),onClick:()=>!n&&!s&&(t==null?void 0:t(m===r?0:m)),disabled:s||n,children:e.jsx(f,{size:x,fill:k?"currentColor":"none"})},m)}),d&&e.jsxs("span",{className:"text-foreground ml-1",style:za,children:[r,"/",o]})]})}const Fa={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function rr({children:r,content:t,placement:o="top",className:a=""}){const[s,n]=c.useState(!1),[l,d]=c.useState({top:0,left:0}),i=c.useRef(null),h=()=>{if(!i.current)return;const p=i.current.getBoundingClientRect(),g=8;let m=0,k=0;o==="right"?(m=p.top+p.height/2,k=p.right+g):o==="left"?(m=p.top+p.height/2,k=p.left-g):o==="bottom"?(m=p.bottom+g,k=p.left+p.width/2):(m=p.top-g,k=p.left+p.width/2),d({top:m,left:k})},u=()=>{h(),n(!0)},x=()=>n(!1);c.useEffect(()=>{if(!s)return;const p=()=>h();return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[s]);const y=o==="right"?{transform:"translateY(-50%)"}:o==="left"?{transform:"translate(-100%, -50%)"}:o==="bottom"?{transform:"translateX(-50%)"}:{transform:"translate(-50%, -100%)"},f=s?e.jsx("div",{style:{position:"fixed",top:l.top,left:l.left,zIndex:9999,pointerEvents:"none",...y},children:e.jsx("div",{className:"px-2.5 py-1.5 rounded-[var(--radius-sm)] bg-foreground text-background whitespace-nowrap shadow-elevation-sm",style:Fa,role:"tooltip",children:t})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:i,className:`relative inline-flex ${a}`,onMouseEnter:u,onMouseLeave:x,onFocus:u,onBlur:x,children:r}),typeof document<"u"&&Ce.createPortal(f,document.body)]})}rr.displayName="Tooltip";const ct={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-button)",lineHeight:"1"},Wa={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"},La={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"};function tr({item:r,size:t=40}){const o=t+"px",a=t>=40?"var(--text-label)":"var(--text-caption)";if(r.avatarUrl)return e.jsx("img",{src:r.avatarUrl,alt:r.name,style:{width:o,height:o,borderRadius:"50%",objectFit:"cover",flexShrink:0}});const s=r.avatarFallback||r.name.charAt(0).toUpperCase();return e.jsx("div",{style:{width:o,height:o,borderRadius:"50%",flexShrink:0,background:"var(--Base_Color--Sky--100, #e0f2fe)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-label)",fontSize:a,fontWeight:"var(--weight-button)",color:"var(--Base_Color--Sky--600, #1b8bf5)"},children:s})}function or({company:r,branch:t,provider:o,companies:a=[],branches:s=[],providers:n=[],onCompanyChange:l,onBranchChange:d,onProviderChange:i,collapsed:h=!1}){const[u,x]=c.useState(!1),y=c.useRef(null);c.useEffect(()=>{if(!u)return;const m=k=>{y.current&&!y.current.contains(k.target)&&x(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[u]);const f=r,p=(t==null?void 0:t.name)??(o==null?void 0:o.name),g=m=>{l==null||l(m),x(!1)};return h?e.jsx("button",{onClick:()=>x(!u),title:(f==null?void 0:f.name)??"Switch account",style:{width:40,height:40,borderRadius:"50%",border:"none",background:"rgba(240,249,255,1)",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f?e.jsx(tr,{item:f,size:36}):e.jsx("div",{style:{width:36,height:36,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)"},children:"S"})}):e.jsxs("div",{ref:y,style:{position:"relative",width:"100%"},children:[e.jsxs("button",{onClick:()=>x(!u),style:{width:"100%",background:"rgba(240,249,255,1)",border:"1px solid rgba(217,242,255,1)",borderRadius:"8px",padding:"8px 16px 8px 8px",display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",textAlign:"left",minHeight:"56px"},children:[f?e.jsx(tr,{item:f,size:40}):e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)",flexShrink:0},children:"S"}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:(f==null?void 0:f.name)??"Select Company"}),p&&e.jsx("span",{style:{...Wa,color:"var(--Base_Color--Sky--500, #32a9ff)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:p})]}),e.jsx(v.ChevronUp,{size:16,color:"rgba(50,169,255,1)",style:{flexShrink:0,transition:"transform 0.2s ease",transform:u?"rotate(0deg)":"rotate(180deg)"}})]}),u&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:50,background:"var(--background, #fff)",border:"1px solid var(--border, #e5e7eb)",borderRadius:"8px",boxShadow:"0px 4px 12px 0px rgba(0,0,0,0.08)",overflow:"hidden"},children:e.jsx("div",{style:{maxHeight:"240px",overflowY:"auto"},children:a.map(m=>{const k=(r==null?void 0:r.id)===m.id;return e.jsxs("button",{onClick:()=>g(m),style:{width:"100%",display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",background:k?"rgba(240,249,255,0.6)":"none",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s",minHeight:"48px"},onMouseEnter:z=>{k||(z.currentTarget.style.background="var(--accent, #f3f4f6)")},onMouseLeave:z=>{z.currentTarget.style.background=k?"rgba(240,249,255,0.6)":"none"},children:[e.jsx(tr,{item:m,size:36}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.name}),m.handle&&e.jsx("div",{style:{...La,color:"var(--muted-foreground, #6b7280)",marginTop:"2px"},children:m.handle})]}),k&&e.jsx(v.Check,{size:16,color:"var(--Base_Color--Sky--500, #32a9ff)",style:{flexShrink:0}})]},m.id)})})})]})}or.displayName="SidebarAccountSwitcher";const Ma={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Da={fontFamily:"var(--font-p)",fontSize:"var(--text-p)"},Aa={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},ja={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ea={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Oe({brand:r,accountSwitcher:t,groups:o,activeItem:a,onNavigate:s,collapsed:n=!1,onCollapsedChange:l,showCollapseToggle:d=!0,version:i,versionDate:h,className:u=""}){const[x,y]=c.useState(new Set),f=p=>{y(g=>{const m=new Set(g);return m.has(p)?m.delete(p):m.add(p),m})};return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 ${u}`,style:{width:n?"64px":"256px",minWidth:n?"64px":"256px",transition:"width 0.25s cubic-bezier(0.4,0,0.2,1), min-width 0.25s cubic-bezier(0.4,0,0.2,1)",overflow:"visible"},children:[t?e.jsx("div",{className:`${n?"px-2 py-2":"px-3 py-3"} border-b border-sidebar-border flex items-center ${n?"justify-center":""}`,children:e.jsx(or,{...t,collapsed:n})}):r&&e.jsxs("div",{className:`${n?"px-2":"px-4"} py-4 border-b border-sidebar-border flex items-center ${n?"justify-center":"gap-2"}`,children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Aa,children:r.name.charAt(0).toUpperCase()}),!n&&e.jsx("span",{className:"text-sidebar-foreground truncate",style:Ma,children:r.name})]}),e.jsx("nav",{className:`flex-1 overflow-y-auto py-3 ${n?"px-1.5":"px-2"}`,children:o.map(p=>{const g=x.has(p.label);return e.jsxs("div",{className:"mb-4",children:[!n&&e.jsxs("button",{onClick:()=>f(p.label),className:"w-full flex items-center justify-between px-2 mb-1.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",style:ja,children:[e.jsx("span",{children:p.label}),e.jsx(v.ChevronUp,{size:12,style:{transition:"transform 0.2s ease",transform:g?"rotate(180deg)":"rotate(0deg)"}})]}),n&&e.jsx("div",{className:"h-px bg-sidebar-border mx-1 mb-2 mt-1"}),!g&&e.jsx("div",{className:"space-y-0.5",children:p.items.map(m=>{const k=a===m.id,z=e.jsxs("button",{onClick:()=>s==null?void 0:s(m),className:`w-full flex items-center ${n?"justify-center":"gap-2"} ${n?"px-0":"px-2"} py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${k?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:Da,children:[e.jsx("span",{className:`flex-shrink-0 ${k?"text-sidebar-primary":"text-muted-foreground"}`,children:m.icon}),!n&&e.jsx("span",{className:"truncate flex-1 text-left",children:m.label}),m.badge!=null&&!n&&e.jsx("span",{className:"rounded-full bg-primary text-primary-foreground",style:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)",lineHeight:"1",padding:"2px 6px",display:"inline-flex",alignItems:"center",minWidth:"18px",justifyContent:"center"},children:String(m.badge)})]},m.id);return n?e.jsx("div",{className:"w-full flex",children:e.jsx(rr,{content:m.label,placement:"right",className:"flex-1",children:z})},m.id):z})})]},p.label)})}),(d&&l||i)&&e.jsxs("div",{className:`${n?"px-1.5":"px-3"} py-3 border-t border-sidebar-border flex flex-col gap-1`,children:[d&&l&&e.jsxs("button",{onClick:()=>l(!n),className:`w-full flex items-center ${n?"justify-center":"gap-2 px-2"} py-1.5 rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50 cursor-pointer`,style:Ea,title:n?"Expand sidebar":"Collapse sidebar",children:[n?e.jsx(v.PanelLeftOpen,{size:16}):e.jsx(v.PanelLeftClose,{size:16}),!n&&e.jsx("span",{children:"Collapse"})]}),i&&!n&&e.jsxs("div",{className:"px-2 flex items-center gap-1.5 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},children:[e.jsx("span",{children:i}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:h})]})]}),i&&n&&e.jsx("div",{className:"flex justify-center text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},title:`${i}${h?` · ${h}`:""}`,children:i})]})]})}Oe.displayName="Sidebar";function se({width:r,height:t,variant:o="rectangular",animate:a=!0,className:s}){const n="bg-muted",l=a?"animate-pulse":"",d=o==="circular"?"rounded-full":o==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${n} ${l} ${d} ${s??""}`,style:{width:r??"100%",height:t??(o==="text"?"1em":o==="circular"?40:20)}})}function Ta(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(se,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{variant:"text",width:"60%",height:20}),e.jsx(se,{variant:"text",width:"100%",height:14}),e.jsx(se,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:"40%",height:14}),e.jsx(se,{variant:"text",width:"25%",height:12})]})]})]})}function Ia(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex gap-4",children:[120,160,100,80].map((r,t)=>e.jsx(se,{variant:"text",width:r,height:14},t))}),[0,1,2,3].map(r=>e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-4",children:[e.jsx(se,{variant:"circular",width:28,height:28}),e.jsx(se,{variant:"text",width:100+r*15,height:14}),e.jsx(se,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(se,{variant:"rounded",width:60,height:22}),e.jsx(se,{variant:"text",width:80,height:14})]},r))]})}function ar({rows:r=3}){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:Array.from({length:r}).map((t,o)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-[var(--radius-md)] border border-border bg-card",children:[e.jsx(se,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:`${60+o*10}%`,height:14}),e.jsx(se,{variant:"text",width:`${40+o*5}%`,height:12})]}),e.jsx(se,{variant:"rounded",width:50,height:24})]},o))})}const Ba={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-[3px]",lg:"w-12 h-12 border-4",xl:"w-16 h-16 border-4"};function ft({size:r="md",color:t,className:o=""}){return e.jsx("div",{className:`${Ba[r]} rounded-full border-muted animate-spin ${o}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}ft.displayName="Spinner";const sr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ht={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ut={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},bt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_a={sm:{fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},md:{fontFamily:"var(--font-h2)",fontSize:"var(--text-h2)",fontWeight:"var(--weight-h2)"},lg:{fontFamily:"var(--font-h1)",fontSize:"var(--text-h1)",fontWeight:"var(--weight-h1)"}};function Ha({title:r,value:t,prefix:o,suffix:a,trend:s,trendLabel:n,icon:l,size:d="md",loading:i}){const h=_a[d],u=(s==null?void 0:s.direction)==="up"?"text-chart-2":(s==null?void 0:s.direction)==="down"?"text-destructive":"text-muted-foreground",x=(s==null?void 0:s.direction)==="up"?v.ArrowUpRight:(s==null?void 0:s.direction)==="down"?v.ArrowDownRight:v.Minus;return i?e.jsxs("div",{className:"space-y-2 animate-pulse",children:[e.jsx("div",{className:"h-3 w-20 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-8 w-32 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded-[var(--radius-sm)]"})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsx("span",{className:"text-muted-foreground",style:sr,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ht,children:o}),e.jsx("span",{className:"text-foreground",style:h,children:typeof t=="number"?t.toLocaleString():t}),a&&e.jsx("span",{className:"text-muted-foreground",style:sr,children:a})]}),s&&e.jsxs("div",{className:`flex items-center gap-1 ${u}`,children:[e.jsx(x,{size:14}),e.jsxs("span",{style:bt,children:[s.value,"%"]}),n&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:n})]})]})}function Pa({title:r,value:t,prefix:o,trend:a,trendLabel:s,icon:n,iconBg:l}){const d=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",i=(a==null?void 0:a.direction)==="up"?v.ArrowUpRight:(a==null?void 0:a.direction)==="down"?v.ArrowDownRight:v.Minus;return e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-5 overflow-hidden",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1 min-w-0 flex-1",children:[e.jsx("span",{className:"text-muted-foreground",style:sr,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ht,children:o}),e.jsx("span",{className:"text-foreground",style:{fontFamily:"var(--font-h3)",fontSize:"var(--text-h3)",fontWeight:"var(--weight-h3)"},children:typeof t=="number"?t.toLocaleString():t})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${d}`,children:[e.jsx(i,{size:12}),e.jsxs("span",{style:bt,children:[a.value,"%"]}),s&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:s})]})]}),n&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${l||"bg-primary/10 text-primary"}`,children:n})]})})}const Oa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},gt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},pt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},vt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function mt({steps:r,current:t,orientation:o="horizontal",onStepClick:a,className:s=""}){return o==="vertical"?e.jsx("div",{className:`flex flex-col ${s}`,children:r.map((n,l)=>{const d=l<t,i=l===t,h=n.disabled;return e.jsxs("div",{className:`flex gap-3 ${h?"opacity-50":""}`,onClick:()=>!h&&(a==null?void 0:a(l)),children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${h?"cursor-not-allowed":a?"cursor-pointer":""} ${d||i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:vt,children:d?e.jsx(v.Check,{size:14}):l+1}),l<r.length-1&&e.jsx("div",{className:`w-px flex-1 min-h-[24px] my-1 ${d?"bg-primary":"bg-border"}`})]}),e.jsxs("div",{className:`pb-6 ${l===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${i?"text-foreground":"text-muted-foreground"}`,style:i?gt:Oa,children:n.title}),n.description&&e.jsx("span",{className:"text-muted-foreground block",style:pt,children:n.description})]})]},l)})}):e.jsx("div",{className:`flex items-center ${s}`,children:r.map((n,l)=>{const d=l<t,i=l===t;return e.jsxs("div",{className:`flex items-center ${l<r.length-1?"flex-1":""} ${n.disabled?"opacity-50":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>!n.disabled&&(a==null?void 0:a(l)),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${n.disabled?"cursor-not-allowed":a?"cursor-pointer":""} ${d||i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:vt,children:d?e.jsx(v.Check,{size:14}):l+1}),e.jsx("span",{className:`text-center ${i?"text-foreground":"text-muted-foreground"}`,style:i?gt:pt,children:n.title})]}),l<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${d?"bg-primary":"bg-border"}`})]},l)})})}mt.displayName="Stepper";const Ya={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ga={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Ua={sm:{track:"w-7 h-4",thumb:"w-3 h-3",on:"translate-x-3"},md:{track:"w-10 h-6",thumb:"w-4.5 h-4.5",on:"translate-x-4.5"},lg:{track:"w-14 h-8",thumb:"w-6.5 h-6.5",on:"translate-x-6"}},Xa={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},Ka={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Za({checked:r,onChange:t,label:o,description:a,size:s="md",disabled:n,color:l="primary"}){const d=Ua[s],i=Ka[s];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${n?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:n,className:`${d.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Xa[l]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-background shadow-elevation-sm absolute transition-transform",style:{width:i.w,height:i.h,top:"50%",transform:`translateY(-50%) translateX(${r?i.on:2}px)`,left:0}})}),(o||a)&&e.jsxs("div",{children:[o&&e.jsx("span",{className:"text-foreground block",style:Ya,children:o}),a&&e.jsx("span",{className:"text-muted-foreground block",style:Ga,children:a})]})]})}const qa={default:"bg-muted/50 text-foreground border-border",primary:"bg-primary/10 text-primary border-primary/20",success:"bg-chart-2/10 text-chart-2 border-chart-2/20",warning:"bg-chart-5/10 text-chart-5 border-chart-5/20",destructive:"bg-destructive/10 text-destructive border-destructive/20",info:"bg-accent text-accent-foreground border-primary/20"},Ja={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Qa={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},md:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}};function xt({children:r,color:t="default",size:o="md",icon:a,closable:s,onClose:n,className:l=""}){const d=qa[t],i=Ja[o],h=Qa[o];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${d} ${i} ${l}`,style:h,children:[a&&e.jsx("span",{className:"flex-shrink-0",children:a}),r,s&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:n,children:e.jsx(v.X,{size:o==="sm"?10:12})})]})}xt.displayName="Tag";const Va={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ra={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},es={default:"bg-card border-border",outline:"bg-transparent border-border",filled:"bg-muted/30 border-transparent"};function yt({tags:r,onChange:t,placeholder:o,disabled:a,maxTags:s,variant:n="default",className:l=""}){const[d,i]=c.useState(""),h=()=>{const x=d.trim();!x||r.includes(x)||s&&r.length>=s||(t([...r,x]),i(""))},u=x=>{t(r.filter(y=>y!==x))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${es[n]} transition-colors focus-within:border-primary ${a?"opacity-50 pointer-events-none":""} ${l}`,children:[r.map(x=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-[var(--radius-sm)] bg-primary/10 text-primary",style:Ra,children:[x,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>u(x),children:e.jsx(v.X,{size:12})})]},x)),e.jsx("input",{value:d,onChange:x=>i(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),h()),x.key==="Backspace"&&!d&&r.length&&t(r.slice(0,-1))},placeholder:r.length?"":o,className:"flex-1 min-w-[80px] bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Va,disabled:a})]})}yt.displayName="TagInput";const rs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},wt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},nr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ts({items:r,variant:t="default",size:o="md"}){const a=o==="sm"?"w-6 h-6":o==="lg"?"w-10 h-10":"w-8 h-8",s=o==="sm"?12:o==="lg"?18:14,n=l=>l==="completed"?"bg-chart-2 text-primary-foreground":l==="current"?"bg-primary text-primary-foreground":l==="error"?"bg-destructive text-primary-foreground":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((l,d)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`${a} rounded-full flex items-center justify-center flex-shrink-0 ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(v.CheckCircle2,{size:s}):e.jsx(v.Circle,{size:s}))}),d<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 min-h-4 bg-border"})]}),e.jsxs("div",{className:"pb-4 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-foreground",style:wt,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:nr,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:nr,children:l.description})]})]},d))}):e.jsx("div",{className:"relative",children:r.map((l,d)=>{const i=t==="alternate"&&d%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${i?"flex-row-reverse":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`${a} rounded-full flex items-center justify-center ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(v.CheckCircle2,{size:s}):e.jsx(v.Circle,{size:s}))}),d<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 bg-border mt-1"})]}),e.jsxs("div",{className:`flex-1 min-w-0 ${i?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${i?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:wt,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:nr,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:rs,children:l.description}),l.children&&e.jsx("div",{className:"mt-2",children:l.children})]})]},d)})})}const Te={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function lr({brand:r,breadcrumbs:t,title:o,actions:a,user:s,height:n="72px",showSearch:l=!1,searchPlaceholder:d="Search... (Ctrl+K)",onSearchClick:i,notificationCount:h,onNotificationClick:u,onMobileMenuClick:x,onSidebarToggle:y,onUserClick:f,onBreadcrumbClick:p,workspaceSwitcher:g,className:m=""}){const k=s!=null&&s.name?s.name.split(" ").map(z=>z[0]).join("").slice(0,2).toUpperCase():"";return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-5 gap-4 ${m}`,style:{height:n},children:[y&&e.jsx("button",{className:"w-9 h-9 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:y,title:"Toggle sidebar",children:e.jsx(v.Menu,{size:18})}),!y&&x&&e.jsx("button",{className:"lg:hidden w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:x,children:e.jsx(v.Menu,{size:16})}),r&&e.jsx(e.Fragment,{children:typeof r.logo=="string"?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):r.logo?e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] overflow-hidden flex-shrink-0",children:r.logo}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Te,children:r.name.charAt(0).toUpperCase()})}),g&&e.jsx("div",{className:"flex items-center ml-1",children:g}),o&&e.jsx("span",{className:"text-foreground hidden sm:block truncate",style:Te,children:o}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:Te,children:t.map((z,b)=>e.jsxs(c.Fragment,{children:[b>0&&e.jsx(v.ChevronRight,{size:12}),z.href||p?e.jsx("span",{className:`cursor-pointer ${b===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>p==null?void 0:p(z,b),children:z.label}):e.jsx("span",{className:b===t.length-1?"text-foreground":"",children:z.label})]},b))}),e.jsx("div",{className:"flex-1"}),l&&e.jsxs("div",{className:"hidden md:flex items-center gap-2 px-3 h-8 rounded-[var(--radius)] border border-border bg-muted/20 text-muted-foreground w-56 cursor-pointer hover:border-primary/40 transition-colors",onClick:i,children:[e.jsx(v.Search,{size:14}),e.jsx("span",{style:Te,children:d})]}),a,u&&e.jsxs("button",{className:"relative w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:u,children:[e.jsx(v.Bell,{size:16}),h!==void 0&&h>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),s&&e.jsx("div",{className:"cursor-pointer",onClick:f,children:s.avatar?e.jsx("img",{src:s.avatar,alt:s.name,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center",style:Te,children:k})})]})}lr.displayName="TopNavbar";const os={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ir={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function St({title:r,items:t,selected:o,onToggle:a,search:s,onSearch:n,searchable:l}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-md)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-3 py-2.5 border-b border-border bg-muted/30 flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:Nt,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:ir,children:[t.length," items"]})]}),l&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(v.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:s,onChange:d=>n(d.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:ir})]}),e.jsxs("div",{className:"max-h-[240px] overflow-y-auto py-1",children:[t.length===0&&e.jsx("div",{className:"px-3 py-6 text-center text-muted-foreground",style:ir,children:"No items"}),t.map(d=>e.jsxs("button",{onClick:()=>!d.disabled&&a(d.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
|
|
84
|
+
${f?"border-primary bg-primary/5":"border-border hover:border-primary/40 hover:bg-accent/30"}`,children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(v.Upload,{size:20,className:"text-primary"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-foreground",style:He,children:[e.jsx("span",{className:"text-primary",children:"Click to upload"})," or drag and drop"]}),e.jsxs("p",{className:"text-muted-foreground",style:tt,children:[l||(r?`Accepted: ${r}`:"Any file type"),t&&` · Max ${ot(t)}`]})]})]}),e.jsx("input",{ref:g,type:"file",className:"hidden",accept:r,multiple:o,onChange:u=>k(u.target.files)}),y.length>0&&e.jsx(at,{files:y,onRemove:$})]})}const ha={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ua={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function ba({images:r,initialIndex:t=0}){const[o,a]=c.useState(!1),[s,n]=c.useState(t),[l,d]=c.useState(1),[i,h]=c.useState(0),b=r[s],x=()=>{n(y=>(y-1+r.length)%r.length),d(1),h(0)},w=()=>{n(y=>(y+1)%r.length),d(1),h(0)},f=()=>d(y=>Math.min(y+.25,3)),p=()=>d(y=>Math.max(y-.25,.5)),g=()=>h(y=>(y+90)%360);return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((y,k)=>e.jsx("button",{onClick:()=>{n(k),a(!0),d(1),h(0)},className:`rounded-[var(--radius-md)] overflow-hidden border-2 transition-all cursor-pointer hover:opacity-80
|
|
85
|
+
${s===k&&o?"border-primary":"border-border"}`,children:e.jsx("div",{className:"w-20 h-20 bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:y.thumbnail||y.src,alt:y.alt,className:"w-full h-full object-cover",loading:"lazy"})})},k))}),o&&e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`Image preview: ${b.alt}`,className:"fixed inset-0 z-[60] bg-foreground/80 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-foreground/20",children:[e.jsxs("span",{className:"text-primary-foreground",style:ha,children:[b.alt," (",s+1,"/",r.length,")"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:p,"aria-label":"Zoom out",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(v.ZoomOut,{size:16})}),e.jsxs("span",{className:"text-primary-foreground/70 px-2",style:ua,"aria-live":"polite","aria-label":`Zoom level ${Math.round(l*100)}%`,children:[Math.round(l*100),"%"]}),e.jsx("button",{onClick:f,"aria-label":"Zoom in",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(v.ZoomIn,{size:16})}),e.jsx("button",{onClick:g,"aria-label":"Rotate clockwise",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(v.RotateCw,{size:16})}),e.jsx("div",{className:"w-px h-5 bg-primary-foreground/20 mx-1"}),e.jsx("button",{onClick:()=>{a(!1),d(1),h(0)},"aria-label":"Close preview",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(v.X,{size:16})})]})]}),e.jsxs("div",{className:"flex-1 flex items-center justify-center relative overflow-hidden",onClick:y=>{y.target===y.currentTarget&&(a(!1),d(1),h(0))},children:[r.length>1&&e.jsx("button",{onClick:x,"aria-label":"Previous image",className:"absolute left-4 w-10 h-10 rounded-full bg-foreground/30 text-primary-foreground flex items-center justify-center hover:bg-foreground/50 cursor-pointer z-10",children:e.jsx(v.ChevronLeft,{size:20})}),e.jsx("img",{src:b.src,alt:b.alt,className:"max-w-[90%] max-h-[80vh] object-contain transition-transform",style:{transform:`scale(${l}) rotate(${i}deg)`}}),r.length>1&&e.jsx("button",{onClick:w,"aria-label":"Next image",className:"absolute right-4 w-10 h-10 rounded-full bg-foreground/30 text-primary-foreground flex items-center justify-center hover:bg-foreground/50 cursor-pointer z-10",children:e.jsx(v.ChevronRight,{size:20})})]}),r.length>1&&e.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-foreground/20",children:r.map((y,k)=>e.jsx("button",{onClick:()=>{n(k),d(1),h(0)},className:`w-12 h-12 rounded-[var(--radius-sm)] overflow-hidden border-2 cursor-pointer transition-all
|
|
86
|
+
${k===s?"border-primary-foreground":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:y.thumbnail||y.src,alt:y.alt,className:"w-full h-full object-cover"})},k))})]})]})}const ga={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},pa={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},va={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function ma({items:r,parentRect:t}){const o=c.useRef(null),[a,s]=c.useState({top:t.top,left:t.right+4});return c.useEffect(()=>{if(!o.current)return;const l=o.current.getBoundingClientRect();let d=t.top,i=t.right+4;i+l.width>window.innerWidth-8&&(i=t.left-l.width-4),d+l.height>window.innerHeight-8&&(d=window.innerHeight-l.height-8),s({top:d,left:i})},[t]),Ce.createPortal(e.jsx("div",{ref:o,className:"fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1",style:{top:a.top,left:a.left},children:r.map((n,l)=>e.jsx(st,{item:n},l))}),document.body)}function st({item:r}){const[t,o]=c.useState(!1),a=c.useRef(null),s=c.useRef(null);if(r.divider)return e.jsx("div",{className:"my-1 border-t border-border"});if(r.label)return e.jsx("div",{className:"px-3 py-1.5 text-muted-foreground",style:va,children:r.label});const n=r.children&&r.children.length>0,l=()=>{s.current&&clearTimeout(s.current),n&&o(!0)},d=()=>{s.current=setTimeout(()=>o(!1),150)};return e.jsxs("div",{ref:a,className:"relative",onMouseEnter:l,onMouseLeave:d,children:[e.jsxs("button",{onClick:()=>{var i;n||(i=r.onClick)==null||i.call(r)},disabled:r.disabled,className:`w-full flex items-center text-left rounded-[var(--radius-sm)] transition-colors cursor-pointer ${r.destructive?"text-destructive hover:bg-destructive/10":r.disabled?"text-muted-foreground opacity-50 cursor-not-allowed":"text-popover-foreground hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)",...ga},children:[r.icon&&e.jsx("span",{className:"flex-shrink-0",children:r.icon}),e.jsx("span",{className:"flex-1",children:r.text}),r.shortcut&&e.jsx("span",{className:"text-muted-foreground ml-4",style:pa,children:r.shortcut}),n&&e.jsx(v.ChevronRight,{size:14,className:"text-muted-foreground"})]}),n&&t&&a.current&&e.jsx(ma,{items:r.children,parentRect:a.current.getBoundingClientRect()})]})}function nt({items:r,open:t,onClose:o,triggerRef:a,className:s=""}){const n=c.useRef(null),[l,d]=c.useState({top:0,left:0});return c.useEffect(()=>{if(!t||!a.current)return;const i=a.current.getBoundingClientRect();let h=i.bottom+4,b=i.left;requestAnimationFrame(()=>{if(!n.current)return;const x=n.current.getBoundingClientRect();b+x.width>window.innerWidth-8&&(b=i.right-x.width),h+x.height>window.innerHeight-8&&(h=i.top-x.height-4),d({top:h,left:b})}),d({top:h,left:b})},[t,a]),c.useEffect(()=>{if(!t)return;const i=h=>{var b,x;(b=a.current)!=null&&b.contains(h.target)||(x=n.current)!=null&&x.contains(h.target)||o()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[t,o,a]),t?Ce.createPortal(e.jsxs("div",{ref:n,className:`fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1 animate-[fadeIn_0.15s_ease] ${s}`,style:{top:l.top,left:l.left},children:[r.map((i,h)=>e.jsx(st,{item:i},h)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}nt.displayName="Menu";const lt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},er={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},xa={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Pe={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function it({type:r="info",title:t,message:o,closable:a=!0,onClose:s,action:n,avatar:l,time:d,read:i}){const h={info:e.jsx(v.Info,{size:16,className:"text-primary"}),success:e.jsx(v.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(v.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(v.XCircle,{size:16,className:"text-destructive"})},b={info:"border-l-primary",success:"border-l-chart-2",warning:"border-l-chart-5",error:"border-l-destructive"};return e.jsxs("div",{className:`flex gap-3 px-4 py-3 rounded-[var(--radius-md)] border border-border bg-card border-l-[3px] ${b[r]} ${i===!1?"bg-primary/5":""}`,children:[l?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:er,children:e.jsx("span",{className:"text-primary",children:l.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:h[r]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("span",{className:"text-foreground",style:er,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d&&e.jsx("span",{className:"text-muted-foreground",style:xa,children:d}),i===!1&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),a&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:14})})]})]}),o&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:lt,children:o}),n&&e.jsxs("button",{onClick:n.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:Pe,children:[n.label," ",e.jsx(v.ExternalLink,{size:12})]})]})]})}function ya({items:r,onMarkRead:t,onMarkAllRead:o,onDismiss:a,onClearAll:s}){const[n,l]=c.useState(r),d=t!==void 0||o!==void 0,i=d?r:n,h=i.filter(f=>!f.read).length,b=()=>{o&&o(),d||l(f=>f.map(p=>({...p,read:!0})))},x=f=>{a&&a(f),d||l(p=>p.filter(g=>g.id!==f))},w=f=>{t&&t(f),d||l(p=>p.map(g=>g.id===f?{...g,read:!0}:g))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-md)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:er,children:"Notifications"}),h>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:Pe,children:h})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[h>0&&e.jsx("button",{onClick:b,className:"text-primary cursor-pointer",style:Pe,children:"Mark all read"}),i.length>0&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:Pe,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:i.map(f=>e.jsx("div",{className:`px-3 py-2 ${f.read?"":"bg-primary/5"}`,onClick:()=>!f.read&&w(f.id),children:e.jsx(it,{type:f.type,title:f.title,message:f.message,time:f.time,read:f.read,closable:!!a,onClose:()=>x(f.id)})},f.id))}),i.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(v.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:lt,children:"No notifications"})]})]})}const wa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Na({trigger:r,children:t,placement:o="bottom",title:a,open:s,onOpenChange:n}){const[l,d]=c.useState(!1),i=s!==void 0?s:l,h=w=>{n==null||n(w),s===void 0&&d(w)},b=c.useRef(null);c.useEffect(()=>{if(!i)return;const w=f=>{b.current&&!b.current.contains(f.target)&&h(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[i]);const x={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};return e.jsxs("div",{className:"relative inline-block",ref:b,children:[e.jsx("div",{onClick:()=>h(!i),className:"cursor-pointer",children:r}),i&&e.jsx("div",{className:`absolute z-50 ${x[o]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card shadow-elevation-sm overflow-hidden",children:[a&&e.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:wa,children:a}),e.jsx("button",{onClick:()=>h(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const Sa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},ka={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function dt({value:r,max:t=100,size:o="md",color:a,label:s,showValue:n,indeterminate:l,className:d=""}){const i={sm:"h-1.5",md:"h-2.5",lg:"h-4"},h=l?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${d}`,children:[(s||n)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[s&&e.jsx("span",{className:"text-foreground",style:Sa,children:s}),n&&!l&&e.jsxs("span",{className:"text-muted-foreground",style:ka,children:[Math.round(h),"%"]})]}),e.jsx("div",{className:`w-full ${i[o]} rounded-full bg-muted overflow-hidden`,children:l?e.jsx("div",{className:"h-full w-1/3 rounded-full animate-[indeterminate_1.5s_infinite_ease-in-out]",style:{backgroundColor:a??"var(--primary)"}}):e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${h}%`,backgroundColor:a??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}dt.displayName="ProgressBar";const $a={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},za={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Ca({value:r=0,onChange:t,max:o=5,size:a="md",disabled:s,readOnly:n,icon:l="star",showValue:d,label:i}){const[h,b]=c.useState(0),x=a==="sm"?16:a==="lg"?28:20,w=a==="sm"?"gap-0.5":a==="lg"?"gap-1.5":"gap-1",f=l==="heart"?v.Heart:l==="thumb"?v.ThumbsUp:v.Star,p=l==="heart"?"text-destructive":"text-chart-5",g=Array.from({length:o},(y,k)=>k+1);return e.jsxs("div",{className:`inline-flex items-center ${w} ${s?"opacity-50 pointer-events-none":""}`,children:[i&&e.jsx("span",{className:"text-foreground mr-2",style:$a,children:i}),g.map(y=>{const k=y<=(h||r);return e.jsx("button",{type:"button",className:`transition-transform ${n||s?"":"cursor-pointer hover:scale-110"} ${k?p:"text-muted-foreground/40"}`,onMouseEnter:()=>!n&&!s&&b(y),onMouseLeave:()=>b(0),onClick:()=>!n&&!s&&(t==null?void 0:t(y===r?0:y)),disabled:s||n,children:e.jsx(f,{size:x,fill:k?"currentColor":"none"})},y)}),d&&e.jsxs("span",{className:"text-foreground ml-1",style:za,children:[r,"/",o]})]})}const Fa={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function rr({children:r,content:t,placement:o="top",className:a=""}){const[s,n]=c.useState(!1),[l,d]=c.useState({top:0,left:0}),i=c.useRef(null),h=()=>{if(!i.current)return;const p=i.current.getBoundingClientRect(),g=8;let y=0,k=0;o==="right"?(y=p.top+p.height/2,k=p.right+g):o==="left"?(y=p.top+p.height/2,k=p.left-g):o==="bottom"?(y=p.bottom+g,k=p.left+p.width/2):(y=p.top-g,k=p.left+p.width/2),d({top:y,left:k})},b=()=>{h(),n(!0)},x=()=>n(!1);c.useEffect(()=>{if(!s)return;const p=()=>h();return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[s]);const w=o==="right"?{transform:"translateY(-50%)"}:o==="left"?{transform:"translate(-100%, -50%)"}:o==="bottom"?{transform:"translateX(-50%)"}:{transform:"translate(-50%, -100%)"},f=s?e.jsx("div",{style:{position:"fixed",top:l.top,left:l.left,zIndex:9999,pointerEvents:"none",...w},children:e.jsx("div",{className:"px-2.5 py-1.5 rounded-[var(--radius-sm)] bg-foreground text-background whitespace-nowrap shadow-elevation-sm",style:Fa,role:"tooltip",children:t})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:i,className:`relative inline-flex ${a}`,onMouseEnter:b,onMouseLeave:x,onFocus:b,onBlur:x,children:r}),typeof document<"u"&&Ce.createPortal(f,document.body)]})}rr.displayName="Tooltip";const ct={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-button)",lineHeight:"1"},Wa={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"},La={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"};function tr({item:r,size:t=40}){const o=t+"px",a=t>=40?"var(--text-label)":"var(--text-caption)";if(r.avatarUrl)return e.jsx("img",{src:r.avatarUrl,alt:r.name,style:{width:o,height:o,borderRadius:"50%",objectFit:"cover",flexShrink:0}});const s=r.avatarFallback||r.name.charAt(0).toUpperCase();return e.jsx("div",{style:{width:o,height:o,borderRadius:"50%",flexShrink:0,background:"var(--Base_Color--Sky--100, #e0f2fe)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-label)",fontSize:a,fontWeight:"var(--weight-button)",color:"var(--Base_Color--Sky--600, #1b8bf5)"},children:s})}function or({company:r,branch:t,provider:o,companies:a=[],branches:s=[],providers:n=[],onCompanyChange:l,onBranchChange:d,onProviderChange:i,collapsed:h=!1}){const[b,x]=c.useState(!1),w=c.useRef(null);c.useEffect(()=>{if(!b)return;const y=k=>{w.current&&!w.current.contains(k.target)&&x(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[b]);const f=r,p=(t==null?void 0:t.name)??(o==null?void 0:o.name),g=y=>{l==null||l(y),x(!1)};return h?e.jsx("button",{onClick:()=>x(!b),title:(f==null?void 0:f.name)??"Switch account",style:{width:40,height:40,borderRadius:"50%",border:"none",background:"rgba(240,249,255,1)",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f?e.jsx(tr,{item:f,size:36}):e.jsx("div",{style:{width:36,height:36,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)"},children:"S"})}):e.jsxs("div",{ref:w,style:{position:"relative",width:"100%"},children:[e.jsxs("button",{onClick:()=>x(!b),style:{width:"100%",background:"rgba(240,249,255,1)",border:"1px solid rgba(217,242,255,1)",borderRadius:"8px",padding:"8px 16px 8px 8px",display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",textAlign:"left",minHeight:"56px"},children:[f?e.jsx(tr,{item:f,size:40}):e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)",flexShrink:0},children:"S"}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:(f==null?void 0:f.name)??"Select Company"}),p&&e.jsx("span",{style:{...Wa,color:"var(--Base_Color--Sky--500, #32a9ff)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:p})]}),e.jsx(v.ChevronUp,{size:16,color:"rgba(50,169,255,1)",style:{flexShrink:0,transition:"transform 0.2s ease",transform:b?"rotate(0deg)":"rotate(180deg)"}})]}),b&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:50,background:"var(--background, #fff)",border:"1px solid var(--border, #e5e7eb)",borderRadius:"8px",boxShadow:"0px 4px 12px 0px rgba(0,0,0,0.08)",overflow:"hidden"},children:e.jsx("div",{style:{maxHeight:"240px",overflowY:"auto"},children:a.map(y=>{const k=(r==null?void 0:r.id)===y.id;return e.jsxs("button",{onClick:()=>g(y),style:{width:"100%",display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",background:k?"rgba(240,249,255,0.6)":"none",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s",minHeight:"48px"},onMouseEnter:$=>{k||($.currentTarget.style.background="var(--accent, #f3f4f6)")},onMouseLeave:$=>{$.currentTarget.style.background=k?"rgba(240,249,255,0.6)":"none"},children:[e.jsx(tr,{item:y,size:36}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.name}),y.handle&&e.jsx("div",{style:{...La,color:"var(--muted-foreground, #6b7280)",marginTop:"2px"},children:y.handle})]}),k&&e.jsx(v.Check,{size:16,color:"var(--Base_Color--Sky--500, #32a9ff)",style:{flexShrink:0}})]},y.id)})})})]})}or.displayName="SidebarAccountSwitcher";const Ma={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Da={fontFamily:"var(--font-p)",fontSize:"var(--text-p)"},Aa={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},ja={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ea={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Oe({brand:r,accountSwitcher:t,groups:o,activeItem:a,onNavigate:s,collapsed:n=!1,onCollapsedChange:l,showCollapseToggle:d=!0,version:i,versionDate:h,width:b,className:x=""}){const[w,f]=c.useState(new Set),p=$=>{f(u=>{const m=new Set(u);return m.has($)?m.delete($):m.add($),m})},k=n?"var(--shell-sidebar-collapsed, 64px)":b??"var(--shell-sidebar-width, 240px)";return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 h-full ${x}`,style:{width:k,minWidth:k,transition:"width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1)), min-width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))",overflow:"visible"},children:[t?e.jsx("div",{className:`${n?"px-2 py-2":"px-3 py-3"} border-b border-sidebar-border flex items-center ${n?"justify-center":""}`,children:e.jsx(or,{...t,collapsed:n})}):r&&e.jsxs("div",{className:`${n?"px-2":"px-4"} py-4 border-b border-sidebar-border flex items-center ${n?"justify-center":"gap-2"}`,children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Aa,children:r.name.charAt(0).toUpperCase()}),!n&&e.jsx("span",{className:"text-sidebar-foreground truncate",style:Ma,children:r.name})]}),e.jsx("nav",{className:`flex-1 overflow-y-auto py-3 ${n?"px-1.5":"px-2"}`,children:o.map($=>{const u=w.has($.label);return e.jsxs("div",{className:"mb-4",children:[!n&&e.jsxs("button",{onClick:()=>p($.label),className:"w-full flex items-center justify-between px-2 mb-1.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",style:ja,children:[e.jsx("span",{children:$.label}),e.jsx(v.ChevronUp,{size:12,style:{transition:"transform 0.2s ease",transform:u?"rotate(180deg)":"rotate(0deg)"}})]}),n&&e.jsx("div",{className:"h-px bg-sidebar-border mx-1 mb-2 mt-1"}),!u&&e.jsx("div",{className:"space-y-0.5",children:$.items.map(m=>{const N=a===m.id,C=e.jsxs("button",{onClick:()=>s==null?void 0:s(m),className:`w-full flex items-center ${n?"justify-center":"gap-2"} ${n?"px-0":"px-2"} py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${N?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:Da,children:[e.jsx("span",{className:`flex-shrink-0 ${N?"text-sidebar-primary":"text-muted-foreground"}`,children:m.icon}),!n&&e.jsx("span",{className:"truncate flex-1 text-left",children:m.label}),m.badge!=null&&!n&&e.jsx("span",{className:"rounded-full bg-primary text-primary-foreground",style:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)",lineHeight:"1",padding:"2px 6px",display:"inline-flex",alignItems:"center",minWidth:"18px",justifyContent:"center"},children:String(m.badge)})]},m.id);return n?e.jsx("div",{className:"w-full flex",children:e.jsx(rr,{content:m.label,placement:"right",className:"flex-1",children:C})},m.id):C})})]},$.label)})}),(d&&l||i)&&e.jsxs("div",{className:`${n?"px-1.5":"px-3"} py-3 border-t border-sidebar-border flex flex-col gap-1`,children:[d&&l&&e.jsxs("button",{onClick:()=>l(!n),className:`w-full flex items-center ${n?"justify-center":"gap-2 px-2"} py-1.5 rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50 cursor-pointer`,style:Ea,title:n?"Expand sidebar":"Collapse sidebar",children:[n?e.jsx(v.PanelLeftOpen,{size:16}):e.jsx(v.PanelLeftClose,{size:16}),!n&&e.jsx("span",{children:"Collapse"})]}),i&&!n&&e.jsxs("div",{className:"px-2 flex items-center gap-1.5 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},children:[e.jsx("span",{children:i}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:h})]})]}),i&&n&&e.jsx("div",{className:"flex justify-center text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},title:`${i}${h?` · ${h}`:""}`,children:i})]})]})}Oe.displayName="Sidebar";function se({width:r,height:t,variant:o="rectangular",animate:a=!0,className:s}){const n="bg-muted",l=a?"animate-pulse":"",d=o==="circular"?"rounded-full":o==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${n} ${l} ${d} ${s??""}`,style:{width:r??"100%",height:t??(o==="text"?"1em":o==="circular"?40:20)}})}function Ta(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(se,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{variant:"text",width:"60%",height:20}),e.jsx(se,{variant:"text",width:"100%",height:14}),e.jsx(se,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:"40%",height:14}),e.jsx(se,{variant:"text",width:"25%",height:12})]})]})]})}function Ia(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex gap-4",children:[120,160,100,80].map((r,t)=>e.jsx(se,{variant:"text",width:r,height:14},t))}),[0,1,2,3].map(r=>e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-4",children:[e.jsx(se,{variant:"circular",width:28,height:28}),e.jsx(se,{variant:"text",width:100+r*15,height:14}),e.jsx(se,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(se,{variant:"rounded",width:60,height:22}),e.jsx(se,{variant:"text",width:80,height:14})]},r))]})}function ar({rows:r=3}){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:Array.from({length:r}).map((t,o)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-[var(--radius-md)] border border-border bg-card",children:[e.jsx(se,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:`${60+o*10}%`,height:14}),e.jsx(se,{variant:"text",width:`${40+o*5}%`,height:12})]}),e.jsx(se,{variant:"rounded",width:50,height:24})]},o))})}const Ba={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-[3px]",lg:"w-12 h-12 border-4",xl:"w-16 h-16 border-4"};function ft({size:r="md",color:t,className:o=""}){return e.jsx("div",{className:`${Ba[r]} rounded-full border-muted animate-spin ${o}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}ft.displayName="Spinner";const sr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ht={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ut={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},bt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_a={sm:{fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},md:{fontFamily:"var(--font-h2)",fontSize:"var(--text-h2)",fontWeight:"var(--weight-h2)"},lg:{fontFamily:"var(--font-h1)",fontSize:"var(--text-h1)",fontWeight:"var(--weight-h1)"}};function Ha({title:r,value:t,prefix:o,suffix:a,trend:s,trendLabel:n,icon:l,size:d="md",loading:i}){const h=_a[d],b=(s==null?void 0:s.direction)==="up"?"text-chart-2":(s==null?void 0:s.direction)==="down"?"text-destructive":"text-muted-foreground",x=(s==null?void 0:s.direction)==="up"?v.ArrowUpRight:(s==null?void 0:s.direction)==="down"?v.ArrowDownRight:v.Minus;return i?e.jsxs("div",{className:"space-y-2 animate-pulse",children:[e.jsx("div",{className:"h-3 w-20 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-8 w-32 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded-[var(--radius-sm)]"})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsx("span",{className:"text-muted-foreground",style:sr,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ht,children:o}),e.jsx("span",{className:"text-foreground",style:h,children:typeof t=="number"?t.toLocaleString():t}),a&&e.jsx("span",{className:"text-muted-foreground",style:sr,children:a})]}),s&&e.jsxs("div",{className:`flex items-center gap-1 ${b}`,children:[e.jsx(x,{size:14}),e.jsxs("span",{style:bt,children:[s.value,"%"]}),n&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:n})]})]})}function Pa({title:r,value:t,prefix:o,trend:a,trendLabel:s,icon:n,iconBg:l}){const d=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",i=(a==null?void 0:a.direction)==="up"?v.ArrowUpRight:(a==null?void 0:a.direction)==="down"?v.ArrowDownRight:v.Minus;return e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-5 overflow-hidden",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1 min-w-0 flex-1",children:[e.jsx("span",{className:"text-muted-foreground",style:sr,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ht,children:o}),e.jsx("span",{className:"text-foreground",style:{fontFamily:"var(--font-h3)",fontSize:"var(--text-h3)",fontWeight:"var(--weight-h3)"},children:typeof t=="number"?t.toLocaleString():t})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${d}`,children:[e.jsx(i,{size:12}),e.jsxs("span",{style:bt,children:[a.value,"%"]}),s&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:s})]})]}),n&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${l||"bg-primary/10 text-primary"}`,children:n})]})})}const Oa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},gt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},pt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},vt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function mt({steps:r,current:t,orientation:o="horizontal",onStepClick:a,className:s=""}){return o==="vertical"?e.jsx("div",{className:`flex flex-col ${s}`,children:r.map((n,l)=>{const d=l<t,i=l===t,h=n.disabled;return e.jsxs("div",{className:`flex gap-3 ${h?"opacity-50":""}`,onClick:()=>!h&&(a==null?void 0:a(l)),children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${h?"cursor-not-allowed":a?"cursor-pointer":""} ${d||i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:vt,children:d?e.jsx(v.Check,{size:14}):l+1}),l<r.length-1&&e.jsx("div",{className:`w-px flex-1 min-h-[24px] my-1 ${d?"bg-primary":"bg-border"}`})]}),e.jsxs("div",{className:`pb-6 ${l===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${i?"text-foreground":"text-muted-foreground"}`,style:i?gt:Oa,children:n.title}),n.description&&e.jsx("span",{className:"text-muted-foreground block",style:pt,children:n.description})]})]},l)})}):e.jsx("div",{className:`flex items-center ${s}`,children:r.map((n,l)=>{const d=l<t,i=l===t;return e.jsxs("div",{className:`flex items-center ${l<r.length-1?"flex-1":""} ${n.disabled?"opacity-50":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>!n.disabled&&(a==null?void 0:a(l)),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${n.disabled?"cursor-not-allowed":a?"cursor-pointer":""} ${d||i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:vt,children:d?e.jsx(v.Check,{size:14}):l+1}),e.jsx("span",{className:`text-center ${i?"text-foreground":"text-muted-foreground"}`,style:i?gt:pt,children:n.title})]}),l<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${d?"bg-primary":"bg-border"}`})]},l)})})}mt.displayName="Stepper";const Ya={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ga={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Ua={sm:{track:"w-7 h-4",thumb:"w-3 h-3",on:"translate-x-3"},md:{track:"w-10 h-6",thumb:"w-4.5 h-4.5",on:"translate-x-4.5"},lg:{track:"w-14 h-8",thumb:"w-6.5 h-6.5",on:"translate-x-6"}},Xa={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},Ka={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Za({checked:r,onChange:t,label:o,description:a,size:s="md",disabled:n,color:l="primary"}){const d=Ua[s],i=Ka[s];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${n?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:n,className:`${d.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Xa[l]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-background shadow-elevation-sm absolute transition-transform",style:{width:i.w,height:i.h,top:"50%",transform:`translateY(-50%) translateX(${r?i.on:2}px)`,left:0}})}),(o||a)&&e.jsxs("div",{children:[o&&e.jsx("span",{className:"text-foreground block",style:Ya,children:o}),a&&e.jsx("span",{className:"text-muted-foreground block",style:Ga,children:a})]})]})}const qa={default:"bg-muted/50 text-foreground border-border",primary:"bg-primary/10 text-primary border-primary/20",success:"bg-chart-2/10 text-chart-2 border-chart-2/20",warning:"bg-chart-5/10 text-chart-5 border-chart-5/20",destructive:"bg-destructive/10 text-destructive border-destructive/20",info:"bg-accent text-accent-foreground border-primary/20"},Ja={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Qa={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},md:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}};function xt({children:r,color:t="default",size:o="md",icon:a,closable:s,onClose:n,className:l=""}){const d=qa[t],i=Ja[o],h=Qa[o];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${d} ${i} ${l}`,style:h,children:[a&&e.jsx("span",{className:"flex-shrink-0",children:a}),r,s&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:n,children:e.jsx(v.X,{size:o==="sm"?10:12})})]})}xt.displayName="Tag";const Va={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ra={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},es={default:"bg-card border-border",outline:"bg-transparent border-border",filled:"bg-muted/30 border-transparent"};function yt({tags:r,onChange:t,placeholder:o,disabled:a,maxTags:s,variant:n="default",className:l=""}){const[d,i]=c.useState(""),h=()=>{const x=d.trim();!x||r.includes(x)||s&&r.length>=s||(t([...r,x]),i(""))},b=x=>{t(r.filter(w=>w!==x))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${es[n]} transition-colors focus-within:border-primary ${a?"opacity-50 pointer-events-none":""} ${l}`,children:[r.map(x=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-[var(--radius-sm)] bg-primary/10 text-primary",style:Ra,children:[x,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>b(x),children:e.jsx(v.X,{size:12})})]},x)),e.jsx("input",{value:d,onChange:x=>i(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),h()),x.key==="Backspace"&&!d&&r.length&&t(r.slice(0,-1))},placeholder:r.length?"":o,className:"flex-1 min-w-[80px] bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Va,disabled:a})]})}yt.displayName="TagInput";const rs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},wt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},nr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ts({items:r,variant:t="default",size:o="md"}){const a=o==="sm"?"w-6 h-6":o==="lg"?"w-10 h-10":"w-8 h-8",s=o==="sm"?12:o==="lg"?18:14,n=l=>l==="completed"?"bg-chart-2 text-primary-foreground":l==="current"?"bg-primary text-primary-foreground":l==="error"?"bg-destructive text-primary-foreground":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((l,d)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`${a} rounded-full flex items-center justify-center flex-shrink-0 ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(v.CheckCircle2,{size:s}):e.jsx(v.Circle,{size:s}))}),d<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 min-h-4 bg-border"})]}),e.jsxs("div",{className:"pb-4 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-foreground",style:wt,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:nr,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:nr,children:l.description})]})]},d))}):e.jsx("div",{className:"relative",children:r.map((l,d)=>{const i=t==="alternate"&&d%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${i?"flex-row-reverse":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`${a} rounded-full flex items-center justify-center ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(v.CheckCircle2,{size:s}):e.jsx(v.Circle,{size:s}))}),d<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 bg-border mt-1"})]}),e.jsxs("div",{className:`flex-1 min-w-0 ${i?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${i?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:wt,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:nr,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:rs,children:l.description}),l.children&&e.jsx("div",{className:"mt-2",children:l.children})]})]},d)})})}const Te={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function lr({brand:r,breadcrumbs:t,title:o,actions:a,user:s,height:n="72px",showSearch:l=!1,searchPlaceholder:d="Search... (Ctrl+K)",onSearchClick:i,notificationCount:h,onNotificationClick:b,onMobileMenuClick:x,onSidebarToggle:w,onUserClick:f,onBreadcrumbClick:p,workspaceSwitcher:g,className:y=""}){const k=s!=null&&s.name?s.name.split(" ").map($=>$[0]).join("").slice(0,2).toUpperCase():"";return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-5 gap-4 ${y}`,style:{height:n},children:[w&&e.jsx("button",{className:"w-9 h-9 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:w,title:"Toggle sidebar",children:e.jsx(v.Menu,{size:18})}),!w&&x&&e.jsx("button",{className:"lg:hidden w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:x,children:e.jsx(v.Menu,{size:16})}),r&&e.jsx(e.Fragment,{children:typeof r.logo=="string"?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):r.logo?e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] overflow-hidden flex-shrink-0",children:r.logo}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Te,children:r.name.charAt(0).toUpperCase()})}),g&&e.jsx("div",{className:"flex items-center ml-1",children:g}),o&&e.jsx("span",{className:"text-foreground hidden sm:block truncate",style:Te,children:o}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:Te,children:t.map(($,u)=>e.jsxs(c.Fragment,{children:[u>0&&e.jsx(v.ChevronRight,{size:12}),$.href||p?e.jsx("span",{className:`cursor-pointer ${u===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>p==null?void 0:p($,u),children:$.label}):e.jsx("span",{className:u===t.length-1?"text-foreground":"",children:$.label})]},u))}),e.jsx("div",{className:"flex-1"}),l&&e.jsxs("div",{className:"hidden md:flex items-center gap-2 px-3 h-8 rounded-[var(--radius)] border border-border bg-muted/20 text-muted-foreground w-56 cursor-pointer hover:border-primary/40 transition-colors",onClick:i,children:[e.jsx(v.Search,{size:14}),e.jsx("span",{style:Te,children:d})]}),a,b&&e.jsxs("button",{className:"relative w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:b,children:[e.jsx(v.Bell,{size:16}),h!==void 0&&h>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),s&&e.jsx("div",{className:"cursor-pointer",onClick:f,children:s.avatar?e.jsx("img",{src:s.avatar,alt:s.name,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center",style:Te,children:k})})]})}lr.displayName="TopNavbar";const os={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ir={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function St({title:r,items:t,selected:o,onToggle:a,search:s,onSearch:n,searchable:l}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-md)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-3 py-2.5 border-b border-border bg-muted/30 flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:Nt,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:ir,children:[t.length," items"]})]}),l&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(v.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:s,onChange:d=>n(d.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:ir})]}),e.jsxs("div",{className:"max-h-[240px] overflow-y-auto py-1",children:[t.length===0&&e.jsx("div",{className:"px-3 py-6 text-center text-muted-foreground",style:ir,children:"No items"}),t.map(d=>e.jsxs("button",{onClick:()=>!d.disabled&&a(d.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
|
|
87
87
|
${o.has(d.id)?"bg-primary/10":"hover:bg-accent"}
|
|
88
88
|
${d.disabled?"opacity-40 pointer-events-none":""}`,style:os,children:[e.jsx("span",{className:`w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center flex-shrink-0
|
|
89
|
-
${o.has(d.id)?"bg-primary border-primary":"border-border"}`,children:o.has(d.id)&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"text-foreground truncate",children:d.label})]},d.id))]})]})}function as({sourceTitle:r="Available",targetTitle:t="Selected",items:o,defaultTarget:a=[],searchable:s,value:n,onChange:l,loading:d=!1,error:i}){const[h,
|
|
89
|
+
${o.has(d.id)?"bg-primary border-primary":"border-border"}`,children:o.has(d.id)&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"text-foreground truncate",children:d.label})]},d.id))]})]})}function as({sourceTitle:r="Available",targetTitle:t="Selected",items:o,defaultTarget:a=[],searchable:s,value:n,onChange:l,loading:d=!1,error:i}){const[h,b]=c.useState(new Set(a)),x=n!==void 0?new Set(n):h,w=z=>{l&&l(Array.from(z)),n===void 0&&b(z)},[f,p]=c.useState(new Set),[g,y]=c.useState(new Set),[k,$]=c.useState(""),[u,m]=c.useState(""),N=o.filter(z=>!x.has(z.id)),C=o.filter(z=>x.has(z.id)),L=k?N.filter(z=>z.label.toLowerCase().includes(k.toLowerCase())):N,M=u?C.filter(z=>z.label.toLowerCase().includes(u.toLowerCase())):C,W=()=>{const z=new Set(x);f.forEach(E=>z.add(E)),w(z),p(new Set)},D=()=>{const z=new Set(x);g.forEach(E=>z.delete(E)),w(z),y(new Set)},T=()=>{w(new Set(o.filter(z=>!z.disabled).map(z=>z.id))),p(new Set)},A=()=>{w(new Set),y(new Set)},S=(z,E,I)=>{const H=new Set(E);H.has(z)?H.delete(z):H.add(z),I(H)};return i?e.jsx("div",{className:"flex items-center justify-center rounded-[var(--radius-md)] border border-border bg-card px-6 py-10 text-center",children:e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",color:"var(--destructive)"},children:i})}):d?e.jsx("div",{className:"flex items-stretch gap-3 flex-wrap opacity-60 pointer-events-none",children:[r,t].map(z=>e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-md)] border border-border bg-card overflow-hidden",children:[e.jsx("div",{className:"px-3 py-2.5 border-b border-border bg-muted/30",children:e.jsx("span",{style:Nt,children:z})}),e.jsx("div",{className:"p-3 flex flex-col gap-2",children:[1,2,3,4].map(E=>e.jsx("div",{className:"h-8 rounded bg-muted/50 animate-pulse"},E))})]},z))}):e.jsxs("div",{className:"flex items-stretch gap-3 flex-wrap",children:[e.jsx(St,{title:r,items:L,selected:f,onToggle:z=>S(z,f,p),search:k,onSearch:$,searchable:s}),e.jsxs("div",{className:"flex flex-col items-center justify-center gap-1.5 py-4",children:[e.jsx("button",{onClick:T,disabled:N.length===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(v.ChevronsRight,{size:14})}),e.jsx("button",{onClick:W,disabled:f.size===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(v.ChevronRight,{size:14})}),e.jsx("button",{onClick:D,disabled:g.size===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(v.ChevronLeft,{size:14})}),e.jsx("button",{onClick:A,disabled:C.length===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(v.ChevronsLeft,{size:14})})]}),e.jsx(St,{title:t,items:M,selected:g,onToggle:z=>S(z,g,y),search:u,onSearch:m,searchable:s})]})}const dr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function kt({node:r,level:t,expanded:o,selected:a,onToggle:s,onSelect:n,selectable:l,showLines:d}){const i=r.children&&r.children.length>0,h=o.has(r.id),b=a.has(r.id),x=i?h?e.jsx(v.FolderOpen,{size:14,className:"text-chart-5"}):e.jsx(v.Folder,{size:14,className:"text-chart-5"}):e.jsx(v.File,{size:14,className:"text-muted-foreground"});return e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-1.5 py-1 px-2 rounded-[var(--radius-sm)] transition-colors
|
|
90
90
|
${r.disabled?"opacity-40 pointer-events-none":"cursor-pointer hover:bg-accent"}
|
|
91
|
-
${
|
|
91
|
+
${b?"bg-primary/10 text-primary":"text-foreground"}`,style:{paddingLeft:`${t*20+8}px`,...dr},onClick:()=>{i&&s(r.id),l&&n(r.id)},children:[i?e.jsx("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:h?e.jsx(v.ChevronDown,{size:12}):e.jsx(v.ChevronRight,{size:12})}):e.jsx("span",{className:"w-4"}),l&&e.jsx("span",{className:`w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center flex-shrink-0 ${b?"bg-primary border-primary":"border-border"}`,children:b&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"flex-shrink-0",children:r.icon||x}),e.jsx("span",{className:"truncate",children:r.label})]}),i&&h&&e.jsx("div",{className:d?"border-l border-border ml-[22px]":"",children:r.children.map(w=>e.jsx(kt,{node:w,level:t+1,expanded:o,selected:a,onToggle:s,onSelect:n,selectable:l,showLines:d},w.id))})]})}function ss({data:r,selectable:t,showLines:o,defaultExpanded:a,expandedItems:s,onExpandChange:n,selectedItems:l,onSelect:d,loading:i=!1,error:h,emptyMessage:b="No items"}){const[x,w]=c.useState(new Set(a||[])),[f,p]=c.useState(new Set),g=s!==void 0?new Set(s):x,y=l!==void 0?new Set(l):f,k=u=>{const m=new Set(g);m.has(u)?m.delete(u):m.add(u),n&&n(Array.from(m)),s===void 0&&w(m)},$=u=>{const m=new Set(y);m.has(u)?m.delete(u):m.add(u),d&&d(Array.from(m)),l===void 0&&p(m)};return h?e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card px-4 py-8 text-center",children:e.jsx("span",{style:{...dr,color:"var(--destructive)"},children:h})}):i?e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card py-2 px-3 flex flex-col gap-2",children:[1,2,3,4,5].map(u=>e.jsx("div",{className:"h-7 rounded bg-muted/50 animate-pulse",style:{width:`${60+u%3*15}%`}},u))}):e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card py-1",children:r.length===0?e.jsx("div",{className:"px-4 py-8 text-center text-muted-foreground",style:dr,children:b}):r.map(u=>e.jsx(kt,{node:u,level:0,expanded:g,selected:y,onToggle:k,onSelect:$,selectable:t,showLines:o},u.id))})}const ns={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},cr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},$t=c.createContext({name:""});function ls(){return c.useContext($t)}function fr({htmlFor:r,required:t,children:o,className:a=""}){return e.jsxs("label",{htmlFor:r,className:`block text-foreground mb-1.5 ${a}`,style:ns,children:[o,t&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]})}function zt({message:r,className:t=""}){return r?e.jsxs("div",{className:`flex items-center gap-1 mt-1.5 text-destructive ${t}`,style:cr,role:"alert",children:[e.jsx(v.AlertCircle,{size:12,className:"flex-shrink-0"}),e.jsx("span",{children:r})]}):null}function Ct({message:r,className:t=""}){return r?e.jsxs("div",{className:`flex items-center gap-1 mt-1.5 text-chart-2 ${t}`,style:cr,role:"status",children:[e.jsx(v.CheckCircle2,{size:12,className:"flex-shrink-0"}),e.jsx("span",{children:r})]}):null}function Ft({children:r,className:t=""}){return e.jsx("p",{className:`mt-1.5 text-muted-foreground ${t}`,style:cr,children:r})}function is({name:r,label:t,required:o,error:a,successMessage:s,helperText:n,layout:l="vertical",labelWidth:d="160px",children:i,className:h=""}){const b=l==="horizontal",x=a?e.jsx(zt,{message:a}):s?e.jsx(Ct,{message:s}):n?e.jsx(Ft,{children:n}):null;return e.jsx($t.Provider,{value:{name:r,error:a},children:b?e.jsxs("div",{className:`flex items-start gap-4 ${h}`,children:[t&&e.jsx("div",{style:{width:d,flexShrink:0,paddingTop:"6px"},children:e.jsx(fr,{htmlFor:r,required:o,children:t})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[i,x]})]}):e.jsxs("div",{className:`${h}`,children:[t&&e.jsx(fr,{htmlFor:r,required:o,children:t}),i,x]})})}const ds={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},cs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},fs={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},hs={sm:"h-8",md:"h-10",lg:"h-12"},Wt={sm:14,md:16,lg:18};function us({value:r,defaultValue:t=0,onChange:o,min:a,max:s,step:n=1,disabled:l,size:d="md",label:i,placeholder:h,error:b,className:x=""}){const[w,f]=c.useState(t),p=r??w,g=$=>{const u=Math.max(a??-1/0,Math.min(s??1/0,$));o&&o(u),r===void 0&&f(u)},y=a===void 0||p-n>=a,k=s===void 0||p+n<=s;return e.jsxs("div",{className:x,children:[i&&e.jsx("label",{className:"block text-foreground mb-1.5",style:ds,children:i}),e.jsxs("div",{className:`inline-flex items-center rounded-[var(--radius-md)] border ${b?"border-destructive":"border-border"} bg-background overflow-hidden ${l?"opacity-50 pointer-events-none":""}`,children:[e.jsx("button",{type:"button",onClick:()=>g(p-n),disabled:l||!y,className:"flex items-center justify-center px-2.5 border-r border-border text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors cursor-pointer",style:{height:"100%"},children:e.jsx(v.Minus,{size:Wt[d]})}),e.jsx("input",{type:"number",value:p,placeholder:h,onChange:$=>{const u=parseFloat($.target.value);isNaN(u)||g(u)},disabled:l,className:`w-20 text-center bg-transparent outline-none text-foreground ${hs[d]} [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none`,style:cs}),e.jsx("button",{type:"button",onClick:()=>g(p+n),disabled:l||!k,className:"flex items-center justify-center px-2.5 border-l border-border text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors cursor-pointer",style:{height:"100%"},children:e.jsx(v.Plus,{size:Wt[d]})})]}),b&&e.jsx("p",{className:"mt-1.5 text-destructive",style:fs,children:b})]})}const bs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},gs={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},ps={sm:"w-9 h-9",md:"w-11 h-11",lg:"w-14 h-14"};function vs({length:r=6,value:t,onChange:o,onComplete:a,disabled:s,error:n,size:l="md",label:d,masked:i,className:h=""}){const[b,x]=c.useState(()=>"".padEnd(r,"")),w=c.useRef([]),p=(t??b).padEnd(r,"").split("").slice(0,r),g=c.useCallback(u=>{o&&o(u),t===void 0&&x(u),u.replace(/ /g,"").length===r&&a&&a(u)},[o,a,t,r]),y=(u,m)=>{var L;if(!/^\d$/.test(m))return;const N=p.slice();N[u]=m;const C=N.join("");g(C),u<r-1&&((L=w.current[u+1])==null||L.focus())},k=(u,m)=>{var N,C,L;if(m.key==="Backspace"){m.preventDefault();const M=p.slice();M[u]!==" "&&M[u]!==""?(M[u]=" ",g(M.join(""))):u>0&&(M[u-1]=" ",g(M.join("")),(N=w.current[u-1])==null||N.focus())}else m.key==="ArrowLeft"&&u>0?(C=w.current[u-1])==null||C.focus():m.key==="ArrowRight"&&u<r-1&&((L=w.current[u+1])==null||L.focus())},$=u=>{var N;u.preventDefault();const m=u.clipboardData.getData("text").replace(/\D/g,"").slice(0,r);if(m){g(m.padEnd(r," "));const C=Math.min(m.length,r-1);(N=w.current[C])==null||N.focus()}};return e.jsxs("div",{className:h,children:[d&&e.jsx("label",{className:"block text-foreground mb-2",style:bs,children:d}),e.jsx("div",{className:"flex gap-2",onPaste:$,children:p.map((u,m)=>e.jsx("input",{ref:N=>{w.current[m]=N},type:i?"password":"text",inputMode:"numeric",maxLength:1,value:u===" "?"":u,disabled:s,onChange:N=>{const C=N.target.value;C&&y(m,C[C.length-1])},onKeyDown:N=>k(m,N),onFocus:N=>N.target.select(),className:`${ps[l]} text-center rounded-[var(--radius-md)] border outline-none transition-all
|
|
92
92
|
${n?"border-destructive focus:ring-2 focus:ring-destructive/30":"border-border focus:border-primary focus:ring-2 focus:ring-primary/20"}
|
|
93
93
|
${s?"opacity-50 pointer-events-none bg-muted":"bg-background"}
|
|
94
|
-
text-foreground`,style:{fontFamily:"var(--font-button)",fontWeight:"var(--weight-button)"}},w))}),n&&e.jsx("p",{className:"mt-2 text-destructive",style:gs,children:n})]})}const ms={fontFamily:"var(--font-h3, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-h3, 28px)",fontWeight:"var(--weight-h3, 700)",color:"var(--foreground)",lineHeight:1.3},xs={fontFamily:"var(--font-p, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-p, 20px)",fontWeight:"var(--weight-p, 400)",color:"var(--muted-foreground)",lineHeight:1.4},ys={fontFamily:"var(--font-label, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-label)"};function ws({title:r,subtitle:t,breadcrumb:o,actions:a,tabs:s,sticky:n=!1,className:l=""}){return e.jsxs("div",{className:`bg-card border-b border-border ${n?"sticky top-0 z-10":""} ${l}`,children:[e.jsxs("div",{className:"px-6 pt-5 pb-4",children:[o&&e.jsx("div",{className:"mb-2",style:ys,children:o}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{style:ms,className:"truncate",children:r}),t&&e.jsx("p",{className:"mt-0.5",style:xs,children:t})]}),a&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 pt-0.5",children:a})]})]}),s&&e.jsx("div",{className:"px-6",children:s})]})}const Ns={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ye={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400};function Ss({config:r,value:t,onChange:o}){var h;const[a,s]=c.useState(!1),n=Array.isArray(t)?t:t?[t]:[],l=n.length>0,d=c.useCallback(u=>{if(r.type==="single"){const x=n[0]===u?null:u;o(r.key,x),s(!1)}else{const x=n.includes(u)?n.filter(y=>y!==u):[...n,u];o(r.key,x.length?x:null)}},[r,n,o]),i=n.length===1?(h=r.options.find(u=>u.value===n[0]))==null?void 0:h.label:n.length>1?`${r.label} (${n.length})`:r.label;return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>s(u=>!u),className:`inline-flex items-center gap-1.5 h-9 px-3 rounded-lg border transition-colors cursor-pointer select-none ${l?"bg-[var(--primary)]/10 border-[var(--primary)] text-[var(--primary)]":"bg-[var(--background)] border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ns,children:[i,l&&e.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-[var(--primary)] text-primary-foreground font-bold",style:{fontSize:"var(--text-label)",lineHeight:1},children:n.length}),e.jsx(v.ChevronDown,{size:14,className:`transition-transform ${a?"rotate-180":""}`})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),e.jsx("div",{className:"absolute left-0 top-full mt-1 z-20 bg-[var(--card)] border border-[var(--border)] rounded-lg shadow-elevation-sm min-w-[160px] py-1 overflow-hidden",children:r.options.map(u=>{const x=n.includes(u.value);return e.jsxs("button",{type:"button",onClick:()=>d(u.value),className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors cursor-pointer ${x?"bg-[var(--primary)]/10 text-[var(--primary)]":"text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ye,children:[r.type==="multi"&&e.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border flex-shrink-0 ${x?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":"border-[var(--border)]"}`,children:x&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),u.label]},u.value)})})]})]})}function ks({filters:r=[],searchPlaceholder:t="Search...",showSearch:o=!0,value:a,onFilterChange:s,className:n=""}){const[l,d]=c.useState({search:"",filters:{}}),i=a??l,h=c.useCallback(g=>{d(g),s==null||s(g)},[s]),u=c.useCallback(g=>{h({...i,search:g.target.value})},[i,h]),x=c.useCallback((g,m)=>{h({...i,filters:{...i.filters,[g]:m}})},[i,h]),y=c.useCallback(()=>{h({search:"",filters:{}})},[h]),f=Object.values(i.filters).filter(g=>g!==null&&(!Array.isArray(g)||g.length>0)).length,p=f>0||i.search&&i.search.length>0;return e.jsxs("div",{className:`flex items-center gap-2 flex-wrap bg-[var(--background)] border border-[var(--border)] rounded-lg px-3 py-2 ${n}`,children:[o&&e.jsxs("div",{className:"relative flex items-center",children:[e.jsx(v.Search,{size:14,className:"absolute left-2.5 text-[var(--muted-foreground)] pointer-events-none"}),e.jsx("input",{type:"text",value:i.search??"",onChange:u,placeholder:t,className:"h-8 pl-8 pr-3 rounded-md border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)] placeholder:text-[var(--muted-foreground)] focus:outline-none focus:border-[var(--primary)] focus:ring-1 focus:ring-[var(--primary)] transition-colors min-w-[200px]",style:Ye})]}),o&&r.length>0&&e.jsx("div",{className:"w-px h-5 bg-[var(--border)] flex-shrink-0"}),r.length>0&&e.jsx(v.SlidersHorizontal,{size:14,className:"text-[var(--muted-foreground)] flex-shrink-0"}),r.map(g=>e.jsx(Ss,{config:g,value:i.filters[g.key]??null,onChange:x},g.key)),f>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-[var(--primary)]/10 text-[var(--primary)]",style:Ye,children:[f," active"]}),p&&e.jsxs("button",{type:"button",onClick:y,className:"inline-flex items-center gap-1 h-7 px-2 rounded-md text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--muted)] transition-colors cursor-pointer ml-auto",style:Ye,children:[e.jsx(v.X,{size:12}),"Clear all"]})]})}const Lt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},hr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ve={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400},fe={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function $s({width:r}){return e.jsx("div",{className:"h-4 rounded bg-muted animate-pulse",style:{width:r??"80%"}})}function zs({columns:r,hidden:t,onToggle:o}){const[a,s]=c.useState(!1),n=c.useRef(null);c.useEffect(()=>{function d(i){n.current&&!n.current.contains(i.target)&&s(!1)}return a&&document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[a]);const l=r.filter(d=>d.hideable!==!1);return e.jsxs("div",{ref:n,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>s(d=>!d),className:"inline-flex items-center gap-1.5 h-8 px-3 rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--muted-foreground)] hover:bg-[var(--muted)] hover:text-[var(--foreground)] transition-colors cursor-pointer",style:ve,children:[e.jsx(v.Columns3,{size:14}),"Columns"]}),a&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-30 bg-[var(--card)] border border-[var(--border)] rounded-lg shadow-elevation-sm w-44 py-1",children:l.map(d=>{const i=!t.has(d.key);return e.jsxs("button",{type:"button",onClick:()=>o(d.key),className:"w-full flex items-center justify-between gap-2 px-3 py-2 hover:bg-[var(--muted)] text-[var(--foreground)] transition-colors cursor-pointer",style:ve,children:[e.jsx("span",{children:d.header}),i&&e.jsx(v.Check,{size:13,className:"text-[var(--primary)]"})]},d.key)})})]})}function Cs({count:r,actions:t,selectedKeys:o,onClear:a}){return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 bg-[var(--primary)]/8 border-b border-[var(--primary)]/20",children:[e.jsxs("span",{className:"text-[var(--primary)] flex-shrink-0",style:Lt,children:[r," selected"]}),e.jsx("div",{className:"flex items-center gap-2 flex-1 flex-wrap",children:t.map((s,n)=>e.jsxs("button",{type:"button",onClick:()=>s.onClick(o),className:`inline-flex items-center gap-1.5 h-7 px-3 rounded-md border transition-colors cursor-pointer ${s.variant==="destructive"?"border-[var(--destructive)] text-[var(--destructive)] hover:bg-[var(--destructive)]/10":"border-[var(--primary)] text-[var(--primary)] hover:bg-[var(--primary)]/10"}`,style:{...ve,fontWeight:500},children:[s.icon,s.label]},n))}),e.jsx("button",{type:"button",onClick:a,className:"text-[var(--muted-foreground)] hover:text-[var(--foreground)] transition-colors cursor-pointer p-1 rounded",title:"Clear selection",children:e.jsx(v.X,{size:14})})]})}const Fs=[10,20,50,100];function Ws({meta:r,onPageChange:t}){const{page:o,pageSize:a,totalCount:s}=r,n=Math.max(1,Math.ceil(s/a)),l=s===0?0:(o-1)*a+1,d=Math.min(o*a,s),i=c.useMemo(()=>{const h=[];if(n<=7)for(let u=1;u<=n;u++)h.push(u);else{h.push(1),o>3&&h.push("...");for(let u=Math.max(2,o-1);u<=Math.min(n-1,o+1);u++)h.push(u);o<n-2&&h.push("..."),h.push(n)}return h},[o,n]);return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[var(--border)] flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[var(--muted-foreground)] whitespace-nowrap",style:ve,children:[l,"–",d," of ",s.toLocaleString()]}),e.jsx("select",{value:a,onChange:h=>t(1,Number(h.target.value)),className:"h-7 px-2 rounded-md border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)] focus:outline-none focus:border-[var(--primary)] cursor-pointer",style:ve,children:Fs.map(h=>e.jsxs("option",{value:h,children:[h," / page"]},h))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ur,{disabled:o===1,onClick:()=>t(o-1,a),label:"‹ Prev"}),i.map((h,u)=>h==="..."?e.jsx("span",{className:"px-2 text-[var(--muted-foreground)]",style:ve,children:"…"},`ellipsis-${u}`):e.jsx(ur,{active:h===o,onClick:()=>t(h,a),label:String(h)},h)),e.jsx(ur,{disabled:o===n,onClick:()=>t(o+1,a),label:"Next ›"})]})]})}function ur({label:r,active:t,disabled:o,onClick:a}){return e.jsx("button",{type:"button",onClick:a,disabled:o,className:`min-w-[28px] h-7 px-2 rounded-md border transition-colors cursor-pointer ${t?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":o?"border-transparent text-[var(--muted-foreground)] cursor-not-allowed":"border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:{...ve,fontWeight:t?600:400},children:r})}function Ls({columns:r,data:t,rowKey:o="id",pagination:a,sortBy:s,sortOrder:n,onPageChange:l,onSortChange:d,selectable:i=!1,selectedRows:h,onSelectionChange:u,bulkActions:x=[],onRowClick:y,expandedRowRender:f,loading:p=!1,loadingRows:g=5,error:m,emptyMessage:k="No data found",emptyDescription:z,showColumnToggle:b=!1,size:w="md",stickyHeader:N=!1,className:F=""}){const[L,M]=c.useState(new Set(r.filter(B=>B.defaultHidden).map(B=>B.key))),W=c.useCallback(B=>{M(V=>{const J=new Set(V);return J.has(B)?J.delete(B):J.add(B),J})},[]),D=c.useMemo(()=>r.filter(B=>!L.has(B.key)),[r,L]),[T,A]=c.useState(new Set),S=h??T,$=c.useCallback(B=>{h||A(B);const V=t.filter(J=>B.has(J[o]));u==null||u(B,V)},[h,t,o,u]),E=c.useMemo(()=>t.map(B=>B[o]),[t,o]),I=E.length>0&&E.every(B=>S.has(B)),H=S.size>0&&!I,P=c.useCallback(()=>{$(I?new Set:new Set(E))},[I,E,$]),_=c.useCallback(B=>{const V=new Set(S);V.has(B)?V.delete(B):V.add(B),$(V)},[S,$]),[Q,O]=c.useState(new Set),Z=c.useCallback(B=>{O(V=>{const J=new Set(V);return J.has(B)?J.delete(B):J.add(B),J})},[]),oe=c.useCallback(B=>{d&&(s===B?d(B,n==="asc"?"desc":"asc"):d(B,"asc"))},[s,n,d]),X=c.useMemo(()=>{const B={};let V=0;i&&(V+=48),f&&(V+=40);for(const J of D)if(J.frozen){B[J.key]=V;const le=typeof J.width=="number"?J.width:parseInt(J.width??"120");V+=isNaN(le)?120:le}return B},[D,i,f]),re=D.length+(i?1:0)+(f?1:0),U="sticky z-[2] bg-inherit";return e.jsxs("div",{className:`rounded-[var(--radius-md)] border border-[var(--border)] overflow-hidden ${F}`,children:[b&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-2.5 border-b border-[var(--border)] bg-[var(--background)]",children:e.jsx(zs,{columns:r,hidden:L,onToggle:W})}),i&&S.size>0&&x.length>0&&e.jsx(Cs,{count:S.size,actions:x,selectedKeys:Array.from(S),onClear:()=>$(new Set)}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",style:{minWidth:"100%"},children:[e.jsx("thead",{className:N?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"border-b border-border",style:{backgroundColor:"color-mix(in srgb, var(--muted) 30%, var(--background) 70%)"},children:[f&&e.jsx("th",{className:`${fe[w]} w-10`}),i&&e.jsx("th",{className:`${fe[w]} w-12`,children:e.jsx(Fe,{size:"sm",checked:I,indeterminate:H&&!I,onChange:P})}),D.map(B=>{const V=B.frozen&&B.key in X,J=s===B.key;return e.jsx("th",{className:`${fe[w]} text-${B.align??"left"} text-[var(--foreground)] whitespace-nowrap select-none ${B.sortable&&d?"cursor-pointer hover:text-[var(--primary)]":""} ${V?U:""}`,style:{...Lt,width:B.width,minWidth:B.minWidth??80,...V?{left:X[B.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},onClick:()=>B.sortable&&oe(B.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[B.header,B.sortable&&d&&e.jsx("span",{className:J?"text-[var(--primary)]":"text-[var(--muted-foreground)]/60",children:J?n==="asc"?e.jsx(v.ChevronUp,{size:13}):e.jsx(v.ChevronDown,{size:13}):e.jsx(v.ChevronsUpDown,{size:12})})]})},B.key)})]})}),e.jsxs("tbody",{children:[m&&e.jsx("tr",{children:e.jsx("td",{colSpan:re,className:`${fe[w]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-10",children:[e.jsx(v.AlertCircle,{size:32,className:"text-[var(--destructive)] opacity-60"}),e.jsx("span",{className:"text-[var(--destructive)]",style:hr,children:m})]})})}),!m&&p&&Array.from({length:g}).map((B,V)=>e.jsxs("tr",{className:"border-b border-[var(--border)] last:border-b-0",children:[f&&e.jsx("td",{className:`${fe[w]} w-10`}),i&&e.jsx("td",{className:`${fe[w]} w-12`,children:e.jsx("div",{className:"w-4 h-4 rounded bg-muted animate-pulse"})}),D.map(J=>e.jsx("td",{className:`${fe[w]}`,children:e.jsx($s,{width:J.align==="right"?"60%":J.align==="center"?"50%":"75%"})},J.key))]},`skel-${V}`)),!m&&!p&&t.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:re,className:`${fe[w]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-[var(--muted)] flex items-center justify-center text-[var(--muted-foreground)]",children:e.jsx(v.ChevronsUpDown,{size:20})}),e.jsx("span",{className:"text-[var(--foreground)]",style:hr,children:k}),z&&e.jsx("span",{className:"text-[var(--muted-foreground)]",style:ve,children:z})]})})}),!m&&!p&&t.map((B,V)=>{const J=B[o],le=S.has(J),me=Q.has(J),Ie=!!y||!!f;return e.jsxs(c.Fragment,{children:[e.jsxs("tr",{className:`group/row border-b border-[var(--border)] last:border-b-0 transition-colors ${le?"bg-primary/5":"bg-[var(--card)] hover:bg-[var(--row-hover-bg)]"} ${Ie?"cursor-pointer":""}`,onClick:()=>{y==null||y(B),f&&Z(J)},children:[f&&e.jsx("td",{className:`${fe[w]} w-10 text-center`,onClick:q=>{q.stopPropagation(),Z(J)},children:e.jsx(v.ChevronRight,{size:14,className:`text-[var(--muted-foreground)] transition-transform mx-auto ${me?"rotate-90":""}`})}),i&&e.jsx("td",{className:`${fe[w]} w-12`,onClick:q=>q.stopPropagation(),children:e.jsx(Fe,{size:"sm",checked:le,onChange:()=>_(J)})}),D.map(q=>{const xe=q.frozen&&q.key in X,Ne=xe?le?"sticky z-[1] bg-primary/5":"sticky z-[1] bg-[var(--card)] group-hover/row:bg-[var(--row-hover-bg)] transition-colors":"";return e.jsx("td",{className:`${fe[w]} text-${q.align??"left"} text-[var(--foreground)] ${Ne}`,style:{...hr,...xe?{left:X[q.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},children:q.render?q.render(B[q.key],B,V):B[q.key]},q.key)})]}),f&&me&&e.jsx("tr",{className:"bg-[var(--muted)] border-b border-[var(--border)]",children:e.jsx("td",{colSpan:re,className:"px-6 py-4",children:f(B)})})]},J??V)})]})]})}),a&&l&&!p&&!m&&e.jsx(Ws,{meta:a,onPageChange:l})]})}const We=["var(--chart-1, #32a9ff)","var(--chart-2, #22c55e)","var(--chart-3, #f59e0b)","var(--chart-4, #ef4444)","var(--chart-5, #a855f7)","var(--chart-6, #06b6d4)"];function ie(r,t){return r.color??We[t%We.length]}const ne={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function br(r,t,o){return Math.max(t,Math.min(o,r))}function Ge(r){const t=Math.max(...r,0);if(t===0)return 10;const o=Math.pow(10,Math.floor(Math.log10(t)));return Math.ceil(t/o)*o}function gr(r,t){if(r.length===0)return"";if(!t||r.length<3)return r.map((a,s)=>`${s===0?"M":"L"}${a[0]},${a[1]}`).join(" ");let o=`M${r[0][0]},${r[0][1]}`;for(let a=1;a<r.length;a++){const s=r[a-1],n=r[a],l=s[0]+(n[0]-s[0])*.4,d=n[0]-(n[0]-s[0])*.4;o+=` C${l},${s[1]} ${d},${n[1]} ${n[0]},${n[1]}`}return o}function pr({x:r,y:t,label:o,items:a}){return e.jsx("foreignObject",{x:r,y:t,width:160,height:40+a.length*22,style:{overflow:"visible"},children:e.jsxs("div",{className:"bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_16px_rgba(0,0,0,0.12)] p-2 pointer-events-none",style:{width:"max-content",...ne},children:[e.jsx("div",{className:"text-muted-foreground mb-1",children:o}),a.map(s=>e.jsxs("div",{className:"flex items-center gap-1.5 text-foreground",children:[e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:s.color}}),e.jsxs("span",{className:"truncate",children:[s.name,":"]}),e.jsx("span",{className:"font-medium ml-auto pl-2",children:s.value.toLocaleString()})]},s.name))]})})}function Mt({series:r,height:t=240,width:o,showXAxis:a=!0,showYAxis:s=!0,showGrid:n=!0,showLegend:l=!0,showTooltip:d=!0,showDots:i=!0,smooth:h=!1,className:u=""}){c.useId();const x=c.useRef(null),[y,f]=c.useState(null);if(!r.length||!r[0].data.length)return null;const p=r[0].data.map(T=>T.label),g=r.flatMap(T=>T.data.map(A=>A.value)),m=Ge(g),k=0,z={top:12,right:16,bottom:a?36:12,left:s?48:16},b=o??600,w=t,N=b-z.left-z.right,F=w-z.top-z.bottom,L=p.length>1?N/(p.length-1):N;function M(T){return z.left+T*L}function W(T){return z.top+F-(T-k)/(m-k||1)*F}const D=Array.from({length:5},(T,A)=>k+A/4*(m-k));return e.jsxs("div",{className:`w-full ${u}`,children:[e.jsxs("svg",{ref:x,width:o?b:"100%",height:w,viewBox:`0 0 ${b} ${w}`,onMouseLeave:()=>f(null),children:[n&&D.map((T,A)=>e.jsx("line",{x1:z.left,y1:W(T),x2:b-z.right,y2:W(T),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},A)),s&&D.map((T,A)=>e.jsx("text",{x:z.left-8,y:W(T)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:ne,children:T>=1e3?`${(T/1e3).toFixed(1)}k`:T},A)),a&&p.map((T,A)=>{const S=Math.max(1,Math.floor(p.length/8));return A%S!==0&&A!==p.length-1?null:e.jsx("text",{x:M(A),y:w-z.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:ne,children:T},A)}),r.map((T,A)=>{const S=ie(T,A),$=T.data.map((I,H)=>[M(H),W(I.value)]),E=gr($,h);return e.jsxs("g",{children:[e.jsx("path",{d:E,fill:"none",stroke:S,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),i&&$.map(([I,H],P)=>e.jsx("circle",{cx:I,cy:H,r:3,fill:"var(--card)",stroke:S,strokeWidth:2},P))]},A)}),d&&p.map((T,A)=>e.jsx("rect",{x:M(A)-L/2,y:z.top,width:L,height:F,fill:"transparent",onMouseEnter:()=>f({x:M(A),y:z.top,labelIdx:A})},A)),y&&e.jsx("line",{x1:M(y.labelIdx),y1:z.top,x2:M(y.labelIdx),y2:z.top+F,stroke:"var(--border)",strokeWidth:1,strokeDasharray:"4 2"}),y&&d&&e.jsx(pr,{x:br(M(y.labelIdx)+8,z.left,b-180),y:z.top,label:p[y.labelIdx],items:r.map((T,A)=>{var S;return{name:T.name,value:((S=T.data[y.labelIdx])==null?void 0:S.value)??0,color:ie(T,A)}})})]}),l&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((T,A)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:ne,children:[e.jsx("div",{className:"w-3 h-0.5 rounded-full",style:{backgroundColor:ie(T,A)}}),e.jsx("span",{className:"text-muted-foreground",children:T.name})]},A))})]})}Mt.displayName="LineChart";function Dt({series:r,height:t=240,width:o,showXAxis:a=!0,showYAxis:s=!0,showGrid:n=!0,showLegend:l=!0,showTooltip:d=!0,showDots:i=!1,smooth:h=!0,fillOpacity:u=.15,className:x=""}){const y=c.useId(),[f,p]=c.useState(null);if(!r.length||!r[0].data.length)return null;const g=r[0].data.map(S=>S.label),m=r.flatMap(S=>S.data.map($=>$.value)),k=Ge(m),z=0,b={top:12,right:16,bottom:a?36:12,left:s?48:16},w=o??600,N=t,F=w-b.left-b.right,L=N-b.top-b.bottom,M=g.length>1?F/(g.length-1):F;function W(S){return b.left+S*M}function D(S){return b.top+L-(S-z)/(k-z||1)*L}const T=Array.from({length:5},(S,$)=>z+$/4*(k-z)),A=b.top+L;return e.jsxs("div",{className:`w-full ${x}`,children:[e.jsxs("svg",{width:o?w:"100%",height:N,viewBox:`0 0 ${w} ${N}`,onMouseLeave:()=>p(null),children:[e.jsx("defs",{children:r.map((S,$)=>e.jsxs("linearGradient",{id:`${y}-grad-${$}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:ie(S,$),stopOpacity:u*4}),e.jsx("stop",{offset:"100%",stopColor:ie(S,$),stopOpacity:0})]},$))}),n&&T.map((S,$)=>e.jsx("line",{x1:b.left,y1:D(S),x2:w-b.right,y2:D(S),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},$)),s&&T.map((S,$)=>e.jsx("text",{x:b.left-8,y:D(S)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:ne,children:S>=1e3?`${(S/1e3).toFixed(1)}k`:S},$)),a&&g.map((S,$)=>{const E=Math.max(1,Math.floor(g.length/8));return $%E!==0&&$!==g.length-1?null:e.jsx("text",{x:W($),y:N-b.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:ne,children:S},$)}),r.map((S,$)=>{const E=ie(S,$),I=S.data.map((_,Q)=>[W(Q),D(_.value)]),H=gr(I,h),P=H+` L${I[I.length-1][0]},${A} L${I[0][0]},${A} Z`;return e.jsxs("g",{children:[e.jsx("path",{d:P,fill:`url(#${y}-grad-${$})`}),e.jsx("path",{d:H,fill:"none",stroke:E,strokeWidth:2,strokeLinecap:"round"}),i&&I.map(([_,Q],O)=>e.jsx("circle",{cx:_,cy:Q,r:3,fill:"var(--card)",stroke:E,strokeWidth:2},O))]},$)}),d&&g.map((S,$)=>e.jsx("rect",{x:W($)-M/2,y:b.top,width:M,height:L,fill:"transparent",onMouseEnter:()=>p({x:W($),y:b.top,labelIdx:$})},$)),f&&e.jsx("line",{x1:W(f.labelIdx),y1:b.top,x2:W(f.labelIdx),y2:b.top+L,stroke:"var(--border)",strokeWidth:1,strokeDasharray:"4 2"}),f&&e.jsx(pr,{x:br(W(f.labelIdx)+8,b.left,w-180),y:b.top,label:g[f.labelIdx],items:r.map((S,$)=>{var E;return{name:S.name,value:((E=S.data[f.labelIdx])==null?void 0:E.value)??0,color:ie(S,$)}})})]}),l&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((S,$)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:ne,children:[e.jsx("div",{className:"w-3 h-0.5 rounded-full",style:{backgroundColor:ie(S,$)}}),e.jsx("span",{className:"text-muted-foreground",children:S.name})]},$))})]})}Dt.displayName="AreaChart";function At({series:r,height:t=240,width:o,showXAxis:a=!0,showYAxis:s=!0,showGrid:n=!0,showLegend:l=!0,showTooltip:d=!0,stacked:i=!1,radius:h=4,className:u=""}){const[x,y]=c.useState(null);if(!r.length||!r[0].data.length)return null;const f=r[0].data.map(A=>A.label);let p;i?p=Ge(f.map((A,S)=>r.reduce(($,E)=>{var I;return $+(((I=E.data[S])==null?void 0:I.value)??0)},0))):p=Ge(r.flatMap(A=>A.data.map(S=>S.value)));const g={top:12,right:16,bottom:a?36:12,left:s?48:16},m=o??600,k=t,z=m-g.left-g.right,b=k-g.top-g.bottom,w=z/f.length,N=w*.2,F=w-N*2,L=i?F:F/r.length;function M(A){return g.top+b-A/p*b}function W(A){return A/p*b}function D(A){return g.left+A*w+N}const T=Array.from({length:5},(A,S)=>S/4*p);return e.jsxs("div",{className:`w-full ${u}`,children:[e.jsxs("svg",{width:o?m:"100%",height:k,viewBox:`0 0 ${m} ${k}`,onMouseLeave:()=>y(null),children:[n&&T.map((A,S)=>e.jsx("line",{x1:g.left,y1:M(A),x2:m-g.right,y2:M(A),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},S)),s&&T.map((A,S)=>e.jsx("text",{x:g.left-8,y:M(A)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:ne,children:A>=1e3?`${(A/1e3).toFixed(1)}k`:A},S)),a&&f.map((A,S)=>e.jsx("text",{x:D(S)+F/2,y:k-g.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:ne,children:A},S)),f.map((A,S)=>{if(i){let $=g.top+b;return e.jsx("g",{children:r.map((E,I)=>{var V;const H=((V=E.data[S])==null?void 0:V.value)??0,P=W(H),_=$-P;$=_;const Q=ie(E,I),O=I===r.length-1,Z=I===0,oe=h,X=D(S),re=F,U=P,B=O&&Z?`M${X},${_+oe} Q${X},${_} ${X+oe},${_} L${X+re-oe},${_} Q${X+re},${_} ${X+re},${_+oe} L${X+re},${_+U} L${X},${_+U} Z`:O?`M${X},${_+oe} Q${X},${_} ${X+oe},${_} L${X+re-oe},${_} Q${X+re},${_} ${X+re},${_+oe} L${X+re},${_+U} L${X},${_+U} Z`:`M${X},${_} L${X+re},${_} L${X+re},${_+U} L${X},${_+U} Z`;return e.jsx("path",{d:B,fill:Q},I)})},S)}else return e.jsx("g",{children:r.map(($,E)=>{var Z;const I=((Z=$.data[S])==null?void 0:Z.value)??0,H=W(I),P=D(S)+E*L,_=M(I),Q=ie($,E),O=Math.min(h,L/2);return e.jsx("path",{d:`M${P},${_+O} Q${P},${_} ${P+O},${_} L${P+L-O},${_} Q${P+L},${_} ${P+L},${_+O} L${P+L},${_+H} L${P},${_+H} Z`,fill:Q},E)})},S)}),d&&f.map((A,S)=>e.jsx("rect",{x:D(S),y:g.top,width:F,height:b,fill:"transparent",style:{cursor:"default"},onMouseEnter:()=>y({x:D(S)+F/2,y:g.top,labelIdx:S})},S)),x&&e.jsx(pr,{x:br(x.x+8,g.left,m-180),y:g.top,label:f[x.labelIdx],items:r.map((A,S)=>{var $;return{name:A.name,value:(($=A.data[x.labelIdx])==null?void 0:$.value)??0,color:ie(A,S)}})})]}),l&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((A,S)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:ne,children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:ie(A,S)}}),e.jsx("span",{className:"text-muted-foreground",children:A.name})]},S))})]})}At.displayName="BarChart";function jt({data:r,size:t=200,innerRatio:o=.6,centerLabel:a,centerValue:s,showLegend:n=!0,showTooltip:l=!0,className:d=""}){const[i,h]=c.useState(null),u=r.reduce((b,w)=>b+w.value,0);if(u===0||r.length===0)return null;const x=t/2,y=t/2,f=t/2-4,p=f*o;let g=-Math.PI/2;const m=r.map((b,w)=>{const N=b.value/u,F=g,L=g+N*2*Math.PI;g=L;const M=x+f*Math.cos(F),W=y+f*Math.sin(F),D=x+f*Math.cos(L),T=y+f*Math.sin(L),A=x+p*Math.cos(L),S=y+p*Math.sin(L),$=x+p*Math.cos(F),E=y+p*Math.sin(F),I=N>.5?1:0;return{path:[`M${M},${W}`,`A${f},${f} 0 ${I} 1 ${D},${T}`,`L${A},${S}`,`A${p},${p} 0 ${I} 0 ${$},${E}`,"Z"].join(" "),color:b.color??We[w%We.length],ratio:N,d:b,i:w}}),k=s??u.toLocaleString(),z=i!==null?r[i]:null;return e.jsxs("div",{className:`flex items-center gap-6 ${d}`,children:[e.jsx("div",{className:"relative flex-shrink-0",children:e.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[m.map(b=>e.jsx("path",{d:b.path,fill:b.color,opacity:i===null||i===b.i?1:.4,style:{transition:"opacity 0.15s"},onMouseEnter:()=>h(b.i),onMouseLeave:()=>h(null)},b.i)),o>0&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x,y:y-6,textAnchor:"middle",fill:"var(--foreground)",style:{...ne,fontWeight:"700",fontSize:"18px"},children:z?z.value.toLocaleString():k}),(a||z)&&e.jsx("text",{x,y:y+12,textAnchor:"middle",fill:"var(--muted-foreground)",style:{...ne,fontSize:"var(--text-caption)"},children:z?z.label:a})]})]})}),n&&e.jsx("div",{className:"flex flex-col gap-2",children:r.map((b,w)=>e.jsxs("div",{className:"flex items-center gap-2 cursor-default",style:ne,onMouseEnter:()=>h(w),onMouseLeave:()=>h(null),children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm flex-shrink-0",style:{backgroundColor:b.color??We[w%We.length]}}),e.jsx("span",{className:"text-foreground",children:b.label}),e.jsxs("span",{className:"text-muted-foreground ml-auto pl-4",children:[(b.value/u*100).toFixed(1),"%"]})]},w))})]})}jt.displayName="DonutChart";function Et({values:r,type:t="line",width:o=80,height:a=32,color:s,showValue:n=!1,trend:l,className:d=""}){if(!r.length)return null;const i=Math.min(...r),u=Math.max(...r)-i||1,x=r[r.length-1]>r[0]?"up":r[r.length-1]<r[0]?"down":"neutral",y=l??x,p=s??(y==="up"?"var(--chart-1, #22c55e)":y==="down"?"var(--chart-4, #ef4444)":"var(--muted-foreground)"),g=2,m=o-g*2,k=a-g*2;function z(L){return g+L/(r.length-1||1)*m}function b(L){return g+k-(L-i)/u*k}if(t==="bar"){const L=m/r.length-1;return e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d}`,children:[e.jsx("svg",{width:o,height:a,viewBox:`0 0 ${o} ${a}`,children:r.map((M,W)=>{const D=(M-i)/u*k;return e.jsx("rect",{x:g+W*(m/r.length),y:g+k-D,width:L,height:D,fill:p,rx:1,opacity:W===r.length-1?1:.5},W)})}),n&&e.jsx("span",{style:{...ne,color:p},children:r[r.length-1].toLocaleString()})]})}const w=r.map((L,M)=>[z(M),b(L)]),N=gr(w,!1),F=N+` L${w[w.length-1][0]},${g+k} L${w[0][0]},${g+k} Z`;return e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d}`,children:[e.jsxs("svg",{width:o,height:a,viewBox:`0 0 ${o} ${a}`,children:[t==="area"&&e.jsx("path",{d:F,fill:p,fillOpacity:.15}),e.jsx("path",{d:N,fill:"none",stroke:p,strokeWidth:1.5,strokeLinecap:"round"}),e.jsx("circle",{cx:w[w.length-1][0],cy:w[w.length-1][1],r:2,fill:p})]}),n&&e.jsx("span",{style:{...ne,color:p},children:r[r.length-1].toLocaleString()})]})}Et.displayName="MiniSparkline";function ge(r){const t=new Date(r);return t.setHours(0,0,0,0),t}function pe(r){const t=new Date(r);return t.setHours(23,59,59,999),t}const Ms=[{label:"Today",value:"today",range:()=>{const r=new Date;return{from:ge(r),to:pe(r)}}},{label:"Yesterday",value:"yesterday",range:()=>{const r=new Date;return r.setDate(r.getDate()-1),{from:ge(r),to:pe(r)}}},{label:"Last 7 days",value:"last7",range:()=>{const r=new Date,t=new Date;return t.setDate(t.getDate()-6),{from:ge(t),to:pe(r)}}},{label:"Last 30 days",value:"last30",range:()=>{const r=new Date,t=new Date;return t.setDate(t.getDate()-29),{from:ge(t),to:pe(r)}}},{label:"This month",value:"thisMonth",range:()=>{const r=new Date,t=new Date(r.getFullYear(),r.getMonth(),1),o=new Date(r.getFullYear(),r.getMonth()+1,0);return{from:ge(t),to:pe(o)}}},{label:"Last month",value:"lastMonth",range:()=>{const r=new Date,t=new Date(r.getFullYear(),r.getMonth()-1,1),o=new Date(r.getFullYear(),r.getMonth(),0);return{from:ge(t),to:pe(o)}}},{label:"Custom range",value:"custom",range:()=>({from:null,to:null})}],Ds=["January","February","March","April","May","June","July","August","September","October","November","December"],As=["Su","Mo","Tu","We","Th","Fr","Sa"];function vr(r){return r?r.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):""}function mr(r,t){return r.getFullYear()===t.getFullYear()&&r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()}function js(r,t){const o=[],a=new Date(r,t,1),s=new Date(a);s.setDate(s.getDate()-s.getDay());for(let n=0;n<42;n++)o.push(new Date(s)),s.setDate(s.getDate()+1);return o}const Es={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},Tt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},It={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ts={sm:"h-8 px-3",md:"h-10 px-3.5",lg:"h-11 px-4"};function Bt({month:r,year:t,range:o,hovered:a,onHover:s,onSelect:n,onPrevMonth:l,onNextMonth:d,minDate:i,maxDate:h}){const u=js(t,r);function x(f){const p=o.from,g=o.to??a;if(!p||!g)return!1;const[m,k]=p<=g?[p,g]:[g,p];return f>m&&f<k}function y(f){return!!(i&&f<ge(i)||h&&f>pe(h))}return e.jsxs("div",{className:"select-none flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{type:"button",onClick:l,className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(v.ChevronLeft,{size:14})}),e.jsxs("span",{className:"text-foreground",style:It,children:[Ds[r]," ",t]}),e.jsx("button",{type:"button",onClick:d,className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(v.ChevronRight,{size:14})})]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:As.map(f=>e.jsx("div",{className:"h-8 flex items-center justify-center text-muted-foreground",style:Tt,children:f},f))}),e.jsx("div",{className:"grid grid-cols-7",children:u.map((f,p)=>{const g=f.getMonth()===r,m=o.from?mr(f,o.from):!1,k=o.to?mr(f,o.to):a&&o.from?mr(f,a):!1,z=x(f),b=y(f);return e.jsx("button",{type:"button",disabled:b,onMouseEnter:()=>!b&&s(f),onMouseLeave:()=>s(null),onClick:()=>!b&&n(f),className:["h-8 w-full flex items-center justify-center text-center transition-colors",b?"opacity-30 cursor-not-allowed":"cursor-pointer",g?"":"text-muted-foreground/40",m||k?"bg-primary text-primary-foreground rounded-[var(--radius-md)] font-semibold":z?"bg-primary/10 text-primary":b?"":"hover:bg-muted/40 rounded-[var(--radius-md)]"].filter(Boolean).join(" "),style:Tt,children:f.getDate()},p)})})]})}function _t({value:r,onChange:t,presets:o=["today","last7","last30","custom"],placeholder:a="Select date range",size:s="md",minDate:n,maxDate:l,clearable:d=!0,disabled:i=!1,className:h=""}){const u=new Date,[x,y]=c.useState(!1),[f,p]=c.useState({from:null,to:null}),[g,m]=c.useState(null),[k,z]=c.useState(void 0),[b,w]=c.useState(u.getMonth()),[N,F]=c.useState(u.getFullYear()),[L,M]=c.useState("from"),[W,D]=c.useState({top:0,left:0,width:0}),T=c.useRef(null),A=c.useRef(null),S=r??f,$=(b+1)%12,E=b===11?N+1:N;c.useEffect(()=>{function O(Z){T.current&&!T.current.contains(Z.target)&&y(!1)}return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[]),c.useEffect(()=>{if(!x||!A.current)return;const O=()=>{const Z=A.current.getBoundingClientRect();D({top:Z.bottom+4,left:Z.left,width:Z.width})};return O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[x]);function I(O){if(O.value==="custom"){z("custom");return}const Z=O.range();p(Z),t==null||t(Z,O.value),z(O.value),y(!1)}function H(O){if(L==="from")p({from:ge(O),to:null}),M("to");else{const Z=f.from,[oe,X]=O>=Z?[Z,pe(O)]:[ge(O),pe(Z)],re={from:oe,to:X};p(re),t==null||t(re,"custom"),z("custom"),M("from"),y(!1)}}function P(O){O.stopPropagation();const Z={from:null,to:null};p(Z),t==null||t(Z,void 0),z(void 0)}const _=S.from&&S.to?`${vr(S.from)} – ${vr(S.to)}`:S.from?`${vr(S.from)} – ...`:"",Q=Ms.filter(O=>o.includes(O.value));return e.jsxs("div",{ref:T,className:`relative inline-block ${h}`,children:[e.jsxs("button",{ref:A,type:"button",disabled:i,onClick:()=>!i&&y(!x),className:["flex items-center gap-2 border border-border bg-card text-left rounded-[var(--radius-md)] transition-colors w-full min-w-[260px]",Ts[s],x?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Es,children:[e.jsx(v.Calendar,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:_?"text-foreground flex-1":"text-muted-foreground flex-1",children:_||a}),d&&S.from&&e.jsx("span",{role:"button",tabIndex:0,onClick:P,onKeyDown:O=>O.key==="Enter"&&P(O),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer flex-shrink-0",children:e.jsx(v.X,{size:12})})]}),x&&Ce.createPortal(e.jsxs("div",{className:"fixed z-[9999] bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] flex overflow-y-auto",style:{top:W.top,left:W.left,minWidth:"620px",maxHeight:"calc(100vh - 120px)"},children:[e.jsx("div",{className:"w-36 border-r border-border py-2 flex flex-col gap-0.5 flex-shrink-0",children:Q.map(O=>e.jsx("button",{type:"button",onClick:()=>I(O),className:["w-full text-left px-3 py-1.5 rounded-none transition-colors",k===O.value?"bg-primary/10 text-primary":"text-foreground hover:bg-muted/30"].join(" "),style:It,children:O.label},O.value))}),e.jsxs("div",{className:"flex gap-4 p-4 flex-1 min-w-0",children:[e.jsx(Bt,{month:b,year:N,range:S,hovered:g,onHover:m,onSelect:H,onPrevMonth:()=>{b===0?(w(11),F(N-1)):w(b-1)},onNextMonth:()=>{b===11?(w(0),F(N+1)):w(b+1)},minDate:n,maxDate:l}),e.jsx("div",{className:"w-px bg-border"}),e.jsx(Bt,{month:$,year:E,range:S,hovered:g,onHover:m,onSelect:H,onPrevMonth:()=>{b===0?(w(11),F(N-1)):w(b-1)},onNextMonth:()=>{b===11?(w(0),F(N+1)):w(b+1)},minDate:n,maxDate:l})]})]}),document.body)]})}_t.displayName="DateRangePicker";function he(r){return String(r).padStart(2,"0")}function Ht(r,t,o){if(t==="12h"){const a=r.hours%12||12,s=r.hours<12?"AM":"PM";return o?`${he(a)}:${he(r.minutes)}:${he(r.seconds??0)} ${s}`:`${he(a)}:${he(r.minutes)} ${s}`}return o?`${he(r.hours)}:${he(r.minutes)}:${he(r.seconds??0)}`:`${he(r.hours)}:${he(r.minutes)}`}const Pt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},Ue={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",fontVariantNumeric:"tabular-nums"},Ot={sm:"h-8 px-3",md:"h-10 px-3.5",lg:"h-11 px-4"};function Xe({options:r,value:t,onChange:o,label:a}){const s=r.indexOf(t);return e.jsxs("div",{className:"flex flex-col items-center gap-1 w-12",children:[e.jsx("button",{type:"button",onClick:()=>{const n=r[(s-1+r.length)%r.length];o(n)},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(v.ChevronUp,{size:14})}),e.jsx("div",{className:"text-foreground w-full text-center px-1 py-1 rounded-[var(--radius-md)] bg-muted/20",style:Ue,children:he(t)}),e.jsx("button",{type:"button",onClick:()=>{const n=r[(s+1)%r.length];o(n)},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(v.ChevronDown,{size:14})}),e.jsx("span",{className:"text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:a})]})}function xr({value:r,onChange:t,format:o="24h",showSeconds:a=!1,minuteStep:s=1,placeholder:n="Select time",size:l="md",disabled:d=!1,className:i=""}){const[h,u]=c.useState(!1),[x,y]=c.useState({hours:0,minutes:0,seconds:0}),f=c.useRef(null),p=r??x,g=o==="12h"?Array.from({length:12},(W,D)=>D+1):Array.from({length:24},(W,D)=>D),m=Array.from({length:Math.ceil(60/s)},(W,D)=>D*s),k=Array.from({length:60},(W,D)=>D),z=["AM","PM"];c.useEffect(()=>{function W(D){f.current&&!f.current.contains(D.target)&&u(!1)}return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[]);function b(W){const D={...p,...W};y(D),t==null||t(D)}const w=Ht(p,o,a),N=r!==void 0||x.hours!==0||x.minutes!==0,F=o==="12h"?p.hours%12||12:p.hours,L=p.hours<12;function M(W,D){let T=W%12;D||(T+=12),b({hours:T})}return e.jsxs("div",{ref:f,className:`relative inline-block ${i}`,children:[e.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&u(!h),className:["flex items-center gap-2 border border-border bg-card rounded-[var(--radius-md)] transition-colors min-w-[120px]",Ot[l],h?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",d?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Pt,children:[e.jsx(v.Clock,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:N?"text-foreground":"text-muted-foreground",children:N?w:n})]}),h&&e.jsx("div",{className:"absolute top-full mt-1 z-50 bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[o==="12h"?e.jsx(Xe,{options:g,value:F,onChange:W=>M(W,L),label:"Hour"}):e.jsx(Xe,{options:g,value:p.hours,onChange:W=>b({hours:W}),label:"Hour"}),e.jsx("div",{className:"text-muted-foreground text-lg mt-3",style:Ue,children:":"}),e.jsx(Xe,{options:m,value:p.minutes,onChange:W=>b({minutes:W}),label:"Min"}),a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-muted-foreground text-lg mt-3",style:Ue,children:":"}),e.jsx(Xe,{options:k,value:p.seconds??0,onChange:W=>b({seconds:W}),label:"Sec"})]}),o==="12h"&&e.jsxs("div",{className:"flex flex-col gap-1 ml-1",children:[e.jsx("div",{className:"h-5"}),z.map(W=>e.jsx("button",{type:"button",onClick:()=>M(F,W==="AM"),className:["px-2 py-1 rounded-[var(--radius-md)] transition-colors",W==="AM"===L?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted/30 cursor-pointer"].join(" "),style:Ue,children:W},W))]})]})})]})}xr.displayName="TimePicker";function Yt({value:r,onChange:t,format:o="24h",showSeconds:a=!1,placeholder:s="Select date & time",size:n="md",minDate:l,maxDate:d,disabled:i=!1,className:h=""}){const[u,x]=c.useState(!1),[y,f]=c.useState(r??new Date),p=c.useRef(null),g=r??y,m=new Date,[k,z]=c.useState(g.getMonth()),[b,w]=c.useState(g.getFullYear());c.useEffect(()=>{function $(E){p.current&&!p.current.contains(E.target)&&x(!1)}return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]);function N($){f($),t==null||t($)}function F($){const E=new Date($);E.setHours(g.getHours(),g.getMinutes(),g.getSeconds(),0),N(E)}function L($){const E=new Date(g);E.setHours($.hours,$.minutes,$.seconds??0,0),N(E)}const M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],W=["Su","Mo","Tu","We","Th","Fr","Sa"];function D(){const $=[],E=new Date(b,k,1),I=new Date(E);I.setDate(I.getDate()-I.getDay());for(let H=0;H<42;H++)$.push(new Date(I)),I.setDate(I.getDate()+1);return $}const T={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},A={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},S=`${g.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})} ${Ht({hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds()},o,a)}`;return e.jsxs("div",{ref:p,className:`relative inline-block ${h}`,children:[e.jsxs("button",{type:"button",disabled:i,onClick:()=>!i&&x(!u),className:["flex items-center gap-2 border border-border bg-card rounded-[var(--radius-md)] transition-colors min-w-[200px]",Ot[n],u?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Pt,children:[e.jsx(v.Clock,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:"text-foreground",children:S})]}),u&&e.jsxs("div",{className:"absolute top-full mt-1 z-50 bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] p-4 flex gap-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{type:"button",onClick:()=>{k===0?(z(11),w(b-1)):z(k-1)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(v.ChevronLeft,{size:14})}),e.jsxs("span",{style:A,children:[M[k]," ",b]}),e.jsx("button",{type:"button",onClick:()=>{k===11?(z(0),w(b+1)):z(k+1)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(v.ChevronRight,{size:14})})]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:W.map($=>e.jsx("div",{className:"text-center text-muted-foreground",style:T,children:$},$))}),e.jsx("div",{className:"grid grid-cols-7 gap-y-0.5",children:D().map(($,E)=>{const I=$.getMonth()===k,H=r?$.toDateString()===r.toDateString():$.toDateString()===y.toDateString(),P=$.toDateString()===m.toDateString();return e.jsx("button",{type:"button",onClick:()=>F($),className:["h-7 w-full text-center transition-colors rounded-[var(--radius-md)] cursor-pointer",I?"":"text-muted-foreground/40",H?"bg-primary text-primary-foreground font-semibold":P?"border border-primary text-primary":"hover:bg-muted/40"].filter(Boolean).join(" "),style:T,children:$.getDate()},E)})})]}),e.jsx("div",{className:"w-px bg-border"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:T,children:"Time"}),e.jsx(xr,{value:{hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds()},onChange:L,format:o,showSeconds:a,size:"sm"})]})]})]})}Yt.displayName="DateTimePicker";const Is={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Bs={fontFamily:"var(--font-p)",fontSize:"var(--text-button)",fontWeight:"var(--weight-p)"},_s={fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)"},Hs={sm:"p-3 gap-2.5 rounded-[var(--radius-md)]",md:"p-4 gap-3 rounded-[var(--radius-md)]",lg:"p-5 gap-4 rounded-[var(--radius-md)]"},Ps={sm:"w-8 h-8 rounded-[var(--radius-sm)]",md:"w-10 h-10 rounded-[var(--radius-md)]",lg:"w-12 h-12 rounded-[var(--radius-md)] text-lg"};function Gt({value:r,title:t,description:o,icon:a,badge:s,selected:n=!1,disabled:l=!1,showArrow:d=!0,showCheck:i=!1,size:h="md",layout:u="horizontal",onClick:x,className:y=""}){const f=u==="vertical";return e.jsxs("button",{type:"button",disabled:l,onClick:()=>!l&&(x==null?void 0:x(r)),className:["w-full text-left border transition-all duration-150",Hs[h],f?"flex flex-col items-center text-center":"flex items-center",n?"border-primary bg-primary/5 shadow-[0_0_0_1px_var(--primary)]":"border-border bg-card hover:border-primary/40 hover:bg-muted/20",l?"opacity-50 cursor-not-allowed":"cursor-pointer",y].filter(Boolean).join(" "),"aria-pressed":n,children:[a&&e.jsx("div",{className:[Ps[h],"flex items-center justify-center flex-shrink-0",n?"bg-primary/10 text-primary":"bg-muted/40 text-muted-foreground"].join(" "),children:a}),e.jsxs("div",{className:`flex-1 min-w-0 ${f?"mt-2":""}`,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-foreground",style:Is,children:t}),s&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary/10 text-primary",style:_s,children:s})]}),o&&e.jsx("p",{className:`text-muted-foreground mt-0.5 ${f?"line-clamp-2":"truncate"}`,style:Bs,children:o})]}),!f&&e.jsx("div",{className:"flex-shrink-0 ml-auto pl-2",children:i&&n?e.jsx("span",{className:"w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:e.jsx(v.Check,{size:12})}):d?e.jsx(v.ChevronRight,{size:16,className:n?"text-primary":"text-muted-foreground"}):null}),f&&n&&e.jsx("div",{className:"mt-2 w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:e.jsx(v.Check,{size:12})})]})}Gt.displayName="ChoiceCard";function Ut({value:r,onChange:t,layout:o="horizontal",size:a="md",children:s,className:n=""}){return e.jsx("div",{className:["grid gap-3",o==="vertical"?"grid-cols-2 sm:grid-cols-3":"grid-cols-1",n].join(" "),role:"group",children:c.Children.map(s,l=>c.isValidElement(l)?c.cloneElement(l,{selected:r===l.props.value,onClick:d=>t==null?void 0:t(d),layout:o,size:a}):l)})}Ut.displayName="ChoiceCardGroup";const Os={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ys={fontFamily:"var(--font-p)",fontSize:"var(--text-button)",fontWeight:"var(--weight-p)"},Gs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Us={sm:"p-3",md:"p-4",lg:"p-5"},Xs={sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12"},Ks={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-2 lg:grid-cols-4"};function Xt({options:r,value:t,onChange:o,columns:a=2,layout:s="grid",size:n="md",name:l,className:d=""}){const i=l??`radio-card-${Math.random().toString(36).slice(2,7)}`;return e.jsx("div",{className:[s==="grid"?`grid gap-3 ${Ks[a]}`:"flex flex-col gap-2",d].join(" "),role:"radiogroup",children:r.map(h=>{const u=t===h.value,x=h.disabled??!1;return e.jsxs("label",{className:["relative flex items-start gap-3 border rounded-[var(--radius-md)] cursor-pointer transition-all duration-150",Us[n],u?"border-primary bg-primary/5 shadow-[0_0_0_1px_var(--primary)]":"border-border bg-card hover:border-primary/40 hover:bg-muted/10",x?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsx("input",{type:"radio",name:i,value:h.value,checked:u,disabled:x,onChange:()=>!x&&(o==null?void 0:o(h.value)),className:"sr-only"}),e.jsx("div",{className:["flex-shrink-0 mt-0.5 w-4 h-4 rounded-full border-2 flex items-center justify-center transition-colors",u?"border-primary bg-primary":"border-border bg-transparent"].join(" "),children:u&&e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary-foreground"})}),h.icon&&e.jsx("div",{className:[Xs[n],"flex-shrink-0 flex items-center justify-center rounded-[var(--radius-md)]",u?"bg-primary/10 text-primary":"bg-muted/40 text-muted-foreground"].join(" "),children:h.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-foreground",style:Os,children:h.title}),h.badge&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary/10 text-primary",style:Gs,children:h.badge})]}),h.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Ys,children:h.description})]})]},h.value)})})}Xt.displayName="RadioCard";function Zs(){return Math.random().toString(36).slice(2,9)}function qs(r={}){return{id:Zs(),values:{...r}}}const Js={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Kt={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Zt({columns:r,value:t,onChange:o,defaultRow:a={},minRows:s=0,maxRows:n,addLabel:l="Add row",sortable:d=!1,disabled:i=!1,className:h=""}){const[u,x]=c.useState(()=>t??[]),y=t??u,f=N=>{x(N),o==null||o(N)},p=()=>{n!==void 0&&y.length>=n||f([...y,qs(a)])},g=N=>{y.length<=s||f(y.filter(F=>F.id!==N))},m=(N,F,L)=>{f(y.map(M=>M.id===N?{...M,values:{...M.values,[F]:L}}:M))},k=(N,F)=>{const L=[...y],[M]=L.splice(N,1);L.splice(F,0,M),f(L)},z=y.length<=s,b=n!==void 0&&y.length>=n,w=c.useRef(null);return e.jsxs("div",{className:`space-y-2 ${h}`,children:[e.jsxs("div",{className:["flex items-center gap-2 px-3 text-muted-foreground",d?"pl-9":""].join(" "),children:[r.map(N=>e.jsx("div",{style:{width:N.width??"1fr",flex:N.width?"none":"1"},className:"min-w-0",children:e.jsx("span",{style:Js,children:N.label})},N.key)),e.jsx("div",{className:"w-8 flex-shrink-0"})]}),e.jsx("div",{className:"space-y-2",children:y.map((N,F)=>e.jsxs("div",{className:["flex items-center gap-2 p-2 rounded-[var(--radius-md)] border border-border bg-card transition-colors",i?"opacity-60":""].join(" "),draggable:d&&!i,onDragStart:()=>{w.current=F},onDragOver:L=>{L.preventDefault()},onDrop:()=>{w.current!==null&&w.current!==F&&(k(w.current,F),w.current=null)},children:[d&&e.jsx("div",{className:"cursor-grab text-muted-foreground/50 hover:text-muted-foreground flex-shrink-0",children:e.jsx(v.GripVertical,{size:14})}),r.map(L=>e.jsx("div",{style:{width:L.width??"1fr",flex:L.width?"none":"1"},className:"min-w-0",children:L.render(N.values[L.key],M=>m(N.id,L.key,M),F)},L.key)),e.jsx("button",{type:"button",disabled:i||z,onClick:()=>g(N.id),className:["flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] transition-colors",i||z?"text-muted-foreground/30 cursor-not-allowed":"text-muted-foreground hover:text-destructive hover:bg-destructive/10 cursor-pointer"].join(" "),"aria-label":"Remove row",children:e.jsx(v.Trash2,{size:14})})]},N.id))}),y.length===0&&e.jsx("div",{className:"text-center py-6 text-muted-foreground rounded-[var(--radius-md)] border border-dashed border-border",children:e.jsxs("span",{style:Kt,children:['No rows yet. Click "',l,'" to begin.']})}),!b&&e.jsxs("button",{type:"button",disabled:i,onClick:p,className:["flex items-center gap-1.5 px-3 py-1.5 rounded-[var(--radius-md)] border border-dashed border-primary/40 text-primary hover:bg-primary/5 transition-colors",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Kt,children:[e.jsx(v.Plus,{size:14}),l]})]})}Zt.displayName="RepeatableFieldList";const Qs={history:[{cmd:"undo",icon:v.Undo,title:"Undo"},{cmd:"redo",icon:v.Redo,title:"Redo"}],format:[{cmd:"bold",icon:v.Bold,title:"Bold"},{cmd:"italic",icon:v.Italic,title:"Italic"},{cmd:"underline",icon:v.Underline,title:"Underline"},{cmd:"strikethrough",icon:v.Strikethrough,title:"Strikethrough"}],list:[{cmd:"insertUnorderedList",icon:v.List,title:"Bullet list"},{cmd:"insertOrderedList",icon:v.ListOrdered,title:"Numbered list"}],align:[{cmd:"justifyLeft",icon:v.AlignLeft,title:"Align left"},{cmd:"justifyCenter",icon:v.AlignCenter,title:"Align center"},{cmd:"justifyRight",icon:v.AlignRight,title:"Align right"}],block:[{cmd:"formatBlock-h2",icon:v.Heading2,title:"Heading 2"},{cmd:"formatBlock-blockquote",icon:v.Quote,title:"Blockquote"},{cmd:"formatBlock-pre",icon:v.Code,title:"Code block"}],link:[{cmd:"createLink",icon:v.Link,title:"Insert link"},{cmd:"unlink",icon:v.Unlink,title:"Remove link"}]},Vs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},Rs={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1.6",color:"var(--foreground)"};function qt({value:r="",onChange:t,placeholder:o="Start typing…",minHeight:a=160,maxHeight:s=480,toolbar:n=["history","format","list","align","link","block"],fullscreen:l=!0,disabled:d=!1,readOnly:i=!1,size:h="md",className:u=""}){const x=c.useRef(null),[y,f]=c.useState(!1),[p,g]=c.useState(new Set),[m,k]=c.useState(!r);c.useEffect(()=>{x.current&&r&&x.current.innerHTML!==r&&(x.current.innerHTML=r,k(!1))},[]);const z=c.useCallback(()=>{const M=new Set;["bold","italic","underline","strikethrough","insertUnorderedList","insertOrderedList","justifyLeft","justifyCenter","justifyRight"].forEach(W=>{try{document.queryCommandState(W)&&M.add(W)}catch{}}),g(M)},[]);function b(M){var W;if(!(d||i)){if((W=x.current)==null||W.focus(),M.startsWith("formatBlock-")){const D=M.replace("formatBlock-","");document.execCommand("formatBlock",!1,D)}else if(M==="createLink"){const D=window.prompt("Enter URL:");D&&document.execCommand("createLink",!1,D)}else document.execCommand(M,!1);z(),x.current&&t&&t(x.current.innerHTML)}}function w(){if(x.current){const M=x.current.innerHTML,W=x.current.innerText.trim();k(!W),t==null||t(M),z()}}const F=a??{sm:120,md:160,lg:240}[h],L=["border border-border rounded-[var(--radius-md)] bg-card overflow-hidden transition-all",y?"fixed inset-4 z-[var(--z-modal)] flex flex-col shadow-[0_8px_48px_rgba(0,0,0,0.2)]":"relative",d?"opacity-60":"",u].filter(Boolean).join(" ");return e.jsxs("div",{className:L,children:[!i&&e.jsxs("div",{className:"flex items-center gap-0.5 flex-wrap px-2 py-1.5 border-b border-border bg-muted/10",children:[n.map((M,W)=>{const D=Qs[M];return e.jsxs(c.Fragment,{children:[W>0&&e.jsx("div",{className:"w-px h-5 bg-border mx-1"}),D.map(T=>{const A=T.icon,S=p.has(T.cmd);return e.jsx("button",{type:"button",title:T.title,disabled:d,onMouseDown:$=>{$.preventDefault(),b(T.cmd)},className:["w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] transition-colors",S?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/40 hover:text-foreground",d?"cursor-not-allowed":"cursor-pointer"].join(" "),children:e.jsx(A,{size:13})},T.cmd)})]},M)}),l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ml-auto w-px h-5 bg-border mx-1"}),e.jsx("button",{type:"button",title:y?"Exit fullscreen":"Fullscreen",onClick:()=>f(!y),className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-muted/40 hover:text-foreground transition-colors cursor-pointer",children:y?e.jsx(v.Minimize2,{size:13}):e.jsx(v.Maximize2,{size:13})})]})]}),e.jsxs("div",{className:"relative flex-1",children:[m&&e.jsx("div",{className:"absolute top-0 left-0 pointer-events-none p-4 text-muted-foreground",style:Vs,children:o}),e.jsx("div",{ref:x,contentEditable:!d&&!i,suppressContentEditableWarning:!0,onInput:w,onKeyUp:z,onMouseUp:z,className:["outline-none p-4 overflow-y-auto","prose-p:my-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-3","[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_pre]:bg-muted/30 [&_pre]:rounded [&_pre]:p-2 [&_pre]:text-sm","[&_a]:text-primary [&_a]:underline","[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5",y?"flex-1":""].filter(Boolean).join(" "),style:{...Rs,minHeight:y?void 0:F,maxHeight:y?void 0:s},"data-placeholder":o})]})]})}qt.displayName="RichTextEditor";const yr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Le={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},en={2:"grid-cols-2",3:"grid-cols-2 sm:grid-cols-3",4:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4",5:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-5",6:"grid-cols-2 sm:grid-cols-4 lg:grid-cols-6"};function rn({images:r,startIdx:t,onClose:o}){const[a,s]=c.useState(t),n=r[a],l=()=>s(i=>(i-1+r.length)%r.length),d=()=>s(i=>(i+1)%r.length);return c.useEffect(()=>{function i(h){h.key==="Escape"&&o(),h.key==="ArrowLeft"&&l(),h.key==="ArrowRight"&&d()}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[]),e.jsxs("div",{className:"fixed inset-0 z-[var(--z-modal)] bg-black/90 flex items-center justify-center",onClick:o,children:[e.jsx("button",{type:"button",onClick:o,className:"absolute top-4 right-4 w-9 h-9 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(v.X,{size:16})}),r.length>1&&e.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),l()},className:"absolute left-4 w-10 h-10 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(v.ChevronLeft,{size:20})}),e.jsxs("div",{className:"max-w-4xl max-h-[80vh] px-16",onClick:i=>i.stopPropagation(),children:[e.jsx("img",{src:n.src,alt:n.alt??n.name,className:"max-w-full max-h-[70vh] object-contain rounded-[var(--radius-md)]"}),n.name&&e.jsxs("p",{className:"text-center text-white/70 mt-3",style:Le,children:[n.name," ",n.size?`· ${n.size}`:""]}),r.length>1&&e.jsxs("p",{className:"text-center text-white/40 mt-1",style:Le,children:[a+1," / ",r.length]})]}),r.length>1&&e.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),d()},className:"absolute right-4 w-10 h-10 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(v.ChevronRight,{size:20})})]})}function wr({src:r,alt:t="",caption:o,subCaption:a,size:s="sm",onClick:n,className:l=""}){const d={xs:"w-8 h-8",sm:"w-10 h-10",md:"w-14 h-14"};return e.jsxs("div",{className:`flex items-center gap-2.5 ${n?"cursor-pointer":""} ${l}`,onClick:n,children:[e.jsx("div",{className:`${d[s]} flex-shrink-0 rounded-[var(--radius-md)] overflow-hidden bg-muted/20 border border-border`,children:e.jsx("img",{src:r,alt:t,className:"w-full h-full object-cover",onError:i=>{i.target.style.display="none"}})}),(o||a)&&e.jsxs("div",{className:"min-w-0",children:[o&&e.jsx("div",{className:"truncate text-foreground",style:yr,children:o}),a&&e.jsx("div",{className:"truncate text-muted-foreground",style:Le,children:a})]})]})}wr.displayName="ThumbnailCell";function Jt({images:r,selectable:t=!1,selectedIds:o=[],onSelectChange:a,maxSelect:s,lightbox:n=!0,uploadable:l=!1,onUpload:d,onDelete:i,defaultLayout:h="grid",columns:u=4,disabled:x=!1,className:y=""}){const[f,p]=c.useState(h),[g,m]=c.useState(null),k=c.useRef(null);function z(N){if(x)return;if(o.includes(N))a==null||a(o.filter(L=>L!==N));else{if(s&&o.length>=s)return;a==null||a([...o,N])}}function b(N,F){t?z(F):n&&m(N)}const w=c.useCallback(N=>{var F;(F=N.target.files)!=null&&F.length&&(d==null||d(N.target.files),N.target.value="")},[d]);return r.length===0&&!l?e.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground border border-dashed border-border rounded-[var(--radius-md)]",children:e.jsx("span",{style:yr,children:"No images yet"})}):e.jsxs("div",{className:y,children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("span",{className:"text-muted-foreground",style:Le,children:[r.length," image",r.length!==1?"s":"",t&&o.length>0&&` · ${o.length} selected`]}),e.jsxs("div",{className:"flex items-center gap-1",children:[l&&e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:k,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:w}),e.jsxs("button",{type:"button",disabled:x,onClick:()=>{var N;return(N=k.current)==null?void 0:N.click()},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-card hover:bg-muted/20 text-foreground transition-colors cursor-pointer",style:Le,children:[e.jsx(v.Upload,{size:12}),"Upload"]})]}),e.jsx("button",{type:"button",onClick:()=>p("grid"),className:`w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${f==="grid"?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/30"}`,children:e.jsx(v.Grid,{size:14})}),e.jsx("button",{type:"button",onClick:()=>p("list"),className:`w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${f==="list"?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/30"}`,children:e.jsx(v.List,{size:14})})]})]}),f==="grid"&&e.jsx("div",{className:`grid gap-2 ${en[u]}`,children:r.map((N,F)=>{const L=o.includes(N.id);return e.jsxs("div",{className:["relative group rounded-[var(--radius-md)] overflow-hidden border transition-all cursor-pointer",L?"border-primary shadow-[0_0_0_2px_var(--primary)]":"border-border hover:border-primary/40"].join(" "),onClick:()=>b(F,N.id),children:[e.jsx("div",{className:"aspect-square",children:e.jsx("img",{src:N.src,alt:N.alt??N.name,className:"w-full h-full object-cover"})}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center",children:!t&&n&&e.jsx(v.ZoomIn,{size:20,className:"text-white opacity-0 group-hover:opacity-100 transition-opacity"})}),t&&e.jsx("div",{className:["absolute top-1.5 left-1.5 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-all",L?"bg-primary border-primary":"bg-white/80 border-white"].join(" "),children:L&&e.jsx(v.Check,{size:10,className:"text-primary-foreground"})}),i&&e.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),i(N.id)},className:"absolute top-1.5 right-1.5 w-6 h-6 flex items-center justify-center rounded-full bg-black/60 text-white opacity-0 group-hover:opacity-100 transition-opacity hover:bg-destructive cursor-pointer",children:e.jsx(v.Trash2,{size:10})})]},N.id)})}),f==="list"&&e.jsx("div",{className:"space-y-1.5",children:r.map((N,F)=>{const L=o.includes(N.id);return e.jsxs("div",{className:["flex items-center gap-3 p-2.5 rounded-[var(--radius-md)] border transition-all cursor-pointer",L?"border-primary bg-primary/5":"border-border hover:bg-muted/10"].join(" "),onClick:()=>b(F,N.id),children:[e.jsx(wr,{src:N.src,alt:N.alt,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"truncate text-foreground",style:yr,children:N.name??N.alt??`Image ${F+1}`}),N.size&&e.jsx("div",{className:"text-muted-foreground",style:Le,children:N.size})]}),t&&L&&e.jsx("div",{className:"w-5 h-5 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:e.jsx(v.Check,{size:10,className:"text-primary-foreground"})}),i&&e.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),i(N.id)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors cursor-pointer flex-shrink-0",children:e.jsx(v.Trash2,{size:13})})]},N.id)})}),g!==null&&e.jsx(rn,{images:r,startIdx:g,onClose:()=>m(null)})]})}Jt.displayName="ImageGallery";const Nr=c.createContext(null);Nr.displayName="AppShellContext";const Sr=c.createContext(null);Sr.displayName="AppShellFullContext";function kr({user:r=null,product:t=null,navResolver:o,sidebarOpen:a,onSidebarChange:s,defaultSidebarOpen:n=!0,children:l}){const d=a!==void 0,[i,h]=c.useState(n),u=d?a:i,x=c.useCallback(w=>{d||h(w),s==null||s(w)},[d,s]),[y,f]=c.useState([]),p=c.useCallback(w=>{f(w)},[]),[g,m]=c.useState({groups:[],loading:!1,error:null}),k=c.useRef(0),z=c.useCallback(async()=>{if(!o||!r){m({groups:[],loading:!1,error:null});return}const w=++k.current;m(N=>({...N,loading:!0,error:null}));try{const N=await o(r);if(w!==k.current)return;m({groups:N,loading:!1,error:null})}catch(N){if(w!==k.current)return;m({groups:[],loading:!1,error:N instanceof Error?N.message:"Failed to load navigation"})}},[o,r]);c.useEffect(()=>{z()},[z]),c.useEffect(()=>{if(!(t!=null&&t.product))return;const w=document.documentElement.getAttribute("data-product");return document.documentElement.setAttribute("data-product",t.product),()=>{w?document.documentElement.setAttribute("data-product",w):document.documentElement.removeAttribute("data-product")}},[t==null?void 0:t.product]);const b=c.useMemo(()=>({sidebarOpen:u,setSidebarOpen:x,user:r,product:t,breadcrumbs:y,setBreadcrumbs:p,navGroups:g.groups,navLoading:g.loading,navError:g.error,refreshNav:z}),[u,x,r,t,y,p,g.groups,g.loading,g.error,z]);return e.jsx(Sr.Provider,{value:b,children:e.jsx(Nr.Provider,{value:b,children:l})})}kr.displayName="AppShellProvider";function Qt(){const r=c.useContext(Nr);if(!r)throw new Error("[useAppShell] must be used inside <AppShellProvider>. Wrap your app root with <AppShellProvider user={...} product={...}>.");return r}function Vt(){const r=c.useContext(Sr);if(!r)throw new Error("[useAppShellFull] must be used inside <AppShellProvider>.");return r}function tn(r){const{setBreadcrumbs:t}=Qt(),o=JSON.stringify(r);c.useEffect(()=>(t(r),()=>t([])),[o])}function on(r,t){const[o,a]=c.useState({groups:[],loading:!1,error:null}),s=c.useRef(0),n=c.useCallback(async()=>{if(!r||!t){a({groups:[],loading:!1,error:null});return}const l=++s.current;a(d=>({...d,loading:!0,error:null}));try{const d=await r(t);if(l!==s.current)return;a({groups:d,loading:!1,error:null})}catch(d){if(l!==s.current)return;a({groups:[],loading:!1,error:d instanceof Error?d.message:"Navigation load failed"})}},[r,t]);return c.useEffect(()=>{n()},[n]),{...o,refresh:n}}class Rt extends c.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){console.error("[AppShellErrorBoundary] Caught error:",t,o)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[200px] gap-3 p-6 text-center",role:"alert",children:[e.jsx("div",{className:"text-destructive",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:"Something went wrong in this section."}),e.jsx("button",{type:"button",onClick:()=>this.setState({hasError:!1}),className:"px-4 py-1.5 rounded-[var(--radius-md)] border border-border text-muted-foreground hover:bg-muted/20 transition-colors text-sm cursor-pointer",children:"Try again"})]}):this.props.children}}function R({children:r,className:t=""}){return r?e.jsx("div",{className:t,children:r}):null}function eo({children:r}){return r?e.jsx("div",{className:"sticky bottom-0 left-0 right-0 z-[var(--z-sticky)] bg-card border-t border-border px-6 py-3 flex items-center justify-end gap-3",children:r}):null}function ro({p:r}){const t=r.gap??"gap-5";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.stats}),e.jsx(R,{children:r.filters}),e.jsx(R,{className:"min-h-0",children:r.content}),e.jsx(R,{children:r.footer})]})}function an({p:r}){const t=r.gap??"gap-6",o=r.asideWidth??"w-80";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsxs("div",{className:`flex flex-col lg:flex-row ${t} min-h-0`,children:[r.asideLeft&&e.jsx("div",{className:`flex-shrink-0 ${o} lg:sticky lg:top-4 lg:max-h-[calc(100vh-5rem)] lg:overflow-y-auto`,children:r.aside}),e.jsx("div",{className:"flex-1 min-w-0 flex flex-col gap-5",children:r.main??r.content}),!r.asideLeft&&e.jsx("div",{className:`flex-shrink-0 ${o} lg:sticky lg:top-4 lg:max-h-[calc(100vh-5rem)] lg:overflow-y-auto`,children:r.aside})]})]})}function sn({p:r}){const t=r.gap??"gap-8";return e.jsxs("div",{className:`flex flex-col ${t} max-w-3xl`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{className:`flex flex-col ${t}`,children:r.sections??r.content})]})}function nn({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsxs("div",{className:`flex flex-col ${t} flex-1 pb-24`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.stepper}),e.jsx(R,{className:"flex-1",children:r.form??r.content})]}),e.jsx(eo,{children:r.actions})]})}function ln({p:r}){const t=r.gap??"gap-6",o=r.primaryChart&&r.secondaryCharts;return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.kpis??r.stats}),o?e.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-3 ${t}`,children:[e.jsx("div",{className:"lg:col-span-2",children:r.primaryChart}),e.jsx("div",{className:"flex flex-col gap-4",children:r.secondaryCharts})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{children:r.primaryChart??r.charts}),e.jsx(R,{children:r.secondaryCharts})]}),e.jsx(R,{children:r.content??r.table}),e.jsx(R,{children:r.footer})]})}function dn({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsxs("div",{className:`flex flex-col ${t} flex-1 pb-24`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{className:"flex-1 max-w-2xl",children:r.form??r.content})]}),e.jsx(eo,{children:r.actions})]})}function cn({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[r.stats&&e.jsx("div",{className:"flex-1",children:r.stats}),r.dateRange&&e.jsx("div",{className:"flex-shrink-0",children:r.dateRange})]}),e.jsx(R,{children:r.filters}),e.jsx(R,{children:r.charts??r.primaryChart}),r.secondaryCharts&&e.jsx("div",{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 ${t}`,children:r.secondaryCharts}),e.jsx(R,{children:r.table??r.content}),e.jsx(R,{children:r.footer})]})}function to(r){const{layout:t="list",maxWidth:o,padding:a,className:s=""}=r,n=a??"p-4 sm:p-6",l=o?`${o} mx-auto w-full`:"w-full",d=(()=>{switch(t){case"list":return e.jsx(ro,{p:r});case"detail":return e.jsx(an,{p:r});case"settings":return e.jsx(sn,{p:r});case"wizard":return e.jsx(nn,{p:r});case"dashboard":return e.jsx(ln,{p:r});case"form":return e.jsx(dn,{p:r});case"report":return e.jsx(cn,{p:r});default:return e.jsx(ro,{p:r})}})();return e.jsx("div",{className:`${n} ${l} ${s}`,children:d})}to.displayName="FeaturePageScaffold";const fn={fontFamily:"var(--font-label)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-button)",color:"var(--foreground)"},hn={fontFamily:"var(--font-p)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)",color:"var(--muted-foreground)"};function oo({title:r,description:t,action:o,children:a,className:s=""}){return e.jsxs("section",{className:`space-y-4 ${s}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{style:fn,children:r}),t&&e.jsx("p",{className:"mt-1",style:hn,children:t})]}),o&&e.jsx("div",{className:"flex-shrink-0",children:o})]}),e.jsx("div",{className:"border-t border-border pt-4",children:a})]})}oo.displayName="ScaffoldSection";function ao({children:r,className:t=""}){return e.jsx("div",{className:`grid grid-cols-2 lg:grid-cols-4 gap-4 ${t}`,children:r})}ao.displayName="ScaffoldKPIRow";function un(r){return r.map(t=>({label:t.title??"",items:t.items.filter(o=>!o.disabled).map(o=>({id:o.id,label:o.label,icon:o.icon,badge:typeof o.badge=="function"?void 0:o.badge}))}))}function bn({activeItemId:r,onNavigate:t,notificationCount:o,onNotificationClick:a,onUserClick:s,onSearchClick:n,showSearch:l=!1,version:d,versionDate:i,contentPadding:h=!0,children:u,className:x=""}){var S,$,E,I;const{sidebarOpen:y,setSidebarOpen:f,user:p,product:g,breadcrumbs:m,navGroups:k,navLoading:z,navError:b,refreshNav:w}=Vt(),[N,F]=c.useState(!(((S=g==null?void 0:g.shell)==null?void 0:S.sidebarDefaultOpen)??!0)),[L,M]=c.useState(!1);c.useEffect(()=>{function H(){window.innerWidth>=768&&M(!1)}return window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]);const W=un(k),D=c.useCallback(H=>{const P=k.flatMap(_=>_.items).find(_=>_.id===H.id);P&&t&&t(P),M(!1)},[k,t]),T=e.jsx(Oe,{brand:g?{name:g.brand.name}:{name:"Sellsuki"},groups:z?[{label:"Loading",items:[]}]:W,activeItem:r,onNavigate:D,collapsed:N,onCollapsedChange:F,showCollapseToggle:(($=g==null?void 0:g.shell)==null?void 0:$.sidebarCollapsible)??!0,version:d,versionDate:i}),A=N?"var(--shell-sidebar-collapsed, 64px)":"var(--shell-sidebar-width, 240px)";return e.jsxs("div",{className:`min-h-screen bg-[var(--background)] ${x}`,"data-product":g==null?void 0:g.product,children:[e.jsx("div",{className:"fixed top-0 left-0 right-0",style:{zIndex:"var(--z-shell-navbar, 100)"},children:e.jsx(lr,{brand:g?{name:g.brand.name,logo:g.brand.logo}:{name:"Sellsuki"},breadcrumbs:m.map(H=>({label:H.label,href:H.href})),user:p?{name:p.name,avatar:p.avatar}:void 0,showSearch:l,onSearchClick:n,notificationCount:o,onNotificationClick:a,onUserClick:s,workspaceSwitcher:(E=g==null?void 0:g.brand)==null?void 0:E.workspaceSwitcher,onSidebarToggle:()=>{window.innerWidth<768?M(H=>!H):F(H=>!H)},onMobileMenuClick:()=>M(H=>!H)})}),e.jsx("aside",{className:"hidden md:flex flex-col fixed left-0 bottom-0 overflow-y-auto bg-card border-r border-border",style:{top:"var(--shell-navbar-height, 56px)",width:A,zIndex:"var(--z-shell-sidebar, 90)",transition:"width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))"},children:z?e.jsx("div",{className:"p-4 w-full",children:e.jsx(ar,{rows:6})}):b?e.jsxs("div",{className:"p-3",children:[e.jsx(Qe,{variant:"error",children:e.jsx("span",{style:{fontSize:"var(--text-label)"},children:"Nav load failed"})}),e.jsx("button",{type:"button",className:"mt-2 text-primary cursor-pointer hover:underline",style:{fontSize:"var(--text-label)"},onClick:w,children:"Retry"})]}):T}),L&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/40 md:hidden",style:{zIndex:"var(--z-shell-overlay, 80)"},onClick:()=>M(!1)}),e.jsx("div",{className:"fixed left-0 bottom-0 bg-card shadow-lg md:hidden overflow-y-auto",style:{top:"var(--shell-navbar-height, 56px)",width:"var(--shell-sidebar-width, 240px)",zIndex:"var(--z-shell-sidebar, 90)"},children:z?e.jsx("div",{className:"p-4",children:e.jsx(ar,{rows:6})}):e.jsx(Oe,{brand:g?{name:g.brand.name}:{name:"Sellsuki"},groups:W,activeItem:r,onNavigate:D,collapsed:!1,showCollapseToggle:!1,version:d,versionDate:i})})]}),e.jsx("main",{className:`min-h-screen ${h?"":"p-0"}`,style:{paddingTop:"var(--shell-navbar-height, 56px)",marginLeft:A,transition:"margin-left var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))",maxWidth:(I=g==null?void 0:g.shell)==null?void 0:I.contentMaxWidth},children:e.jsx(Rt,{children:u})}),e.jsx(Er,{})]})}function so({product:r,user:t,navResolver:o,...a}){var s;return e.jsx(kr,{product:r,user:t,navResolver:o,defaultSidebarOpen:((s=r==null?void 0:r.shell)==null?void 0:s.sidebarDefaultOpen)??!0,children:e.jsx(bn,{...a})})}so.displayName="AppShell";function no(){return e.jsxs("div",{className:"min-h-screen bg-[var(--background)] flex flex-col",children:[e.jsxs("div",{className:"h-14 bg-card border-b border-border flex items-center px-4 gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-md)] bg-muted/40 animate-pulse"}),e.jsx("div",{className:"w-24 h-4 rounded bg-muted/40 animate-pulse"}),e.jsxs("div",{className:"ml-auto flex gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted/40 animate-pulse"}),e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted/40 animate-pulse"})]})]}),e.jsxs("div",{className:"flex flex-1",children:[e.jsxs("div",{className:"w-60 border-r border-border p-4 space-y-3 hidden md:block",children:[e.jsx("div",{className:"w-full h-8 rounded-[var(--radius-md)] bg-muted/40 animate-pulse"}),Array.from({length:6}).map((r,t)=>e.jsx("div",{className:"w-full h-7 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"},t))]}),e.jsxs("div",{className:"flex-1 p-6 space-y-4",children:[e.jsx("div",{className:"h-8 w-48 rounded bg-muted/40 animate-pulse"}),e.jsx("div",{className:"h-32 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"}),e.jsx("div",{className:"h-64 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"})]})]})]})}no.displayName="AppShellSkeleton";const gn={product:"sellsuki",brand:{name:"Sellsuki",theme:"sellsuki"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},pn={product:"patona",brand:{name:"Patona",theme:"patona"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},vn={product:"sukispace",brand:{name:"Sukispace",theme:"sukispace"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},mn={product:"shipmunk",brand:{name:"Shipmunk",theme:"shipmunk"}},xn={product:"akita",brand:{name:"Akita",theme:"akita"}};C.Accordion=Yr,C.AccordionItem=Re,C.AdvancedDataTable=Ls,C.Alert=Qe,C.AppShell=so,C.AppShellErrorBoundary=Rt,C.AppShellProvider=kr,C.AppShellSkeleton=no,C.AreaChart=Dt,C.Avatar=Ur,C.AvatarGroup=Xr,C.Badge=mo,C.BarChart=At,C.Breadcrumb=Ko,C.Button=Ze,C.ButtonGroup=uo,C.Card=Kr,C.CardBody=qr,C.CardFooter=Jr,C.CardHeader=Zr,C.Checkbox=Fe,C.CheckboxGroup=yo,C.ChoiceCard=Gt,C.ChoiceCardGroup=Ut,C.ColorPicker=ea,C.ConfirmDialog=Lo,C.DSButton=Ze,C.DSCheckbox=Fe,C.DSInput=qe,C.DSRadio=Ir,C.DSTable=Or,C.DSTextarea=Je,C.DatePicker=Fo,C.DateRangePicker=_t,C.DateTimePicker=Yt,C.Divider=Vr,C.DonutChart=jt,C.Drawer=Rr,C.Dropdown=et,C.EmptyState=la,C.FeaturePageScaffold=to,C.FileUpload=fa,C.FilterBar=ks,C.FormError=zt,C.FormField=is,C.FormHelperText=Ft,C.FormLabel=fr,C.FormSuccess=Ct,C.IconButton=Wr,C.ImageGallery=Jt,C.ImagePreview=ba,C.Input=qe,C.LineChart=Mt,C.Menu=nt,C.MiniSparkline=Et,C.Modal=Pr,C.Notification=it,C.NotificationCenter=ya,C.NumberInput=us,C.OTPInput=vs,C.PageHeader=ws,C.Pagination=jo,C.Popover=Na,C.ProgressBar=dt,C.Radio=Ir,C.RadioCard=Xt,C.RadioGroup=No,C.Rating=Ca,C.RepeatableFieldList=Zt,C.RichTextEditor=qt,C.ScaffoldKPIRow=ao,C.ScaffoldSection=oo,C.SearchField=Io,C.Sidebar=Oe,C.SidebarAccountSwitcher=or,C.Skeleton=se,C.SkeletonCard=Ta,C.SkeletonList=ar,C.SkeletonTable=Ia,C.Spinner=ft,C.StatCard=Pa,C.Statistic=Ha,C.Stepper=mt,C.Switch=Za,C.Table=Or,C.Tabs=_o,C.Tag=xt,C.TagInput=yt,C.Textarea=Je,C.ThumbnailCell=wr,C.TimePicker=xr,C.Timeline=ts,C.ToastContainer=Er,C.Tooltip=rr,C.TopNavbar=lr,C.TransferList=as,C.Tree=ss,C.akitaBrandConfig=xn,C.patonaBrandConfig=pn,C.sellsukiBrandConfig=gn,C.shipmunkBrandConfig=mn,C.sukispaceBrandConfig=vn,C.toast=ye,C.useAppShell=Qt,C.useAppShellFull=Vt,C.useBreadcrumbs=tn,C.useFormField=ls,C.useNavResolver=on,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
|
|
94
|
+
text-foreground`,style:{fontFamily:"var(--font-button)",fontWeight:"var(--weight-button)"}},m))}),n&&e.jsx("p",{className:"mt-2 text-destructive",style:gs,children:n})]})}const ms={fontFamily:"var(--font-h3, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-h3, 28px)",fontWeight:"var(--weight-h3, 700)",color:"var(--foreground)",lineHeight:1.3},xs={fontFamily:"var(--font-p, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-p, 20px)",fontWeight:"var(--weight-p, 400)",color:"var(--muted-foreground)",lineHeight:1.4},ys={fontFamily:"var(--font-label, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-label)"};function ws({title:r,subtitle:t,breadcrumb:o,actions:a,tabs:s,sticky:n=!1,className:l=""}){return e.jsxs("div",{className:`bg-card border-b border-border ${n?"sticky top-0 z-10":""} ${l}`,children:[e.jsxs("div",{className:"px-6 pt-5 pb-4",children:[o&&e.jsx("div",{className:"mb-2",style:ys,children:o}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{style:ms,className:"truncate",children:r}),t&&e.jsx("p",{className:"mt-0.5",style:xs,children:t})]}),a&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 pt-0.5",children:a})]})]}),s&&e.jsx("div",{className:"px-6",children:s})]})}const Ns={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ye={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400};function Ss({config:r,value:t,onChange:o}){var h;const[a,s]=c.useState(!1),n=Array.isArray(t)?t:t?[t]:[],l=n.length>0,d=c.useCallback(b=>{if(r.type==="single"){const x=n[0]===b?null:b;o(r.key,x),s(!1)}else{const x=n.includes(b)?n.filter(w=>w!==b):[...n,b];o(r.key,x.length?x:null)}},[r,n,o]),i=n.length===1?(h=r.options.find(b=>b.value===n[0]))==null?void 0:h.label:n.length>1?`${r.label} (${n.length})`:r.label;return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>s(b=>!b),className:`inline-flex items-center gap-1.5 h-9 px-3 rounded-lg border transition-colors cursor-pointer select-none ${l?"bg-[var(--primary)]/10 border-[var(--primary)] text-[var(--primary)]":"bg-[var(--background)] border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ns,children:[i,l&&e.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-[var(--primary)] text-primary-foreground font-bold",style:{fontSize:"var(--text-label)",lineHeight:1},children:n.length}),e.jsx(v.ChevronDown,{size:14,className:`transition-transform ${a?"rotate-180":""}`})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),e.jsx("div",{className:"absolute left-0 top-full mt-1 z-20 bg-[var(--card)] border border-[var(--border)] rounded-lg shadow-elevation-sm min-w-[160px] py-1 overflow-hidden",children:r.options.map(b=>{const x=n.includes(b.value);return e.jsxs("button",{type:"button",onClick:()=>d(b.value),className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors cursor-pointer ${x?"bg-[var(--primary)]/10 text-[var(--primary)]":"text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ye,children:[r.type==="multi"&&e.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border flex-shrink-0 ${x?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":"border-[var(--border)]"}`,children:x&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),b.label]},b.value)})})]})]})}function ks({filters:r=[],searchPlaceholder:t="Search...",showSearch:o=!0,value:a,onFilterChange:s,className:n=""}){const[l,d]=c.useState({search:"",filters:{}}),i=a??l,h=c.useCallback(g=>{d(g),s==null||s(g)},[s]),b=c.useCallback(g=>{h({...i,search:g.target.value})},[i,h]),x=c.useCallback((g,y)=>{h({...i,filters:{...i.filters,[g]:y}})},[i,h]),w=c.useCallback(()=>{h({search:"",filters:{}})},[h]),f=Object.values(i.filters).filter(g=>g!==null&&(!Array.isArray(g)||g.length>0)).length,p=f>0||i.search&&i.search.length>0;return e.jsxs("div",{className:`flex items-center gap-2 flex-wrap bg-[var(--background)] border border-[var(--border)] rounded-lg px-3 py-2 ${n}`,children:[o&&e.jsxs("div",{className:"relative flex items-center",children:[e.jsx(v.Search,{size:14,className:"absolute left-2.5 text-[var(--muted-foreground)] pointer-events-none"}),e.jsx("input",{type:"text",value:i.search??"",onChange:b,placeholder:t,className:"h-8 pl-8 pr-3 rounded-md border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)] placeholder:text-[var(--muted-foreground)] focus:outline-none focus:border-[var(--primary)] focus:ring-1 focus:ring-[var(--primary)] transition-colors min-w-[200px]",style:Ye})]}),o&&r.length>0&&e.jsx("div",{className:"w-px h-5 bg-[var(--border)] flex-shrink-0"}),r.length>0&&e.jsx(v.SlidersHorizontal,{size:14,className:"text-[var(--muted-foreground)] flex-shrink-0"}),r.map(g=>e.jsx(Ss,{config:g,value:i.filters[g.key]??null,onChange:x},g.key)),f>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-[var(--primary)]/10 text-[var(--primary)]",style:Ye,children:[f," active"]}),p&&e.jsxs("button",{type:"button",onClick:w,className:"inline-flex items-center gap-1 h-7 px-2 rounded-md text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--muted)] transition-colors cursor-pointer ml-auto",style:Ye,children:[e.jsx(v.X,{size:12}),"Clear all"]})]})}const Lt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},hr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ve={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400},fe={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function $s({width:r}){return e.jsx("div",{className:"h-4 rounded bg-muted animate-pulse",style:{width:r??"80%"}})}function zs({columns:r,hidden:t,onToggle:o}){const[a,s]=c.useState(!1),n=c.useRef(null);c.useEffect(()=>{function d(i){n.current&&!n.current.contains(i.target)&&s(!1)}return a&&document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[a]);const l=r.filter(d=>d.hideable!==!1);return e.jsxs("div",{ref:n,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>s(d=>!d),className:"inline-flex items-center gap-1.5 h-8 px-3 rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--muted-foreground)] hover:bg-[var(--muted)] hover:text-[var(--foreground)] transition-colors cursor-pointer",style:ve,children:[e.jsx(v.Columns3,{size:14}),"Columns"]}),a&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-30 bg-[var(--card)] border border-[var(--border)] rounded-lg shadow-elevation-sm w-44 py-1",children:l.map(d=>{const i=!t.has(d.key);return e.jsxs("button",{type:"button",onClick:()=>o(d.key),className:"w-full flex items-center justify-between gap-2 px-3 py-2 hover:bg-[var(--muted)] text-[var(--foreground)] transition-colors cursor-pointer",style:ve,children:[e.jsx("span",{children:d.header}),i&&e.jsx(v.Check,{size:13,className:"text-[var(--primary)]"})]},d.key)})})]})}function Cs({count:r,actions:t,selectedKeys:o,onClear:a}){return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 bg-[var(--primary)]/8 border-b border-[var(--primary)]/20",children:[e.jsxs("span",{className:"text-[var(--primary)] flex-shrink-0",style:Lt,children:[r," selected"]}),e.jsx("div",{className:"flex items-center gap-2 flex-1 flex-wrap",children:t.map((s,n)=>e.jsxs("button",{type:"button",onClick:()=>s.onClick(o),className:`inline-flex items-center gap-1.5 h-7 px-3 rounded-md border transition-colors cursor-pointer ${s.variant==="destructive"?"border-[var(--destructive)] text-[var(--destructive)] hover:bg-[var(--destructive)]/10":"border-[var(--primary)] text-[var(--primary)] hover:bg-[var(--primary)]/10"}`,style:{...ve,fontWeight:500},children:[s.icon,s.label]},n))}),e.jsx("button",{type:"button",onClick:a,className:"text-[var(--muted-foreground)] hover:text-[var(--foreground)] transition-colors cursor-pointer p-1 rounded",title:"Clear selection",children:e.jsx(v.X,{size:14})})]})}const Fs=[10,20,50,100];function Ws({meta:r,onPageChange:t}){const{page:o,pageSize:a,totalCount:s}=r,n=Math.max(1,Math.ceil(s/a)),l=s===0?0:(o-1)*a+1,d=Math.min(o*a,s),i=c.useMemo(()=>{const h=[];if(n<=7)for(let b=1;b<=n;b++)h.push(b);else{h.push(1),o>3&&h.push("...");for(let b=Math.max(2,o-1);b<=Math.min(n-1,o+1);b++)h.push(b);o<n-2&&h.push("..."),h.push(n)}return h},[o,n]);return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[var(--border)] flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[var(--muted-foreground)] whitespace-nowrap",style:ve,children:[l,"–",d," of ",s.toLocaleString()]}),e.jsx("select",{value:a,onChange:h=>t(1,Number(h.target.value)),className:"h-7 px-2 rounded-md border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)] focus:outline-none focus:border-[var(--primary)] cursor-pointer",style:ve,children:Fs.map(h=>e.jsxs("option",{value:h,children:[h," / page"]},h))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ur,{disabled:o===1,onClick:()=>t(o-1,a),label:"‹ Prev"}),i.map((h,b)=>h==="..."?e.jsx("span",{className:"px-2 text-[var(--muted-foreground)]",style:ve,children:"…"},`ellipsis-${b}`):e.jsx(ur,{active:h===o,onClick:()=>t(h,a),label:String(h)},h)),e.jsx(ur,{disabled:o===n,onClick:()=>t(o+1,a),label:"Next ›"})]})]})}function ur({label:r,active:t,disabled:o,onClick:a}){return e.jsx("button",{type:"button",onClick:a,disabled:o,className:`min-w-[28px] h-7 px-2 rounded-md border transition-colors cursor-pointer ${t?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":o?"border-transparent text-[var(--muted-foreground)] cursor-not-allowed":"border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:{...ve,fontWeight:t?600:400},children:r})}function Ls({columns:r,data:t,rowKey:o="id",pagination:a,sortBy:s,sortOrder:n,onPageChange:l,onSortChange:d,selectable:i=!1,selectedRows:h,onSelectionChange:b,bulkActions:x=[],onRowClick:w,expandedRowRender:f,loading:p=!1,loadingRows:g=5,error:y,emptyMessage:k="No data found",emptyDescription:$,showColumnToggle:u=!1,size:m="md",stickyHeader:N=!1,className:C=""}){const[L,M]=c.useState(new Set(r.filter(B=>B.defaultHidden).map(B=>B.key))),W=c.useCallback(B=>{M(V=>{const J=new Set(V);return J.has(B)?J.delete(B):J.add(B),J})},[]),D=c.useMemo(()=>r.filter(B=>!L.has(B.key)),[r,L]),[T,A]=c.useState(new Set),S=h??T,z=c.useCallback(B=>{h||A(B);const V=t.filter(J=>B.has(J[o]));b==null||b(B,V)},[h,t,o,b]),E=c.useMemo(()=>t.map(B=>B[o]),[t,o]),I=E.length>0&&E.every(B=>S.has(B)),H=S.size>0&&!I,P=c.useCallback(()=>{z(I?new Set:new Set(E))},[I,E,z]),_=c.useCallback(B=>{const V=new Set(S);V.has(B)?V.delete(B):V.add(B),z(V)},[S,z]),[Q,O]=c.useState(new Set),Z=c.useCallback(B=>{O(V=>{const J=new Set(V);return J.has(B)?J.delete(B):J.add(B),J})},[]),oe=c.useCallback(B=>{d&&(s===B?d(B,n==="asc"?"desc":"asc"):d(B,"asc"))},[s,n,d]),X=c.useMemo(()=>{const B={};let V=0;i&&(V+=48),f&&(V+=40);for(const J of D)if(J.frozen){B[J.key]=V;const le=typeof J.width=="number"?J.width:parseInt(J.width??"120");V+=isNaN(le)?120:le}return B},[D,i,f]),re=D.length+(i?1:0)+(f?1:0),U="sticky z-[2] bg-inherit";return e.jsxs("div",{className:`rounded-[var(--radius-md)] border border-[var(--border)] overflow-hidden ${C}`,children:[u&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-2.5 border-b border-[var(--border)] bg-[var(--background)]",children:e.jsx(zs,{columns:r,hidden:L,onToggle:W})}),i&&S.size>0&&x.length>0&&e.jsx(Cs,{count:S.size,actions:x,selectedKeys:Array.from(S),onClear:()=>z(new Set)}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",style:{minWidth:"100%"},children:[e.jsx("thead",{className:N?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"border-b border-border",style:{backgroundColor:"color-mix(in srgb, var(--muted) 30%, var(--background) 70%)"},children:[f&&e.jsx("th",{className:`${fe[m]} w-10`}),i&&e.jsx("th",{className:`${fe[m]} w-12`,children:e.jsx(Fe,{size:"sm",checked:I,indeterminate:H&&!I,onChange:P})}),D.map(B=>{const V=B.frozen&&B.key in X,J=s===B.key;return e.jsx("th",{className:`${fe[m]} text-${B.align??"left"} text-[var(--foreground)] whitespace-nowrap select-none ${B.sortable&&d?"cursor-pointer hover:text-[var(--primary)]":""} ${V?U:""}`,style:{...Lt,width:B.width,minWidth:B.minWidth??80,...V?{left:X[B.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},onClick:()=>B.sortable&&oe(B.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[B.header,B.sortable&&d&&e.jsx("span",{className:J?"text-[var(--primary)]":"text-[var(--muted-foreground)]/60",children:J?n==="asc"?e.jsx(v.ChevronUp,{size:13}):e.jsx(v.ChevronDown,{size:13}):e.jsx(v.ChevronsUpDown,{size:12})})]})},B.key)})]})}),e.jsxs("tbody",{children:[y&&e.jsx("tr",{children:e.jsx("td",{colSpan:re,className:`${fe[m]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-10",children:[e.jsx(v.AlertCircle,{size:32,className:"text-[var(--destructive)] opacity-60"}),e.jsx("span",{className:"text-[var(--destructive)]",style:hr,children:y})]})})}),!y&&p&&Array.from({length:g}).map((B,V)=>e.jsxs("tr",{className:"border-b border-[var(--border)] last:border-b-0",children:[f&&e.jsx("td",{className:`${fe[m]} w-10`}),i&&e.jsx("td",{className:`${fe[m]} w-12`,children:e.jsx("div",{className:"w-4 h-4 rounded bg-muted animate-pulse"})}),D.map(J=>e.jsx("td",{className:`${fe[m]}`,children:e.jsx($s,{width:J.align==="right"?"60%":J.align==="center"?"50%":"75%"})},J.key))]},`skel-${V}`)),!y&&!p&&t.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:re,className:`${fe[m]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-[var(--muted)] flex items-center justify-center text-[var(--muted-foreground)]",children:e.jsx(v.ChevronsUpDown,{size:20})}),e.jsx("span",{className:"text-[var(--foreground)]",style:hr,children:k}),$&&e.jsx("span",{className:"text-[var(--muted-foreground)]",style:ve,children:$})]})})}),!y&&!p&&t.map((B,V)=>{const J=B[o],le=S.has(J),me=Q.has(J),Ie=!!w||!!f;return e.jsxs(c.Fragment,{children:[e.jsxs("tr",{className:`group/row border-b border-[var(--border)] last:border-b-0 transition-colors ${le?"bg-primary/5":"bg-[var(--card)] hover:bg-[var(--row-hover-bg)]"} ${Ie?"cursor-pointer":""}`,onClick:()=>{w==null||w(B),f&&Z(J)},children:[f&&e.jsx("td",{className:`${fe[m]} w-10 text-center`,onClick:q=>{q.stopPropagation(),Z(J)},children:e.jsx(v.ChevronRight,{size:14,className:`text-[var(--muted-foreground)] transition-transform mx-auto ${me?"rotate-90":""}`})}),i&&e.jsx("td",{className:`${fe[m]} w-12`,onClick:q=>q.stopPropagation(),children:e.jsx(Fe,{size:"sm",checked:le,onChange:()=>_(J)})}),D.map(q=>{const xe=q.frozen&&q.key in X,Ne=xe?le?"sticky z-[1] bg-primary/5":"sticky z-[1] bg-[var(--card)] group-hover/row:bg-[var(--row-hover-bg)] transition-colors":"";return e.jsx("td",{className:`${fe[m]} text-${q.align??"left"} text-[var(--foreground)] ${Ne}`,style:{...hr,...xe?{left:X[q.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},children:q.render?q.render(B[q.key],B,V):B[q.key]},q.key)})]}),f&&me&&e.jsx("tr",{className:"bg-[var(--muted)] border-b border-[var(--border)]",children:e.jsx("td",{colSpan:re,className:"px-6 py-4",children:f(B)})})]},J??V)})]})]})}),a&&l&&!p&&!y&&e.jsx(Ws,{meta:a,onPageChange:l})]})}const We=["var(--chart-1, #32a9ff)","var(--chart-2, #22c55e)","var(--chart-3, #f59e0b)","var(--chart-4, #ef4444)","var(--chart-5, #a855f7)","var(--chart-6, #06b6d4)"];function ie(r,t){return r.color??We[t%We.length]}const ne={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function br(r,t,o){return Math.max(t,Math.min(o,r))}function Ge(r){const t=Math.max(...r,0);if(t===0)return 10;const o=Math.pow(10,Math.floor(Math.log10(t)));return Math.ceil(t/o)*o}function gr(r,t){if(r.length===0)return"";if(!t||r.length<3)return r.map((a,s)=>`${s===0?"M":"L"}${a[0]},${a[1]}`).join(" ");let o=`M${r[0][0]},${r[0][1]}`;for(let a=1;a<r.length;a++){const s=r[a-1],n=r[a],l=s[0]+(n[0]-s[0])*.4,d=n[0]-(n[0]-s[0])*.4;o+=` C${l},${s[1]} ${d},${n[1]} ${n[0]},${n[1]}`}return o}function pr({x:r,y:t,label:o,items:a}){return e.jsx("foreignObject",{x:r,y:t,width:160,height:40+a.length*22,style:{overflow:"visible"},children:e.jsxs("div",{className:"bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_16px_rgba(0,0,0,0.12)] p-2 pointer-events-none",style:{width:"max-content",...ne},children:[e.jsx("div",{className:"text-muted-foreground mb-1",children:o}),a.map(s=>e.jsxs("div",{className:"flex items-center gap-1.5 text-foreground",children:[e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:s.color}}),e.jsxs("span",{className:"truncate",children:[s.name,":"]}),e.jsx("span",{className:"font-medium ml-auto pl-2",children:s.value.toLocaleString()})]},s.name))]})})}function Mt({series:r,height:t=240,width:o,showXAxis:a=!0,showYAxis:s=!0,showGrid:n=!0,showLegend:l=!0,showTooltip:d=!0,showDots:i=!0,smooth:h=!1,className:b=""}){c.useId();const x=c.useRef(null),[w,f]=c.useState(null);if(!r.length||!r[0].data.length)return null;const p=r[0].data.map(T=>T.label),g=r.flatMap(T=>T.data.map(A=>A.value)),y=Ge(g),k=0,$={top:12,right:16,bottom:a?36:12,left:s?48:16},u=o??600,m=t,N=u-$.left-$.right,C=m-$.top-$.bottom,L=p.length>1?N/(p.length-1):N;function M(T){return $.left+T*L}function W(T){return $.top+C-(T-k)/(y-k||1)*C}const D=Array.from({length:5},(T,A)=>k+A/4*(y-k));return e.jsxs("div",{className:`w-full ${b}`,children:[e.jsxs("svg",{ref:x,width:o?u:"100%",height:m,viewBox:`0 0 ${u} ${m}`,onMouseLeave:()=>f(null),children:[n&&D.map((T,A)=>e.jsx("line",{x1:$.left,y1:W(T),x2:u-$.right,y2:W(T),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},A)),s&&D.map((T,A)=>e.jsx("text",{x:$.left-8,y:W(T)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:ne,children:T>=1e3?`${(T/1e3).toFixed(1)}k`:T},A)),a&&p.map((T,A)=>{const S=Math.max(1,Math.floor(p.length/8));return A%S!==0&&A!==p.length-1?null:e.jsx("text",{x:M(A),y:m-$.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:ne,children:T},A)}),r.map((T,A)=>{const S=ie(T,A),z=T.data.map((I,H)=>[M(H),W(I.value)]),E=gr(z,h);return e.jsxs("g",{children:[e.jsx("path",{d:E,fill:"none",stroke:S,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),i&&z.map(([I,H],P)=>e.jsx("circle",{cx:I,cy:H,r:3,fill:"var(--card)",stroke:S,strokeWidth:2},P))]},A)}),d&&p.map((T,A)=>e.jsx("rect",{x:M(A)-L/2,y:$.top,width:L,height:C,fill:"transparent",onMouseEnter:()=>f({x:M(A),y:$.top,labelIdx:A})},A)),w&&e.jsx("line",{x1:M(w.labelIdx),y1:$.top,x2:M(w.labelIdx),y2:$.top+C,stroke:"var(--border)",strokeWidth:1,strokeDasharray:"4 2"}),w&&d&&e.jsx(pr,{x:br(M(w.labelIdx)+8,$.left,u-180),y:$.top,label:p[w.labelIdx],items:r.map((T,A)=>{var S;return{name:T.name,value:((S=T.data[w.labelIdx])==null?void 0:S.value)??0,color:ie(T,A)}})})]}),l&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((T,A)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:ne,children:[e.jsx("div",{className:"w-3 h-0.5 rounded-full",style:{backgroundColor:ie(T,A)}}),e.jsx("span",{className:"text-muted-foreground",children:T.name})]},A))})]})}Mt.displayName="LineChart";function Dt({series:r,height:t=240,width:o,showXAxis:a=!0,showYAxis:s=!0,showGrid:n=!0,showLegend:l=!0,showTooltip:d=!0,showDots:i=!1,smooth:h=!0,fillOpacity:b=.15,className:x=""}){const w=c.useId(),[f,p]=c.useState(null);if(!r.length||!r[0].data.length)return null;const g=r[0].data.map(S=>S.label),y=r.flatMap(S=>S.data.map(z=>z.value)),k=Ge(y),$=0,u={top:12,right:16,bottom:a?36:12,left:s?48:16},m=o??600,N=t,C=m-u.left-u.right,L=N-u.top-u.bottom,M=g.length>1?C/(g.length-1):C;function W(S){return u.left+S*M}function D(S){return u.top+L-(S-$)/(k-$||1)*L}const T=Array.from({length:5},(S,z)=>$+z/4*(k-$)),A=u.top+L;return e.jsxs("div",{className:`w-full ${x}`,children:[e.jsxs("svg",{width:o?m:"100%",height:N,viewBox:`0 0 ${m} ${N}`,onMouseLeave:()=>p(null),children:[e.jsx("defs",{children:r.map((S,z)=>e.jsxs("linearGradient",{id:`${w}-grad-${z}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:ie(S,z),stopOpacity:b*4}),e.jsx("stop",{offset:"100%",stopColor:ie(S,z),stopOpacity:0})]},z))}),n&&T.map((S,z)=>e.jsx("line",{x1:u.left,y1:D(S),x2:m-u.right,y2:D(S),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},z)),s&&T.map((S,z)=>e.jsx("text",{x:u.left-8,y:D(S)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:ne,children:S>=1e3?`${(S/1e3).toFixed(1)}k`:S},z)),a&&g.map((S,z)=>{const E=Math.max(1,Math.floor(g.length/8));return z%E!==0&&z!==g.length-1?null:e.jsx("text",{x:W(z),y:N-u.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:ne,children:S},z)}),r.map((S,z)=>{const E=ie(S,z),I=S.data.map((_,Q)=>[W(Q),D(_.value)]),H=gr(I,h),P=H+` L${I[I.length-1][0]},${A} L${I[0][0]},${A} Z`;return e.jsxs("g",{children:[e.jsx("path",{d:P,fill:`url(#${w}-grad-${z})`}),e.jsx("path",{d:H,fill:"none",stroke:E,strokeWidth:2,strokeLinecap:"round"}),i&&I.map(([_,Q],O)=>e.jsx("circle",{cx:_,cy:Q,r:3,fill:"var(--card)",stroke:E,strokeWidth:2},O))]},z)}),d&&g.map((S,z)=>e.jsx("rect",{x:W(z)-M/2,y:u.top,width:M,height:L,fill:"transparent",onMouseEnter:()=>p({x:W(z),y:u.top,labelIdx:z})},z)),f&&e.jsx("line",{x1:W(f.labelIdx),y1:u.top,x2:W(f.labelIdx),y2:u.top+L,stroke:"var(--border)",strokeWidth:1,strokeDasharray:"4 2"}),f&&e.jsx(pr,{x:br(W(f.labelIdx)+8,u.left,m-180),y:u.top,label:g[f.labelIdx],items:r.map((S,z)=>{var E;return{name:S.name,value:((E=S.data[f.labelIdx])==null?void 0:E.value)??0,color:ie(S,z)}})})]}),l&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((S,z)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:ne,children:[e.jsx("div",{className:"w-3 h-0.5 rounded-full",style:{backgroundColor:ie(S,z)}}),e.jsx("span",{className:"text-muted-foreground",children:S.name})]},z))})]})}Dt.displayName="AreaChart";function At({series:r,height:t=240,width:o,showXAxis:a=!0,showYAxis:s=!0,showGrid:n=!0,showLegend:l=!0,showTooltip:d=!0,stacked:i=!1,radius:h=4,className:b=""}){const[x,w]=c.useState(null);if(!r.length||!r[0].data.length)return null;const f=r[0].data.map(A=>A.label);let p;i?p=Ge(f.map((A,S)=>r.reduce((z,E)=>{var I;return z+(((I=E.data[S])==null?void 0:I.value)??0)},0))):p=Ge(r.flatMap(A=>A.data.map(S=>S.value)));const g={top:12,right:16,bottom:a?36:12,left:s?48:16},y=o??600,k=t,$=y-g.left-g.right,u=k-g.top-g.bottom,m=$/f.length,N=m*.2,C=m-N*2,L=i?C:C/r.length;function M(A){return g.top+u-A/p*u}function W(A){return A/p*u}function D(A){return g.left+A*m+N}const T=Array.from({length:5},(A,S)=>S/4*p);return e.jsxs("div",{className:`w-full ${b}`,children:[e.jsxs("svg",{width:o?y:"100%",height:k,viewBox:`0 0 ${y} ${k}`,onMouseLeave:()=>w(null),children:[n&&T.map((A,S)=>e.jsx("line",{x1:g.left,y1:M(A),x2:y-g.right,y2:M(A),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},S)),s&&T.map((A,S)=>e.jsx("text",{x:g.left-8,y:M(A)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:ne,children:A>=1e3?`${(A/1e3).toFixed(1)}k`:A},S)),a&&f.map((A,S)=>e.jsx("text",{x:D(S)+C/2,y:k-g.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:ne,children:A},S)),f.map((A,S)=>{if(i){let z=g.top+u;return e.jsx("g",{children:r.map((E,I)=>{var V;const H=((V=E.data[S])==null?void 0:V.value)??0,P=W(H),_=z-P;z=_;const Q=ie(E,I),O=I===r.length-1,Z=I===0,oe=h,X=D(S),re=C,U=P,B=O&&Z?`M${X},${_+oe} Q${X},${_} ${X+oe},${_} L${X+re-oe},${_} Q${X+re},${_} ${X+re},${_+oe} L${X+re},${_+U} L${X},${_+U} Z`:O?`M${X},${_+oe} Q${X},${_} ${X+oe},${_} L${X+re-oe},${_} Q${X+re},${_} ${X+re},${_+oe} L${X+re},${_+U} L${X},${_+U} Z`:`M${X},${_} L${X+re},${_} L${X+re},${_+U} L${X},${_+U} Z`;return e.jsx("path",{d:B,fill:Q},I)})},S)}else return e.jsx("g",{children:r.map((z,E)=>{var Z;const I=((Z=z.data[S])==null?void 0:Z.value)??0,H=W(I),P=D(S)+E*L,_=M(I),Q=ie(z,E),O=Math.min(h,L/2);return e.jsx("path",{d:`M${P},${_+O} Q${P},${_} ${P+O},${_} L${P+L-O},${_} Q${P+L},${_} ${P+L},${_+O} L${P+L},${_+H} L${P},${_+H} Z`,fill:Q},E)})},S)}),d&&f.map((A,S)=>e.jsx("rect",{x:D(S),y:g.top,width:C,height:u,fill:"transparent",style:{cursor:"default"},onMouseEnter:()=>w({x:D(S)+C/2,y:g.top,labelIdx:S})},S)),x&&e.jsx(pr,{x:br(x.x+8,g.left,y-180),y:g.top,label:f[x.labelIdx],items:r.map((A,S)=>{var z;return{name:A.name,value:((z=A.data[x.labelIdx])==null?void 0:z.value)??0,color:ie(A,S)}})})]}),l&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((A,S)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:ne,children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:ie(A,S)}}),e.jsx("span",{className:"text-muted-foreground",children:A.name})]},S))})]})}At.displayName="BarChart";function jt({data:r,size:t=200,innerRatio:o=.6,centerLabel:a,centerValue:s,showLegend:n=!0,showTooltip:l=!0,className:d=""}){const[i,h]=c.useState(null),b=r.reduce((u,m)=>u+m.value,0);if(b===0||r.length===0)return null;const x=t/2,w=t/2,f=t/2-4,p=f*o;let g=-Math.PI/2;const y=r.map((u,m)=>{const N=u.value/b,C=g,L=g+N*2*Math.PI;g=L;const M=x+f*Math.cos(C),W=w+f*Math.sin(C),D=x+f*Math.cos(L),T=w+f*Math.sin(L),A=x+p*Math.cos(L),S=w+p*Math.sin(L),z=x+p*Math.cos(C),E=w+p*Math.sin(C),I=N>.5?1:0;return{path:[`M${M},${W}`,`A${f},${f} 0 ${I} 1 ${D},${T}`,`L${A},${S}`,`A${p},${p} 0 ${I} 0 ${z},${E}`,"Z"].join(" "),color:u.color??We[m%We.length],ratio:N,d:u,i:m}}),k=s??b.toLocaleString(),$=i!==null?r[i]:null;return e.jsxs("div",{className:`flex items-center gap-6 ${d}`,children:[e.jsx("div",{className:"relative flex-shrink-0",children:e.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[y.map(u=>e.jsx("path",{d:u.path,fill:u.color,opacity:i===null||i===u.i?1:.4,style:{transition:"opacity 0.15s"},onMouseEnter:()=>h(u.i),onMouseLeave:()=>h(null)},u.i)),o>0&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x,y:w-6,textAnchor:"middle",fill:"var(--foreground)",style:{...ne,fontWeight:"700",fontSize:"18px"},children:$?$.value.toLocaleString():k}),(a||$)&&e.jsx("text",{x,y:w+12,textAnchor:"middle",fill:"var(--muted-foreground)",style:{...ne,fontSize:"var(--text-caption)"},children:$?$.label:a})]})]})}),n&&e.jsx("div",{className:"flex flex-col gap-2",children:r.map((u,m)=>e.jsxs("div",{className:"flex items-center gap-2 cursor-default",style:ne,onMouseEnter:()=>h(m),onMouseLeave:()=>h(null),children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm flex-shrink-0",style:{backgroundColor:u.color??We[m%We.length]}}),e.jsx("span",{className:"text-foreground",children:u.label}),e.jsxs("span",{className:"text-muted-foreground ml-auto pl-4",children:[(u.value/b*100).toFixed(1),"%"]})]},m))})]})}jt.displayName="DonutChart";function Et({values:r,type:t="line",width:o=80,height:a=32,color:s,showValue:n=!1,trend:l,className:d=""}){if(!r.length)return null;const i=Math.min(...r),b=Math.max(...r)-i||1,x=r[r.length-1]>r[0]?"up":r[r.length-1]<r[0]?"down":"neutral",w=l??x,p=s??(w==="up"?"var(--chart-1, #22c55e)":w==="down"?"var(--chart-4, #ef4444)":"var(--muted-foreground)"),g=2,y=o-g*2,k=a-g*2;function $(L){return g+L/(r.length-1||1)*y}function u(L){return g+k-(L-i)/b*k}if(t==="bar"){const L=y/r.length-1;return e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d}`,children:[e.jsx("svg",{width:o,height:a,viewBox:`0 0 ${o} ${a}`,children:r.map((M,W)=>{const D=(M-i)/b*k;return e.jsx("rect",{x:g+W*(y/r.length),y:g+k-D,width:L,height:D,fill:p,rx:1,opacity:W===r.length-1?1:.5},W)})}),n&&e.jsx("span",{style:{...ne,color:p},children:r[r.length-1].toLocaleString()})]})}const m=r.map((L,M)=>[$(M),u(L)]),N=gr(m,!1),C=N+` L${m[m.length-1][0]},${g+k} L${m[0][0]},${g+k} Z`;return e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d}`,children:[e.jsxs("svg",{width:o,height:a,viewBox:`0 0 ${o} ${a}`,children:[t==="area"&&e.jsx("path",{d:C,fill:p,fillOpacity:.15}),e.jsx("path",{d:N,fill:"none",stroke:p,strokeWidth:1.5,strokeLinecap:"round"}),e.jsx("circle",{cx:m[m.length-1][0],cy:m[m.length-1][1],r:2,fill:p})]}),n&&e.jsx("span",{style:{...ne,color:p},children:r[r.length-1].toLocaleString()})]})}Et.displayName="MiniSparkline";function ge(r){const t=new Date(r);return t.setHours(0,0,0,0),t}function pe(r){const t=new Date(r);return t.setHours(23,59,59,999),t}const Ms=[{label:"Today",value:"today",range:()=>{const r=new Date;return{from:ge(r),to:pe(r)}}},{label:"Yesterday",value:"yesterday",range:()=>{const r=new Date;return r.setDate(r.getDate()-1),{from:ge(r),to:pe(r)}}},{label:"Last 7 days",value:"last7",range:()=>{const r=new Date,t=new Date;return t.setDate(t.getDate()-6),{from:ge(t),to:pe(r)}}},{label:"Last 30 days",value:"last30",range:()=>{const r=new Date,t=new Date;return t.setDate(t.getDate()-29),{from:ge(t),to:pe(r)}}},{label:"This month",value:"thisMonth",range:()=>{const r=new Date,t=new Date(r.getFullYear(),r.getMonth(),1),o=new Date(r.getFullYear(),r.getMonth()+1,0);return{from:ge(t),to:pe(o)}}},{label:"Last month",value:"lastMonth",range:()=>{const r=new Date,t=new Date(r.getFullYear(),r.getMonth()-1,1),o=new Date(r.getFullYear(),r.getMonth(),0);return{from:ge(t),to:pe(o)}}},{label:"Custom range",value:"custom",range:()=>({from:null,to:null})}],Ds=["January","February","March","April","May","June","July","August","September","October","November","December"],As=["Su","Mo","Tu","We","Th","Fr","Sa"];function vr(r){return r?r.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):""}function mr(r,t){return r.getFullYear()===t.getFullYear()&&r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()}function js(r,t){const o=[],a=new Date(r,t,1),s=new Date(a);s.setDate(s.getDate()-s.getDay());for(let n=0;n<42;n++)o.push(new Date(s)),s.setDate(s.getDate()+1);return o}const Es={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},Tt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},It={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ts={sm:"h-8 px-3",md:"h-10 px-3.5",lg:"h-11 px-4"};function Bt({month:r,year:t,range:o,hovered:a,onHover:s,onSelect:n,onPrevMonth:l,onNextMonth:d,minDate:i,maxDate:h}){const b=js(t,r);function x(f){const p=o.from,g=o.to??a;if(!p||!g)return!1;const[y,k]=p<=g?[p,g]:[g,p];return f>y&&f<k}function w(f){return!!(i&&f<ge(i)||h&&f>pe(h))}return e.jsxs("div",{className:"select-none flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{type:"button",onClick:l,className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(v.ChevronLeft,{size:14})}),e.jsxs("span",{className:"text-foreground",style:It,children:[Ds[r]," ",t]}),e.jsx("button",{type:"button",onClick:d,className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(v.ChevronRight,{size:14})})]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:As.map(f=>e.jsx("div",{className:"h-8 flex items-center justify-center text-muted-foreground",style:Tt,children:f},f))}),e.jsx("div",{className:"grid grid-cols-7",children:b.map((f,p)=>{const g=f.getMonth()===r,y=o.from?mr(f,o.from):!1,k=o.to?mr(f,o.to):a&&o.from?mr(f,a):!1,$=x(f),u=w(f);return e.jsx("button",{type:"button",disabled:u,onMouseEnter:()=>!u&&s(f),onMouseLeave:()=>s(null),onClick:()=>!u&&n(f),className:["h-8 w-full flex items-center justify-center text-center transition-colors",u?"opacity-30 cursor-not-allowed":"cursor-pointer",g?"":"text-muted-foreground/40",y||k?"bg-primary text-primary-foreground rounded-[var(--radius-md)] font-semibold":$?"bg-primary/10 text-primary":u?"":"hover:bg-muted/40 rounded-[var(--radius-md)]"].filter(Boolean).join(" "),style:Tt,children:f.getDate()},p)})})]})}function _t({value:r,onChange:t,presets:o=["today","last7","last30","custom"],placeholder:a="Select date range",size:s="md",minDate:n,maxDate:l,clearable:d=!0,disabled:i=!1,className:h=""}){const b=new Date,[x,w]=c.useState(!1),[f,p]=c.useState({from:null,to:null}),[g,y]=c.useState(null),[k,$]=c.useState(void 0),[u,m]=c.useState(b.getMonth()),[N,C]=c.useState(b.getFullYear()),[L,M]=c.useState("from"),[W,D]=c.useState({top:0,left:0,width:0}),T=c.useRef(null),A=c.useRef(null),S=r??f,z=(u+1)%12,E=u===11?N+1:N;c.useEffect(()=>{function O(Z){T.current&&!T.current.contains(Z.target)&&w(!1)}return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[]),c.useEffect(()=>{if(!x||!A.current)return;const O=()=>{const Z=A.current.getBoundingClientRect();D({top:Z.bottom+4,left:Z.left,width:Z.width})};return O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[x]);function I(O){if(O.value==="custom"){$("custom");return}const Z=O.range();p(Z),t==null||t(Z,O.value),$(O.value),w(!1)}function H(O){if(L==="from")p({from:ge(O),to:null}),M("to");else{const Z=f.from,[oe,X]=O>=Z?[Z,pe(O)]:[ge(O),pe(Z)],re={from:oe,to:X};p(re),t==null||t(re,"custom"),$("custom"),M("from"),w(!1)}}function P(O){O.stopPropagation();const Z={from:null,to:null};p(Z),t==null||t(Z,void 0),$(void 0)}const _=S.from&&S.to?`${vr(S.from)} – ${vr(S.to)}`:S.from?`${vr(S.from)} – ...`:"",Q=Ms.filter(O=>o.includes(O.value));return e.jsxs("div",{ref:T,className:`relative inline-block ${h}`,children:[e.jsxs("button",{ref:A,type:"button",disabled:i,onClick:()=>!i&&w(!x),className:["flex items-center gap-2 border border-border bg-card text-left rounded-[var(--radius-md)] transition-colors w-full min-w-[260px]",Ts[s],x?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Es,children:[e.jsx(v.Calendar,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:_?"text-foreground flex-1":"text-muted-foreground flex-1",children:_||a}),d&&S.from&&e.jsx("span",{role:"button",tabIndex:0,onClick:P,onKeyDown:O=>O.key==="Enter"&&P(O),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer flex-shrink-0",children:e.jsx(v.X,{size:12})})]}),x&&Ce.createPortal(e.jsxs("div",{className:"fixed z-[9999] bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] flex overflow-y-auto",style:{top:W.top,left:W.left,minWidth:"620px",maxHeight:"calc(100vh - 120px)"},children:[e.jsx("div",{className:"w-36 border-r border-border py-2 flex flex-col gap-0.5 flex-shrink-0",children:Q.map(O=>e.jsx("button",{type:"button",onClick:()=>I(O),className:["w-full text-left px-3 py-1.5 rounded-none transition-colors",k===O.value?"bg-primary/10 text-primary":"text-foreground hover:bg-muted/30"].join(" "),style:It,children:O.label},O.value))}),e.jsxs("div",{className:"flex gap-4 p-4 flex-1 min-w-0",children:[e.jsx(Bt,{month:u,year:N,range:S,hovered:g,onHover:y,onSelect:H,onPrevMonth:()=>{u===0?(m(11),C(N-1)):m(u-1)},onNextMonth:()=>{u===11?(m(0),C(N+1)):m(u+1)},minDate:n,maxDate:l}),e.jsx("div",{className:"w-px bg-border"}),e.jsx(Bt,{month:z,year:E,range:S,hovered:g,onHover:y,onSelect:H,onPrevMonth:()=>{u===0?(m(11),C(N-1)):m(u-1)},onNextMonth:()=>{u===11?(m(0),C(N+1)):m(u+1)},minDate:n,maxDate:l})]})]}),document.body)]})}_t.displayName="DateRangePicker";function he(r){return String(r).padStart(2,"0")}function Ht(r,t,o){if(t==="12h"){const a=r.hours%12||12,s=r.hours<12?"AM":"PM";return o?`${he(a)}:${he(r.minutes)}:${he(r.seconds??0)} ${s}`:`${he(a)}:${he(r.minutes)} ${s}`}return o?`${he(r.hours)}:${he(r.minutes)}:${he(r.seconds??0)}`:`${he(r.hours)}:${he(r.minutes)}`}const Pt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},Ue={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",fontVariantNumeric:"tabular-nums"},Ot={sm:"h-8 px-3",md:"h-10 px-3.5",lg:"h-11 px-4"};function Xe({options:r,value:t,onChange:o,label:a}){const s=r.indexOf(t);return e.jsxs("div",{className:"flex flex-col items-center gap-1 w-12",children:[e.jsx("button",{type:"button",onClick:()=>{const n=r[(s-1+r.length)%r.length];o(n)},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(v.ChevronUp,{size:14})}),e.jsx("div",{className:"text-foreground w-full text-center px-1 py-1 rounded-[var(--radius-md)] bg-muted/20",style:Ue,children:he(t)}),e.jsx("button",{type:"button",onClick:()=>{const n=r[(s+1)%r.length];o(n)},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(v.ChevronDown,{size:14})}),e.jsx("span",{className:"text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:a})]})}function xr({value:r,onChange:t,format:o="24h",showSeconds:a=!1,minuteStep:s=1,placeholder:n="Select time",size:l="md",disabled:d=!1,className:i=""}){const[h,b]=c.useState(!1),[x,w]=c.useState({hours:0,minutes:0,seconds:0}),f=c.useRef(null),p=r??x,g=o==="12h"?Array.from({length:12},(W,D)=>D+1):Array.from({length:24},(W,D)=>D),y=Array.from({length:Math.ceil(60/s)},(W,D)=>D*s),k=Array.from({length:60},(W,D)=>D),$=["AM","PM"];c.useEffect(()=>{function W(D){f.current&&!f.current.contains(D.target)&&b(!1)}return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[]);function u(W){const D={...p,...W};w(D),t==null||t(D)}const m=Ht(p,o,a),N=r!==void 0||x.hours!==0||x.minutes!==0,C=o==="12h"?p.hours%12||12:p.hours,L=p.hours<12;function M(W,D){let T=W%12;D||(T+=12),u({hours:T})}return e.jsxs("div",{ref:f,className:`relative inline-block ${i}`,children:[e.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&b(!h),className:["flex items-center gap-2 border border-border bg-card rounded-[var(--radius-md)] transition-colors min-w-[120px]",Ot[l],h?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",d?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Pt,children:[e.jsx(v.Clock,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:N?"text-foreground":"text-muted-foreground",children:N?m:n})]}),h&&e.jsx("div",{className:"absolute top-full mt-1 z-50 bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[o==="12h"?e.jsx(Xe,{options:g,value:C,onChange:W=>M(W,L),label:"Hour"}):e.jsx(Xe,{options:g,value:p.hours,onChange:W=>u({hours:W}),label:"Hour"}),e.jsx("div",{className:"text-muted-foreground text-lg mt-3",style:Ue,children:":"}),e.jsx(Xe,{options:y,value:p.minutes,onChange:W=>u({minutes:W}),label:"Min"}),a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-muted-foreground text-lg mt-3",style:Ue,children:":"}),e.jsx(Xe,{options:k,value:p.seconds??0,onChange:W=>u({seconds:W}),label:"Sec"})]}),o==="12h"&&e.jsxs("div",{className:"flex flex-col gap-1 ml-1",children:[e.jsx("div",{className:"h-5"}),$.map(W=>e.jsx("button",{type:"button",onClick:()=>M(C,W==="AM"),className:["px-2 py-1 rounded-[var(--radius-md)] transition-colors",W==="AM"===L?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted/30 cursor-pointer"].join(" "),style:Ue,children:W},W))]})]})})]})}xr.displayName="TimePicker";function Yt({value:r,onChange:t,format:o="24h",showSeconds:a=!1,placeholder:s="Select date & time",size:n="md",minDate:l,maxDate:d,disabled:i=!1,className:h=""}){const[b,x]=c.useState(!1),[w,f]=c.useState(r??new Date),p=c.useRef(null),g=r??w,y=new Date,[k,$]=c.useState(g.getMonth()),[u,m]=c.useState(g.getFullYear());c.useEffect(()=>{function z(E){p.current&&!p.current.contains(E.target)&&x(!1)}return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);function N(z){f(z),t==null||t(z)}function C(z){const E=new Date(z);E.setHours(g.getHours(),g.getMinutes(),g.getSeconds(),0),N(E)}function L(z){const E=new Date(g);E.setHours(z.hours,z.minutes,z.seconds??0,0),N(E)}const M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],W=["Su","Mo","Tu","We","Th","Fr","Sa"];function D(){const z=[],E=new Date(u,k,1),I=new Date(E);I.setDate(I.getDate()-I.getDay());for(let H=0;H<42;H++)z.push(new Date(I)),I.setDate(I.getDate()+1);return z}const T={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},A={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},S=`${g.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})} ${Ht({hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds()},o,a)}`;return e.jsxs("div",{ref:p,className:`relative inline-block ${h}`,children:[e.jsxs("button",{type:"button",disabled:i,onClick:()=>!i&&x(!b),className:["flex items-center gap-2 border border-border bg-card rounded-[var(--radius-md)] transition-colors min-w-[200px]",Ot[n],b?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Pt,children:[e.jsx(v.Clock,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:"text-foreground",children:S})]}),b&&e.jsxs("div",{className:"absolute top-full mt-1 z-50 bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] p-4 flex gap-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{type:"button",onClick:()=>{k===0?($(11),m(u-1)):$(k-1)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(v.ChevronLeft,{size:14})}),e.jsxs("span",{style:A,children:[M[k]," ",u]}),e.jsx("button",{type:"button",onClick:()=>{k===11?($(0),m(u+1)):$(k+1)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(v.ChevronRight,{size:14})})]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:W.map(z=>e.jsx("div",{className:"text-center text-muted-foreground",style:T,children:z},z))}),e.jsx("div",{className:"grid grid-cols-7 gap-y-0.5",children:D().map((z,E)=>{const I=z.getMonth()===k,H=r?z.toDateString()===r.toDateString():z.toDateString()===w.toDateString(),P=z.toDateString()===y.toDateString();return e.jsx("button",{type:"button",onClick:()=>C(z),className:["h-7 w-full text-center transition-colors rounded-[var(--radius-md)] cursor-pointer",I?"":"text-muted-foreground/40",H?"bg-primary text-primary-foreground font-semibold":P?"border border-primary text-primary":"hover:bg-muted/40"].filter(Boolean).join(" "),style:T,children:z.getDate()},E)})})]}),e.jsx("div",{className:"w-px bg-border"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:T,children:"Time"}),e.jsx(xr,{value:{hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds()},onChange:L,format:o,showSeconds:a,size:"sm"})]})]})]})}Yt.displayName="DateTimePicker";const Is={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Bs={fontFamily:"var(--font-p)",fontSize:"var(--text-button)",fontWeight:"var(--weight-p)"},_s={fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)"},Hs={sm:"p-3 gap-2.5 rounded-[var(--radius-md)]",md:"p-4 gap-3 rounded-[var(--radius-md)]",lg:"p-5 gap-4 rounded-[var(--radius-md)]"},Ps={sm:"w-8 h-8 rounded-[var(--radius-sm)]",md:"w-10 h-10 rounded-[var(--radius-md)]",lg:"w-12 h-12 rounded-[var(--radius-md)] text-lg"};function Gt({value:r,title:t,description:o,icon:a,badge:s,selected:n=!1,disabled:l=!1,showArrow:d=!0,showCheck:i=!1,size:h="md",layout:b="horizontal",onClick:x,className:w=""}){const f=b==="vertical";return e.jsxs("button",{type:"button",disabled:l,onClick:()=>!l&&(x==null?void 0:x(r)),className:["w-full text-left border transition-all duration-150",Hs[h],f?"flex flex-col items-center text-center":"flex items-center",n?"border-primary bg-primary/5 shadow-[0_0_0_1px_var(--primary)]":"border-border bg-card hover:border-primary/40 hover:bg-muted/20",l?"opacity-50 cursor-not-allowed":"cursor-pointer",w].filter(Boolean).join(" "),"aria-pressed":n,children:[a&&e.jsx("div",{className:[Ps[h],"flex items-center justify-center flex-shrink-0",n?"bg-primary/10 text-primary":"bg-muted/40 text-muted-foreground"].join(" "),children:a}),e.jsxs("div",{className:`flex-1 min-w-0 ${f?"mt-2":""}`,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-foreground",style:Is,children:t}),s&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary/10 text-primary",style:_s,children:s})]}),o&&e.jsx("p",{className:`text-muted-foreground mt-0.5 ${f?"line-clamp-2":"truncate"}`,style:Bs,children:o})]}),!f&&e.jsx("div",{className:"flex-shrink-0 ml-auto pl-2",children:i&&n?e.jsx("span",{className:"w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:e.jsx(v.Check,{size:12})}):d?e.jsx(v.ChevronRight,{size:16,className:n?"text-primary":"text-muted-foreground"}):null}),f&&n&&e.jsx("div",{className:"mt-2 w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:e.jsx(v.Check,{size:12})})]})}Gt.displayName="ChoiceCard";function Ut({value:r,onChange:t,layout:o="horizontal",size:a="md",children:s,className:n=""}){return e.jsx("div",{className:["grid gap-3",o==="vertical"?"grid-cols-2 sm:grid-cols-3":"grid-cols-1",n].join(" "),role:"group",children:c.Children.map(s,l=>c.isValidElement(l)?c.cloneElement(l,{selected:r===l.props.value,onClick:d=>t==null?void 0:t(d),layout:o,size:a}):l)})}Ut.displayName="ChoiceCardGroup";const Os={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ys={fontFamily:"var(--font-p)",fontSize:"var(--text-button)",fontWeight:"var(--weight-p)"},Gs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Us={sm:"p-3",md:"p-4",lg:"p-5"},Xs={sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12"},Ks={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-2 lg:grid-cols-4"};function Xt({options:r,value:t,onChange:o,columns:a=2,layout:s="grid",size:n="md",name:l,className:d=""}){const i=l??`radio-card-${Math.random().toString(36).slice(2,7)}`;return e.jsx("div",{className:[s==="grid"?`grid gap-3 ${Ks[a]}`:"flex flex-col gap-2",d].join(" "),role:"radiogroup",children:r.map(h=>{const b=t===h.value,x=h.disabled??!1;return e.jsxs("label",{className:["relative flex items-start gap-3 border rounded-[var(--radius-md)] cursor-pointer transition-all duration-150",Us[n],b?"border-primary bg-primary/5 shadow-[0_0_0_1px_var(--primary)]":"border-border bg-card hover:border-primary/40 hover:bg-muted/10",x?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsx("input",{type:"radio",name:i,value:h.value,checked:b,disabled:x,onChange:()=>!x&&(o==null?void 0:o(h.value)),className:"sr-only"}),e.jsx("div",{className:["flex-shrink-0 mt-0.5 w-4 h-4 rounded-full border-2 flex items-center justify-center transition-colors",b?"border-primary bg-primary":"border-border bg-transparent"].join(" "),children:b&&e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary-foreground"})}),h.icon&&e.jsx("div",{className:[Xs[n],"flex-shrink-0 flex items-center justify-center rounded-[var(--radius-md)]",b?"bg-primary/10 text-primary":"bg-muted/40 text-muted-foreground"].join(" "),children:h.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-foreground",style:Os,children:h.title}),h.badge&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary/10 text-primary",style:Gs,children:h.badge})]}),h.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Ys,children:h.description})]})]},h.value)})})}Xt.displayName="RadioCard";function Zs(){return Math.random().toString(36).slice(2,9)}function qs(r={}){return{id:Zs(),values:{...r}}}const Js={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Kt={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Zt({columns:r,value:t,onChange:o,defaultRow:a={},minRows:s=0,maxRows:n,addLabel:l="Add row",sortable:d=!1,disabled:i=!1,className:h=""}){const[b,x]=c.useState(()=>t??[]),w=t??b,f=N=>{x(N),o==null||o(N)},p=()=>{n!==void 0&&w.length>=n||f([...w,qs(a)])},g=N=>{w.length<=s||f(w.filter(C=>C.id!==N))},y=(N,C,L)=>{f(w.map(M=>M.id===N?{...M,values:{...M.values,[C]:L}}:M))},k=(N,C)=>{const L=[...w],[M]=L.splice(N,1);L.splice(C,0,M),f(L)},$=w.length<=s,u=n!==void 0&&w.length>=n,m=c.useRef(null);return e.jsxs("div",{className:`space-y-2 ${h}`,children:[e.jsxs("div",{className:["flex items-center gap-2 px-3 text-muted-foreground",d?"pl-9":""].join(" "),children:[r.map(N=>e.jsx("div",{style:{width:N.width??"1fr",flex:N.width?"none":"1"},className:"min-w-0",children:e.jsx("span",{style:Js,children:N.label})},N.key)),e.jsx("div",{className:"w-8 flex-shrink-0"})]}),e.jsx("div",{className:"space-y-2",children:w.map((N,C)=>e.jsxs("div",{className:["flex items-center gap-2 p-2 rounded-[var(--radius-md)] border border-border bg-card transition-colors",i?"opacity-60":""].join(" "),draggable:d&&!i,onDragStart:()=>{m.current=C},onDragOver:L=>{L.preventDefault()},onDrop:()=>{m.current!==null&&m.current!==C&&(k(m.current,C),m.current=null)},children:[d&&e.jsx("div",{className:"cursor-grab text-muted-foreground/50 hover:text-muted-foreground flex-shrink-0",children:e.jsx(v.GripVertical,{size:14})}),r.map(L=>e.jsx("div",{style:{width:L.width??"1fr",flex:L.width?"none":"1"},className:"min-w-0",children:L.render(N.values[L.key],M=>y(N.id,L.key,M),C)},L.key)),e.jsx("button",{type:"button",disabled:i||$,onClick:()=>g(N.id),className:["flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] transition-colors",i||$?"text-muted-foreground/30 cursor-not-allowed":"text-muted-foreground hover:text-destructive hover:bg-destructive/10 cursor-pointer"].join(" "),"aria-label":"Remove row",children:e.jsx(v.Trash2,{size:14})})]},N.id))}),w.length===0&&e.jsx("div",{className:"text-center py-6 text-muted-foreground rounded-[var(--radius-md)] border border-dashed border-border",children:e.jsxs("span",{style:Kt,children:['No rows yet. Click "',l,'" to begin.']})}),!u&&e.jsxs("button",{type:"button",disabled:i,onClick:p,className:["flex items-center gap-1.5 px-3 py-1.5 rounded-[var(--radius-md)] border border-dashed border-primary/40 text-primary hover:bg-primary/5 transition-colors",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Kt,children:[e.jsx(v.Plus,{size:14}),l]})]})}Zt.displayName="RepeatableFieldList";const Qs={history:[{cmd:"undo",icon:v.Undo,title:"Undo"},{cmd:"redo",icon:v.Redo,title:"Redo"}],format:[{cmd:"bold",icon:v.Bold,title:"Bold"},{cmd:"italic",icon:v.Italic,title:"Italic"},{cmd:"underline",icon:v.Underline,title:"Underline"},{cmd:"strikethrough",icon:v.Strikethrough,title:"Strikethrough"}],list:[{cmd:"insertUnorderedList",icon:v.List,title:"Bullet list"},{cmd:"insertOrderedList",icon:v.ListOrdered,title:"Numbered list"}],align:[{cmd:"justifyLeft",icon:v.AlignLeft,title:"Align left"},{cmd:"justifyCenter",icon:v.AlignCenter,title:"Align center"},{cmd:"justifyRight",icon:v.AlignRight,title:"Align right"}],block:[{cmd:"formatBlock-h2",icon:v.Heading2,title:"Heading 2"},{cmd:"formatBlock-blockquote",icon:v.Quote,title:"Blockquote"},{cmd:"formatBlock-pre",icon:v.Code,title:"Code block"}],link:[{cmd:"createLink",icon:v.Link,title:"Insert link"},{cmd:"unlink",icon:v.Unlink,title:"Remove link"}]},Vs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},Rs={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1.6",color:"var(--foreground)"};function qt({value:r="",onChange:t,placeholder:o="Start typing…",minHeight:a=160,maxHeight:s=480,toolbar:n=["history","format","list","align","link","block"],fullscreen:l=!0,disabled:d=!1,readOnly:i=!1,size:h="md",className:b=""}){const x=c.useRef(null),[w,f]=c.useState(!1),[p,g]=c.useState(new Set),[y,k]=c.useState(!r);c.useEffect(()=>{x.current&&r&&x.current.innerHTML!==r&&(x.current.innerHTML=r,k(!1))},[]);const $=c.useCallback(()=>{const M=new Set;["bold","italic","underline","strikethrough","insertUnorderedList","insertOrderedList","justifyLeft","justifyCenter","justifyRight"].forEach(W=>{try{document.queryCommandState(W)&&M.add(W)}catch{}}),g(M)},[]);function u(M){var W;if(!(d||i)){if((W=x.current)==null||W.focus(),M.startsWith("formatBlock-")){const D=M.replace("formatBlock-","");document.execCommand("formatBlock",!1,D)}else if(M==="createLink"){const D=window.prompt("Enter URL:");D&&document.execCommand("createLink",!1,D)}else document.execCommand(M,!1);$(),x.current&&t&&t(x.current.innerHTML)}}function m(){if(x.current){const M=x.current.innerHTML,W=x.current.innerText.trim();k(!W),t==null||t(M),$()}}const C=a??{sm:120,md:160,lg:240}[h],L=["border border-border rounded-[var(--radius-md)] bg-card overflow-hidden transition-all",w?"fixed inset-4 z-[var(--z-modal)] flex flex-col shadow-[0_8px_48px_rgba(0,0,0,0.2)]":"relative",d?"opacity-60":"",b].filter(Boolean).join(" ");return e.jsxs("div",{className:L,children:[!i&&e.jsxs("div",{className:"flex items-center gap-0.5 flex-wrap px-2 py-1.5 border-b border-border bg-muted/10",children:[n.map((M,W)=>{const D=Qs[M];return e.jsxs(c.Fragment,{children:[W>0&&e.jsx("div",{className:"w-px h-5 bg-border mx-1"}),D.map(T=>{const A=T.icon,S=p.has(T.cmd);return e.jsx("button",{type:"button",title:T.title,disabled:d,onMouseDown:z=>{z.preventDefault(),u(T.cmd)},className:["w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] transition-colors",S?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/40 hover:text-foreground",d?"cursor-not-allowed":"cursor-pointer"].join(" "),children:e.jsx(A,{size:13})},T.cmd)})]},M)}),l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ml-auto w-px h-5 bg-border mx-1"}),e.jsx("button",{type:"button",title:w?"Exit fullscreen":"Fullscreen",onClick:()=>f(!w),className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-muted/40 hover:text-foreground transition-colors cursor-pointer",children:w?e.jsx(v.Minimize2,{size:13}):e.jsx(v.Maximize2,{size:13})})]})]}),e.jsxs("div",{className:"relative flex-1",children:[y&&e.jsx("div",{className:"absolute top-0 left-0 pointer-events-none p-4 text-muted-foreground",style:Vs,children:o}),e.jsx("div",{ref:x,contentEditable:!d&&!i,suppressContentEditableWarning:!0,onInput:m,onKeyUp:$,onMouseUp:$,className:["outline-none p-4 overflow-y-auto","prose-p:my-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-3","[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_pre]:bg-muted/30 [&_pre]:rounded [&_pre]:p-2 [&_pre]:text-sm","[&_a]:text-primary [&_a]:underline","[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5",w?"flex-1":""].filter(Boolean).join(" "),style:{...Rs,minHeight:w?void 0:C,maxHeight:w?void 0:s},"data-placeholder":o})]})]})}qt.displayName="RichTextEditor";const yr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Le={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},en={2:"grid-cols-2",3:"grid-cols-2 sm:grid-cols-3",4:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4",5:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-5",6:"grid-cols-2 sm:grid-cols-4 lg:grid-cols-6"};function rn({images:r,startIdx:t,onClose:o}){const[a,s]=c.useState(t),n=r[a],l=()=>s(i=>(i-1+r.length)%r.length),d=()=>s(i=>(i+1)%r.length);return c.useEffect(()=>{function i(h){h.key==="Escape"&&o(),h.key==="ArrowLeft"&&l(),h.key==="ArrowRight"&&d()}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[]),e.jsxs("div",{className:"fixed inset-0 z-[var(--z-modal)] bg-black/90 flex items-center justify-center",onClick:o,children:[e.jsx("button",{type:"button",onClick:o,className:"absolute top-4 right-4 w-9 h-9 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(v.X,{size:16})}),r.length>1&&e.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),l()},className:"absolute left-4 w-10 h-10 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(v.ChevronLeft,{size:20})}),e.jsxs("div",{className:"max-w-4xl max-h-[80vh] px-16",onClick:i=>i.stopPropagation(),children:[e.jsx("img",{src:n.src,alt:n.alt??n.name,className:"max-w-full max-h-[70vh] object-contain rounded-[var(--radius-md)]"}),n.name&&e.jsxs("p",{className:"text-center text-white/70 mt-3",style:Le,children:[n.name," ",n.size?`· ${n.size}`:""]}),r.length>1&&e.jsxs("p",{className:"text-center text-white/40 mt-1",style:Le,children:[a+1," / ",r.length]})]}),r.length>1&&e.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),d()},className:"absolute right-4 w-10 h-10 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(v.ChevronRight,{size:20})})]})}function wr({src:r,alt:t="",caption:o,subCaption:a,size:s="sm",onClick:n,className:l=""}){const d={xs:"w-8 h-8",sm:"w-10 h-10",md:"w-14 h-14"};return e.jsxs("div",{className:`flex items-center gap-2.5 ${n?"cursor-pointer":""} ${l}`,onClick:n,children:[e.jsx("div",{className:`${d[s]} flex-shrink-0 rounded-[var(--radius-md)] overflow-hidden bg-muted/20 border border-border`,children:e.jsx("img",{src:r,alt:t,className:"w-full h-full object-cover",onError:i=>{i.target.style.display="none"}})}),(o||a)&&e.jsxs("div",{className:"min-w-0",children:[o&&e.jsx("div",{className:"truncate text-foreground",style:yr,children:o}),a&&e.jsx("div",{className:"truncate text-muted-foreground",style:Le,children:a})]})]})}wr.displayName="ThumbnailCell";function Jt({images:r,selectable:t=!1,selectedIds:o=[],onSelectChange:a,maxSelect:s,lightbox:n=!0,uploadable:l=!1,onUpload:d,onDelete:i,defaultLayout:h="grid",columns:b=4,disabled:x=!1,className:w=""}){const[f,p]=c.useState(h),[g,y]=c.useState(null),k=c.useRef(null);function $(N){if(x)return;if(o.includes(N))a==null||a(o.filter(L=>L!==N));else{if(s&&o.length>=s)return;a==null||a([...o,N])}}function u(N,C){t?$(C):n&&y(N)}const m=c.useCallback(N=>{var C;(C=N.target.files)!=null&&C.length&&(d==null||d(N.target.files),N.target.value="")},[d]);return r.length===0&&!l?e.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground border border-dashed border-border rounded-[var(--radius-md)]",children:e.jsx("span",{style:yr,children:"No images yet"})}):e.jsxs("div",{className:w,children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("span",{className:"text-muted-foreground",style:Le,children:[r.length," image",r.length!==1?"s":"",t&&o.length>0&&` · ${o.length} selected`]}),e.jsxs("div",{className:"flex items-center gap-1",children:[l&&e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:k,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:m}),e.jsxs("button",{type:"button",disabled:x,onClick:()=>{var N;return(N=k.current)==null?void 0:N.click()},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-card hover:bg-muted/20 text-foreground transition-colors cursor-pointer",style:Le,children:[e.jsx(v.Upload,{size:12}),"Upload"]})]}),e.jsx("button",{type:"button",onClick:()=>p("grid"),className:`w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${f==="grid"?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/30"}`,children:e.jsx(v.Grid,{size:14})}),e.jsx("button",{type:"button",onClick:()=>p("list"),className:`w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${f==="list"?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/30"}`,children:e.jsx(v.List,{size:14})})]})]}),f==="grid"&&e.jsx("div",{className:`grid gap-2 ${en[b]}`,children:r.map((N,C)=>{const L=o.includes(N.id);return e.jsxs("div",{className:["relative group rounded-[var(--radius-md)] overflow-hidden border transition-all cursor-pointer",L?"border-primary shadow-[0_0_0_2px_var(--primary)]":"border-border hover:border-primary/40"].join(" "),onClick:()=>u(C,N.id),children:[e.jsx("div",{className:"aspect-square",children:e.jsx("img",{src:N.src,alt:N.alt??N.name,className:"w-full h-full object-cover"})}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center",children:!t&&n&&e.jsx(v.ZoomIn,{size:20,className:"text-white opacity-0 group-hover:opacity-100 transition-opacity"})}),t&&e.jsx("div",{className:["absolute top-1.5 left-1.5 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-all",L?"bg-primary border-primary":"bg-white/80 border-white"].join(" "),children:L&&e.jsx(v.Check,{size:10,className:"text-primary-foreground"})}),i&&e.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),i(N.id)},className:"absolute top-1.5 right-1.5 w-6 h-6 flex items-center justify-center rounded-full bg-black/60 text-white opacity-0 group-hover:opacity-100 transition-opacity hover:bg-destructive cursor-pointer",children:e.jsx(v.Trash2,{size:10})})]},N.id)})}),f==="list"&&e.jsx("div",{className:"space-y-1.5",children:r.map((N,C)=>{const L=o.includes(N.id);return e.jsxs("div",{className:["flex items-center gap-3 p-2.5 rounded-[var(--radius-md)] border transition-all cursor-pointer",L?"border-primary bg-primary/5":"border-border hover:bg-muted/10"].join(" "),onClick:()=>u(C,N.id),children:[e.jsx(wr,{src:N.src,alt:N.alt,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"truncate text-foreground",style:yr,children:N.name??N.alt??`Image ${C+1}`}),N.size&&e.jsx("div",{className:"text-muted-foreground",style:Le,children:N.size})]}),t&&L&&e.jsx("div",{className:"w-5 h-5 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:e.jsx(v.Check,{size:10,className:"text-primary-foreground"})}),i&&e.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),i(N.id)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors cursor-pointer flex-shrink-0",children:e.jsx(v.Trash2,{size:13})})]},N.id)})}),g!==null&&e.jsx(rn,{images:r,startIdx:g,onClose:()=>y(null)})]})}Jt.displayName="ImageGallery";const Nr=c.createContext(null);Nr.displayName="AppShellContext";const Sr=c.createContext(null);Sr.displayName="AppShellFullContext";function kr({user:r=null,product:t=null,navResolver:o,sidebarOpen:a,onSidebarChange:s,defaultSidebarOpen:n=!0,children:l}){const d=a!==void 0,[i,h]=c.useState(n),b=d?a:i,x=c.useCallback(m=>{d||h(m),s==null||s(m)},[d,s]),[w,f]=c.useState([]),p=c.useCallback(m=>{f(m)},[]),[g,y]=c.useState({groups:[],loading:!1,error:null}),k=c.useRef(0),$=c.useCallback(async()=>{if(!o||!r){y({groups:[],loading:!1,error:null});return}const m=++k.current;y(N=>({...N,loading:!0,error:null}));try{const N=await o(r);if(m!==k.current)return;y({groups:N,loading:!1,error:null})}catch(N){if(m!==k.current)return;y({groups:[],loading:!1,error:N instanceof Error?N.message:"Failed to load navigation"})}},[o,r]);c.useEffect(()=>{$()},[$]),c.useEffect(()=>{if(!(t!=null&&t.product))return;const m=document.documentElement.getAttribute("data-product");return document.documentElement.setAttribute("data-product",t.product),()=>{m?document.documentElement.setAttribute("data-product",m):document.documentElement.removeAttribute("data-product")}},[t==null?void 0:t.product]);const u=c.useMemo(()=>({sidebarOpen:b,setSidebarOpen:x,user:r,product:t,breadcrumbs:w,setBreadcrumbs:p,navGroups:g.groups,navLoading:g.loading,navError:g.error,refreshNav:$}),[b,x,r,t,w,p,g.groups,g.loading,g.error,$]);return e.jsx(Sr.Provider,{value:u,children:e.jsx(Nr.Provider,{value:u,children:l})})}kr.displayName="AppShellProvider";function Qt(){const r=c.useContext(Nr);if(!r)throw new Error("[useAppShell] must be used inside <AppShellProvider>. Wrap your app root with <AppShellProvider user={...} product={...}>.");return r}function Vt(){const r=c.useContext(Sr);if(!r)throw new Error("[useAppShellFull] must be used inside <AppShellProvider>.");return r}function tn(r){const{setBreadcrumbs:t}=Qt(),o=JSON.stringify(r);c.useEffect(()=>(t(r),()=>t([])),[o])}function on(r,t){const[o,a]=c.useState({groups:[],loading:!1,error:null}),s=c.useRef(0),n=c.useCallback(async()=>{if(!r||!t){a({groups:[],loading:!1,error:null});return}const l=++s.current;a(d=>({...d,loading:!0,error:null}));try{const d=await r(t);if(l!==s.current)return;a({groups:d,loading:!1,error:null})}catch(d){if(l!==s.current)return;a({groups:[],loading:!1,error:d instanceof Error?d.message:"Navigation load failed"})}},[r,t]);return c.useEffect(()=>{n()},[n]),{...o,refresh:n}}class Rt extends c.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){console.error("[AppShellErrorBoundary] Caught error:",t,o)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[200px] gap-3 p-6 text-center",role:"alert",children:[e.jsx("div",{className:"text-destructive",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:"Something went wrong in this section."}),e.jsx("button",{type:"button",onClick:()=>this.setState({hasError:!1}),className:"px-4 py-1.5 rounded-[var(--radius-md)] border border-border text-muted-foreground hover:bg-muted/20 transition-colors text-sm cursor-pointer",children:"Try again"})]}):this.props.children}}function R({children:r,className:t=""}){return r?e.jsx("div",{className:t,children:r}):null}function eo({children:r}){return r?e.jsx("div",{className:"sticky bottom-0 left-0 right-0 z-[var(--z-sticky)] bg-card border-t border-border px-6 py-3 flex items-center justify-end gap-3",children:r}):null}function ro({p:r}){const t=r.gap??"gap-5";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.stats}),e.jsx(R,{children:r.filters}),e.jsx(R,{className:"min-h-0",children:r.content}),e.jsx(R,{children:r.footer})]})}function an({p:r}){const t=r.gap??"gap-6",o=r.asideWidth??"w-80";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsxs("div",{className:`flex flex-col lg:flex-row ${t} min-h-0`,children:[r.asideLeft&&e.jsx("div",{className:`flex-shrink-0 ${o} lg:sticky lg:top-4 lg:max-h-[calc(100vh-5rem)] lg:overflow-y-auto`,children:r.aside}),e.jsx("div",{className:"flex-1 min-w-0 flex flex-col gap-5",children:r.main??r.content}),!r.asideLeft&&e.jsx("div",{className:`flex-shrink-0 ${o} lg:sticky lg:top-4 lg:max-h-[calc(100vh-5rem)] lg:overflow-y-auto`,children:r.aside})]})]})}function sn({p:r}){const t=r.gap??"gap-8";return e.jsxs("div",{className:`flex flex-col ${t} max-w-3xl`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{className:`flex flex-col ${t}`,children:r.sections??r.content})]})}function nn({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsxs("div",{className:`flex flex-col ${t} flex-1 pb-24`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.stepper}),e.jsx(R,{className:"flex-1",children:r.form??r.content})]}),e.jsx(eo,{children:r.actions})]})}function ln({p:r}){const t=r.gap??"gap-6",o=r.primaryChart&&r.secondaryCharts;return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.kpis??r.stats}),o?e.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-3 ${t}`,children:[e.jsx("div",{className:"lg:col-span-2",children:r.primaryChart}),e.jsx("div",{className:"flex flex-col gap-4",children:r.secondaryCharts})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{children:r.primaryChart??r.charts}),e.jsx(R,{children:r.secondaryCharts})]}),e.jsx(R,{children:r.content??r.table}),e.jsx(R,{children:r.footer})]})}function dn({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsxs("div",{className:`flex flex-col ${t} flex-1 pb-24`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{className:"flex-1 max-w-2xl",children:r.form??r.content})]}),e.jsx(eo,{children:r.actions})]})}function cn({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[r.stats&&e.jsx("div",{className:"flex-1",children:r.stats}),r.dateRange&&e.jsx("div",{className:"flex-shrink-0",children:r.dateRange})]}),e.jsx(R,{children:r.filters}),e.jsx(R,{children:r.charts??r.primaryChart}),r.secondaryCharts&&e.jsx("div",{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 ${t}`,children:r.secondaryCharts}),e.jsx(R,{children:r.table??r.content}),e.jsx(R,{children:r.footer})]})}function to(r){const{layout:t="list",maxWidth:o,padding:a,className:s=""}=r,n=a??"p-4 sm:p-6",l=o?`${o} mx-auto w-full`:"w-full",d=(()=>{switch(t){case"list":return e.jsx(ro,{p:r});case"detail":return e.jsx(an,{p:r});case"settings":return e.jsx(sn,{p:r});case"wizard":return e.jsx(nn,{p:r});case"dashboard":return e.jsx(ln,{p:r});case"form":return e.jsx(dn,{p:r});case"report":return e.jsx(cn,{p:r});default:return e.jsx(ro,{p:r})}})();return e.jsx("div",{className:`${n} ${l} ${s}`,children:d})}to.displayName="FeaturePageScaffold";const fn={fontFamily:"var(--font-label)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-button)",color:"var(--foreground)"},hn={fontFamily:"var(--font-p)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)",color:"var(--muted-foreground)"};function oo({title:r,description:t,action:o,children:a,className:s=""}){return e.jsxs("section",{className:`space-y-4 ${s}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{style:fn,children:r}),t&&e.jsx("p",{className:"mt-1",style:hn,children:t})]}),o&&e.jsx("div",{className:"flex-shrink-0",children:o})]}),e.jsx("div",{className:"border-t border-border pt-4",children:a})]})}oo.displayName="ScaffoldSection";function ao({children:r,className:t=""}){return e.jsx("div",{className:`grid grid-cols-2 lg:grid-cols-4 gap-4 ${t}`,children:r})}ao.displayName="ScaffoldKPIRow";function un(r){return r.map(t=>({label:t.title??"",items:t.items.filter(o=>!o.disabled).map(o=>({id:o.id,label:o.label,icon:o.icon,badge:typeof o.badge=="function"?void 0:o.badge}))}))}function bn({activeItemId:r,onNavigate:t,notificationCount:o,onNotificationClick:a,onUserClick:s,onSearchClick:n,showSearch:l=!1,version:d,versionDate:i,contentPadding:h=!0,children:b,className:x=""}){var S,z,E,I;const{sidebarOpen:w,setSidebarOpen:f,user:p,product:g,breadcrumbs:y,navGroups:k,navLoading:$,navError:u,refreshNav:m}=Vt(),[N,C]=c.useState(!(((S=g==null?void 0:g.shell)==null?void 0:S.sidebarDefaultOpen)??!0)),[L,M]=c.useState(!1);c.useEffect(()=>{function H(){window.innerWidth>=768&&M(!1)}return window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]);const W=un(k),D=c.useCallback(H=>{const P=k.flatMap(_=>_.items).find(_=>_.id===H.id);P&&t&&t(P),M(!1)},[k,t]),T=e.jsx(Oe,{brand:g?{name:g.brand.name}:{name:"Sellsuki"},groups:$?[{label:"Loading",items:[]}]:W,activeItem:r,onNavigate:D,collapsed:N,onCollapsedChange:C,showCollapseToggle:((z=g==null?void 0:g.shell)==null?void 0:z.sidebarCollapsible)??!0,version:d,versionDate:i}),A=N?"var(--shell-sidebar-collapsed, 64px)":"var(--shell-sidebar-width, 240px)";return e.jsxs("div",{className:`min-h-screen bg-[var(--background)] ${x}`,"data-product":g==null?void 0:g.product,children:[e.jsx("div",{className:"fixed top-0 left-0 right-0",style:{zIndex:"var(--z-shell-navbar, 100)"},children:e.jsx(lr,{brand:g?{name:g.brand.name,logo:g.brand.logo}:{name:"Sellsuki"},breadcrumbs:y.map(H=>({label:H.label,href:H.href})),user:p?{name:p.name,avatar:p.avatar}:void 0,showSearch:l,onSearchClick:n,notificationCount:o,onNotificationClick:a,onUserClick:s,workspaceSwitcher:(E=g==null?void 0:g.brand)==null?void 0:E.workspaceSwitcher,onSidebarToggle:()=>{window.innerWidth<768?M(H=>!H):C(H=>!H)},onMobileMenuClick:()=>M(H=>!H)})}),e.jsx("aside",{className:"hidden md:flex flex-col fixed left-0 bottom-0 overflow-hidden",style:{top:"var(--shell-navbar-height, 56px)",width:A,zIndex:"var(--z-shell-sidebar, 90)",transition:"width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))"},children:$?e.jsx("div",{className:"p-4 w-full",children:e.jsx(ar,{rows:6})}):u?e.jsxs("div",{className:"p-3",children:[e.jsx(Qe,{variant:"error",children:e.jsx("span",{style:{fontSize:"var(--text-label)"},children:"Nav load failed"})}),e.jsx("button",{type:"button",className:"mt-2 text-primary cursor-pointer hover:underline",style:{fontSize:"var(--text-label)"},onClick:m,children:"Retry"})]}):T}),L&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/40 md:hidden",style:{zIndex:"var(--z-shell-overlay, 80)"},onClick:()=>M(!1)}),e.jsx("div",{className:"fixed left-0 bottom-0 bg-card shadow-lg md:hidden overflow-y-auto",style:{top:"var(--shell-navbar-height, 56px)",width:"var(--shell-sidebar-width, 240px)",zIndex:"var(--z-shell-sidebar, 90)"},children:$?e.jsx("div",{className:"p-4",children:e.jsx(ar,{rows:6})}):e.jsx(Oe,{brand:g?{name:g.brand.name}:{name:"Sellsuki"},groups:W,activeItem:r,onNavigate:D,collapsed:!1,showCollapseToggle:!1,version:d,versionDate:i})})]}),e.jsx("main",{className:`min-h-screen ${h?"":"p-0"}`,style:{paddingTop:"var(--shell-navbar-height, 56px)",marginLeft:A,transition:"margin-left var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))",maxWidth:(I=g==null?void 0:g.shell)==null?void 0:I.contentMaxWidth},children:e.jsx(Rt,{children:b})}),e.jsx(Er,{})]})}function so({product:r,user:t,navResolver:o,...a}){var s;return e.jsx(kr,{product:r,user:t,navResolver:o,defaultSidebarOpen:((s=r==null?void 0:r.shell)==null?void 0:s.sidebarDefaultOpen)??!0,children:e.jsx(bn,{...a})})}so.displayName="AppShell";function no(){return e.jsxs("div",{className:"min-h-screen bg-[var(--background)] flex flex-col",children:[e.jsxs("div",{className:"h-14 bg-card border-b border-border flex items-center px-4 gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-md)] bg-muted/40 animate-pulse"}),e.jsx("div",{className:"w-24 h-4 rounded bg-muted/40 animate-pulse"}),e.jsxs("div",{className:"ml-auto flex gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted/40 animate-pulse"}),e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted/40 animate-pulse"})]})]}),e.jsxs("div",{className:"flex flex-1",children:[e.jsxs("div",{className:"w-60 border-r border-border p-4 space-y-3 hidden md:block",children:[e.jsx("div",{className:"w-full h-8 rounded-[var(--radius-md)] bg-muted/40 animate-pulse"}),Array.from({length:6}).map((r,t)=>e.jsx("div",{className:"w-full h-7 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"},t))]}),e.jsxs("div",{className:"flex-1 p-6 space-y-4",children:[e.jsx("div",{className:"h-8 w-48 rounded bg-muted/40 animate-pulse"}),e.jsx("div",{className:"h-32 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"}),e.jsx("div",{className:"h-64 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"})]})]})]})}no.displayName="AppShellSkeleton";const gn={product:"sellsuki",brand:{name:"Sellsuki",theme:"sellsuki"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},pn={product:"patona",brand:{name:"Patona",theme:"patona"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},vn={product:"sukispace",brand:{name:"Sukispace",theme:"sukispace"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},mn={product:"shipmunk",brand:{name:"Shipmunk",theme:"shipmunk"}},xn={product:"akita",brand:{name:"Akita",theme:"akita"}};F.Accordion=Yr,F.AccordionItem=Re,F.AdvancedDataTable=Ls,F.Alert=Qe,F.AppShell=so,F.AppShellErrorBoundary=Rt,F.AppShellProvider=kr,F.AppShellSkeleton=no,F.AreaChart=Dt,F.Avatar=Ur,F.AvatarGroup=Xr,F.Badge=mo,F.BarChart=At,F.Breadcrumb=Ko,F.Button=Ze,F.ButtonGroup=uo,F.Card=Kr,F.CardBody=qr,F.CardFooter=Jr,F.CardHeader=Zr,F.Checkbox=Fe,F.CheckboxGroup=yo,F.ChoiceCard=Gt,F.ChoiceCardGroup=Ut,F.ColorPicker=ea,F.ConfirmDialog=Lo,F.DSButton=Ze,F.DSCheckbox=Fe,F.DSInput=qe,F.DSRadio=Ir,F.DSTable=Or,F.DSTextarea=Je,F.DatePicker=Fo,F.DateRangePicker=_t,F.DateTimePicker=Yt,F.Divider=Vr,F.DonutChart=jt,F.Drawer=Rr,F.Dropdown=et,F.EmptyState=la,F.FeaturePageScaffold=to,F.FileUpload=fa,F.FilterBar=ks,F.FormError=zt,F.FormField=is,F.FormHelperText=Ft,F.FormLabel=fr,F.FormSuccess=Ct,F.IconButton=Wr,F.ImageGallery=Jt,F.ImagePreview=ba,F.Input=qe,F.LineChart=Mt,F.Menu=nt,F.MiniSparkline=Et,F.Modal=Pr,F.Notification=it,F.NotificationCenter=ya,F.NumberInput=us,F.OTPInput=vs,F.PageHeader=ws,F.Pagination=jo,F.Popover=Na,F.ProgressBar=dt,F.Radio=Ir,F.RadioCard=Xt,F.RadioGroup=No,F.Rating=Ca,F.RepeatableFieldList=Zt,F.RichTextEditor=qt,F.ScaffoldKPIRow=ao,F.ScaffoldSection=oo,F.SearchField=Io,F.Sidebar=Oe,F.SidebarAccountSwitcher=or,F.Skeleton=se,F.SkeletonCard=Ta,F.SkeletonList=ar,F.SkeletonTable=Ia,F.Spinner=ft,F.StatCard=Pa,F.Statistic=Ha,F.Stepper=mt,F.Switch=Za,F.Table=Or,F.Tabs=_o,F.Tag=xt,F.TagInput=yt,F.Textarea=Je,F.ThumbnailCell=wr,F.TimePicker=xr,F.Timeline=ts,F.ToastContainer=Er,F.Tooltip=rr,F.TopNavbar=lr,F.TransferList=as,F.Tree=ss,F.akitaBrandConfig=xn,F.patonaBrandConfig=pn,F.sellsukiBrandConfig=gn,F.shipmunkBrandConfig=mn,F.sukispaceBrandConfig=vn,F.toast=ye,F.useAppShell=Qt,F.useAppShellFull=Vt,F.useBreadcrumbs=tn,F.useFormField=ls,F.useNavResolver=on,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})}));
|
|
95
95
|
//# sourceMappingURL=sellsuki-ds.umd.cjs.map
|