@moontra/moonui-pro 2.30.10 → 2.30.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -404,7 +404,7 @@ Alternatively, you can use your own component as a description by assigning it a
|
|
|
404
404
|
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return Lf.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},RKe=gKe;var NKe=vKe,Ple=yKe,Ile=xKe,kle=PKe,Rle=kKe,Nle=wKe,Mle=SKe;var Yp=D(de(),1),MKe=RKe;var RZt=NKe,TKe=p1.forwardRef(({className:e,...t},r)=>(0,Yp.jsx)(Ple,{className:B("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));TKe.displayName=Ple.displayName;var Tle=p1.forwardRef(({className:e,...t},r)=>(0,Yp.jsxs)(RZt,{children:[(0,Yp.jsx)(TKe,{}),(0,Yp.jsx)(Ile,{ref:r,className:B("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Tle.displayName=Ile.displayName;var Ale=({className:e,...t})=>(0,Yp.jsx)("div",{className:B("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ale.displayName="AlertDialogHeader";var Lle=({className:e,...t})=>(0,Yp.jsx)("div",{className:B("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6",e),...t});Lle.displayName="AlertDialogFooter";var Ele=p1.forwardRef(({className:e,...t},r)=>(0,Yp.jsx)(Nle,{ref:r,className:B("text-lg font-semibold",e),...t}));Ele.displayName=Nle.displayName;var Dle=p1.forwardRef(({className:e,...t},r)=>(0,Yp.jsx)(Mle,{ref:r,className:B("text-sm text-muted-foreground",e),...t}));Dle.displayName=Mle.displayName;var Ole=p1.forwardRef(({className:e,...t},r)=>(0,Yp.jsx)(kle,{ref:r,className:B(Xu(),e),...t}));Ole.displayName=kle.displayName;var _le=p1.forwardRef(({className:e,...t},r)=>(0,Yp.jsx)(Rle,{ref:r,className:B(Xu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));_le.displayName=Rle.displayName;var Bn=D(de(),1);function AKe({selectedRows:e,actions:t,onClearSelection:r,className:n}){let[o,a]=Fle.default.useState(!1),[i,s]=Fle.default.useState(null),l=e.length,c=async f=>{if(f.confirmMessage){s(f);return}await u(f)},u=async f=>{a(!0);try{await f.action(e),r&&r()}catch(p){console.error("Bulk action failed:",p)}finally{a(!1),s(null)}},d=async()=>{i&&await u(i)};return l===0?null:(0,Bn.jsxs)(Bn.Fragment,{children:[(0,Bn.jsxs)("div",{className:B("flex items-center gap-2",n),children:[(0,Bn.jsxs)(dt,{variant:"secondary",className:"gap-1",children:[(0,Bn.jsx)("span",{className:"font-semibold",children:l}),(0,Bn.jsx)("span",{children:" Selected"})]}),(0,Bn.jsxs)(Nr,{children:[(0,Bn.jsx)(Mr,{asChild:!0,children:(0,Bn.jsx)(re,{variant:"outline",size:"sm",disabled:o,className:"gap-2",children:o?(0,Bn.jsxs)(Bn.Fragment,{children:[(0,Bn.jsx)(Rr,{className:"h-4 w-4 animate-spin"}),"Processing..."]}):(0,Bn.jsxs)(Bn.Fragment,{children:[(0,Bn.jsx)(Ja,{className:"h-4 w-4"}),"Bulk Actions"]})})}),(0,Bn.jsxs)(Sr,{align:"end",className:"w-48",children:[t.map((f,p)=>{let m=typeof f.disabled=="function"?f.disabled(e):f.disabled;return(0,Bn.jsxs)(Ue,{disabled:m||o,onSelect:()=>c(f),className:B("cursor-pointer",f.variant==="destructive"&&"text-destructive focus:text-destructive"),children:[f.icon&&(0,Bn.jsx)("span",{className:"mr-2 h-4 w-4",children:f.icon}),f.label]},p)}),r&&(0,Bn.jsxs)(Bn.Fragment,{children:[(0,Bn.jsx)(Kr,{}),(0,Bn.jsx)(Ue,{onSelect:r,className:"cursor-pointer text-muted-foreground",children:"Clear selection"})]})]})]})]}),(0,Bn.jsx)(MKe,{open:!!i,onOpenChange:f=>!f&&s(null),children:(0,Bn.jsxs)(Tle,{children:[(0,Bn.jsxs)(Ale,{children:[(0,Bn.jsxs)(Ele,{className:"flex items-center gap-2",children:[i?.variant==="destructive"&&(0,Bn.jsx)(ya,{className:"h-5 w-5 text-destructive"}),i?.confirmTitle||"Confirm Action"]}),(0,Bn.jsx)(Dle,{children:i?.confirmMessage||`This action will affect ${l} selected item${l>1?"s":""}. This action cannot be undone.`})]}),(0,Bn.jsxs)(Lle,{children:[(0,Bn.jsx)(_le,{disabled:o,children:"Cancel"}),(0,Bn.jsx)(Ole,{onClick:d,disabled:o,className:B(i?.variant==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90"),children:o?(0,Bn.jsxs)(Bn.Fragment,{children:[(0,Bn.jsx)(Rr,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing..."]}):"Confirm"})]})]})})]})}function NZt(e,t,r=!0){if(e.length===0)return"";let n=t||Object.keys(e[0]),o=[];if(r){let a=n.map(i=>{let s=String(i);return s.includes(",")||s.includes('"')||s.includes(`
|
|
405
405
|
`)?`"${s.replace(/"/g,'""')}"`:s});o.push(a.join(","))}return e.forEach(a=>{let i=n.map(s=>{let l=a[s];if(l==null)return"";if(l instanceof Date)return l.toISOString();if(typeof l=="object")return JSON.stringify(l);let c=String(l);return c.includes(",")||c.includes('"')||c.includes(`
|
|
406
406
|
`)?`"${c.replace(/"/g,'""')}"`:c});o.push(i.join(","))}),o.join(`
|
|
407
|
-
`)}function MZt(e,t){if(!t||t.length===0)return JSON.stringify(e,null,2);let r=e.map(n=>{let o={};return t.forEach(a=>{a in n&&(o[a]=n[a])}),o});return JSON.stringify(r,null,2)}function TZt(e,t,r){let n=new Blob([e],{type:r}),o=URL.createObjectURL(n),a=document.createElement("a");a.href=o,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}async function LKe(e,t){let{format:r,filename:n="data-export",columns:o,includeHeaders:a=!0}=t,i,s,l;switch(r){case"csv":i=NZt(e,o,a),s="text/csv;charset=utf-8;",l="csv";break;case"json":i=MZt(e,o),s="application/json;charset=utf-8;",l="json";break;case"xlsx":throw new Error("XLSX export requires additional dependencies. Use CSV format instead.");default:throw new Error(`Unsupported export format: ${r}`)}let c=`${n}-${new Date().toISOString().split("T")[0]}.${l}`;TZt(i,c,s)}function EKe(e,t){return e.filter(r=>{let n=r.id||r.accessorKey;return n&&t[n]!==!1}).map(r=>r.id||r.accessorKey).filter(Boolean)}var m1=D(ce(),1),DKe=D(kh(),1);var Ut=D(de(),1),AZt={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Not contains",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",in:"In",notIn:"Not in",isNull:"Is empty",isNotNull:"Is not empty"};function LZt(e){switch(e){case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","isNull","isNotNull"];case"date":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","isNull","isNotNull"];case"boolean":return["equals","notEquals","isNull","isNotNull"];case"select":return["equals","notEquals","in","notIn","isNull","isNotNull"];default:return["equals","notEquals","contains","notContains","startsWith","endsWith","isNull","isNotNull"]}}function OKe({table:e,open:t,onOpenChange:r,position:n="right",width:o="400px",filters:a,onFiltersChange:i,customFilters:s,matchAll:l,onMatchAllChange:c}){let[u,d]=(0,m1.useState)([]),[f,p]=(0,m1.useState)(!0),m=a||u,h=i||d,g=l!==void 0?l:f,v=c||p,y=(0,m1.useMemo)(()=>e.getAllColumns().filter(N=>N.id==="select"||N.id==="actions"||N.id==="expander"?!1:N.getCanFilter()),[e]),x=()=>{let N=y[0];if(!N)return;let M={column:N.id,operator:"contains",value:""};h([...m,M])},w=(N,M)=>{let A=[...m];A[N]={...A[N],...M},h(A)},b=N=>{h(m.filter((M,A)=>A!==N))},C=()=>{h([]),e.resetColumnFilters()},S=()=>{e.resetColumnFilters(),[...new Set(m.map(M=>M.column))].forEach(M=>{let A=e.getColumn(M);A&&A.setFilterValue({custom:!0,filters:m,matchAll:g})}),m.length===0&&e.resetColumnFilters(),r(!1)};if(typeof document>"u")return null;let I=(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)(_t,{children:t&&(0,Ut.jsx)(ne.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/20",style:{zIndex:9998},onClick:()=>r(!1)})}),(0,Ut.jsx)(_t,{children:t&&(0,Ut.jsx)(ne.div,{initial:{x:n==="right"?"100%":"-100%"},animate:{x:0},exit:{x:n==="right"?"100%":"-100%"},transition:{type:"spring",damping:30,stiffness:300},className:B("fixed top-0 bottom-0 bg-background border-l shadow-xl",n==="right"?"right-0":"left-0"),style:{width:o,zIndex:9999},children:(0,Ut.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsx)(Di,{className:"h-5 w-5"}),(0,Ut.jsx)("h2",{className:"text-lg font-semibold",children:"Filters"}),m.length>0&&(0,Ut.jsxs)("span",{className:"text-sm text-muted-foreground",children:["(",m.length," active)"]})]}),(0,Ut.jsx)(re,{variant:"ghost",size:"icon",onClick:()=>r(!1),children:(0,Ut.jsx)(sr,{className:"h-4 w-4"})})]}),(0,Ut.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[(0,Ut.jsxs)("div",{className:"mb-6",children:[(0,Ut.jsx)(It,{className:"text-sm font-medium mb-2 block",children:"Match conditions"}),(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsx)(re,{variant:g?"primary":"outline",size:"sm",onClick:()=>v(!0),className:"flex-1",children:"Match all"}),(0,Ut.jsx)(re,{variant:g?"outline":"primary",size:"sm",onClick:()=>v(!1),className:"flex-1",children:"Match any"})]})]}),(0,Ut.jsx)(Is,{className:"mb-6"}),s&&(0,Ut.jsxs)(Ut.Fragment,{children:[s,(0,Ut.jsx)(Is,{className:"my-6"})]}),(0,Ut.jsx)("div",{className:"space-y-4",children:m.map((N,M)=>(0,Ut.jsx)(EZt,{filter:N,columns:y,onUpdate:A=>w(M,A),onRemove:()=>b(M)},M))}),(0,Ut.jsxs)(re,{variant:"outline",size:"sm",onClick:x,className:"w-full mt-4",children:[(0,Ut.jsx)(yi,{className:"h-4 w-4 mr-2"}),"Add filter"]})]}),(0,Ut.jsx)("div",{className:"p-4 border-t space-y-2",children:(0,Ut.jsxs)("div",{className:"flex gap-2",children:[(0,Ut.jsxs)(re,{variant:"outline",onClick:C,disabled:m.length===0,className:"flex-1",children:[(0,Ut.jsx)(Zi,{className:"h-4 w-4 mr-2"}),"Clear all"]}),(0,Ut.jsx)(re,{onClick:S,className:"flex-1",children:"Apply filters"})]})})]})})})]});return(0,DKe.createPortal)(I,document.body)}function EZt({filter:e,columns:t,onUpdate:r,onRemove:n}){let a=t.find(p=>p.id===e.column)?.columnDef,i=a?.meta?.filterType||"string",s=a?.meta?.filterOptions,l=a?.meta?.filterValueAccessor,c=LZt(i),u=e.operator!=="isNull"&&e.operator!=="isNotNull",d=e.operator==="in"||e.operator==="notIn",f=m1.default.useMemo(()=>i!=="select"&&!s?null:s||null,[i,s]);return(0,Ut.jsxs)("div",{className:"space-y-2 p-3 border rounded-lg bg-muted/30",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsxs)($o,{value:e.column,onValueChange:p=>r({column:p}),children:[(0,Ut.jsx)(qo,{className:"flex-1",children:(0,Ut.jsx)(aa,{})}),(0,Ut.jsx)(Wo,{style:{zIndex:1e4},children:t.map(p=>{let m=p.columnDef.header,h=typeof m=="function"?p.id:m||p.id;return(0,Ut.jsx)(Ft,{value:p.id,children:h},p.id)})})]}),(0,Ut.jsx)(re,{variant:"ghost",size:"icon",onClick:n,className:"h-8 w-8",children:(0,Ut.jsx)(sr,{className:"h-4 w-4"})})]}),(0,Ut.jsxs)($o,{value:e.operator,onValueChange:p=>r({operator:p}),children:[(0,Ut.jsx)(qo,{children:(0,Ut.jsx)(aa,{})}),(0,Ut.jsx)(Wo,{style:{zIndex:1e4},children:c.map(p=>(0,Ut.jsx)(Ft,{value:p,children:AZt[p]},p))})]}),u&&(0,Ut.jsx)("div",{children:i==="boolean"?(0,Ut.jsxs)($o,{value:String(e.value),onValueChange:p=>r({value:p==="true"}),children:[(0,Ut.jsx)(qo,{children:(0,Ut.jsx)(aa,{})}),(0,Ut.jsxs)(Wo,{style:{zIndex:1e4},children:[(0,Ut.jsx)(Ft,{value:"true",children:"True"}),(0,Ut.jsx)(Ft,{value:"false",children:"False"})]})]}):(i==="select"||f)&&!d?(0,Ut.jsxs)($o,{value:e.value||"",onValueChange:p=>r({value:p}),children:[(0,Ut.jsx)(qo,{children:(0,Ut.jsx)(aa,{placeholder:"Select value..."})}),(0,Ut.jsx)(Wo,{style:{zIndex:1e4},children:f?.map(p=>(0,Ut.jsx)(Ft,{value:p,children:p},p))})]}):(i==="select"||f)&&d?(0,Ut.jsxs)("div",{className:"space-y-2",children:[(0,Ut.jsx)("div",{className:"text-xs text-muted-foreground",children:"Select multiple values:"}),(0,Ut.jsx)("div",{className:"space-y-1 max-h-32 overflow-y-auto border rounded-md p-2",children:f?.map(p=>{let m=Array.isArray(e.value)?e.value:[],h=m.includes(p);return(0,Ut.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer hover:bg-muted/50 p-1 rounded",children:[(0,Ut.jsx)("input",{type:"checkbox",checked:h,onChange:g=>{let v=g.target.checked?[...m,p]:m.filter(y=>y!==p);r({value:v})},className:"rounded border-gray-300"}),(0,Ut.jsx)("span",{className:"text-sm",children:p})]},p)})})]}):i==="number"?(0,Ut.jsx)(Jt,{type:"number",value:e.value||"",onChange:p=>r({value:p.target.value}),placeholder:"Enter value..."}):d?(0,Ut.jsx)(Jt,{value:Array.isArray(e.value)?e.value.join(", "):e.value||"",onChange:p=>r({value:p.target.value}),placeholder:"Enter values separated by comma..."}):(0,Ut.jsx)(Jt,{value:e.value||"",onChange:p=>r({value:p.target.value}),placeholder:"Enter value..."})})]})}var Zg=D(ce(),1);var ca=D(de(),1);function _Ke({table:e,filter:t,data:r}){let[n,o]=(0,Zg.useState)(!1),[a,i]=(0,Zg.useState)(""),s=Zg.default.useMemo(()=>{let v=e.getColumn(t.column);return v||(v=e.getAllColumns().find(x=>x.id===t.column||x.columnDef.accessorKey===t.column)),v},[e,t.column]),l=(0,Zg.useMemo)(()=>{if(t.options&&t.options!=="auto")return t.options;let v=new Set;return r.forEach(y=>{let x=y[t.column];if(x===void 0&&t.column.includes(".")){let w=t.column.split(".");x=y;for(let b of w)x=x?.[b]}x!=null&&x!==""&&v.add(String(x))}),Array.from(v).sort()},[r,t.column,t.options]),c=s?.getFilterValue(),u=(0,Zg.useMemo)(()=>c?Array.isArray(c)?new Set(c):new Set([String(c)]):new Set,[c]),d=(0,Zg.useMemo)(()=>{if(!t.showCounts)return{};let v={};return r.forEach(y=>{let x=y[t.column];if(x===void 0&&t.column.includes(".")){let w=t.column.split(".");x=y;for(let b of w)x=x?.[b]}if(x!=null&&x!==""){let w=String(x);v[w]=(v[w]||0)+1}}),v},[r,t.column,t.showCounts]),f=v=>{if(s)if(t.multi){let y=new Set(u);y.has(v)?y.delete(v):y.add(v),y.size===0?s.setFilterValue(void 0):s.setFilterValue(Array.from(y))}else u.has(v)?s.setFilterValue(void 0):s.setFilterValue(v)},p=()=>{s?.setFilterValue(void 0),i("")},m=t.label||t.column,h=(0,Zg.useMemo)(()=>a?l.filter(v=>v.toLowerCase().includes(a.toLowerCase())):l,[l,a]),g=!s||l.length===0;return(0,ca.jsxs)(Bi,{open:n,onOpenChange:o,children:[(0,ca.jsx)(Vi,{asChild:!0,children:(0,ca.jsxs)(re,{variant:"outline",size:"sm",disabled:g,className:B("h-8 border-dashed",u.size>0&&"border-solid"),children:[m,u.size>0&&(0,ca.jsxs)(ca.Fragment,{children:[(0,ca.jsx)("span",{className:"mx-2 h-4 w-px bg-border"}),(0,ca.jsx)(dt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:u.size})]})]})}),(0,ca.jsx)(Ii,{className:"w-[250px] p-0",align:"start",children:(0,ca.jsxs)("div",{className:"p-2",children:[l.length>0&&(0,ca.jsx)("div",{className:"pb-2",children:(0,ca.jsxs)("div",{className:"relative",children:[(0,ca.jsx)(co,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),(0,ca.jsx)(Jt,{placeholder:`Search ${m.toLowerCase()}...`,value:a,onChange:v=>i(v.target.value),className:"h-8 w-full pl-8"})]})}),l.length===0?(0,ca.jsx)("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No options available"}):h.length===0?(0,ca.jsx)("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No results found"}):(0,ca.jsx)("div",{className:"space-y-1 max-h-[300px] overflow-y-auto",children:h.map(v=>{let y=u.has(v);return(0,ca.jsxs)("button",{onClick:()=>f(v),className:B("flex w-full items-center justify-between rounded px-2 py-1.5 text-sm hover:bg-accent",y&&"bg-accent"),children:[(0,ca.jsxs)("div",{className:"flex items-center",children:[(0,ca.jsx)("div",{className:B("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",y?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,ca.jsx)(en,{className:"h-4 w-4"})}),(0,ca.jsx)("span",{children:v})]}),t.showCounts&&d[v]!==void 0&&(0,ca.jsx)("span",{className:"text-xs text-muted-foreground",children:d[v]})]},v)})}),u.size>0&&(0,ca.jsx)("div",{className:"border-t mt-2 pt-2",children:(0,ca.jsx)(re,{variant:"ghost",size:"sm",className:"w-full justify-center",onClick:p,children:"Clear filter"})})]})})]})}var n_=D(ce(),1);var Ln=D(de(),1);function FKe({table:e,column:t,title:r,options:n="auto",data:o}){let a=e.getColumn(t),[i,s]=(0,n_.useState)("");if(!a)return null;let l=a.columnDef,c=l?.meta?.filterValueAccessor,u=l?.meta?.filterOptions,d=b=>c?c(b):b[t],{availableOptions:f,optionCounts:p}=(0,n_.useMemo)(()=>{let b={},C=new Set;o.forEach(I=>{let N=d(I);if(N!=null&&N!==""){let M=String(N);C.add(M),b[M]=(b[M]||0)+1}});let S=[];return n!=="auto"?S=n:u?S=u.map(I=>({value:I,label:I})):S=Array.from(C).sort().slice(0,50).map(I=>({value:I,label:I})),{availableOptions:S,optionCounts:b}},[o,n,u]),m=a.getFilterValue(),h=new Set(m||[]),g=(0,n_.useMemo)(()=>i?f.filter(b=>(b.label||b.value).toLowerCase().includes(i.toLowerCase())):f,[f,i]),v=r||a.columnDef.header||t,y=b=>{let C=new Set(h);C.has(b)?C.delete(b):C.add(b),C.size===0?a.setFilterValue(void 0):a.setFilterValue(Array.from(C))},x=()=>{a.setFilterValue(void 0),s("")},w=()=>{let b=g.map(C=>C.value);a.setFilterValue(b)};return(0,Ln.jsxs)(Bi,{children:[(0,Ln.jsx)(Vi,{asChild:!0,children:(0,Ln.jsxs)(re,{variant:"outline",size:"sm",className:B("h-8 border-dashed",h.size>0&&"border-solid"),children:[(0,Ln.jsx)(zx,{className:"mr-2 h-4 w-4"}),v,h.size>0&&(0,Ln.jsxs)(Ln.Fragment,{children:[(0,Ln.jsx)(Is,{orientation:"vertical",className:"mx-2 h-4"}),(0,Ln.jsx)(dt,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:h.size}),(0,Ln.jsx)("div",{className:"hidden space-x-1 lg:flex",children:h.size>2?(0,Ln.jsxs)(dt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[h.size," selected"]}):Array.from(h).slice(0,2).map(b=>{let C=f.find(S=>S.value===b);return(0,Ln.jsx)(dt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:C?.label||b},b)})})]})]})}),(0,Ln.jsxs)(Ii,{className:"w-[300px] p-0",align:"start",children:[(0,Ln.jsx)("div",{className:"p-3",children:(0,Ln.jsxs)("div",{className:"relative",children:[(0,Ln.jsx)(co,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),(0,Ln.jsx)(Jt,{placeholder:`Search ${v.toLowerCase()}...`,value:i,onChange:b=>s(b.target.value),className:"h-8 pl-8"})]})}),(0,Ln.jsx)(Is,{}),(0,Ln.jsx)("div",{className:"max-h-[300px] overflow-y-auto",children:g.length===0?(0,Ln.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No results found"}):(0,Ln.jsx)("div",{className:"p-2",children:g.map(b=>{let C=h.has(b.value),S=p[b.value]||0;return(0,Ln.jsxs)(re,{variant:"ghost",size:"sm",className:"w-full justify-start font-normal",onClick:()=>y(b.value),children:[(0,Ln.jsx)("div",{className:B("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",C?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,Ln.jsx)(en,{className:B("h-4 w-4")})}),b.icon&&(0,Ln.jsx)("span",{className:"mr-2",children:b.icon}),(0,Ln.jsx)("span",{className:"flex-1 text-left",children:b.label||b.value}),S>0&&(0,Ln.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:S})]},b.value)})})}),(h.size>0||g.length>0)&&(0,Ln.jsxs)(Ln.Fragment,{children:[(0,Ln.jsx)(Is,{}),(0,Ln.jsxs)("div",{className:"flex items-center justify-between p-2",children:[h.size>0?(0,Ln.jsxs)(re,{variant:"ghost",size:"sm",onClick:x,className:"h-8 px-2 lg:px-3",children:["Clear",(0,Ln.jsx)(sr,{className:"ml-2 h-4 w-4"})]}):(0,Ln.jsxs)(re,{variant:"ghost",size:"sm",onClick:w,className:"h-8 px-2 lg:px-3",children:["Select all",(0,Ln.jsx)(en,{className:"ml-2 h-4 w-4"})]}),(0,Ln.jsxs)("span",{className:"text-xs text-muted-foreground",children:[h.size," of ",f.length," selected"]})]})]})]})]})}var Je=D(de(),1);function Ble({columns:e,data:t,searchable:r=!0,filterable:n=!0,exportable:o=!0,selectable:a=!1,pagination:i=!0,pageSize:s=10,pageSizeOptions:l=[5,10,20,50,100],className:c,onRowSelect:u,onExport:d,enableExpandable:f=!1,renderSubComponent:p,expandedRows:m,onRowExpandChange:h,bulkActions:g=[],quickFilters:v=[],facetedFilters:y=[],features:x={},theme:w={},texts:b={},enableSorting:C=!0,enableFiltering:S=!0,enablePagination:I=!0,enableColumnVisibility:N=!0,enableRowSelection:M,filterPlaceholder:A="Search all columns...",defaultPageSize:T,manualPagination:O=!1,pageCount:F,onPaginationChange:P,onSortingChange:k,onColumnFiltersChange:R,state:L}){let _=Gi.default.useMemo(()=>e.map(De=>{let{enableHiding:gt,...Ke}=De;return{...Ke,enableHiding:!0,filterFn:"custom"}}),[e]),{hasProAccess:U,isLoading:V}=Yt();if(!V&&!U)return(0,Je.jsx)(Ve,{className:B("w-full",c),children:(0,Je.jsx)(ze,{className:"py-12 text-center",children:(0,Je.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,Je.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Je.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Je.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Data Table is available exclusively to MoonUI Pro subscribers."}),(0,Je.jsx)("div",{className:"flex gap-3 justify-center",children:(0,Je.jsx)("a",{href:"/pricing",children:(0,Je.jsxs)(re,{size:"sm",children:[(0,Je.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[E,H]=Gi.default.useState([]),[j,$]=Gi.default.useState([]),[W,z]=Gi.default.useState({}),[G,X]=Gi.default.useState({}),[Y,oe]=Gi.default.useState(""),[ie,Le]=Gi.default.useState({pageIndex:0,pageSize:T||s||10}),[Ce,Be]=Gi.default.useState(!1),[he,Re]=Gi.default.useState(new Set),[ye,Oe]=Gi.default.useState(!1),Q=m||he,Z=h?De=>h(De):Re,me=T||s,ke=Gi.default.useMemo(()=>t,[t]),fe=De=>()=>{let Ke=(L?.sorting??E).find(Vr=>Vr.id===De),Vt=[];Ke?Ke.desc?Vt=[]:Vt=[{id:De,desc:!0}]:Vt=[{id:De,desc:!1}];let jt=k!==void 0?k:H;typeof jt=="function"&&jt(Vt)},Pe=Gi.default.useRef(null),te=Gi.default.useCallback(De=>{let gt=typeof De=="function"?De(G):De;if(X(gt),u&&Pe.current){let Ke=Object.keys(gt).filter(jt=>gt[jt]),Vt=Pe.current.getRowModel().rows.filter(jt=>Ke.includes(jt.id)).map(jt=>jt.original);u(Vt)}},[G,u]),xe=Gi.default.useMemo(()=>{let De=_.map(Ke=>!Ke.id&&Ke.accessorKey?{...Ke,id:Ke.accessorKey}:Ke),gt=De.some(Ke=>{if(Ke.id==="select")return!0;let Vt=Ke.header?.toString()||"",jt=Ke.cell?.toString()||"";return Vt.includes("Checkbox")||jt.includes("Checkbox")});return(a||M)&&!gt&&(De=[{id:"select",header:({table:Vt})=>{let jt=Vt.getIsAllPageRowsSelected(),Vr=Vt.getIsSomePageRowsSelected();return(0,Je.jsx)("div",{className:"flex items-center justify-center",children:(0,Je.jsx)(ql,{checked:jt?!0:Vr?"indeterminate":!1,onCheckedChange:fn=>{Vt.toggleAllPageRowsSelected(!!fn)},"aria-label":"Select all",className:"h-4 w-4"})})},cell:({row:Vt})=>{let jt=Vt.getIsSelected();return(0,Je.jsx)("div",{className:"flex items-center justify-center",children:(0,Je.jsx)(ql,{checked:jt,onCheckedChange:Vr=>Vt.toggleSelected(!!Vr),disabled:!Vt.getCanSelect(),"aria-label":"Select row",className:"h-4 w-4"},`select-${Vt.id}-${jt}`)})},enableSorting:!1,enableHiding:!1,size:40,maxSize:40},...De]),De},[_,a,M]),se=w9e({data:ke,columns:xe,onSortingChange:k!==void 0?k:H,onColumnFiltersChange:R!==void 0?R:$,onPaginationChange:P!==void 0?P:Le,getCoreRowModel:v9e(),getPaginationRowModel:x9e(),getSortedRowModel:b9e(),getFilteredRowModel:y9e(),enableSortingRemoval:!0,enableMultiSort:!1,sortDescFirst:!1,onColumnVisibilityChange:z,onRowSelectionChange:te,onGlobalFilterChange:oe,globalFilterFn:"includesString",enableRowSelection:a||M||!1,filterFns:{custom:(De,gt,Ke)=>{if(Array.isArray(Ke)){let No=se.getColumn(gt)?.columnDef?.meta?.filterValueAccessor,Ma=No?No(De.original):De.getValue(gt);return Ke.includes(String(Ma))}if(typeof Ke=="string"||typeof Ke=="number"||typeof Ke=="boolean"){let No=se.getColumn(gt)?.columnDef?.meta?.filterValueAccessor,Ma=No?No(De.original):De.getValue(gt);return String(Ma)===String(Ke)}if(!Ke?.custom||!Ke?.filters)return!0;let Vt=Ke.filters,jt=Ke.matchAll!==void 0?Ke.matchAll:!0,Vr=Vt.map(fn=>{let Ma=se.getColumn(fn.column)?.columnDef?.meta?.filterValueAccessor,Dr=Ma?Ma(De.original):De.getValue(fn.column),vn=fn.value;switch(fn.operator){case"equals":return Dr===vn;case"notEquals":return Dr!==vn;case"contains":return String(Dr).toLowerCase().includes(String(vn).toLowerCase());case"notContains":return!String(Dr).toLowerCase().includes(String(vn).toLowerCase());case"startsWith":return String(Dr).toLowerCase().startsWith(String(vn).toLowerCase());case"endsWith":return String(Dr).toLowerCase().endsWith(String(vn).toLowerCase());case"greaterThan":return Number(Dr)>Number(vn);case"lessThan":return Number(Dr)<Number(vn);case"greaterThanOrEqual":return Number(Dr)>=Number(vn);case"lessThanOrEqual":return Number(Dr)<=Number(vn);case"in":return Array.isArray(vn)?vn.includes(Dr):String(vn).split(",").map(js=>js.trim()).includes(String(Dr));case"notIn":return Array.isArray(vn)?!vn.includes(Dr):!String(vn).split(",").map(js=>js.trim()).includes(String(Dr));case"isNull":return Dr==null||Dr==="";case"isNotNull":return Dr!=null&&Dr!=="";default:return!0}});return jt?Vr.every(fn=>fn):Vr.some(fn=>fn)}},manualPagination:O,pageCount:F,state:{sorting:L?.sorting??E,columnFilters:L?.columnFilters??j,columnVisibility:L?.columnVisibility??W,rowSelection:L?.rowSelection??G,globalFilter:L?.globalFilter??Y,pagination:L?.pagination??ie},initialState:{pagination:{pageSize:me}},autoResetAll:!1,autoResetPageIndex:!1,autoResetExpanded:!1,getRowId:(De,gt)=>{let Ke=De;return Ke.id!==void 0&&Ke.id!==null&&Ke.id!==""?String(Ke.id):Ke.orderId!==void 0&&Ke.orderId!==null?String(Ke.orderId):Ke.orderNumber!==void 0&&Ke.orderNumber!==null?String(Ke.orderNumber):Ke.email?`email-${Ke.email}`:Ke.name&&Ke.email?`${Ke.name}-${Ke.email}`:Ke.name?`name-${Ke.name}-${gt}`:String(gt)}});Pe.current=se;let ae=se.getState(),_e=se.getRowModel(),Dt=Gi.default.useRef(_e.rows),vo=Gi.default.useMemo(()=>{let De=Dt.current!==_e.rows;return De&&(Dt.current=_e.rows),De},[_e.rows]),Ye=Dt.current,tt={sorting:x.sorting!==!1,filtering:x.filtering!==!1||n,pagination:x.pagination!==!1||i,search:x.search!==!1||r,columnVisibility:x.columnVisibility!==!1,rowSelection:x.rowSelection!==!1||a,export:x.export!==!1||o},Ie=async De=>{let gt=se.getFilteredSelectedRowModel().rows,Ke=gt.length>0?gt.map(Vr=>Vr.original):se.getFilteredRowModel().rows.map(Vr=>Vr.original);if(typeof o=="object"&&o.onExport){o.onExport(Ke,De);return}if(d){d(Ke);return}let Vt=typeof o=="object"&&o.filename?o.filename:"data-export",jt=EKe(_,W);await LKe(Ke,{format:De,filename:Vt,columns:jt,includeHeaders:!0})},ht=Gi.default.useMemo(()=>o?o===!0?["csv","json"]:typeof o=="object"&&o.formats?o.formats:["csv","json"]:[],[o]),Mt=()=>{se.resetRowSelection()};return(0,Je.jsxs)("div",{className:B("moonui-pro-datatable-container flex flex-col gap-4",c),children:[a&&se.getFilteredSelectedRowModel().rows.length>0&&(0,Je.jsxs)("div",{className:"flex items-center justify-between rounded-md bg-muted/50 px-4 py-2",children:[(0,Je.jsxs)("span",{className:"text-sm text-muted-foreground",children:[se.getFilteredSelectedRowModel().rows.length," Selected"]}),g.length>0&&(0,Je.jsx)(AKe,{selectedRows:se.getFilteredSelectedRowModel().rows.map(De=>De.original),actions:g,onClearSelection:Mt})]}),(0,Je.jsxs)("div",{className:"moonui-pro-datatable-toolbar flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,Je.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[r&&(0,Je.jsxs)("div",{className:"relative",children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(co,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"})}),(0,Je.jsx)(Jt,{placeholder:A,value:Y,onChange:De=>oe(De.target.value),className:"pl-8 w-full sm:w-64"})]}),v.length>0&&(0,Je.jsx)("div",{className:"flex items-center gap-2",children:v.map((De,gt)=>(0,Je.jsx)(_Ke,{table:se,filter:De,data:t},`quick-${De.column}-${gt}`))}),y.length>0&&(0,Je.jsx)("div",{className:"flex items-center gap-2",children:y.map((De,gt)=>{let Ke=typeof De=="string"?De:De.column,Vt=typeof De=="string"?void 0:De.label;return(0,Je.jsx)(FKe,{table:se,column:Ke,title:Vt,data:t},`faceted-${Ke}-${gt}`)})}),n&&(0,Je.jsxs)(re,{variant:"outline",size:"sm",onClick:()=>Oe(!0),children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Di,{className:"mr-2 h-4 w-4"})}),"Filters",j.length>0&&(0,Je.jsx)("span",{className:"ml-2 rounded-full bg-primary px-2 py-0.5 text-xs text-primary-foreground",children:j.length})]})]}),(0,Je.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o&&ht.length>0&&(0,Je.jsxs)(Nr,{children:[(0,Je.jsx)(Mr,{asChild:!0,children:(0,Je.jsxs)(re,{variant:"outline",size:"sm",children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(xn,{className:"mr-2 h-4 w-4"})}),"Export"]})}),(0,Je.jsxs)(Sr,{align:"end",children:[ht.includes("csv")&&(0,Je.jsxs)(Ue,{onClick:()=>Ie("csv"),children:[(0,Je.jsx)(Pv,{className:"mr-2 h-4 w-4"}),"Export as CSV"]}),ht.includes("json")&&(0,Je.jsxs)(Ue,{onClick:()=>Ie("json"),children:[(0,Je.jsx)(Bw,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),ht.includes("xlsx")&&(0,Je.jsxs)(Ue,{onClick:()=>Ie("xlsx"),children:[(0,Je.jsx)(vA,{className:"mr-2 h-4 w-4"}),"Export as Excel"]})]})]}),(0,Je.jsx)(C9e,{table:se})]})]}),(0,Je.jsx)("div",{className:"moonui-pro-datatable-wrapper rounded-md border overflow-hidden",style:{contain:"layout style"},children:(0,Je.jsx)("div",{style:{overflowX:"auto"},children:(0,Je.jsxs)("table",{className:"moonui-pro-datatable",style:{width:"100%",tableLayout:"auto"},children:[(0,Je.jsx)("thead",{className:"moonui-data-table-header",children:se.getHeaderGroups().map(De=>(0,Je.jsx)("tr",{className:"moonui-data-table-row border-b",children:De.headers.filter(gt=>gt.column.getIsVisible()).map(gt=>(0,Je.jsx)("th",{className:"moonui-data-table-th h-12 px-4 text-left align-middle font-medium text-muted-foreground",children:gt.isPlaceholder?null:(0,Je.jsxs)("div",{className:B("flex items-center space-x-2",gt.column.getCanSort()&&"cursor-pointer select-none"),onClick:gt.column.getCanSort()?fe(gt.column.id):void 0,children:[ele(gt.column.columnDef.header,gt.getContext()),gt.column.getCanSort()&&(0,Je.jsx)("div",{className:"ml-2",children:gt.column.getIsSorted()==="asc"?(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Cv,{className:"h-4 w-4"})}):gt.column.getIsSorted()==="desc"?(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Gf,{className:"h-4 w-4"})}):(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(wv,{className:"h-4 w-4"})})})]})},gt.id))},De.id))}),(0,Je.jsx)("tbody",{className:"moonui-data-table-body",children:Ce?(0,Je.jsx)(ne.tr,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:(0,Je.jsx)("td",{colSpan:se.getAllLeafColumns().filter(De=>De.getIsVisible()).length,className:"h-24 text-center",children:(0,Je.jsxs)("div",{className:"flex items-center justify-center space-x-2",children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Rr,{className:"h-4 w-4 animate-spin"})}),(0,Je.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading..."})]})})},"loading"):Ye?.length?(0,Je.jsx)(Je.Fragment,{children:Ye.map((De,gt)=>{let Ke=De.original.id||De.id,Vt=f&&Q.has(Ke);return(0,Je.jsx)(BKe,{row:De,columns:_,isExpanded:Vt,enableExpandable:f,renderSubComponent:p,visibilityState:se.getState().columnVisibility},Ke)})}):(0,Je.jsx)(ne.tr,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:(0,Je.jsx)("td",{colSpan:se.getAllLeafColumns().filter(De=>De.getIsVisible()).length,className:"h-24 text-center",children:"No results found."})},"no-results")})]})})}),i&&(0,Je.jsxs)("div",{className:"flex items-center justify-between px-2",children:[(0,Je.jsx)("div",{className:"flex-1 text-sm text-muted-foreground",children:a&&se.getFilteredSelectedRowModel().rows.length>0&&(0,Je.jsxs)("span",{children:[se.getFilteredSelectedRowModel().rows.length," ","of ",se.getFilteredRowModel().rows.length," ","row(s) selected."]})}),(0,Je.jsxs)("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Je.jsx)("p",{className:"text-sm font-medium",children:"Rows per page"}),(0,Je.jsx)("select",{value:se.getState().pagination.pageSize,onChange:async De=>{let gt=Number(De.target.value);P?P({pageIndex:se.getState().pagination.pageIndex,pageSize:gt}):(Be(!0),await new Promise(Ke=>setTimeout(Ke,300)),se.setPageSize(gt),Be(!1))},className:"h-8 w-[70px] rounded border border-input bg-background px-3 py-1 text-sm",disabled:Ce,children:l.map(De=>(0,Je.jsx)("option",{value:De,children:De},De))})]}),(0,Je.jsxs)("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",se.getState().pagination.pageIndex+1," of"," ",se.getPageCount()]}),(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Je.jsx)(re,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:async()=>{P?P({pageIndex:0,pageSize:se.getState().pagination.pageSize}):(Be(!0),await new Promise(De=>setTimeout(De,300)),se.setPageIndex(0),Be(!1))},disabled:!se.getCanPreviousPage()||Ce,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(fA,{className:"h-4 w-4"})})}),(0,Je.jsx)(re,{variant:"outline",className:"h-8 w-8 p-0",onClick:async()=>{if(P){let De=se.getState().pagination.pageIndex;P({pageIndex:De-1,pageSize:se.getState().pagination.pageSize})}else Be(!0),await new Promise(De=>setTimeout(De,300)),se.previousPage(),Be(!1)},disabled:!se.getCanPreviousPage()||Ce,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(ga,{className:"h-4 w-4"})})}),(0,Je.jsx)(re,{variant:"outline",className:"h-8 w-8 p-0",onClick:async()=>{Be(!0),await new Promise(De=>setTimeout(De,300)),se.nextPage(),Be(!1)},disabled:!se.getCanNextPage()||Ce,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Kn,{className:"h-4 w-4"})})}),(0,Je.jsx)(re,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:async()=>{Be(!0),await new Promise(De=>setTimeout(De,300)),se.setPageIndex(se.getPageCount()-1),Be(!1)},disabled:!se.getCanNextPage()||Ce,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(pA,{className:"h-4 w-4"})})})]})]})]}),n&&(0,Je.jsx)(OKe,{table:se,open:ye,onOpenChange:Oe})]})}function DZt(e,t){return{id:"expander",header:()=>null,size:50,cell:({row:r})=>{let n=r.original.id||r.id,o=e.has(n);return(0,Je.jsx)("button",{onClick:a=>{a.stopPropagation(),t(n)},className:"p-2 hover:bg-muted rounded-md transition-colors","aria-label":o?"Collapse row":"Expand row",children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:o?(0,Je.jsx)(ea,{className:"h-4 w-4 text-muted-foreground"}):(0,Je.jsx)(Kn,{className:"h-4 w-4 text-muted-foreground"})})})}}}function OZt(e=new Set){let[t,r]=Gi.default.useState(e),n=Gi.default.useCallback(i=>{r(s=>{let l=new Set(s);return l.has(i)?l.delete(i):l.add(i),l})},[]),o=Gi.default.useCallback(i=>{r(new Set(i))},[]),a=Gi.default.useCallback(()=>{r(new Set)},[]);return{expandedRows:t,setExpandedRows:r,toggleRow:n,expandAll:o,collapseAll:a}}var BKe=({row:e,columns:t,isExpanded:r,enableExpandable:n,renderSubComponent:o,visibilityState:a})=>{let i=e.original.id||e.id;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("tr",{className:B("border-b transition-colors hover:bg-muted/50",e.getIsSelected()&&"bg-muted",r&&"border-b-0"),children:e.getAllCells().filter(s=>a[s.column.id]!==!1).map(s=>(0,Je.jsx)("td",{className:"moonui-data-table-td p-4 align-middle",children:ele(s.column.columnDef.cell,s.getContext())},s.id))}),r&&o&&(0,Je.jsx)("tr",{className:"border-b",children:(0,Je.jsx)("td",{colSpan:e.getAllCells().filter(s=>a[s.column.id]!==!1).length||1,className:"p-0 overflow-hidden",children:(0,Je.jsx)("div",{className:"transition-all duration-300 ease-out",style:{maxHeight:r?"1000px":"0",opacity:r?1:0},children:(0,Je.jsx)("div",{className:"border-t border-border/50",children:o({row:{original:e.original,id:i}})})})})})]})};BKe.displayName="TableRow";var _Zt=Ble,FZt=Ble;var kn=D(ce(),1);var yW=D(Ule(),1);var Ge=D(de(),1),zle=kn.default.memo(({searchInputRef:e,searchPlaceholder:t,initialValue:r,onSearchChange:n,keyboardShortcuts:o})=>{let[a,i]=(0,kn.useState)(r||""),s=(0,kn.useRef)(void 0);(0,kn.useEffect)(()=>{i(r)},[r]);let l=(0,kn.useCallback)(c=>{let u=c.target.value;i(u),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{n(u),e.current&&e.current.focus()},150)},[n,e]);return(0,kn.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),(0,Ge.jsx)("div",{className:"p-4 border-b",children:(0,Ge.jsxs)("div",{className:"relative",children:[(0,Ge.jsx)(co,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),(0,Ge.jsx)("input",{ref:e,type:"text",placeholder:t,value:a,onChange:l,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",className:"w-full h-10 pl-9 pr-9 text-sm bg-background border border-input rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}),o&&(0,Ge.jsxs)("kbd",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 hidden sm:flex",children:[(0,Ge.jsx)("span",{className:"text-xs",children:"\u2318"}),"K"]})]})})});zle.displayName="SearchInput";function BZt({sections:e,footer:t,showSearch:r=!0,searchPlaceholder:n="Search...",searchQuery:o="",onSearchChange:a,showThemeToggle:i=!1,theme:s="system",onThemeChange:l,branding:c,collapsible:u=!0,defaultCollapsed:d=!1,floatingActionButton:f=!0,floatingActionButtonPosition:p={bottom:"1rem",left:"1rem"},floatingActionButtonClassName:m,glassmorphism:h=!1,animatedBackground:g=!1,keyboardShortcuts:v=!0,persistState:y=!0,persistKey:x="moonui-sidebar-state",onStateChange:w,customStyles:b,fullWidthItems:C=!0,enableNProgress:S=!0,className:I,activePath:N,onNavigate:M}){let[A,T]=(0,kn.useState)(!1),[O,F]=(0,kn.useState)(!1),[P,k]=(0,kn.useState)(d),[R,L]=(0,kn.useState)([]),[_,U]=(0,kn.useState)(o),[V,E]=(0,kn.useState)([]),H=(0,kn.useRef)(null);(0,kn.useEffect)(()=>{S&&yW.default.configure({easing:"ease",speed:800,showSpinner:!1,trickleSpeed:200,minimum:.2})},[S]);let j=_a(0),$=_a(0),W=jh(j,{stiffness:300,damping:30}),z=jh($,{stiffness:300,damping:30});(0,kn.useEffect)(()=>{if(y&&typeof window<"u"){let Z=localStorage.getItem(x);if(Z){let me=JSON.parse(Z);k(me.collapsed),L(me.expandedSections),E(me.pinnedItems||[])}}},[y,x]),(0,kn.useEffect)(()=>{if(y&&typeof window<"u"){let Z={collapsed:P,expandedSections:R,searchQuery:_,pinnedItems:V,recentItems:[]};localStorage.setItem(x,JSON.stringify(Z)),w?.(Z)}},[P,R,_,V,y,x,w]),(0,kn.useEffect)(()=>{let Z=()=>{T(window.innerWidth<768)};return Z(),window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]),(0,kn.useEffect)(()=>{let Z=e.filter(me=>me.defaultExpanded!==!1).map(me=>me.id);L(Z)},[e]),(0,kn.useEffect)(()=>{if(!v)return;let Z=me=>{(me.metaKey||me.ctrlKey)&&me.key==="k"&&(me.preventDefault(),H.current?.focus()),(me.metaKey||me.ctrlKey)&&me.key==="b"&&(me.preventDefault(),A?F(!O):k(!P))};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[v,A,O,P]),(0,kn.useEffect)(()=>{if(!g)return;let Z=me=>{let ke=document.querySelector(".sidebar-container")?.getBoundingClientRect();ke&&(j.set(me.clientX-ke.left),$.set(me.clientY-ke.top))};return document.addEventListener("mousemove",Z),()=>document.removeEventListener("mousemove",Z)},[g,j,$]);let G=(0,kn.useCallback)(Z=>{L(me=>me.includes(Z)?me.filter(ke=>ke!==Z):[...me,Z])},[]),X=(0,kn.useCallback)(Z=>{E(me=>me.includes(Z)?me.filter(ke=>ke!==Z):[...me,Z])},[]),Y=(0,kn.useCallback)(Z=>{Z.action?Z.action():Z.href&&(S&&(yW.default.start(),setTimeout(()=>yW.default.done(),500)),M?M(Z.href):window.location.href=Z.href,A&&F(!1))},[M,A,S]);(0,kn.useEffect)(()=>{U(o)},[o]);let oe=(0,kn.useCallback)(Z=>{U(Z),a?.(Z)},[a]),ie=(0,kn.useCallback)((Z,me)=>me?Z.filter(ke=>{let fe=ke.title.toLowerCase().includes(me.toLowerCase()),Pe=ke.items?.some(te=>te.title.toLowerCase().includes(me.toLowerCase()));return fe||Pe}):Z,[]),Le=(0,kn.useMemo)(()=>_?e.map(Z=>({...Z,filteredItems:ie(Z.items,_).map(me=>({...me,filteredChildren:me.items?ie(me.items,_):void 0}))})).filter(Z=>Z.filteredItems.length>0):e.map(Z=>({...Z,filteredItems:Z.items.map(me=>({...me,filteredChildren:me.items}))})),[e,_,ie]),Ce=(0,kn.useCallback)(Z=>{let me=Z.items&&Z.items.length>0;return!me&&!Z.title?null:(0,Ge.jsxs)("div",{className:B("min-w-[200px] p-2",h&&"bg-background/95 backdrop-blur-sm"),children:[(0,Ge.jsx)("div",{className:"font-medium px-2 py-1 text-sm",children:Z.title}),me&&(0,Ge.jsx)("div",{className:"mt-1 space-y-0.5",children:Z.items?.map(ke=>{let fe=ke.href===N,Pe=ke.items&&ke.items.length>0;return(0,Ge.jsx)("div",{className:"relative",children:Pe?(0,Ge.jsxs)(DE,{openDelay:200,closeDelay:100,children:[(0,Ge.jsx)(OE,{asChild:!0,children:(0,Ge.jsxs)("button",{onClick:()=>Y(ke),disabled:ke.disabled,className:B("w-full flex items-center justify-between gap-2 rounded-md px-2 py-1.5 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",fe&&"bg-primary/10 text-primary font-medium",ke.disabled&&"opacity-50 cursor-not-allowed"),children:[(0,Ge.jsxs)("div",{className:"flex items-center gap-2",children:[ke.icon&&(0,Ge.jsx)("span",{className:"flex-shrink-0",children:ke.icon}),(0,Ge.jsx)("span",{className:"truncate",children:ke.title})]}),(0,Ge.jsx)(Kn,{className:"h-3 w-3 flex-shrink-0"})]})}),(0,Ge.jsx)(fk,{side:"right",align:"start",sideOffset:10,className:B("p-2",h&&"bg-background/95 backdrop-blur-sm"),children:(0,Ge.jsx)("div",{className:"space-y-0.5",children:ke.items?.map(te=>{let xe=te.href===N;return(0,Ge.jsxs)("button",{onClick:()=>Y(te),disabled:te.disabled,className:B("w-full flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",xe&&"bg-primary/10 text-primary font-medium",te.disabled&&"opacity-50 cursor-not-allowed"),children:[te.icon&&(0,Ge.jsx)("span",{className:"flex-shrink-0",children:te.icon}),(0,Ge.jsx)("span",{className:"truncate",children:te.title}),te.badge&&(0,Ge.jsx)(dt,{variant:te.badgeVariant||"secondary",className:"ml-auto flex-shrink-0 text-[10px] px-1.5 py-0 h-5",children:te.badge})]},te.id)})})})]}):(0,Ge.jsxs)("button",{onClick:()=>Y(ke),disabled:ke.disabled,className:B("w-full flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",fe&&"bg-primary/10 text-primary font-medium",ke.disabled&&"opacity-50 cursor-not-allowed"),children:[ke.icon&&(0,Ge.jsx)("span",{className:"flex-shrink-0",children:ke.icon}),(0,Ge.jsx)("span",{className:"truncate",children:ke.title}),ke.badge&&(0,Ge.jsx)(dt,{variant:ke.badgeVariant||"secondary",className:"ml-auto flex-shrink-0 text-[10px] px-1.5 py-0 h-5",children:ke.badge})]})},ke.id)})})]})},[N,h,Y]),Be=(0,kn.useCallback)((Z,me=0,ke)=>{let fe=Z.href===N,Pe=V.includes(Z.id),te=Z.items&&Z.items.length>0,xe=R.includes(Z.id),se=P&&!A&&me===0&&(te||Z.title),ae=Z.tooltip&&!P&&!se,_e=(0,Ge.jsxs)("button",{onClick:()=>{te?G(Z.id):Y(Z)},className:B("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all",C?"w-[calc(100%-1.5rem)] mx-3":"w-full","hover:bg-accent hover:text-accent-foreground",fe&&"bg-primary/10 text-primary font-medium",Z.disabled&&"opacity-50 cursor-not-allowed",me>0&&"ml-6 text-xs",P&&me===0&&"justify-center px-2",b?.hover),disabled:Z.disabled,children:[Z.icon&&(0,Ge.jsx)("span",{className:B("flex-shrink-0",P&&me===0&&"mx-auto"),children:Z.icon}),(!P||me>0)&&(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("span",{className:"flex-1 text-left truncate",children:Z.title}),Z.badge&&(0,Ge.jsx)(dt,{variant:Z.badgeVariant||"secondary",className:"ml-auto flex-shrink-0 text-[10px] px-1.5 py-0 h-5",children:Z.badge}),te&&me===0&&(0,Ge.jsx)(ea,{className:B("h-4 w-4 flex-shrink-0 transition-transform",xe&&"rotate-180")}),Pe&&(0,Ge.jsx)(jA,{className:"h-3 w-3 flex-shrink-0"})]})]});return se?(0,Ge.jsx)("div",{children:(0,Ge.jsxs)(DE,{openDelay:200,closeDelay:100,children:[(0,Ge.jsx)(OE,{asChild:!0,children:_e}),(0,Ge.jsx)(fk,{side:"right",align:"start",sideOffset:10,className:B("p-0 w-auto",h&&"bg-background/95 backdrop-blur-sm","animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"),children:(0,Ge.jsx)(ne.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.15},children:Ce(Z)})})]})},Z.id):(0,Ge.jsxs)("div",{children:[ae?(0,Ge.jsx)(Qs,{children:(0,Ge.jsxs)(ws,{children:[(0,Ge.jsx)(Cs,{asChild:!0,children:_e}),(0,Ge.jsx)(rs,{side:"right",children:(0,Ge.jsx)("p",{children:Z.tooltip})})]})}):_e,te&&!P&&ke&&(0,Ge.jsx)(_t,{children:xe&&(0,Ge.jsx)(ne.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:(0,Ge.jsx)("div",{className:"pt-1 space-y-1",children:ke.map(Dt=>Be(Dt,me+1))})})})]},Z.id)},[N,V,R,P,b,Y,G,A,h,Ce,C]),he=kn.default.memo(()=>(0,Ge.jsxs)("div",{className:B("flex items-center gap-3 p-4 border-b",P&&!A&&"justify-center px-2"),children:[c&&(0,Ge.jsxs)(Ge.Fragment,{children:[c.logo,(!P||A)&&c.title&&(0,Ge.jsx)("span",{className:"font-semibold text-lg",children:c.title})]}),A&&(0,Ge.jsx)(re,{variant:"ghost",size:"sm",className:"ml-auto h-8 w-8 p-0",onClick:()=>F(!1),children:(0,Ge.jsx)(sr,{className:"h-4 w-4"})}),!A&&u&&(0,Ge.jsx)(re,{variant:"ghost",size:"sm",className:B("h-8 w-8 p-0",!P&&"ml-auto"),onClick:()=>k(!P),children:P?(0,Ge.jsx)(Kn,{className:"h-4 w-4"}):(0,Ge.jsx)(ga,{className:"h-4 w-4"})})]})),Re=kn.default.memo(()=>(0,Ge.jsx)(Pc,{className:"flex-1 overflow-y-auto",children:(0,Ge.jsxs)("div",{className:"p-4 space-y-6",children:[V.length>0&&(!P||A)&&(0,Ge.jsxs)("div",{children:[(0,Ge.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Pinned"}),(0,Ge.jsx)("div",{className:"space-y-1",children:e.flatMap(Z=>Z.items.filter(me=>V.includes(me.id))).map(Z=>Be(Z))}),(0,Ge.jsx)(Is,{className:"mt-4"})]}),Le.map((Z,me)=>(0,Ge.jsxs)("div",{children:[Z.title&&(!P||A)&&(0,Ge.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2",children:Z.title}),(0,Ge.jsx)("div",{className:"space-y-1",children:Z.filteredItems.map(ke=>Be(ke,0,ke.filteredChildren))}),Z.showDivider&&me<Le.length-1&&(0,Ge.jsx)(Is,{className:"mt-4"})]},Z.id))]})})),ye=kn.default.memo(()=>t?(0,Ge.jsxs)("div",{className:"border-t p-4",children:[(0,Ge.jsx)("div",{className:"space-y-1",children:t.items.map(Z=>Be(Z))}),i&&(!P||A)&&(0,Ge.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,Ge.jsx)("span",{className:"text-xs text-muted-foreground",children:"Theme"}),(0,Ge.jsxs)(Nr,{children:[(0,Ge.jsx)(Mr,{asChild:!0,children:(0,Ge.jsxs)(re,{variant:"ghost",size:"sm",className:"h-7 px-2",children:[s==="light"&&(0,Ge.jsx)(Lh,{className:"h-3 w-3"}),s==="dark"&&(0,Ge.jsx)(Th,{className:"h-3 w-3"}),s==="system"&&(0,Ge.jsx)(Jf,{className:"h-3 w-3"})]})}),(0,Ge.jsxs)(Sr,{align:"end",children:[(0,Ge.jsxs)(Ue,{onClick:()=>l?.("light"),children:[(0,Ge.jsx)(Lh,{className:"mr-2 h-4 w-4"}),"Light"]}),(0,Ge.jsxs)(Ue,{onClick:()=>l?.("dark"),children:[(0,Ge.jsx)(Th,{className:"mr-2 h-4 w-4"}),"Dark"]}),(0,Ge.jsxs)(Ue,{onClick:()=>l?.("system"),children:[(0,Ge.jsx)(Jf,{className:"mr-2 h-4 w-4"}),"System"]})]})]})]})]}):null),Oe=kn.default.memo(()=>(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(Re,{}),(0,Ge.jsx)(ye,{})]})),Q=B("moonui-pro flex h-full flex-col bg-background border-r",h&&"bg-background/80 backdrop-blur-xl border-white/10",P&&!A&&"w-16",!P&&!A&&"w-64",b?.background,b?.border,I);return A?(0,Ge.jsxs)(Ge.Fragment,{children:[f&&(0,Ge.jsx)(re,{onClick:()=>F(!0),className:B("fixed z-40 h-12 w-12 rounded-full shadow-lg md:hidden",m),size:"icon",style:{bottom:p?.bottom,left:p?.left,right:p?.right,top:p?.top},children:(0,Ge.jsx)(Zf,{className:"h-5 w-5"})}),(0,Ge.jsx)(zb,{open:O,onOpenChange:F,children:(0,Ge.jsx)(ry,{side:"left",className:"w-80 p-0",children:(0,Ge.jsxs)("div",{className:B(Q,"sidebar-container flex flex-col"),children:[g&&(0,Ge.jsx)(ne.div,{className:"absolute inset-0 opacity-30",style:{background:`radial-gradient(circle at ${W}px ${z}px, rgba(var(--primary-rgb), 0.15), transparent 50%)`}}),(0,Ge.jsx)(he,{}),r&&(!P||A)&&(0,Ge.jsx)(zle,{searchInputRef:H,searchPlaceholder:n,initialValue:_,onSearchChange:oe,keyboardShortcuts:v},"sidebar-search-mobile"),(0,Ge.jsx)(Oe,{})]})})})]}):(0,Ge.jsxs)("aside",{className:B(Q,"sidebar-container hidden md:flex flex-col"),children:[g&&(0,Ge.jsx)(ne.div,{className:"absolute inset-0 opacity-30",style:{background:`radial-gradient(circle at ${W}px ${z}px, rgba(var(--primary-rgb), 0.15), transparent 50%)`}}),(0,Ge.jsx)(he,{}),r&&(!P||A)&&(0,Ge.jsx)(zle,{searchInputRef:H,searchPlaceholder:n,initialValue:_,onSearchChange:oe,keyboardShortcuts:v},"sidebar-search-desktop"),(0,Ge.jsx)(Oe,{})]})}function UKe(e){let{hasProAccess:t,isLoading:r}=Yt();return!r&&!t?(0,Ge.jsx)(Ve,{className:B("w-full max-w-xs",e.className),children:(0,Ge.jsx)(ze,{className:"py-12 text-center",children:(0,Ge.jsxs)("div",{className:"space-y-4",children:[(0,Ge.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Ge.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Ge.jsxs)("div",{children:[(0,Ge.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Ge.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Advanced Sidebar is available exclusively to MoonUI Pro subscribers."}),(0,Ge.jsx)("a",{href:"/pricing",children:(0,Ge.jsxs)(re,{size:"sm",children:[(0,Ge.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Ge.jsx)(BZt,{...e})}var VZt=UKe;var Ki=D(ce(),1);var xW=D(Ule(),1);var we=D(de(),1);function UZt({sections:e=[],branding:t,showSearch:r=!0,enableCommandAI:n=!1,commandAIShortcut:o="\u2318K",commandAIPlaceholder:a="Search commands...",onCommandAIOpen:i,onCommandAIClose:s,onCommandAISelect:l,searchPlaceholder:c="Search...",onSearch:u,showThemeToggle:d=!1,theme:f="system",onThemeChange:p,userMenu:m,notifications:h,cta:g,sticky:v=!0,glassmorphism:y=!1,animatedBackground:x=!1,keyboardShortcuts:w=!0,hideNavItems:b=!1,mobileBreakpoint:C=768,customStyles:S,variant:I="default",size:N="md",blur:M=!0,shadow:A=!1,rounded:T=!1,logoPosition:O="left",mobileMenuPosition:F="left",hideOnScroll:P=!1,showScrollProgress:k=!1,maxWidth:R="2xl",fullWidth:L=!1,enableNProgress:_=!0,className:U,activePath:V,onNavigate:E}){let[H,j]=(0,Ki.useState)(!1),[$,W]=(0,Ki.useState)(!1),[z,G]=(0,Ki.useState)(!1),[X,Y]=(0,Ki.useState)(!1),[oe,ie]=(0,Ki.useState)(""),[Le,Ce]=(0,Ki.useState)(!1),[Be,he]=(0,Ki.useState)(!1),[Re,ye]=(0,Ki.useState)(0),Oe=(0,Ki.useRef)(0),Q=(0,Ki.useRef)(null);(0,Ki.useEffect)(()=>{_&&xW.default.configure({easing:"ease",speed:800,showSpinner:!1,trickleSpeed:200,minimum:.2})},[_]),(0,Ki.useEffect)(()=>{let se=()=>{j(window.innerWidth<C)};return se(),window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)},[C]),(0,Ki.useEffect)(()=>{if(!v&&!P&&!k)return;let se=()=>{let ae=window.scrollY;if(Ce(ae>10),P&&(ae>Oe.current&&ae>100?he(!0):he(!1),Oe.current=ae),k){let _e=window.scrollY,Dt=document.documentElement.scrollHeight-document.documentElement.clientHeight,vo=_e/Dt*100;ye(vo)}};return window.addEventListener("scroll",se,{passive:!0}),()=>window.removeEventListener("scroll",se)},[v,P,k]),(0,Ki.useEffect)(()=>{if(!w&&!n)return;let se=ae=>{(ae.metaKey||ae.ctrlKey)&&ae.key==="k"&&(ae.preventDefault(),Y(!0),n&&i?.())};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[w,n,i]);let Z=(0,Ki.useCallback)(se=>{se.action?se.action():se.href&&(_&&(xW.default.start(),setTimeout(()=>xW.default.done(),500)),E?E(se.href):window.location.href=se.href,H&&W(!1))},[E,H,_]),me=(0,Ki.useCallback)(se=>{ie(se),u?.(se)},[u]),ke=se=>(0,we.jsx)("div",{className:"grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]",children:se.map(ae=>(0,we.jsxs)(jE,{className:B("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",ae.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>!ae.disabled&&Z(ae),children:[(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{className:"flex-shrink-0",children:ae.icon}),(0,we.jsx)("div",{className:"text-sm font-medium leading-none",children:ae.title}),ae.badge&&(0,we.jsx)(dt,{variant:ae.badgeVariant||"secondary",className:"ml-auto",children:ae.badge})]}),ae.description&&(0,we.jsx)("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:ae.description})]},ae.id))}),fe=se=>(0,we.jsx)(we.Fragment,{children:se.map(ae=>ae.items&&ae.items.length>0?(0,we.jsxs)(od,{children:[(0,we.jsx)(cu,{disabled:ae.disabled,children:(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]})}),(0,we.jsx)(uu,{children:fe(ae.items)})]},ae.id):(0,we.jsxs)(Ue,{disabled:ae.disabled,onClick:()=>Z(ae),children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]}),ae.badge&&(0,we.jsx)(dt,{variant:ae.badgeVariant||"secondary",className:"ml-auto",children:ae.badge})]},ae.id))}),Pe=()=>(0,we.jsxs)(zb,{open:$,onOpenChange:W,children:[(0,we.jsx)(mU,{asChild:!0,children:(0,we.jsx)(re,{variant:"ghost",size:"icon",className:"md:hidden",children:(0,we.jsx)(Zf,{className:"h-5 w-5"})})}),(0,we.jsx)(ry,{side:F,className:"w-80 p-0",children:(0,we.jsxs)("div",{className:"flex h-full flex-col",children:[(0,we.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[t&&(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[t.logo,t.title&&(0,we.jsx)("span",{className:"font-semibold text-lg",children:t.title})]}),(0,we.jsx)(re,{variant:"ghost",size:"icon",onClick:()=>W(!1),className:"h-8 w-8",children:(0,we.jsx)(sr,{className:"h-4 w-4"})})]}),(0,we.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:!b&&e.map(se=>(0,we.jsxs)("div",{className:"space-y-1",children:[se.items.map(ae=>(0,we.jsx)("div",{children:ae.items&&ae.items.length>0?(0,we.jsxs)(Nr,{children:[(0,we.jsx)(Mr,{asChild:!0,children:(0,we.jsxs)(re,{variant:"ghost",className:"w-full justify-between",disabled:ae.disabled,children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]}),(0,we.jsx)(ea,{className:"h-4 w-4"})]})}),(0,we.jsx)(Sr,{align:"start",className:"w-56",children:ae.items&&fe(ae.items)})]}):(0,we.jsxs)(re,{variant:"ghost",className:"w-full justify-start",disabled:ae.disabled,onClick:()=>Z(ae),children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]}),ae.badge&&(0,we.jsx)(dt,{variant:ae.badgeVariant||"secondary",className:"ml-auto",children:ae.badge})]})},ae.id)),(0,we.jsx)(Is,{className:"my-2"})]},se.id))})]})})]}),te=()=>{switch(N){case"sm":return"h-14";case"lg":return"h-20";default:return"h-16"}},xe=B("moonui-pro w-full transition-all duration-300",I==="default"&&"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",I==="floating"&&"mx-4 mt-4 rounded-lg border bg-background/95 backdrop-blur shadow-lg",I==="minimal"&&"bg-background",I==="transparent"&&"bg-transparent",v&&"sticky top-0 z-50",Le&&v&&I!=="transparent"&&"shadow-sm",Le&&I==="transparent"&&"bg-background/95 backdrop-blur border-b",Be&&"-translate-y-full",y&&"bg-background/80 backdrop-blur-xl border-white/10",M&&"backdrop-blur-md",A&&"shadow-lg",T&&"rounded-lg",S?.background,S?.border,U);return(0,we.jsxs)(we.Fragment,{children:[(0,we.jsxs)("nav",{ref:Q,className:xe,children:[(0,we.jsxs)("div",{className:B("flex items-center",te(),L?"w-full px-4 sm:px-6 lg:px-8":R==="sm"&&"container max-w-screen-sm"||R==="md"&&"container max-w-screen-md"||R==="lg"&&"container max-w-screen-lg"||R==="xl"&&"container max-w-screen-xl"||R==="2xl"&&"container max-w-screen-2xl"||R==="full"&&"w-full px-4 sm:px-6 lg:px-8"),children:[t&&(0,we.jsxs)("div",{className:B("flex items-center gap-2",O==="center"&&!H?"absolute left-1/2 -translate-x-1/2":"mr-4"),children:[O==="left"&&F==="left"&&(0,we.jsx)(Pe,{}),(0,we.jsxs)("a",{href:t.href||"/",onClick:se=>{t.href&&E&&(se.preventDefault(),E(t.href))},className:"flex items-center gap-2",children:[t.logo,t.title&&!H&&(0,we.jsx)("span",{className:"font-semibold text-lg",children:t.title})]})]}),!H&&!b&&(0,we.jsx)(FE,{className:"hidden md:flex",children:(0,we.jsx)(BE,{children:e.map(se=>(0,we.jsx)(Ki.default.Fragment,{children:se.items.map(ae=>{let _e=ae.items&&ae.items.length>0,Dt=ae.href===V;return _e?(0,we.jsxs)(VE,{children:[(0,we.jsx)(zE,{className:B(Dt&&"bg-accent text-accent-foreground",ae.disabled&&"opacity-50 cursor-not-allowed"),disabled:ae.disabled,children:(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]})}),(0,we.jsx)(HE,{children:ae.items&&ke(ae.items)})]},ae.id):(0,we.jsx)(VE,{children:(0,we.jsxs)(jE,{className:B(UE(),Dt&&"bg-accent text-accent-foreground",ae.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>!ae.disabled&&Z(ae),children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]}),ae.badge&&(0,we.jsx)(dt,{variant:ae.badgeVariant||"secondary",className:"ml-2",children:ae.badge})]})},ae.id)})},se.id))})}),(0,we.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[r&&(0,we.jsx)(we.Fragment,{children:H?(0,we.jsx)(re,{variant:"ghost",size:"icon",onClick:()=>Y(!0),children:(0,we.jsx)(co,{className:"h-5 w-5"})}):(0,we.jsxs)("div",{className:"relative",children:[(0,we.jsx)(co,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,we.jsx)(Jt,{type:"search",placeholder:c,className:"w-64 pl-9 pr-4 h-9 cursor-pointer",value:oe,onChange:se=>me(se.target.value),onClick:()=>{n&&(Y(!0),i?.())},readOnly:n}),(w||n)&&(0,we.jsx)("kbd",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 hidden sm:flex",children:n?o:(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)("span",{className:"text-xs",children:"\u2318"}),"K"]})})]})}),d&&(0,we.jsxs)(Nr,{children:[(0,we.jsx)(Mr,{asChild:!0,children:(0,we.jsxs)(re,{variant:"ghost",size:"icon",children:[f==="light"&&(0,we.jsx)(Lh,{className:"h-5 w-5"}),f==="dark"&&(0,we.jsx)(Th,{className:"h-5 w-5"}),f==="system"&&(0,we.jsx)(Jf,{className:"h-5 w-5"})]})}),(0,we.jsxs)(Sr,{align:"end",children:[(0,we.jsxs)(Ue,{onClick:()=>p?.("light"),children:[(0,we.jsx)(Lh,{className:"mr-2 h-4 w-4"}),"Light"]}),(0,we.jsxs)(Ue,{onClick:()=>p?.("dark"),children:[(0,we.jsx)(Th,{className:"mr-2 h-4 w-4"}),"Dark"]}),(0,we.jsxs)(Ue,{onClick:()=>p?.("system"),children:[(0,we.jsx)(Jf,{className:"mr-2 h-4 w-4"}),"System"]})]})]}),h&&(0,we.jsxs)(Nr,{children:[(0,we.jsx)(Mr,{asChild:!0,children:(0,we.jsxs)(re,{variant:"ghost",size:"icon",className:"relative",children:[(0,we.jsx)(mm,{className:"h-5 w-5"}),h.count&&h.count>0&&(0,we.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] rounded-full bg-red-500 text-[11px] font-medium text-white flex items-center justify-center px-1",children:h.count>9?"9+":h.count})]})}),(0,we.jsxs)(Sr,{align:"end",className:"w-[380px] p-0",sideOffset:8,children:[(0,we.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b",children:[(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[(0,we.jsx)("h4",{className:"text-base font-semibold",children:"Notifications"}),h.count&&h.count>0&&(0,we.jsxs)(dt,{variant:"secondary",className:"h-5 px-2 rounded-full bg-primary/10 text-primary border-0",children:[h.count," ","new"]})]}),h.items&&h.items.length>0&&(0,we.jsx)(re,{variant:"ghost",size:"sm",className:"text-xs h-7 px-2 text-muted-foreground hover:text-foreground",onClick:se=>{se.preventDefault(),console.log("Mark all as read")},children:"Mark all read"})]}),(0,we.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:h.items&&h.items.length>0?(0,we.jsx)("div",{className:"py-1",children:h.items.map((se,ae)=>(0,we.jsxs)("div",{children:[(0,we.jsx)("button",{className:B("w-full px-4 py-3 text-left hover:bg-muted/50 transition-colors","focus:outline-none focus:bg-muted/50",!se.read&&"bg-primary/5 hover:bg-primary/10"),onClick:()=>h.onNotificationClick?.(se.id),children:(0,we.jsxs)("div",{className:"flex gap-3",children:[(0,we.jsx)("div",{className:"mt-1.5",children:(0,we.jsx)("div",{className:B("h-2 w-2 rounded-full",se.read?"bg-transparent":"bg-primary")})}),(0,we.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,we.jsx)("p",{className:B("text-sm leading-tight",se.read?"font-normal":"font-medium"),children:se.title}),se.description&&(0,we.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:se.description}),se.time&&(0,we.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-1",children:se.time})]})]})}),ae<(h.items?.length||0)-1&&(0,we.jsx)("div",{className:"mx-4 border-b"})]},se.id))}):(0,we.jsxs)("div",{className:"py-12 text-center",children:[(0,we.jsx)(mm,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),(0,we.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"No new notifications"}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"You're all caught up!"})]})}),h.items&&h.items.length>0&&(0,we.jsx)("div",{className:"border-t p-2",children:(0,we.jsx)(re,{variant:"ghost",className:"w-full h-8 text-xs text-muted-foreground hover:text-foreground",onClick:se=>{se.preventDefault(),console.log("View all notifications")},children:"View all notifications"})})]})]}),g&&(0,we.jsx)(re,{variant:g.variant||"primary",size:"sm",onClick:()=>{g.action?g.action():g.href&&E&&E(g.href)},className:H?"":"ml-2",children:g.text}),m&&(0,we.jsxs)(Nr,{children:[(0,we.jsx)(Mr,{asChild:!0,children:(0,we.jsx)(re,{variant:"ghost",size:"icon",className:"relative",children:(0,we.jsxs)(Da,{className:"h-8 w-8",children:[(0,we.jsx)(Oi,{src:m.user?.avatar,alt:m.user?.name}),(0,we.jsx)(ti,{children:m.user?.name?.charAt(0)||(0,we.jsx)(rp,{className:"h-4 w-4"})})]})})}),(0,we.jsxs)(Sr,{align:"end",className:"w-56",children:[m.user&&(0,we.jsxs)(we.Fragment,{children:[(0,we.jsxs)("div",{className:"p-2",children:[(0,we.jsx)("p",{className:"text-sm font-medium",children:m.user.name}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground",children:m.user.email})]}),(0,we.jsx)(Kr,{})]}),m.items&&fe(m.items)]})]})]})]}),x&&(0,we.jsx)(ne.div,{className:"absolute inset-0 -z-10 opacity-30",animate:{background:["radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%)","radial-gradient(circle at 80% 50%, rgba(120, 119, 198, 0.3), transparent 50%)","radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%)"]},transition:{duration:10,repeat:1/0,ease:"linear"}}),k&&(0,we.jsx)("div",{className:"absolute bottom-0 left-0 w-full h-0.5 bg-muted",children:(0,we.jsx)("div",{className:"h-full bg-primary transition-all duration-150",style:{width:`${Re}%`}})})]}),(0,we.jsxs)(dE,{open:X,onOpenChange:se=>{Y(se),se||s?.()},children:[(0,we.jsx)(Jh,{placeholder:n?a:c,value:oe,onValueChange:me}),(0,we.jsxs)(QI,{children:[(0,we.jsx)(eg,{children:n?(0,we.jsxs)("div",{className:"flex flex-col items-center py-6",children:[(0,we.jsx)(bt,{className:"h-8 w-8 text-muted-foreground mb-2"}),(0,we.jsx)("p",{className:"text-sm text-muted-foreground",children:"No results found"}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Try searching for pages, actions, or commands"})]}):"No results found."}),n&&!oe&&(0,we.jsxs)(pp,{heading:"Quick Actions",children:[(0,we.jsxs)(nd,{onSelect:()=>{let se={id:"home",title:"Go Home",href:"/"};l?.(se),Z(se),Y(!1)},children:[(0,we.jsx)(jx,{className:"mr-2 h-4 w-4"}),"Go Home",(0,we.jsx)("kbd",{className:"ml-auto text-xs",children:"\u2318H"})]}),(0,we.jsxs)(nd,{onSelect:()=>{G(!0),Y(!1),l?.({id:"search",title:"Search",action:()=>G(!0)})},children:[(0,we.jsx)(co,{className:"mr-2 h-4 w-4"}),"Search",(0,we.jsx)("kbd",{className:"ml-auto text-xs",children:"\u2318S"})]}),d&&(0,we.jsxs)(nd,{onSelect:()=>{p?.(f==="dark"?"light":"dark"),Y(!1)},children:[f==="dark"?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(Lh,{className:"mr-2 h-4 w-4"}),"Switch to Light Mode"]}):(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(Th,{className:"mr-2 h-4 w-4"}),"Switch to Dark Mode"]}),(0,we.jsx)("kbd",{className:"ml-auto text-xs",children:"\u2318T"})]})]}),e&&e.length>0&&e.map(se=>{if(!se||!se.items||se.items.length===0)return null;let ae=oe?se.items.filter(_e=>_e.title.toLowerCase().includes(oe.toLowerCase())||_e.description?.toLowerCase().includes(oe.toLowerCase())):se.items;return ae.length===0?null:(0,we.jsx)(pp,{heading:se.title||se.id,children:ae.map(_e=>(0,we.jsxs)(nd,{disabled:_e.disabled,onSelect:()=>{n&&l?.(_e),Z(_e),Y(!1)},children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[_e.icon&&(0,we.jsx)("span",{children:_e.icon}),_e.title]}),_e.badge&&(0,we.jsx)(dt,{variant:_e.badgeVariant||"secondary",className:"ml-auto",children:_e.badge}),_e.description&&n&&(0,we.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:_e.description})]},_e.id))},se.id)}),n&&m?.items&&(0,we.jsx)(pp,{heading:"Account",children:m.items.map(se=>(0,we.jsx)(nd,{disabled:se.disabled,onSelect:()=>{let ae={...se,action:se.onClick||se.action};ae.action?ae.action():ae.href&&(window.location.href=ae.href),l?.(ae),Y(!1)},children:(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[se.icon&&(0,we.jsx)("span",{children:se.icon}),se.title]})},se.id))})]})]})]})}function zKe(e){let{hasProAccess:t,isLoading:r}=Yt();return!r&&!t?(0,we.jsx)(Ve,{className:B("w-full",e.className),children:(0,we.jsx)(ze,{className:"py-8 text-center",children:(0,we.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,we.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,we.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,we.jsxs)("div",{children:[(0,we.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,we.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Advanced Navbar is available exclusively to MoonUI Pro subscribers."}),(0,we.jsx)("a",{href:"/pricing",children:(0,we.jsxs)(re,{size:"sm",children:[(0,we.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,we.jsx)(UZt,{...e})}var zZt=zKe;var Hle=D(ce(),1);var ui=D(ce(),1),$Ke=D(de(),1),HKe=(0,ui.createContext)(null),z0=()=>{let e=(0,ui.useContext)(HKe);if(!e)throw new Error("useFormWizard must be used within a FormWizardProvider");return e},jKe=({children:e,steps:t,initialStep:r=0,onStepChange:n,onComplete:o,validateOnStepChange:a=!0,allowBackNavigation:i=!0,allowStepSkip:s=!1,autoSave:l=!1,autoSaveDelay:c=2e3,onAutoSave:u,persistData:d=!1,storageKey:f="form-wizard-data"})=>{let[p,m]=(0,ui.useState)(r),[h,g]=(0,ui.useState)({}),[v,y]=(0,ui.useState)(new Set),[x,w]=(0,ui.useState)(!1),[b,C]=(0,ui.useState)(null);(0,ui.useEffect)(()=>{if(d&&typeof window<"u"){let R=localStorage.getItem(f);if(R)try{let L=JSON.parse(R);g(L.stepData||{}),m(L.currentStep||0),y(new Set(L.completedSteps||[]))}catch(L){console.error("Failed to load persisted wizard data:",L)}}},[d,f]),(0,ui.useEffect)(()=>{if(!l||!u)return;let R=setTimeout(()=>{let L=h[t[p].id];L&&u(t[p].id,L)},c);return()=>clearTimeout(R)},[h,p,l,c,u,t]),(0,ui.useEffect)(()=>{if(d&&typeof window<"u"){let R={stepData:h,currentStep:p,completedSteps:Array.from(v)};localStorage.setItem(f,JSON.stringify(R))}},[h,p,v,d,f]);let S=(0,ui.useCallback)(async()=>{let R=t[p];if(R.requiredFields!==!1&&typeof window<"u"){let _=document.querySelector("[data-wizard-step-content]");if(_)if(Array.isArray(R.requiredFields)){let U=[];if(R.requiredFields.forEach(V=>{let E=_.querySelector(`[name="${V}"], [id="${V}"]`);if(E){let H=E;E.tagName==="INPUT"&&E.type==="checkbox"?E.checked||U.push(V):(!H.value||H.value.trim()==="")&&U.push(V)}}),U.length>0)return C(`Please fill in the following required fields: ${U.join(", ")}`),!1}else{let U=_.querySelectorAll("input[required], select[required], textarea[required]"),V=[];if(U.forEach(H=>{let j=H;if(!j.value||j.value.trim()===""){let $=document.querySelector(`label[for="${j.id}"]`),W=$?$.textContent?.replace(" *","")||"Field":j.name||j.id||"Field";V.push(W)}}),_.querySelectorAll('input[type="checkbox"][required]').forEach(H=>{let j=H;if(!j.checked){let $=document.querySelector(`label[for="${j.id}"]`),W=$?$.textContent?.replace(" *","")||"Checkbox":j.name||j.id||"Checkbox";V.push(W)}}),V.length>0)return C(`Please fill in the following required fields: ${V.join(", ")}`),!1}}if(!R.validation)return!0;w(!0),C(null);try{let _=await R.validation();if(typeof _=="boolean")return _||C("Please complete all required fields before proceeding"),_;if(typeof _=="object"&&_!==null&&"isValid"in _){let U=_;return U.isValid||(U.error?C(U.error):U.errors&&Array.isArray(U.errors)?C(U.errors.join(", ")):C("Please complete all required fields before proceeding")),U.isValid}return C("Invalid validation response"),!1}catch(_){return C(_ instanceof Error?_.message:"Validation failed"),!1}finally{w(!1)}},[p,t]),I=(0,ui.useCallback)((R,L)=>{g(_=>({..._,[R]:{..._[R],...L}})),C(null)},[]),N=(0,ui.useCallback)(async R=>{if(R<0||R>=t.length||R===p)return;let L=t[R];if((typeof L.isDisabled=="function"?L.isDisabled(p,t):L.isDisabled)||a&&R>p&&!await S())return;let U=t[p];U.onExit&&await U.onExit(),R>p&&y(E=>new Set([...E,p])),L.onEnter&&await L.onEnter();let V=p;m(R),n?.(R,V)},[p,t,a,S,n]),M=(0,ui.useCallback)(()=>{N(p+1)},[p,N]),A=(0,ui.useCallback)(()=>{i&&N(p-1)},[p,N,i]),T=(0,ui.useCallback)(async()=>{if(await S()&&(y(L=>new Set([...L,p])),o)){w(!0);try{await o(h),d&&typeof window<"u"&&localStorage.removeItem(f)}catch(L){C(L instanceof Error?L.message:"Failed to complete wizard")}finally{w(!1)}}},[p,h,S,o,d,f]),O=(0,ui.useCallback)(()=>{m(0),g({}),y(new Set),C(null),d&&typeof window<"u"&&localStorage.removeItem(f)},[d,f]),F=(0,ui.useCallback)(R=>v.has(R),[v]),P=(0,ui.useCallback)(R=>{if(R===0||s)return!0;for(let L=0;L<R;L++)if(!v.has(L)&&!t[L].isOptional)return!1;return!0},[v,s,t]),k={steps:t,currentStep:p,stepData:h,isLoading:x,error:b,goToNext:M,goToPrevious:A,goToStep:N,updateStepData:R=>I(t[p].id,R),validateCurrentStep:S,completeWizard:T,resetWizard:O,isStepCompleted:F,isStepAccessible:P,canGoNext:p<t.length-1,canGoPrevious:i&&p>0};return(0,$Ke.jsx)(HKe.Provider,{value:k,children:e})};var wr=D(de(),1),bW=({className:e,progressType:t="linear",orientation:r="horizontal",showStepNumbers:n=!0,showStepTitles:o=!0,stepIconPosition:a="top",completedStepIcon:i=(0,wr.jsx)(Bo,{className:"w-5 h-5"}),activeStepIcon:s,errorStepIcon:l=(0,wr.jsx)(lo,{className:"w-5 h-5"})})=>{let{steps:c,currentStep:u,isStepCompleted:d,isStepAccessible:f,error:p}=z0();if(t==="linear")return(0,wr.jsx)("div",{className:B("relative w-full",r==="vertical"?"flex flex-col space-y-8":"",e),children:r==="horizontal"?(0,wr.jsx)("div",{className:"relative w-full",children:(0,wr.jsx)("div",{className:B("relative flex items-start justify-between w-full",a==="left"&&"pl-14"),children:c.map((m,h)=>{let g=h===u,v=d(h),y=f(h),x=g&&p,w=typeof m.icon=="function"?m.icon({isActive:g,isCompleted:v}):m.icon;return(0,wr.jsxs)("div",{className:"relative flex-1 flex flex-col items-center",children:[a==="left"&&w&&(0,wr.jsx)("div",{className:"absolute -left-12 top-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,wr.jsx)("span",{className:B("w-8 h-8 flex items-center justify-center transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:w})}),a==="top"&&w&&(0,wr.jsx)("div",{className:"flex items-center justify-center mb-2",children:(0,wr.jsx)("span",{className:B("w-8 h-8 flex items-center justify-center transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:w})}),o&&(0,wr.jsxs)("div",{className:"text-center mb-3 min-h-[40px] px-2",children:[(0,wr.jsx)("p",{className:B("text-sm font-semibold transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:m.title}),m.description&&(0,wr.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:m.description})]}),(0,wr.jsxs)("div",{className:"relative flex items-center w-full",children:[h<c.length-1&&(0,wr.jsxs)("div",{className:"absolute left-1/2 w-full h-[2px]",style:{width:"calc(100% + 24px)",marginLeft:"24px"},children:[(0,wr.jsx)("div",{className:"h-full bg-border"}),h<u&&(0,wr.jsx)(ne.div,{className:"absolute inset-0 bg-primary",initial:{scaleX:0},animate:{scaleX:1},transition:{duration:.5,delay:h*.1},style:{transformOrigin:"left"}})]}),(0,wr.jsx)(ne.div,{initial:{scale:.8},animate:{scale:g?1.05:1},transition:{duration:.2},className:B("relative z-10 flex items-center justify-center rounded-full transition-all duration-300 mx-auto","w-12 h-12 border-2",g&&"border-primary bg-primary text-primary-foreground shadow-lg shadow-primary/20",v&&!g&&"border-primary bg-primary text-primary-foreground",!g&&!v&&y&&"border-border bg-background text-muted-foreground hover:border-accent",!y&&"border-border/50 bg-muted text-muted-foreground/50 cursor-not-allowed",x&&"border-destructive bg-destructive text-destructive-foreground"),children:x?l:v&&!g?i:g&&s?s:w&&a==="inside"?(0,wr.jsx)("span",{className:"w-5 h-5 flex items-center justify-center",children:w}):n?(0,wr.jsx)("span",{className:"text-sm font-semibold",children:h+1}):(0,wr.jsx)(Kf,{className:"w-4 h-4"})})]}),(0,wr.jsx)("div",{className:"mt-3",children:(0,wr.jsxs)("p",{className:"text-xs text-muted-foreground font-medium",children:["Step ",h+1," of ",c.length]})})]},m.id)})})}):(0,wr.jsxs)("div",{className:"relative pl-12",children:[c.length>1&&(0,wr.jsxs)(wr.Fragment,{children:[(0,wr.jsx)("div",{className:"absolute left-6 top-8 bottom-8 w-[2px] bg-border"}),(0,wr.jsx)(ne.div,{className:"absolute left-6 top-8 w-[2px] bg-primary",initial:{height:0},animate:{height:`${u/(c.length-1)*(100-16)}%`},transition:{duration:.5}})]}),c.map((m,h)=>{let g=h===u,v=d(h),y=f(h),x=g&&p,w=typeof m.icon=="function"?m.icon({isActive:g,isCompleted:v}):m.icon;return(0,wr.jsxs)("div",{className:"relative flex items-center mb-8 last:mb-0",children:[(0,wr.jsx)(ne.div,{initial:{scale:.8},animate:{scale:g?1.05:1},className:B("absolute left-0 z-20 flex items-center justify-center rounded-full border-2 transition-all duration-300","w-12 h-12",g&&"border-primary bg-primary text-primary-foreground shadow-lg",v&&!g&&"border-primary bg-primary text-primary-foreground",!g&&!v&&y&&"border-border bg-background text-muted-foreground hover:border-accent",!y&&"border-border/50 bg-muted text-muted-foreground/50 cursor-not-allowed",x&&"border-destructive bg-destructive text-destructive-foreground"),children:x?l:v&&!g?i:g&&s?s:w?(0,wr.jsx)("span",{className:"w-5 h-5 flex items-center justify-center",children:w}):n?(0,wr.jsx)("span",{className:"text-sm font-semibold",children:h+1}):(0,wr.jsx)(Kf,{className:"w-4 h-4"})}),(0,wr.jsx)("div",{className:"ml-16",children:o&&(0,wr.jsxs)(wr.Fragment,{children:[(0,wr.jsx)("p",{className:B("text-sm font-semibold transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:m.title}),m.description&&(0,wr.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:m.description})]})})]},m.id)})]})});if(t==="dots")return(0,wr.jsx)("div",{className:B("flex items-center justify-center space-x-2",e),children:c.map((m,h)=>{let g=h===u,v=d(h);return(0,wr.jsx)(ne.div,{initial:{scale:.8},animate:{scale:g?1.2:1},className:B("rounded-full transition-all duration-300",g?"w-3 h-3 bg-primary":"w-2 h-2",v&&!g&&"bg-primary/60",!g&&!v&&"bg-muted")},h)})});if(t==="circular"){let m=(u+1)/c.length*100,h=2*Math.PI*45,g=h-m/100*h;return(0,wr.jsxs)("div",{className:B("relative w-36 h-36 mx-auto",e),children:[(0,wr.jsxs)("svg",{className:"w-full h-full -rotate-90",viewBox:"0 0 144 144",children:[(0,wr.jsx)("circle",{cx:"72",cy:"72",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",className:"text-border"}),(0,wr.jsx)(ne.circle,{cx:"72",cy:"72",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",strokeDasharray:h,initial:{strokeDashoffset:h},animate:{strokeDashoffset:g},className:"text-primary",transition:{duration:.5}})]}),(0,wr.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,wr.jsxs)("div",{className:"text-center",children:[(0,wr.jsx)("p",{className:"text-3xl font-bold",children:u+1}),(0,wr.jsxs)("p",{className:"text-sm text-muted-foreground",children:["of ",c.length]})]})})]})}return null};var wW=D(ce(),1);var H0=D(de(),1),HZt={slide:{initial:e=>({x:e>0?1e3:-1e3,opacity:0}),animate:{x:0,opacity:1},exit:e=>({x:e<0?1e3:-1e3,opacity:0})},fade:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},scale:{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}},none:{initial:{},animate:{},exit:{}}},CW=({className:e,animationType:t="slide",animationDuration:r=.3})=>{let{steps:n,currentStep:o,goToNext:a,goToPrevious:i,goToStep:s,updateStepData:l,stepData:c,error:u}=z0(),[d,f]=wW.default.useState(0),p=wW.default.useRef(o);wW.default.useEffect(()=>{f(o>p.current?1:-1),p.current=o},[o]);let m=n[o],h=o===0,g=o===n.length-1,v={currentStep:o,totalSteps:n.length,goToNext:a,goToPrevious:i,goToStep:s,isFirstStep:h,isLastStep:g,stepData:c[m.id]||{},updateStepData:x=>l(m.id,x)},y=typeof m.content=="function"?m.content(v):m.content;return(0,H0.jsx)(_t,{mode:"wait",custom:d,children:(0,H0.jsx)(ne.div,{custom:d,variants:HZt[t],initial:"initial",animate:"animate",exit:"exit",transition:{duration:r,ease:"easeInOut"},className:B("w-full",e),"data-wizard-step-content":!0,children:(0,H0.jsxs)("div",{className:"space-y-4",children:[u&&(0,H0.jsxs)(Yx,{variant:"error",children:[(0,H0.jsx)(Mn,{className:"h-4 w-4"}),(0,H0.jsx)(Qx,{children:u})]}),y]})},o)})};var sl=D(de(),1),SW=({className:e,showStepIndicator:t=!0,previousText:r="Previous",nextText:n="Next",completeText:o="Complete",loadingText:a="Processing...",onPreviousClick:i,onNextClick:s,onCompleteClick:l})=>{let{steps:c,currentStep:u,isLoading:d,canGoNext:f,canGoPrevious:p,goToNext:m,goToPrevious:h,completeWizard:g}=z0(),v=u===c.length-1,y=c[u],x=()=>{i?.(),h()},w=()=>{v?(l?.(),g()):(s?.(),m())};return(0,sl.jsxs)("div",{className:B("flex items-center justify-between",e),children:[(0,sl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,sl.jsxs)(re,{type:"button",variant:"outline",onClick:x,disabled:!p||d,className:B("transition-all duration-200",!p&&"invisible"),children:[(0,sl.jsx)(ga,{className:"w-4 h-4 mr-1"}),r]}),t&&(0,sl.jsxs)(ne.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"px-3 py-1 text-sm text-muted-foreground",children:["Step ",u+1," of ",c.length,y.isOptional&&(0,sl.jsx)("span",{className:"ml-1 text-xs",children:"(Optional)"})]})]}),(0,sl.jsx)(re,{type:"button",onClick:w,disabled:d||!f&&!v,className:"min-w-[120px]",children:d?(0,sl.jsxs)(sl.Fragment,{children:[(0,sl.jsx)(Rr,{className:"w-4 h-4 mr-2 animate-spin"}),a]}):v?(0,sl.jsxs)(sl.Fragment,{children:[(0,sl.jsx)(en,{className:"w-4 h-4 mr-2"}),o]}):(0,sl.jsxs)(sl.Fragment,{children:[n,(0,sl.jsx)(Kn,{className:"w-4 h-4 ml-1"})]})})]})};var di=D(de(),1),qKe=Hle.default.forwardRef(({steps:e,currentStep:t=0,onStepChange:r,onComplete:n,orientation:o="horizontal",progressType:a="linear",allowStepSkip:i=!1,allowBackNavigation:s=!0,validateOnStepChange:l=!0,animationType:c="slide",animationDuration:u=.3,showStepNumbers:d=!0,showStepTitles:f=!0,showProgressBar:p=!0,stepIconPosition:m="top",completedStepIcon:h,activeStepIcon:g,errorStepIcon:v,className:y,progressClassName:x,navigationClassName:w,contentClassName:b,stepClassName:C,autoSave:S=!1,autoSaveDelay:I=2e3,onAutoSave:N,persistData:M=!1,storageKey:A="form-wizard-data"},T)=>(0,di.jsx)(jKe,{steps:e,initialStep:t,onStepChange:r,onComplete:n,validateOnStepChange:l,allowBackNavigation:s,allowStepSkip:i,autoSave:S,autoSaveDelay:I,onAutoSave:N,persistData:M,storageKey:A,children:(0,di.jsxs)("div",{ref:T,className:B("w-full",y),children:[p&&(0,di.jsx)(di.Fragment,{children:(0,di.jsx)(bW,{className:B("mb-12",x),progressType:a,orientation:o,showStepNumbers:d,showStepTitles:f,stepIconPosition:m,completedStepIcon:h,activeStepIcon:g,errorStepIcon:v})}),(0,di.jsx)(Ve,{className:B("border-0 shadow-none",b),children:(0,di.jsx)(ze,{className:"p-0",children:(0,di.jsx)(CW,{className:C,animationType:c,animationDuration:u})})}),(0,di.jsx)(SW,{className:B("mt-8",w)})]})}));qKe.displayName="FormWizardInternal";var o_=Hle.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Yt();return!n&&!r?(0,di.jsx)(Ve,{className:B("w-full",e.className),children:(0,di.jsx)(ze,{className:"py-12 text-center",children:(0,di.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,di.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,di.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,di.jsxs)("div",{children:[(0,di.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,di.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Form Wizard is available exclusively to MoonUI Pro subscribers."}),(0,di.jsx)("a",{href:"/pricing",children:(0,di.jsxs)(re,{size:"sm",children:[(0,di.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,di.jsx)(qKe,{...e,ref:t})});o_.displayName="MoonUIFormWizardPro";var jZt=o_;var Pd=D(ce(),1);var St=D(de(),1);function WKe(e){let t=[...e];for(let r=t.length-1;r>0;r--){let n=Math.floor(Math.random()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t}var $Zt=({title:e,description:t,questions:r,onComplete:n,showTimer:o=!0,totalTimeLimit:a,showProgress:i=!0,showQuestionNumbers:s=!0,allowReview:l=!0,allowSkip:c=!0,shuffleQuestions:u=!1,shuffleOptions:d=!1,passingScore:f=70,instantFeedback:p=!1,showHints:m=!1,className:h})=>{let[g]=(0,Pd.useState)(()=>u?WKe(r):r),[v,y]=(0,Pd.useState)({}),[x,w]=(0,Pd.useState)([]),[b,C]=(0,Pd.useState)(a||0),[S,I]=(0,Pd.useState)({}),[N,M]=(0,Pd.useState)(!1),[A,T]=(0,Pd.useState)(0);(0,Pd.useEffect)(()=>{if(!o||!a||N)return;let R=setInterval(()=>{C(L=>L<=1?(F(),0):L-1)},1e3);return()=>clearInterval(R)},[o,a,N]),(0,Pd.useEffect)(()=>{if(!o||N)return;let R=setInterval(()=>{T(L=>L+1)},1e3);return()=>clearInterval(R)},[o,N]);let O=(0,Pd.useCallback)(()=>{let R=0,L=0;return{results:g.map(U=>{let V=v[U.id],E=U.points||1;L+=E;let H=!1;if(V!=null&&V!==""){if(U.type==="single-choice"||U.type==="true-false")H=V===U.correctAnswer;else if(U.type==="multiple-choice"){let $=Array.isArray(V)?V:[],W=Array.isArray(U.correctAnswer)?U.correctAnswer:[];H=$.length===W.length&&$.every(z=>W.includes(z))}}let j=H?E:0;return R+=j,{questionId:U.id,answer:V,isCorrect:H,points:j,timeSpent:S[U.id]||0}}),score:R,totalScore:L}},[g,v,S]),F=async()=>{let{results:R,score:L,totalScore:_}=O();w(R),M(!0),n&&await n(R,L,_)},P=R=>{let L=Math.floor(R/60),_=R%60;return`${L}:${_.toString().padStart(2,"0")}`},k=g.map((R,L)=>({id:R.id,title:`Question ${L+1}`,description:R.tags?.join(", "),content:({updateStepData:_,goToNext:U})=>{let V=v[R.id],E=d&&R.options?WKe(R.options):R.options;(0,Pd.useEffect)(()=>{S[R.id]||I(j=>({...j,[R.id]:A}))},[]);let H=j=>{y($=>({...$,[R.id]:j})),p&&R.type};return(0,St.jsxs)(Ve,{className:"border-0 shadow-none",children:[(0,St.jsxs)(vr,{children:[(0,St.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[s&&(0,St.jsxs)(dt,{variant:"secondary",children:["Question ",L+1," of ",g.length]}),R.points&&R.points>1&&(0,St.jsxs)(dt,{variant:"outline",children:[R.points," points"]})]}),(0,St.jsx)(Or,{className:"text-xl",children:R.question}),R.description&&(0,St.jsx)(es,{children:R.description})]}),(0,St.jsxs)(ze,{className:"space-y-4",children:[R.image&&(0,St.jsx)("img",{src:R.image,alt:"Question illustration",className:"w-full rounded-lg"}),R.type==="single-choice"&&E&&(0,St.jsx)(AC,{value:V||"",onValueChange:H,children:E.map((j,$)=>(0,St.jsxs)(ne.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:$*.1},className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,St.jsx)(ty,{value:String(j.value),id:`${R.id}-${j.value}`}),(0,St.jsx)(It,{htmlFor:`${R.id}-${j.value}`,className:"flex-1 cursor-pointer",children:j.label||j.value})]},String(j.value)))}),R.type==="multiple-choice"&&E&&(0,St.jsx)("div",{className:"space-y-2",children:E.map((j,$)=>(0,St.jsxs)(ne.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:$*.1},className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,St.jsx)(ql,{id:`${R.id}-${j.value}`,checked:(V||[]).includes(j.value),onCheckedChange:W=>{let z=V||[];H(W?[...z,j.value]:z.filter(G=>G!==j.value))}}),(0,St.jsx)(It,{htmlFor:`${R.id}-${j.value}`,className:"flex-1 cursor-pointer",children:j.label||j.value})]},String(j.value)))}),R.type==="true-false"&&(0,St.jsxs)(AC,{value:V?.toString()||"",onValueChange:j=>H(j==="true"),children:[(0,St.jsxs)("div",{className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50",children:[(0,St.jsx)(ty,{value:"true",id:`${R.id}-true`}),(0,St.jsx)(It,{htmlFor:`${R.id}-true`,className:"flex-1 cursor-pointer",children:"True"})]}),(0,St.jsxs)("div",{className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50",children:[(0,St.jsx)(ty,{value:"false",id:`${R.id}-false`}),(0,St.jsx)(It,{htmlFor:`${R.id}-false`,className:"flex-1 cursor-pointer",children:"False"})]})]}),R.type==="text"&&(0,St.jsx)(mu,{value:V||"",onChange:j=>H(j.target.value),placeholder:"Type your answer here...",className:"min-h-[120px]"}),R.type==="rating"&&(0,St.jsxs)("div",{className:"space-y-4",children:[(0,St.jsx)(jb,{value:[V||5],onValueChange:([j])=>H(j),max:10,min:1,step:1,className:"w-full"}),(0,St.jsxs)("div",{className:"text-center text-2xl font-bold",children:[V||5,"/10"]})]}),m&&R.hint&&(0,St.jsx)(Yx,{children:(0,St.jsxs)(Qx,{children:[(0,St.jsx)("strong",{children:"Hint:"})," ",R.hint]})})]})]})},validation:()=>!(R.required&&!v[R.id]),isOptional:!R.required}));if(N){let{score:R,totalScore:L}=O(),_=Math.round(R/L*100),U=_>=f;return(0,St.jsx)(ne.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:B("w-full max-w-2xl mx-auto",h),children:(0,St.jsxs)(Ve,{children:[(0,St.jsxs)(vr,{className:"text-center",children:[(0,St.jsx)("div",{className:"mx-auto mb-4",children:(0,St.jsx)(aL,{className:B("w-16 h-16",U?"text-yellow-500":"text-muted-foreground")})}),(0,St.jsx)(Or,{className:"text-3xl",children:"Quiz Complete!"}),(0,St.jsx)(es,{children:"Here's how you performed"})]}),(0,St.jsxs)(ze,{className:"space-y-6",children:[(0,St.jsxs)("div",{className:"text-center",children:[(0,St.jsxs)("div",{className:"text-5xl font-bold mb-2",children:[_,"%"]}),(0,St.jsx)(To,{value:_,className:"h-3 mb-4"}),(0,St.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,St.jsxs)("span",{children:["Score: ",R,"/",L]}),(0,St.jsx)("span",{children:U?(0,St.jsx)(dt,{variant:"success",children:"Passed"}):(0,St.jsx)(dt,{variant:"destructive",children:"Failed"})})]})]}),l&&(0,St.jsxs)("div",{className:"space-y-2",children:[(0,St.jsx)("h3",{className:"font-semibold",children:"Review Answers"}),x.map((V,E)=>{let H=g.find(j=>j.id===V.questionId);return(0,St.jsxs)("div",{className:"flex items-center justify-between p-2 rounded-lg bg-muted/50",children:[(0,St.jsxs)("span",{className:"text-sm",children:[s&&`Q${E+1}: `,H?.question.substring(0,50),"..."]}),(0,St.jsxs)(dt,{variant:V.isCorrect?"success":"destructive",children:[V.points,"/",H?.points||1]})]},V.questionId)})]}),(0,St.jsxs)("div",{className:"flex gap-2",children:[(0,St.jsxs)(re,{className:"flex-1",onClick:()=>window.location.reload(),children:[(0,St.jsx)(Mv,{className:"w-4 h-4 mr-2"}),"Retake Quiz"]}),(0,St.jsxs)(re,{variant:"outline",children:[(0,St.jsx)(xn,{className:"w-4 h-4 mr-2"}),"Download Results"]}),(0,St.jsxs)(re,{variant:"outline",children:[(0,St.jsx)(Tv,{className:"w-4 h-4 mr-2"}),"Share"]})]})]})]})})}return(0,St.jsxs)("div",{className:B("w-full",h),children:[o&&a&&(0,St.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,St.jsxs)("div",{className:"flex items-center gap-2",children:[(0,St.jsx)(yn,{className:"w-4 h-4"}),(0,St.jsxs)("span",{className:"text-sm font-medium",children:["Time Remaining: ",P(b)]})]}),(0,St.jsx)(To,{value:b/a*100,className:"w-32 h-2"})]}),(0,St.jsx)(o_,{steps:k,onComplete:F,allowStepSkip:c,validateOnStepChange:!0,showProgressBar:i,progressType:"dots",animationType:"slide"})]})},qZt=e=>{let{hasProAccess:t,isLoading:r}=Yt();return!r&&!t?(0,St.jsx)(Ve,{className:B("w-full",e.className),children:(0,St.jsx)(ze,{className:"py-12 text-center",children:(0,St.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,St.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,St.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,St.jsxs)("div",{children:[(0,St.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,St.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Quiz Form is available exclusively to MoonUI Pro subscribers."}),(0,St.jsx)("a",{href:"/pricing",children:(0,St.jsxs)(re,{size:"sm",children:[(0,St.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,St.jsx)($Zt,{...e})},WZt=qZt;var Id=D(ce(),1);var Gr=D(de(),1),GZt={visa:/^4/,mastercard:/^5[1-5]/,amex:/^3[47]/,discover:/^6(?:011|5)/,diners:/^3(?:0[0-5]|[68])/,jcb:/^35/,unionpay:/^62/};function KZt(e,t){let r=e.replace(/\s+/g,"").replace(/[^0-9]/gi,""),n=t==="amex"?r.match(/\d{1,4}/g):r.match(/\d{1,4}/g);return n?n.join(" "):r}function XZt(e){let t=e.replace(/\s+/g,"").replace(/[^0-9]/gi,"");return t.length>=2?t.slice(0,2)+(t.length>2?"/"+t.slice(2,4):""):t}function YZt(e){let t=e.replace(/\s+/g,"");for(let[r,n]of Object.entries(GZt))if(n.test(t))return r;return null}function QZt(e){let t=e.replace(/\s+/g,"");if(!/^\d+$/.test(t))return!1;let r=0,n=!1;for(let o=t.length-1;o>=0;o--){let a=parseInt(t.charAt(o),10);n&&(a*=2,a>9&&(a-=9)),r+=a,n=!n}return r%10===0}function ZZt(e){let t=e.split("/");if(t.length!==2)return!1;let r=parseInt(t[0],10),n=parseInt("20"+t[1],10);if(r<1||r>12)return!1;let o=new Date;return new Date(n,r-1)>o}var GKe=Id.default.forwardRef(({value:e={number:"",expiry:"",cvc:"",name:""},onChange:t,showCardPreview:r=!0,showCardType:n=!0,showSecurityBadge:o=!0,autoFormat:a=!0,validateOnChange:i=!1,labels:s={},placeholders:l={},errors:c={},className:u,inputClassName:d,labelClassName:f,errorClassName:p,disabled:m,required:h,...g},v)=>{let[y,x]=(0,Id.useState)(null),[w,b]=(0,Id.useState)(null),[C,S]=(0,Id.useState)({}),I=(0,Id.useRef)(null),N=(0,Id.useRef)(null),M=(0,Id.useRef)(null),A=(0,Id.useRef)(null);(0,Id.useEffect)(()=>{let F=YZt(e.number);x(F)},[e.number]),(0,Id.useEffect)(()=>{if(!i)return;let F={};e.number&&!QZt(e.number)&&(F.number="Invalid card number"),e.expiry&&!ZZt(e.expiry)&&(F.expiry="Invalid expiry date"),e.cvc&&(e.cvc.length<3||e.cvc.length>4)&&(F.cvc="Invalid CVC"),S(F)},[e,i]);let T=(F,P)=>{let k=P;if(a){if(F==="number"){k=KZt(P,y||void 0);let R=y==="amex"?18:19;if(k.length>R)return}else if(F==="expiry"){if(k=XZt(P),k.length>5)return}else if(F==="cvc"){k=P.replace(/\D/g,"");let R=y==="amex"?4:3;if(k.length>R)return}}t?.({...e,[F]:k}),a&&(F==="number"&&k.length===(y==="amex"?18:19)?N.current?.focus():F==="expiry"&&k.length===5?M.current?.focus():F==="cvc"&&k.length===(y==="amex"?4:3)&&A.current?.focus())},O={...C,...c};return(0,Gr.jsxs)("div",{ref:v,className:B("space-y-4",u),...g,children:[r&&(0,Gr.jsxs)(ne.div,{className:"relative w-full max-w-md mx-auto h-48 rounded-xl bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700 p-6 text-white shadow-xl overflow-hidden",initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},children:[(0,Gr.jsxs)("div",{className:"flex justify-between items-start mb-8",children:[(0,Gr.jsx)("div",{className:"text-lg font-semibold",children:y?y.toUpperCase():"CARD"}),(0,Gr.jsx)(Sv,{className:"w-8 h-8 text-white/80"})]}),(0,Gr.jsxs)("div",{className:"space-y-4",children:[(0,Gr.jsx)("div",{className:"text-xl font-mono tracking-wider",children:e.number||"\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022"}),(0,Gr.jsxs)("div",{className:"flex justify-between",children:[(0,Gr.jsxs)("div",{children:[(0,Gr.jsx)("div",{className:"text-xs text-white/70",children:"NAME"}),(0,Gr.jsx)("div",{className:"text-sm uppercase",children:e.name||"YOUR NAME"})]}),(0,Gr.jsxs)("div",{children:[(0,Gr.jsx)("div",{className:"text-xs text-white/70",children:"EXPIRES"}),(0,Gr.jsx)("div",{className:"text-sm",children:e.expiry||"MM/YY"})]})]})]})]}),(0,Gr.jsxs)("div",{className:"space-y-4",children:[(0,Gr.jsxs)("div",{className:"space-y-1",children:[(0,Gr.jsxs)(It,{htmlFor:"card-number",className:f,children:[s.number||"Card Number",h&&(0,Gr.jsx)("span",{className:"text-destructive ml-1",children:"*"})]}),(0,Gr.jsxs)("div",{className:"relative",children:[(0,Gr.jsx)(Jt,{ref:I,id:"card-number",type:"text",inputMode:"numeric",value:e.number,onChange:F=>T("number",F.target.value),onFocus:()=>b("number"),onBlur:()=>b(null),placeholder:l.number||"1234 5678 9012 3456",className:B("pr-20",O.number&&"border-destructive",d),disabled:m}),n&&y&&(0,Gr.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm font-medium text-muted-foreground",children:y.toUpperCase()})]}),O.number&&(0,Gr.jsx)("p",{className:B("text-sm text-destructive",p),children:O.number})]}),(0,Gr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Gr.jsxs)("div",{className:"space-y-1",children:[(0,Gr.jsxs)(It,{htmlFor:"card-expiry",className:f,children:[s.expiry||"Expiry Date",h&&(0,Gr.jsx)("span",{className:"text-destructive ml-1",children:"*"})]}),(0,Gr.jsx)(Jt,{ref:N,id:"card-expiry",type:"text",inputMode:"numeric",value:e.expiry,onChange:F=>T("expiry",F.target.value),onFocus:()=>b("expiry"),onBlur:()=>b(null),placeholder:l.expiry||"MM/YY",className:B(O.expiry&&"border-destructive",d),disabled:m}),O.expiry&&(0,Gr.jsx)("p",{className:B("text-sm text-destructive",p),children:O.expiry})]}),(0,Gr.jsxs)("div",{className:"space-y-1",children:[(0,Gr.jsxs)(It,{htmlFor:"card-cvc",className:f,children:[s.cvc||"CVC",h&&(0,Gr.jsx)("span",{className:"text-destructive ml-1",children:"*"})]}),(0,Gr.jsxs)("div",{className:"relative",children:[(0,Gr.jsx)(Jt,{ref:M,id:"card-cvc",type:"text",inputMode:"numeric",value:e.cvc,onChange:F=>T("cvc",F.target.value),onFocus:()=>b("cvc"),onBlur:()=>b(null),placeholder:l.cvc||y==="amex"?"1234":"123",className:B(O.cvc&&"border-destructive",d),disabled:m}),o&&(0,Gr.jsx)(Nt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"})]}),O.cvc&&(0,Gr.jsx)("p",{className:B("text-sm text-destructive",p),children:O.cvc})]})]}),(0,Gr.jsxs)("div",{className:"space-y-1",children:[(0,Gr.jsx)(It,{htmlFor:"card-name",className:f,children:s.name||"Cardholder Name"}),(0,Gr.jsx)(Jt,{ref:A,id:"card-name",type:"text",value:e.name,onChange:F=>T("name",F.target.value),onFocus:()=>b("name"),onBlur:()=>b(null),placeholder:l.name||"John Doe",className:B(O.name&&"border-destructive",d),disabled:m}),O.name&&(0,Gr.jsx)("p",{className:B("text-sm text-destructive",p),children:O.name})]})]}),o&&(0,Gr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Gr.jsx)(Nt,{className:"w-4 h-4"}),(0,Gr.jsx)("span",{children:"Your payment information is secure and encrypted"})]})]})});GKe.displayName="MoonUICreditCardInputPro";var ac=D(ce(),1);var nt=D(de(),1),KKe=xt("relative w-full rounded-lg border bg-card text-card-foreground shadow-sm",{variants:{variant:{default:"border-border",exam:"border-primary/20 bg-primary/5",personality:"border-secondary/20 bg-secondary/5"},size:{sm:"p-4",md:"p-6",lg:"p-8"}},defaultVariants:{variant:"default",size:"md"}}),XKe=ac.default.forwardRef(({className:e,variant:t,size:r,questions:n,settings:o={},onComplete:a,onProgress:i,title:s,description:l,...c},u)=>{let[d,f]=(0,ac.useState)([]),[p,m]=(0,ac.useState)(0),[h,g]=(0,ac.useState)({}),[v,y]=(0,ac.useState)(!1),[x,w]=(0,ac.useState)(null),[b,C]=(0,ac.useState)(o.timeLimit?o.timeLimit*60:null),[S,I]=(0,ac.useState)(Date.now()),[N,M]=(0,ac.useState)(!1),[A,T]=(0,ac.useState)(0);(0,ac.useEffect)(()=>{let j=[...n];o.shuffleQuestions&&(j=F(j)),o.shuffleOptions&&(j=j.map($=>$.options?{...$,options:F([...$.options])}:$)),f(j)},[n,o.shuffleQuestions,o.shuffleOptions]),(0,ac.useEffect)(()=>{if(b===null||b<=0||v)return;let j=setInterval(()=>{C($=>$===null||$<=1?(L(),0):$-1)},1e3);return()=>clearInterval(j)},[b,v]),(0,ac.useEffect)(()=>{i&&i(p+1,d.length)},[p,d.length,i]);let O=d[p],F=j=>{let $=[...j];for(let W=$.length-1;W>0;W--){let z=Math.floor(Math.random()*(W+1));[$[W],$[z]]=[$[z],$[W]]}return $},P=j=>{let $=Date.now()-S;g(W=>({...W,[O.id]:{questionId:O.id,answer:j,timeSpent:$}}))},k=()=>{p<d.length-1?(m(j=>j+1),I(Date.now()),M(!1)):L()},R=()=>{p>0&&(m(j=>j-1),M(!1))},L=()=>{let j=_();w(j),y(!0),T($=>$+1),a&&a(j)},_=()=>{let j=0,$=0,W=[];d.forEach(X=>{let Y=h[X.id],oe=X.points||1;j+=oe;let ie=!1;if(Y?.answer&&X.correctAnswer!==void 0)switch(X.type){case"single-choice":case"true-false":case"text":ie=Y.answer===X.correctAnswer;break;case"multiple-choice":Array.isArray(Y.answer)&&Array.isArray(X.correctAnswer)&&(ie=Y.answer.length===X.correctAnswer.length&&Y.answer.every(Le=>X.correctAnswer.includes(Le)));break;case"matching":if(typeof Y.answer=="object"&&typeof X.correctAnswer=="object"){let Le=X.correctAnswer,Ce=Y.answer;ie=Object.keys(Le).every(Be=>Le[Be]===Ce[Be])}break;case"rating":ie=!0;break}ie&&($+=oe),W.push({questionId:X.id,userAnswer:Y?.answer||null,correctAnswer:X.correctAnswer,isCorrect:ie,points:ie?oe:0})});let z=j>0?$/j*100:0,G=Object.values(h).reduce((X,Y)=>X+(Y.timeSpent||0),0);return{score:$,totalScore:j,percentage:z,passed:o.passingScore?z>=o.passingScore:void 0,answers:W,timeSpent:G,completedAt:new Date}},U=()=>{m(0),g({}),y(!1),w(null),C(o.timeLimit?o.timeLimit*60:null),I(Date.now()),M(!1),o.shuffleQuestions&&f(F([...n]))},V=()=>{if(!x)return;let j={title:s,completedAt:x.completedAt,score:x.score,totalScore:x.totalScore,percentage:x.percentage,passed:x.passed,timeSpent:x.timeSpent,answers:x.answers.map(G=>({question:d.find(Y=>Y.id===G.questionId)?.question,userAnswer:G.userAnswer,correctAnswer:G.correctAnswer,isCorrect:G.isCorrect,points:G.points}))},$=new Blob([JSON.stringify(j,null,2)],{type:"application/json"}),W=URL.createObjectURL($),z=document.createElement("a");z.href=W,z.download=`quiz-results-${Date.now()}.json`,z.click(),URL.revokeObjectURL(W)},E=j=>{let $=Math.floor(j/60),W=j%60;return`${$}:${W.toString().padStart(2,"0")}`},H=()=>{if(!O)return null;let j=h[O.id]?.answer;switch(O.type){case"single-choice":case"true-false":return(0,nt.jsx)("div",{className:"space-y-3",children:O.options?.map((G,X)=>(0,nt.jsx)(ne.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:X*.1},onClick:()=>P(G),className:B("w-full text-left p-4 rounded-lg border transition-colors",j===G?"border-primary bg-primary/10":"border-border hover:border-primary/50"),children:G},X))});case"multiple-choice":return(0,nt.jsx)("div",{className:"space-y-3",children:O.options?.map((G,X)=>{let Y=Array.isArray(j)&&j.includes(G);return(0,nt.jsx)(ne.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:X*.1},onClick:()=>{let oe=j||[],ie=Y?oe.filter(Le=>Le!==G):[...oe,G];P(ie)},className:B("w-full text-left p-4 rounded-lg border transition-colors",Y?"border-primary bg-primary/10":"border-border hover:border-primary/50"),children:(0,nt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,nt.jsx)("div",{className:B("w-5 h-5 rounded border-2 transition-colors",Y?"bg-primary border-primary":"border-border"),children:Y&&(0,nt.jsx)(Ks,{className:"w-full h-full text-primary-foreground"})}),G]})},X)})});case"text":return(0,nt.jsx)(ne.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:(0,nt.jsx)("textarea",{className:"w-full p-4 rounded-lg border border-input bg-background resize-none",rows:4,placeholder:"Type your answer here...",value:j||"",onChange:G=>P(G.target.value)})});case"rating":let $=O.maxRating||5,W=typeof j=="number"?j:0;return(0,nt.jsxs)(ne.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-4",children:[(0,nt.jsx)("div",{className:"flex justify-center gap-2",children:Array.from({length:$},(G,X)=>X+1).map(G=>(0,nt.jsx)("button",{onClick:()=>P(G),className:"transition-transform hover:scale-110",children:(0,nt.jsx)(vs,{className:B("w-10 h-10 transition-colors",G<=W?"fill-yellow-500 text-yellow-500":"text-muted-foreground")})},G))}),O.ratingLabels&&(0,nt.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,nt.jsx)("span",{children:O.ratingLabels[0]}),(0,nt.jsx)("span",{children:O.ratingLabels[1]})]})]});case"matching":let z=j||{};return(0,nt.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,nt.jsxs)("div",{className:"space-y-3",children:[(0,nt.jsx)("h4",{className:"font-medium mb-2",children:"Match these items:"}),O.leftOptions?.map((G,X)=>(0,nt.jsx)(ne.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:X*.1},className:"p-3 rounded-lg border bg-muted/50",children:G},G))]}),(0,nt.jsxs)("div",{className:"space-y-3",children:[(0,nt.jsx)("h4",{className:"font-medium mb-2",children:"With these:"}),O.leftOptions?.map(G=>(0,nt.jsx)(ne.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},children:(0,nt.jsxs)("select",{className:"w-full p-3 rounded-lg border bg-background",value:z[G]||"",onChange:X=>P({...z,[G]:X.target.value}),children:[(0,nt.jsx)("option",{value:"",children:"Select..."}),O.rightOptions?.map(X=>(0,nt.jsx)("option",{value:X,children:X},X))]})},G))]})]});default:return null}};return v&&x?(0,nt.jsx)("div",{ref:u,className:B(KKe({variant:t,size:r}),e),...c,children:(0,nt.jsxs)(ne.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"space-y-6",children:[(0,nt.jsxs)("div",{className:"text-center",children:[(0,nt.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Quiz Completed!"}),(0,nt.jsxs)("div",{className:"text-5xl font-bold mb-4",children:[x.percentage.toFixed(1),"%"]}),(0,nt.jsxs)("p",{className:"text-muted-foreground",children:["You scored ",x.score," out of ",x.totalScore," points"]}),x.passed!==void 0&&(0,nt.jsx)("div",{className:B("mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-full",x.passed?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:x.passed?(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(Ks,{className:"w-5 h-5"}),"Passed"]}):(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(lo,{className:"w-5 h-5"}),"Failed"]})})]}),o.allowReview&&(0,nt.jsxs)("div",{className:"space-y-4",children:[(0,nt.jsx)("h3",{className:"font-semibold",children:"Review Answers:"}),x.answers.map((j,$)=>{let W=d.find(z=>z.id===j.questionId);return W?(0,nt.jsx)("div",{className:"p-4 rounded-lg border bg-muted/50",children:(0,nt.jsxs)("div",{className:"flex items-start gap-3",children:[j.isCorrect?(0,nt.jsx)(Ks,{className:"w-5 h-5 text-green-600 mt-0.5"}):(0,nt.jsx)(lo,{className:"w-5 h-5 text-red-600 mt-0.5"}),(0,nt.jsxs)("div",{className:"flex-1",children:[(0,nt.jsxs)("p",{className:"font-medium mb-2",children:[$+1,". ",W.question]}),(0,nt.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Your answer: ",JSON.stringify(j.userAnswer)]}),!j.isCorrect&&W.correctAnswer!==void 0&&(0,nt.jsxs)("p",{className:"text-sm text-green-600 mt-1",children:["Correct answer: ",JSON.stringify(W.correctAnswer)]}),W.explanation&&(0,nt.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:W.explanation})]})]})},j.questionId):null})]}),(0,nt.jsxs)("div",{className:"flex gap-3 justify-center",children:[(!o.maxAttempts||A<o.maxAttempts)&&(0,nt.jsxs)("button",{onClick:U,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90",children:[(0,nt.jsx)(Mv,{className:"w-4 h-4"}),"Try Again"]}),(0,nt.jsxs)("button",{onClick:V,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg border hover:bg-muted",children:[(0,nt.jsx)(xn,{className:"w-4 h-4"}),"Download Results"]})]})]})}):(0,nt.jsxs)("div",{ref:u,className:B(KKe({variant:t,size:r}),e),...c,children:[(s||b!==null)&&(0,nt.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,nt.jsxs)("div",{children:[s&&(0,nt.jsx)("h2",{className:"text-2xl font-bold",children:s}),l&&(0,nt.jsx)("p",{className:"text-muted-foreground mt-1",children:l})]}),b!==null&&(0,nt.jsxs)("div",{className:B("flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium",b<60?"bg-red-100 text-red-700":"bg-muted"),children:[(0,nt.jsx)(yn,{className:"w-4 h-4"}),E(b)]})]}),(0,nt.jsxs)("div",{className:"mb-6",children:[(0,nt.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground mb-2",children:[(0,nt.jsxs)("span",{children:["Question ",p+1," of ",d.length]}),(0,nt.jsxs)("span",{children:[Math.round((p+1)/d.length*100),"%"]})]}),(0,nt.jsx)("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:(0,nt.jsx)(ne.div,{className:"h-full bg-primary",initial:{width:0},animate:{width:`${(p+1)/d.length*100}%`},transition:{duration:.3}})})]}),(0,nt.jsx)(_t,{mode:"wait",children:O&&(0,nt.jsxs)(ne.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"mb-6",children:[(0,nt.jsxs)("h3",{className:"text-lg font-semibold mb-4",children:[O.question,O.required&&(0,nt.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),H(),o.showHints&&O.hint&&(0,nt.jsxs)("div",{className:"mt-4",children:[(0,nt.jsxs)("button",{onClick:()=>M(!N),className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[(0,nt.jsx)(hm,{className:"w-4 h-4"}),N?"Hide":"Show"," Hint"]}),N&&(0,nt.jsx)(ne.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mt-2 p-3 rounded-lg bg-muted/50 text-sm",children:O.hint})]}),o.showInstantFeedback&&h[O.id]&&O.correctAnswer!==void 0&&(0,nt.jsx)(ne.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mt-4",children:(()=>{let j=h[O.id].answer,$=!1;switch(O.type){case"single-choice":case"true-false":$=j===O.correctAnswer;break}return(0,nt.jsxs)("div",{className:B("p-3 rounded-lg flex items-start gap-2",$?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:[$?(0,nt.jsx)(Ks,{className:"w-5 h-5 mt-0.5"}):(0,nt.jsx)(lo,{className:"w-5 h-5 mt-0.5"}),(0,nt.jsxs)("div",{children:[(0,nt.jsx)("p",{className:"font-medium",children:$?"Correct!":"Incorrect"}),O.explanation&&(0,nt.jsx)("p",{className:"text-sm mt-1",children:O.explanation})]})]})})()})]},O.id)}),(0,nt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nt.jsxs)("button",{onClick:R,disabled:p===0,className:B("inline-flex items-center gap-2 px-4 py-2 rounded-lg transition-colors",p===0?"opacity-50 cursor-not-allowed bg-muted text-muted-foreground":"bg-muted hover:bg-muted/80"),children:[(0,nt.jsx)(ga,{className:"w-4 h-4"}),"Previous"]}),(0,nt.jsxs)("button",{onClick:p===d.length-1?L:k,disabled:O?.required&&!h[O.id],className:B("inline-flex items-center gap-2 px-4 py-2 rounded-lg transition-colors",O?.required&&!h[O.id]?"opacity-50 cursor-not-allowed bg-muted text-muted-foreground":"bg-primary text-primary-foreground hover:bg-primary/90"),children:[p===d.length-1?"Complete":"Next",(0,nt.jsx)(Kn,{className:"w-4 h-4"})]})]})]})});XKe.displayName="MoonUIQuizFormProInternal";var jle=ac.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Yt();return!n&&!r?(0,nt.jsx)(Ve,{className:B("w-full",e.className),children:(0,nt.jsx)(ze,{className:"py-12 text-center",children:(0,nt.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,nt.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,nt.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,nt.jsxs)("div",{children:[(0,nt.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,nt.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"MoonUI Quiz Form is available exclusively to MoonUI Pro subscribers."}),(0,nt.jsx)("a",{href:"/pricing",children:(0,nt.jsxs)(re,{size:"sm",children:[(0,nt.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,nt.jsx)(XKe,{...e,ref:t})});jle.displayName="MoonUIQuizFormPro";var Od=D(ce(),1);var ee=D(lt(),1),Vn=D(lt(),1);var kd=D(lt(),1);var ic=D(lt(),1);var h1=D(_r(),1),PW="Collapsible",[JZt,$le]=mn(PW),[eJt,qle]=JZt(PW),YKe=ic.forwardRef((e,t)=>{let{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:a,onOpenChange:i,...s}=e,[l,c]=Jn({prop:n,defaultProp:o??!1,onChange:i,caller:PW});return(0,h1.jsx)(eJt,{scope:r,disabled:a,contentId:Vo(),open:l,onOpenToggle:ic.useCallback(()=>c(u=>!u),[c]),children:(0,h1.jsx)(rt.div,{"data-state":Gle(l),"data-disabled":a?"":void 0,...s,ref:t})})});YKe.displayName=PW;var QKe="CollapsibleTrigger",ZKe=ic.forwardRef((e,t)=>{let{__scopeCollapsible:r,...n}=e,o=qle(QKe,r);return(0,h1.jsx)(rt.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Gle(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:He(e.onClick,o.onOpenToggle)})});ZKe.displayName=QKe;var Wle="CollapsibleContent",JKe=ic.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=qle(Wle,e.__scopeCollapsible);return(0,h1.jsx)(uo,{present:r||o.open,children:({present:a})=>(0,h1.jsx)(tJt,{...n,ref:t,present:a})})});JKe.displayName=Wle;var tJt=ic.forwardRef((e,t)=>{let{__scopeCollapsible:r,present:n,children:o,...a}=e,i=qle(Wle,r),[s,l]=ic.useState(n),c=ic.useRef(null),u=Xt(t,c),d=ic.useRef(0),f=d.current,p=ic.useRef(0),m=p.current,h=i.open||s,g=ic.useRef(h),v=ic.useRef(void 0);return ic.useEffect(()=>{let y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),qn(()=>{let y=c.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";let x=y.getBoundingClientRect();d.current=x.height,p.current=x.width,g.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(n)}},[i.open,n]),(0,h1.jsx)(rt.div,{"data-state":Gle(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!h,...a,ref:u,style:{["--radix-collapsible-content-height"]:f?`${f}px`:void 0,["--radix-collapsible-content-width"]:m?`${m}px`:void 0,...e.style},children:h&&o})});function Gle(e){return e?"open":"closed"}var e7e=YKe,t7e=ZKe,r7e=JKe;var ll=D(_r(),1),ch="Accordion",nJt=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Xle,oJt,aJt]=cf(ch),[kW,RLn]=mn(ch,[aJt,$le]),Yle=$le(),iJt=kd.default.forwardRef((e,t)=>{let{type:r,...n}=e,o=n,a=n;return(0,ll.jsx)(Xle.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?(0,ll.jsx)(uJt,{...a,ref:t}):(0,ll.jsx)(cJt,{...o,ref:t})})});iJt.displayName=ch;var[n7e,sJt]=kW(ch),[o7e,lJt]=kW(ch,{collapsible:!1}),cJt=kd.default.forwardRef((e,t)=>{let{value:r,defaultValue:n,onValueChange:o=()=>{},collapsible:a=!1,...i}=e,[s,l]=Jn({prop:r,defaultProp:n??"",onChange:o,caller:ch});return(0,ll.jsx)(n7e,{scope:e.__scopeAccordion,value:kd.default.useMemo(()=>s?[s]:[],[s]),onItemOpen:l,onItemClose:kd.default.useCallback(()=>a&&l(""),[a,l]),children:(0,ll.jsx)(o7e,{scope:e.__scopeAccordion,collapsible:a,children:(0,ll.jsx)(a7e,{...i,ref:t})})})}),uJt=kd.default.forwardRef((e,t)=>{let{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,s]=Jn({prop:r,defaultProp:n??[],onChange:o,caller:ch}),l=kd.default.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=kd.default.useCallback(u=>s((d=[])=>d.filter(f=>f!==u)),[s]);return(0,ll.jsx)(n7e,{scope:e.__scopeAccordion,value:i,onItemOpen:l,onItemClose:c,children:(0,ll.jsx)(o7e,{scope:e.__scopeAccordion,collapsible:!0,children:(0,ll.jsx)(a7e,{...a,ref:t})})})}),[dJt,RW]=kW(ch),a7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,disabled:n,dir:o,orientation:a="vertical",...i}=e,s=kd.default.useRef(null),l=Xt(s,t),c=oJt(r),d=wp(o)==="ltr",f=He(e.onKeyDown,p=>{if(!nJt.includes(p.key))return;let m=p.target,h=c().filter(I=>!I.ref.current?.disabled),g=h.findIndex(I=>I.ref.current===m),v=h.length;if(g===-1)return;p.preventDefault();let y=g,x=0,w=v-1,b=()=>{y=g+1,y>w&&(y=x)},C=()=>{y=g-1,y<x&&(y=w)};switch(p.key){case"Home":y=x;break;case"End":y=w;break;case"ArrowRight":a==="horizontal"&&(d?b():C());break;case"ArrowDown":a==="vertical"&&b();break;case"ArrowLeft":a==="horizontal"&&(d?C():b());break;case"ArrowUp":a==="vertical"&&C();break}let S=y%v;h[S].ref.current?.focus()});return(0,ll.jsx)(dJt,{scope:r,disabled:n,direction:o,orientation:a,children:(0,ll.jsx)(Xle.Slot,{scope:r,children:(0,ll.jsx)(rt.div,{...i,"data-orientation":a,ref:l,onKeyDown:n?void 0:f})})})}),IW="AccordionItem",[fJt,Qle]=kW(IW),i7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,value:n,...o}=e,a=RW(IW,r),i=sJt(IW,r),s=Yle(r),l=Vo(),c=n&&i.value.includes(n)||!1,u=a.disabled||e.disabled;return(0,ll.jsx)(fJt,{scope:r,open:c,disabled:u,triggerId:l,children:(0,ll.jsx)(e7e,{"data-orientation":a.orientation,"data-state":f7e(c),...s,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?i.onItemOpen(n):i.onItemClose(n)}})})});i7e.displayName=IW;var s7e="AccordionHeader",l7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,...n}=e,o=RW(ch,r),a=Qle(s7e,r);return(0,ll.jsx)(rt.h3,{"data-orientation":o.orientation,"data-state":f7e(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:t})});l7e.displayName=s7e;var Kle="AccordionTrigger",c7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,...n}=e,o=RW(ch,r),a=Qle(Kle,r),i=lJt(Kle,r),s=Yle(r);return(0,ll.jsx)(Xle.ItemSlot,{scope:r,children:(0,ll.jsx)(t7e,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:a.triggerId,...s,...n,ref:t})})});c7e.displayName=Kle;var u7e="AccordionContent",d7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,...n}=e,o=RW(ch,r),a=Qle(u7e,r),i=Yle(r);return(0,ll.jsx)(r7e,{role:"region","aria-labelledby":a.triggerId,"data-orientation":o.orientation,...i,...n,ref:t,style:{["--radix-accordion-content-height"]:"var(--radix-collapsible-content-height)",["--radix-accordion-content-width"]:"var(--radix-collapsible-content-width)",...e.style}})});d7e.displayName=u7e;function f7e(e){return e?"open":"closed"}var p7e=i7e,m7e=l7e,Zle=c7e,Jle=d7e;var MW=D(lt());var h7e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mJt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ece=e=>{let t=mJt(e);return t.charAt(0).toUpperCase()+t.slice(1)},NW=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),g7e=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var a_=D(lt());var v7e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var y7e=(0,a_.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:i,...s},l)=>(0,a_.createElement)("svg",{ref:l,...v7e,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:NW("lucide",o),...!a&&!g7e(s)&&{"aria-hidden":"true"},...s},[...i.map(([c,u])=>(0,a_.createElement)(c,u)),...Array.isArray(a)?a:[a]]));var wt=(e,t)=>{let r=(0,MW.forwardRef)(({className:n,...o},a)=>(0,MW.createElement)(y7e,{ref:a,iconNode:t,className:NW(`lucide-${h7e(ece(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ece(e),r};var hJt=[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],i_=wt("align-center",hJt);var gJt=[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]],s_=wt("align-justify",gJt);var vJt=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],l_=wt("align-left",vJt);var yJt=[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],c_=wt("align-right",yJt);var xJt=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],u_=wt("bold",xJt);var bJt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ky=wt("check",bJt);var wJt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],j0=wt("chevron-down",wJt);var CJt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],rM=wt("chevron-left",CJt);var SJt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$0=wt("chevron-right",SJt);var PJt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],d_=wt("chevron-up",PJt);var IJt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Jg=wt("circle-alert",IJt);var kJt=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],q0=wt("circle-check-big",kJt);var RJt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nM=wt("circle",RJt);var NJt=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],f_=wt("code",NJt);var MJt=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],p_=wt("credit-card",MJt);var TJt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Xy=wt("ellipsis",TJt);var AJt=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],m_=wt("eye",AJt);var LJt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],h_=wt("file-text",LJt);var EJt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],g_=wt("file",EJt);var DJt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],oM=wt("image",DJt);var OJt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],aM=wt("info",OJt);var _Jt=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],v_=wt("italic",_Jt);var FJt=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],y_=wt("link",FJt);var BJt=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],x_=wt("list-ordered",BJt);var VJt=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],b_=wt("list",VJt);var UJt=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ef=wt("loader-circle",UJt);var zJt=[["path",{d:"M5 12h14",key:"1ays0h"}]],w_=wt("minus",zJt);var HJt=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],C_=wt("music",HJt);var jJt=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],S_=wt("palette",jJt);var $Jt=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],P_=wt("phone",$Jt);var qJt=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],I_=wt("quote",qJt);var WJt=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],k_=wt("redo",WJt);var GJt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],R_=wt("search",GJt);var KJt=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Rd=wt("square-pen",KJt);var XJt=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],N_=wt("strikethrough",XJt);var YJt=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],W0=wt("triangle-alert",YJt);var QJt=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],M_=wt("underline",QJt);var ZJt=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],T_=wt("undo",ZJt);var JJt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],A_=wt("upload",JJt);var eer=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],L_=wt("video",eer);var ter=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yy=wt("x",ter);function x7e(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=x7e(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function TW(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=x7e(e))&&(n&&(n+=" "),n+=t);return n}var nce="-",rer=e=>{let t=oer(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{let s=i.split(nce);return s[0]===""&&s.length!==1&&s.shift(),C7e(s,t)||ner(i)},getConflictingClassGroupIds:(i,s)=>{let l=r[i]||[];return s&&n[i]?[...l,...n[i]]:l}}},C7e=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),o=n?C7e(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;let a=e.join(nce);return t.validators.find(({validator:i})=>i(a))?.classGroupId},b7e=/^\[(.+)\]$/,ner=e=>{if(b7e.test(e)){let t=b7e.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},oer=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return ier(Object.entries(e.classGroups),r).forEach(([a,i])=>{rce(i,n,a,t)}),n},rce=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){let a=o===""?t:w7e(t,o);a.classGroupId=r;return}if(typeof o=="function"){if(aer(o)){rce(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([a,i])=>{rce(i,w7e(t,a),r,n)})})},w7e=(e,t)=>{let r=e;return t.split(nce).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},aer=e=>e.isThemeGetter,ier=(e,t)=>t?e.map(([r,n])=>{let o=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,s])=>[t+i,s])):a);return[r,o]}):e,ser=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map,o=(a,i)=>{r.set(a,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let i=r.get(a);if(i!==void 0)return i;if((i=n.get(a))!==void 0)return o(a,i),i},set(a,i){r.has(a)?r.set(a,i):o(a,i)}}},S7e="!",ler=e=>{let{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],a=t.length,i=s=>{let l=[],c=0,u=0,d;for(let g=0;g<s.length;g++){let v=s[g];if(c===0){if(v===o&&(n||s.slice(g,g+a)===t)){l.push(s.slice(u,g)),u=g+a;continue}if(v==="/"){d=g;continue}}v==="["?c++:v==="]"&&c--}let f=l.length===0?s:s.substring(u),p=f.startsWith(S7e),m=p?f.substring(1):f,h=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:h}};return r?s=>r({className:s,parseClassName:i}):i},cer=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},uer=e=>({cache:ser(e.cacheSize),parseClassName:ler(e),...rer(e)}),der=/\s+/,fer=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(der),s="";for(let l=i.length-1;l>=0;l-=1){let c=i[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(c),m=!!p,h=n(m?f.substring(0,p):f);if(!h){if(!m){s=c+(s.length>0?" "+s:s);continue}if(h=n(f),!h){s=c+(s.length>0?" "+s:s);continue}m=!1}let g=cer(u).join(":"),v=d?g+S7e:g,y=v+h;if(a.includes(y))continue;a.push(y);let x=o(h,m);for(let w=0;w<x.length;++w){let b=x[w];a.push(v+b)}s=c+(s.length>0?" "+s:s)}return s};function per(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=P7e(t))&&(n&&(n+=" "),n+=r);return n}var P7e=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=P7e(e[n]))&&(r&&(r+=" "),r+=t);return r};function mer(e,...t){let r,n,o,a=i;function i(l){let c=t.reduce((u,d)=>d(u),e());return r=uer(c),n=r.cache.get,o=r.cache.set,a=s,s(l)}function s(l){let c=n(l);if(c)return c;let u=fer(l,r);return o(l,u),u}return function(){return a(per.apply(null,arguments))}}var Xa=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},I7e=/^\[(?:([a-z-]+):)?(.+)\]$/i,her=/^\d+\/\d+$/,ger=new Set(["px","full","screen"]),ver=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yer=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xer=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ber=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wer=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qy=e=>iM(e)||ger.has(e)||her.test(e),G0=e=>sM(e,"length",Mer),iM=e=>!!e&&!Number.isNaN(Number(e)),tce=e=>sM(e,"number",iM),E_=e=>!!e&&Number.isInteger(Number(e)),Cer=e=>e.endsWith("%")&&iM(e.slice(0,-1)),un=e=>I7e.test(e),K0=e=>ver.test(e),Ser=new Set(["length","size","percentage"]),Per=e=>sM(e,Ser,k7e),Ier=e=>sM(e,"position",k7e),ker=new Set(["image","url"]),Rer=e=>sM(e,ker,Aer),Ner=e=>sM(e,"",Ter),D_=()=>!0,sM=(e,t,r)=>{let n=I7e.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Mer=e=>yer.test(e)&&!xer.test(e),k7e=()=>!1,Ter=e=>ber.test(e),Aer=e=>wer.test(e);var Ler=()=>{let e=Xa("colors"),t=Xa("spacing"),r=Xa("blur"),n=Xa("brightness"),o=Xa("borderColor"),a=Xa("borderRadius"),i=Xa("borderSpacing"),s=Xa("borderWidth"),l=Xa("contrast"),c=Xa("grayscale"),u=Xa("hueRotate"),d=Xa("invert"),f=Xa("gap"),p=Xa("gradientColorStops"),m=Xa("gradientColorStopPositions"),h=Xa("inset"),g=Xa("margin"),v=Xa("opacity"),y=Xa("padding"),x=Xa("saturate"),w=Xa("scale"),b=Xa("sepia"),C=Xa("skew"),S=Xa("space"),I=Xa("translate"),N=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",un,t],T=()=>[un,t],O=()=>["",Qy,G0],F=()=>["auto",iM,un],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],_=()=>["","0",un],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[iM,un];return{cacheSize:500,separator:":",theme:{colors:[D_],spacing:[Qy,G0],blur:["none","",K0,un],brightness:V(),borderColor:[e],borderRadius:["none","","full",K0,un],borderSpacing:T(),borderWidth:O(),contrast:V(),grayscale:_(),hueRotate:V(),invert:_(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[Cer,G0],inset:A(),margin:A(),opacity:V(),padding:T(),saturate:V(),scale:V(),sepia:_(),skew:V(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",un]}],container:["container"],columns:[{columns:[K0]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...P(),un]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",E_,un]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",un]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",E_,un]}],"grid-cols":[{"grid-cols":[D_]}],"col-start-end":[{col:["auto",{span:["full",E_,un]},un]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[D_]}],"row-start-end":[{row:["auto",{span:[E_,un]},un]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",un]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",un]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",un,t]}],"min-w":[{"min-w":[un,t,"min","max","fit"]}],"max-w":[{"max-w":[un,t,"none","full","min","max","fit","prose",{screen:[K0]},K0]}],h:[{h:[un,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[un,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[un,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[un,t,"auto","min","max","fit"]}],"font-size":[{text:["base",K0,G0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",tce]}],"font-family":[{font:[D_]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",un]}],"line-clamp":[{"line-clamp":["none",iM,tce]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qy,un]}],"list-image":[{"list-image":["none",un]}],"list-style-type":[{list:["none","disc","decimal",un]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qy,G0]}],"underline-offset":[{"underline-offset":["auto",Qy,un]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",un]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",un]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...P(),Ier]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Per]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Rer]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:k()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[Qy,un]}],"outline-w":[{outline:[Qy,G0]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Qy,G0]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",K0,Ner]}],"shadow-color":[{shadow:[D_]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...R(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":R()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",K0,un]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",un]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",un]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",un]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[E_,un]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",un]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",un]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",un]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qy,G0,tce]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var R7e=mer(Ler);var q=D(_r(),1);var N7e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,M7e=TW,jn=(e,t)=>r=>{var n;if(t?.variants==null)return M7e(e,r?.class,r?.className);let{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(c=>{let u=r?.[c],d=a?.[c];if(u===null)return null;let f=N7e(u)||N7e(d);return o[c][f]}),s=r&&Object.entries(r).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(m=>{let[h,g]=m;return Array.isArray(g)?g.includes({...a,...s}[h]):{...a,...s}[h]===g})?[...c,d,f]:c},[]);return M7e(e,i,l,r?.class,r?.className)};var Qp=D(lt(),1);var T7e=D(qE(),1);function A7e(){return(0,T7e.useSyncExternalStore)(Eer,()=>!0,()=>!1)}function Eer(){return()=>{}}var O_=D(_r(),1),oce="Avatar",[Der,lOn]=mn(oce),[Oer,E7e]=Der(oce),D7e=Qp.forwardRef((e,t)=>{let{__scopeAvatar:r,...n}=e,[o,a]=Qp.useState("idle");return(0,O_.jsx)(Oer,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:a,children:(0,O_.jsx)(rt.span,{...n,ref:t})})});D7e.displayName=oce;var O7e="AvatarImage",_7e=Qp.forwardRef((e,t)=>{let{__scopeAvatar:r,src:n,onLoadingStatusChange:o=()=>{},...a}=e,i=E7e(O7e,r),s=_er(n,a),l=eo(c=>{o(c),i.onImageLoadingStatusChange(c)});return qn(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?(0,O_.jsx)(rt.img,{...a,ref:t,src:n}):null});_7e.displayName=O7e;var F7e="AvatarFallback",B7e=Qp.forwardRef((e,t)=>{let{__scopeAvatar:r,delayMs:n,...o}=e,a=E7e(F7e,r),[i,s]=Qp.useState(n===void 0);return Qp.useEffect(()=>{if(n!==void 0){let l=window.setTimeout(()=>s(!0),n);return()=>window.clearTimeout(l)}},[n]),i&&a.imageLoadingStatus!=="loaded"?(0,O_.jsx)(rt.span,{...o,ref:t}):null});B7e.displayName=F7e;function L7e(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function _er(e,{referrerPolicy:t,crossOrigin:r}){let n=A7e(),o=Qp.useRef(null),a=(()=>n?(o.current||(o.current=new window.Image),o.current):null)(),[i,s]=Qp.useState(()=>L7e(a,e));return qn(()=>{s(L7e(a,e))},[a,e]),qn(()=>{let l=d=>()=>{s(d)};if(!a)return;let c=l("loaded"),u=l("error");return a.addEventListener("load",c),a.addEventListener("error",u),t&&(a.referrerPolicy=t),typeof r=="string"&&(a.crossOrigin=r),()=>{a.removeEventListener("load",c),a.removeEventListener("error",u)}},[a,r,t]),i}var ace=D7e,ice=_7e,sce=B7e;var xF=D(_r(),1),nv=D(lt(),1);var V7e=D(lt(),1),lM=(0,V7e.createContext)({});var U7e=D(lt(),1);function ev(e){let t=(0,U7e.useRef)(null);return t.current===null&&(t.current=e()),t.current}var AW=D(lt(),1);var cM=typeof window<"u";var uM=cM?AW.useLayoutEffect:AW.useEffect;var zce=D(_r(),1),HXe=D(lt(),1),vF=D(lt(),1);var z7e=D(lt(),1),X0=(0,z7e.createContext)(null);var UXe=D(_r(),1);function g1(e,t){e.indexOf(t)===-1&&e.push(t)}function uh(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var El=(e,t,r)=>r>t?t:r<e?e:r;var Zy=()=>{},sc=()=>{};var zc={};var __=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function F_(e){return typeof e=="object"&&e!==null}var B_=e=>/^0[^.\s]+$/u.test(e);function v1(e){let t;return()=>(t===void 0&&(t=e()),t)}var Li=e=>e;var Ber=(e,t)=>r=>t(e(r)),dh=(...e)=>e.reduce(Ber);var Zp=(e,t,r)=>{let n=t-e;return n===0?1:(r-e)/n};var Jy=class{constructor(){this.subscriptions=[]}add(t){return g1(this.subscriptions,t),()=>uh(this.subscriptions,t)}notify(t,r,n){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,r,n);else for(let a=0;a<o;a++){let i=this.subscriptions[a];i&&i(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var us=e=>e*1e3,lc=e=>e/1e3;function V_(e,t){return t?e*(1e3/t):0}var H7e=(e,t,r)=>{let n=t-e;return((r-e)%n+n)%n+e};var j7e=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Ver=1e-7,Uer=12;function zer(e,t,r,n,o){let a,i,s=0;do i=t+(r-t)/2,a=j7e(i,n,o)-e,a>0?r=i:t=i;while(Math.abs(a)>Ver&&++s<Uer);return i}function Y0(e,t,r,n){if(e===t&&r===n)return Li;let o=a=>zer(a,0,1,e,r);return a=>a===0||a===1?a:j7e(o(a),t,n)}var LW=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var EW=e=>t=>1-e(1-t);var DW=Y0(.33,1.53,.69,.99),dM=EW(DW),U_=LW(dM);var z_=e=>(e*=2)<1?.5*dM(e):.5*(2-Math.pow(2,-10*(e-1)));var H_=e=>1-Math.sin(Math.acos(e)),j_=EW(H_),$_=LW(H_);var lce=Y0(.42,0,1,1),cce=Y0(0,0,.58,1),q_=Y0(.42,0,.58,1);var W_=e=>Array.isArray(e)&&typeof e[0]!="number";function G_(e,t){return W_(e)?e[H7e(0,e.length,t)]:e}var K_=e=>Array.isArray(e)&&typeof e[0]=="number";var $7e={linear:Li,easeIn:lce,easeInOut:q_,easeOut:cce,circIn:H_,circInOut:$_,circOut:j_,backIn:dM,backInOut:U_,backOut:DW,anticipate:z_},Her=e=>typeof e=="string",OW=e=>{if(K_(e)){sc(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,o]=e;return Y0(t,r,n,o)}else if(Her(e))return sc($7e[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),$7e[e];return e};var X_=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];var Nd={value:null,addProjectionMetrics:null};function q7e(e,t){let r=new Set,n=new Set,o=!1,a=!1,i=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){i.has(d)&&(u.schedule(d),e()),l++,d(s)}let u={schedule:(d,f=!1,p=!1)=>{let h=p&&o?r:n;return f&&i.add(d),h.has(d)||h.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(s=d,o){a=!0;return}o=!0,[r,n]=[n,r],r.forEach(c),t&&Nd.value&&Nd.value.frameloop[t].push(l),l=0,r.clear(),o=!1,a&&(a=!1,u.process(d))}};return u}var jer=40;function _W(e,t){let r=!1,n=!0,o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,i=X_.reduce((x,w)=>(x[w]=q7e(a,t?w:void 0),x),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=i,h=()=>{let x=zc.useManualTiming?o.timestamp:performance.now();r=!1,zc.useManualTiming||(o.delta=n?1e3/60:Math.max(Math.min(x-o.timestamp,jer),1)),o.timestamp=x,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),p.process(o),m.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(h))},g=()=>{r=!0,n=!0,o.isProcessing||e(h)};return{schedule:X_.reduce((x,w)=>{let b=i[w];return x[w]=(C,S=!1,I=!1)=>(r||g(),b.schedule(C,S,I)),x},{}),cancel:x=>{for(let w=0;w<X_.length;w++)i[X_[w]].cancel(x)},state:o,steps:i}}var{schedule:dn,cancel:Hc,state:Xi,steps:Y_}=_W(typeof requestAnimationFrame<"u"?requestAnimationFrame:Li,!0);var FW;function $er(){FW=void 0}var Yi={now:()=>(FW===void 0&&Yi.set(Xi.isProcessing||zc.useManualTiming?Xi.timestamp:performance.now()),FW),set:e=>{FW=e,queueMicrotask($er)}};var fh={layout:0,mainThread:0,waapi:0};var W7e=e=>t=>typeof t=="string"&&t.startsWith(e),y1=W7e("--"),qer=W7e("var(--"),x1=e=>qer(e)?Wer.test(e.split("/*")[0].trim()):!1,Wer=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var tv={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ex={...tv,transform:e=>El(0,1,e)},Q_={...tv,default:1};var Q0=e=>Math.round(e*1e5)/1e5;var fM=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function G7e(e){return e==null}var K7e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var pM=(e,t)=>r=>!!(typeof r=="string"&&K7e.test(r)&&r.startsWith(e)||t&&!G7e(r)&&Object.prototype.hasOwnProperty.call(r,t)),BW=(e,t,r)=>n=>{if(typeof n!="string")return n;let[o,a,i,s]=n.match(fM);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:s!==void 0?parseFloat(s):1}};var Ger=e=>El(0,255,e),uce={...tv,transform:e=>Math.round(Ger(e))},rv={test:pM("rgb","red"),parse:BW("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+uce.transform(e)+", "+uce.transform(t)+", "+uce.transform(r)+", "+Q0(ex.transform(n))+")"};function Ker(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}}var Z_={test:pM("#"),parse:Ker,transform:rv.transform};var J_=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ph=J_("deg"),jc=J_("%"),mr=J_("px"),dce=J_("vh"),fce=J_("vw"),VW=(()=>({...jc,parse:e=>jc.parse(e)/100,transform:e=>jc.transform(e*100)}))();var Z0={test:pM("hsl","hue"),parse:BW("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+jc.transform(Q0(t))+", "+jc.transform(Q0(r))+", "+Q0(ex.transform(n))+")"};var fi={test:e=>rv.test(e)||Z_.test(e)||Z0.test(e),parse:e=>rv.test(e)?rv.parse(e):Z0.test(e)?Z0.parse(e):Z_.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?rv.transform(e):Z0.transform(e),getAnimatableNone:e=>{let t=fi.parse(e);return t.alpha=0,fi.transform(t)}};var X7e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Xer(e){return isNaN(e)&&typeof e=="string"&&(e.match(fM)?.length||0)+(e.match(X7e)?.length||0)>0}var Q7e="number",Z7e="color",Yer="var",Qer="var(",Y7e="${}",Zer=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function J0(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[],a=0,s=t.replace(Zer,l=>(fi.test(l)?(n.color.push(a),o.push(Z7e),r.push(fi.parse(l))):l.startsWith(Qer)?(n.var.push(a),o.push(Yer),r.push(l)):(n.number.push(a),o.push(Q7e),r.push(parseFloat(l))),++a,Y7e)).split(Y7e);return{values:r,split:s,indexes:n,types:o}}function J7e(e){return J0(e).values}function eXe(e){let{split:t,types:r}=J0(e),n=t.length;return o=>{let a="";for(let i=0;i<n;i++)if(a+=t[i],o[i]!==void 0){let s=r[i];s===Q7e?a+=Q0(o[i]):s===Z7e?a+=fi.transform(o[i]):a+=o[i]}return a}}var Jer=e=>typeof e=="number"?0:fi.test(e)?fi.getAnimatableNone(e):e;function etr(e){let t=J7e(e);return eXe(e)(t.map(Jer))}var $c={test:Xer,parse:J7e,createTransformer:eXe,getAnimatableNone:etr};function pce(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function tXe({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let o=0,a=0,i=0;if(!t)o=a=i=r;else{let s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;o=pce(l,s,e+1/3),a=pce(l,s,e),i=pce(l,s,e-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(i*255),alpha:n}}function mM(e,t){return r=>r>0?t:e}var En=(e,t,r)=>e+(t-e)*r;var mce=(e,t,r)=>{let n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},ttr=[Z_,rv,Z0],rtr=e=>ttr.find(t=>t.test(e));function rXe(e){let t=rtr(e);if(Zy(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===Z0&&(r=tXe(r)),r}var hce=(e,t)=>{let r=rXe(e),n=rXe(t);if(!r||!n)return mM(e,t);let o={...r};return a=>(o.red=mce(r.red,n.red,a),o.green=mce(r.green,n.green,a),o.blue=mce(r.blue,n.blue,a),o.alpha=En(r.alpha,n.alpha,a),rv.transform(o))};var UW=new Set(["none","hidden"]);function nXe(e,t){return UW.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function ntr(e,t){return r=>En(e,t,r)}function zW(e){return typeof e=="number"?ntr:typeof e=="string"?x1(e)?mM:fi.test(e)?hce:itr:Array.isArray(e)?oXe:typeof e=="object"?fi.test(e)?hce:otr:mM}function oXe(e,t){let r=[...e],n=r.length,o=e.map((a,i)=>zW(a)(a,t[i]));return a=>{for(let i=0;i<n;i++)r[i]=o[i](a);return r}}function otr(e,t){let r={...e,...t},n={};for(let o in r)e[o]!==void 0&&t[o]!==void 0&&(n[o]=zW(e[o])(e[o],t[o]));return o=>{for(let a in n)r[a]=n[a](o);return r}}function atr(e,t){let r=[],n={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){let a=t.types[o],i=e.indexes[a][n[a]],s=e.values[i]??0;r[o]=s,n[a]++}return r}var itr=(e,t)=>{let r=$c.createTransformer(t),n=J0(e),o=J0(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?UW.has(e)&&!o.values.length||UW.has(t)&&!n.values.length?nXe(e,t):dh(oXe(atr(n,o),o.values),r):(Zy(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),mM(e,t))};function HW(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?En(e,t,r):zW(e)(e,t)}var aXe=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>dn.update(t,r),stop:()=>Hc(t),now:()=>Xi.isProcessing?Xi.timestamp:Yi.now()}};var jW=(e,t,r=10)=>{let n="",o=Math.max(Math.round(t/r),2);for(let a=0;a<o;a++)n+=Math.round(e(a/(o-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function hM(e){let t=0,r=50,n=e.next(t);for(;!n.done&&t<2e4;)t+=r,n=e.next(t);return t>=2e4?1/0:t}function eF(e,t=100,r){let n=r({...e,keyframes:[0,t]}),o=Math.min(hM(n),2e4);return{type:"keyframes",ease:a=>n.next(o*a).value/t,duration:lc(o)}}var str=5;function $W(e,t,r){let n=Math.max(t-str,0);return V_(r-e(n),t-n)}var Ya={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var vce=.001;function iXe({duration:e=Ya.duration,bounce:t=Ya.bounce,velocity:r=Ya.velocity,mass:n=Ya.mass}){let o,a;Zy(e<=us(Ya.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=El(Ya.minDamping,Ya.maxDamping,i),e=El(Ya.minDuration,Ya.maxDuration,lc(e)),i<1?(o=c=>{let u=c*i,d=u*e,f=u-r,p=qW(c,i),m=Math.exp(-d);return vce-f/p*m},a=c=>{let d=c*i*e,f=d*r+r,p=Math.pow(i,2)*Math.pow(c,2)*e,m=Math.exp(-d),h=qW(Math.pow(c,2),i);return(-o(c)+vce>0?-1:1)*((f-p)*m)/h}):(o=c=>{let u=Math.exp(-c*e),d=(c-r)*e+1;return-vce+u*d},a=c=>{let u=Math.exp(-c*e),d=(r-c)*(e*e);return u*d});let s=5/e,l=ctr(o,a,s);if(e=us(e),isNaN(l))return{stiffness:Ya.stiffness,damping:Ya.damping,duration:e};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:i*2*Math.sqrt(n*c),duration:e}}}var ltr=12;function ctr(e,t,r){let n=r;for(let o=1;o<ltr;o++)n=n-e(n)/t(n);return n}function qW(e,t){return e*Math.sqrt(1-t*t)}var utr=["duration","bounce"],dtr=["stiffness","damping","mass"];function sXe(e,t){return t.some(r=>e[r]!==void 0)}function ftr(e){let t={velocity:Ya.velocity,stiffness:Ya.stiffness,damping:Ya.damping,mass:Ya.mass,isResolvedFromDuration:!1,...e};if(!sXe(e,dtr)&&sXe(e,utr))if(e.visualDuration){let r=e.visualDuration,n=2*Math.PI/(r*1.2),o=n*n,a=2*El(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Ya.mass,stiffness:o,damping:a}}else{let r=iXe(e);t={...t,...r,mass:Ya.mass},t.isResolvedFromDuration=!0}return t}function tx(e=Ya.visualDuration,t=Ya.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:n,restDelta:o}=r,a=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=ftr({...r,velocity:-lc(r.velocity||0)}),m=f||0,h=c/(2*Math.sqrt(l*u)),g=i-a,v=lc(Math.sqrt(l/u)),y=Math.abs(g)<5;n||(n=y?Ya.restSpeed.granular:Ya.restSpeed.default),o||(o=y?Ya.restDelta.granular:Ya.restDelta.default);let x;if(h<1){let b=qW(v,h);x=C=>{let S=Math.exp(-h*v*C);return i-S*((m+h*v*g)/b*Math.sin(b*C)+g*Math.cos(b*C))}}else if(h===1)x=b=>i-Math.exp(-v*b)*(g+(m+v*g)*b);else{let b=v*Math.sqrt(h*h-1);x=C=>{let S=Math.exp(-h*v*C),I=Math.min(b*C,300);return i-S*((m+h*v*g)*Math.sinh(I)+b*g*Math.cosh(I))/b}}let w={calculatedDuration:p&&d||null,next:b=>{let C=x(b);if(p)s.done=b>=d;else{let S=b===0?m:0;h<1&&(S=b===0?us(m):$W(x,b,C));let I=Math.abs(S)<=n,N=Math.abs(i-C)<=o;s.done=I&&N}return s.value=s.done?i:C,s},toString:()=>{let b=Math.min(hM(w),2e4),C=jW(S=>w.next(b*S).value,b,30);return b+"ms "+C},toTransition:()=>{}};return w}tx.applyToOptions=e=>{let t=eF(e,100,tx);return e.ease=t.ease,e.duration=us(t.duration),e.type="keyframes",e};function tF({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=I=>s!==void 0&&I<s||l!==void 0&&I>l,m=I=>s===void 0?l:l===void 0||Math.abs(s-I)<Math.abs(l-I)?s:l,h=r*t,g=d+h,v=i===void 0?g:i(g);v!==g&&(h=v-d);let y=I=>-h*Math.exp(-I/n),x=I=>v+y(I),w=I=>{let N=y(I),M=x(I);f.done=Math.abs(N)<=c,f.value=f.done?v:M},b,C,S=I=>{p(f.value)&&(b=I,C=tx({keyframes:[f.value,m(f.value)],velocity:$W(x,I,f.value),damping:o,stiffness:a,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:I=>{let N=!1;return!C&&b===void 0&&(N=!0,w(I),S(I)),b!==void 0&&I>=b?C.next(I-b):(!N&&w(I),f)}}}function ptr(e,t,r){let n=[],o=r||zc.mix||HW,a=e.length-1;for(let i=0;i<a;i++){let s=o(e[i],e[i+1]);if(t){let l=Array.isArray(t)?t[i]||Li:t;s=dh(l,s)}n.push(s)}return n}function WW(e,t,{clamp:r=!0,ease:n,mixer:o}={}){let a=e.length;if(sc(a===t.length,"Both input and output ranges must be the same length","range-length"),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=ptr(t,n,o),l=s.length,c=u=>{if(i&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);let f=Zp(e[d],e[d+1],u);return s[d](f)};return r?u=>c(El(e[0],e[a-1],u)):c}function rF(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let o=Zp(0,t,n);e.push(En(r,1,o))}}function nF(e){let t=[0];return rF(t,e.length-1),t}function lXe(e,t){return e.map(r=>r*t)}function mtr(e,t){return e.map(()=>t||q_).splice(0,e.length-1)}function b1({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let o=W_(n)?n.map(OW):OW(n),a={done:!1,value:t[0]},i=lXe(r&&r.length===t.length?r:nF(t),e),s=WW(i,t,{ease:Array.isArray(o)?o:mtr(t,o)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}var htr=e=>e!==null;function gM(e,{repeat:t,repeatType:r="loop"},n,o=1){let a=e.filter(htr),s=o<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!s||n===void 0?a[s]:n}var gtr={decay:tF,inertia:tF,tween:b1,keyframes:b1,spring:tx};function GW(e){typeof e.type=="string"&&(e.type=gtr[e.type])}var ew=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}};var vtr=e=>e/100,rx=class extends ew{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:r}=this.options;r&&r.updatedAt!==Yi.now()&&this.tick(Yi.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},fh.mainThread++,this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;GW(t);let{type:r=b1,repeat:n=0,repeatDelay:o=0,repeatType:a,velocity:i=0}=t,{keyframes:s}=t,l=r||b1;l!==b1&&typeof s[0]!="number"&&(this.mixKeyframes=dh(vtr,HW(s[0],s[1])),s=[0,100]);let c=l({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-i})),c.calculatedDuration===null&&(c.calculatedDuration=hM(c));let{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(n+1)-o,this.generator=c}updateTime(t){let r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){let{generator:n,totalDuration:o,mixKeyframes:a,mirroredGenerator:i,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:p,type:m,onUpdate:h,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let x=this.currentTime,w=n;if(d){let I=Math.min(this.currentTime,o)/s,N=Math.floor(I),M=I%1;!M&&I>=1&&(M=1),M===1&&N--,N=Math.min(N,d+1),!!(N%2)&&(f==="reverse"?(M=1-M,p&&(M-=p/s)):f==="mirror"&&(w=i)),x=El(0,1,M)*s}let b=y?{done:!1,value:u[0]}:w.next(x);a&&(b.value=a(b.value));let{done:C}=b;!y&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);let S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return S&&m!==tF&&(b.value=gM(u,this.options,g,this.speed)),h&&h(b.value),S&&this.finish(),b}then(t,r){return this.finished.then(t,r)}get duration(){return lc(this.calculatedDuration)}get time(){return lc(this.currentTime)}set time(t){t=us(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Yi.now());let r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=lc(this.currentTime))}play(){if(this.isStopped)return;let{driver:t=aXe,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();let n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Yi.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,fh.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}};function cXe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var w1=e=>e*180/Math.PI,yce=e=>{let t=w1(Math.atan2(e[1],e[0]));return xce(t)},ytr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yce,rotateZ:yce,skewX:e=>w1(Math.atan(e[1])),skewY:e=>w1(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},xce=e=>(e=e%360,e<0&&(e+=360),e),uXe=yce,dXe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fXe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),xtr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:dXe,scaleY:fXe,scale:e=>(dXe(e)+fXe(e))/2,rotateX:e=>xce(w1(Math.atan2(e[6],e[5]))),rotateY:e=>xce(w1(Math.atan2(-e[2],e[0]))),rotateZ:uXe,rotate:uXe,skewX:e=>w1(Math.atan(e[4])),skewY:e=>w1(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function oF(e){return e.includes("scale")?1:0}function aF(e,t){if(!e||e==="none")return oF(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),n,o;if(r)n=xtr,o=r;else{let s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ytr,o=s}if(!o)return oF(t);let a=n[t],i=o[1].split(",").map(btr);return typeof a=="function"?a(i):i[a]}var bce=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return aF(r,t)};function btr(e){return parseFloat(e.trim())}var mh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Df=(()=>new Set(mh))();var wce=e=>e===tv||e===mr,wtr=new Set(["x","y","z"]),Ctr=mh.filter(e=>!wtr.has(e));function pXe(e){let t=[];return Ctr.forEach(r=>{let n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}var tw={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>aF(t,"x"),y:(e,{transform:t})=>aF(t,"y")};tw.translateX=tw.x;tw.translateY=tw.y;var C1=new Set,Cce=!1,Sce=!1,Pce=!1;function mXe(){if(Sce){let e=Array.from(C1).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{let o=pXe(n);o.length&&(r.set(n,o),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();let o=r.get(n);o&&o.forEach(([a,i])=>{n.getValue(a)?.set(i)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Sce=!1,Cce=!1,C1.forEach(e=>e.complete(Pce)),C1.clear()}function hXe(){C1.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Sce=!0)})}function Ice(){Pce=!0,hXe(),mXe(),Pce=!1}var nx=class{constructor(t,r,n,o,a,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=o,this.element=a,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(C1.add(this),Cce||(Cce=!0,dn.read(hXe),dn.resolveKeyframes(mXe))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:n,motionValue:o}=this;if(t[0]===null){let a=o?.get(),i=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){let s=n.readValue(r,i);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=i),o&&a===void 0&&o.set(t[0])}cXe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),C1.delete(this)}cancel(){this.state==="scheduled"&&(C1.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var gXe=e=>e.startsWith("--");function vXe(e,t,r){gXe(t)?e.style.setProperty(t,r):e.style[t]=r}var yXe=v1(()=>window.ScrollTimeline!==void 0);var xXe={};function bXe(e,t){let r=v1(e);return()=>xXe[t]??r()}var KW=bXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var S1=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;var kce={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:S1([0,.65,.55,1]),circOut:S1([.55,0,1,.45]),backIn:S1([.31,.01,.66,-.59]),backOut:S1([.33,1.53,.69,.99])};function Rce(e,t){if(e)return typeof e=="function"?KW()?jW(e,t):"ease-out":K_(e)?S1(e):Array.isArray(e)?e.map(r=>Rce(r,t)||kce.easeOut):kce[e]}function wXe(e,t,r,{delay:n=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeOut",times:l}={},c=void 0){let u={[t]:r};l&&(u.offset=l);let d=Rce(s,o);Array.isArray(d)&&(u.easing=d),Nd.value&&fh.waapi++;let f={delay:n,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:i==="reverse"?"alternate":"normal"};c&&(f.pseudoElement=c);let p=e.animate(u,f);return Nd.value&&p.finished.finally(()=>{fh.waapi--}),p}function P1(e){return typeof e=="function"&&"applyToOptions"in e}function CXe({type:e,...t}){return P1(e)&&KW()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}var XW=class extends ew{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;let{element:r,name:n,keyframes:o,pseudoElement:a,allowFlatten:i=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=i,this.options=t,sc(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let c=CXe(t);this.animation=wXe(r,n,o,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){let u=gM(o,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(u):vXe(r,n,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let t=this.animation.effect?.getComputedTiming?.().duration||0;return lc(Number(t))}get time(){return lc(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=us(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&yXe()?(this.animation.timeline=t,Li):r(this)}};var SXe={anticipate:z_,backInOut:U_,circInOut:$_};function Str(e){return e in SXe}function PXe(e){typeof e.ease=="string"&&Str(e.ease)&&(e.ease=SXe[e.ease])}var IXe=10,YW=class extends XW{constructor(t){PXe(t),GW(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:r,onUpdate:n,onComplete:o,element:a,...i}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let s=new rx({...i,autoplay:!1}),l=us(this.finishedTime??this.time);r.setWithVelocity(s.sample(l-IXe).value,s.sample(l).value,IXe),s.stop()}};var Nce=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&($c.test(e)||e==="0")&&!e.startsWith("url("));function Ptr(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function kXe(e,t,r,n){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let a=e[e.length-1],i=Nce(o,t),s=Nce(a,t);return Zy(i===s,`You are trying to animate ${t} from "${o}" to "${a}". "${i?a:o}" is not an animatable value.`,"value-not-animatable"),!i||!s?!1:Ptr(e)||(r==="spring"||P1(r))&&n}function vM(e){e.duration=0,e.type}var Itr=new Set(["opacity","clipPath","filter","transform"]),ktr=v1(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function RXe(e){let{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:a,type:i}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:c}=t.owner.getProps();return ktr()&&r&&Itr.has(r)&&(r!=="transform"||!c)&&!l&&!n&&o!=="mirror"&&a!==0&&i!=="inertia"}var Rtr=40,iF=class extends ew{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:i="loop",keyframes:s,name:l,motionValue:c,element:u,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Yi.now();let f={autoplay:t,delay:r,type:n,repeat:o,repeatDelay:a,repeatType:i,name:l,motionValue:c,element:u,...d},p=u?.KeyframeResolver||nx;this.keyframeResolver=new p(s,(m,h,g)=>this.onKeyframesResolved(m,h,f,!g),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,r,n,o){this.keyframeResolver=void 0;let{name:a,type:i,velocity:s,delay:l,isHandoff:c,onUpdate:u}=n;this.resolvedAt=Yi.now(),kXe(t,a,i,s)||((zc.instantAnimations||!l)&&u?.(gM(t,n,r)),t[0]=t[t.length-1],vM(n),n.repeat=0);let f={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Rtr?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},p=!c&&RXe(f)?new YW({...f,element:f.motionValue.owner.current}):new rx(f);p.finished.then(()=>this.notifyFinished()).catch(Li),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ice()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};var QW=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,r){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=r}attachTimeline(t){let r=this.animations.map(n=>n.attachTimeline(t));return()=>{r.forEach((n,o)=>{n&&n(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let r=0;r<this.animations.length;r++)t=Math.max(t,this.animations[r].duration);return t}runAll(t){this.animations.forEach(r=>r[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var sF=class extends QW{then(t,r){return this.finished.finally(t).then(()=>{})}};var Ntr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Mtr(e){let t=Ntr.exec(e);if(!t)return[,];let[,r,n,o]=t;return[`--${r??n}`,o]}var Ttr=4;function Mce(e,t,r=1){sc(r<=Ttr,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,o]=Mtr(e);if(!n)return;let a=window.getComputedStyle(t).getPropertyValue(n);if(a){let i=a.trim();return __(i)?parseFloat(i):i}return x1(o)?Mce(o,t,r+1):o}function I1(e,t){return e?.[t]??e?.default??e}var lF=new Set(["width","height","top","left","right","bottom",...mh]);var NXe={test:e=>e==="auto",parse:e=>e};var ZW=e=>t=>t.test(e);var Tce=[tv,mr,jc,ph,fce,dce,NXe],Ace=e=>Tce.find(ZW(e));function MXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||B_(e):!0}var Atr=new Set(["brightness","contrast","saturate","opacity"]);function Ltr(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(fM)||[];if(!n)return e;let o=r.replace(n,""),a=Atr.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}var Etr=/\b([a-z-]*)\(.*?\)/gu,cF={...$c,getAnimatableNone:e=>{let t=e.match(Etr);return t?t.map(Ltr).join(" "):e}};var Lce={...tv,transform:Math.round};var TXe={rotate:ph,rotateX:ph,rotateY:ph,rotateZ:ph,scale:Q_,scaleX:Q_,scaleY:Q_,scaleZ:Q_,skew:ph,skewX:ph,skewY:ph,distance:mr,translateX:mr,translateY:mr,translateZ:mr,x:mr,y:mr,z:mr,perspective:mr,transformPerspective:mr,opacity:ex,originX:VW,originY:VW,originZ:mr};var k1={borderWidth:mr,borderTopWidth:mr,borderRightWidth:mr,borderBottomWidth:mr,borderLeftWidth:mr,borderRadius:mr,radius:mr,borderTopLeftRadius:mr,borderTopRightRadius:mr,borderBottomRightRadius:mr,borderBottomLeftRadius:mr,width:mr,maxWidth:mr,height:mr,maxHeight:mr,top:mr,right:mr,bottom:mr,left:mr,padding:mr,paddingTop:mr,paddingRight:mr,paddingBottom:mr,paddingLeft:mr,margin:mr,marginTop:mr,marginRight:mr,marginBottom:mr,marginLeft:mr,backgroundPositionX:mr,backgroundPositionY:mr,...TXe,zIndex:Lce,fillOpacity:ex,strokeOpacity:ex,numOctaves:Lce};var AXe={...k1,color:fi,backgroundColor:fi,outlineColor:fi,fill:fi,stroke:fi,borderColor:fi,borderTopColor:fi,borderRightColor:fi,borderBottomColor:fi,borderLeftColor:fi,filter:cF,WebkitFilter:cF},uF=e=>AXe[e];function dF(e,t){let r=uF(e);return r!==cF&&(r=$c),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var Dtr=new Set(["auto","none","0"]);function LXe(e,t,r){let n=0,o;for(;n<e.length&&!o;){let a=e[n];typeof a=="string"&&!Dtr.has(a)&&J0(a).values.length&&(o=e[n]),n++}if(o&&r)for(let a of t)e[a]=dF(r,o)}var fF=class extends nx{constructor(t,r,n,o,a){super(t,r,n,o,a,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),x1(c))){let u=Mce(c,r.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!lF.has(n)||t.length!==2)return;let[o,a]=t,i=Ace(o),s=Ace(a);if(i!==s)if(wce(i)&&wce(s))for(let l=0;l<t.length;l++){let c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else tw[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,n=[];for(let o=0;o<t.length;o++)(t[o]===null||MXe(t[o]))&&n.push(o);n.length&&LXe(t,n,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tw[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let o=r[r.length-1];o!==void 0&&t.getValue(n,o).jump(o,!1)}measureEndState(){let{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;let o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);let a=n.length-1,i=n[a];n[a]=tw[r](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}};function pF(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;t&&(n=t.current);let o=r?.[e]??n.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}var mF=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function hF(e){return F_(e)&&"offsetHeight"in e}var EXe=30,Otr=e=>!isNaN(parseFloat(e)),R1={current:void 0},JW=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{let o=Yi.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Yi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Otr(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Jy);let n=this.events[t].add(r);return t==="change"?()=>{n(),dn.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return R1.current&&R1.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=Yi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>EXe)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,EXe);return V_(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Md(e,t){return new JW(e,t)}var{schedule:N1,cancel:_tr}=_W(queueMicrotask,!1);var Jp={x:!1,y:!1};function eG(){return Jp.x||Jp.y}function Ece(e){return e==="x"||e==="y"?Jp[e]?null:(Jp[e]=!0,()=>{Jp[e]=!1}):Jp.x||Jp.y?null:(Jp.x=Jp.y=!0,()=>{Jp.x=Jp.y=!1})}function tG(e,t){let r=pF(e),n=new AbortController,o={passive:!0,...t,signal:n.signal};return[r,o,()=>n.abort()]}function DXe(e){return!(e.pointerType==="touch"||eG())}function Dce(e,t,r={}){let[n,o,a]=tG(e,r),i=s=>{if(!DXe(s))return;let{target:l}=s,c=t(l,s);if(typeof c!="function"||!l)return;let u=d=>{DXe(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return n.forEach(s=>{s.addEventListener("pointerenter",i,o)}),a}var Oce=(e,t)=>t?e===t?!0:Oce(e,t.parentElement):!1;var M1=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var Ftr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function OXe(e){return Ftr.has(e.tagName)||e.tabIndex!==-1}var yM=new WeakSet;function _Xe(e){return t=>{t.key==="Enter"&&e(t)}}function _ce(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var FXe=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=_Xe(()=>{if(yM.has(r))return;_ce(r,"down");let o=_Xe(()=>{_ce(r,"up")}),a=()=>_ce(r,"cancel");r.addEventListener("keyup",o,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function BXe(e){return M1(e)&&!eG()}function Fce(e,t,r={}){let[n,o,a]=tG(e,r),i=s=>{let l=s.currentTarget;if(!BXe(s))return;yM.add(l);let c=t(l,s),u=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),yM.has(l)&&yM.delete(l),BXe(p)&&typeof c=="function"&&c(p,{success:m})},d=p=>{u(p,l===window||l===document||r.useGlobalTarget||Oce(l,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return n.forEach(s=>{(r.useGlobalTarget?window:s).addEventListener("pointerdown",i,o),hF(s)&&(s.addEventListener("focus",c=>FXe(c,o)),!OXe(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function T1(e){return F_(e)&&"ownerSVGElement"in e}function gF(e){return T1(e)&&e.tagName==="svg"}function Bce(...e){let t=!Array.isArray(e[0]),r=t?0:-1,n=e[0+r],o=e[1+r],a=e[2+r],i=e[3+r],s=WW(o,a,i);return t?s(n):s}var Io=e=>!!(e&&e.getVelocity);var Btr=[...Tce,fi,$c],Vce=e=>Btr.find(ZW(e));var rG=D(lt(),1),ox=D(lt(),1);var VXe=D(lt(),1),rw=(0,VXe.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Uce=class extends rG.Component{getSnapshotBeforeUpdate(t){let r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){let n=r.offsetParent,o=hF(n)&&n.offsetWidth||0,a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft,a.right=o-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}};function zXe({children:e,isPresent:t,anchorX:r,root:n}){let o=(0,ox.useId)(),a=(0,ox.useRef)(null),i=(0,ox.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=(0,ox.useContext)(rw);return(0,ox.useInsertionEffect)(()=>{let{width:l,height:c,top:u,left:d,right:f}=i.current;if(t||!a.current||!l||!c)return;let p=r==="left"?`left: ${d}`:`right: ${f}`;a.current.dataset.motionPopId=o;let m=document.createElement("style");s&&(m.nonce=s);let h=n??document.head;return h.appendChild(m),m.sheet&&m.sheet.insertRule(`
|
|
407
|
+
`)}function MZt(e,t){if(!t||t.length===0)return JSON.stringify(e,null,2);let r=e.map(n=>{let o={};return t.forEach(a=>{a in n&&(o[a]=n[a])}),o});return JSON.stringify(r,null,2)}function TZt(e,t,r){let n=new Blob([e],{type:r}),o=URL.createObjectURL(n),a=document.createElement("a");a.href=o,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}async function LKe(e,t){let{format:r,filename:n="data-export",columns:o,includeHeaders:a=!0}=t,i,s,l;switch(r){case"csv":i=NZt(e,o,a),s="text/csv;charset=utf-8;",l="csv";break;case"json":i=MZt(e,o),s="application/json;charset=utf-8;",l="json";break;case"xlsx":throw new Error("XLSX export requires additional dependencies. Use CSV format instead.");default:throw new Error(`Unsupported export format: ${r}`)}let c=`${n}-${new Date().toISOString().split("T")[0]}.${l}`;TZt(i,c,s)}function EKe(e,t){return e.filter(r=>{let n=r.id||r.accessorKey;return n&&t[n]!==!1}).map(r=>r.id||r.accessorKey).filter(Boolean)}var m1=D(ce(),1),DKe=D(kh(),1);var Ut=D(de(),1),AZt={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Not contains",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",in:"In",notIn:"Not in",isNull:"Is empty",isNotNull:"Is not empty"};function LZt(e){switch(e){case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","isNull","isNotNull"];case"date":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","isNull","isNotNull"];case"boolean":return["equals","notEquals","isNull","isNotNull"];case"select":return["equals","notEquals","in","notIn","isNull","isNotNull"];default:return["equals","notEquals","contains","notContains","startsWith","endsWith","isNull","isNotNull"]}}function OKe({table:e,open:t,onOpenChange:r,position:n="right",width:o="400px",filters:a,onFiltersChange:i,customFilters:s,matchAll:l,onMatchAllChange:c}){let[u,d]=(0,m1.useState)([]),[f,p]=(0,m1.useState)(!0),m=a||u,h=i||d,g=l!==void 0?l:f,v=c||p,y=(0,m1.useMemo)(()=>e.getAllColumns().filter(N=>N.id==="select"||N.id==="actions"||N.id==="expander"?!1:N.getCanFilter()),[e]),x=()=>{let N=y[0];if(!N)return;let M={column:N.id,operator:"contains",value:""};h([...m,M])},w=(N,M)=>{let A=[...m];A[N]={...A[N],...M},h(A)},b=N=>{h(m.filter((M,A)=>A!==N))},C=()=>{h([]),e.resetColumnFilters()},S=()=>{e.resetColumnFilters(),[...new Set(m.map(M=>M.column))].forEach(M=>{let A=e.getColumn(M);A&&A.setFilterValue({custom:!0,filters:m,matchAll:g})}),m.length===0&&e.resetColumnFilters(),r(!1)};if(typeof document>"u")return null;let I=(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)(_t,{children:t&&(0,Ut.jsx)(ne.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/20",style:{zIndex:9998},onClick:()=>r(!1)})}),(0,Ut.jsx)(_t,{children:t&&(0,Ut.jsx)(ne.div,{initial:{x:n==="right"?"100%":"-100%"},animate:{x:0},exit:{x:n==="right"?"100%":"-100%"},transition:{type:"spring",damping:30,stiffness:300},className:B("fixed top-0 bottom-0 bg-background border-l shadow-xl",n==="right"?"right-0":"left-0"),style:{width:o,zIndex:9999},children:(0,Ut.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Ut.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsx)(Di,{className:"h-5 w-5"}),(0,Ut.jsx)("h2",{className:"text-lg font-semibold",children:"Filters"}),m.length>0&&(0,Ut.jsxs)("span",{className:"text-sm text-muted-foreground",children:["(",m.length," active)"]})]}),(0,Ut.jsx)(re,{variant:"ghost",size:"icon",onClick:()=>r(!1),children:(0,Ut.jsx)(sr,{className:"h-4 w-4"})})]}),(0,Ut.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[(0,Ut.jsxs)("div",{className:"mb-6",children:[(0,Ut.jsx)(It,{className:"text-sm font-medium mb-2 block",children:"Match conditions"}),(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsx)(re,{variant:g?"primary":"outline",size:"sm",onClick:()=>v(!0),className:"flex-1",children:"Match all"}),(0,Ut.jsx)(re,{variant:g?"outline":"primary",size:"sm",onClick:()=>v(!1),className:"flex-1",children:"Match any"})]})]}),(0,Ut.jsx)(Is,{className:"mb-6"}),s&&(0,Ut.jsxs)(Ut.Fragment,{children:[s,(0,Ut.jsx)(Is,{className:"my-6"})]}),(0,Ut.jsx)("div",{className:"space-y-4",children:m.map((N,M)=>(0,Ut.jsx)(EZt,{filter:N,columns:y,onUpdate:A=>w(M,A),onRemove:()=>b(M)},M))}),(0,Ut.jsxs)(re,{variant:"outline",size:"sm",onClick:x,className:"w-full mt-4",children:[(0,Ut.jsx)(yi,{className:"h-4 w-4 mr-2"}),"Add filter"]})]}),(0,Ut.jsx)("div",{className:"p-4 border-t space-y-2",children:(0,Ut.jsxs)("div",{className:"flex gap-2",children:[(0,Ut.jsxs)(re,{variant:"outline",onClick:C,disabled:m.length===0,className:"flex-1",children:[(0,Ut.jsx)(Zi,{className:"h-4 w-4 mr-2"}),"Clear all"]}),(0,Ut.jsx)(re,{onClick:S,className:"flex-1",children:"Apply filters"})]})})]})})})]});return(0,DKe.createPortal)(I,document.body)}function EZt({filter:e,columns:t,onUpdate:r,onRemove:n}){let a=t.find(p=>p.id===e.column)?.columnDef,i=a?.meta?.filterType||"string",s=a?.meta?.filterOptions,l=a?.meta?.filterValueAccessor,c=LZt(i),u=e.operator!=="isNull"&&e.operator!=="isNotNull",d=e.operator==="in"||e.operator==="notIn",f=m1.default.useMemo(()=>i!=="select"&&!s?null:s||null,[i,s]);return(0,Ut.jsxs)("div",{className:"space-y-2 p-3 border rounded-lg bg-muted/30",children:[(0,Ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ut.jsxs)($o,{value:e.column,onValueChange:p=>r({column:p}),children:[(0,Ut.jsx)(qo,{className:"flex-1",children:(0,Ut.jsx)(aa,{})}),(0,Ut.jsx)(Wo,{style:{zIndex:1e4},children:t.map(p=>{let m=p.columnDef.header,h=typeof m=="function"?p.id:m||p.id;return(0,Ut.jsx)(Ft,{value:p.id,children:h},p.id)})})]}),(0,Ut.jsx)(re,{variant:"ghost",size:"icon",onClick:n,className:"h-8 w-8",children:(0,Ut.jsx)(sr,{className:"h-4 w-4"})})]}),(0,Ut.jsxs)($o,{value:e.operator,onValueChange:p=>r({operator:p}),children:[(0,Ut.jsx)(qo,{children:(0,Ut.jsx)(aa,{})}),(0,Ut.jsx)(Wo,{style:{zIndex:1e4},children:c.map(p=>(0,Ut.jsx)(Ft,{value:p,children:AZt[p]},p))})]}),u&&(0,Ut.jsx)("div",{children:i==="boolean"?(0,Ut.jsxs)($o,{value:String(e.value),onValueChange:p=>r({value:p==="true"}),children:[(0,Ut.jsx)(qo,{children:(0,Ut.jsx)(aa,{})}),(0,Ut.jsxs)(Wo,{style:{zIndex:1e4},children:[(0,Ut.jsx)(Ft,{value:"true",children:"True"}),(0,Ut.jsx)(Ft,{value:"false",children:"False"})]})]}):(i==="select"||f)&&!d?(0,Ut.jsxs)($o,{value:e.value||"",onValueChange:p=>r({value:p}),children:[(0,Ut.jsx)(qo,{children:(0,Ut.jsx)(aa,{placeholder:"Select value..."})}),(0,Ut.jsx)(Wo,{style:{zIndex:1e4},children:f?.map(p=>(0,Ut.jsx)(Ft,{value:p,children:p},p))})]}):(i==="select"||f)&&d?(0,Ut.jsxs)("div",{className:"space-y-2",children:[(0,Ut.jsx)("div",{className:"text-xs text-muted-foreground",children:"Select multiple values:"}),(0,Ut.jsx)("div",{className:"space-y-1 max-h-32 overflow-y-auto border rounded-md p-2",children:f?.map(p=>{let m=Array.isArray(e.value)?e.value:[],h=m.includes(p);return(0,Ut.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer hover:bg-muted/50 p-1 rounded",children:[(0,Ut.jsx)("input",{type:"checkbox",checked:h,onChange:g=>{let v=g.target.checked?[...m,p]:m.filter(y=>y!==p);r({value:v})},className:"rounded border-gray-300"}),(0,Ut.jsx)("span",{className:"text-sm",children:p})]},p)})})]}):i==="number"?(0,Ut.jsx)(Jt,{type:"number",value:e.value||"",onChange:p=>r({value:p.target.value}),placeholder:"Enter value..."}):d?(0,Ut.jsx)(Jt,{value:Array.isArray(e.value)?e.value.join(", "):e.value||"",onChange:p=>r({value:p.target.value}),placeholder:"Enter values separated by comma..."}):(0,Ut.jsx)(Jt,{value:e.value||"",onChange:p=>r({value:p.target.value}),placeholder:"Enter value..."})})]})}var Zg=D(ce(),1);var ca=D(de(),1);function _Ke({table:e,filter:t,data:r}){let[n,o]=(0,Zg.useState)(!1),[a,i]=(0,Zg.useState)(""),s=Zg.default.useMemo(()=>{let v=e.getColumn(t.column);return v||(v=e.getAllColumns().find(x=>x.id===t.column||x.columnDef.accessorKey===t.column)),v},[e,t.column]),l=(0,Zg.useMemo)(()=>{if(t.options&&t.options!=="auto")return t.options;let v=new Set;return r.forEach(y=>{let x=y[t.column];if(x===void 0&&t.column.includes(".")){let w=t.column.split(".");x=y;for(let b of w)x=x?.[b]}x!=null&&x!==""&&v.add(String(x))}),Array.from(v).sort()},[r,t.column,t.options]),c=s?.getFilterValue(),u=(0,Zg.useMemo)(()=>c?Array.isArray(c)?new Set(c):new Set([String(c)]):new Set,[c]),d=(0,Zg.useMemo)(()=>{if(!t.showCounts)return{};let v={};return r.forEach(y=>{let x=y[t.column];if(x===void 0&&t.column.includes(".")){let w=t.column.split(".");x=y;for(let b of w)x=x?.[b]}if(x!=null&&x!==""){let w=String(x);v[w]=(v[w]||0)+1}}),v},[r,t.column,t.showCounts]),f=v=>{if(s)if(t.multi){let y=new Set(u);y.has(v)?y.delete(v):y.add(v),y.size===0?s.setFilterValue(void 0):s.setFilterValue(Array.from(y))}else u.has(v)?s.setFilterValue(void 0):s.setFilterValue(v)},p=()=>{s?.setFilterValue(void 0),i("")},m=t.label||t.column,h=(0,Zg.useMemo)(()=>a?l.filter(v=>v.toLowerCase().includes(a.toLowerCase())):l,[l,a]),g=!s||l.length===0;return(0,ca.jsxs)(Bi,{open:n,onOpenChange:o,children:[(0,ca.jsx)(Vi,{asChild:!0,children:(0,ca.jsxs)(re,{variant:"outline",size:"sm",disabled:g,className:B("h-8 border-dashed",u.size>0&&"border-solid"),children:[m,u.size>0&&(0,ca.jsxs)(ca.Fragment,{children:[(0,ca.jsx)("span",{className:"mx-2 h-4 w-px bg-border"}),(0,ca.jsx)(dt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:u.size})]})]})}),(0,ca.jsx)(Ii,{className:"w-[250px] p-0",align:"start",children:(0,ca.jsxs)("div",{className:"p-2",children:[l.length>0&&(0,ca.jsx)("div",{className:"pb-2",children:(0,ca.jsxs)("div",{className:"relative",children:[(0,ca.jsx)(co,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),(0,ca.jsx)(Jt,{placeholder:`Search ${m.toLowerCase()}...`,value:a,onChange:v=>i(v.target.value),className:"h-8 w-full pl-8"})]})}),l.length===0?(0,ca.jsx)("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No options available"}):h.length===0?(0,ca.jsx)("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No results found"}):(0,ca.jsx)("div",{className:"space-y-1 max-h-[300px] overflow-y-auto",children:h.map(v=>{let y=u.has(v);return(0,ca.jsxs)("button",{onClick:()=>f(v),className:B("flex w-full items-center justify-between rounded px-2 py-1.5 text-sm hover:bg-accent",y&&"bg-accent"),children:[(0,ca.jsxs)("div",{className:"flex items-center",children:[(0,ca.jsx)("div",{className:B("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",y?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,ca.jsx)(en,{className:"h-4 w-4"})}),(0,ca.jsx)("span",{children:v})]}),t.showCounts&&d[v]!==void 0&&(0,ca.jsx)("span",{className:"text-xs text-muted-foreground",children:d[v]})]},v)})}),u.size>0&&(0,ca.jsx)("div",{className:"border-t mt-2 pt-2",children:(0,ca.jsx)(re,{variant:"ghost",size:"sm",className:"w-full justify-center",onClick:p,children:"Clear filter"})})]})})]})}var n_=D(ce(),1);var Ln=D(de(),1);function FKe({table:e,column:t,title:r,options:n="auto",data:o}){let a=e.getColumn(t),[i,s]=(0,n_.useState)("");if(!a)return null;let l=a.columnDef,c=l?.meta?.filterValueAccessor,u=l?.meta?.filterOptions,d=b=>c?c(b):b[t],{availableOptions:f,optionCounts:p}=(0,n_.useMemo)(()=>{let b={},C=new Set;o.forEach(I=>{let N=d(I);if(N!=null&&N!==""){let M=String(N);C.add(M),b[M]=(b[M]||0)+1}});let S=[];return n!=="auto"?S=n:u?S=u.map(I=>({value:I,label:I})):S=Array.from(C).sort().slice(0,50).map(I=>({value:I,label:I})),{availableOptions:S,optionCounts:b}},[o,n,u]),m=a.getFilterValue(),h=new Set(m||[]),g=(0,n_.useMemo)(()=>i?f.filter(b=>(b.label||b.value).toLowerCase().includes(i.toLowerCase())):f,[f,i]),v=r||a.columnDef.header||t,y=b=>{let C=new Set(h);C.has(b)?C.delete(b):C.add(b),C.size===0?a.setFilterValue(void 0):a.setFilterValue(Array.from(C))},x=()=>{a.setFilterValue(void 0),s("")},w=()=>{let b=g.map(C=>C.value);a.setFilterValue(b)};return(0,Ln.jsxs)(Bi,{children:[(0,Ln.jsx)(Vi,{asChild:!0,children:(0,Ln.jsxs)(re,{variant:"outline",size:"sm",className:B("h-8 border-dashed",h.size>0&&"border-solid"),children:[(0,Ln.jsx)(zx,{className:"mr-2 h-4 w-4"}),v,h.size>0&&(0,Ln.jsxs)(Ln.Fragment,{children:[(0,Ln.jsx)(Is,{orientation:"vertical",className:"mx-2 h-4"}),(0,Ln.jsx)(dt,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:h.size}),(0,Ln.jsx)("div",{className:"hidden space-x-1 lg:flex",children:h.size>2?(0,Ln.jsxs)(dt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[h.size," selected"]}):Array.from(h).slice(0,2).map(b=>{let C=f.find(S=>S.value===b);return(0,Ln.jsx)(dt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:C?.label||b},b)})})]})]})}),(0,Ln.jsxs)(Ii,{className:"w-[300px] p-0",align:"start",children:[(0,Ln.jsx)("div",{className:"p-3",children:(0,Ln.jsxs)("div",{className:"relative",children:[(0,Ln.jsx)(co,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),(0,Ln.jsx)(Jt,{placeholder:`Search ${v.toLowerCase()}...`,value:i,onChange:b=>s(b.target.value),className:"h-8 pl-8"})]})}),(0,Ln.jsx)(Is,{}),(0,Ln.jsx)("div",{className:"max-h-[300px] overflow-y-auto",children:g.length===0?(0,Ln.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No results found"}):(0,Ln.jsx)("div",{className:"p-2",children:g.map(b=>{let C=h.has(b.value),S=p[b.value]||0;return(0,Ln.jsxs)(re,{variant:"ghost",size:"sm",className:"w-full justify-start font-normal",onClick:()=>y(b.value),children:[(0,Ln.jsx)("div",{className:B("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",C?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,Ln.jsx)(en,{className:B("h-4 w-4")})}),b.icon&&(0,Ln.jsx)("span",{className:"mr-2",children:b.icon}),(0,Ln.jsx)("span",{className:"flex-1 text-left",children:b.label||b.value}),S>0&&(0,Ln.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:S})]},b.value)})})}),(h.size>0||g.length>0)&&(0,Ln.jsxs)(Ln.Fragment,{children:[(0,Ln.jsx)(Is,{}),(0,Ln.jsxs)("div",{className:"flex items-center justify-between p-2",children:[h.size>0?(0,Ln.jsxs)(re,{variant:"ghost",size:"sm",onClick:x,className:"h-8 px-2 lg:px-3",children:["Clear",(0,Ln.jsx)(sr,{className:"ml-2 h-4 w-4"})]}):(0,Ln.jsxs)(re,{variant:"ghost",size:"sm",onClick:w,className:"h-8 px-2 lg:px-3",children:["Select all",(0,Ln.jsx)(en,{className:"ml-2 h-4 w-4"})]}),(0,Ln.jsxs)("span",{className:"text-xs text-muted-foreground",children:[h.size," of ",f.length," selected"]})]})]})]})]})}var Je=D(de(),1);function Ble({columns:e,data:t,searchable:r=!0,filterable:n=!0,exportable:o=!0,selectable:a=!1,pagination:i=!0,pageSize:s=10,pageSizeOptions:l=[5,10,20,50,100],className:c,onRowSelect:u,onExport:d,enableExpandable:f=!1,renderSubComponent:p,expandedRows:m,onRowExpandChange:h,bulkActions:g=[],quickFilters:v=[],facetedFilters:y=[],features:x={},theme:w={},texts:b={},enableSorting:C=!0,enableFiltering:S=!0,enablePagination:I=!0,enableColumnVisibility:N=!0,enableRowSelection:M,filterPlaceholder:A="Search all columns...",defaultPageSize:T,manualPagination:O=!1,pageCount:F,onPaginationChange:P,onSortingChange:k,onColumnFiltersChange:R,state:L}){let _=Gi.default.useMemo(()=>e.map(De=>{let{enableHiding:gt,...Ke}=De;return{...Ke,enableHiding:!0,filterFn:"custom"}}),[e]),{hasProAccess:U,isLoading:V}=Yt();if(!V&&!U)return(0,Je.jsx)(Ve,{className:B("w-full",c),children:(0,Je.jsx)(ze,{className:"py-12 text-center",children:(0,Je.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,Je.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Je.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Je.jsxs)("div",{children:[(0,Je.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Je.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Data Table is available exclusively to MoonUI Pro subscribers."}),(0,Je.jsx)("div",{className:"flex gap-3 justify-center",children:(0,Je.jsx)("a",{href:"/pricing",children:(0,Je.jsxs)(re,{size:"sm",children:[(0,Je.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[E,H]=Gi.default.useState([]),[j,$]=Gi.default.useState([]),[W,z]=Gi.default.useState({}),[G,X]=Gi.default.useState({}),[Y,oe]=Gi.default.useState(""),[ie,Le]=Gi.default.useState({pageIndex:0,pageSize:T||s||10}),[Ce,Be]=Gi.default.useState(!1),[he,Re]=Gi.default.useState(new Set),[ye,Oe]=Gi.default.useState(!1),Q=m||he,Z=h?De=>h(De):Re,me=T||s,ke=Gi.default.useMemo(()=>t,[t]),fe=De=>()=>{let Ke=(L?.sorting??E).find(Vr=>Vr.id===De),Vt=[];Ke?Ke.desc?Vt=[]:Vt=[{id:De,desc:!0}]:Vt=[{id:De,desc:!1}];let jt=k!==void 0?k:H;typeof jt=="function"&&jt(Vt)},Pe=Gi.default.useRef(null),te=Gi.default.useCallback(De=>{let gt=typeof De=="function"?De(G):De;if(X(gt),u&&Pe.current){let Ke=Object.keys(gt).filter(jt=>gt[jt]),Vt=Pe.current.getRowModel().rows.filter(jt=>Ke.includes(jt.id)).map(jt=>jt.original);u(Vt)}},[G,u]),xe=Gi.default.useMemo(()=>{let De=_.map(Ke=>!Ke.id&&Ke.accessorKey?{...Ke,id:Ke.accessorKey}:Ke),gt=De.some(Ke=>{if(Ke.id==="select")return!0;let Vt=Ke.header?.toString()||"",jt=Ke.cell?.toString()||"";return Vt.includes("Checkbox")||jt.includes("Checkbox")});return(a||M)&&!gt&&(De=[{id:"select",header:({table:Vt})=>{let jt=Vt.getIsAllPageRowsSelected(),Vr=Vt.getIsSomePageRowsSelected();return(0,Je.jsx)("div",{className:"flex items-center justify-center",children:(0,Je.jsx)(ql,{checked:jt?!0:Vr?"indeterminate":!1,onCheckedChange:fn=>{Vt.toggleAllPageRowsSelected(!!fn)},"aria-label":"Select all",className:"h-4 w-4"})})},cell:({row:Vt})=>{let jt=Vt.getIsSelected();return(0,Je.jsx)("div",{className:"flex items-center justify-center",children:(0,Je.jsx)(ql,{checked:jt,onCheckedChange:Vr=>Vt.toggleSelected(!!Vr),disabled:!Vt.getCanSelect(),"aria-label":"Select row",className:"h-4 w-4"},`select-${Vt.id}-${jt}`)})},enableSorting:!1,enableHiding:!1,size:40,maxSize:40},...De]),De},[_,a,M]),se=w9e({data:ke,columns:xe,onSortingChange:k!==void 0?k:H,onColumnFiltersChange:R!==void 0?R:$,onPaginationChange:P!==void 0?P:Le,getCoreRowModel:v9e(),getPaginationRowModel:x9e(),getSortedRowModel:b9e(),getFilteredRowModel:y9e(),enableSortingRemoval:!0,enableMultiSort:!1,sortDescFirst:!1,onColumnVisibilityChange:z,onRowSelectionChange:te,onGlobalFilterChange:oe,globalFilterFn:"includesString",enableRowSelection:a||M||!1,filterFns:{custom:(De,gt,Ke)=>{if(Array.isArray(Ke)){let No=se.getColumn(gt)?.columnDef?.meta?.filterValueAccessor,Ma=No?No(De.original):De.getValue(gt);return Ke.includes(String(Ma))}if(typeof Ke=="string"||typeof Ke=="number"||typeof Ke=="boolean"){let No=se.getColumn(gt)?.columnDef?.meta?.filterValueAccessor,Ma=No?No(De.original):De.getValue(gt);return String(Ma)===String(Ke)}if(!Ke?.custom||!Ke?.filters)return!0;let Vt=Ke.filters,jt=Ke.matchAll!==void 0?Ke.matchAll:!0,Vr=Vt.map(fn=>{let Ma=se.getColumn(fn.column)?.columnDef?.meta?.filterValueAccessor,Dr=Ma?Ma(De.original):De.getValue(fn.column),vn=fn.value;switch(fn.operator){case"equals":return Dr===vn;case"notEquals":return Dr!==vn;case"contains":return String(Dr).toLowerCase().includes(String(vn).toLowerCase());case"notContains":return!String(Dr).toLowerCase().includes(String(vn).toLowerCase());case"startsWith":return String(Dr).toLowerCase().startsWith(String(vn).toLowerCase());case"endsWith":return String(Dr).toLowerCase().endsWith(String(vn).toLowerCase());case"greaterThan":return Number(Dr)>Number(vn);case"lessThan":return Number(Dr)<Number(vn);case"greaterThanOrEqual":return Number(Dr)>=Number(vn);case"lessThanOrEqual":return Number(Dr)<=Number(vn);case"in":return Array.isArray(vn)?vn.includes(Dr):String(vn).split(",").map(js=>js.trim()).includes(String(Dr));case"notIn":return Array.isArray(vn)?!vn.includes(Dr):!String(vn).split(",").map(js=>js.trim()).includes(String(Dr));case"isNull":return Dr==null||Dr==="";case"isNotNull":return Dr!=null&&Dr!=="";default:return!0}});return jt?Vr.every(fn=>fn):Vr.some(fn=>fn)}},manualPagination:O,pageCount:F,state:{sorting:L?.sorting??E,columnFilters:L?.columnFilters??j,columnVisibility:L?.columnVisibility??W,rowSelection:L?.rowSelection??G,globalFilter:L?.globalFilter??Y,pagination:L?.pagination??ie},initialState:{pagination:{pageSize:me}},autoResetAll:!1,autoResetPageIndex:!1,autoResetExpanded:!1,getRowId:(De,gt)=>{let Ke=De;return Ke.id!==void 0&&Ke.id!==null&&Ke.id!==""?String(Ke.id):Ke.orderId!==void 0&&Ke.orderId!==null?String(Ke.orderId):Ke.orderNumber!==void 0&&Ke.orderNumber!==null?String(Ke.orderNumber):Ke.email?`email-${Ke.email}`:Ke.name&&Ke.email?`${Ke.name}-${Ke.email}`:Ke.name?`name-${Ke.name}-${gt}`:String(gt)}});Pe.current=se;let ae=se.getState(),_e=se.getRowModel(),Dt=Gi.default.useRef(_e.rows),vo=Gi.default.useMemo(()=>{let De=Dt.current!==_e.rows;return De&&(Dt.current=_e.rows),De},[_e.rows]),Ye=Dt.current,tt={sorting:x.sorting!==!1,filtering:x.filtering!==!1||n,pagination:x.pagination!==!1||i,search:x.search!==!1||r,columnVisibility:x.columnVisibility!==!1,rowSelection:x.rowSelection!==!1||a,export:x.export!==!1||o},Ie=async De=>{let gt=se.getFilteredSelectedRowModel().rows,Ke=gt.length>0?gt.map(Vr=>Vr.original):se.getFilteredRowModel().rows.map(Vr=>Vr.original);if(typeof o=="object"&&o.onExport){o.onExport(Ke,De);return}if(d){d(Ke);return}let Vt=typeof o=="object"&&o.filename?o.filename:"data-export",jt=EKe(_,W);await LKe(Ke,{format:De,filename:Vt,columns:jt,includeHeaders:!0})},ht=Gi.default.useMemo(()=>o?o===!0?["csv","json"]:typeof o=="object"&&o.formats?o.formats:["csv","json"]:[],[o]),Mt=()=>{se.resetRowSelection()};return(0,Je.jsxs)("div",{className:B("moonui-pro-datatable-container flex flex-col gap-4",c),children:[a&&se.getFilteredSelectedRowModel().rows.length>0&&(0,Je.jsxs)("div",{className:"flex items-center justify-between rounded-md bg-muted/50 px-4 py-2",children:[(0,Je.jsxs)("span",{className:"text-sm text-muted-foreground",children:[se.getFilteredSelectedRowModel().rows.length," Selected"]}),g.length>0&&(0,Je.jsx)(AKe,{selectedRows:se.getFilteredSelectedRowModel().rows.map(De=>De.original),actions:g,onClearSelection:Mt})]}),(0,Je.jsxs)("div",{className:"moonui-pro-datatable-toolbar flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,Je.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[r&&(0,Je.jsxs)("div",{className:"relative",children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(co,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"})}),(0,Je.jsx)(Jt,{placeholder:A,value:Y,onChange:De=>oe(De.target.value),className:"pl-8 w-full sm:w-64"})]}),v.length>0&&(0,Je.jsx)("div",{className:"flex items-center gap-2",children:v.map((De,gt)=>(0,Je.jsx)(_Ke,{table:se,filter:De,data:t},`quick-${De.column}-${gt}`))}),y.length>0&&(0,Je.jsx)("div",{className:"flex items-center gap-2",children:y.map((De,gt)=>{let Ke=typeof De=="string"?De:De.column,Vt=typeof De=="string"?void 0:De.label;return(0,Je.jsx)(FKe,{table:se,column:Ke,title:Vt,data:t},`faceted-${Ke}-${gt}`)})}),n&&(0,Je.jsxs)(re,{variant:"outline",size:"sm",onClick:()=>Oe(!0),children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Di,{className:"mr-2 h-4 w-4"})}),"Filters",j.length>0&&(0,Je.jsx)("span",{className:"ml-2 rounded-full bg-primary px-2 py-0.5 text-xs text-primary-foreground",children:j.length})]})]}),(0,Je.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o&&ht.length>0&&(0,Je.jsxs)(Nr,{children:[(0,Je.jsx)(Mr,{asChild:!0,children:(0,Je.jsxs)(re,{variant:"outline",size:"sm",children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(xn,{className:"mr-2 h-4 w-4"})}),"Export"]})}),(0,Je.jsxs)(Sr,{align:"end",children:[ht.includes("csv")&&(0,Je.jsxs)(Ue,{onClick:()=>Ie("csv"),children:[(0,Je.jsx)(Pv,{className:"mr-2 h-4 w-4"}),"Export as CSV"]}),ht.includes("json")&&(0,Je.jsxs)(Ue,{onClick:()=>Ie("json"),children:[(0,Je.jsx)(Bw,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),ht.includes("xlsx")&&(0,Je.jsxs)(Ue,{onClick:()=>Ie("xlsx"),children:[(0,Je.jsx)(vA,{className:"mr-2 h-4 w-4"}),"Export as Excel"]})]})]}),(0,Je.jsx)(C9e,{table:se})]})]}),(0,Je.jsx)("div",{className:"moonui-pro-datatable-wrapper rounded-md border overflow-hidden",style:{contain:"layout style"},children:(0,Je.jsx)("div",{style:{overflowX:"auto"},children:(0,Je.jsxs)("table",{className:"moonui-pro-datatable",style:{width:"100%",tableLayout:"auto"},children:[(0,Je.jsx)("thead",{className:"moonui-data-table-header",children:se.getHeaderGroups().map(De=>(0,Je.jsx)("tr",{className:"moonui-data-table-row border-b",children:De.headers.filter(gt=>gt.column.getIsVisible()).map(gt=>(0,Je.jsx)("th",{className:"moonui-data-table-th h-12 px-4 text-left align-middle font-medium text-muted-foreground",children:gt.isPlaceholder?null:(0,Je.jsxs)("div",{className:B("flex items-center space-x-2",gt.column.getCanSort()&&"cursor-pointer select-none"),onClick:gt.column.getCanSort()?fe(gt.column.id):void 0,children:[ele(gt.column.columnDef.header,gt.getContext()),gt.column.getCanSort()&&(0,Je.jsx)("div",{className:"ml-2",children:gt.column.getIsSorted()==="asc"?(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Cv,{className:"h-4 w-4"})}):gt.column.getIsSorted()==="desc"?(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Gf,{className:"h-4 w-4"})}):(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(wv,{className:"h-4 w-4"})})})]})},gt.id))},De.id))}),(0,Je.jsx)("tbody",{className:"moonui-data-table-body",children:Ce?(0,Je.jsx)(ne.tr,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:(0,Je.jsx)("td",{colSpan:se.getAllLeafColumns().filter(De=>De.getIsVisible()).length,className:"h-24 text-center",children:(0,Je.jsxs)("div",{className:"flex items-center justify-center space-x-2",children:[(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Rr,{className:"h-4 w-4 animate-spin"})}),(0,Je.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading..."})]})})},"loading"):Ye?.length?(0,Je.jsx)(Je.Fragment,{children:Ye.map((De,gt)=>{let Ke=De.original.id||De.id,Vt=f&&Q.has(Ke);return(0,Je.jsx)(BKe,{row:De,columns:_,isExpanded:Vt,enableExpandable:f,renderSubComponent:p,visibilityState:se.getState().columnVisibility},Ke)})}):(0,Je.jsx)(ne.tr,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:(0,Je.jsx)("td",{colSpan:se.getAllLeafColumns().filter(De=>De.getIsVisible()).length,className:"h-24 text-center",children:"No results found."})},"no-results")})]})})}),i&&(0,Je.jsxs)("div",{className:"flex items-center justify-between px-2",children:[(0,Je.jsx)("div",{className:"flex-1 text-sm text-muted-foreground",children:a&&se.getFilteredSelectedRowModel().rows.length>0&&(0,Je.jsxs)("span",{children:[se.getFilteredSelectedRowModel().rows.length," ","of ",se.getFilteredRowModel().rows.length," ","row(s) selected."]})}),(0,Je.jsxs)("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Je.jsx)("p",{className:"text-sm font-medium",children:"Rows per page"}),(0,Je.jsx)("select",{value:se.getState().pagination.pageSize,onChange:async De=>{let gt=Number(De.target.value);P?P({pageIndex:se.getState().pagination.pageIndex,pageSize:gt}):(Be(!0),await new Promise(Ke=>setTimeout(Ke,300)),se.setPageSize(gt),Be(!1))},className:"h-8 w-[70px] rounded border border-input bg-background px-3 py-1 text-sm",disabled:Ce,children:l.map(De=>(0,Je.jsx)("option",{value:De,children:De},De))})]}),(0,Je.jsxs)("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",se.getState().pagination.pageIndex+1," of"," ",se.getPageCount()]}),(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Je.jsx)(re,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:async()=>{P?P({pageIndex:0,pageSize:se.getState().pagination.pageSize}):(Be(!0),await new Promise(De=>setTimeout(De,300)),se.setPageIndex(0),Be(!1))},disabled:!se.getCanPreviousPage()||Ce,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(fA,{className:"h-4 w-4"})})}),(0,Je.jsx)(re,{variant:"outline",className:"h-8 w-8 p-0",onClick:async()=>{if(P){let De=se.getState().pagination.pageIndex;P({pageIndex:De-1,pageSize:se.getState().pagination.pageSize})}else Be(!0),await new Promise(De=>setTimeout(De,300)),se.previousPage(),Be(!1)},disabled:!se.getCanPreviousPage()||Ce,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(ga,{className:"h-4 w-4"})})}),(0,Je.jsx)(re,{variant:"outline",className:"h-8 w-8 p-0",onClick:async()=>{Be(!0),await new Promise(De=>setTimeout(De,300)),se.nextPage(),Be(!1)},disabled:!se.getCanNextPage()||Ce,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(Kn,{className:"h-4 w-4"})})}),(0,Je.jsx)(re,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:async()=>{Be(!0),await new Promise(De=>setTimeout(De,300)),se.setPageIndex(se.getPageCount()-1),Be(!1)},disabled:!se.getCanNextPage()||Ce,children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:(0,Je.jsx)(pA,{className:"h-4 w-4"})})})]})]})]}),n&&(0,Je.jsx)(OKe,{table:se,open:ye,onOpenChange:Oe})]})}function DZt(e,t){return{id:"expander",header:()=>null,size:50,cell:({row:r})=>{let n=r.original.id||r.id,o=e.has(n);return(0,Je.jsx)("button",{onClick:a=>{a.stopPropagation(),t(n)},className:"p-2 hover:bg-muted rounded-md transition-colors","aria-label":o?"Collapse row":"Expand row",children:(0,Je.jsx)("span",{suppressHydrationWarning:!0,children:o?(0,Je.jsx)(ea,{className:"h-4 w-4 text-muted-foreground"}):(0,Je.jsx)(Kn,{className:"h-4 w-4 text-muted-foreground"})})})}}}function OZt(e=new Set){let[t,r]=Gi.default.useState(e),n=Gi.default.useCallback(i=>{r(s=>{let l=new Set(s);return l.has(i)?l.delete(i):l.add(i),l})},[]),o=Gi.default.useCallback(i=>{r(new Set(i))},[]),a=Gi.default.useCallback(()=>{r(new Set)},[]);return{expandedRows:t,setExpandedRows:r,toggleRow:n,expandAll:o,collapseAll:a}}var BKe=({row:e,columns:t,isExpanded:r,enableExpandable:n,renderSubComponent:o,visibilityState:a})=>{let i=e.original.id||e.id;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("tr",{className:B("border-b transition-colors hover:bg-muted/50",e.getIsSelected()&&"bg-muted",r&&"border-b-0"),children:e.getAllCells().filter(s=>a[s.column.id]!==!1).map(s=>(0,Je.jsx)("td",{className:"moonui-data-table-td p-4 align-middle",children:ele(s.column.columnDef.cell,s.getContext())},s.id))}),r&&o&&(0,Je.jsx)("tr",{className:"border-b",children:(0,Je.jsx)("td",{colSpan:e.getAllCells().filter(s=>a[s.column.id]!==!1).length||1,className:"p-0 overflow-hidden",children:(0,Je.jsx)("div",{className:"transition-all duration-300 ease-out",style:{maxHeight:r?"1000px":"0",opacity:r?1:0},children:(0,Je.jsx)("div",{className:"border-t border-border/50",children:o({row:{original:e.original,id:i}})})})})})]})};BKe.displayName="TableRow";var _Zt=Ble,FZt=Ble;var kn=D(ce(),1);var yW=D(Ule(),1);var Ge=D(de(),1),zle=kn.default.memo(({searchInputRef:e,searchPlaceholder:t,initialValue:r,onSearchChange:n,keyboardShortcuts:o})=>{let[a,i]=(0,kn.useState)(r||""),s=(0,kn.useRef)(void 0);(0,kn.useEffect)(()=>{i(r)},[r]);let l=(0,kn.useCallback)(c=>{let u=c.target.value;i(u),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{n(u),e.current&&e.current.focus()},150)},[n,e]);return(0,kn.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),(0,Ge.jsx)("div",{className:"p-4 border-b",children:(0,Ge.jsxs)("div",{className:"relative",children:[(0,Ge.jsx)(co,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),(0,Ge.jsx)("input",{ref:e,type:"text",placeholder:t,value:a,onChange:l,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",className:"w-full h-10 pl-9 pr-9 text-sm bg-background border border-input rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}),o&&(0,Ge.jsxs)("kbd",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 hidden sm:flex",children:[(0,Ge.jsx)("span",{className:"text-xs",children:"\u2318"}),"K"]})]})})});zle.displayName="SearchInput";function BZt({sections:e,footer:t,showSearch:r=!0,searchPlaceholder:n="Search...",searchQuery:o="",onSearchChange:a,showThemeToggle:i=!1,theme:s="system",onThemeChange:l,branding:c,collapsible:u=!0,defaultCollapsed:d=!1,floatingActionButton:f=!0,floatingActionButtonPosition:p={bottom:"1rem",left:"1rem"},floatingActionButtonClassName:m,glassmorphism:h=!1,animatedBackground:g=!1,keyboardShortcuts:v=!0,persistState:y=!0,persistKey:x="moonui-sidebar-state",onStateChange:w,customStyles:b,fullWidthItems:C=!0,enableNProgress:S=!0,className:I,activePath:N,onNavigate:M}){let[A,T]=(0,kn.useState)(!1),[O,F]=(0,kn.useState)(!1),[P,k]=(0,kn.useState)(d),[R,L]=(0,kn.useState)([]),[_,U]=(0,kn.useState)(o),[V,E]=(0,kn.useState)([]),H=(0,kn.useRef)(null);(0,kn.useEffect)(()=>{S&&yW.default.configure({easing:"ease",speed:800,showSpinner:!1,trickleSpeed:200,minimum:.2})},[S]);let j=_a(0),$=_a(0),W=jh(j,{stiffness:300,damping:30}),z=jh($,{stiffness:300,damping:30});(0,kn.useEffect)(()=>{if(y&&typeof window<"u"){let Z=localStorage.getItem(x);if(Z){let me=JSON.parse(Z);k(me.collapsed),L(me.expandedSections),E(me.pinnedItems||[])}}},[y,x]),(0,kn.useEffect)(()=>{if(y&&typeof window<"u"){let Z={collapsed:P,expandedSections:R,searchQuery:_,pinnedItems:V,recentItems:[]};localStorage.setItem(x,JSON.stringify(Z)),w?.(Z)}},[P,R,_,V,y,x,w]),(0,kn.useEffect)(()=>{let Z=()=>{T(window.innerWidth<768)};return Z(),window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]),(0,kn.useEffect)(()=>{let Z=e.filter(me=>me.defaultExpanded!==!1).map(me=>me.id);L(Z)},[e]),(0,kn.useEffect)(()=>{if(!v)return;let Z=me=>{(me.metaKey||me.ctrlKey)&&me.key==="k"&&(me.preventDefault(),H.current?.focus()),(me.metaKey||me.ctrlKey)&&me.key==="b"&&(me.preventDefault(),A?F(!O):k(!P))};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[v,A,O,P]),(0,kn.useEffect)(()=>{if(!g)return;let Z=me=>{let ke=document.querySelector(".sidebar-container")?.getBoundingClientRect();ke&&(j.set(me.clientX-ke.left),$.set(me.clientY-ke.top))};return document.addEventListener("mousemove",Z),()=>document.removeEventListener("mousemove",Z)},[g,j,$]);let G=(0,kn.useCallback)(Z=>{L(me=>me.includes(Z)?me.filter(ke=>ke!==Z):[...me,Z])},[]),X=(0,kn.useCallback)(Z=>{E(me=>me.includes(Z)?me.filter(ke=>ke!==Z):[...me,Z])},[]),Y=(0,kn.useCallback)(Z=>{Z.action?Z.action():Z.href&&(S&&(yW.default.start(),setTimeout(()=>yW.default.done(),500)),M?M(Z.href):window.location.href=Z.href,A&&F(!1))},[M,A,S]);(0,kn.useEffect)(()=>{U(o)},[o]);let oe=(0,kn.useCallback)(Z=>{U(Z),a?.(Z)},[a]),ie=(0,kn.useCallback)((Z,me)=>me?Z.filter(ke=>{let fe=ke.title.toLowerCase().includes(me.toLowerCase()),Pe=ke.items?.some(te=>te.title.toLowerCase().includes(me.toLowerCase()));return fe||Pe}):Z,[]),Le=(0,kn.useMemo)(()=>_?e.map(Z=>({...Z,filteredItems:ie(Z.items,_).map(me=>({...me,filteredChildren:me.items?ie(me.items,_):void 0}))})).filter(Z=>Z.filteredItems.length>0):e.map(Z=>({...Z,filteredItems:Z.items.map(me=>({...me,filteredChildren:me.items}))})),[e,_,ie]),Ce=(0,kn.useCallback)(Z=>{let me=Z.items&&Z.items.length>0;return!me&&!Z.title?null:(0,Ge.jsxs)("div",{className:B("min-w-[200px] p-2",h&&"bg-background/95 backdrop-blur-sm"),children:[(0,Ge.jsx)("div",{className:"font-medium px-2 py-1 text-sm",children:Z.title}),me&&(0,Ge.jsx)("div",{className:"mt-1 space-y-0.5",children:Z.items?.map(ke=>{let fe=ke.href===N,Pe=ke.items&&ke.items.length>0;return(0,Ge.jsx)("div",{className:"relative",children:Pe?(0,Ge.jsxs)(DE,{openDelay:200,closeDelay:100,children:[(0,Ge.jsx)(OE,{asChild:!0,children:(0,Ge.jsxs)("button",{onClick:()=>Y(ke),disabled:ke.disabled,className:B("w-full flex items-center justify-between gap-2 rounded-md px-2 py-1.5 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",fe&&"bg-primary/10 text-primary font-medium",ke.disabled&&"opacity-50 cursor-not-allowed"),children:[(0,Ge.jsxs)("div",{className:"flex items-center gap-2",children:[ke.icon&&(0,Ge.jsx)("span",{className:"flex-shrink-0",children:ke.icon}),(0,Ge.jsx)("span",{className:"truncate",children:ke.title})]}),(0,Ge.jsx)(Kn,{className:"h-3 w-3 flex-shrink-0"})]})}),(0,Ge.jsx)(fk,{side:"right",align:"start",sideOffset:10,className:B("p-2",h&&"bg-background/95 backdrop-blur-sm"),children:(0,Ge.jsx)("div",{className:"space-y-0.5",children:ke.items?.map(te=>{let xe=te.href===N;return(0,Ge.jsxs)("button",{onClick:()=>Y(te),disabled:te.disabled,className:B("w-full flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",xe&&"bg-primary/10 text-primary font-medium",te.disabled&&"opacity-50 cursor-not-allowed"),children:[te.icon&&(0,Ge.jsx)("span",{className:"flex-shrink-0",children:te.icon}),(0,Ge.jsx)("span",{className:"truncate",children:te.title}),te.badge&&(0,Ge.jsx)(dt,{variant:te.badgeVariant||"secondary",className:"ml-auto flex-shrink-0 text-[10px] px-1.5 py-0 h-5",children:te.badge})]},te.id)})})})]}):(0,Ge.jsxs)("button",{onClick:()=>Y(ke),disabled:ke.disabled,className:B("w-full flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",fe&&"bg-primary/10 text-primary font-medium",ke.disabled&&"opacity-50 cursor-not-allowed"),children:[ke.icon&&(0,Ge.jsx)("span",{className:"flex-shrink-0",children:ke.icon}),(0,Ge.jsx)("span",{className:"truncate",children:ke.title}),ke.badge&&(0,Ge.jsx)(dt,{variant:ke.badgeVariant||"secondary",className:"ml-auto flex-shrink-0 text-[10px] px-1.5 py-0 h-5",children:ke.badge})]})},ke.id)})})]})},[N,h,Y]),Be=(0,kn.useCallback)((Z,me=0,ke)=>{let fe=Z.href===N,Pe=V.includes(Z.id),te=Z.items&&Z.items.length>0,xe=R.includes(Z.id),se=P&&!A&&me===0&&(te||Z.title),ae=Z.tooltip&&!P&&!se,_e=(0,Ge.jsxs)("button",{onClick:()=>{te?G(Z.id):Y(Z)},className:B("flex items-center gap-3 rounded-lg text-sm transition-all",C?"w-full mx-3 px-3 py-2":"w-full px-3 py-2","hover:bg-accent hover:text-accent-foreground",fe&&"bg-primary/10 text-primary font-medium",Z.disabled&&"opacity-50 cursor-not-allowed",me>0&&"ml-6 text-xs",P&&me===0&&"justify-center px-2",b?.hover),disabled:Z.disabled,children:[Z.icon&&(0,Ge.jsx)("span",{className:B("flex-shrink-0",P&&me===0&&"mx-auto"),children:Z.icon}),(!P||me>0)&&(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("span",{className:"flex-1 text-left truncate",children:Z.title}),Z.badge&&(0,Ge.jsx)(dt,{variant:Z.badgeVariant||"secondary",className:"ml-auto flex-shrink-0 text-[10px] px-1.5 py-0 h-5",children:Z.badge}),te&&me===0&&(0,Ge.jsx)(ea,{className:B("h-4 w-4 flex-shrink-0 transition-transform",xe&&"rotate-180")}),Pe&&(0,Ge.jsx)(jA,{className:"h-3 w-3 flex-shrink-0"})]})]});return se?(0,Ge.jsx)("div",{children:(0,Ge.jsxs)(DE,{openDelay:200,closeDelay:100,children:[(0,Ge.jsx)(OE,{asChild:!0,children:_e}),(0,Ge.jsx)(fk,{side:"right",align:"start",sideOffset:10,className:B("p-0 w-auto",h&&"bg-background/95 backdrop-blur-sm","animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"),children:(0,Ge.jsx)(ne.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.15},children:Ce(Z)})})]})},Z.id):(0,Ge.jsxs)("div",{children:[ae?(0,Ge.jsx)(Qs,{children:(0,Ge.jsxs)(ws,{children:[(0,Ge.jsx)(Cs,{asChild:!0,children:_e}),(0,Ge.jsx)(rs,{side:"right",children:(0,Ge.jsx)("p",{children:Z.tooltip})})]})}):_e,te&&!P&&ke&&(0,Ge.jsx)(_t,{children:xe&&(0,Ge.jsx)(ne.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:(0,Ge.jsx)("div",{className:"pt-1 space-y-1",children:ke.map(Dt=>Be(Dt,me+1))})})})]},Z.id)},[N,V,R,P,b,Y,G,A,h,Ce,C]),he=kn.default.memo(()=>(0,Ge.jsxs)("div",{className:B("flex items-center gap-3 p-4 border-b",P&&!A&&"justify-center px-2"),children:[c&&(0,Ge.jsxs)(Ge.Fragment,{children:[c.logo,(!P||A)&&c.title&&(0,Ge.jsx)("span",{className:"font-semibold text-lg",children:c.title})]}),A&&(0,Ge.jsx)(re,{variant:"ghost",size:"sm",className:"ml-auto h-8 w-8 p-0",onClick:()=>F(!1),children:(0,Ge.jsx)(sr,{className:"h-4 w-4"})}),!A&&u&&(0,Ge.jsx)(re,{variant:"ghost",size:"sm",className:B("h-8 w-8 p-0",!P&&"ml-auto"),onClick:()=>k(!P),children:P?(0,Ge.jsx)(Kn,{className:"h-4 w-4"}):(0,Ge.jsx)(ga,{className:"h-4 w-4"})})]})),Re=kn.default.memo(()=>(0,Ge.jsx)(Pc,{className:"flex-1 overflow-y-auto",children:(0,Ge.jsxs)("div",{className:"p-4 space-y-6",children:[V.length>0&&(!P||A)&&(0,Ge.jsxs)("div",{children:[(0,Ge.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Pinned"}),(0,Ge.jsx)("div",{className:"space-y-1",children:e.flatMap(Z=>Z.items.filter(me=>V.includes(me.id))).map(Z=>Be(Z))}),(0,Ge.jsx)(Is,{className:"mt-4"})]}),Le.map((Z,me)=>(0,Ge.jsxs)("div",{children:[Z.title&&(!P||A)&&(0,Ge.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2",children:Z.title}),(0,Ge.jsx)("div",{className:"space-y-1",children:Z.filteredItems.map(ke=>Be(ke,0,ke.filteredChildren))}),Z.showDivider&&me<Le.length-1&&(0,Ge.jsx)(Is,{className:"mt-4"})]},Z.id))]})})),ye=kn.default.memo(()=>t?(0,Ge.jsxs)("div",{className:"border-t p-4",children:[(0,Ge.jsx)("div",{className:"space-y-1",children:t.items.map(Z=>Be(Z))}),i&&(!P||A)&&(0,Ge.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,Ge.jsx)("span",{className:"text-xs text-muted-foreground",children:"Theme"}),(0,Ge.jsxs)(Nr,{children:[(0,Ge.jsx)(Mr,{asChild:!0,children:(0,Ge.jsxs)(re,{variant:"ghost",size:"sm",className:"h-7 px-2",children:[s==="light"&&(0,Ge.jsx)(Lh,{className:"h-3 w-3"}),s==="dark"&&(0,Ge.jsx)(Th,{className:"h-3 w-3"}),s==="system"&&(0,Ge.jsx)(Jf,{className:"h-3 w-3"})]})}),(0,Ge.jsxs)(Sr,{align:"end",children:[(0,Ge.jsxs)(Ue,{onClick:()=>l?.("light"),children:[(0,Ge.jsx)(Lh,{className:"mr-2 h-4 w-4"}),"Light"]}),(0,Ge.jsxs)(Ue,{onClick:()=>l?.("dark"),children:[(0,Ge.jsx)(Th,{className:"mr-2 h-4 w-4"}),"Dark"]}),(0,Ge.jsxs)(Ue,{onClick:()=>l?.("system"),children:[(0,Ge.jsx)(Jf,{className:"mr-2 h-4 w-4"}),"System"]})]})]})]})]}):null),Oe=kn.default.memo(()=>(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(Re,{}),(0,Ge.jsx)(ye,{})]})),Q=B("moonui-pro flex h-full flex-col bg-background border-r",h&&"bg-background/80 backdrop-blur-xl border-white/10",P&&!A&&"w-16",!P&&!A&&"w-64",b?.background,b?.border,I);return A?(0,Ge.jsxs)(Ge.Fragment,{children:[f&&(0,Ge.jsx)(re,{onClick:()=>F(!0),className:B("fixed z-40 h-12 w-12 rounded-full shadow-lg md:hidden",m),size:"icon",style:{bottom:p?.bottom,left:p?.left,right:p?.right,top:p?.top},children:(0,Ge.jsx)(Zf,{className:"h-5 w-5"})}),(0,Ge.jsx)(zb,{open:O,onOpenChange:F,children:(0,Ge.jsx)(ry,{side:"left",className:"w-80 p-0",children:(0,Ge.jsxs)("div",{className:B(Q,"sidebar-container flex flex-col"),children:[g&&(0,Ge.jsx)(ne.div,{className:"absolute inset-0 opacity-30",style:{background:`radial-gradient(circle at ${W}px ${z}px, rgba(var(--primary-rgb), 0.15), transparent 50%)`}}),(0,Ge.jsx)(he,{}),r&&(!P||A)&&(0,Ge.jsx)(zle,{searchInputRef:H,searchPlaceholder:n,initialValue:_,onSearchChange:oe,keyboardShortcuts:v},"sidebar-search-mobile"),(0,Ge.jsx)(Oe,{})]})})})]}):(0,Ge.jsxs)("aside",{className:B(Q,"sidebar-container hidden md:flex flex-col"),children:[g&&(0,Ge.jsx)(ne.div,{className:"absolute inset-0 opacity-30",style:{background:`radial-gradient(circle at ${W}px ${z}px, rgba(var(--primary-rgb), 0.15), transparent 50%)`}}),(0,Ge.jsx)(he,{}),r&&(!P||A)&&(0,Ge.jsx)(zle,{searchInputRef:H,searchPlaceholder:n,initialValue:_,onSearchChange:oe,keyboardShortcuts:v},"sidebar-search-desktop"),(0,Ge.jsx)(Oe,{})]})}function UKe(e){let{hasProAccess:t,isLoading:r}=Yt();return!r&&!t?(0,Ge.jsx)(Ve,{className:B("w-full max-w-xs",e.className),children:(0,Ge.jsx)(ze,{className:"py-12 text-center",children:(0,Ge.jsxs)("div",{className:"space-y-4",children:[(0,Ge.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Ge.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Ge.jsxs)("div",{children:[(0,Ge.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Ge.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Advanced Sidebar is available exclusively to MoonUI Pro subscribers."}),(0,Ge.jsx)("a",{href:"/pricing",children:(0,Ge.jsxs)(re,{size:"sm",children:[(0,Ge.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Ge.jsx)(BZt,{...e})}var VZt=UKe;var Ki=D(ce(),1);var xW=D(Ule(),1);var we=D(de(),1);function UZt({sections:e=[],branding:t,showSearch:r=!0,enableCommandAI:n=!1,commandAIShortcut:o="\u2318K",commandAIPlaceholder:a="Search commands...",onCommandAIOpen:i,onCommandAIClose:s,onCommandAISelect:l,searchPlaceholder:c="Search...",onSearch:u,showThemeToggle:d=!1,theme:f="system",onThemeChange:p,userMenu:m,notifications:h,cta:g,sticky:v=!0,glassmorphism:y=!1,animatedBackground:x=!1,keyboardShortcuts:w=!0,hideNavItems:b=!1,mobileBreakpoint:C=768,customStyles:S,variant:I="default",size:N="md",blur:M=!0,shadow:A=!1,rounded:T=!1,logoPosition:O="left",mobileMenuPosition:F="left",hideOnScroll:P=!1,showScrollProgress:k=!1,maxWidth:R="2xl",fullWidth:L=!1,enableNProgress:_=!0,className:U,activePath:V,onNavigate:E}){let[H,j]=(0,Ki.useState)(!1),[$,W]=(0,Ki.useState)(!1),[z,G]=(0,Ki.useState)(!1),[X,Y]=(0,Ki.useState)(!1),[oe,ie]=(0,Ki.useState)(""),[Le,Ce]=(0,Ki.useState)(!1),[Be,he]=(0,Ki.useState)(!1),[Re,ye]=(0,Ki.useState)(0),Oe=(0,Ki.useRef)(0),Q=(0,Ki.useRef)(null);(0,Ki.useEffect)(()=>{_&&xW.default.configure({easing:"ease",speed:800,showSpinner:!1,trickleSpeed:200,minimum:.2})},[_]),(0,Ki.useEffect)(()=>{let se=()=>{j(window.innerWidth<C)};return se(),window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)},[C]),(0,Ki.useEffect)(()=>{if(!v&&!P&&!k)return;let se=()=>{let ae=window.scrollY;if(Ce(ae>10),P&&(ae>Oe.current&&ae>100?he(!0):he(!1),Oe.current=ae),k){let _e=window.scrollY,Dt=document.documentElement.scrollHeight-document.documentElement.clientHeight,vo=_e/Dt*100;ye(vo)}};return window.addEventListener("scroll",se,{passive:!0}),()=>window.removeEventListener("scroll",se)},[v,P,k]),(0,Ki.useEffect)(()=>{if(!w&&!n)return;let se=ae=>{(ae.metaKey||ae.ctrlKey)&&ae.key==="k"&&(ae.preventDefault(),Y(!0),n&&i?.())};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[w,n,i]);let Z=(0,Ki.useCallback)(se=>{se.action?se.action():se.href&&(_&&(xW.default.start(),setTimeout(()=>xW.default.done(),500)),E?E(se.href):window.location.href=se.href,H&&W(!1))},[E,H,_]),me=(0,Ki.useCallback)(se=>{ie(se),u?.(se)},[u]),ke=se=>(0,we.jsx)("div",{className:"grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]",children:se.map(ae=>(0,we.jsxs)(jE,{className:B("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",ae.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>!ae.disabled&&Z(ae),children:[(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{className:"flex-shrink-0",children:ae.icon}),(0,we.jsx)("div",{className:"text-sm font-medium leading-none",children:ae.title}),ae.badge&&(0,we.jsx)(dt,{variant:ae.badgeVariant||"secondary",className:"ml-auto",children:ae.badge})]}),ae.description&&(0,we.jsx)("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:ae.description})]},ae.id))}),fe=se=>(0,we.jsx)(we.Fragment,{children:se.map(ae=>ae.items&&ae.items.length>0?(0,we.jsxs)(od,{children:[(0,we.jsx)(cu,{disabled:ae.disabled,children:(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]})}),(0,we.jsx)(uu,{children:fe(ae.items)})]},ae.id):(0,we.jsxs)(Ue,{disabled:ae.disabled,onClick:()=>Z(ae),children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]}),ae.badge&&(0,we.jsx)(dt,{variant:ae.badgeVariant||"secondary",className:"ml-auto",children:ae.badge})]},ae.id))}),Pe=()=>(0,we.jsxs)(zb,{open:$,onOpenChange:W,children:[(0,we.jsx)(mU,{asChild:!0,children:(0,we.jsx)(re,{variant:"ghost",size:"icon",className:"md:hidden",children:(0,we.jsx)(Zf,{className:"h-5 w-5"})})}),(0,we.jsx)(ry,{side:F,className:"w-80 p-0",children:(0,we.jsxs)("div",{className:"flex h-full flex-col",children:[(0,we.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[t&&(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[t.logo,t.title&&(0,we.jsx)("span",{className:"font-semibold text-lg",children:t.title})]}),(0,we.jsx)(re,{variant:"ghost",size:"icon",onClick:()=>W(!1),className:"h-8 w-8",children:(0,we.jsx)(sr,{className:"h-4 w-4"})})]}),(0,we.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:!b&&e.map(se=>(0,we.jsxs)("div",{className:"space-y-1",children:[se.items.map(ae=>(0,we.jsx)("div",{children:ae.items&&ae.items.length>0?(0,we.jsxs)(Nr,{children:[(0,we.jsx)(Mr,{asChild:!0,children:(0,we.jsxs)(re,{variant:"ghost",className:"w-full justify-between",disabled:ae.disabled,children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]}),(0,we.jsx)(ea,{className:"h-4 w-4"})]})}),(0,we.jsx)(Sr,{align:"start",className:"w-56",children:ae.items&&fe(ae.items)})]}):(0,we.jsxs)(re,{variant:"ghost",className:"w-full justify-start",disabled:ae.disabled,onClick:()=>Z(ae),children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]}),ae.badge&&(0,we.jsx)(dt,{variant:ae.badgeVariant||"secondary",className:"ml-auto",children:ae.badge})]})},ae.id)),(0,we.jsx)(Is,{className:"my-2"})]},se.id))})]})})]}),te=()=>{switch(N){case"sm":return"h-14";case"lg":return"h-20";default:return"h-16"}},xe=B("moonui-pro w-full transition-all duration-300",I==="default"&&"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",I==="floating"&&"mx-4 mt-4 rounded-lg border bg-background/95 backdrop-blur shadow-lg",I==="minimal"&&"bg-background",I==="transparent"&&"bg-transparent",v&&"sticky top-0 z-50",Le&&v&&I!=="transparent"&&"shadow-sm",Le&&I==="transparent"&&"bg-background/95 backdrop-blur border-b",Be&&"-translate-y-full",y&&"bg-background/80 backdrop-blur-xl border-white/10",M&&"backdrop-blur-md",A&&"shadow-lg",T&&"rounded-lg",S?.background,S?.border,U);return(0,we.jsxs)(we.Fragment,{children:[(0,we.jsxs)("nav",{ref:Q,className:xe,children:[(0,we.jsxs)("div",{className:B("flex items-center",te(),L?"w-full px-4 sm:px-6 lg:px-8":R==="sm"&&"container max-w-screen-sm"||R==="md"&&"container max-w-screen-md"||R==="lg"&&"container max-w-screen-lg"||R==="xl"&&"container max-w-screen-xl"||R==="2xl"&&"container max-w-screen-2xl"||R==="full"&&"w-full px-4 sm:px-6 lg:px-8"),children:[t&&(0,we.jsxs)("div",{className:B("flex items-center gap-2",O==="center"&&!H?"absolute left-1/2 -translate-x-1/2":"mr-4"),children:[O==="left"&&F==="left"&&(0,we.jsx)(Pe,{}),(0,we.jsxs)("a",{href:t.href||"/",onClick:se=>{t.href&&E&&(se.preventDefault(),E(t.href))},className:"flex items-center gap-2",children:[t.logo,t.title&&!H&&(0,we.jsx)("span",{className:"font-semibold text-lg",children:t.title})]})]}),!H&&!b&&(0,we.jsx)(FE,{className:"hidden md:flex",children:(0,we.jsx)(BE,{children:e.map(se=>(0,we.jsx)(Ki.default.Fragment,{children:se.items.map(ae=>{let _e=ae.items&&ae.items.length>0,Dt=ae.href===V;return _e?(0,we.jsxs)(VE,{children:[(0,we.jsx)(zE,{className:B(Dt&&"bg-accent text-accent-foreground",ae.disabled&&"opacity-50 cursor-not-allowed"),disabled:ae.disabled,children:(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]})}),(0,we.jsx)(HE,{children:ae.items&&ke(ae.items)})]},ae.id):(0,we.jsx)(VE,{children:(0,we.jsxs)(jE,{className:B(UE(),Dt&&"bg-accent text-accent-foreground",ae.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>!ae.disabled&&Z(ae),children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[ae.icon&&(0,we.jsx)("span",{children:ae.icon}),ae.title]}),ae.badge&&(0,we.jsx)(dt,{variant:ae.badgeVariant||"secondary",className:"ml-2",children:ae.badge})]})},ae.id)})},se.id))})}),(0,we.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[r&&(0,we.jsx)(we.Fragment,{children:H?(0,we.jsx)(re,{variant:"ghost",size:"icon",onClick:()=>Y(!0),children:(0,we.jsx)(co,{className:"h-5 w-5"})}):(0,we.jsxs)("div",{className:"relative",children:[(0,we.jsx)(co,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,we.jsx)(Jt,{type:"search",placeholder:c,className:"w-64 pl-9 pr-4 h-9 cursor-pointer",value:oe,onChange:se=>me(se.target.value),onClick:()=>{n&&(Y(!0),i?.())},readOnly:n}),(w||n)&&(0,we.jsx)("kbd",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 hidden sm:flex",children:n?o:(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)("span",{className:"text-xs",children:"\u2318"}),"K"]})})]})}),d&&(0,we.jsxs)(Nr,{children:[(0,we.jsx)(Mr,{asChild:!0,children:(0,we.jsxs)(re,{variant:"ghost",size:"icon",children:[f==="light"&&(0,we.jsx)(Lh,{className:"h-5 w-5"}),f==="dark"&&(0,we.jsx)(Th,{className:"h-5 w-5"}),f==="system"&&(0,we.jsx)(Jf,{className:"h-5 w-5"})]})}),(0,we.jsxs)(Sr,{align:"end",children:[(0,we.jsxs)(Ue,{onClick:()=>p?.("light"),children:[(0,we.jsx)(Lh,{className:"mr-2 h-4 w-4"}),"Light"]}),(0,we.jsxs)(Ue,{onClick:()=>p?.("dark"),children:[(0,we.jsx)(Th,{className:"mr-2 h-4 w-4"}),"Dark"]}),(0,we.jsxs)(Ue,{onClick:()=>p?.("system"),children:[(0,we.jsx)(Jf,{className:"mr-2 h-4 w-4"}),"System"]})]})]}),h&&(0,we.jsxs)(Nr,{children:[(0,we.jsx)(Mr,{asChild:!0,children:(0,we.jsxs)(re,{variant:"ghost",size:"icon",className:"relative",children:[(0,we.jsx)(mm,{className:"h-5 w-5"}),h.count&&h.count>0&&(0,we.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] rounded-full bg-red-500 text-[11px] font-medium text-white flex items-center justify-center px-1",children:h.count>9?"9+":h.count})]})}),(0,we.jsxs)(Sr,{align:"end",className:"w-[380px] p-0",sideOffset:8,children:[(0,we.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b",children:[(0,we.jsxs)("div",{className:"flex items-center gap-2",children:[(0,we.jsx)("h4",{className:"text-base font-semibold",children:"Notifications"}),h.count&&h.count>0&&(0,we.jsxs)(dt,{variant:"secondary",className:"h-5 px-2 rounded-full bg-primary/10 text-primary border-0",children:[h.count," ","new"]})]}),h.items&&h.items.length>0&&(0,we.jsx)(re,{variant:"ghost",size:"sm",className:"text-xs h-7 px-2 text-muted-foreground hover:text-foreground",onClick:se=>{se.preventDefault(),console.log("Mark all as read")},children:"Mark all read"})]}),(0,we.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:h.items&&h.items.length>0?(0,we.jsx)("div",{className:"py-1",children:h.items.map((se,ae)=>(0,we.jsxs)("div",{children:[(0,we.jsx)("button",{className:B("w-full px-4 py-3 text-left hover:bg-muted/50 transition-colors","focus:outline-none focus:bg-muted/50",!se.read&&"bg-primary/5 hover:bg-primary/10"),onClick:()=>h.onNotificationClick?.(se.id),children:(0,we.jsxs)("div",{className:"flex gap-3",children:[(0,we.jsx)("div",{className:"mt-1.5",children:(0,we.jsx)("div",{className:B("h-2 w-2 rounded-full",se.read?"bg-transparent":"bg-primary")})}),(0,we.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,we.jsx)("p",{className:B("text-sm leading-tight",se.read?"font-normal":"font-medium"),children:se.title}),se.description&&(0,we.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:se.description}),se.time&&(0,we.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-1",children:se.time})]})]})}),ae<(h.items?.length||0)-1&&(0,we.jsx)("div",{className:"mx-4 border-b"})]},se.id))}):(0,we.jsxs)("div",{className:"py-12 text-center",children:[(0,we.jsx)(mm,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),(0,we.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"No new notifications"}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"You're all caught up!"})]})}),h.items&&h.items.length>0&&(0,we.jsx)("div",{className:"border-t p-2",children:(0,we.jsx)(re,{variant:"ghost",className:"w-full h-8 text-xs text-muted-foreground hover:text-foreground",onClick:se=>{se.preventDefault(),console.log("View all notifications")},children:"View all notifications"})})]})]}),g&&(0,we.jsx)(re,{variant:g.variant||"primary",size:"sm",onClick:()=>{g.action?g.action():g.href&&E&&E(g.href)},className:H?"":"ml-2",children:g.text}),m&&(0,we.jsxs)(Nr,{children:[(0,we.jsx)(Mr,{asChild:!0,children:(0,we.jsx)(re,{variant:"ghost",size:"icon",className:"relative",children:(0,we.jsxs)(Da,{className:"h-8 w-8",children:[(0,we.jsx)(Oi,{src:m.user?.avatar,alt:m.user?.name}),(0,we.jsx)(ti,{children:m.user?.name?.charAt(0)||(0,we.jsx)(rp,{className:"h-4 w-4"})})]})})}),(0,we.jsxs)(Sr,{align:"end",className:"w-56",children:[m.user&&(0,we.jsxs)(we.Fragment,{children:[(0,we.jsxs)("div",{className:"p-2",children:[(0,we.jsx)("p",{className:"text-sm font-medium",children:m.user.name}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground",children:m.user.email})]}),(0,we.jsx)(Kr,{})]}),m.items&&fe(m.items)]})]})]})]}),x&&(0,we.jsx)(ne.div,{className:"absolute inset-0 -z-10 opacity-30",animate:{background:["radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%)","radial-gradient(circle at 80% 50%, rgba(120, 119, 198, 0.3), transparent 50%)","radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%)"]},transition:{duration:10,repeat:1/0,ease:"linear"}}),k&&(0,we.jsx)("div",{className:"absolute bottom-0 left-0 w-full h-0.5 bg-muted",children:(0,we.jsx)("div",{className:"h-full bg-primary transition-all duration-150",style:{width:`${Re}%`}})})]}),(0,we.jsxs)(dE,{open:X,onOpenChange:se=>{Y(se),se||s?.()},children:[(0,we.jsx)(Jh,{placeholder:n?a:c,value:oe,onValueChange:me}),(0,we.jsxs)(QI,{children:[(0,we.jsx)(eg,{children:n?(0,we.jsxs)("div",{className:"flex flex-col items-center py-6",children:[(0,we.jsx)(bt,{className:"h-8 w-8 text-muted-foreground mb-2"}),(0,we.jsx)("p",{className:"text-sm text-muted-foreground",children:"No results found"}),(0,we.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Try searching for pages, actions, or commands"})]}):"No results found."}),n&&!oe&&(0,we.jsxs)(pp,{heading:"Quick Actions",children:[(0,we.jsxs)(nd,{onSelect:()=>{let se={id:"home",title:"Go Home",href:"/"};l?.(se),Z(se),Y(!1)},children:[(0,we.jsx)(jx,{className:"mr-2 h-4 w-4"}),"Go Home",(0,we.jsx)("kbd",{className:"ml-auto text-xs",children:"\u2318H"})]}),(0,we.jsxs)(nd,{onSelect:()=>{G(!0),Y(!1),l?.({id:"search",title:"Search",action:()=>G(!0)})},children:[(0,we.jsx)(co,{className:"mr-2 h-4 w-4"}),"Search",(0,we.jsx)("kbd",{className:"ml-auto text-xs",children:"\u2318S"})]}),d&&(0,we.jsxs)(nd,{onSelect:()=>{p?.(f==="dark"?"light":"dark"),Y(!1)},children:[f==="dark"?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(Lh,{className:"mr-2 h-4 w-4"}),"Switch to Light Mode"]}):(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(Th,{className:"mr-2 h-4 w-4"}),"Switch to Dark Mode"]}),(0,we.jsx)("kbd",{className:"ml-auto text-xs",children:"\u2318T"})]})]}),e&&e.length>0&&e.map(se=>{if(!se||!se.items||se.items.length===0)return null;let ae=oe?se.items.filter(_e=>_e.title.toLowerCase().includes(oe.toLowerCase())||_e.description?.toLowerCase().includes(oe.toLowerCase())):se.items;return ae.length===0?null:(0,we.jsx)(pp,{heading:se.title||se.id,children:ae.map(_e=>(0,we.jsxs)(nd,{disabled:_e.disabled,onSelect:()=>{n&&l?.(_e),Z(_e),Y(!1)},children:[(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[_e.icon&&(0,we.jsx)("span",{children:_e.icon}),_e.title]}),_e.badge&&(0,we.jsx)(dt,{variant:_e.badgeVariant||"secondary",className:"ml-auto",children:_e.badge}),_e.description&&n&&(0,we.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:_e.description})]},_e.id))},se.id)}),n&&m?.items&&(0,we.jsx)(pp,{heading:"Account",children:m.items.map(se=>(0,we.jsx)(nd,{disabled:se.disabled,onSelect:()=>{let ae={...se,action:se.onClick||se.action};ae.action?ae.action():ae.href&&(window.location.href=ae.href),l?.(ae),Y(!1)},children:(0,we.jsxs)("span",{className:"flex items-center gap-2",children:[se.icon&&(0,we.jsx)("span",{children:se.icon}),se.title]})},se.id))})]})]})]})}function zKe(e){let{hasProAccess:t,isLoading:r}=Yt();return!r&&!t?(0,we.jsx)(Ve,{className:B("w-full",e.className),children:(0,we.jsx)(ze,{className:"py-8 text-center",children:(0,we.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,we.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,we.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,we.jsxs)("div",{children:[(0,we.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,we.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Advanced Navbar is available exclusively to MoonUI Pro subscribers."}),(0,we.jsx)("a",{href:"/pricing",children:(0,we.jsxs)(re,{size:"sm",children:[(0,we.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,we.jsx)(UZt,{...e})}var zZt=zKe;var Hle=D(ce(),1);var ui=D(ce(),1),$Ke=D(de(),1),HKe=(0,ui.createContext)(null),z0=()=>{let e=(0,ui.useContext)(HKe);if(!e)throw new Error("useFormWizard must be used within a FormWizardProvider");return e},jKe=({children:e,steps:t,initialStep:r=0,onStepChange:n,onComplete:o,validateOnStepChange:a=!0,allowBackNavigation:i=!0,allowStepSkip:s=!1,autoSave:l=!1,autoSaveDelay:c=2e3,onAutoSave:u,persistData:d=!1,storageKey:f="form-wizard-data"})=>{let[p,m]=(0,ui.useState)(r),[h,g]=(0,ui.useState)({}),[v,y]=(0,ui.useState)(new Set),[x,w]=(0,ui.useState)(!1),[b,C]=(0,ui.useState)(null);(0,ui.useEffect)(()=>{if(d&&typeof window<"u"){let R=localStorage.getItem(f);if(R)try{let L=JSON.parse(R);g(L.stepData||{}),m(L.currentStep||0),y(new Set(L.completedSteps||[]))}catch(L){console.error("Failed to load persisted wizard data:",L)}}},[d,f]),(0,ui.useEffect)(()=>{if(!l||!u)return;let R=setTimeout(()=>{let L=h[t[p].id];L&&u(t[p].id,L)},c);return()=>clearTimeout(R)},[h,p,l,c,u,t]),(0,ui.useEffect)(()=>{if(d&&typeof window<"u"){let R={stepData:h,currentStep:p,completedSteps:Array.from(v)};localStorage.setItem(f,JSON.stringify(R))}},[h,p,v,d,f]);let S=(0,ui.useCallback)(async()=>{let R=t[p];if(R.requiredFields!==!1&&typeof window<"u"){let _=document.querySelector("[data-wizard-step-content]");if(_)if(Array.isArray(R.requiredFields)){let U=[];if(R.requiredFields.forEach(V=>{let E=_.querySelector(`[name="${V}"], [id="${V}"]`);if(E){let H=E;E.tagName==="INPUT"&&E.type==="checkbox"?E.checked||U.push(V):(!H.value||H.value.trim()==="")&&U.push(V)}}),U.length>0)return C(`Please fill in the following required fields: ${U.join(", ")}`),!1}else{let U=_.querySelectorAll("input[required], select[required], textarea[required]"),V=[];if(U.forEach(H=>{let j=H;if(!j.value||j.value.trim()===""){let $=document.querySelector(`label[for="${j.id}"]`),W=$?$.textContent?.replace(" *","")||"Field":j.name||j.id||"Field";V.push(W)}}),_.querySelectorAll('input[type="checkbox"][required]').forEach(H=>{let j=H;if(!j.checked){let $=document.querySelector(`label[for="${j.id}"]`),W=$?$.textContent?.replace(" *","")||"Checkbox":j.name||j.id||"Checkbox";V.push(W)}}),V.length>0)return C(`Please fill in the following required fields: ${V.join(", ")}`),!1}}if(!R.validation)return!0;w(!0),C(null);try{let _=await R.validation();if(typeof _=="boolean")return _||C("Please complete all required fields before proceeding"),_;if(typeof _=="object"&&_!==null&&"isValid"in _){let U=_;return U.isValid||(U.error?C(U.error):U.errors&&Array.isArray(U.errors)?C(U.errors.join(", ")):C("Please complete all required fields before proceeding")),U.isValid}return C("Invalid validation response"),!1}catch(_){return C(_ instanceof Error?_.message:"Validation failed"),!1}finally{w(!1)}},[p,t]),I=(0,ui.useCallback)((R,L)=>{g(_=>({..._,[R]:{..._[R],...L}})),C(null)},[]),N=(0,ui.useCallback)(async R=>{if(R<0||R>=t.length||R===p)return;let L=t[R];if((typeof L.isDisabled=="function"?L.isDisabled(p,t):L.isDisabled)||a&&R>p&&!await S())return;let U=t[p];U.onExit&&await U.onExit(),R>p&&y(E=>new Set([...E,p])),L.onEnter&&await L.onEnter();let V=p;m(R),n?.(R,V)},[p,t,a,S,n]),M=(0,ui.useCallback)(()=>{N(p+1)},[p,N]),A=(0,ui.useCallback)(()=>{i&&N(p-1)},[p,N,i]),T=(0,ui.useCallback)(async()=>{if(await S()&&(y(L=>new Set([...L,p])),o)){w(!0);try{await o(h),d&&typeof window<"u"&&localStorage.removeItem(f)}catch(L){C(L instanceof Error?L.message:"Failed to complete wizard")}finally{w(!1)}}},[p,h,S,o,d,f]),O=(0,ui.useCallback)(()=>{m(0),g({}),y(new Set),C(null),d&&typeof window<"u"&&localStorage.removeItem(f)},[d,f]),F=(0,ui.useCallback)(R=>v.has(R),[v]),P=(0,ui.useCallback)(R=>{if(R===0||s)return!0;for(let L=0;L<R;L++)if(!v.has(L)&&!t[L].isOptional)return!1;return!0},[v,s,t]),k={steps:t,currentStep:p,stepData:h,isLoading:x,error:b,goToNext:M,goToPrevious:A,goToStep:N,updateStepData:R=>I(t[p].id,R),validateCurrentStep:S,completeWizard:T,resetWizard:O,isStepCompleted:F,isStepAccessible:P,canGoNext:p<t.length-1,canGoPrevious:i&&p>0};return(0,$Ke.jsx)(HKe.Provider,{value:k,children:e})};var wr=D(de(),1),bW=({className:e,progressType:t="linear",orientation:r="horizontal",showStepNumbers:n=!0,showStepTitles:o=!0,stepIconPosition:a="top",completedStepIcon:i=(0,wr.jsx)(Bo,{className:"w-5 h-5"}),activeStepIcon:s,errorStepIcon:l=(0,wr.jsx)(lo,{className:"w-5 h-5"})})=>{let{steps:c,currentStep:u,isStepCompleted:d,isStepAccessible:f,error:p}=z0();if(t==="linear")return(0,wr.jsx)("div",{className:B("relative w-full",r==="vertical"?"flex flex-col space-y-8":"",e),children:r==="horizontal"?(0,wr.jsx)("div",{className:"relative w-full",children:(0,wr.jsx)("div",{className:B("relative flex items-start justify-between w-full",a==="left"&&"pl-14"),children:c.map((m,h)=>{let g=h===u,v=d(h),y=f(h),x=g&&p,w=typeof m.icon=="function"?m.icon({isActive:g,isCompleted:v}):m.icon;return(0,wr.jsxs)("div",{className:"relative flex-1 flex flex-col items-center",children:[a==="left"&&w&&(0,wr.jsx)("div",{className:"absolute -left-12 top-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,wr.jsx)("span",{className:B("w-8 h-8 flex items-center justify-center transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:w})}),a==="top"&&w&&(0,wr.jsx)("div",{className:"flex items-center justify-center mb-2",children:(0,wr.jsx)("span",{className:B("w-8 h-8 flex items-center justify-center transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:w})}),o&&(0,wr.jsxs)("div",{className:"text-center mb-3 min-h-[40px] px-2",children:[(0,wr.jsx)("p",{className:B("text-sm font-semibold transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:m.title}),m.description&&(0,wr.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:m.description})]}),(0,wr.jsxs)("div",{className:"relative flex items-center w-full",children:[h<c.length-1&&(0,wr.jsxs)("div",{className:"absolute left-1/2 w-full h-[2px]",style:{width:"calc(100% + 24px)",marginLeft:"24px"},children:[(0,wr.jsx)("div",{className:"h-full bg-border"}),h<u&&(0,wr.jsx)(ne.div,{className:"absolute inset-0 bg-primary",initial:{scaleX:0},animate:{scaleX:1},transition:{duration:.5,delay:h*.1},style:{transformOrigin:"left"}})]}),(0,wr.jsx)(ne.div,{initial:{scale:.8},animate:{scale:g?1.05:1},transition:{duration:.2},className:B("relative z-10 flex items-center justify-center rounded-full transition-all duration-300 mx-auto","w-12 h-12 border-2",g&&"border-primary bg-primary text-primary-foreground shadow-lg shadow-primary/20",v&&!g&&"border-primary bg-primary text-primary-foreground",!g&&!v&&y&&"border-border bg-background text-muted-foreground hover:border-accent",!y&&"border-border/50 bg-muted text-muted-foreground/50 cursor-not-allowed",x&&"border-destructive bg-destructive text-destructive-foreground"),children:x?l:v&&!g?i:g&&s?s:w&&a==="inside"?(0,wr.jsx)("span",{className:"w-5 h-5 flex items-center justify-center",children:w}):n?(0,wr.jsx)("span",{className:"text-sm font-semibold",children:h+1}):(0,wr.jsx)(Kf,{className:"w-4 h-4"})})]}),(0,wr.jsx)("div",{className:"mt-3",children:(0,wr.jsxs)("p",{className:"text-xs text-muted-foreground font-medium",children:["Step ",h+1," of ",c.length]})})]},m.id)})})}):(0,wr.jsxs)("div",{className:"relative pl-12",children:[c.length>1&&(0,wr.jsxs)(wr.Fragment,{children:[(0,wr.jsx)("div",{className:"absolute left-6 top-8 bottom-8 w-[2px] bg-border"}),(0,wr.jsx)(ne.div,{className:"absolute left-6 top-8 w-[2px] bg-primary",initial:{height:0},animate:{height:`${u/(c.length-1)*(100-16)}%`},transition:{duration:.5}})]}),c.map((m,h)=>{let g=h===u,v=d(h),y=f(h),x=g&&p,w=typeof m.icon=="function"?m.icon({isActive:g,isCompleted:v}):m.icon;return(0,wr.jsxs)("div",{className:"relative flex items-center mb-8 last:mb-0",children:[(0,wr.jsx)(ne.div,{initial:{scale:.8},animate:{scale:g?1.05:1},className:B("absolute left-0 z-20 flex items-center justify-center rounded-full border-2 transition-all duration-300","w-12 h-12",g&&"border-primary bg-primary text-primary-foreground shadow-lg",v&&!g&&"border-primary bg-primary text-primary-foreground",!g&&!v&&y&&"border-border bg-background text-muted-foreground hover:border-accent",!y&&"border-border/50 bg-muted text-muted-foreground/50 cursor-not-allowed",x&&"border-destructive bg-destructive text-destructive-foreground"),children:x?l:v&&!g?i:g&&s?s:w?(0,wr.jsx)("span",{className:"w-5 h-5 flex items-center justify-center",children:w}):n?(0,wr.jsx)("span",{className:"text-sm font-semibold",children:h+1}):(0,wr.jsx)(Kf,{className:"w-4 h-4"})}),(0,wr.jsx)("div",{className:"ml-16",children:o&&(0,wr.jsxs)(wr.Fragment,{children:[(0,wr.jsx)("p",{className:B("text-sm font-semibold transition-colors",g&&"text-primary",v&&!g&&"text-primary",!g&&!v&&"text-muted-foreground"),children:m.title}),m.description&&(0,wr.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:m.description})]})})]},m.id)})]})});if(t==="dots")return(0,wr.jsx)("div",{className:B("flex items-center justify-center space-x-2",e),children:c.map((m,h)=>{let g=h===u,v=d(h);return(0,wr.jsx)(ne.div,{initial:{scale:.8},animate:{scale:g?1.2:1},className:B("rounded-full transition-all duration-300",g?"w-3 h-3 bg-primary":"w-2 h-2",v&&!g&&"bg-primary/60",!g&&!v&&"bg-muted")},h)})});if(t==="circular"){let m=(u+1)/c.length*100,h=2*Math.PI*45,g=h-m/100*h;return(0,wr.jsxs)("div",{className:B("relative w-36 h-36 mx-auto",e),children:[(0,wr.jsxs)("svg",{className:"w-full h-full -rotate-90",viewBox:"0 0 144 144",children:[(0,wr.jsx)("circle",{cx:"72",cy:"72",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",className:"text-border"}),(0,wr.jsx)(ne.circle,{cx:"72",cy:"72",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",strokeDasharray:h,initial:{strokeDashoffset:h},animate:{strokeDashoffset:g},className:"text-primary",transition:{duration:.5}})]}),(0,wr.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,wr.jsxs)("div",{className:"text-center",children:[(0,wr.jsx)("p",{className:"text-3xl font-bold",children:u+1}),(0,wr.jsxs)("p",{className:"text-sm text-muted-foreground",children:["of ",c.length]})]})})]})}return null};var wW=D(ce(),1);var H0=D(de(),1),HZt={slide:{initial:e=>({x:e>0?1e3:-1e3,opacity:0}),animate:{x:0,opacity:1},exit:e=>({x:e<0?1e3:-1e3,opacity:0})},fade:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},scale:{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}},none:{initial:{},animate:{},exit:{}}},CW=({className:e,animationType:t="slide",animationDuration:r=.3})=>{let{steps:n,currentStep:o,goToNext:a,goToPrevious:i,goToStep:s,updateStepData:l,stepData:c,error:u}=z0(),[d,f]=wW.default.useState(0),p=wW.default.useRef(o);wW.default.useEffect(()=>{f(o>p.current?1:-1),p.current=o},[o]);let m=n[o],h=o===0,g=o===n.length-1,v={currentStep:o,totalSteps:n.length,goToNext:a,goToPrevious:i,goToStep:s,isFirstStep:h,isLastStep:g,stepData:c[m.id]||{},updateStepData:x=>l(m.id,x)},y=typeof m.content=="function"?m.content(v):m.content;return(0,H0.jsx)(_t,{mode:"wait",custom:d,children:(0,H0.jsx)(ne.div,{custom:d,variants:HZt[t],initial:"initial",animate:"animate",exit:"exit",transition:{duration:r,ease:"easeInOut"},className:B("w-full",e),"data-wizard-step-content":!0,children:(0,H0.jsxs)("div",{className:"space-y-4",children:[u&&(0,H0.jsxs)(Yx,{variant:"error",children:[(0,H0.jsx)(Mn,{className:"h-4 w-4"}),(0,H0.jsx)(Qx,{children:u})]}),y]})},o)})};var sl=D(de(),1),SW=({className:e,showStepIndicator:t=!0,previousText:r="Previous",nextText:n="Next",completeText:o="Complete",loadingText:a="Processing...",onPreviousClick:i,onNextClick:s,onCompleteClick:l})=>{let{steps:c,currentStep:u,isLoading:d,canGoNext:f,canGoPrevious:p,goToNext:m,goToPrevious:h,completeWizard:g}=z0(),v=u===c.length-1,y=c[u],x=()=>{i?.(),h()},w=()=>{v?(l?.(),g()):(s?.(),m())};return(0,sl.jsxs)("div",{className:B("flex items-center justify-between",e),children:[(0,sl.jsxs)("div",{className:"flex items-center gap-2",children:[(0,sl.jsxs)(re,{type:"button",variant:"outline",onClick:x,disabled:!p||d,className:B("transition-all duration-200",!p&&"invisible"),children:[(0,sl.jsx)(ga,{className:"w-4 h-4 mr-1"}),r]}),t&&(0,sl.jsxs)(ne.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"px-3 py-1 text-sm text-muted-foreground",children:["Step ",u+1," of ",c.length,y.isOptional&&(0,sl.jsx)("span",{className:"ml-1 text-xs",children:"(Optional)"})]})]}),(0,sl.jsx)(re,{type:"button",onClick:w,disabled:d||!f&&!v,className:"min-w-[120px]",children:d?(0,sl.jsxs)(sl.Fragment,{children:[(0,sl.jsx)(Rr,{className:"w-4 h-4 mr-2 animate-spin"}),a]}):v?(0,sl.jsxs)(sl.Fragment,{children:[(0,sl.jsx)(en,{className:"w-4 h-4 mr-2"}),o]}):(0,sl.jsxs)(sl.Fragment,{children:[n,(0,sl.jsx)(Kn,{className:"w-4 h-4 ml-1"})]})})]})};var di=D(de(),1),qKe=Hle.default.forwardRef(({steps:e,currentStep:t=0,onStepChange:r,onComplete:n,orientation:o="horizontal",progressType:a="linear",allowStepSkip:i=!1,allowBackNavigation:s=!0,validateOnStepChange:l=!0,animationType:c="slide",animationDuration:u=.3,showStepNumbers:d=!0,showStepTitles:f=!0,showProgressBar:p=!0,stepIconPosition:m="top",completedStepIcon:h,activeStepIcon:g,errorStepIcon:v,className:y,progressClassName:x,navigationClassName:w,contentClassName:b,stepClassName:C,autoSave:S=!1,autoSaveDelay:I=2e3,onAutoSave:N,persistData:M=!1,storageKey:A="form-wizard-data"},T)=>(0,di.jsx)(jKe,{steps:e,initialStep:t,onStepChange:r,onComplete:n,validateOnStepChange:l,allowBackNavigation:s,allowStepSkip:i,autoSave:S,autoSaveDelay:I,onAutoSave:N,persistData:M,storageKey:A,children:(0,di.jsxs)("div",{ref:T,className:B("w-full",y),children:[p&&(0,di.jsx)(di.Fragment,{children:(0,di.jsx)(bW,{className:B("mb-12",x),progressType:a,orientation:o,showStepNumbers:d,showStepTitles:f,stepIconPosition:m,completedStepIcon:h,activeStepIcon:g,errorStepIcon:v})}),(0,di.jsx)(Ve,{className:B("border-0 shadow-none",b),children:(0,di.jsx)(ze,{className:"p-0",children:(0,di.jsx)(CW,{className:C,animationType:c,animationDuration:u})})}),(0,di.jsx)(SW,{className:B("mt-8",w)})]})}));qKe.displayName="FormWizardInternal";var o_=Hle.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Yt();return!n&&!r?(0,di.jsx)(Ve,{className:B("w-full",e.className),children:(0,di.jsx)(ze,{className:"py-12 text-center",children:(0,di.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,di.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,di.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,di.jsxs)("div",{children:[(0,di.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,di.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Form Wizard is available exclusively to MoonUI Pro subscribers."}),(0,di.jsx)("a",{href:"/pricing",children:(0,di.jsxs)(re,{size:"sm",children:[(0,di.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,di.jsx)(qKe,{...e,ref:t})});o_.displayName="MoonUIFormWizardPro";var jZt=o_;var Pd=D(ce(),1);var St=D(de(),1);function WKe(e){let t=[...e];for(let r=t.length-1;r>0;r--){let n=Math.floor(Math.random()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t}var $Zt=({title:e,description:t,questions:r,onComplete:n,showTimer:o=!0,totalTimeLimit:a,showProgress:i=!0,showQuestionNumbers:s=!0,allowReview:l=!0,allowSkip:c=!0,shuffleQuestions:u=!1,shuffleOptions:d=!1,passingScore:f=70,instantFeedback:p=!1,showHints:m=!1,className:h})=>{let[g]=(0,Pd.useState)(()=>u?WKe(r):r),[v,y]=(0,Pd.useState)({}),[x,w]=(0,Pd.useState)([]),[b,C]=(0,Pd.useState)(a||0),[S,I]=(0,Pd.useState)({}),[N,M]=(0,Pd.useState)(!1),[A,T]=(0,Pd.useState)(0);(0,Pd.useEffect)(()=>{if(!o||!a||N)return;let R=setInterval(()=>{C(L=>L<=1?(F(),0):L-1)},1e3);return()=>clearInterval(R)},[o,a,N]),(0,Pd.useEffect)(()=>{if(!o||N)return;let R=setInterval(()=>{T(L=>L+1)},1e3);return()=>clearInterval(R)},[o,N]);let O=(0,Pd.useCallback)(()=>{let R=0,L=0;return{results:g.map(U=>{let V=v[U.id],E=U.points||1;L+=E;let H=!1;if(V!=null&&V!==""){if(U.type==="single-choice"||U.type==="true-false")H=V===U.correctAnswer;else if(U.type==="multiple-choice"){let $=Array.isArray(V)?V:[],W=Array.isArray(U.correctAnswer)?U.correctAnswer:[];H=$.length===W.length&&$.every(z=>W.includes(z))}}let j=H?E:0;return R+=j,{questionId:U.id,answer:V,isCorrect:H,points:j,timeSpent:S[U.id]||0}}),score:R,totalScore:L}},[g,v,S]),F=async()=>{let{results:R,score:L,totalScore:_}=O();w(R),M(!0),n&&await n(R,L,_)},P=R=>{let L=Math.floor(R/60),_=R%60;return`${L}:${_.toString().padStart(2,"0")}`},k=g.map((R,L)=>({id:R.id,title:`Question ${L+1}`,description:R.tags?.join(", "),content:({updateStepData:_,goToNext:U})=>{let V=v[R.id],E=d&&R.options?WKe(R.options):R.options;(0,Pd.useEffect)(()=>{S[R.id]||I(j=>({...j,[R.id]:A}))},[]);let H=j=>{y($=>({...$,[R.id]:j})),p&&R.type};return(0,St.jsxs)(Ve,{className:"border-0 shadow-none",children:[(0,St.jsxs)(vr,{children:[(0,St.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[s&&(0,St.jsxs)(dt,{variant:"secondary",children:["Question ",L+1," of ",g.length]}),R.points&&R.points>1&&(0,St.jsxs)(dt,{variant:"outline",children:[R.points," points"]})]}),(0,St.jsx)(Or,{className:"text-xl",children:R.question}),R.description&&(0,St.jsx)(es,{children:R.description})]}),(0,St.jsxs)(ze,{className:"space-y-4",children:[R.image&&(0,St.jsx)("img",{src:R.image,alt:"Question illustration",className:"w-full rounded-lg"}),R.type==="single-choice"&&E&&(0,St.jsx)(AC,{value:V||"",onValueChange:H,children:E.map((j,$)=>(0,St.jsxs)(ne.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:$*.1},className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,St.jsx)(ty,{value:String(j.value),id:`${R.id}-${j.value}`}),(0,St.jsx)(It,{htmlFor:`${R.id}-${j.value}`,className:"flex-1 cursor-pointer",children:j.label||j.value})]},String(j.value)))}),R.type==="multiple-choice"&&E&&(0,St.jsx)("div",{className:"space-y-2",children:E.map((j,$)=>(0,St.jsxs)(ne.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:$*.1},className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,St.jsx)(ql,{id:`${R.id}-${j.value}`,checked:(V||[]).includes(j.value),onCheckedChange:W=>{let z=V||[];H(W?[...z,j.value]:z.filter(G=>G!==j.value))}}),(0,St.jsx)(It,{htmlFor:`${R.id}-${j.value}`,className:"flex-1 cursor-pointer",children:j.label||j.value})]},String(j.value)))}),R.type==="true-false"&&(0,St.jsxs)(AC,{value:V?.toString()||"",onValueChange:j=>H(j==="true"),children:[(0,St.jsxs)("div",{className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50",children:[(0,St.jsx)(ty,{value:"true",id:`${R.id}-true`}),(0,St.jsx)(It,{htmlFor:`${R.id}-true`,className:"flex-1 cursor-pointer",children:"True"})]}),(0,St.jsxs)("div",{className:"flex items-center space-x-2 p-3 rounded-lg hover:bg-muted/50",children:[(0,St.jsx)(ty,{value:"false",id:`${R.id}-false`}),(0,St.jsx)(It,{htmlFor:`${R.id}-false`,className:"flex-1 cursor-pointer",children:"False"})]})]}),R.type==="text"&&(0,St.jsx)(mu,{value:V||"",onChange:j=>H(j.target.value),placeholder:"Type your answer here...",className:"min-h-[120px]"}),R.type==="rating"&&(0,St.jsxs)("div",{className:"space-y-4",children:[(0,St.jsx)(jb,{value:[V||5],onValueChange:([j])=>H(j),max:10,min:1,step:1,className:"w-full"}),(0,St.jsxs)("div",{className:"text-center text-2xl font-bold",children:[V||5,"/10"]})]}),m&&R.hint&&(0,St.jsx)(Yx,{children:(0,St.jsxs)(Qx,{children:[(0,St.jsx)("strong",{children:"Hint:"})," ",R.hint]})})]})]})},validation:()=>!(R.required&&!v[R.id]),isOptional:!R.required}));if(N){let{score:R,totalScore:L}=O(),_=Math.round(R/L*100),U=_>=f;return(0,St.jsx)(ne.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:B("w-full max-w-2xl mx-auto",h),children:(0,St.jsxs)(Ve,{children:[(0,St.jsxs)(vr,{className:"text-center",children:[(0,St.jsx)("div",{className:"mx-auto mb-4",children:(0,St.jsx)(aL,{className:B("w-16 h-16",U?"text-yellow-500":"text-muted-foreground")})}),(0,St.jsx)(Or,{className:"text-3xl",children:"Quiz Complete!"}),(0,St.jsx)(es,{children:"Here's how you performed"})]}),(0,St.jsxs)(ze,{className:"space-y-6",children:[(0,St.jsxs)("div",{className:"text-center",children:[(0,St.jsxs)("div",{className:"text-5xl font-bold mb-2",children:[_,"%"]}),(0,St.jsx)(To,{value:_,className:"h-3 mb-4"}),(0,St.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,St.jsxs)("span",{children:["Score: ",R,"/",L]}),(0,St.jsx)("span",{children:U?(0,St.jsx)(dt,{variant:"success",children:"Passed"}):(0,St.jsx)(dt,{variant:"destructive",children:"Failed"})})]})]}),l&&(0,St.jsxs)("div",{className:"space-y-2",children:[(0,St.jsx)("h3",{className:"font-semibold",children:"Review Answers"}),x.map((V,E)=>{let H=g.find(j=>j.id===V.questionId);return(0,St.jsxs)("div",{className:"flex items-center justify-between p-2 rounded-lg bg-muted/50",children:[(0,St.jsxs)("span",{className:"text-sm",children:[s&&`Q${E+1}: `,H?.question.substring(0,50),"..."]}),(0,St.jsxs)(dt,{variant:V.isCorrect?"success":"destructive",children:[V.points,"/",H?.points||1]})]},V.questionId)})]}),(0,St.jsxs)("div",{className:"flex gap-2",children:[(0,St.jsxs)(re,{className:"flex-1",onClick:()=>window.location.reload(),children:[(0,St.jsx)(Mv,{className:"w-4 h-4 mr-2"}),"Retake Quiz"]}),(0,St.jsxs)(re,{variant:"outline",children:[(0,St.jsx)(xn,{className:"w-4 h-4 mr-2"}),"Download Results"]}),(0,St.jsxs)(re,{variant:"outline",children:[(0,St.jsx)(Tv,{className:"w-4 h-4 mr-2"}),"Share"]})]})]})]})})}return(0,St.jsxs)("div",{className:B("w-full",h),children:[o&&a&&(0,St.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,St.jsxs)("div",{className:"flex items-center gap-2",children:[(0,St.jsx)(yn,{className:"w-4 h-4"}),(0,St.jsxs)("span",{className:"text-sm font-medium",children:["Time Remaining: ",P(b)]})]}),(0,St.jsx)(To,{value:b/a*100,className:"w-32 h-2"})]}),(0,St.jsx)(o_,{steps:k,onComplete:F,allowStepSkip:c,validateOnStepChange:!0,showProgressBar:i,progressType:"dots",animationType:"slide"})]})},qZt=e=>{let{hasProAccess:t,isLoading:r}=Yt();return!r&&!t?(0,St.jsx)(Ve,{className:B("w-full",e.className),children:(0,St.jsx)(ze,{className:"py-12 text-center",children:(0,St.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,St.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,St.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,St.jsxs)("div",{children:[(0,St.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,St.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Quiz Form is available exclusively to MoonUI Pro subscribers."}),(0,St.jsx)("a",{href:"/pricing",children:(0,St.jsxs)(re,{size:"sm",children:[(0,St.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,St.jsx)($Zt,{...e})},WZt=qZt;var Id=D(ce(),1);var Gr=D(de(),1),GZt={visa:/^4/,mastercard:/^5[1-5]/,amex:/^3[47]/,discover:/^6(?:011|5)/,diners:/^3(?:0[0-5]|[68])/,jcb:/^35/,unionpay:/^62/};function KZt(e,t){let r=e.replace(/\s+/g,"").replace(/[^0-9]/gi,""),n=t==="amex"?r.match(/\d{1,4}/g):r.match(/\d{1,4}/g);return n?n.join(" "):r}function XZt(e){let t=e.replace(/\s+/g,"").replace(/[^0-9]/gi,"");return t.length>=2?t.slice(0,2)+(t.length>2?"/"+t.slice(2,4):""):t}function YZt(e){let t=e.replace(/\s+/g,"");for(let[r,n]of Object.entries(GZt))if(n.test(t))return r;return null}function QZt(e){let t=e.replace(/\s+/g,"");if(!/^\d+$/.test(t))return!1;let r=0,n=!1;for(let o=t.length-1;o>=0;o--){let a=parseInt(t.charAt(o),10);n&&(a*=2,a>9&&(a-=9)),r+=a,n=!n}return r%10===0}function ZZt(e){let t=e.split("/");if(t.length!==2)return!1;let r=parseInt(t[0],10),n=parseInt("20"+t[1],10);if(r<1||r>12)return!1;let o=new Date;return new Date(n,r-1)>o}var GKe=Id.default.forwardRef(({value:e={number:"",expiry:"",cvc:"",name:""},onChange:t,showCardPreview:r=!0,showCardType:n=!0,showSecurityBadge:o=!0,autoFormat:a=!0,validateOnChange:i=!1,labels:s={},placeholders:l={},errors:c={},className:u,inputClassName:d,labelClassName:f,errorClassName:p,disabled:m,required:h,...g},v)=>{let[y,x]=(0,Id.useState)(null),[w,b]=(0,Id.useState)(null),[C,S]=(0,Id.useState)({}),I=(0,Id.useRef)(null),N=(0,Id.useRef)(null),M=(0,Id.useRef)(null),A=(0,Id.useRef)(null);(0,Id.useEffect)(()=>{let F=YZt(e.number);x(F)},[e.number]),(0,Id.useEffect)(()=>{if(!i)return;let F={};e.number&&!QZt(e.number)&&(F.number="Invalid card number"),e.expiry&&!ZZt(e.expiry)&&(F.expiry="Invalid expiry date"),e.cvc&&(e.cvc.length<3||e.cvc.length>4)&&(F.cvc="Invalid CVC"),S(F)},[e,i]);let T=(F,P)=>{let k=P;if(a){if(F==="number"){k=KZt(P,y||void 0);let R=y==="amex"?18:19;if(k.length>R)return}else if(F==="expiry"){if(k=XZt(P),k.length>5)return}else if(F==="cvc"){k=P.replace(/\D/g,"");let R=y==="amex"?4:3;if(k.length>R)return}}t?.({...e,[F]:k}),a&&(F==="number"&&k.length===(y==="amex"?18:19)?N.current?.focus():F==="expiry"&&k.length===5?M.current?.focus():F==="cvc"&&k.length===(y==="amex"?4:3)&&A.current?.focus())},O={...C,...c};return(0,Gr.jsxs)("div",{ref:v,className:B("space-y-4",u),...g,children:[r&&(0,Gr.jsxs)(ne.div,{className:"relative w-full max-w-md mx-auto h-48 rounded-xl bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700 p-6 text-white shadow-xl overflow-hidden",initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},children:[(0,Gr.jsxs)("div",{className:"flex justify-between items-start mb-8",children:[(0,Gr.jsx)("div",{className:"text-lg font-semibold",children:y?y.toUpperCase():"CARD"}),(0,Gr.jsx)(Sv,{className:"w-8 h-8 text-white/80"})]}),(0,Gr.jsxs)("div",{className:"space-y-4",children:[(0,Gr.jsx)("div",{className:"text-xl font-mono tracking-wider",children:e.number||"\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022"}),(0,Gr.jsxs)("div",{className:"flex justify-between",children:[(0,Gr.jsxs)("div",{children:[(0,Gr.jsx)("div",{className:"text-xs text-white/70",children:"NAME"}),(0,Gr.jsx)("div",{className:"text-sm uppercase",children:e.name||"YOUR NAME"})]}),(0,Gr.jsxs)("div",{children:[(0,Gr.jsx)("div",{className:"text-xs text-white/70",children:"EXPIRES"}),(0,Gr.jsx)("div",{className:"text-sm",children:e.expiry||"MM/YY"})]})]})]})]}),(0,Gr.jsxs)("div",{className:"space-y-4",children:[(0,Gr.jsxs)("div",{className:"space-y-1",children:[(0,Gr.jsxs)(It,{htmlFor:"card-number",className:f,children:[s.number||"Card Number",h&&(0,Gr.jsx)("span",{className:"text-destructive ml-1",children:"*"})]}),(0,Gr.jsxs)("div",{className:"relative",children:[(0,Gr.jsx)(Jt,{ref:I,id:"card-number",type:"text",inputMode:"numeric",value:e.number,onChange:F=>T("number",F.target.value),onFocus:()=>b("number"),onBlur:()=>b(null),placeholder:l.number||"1234 5678 9012 3456",className:B("pr-20",O.number&&"border-destructive",d),disabled:m}),n&&y&&(0,Gr.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm font-medium text-muted-foreground",children:y.toUpperCase()})]}),O.number&&(0,Gr.jsx)("p",{className:B("text-sm text-destructive",p),children:O.number})]}),(0,Gr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Gr.jsxs)("div",{className:"space-y-1",children:[(0,Gr.jsxs)(It,{htmlFor:"card-expiry",className:f,children:[s.expiry||"Expiry Date",h&&(0,Gr.jsx)("span",{className:"text-destructive ml-1",children:"*"})]}),(0,Gr.jsx)(Jt,{ref:N,id:"card-expiry",type:"text",inputMode:"numeric",value:e.expiry,onChange:F=>T("expiry",F.target.value),onFocus:()=>b("expiry"),onBlur:()=>b(null),placeholder:l.expiry||"MM/YY",className:B(O.expiry&&"border-destructive",d),disabled:m}),O.expiry&&(0,Gr.jsx)("p",{className:B("text-sm text-destructive",p),children:O.expiry})]}),(0,Gr.jsxs)("div",{className:"space-y-1",children:[(0,Gr.jsxs)(It,{htmlFor:"card-cvc",className:f,children:[s.cvc||"CVC",h&&(0,Gr.jsx)("span",{className:"text-destructive ml-1",children:"*"})]}),(0,Gr.jsxs)("div",{className:"relative",children:[(0,Gr.jsx)(Jt,{ref:M,id:"card-cvc",type:"text",inputMode:"numeric",value:e.cvc,onChange:F=>T("cvc",F.target.value),onFocus:()=>b("cvc"),onBlur:()=>b(null),placeholder:l.cvc||y==="amex"?"1234":"123",className:B(O.cvc&&"border-destructive",d),disabled:m}),o&&(0,Gr.jsx)(Nt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"})]}),O.cvc&&(0,Gr.jsx)("p",{className:B("text-sm text-destructive",p),children:O.cvc})]})]}),(0,Gr.jsxs)("div",{className:"space-y-1",children:[(0,Gr.jsx)(It,{htmlFor:"card-name",className:f,children:s.name||"Cardholder Name"}),(0,Gr.jsx)(Jt,{ref:A,id:"card-name",type:"text",value:e.name,onChange:F=>T("name",F.target.value),onFocus:()=>b("name"),onBlur:()=>b(null),placeholder:l.name||"John Doe",className:B(O.name&&"border-destructive",d),disabled:m}),O.name&&(0,Gr.jsx)("p",{className:B("text-sm text-destructive",p),children:O.name})]})]}),o&&(0,Gr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Gr.jsx)(Nt,{className:"w-4 h-4"}),(0,Gr.jsx)("span",{children:"Your payment information is secure and encrypted"})]})]})});GKe.displayName="MoonUICreditCardInputPro";var ac=D(ce(),1);var nt=D(de(),1),KKe=xt("relative w-full rounded-lg border bg-card text-card-foreground shadow-sm",{variants:{variant:{default:"border-border",exam:"border-primary/20 bg-primary/5",personality:"border-secondary/20 bg-secondary/5"},size:{sm:"p-4",md:"p-6",lg:"p-8"}},defaultVariants:{variant:"default",size:"md"}}),XKe=ac.default.forwardRef(({className:e,variant:t,size:r,questions:n,settings:o={},onComplete:a,onProgress:i,title:s,description:l,...c},u)=>{let[d,f]=(0,ac.useState)([]),[p,m]=(0,ac.useState)(0),[h,g]=(0,ac.useState)({}),[v,y]=(0,ac.useState)(!1),[x,w]=(0,ac.useState)(null),[b,C]=(0,ac.useState)(o.timeLimit?o.timeLimit*60:null),[S,I]=(0,ac.useState)(Date.now()),[N,M]=(0,ac.useState)(!1),[A,T]=(0,ac.useState)(0);(0,ac.useEffect)(()=>{let j=[...n];o.shuffleQuestions&&(j=F(j)),o.shuffleOptions&&(j=j.map($=>$.options?{...$,options:F([...$.options])}:$)),f(j)},[n,o.shuffleQuestions,o.shuffleOptions]),(0,ac.useEffect)(()=>{if(b===null||b<=0||v)return;let j=setInterval(()=>{C($=>$===null||$<=1?(L(),0):$-1)},1e3);return()=>clearInterval(j)},[b,v]),(0,ac.useEffect)(()=>{i&&i(p+1,d.length)},[p,d.length,i]);let O=d[p],F=j=>{let $=[...j];for(let W=$.length-1;W>0;W--){let z=Math.floor(Math.random()*(W+1));[$[W],$[z]]=[$[z],$[W]]}return $},P=j=>{let $=Date.now()-S;g(W=>({...W,[O.id]:{questionId:O.id,answer:j,timeSpent:$}}))},k=()=>{p<d.length-1?(m(j=>j+1),I(Date.now()),M(!1)):L()},R=()=>{p>0&&(m(j=>j-1),M(!1))},L=()=>{let j=_();w(j),y(!0),T($=>$+1),a&&a(j)},_=()=>{let j=0,$=0,W=[];d.forEach(X=>{let Y=h[X.id],oe=X.points||1;j+=oe;let ie=!1;if(Y?.answer&&X.correctAnswer!==void 0)switch(X.type){case"single-choice":case"true-false":case"text":ie=Y.answer===X.correctAnswer;break;case"multiple-choice":Array.isArray(Y.answer)&&Array.isArray(X.correctAnswer)&&(ie=Y.answer.length===X.correctAnswer.length&&Y.answer.every(Le=>X.correctAnswer.includes(Le)));break;case"matching":if(typeof Y.answer=="object"&&typeof X.correctAnswer=="object"){let Le=X.correctAnswer,Ce=Y.answer;ie=Object.keys(Le).every(Be=>Le[Be]===Ce[Be])}break;case"rating":ie=!0;break}ie&&($+=oe),W.push({questionId:X.id,userAnswer:Y?.answer||null,correctAnswer:X.correctAnswer,isCorrect:ie,points:ie?oe:0})});let z=j>0?$/j*100:0,G=Object.values(h).reduce((X,Y)=>X+(Y.timeSpent||0),0);return{score:$,totalScore:j,percentage:z,passed:o.passingScore?z>=o.passingScore:void 0,answers:W,timeSpent:G,completedAt:new Date}},U=()=>{m(0),g({}),y(!1),w(null),C(o.timeLimit?o.timeLimit*60:null),I(Date.now()),M(!1),o.shuffleQuestions&&f(F([...n]))},V=()=>{if(!x)return;let j={title:s,completedAt:x.completedAt,score:x.score,totalScore:x.totalScore,percentage:x.percentage,passed:x.passed,timeSpent:x.timeSpent,answers:x.answers.map(G=>({question:d.find(Y=>Y.id===G.questionId)?.question,userAnswer:G.userAnswer,correctAnswer:G.correctAnswer,isCorrect:G.isCorrect,points:G.points}))},$=new Blob([JSON.stringify(j,null,2)],{type:"application/json"}),W=URL.createObjectURL($),z=document.createElement("a");z.href=W,z.download=`quiz-results-${Date.now()}.json`,z.click(),URL.revokeObjectURL(W)},E=j=>{let $=Math.floor(j/60),W=j%60;return`${$}:${W.toString().padStart(2,"0")}`},H=()=>{if(!O)return null;let j=h[O.id]?.answer;switch(O.type){case"single-choice":case"true-false":return(0,nt.jsx)("div",{className:"space-y-3",children:O.options?.map((G,X)=>(0,nt.jsx)(ne.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:X*.1},onClick:()=>P(G),className:B("w-full text-left p-4 rounded-lg border transition-colors",j===G?"border-primary bg-primary/10":"border-border hover:border-primary/50"),children:G},X))});case"multiple-choice":return(0,nt.jsx)("div",{className:"space-y-3",children:O.options?.map((G,X)=>{let Y=Array.isArray(j)&&j.includes(G);return(0,nt.jsx)(ne.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:X*.1},onClick:()=>{let oe=j||[],ie=Y?oe.filter(Le=>Le!==G):[...oe,G];P(ie)},className:B("w-full text-left p-4 rounded-lg border transition-colors",Y?"border-primary bg-primary/10":"border-border hover:border-primary/50"),children:(0,nt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,nt.jsx)("div",{className:B("w-5 h-5 rounded border-2 transition-colors",Y?"bg-primary border-primary":"border-border"),children:Y&&(0,nt.jsx)(Ks,{className:"w-full h-full text-primary-foreground"})}),G]})},X)})});case"text":return(0,nt.jsx)(ne.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:(0,nt.jsx)("textarea",{className:"w-full p-4 rounded-lg border border-input bg-background resize-none",rows:4,placeholder:"Type your answer here...",value:j||"",onChange:G=>P(G.target.value)})});case"rating":let $=O.maxRating||5,W=typeof j=="number"?j:0;return(0,nt.jsxs)(ne.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-4",children:[(0,nt.jsx)("div",{className:"flex justify-center gap-2",children:Array.from({length:$},(G,X)=>X+1).map(G=>(0,nt.jsx)("button",{onClick:()=>P(G),className:"transition-transform hover:scale-110",children:(0,nt.jsx)(vs,{className:B("w-10 h-10 transition-colors",G<=W?"fill-yellow-500 text-yellow-500":"text-muted-foreground")})},G))}),O.ratingLabels&&(0,nt.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,nt.jsx)("span",{children:O.ratingLabels[0]}),(0,nt.jsx)("span",{children:O.ratingLabels[1]})]})]});case"matching":let z=j||{};return(0,nt.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,nt.jsxs)("div",{className:"space-y-3",children:[(0,nt.jsx)("h4",{className:"font-medium mb-2",children:"Match these items:"}),O.leftOptions?.map((G,X)=>(0,nt.jsx)(ne.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:X*.1},className:"p-3 rounded-lg border bg-muted/50",children:G},G))]}),(0,nt.jsxs)("div",{className:"space-y-3",children:[(0,nt.jsx)("h4",{className:"font-medium mb-2",children:"With these:"}),O.leftOptions?.map(G=>(0,nt.jsx)(ne.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},children:(0,nt.jsxs)("select",{className:"w-full p-3 rounded-lg border bg-background",value:z[G]||"",onChange:X=>P({...z,[G]:X.target.value}),children:[(0,nt.jsx)("option",{value:"",children:"Select..."}),O.rightOptions?.map(X=>(0,nt.jsx)("option",{value:X,children:X},X))]})},G))]})]});default:return null}};return v&&x?(0,nt.jsx)("div",{ref:u,className:B(KKe({variant:t,size:r}),e),...c,children:(0,nt.jsxs)(ne.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"space-y-6",children:[(0,nt.jsxs)("div",{className:"text-center",children:[(0,nt.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Quiz Completed!"}),(0,nt.jsxs)("div",{className:"text-5xl font-bold mb-4",children:[x.percentage.toFixed(1),"%"]}),(0,nt.jsxs)("p",{className:"text-muted-foreground",children:["You scored ",x.score," out of ",x.totalScore," points"]}),x.passed!==void 0&&(0,nt.jsx)("div",{className:B("mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-full",x.passed?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:x.passed?(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(Ks,{className:"w-5 h-5"}),"Passed"]}):(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(lo,{className:"w-5 h-5"}),"Failed"]})})]}),o.allowReview&&(0,nt.jsxs)("div",{className:"space-y-4",children:[(0,nt.jsx)("h3",{className:"font-semibold",children:"Review Answers:"}),x.answers.map((j,$)=>{let W=d.find(z=>z.id===j.questionId);return W?(0,nt.jsx)("div",{className:"p-4 rounded-lg border bg-muted/50",children:(0,nt.jsxs)("div",{className:"flex items-start gap-3",children:[j.isCorrect?(0,nt.jsx)(Ks,{className:"w-5 h-5 text-green-600 mt-0.5"}):(0,nt.jsx)(lo,{className:"w-5 h-5 text-red-600 mt-0.5"}),(0,nt.jsxs)("div",{className:"flex-1",children:[(0,nt.jsxs)("p",{className:"font-medium mb-2",children:[$+1,". ",W.question]}),(0,nt.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Your answer: ",JSON.stringify(j.userAnswer)]}),!j.isCorrect&&W.correctAnswer!==void 0&&(0,nt.jsxs)("p",{className:"text-sm text-green-600 mt-1",children:["Correct answer: ",JSON.stringify(W.correctAnswer)]}),W.explanation&&(0,nt.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:W.explanation})]})]})},j.questionId):null})]}),(0,nt.jsxs)("div",{className:"flex gap-3 justify-center",children:[(!o.maxAttempts||A<o.maxAttempts)&&(0,nt.jsxs)("button",{onClick:U,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90",children:[(0,nt.jsx)(Mv,{className:"w-4 h-4"}),"Try Again"]}),(0,nt.jsxs)("button",{onClick:V,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg border hover:bg-muted",children:[(0,nt.jsx)(xn,{className:"w-4 h-4"}),"Download Results"]})]})]})}):(0,nt.jsxs)("div",{ref:u,className:B(KKe({variant:t,size:r}),e),...c,children:[(s||b!==null)&&(0,nt.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,nt.jsxs)("div",{children:[s&&(0,nt.jsx)("h2",{className:"text-2xl font-bold",children:s}),l&&(0,nt.jsx)("p",{className:"text-muted-foreground mt-1",children:l})]}),b!==null&&(0,nt.jsxs)("div",{className:B("flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium",b<60?"bg-red-100 text-red-700":"bg-muted"),children:[(0,nt.jsx)(yn,{className:"w-4 h-4"}),E(b)]})]}),(0,nt.jsxs)("div",{className:"mb-6",children:[(0,nt.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground mb-2",children:[(0,nt.jsxs)("span",{children:["Question ",p+1," of ",d.length]}),(0,nt.jsxs)("span",{children:[Math.round((p+1)/d.length*100),"%"]})]}),(0,nt.jsx)("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:(0,nt.jsx)(ne.div,{className:"h-full bg-primary",initial:{width:0},animate:{width:`${(p+1)/d.length*100}%`},transition:{duration:.3}})})]}),(0,nt.jsx)(_t,{mode:"wait",children:O&&(0,nt.jsxs)(ne.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"mb-6",children:[(0,nt.jsxs)("h3",{className:"text-lg font-semibold mb-4",children:[O.question,O.required&&(0,nt.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),H(),o.showHints&&O.hint&&(0,nt.jsxs)("div",{className:"mt-4",children:[(0,nt.jsxs)("button",{onClick:()=>M(!N),className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[(0,nt.jsx)(hm,{className:"w-4 h-4"}),N?"Hide":"Show"," Hint"]}),N&&(0,nt.jsx)(ne.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mt-2 p-3 rounded-lg bg-muted/50 text-sm",children:O.hint})]}),o.showInstantFeedback&&h[O.id]&&O.correctAnswer!==void 0&&(0,nt.jsx)(ne.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mt-4",children:(()=>{let j=h[O.id].answer,$=!1;switch(O.type){case"single-choice":case"true-false":$=j===O.correctAnswer;break}return(0,nt.jsxs)("div",{className:B("p-3 rounded-lg flex items-start gap-2",$?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:[$?(0,nt.jsx)(Ks,{className:"w-5 h-5 mt-0.5"}):(0,nt.jsx)(lo,{className:"w-5 h-5 mt-0.5"}),(0,nt.jsxs)("div",{children:[(0,nt.jsx)("p",{className:"font-medium",children:$?"Correct!":"Incorrect"}),O.explanation&&(0,nt.jsx)("p",{className:"text-sm mt-1",children:O.explanation})]})]})})()})]},O.id)}),(0,nt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nt.jsxs)("button",{onClick:R,disabled:p===0,className:B("inline-flex items-center gap-2 px-4 py-2 rounded-lg transition-colors",p===0?"opacity-50 cursor-not-allowed bg-muted text-muted-foreground":"bg-muted hover:bg-muted/80"),children:[(0,nt.jsx)(ga,{className:"w-4 h-4"}),"Previous"]}),(0,nt.jsxs)("button",{onClick:p===d.length-1?L:k,disabled:O?.required&&!h[O.id],className:B("inline-flex items-center gap-2 px-4 py-2 rounded-lg transition-colors",O?.required&&!h[O.id]?"opacity-50 cursor-not-allowed bg-muted text-muted-foreground":"bg-primary text-primary-foreground hover:bg-primary/90"),children:[p===d.length-1?"Complete":"Next",(0,nt.jsx)(Kn,{className:"w-4 h-4"})]})]})]})});XKe.displayName="MoonUIQuizFormProInternal";var jle=ac.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Yt();return!n&&!r?(0,nt.jsx)(Ve,{className:B("w-full",e.className),children:(0,nt.jsx)(ze,{className:"py-12 text-center",children:(0,nt.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,nt.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,nt.jsx)(Nt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,nt.jsxs)("div",{children:[(0,nt.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,nt.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"MoonUI Quiz Form is available exclusively to MoonUI Pro subscribers."}),(0,nt.jsx)("a",{href:"/pricing",children:(0,nt.jsxs)(re,{size:"sm",children:[(0,nt.jsx)(bt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,nt.jsx)(XKe,{...e,ref:t})});jle.displayName="MoonUIQuizFormPro";var Od=D(ce(),1);var ee=D(lt(),1),Vn=D(lt(),1);var kd=D(lt(),1);var ic=D(lt(),1);var h1=D(_r(),1),PW="Collapsible",[JZt,$le]=mn(PW),[eJt,qle]=JZt(PW),YKe=ic.forwardRef((e,t)=>{let{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:a,onOpenChange:i,...s}=e,[l,c]=Jn({prop:n,defaultProp:o??!1,onChange:i,caller:PW});return(0,h1.jsx)(eJt,{scope:r,disabled:a,contentId:Vo(),open:l,onOpenToggle:ic.useCallback(()=>c(u=>!u),[c]),children:(0,h1.jsx)(rt.div,{"data-state":Gle(l),"data-disabled":a?"":void 0,...s,ref:t})})});YKe.displayName=PW;var QKe="CollapsibleTrigger",ZKe=ic.forwardRef((e,t)=>{let{__scopeCollapsible:r,...n}=e,o=qle(QKe,r);return(0,h1.jsx)(rt.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Gle(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:He(e.onClick,o.onOpenToggle)})});ZKe.displayName=QKe;var Wle="CollapsibleContent",JKe=ic.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=qle(Wle,e.__scopeCollapsible);return(0,h1.jsx)(uo,{present:r||o.open,children:({present:a})=>(0,h1.jsx)(tJt,{...n,ref:t,present:a})})});JKe.displayName=Wle;var tJt=ic.forwardRef((e,t)=>{let{__scopeCollapsible:r,present:n,children:o,...a}=e,i=qle(Wle,r),[s,l]=ic.useState(n),c=ic.useRef(null),u=Xt(t,c),d=ic.useRef(0),f=d.current,p=ic.useRef(0),m=p.current,h=i.open||s,g=ic.useRef(h),v=ic.useRef(void 0);return ic.useEffect(()=>{let y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),qn(()=>{let y=c.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";let x=y.getBoundingClientRect();d.current=x.height,p.current=x.width,g.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(n)}},[i.open,n]),(0,h1.jsx)(rt.div,{"data-state":Gle(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!h,...a,ref:u,style:{["--radix-collapsible-content-height"]:f?`${f}px`:void 0,["--radix-collapsible-content-width"]:m?`${m}px`:void 0,...e.style},children:h&&o})});function Gle(e){return e?"open":"closed"}var e7e=YKe,t7e=ZKe,r7e=JKe;var ll=D(_r(),1),ch="Accordion",nJt=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Xle,oJt,aJt]=cf(ch),[kW,RLn]=mn(ch,[aJt,$le]),Yle=$le(),iJt=kd.default.forwardRef((e,t)=>{let{type:r,...n}=e,o=n,a=n;return(0,ll.jsx)(Xle.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?(0,ll.jsx)(uJt,{...a,ref:t}):(0,ll.jsx)(cJt,{...o,ref:t})})});iJt.displayName=ch;var[n7e,sJt]=kW(ch),[o7e,lJt]=kW(ch,{collapsible:!1}),cJt=kd.default.forwardRef((e,t)=>{let{value:r,defaultValue:n,onValueChange:o=()=>{},collapsible:a=!1,...i}=e,[s,l]=Jn({prop:r,defaultProp:n??"",onChange:o,caller:ch});return(0,ll.jsx)(n7e,{scope:e.__scopeAccordion,value:kd.default.useMemo(()=>s?[s]:[],[s]),onItemOpen:l,onItemClose:kd.default.useCallback(()=>a&&l(""),[a,l]),children:(0,ll.jsx)(o7e,{scope:e.__scopeAccordion,collapsible:a,children:(0,ll.jsx)(a7e,{...i,ref:t})})})}),uJt=kd.default.forwardRef((e,t)=>{let{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,s]=Jn({prop:r,defaultProp:n??[],onChange:o,caller:ch}),l=kd.default.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=kd.default.useCallback(u=>s((d=[])=>d.filter(f=>f!==u)),[s]);return(0,ll.jsx)(n7e,{scope:e.__scopeAccordion,value:i,onItemOpen:l,onItemClose:c,children:(0,ll.jsx)(o7e,{scope:e.__scopeAccordion,collapsible:!0,children:(0,ll.jsx)(a7e,{...a,ref:t})})})}),[dJt,RW]=kW(ch),a7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,disabled:n,dir:o,orientation:a="vertical",...i}=e,s=kd.default.useRef(null),l=Xt(s,t),c=oJt(r),d=wp(o)==="ltr",f=He(e.onKeyDown,p=>{if(!nJt.includes(p.key))return;let m=p.target,h=c().filter(I=>!I.ref.current?.disabled),g=h.findIndex(I=>I.ref.current===m),v=h.length;if(g===-1)return;p.preventDefault();let y=g,x=0,w=v-1,b=()=>{y=g+1,y>w&&(y=x)},C=()=>{y=g-1,y<x&&(y=w)};switch(p.key){case"Home":y=x;break;case"End":y=w;break;case"ArrowRight":a==="horizontal"&&(d?b():C());break;case"ArrowDown":a==="vertical"&&b();break;case"ArrowLeft":a==="horizontal"&&(d?C():b());break;case"ArrowUp":a==="vertical"&&C();break}let S=y%v;h[S].ref.current?.focus()});return(0,ll.jsx)(dJt,{scope:r,disabled:n,direction:o,orientation:a,children:(0,ll.jsx)(Xle.Slot,{scope:r,children:(0,ll.jsx)(rt.div,{...i,"data-orientation":a,ref:l,onKeyDown:n?void 0:f})})})}),IW="AccordionItem",[fJt,Qle]=kW(IW),i7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,value:n,...o}=e,a=RW(IW,r),i=sJt(IW,r),s=Yle(r),l=Vo(),c=n&&i.value.includes(n)||!1,u=a.disabled||e.disabled;return(0,ll.jsx)(fJt,{scope:r,open:c,disabled:u,triggerId:l,children:(0,ll.jsx)(e7e,{"data-orientation":a.orientation,"data-state":f7e(c),...s,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?i.onItemOpen(n):i.onItemClose(n)}})})});i7e.displayName=IW;var s7e="AccordionHeader",l7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,...n}=e,o=RW(ch,r),a=Qle(s7e,r);return(0,ll.jsx)(rt.h3,{"data-orientation":o.orientation,"data-state":f7e(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:t})});l7e.displayName=s7e;var Kle="AccordionTrigger",c7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,...n}=e,o=RW(ch,r),a=Qle(Kle,r),i=lJt(Kle,r),s=Yle(r);return(0,ll.jsx)(Xle.ItemSlot,{scope:r,children:(0,ll.jsx)(t7e,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:a.triggerId,...s,...n,ref:t})})});c7e.displayName=Kle;var u7e="AccordionContent",d7e=kd.default.forwardRef((e,t)=>{let{__scopeAccordion:r,...n}=e,o=RW(ch,r),a=Qle(u7e,r),i=Yle(r);return(0,ll.jsx)(r7e,{role:"region","aria-labelledby":a.triggerId,"data-orientation":o.orientation,...i,...n,ref:t,style:{["--radix-accordion-content-height"]:"var(--radix-collapsible-content-height)",["--radix-accordion-content-width"]:"var(--radix-collapsible-content-width)",...e.style}})});d7e.displayName=u7e;function f7e(e){return e?"open":"closed"}var p7e=i7e,m7e=l7e,Zle=c7e,Jle=d7e;var MW=D(lt());var h7e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mJt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ece=e=>{let t=mJt(e);return t.charAt(0).toUpperCase()+t.slice(1)},NW=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),g7e=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var a_=D(lt());var v7e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var y7e=(0,a_.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:i,...s},l)=>(0,a_.createElement)("svg",{ref:l,...v7e,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:NW("lucide",o),...!a&&!g7e(s)&&{"aria-hidden":"true"},...s},[...i.map(([c,u])=>(0,a_.createElement)(c,u)),...Array.isArray(a)?a:[a]]));var wt=(e,t)=>{let r=(0,MW.forwardRef)(({className:n,...o},a)=>(0,MW.createElement)(y7e,{ref:a,iconNode:t,className:NW(`lucide-${h7e(ece(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ece(e),r};var hJt=[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],i_=wt("align-center",hJt);var gJt=[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]],s_=wt("align-justify",gJt);var vJt=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],l_=wt("align-left",vJt);var yJt=[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],c_=wt("align-right",yJt);var xJt=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],u_=wt("bold",xJt);var bJt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ky=wt("check",bJt);var wJt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],j0=wt("chevron-down",wJt);var CJt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],rM=wt("chevron-left",CJt);var SJt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$0=wt("chevron-right",SJt);var PJt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],d_=wt("chevron-up",PJt);var IJt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Jg=wt("circle-alert",IJt);var kJt=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],q0=wt("circle-check-big",kJt);var RJt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nM=wt("circle",RJt);var NJt=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],f_=wt("code",NJt);var MJt=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],p_=wt("credit-card",MJt);var TJt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Xy=wt("ellipsis",TJt);var AJt=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],m_=wt("eye",AJt);var LJt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],h_=wt("file-text",LJt);var EJt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],g_=wt("file",EJt);var DJt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],oM=wt("image",DJt);var OJt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],aM=wt("info",OJt);var _Jt=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],v_=wt("italic",_Jt);var FJt=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],y_=wt("link",FJt);var BJt=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],x_=wt("list-ordered",BJt);var VJt=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],b_=wt("list",VJt);var UJt=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ef=wt("loader-circle",UJt);var zJt=[["path",{d:"M5 12h14",key:"1ays0h"}]],w_=wt("minus",zJt);var HJt=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],C_=wt("music",HJt);var jJt=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],S_=wt("palette",jJt);var $Jt=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],P_=wt("phone",$Jt);var qJt=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],I_=wt("quote",qJt);var WJt=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],k_=wt("redo",WJt);var GJt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],R_=wt("search",GJt);var KJt=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Rd=wt("square-pen",KJt);var XJt=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],N_=wt("strikethrough",XJt);var YJt=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],W0=wt("triangle-alert",YJt);var QJt=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],M_=wt("underline",QJt);var ZJt=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],T_=wt("undo",ZJt);var JJt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],A_=wt("upload",JJt);var eer=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],L_=wt("video",eer);var ter=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yy=wt("x",ter);function x7e(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=x7e(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function TW(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=x7e(e))&&(n&&(n+=" "),n+=t);return n}var nce="-",rer=e=>{let t=oer(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{let s=i.split(nce);return s[0]===""&&s.length!==1&&s.shift(),C7e(s,t)||ner(i)},getConflictingClassGroupIds:(i,s)=>{let l=r[i]||[];return s&&n[i]?[...l,...n[i]]:l}}},C7e=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),o=n?C7e(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;let a=e.join(nce);return t.validators.find(({validator:i})=>i(a))?.classGroupId},b7e=/^\[(.+)\]$/,ner=e=>{if(b7e.test(e)){let t=b7e.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},oer=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return ier(Object.entries(e.classGroups),r).forEach(([a,i])=>{rce(i,n,a,t)}),n},rce=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){let a=o===""?t:w7e(t,o);a.classGroupId=r;return}if(typeof o=="function"){if(aer(o)){rce(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([a,i])=>{rce(i,w7e(t,a),r,n)})})},w7e=(e,t)=>{let r=e;return t.split(nce).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},aer=e=>e.isThemeGetter,ier=(e,t)=>t?e.map(([r,n])=>{let o=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,s])=>[t+i,s])):a);return[r,o]}):e,ser=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map,o=(a,i)=>{r.set(a,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let i=r.get(a);if(i!==void 0)return i;if((i=n.get(a))!==void 0)return o(a,i),i},set(a,i){r.has(a)?r.set(a,i):o(a,i)}}},S7e="!",ler=e=>{let{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],a=t.length,i=s=>{let l=[],c=0,u=0,d;for(let g=0;g<s.length;g++){let v=s[g];if(c===0){if(v===o&&(n||s.slice(g,g+a)===t)){l.push(s.slice(u,g)),u=g+a;continue}if(v==="/"){d=g;continue}}v==="["?c++:v==="]"&&c--}let f=l.length===0?s:s.substring(u),p=f.startsWith(S7e),m=p?f.substring(1):f,h=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:h}};return r?s=>r({className:s,parseClassName:i}):i},cer=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},uer=e=>({cache:ser(e.cacheSize),parseClassName:ler(e),...rer(e)}),der=/\s+/,fer=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(der),s="";for(let l=i.length-1;l>=0;l-=1){let c=i[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(c),m=!!p,h=n(m?f.substring(0,p):f);if(!h){if(!m){s=c+(s.length>0?" "+s:s);continue}if(h=n(f),!h){s=c+(s.length>0?" "+s:s);continue}m=!1}let g=cer(u).join(":"),v=d?g+S7e:g,y=v+h;if(a.includes(y))continue;a.push(y);let x=o(h,m);for(let w=0;w<x.length;++w){let b=x[w];a.push(v+b)}s=c+(s.length>0?" "+s:s)}return s};function per(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=P7e(t))&&(n&&(n+=" "),n+=r);return n}var P7e=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=P7e(e[n]))&&(r&&(r+=" "),r+=t);return r};function mer(e,...t){let r,n,o,a=i;function i(l){let c=t.reduce((u,d)=>d(u),e());return r=uer(c),n=r.cache.get,o=r.cache.set,a=s,s(l)}function s(l){let c=n(l);if(c)return c;let u=fer(l,r);return o(l,u),u}return function(){return a(per.apply(null,arguments))}}var Xa=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},I7e=/^\[(?:([a-z-]+):)?(.+)\]$/i,her=/^\d+\/\d+$/,ger=new Set(["px","full","screen"]),ver=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yer=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xer=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ber=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wer=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qy=e=>iM(e)||ger.has(e)||her.test(e),G0=e=>sM(e,"length",Mer),iM=e=>!!e&&!Number.isNaN(Number(e)),tce=e=>sM(e,"number",iM),E_=e=>!!e&&Number.isInteger(Number(e)),Cer=e=>e.endsWith("%")&&iM(e.slice(0,-1)),un=e=>I7e.test(e),K0=e=>ver.test(e),Ser=new Set(["length","size","percentage"]),Per=e=>sM(e,Ser,k7e),Ier=e=>sM(e,"position",k7e),ker=new Set(["image","url"]),Rer=e=>sM(e,ker,Aer),Ner=e=>sM(e,"",Ter),D_=()=>!0,sM=(e,t,r)=>{let n=I7e.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Mer=e=>yer.test(e)&&!xer.test(e),k7e=()=>!1,Ter=e=>ber.test(e),Aer=e=>wer.test(e);var Ler=()=>{let e=Xa("colors"),t=Xa("spacing"),r=Xa("blur"),n=Xa("brightness"),o=Xa("borderColor"),a=Xa("borderRadius"),i=Xa("borderSpacing"),s=Xa("borderWidth"),l=Xa("contrast"),c=Xa("grayscale"),u=Xa("hueRotate"),d=Xa("invert"),f=Xa("gap"),p=Xa("gradientColorStops"),m=Xa("gradientColorStopPositions"),h=Xa("inset"),g=Xa("margin"),v=Xa("opacity"),y=Xa("padding"),x=Xa("saturate"),w=Xa("scale"),b=Xa("sepia"),C=Xa("skew"),S=Xa("space"),I=Xa("translate"),N=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",un,t],T=()=>[un,t],O=()=>["",Qy,G0],F=()=>["auto",iM,un],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],_=()=>["","0",un],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[iM,un];return{cacheSize:500,separator:":",theme:{colors:[D_],spacing:[Qy,G0],blur:["none","",K0,un],brightness:V(),borderColor:[e],borderRadius:["none","","full",K0,un],borderSpacing:T(),borderWidth:O(),contrast:V(),grayscale:_(),hueRotate:V(),invert:_(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[Cer,G0],inset:A(),margin:A(),opacity:V(),padding:T(),saturate:V(),scale:V(),sepia:_(),skew:V(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",un]}],container:["container"],columns:[{columns:[K0]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...P(),un]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",E_,un]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",un]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",E_,un]}],"grid-cols":[{"grid-cols":[D_]}],"col-start-end":[{col:["auto",{span:["full",E_,un]},un]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[D_]}],"row-start-end":[{row:["auto",{span:[E_,un]},un]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",un]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",un]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",un,t]}],"min-w":[{"min-w":[un,t,"min","max","fit"]}],"max-w":[{"max-w":[un,t,"none","full","min","max","fit","prose",{screen:[K0]},K0]}],h:[{h:[un,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[un,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[un,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[un,t,"auto","min","max","fit"]}],"font-size":[{text:["base",K0,G0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",tce]}],"font-family":[{font:[D_]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",un]}],"line-clamp":[{"line-clamp":["none",iM,tce]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qy,un]}],"list-image":[{"list-image":["none",un]}],"list-style-type":[{list:["none","disc","decimal",un]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qy,G0]}],"underline-offset":[{"underline-offset":["auto",Qy,un]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",un]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",un]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...P(),Ier]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Per]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Rer]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:k()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[Qy,un]}],"outline-w":[{outline:[Qy,G0]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Qy,G0]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",K0,Ner]}],"shadow-color":[{shadow:[D_]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...R(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":R()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",K0,un]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",un]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",un]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",un]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[E_,un]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",un]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",un]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",un]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qy,G0,tce]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var R7e=mer(Ler);var q=D(_r(),1);var N7e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,M7e=TW,jn=(e,t)=>r=>{var n;if(t?.variants==null)return M7e(e,r?.class,r?.className);let{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(c=>{let u=r?.[c],d=a?.[c];if(u===null)return null;let f=N7e(u)||N7e(d);return o[c][f]}),s=r&&Object.entries(r).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(m=>{let[h,g]=m;return Array.isArray(g)?g.includes({...a,...s}[h]):{...a,...s}[h]===g})?[...c,d,f]:c},[]);return M7e(e,i,l,r?.class,r?.className)};var Qp=D(lt(),1);var T7e=D(qE(),1);function A7e(){return(0,T7e.useSyncExternalStore)(Eer,()=>!0,()=>!1)}function Eer(){return()=>{}}var O_=D(_r(),1),oce="Avatar",[Der,lOn]=mn(oce),[Oer,E7e]=Der(oce),D7e=Qp.forwardRef((e,t)=>{let{__scopeAvatar:r,...n}=e,[o,a]=Qp.useState("idle");return(0,O_.jsx)(Oer,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:a,children:(0,O_.jsx)(rt.span,{...n,ref:t})})});D7e.displayName=oce;var O7e="AvatarImage",_7e=Qp.forwardRef((e,t)=>{let{__scopeAvatar:r,src:n,onLoadingStatusChange:o=()=>{},...a}=e,i=E7e(O7e,r),s=_er(n,a),l=eo(c=>{o(c),i.onImageLoadingStatusChange(c)});return qn(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?(0,O_.jsx)(rt.img,{...a,ref:t,src:n}):null});_7e.displayName=O7e;var F7e="AvatarFallback",B7e=Qp.forwardRef((e,t)=>{let{__scopeAvatar:r,delayMs:n,...o}=e,a=E7e(F7e,r),[i,s]=Qp.useState(n===void 0);return Qp.useEffect(()=>{if(n!==void 0){let l=window.setTimeout(()=>s(!0),n);return()=>window.clearTimeout(l)}},[n]),i&&a.imageLoadingStatus!=="loaded"?(0,O_.jsx)(rt.span,{...o,ref:t}):null});B7e.displayName=F7e;function L7e(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function _er(e,{referrerPolicy:t,crossOrigin:r}){let n=A7e(),o=Qp.useRef(null),a=(()=>n?(o.current||(o.current=new window.Image),o.current):null)(),[i,s]=Qp.useState(()=>L7e(a,e));return qn(()=>{s(L7e(a,e))},[a,e]),qn(()=>{let l=d=>()=>{s(d)};if(!a)return;let c=l("loaded"),u=l("error");return a.addEventListener("load",c),a.addEventListener("error",u),t&&(a.referrerPolicy=t),typeof r=="string"&&(a.crossOrigin=r),()=>{a.removeEventListener("load",c),a.removeEventListener("error",u)}},[a,r,t]),i}var ace=D7e,ice=_7e,sce=B7e;var xF=D(_r(),1),nv=D(lt(),1);var V7e=D(lt(),1),lM=(0,V7e.createContext)({});var U7e=D(lt(),1);function ev(e){let t=(0,U7e.useRef)(null);return t.current===null&&(t.current=e()),t.current}var AW=D(lt(),1);var cM=typeof window<"u";var uM=cM?AW.useLayoutEffect:AW.useEffect;var zce=D(_r(),1),HXe=D(lt(),1),vF=D(lt(),1);var z7e=D(lt(),1),X0=(0,z7e.createContext)(null);var UXe=D(_r(),1);function g1(e,t){e.indexOf(t)===-1&&e.push(t)}function uh(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var El=(e,t,r)=>r>t?t:r<e?e:r;var Zy=()=>{},sc=()=>{};var zc={};var __=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function F_(e){return typeof e=="object"&&e!==null}var B_=e=>/^0[^.\s]+$/u.test(e);function v1(e){let t;return()=>(t===void 0&&(t=e()),t)}var Li=e=>e;var Ber=(e,t)=>r=>t(e(r)),dh=(...e)=>e.reduce(Ber);var Zp=(e,t,r)=>{let n=t-e;return n===0?1:(r-e)/n};var Jy=class{constructor(){this.subscriptions=[]}add(t){return g1(this.subscriptions,t),()=>uh(this.subscriptions,t)}notify(t,r,n){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,r,n);else for(let a=0;a<o;a++){let i=this.subscriptions[a];i&&i(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var us=e=>e*1e3,lc=e=>e/1e3;function V_(e,t){return t?e*(1e3/t):0}var H7e=(e,t,r)=>{let n=t-e;return((r-e)%n+n)%n+e};var j7e=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Ver=1e-7,Uer=12;function zer(e,t,r,n,o){let a,i,s=0;do i=t+(r-t)/2,a=j7e(i,n,o)-e,a>0?r=i:t=i;while(Math.abs(a)>Ver&&++s<Uer);return i}function Y0(e,t,r,n){if(e===t&&r===n)return Li;let o=a=>zer(a,0,1,e,r);return a=>a===0||a===1?a:j7e(o(a),t,n)}var LW=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var EW=e=>t=>1-e(1-t);var DW=Y0(.33,1.53,.69,.99),dM=EW(DW),U_=LW(dM);var z_=e=>(e*=2)<1?.5*dM(e):.5*(2-Math.pow(2,-10*(e-1)));var H_=e=>1-Math.sin(Math.acos(e)),j_=EW(H_),$_=LW(H_);var lce=Y0(.42,0,1,1),cce=Y0(0,0,.58,1),q_=Y0(.42,0,.58,1);var W_=e=>Array.isArray(e)&&typeof e[0]!="number";function G_(e,t){return W_(e)?e[H7e(0,e.length,t)]:e}var K_=e=>Array.isArray(e)&&typeof e[0]=="number";var $7e={linear:Li,easeIn:lce,easeInOut:q_,easeOut:cce,circIn:H_,circInOut:$_,circOut:j_,backIn:dM,backInOut:U_,backOut:DW,anticipate:z_},Her=e=>typeof e=="string",OW=e=>{if(K_(e)){sc(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,o]=e;return Y0(t,r,n,o)}else if(Her(e))return sc($7e[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),$7e[e];return e};var X_=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];var Nd={value:null,addProjectionMetrics:null};function q7e(e,t){let r=new Set,n=new Set,o=!1,a=!1,i=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){i.has(d)&&(u.schedule(d),e()),l++,d(s)}let u={schedule:(d,f=!1,p=!1)=>{let h=p&&o?r:n;return f&&i.add(d),h.has(d)||h.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(s=d,o){a=!0;return}o=!0,[r,n]=[n,r],r.forEach(c),t&&Nd.value&&Nd.value.frameloop[t].push(l),l=0,r.clear(),o=!1,a&&(a=!1,u.process(d))}};return u}var jer=40;function _W(e,t){let r=!1,n=!0,o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,i=X_.reduce((x,w)=>(x[w]=q7e(a,t?w:void 0),x),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=i,h=()=>{let x=zc.useManualTiming?o.timestamp:performance.now();r=!1,zc.useManualTiming||(o.delta=n?1e3/60:Math.max(Math.min(x-o.timestamp,jer),1)),o.timestamp=x,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),p.process(o),m.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(h))},g=()=>{r=!0,n=!0,o.isProcessing||e(h)};return{schedule:X_.reduce((x,w)=>{let b=i[w];return x[w]=(C,S=!1,I=!1)=>(r||g(),b.schedule(C,S,I)),x},{}),cancel:x=>{for(let w=0;w<X_.length;w++)i[X_[w]].cancel(x)},state:o,steps:i}}var{schedule:dn,cancel:Hc,state:Xi,steps:Y_}=_W(typeof requestAnimationFrame<"u"?requestAnimationFrame:Li,!0);var FW;function $er(){FW=void 0}var Yi={now:()=>(FW===void 0&&Yi.set(Xi.isProcessing||zc.useManualTiming?Xi.timestamp:performance.now()),FW),set:e=>{FW=e,queueMicrotask($er)}};var fh={layout:0,mainThread:0,waapi:0};var W7e=e=>t=>typeof t=="string"&&t.startsWith(e),y1=W7e("--"),qer=W7e("var(--"),x1=e=>qer(e)?Wer.test(e.split("/*")[0].trim()):!1,Wer=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var tv={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ex={...tv,transform:e=>El(0,1,e)},Q_={...tv,default:1};var Q0=e=>Math.round(e*1e5)/1e5;var fM=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function G7e(e){return e==null}var K7e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var pM=(e,t)=>r=>!!(typeof r=="string"&&K7e.test(r)&&r.startsWith(e)||t&&!G7e(r)&&Object.prototype.hasOwnProperty.call(r,t)),BW=(e,t,r)=>n=>{if(typeof n!="string")return n;let[o,a,i,s]=n.match(fM);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:s!==void 0?parseFloat(s):1}};var Ger=e=>El(0,255,e),uce={...tv,transform:e=>Math.round(Ger(e))},rv={test:pM("rgb","red"),parse:BW("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+uce.transform(e)+", "+uce.transform(t)+", "+uce.transform(r)+", "+Q0(ex.transform(n))+")"};function Ker(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}}var Z_={test:pM("#"),parse:Ker,transform:rv.transform};var J_=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ph=J_("deg"),jc=J_("%"),mr=J_("px"),dce=J_("vh"),fce=J_("vw"),VW=(()=>({...jc,parse:e=>jc.parse(e)/100,transform:e=>jc.transform(e*100)}))();var Z0={test:pM("hsl","hue"),parse:BW("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+jc.transform(Q0(t))+", "+jc.transform(Q0(r))+", "+Q0(ex.transform(n))+")"};var fi={test:e=>rv.test(e)||Z_.test(e)||Z0.test(e),parse:e=>rv.test(e)?rv.parse(e):Z0.test(e)?Z0.parse(e):Z_.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?rv.transform(e):Z0.transform(e),getAnimatableNone:e=>{let t=fi.parse(e);return t.alpha=0,fi.transform(t)}};var X7e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Xer(e){return isNaN(e)&&typeof e=="string"&&(e.match(fM)?.length||0)+(e.match(X7e)?.length||0)>0}var Q7e="number",Z7e="color",Yer="var",Qer="var(",Y7e="${}",Zer=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function J0(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[],a=0,s=t.replace(Zer,l=>(fi.test(l)?(n.color.push(a),o.push(Z7e),r.push(fi.parse(l))):l.startsWith(Qer)?(n.var.push(a),o.push(Yer),r.push(l)):(n.number.push(a),o.push(Q7e),r.push(parseFloat(l))),++a,Y7e)).split(Y7e);return{values:r,split:s,indexes:n,types:o}}function J7e(e){return J0(e).values}function eXe(e){let{split:t,types:r}=J0(e),n=t.length;return o=>{let a="";for(let i=0;i<n;i++)if(a+=t[i],o[i]!==void 0){let s=r[i];s===Q7e?a+=Q0(o[i]):s===Z7e?a+=fi.transform(o[i]):a+=o[i]}return a}}var Jer=e=>typeof e=="number"?0:fi.test(e)?fi.getAnimatableNone(e):e;function etr(e){let t=J7e(e);return eXe(e)(t.map(Jer))}var $c={test:Xer,parse:J7e,createTransformer:eXe,getAnimatableNone:etr};function pce(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function tXe({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let o=0,a=0,i=0;if(!t)o=a=i=r;else{let s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;o=pce(l,s,e+1/3),a=pce(l,s,e),i=pce(l,s,e-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(i*255),alpha:n}}function mM(e,t){return r=>r>0?t:e}var En=(e,t,r)=>e+(t-e)*r;var mce=(e,t,r)=>{let n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},ttr=[Z_,rv,Z0],rtr=e=>ttr.find(t=>t.test(e));function rXe(e){let t=rtr(e);if(Zy(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===Z0&&(r=tXe(r)),r}var hce=(e,t)=>{let r=rXe(e),n=rXe(t);if(!r||!n)return mM(e,t);let o={...r};return a=>(o.red=mce(r.red,n.red,a),o.green=mce(r.green,n.green,a),o.blue=mce(r.blue,n.blue,a),o.alpha=En(r.alpha,n.alpha,a),rv.transform(o))};var UW=new Set(["none","hidden"]);function nXe(e,t){return UW.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function ntr(e,t){return r=>En(e,t,r)}function zW(e){return typeof e=="number"?ntr:typeof e=="string"?x1(e)?mM:fi.test(e)?hce:itr:Array.isArray(e)?oXe:typeof e=="object"?fi.test(e)?hce:otr:mM}function oXe(e,t){let r=[...e],n=r.length,o=e.map((a,i)=>zW(a)(a,t[i]));return a=>{for(let i=0;i<n;i++)r[i]=o[i](a);return r}}function otr(e,t){let r={...e,...t},n={};for(let o in r)e[o]!==void 0&&t[o]!==void 0&&(n[o]=zW(e[o])(e[o],t[o]));return o=>{for(let a in n)r[a]=n[a](o);return r}}function atr(e,t){let r=[],n={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){let a=t.types[o],i=e.indexes[a][n[a]],s=e.values[i]??0;r[o]=s,n[a]++}return r}var itr=(e,t)=>{let r=$c.createTransformer(t),n=J0(e),o=J0(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?UW.has(e)&&!o.values.length||UW.has(t)&&!n.values.length?nXe(e,t):dh(oXe(atr(n,o),o.values),r):(Zy(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),mM(e,t))};function HW(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?En(e,t,r):zW(e)(e,t)}var aXe=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>dn.update(t,r),stop:()=>Hc(t),now:()=>Xi.isProcessing?Xi.timestamp:Yi.now()}};var jW=(e,t,r=10)=>{let n="",o=Math.max(Math.round(t/r),2);for(let a=0;a<o;a++)n+=Math.round(e(a/(o-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function hM(e){let t=0,r=50,n=e.next(t);for(;!n.done&&t<2e4;)t+=r,n=e.next(t);return t>=2e4?1/0:t}function eF(e,t=100,r){let n=r({...e,keyframes:[0,t]}),o=Math.min(hM(n),2e4);return{type:"keyframes",ease:a=>n.next(o*a).value/t,duration:lc(o)}}var str=5;function $W(e,t,r){let n=Math.max(t-str,0);return V_(r-e(n),t-n)}var Ya={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var vce=.001;function iXe({duration:e=Ya.duration,bounce:t=Ya.bounce,velocity:r=Ya.velocity,mass:n=Ya.mass}){let o,a;Zy(e<=us(Ya.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=El(Ya.minDamping,Ya.maxDamping,i),e=El(Ya.minDuration,Ya.maxDuration,lc(e)),i<1?(o=c=>{let u=c*i,d=u*e,f=u-r,p=qW(c,i),m=Math.exp(-d);return vce-f/p*m},a=c=>{let d=c*i*e,f=d*r+r,p=Math.pow(i,2)*Math.pow(c,2)*e,m=Math.exp(-d),h=qW(Math.pow(c,2),i);return(-o(c)+vce>0?-1:1)*((f-p)*m)/h}):(o=c=>{let u=Math.exp(-c*e),d=(c-r)*e+1;return-vce+u*d},a=c=>{let u=Math.exp(-c*e),d=(r-c)*(e*e);return u*d});let s=5/e,l=ctr(o,a,s);if(e=us(e),isNaN(l))return{stiffness:Ya.stiffness,damping:Ya.damping,duration:e};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:i*2*Math.sqrt(n*c),duration:e}}}var ltr=12;function ctr(e,t,r){let n=r;for(let o=1;o<ltr;o++)n=n-e(n)/t(n);return n}function qW(e,t){return e*Math.sqrt(1-t*t)}var utr=["duration","bounce"],dtr=["stiffness","damping","mass"];function sXe(e,t){return t.some(r=>e[r]!==void 0)}function ftr(e){let t={velocity:Ya.velocity,stiffness:Ya.stiffness,damping:Ya.damping,mass:Ya.mass,isResolvedFromDuration:!1,...e};if(!sXe(e,dtr)&&sXe(e,utr))if(e.visualDuration){let r=e.visualDuration,n=2*Math.PI/(r*1.2),o=n*n,a=2*El(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Ya.mass,stiffness:o,damping:a}}else{let r=iXe(e);t={...t,...r,mass:Ya.mass},t.isResolvedFromDuration=!0}return t}function tx(e=Ya.visualDuration,t=Ya.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:n,restDelta:o}=r,a=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=ftr({...r,velocity:-lc(r.velocity||0)}),m=f||0,h=c/(2*Math.sqrt(l*u)),g=i-a,v=lc(Math.sqrt(l/u)),y=Math.abs(g)<5;n||(n=y?Ya.restSpeed.granular:Ya.restSpeed.default),o||(o=y?Ya.restDelta.granular:Ya.restDelta.default);let x;if(h<1){let b=qW(v,h);x=C=>{let S=Math.exp(-h*v*C);return i-S*((m+h*v*g)/b*Math.sin(b*C)+g*Math.cos(b*C))}}else if(h===1)x=b=>i-Math.exp(-v*b)*(g+(m+v*g)*b);else{let b=v*Math.sqrt(h*h-1);x=C=>{let S=Math.exp(-h*v*C),I=Math.min(b*C,300);return i-S*((m+h*v*g)*Math.sinh(I)+b*g*Math.cosh(I))/b}}let w={calculatedDuration:p&&d||null,next:b=>{let C=x(b);if(p)s.done=b>=d;else{let S=b===0?m:0;h<1&&(S=b===0?us(m):$W(x,b,C));let I=Math.abs(S)<=n,N=Math.abs(i-C)<=o;s.done=I&&N}return s.value=s.done?i:C,s},toString:()=>{let b=Math.min(hM(w),2e4),C=jW(S=>w.next(b*S).value,b,30);return b+"ms "+C},toTransition:()=>{}};return w}tx.applyToOptions=e=>{let t=eF(e,100,tx);return e.ease=t.ease,e.duration=us(t.duration),e.type="keyframes",e};function tF({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=I=>s!==void 0&&I<s||l!==void 0&&I>l,m=I=>s===void 0?l:l===void 0||Math.abs(s-I)<Math.abs(l-I)?s:l,h=r*t,g=d+h,v=i===void 0?g:i(g);v!==g&&(h=v-d);let y=I=>-h*Math.exp(-I/n),x=I=>v+y(I),w=I=>{let N=y(I),M=x(I);f.done=Math.abs(N)<=c,f.value=f.done?v:M},b,C,S=I=>{p(f.value)&&(b=I,C=tx({keyframes:[f.value,m(f.value)],velocity:$W(x,I,f.value),damping:o,stiffness:a,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:I=>{let N=!1;return!C&&b===void 0&&(N=!0,w(I),S(I)),b!==void 0&&I>=b?C.next(I-b):(!N&&w(I),f)}}}function ptr(e,t,r){let n=[],o=r||zc.mix||HW,a=e.length-1;for(let i=0;i<a;i++){let s=o(e[i],e[i+1]);if(t){let l=Array.isArray(t)?t[i]||Li:t;s=dh(l,s)}n.push(s)}return n}function WW(e,t,{clamp:r=!0,ease:n,mixer:o}={}){let a=e.length;if(sc(a===t.length,"Both input and output ranges must be the same length","range-length"),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=ptr(t,n,o),l=s.length,c=u=>{if(i&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);let f=Zp(e[d],e[d+1],u);return s[d](f)};return r?u=>c(El(e[0],e[a-1],u)):c}function rF(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let o=Zp(0,t,n);e.push(En(r,1,o))}}function nF(e){let t=[0];return rF(t,e.length-1),t}function lXe(e,t){return e.map(r=>r*t)}function mtr(e,t){return e.map(()=>t||q_).splice(0,e.length-1)}function b1({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let o=W_(n)?n.map(OW):OW(n),a={done:!1,value:t[0]},i=lXe(r&&r.length===t.length?r:nF(t),e),s=WW(i,t,{ease:Array.isArray(o)?o:mtr(t,o)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}var htr=e=>e!==null;function gM(e,{repeat:t,repeatType:r="loop"},n,o=1){let a=e.filter(htr),s=o<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!s||n===void 0?a[s]:n}var gtr={decay:tF,inertia:tF,tween:b1,keyframes:b1,spring:tx};function GW(e){typeof e.type=="string"&&(e.type=gtr[e.type])}var ew=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}};var vtr=e=>e/100,rx=class extends ew{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:r}=this.options;r&&r.updatedAt!==Yi.now()&&this.tick(Yi.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},fh.mainThread++,this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;GW(t);let{type:r=b1,repeat:n=0,repeatDelay:o=0,repeatType:a,velocity:i=0}=t,{keyframes:s}=t,l=r||b1;l!==b1&&typeof s[0]!="number"&&(this.mixKeyframes=dh(vtr,HW(s[0],s[1])),s=[0,100]);let c=l({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-i})),c.calculatedDuration===null&&(c.calculatedDuration=hM(c));let{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(n+1)-o,this.generator=c}updateTime(t){let r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){let{generator:n,totalDuration:o,mixKeyframes:a,mirroredGenerator:i,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:p,type:m,onUpdate:h,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let x=this.currentTime,w=n;if(d){let I=Math.min(this.currentTime,o)/s,N=Math.floor(I),M=I%1;!M&&I>=1&&(M=1),M===1&&N--,N=Math.min(N,d+1),!!(N%2)&&(f==="reverse"?(M=1-M,p&&(M-=p/s)):f==="mirror"&&(w=i)),x=El(0,1,M)*s}let b=y?{done:!1,value:u[0]}:w.next(x);a&&(b.value=a(b.value));let{done:C}=b;!y&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);let S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return S&&m!==tF&&(b.value=gM(u,this.options,g,this.speed)),h&&h(b.value),S&&this.finish(),b}then(t,r){return this.finished.then(t,r)}get duration(){return lc(this.calculatedDuration)}get time(){return lc(this.currentTime)}set time(t){t=us(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Yi.now());let r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=lc(this.currentTime))}play(){if(this.isStopped)return;let{driver:t=aXe,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();let n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Yi.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,fh.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}};function cXe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var w1=e=>e*180/Math.PI,yce=e=>{let t=w1(Math.atan2(e[1],e[0]));return xce(t)},ytr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yce,rotateZ:yce,skewX:e=>w1(Math.atan(e[1])),skewY:e=>w1(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},xce=e=>(e=e%360,e<0&&(e+=360),e),uXe=yce,dXe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fXe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),xtr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:dXe,scaleY:fXe,scale:e=>(dXe(e)+fXe(e))/2,rotateX:e=>xce(w1(Math.atan2(e[6],e[5]))),rotateY:e=>xce(w1(Math.atan2(-e[2],e[0]))),rotateZ:uXe,rotate:uXe,skewX:e=>w1(Math.atan(e[4])),skewY:e=>w1(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function oF(e){return e.includes("scale")?1:0}function aF(e,t){if(!e||e==="none")return oF(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),n,o;if(r)n=xtr,o=r;else{let s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ytr,o=s}if(!o)return oF(t);let a=n[t],i=o[1].split(",").map(btr);return typeof a=="function"?a(i):i[a]}var bce=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return aF(r,t)};function btr(e){return parseFloat(e.trim())}var mh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Df=(()=>new Set(mh))();var wce=e=>e===tv||e===mr,wtr=new Set(["x","y","z"]),Ctr=mh.filter(e=>!wtr.has(e));function pXe(e){let t=[];return Ctr.forEach(r=>{let n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}var tw={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>aF(t,"x"),y:(e,{transform:t})=>aF(t,"y")};tw.translateX=tw.x;tw.translateY=tw.y;var C1=new Set,Cce=!1,Sce=!1,Pce=!1;function mXe(){if(Sce){let e=Array.from(C1).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{let o=pXe(n);o.length&&(r.set(n,o),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();let o=r.get(n);o&&o.forEach(([a,i])=>{n.getValue(a)?.set(i)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Sce=!1,Cce=!1,C1.forEach(e=>e.complete(Pce)),C1.clear()}function hXe(){C1.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Sce=!0)})}function Ice(){Pce=!0,hXe(),mXe(),Pce=!1}var nx=class{constructor(t,r,n,o,a,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=o,this.element=a,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(C1.add(this),Cce||(Cce=!0,dn.read(hXe),dn.resolveKeyframes(mXe))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:n,motionValue:o}=this;if(t[0]===null){let a=o?.get(),i=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){let s=n.readValue(r,i);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=i),o&&a===void 0&&o.set(t[0])}cXe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),C1.delete(this)}cancel(){this.state==="scheduled"&&(C1.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var gXe=e=>e.startsWith("--");function vXe(e,t,r){gXe(t)?e.style.setProperty(t,r):e.style[t]=r}var yXe=v1(()=>window.ScrollTimeline!==void 0);var xXe={};function bXe(e,t){let r=v1(e);return()=>xXe[t]??r()}var KW=bXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var S1=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;var kce={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:S1([0,.65,.55,1]),circOut:S1([.55,0,1,.45]),backIn:S1([.31,.01,.66,-.59]),backOut:S1([.33,1.53,.69,.99])};function Rce(e,t){if(e)return typeof e=="function"?KW()?jW(e,t):"ease-out":K_(e)?S1(e):Array.isArray(e)?e.map(r=>Rce(r,t)||kce.easeOut):kce[e]}function wXe(e,t,r,{delay:n=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeOut",times:l}={},c=void 0){let u={[t]:r};l&&(u.offset=l);let d=Rce(s,o);Array.isArray(d)&&(u.easing=d),Nd.value&&fh.waapi++;let f={delay:n,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:i==="reverse"?"alternate":"normal"};c&&(f.pseudoElement=c);let p=e.animate(u,f);return Nd.value&&p.finished.finally(()=>{fh.waapi--}),p}function P1(e){return typeof e=="function"&&"applyToOptions"in e}function CXe({type:e,...t}){return P1(e)&&KW()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}var XW=class extends ew{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;let{element:r,name:n,keyframes:o,pseudoElement:a,allowFlatten:i=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=i,this.options=t,sc(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let c=CXe(t);this.animation=wXe(r,n,o,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){let u=gM(o,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(u):vXe(r,n,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let t=this.animation.effect?.getComputedTiming?.().duration||0;return lc(Number(t))}get time(){return lc(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=us(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&yXe()?(this.animation.timeline=t,Li):r(this)}};var SXe={anticipate:z_,backInOut:U_,circInOut:$_};function Str(e){return e in SXe}function PXe(e){typeof e.ease=="string"&&Str(e.ease)&&(e.ease=SXe[e.ease])}var IXe=10,YW=class extends XW{constructor(t){PXe(t),GW(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:r,onUpdate:n,onComplete:o,element:a,...i}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let s=new rx({...i,autoplay:!1}),l=us(this.finishedTime??this.time);r.setWithVelocity(s.sample(l-IXe).value,s.sample(l).value,IXe),s.stop()}};var Nce=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&($c.test(e)||e==="0")&&!e.startsWith("url("));function Ptr(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function kXe(e,t,r,n){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let a=e[e.length-1],i=Nce(o,t),s=Nce(a,t);return Zy(i===s,`You are trying to animate ${t} from "${o}" to "${a}". "${i?a:o}" is not an animatable value.`,"value-not-animatable"),!i||!s?!1:Ptr(e)||(r==="spring"||P1(r))&&n}function vM(e){e.duration=0,e.type}var Itr=new Set(["opacity","clipPath","filter","transform"]),ktr=v1(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function RXe(e){let{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:a,type:i}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:c}=t.owner.getProps();return ktr()&&r&&Itr.has(r)&&(r!=="transform"||!c)&&!l&&!n&&o!=="mirror"&&a!==0&&i!=="inertia"}var Rtr=40,iF=class extends ew{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:i="loop",keyframes:s,name:l,motionValue:c,element:u,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Yi.now();let f={autoplay:t,delay:r,type:n,repeat:o,repeatDelay:a,repeatType:i,name:l,motionValue:c,element:u,...d},p=u?.KeyframeResolver||nx;this.keyframeResolver=new p(s,(m,h,g)=>this.onKeyframesResolved(m,h,f,!g),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,r,n,o){this.keyframeResolver=void 0;let{name:a,type:i,velocity:s,delay:l,isHandoff:c,onUpdate:u}=n;this.resolvedAt=Yi.now(),kXe(t,a,i,s)||((zc.instantAnimations||!l)&&u?.(gM(t,n,r)),t[0]=t[t.length-1],vM(n),n.repeat=0);let f={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Rtr?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},p=!c&&RXe(f)?new YW({...f,element:f.motionValue.owner.current}):new rx(f);p.finished.then(()=>this.notifyFinished()).catch(Li),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ice()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};var QW=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,r){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=r}attachTimeline(t){let r=this.animations.map(n=>n.attachTimeline(t));return()=>{r.forEach((n,o)=>{n&&n(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let r=0;r<this.animations.length;r++)t=Math.max(t,this.animations[r].duration);return t}runAll(t){this.animations.forEach(r=>r[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var sF=class extends QW{then(t,r){return this.finished.finally(t).then(()=>{})}};var Ntr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Mtr(e){let t=Ntr.exec(e);if(!t)return[,];let[,r,n,o]=t;return[`--${r??n}`,o]}var Ttr=4;function Mce(e,t,r=1){sc(r<=Ttr,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,o]=Mtr(e);if(!n)return;let a=window.getComputedStyle(t).getPropertyValue(n);if(a){let i=a.trim();return __(i)?parseFloat(i):i}return x1(o)?Mce(o,t,r+1):o}function I1(e,t){return e?.[t]??e?.default??e}var lF=new Set(["width","height","top","left","right","bottom",...mh]);var NXe={test:e=>e==="auto",parse:e=>e};var ZW=e=>t=>t.test(e);var Tce=[tv,mr,jc,ph,fce,dce,NXe],Ace=e=>Tce.find(ZW(e));function MXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||B_(e):!0}var Atr=new Set(["brightness","contrast","saturate","opacity"]);function Ltr(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(fM)||[];if(!n)return e;let o=r.replace(n,""),a=Atr.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}var Etr=/\b([a-z-]*)\(.*?\)/gu,cF={...$c,getAnimatableNone:e=>{let t=e.match(Etr);return t?t.map(Ltr).join(" "):e}};var Lce={...tv,transform:Math.round};var TXe={rotate:ph,rotateX:ph,rotateY:ph,rotateZ:ph,scale:Q_,scaleX:Q_,scaleY:Q_,scaleZ:Q_,skew:ph,skewX:ph,skewY:ph,distance:mr,translateX:mr,translateY:mr,translateZ:mr,x:mr,y:mr,z:mr,perspective:mr,transformPerspective:mr,opacity:ex,originX:VW,originY:VW,originZ:mr};var k1={borderWidth:mr,borderTopWidth:mr,borderRightWidth:mr,borderBottomWidth:mr,borderLeftWidth:mr,borderRadius:mr,radius:mr,borderTopLeftRadius:mr,borderTopRightRadius:mr,borderBottomRightRadius:mr,borderBottomLeftRadius:mr,width:mr,maxWidth:mr,height:mr,maxHeight:mr,top:mr,right:mr,bottom:mr,left:mr,padding:mr,paddingTop:mr,paddingRight:mr,paddingBottom:mr,paddingLeft:mr,margin:mr,marginTop:mr,marginRight:mr,marginBottom:mr,marginLeft:mr,backgroundPositionX:mr,backgroundPositionY:mr,...TXe,zIndex:Lce,fillOpacity:ex,strokeOpacity:ex,numOctaves:Lce};var AXe={...k1,color:fi,backgroundColor:fi,outlineColor:fi,fill:fi,stroke:fi,borderColor:fi,borderTopColor:fi,borderRightColor:fi,borderBottomColor:fi,borderLeftColor:fi,filter:cF,WebkitFilter:cF},uF=e=>AXe[e];function dF(e,t){let r=uF(e);return r!==cF&&(r=$c),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var Dtr=new Set(["auto","none","0"]);function LXe(e,t,r){let n=0,o;for(;n<e.length&&!o;){let a=e[n];typeof a=="string"&&!Dtr.has(a)&&J0(a).values.length&&(o=e[n]),n++}if(o&&r)for(let a of t)e[a]=dF(r,o)}var fF=class extends nx{constructor(t,r,n,o,a){super(t,r,n,o,a,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),x1(c))){let u=Mce(c,r.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!lF.has(n)||t.length!==2)return;let[o,a]=t,i=Ace(o),s=Ace(a);if(i!==s)if(wce(i)&&wce(s))for(let l=0;l<t.length;l++){let c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else tw[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,n=[];for(let o=0;o<t.length;o++)(t[o]===null||MXe(t[o]))&&n.push(o);n.length&&LXe(t,n,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tw[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let o=r[r.length-1];o!==void 0&&t.getValue(n,o).jump(o,!1)}measureEndState(){let{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;let o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);let a=n.length-1,i=n[a];n[a]=tw[r](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}};function pF(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;t&&(n=t.current);let o=r?.[e]??n.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}var mF=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function hF(e){return F_(e)&&"offsetHeight"in e}var EXe=30,Otr=e=>!isNaN(parseFloat(e)),R1={current:void 0},JW=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{let o=Yi.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Yi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Otr(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Jy);let n=this.events[t].add(r);return t==="change"?()=>{n(),dn.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return R1.current&&R1.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=Yi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>EXe)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,EXe);return V_(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Md(e,t){return new JW(e,t)}var{schedule:N1,cancel:_tr}=_W(queueMicrotask,!1);var Jp={x:!1,y:!1};function eG(){return Jp.x||Jp.y}function Ece(e){return e==="x"||e==="y"?Jp[e]?null:(Jp[e]=!0,()=>{Jp[e]=!1}):Jp.x||Jp.y?null:(Jp.x=Jp.y=!0,()=>{Jp.x=Jp.y=!1})}function tG(e,t){let r=pF(e),n=new AbortController,o={passive:!0,...t,signal:n.signal};return[r,o,()=>n.abort()]}function DXe(e){return!(e.pointerType==="touch"||eG())}function Dce(e,t,r={}){let[n,o,a]=tG(e,r),i=s=>{if(!DXe(s))return;let{target:l}=s,c=t(l,s);if(typeof c!="function"||!l)return;let u=d=>{DXe(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return n.forEach(s=>{s.addEventListener("pointerenter",i,o)}),a}var Oce=(e,t)=>t?e===t?!0:Oce(e,t.parentElement):!1;var M1=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var Ftr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function OXe(e){return Ftr.has(e.tagName)||e.tabIndex!==-1}var yM=new WeakSet;function _Xe(e){return t=>{t.key==="Enter"&&e(t)}}function _ce(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var FXe=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=_Xe(()=>{if(yM.has(r))return;_ce(r,"down");let o=_Xe(()=>{_ce(r,"up")}),a=()=>_ce(r,"cancel");r.addEventListener("keyup",o,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function BXe(e){return M1(e)&&!eG()}function Fce(e,t,r={}){let[n,o,a]=tG(e,r),i=s=>{let l=s.currentTarget;if(!BXe(s))return;yM.add(l);let c=t(l,s),u=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),yM.has(l)&&yM.delete(l),BXe(p)&&typeof c=="function"&&c(p,{success:m})},d=p=>{u(p,l===window||l===document||r.useGlobalTarget||Oce(l,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return n.forEach(s=>{(r.useGlobalTarget?window:s).addEventListener("pointerdown",i,o),hF(s)&&(s.addEventListener("focus",c=>FXe(c,o)),!OXe(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function T1(e){return F_(e)&&"ownerSVGElement"in e}function gF(e){return T1(e)&&e.tagName==="svg"}function Bce(...e){let t=!Array.isArray(e[0]),r=t?0:-1,n=e[0+r],o=e[1+r],a=e[2+r],i=e[3+r],s=WW(o,a,i);return t?s(n):s}var Io=e=>!!(e&&e.getVelocity);var Btr=[...Tce,fi,$c],Vce=e=>Btr.find(ZW(e));var rG=D(lt(),1),ox=D(lt(),1);var VXe=D(lt(),1),rw=(0,VXe.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Uce=class extends rG.Component{getSnapshotBeforeUpdate(t){let r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){let n=r.offsetParent,o=hF(n)&&n.offsetWidth||0,a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft,a.right=o-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}};function zXe({children:e,isPresent:t,anchorX:r,root:n}){let o=(0,ox.useId)(),a=(0,ox.useRef)(null),i=(0,ox.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=(0,ox.useContext)(rw);return(0,ox.useInsertionEffect)(()=>{let{width:l,height:c,top:u,left:d,right:f}=i.current;if(t||!a.current||!l||!c)return;let p=r==="left"?`left: ${d}`:`right: ${f}`;a.current.dataset.motionPopId=o;let m=document.createElement("style");s&&(m.nonce=s);let h=n??document.head;return h.appendChild(m),m.sheet&&m.sheet.insertRule(`
|
|
408
408
|
[data-motion-pop-id="${o}"] {
|
|
409
409
|
position: absolute !important;
|
|
410
410
|
width: ${l}px !important;
|