better-cmdk 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,47 +22,31 @@ npm install react react-dom tailwindcss
22
22
 
23
23
  ## Setup
24
24
 
25
- ### 1. Configure Tailwind to scan the package
25
+ ### 1. Import the package styles
26
26
 
27
- Add the package to your Tailwind CSS sources in your main CSS file:
27
+ Import the precompiled stylesheet in your main CSS file:
28
28
 
29
29
  ```css
30
30
  @import "tailwindcss";
31
- @source "node_modules/better-cmdk";
31
+ @import "better-cmdk";
32
32
  ```
33
33
 
34
- ### 2. Add CSS variables
34
+ ### 2. Optional: override better-cmdk tokens
35
35
 
36
- Add the required CSS variables to your global styles:
36
+ Styles are isolated under `.bcmdk-root`. Override only the command menu tokens:
37
37
 
38
38
  ```css
39
- :root {
40
- --radius: 0.625rem;
41
- --background: oklch(1 0 0);
42
- --foreground: oklch(0.145 0 0);
43
- --popover: oklch(1 0 0);
44
- --popover-foreground: oklch(0.145 0 0);
45
- --primary: oklch(0.205 0 0);
46
- --primary-foreground: oklch(0.985 0 0);
47
- --muted: oklch(0.97 0 0);
48
- --muted-foreground: oklch(0.556 0 0);
49
- --border: oklch(0.922 0 0);
50
- --input: oklch(0.922 0 0);
51
- --ring: oklch(0.708 0 0);
52
- }
53
-
54
- @theme inline {
55
- --color-background: var(--background);
56
- --color-foreground: var(--foreground);
57
- --color-popover: var(--popover);
58
- --color-popover-foreground: var(--popover-foreground);
59
- --color-primary: var(--primary);
60
- --color-primary-foreground: var(--primary-foreground);
61
- --color-muted: var(--muted);
62
- --color-muted-foreground: var(--muted-foreground);
63
- --color-border: var(--border);
64
- --color-input: var(--input);
65
- --color-ring: var(--ring);
39
+ .bcmdk-root {
40
+ --bcmdk-radius: 0.625rem;
41
+ --bcmdk-background: 1 0 0;
42
+ --bcmdk-foreground: 0.145 0 0;
43
+ --bcmdk-primary: 0.205 0 0;
44
+ --bcmdk-primary-foreground: 0.985 0 0;
45
+ --bcmdk-muted: 0.97 0 0;
46
+ --bcmdk-muted-foreground: 0.556 0 0;
47
+ --bcmdk-border: 0.922 0 0;
48
+ --bcmdk-input: 0.922 0 0;
49
+ --bcmdk-ring: 0.708 0 0;
66
50
  }
67
51
  ```
68
52
 
@@ -307,9 +291,9 @@ Children can also be a function to access internal state:
307
291
 
308
292
  ## Styling
309
293
 
310
- The component uses Tailwind CSS with the shadcn/ui design tokens. Customize by:
294
+ better-cmdk ships namespaced styles under `.bcmdk-root` to avoid app-wide collisions. Customize by:
311
295
 
312
- 1. Overriding CSS variables
296
+ 1. Overriding `--bcmdk-*` variables on `.bcmdk-root`
313
297
  2. Passing `className` props to components
314
298
  3. Using the `cn()` utility for conditional classes
315
299
 
package/dist/index.d.ts CHANGED
@@ -266,6 +266,7 @@ declare function DialogClose({
266
266
  }: React$2.ComponentProps<typeof Dialog$1.Close>): react_jsx_runtime0.JSX.Element;
267
267
  declare function DialogOverlay({
268
268
  className,
269
+ style,
269
270
  ...props
270
271
  }: React$2.ComponentProps<typeof Dialog$1.Overlay>): react_jsx_runtime0.JSX.Element;
271
272
  declare function DialogContent({
@@ -319,8 +320,12 @@ declare function CommandSeparator({
319
320
  declare function CommandItem({
320
321
  className,
321
322
  style,
323
+ onSelect,
324
+ closeOnSelect,
322
325
  ...props
323
- }: React$2.ComponentProps<typeof pkg.Item>): react_jsx_runtime0.JSX.Element;
326
+ }: React$2.ComponentProps<typeof pkg.Item> & {
327
+ closeOnSelect?: boolean;
328
+ }): react_jsx_runtime0.JSX.Element;
324
329
  declare function CommandShortcut({
325
330
  className,
326
331
  children,
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{cn as e}from"./lib/utils.js";import{JSONUIProvider as t,Renderer as n,flatToTree as r}from"@json-render/react";import*as i from"react";import{createContext as a,memo as o,useCallback as s,useContext as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{z as p}from"zod";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{Streamdown as _}from"streamdown";import{ArrowUpIcon as v,ChevronDownIcon as y,KeyboardIcon as b,LoaderIcon as x,MessageCircleIcon as S,SearchIcon as C,XIcon as w}from"lucide-react";import*as T from"@radix-ui/react-collapsible";import{cva as E}from"class-variance-authority";import{Dialog as D,Slot as O}from"radix-ui";import*as k from"@radix-ui/react-dialog";import{Primitive as A}from"@radix-ui/react-primitive";import{useId as j}from"@radix-ui/react-id";import{composeRefs as M}from"@radix-ui/react-compose-refs";import{motion as N}from"motion/react";import{useChat as ee}from"@ai-sdk/react";import{DefaultChatTransport as P}from"ai";import{BrowserClient as F,Scope as I,dedupeIntegration as L,defaultStackParser as R,linkedErrorsIntegration as te,makeFetchTransport as ne}from"@sentry/browser";const re=a(null);function ie(){let e=c(re);if(!e)throw Error(`Confirmation components must be used within Confirmation`);return e}function ae({approval:t,state:n,style:r,...i}){return!t||n===`input-streaming`||n===`input-available`?null:h(re.Provider,{value:{approval:t,state:n},children:h(`div`,{"data-slot":`confirmation`,"data-state":n,"data-approved":t?.approved,role:`alertdialog`,"aria-labelledby":`confirmation-title`,style:{borderRadius:`var(--cmdk-radius, 0.5rem)`,...r},className:e(`flex flex-col gap-2 border p-4`,`data-[state=approval-requested]:border-amber-500/50 data-[state=approval-requested]:bg-amber-50/50 dark:data-[state=approval-requested]:bg-amber-950/20`,`data-[approved=true]:border-green-500/50 data-[approved=true]:bg-green-50/50 dark:data-[approved=true]:bg-green-950/20`,`data-[approved=false]:border-red-500/50 data-[approved=false]:bg-red-50/50 dark:data-[approved=false]:bg-red-950/20`),...i})})}function oe(e){return h(`p`,{id:`confirmation-title`,"data-slot":`confirmation-title`,className:`text-sm font-medium`,...e})}function se({children:e}){let{state:t}=ie();return t===`approval-requested`?h(`div`,{"data-slot":`confirmation-request`,children:e}):null}function ce({children:e}){let{approval:t,state:n}=ie();return!t?.approved||n!==`approval-responded`&&n!==`output-denied`&&n!==`output-available`?null:h(`div`,{"data-slot":`confirmation-accepted`,children:e})}function le({children:e}){let{approval:t,state:n}=ie();return t?.approved!==!1||n!==`approval-responded`&&n!==`output-denied`&&n!==`output-available`?null:h(`div`,{"data-slot":`confirmation-rejected`,children:e})}function ue(e){let{state:t}=ie();return t===`approval-requested`?h(`div`,{"data-slot":`confirmation-actions`,className:`flex items-center justify-end gap-2 self-end`,...e}):null}function de({variant:t=`default`,style:n,...r}){return h(`button`,{"data-slot":`confirmation-action`,"data-variant":t,type:`button`,className:e(`inline-flex h-8 items-center justify-center gap-2 whitespace-nowrap px-3 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`,t===`default`&&`bg-primary text-primary-foreground shadow hover:bg-primary/90`,t===`outline`&&`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,t===`destructive`&&`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`),style:{borderRadius:`var(--cmdk-radius, 0.375rem)`,...n},...r})}function z(e){e.stopPropagation()}function fe({element:t,children:n,onAction:r}){let{id:i=`form`,title:a,submitLabel:o=`Submit`}=t.props??{},s=e=>{e.preventDefault();let t=new FormData(e.currentTarget),n={};t.forEach((e,t)=>{typeof e==`string`&&(n[t]=e)}),r?.({name:`submit`,params:{formId:i,data:n}})};return g(`div`,{"data-slot":`form-card`,className:e(`w-full rounded-lg border bg-card text-card-foreground shadow-sm`),children:[a&&h(`div`,{className:`flex flex-col space-y-1.5 p-4 pb-3`,children:h(`h3`,{className:`text-base font-semibold leading-none tracking-tight`,children:a})}),h(`div`,{className:e(`p-4`,a?``:`pt-4`),children:g(`form`,{onSubmit:s,className:`space-y-4`,children:[n,g(`div`,{className:`flex justify-end gap-2 pt-2`,children:[h(`button`,{type:`button`,className:e(`inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors`,`hover:bg-accent hover:text-accent-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`),onClick:()=>r?.({name:`cancel`,params:{formId:i}}),children:`Cancel`}),h(`button`,{type:`submit`,className:e(`inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors`,`hover:bg-primary/90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`),children:o})]})]})})]})}function pe({element:t}){let{name:n=`field`,label:r=`Field`,placeholder:i,required:a,defaultValue:o}=t.props??{};return g(`div`,{className:`space-y-1.5`,children:[g(`label`,{htmlFor:n,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[r,a&&h(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),h(`input`,{id:n,name:n,type:`text`,placeholder:i,required:a,defaultValue:o,autoComplete:`off`,onKeyDown:z,onKeyUp:z,className:e(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}function me({element:t}){let{name:n=`field`,label:r=`Field`,placeholder:i,required:a,defaultValue:o,rows:s=3}=t.props??{};return g(`div`,{className:`space-y-1.5`,children:[g(`label`,{htmlFor:n,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[r,a&&h(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),h(`textarea`,{id:n,name:n,placeholder:i,required:a,defaultValue:o,rows:s,onKeyDown:z,onKeyUp:z,className:e(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}function he({element:t}){let{name:n=`date`,label:r=`Date`,required:i,defaultValue:a,min:o,max:s}=t.props??{};return g(`div`,{className:`space-y-1.5`,children:[g(`label`,{htmlFor:n,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[r,i&&h(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),h(`input`,{type:`date`,id:n,name:n,required:i,defaultValue:a,min:o,max:s,onKeyDown:z,onKeyUp:z,className:e(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}const ge={Form:fe,TextField:pe,TextArea:me,DateField:he},_e=p.object({formId:p.string(),data:p.record(p.string(),p.string())}),ve=p.object({formId:p.string()});function ye({ui:e,context:r,onSubmit:i,onCancel:a,registry:o=ge}){let c=s(e=>{let t=_e.safeParse(e);t.success?i(t.data.formId,t.data.data):console.warn(`Form submit: Invalid params`,t.error.flatten())},[i]),l=s(e=>{let t=ve.safeParse(e);t.success?a?.(t.data.formId):console.warn(`Form cancel: Invalid params`,t.error.flatten())},[a]);return h(t,{registry:o,initialData:r,actionHandlers:u(()=>({submit:c,cancel:l}),[c,l]),children:h(n,{tree:e,registry:o})})}function be({from:t,...n}){return h(`div`,{"data-slot":`message`,"data-from":t,className:e(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`),...n})}function xe({children:t,style:n,...r}){return h(`div`,{"data-slot":`message-content`,className:e(`flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-foreground`),style:{borderRadius:`var(--cmdk-radius, 0.5rem)`,...n},...r,children:t})}const Se=o(function(e){return h(_,{"data-slot":`message-response`,className:`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,...e})},(e,t)=>e.children===t.children);function Ce({...e}){return h(T.Root,{"data-slot":`collapsible`,...e})}function we({...e}){return h(T.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...e})}function Te({...e}){return h(T.CollapsibleContent,{"data-slot":`collapsible-content`,...e})}function Ee({children:e,...t}){return h(`div`,{"data-slot":`task-item-file`,className:`inline-flex items-center gap-1 rounded-md border bg-secondary px-1.5 py-0.5 text-xs text-foreground`,...t,children:e})}function De({children:e,...t}){return h(`div`,{"data-slot":`task-item`,className:`text-sm text-muted-foreground`,...t,children:e})}function Oe({defaultOpen:e=!0,...t}){return h(Ce,{"data-slot":`task`,defaultOpen:e,...t})}function ke({children:e,title:t,icon:n,...r}){return h(we,{asChild:!0,className:`group`,...r,children:e??g(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[n??h(C,{className:`size-4`}),h(`p`,{className:`text-sm`,children:t}),h(y,{className:`size-4 transition-transform group-data-[state=open]:rotate-180`})]})})}function Ae({children:t,...n}){return h(Te,{"data-slot":`task-content`,className:e(`text-popover-foreground outline-none`,`data-[state=closed]:animate-out data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2`),...n,children:h(`div`,{className:`mt-4 space-y-2 border-l-2 border-muted pl-4`,children:t})})}const je=p.object({name:p.string(),options:p.record(p.string(),p.unknown()).optional()}),Me=p.object({actions:p.array(je).optional()}),Ne=p.object({id:p.string(),approved:p.boolean().optional()}),Pe=p.object({type:p.string(),props:p.record(p.string(),p.unknown()).default({}),children:p.array(p.string()).optional(),parentKey:p.string().nullable().optional()}),Fe=p.object({ui:p.object({elements:p.record(p.string(),Pe)}),context:p.record(p.string(),p.unknown()).optional()});function Ie(e){return e.name}function Le({messages:e,sendMessage:t,addToolApprovalResponse:n,getActionDescription:r=Ie}){let i=e.filter(e=>e.role===`user`||e.role===`assistant`);return h(m,{children:i.map((e,a)=>{let o=a===i.length-1;return h(be,{from:e.role,children:h(xe,{children:e.parts.map((i,a)=>h(Re,{part:i,messageId:e.id,partIndex:a,isLastMessage:o,sendMessage:t,addToolApprovalResponse:n,getActionDescription:r},`${e.id}-${a}`))})},e.id)})})}function Re({part:e,messageId:t,partIndex:n,isLastMessage:r,sendMessage:i,addToolApprovalResponse:a,getActionDescription:o}){if(e.type===`text`)return h(Se,{children:e.text});if(e.type===`tool-performActions`){let r=`input`in e?e.input:void 0,i=Me.safeParse(r),s=i.success?i.data.actions??[]:[];if(s.length===0)return null;let c=s.length,l=`state`in e?e.state:void 0,u=`approval`in e?e.approval:void 0,d=Ne.safeParse(u),f=d.success?d.data:void 0;return f&&l?g(ae,{state:l,approval:f,children:[h(oe,{children:c===1?`Confirm action`:`Confirm ${c} actions`}),h(se,{children:h(`ul`,{className:`list-disc list-inside text-sm text-muted-foreground mt-2`,children:s.map((e,r)=>h(`li`,{children:o(e)},`${t}-${n}-${r}`))})}),h(ce,{children:h(`span`,{className:`text-sm text-muted-foreground`,children:c===1?`Action approved`:`${c} actions approved`})}),h(le,{children:h(`span`,{className:`text-sm text-muted-foreground`,children:c===1?`Action cancelled`:`${c} actions cancelled`})}),g(ue,{children:[h(de,{variant:`outline`,onClick:()=>a({id:f.id,approved:!1}),children:`Deny`}),h(de,{onClick:()=>a({id:f.id,approved:!0}),children:`Approve`})]})]}):g(Oe,{defaultOpen:!1,children:[h(ke,{title:c===1?`Performing 1 action`:`Performing ${c} actions`}),h(Ae,{children:s.map((e,r)=>h(De,{children:o(e)},`${t}-${n}-${r}`))})]})}return e.type===`tool-renderUI`&&r&&(`state`in e?e.state:void 0)===`output-available`&&`output`in e?h(ze,{output:e.output,sendMessage:i}):null}function ze({output:e,sendMessage:t}){let n=i.useMemo(()=>{let t=Fe.safeParse(e);return t.success?{ui:r(Object.entries(t.data.ui.elements).map(([e,t])=>({...t,key:e}))),context:t.data.context}:null},[e]),a=i.useCallback((e,n)=>{t({text:`[Form:${e}] ${JSON.stringify(n)}`})},[t]),o=i.useCallback(e=>{t({text:`[Form:${e}] cancelled`})},[t]);return n?h(ye,{ui:n.ui,context:n.context,onSubmit:a,onCancel:o}):null}const Be=E(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Ve({className:t,variant:n=`default`,size:r=`default`,asChild:i=!1,...a}){return h(i?O.Root:`button`,{"data-slot":`button`,"data-variant":n,"data-size":r,className:e(Be({variant:n,size:r,className:t})),...a})}function He({children:t,className:n,...r}){let a=i.useRef(null);return i.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[t]),h(`div`,{ref:a,"data-slot":`chat-message-list`,className:e(`flex flex-col overflow-y-auto scroll-smooth`,n),...r,children:t})}function Ue({text:t=`AI is thinking...`,className:n,...r}){return g(`div`,{"data-slot":`chat-loading`,className:e(`flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground`,n),...r,children:[h(x,{className:`size-4 animate-spin`}),h(`span`,{children:t})]})}function We({title:t=`Start a conversation`,description:n=`Ask a question or describe what you need help with.`,className:r,...i}){return h(`div`,{"data-slot":`chat-empty`,className:e(`flex flex-col items-center justify-center gap-2 py-8 text-center`,r),...i,children:g(`div`,{className:`space-y-1`,children:[h(`h3`,{className:`text-sm font-medium`,children:t}),h(`p`,{className:`text-xs text-muted-foreground`,children:n})]})})}var Ge=1,Ke=.9,qe=.8,Je=.17,Ye=.1,Xe=.999,Ze=.9999,Qe=.99,$e=/[\\\/_+.#"@\[\(\{&]/,et=/[\\\/_+.#"@\[\(\{&]/g,tt=/[\s-]/,nt=/[\s-]/g;function rt(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Ge:Qe;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=rt(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Ge:$e.test(e.charAt(l-1))?(d*=qe,p=e.slice(i,l-1).match(et),p&&i>0&&(d*=Xe**+p.length)):tt.test(e.charAt(l-1))?(d*=Ke,m=e.slice(i,l-1).match(nt),m&&i>0&&(d*=Xe**+m.length)):(d*=Je,i>0&&(d*=Xe**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Ze)),(d<Ye&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=rt(e,t,n,r,l+1,a+2,o),f*Ye>d&&(d=f*Ye)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function it(e){return e.toLowerCase().replace(nt,` `)}function at(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,rt(e,t,it(e),it(t),0,0,{})}const B=`[cmdk-group=""]`,ot=`[cmdk-group-items=""]`,st=`[cmdk-item=""]`,ct=`${st}:not([aria-disabled="true"])`,lt=`cmdk-item-select`,V=`data-value`,ut=(e,t,n)=>at(e,t,n),dt=i.createContext(void 0),H=()=>{let e=i.useContext(dt);if(!e)throw Error(`CommandContext is missing a provider`);return e},ft=i.createContext(void 0),pt=()=>{let e=i.useContext(ft);if(!e)throw Error(`StoreContext is missing a provider`);return e},mt=i.createContext(void 0),ht=i.forwardRef((e,t)=>{let n=G(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=G(()=>new Set),a=G(()=>new Map),o=G(()=>new Map),s=G(()=>new Set),c=Et(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:_,disablePointerSelection:v=!1,vimBindings:y=!0,...b}=e,x=j(),S=j(),C=j(),w=i.useRef(null),T=Ot();W(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,E.emit()}},[d]),W(()=>{T(6,ee)},[]);let E=i.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)N(),k(),T(1,M);else if(e===`value`){let e=document.activeElement;if(e instanceof HTMLElement&&(e.hasAttribute(`cmdk-input`)||e.hasAttribute(`cmdk-root`))){let e=document.getElementById(C);e?e.focus():document.getElementById(x)?.focus()}if(T(7,()=>{n.current.selectedItemId=P()?.id,E.emit()}),r||T(5,ee),c.current?.value!==void 0){let e=t??``;c.current.onValueChange?.(e);return}}E.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),D=i.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,O(t,r)),T(2,()=>{k(),E.emit()}))},item:(e,t)=>{if(r.current.add(e),t)if(!a.current.has(t))a.current.set(t,new Set([e]));else{let n=a.current.get(t);n?n.add(e):a.current.set(t,new Set([e]))}return T(3,()=>{N(),k(),n.current.value||M(),E.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=P();T(4,()=>{N(),t?.getAttribute(`id`)===e&&M(),E.emit()})}},group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>c.current.shouldFilter!==!1,label:l||e[`aria-label`]||`Command Menu`,getDisablePointerSelection:()=>!!c.current.disablePointerSelection,listId:x,inputId:C,labelId:S,listInnerRef:w}),[]);function O(e,t){let r=c.current?.filter??ut;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=a.current.get(n);if(!r){t.push([n,0]);return}let i=0;r.forEach(t=>{let n=e.get(t)??0;i=Math.max(n,i)}),t.push([n,i])});let r=w.current;F().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i??``)??0)-(e.get(r??``)??0)}).forEach(e=>{let t=e.closest(ot);if(t){let n=e.parentElement===t?e:e.closest(`${ot} > *`);n&&t.appendChild(n)}else{if(!r)return;let t=e.parentElement===r?e:e.closest(`${ot} > *`);t&&r.appendChild(t)}}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=w.current?.querySelector(`${B}[cmdk-group-id="${e[0]}"]`);t?.parentElement&&t.parentElement.appendChild(t)});let i=new Set(t.map(e=>e[0]));w.current?.querySelectorAll(`${B}[cmdk-group-id]`)?.forEach(e=>{let t=e.getAttribute(`cmdk-group-id`);t&&!i.has(t)&&e.parentElement?.appendChild(e)});let o=w.current?.closest(`[cmdk-list]`);o&&(o.scrollTop=0)}function M(){let e=F().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(V);E.setState(`value`,e??``)}function N(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=O(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of a.current)for(let r of t)if((n.current.filtered.items.get(r)??0)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ee(){let e=P();e&&(e.parentElement?.firstChild===e&&e.closest(B)?.querySelector(`[cmdk-group-heading=""]`)?.scrollIntoView({block:`nearest`}),e.scrollIntoView({block:`nearest`}))}function P(){return w.current?.querySelector(`${st}[aria-selected="true"]`)}function F(){return Array.from(w.current?.querySelectorAll(ct)||[])}function I(e){let t=F()[e];t&&E.setState(`value`,t.getAttribute(V)??``)}function L(e){let t=P(),n=F(),r=n.findIndex(e=>e===t),i=n[r+e];c.current?.loop&&(i=r+e<0?n[n.length-1]:r+e===n.length?n[0]:n[r+e]),i&&E.setState(`value`,i.getAttribute(V)??``)}function R(e){let t=P()?.closest(B),n;for(;t&&!n;)t=e>0?wt(t,B):Tt(t,B),n=t?.querySelector(ct);n?E.setState(`value`,n.getAttribute(V)??``):L(e)}let te=()=>I(F().length-1),ne=e=>{e.preventDefault(),e.metaKey?te():e.altKey?R(1):L(1)},re=e=>{e.preventDefault(),e.metaKey?I(0):e.altKey?R(-1):L(-1)};return g(A.div,{ref:t,tabIndex:-1,...b,"cmdk-root":``,onKeyDown:e=>{b.onKeyDown?.(e);let t=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||t))switch(e.key){case`n`:case`j`:y&&e.ctrlKey&&ne(e);break;case`ArrowDown`:ne(e);break;case`p`:case`k`:y&&e.ctrlKey&&re(e);break;case`ArrowUp`:re(e);break;case`Home`:e.preventDefault(),I(0);break;case`End`:e.preventDefault(),te();break;case`Enter`:{e.preventDefault();let t=P();if(t){let e=new Event(lt);t.dispatchEvent(e)}}}},children:[h(`label`,{"cmdk-label":``,htmlFor:D.inputId,id:D.labelId,style:At,children:l}),q(e,e=>h(ft.Provider,{value:E,children:h(dt.Provider,{value:D,children:e})}))]})}),gt=i.forwardRef((e,t)=>{let n=j(),r=i.useRef(null),a=i.useContext(mt),o=H(),s=Et(e),c=s.current?.forceMount??a?.forceMount;W(()=>o.item(n,a?.id),[c]);let l=Dt(n,r,[e.value,e.children,r],e.keywords),u=pt(),d=K(e=>e.value&&e.value===l.current),f=K(e=>c||o.filter()===!1?!0:e.search?(e.filtered.items.get(n)??0)>0:!0);i.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(lt,p),()=>t.removeEventListener(lt,p)},[f,e.onSelect,e.disabled]);function p(){m(),s.current.onSelect?.(l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:g,value:_,onSelect:v,forceMount:y,keywords:b,...x}=e;return h(A.div,{ref:M(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!g,"aria-selected":!!d,"data-disabled":!!g,"data-selected":!!d,onPointerMove:g||o.getDisablePointerSelection()?void 0:m,onClick:g?void 0:p,children:e.children})}),_t=i.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=j(),c=i.useRef(null),l=i.useRef(null),u=j(),d=H(),f=K(e=>a||d.filter()===!1?!0:e.search?e.filtered.groups.has(s):!0);W(()=>d.group(s),[]),Dt(s,c,[e.value,e.heading,l]);let p=i.useMemo(()=>({id:s,forceMount:a}),[a]);return g(A.div,{ref:M(c,t),...o,"cmdk-group":``,"cmdk-group-id":s,role:`presentation`,hidden:f?void 0:!0,children:[n&&h(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u,children:n}),q(e,e=>h(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0,children:h(mt.Provider,{value:p,children:e})}))]})}),vt=i.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=i.useRef(null),o=K(e=>!e.search);return!n&&!o?null:h(A.div,{ref:M(a,t),...r,"cmdk-separator":``,role:`separator`})}),yt=i.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=pt(),s=K(e=>e.search),c=K(e=>e.selectedItemId),l=H();return i.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),h(A.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:a?e.value:s,onChange:e=>{a||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),bt=i.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...a}=e,o=i.useRef(null),s=i.useRef(null),c=K(e=>e.selectedItemId),l=H();return i.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n=null,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{n!==null&&cancelAnimationFrame(n),r.unobserve(e)}}},[]),h(A.div,{ref:M(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId,children:q(e,e=>h(`div`,{ref:M(s,l.listInnerRef),"cmdk-list-sizer":``,children:e}))})}),xt=i.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return h(k.Root,{open:n,onOpenChange:r,children:g(k.Portal,{container:o,children:[h(k.Overlay,{"cmdk-overlay":``,className:i}),h(k.Content,{"aria-label":e.label,"cmdk-dialog":``,className:a,children:h(ht,{ref:t,...s})})]})})}),St=i.forwardRef((e,t)=>K(e=>e.filtered.count===0)?h(A.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Ct=i.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return h(A.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i,children:q(e,e=>h(`div`,{"aria-hidden":!0,children:e}))})}),U=Object.assign(ht,{List:bt,Item:gt,Input:yt,Group:_t,Separator:vt,Dialog:xt,Empty:St,Loading:Ct});function wt(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Tt(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Et(e){let t=i.useRef(e);return W(()=>{t.current=e}),t}const W=typeof window>`u`?i.useEffect:i.useLayoutEffect;function G(e){let t=i.useRef(void 0);return t.current===void 0&&(t.current=e()),t}function K(e){let t=pt(),n=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,n,n)}function Dt(e,t,n,r=[]){let a=i.useRef(``),o=H();return W(()=>{let i=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&e&&`current`in e)return e.current?e.current.textContent?.trim():a.current}})()??``,s=r.map(e=>e.trim());o.value(e,i,s),t.current?.setAttribute(V,i),a.current=i}),a}const Ot=()=>{let[e,t]=i.useState(),n=G(()=>new Map);return W(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function kt(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function q({asChild:e,children:t},n){if(e&&i.isValidElement(t)){let e=t;return i.cloneElement(kt(e),{ref:e.ref},n(e.props.children))}return n(t)}const At={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function jt({...e}){return h(D.Root,{"data-slot":`dialog`,...e})}function Mt({...e}){return h(D.Trigger,{"data-slot":`dialog-trigger`,...e})}function J({...e}){return h(D.Portal,{"data-slot":`dialog-portal`,...e})}function Nt({...e}){return h(D.Close,{"data-slot":`dialog-close`,...e})}function Pt({className:t,...n}){return h(D.Overlay,{"data-slot":`dialog-overlay`,className:e(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,t),...n})}function Ft({className:t,children:n,showCloseButton:r=!0,...i}){return g(J,{"data-slot":`dialog-portal`,children:[h(Pt,{}),g(D.Content,{"data-slot":`dialog-content`,className:e(`bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg`,t),...i,children:[n,r&&g(D.Close,{"data-slot":`dialog-close`,className:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[h(w,{}),h(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function It({className:t,...n}){return h(`div`,{"data-slot":`dialog-header`,className:e(`flex flex-col gap-2 text-center sm:text-left`,t),...n})}function Lt({className:t,showCloseButton:n=!1,children:r,...i}){return g(`div`,{"data-slot":`dialog-footer`,className:e(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,t),...i,children:[r,n&&h(D.Close,{asChild:!0,children:h(Ve,{variant:`outline`,children:`Close`})})]})}function Rt({className:t,...n}){return h(D.Title,{"data-slot":`dialog-title`,className:e(`text-lg leading-none font-semibold`,t),...n})}function zt({className:t,...n}){return h(D.Description,{"data-slot":`dialog-description`,className:e(`text-muted-foreground text-sm`,t),...n})}function Bt({className:t,...n}){return h(`kbd`,{"data-slot":`kbd`,className:e(`bg-muted text-muted-foreground pointer-events-none inline-grid w-fit min-w-5 place-items-center gap-1 rounded px-1.5 py-0.5 font-sans text-xs font-medium select-none leading-[1]`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,t),...n})}function Vt({className:t,...n}){return h(`kbd`,{"data-slot":`kbd-group`,className:e(`inline-flex items-center gap-1`,t),...n})}function Ht({className:t,...n}){return h(U,{"data-slot":`command`,className:e(`text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n})}function Ut({className:t,children:n,...r}){return h(J,{"data-slot":`dialog-portal`,children:h(D.Content,{"data-slot":`dialog-content`,className:e(`backdrop-blur-xl fixed top-1/3 left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] overflow-hidden rounded-xl border-none p-2 shadow-2xl ring-0 duration-200 outline-none sm:max-w-lg`,t),style:{backgroundColor:`color-mix(in oklch, var(--background) 95%, transparent)`},...r,children:n})})}function Wt({className:t,...n}){return h(U.Empty,{"data-slot":`command-empty`,className:e(`text-muted-foreground py-6 text-center text-sm`,t),...n})}function Y({className:t,ref:n,...r}){let a=i.useCallback(e=>{if(e){let t=e.querySelector(`[cmdk-group-heading]`);t instanceof HTMLElement&&(t.style.position=`sticky`,t.style.top=`0`,t.style.zIndex=`10`,t.style.width=`fit-content`,t.style.backdropFilter=`blur(24px)`,t.style.setProperty(`-webkit-backdrop-filter`,`blur(24px)`),t.style.backgroundColor=`color-mix(in oklch, var(--background) 95%, transparent)`,t.style.borderRadius=`6px`,t.style.setProperty(`padding-top`,`4px`,`important`),t.style.setProperty(`padding-bottom`,`4px`,`important`))}typeof n==`function`?n(e):n&&(n.current=e)},[n]);return h(U.Group,{ref:a,"data-slot":`command-group`,className:e(`text-foreground !p-0 [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:scroll-mt-16 [&_[cmdk-group-heading]]:pt-0! [&_[cmdk-group-heading]]:!p-3 [&_[cmdk-group-heading]]:!pb-1 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium`,t),...r})}function Gt({className:t,...n}){return h(U.Separator,{"data-slot":`command-separator`,className:e(`bg-border -mx-1 h-px`,t),...n})}function Kt({className:t,style:n,...r}){return h(U.Item,{"data-slot":`command-item`,className:e(`data-[selected=true]:border-input data-[selected=true]:bg-input/50 [&_svg:not([class*='text-'])]:text-muted-foreground relative flex h-[var(--cmdk-item-height,2.25rem)] cursor-default items-center gap-2 border border-transparent px-3 text-sm font-medium outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),style:{borderRadius:`var(--cmdk-radius, 0.375rem)`,...n},...r})}function qt({className:t,children:n,...r}){let i=typeof n==`string`?[...n]:null;return h(`span`,{"data-slot":`command-shortcut`,className:e(`ml-auto flex items-center gap-1`,t),...r,children:i?i.map((e,t)=>h(Bt,{children:e},t)):n})}function Jt(){return crypto.randomUUID()}function Yt(e){let t=e.find(e=>e.role===`user`);if(!t)return`New conversation`;let n=t.parts?.filter(e=>e.type===`text`).map(e=>e.text).join(` `)||`New conversation`;return n.length>50?n.slice(0,50)+`...`:n}function Xt(e){return typeof e!=`object`||!e||!(`version`in e)||e.version!==1||!(`conversations`in e)||!Array.isArray(e.conversations)?null:e}function Zt({storageKey:e=`cmdk-chat-history`,maxConversations:t=50,messages:n,setMessages:r}){let[i,a]=f([]),[o,c]=f(null),[p,m]=f(!1),h=d(n);h.current=n;let g=d(r);g.current=r;let _=d(i);_.current=i;let v=d(o);v.current=o,l(()=>{try{let t=localStorage.getItem(e);if(t){let n=Xt(JSON.parse(t));n?a(n.conversations):(console.warn(`Chat history: stored data failed validation. Discarding.`),localStorage.removeItem(e))}}catch(e){console.error(`Failed to load chat history:`,e)}finally{m(!0)}},[e]),l(()=>{if(p)try{let t={version:1,conversations:i};localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(`Failed to save chat history:`,e)}},[i,e,p]);let y=s(()=>{let e=h.current,n=v.current;!n||e.length===0||a(r=>{let i=Date.now();return r.find(e=>e.id===n)?r.map(t=>t.id===n?{...t,messages:e,title:Yt(e),updatedAt:i}:t):[{id:n,title:Yt(e),messages:e,createdAt:i,updatedAt:i},...r].slice(0,t)})},[t]),b=s(()=>{v.current&&h.current.length>0&&y(),g.current?.([]),c(Jt())},[y]),x=s(e=>{v.current&&h.current.length>0&&y();let t=_.current.find(t=>t.id===e);t&&(g.current?.(t.messages),c(e))},[y]);return u(()=>({conversations:i,currentConversationId:o,startNewChat:b,loadConversation:x,saveCurrentConversation:y}),[i,o,b,x,y])}let X=null,Z=null;function Qt(){try{return typeof process<`u`&&process.env?.BETTER_CMDK_TELEMETRY_DISABLED===`1`}catch{return!1}}function $t(e,t){return delete e.user,delete e.server_name,e.request&&(delete e.request.cookies,delete e.request.headers,delete e.request.env,delete e.request.data),e.breadcrumbs=[],e}function en(){typeof window>`u`||X===null&&(Qt()||(X=new F({dsn:`https://7d9fc7e14e8769805297d46569e33c05@o4510706172755968.ingest.us.sentry.io/4510846832017408`,transport:ne,stackParser:R,integrations:[L(),te()],beforeSend:$t,sendDefaultPii:!1,tracesSampleRate:1}),Z=new I,Z.setClient(X),X.init()))}function tn(e,t){!Z||!X||(t?Z.captureException(e,{captureContext:e=>(e.setExtras(t),e)}):Z.captureException(e))}function nn(e){try{let t=new Uint8Array(e/2);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}catch{let t=``;for(let n=0;n<e;n++)t+=Math.floor(Math.random()*16).toString(16);return t}}function rn(e,t,n){if(!Z||!X)return n();let r=Date.now()/1e3,i=nn(32),a=nn(16),o=`ok`,s=()=>{let n=Date.now()/1e3;Z.captureEvent({type:`transaction`,transaction:e,start_timestamp:r,timestamp:n,contexts:{trace:{trace_id:i,span_id:a,op:t,status:o}}})};try{let e=n();return e instanceof Promise?e.then(e=>(s(),e),e=>{throw o=`internal_error`,s(),e}):(s(),e)}catch(e){throw o=`internal_error`,s(),e}}const an=i.createContext(null),on=[];function sn({children:e,chatEndpoint:t=null,chat:n,onModeChange:r,onOpenChange:a,historyStorageKey:o,maxConversations:s}){let[c,l]=i.useState(`command`),[u,d]=i.useState(``),[f,p]=i.useState(`idle`),[m,g]=i.useState(null),_=i.useRef(n);_.current=n;let v=!!n;i.useEffect(()=>{en()},[]);let y=i.useMemo(()=>{if(!(v||!t))return new P({api:t})},[t,v]),b=ee(i.useMemo(()=>y?{transport:y,onError:e=>{tn(e,{source:`internalChat.onError`}),p(`error`),g(e)}}:{},[y])),x=n?.status,S=n?.error??null;i.useEffect(()=>{if(v)x===`ready`?p(`idle`):x===`streaming`?p(`streaming`):x===`submitted`?p(`submitted`):x===`error`&&p(`error`),g(S);else{let e=b.status;e===`streaming`?p(`streaming`):e===`submitted`?p(`submitted`):e===`error`?p(`error`):e===`ready`&&p(`idle`)}},[x,S,b.status,v]);let C=i.useCallback(e=>{l(e),r?.(e)},[r]),w=!!(n||t),T=i.useCallback(e=>{w&&rn(`switchToChat`,`ui.action`,()=>{C(`chat`),e&&d(e)})},[w,C]),E=i.useCallback(()=>{C(`command`),d(``),p(`idle`),g(null)},[C]),D=i.useCallback(async e=>{e.trim()&&await rn(`sendMessage`,`function`,async()=>{try{let t=_.current;if(t){d(``),t.sendMessage({text:e.trim()});return}if(!y)return;p(`submitted`),d(``),await b.sendMessage({text:e.trim()})}catch(e){throw tn(e,{source:`sendMessage`}),e}})},[b,y]),O=f===`submitted`||f===`streaming`,k=n?n.messages:b.messages??on,A=n?.setMessages??b.setMessages,j=n?.addToolApprovalResponse,M=n?.agenticActions,N=Zt({storageKey:o,maxConversations:s,messages:k,setMessages:A}),F=i.useCallback(e=>{N.loadConversation(e),C(`chat`)},[N.loadConversation,C]),I=i.useRef(f);i.useEffect(()=>{let e=I.current;I.current=f,(e===`streaming`||e===`submitted`)&&f===`idle`&&k.length>0&&N.saveCurrentConversation()},[f,k.length,N.saveCurrentConversation]);let L=i.useCallback(()=>{a?.(!1)},[a]),R=i.useMemo(()=>({mode:c,setMode:C,inputValue:u,setInputValue:d,chatEndpoint:t,status:f,error:m,switchToChat:T,switchToCommand:E,messages:k,sendMessage:D,isLoading:O,isEnabled:w,addToolApprovalResponse:j,agenticActions:M,requestClose:L,conversations:N.conversations,currentConversationId:N.currentConversationId,startNewChat:N.startNewChat,loadConversation:F}),[c,C,u,t,f,m,T,E,k,D,O,w,j,M,L,N.conversations,N.currentConversationId,N.startNewChat,F]);return h(an.Provider,{value:R,children:e})}function Q(){let e=i.useContext(an);if(!e)throw Error(`useCommandMenuContext must be used within a CommandMenuProvider`);return e}var cn=class extends i.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){tn(e,{componentStack:t.componentStack??void 0})}render(){return this.state.hasError?null:this.props.children}};function ln(e){return e instanceof Element?!!e.closest(`input, textarea, select, button, a, [contenteditable='true'], [contenteditable=''], [data-cmdk-mobile-gesture-ignore]`):!1}function un(e,t,n,r,i,a){let o=window.innerWidth,s=window.innerHeight,c=o*n,l=o-a,u=Math.max(0,l-c),d=s*(1-r),f=s-i;return e>=u&&e<=l&&t>=d&&t<=f}function dn({enabled:e,open:t,holdMs:n,swipeUpPx:r,onTrigger:a,movementTolerancePx:o=10,horizontalCancelPx:s=24,activationZoneWidthPercent:c=.4,activationZoneHeightPercent:l=.4,bottomExclusionPx:u=8,rightExclusionPx:d=0}){let[f,p]=i.useState(!1),m=i.useRef(null),h=i.useRef(0),g=i.useRef(a),_=i.useRef({applied:!1,touchCallout:``,webkitUserSelect:``,userSelect:``});i.useEffect(()=>{g.current=a},[a]);let v=i.useCallback(()=>{if(typeof document>`u`||_.current.applied)return;let{style:e}=document.documentElement;_.current={applied:!0,touchCallout:e.getPropertyValue(`-webkit-touch-callout`),webkitUserSelect:e.getPropertyValue(`-webkit-user-select`),userSelect:e.getPropertyValue(`user-select`)},e.setProperty(`-webkit-touch-callout`,`none`),e.setProperty(`-webkit-user-select`,`none`),e.setProperty(`user-select`,`none`)},[]),y=i.useCallback(()=>{if(typeof document>`u`)return;let e=_.current;if(!e.applied)return;let{style:t}=document.documentElement;e.touchCallout?t.setProperty(`-webkit-touch-callout`,e.touchCallout):t.removeProperty(`-webkit-touch-callout`),e.webkitUserSelect?t.setProperty(`-webkit-user-select`,e.webkitUserSelect):t.removeProperty(`-webkit-user-select`),e.userSelect?t.setProperty(`user-select`,e.userSelect):t.removeProperty(`user-select`),_.current={applied:!1,touchCallout:``,webkitUserSelect:``,userSelect:``}},[]),b=i.useCallback(()=>{let e=m.current;e?.timer!=null&&window.clearTimeout(e.timer),m.current=null,p(!1),y()},[y]);return i.useEffect(()=>{if(!e||t||typeof window>`u`){b();return}let i=e=>{if(e.touches.length!==1||ln(e.target))return;let t=e.touches[0];if(!t||!un(t.clientX,t.clientY,c,l,u,d))return;h.current=Date.now(),v();let r=window.setTimeout(()=>{let e=m.current;e&&(e.armed=!0,p(!0),typeof navigator<`u`&&`vibrate`in navigator&&navigator.vibrate(6))},n);m.current={startX:t.clientX,startY:t.clientY,armed:!1,timer:r}},a=e=>{if(e.touches.length!==1){b();return}let t=m.current;if(!t)return;let n=e.touches[0];if(!n)return;let i=n.clientX-t.startX,a=n.clientY-t.startY;if(!t.armed){Math.hypot(i,a)>o&&b();return}if(e.cancelable&&e.preventDefault(),Math.abs(i)>s){b();return}a<=-r&&(b(),typeof navigator<`u`&&`vibrate`in navigator&&navigator.vibrate(14),g.current())},f=()=>{b()},_=()=>{b()},y=e=>{let t=m.current!==null,r=Date.now()-h.current<n+1200,i=un(e.clientX,e.clientY,c,l,u,d);if(t||r&&i){if(!t&&ln(e.target))return;e.preventDefault(),e.stopPropagation()}};return document.addEventListener(`touchstart`,i,{passive:!1}),document.addEventListener(`touchmove`,a,{passive:!1}),document.addEventListener(`touchend`,f,{passive:!0}),document.addEventListener(`touchcancel`,_,{passive:!0}),document.addEventListener(`contextmenu`,y,!0),()=>{document.removeEventListener(`touchstart`,i),document.removeEventListener(`touchmove`,a),document.removeEventListener(`touchend`,f),document.removeEventListener(`touchcancel`,_),document.removeEventListener(`contextmenu`,y,!0),b()}},[e,t,n,r,o,s,c,l,u,d,b,v]),{showHint:f}}function fn(e){let[t,n]=i.useState(0);return i.useEffect(()=>{if(!e||typeof window>`u`){n(0);return}let t=window.visualViewport;if(!t){n(0);return}let r=()=>{let e=Math.max(0,Math.round(window.innerHeight-t.height-t.offsetTop));n(t=>t===e?t:e)};return r(),t.addEventListener(`resize`,r),t.addEventListener(`scroll`,r),window.addEventListener(`orientationchange`,r),()=>{t.removeEventListener(`resize`,r),t.removeEventListener(`scroll`,r),window.removeEventListener(`orientationchange`,r)}},[e]),t}const pn=e=>{},mn={none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,xl:`rounded-xl`},hn={none:`0px`,sm:`0.125rem`,md:`0.375rem`,lg:`0.5rem`,xl:`0.75rem`},gn=i.createContext({isMobile:!1,layout:`keyboard-last`,keyboardInset:0,showQuickActions:!1,quickActionsCount:4});function _n(){return i.useContext(gn)}function vn(e){let t=e?.gesture!==!1,n=e?.gesture===!1?void 0:e?.gesture;return{enabled:e?.enabled??!0,breakpoint:e?.breakpoint??900,layout:e?.layout??`keyboard-last`,gesture:{enabled:t?n?.enabled??!0:!1,holdMs:t?n?.holdMs??350:350,swipeUpPx:t?n?.swipeUpPx??56:56},showQuickActions:e?.showQuickActions??!0,quickActionsCount:e?.quickActionsCount??4}}function yn(e,t){let[n,r]=i.useState(!1);return i.useEffect(()=>{if(!t||typeof window>`u`){r(!1);return}let n=window.matchMedia(`(max-width: ${e}px)`),i=window.matchMedia(`(pointer: coarse)`),a=()=>{r(n.matches||i.matches)};return a(),n.addEventListener(`change`,a),i.addEventListener(`change`,a),window.addEventListener(`orientationchange`,a),()=>{n.removeEventListener(`change`,a),i.removeEventListener(`change`,a),window.removeEventListener(`orientationchange`,a)}},[e,t]),n}function bn(e){let t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function xn({className:t,children:n,corners:r=`xl`,borderColor:a,isMobile:o,keyboardInset:s,onRequestClose:c,...l}){let u=i.useRef(null),d=i.useCallback(()=>{if(typeof document>`u`)return;let e=document.activeElement;if(e instanceof HTMLElement&&e.hasAttribute(`cmdk-input`)){e.blur();return}c?.()},[c]),f=e=>{if(e.touches.length!==1)return;let t=e.touches[0];t&&(u.current={x:t.clientX,y:t.clientY})},p=e=>{let t=u.current;if(u.current=null,!t||e.changedTouches.length===0)return;let n=e.changedTouches[0];if(!n)return;let r=n.clientX-t.x;n.clientY-t.y>56&&Math.abs(r)<42&&d()};return g(J,{"data-slot":`dialog-portal`,children:[o&&h(D.Overlay,{className:`fixed inset-0 z-40 bg-black/35 backdrop-blur-[1px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),g(`div`,{className:e(`fixed z-50 w-full max-w-[calc(100%-2rem)]`,o?`inset-x-0 bottom-0 max-w-none px-0`:`top-1/3 left-[50%] translate-x-[-50%] translate-y-[-50%]`),style:o?void 0:{maxWidth:`45vw`},children:[g(D.Content,{"data-slot":`dialog-content`,className:e(`backdrop-blur-xl flex flex-col w-full overflow-hidden border border-input p-0 ring-0 outline-none`,o?`border-x-0 border-b-0 will-change-transform 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]:slide-out-to-bottom-8 data-[state=open]:slide-in-from-bottom-8 data-[state=open]:duration-300 data-[state=closed]:duration-200`:mn[r],t),style:{"--cmdk-radius":hn[r],"--cmdk-mobile-keyboard-inset":`${s??0}px`,"--cmdk-mobile-sheet-top-inset":`max(11rem, calc(env(safe-area-inset-top) + 8rem))`,maxHeight:o?`calc(100dvh - var(--cmdk-mobile-sheet-top-inset))`:`45vh`,height:o?`calc(100dvh - var(--cmdk-mobile-sheet-top-inset))`:void 0,...o?{borderTopLeftRadius:hn[r],borderTopRightRadius:hn[r],borderBottomLeftRadius:`0px`,borderBottomRightRadius:`0px`}:{},backgroundColor:`color-mix(in oklch, var(--background) 95%, transparent)`,boxShadow:`4px 4px 12px -2px rgba(0,0,0,0.12), -4px 4px 12px -2px rgba(0,0,0,0.12), 0 8px 16px -4px rgba(0,0,0,0.1)`,...a?{"--tw-ring-color":a}:{}},...l,children:[o&&h(`div`,{className:`flex justify-center py-2`,"data-cmdk-mobile-gesture-ignore":!0,onTouchStart:f,onTouchEnd:p,children:h(`div`,{className:`h-1.5 w-11 rounded-full bg-muted-foreground/35`})}),n]}),h(`div`,{className:e(`flex justify-end select-none`,o&&`hidden`),children:h(`a`,{href:`https://better-cmdk.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-xs text-muted-foreground font-medium px-2 py-0.5 hover:text-foreground transition-colors`,style:{borderRadius:`0 0 0.375rem 0.375rem`,marginRight:`1rem`,backgroundColor:`color-mix(in oklch, var(--background) 95%, transparent)`,backdropFilter:`blur(24px)`,WebkitBackdropFilter:`blur(24px)`,borderLeft:`1px solid var(--color-input)`,borderRight:`1px solid var(--color-input)`,borderBottom:`1px solid var(--color-input)`,boxShadow:`4px 4px 12px -2px rgba(0,0,0,0.12), -4px 4px 12px -2px rgba(0,0,0,0.12), 0 8px 16px -4px rgba(0,0,0,0.1)`},children:`powered by better-cmdk`})})]})]})}const Sn=g(m,{children:[h(Tn,{placeholder:`Search for commands or ask AI...`,showSendButton:!0}),h(On,{children:h($,{})})]});function Cn({title:t=`Command Palette`,description:n=`Search for a command to run...`,children:r,className:a,corners:o=`xl`,borderColor:s,commands:c,commandsPlaceholder:l=`Search for commands or ask AI...`,commandsAskAILabel:u=`Ask AI`,mobile:d,...f}){let{mode:p,status:_,switchToCommand:y,messages:b,isEnabled:x,setInputValue:S,inputValue:C}=Q(),w=i.useMemo(()=>vn(d),[d]),T=yn(w.breakpoint,w.enabled),E=w.enabled&&T,D=fn(E&&!!f.open),O=i.useCallback(e=>{e&&S(``),f.onOpenChange?.(e)},[f.onOpenChange,S]),k=i.useCallback(()=>{O(!0)},[O]),A=dn({enabled:E&&!f.open&&!!f.onOpenChange&&w.gesture.enabled,open:!!f.open,holdMs:w.gesture.holdMs,swipeUpPx:w.gesture.swipeUpPx,onTrigger:k}),j=i.useMemo(()=>({isMobile:E,layout:w.layout,keyboardInset:D,showQuickActions:w.showQuickActions,quickActionsCount:w.quickActionsCount}),[E,w.layout,D,w.showQuickActions,w.quickActionsCount]),M=()=>c&&c.length>0?h(Dn,{commands:c,placeholder:l,askAILabel:u}):typeof r==`function`?r({mode:p,messages:b,status:_,isEnabled:x}):r??Sn,N=e=>{p===`chat`&&(e.preventDefault(),y())};return i.useEffect(()=>{let e=e=>{e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),O(!1))};if(f.open)return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[f.open,O]),g(m,{children:[h(jt,{...f,onOpenChange:O,children:g(xn,{className:a,corners:o,borderColor:s,isMobile:E,keyboardInset:D,onRequestClose:()=>O(!1),onEscapeKeyDown:N,onOpenAutoFocus:e=>{E&&w.layout===`keyboard-last`&&e.preventDefault()},children:[g(It,{className:`sr-only`,children:[h(Rt,{children:t}),h(zt,{children:n})]}),h(gn.Provider,{value:j,children:h(U,{"data-slot":`command`,className:e(`**:data-[slot=command-input-wrapper]:bg-transparent rounded-none bg-transparent **:data-[slot=command-input]:!h-11 **:data-[slot=command-input]:py-0 **:data-[slot=command-input-wrapper]:mb-0`,E?`**:data-[slot=command-input-wrapper]:!h-[var(--cmdk-input-row-height)] pb-[env(safe-area-inset-bottom)]`:`**:data-[slot=command-input-wrapper]:!h-11`,`text-popover-foreground flex h-full min-h-0 w-full flex-col overflow-hidden`),style:{borderRadius:`var(--cmdk-radius, 0.75rem)`,"--cmdk-item-height":E?`3.125rem`:`2.25rem`,"--cmdk-input-row-height":E?`3.5rem`:`2.75rem`},children:M()})})]})}),A.showHint&&g(`div`,{className:`fixed left-1/2 z-50 flex -translate-x-1/2 items-center gap-2 rounded-full border border-input bg-background/95 px-3 py-1.5 text-xs font-medium text-foreground shadow-sm backdrop-blur-md`,style:{bottom:`calc(env(safe-area-inset-bottom) + 2rem)`},"data-cmdk-mobile-gesture-ignore":!0,children:[h(v,{className:`size-3.5`}),`Swipe up for Command Menu`]})]})}function wn({chatEndpoint:e=null,chat:t,onModeChange:n,onOpenChange:r,historyStorageKey:i,maxConversations:a,commands:o,commandsPlaceholder:s,commandsAskAILabel:c,mobile:l,...u}){return h(sn,{chatEndpoint:e,chat:t,onModeChange:n,onOpenChange:r,historyStorageKey:i,maxConversations:a,children:h(cn,{children:h(Cn,{onOpenChange:r,commands:o,commandsPlaceholder:s,commandsAskAILabel:c,mobile:l,...u})})})}function Tn({className:t,showSendButton:n=!1,...r}){let{mode:a,inputValue:o,setInputValue:s,sendMessage:c,isLoading:l,switchToChat:u,startNewChat:d}=Q(),{isMobile:f,layout:p,keyboardInset:m}=_n(),[_,y]=i.useState(!1),x=i.useRef(null),S=()=>{o.trim()&&a===`chat`&&c(o)},C=e=>{if((e.metaKey||e.ctrlKey)&&e.key===`Enter`){e.preventDefault(),a===`command`&&o.trim()?(d(),u(),c(o)):a===`chat`&&o.trim()&&c(o);return}if(a===`chat`&&e.key===`Enter`&&!e.shiftKey){e.preventDefault(),o.trim()&&c(o);return}},w=a===`chat`||o.length>0||f&&p===`keyboard-last`,T=f&&p===`keyboard-last`&&!_&&a===`command`,E=e=>{y(!0),r.onFocus?.(e)},D=e=>{y(!1),r.onBlur?.(e)},O=f?{marginBottom:m>0?`${m}px`:void 0}:void 0,k={...r,onFocus:E,onBlur:D};return g(`div`,{"data-slot":`command-input-wrapper`,className:e(`order-2 flex h-[var(--cmdk-input-row-height,2.75rem)] items-center gap-2 px-6 transition-[margin,border-color] duration-200`,f&&`px-4`,w?`border-t border-input mt-0`:`border-t border-transparent mt-0`),style:O,children:[h(U.Input,{"data-slot":`command-input`,ref:x,value:o,onValueChange:s,onKeyDown:C,className:e(`placeholder:text-muted-foreground flex h-10 w-full bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t),...k,placeholder:a===`chat`?`Ask AI...`:r.placeholder}),T&&h(`button`,{type:`button`,onClick:()=>x.current?.focus(),className:`flex items-center justify-center size-7 shrink-0 border border-input bg-background text-muted-foreground hover:text-foreground transition-colors`,style:{borderRadius:`var(--cmdk-radius, 0.75rem)`},"aria-label":`Type a command`,"data-cmdk-mobile-gesture-ignore":!0,children:h(b,{className:`size-4`})}),n&&a===`chat`&&h(`button`,{type:`button`,onClick:S,disabled:!o.trim()||l,className:`flex items-center justify-center size-6 shrink-0 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,style:{borderRadius:`var(--cmdk-radius, 0.75rem)`},children:h(v,{className:`size-3`})})]})}function $({label:t=`Ask AI`,className:n,...r}){let{inputValue:i,setInputValue:a,switchToChat:o,sendMessage:s,isEnabled:c,startNewChat:l}=Q(),{isMobile:u}=_n(),d=K(e=>e.filtered.count),f=()=>{if(c)if(i.trim()){let e=ut(`ask-ai`,i.trim())>0;d===0&&!e?(l(),o(),s(i)):(o(),a(``))}else o()};return c?h(U.Group,{forceMount:!0,children:g(U.Item,{"data-slot":`command-item`,value:`ask-ai`,onSelect:f,className:e(`data-[selected=true]:border-input data-[selected=true]:bg-input/50 relative flex cursor-default items-center gap-3 border border-transparent px-3 py-2 text-sm outline-hidden select-none`,u&&`min-h-12 py-3`,n),style:{borderRadius:`var(--cmdk-radius, 0.75rem)`},...r,children:[h(S,{className:`size-4 shrink-0 text-primary`}),h(`div`,{className:`flex flex-col items-start gap-0.5`,children:h(`span`,{className:`font-medium`,children:t})}),!u&&g(`span`,{className:`ml-auto flex items-center gap-1`,children:[h(Bt,{children:`⌘`}),h(Bt,{children:`↵`})]})]})}):h(U.Empty,{"data-slot":`command-empty`,className:e(`text-muted-foreground py-6 text-center text-sm`,n),children:`No results found.`})}function En(e){let t=[],n=new Map;for(let r of e){let e=r.group,i=n.get(e);i===void 0?(n.set(e,t.length),t.push({heading:e,items:[r]})):t[i].items.push(r)}let r=t.findIndex(e=>e.heading===void 0);if(r>0){let e=t.splice(r,1)[0];t.unshift(e)}return t}function Dn({commands:t,placeholder:n,askAILabel:r}){let{inputValue:a,mode:o}=Q(),{isMobile:s,layout:c,showQuickActions:l,quickActionsCount:u}=_n(),d=En(t),f=s&&c===`keyboard-last`&&l&&o===`command`&&a.length===0,p=f?t.filter(e=>!e.disabled).slice(0,u):[],_=new Set(p.map(e=>e.name)),v=t=>{let n=t.label??t.name,r=[...t.keywords??[]];return t.label&&t.label!==t.name&&r.push(t.label),g(Kt,{value:t.name,keywords:r.length>0?r:void 0,disabled:t.disabled,onSelect:()=>t.onSelect?.(),className:e(s&&`min-h-12 py-3`),children:[t.icon,n,t.shortcut&&!s&&h(qt,{children:t.shortcut})]},t.name)};return g(m,{children:[h(Tn,{placeholder:n,showSendButton:!0}),g(On,{children:[f&&p.length>0&&h(Y,{heading:`Quick Actions`,children:p.map(e=>v(e))}),d.map((e,t)=>{let n=f?e.items.filter(e=>!_.has(e.name)):e.items;if(n.length===0)return null;let r=n.map(e=>v(e));return e.heading?h(Y,{heading:e.heading,children:r},e.heading):h(i.Fragment,{children:r},`__ungrouped_${t}`)}),h($,{label:r})]})]})}function On({className:t,children:n,actions:r,actionsHeading:a=`Actions`,style:o,...s}){let{mode:c,status:l,messages:u,sendMessage:d,addToolApprovalResponse:f,agenticActions:p,switchToChat:m,startNewChat:_,conversations:v,loadConversation:y,inputValue:b}=Q(),{isMobile:x,layout:C,keyboardInset:w}=_n(),T=i.useCallback(e=>d(e.text),[d]),E=f??pn;if(c===`chat`)return h(`div`,{"data-slot":`command-list`,className:e(`order-1 min-h-0 flex-1 overflow-hidden px-3 flex flex-col`,x&&`px-2`,t),children:u.length===0?h(We,{}):g(He,{style:{flex:`1 1 0%`,minHeight:0},children:[h(`div`,{className:`px-3 py-2 space-y-4`,children:h(Le,{messages:u,sendMessage:T,addToolApprovalResponse:E})}),l===`streaming`&&h(Ue,{})]})});let D=i.Children.toArray(n),O=[],k=[];D.forEach(e=>{i.isValidElement(e)&&(e.type===$||e.type.displayName===`CommandEmpty`)?O.push(e):i.isValidElement(e)&&e.type===Wt||k.push(e)});let A=(r??p)?.filter(e=>e.execute),j=e=>{let t=e.label??e.name;_(),m(),d(t)},M=b.length>0||x&&C===`keyboard-last`,ee=x?`calc(100% - var(--cmdk-input-row-height, 3.5rem))`:`calc(45vh - 2.75rem)`,P={overscrollBehavior:`contain`,paddingBottom:w>0?`${w+8}px`:x?`env(safe-area-inset-bottom)`:void 0,...o};return h(N.div,{initial:!1,animate:{height:M?ee:0},transition:{type:`spring`,duration:.25,bounce:0},className:e(`order-1 min-h-0 overflow-hidden px-3`,x&&`px-2`),children:g(U.List,{"data-slot":`command-list`,className:e(`overflow-x-hidden overflow-y-auto overscroll-contain pt-2 h-full`,x&&`pt-1`,t),style:P,...s,children:[k,v.length>0&&h(Y,{heading:`Recent Chats`,children:v.slice(0,5).map(t=>g(Kt,{value:`chat-history-${t.id}`,keywords:[t.title],onSelect:()=>y(t.id),className:e(x&&`min-h-12 py-3`),children:[h(S,{className:`size-4`}),h(`span`,{className:`truncate`,children:t.title}),h(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:bn(t.updatedAt)})]},t.id))}),A&&A.length>0&&h(Y,{heading:a,children:A.map(t=>h(Kt,{value:t.label??t.name,onSelect:()=>j(t),className:e(x&&`min-h-12 py-3`),children:t.label??t.name},t.name))}),O]})})}$.displayName=`CommandEmpty`;export{ye as AssistantFormRenderer,Le as AssistantMessages,Ve as Button,We as ChatEmpty,Ue as ChatLoading,He as ChatMessageList,Ce as Collapsible,Te as CollapsibleContent,we as CollapsibleTrigger,Ht as Command,xn as CommandContent,wn as CommandDialog,wn as CommandMenu,Ut as CommandDialogContent,$ as CommandEmpty,Y as CommandGroup,Tn as CommandInput,Kt as CommandItem,On as CommandList,an as CommandMenuContext,sn as CommandMenuProvider,Gt as CommandSeparator,qt as CommandShortcut,ae as Confirmation,ce as ConfirmationAccepted,de as ConfirmationAction,ue as ConfirmationActions,le as ConfirmationRejected,se as ConfirmationRequest,oe as ConfirmationTitle,jt as Dialog,Nt as DialogClose,Ft as DialogContent,zt as DialogDescription,Lt as DialogFooter,It as DialogHeader,Pt as DialogOverlay,J as DialogPortal,Rt as DialogTitle,Mt as DialogTrigger,Bt as Kbd,Vt as KbdGroup,be as Message,xe as MessageContent,Se as MessageResponse,Oe as Task,Ae as TaskContent,De as TaskItem,Ee as TaskItemFile,ke as TaskTrigger,Be as buttonVariants,e as cn,ge as defaultFormRegistry,Zt as useChatHistory,Q as useCommandMenuContext};
1
+ import{cn as e}from"./lib/utils.js";import{JSONUIProvider as t,Renderer as n,flatToTree as r}from"@json-render/react";import*as i from"react";import{createContext as a,memo as o,useCallback as s,useContext as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{z as p}from"zod";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{Streamdown as _}from"streamdown";import{ArrowUpIcon as v,ChevronDownIcon as y,KeyboardIcon as b,LoaderIcon as x,MessageCircleIcon as S,SearchIcon as C,XIcon as w}from"lucide-react";import*as T from"@radix-ui/react-collapsible";import{cva as E}from"class-variance-authority";import{Dialog as D,Slot as O}from"radix-ui";import*as k from"@radix-ui/react-dialog";import{Primitive as A}from"@radix-ui/react-primitive";import{useId as j}from"@radix-ui/react-id";import{composeRefs as M}from"@radix-ui/react-compose-refs";import{useChat as N}from"@ai-sdk/react";import{DefaultChatTransport as ee}from"ai";import{BrowserClient as P,Scope as F,dedupeIntegration as I,defaultStackParser as L,linkedErrorsIntegration as te,makeFetchTransport as ne}from"@sentry/browser";import{motion as re}from"motion/react";const R=a(null);function z(){let e=c(R);if(!e)throw Error(`Confirmation components must be used within Confirmation`);return e}function ie({approval:t,state:n,style:r,...i}){return!t||n===`input-streaming`||n===`input-available`?null:h(R.Provider,{value:{approval:t,state:n},children:h(`div`,{"data-slot":`confirmation`,"data-state":n,"data-approved":t?.approved,role:`alertdialog`,"aria-labelledby":`confirmation-title`,style:{borderRadius:`var(--cmdk-radius, 0.5rem)`,...r},className:e(`flex flex-col gap-2 border p-4`,`data-[state=approval-requested]:border-amber-500/50 data-[state=approval-requested]:bg-amber-50/50 dark:data-[state=approval-requested]:bg-amber-950/20`,`data-[approved=true]:border-green-500/50 data-[approved=true]:bg-green-50/50 dark:data-[approved=true]:bg-green-950/20`,`data-[approved=false]:border-red-500/50 data-[approved=false]:bg-red-50/50 dark:data-[approved=false]:bg-red-950/20`),...i})})}function ae(e){return h(`p`,{id:`confirmation-title`,"data-slot":`confirmation-title`,className:`text-sm font-medium`,...e})}function oe({children:e}){let{state:t}=z();return t===`approval-requested`?h(`div`,{"data-slot":`confirmation-request`,children:e}):null}function se({children:e}){let{approval:t,state:n}=z();return!t?.approved||n!==`approval-responded`&&n!==`output-denied`&&n!==`output-available`?null:h(`div`,{"data-slot":`confirmation-accepted`,children:e})}function ce({children:e}){let{approval:t,state:n}=z();return t?.approved!==!1||n!==`approval-responded`&&n!==`output-denied`&&n!==`output-available`?null:h(`div`,{"data-slot":`confirmation-rejected`,children:e})}function le(e){let{state:t}=z();return t===`approval-requested`?h(`div`,{"data-slot":`confirmation-actions`,className:`flex items-center justify-end gap-2 self-end`,...e}):null}function ue({variant:t=`default`,style:n,...r}){return h(`button`,{"data-slot":`confirmation-action`,"data-variant":t,type:`button`,className:e(`inline-flex h-8 items-center justify-center gap-2 whitespace-nowrap px-3 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`,t===`default`&&`bg-primary text-primary-foreground shadow hover:bg-primary/90`,t===`outline`&&`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,t===`destructive`&&`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`),style:{borderRadius:`var(--cmdk-radius, 0.375rem)`,...n},...r})}function B(e){e.stopPropagation()}function de({element:t,children:n,onAction:r}){let{id:i=`form`,title:a,submitLabel:o=`Submit`}=t.props??{},s=e=>{e.preventDefault();let t=new FormData(e.currentTarget),n={};t.forEach((e,t)=>{typeof e==`string`&&(n[t]=e)}),r?.({name:`submit`,params:{formId:i,data:n}})};return g(`div`,{"data-slot":`form-card`,className:e(`w-full rounded-lg border bg-card text-card-foreground shadow-sm`),children:[a&&h(`div`,{className:`flex flex-col space-y-1.5 p-4 pb-3`,children:h(`h3`,{className:`text-base font-semibold leading-none tracking-tight`,children:a})}),h(`div`,{className:e(`p-4`,a?``:`pt-4`),children:g(`form`,{onSubmit:s,className:`space-y-4`,children:[n,g(`div`,{className:`flex justify-end gap-2 pt-2`,children:[h(`button`,{type:`button`,className:e(`inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors`,`hover:bg-accent hover:text-accent-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`),onClick:()=>r?.({name:`cancel`,params:{formId:i}}),children:`Cancel`}),h(`button`,{type:`submit`,className:e(`inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors`,`hover:bg-primary/90`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:opacity-50`),children:o})]})]})})]})}function fe({element:t}){let{name:n=`field`,label:r=`Field`,placeholder:i,required:a,defaultValue:o}=t.props??{};return g(`div`,{className:`space-y-1.5`,children:[g(`label`,{htmlFor:n,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[r,a&&h(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),h(`input`,{id:n,name:n,type:`text`,placeholder:i,required:a,defaultValue:o,autoComplete:`off`,onKeyDown:B,onKeyUp:B,className:e(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}function pe({element:t}){let{name:n=`field`,label:r=`Field`,placeholder:i,required:a,defaultValue:o,rows:s=3}=t.props??{};return g(`div`,{className:`space-y-1.5`,children:[g(`label`,{htmlFor:n,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[r,a&&h(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),h(`textarea`,{id:n,name:n,placeholder:i,required:a,defaultValue:o,rows:s,onKeyDown:B,onKeyUp:B,className:e(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}function me({element:t}){let{name:n=`date`,label:r=`Date`,required:i,defaultValue:a,min:o,max:s}=t.props??{};return g(`div`,{className:`space-y-1.5`,children:[g(`label`,{htmlFor:n,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,children:[r,i&&h(`span`,{className:`ml-1 text-destructive`,children:`*`})]}),h(`input`,{type:`date`,id:n,name:n,required:i,defaultValue:a,min:o,max:s,onKeyDown:B,onKeyUp:B,className:e(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`)})]})}const he={Form:de,TextField:fe,TextArea:pe,DateField:me},ge=p.object({formId:p.string(),data:p.record(p.string(),p.string())}),_e=p.object({formId:p.string()});function ve({ui:e,context:r,onSubmit:i,onCancel:a,registry:o=he}){let c=s(e=>{let t=ge.safeParse(e);t.success?i(t.data.formId,t.data.data):console.warn(`Form submit: Invalid params`,t.error.flatten())},[i]),l=s(e=>{let t=_e.safeParse(e);t.success?a?.(t.data.formId):console.warn(`Form cancel: Invalid params`,t.error.flatten())},[a]);return h(t,{registry:o,initialData:r,actionHandlers:u(()=>({submit:c,cancel:l}),[c,l]),children:h(n,{tree:e,registry:o})})}function ye({from:t,...n}){return h(`div`,{"data-slot":`message`,"data-from":t,className:e(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`),...n})}function be({children:t,style:n,...r}){return h(`div`,{"data-slot":`message-content`,className:e(`flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-foreground`),style:{borderRadius:`var(--cmdk-radius, 0.5rem)`,...n},...r,children:t})}const xe=o(function(e){return h(_,{"data-slot":`message-response`,className:`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,...e})},(e,t)=>e.children===t.children);function Se({...e}){return h(T.Root,{"data-slot":`collapsible`,...e})}function Ce({...e}){return h(T.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...e})}function we({...e}){return h(T.CollapsibleContent,{"data-slot":`collapsible-content`,...e})}function Te({children:e,...t}){return h(`div`,{"data-slot":`task-item-file`,className:`inline-flex items-center gap-1 rounded-md border bg-secondary px-1.5 py-0.5 text-xs text-foreground`,...t,children:e})}function Ee({children:e,...t}){return h(`div`,{"data-slot":`task-item`,className:`text-sm text-muted-foreground`,...t,children:e})}function De({defaultOpen:e=!0,...t}){return h(Se,{"data-slot":`task`,defaultOpen:e,...t})}function Oe({children:e,title:t,icon:n,...r}){return h(Ce,{asChild:!0,className:`group`,...r,children:e??g(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[n??h(C,{className:`size-4`}),h(`p`,{className:`text-sm`,children:t}),h(y,{className:`size-4 transition-transform group-data-[state=open]:rotate-180`})]})})}function ke({children:t,...n}){return h(we,{"data-slot":`task-content`,className:e(`text-popover-foreground outline-none`,`data-[state=closed]:animate-out data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2`),...n,children:h(`div`,{className:`mt-4 space-y-2 border-l-2 border-muted pl-4`,children:t})})}const Ae=p.object({name:p.string(),options:p.record(p.string(),p.unknown()).optional()}),je=p.object({actions:p.array(Ae).optional()}),Me=p.object({id:p.string(),approved:p.boolean().optional()}),Ne=p.object({type:p.string(),props:p.record(p.string(),p.unknown()).default({}),children:p.array(p.string()).optional(),parentKey:p.string().nullable().optional()}),Pe=p.object({ui:p.object({elements:p.record(p.string(),Ne)}),context:p.record(p.string(),p.unknown()).optional()});function Fe(e){return e.name}function Ie({messages:e,sendMessage:t,addToolApprovalResponse:n,getActionDescription:r=Fe}){let i=e.filter(e=>e.role===`user`||e.role===`assistant`);return h(m,{children:i.map((e,a)=>{let o=a===i.length-1;return h(ye,{from:e.role,children:h(be,{children:e.parts.map((i,a)=>h(Le,{part:i,messageId:e.id,partIndex:a,isLastMessage:o,sendMessage:t,addToolApprovalResponse:n,getActionDescription:r},`${e.id}-${a}`))})},e.id)})})}function Le({part:e,messageId:t,partIndex:n,isLastMessage:r,sendMessage:i,addToolApprovalResponse:a,getActionDescription:o}){if(e.type===`text`)return h(xe,{children:e.text});if(e.type===`tool-performActions`){let r=`input`in e?e.input:void 0,i=je.safeParse(r),s=i.success?i.data.actions??[]:[];if(s.length===0)return null;let c=s.length,l=`state`in e?e.state:void 0,u=`approval`in e?e.approval:void 0,d=Me.safeParse(u),f=d.success?d.data:void 0;return f&&l?g(ie,{state:l,approval:f,children:[h(ae,{children:c===1?`Confirm action`:`Confirm ${c} actions`}),h(oe,{children:h(`ul`,{className:`list-disc list-inside text-sm text-muted-foreground mt-2`,children:s.map((e,r)=>h(`li`,{children:o(e)},`${t}-${n}-${r}`))})}),h(se,{children:h(`span`,{className:`text-sm text-muted-foreground`,children:c===1?`Action approved`:`${c} actions approved`})}),h(ce,{children:h(`span`,{className:`text-sm text-muted-foreground`,children:c===1?`Action cancelled`:`${c} actions cancelled`})}),g(le,{children:[h(ue,{variant:`outline`,onClick:()=>a({id:f.id,approved:!1}),children:`Deny`}),h(ue,{onClick:()=>a({id:f.id,approved:!0}),children:`Approve`})]})]}):g(De,{defaultOpen:!1,children:[h(Oe,{title:c===1?`Performing 1 action`:`Performing ${c} actions`}),h(ke,{children:s.map((e,r)=>h(Ee,{children:o(e)},`${t}-${n}-${r}`))})]})}return e.type===`tool-renderUI`&&r&&(`state`in e?e.state:void 0)===`output-available`&&`output`in e?h(Re,{output:e.output,sendMessage:i}):null}function Re({output:e,sendMessage:t}){let n=i.useMemo(()=>{let t=Pe.safeParse(e);return t.success?{ui:r(Object.entries(t.data.ui.elements).map(([e,t])=>({...t,key:e}))),context:t.data.context}:null},[e]),a=i.useCallback((e,n)=>{t({text:`[Form:${e}] ${JSON.stringify(n)}`})},[t]),o=i.useCallback(e=>{t({text:`[Form:${e}] cancelled`})},[t]);return n?h(ve,{ui:n.ui,context:n.context,onSubmit:a,onCancel:o}):null}const ze=E(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Be({className:t,variant:n=`default`,size:r=`default`,asChild:i=!1,...a}){return h(i?O.Root:`button`,{"data-slot":`button`,"data-variant":n,"data-size":r,className:e(ze({variant:n,size:r,className:t})),...a})}function Ve({children:t,className:n,...r}){let a=i.useRef(null);return i.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[t]),h(`div`,{ref:a,"data-slot":`chat-message-list`,className:e(`flex flex-col overflow-y-auto scroll-smooth`,n),...r,children:t})}function He({text:t=`AI is thinking...`,className:n,...r}){return g(`div`,{"data-slot":`chat-loading`,className:e(`flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground`,n),...r,children:[h(x,{className:`size-4 animate-spin`}),h(`span`,{children:t})]})}function Ue({title:t=`Start a conversation`,description:n=`Ask a question or describe what you need help with.`,className:r,...i}){return h(`div`,{"data-slot":`chat-empty`,className:e(`flex flex-col items-center justify-center gap-2 py-8 text-center`,r),...i,children:g(`div`,{className:`space-y-1`,children:[h(`h3`,{className:`text-sm font-medium`,children:t}),h(`p`,{className:`text-xs text-muted-foreground`,children:n})]})})}var We=1,Ge=.9,Ke=.8,qe=.17,Je=.1,Ye=.999,Xe=.9999,Ze=.99,Qe=/[\\\/_+.#"@\[\(\{&]/,$e=/[\\\/_+.#"@\[\(\{&]/g,et=/[\s-]/,tt=/[\s-]/g;function nt(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?We:Ze;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=nt(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=We:Qe.test(e.charAt(l-1))?(d*=Ke,p=e.slice(i,l-1).match($e),p&&i>0&&(d*=Ye**+p.length)):et.test(e.charAt(l-1))?(d*=Ge,m=e.slice(i,l-1).match(tt),m&&i>0&&(d*=Ye**+m.length)):(d*=qe,i>0&&(d*=Ye**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Xe)),(d<Je&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=nt(e,t,n,r,l+1,a+2,o),f*Je>d&&(d=f*Je)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function rt(e){return e.toLowerCase().replace(tt,` `)}function it(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,nt(e,t,rt(e),rt(t),0,0,{})}const V=`[cmdk-group=""]`,at=`[cmdk-group-items=""]`,ot=`[cmdk-item=""]`,st=`${ot}:not([aria-disabled="true"])`,ct=`cmdk-item-select`,H=`data-value`,lt=(e,t,n)=>it(e,t,n),ut=i.createContext(void 0),U=()=>{let e=i.useContext(ut);if(!e)throw Error(`CommandContext is missing a provider`);return e},dt=i.createContext(void 0),ft=()=>{let e=i.useContext(dt);if(!e)throw Error(`StoreContext is missing a provider`);return e},pt=i.createContext(void 0),mt=i.forwardRef((e,t)=>{let n=K(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=K(()=>new Set),a=K(()=>new Map),o=K(()=>new Map),s=K(()=>new Set),c=Tt(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:_,disablePointerSelection:v=!1,vimBindings:y=!0,...b}=e,x=j(),S=j(),C=j(),w=i.useRef(null),T=Dt();G(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,E.emit()}},[d]),G(()=>{T(6,ee)},[]);let E=i.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)N(),k(),T(1,M);else if(e===`value`){let e=document.activeElement;if(e instanceof HTMLElement&&(e.hasAttribute(`cmdk-input`)||e.hasAttribute(`cmdk-root`))){let e=document.getElementById(C);e?e.focus():document.getElementById(x)?.focus()}if(T(7,()=>{n.current.selectedItemId=P()?.id,E.emit()}),r||T(5,ee),c.current?.value!==void 0){let e=t??``;c.current.onValueChange?.(e);return}}E.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),D=i.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,O(t,r)),T(2,()=>{k(),E.emit()}))},item:(e,t)=>{if(r.current.add(e),t)if(!a.current.has(t))a.current.set(t,new Set([e]));else{let n=a.current.get(t);n?n.add(e):a.current.set(t,new Set([e]))}return T(3,()=>{N(),k(),n.current.value||M(),E.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=P();T(4,()=>{N(),t?.getAttribute(`id`)===e&&M(),E.emit()})}},group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>c.current.shouldFilter!==!1,label:l||e[`aria-label`]||`Command Menu`,getDisablePointerSelection:()=>!!c.current.disablePointerSelection,listId:x,inputId:C,labelId:S,listInnerRef:w}),[]);function O(e,t){let r=c.current?.filter??lt;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=a.current.get(n);if(!r){t.push([n,0]);return}let i=0;r.forEach(t=>{let n=e.get(t)??0;i=Math.max(n,i)}),t.push([n,i])});let r=w.current;F().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i??``)??0)-(e.get(r??``)??0)}).forEach(e=>{let t=e.closest(at);if(t){let n=e.parentElement===t?e:e.closest(`${at} > *`);n&&t.appendChild(n)}else{if(!r)return;let t=e.parentElement===r?e:e.closest(`${at} > *`);t&&r.appendChild(t)}}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=w.current?.querySelector(`${V}[cmdk-group-id="${e[0]}"]`);t?.parentElement&&t.parentElement.appendChild(t)});let i=new Set(t.map(e=>e[0]));w.current?.querySelectorAll(`${V}[cmdk-group-id]`)?.forEach(e=>{let t=e.getAttribute(`cmdk-group-id`);t&&!i.has(t)&&e.parentElement?.appendChild(e)});let o=w.current?.closest(`[cmdk-list]`);o&&(o.scrollTop=0)}function M(){let e=F().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(H);E.setState(`value`,e??``)}function N(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=O(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of a.current)for(let r of t)if((n.current.filtered.items.get(r)??0)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ee(){let e=P();e&&(e.parentElement?.firstChild===e&&e.closest(V)?.querySelector(`[cmdk-group-heading=""]`)?.scrollIntoView({block:`nearest`}),e.scrollIntoView({block:`nearest`}))}function P(){return w.current?.querySelector(`${ot}[aria-selected="true"]`)}function F(){return Array.from(w.current?.querySelectorAll(st)||[])}function I(e){let t=F()[e];t&&E.setState(`value`,t.getAttribute(H)??``)}function L(e){let t=P(),n=F(),r=n.findIndex(e=>e===t),i=n[r+e];c.current?.loop&&(i=r+e<0?n[n.length-1]:r+e===n.length?n[0]:n[r+e]),i&&E.setState(`value`,i.getAttribute(H)??``)}function te(e){let t=P()?.closest(V),n;for(;t&&!n;)t=e>0?Ct(t,V):wt(t,V),n=t?.querySelector(st);n?E.setState(`value`,n.getAttribute(H)??``):L(e)}let ne=()=>I(F().length-1),re=e=>{e.preventDefault(),e.metaKey?ne():e.altKey?te(1):L(1)},R=e=>{e.preventDefault(),e.metaKey?I(0):e.altKey?te(-1):L(-1)};return g(A.div,{ref:t,tabIndex:-1,...b,"cmdk-root":``,onKeyDown:e=>{b.onKeyDown?.(e);let t=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||t))switch(e.key){case`n`:case`j`:y&&e.ctrlKey&&re(e);break;case`ArrowDown`:re(e);break;case`p`:case`k`:y&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),I(0);break;case`End`:e.preventDefault(),ne();break;case`Enter`:{e.preventDefault();let t=P();if(t){let e=new Event(ct);t.dispatchEvent(e)}}}},children:[h(`label`,{"cmdk-label":``,htmlFor:D.inputId,id:D.labelId,style:At,children:l}),kt(e,e=>h(dt.Provider,{value:E,children:h(ut.Provider,{value:D,children:e})}))]})}),ht=i.forwardRef((e,t)=>{let n=j(),r=i.useRef(null),a=i.useContext(pt),o=U(),s=Tt(e),c=s.current?.forceMount??a?.forceMount;G(()=>o.item(n,a?.id),[c]);let l=Et(n,r,[e.value,e.children,r],e.keywords),u=ft(),d=q(e=>e.value&&e.value===l.current),f=q(e=>c||o.filter()===!1?!0:e.search?(e.filtered.items.get(n)??0)>0:!0);i.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(ct,p),()=>t.removeEventListener(ct,p)},[f,e.onSelect,e.disabled]);function p(){m(),s.current.onSelect?.(l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:g,value:_,onSelect:v,forceMount:y,keywords:b,...x}=e;return h(A.div,{ref:M(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!g,"aria-selected":!!d,"data-disabled":!!g,"data-selected":!!d,onPointerMove:g||o.getDisablePointerSelection()?void 0:m,onClick:g?void 0:p,children:e.children})}),gt=i.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=j(),c=i.useRef(null),l=i.useRef(null),u=j(),d=U(),f=q(e=>a||d.filter()===!1?!0:e.search?e.filtered.groups.has(s):!0);G(()=>d.group(s),[]),Et(s,c,[e.value,e.heading,l]);let p=i.useMemo(()=>({id:s,forceMount:a}),[a]);return g(A.div,{ref:M(c,t),...o,"cmdk-group":``,"cmdk-group-id":s,role:`presentation`,hidden:f?void 0:!0,children:[n&&h(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u,children:n}),kt(e,e=>h(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0,children:h(pt.Provider,{value:p,children:e})}))]})}),_t=i.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=i.useRef(null),o=q(e=>!e.search);return!n&&!o?null:h(A.div,{ref:M(a,t),...r,"cmdk-separator":``,role:`separator`})}),vt=i.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=ft(),s=q(e=>e.search),c=q(e=>e.selectedItemId),l=U();return i.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),h(A.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:a?e.value:s,onChange:e=>{a||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),yt=i.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...a}=e,o=i.useRef(null),s=i.useRef(null),c=q(e=>e.selectedItemId),l=U();return i.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n=null,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{n!==null&&cancelAnimationFrame(n),r.unobserve(e)}}},[]),h(A.div,{ref:M(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId,children:kt(e,e=>h(`div`,{ref:M(s,l.listInnerRef),"cmdk-list-sizer":``,children:e}))})}),bt=i.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return h(k.Root,{open:n,onOpenChange:r,children:g(k.Portal,{container:o,children:[h(k.Overlay,{"cmdk-overlay":``,className:i}),h(k.Content,{"aria-label":e.label,"cmdk-dialog":``,className:a,children:h(mt,{ref:t,...s})})]})})}),xt=i.forwardRef((e,t)=>q(e=>e.filtered.count===0)?h(A.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),St=i.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return h(A.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i,children:kt(e,e=>h(`div`,{"aria-hidden":!0,children:e}))})}),W=Object.assign(mt,{List:yt,Item:ht,Input:vt,Group:gt,Separator:_t,Dialog:bt,Empty:xt,Loading:St});function Ct(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wt(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Tt(e){let t=i.useRef(e);return G(()=>{t.current=e}),t}const G=typeof window>`u`?i.useEffect:i.useLayoutEffect;function K(e){let t=i.useRef(void 0);return t.current===void 0&&(t.current=e()),t}function q(e){let t=ft(),n=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,n,n)}function Et(e,t,n,r=[]){let a=i.useRef(``),o=U();return G(()=>{let i=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&e&&`current`in e)return e.current?e.current.textContent?.trim():a.current}})()??``,s=r.map(e=>e.trim());o.value(e,i,s),t.current?.setAttribute(H,i),a.current=i}),a}const Dt=()=>{let[e,t]=i.useState(),n=K(()=>new Map);return G(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ot(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function kt({asChild:e,children:t},n){if(e&&i.isValidElement(t)){let e=t;return i.cloneElement(Ot(e),{ref:e.ref},n(e.props.children))}return n(t)}const At={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function jt(){return crypto.randomUUID()}function Mt(e){let t=e.find(e=>e.role===`user`);if(!t)return`New conversation`;let n=t.parts?.filter(e=>e.type===`text`).map(e=>e.text).join(` `)||`New conversation`;return n.length>50?n.slice(0,50)+`...`:n}function Nt(e){return typeof e!=`object`||!e||!(`version`in e)||e.version!==1||!(`conversations`in e)||!Array.isArray(e.conversations)?null:e}function Pt({storageKey:e=`cmdk-chat-history`,maxConversations:t=50,messages:n,setMessages:r}){let[i,a]=f([]),[o,c]=f(null),[p,m]=f(!1),h=d(n);h.current=n;let g=d(r);g.current=r;let _=d(i);_.current=i;let v=d(o);v.current=o,l(()=>{try{let t=localStorage.getItem(e);if(t){let n=Nt(JSON.parse(t));n?a(n.conversations):(console.warn(`Chat history: stored data failed validation. Discarding.`),localStorage.removeItem(e))}}catch(e){console.error(`Failed to load chat history:`,e)}finally{m(!0)}},[e]),l(()=>{if(p)try{let t={version:1,conversations:i};localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(`Failed to save chat history:`,e)}},[i,e,p]);let y=s(()=>{let e=h.current,n=v.current;!n||e.length===0||a(r=>{let i=Date.now();return r.find(e=>e.id===n)?r.map(t=>t.id===n?{...t,messages:e,title:Mt(e),updatedAt:i}:t):[{id:n,title:Mt(e),messages:e,createdAt:i,updatedAt:i},...r].slice(0,t)})},[t]),b=s(()=>{v.current&&h.current.length>0&&y(),g.current?.([]),c(jt())},[y]),x=s(e=>{v.current&&h.current.length>0&&y();let t=_.current.find(t=>t.id===e);t&&(g.current?.(t.messages),c(e))},[y]);return u(()=>({conversations:i,currentConversationId:o,startNewChat:b,loadConversation:x,saveCurrentConversation:y}),[i,o,b,x,y])}let J=null,Y=null;function Ft(){try{return typeof process<`u`&&process.env?.BETTER_CMDK_TELEMETRY_DISABLED===`1`}catch{return!1}}function It(e,t){return delete e.user,delete e.server_name,e.request&&(delete e.request.cookies,delete e.request.headers,delete e.request.env,delete e.request.data),e.breadcrumbs=[],e}function Lt(){typeof window>`u`||J===null&&(Ft()||(J=new P({dsn:`https://7d9fc7e14e8769805297d46569e33c05@o4510706172755968.ingest.us.sentry.io/4510846832017408`,transport:ne,stackParser:L,integrations:[I(),te()],beforeSend:It,sendDefaultPii:!1,tracesSampleRate:1}),Y=new F,Y.setClient(J),J.init()))}function Rt(e,t){!Y||!J||(t?Y.captureException(e,{captureContext:e=>(e.setExtras(t),e)}):Y.captureException(e))}function zt(e){try{let t=new Uint8Array(e/2);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}catch{let t=``;for(let n=0;n<e;n++)t+=Math.floor(Math.random()*16).toString(16);return t}}function Bt(e,t,n){if(!Y||!J)return n();let r=Date.now()/1e3,i=zt(32),a=zt(16),o=`ok`,s=()=>{let n=Date.now()/1e3;Y.captureEvent({type:`transaction`,transaction:e,start_timestamp:r,timestamp:n,contexts:{trace:{trace_id:i,span_id:a,op:t,status:o}}})};try{let e=n();return e instanceof Promise?e.then(e=>(s(),e),e=>{throw o=`internal_error`,s(),e}):(s(),e)}catch(e){throw o=`internal_error`,s(),e}}const Vt=i.createContext(null),Ht=[];function Ut({children:e,chatEndpoint:t=null,chat:n,onModeChange:r,onOpenChange:a,historyStorageKey:o,maxConversations:s}){let[c,l]=i.useState(`command`),[u,d]=i.useState(``),[f,p]=i.useState(`idle`),[m,g]=i.useState(null),_=i.useRef(n);_.current=n;let v=!!n;i.useEffect(()=>{Lt()},[]);let y=i.useMemo(()=>{if(!(v||!t))return new ee({api:t})},[t,v]),b=N(i.useMemo(()=>y?{transport:y,onError:e=>{Rt(e,{source:`internalChat.onError`}),p(`error`),g(e)}}:{},[y])),x=n?.status,S=n?.error??null;i.useEffect(()=>{if(v)x===`ready`?p(`idle`):x===`streaming`?p(`streaming`):x===`submitted`?p(`submitted`):x===`error`&&p(`error`),g(S);else{let e=b.status;e===`streaming`?p(`streaming`):e===`submitted`?p(`submitted`):e===`error`?p(`error`):e===`ready`&&p(`idle`)}},[x,S,b.status,v]);let C=i.useCallback(e=>{l(e),r?.(e)},[r]),w=!!(n||t),T=i.useCallback(e=>{w&&Bt(`switchToChat`,`ui.action`,()=>{C(`chat`),e&&d(e)})},[w,C]),E=i.useCallback(()=>{C(`command`),d(``),p(`idle`),g(null)},[C]),D=i.useCallback(async e=>{e.trim()&&await Bt(`sendMessage`,`function`,async()=>{try{let t=_.current;if(t){d(``),t.sendMessage({text:e.trim()});return}if(!y)return;p(`submitted`),d(``),await b.sendMessage({text:e.trim()})}catch(e){throw Rt(e,{source:`sendMessage`}),e}})},[b,y]),O=f===`submitted`||f===`streaming`,k=n?n.messages:b.messages??Ht,A=n?.setMessages??b.setMessages,j=n?.addToolApprovalResponse,M=n?.agenticActions,P=Pt({storageKey:o,maxConversations:s,messages:k,setMessages:A}),F=i.useCallback(e=>{P.loadConversation(e),C(`chat`)},[P.loadConversation,C]),I=i.useRef(f);i.useEffect(()=>{let e=I.current;I.current=f,(e===`streaming`||e===`submitted`)&&f===`idle`&&k.length>0&&P.saveCurrentConversation()},[f,k.length,P.saveCurrentConversation]);let L=i.useCallback(()=>{a?.(!1)},[a]),te=i.useMemo(()=>({mode:c,setMode:C,inputValue:u,setInputValue:d,chatEndpoint:t,status:f,error:m,switchToChat:T,switchToCommand:E,messages:k,sendMessage:D,isLoading:O,isEnabled:w,addToolApprovalResponse:j,agenticActions:M,requestClose:L,conversations:P.conversations,currentConversationId:P.currentConversationId,startNewChat:P.startNewChat,loadConversation:F}),[c,C,u,t,f,m,T,E,k,D,O,w,j,M,L,P.conversations,P.currentConversationId,P.startNewChat,F]);return h(Vt.Provider,{value:te,children:e})}function X(){let e=i.useContext(Vt);if(!e)throw Error(`useCommandMenuContext must be used within a CommandMenuProvider`);return e}function Wt({...e}){return h(D.Root,{"data-slot":`dialog`,...e})}function Gt({...e}){return h(D.Trigger,{"data-slot":`dialog-trigger`,...e})}function Kt({...e}){return h(D.Portal,{"data-slot":`dialog-portal`,...e})}function qt({...e}){return h(D.Close,{"data-slot":`dialog-close`,...e})}function Jt({className:t,style:n,...r}){return h(D.Overlay,{"data-slot":`dialog-overlay`,className:e(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,t),style:{position:`fixed`,inset:0,zIndex:50,backgroundColor:`rgb(0 0 0 / 0.5)`,...n},...r})}function Yt({className:t,children:n,showCloseButton:r=!0,...i}){return h(Kt,{"data-slot":`dialog-portal`,children:g(`div`,{className:`bcmdk-root`,children:[h(Jt,{}),g(D.Content,{"data-slot":`dialog-content`,className:e(`bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg`,t),...i,children:[n,r&&g(D.Close,{"data-slot":`dialog-close`,className:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[h(w,{}),h(`span`,{className:`sr-only`,children:`Close`})]})]})]})})}function Xt({className:t,...n}){return h(`div`,{"data-slot":`dialog-header`,className:e(`flex flex-col gap-2 text-center sm:text-left`,t),...n})}function Zt({className:t,showCloseButton:n=!1,children:r,...i}){return g(`div`,{"data-slot":`dialog-footer`,className:e(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,t),...i,children:[r,n&&h(D.Close,{asChild:!0,children:h(Be,{variant:`outline`,children:`Close`})})]})}function Qt({className:t,...n}){return h(D.Title,{"data-slot":`dialog-title`,className:e(`text-lg leading-none font-semibold`,t),...n})}function $t({className:t,...n}){return h(D.Description,{"data-slot":`dialog-description`,className:e(`text-muted-foreground text-sm`,t),...n})}function en({className:t,...n}){return h(`kbd`,{"data-slot":`kbd`,className:e(`bg-muted text-muted-foreground pointer-events-none inline-grid w-fit min-w-5 place-items-center gap-1 rounded px-1.5 py-0.5 font-sans text-xs font-medium select-none leading-[1]`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,t),...n})}function tn({className:t,...n}){return h(`kbd`,{"data-slot":`kbd-group`,className:e(`inline-flex items-center gap-1`,t),...n})}function nn({className:t,...n}){return h(W,{"data-slot":`command`,className:e(`bcmdk-root text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n})}function rn({className:t,children:n,...r}){return h(Kt,{"data-slot":`dialog-portal`,children:h(`div`,{className:`bcmdk-root`,children:h(D.Content,{"data-slot":`dialog-content`,className:e(`backdrop-blur-xl fixed top-1/3 left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] overflow-hidden rounded-xl border-none p-2 shadow-2xl ring-0 duration-200 outline-none sm:max-w-lg`,t),style:{backgroundColor:`color-mix(in oklch, oklch(var(--bcmdk-background)) 95%, transparent)`},...r,children:n})})})}function an({className:t,...n}){return h(W.Empty,{"data-slot":`command-empty`,className:e(`text-muted-foreground py-6 text-center text-sm`,t),...n})}function Z({className:t,ref:n,...r}){let a=i.useCallback(e=>{if(e){let t=e.querySelector(`[cmdk-group-heading]`);t instanceof HTMLElement&&(t.style.position=`sticky`,t.style.top=`0`,t.style.zIndex=`10`,t.style.width=`fit-content`,t.style.backdropFilter=`blur(24px)`,t.style.setProperty(`-webkit-backdrop-filter`,`blur(24px)`),t.style.backgroundColor=`color-mix(in oklch, oklch(var(--bcmdk-background)) 95%, transparent)`,t.style.borderRadius=`6px`,t.style.setProperty(`padding-top`,`4px`,`important`),t.style.setProperty(`padding-bottom`,`4px`,`important`))}typeof n==`function`?n(e):n&&(n.current=e)},[n]);return h(W.Group,{ref:a,"data-slot":`command-group`,className:e(`text-foreground !p-0 [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:scroll-mt-16 [&_[cmdk-group-heading]]:pt-0! [&_[cmdk-group-heading]]:!p-3 [&_[cmdk-group-heading]]:!pb-1 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium`,t),...r})}function on({className:t,...n}){return h(W.Separator,{"data-slot":`command-separator`,className:e(`bg-border -mx-1 h-px`,t),...n})}function sn({className:t,style:n,onSelect:r,closeOnSelect:a=!0,...o}){let s=i.useContext(Vt),c=i.useCallback(e=>{r?.(e),a&&s?.requestClose?.()},[r,a,s]);return h(W.Item,{"data-slot":`command-item`,className:e(`data-[selected=true]:border-input data-[selected=true]:bg-input/50 [&_svg:not([class*='text-'])]:text-muted-foreground relative flex h-[var(--cmdk-item-height,2.25rem)] cursor-default items-center gap-2 border border-transparent px-3 text-sm font-medium outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),style:{borderRadius:`var(--cmdk-radius, 0.375rem)`,...n},onSelect:c,...o})}function cn({className:t,children:n,...r}){let i=typeof n==`string`?[...n]:null;return h(`span`,{"data-slot":`command-shortcut`,className:e(`ml-auto flex items-center gap-1`,t),...r,children:i?i.map((e,t)=>h(en,{children:e},t)):n})}var ln=class extends i.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Rt(e,{componentStack:t.componentStack??void 0})}render(){return this.state.hasError?null:this.props.children}};function un(e){return e instanceof Element?!!e.closest(`input, textarea, select, button, a, [contenteditable='true'], [contenteditable=''], [data-cmdk-mobile-gesture-ignore]`):!1}function dn(e,t,n,r,i,a){let o=window.innerWidth,s=window.innerHeight,c=o*n,l=o-a,u=Math.max(0,l-c),d=s*(1-r),f=s-i;return e>=u&&e<=l&&t>=d&&t<=f}function fn({enabled:e,open:t,holdMs:n,swipeUpPx:r,onTrigger:a,movementTolerancePx:o=10,horizontalCancelPx:s=24,activationZoneWidthPercent:c=.4,activationZoneHeightPercent:l=.4,bottomExclusionPx:u=8,rightExclusionPx:d=0}){let[f,p]=i.useState(!1),m=i.useRef(null),h=i.useRef(0),g=i.useRef(a),_=i.useRef({applied:!1,touchCallout:``,webkitUserSelect:``,userSelect:``});i.useEffect(()=>{g.current=a},[a]);let v=i.useCallback(()=>{if(typeof document>`u`||_.current.applied)return;let{style:e}=document.documentElement;_.current={applied:!0,touchCallout:e.getPropertyValue(`-webkit-touch-callout`),webkitUserSelect:e.getPropertyValue(`-webkit-user-select`),userSelect:e.getPropertyValue(`user-select`)},e.setProperty(`-webkit-touch-callout`,`none`),e.setProperty(`-webkit-user-select`,`none`),e.setProperty(`user-select`,`none`)},[]),y=i.useCallback(()=>{if(typeof document>`u`)return;let e=_.current;if(!e.applied)return;let{style:t}=document.documentElement;e.touchCallout?t.setProperty(`-webkit-touch-callout`,e.touchCallout):t.removeProperty(`-webkit-touch-callout`),e.webkitUserSelect?t.setProperty(`-webkit-user-select`,e.webkitUserSelect):t.removeProperty(`-webkit-user-select`),e.userSelect?t.setProperty(`user-select`,e.userSelect):t.removeProperty(`user-select`),_.current={applied:!1,touchCallout:``,webkitUserSelect:``,userSelect:``}},[]),b=i.useCallback(()=>{let e=m.current;e?.timer!=null&&window.clearTimeout(e.timer),m.current=null,p(!1),y()},[y]);return i.useEffect(()=>{if(!e||t||typeof window>`u`){b();return}let i=e=>{if(e.touches.length!==1||un(e.target))return;let t=e.touches[0];if(!t||!dn(t.clientX,t.clientY,c,l,u,d))return;h.current=Date.now(),v();let r=window.setTimeout(()=>{let e=m.current;e&&(e.armed=!0,p(!0),typeof navigator<`u`&&`vibrate`in navigator&&navigator.vibrate(6))},n);m.current={startX:t.clientX,startY:t.clientY,armed:!1,timer:r}},a=e=>{if(e.touches.length!==1){b();return}let t=m.current;if(!t)return;let n=e.touches[0];if(!n)return;let i=n.clientX-t.startX,a=n.clientY-t.startY;if(!t.armed){Math.hypot(i,a)>o&&b();return}if(e.cancelable&&e.preventDefault(),Math.abs(i)>s){b();return}a<=-r&&(b(),typeof navigator<`u`&&`vibrate`in navigator&&navigator.vibrate(14),g.current())},f=()=>{b()},_=()=>{b()},y=e=>{let t=m.current!==null,r=Date.now()-h.current<n+1200,i=dn(e.clientX,e.clientY,c,l,u,d);if(t||r&&i){if(!t&&un(e.target))return;e.preventDefault(),e.stopPropagation()}};return document.addEventListener(`touchstart`,i,{passive:!1}),document.addEventListener(`touchmove`,a,{passive:!1}),document.addEventListener(`touchend`,f,{passive:!0}),document.addEventListener(`touchcancel`,_,{passive:!0}),document.addEventListener(`contextmenu`,y,!0),()=>{document.removeEventListener(`touchstart`,i),document.removeEventListener(`touchmove`,a),document.removeEventListener(`touchend`,f),document.removeEventListener(`touchcancel`,_),document.removeEventListener(`contextmenu`,y,!0),b()}},[e,t,n,r,o,s,c,l,u,d,b,v]),{showHint:f}}function pn(e){let[t,n]=i.useState(0);return i.useEffect(()=>{if(!e||typeof window>`u`){n(0);return}let t=window.visualViewport;if(!t){n(0);return}let r=()=>{let e=Math.max(0,Math.round(window.innerHeight-t.height-t.offsetTop));n(t=>t===e?t:e)};return r(),t.addEventListener(`resize`,r),t.addEventListener(`scroll`,r),window.addEventListener(`orientationchange`,r),()=>{t.removeEventListener(`resize`,r),t.removeEventListener(`scroll`,r),window.removeEventListener(`orientationchange`,r)}},[e]),t}const mn=e=>{},hn={none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,xl:`rounded-xl`},gn={none:`0px`,sm:`0.125rem`,md:`0.375rem`,lg:`0.5rem`,xl:`0.75rem`},_n=i.createContext({isMobile:!1,layout:`keyboard-last`,keyboardInset:0,showQuickActions:!1,quickActionsCount:4});function Q(){return i.useContext(_n)}function vn(e){let t=e?.gesture!==!1,n=e?.gesture===!1?void 0:e?.gesture;return{enabled:e?.enabled??!0,breakpoint:e?.breakpoint??900,layout:e?.layout??`keyboard-last`,gesture:{enabled:t?n?.enabled??!0:!1,holdMs:t?n?.holdMs??350:350,swipeUpPx:t?n?.swipeUpPx??56:56},showQuickActions:e?.showQuickActions??!0,quickActionsCount:e?.quickActionsCount??4}}function yn(e,t){let[n,r]=i.useState(!1);return i.useEffect(()=>{if(!t||typeof window>`u`){r(!1);return}let n=window.matchMedia(`(max-width: ${e}px)`),i=window.matchMedia(`(pointer: coarse)`),a=()=>{r(n.matches||i.matches)};return a(),n.addEventListener(`change`,a),i.addEventListener(`change`,a),window.addEventListener(`orientationchange`,a),()=>{n.removeEventListener(`change`,a),i.removeEventListener(`change`,a),window.removeEventListener(`orientationchange`,a)}},[e,t]),n}function bn(e){let t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function xn({className:t,children:n,corners:r=`xl`,borderColor:a,isMobile:o,keyboardInset:s,onRequestClose:c,...l}){let u=i.useRef(null),d=i.useCallback(()=>{if(typeof document>`u`)return;let e=document.activeElement;if(e instanceof HTMLElement&&e.hasAttribute(`cmdk-input`)){e.blur();return}c?.()},[c]),f=e=>{if(e.touches.length!==1)return;let t=e.touches[0];t&&(u.current={x:t.clientX,y:t.clientY})},p=e=>{let t=u.current;if(u.current=null,!t||e.changedTouches.length===0)return;let n=e.changedTouches[0];if(!n)return;let r=n.clientX-t.x;n.clientY-t.y>56&&Math.abs(r)<42&&d()};return h(Kt,{"data-slot":`dialog-portal`,children:g(`div`,{className:`bcmdk-root`,children:[o&&h(D.Overlay,{className:`fixed inset-0 z-40 bg-black/35 backdrop-blur-[1px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,style:{position:`fixed`,inset:0,zIndex:40,backgroundColor:`rgb(0 0 0 / 0.35)`,backdropFilter:`blur(1px)`,WebkitBackdropFilter:`blur(1px)`}}),g(`div`,{className:e(`fixed z-50 w-full max-w-[calc(100%-2rem)]`,o?`inset-x-0 bottom-0 max-w-none px-0`:`top-1/3 left-[50%] translate-x-[-50%] translate-y-[-50%]`),style:o?{left:0,right:0,bottom:0,maxWidth:`none`,paddingLeft:0,paddingRight:0}:{maxWidth:`45vw`},children:[g(D.Content,{"data-slot":`dialog-content`,className:e(`backdrop-blur-xl flex flex-col w-full overflow-hidden border border-input p-0 ring-0 outline-none`,o?`border-x-0 border-b-0 will-change-transform 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]:slide-out-to-bottom-8 data-[state=open]:slide-in-from-bottom-8 data-[state=open]:duration-300 data-[state=closed]:duration-200`:hn[r],t),style:{"--cmdk-radius":gn[r],"--cmdk-mobile-keyboard-inset":`${s??0}px`,"--cmdk-mobile-sheet-top-inset":`max(11rem, calc(env(safe-area-inset-top) + 8rem))`,maxHeight:o?`calc(100dvh - var(--cmdk-mobile-sheet-top-inset))`:`45vh`,height:o?`calc(100dvh - var(--cmdk-mobile-sheet-top-inset))`:void 0,...o?{borderTopLeftRadius:gn[r],borderTopRightRadius:gn[r],borderBottomLeftRadius:`0px`,borderBottomRightRadius:`0px`}:{},backgroundColor:`color-mix(in oklch, oklch(var(--bcmdk-background)) 95%, transparent)`,boxShadow:`4px 4px 12px -2px rgba(0,0,0,0.12), -4px 4px 12px -2px rgba(0,0,0,0.12), 0 8px 16px -4px rgba(0,0,0,0.1)`,...a?{"--tw-ring-color":a}:{}},...l,children:[o&&h(`div`,{className:`flex justify-center py-2`,"data-cmdk-mobile-gesture-ignore":!0,onTouchStart:f,onTouchEnd:p,children:h(`div`,{className:`h-1.5 w-11 rounded-full bg-muted-foreground/35`})}),n]}),h(`div`,{className:e(`flex justify-end select-none`,o&&`hidden`),children:h(`a`,{href:`https://better-cmdk.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-xs text-muted-foreground font-medium px-2 py-0.5 hover:text-foreground transition-colors`,style:{borderRadius:`0 0 0.375rem 0.375rem`,marginRight:`1rem`,backgroundColor:`color-mix(in oklch, oklch(var(--bcmdk-background)) 95%, transparent)`,backdropFilter:`blur(24px)`,WebkitBackdropFilter:`blur(24px)`,borderLeft:`1px solid oklch(var(--bcmdk-input))`,borderRight:`1px solid oklch(var(--bcmdk-input))`,borderBottom:`1px solid oklch(var(--bcmdk-input))`,boxShadow:`4px 4px 12px -2px rgba(0,0,0,0.12), -4px 4px 12px -2px rgba(0,0,0,0.12), 0 8px 16px -4px rgba(0,0,0,0.1)`},children:`powered by better-cmdk`})})]})]})})}const Sn=g(m,{children:[h(Tn,{placeholder:`Search for commands or ask AI...`,showSendButton:!0}),h(On,{children:h($,{})})]});function Cn({title:t=`Command Palette`,description:n=`Search for a command to run...`,children:r,className:a,corners:o=`xl`,borderColor:s,commands:c,commandsPlaceholder:l=`Search for commands or ask AI...`,commandsAskAILabel:u=`Ask AI`,mobile:d,...f}){let{mode:p,status:_,switchToCommand:y,messages:b,isEnabled:x,setInputValue:S,inputValue:C}=X(),w=i.useMemo(()=>vn(d),[d]),T=yn(w.breakpoint,w.enabled),E=w.enabled&&T,D=pn(E&&!!f.open),O=i.useCallback(e=>{e&&S(``),f.onOpenChange?.(e)},[f.onOpenChange,S]),k=i.useCallback(()=>{O(!0)},[O]),A=fn({enabled:E&&!f.open&&!!f.onOpenChange&&w.gesture.enabled,open:!!f.open,holdMs:w.gesture.holdMs,swipeUpPx:w.gesture.swipeUpPx,onTrigger:k}),j=i.useMemo(()=>({isMobile:E,layout:w.layout,keyboardInset:D,showQuickActions:w.showQuickActions,quickActionsCount:w.quickActionsCount}),[E,w.layout,D,w.showQuickActions,w.quickActionsCount]),M=()=>c&&c.length>0?h(Dn,{commands:c,placeholder:l,askAILabel:u}):typeof r==`function`?r({mode:p,messages:b,status:_,isEnabled:x}):r??Sn,N=e=>{p===`chat`&&(e.preventDefault(),y())};return i.useEffect(()=>{let e=e=>{e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),O(!1))};if(f.open)return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[f.open,O]),g(m,{children:[h(Wt,{...f,onOpenChange:O,children:g(xn,{className:a,corners:o,borderColor:s,isMobile:E,keyboardInset:D,onRequestClose:()=>O(!1),onEscapeKeyDown:N,onOpenAutoFocus:e=>{E&&w.layout===`keyboard-last`&&e.preventDefault()},children:[g(Xt,{className:`sr-only`,children:[h(Qt,{children:t}),h($t,{children:n})]}),h(_n.Provider,{value:j,children:h(W,{"data-slot":`command`,className:e(`bcmdk-root **:data-[slot=command-input-wrapper]:bg-transparent rounded-none bg-transparent **:data-[slot=command-input]:!h-11 **:data-[slot=command-input]:py-0 **:data-[slot=command-input-wrapper]:mb-0`,E?`**:data-[slot=command-input-wrapper]:!h-[var(--cmdk-input-row-height)] pb-[env(safe-area-inset-bottom)]`:`**:data-[slot=command-input-wrapper]:!h-11`,`text-popover-foreground flex h-full min-h-0 w-full flex-col overflow-hidden`),style:{borderRadius:`var(--cmdk-radius, 0.75rem)`,"--cmdk-item-height":E?`3.125rem`:`2.25rem`,"--cmdk-input-row-height":E?`3.5rem`:`2.75rem`},children:M()})})]})}),A.showHint&&g(`div`,{className:`fixed left-1/2 z-50 flex -translate-x-1/2 items-center gap-2 rounded-full border border-input bg-background/95 px-3 py-1.5 text-xs font-medium text-foreground shadow-sm backdrop-blur-md`,style:{bottom:`calc(env(safe-area-inset-bottom) + 2rem)`},"data-cmdk-mobile-gesture-ignore":!0,children:[h(v,{className:`size-3.5`}),`Swipe up for Command Menu`]})]})}function wn({chatEndpoint:e=null,chat:t,onModeChange:n,onOpenChange:r,historyStorageKey:i,maxConversations:a,commands:o,commandsPlaceholder:s,commandsAskAILabel:c,mobile:l,...u}){return h(Ut,{chatEndpoint:e,chat:t,onModeChange:n,onOpenChange:r,historyStorageKey:i,maxConversations:a,children:h(ln,{children:h(Cn,{onOpenChange:r,commands:o,commandsPlaceholder:s,commandsAskAILabel:c,mobile:l,...u})})})}function Tn({className:t,showSendButton:n=!1,...r}){let{mode:a,inputValue:o,setInputValue:s,sendMessage:c,isLoading:l,switchToChat:u,startNewChat:d}=X(),{isMobile:f,layout:p,keyboardInset:m}=Q(),[_,y]=i.useState(!1),x=i.useRef(null),S=()=>{o.trim()&&a===`chat`&&c(o)},C=e=>{if((e.metaKey||e.ctrlKey)&&e.key===`Enter`){e.preventDefault(),a===`command`&&o.trim()?(d(),u(),c(o)):a===`chat`&&o.trim()&&c(o);return}if(a===`chat`&&e.key===`Enter`&&!e.shiftKey){e.preventDefault(),o.trim()&&c(o);return}},w=a===`chat`||o.length>0||f&&p===`keyboard-last`,T=f&&p===`keyboard-last`&&!_&&a===`command`,E=e=>{y(!0),r.onFocus?.(e)},D=e=>{y(!1),r.onBlur?.(e)},O=f?{marginBottom:m>0?`${m}px`:void 0}:void 0,k={...r,onFocus:E,onBlur:D};return g(`div`,{"data-slot":`command-input-wrapper`,className:e(`order-2 flex h-[var(--cmdk-input-row-height,2.75rem)] items-center gap-2 px-6 transition-[margin,border-color] duration-200`,f&&`px-4`,w?`border-t border-input mt-0`:`border-t border-transparent mt-0`),style:O,children:[h(W.Input,{"data-slot":`command-input`,ref:x,value:o,onValueChange:s,onKeyDown:C,className:e(`placeholder:text-muted-foreground flex h-10 w-full bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t),...k,placeholder:a===`chat`?`Ask AI...`:r.placeholder}),T&&h(`button`,{type:`button`,onClick:()=>x.current?.focus(),className:`flex items-center justify-center size-7 shrink-0 border border-input bg-background text-muted-foreground hover:text-foreground transition-colors`,style:{borderRadius:`var(--cmdk-radius, 0.75rem)`},"aria-label":`Type a command`,"data-cmdk-mobile-gesture-ignore":!0,children:h(b,{className:`size-4`})}),n&&a===`chat`&&h(`button`,{type:`button`,onClick:S,disabled:!o.trim()||l,className:`flex items-center justify-center size-6 shrink-0 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,style:{borderRadius:`var(--cmdk-radius, 0.75rem)`},children:h(v,{className:`size-3`})})]})}function $({label:t=`Ask AI`,className:n,...r}){let{inputValue:i,setInputValue:a,switchToChat:o,sendMessage:s,isEnabled:c,startNewChat:l}=X(),{isMobile:u}=Q(),d=q(e=>e.filtered.count),f=()=>{if(c)if(i.trim()){let e=lt(`ask-ai`,i.trim())>0;d===0&&!e?(l(),o(),s(i)):(o(),a(``))}else o()};return c?h(W.Group,{forceMount:!0,children:g(W.Item,{"data-slot":`command-item`,value:`ask-ai`,onSelect:f,className:e(`data-[selected=true]:border-input data-[selected=true]:bg-input/50 relative flex cursor-default items-center gap-3 border border-transparent px-3 py-2 text-sm outline-hidden select-none`,u&&`min-h-12 py-3`,n),style:{borderRadius:`var(--cmdk-radius, 0.75rem)`},...r,children:[h(S,{className:`size-4 shrink-0 text-primary`}),h(`div`,{className:`flex flex-col items-start gap-0.5`,children:h(`span`,{className:`font-medium`,children:t})}),!u&&g(`span`,{className:`ml-auto flex items-center gap-1`,children:[h(en,{children:`⌘`}),h(en,{children:`↵`})]})]})}):h(W.Empty,{"data-slot":`command-empty`,className:e(`text-muted-foreground py-6 text-center text-sm`,n),children:`No results found.`})}function En(e){let t=[],n=new Map;for(let r of e){let e=r.group,i=n.get(e);i===void 0?(n.set(e,t.length),t.push({heading:e,items:[r]})):t[i].items.push(r)}let r=t.findIndex(e=>e.heading===void 0);if(r>0){let e=t.splice(r,1)[0];t.unshift(e)}return t}function Dn({commands:t,placeholder:n,askAILabel:r}){let{inputValue:a,mode:o}=X(),{isMobile:s,layout:c,showQuickActions:l,quickActionsCount:u}=Q(),d=En(t),f=s&&c===`keyboard-last`&&l&&o===`command`&&a.length===0,p=f?t.filter(e=>!e.disabled).slice(0,u):[],_=new Set(p.map(e=>e.name)),v=t=>{let n=t.label??t.name,r=[...t.keywords??[]];return t.label&&t.label!==t.name&&r.push(t.label),g(sn,{value:t.name,keywords:r.length>0?r:void 0,disabled:t.disabled,onSelect:()=>t.onSelect?.(),className:e(s&&`min-h-12 py-3`),children:[t.icon,n,t.shortcut&&!s&&h(cn,{children:t.shortcut})]},t.name)};return g(m,{children:[h(Tn,{placeholder:n,showSendButton:!0}),g(On,{children:[f&&p.length>0&&h(Z,{heading:`Quick Actions`,children:p.map(e=>v(e))}),d.map((e,t)=>{let n=f?e.items.filter(e=>!_.has(e.name)):e.items;if(n.length===0)return null;let r=n.map(e=>v(e));return e.heading?h(Z,{heading:e.heading,children:r},e.heading):h(i.Fragment,{children:r},`__ungrouped_${t}`)}),h($,{label:r})]})]})}function On({className:t,children:n,actions:r,actionsHeading:a=`Actions`,style:o,...s}){let{mode:c,status:l,messages:u,sendMessage:d,addToolApprovalResponse:f,agenticActions:p,switchToChat:m,startNewChat:_,conversations:v,loadConversation:y,inputValue:b}=X(),{isMobile:x,layout:C,keyboardInset:w}=Q(),T=i.useCallback(e=>d(e.text),[d]),E=f??mn;if(c===`chat`)return h(`div`,{"data-slot":`command-list`,className:e(`order-1 min-h-0 flex-1 overflow-hidden px-3 flex flex-col`,x&&`px-2`,t),children:u.length===0?h(Ue,{}):g(Ve,{style:{flex:`1 1 0%`,minHeight:0},children:[h(`div`,{className:`px-3 py-2 space-y-4`,children:h(Ie,{messages:u,sendMessage:T,addToolApprovalResponse:E})}),l===`streaming`&&h(He,{})]})});let D=i.Children.toArray(n),O=[],k=[];D.forEach(e=>{i.isValidElement(e)&&(e.type===$||e.type.displayName===`CommandEmpty`)?O.push(e):i.isValidElement(e)&&e.type===an||k.push(e)});let A=(r??p)?.filter(e=>e.execute),j=e=>{let t=e.label??e.name;_(),m(),d(t)},M=b.length>0||x&&C===`keyboard-last`,N=x?`calc(100% - var(--cmdk-input-row-height, 3.5rem))`:`calc(45vh - 2.75rem)`,ee={overscrollBehavior:`contain`,paddingBottom:w>0?`${w+8}px`:x?`env(safe-area-inset-bottom)`:void 0,...o};return h(re.div,{initial:!1,animate:{height:M?N:0},transition:{type:`spring`,duration:.25,bounce:0},className:e(`order-1 min-h-0 overflow-hidden px-3`,x&&`px-2`),children:g(W.List,{"data-slot":`command-list`,className:e(`overflow-x-hidden overflow-y-auto overscroll-contain pt-2 h-full`,x&&`pt-1`,t),style:ee,...s,children:[k,v.length>0&&h(Z,{heading:`Recent Chats`,children:v.slice(0,5).map(t=>g(sn,{value:`chat-history-${t.id}`,keywords:[t.title],onSelect:()=>y(t.id),className:e(x&&`min-h-12 py-3`),children:[h(S,{className:`size-4`}),h(`span`,{className:`truncate`,children:t.title}),h(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:bn(t.updatedAt)})]},t.id))}),A&&A.length>0&&h(Z,{heading:a,children:A.map(t=>h(sn,{value:t.label??t.name,onSelect:()=>j(t),className:e(x&&`min-h-12 py-3`),children:t.label??t.name},t.name))}),O]})})}$.displayName=`CommandEmpty`;export{ve as AssistantFormRenderer,Ie as AssistantMessages,Be as Button,Ue as ChatEmpty,He as ChatLoading,Ve as ChatMessageList,Se as Collapsible,we as CollapsibleContent,Ce as CollapsibleTrigger,nn as Command,xn as CommandContent,wn as CommandDialog,wn as CommandMenu,rn as CommandDialogContent,$ as CommandEmpty,Z as CommandGroup,Tn as CommandInput,sn as CommandItem,On as CommandList,Vt as CommandMenuContext,Ut as CommandMenuProvider,on as CommandSeparator,cn as CommandShortcut,ie as Confirmation,se as ConfirmationAccepted,ue as ConfirmationAction,le as ConfirmationActions,ce as ConfirmationRejected,oe as ConfirmationRequest,ae as ConfirmationTitle,Wt as Dialog,qt as DialogClose,Yt as DialogContent,$t as DialogDescription,Zt as DialogFooter,Xt as DialogHeader,Jt as DialogOverlay,Kt as DialogPortal,Qt as DialogTitle,Gt as DialogTrigger,en as Kbd,tn as KbdGroup,ye as Message,be as MessageContent,xe as MessageResponse,De as Task,ke as TaskContent,Ee as TaskItem,Te as TaskItemFile,Oe as TaskTrigger,ze as buttonVariants,e as cn,he as defaultFormRegistry,Pt as useChatHistory,X as useCommandMenuContext};
@@ -51,85 +51,42 @@ bun add better-cmdk modifywithai @ai-sdk/react ai
51
51
 
52
52
  ## Step 3: CSS Setup
53
53
 
54
- better-cmdk uses Tailwind CSS and shadcn/ui design tokens.
54
+ better-cmdk ships precompiled styles with namespaced tokens.
55
55
 
56
56
  ### Tailwind v4
57
57
 
58
- Add to my main CSS file (next to the existing `@import "tailwindcss"`):
58
+ Add to my main CSS file:
59
59
 
60
60
  ```css
61
- @source "node_modules/better-cmdk";
61
+ @import "tailwindcss";
62
+ @import "better-cmdk";
62
63
  ```
63
64
 
64
- If my app **already has shadcn/ui CSS variables**, verify they include `--popover`, `--muted`, `--border`, `--ring`, `--primary`, `--primary-foreground`. Don't overwrite existing variables.
65
+ If my app wants custom theming, override better-cmdk's namespaced variables.
65
66
 
66
- If my app **does not have** these variables, add the minimal set:
67
+ Add this minimal override block only when needed:
67
68
 
68
69
  ```css
69
- :root {
70
- --radius: 0.625rem;
71
- --background: oklch(1 0 0);
72
- --foreground: oklch(0.145 0 0);
73
- --popover: oklch(1 0 0);
74
- --popover-foreground: oklch(0.145 0 0);
75
- --primary: oklch(0.205 0 0);
76
- --primary-foreground: oklch(0.985 0 0);
77
- --muted: oklch(0.97 0 0);
78
- --muted-foreground: oklch(0.556 0 0);
79
- --border: oklch(0.922 0 0);
80
- --input: oklch(0.922 0 0);
81
- --ring: oklch(0.708 0 0);
82
- }
83
-
84
- @theme inline {
85
- --color-background: var(--background);
86
- --color-foreground: var(--foreground);
87
- --color-popover: var(--popover);
88
- --color-popover-foreground: var(--popover-foreground);
89
- --color-primary: var(--primary);
90
- --color-primary-foreground: var(--primary-foreground);
91
- --color-muted: var(--muted);
92
- --color-muted-foreground: var(--muted-foreground);
93
- --color-border: var(--border);
94
- --color-input: var(--input);
95
- --color-ring: var(--ring);
96
- --radius-sm: calc(var(--radius) - 4px);
97
- --radius-md: calc(var(--radius) - 2px);
98
- --radius-lg: var(--radius);
99
- --radius-xl: calc(var(--radius) + 4px);
70
+ .bcmdk-root {
71
+ --bcmdk-radius: 0.625rem;
72
+ --bcmdk-background: 1 0 0;
73
+ --bcmdk-foreground: 0.145 0 0;
74
+ --bcmdk-primary: 0.205 0 0;
75
+ --bcmdk-primary-foreground: 0.985 0 0;
76
+ --bcmdk-muted: 0.97 0 0;
77
+ --bcmdk-muted-foreground: 0.556 0 0;
78
+ --bcmdk-border: 0.922 0 0;
79
+ --bcmdk-input: 0.922 0 0;
80
+ --bcmdk-ring: 0.708 0 0;
100
81
  }
101
82
  ```
102
83
 
103
84
  ### Tailwind v3
104
85
 
105
- Add to `tailwind.config.js` or `tailwind.config.ts`:
106
-
107
- ```js
108
- content: [
109
- // ... existing paths
110
- "./node_modules/better-cmdk/**/*.{js,ts,jsx,tsx}",
111
- ],
112
- ```
113
-
114
- If my app **does not have** shadcn/ui CSS variables, add the minimal set (hsl format):
86
+ Use the same CSS import approach:
115
87
 
116
88
  ```css
117
- @layer base {
118
- :root {
119
- --radius: 0.5rem;
120
- --background: 0 0% 100%;
121
- --foreground: 240 10% 3.9%;
122
- --popover: 0 0% 100%;
123
- --popover-foreground: 240 10% 3.9%;
124
- --primary: 240 5.9% 10%;
125
- --primary-foreground: 0 0% 98%;
126
- --muted: 240 4.8% 95.9%;
127
- --muted-foreground: 240 3.8% 46.1%;
128
- --border: 240 5.9% 90%;
129
- --input: 240 5.9% 90%;
130
- --ring: 240 5.9% 10%;
131
- }
132
- }
89
+ @import "better-cmdk";
133
90
  ```
134
91
 
135
92
  ---
@@ -51,85 +51,42 @@ bun add better-cmdk modifywithai @ai-sdk/react ai
51
51
 
52
52
  ## Step 3: CSS Setup
53
53
 
54
- better-cmdk uses Tailwind CSS and shadcn/ui design tokens.
54
+ better-cmdk ships precompiled styles with namespaced tokens.
55
55
 
56
56
  ### Tailwind v4
57
57
 
58
- Add to my main CSS file (next to the existing `@import "tailwindcss"`):
58
+ Add to my main CSS file:
59
59
 
60
60
  ```css
61
- @source "node_modules/better-cmdk";
61
+ @import "tailwindcss";
62
+ @import "better-cmdk";
62
63
  ```
63
64
 
64
- If my app **already has shadcn/ui CSS variables**, verify they include `--popover`, `--muted`, `--border`, `--ring`, `--primary`, `--primary-foreground`. Don't overwrite existing variables.
65
+ If my app wants custom theming, override better-cmdk's namespaced variables.
65
66
 
66
- If my app **does not have** these variables, add the minimal set:
67
+ Add this minimal override block only when needed:
67
68
 
68
69
  ```css
69
- :root {
70
- --radius: 0.625rem;
71
- --background: oklch(1 0 0);
72
- --foreground: oklch(0.145 0 0);
73
- --popover: oklch(1 0 0);
74
- --popover-foreground: oklch(0.145 0 0);
75
- --primary: oklch(0.205 0 0);
76
- --primary-foreground: oklch(0.985 0 0);
77
- --muted: oklch(0.97 0 0);
78
- --muted-foreground: oklch(0.556 0 0);
79
- --border: oklch(0.922 0 0);
80
- --input: oklch(0.922 0 0);
81
- --ring: oklch(0.708 0 0);
82
- }
83
-
84
- @theme inline {
85
- --color-background: var(--background);
86
- --color-foreground: var(--foreground);
87
- --color-popover: var(--popover);
88
- --color-popover-foreground: var(--popover-foreground);
89
- --color-primary: var(--primary);
90
- --color-primary-foreground: var(--primary-foreground);
91
- --color-muted: var(--muted);
92
- --color-muted-foreground: var(--muted-foreground);
93
- --color-border: var(--border);
94
- --color-input: var(--input);
95
- --color-ring: var(--ring);
96
- --radius-sm: calc(var(--radius) - 4px);
97
- --radius-md: calc(var(--radius) - 2px);
98
- --radius-lg: var(--radius);
99
- --radius-xl: calc(var(--radius) + 4px);
70
+ .bcmdk-root {
71
+ --bcmdk-radius: 0.625rem;
72
+ --bcmdk-background: 1 0 0;
73
+ --bcmdk-foreground: 0.145 0 0;
74
+ --bcmdk-primary: 0.205 0 0;
75
+ --bcmdk-primary-foreground: 0.985 0 0;
76
+ --bcmdk-muted: 0.97 0 0;
77
+ --bcmdk-muted-foreground: 0.556 0 0;
78
+ --bcmdk-border: 0.922 0 0;
79
+ --bcmdk-input: 0.922 0 0;
80
+ --bcmdk-ring: 0.708 0 0;
100
81
  }
101
82
  ```
102
83
 
103
84
  ### Tailwind v3
104
85
 
105
- Add to `tailwind.config.js` or `tailwind.config.ts`:
106
-
107
- ```js
108
- content: [
109
- // ... existing paths
110
- "./node_modules/better-cmdk/**/*.{js,ts,jsx,tsx}",
111
- ],
112
- ```
113
-
114
- If my app **does not have** shadcn/ui CSS variables, add the minimal set (hsl format):
86
+ Use the same CSS import approach:
115
87
 
116
88
  ```css
117
- @layer base {
118
- :root {
119
- --radius: 0.5rem;
120
- --background: 0 0% 100%;
121
- --foreground: 240 10% 3.9%;
122
- --popover: 0 0% 100%;
123
- --popover-foreground: 240 10% 3.9%;
124
- --primary: 240 5.9% 10%;
125
- --primary-foreground: 0 0% 98%;
126
- --muted: 240 4.8% 95.9%;
127
- --muted-foreground: 240 3.8% 46.1%;
128
- --border: 240 5.9% 90%;
129
- --input: 240 5.9% 90%;
130
- --ring: 240 5.9% 10%;
131
- }
132
- }
89
+ @import "better-cmdk";
133
90
  ```
134
91
 
135
92
  ---
@@ -0,0 +1,2 @@
1
+ /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){.bcmdk-root,.bcmdk-root *,.bcmdk-root:before,.bcmdk-root:after,.bcmdk-root *:before,.bcmdk-root *:after,.bcmdk-root::backdrop,.bcmdk-root *::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}.bcmdk-root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--color-red-50:oklch(97.1% .013 17.38);--color-red-500:oklch(63.7% .237 25.331);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-500:oklch(72.3% .219 149.579);--color-green-950:oklch(26.6% .065 152.934);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--radius-xs:.125rem;--animate-spin:spin 1s linear infinite;--blur-md:12px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1)}.bcmdk-root .pointer-events-none{pointer-events:none}.bcmdk-root .visible{visibility:visible}.bcmdk-root .sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.bcmdk-root .absolute{position:absolute}.bcmdk-root .fixed{position:fixed}.bcmdk-root .relative{position:relative}.bcmdk-root .static{position:static}.bcmdk-root .sticky{position:sticky}.bcmdk-root .inset-0{inset:calc(var(--spacing)*0)}.bcmdk-root .inset-x-0{inset-inline:calc(var(--spacing)*0)}.bcmdk-root .top-1\/3{top:33.3333%}.bcmdk-root .top-4{top:calc(var(--spacing)*4)}.bcmdk-root .top-\[50\%\]{top:50%}.bcmdk-root .right-4{right:calc(var(--spacing)*4)}.bcmdk-root .bottom-0{bottom:calc(var(--spacing)*0)}.bcmdk-root .left-1\/2,.bcmdk-root .left-\[50\%\]{left:50%}.bcmdk-root .z-40{z-index:40}.bcmdk-root .z-50{z-index:50}.bcmdk-root .order-1{order:1}.bcmdk-root .order-2{order:2}.bcmdk-root .container{width:100%}@media (min-width:40rem){.bcmdk-root .container{max-width:40rem}}@media (min-width:48rem){.bcmdk-root .container{max-width:48rem}}@media (min-width:64rem){.bcmdk-root .container{max-width:64rem}}@media (min-width:80rem){.bcmdk-root .container{max-width:80rem}}@media (min-width:96rem){.bcmdk-root .container{max-width:96rem}}.bcmdk-root .-mx-1{margin-inline:calc(var(--spacing)*-1)}.bcmdk-root .mt-0{margin-top:calc(var(--spacing)*0)}.bcmdk-root .mt-2{margin-top:calc(var(--spacing)*2)}.bcmdk-root .mt-4{margin-top:calc(var(--spacing)*4)}.bcmdk-root .ml-1{margin-left:calc(var(--spacing)*1)}.bcmdk-root .ml-auto{margin-left:auto}.bcmdk-root .block{display:block}.bcmdk-root .flex{display:flex}.bcmdk-root .grid{display:grid}.bcmdk-root .hidden{display:none}.bcmdk-root .inline{display:inline}.bcmdk-root .inline-block{display:inline-block}.bcmdk-root .inline-flex{display:inline-flex}.bcmdk-root .inline-grid{display:inline-grid}.bcmdk-root .size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.bcmdk-root .size-3\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.bcmdk-root .size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.bcmdk-root .size-6{width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.bcmdk-root .size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.bcmdk-root .size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.bcmdk-root .size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.bcmdk-root .size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.bcmdk-root .size-full{width:100%;height:100%}.bcmdk-root .h-1\.5{height:calc(var(--spacing)*1.5)}.bcmdk-root .h-6{height:calc(var(--spacing)*6)}.bcmdk-root .h-8{height:calc(var(--spacing)*8)}.bcmdk-root .h-9{height:calc(var(--spacing)*9)}.bcmdk-root .h-10{height:calc(var(--spacing)*10)}.bcmdk-root .h-\[var\(--cmdk-input-row-height\,2\.75rem\)\]{height:var(--cmdk-input-row-height,2.75rem)}.bcmdk-root .h-\[var\(--cmdk-item-height\,2\.25rem\)\]{height:var(--cmdk-item-height,2.25rem)}.bcmdk-root .h-full{height:100%}.bcmdk-root .h-px{height:1px}.bcmdk-root .max-h-\[300px\]{max-height:300px}.bcmdk-root .min-h-0{min-height:calc(var(--spacing)*0)}.bcmdk-root .min-h-12{min-height:calc(var(--spacing)*12)}.bcmdk-root .min-h-\[60px\]{min-height:60px}.bcmdk-root .w-11{width:calc(var(--spacing)*11)}.bcmdk-root .w-fit{width:fit-content}.bcmdk-root .w-full{width:100%}.bcmdk-root .max-w-\[85\%\]{max-width:85%}.bcmdk-root .max-w-\[95\%\]{max-width:95%}.bcmdk-root .max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.bcmdk-root .max-w-full{max-width:100%}.bcmdk-root .max-w-none{max-width:none}.bcmdk-root .min-w-0{min-width:calc(var(--spacing)*0)}.bcmdk-root .min-w-5{min-width:calc(var(--spacing)*5)}.bcmdk-root .flex-1{flex:1}.bcmdk-root .shrink-0{flex-shrink:0}.bcmdk-root .-translate-x-1\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.bcmdk-root .translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.bcmdk-root .translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.bcmdk-root .animate-spin{animation:var(--animate-spin)}.bcmdk-root .cursor-default{cursor:default}.bcmdk-root .cursor-pointer{cursor:pointer}.bcmdk-root .resize{resize:both}.bcmdk-root .list-inside{list-style-position:inside}.bcmdk-root .list-disc{list-style-type:disc}.bcmdk-root .flex-col{flex-direction:column}.bcmdk-root .flex-col-reverse{flex-direction:column-reverse}.bcmdk-root .place-items-center{place-items:center}.bcmdk-root .items-center{align-items:center}.bcmdk-root .items-start{align-items:flex-start}.bcmdk-root .justify-center{justify-content:center}.bcmdk-root .justify-end{justify-content:flex-end}.bcmdk-root .gap-0\.5{gap:calc(var(--spacing)*.5)}.bcmdk-root .gap-1{gap:calc(var(--spacing)*1)}.bcmdk-root .gap-1\.5{gap:calc(var(--spacing)*1.5)}.bcmdk-root .gap-2{gap:calc(var(--spacing)*2)}.bcmdk-root .gap-3{gap:calc(var(--spacing)*3)}.bcmdk-root .gap-4{gap:calc(var(--spacing)*4)}:where(.bcmdk-root .space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.bcmdk-root .space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.bcmdk-root .space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.bcmdk-root .space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.bcmdk-root .self-end{align-self:flex-end}.bcmdk-root .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.bcmdk-root .overflow-hidden{overflow:hidden}.bcmdk-root .overflow-x-hidden{overflow-x:hidden}.bcmdk-root .overflow-y-auto{overflow-y:auto}.bcmdk-root .overscroll-contain{overscroll-behavior:contain}.bcmdk-root .scroll-smooth{scroll-behavior:smooth}.bcmdk-root .rounded{border-radius:.25rem}.bcmdk-root .rounded-full{border-radius:3.40282e38px}.bcmdk-root .rounded-lg{border-radius:var(--bcmdk-radius)}.bcmdk-root .rounded-md{border-radius:calc(var(--bcmdk-radius) - 2px)}.bcmdk-root .rounded-none{border-radius:0}.bcmdk-root .rounded-sm{border-radius:calc(var(--bcmdk-radius) - 4px)}.bcmdk-root .rounded-xl{border-radius:calc(var(--bcmdk-radius) + 4px)}.bcmdk-root .rounded-xs{border-radius:var(--radius-xs)}.bcmdk-root .border{border-style:var(--tw-border-style);border-width:1px}.bcmdk-root .border-x-0{border-inline-style:var(--tw-border-style);border-inline-width:0}.bcmdk-root .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.bcmdk-root .border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.bcmdk-root .border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.bcmdk-root .border-none{--tw-border-style:none;border-style:none}.bcmdk-root .border-input{border-color:oklch(var(--bcmdk-input)/1)}.bcmdk-root .border-muted{border-color:oklch(var(--bcmdk-muted)/1)}.bcmdk-root .border-transparent{border-color:#0000}.bcmdk-root .bg-background,.bcmdk-root .bg-background\/95{background-color:oklch(var(--bcmdk-background)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .bg-background\/95{background-color:color-mix(in oklab,oklch(var(--bcmdk-background)/1)95%,transparent)}}.bcmdk-root .bg-black\/35{background-color:#00000059}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .bg-black\/35{background-color:color-mix(in oklab,var(--color-black)35%,transparent)}}.bcmdk-root .bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bcmdk-root .bg-border{background-color:oklch(var(--bcmdk-border)/1)}.bcmdk-root .bg-card{background-color:oklch(var(--bcmdk-card)/1)}.bcmdk-root .bg-destructive{background-color:oklch(var(--bcmdk-destructive)/1)}.bcmdk-root .bg-muted{background-color:oklch(var(--bcmdk-muted)/1)}.bcmdk-root .bg-muted-foreground\/35{background-color:oklch(var(--bcmdk-muted-foreground)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .bg-muted-foreground\/35{background-color:color-mix(in oklab,oklch(var(--bcmdk-muted-foreground)/1)35%,transparent)}}.bcmdk-root .bg-primary{background-color:oklch(var(--bcmdk-primary)/1)}.bcmdk-root .bg-secondary{background-color:oklch(var(--bcmdk-secondary)/1)}.bcmdk-root .bg-transparent{background-color:#0000}.bcmdk-root .\!p-0{padding:calc(var(--spacing)*0)!important}.bcmdk-root .p-0{padding:calc(var(--spacing)*0)}.bcmdk-root .p-2{padding:calc(var(--spacing)*2)}.bcmdk-root .p-4{padding:calc(var(--spacing)*4)}.bcmdk-root .p-6{padding:calc(var(--spacing)*6)}.bcmdk-root .px-0{padding-inline:calc(var(--spacing)*0)}.bcmdk-root .px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.bcmdk-root .px-2{padding-inline:calc(var(--spacing)*2)}.bcmdk-root .px-3{padding-inline:calc(var(--spacing)*3)}.bcmdk-root .px-4{padding-inline:calc(var(--spacing)*4)}.bcmdk-root .px-6{padding-inline:calc(var(--spacing)*6)}.bcmdk-root .py-0\.5{padding-block:calc(var(--spacing)*.5)}.bcmdk-root .py-1{padding-block:calc(var(--spacing)*1)}.bcmdk-root .py-1\.5{padding-block:calc(var(--spacing)*1.5)}.bcmdk-root .py-2{padding-block:calc(var(--spacing)*2)}.bcmdk-root .py-3{padding-block:calc(var(--spacing)*3)}.bcmdk-root .py-6{padding-block:calc(var(--spacing)*6)}.bcmdk-root .py-8{padding-block:calc(var(--spacing)*8)}.bcmdk-root .pt-1{padding-top:calc(var(--spacing)*1)}.bcmdk-root .pt-2{padding-top:calc(var(--spacing)*2)}.bcmdk-root .pt-4{padding-top:calc(var(--spacing)*4)}.bcmdk-root .pb-3{padding-bottom:calc(var(--spacing)*3)}.bcmdk-root .pb-\[env\(safe-area-inset-bottom\)\]{padding-bottom:env(safe-area-inset-bottom)}.bcmdk-root .pl-4{padding-left:calc(var(--spacing)*4)}.bcmdk-root .text-center{text-align:center}.bcmdk-root .font-sans{font-family:var(--font-sans)}.bcmdk-root .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.bcmdk-root .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.bcmdk-root .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.bcmdk-root .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bcmdk-root .leading-\[1\],.bcmdk-root .leading-none{--tw-leading:1;line-height:1}.bcmdk-root .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.bcmdk-root .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bcmdk-root .tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.bcmdk-root .break-words{overflow-wrap:break-word}.bcmdk-root .whitespace-nowrap{white-space:nowrap}.bcmdk-root .whitespace-pre-wrap{white-space:pre-wrap}.bcmdk-root .text-card-foreground{color:oklch(var(--bcmdk-card-foreground)/1)}.bcmdk-root .text-destructive{color:oklch(var(--bcmdk-destructive)/1)}.bcmdk-root .text-destructive-foreground{color:oklch(var(--bcmdk-destructive-foreground)/1)}.bcmdk-root .text-foreground{color:oklch(var(--bcmdk-foreground)/1)}.bcmdk-root .text-muted-foreground{color:oklch(var(--bcmdk-muted-foreground)/1)}.bcmdk-root .text-popover-foreground{color:oklch(var(--bcmdk-popover-foreground)/1)}.bcmdk-root .text-primary{color:oklch(var(--bcmdk-primary)/1)}.bcmdk-root .text-primary-foreground{color:oklch(var(--bcmdk-primary-foreground)/1)}.bcmdk-root .text-secondary-foreground{color:oklch(var(--bcmdk-secondary-foreground)/1)}.bcmdk-root .text-white{color:var(--color-white)}.bcmdk-root .underline-offset-4{text-underline-offset:4px}.bcmdk-root .accent-foreground{accent-color:oklch(var(--bcmdk-foreground)/1)}.bcmdk-root .opacity-50{opacity:.5}.bcmdk-root .opacity-70{opacity:.7}.bcmdk-root .shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .ring-offset-background{--tw-ring-offset-color:oklch(var(--bcmdk-background)/1)}.bcmdk-root .outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.bcmdk-root .outline-hidden{outline-offset:2px;outline:2px solid #0000}}.bcmdk-root .outline{outline-style:var(--tw-outline-style);outline-width:1px}.bcmdk-root .filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.bcmdk-root .backdrop-blur-\[1px\]{--tw-backdrop-blur:blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.bcmdk-root .backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.bcmdk-root .backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.bcmdk-root .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.bcmdk-root .transition-\[margin\,border-color\]{transition-property:margin,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.bcmdk-root .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.bcmdk-root .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.bcmdk-root .transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.bcmdk-root .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.bcmdk-root .duration-200{--tw-duration:.2s;transition-duration:.2s}.bcmdk-root .will-change-transform{will-change:transform}.bcmdk-root .outline-none{--tw-outline-style:none;outline-style:none}.bcmdk-root .select-none{-webkit-user-select:none;user-select:none}.bcmdk-root .group-data-\[state\=open\]\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.bcmdk-root .group-\[\.is-assistant\]\:text-foreground:is(:where(.group).is-assistant *){color:oklch(var(--bcmdk-foreground)/1)}.bcmdk-root .group-\[\.is-user\]\:ml-auto:is(:where(.group).is-user *){margin-left:auto}.bcmdk-root .group-\[\.is-user\]\:bg-secondary:is(:where(.group).is-user *){background-color:oklch(var(--bcmdk-secondary)/1)}.bcmdk-root .group-\[\.is-user\]\:px-4:is(:where(.group).is-user *){padding-inline:calc(var(--spacing)*4)}.bcmdk-root .group-\[\.is-user\]\:py-3:is(:where(.group).is-user *){padding-block:calc(var(--spacing)*3)}.bcmdk-root .group-\[\.is-user\]\:text-foreground:is(:where(.group).is-user *){color:oklch(var(--bcmdk-foreground)/1)}.bcmdk-root .peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.bcmdk-root .peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.bcmdk-root .placeholder\:text-muted-foreground::placeholder{color:oklch(var(--bcmdk-muted-foreground)/1)}@media (hover:hover){.bcmdk-root .hover\:bg-accent:hover{background-color:oklch(var(--bcmdk-accent)/1)}.bcmdk-root .hover\:bg-destructive\/90:hover{background-color:oklch(var(--bcmdk-destructive)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,oklch(var(--bcmdk-destructive)/1)90%,transparent)}}.bcmdk-root .hover\:bg-primary\/90:hover{background-color:oklch(var(--bcmdk-primary)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,oklch(var(--bcmdk-primary)/1)90%,transparent)}}.bcmdk-root .hover\:bg-secondary\/80:hover{background-color:oklch(var(--bcmdk-secondary)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,oklch(var(--bcmdk-secondary)/1)80%,transparent)}}.bcmdk-root .hover\:text-accent-foreground:hover{color:oklch(var(--bcmdk-accent-foreground)/1)}.bcmdk-root .hover\:text-foreground:hover{color:oklch(var(--bcmdk-foreground)/1)}.bcmdk-root .hover\:underline:hover{text-decoration-line:underline}.bcmdk-root .hover\:opacity-100:hover{opacity:1}}.bcmdk-root .focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .focus\:ring-ring:focus{--tw-ring-color:oklch(var(--bcmdk-ring)/1)}.bcmdk-root .focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.bcmdk-root .focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.bcmdk-root .focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.bcmdk-root .focus-visible\:border-ring:focus-visible{border-color:oklch(var(--bcmdk-ring)/1)}.bcmdk-root .focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.bcmdk-root .focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:oklch(var(--bcmdk-destructive)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,oklch(var(--bcmdk-destructive)/1)20%,transparent)}}.bcmdk-root .focus-visible\:ring-ring:focus-visible,.bcmdk-root .focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:oklch(var(--bcmdk-ring)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,oklch(var(--bcmdk-ring)/1)50%,transparent)}}.bcmdk-root .focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.bcmdk-root .focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.bcmdk-root .disabled\:pointer-events-none:disabled{pointer-events:none}.bcmdk-root .disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.bcmdk-root .disabled\:opacity-50:disabled{opacity:.5}.bcmdk-root .has-\[\>svg\]\:px-1\.5:has(>svg){padding-inline:calc(var(--spacing)*1.5)}.bcmdk-root .has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.bcmdk-root .has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.bcmdk-root .has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.bcmdk-root .aria-invalid\:border-destructive[aria-invalid=true]{border-color:oklch(var(--bcmdk-destructive)/1)}.bcmdk-root .aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:oklch(var(--bcmdk-destructive)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,oklch(var(--bcmdk-destructive)/1)20%,transparent)}}.bcmdk-root .data-\[approved\=false\]\:border-red-500\/50[data-approved=false]{border-color:#fb2c3680}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .data-\[approved\=false\]\:border-red-500\/50[data-approved=false]{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.bcmdk-root .data-\[approved\=false\]\:bg-red-50\/50[data-approved=false]{background-color:#fef2f280}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .data-\[approved\=false\]\:bg-red-50\/50[data-approved=false]{background-color:color-mix(in oklab,var(--color-red-50)50%,transparent)}}.bcmdk-root .data-\[approved\=true\]\:border-green-500\/50[data-approved=true]{border-color:#00c75880}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .data-\[approved\=true\]\:border-green-500\/50[data-approved=true]{border-color:color-mix(in oklab,var(--color-green-500)50%,transparent)}}.bcmdk-root .data-\[approved\=true\]\:bg-green-50\/50[data-approved=true]{background-color:#f0fdf480}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .data-\[approved\=true\]\:bg-green-50\/50[data-approved=true]{background-color:color-mix(in oklab,var(--color-green-50)50%,transparent)}}.bcmdk-root .data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.bcmdk-root .data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.bcmdk-root .data-\[selected\=true\]\:border-input[data-selected=true]{border-color:oklch(var(--bcmdk-input)/1)}.bcmdk-root .data-\[selected\=true\]\:bg-input\/50[data-selected=true]{background-color:oklch(var(--bcmdk-input)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .data-\[selected\=true\]\:bg-input\/50[data-selected=true]{background-color:color-mix(in oklab,oklch(var(--bcmdk-input)/1)50%,transparent)}}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input\]\:\!h-9 *)[data-slot=command-input]{height:calc(var(--spacing)*9)!important}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input\]\:\!h-11 *)[data-slot=command-input]{height:calc(var(--spacing)*11)!important}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input\]\:py-0 *)[data-slot=command-input]{padding-block:calc(var(--spacing)*0)}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input-wrapper\]\:mb-0 *)[data-slot=command-input-wrapper]{margin-bottom:calc(var(--spacing)*0)}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input-wrapper\]\:\!h-9 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing)*9)!important}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input-wrapper\]\:\!h-11 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing)*11)!important}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input-wrapper\]\:\!h-\[var\(--cmdk-input-row-height\)\] *)[data-slot=command-input-wrapper]{height:var(--cmdk-input-row-height)!important}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input-wrapper\]\:rounded-md *)[data-slot=command-input-wrapper]{border-radius:calc(var(--bcmdk-radius) - 2px)}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input-wrapper\]\:border *)[data-slot=command-input-wrapper]{border-style:var(--tw-border-style);border-width:1px}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input-wrapper\]\:border-input *)[data-slot=command-input-wrapper]{border-color:oklch(var(--bcmdk-input)/1)}:is(.bcmdk-root .\*\*\:data-\[slot\=command-input-wrapper\]\:bg-transparent *)[data-slot=command-input-wrapper]{background-color:#0000}.bcmdk-root .data-\[state\=approval-requested\]\:border-amber-500\/50[data-state=approval-requested]{border-color:#f99c0080}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .data-\[state\=approval-requested\]\:border-amber-500\/50[data-state=approval-requested]{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.bcmdk-root .data-\[state\=approval-requested\]\:bg-amber-50\/50[data-state=approval-requested]{background-color:#fffbeb80}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .data-\[state\=approval-requested\]\:bg-amber-50\/50[data-state=approval-requested]{background-color:color-mix(in oklab,var(--color-amber-50)50%,transparent)}}.bcmdk-root .data-\[state\=closed\]\:duration-200[data-state=closed]{--tw-duration:.2s;transition-duration:.2s}.bcmdk-root .data-\[state\=open\]\:bg-accent[data-state=open]{background-color:oklch(var(--bcmdk-accent)/1)}.bcmdk-root .data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:oklch(var(--bcmdk-muted-foreground)/1)}.bcmdk-root .data-\[state\=open\]\:duration-300[data-state=open]{--tw-duration:.3s;transition-duration:.3s}@media (min-width:40rem){.bcmdk-root .sm\:max-w-lg{max-width:var(--container-lg)}.bcmdk-root .sm\:flex-row{flex-direction:row}.bcmdk-root .sm\:justify-end{justify-content:flex-end}.bcmdk-root .sm\:text-left{text-align:left}}.bcmdk-root .dark\:border-input:is(.dark *){border-color:oklch(var(--bcmdk-input)/1)}.bcmdk-root .dark\:bg-destructive\/60:is(.dark *){background-color:oklch(var(--bcmdk-destructive)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,oklch(var(--bcmdk-destructive)/1)60%,transparent)}}.bcmdk-root .dark\:bg-input\/30:is(.dark *){background-color:oklch(var(--bcmdk-input)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,oklch(var(--bcmdk-input)/1)30%,transparent)}}@media (hover:hover){.bcmdk-root .dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:oklch(var(--bcmdk-accent)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,oklch(var(--bcmdk-accent)/1)50%,transparent)}}.bcmdk-root .dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:oklch(var(--bcmdk-input)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,oklch(var(--bcmdk-input)/1)50%,transparent)}}}.bcmdk-root .dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:oklch(var(--bcmdk-destructive)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,oklch(var(--bcmdk-destructive)/1)40%,transparent)}}.bcmdk-root .dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:oklch(var(--bcmdk-destructive)/1)}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,oklch(var(--bcmdk-destructive)/1)40%,transparent)}}.bcmdk-root .dark\:data-\[approved\=false\]\:bg-red-950\/20:is(.dark *)[data-approved=false]{background-color:#46080933}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .dark\:data-\[approved\=false\]\:bg-red-950\/20:is(.dark *)[data-approved=false]{background-color:color-mix(in oklab,var(--color-red-950)20%,transparent)}}.bcmdk-root .dark\:data-\[approved\=true\]\:bg-green-950\/20:is(.dark *)[data-approved=true]{background-color:#032e1533}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .dark\:data-\[approved\=true\]\:bg-green-950\/20:is(.dark *)[data-approved=true]{background-color:color-mix(in oklab,var(--color-green-950)20%,transparent)}}.bcmdk-root .dark\:data-\[state\=approval-requested\]\:bg-amber-950\/20:is(.dark *)[data-state=approval-requested]{background-color:#46190133}@supports (color:color-mix(in lab, red, red)){.bcmdk-root .dark\:data-\[state\=approval-requested\]\:bg-amber-950\/20:is(.dark *)[data-state=approval-requested]{background-color:color-mix(in oklab,var(--color-amber-950)20%,transparent)}}.bcmdk-root .\[\&_\[cmdk-group-heading\]\]\:scroll-mt-16 [cmdk-group-heading]{scroll-margin-top:calc(var(--spacing)*16)}.bcmdk-root .\[\&_\[cmdk-group-heading\]\]\:\!p-3 [cmdk-group-heading]{padding:calc(var(--spacing)*3)!important}.bcmdk-root .\[\&_\[cmdk-group-heading\]\]\:pt-0\! [cmdk-group-heading]{padding-top:calc(var(--spacing)*0)!important}.bcmdk-root .\[\&_\[cmdk-group-heading\]\]\:\!pb-1 [cmdk-group-heading]{padding-bottom:calc(var(--spacing)*1)!important}.bcmdk-root .\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bcmdk-root .\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.bcmdk-root .\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:oklch(var(--bcmdk-muted-foreground)/1)}.bcmdk-root .\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.bcmdk-root .\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.bcmdk-root .\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.bcmdk-root .\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.bcmdk-root .\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:oklch(var(--bcmdk-muted-foreground)/1)}.bcmdk-root .\[\&\>\*\:first-child\]\:mt-0>:first-child{margin-top:calc(var(--spacing)*0)}.bcmdk-root .\[\&\>\*\:last-child\]\:mb-0>:last-child{margin-bottom:calc(var(--spacing)*0)}[data-slot=tooltip-content] :is(.bcmdk-root .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20){background-color:oklch(var(--bcmdk-background)/1)}@supports (color:color-mix(in lab, red, red)){[data-slot=tooltip-content] :is(.bcmdk-root .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20){background-color:color-mix(in oklab,oklch(var(--bcmdk-background)/1)20%,transparent)}}[data-slot=tooltip-content] :is(.bcmdk-root .\[\[data-slot\=tooltip-content\]_\&\]\:text-background){color:oklch(var(--bcmdk-background)/1)}[data-slot=tooltip-content] .bcmdk-root .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:oklch(var(--bcmdk-background)/1)}@supports (color:color-mix(in lab, red, red)){[data-slot=tooltip-content] .bcmdk-root .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:color-mix(in oklab,oklch(var(--bcmdk-background)/1)10%,transparent)}}.bcmdk-root{--bcmdk-radius:.625rem;--bcmdk-background:1 0 0;--bcmdk-foreground:.145 0 0;--bcmdk-card:1 0 0;--bcmdk-card-foreground:.145 0 0;--bcmdk-popover:1 0 0;--bcmdk-popover-foreground:.145 0 0;--bcmdk-primary:.205 0 0;--bcmdk-primary-foreground:.985 0 0;--bcmdk-secondary:.97 0 0;--bcmdk-secondary-foreground:.205 0 0;--bcmdk-muted:.97 0 0;--bcmdk-muted-foreground:.556 0 0;--bcmdk-accent:.97 0 0;--bcmdk-accent-foreground:.205 0 0;--bcmdk-destructive:.577 .245 27.325;--bcmdk-destructive-foreground:.577 .245 27.325;--bcmdk-border:.922 0 0;--bcmdk-input:.922 0 0;--bcmdk-ring:.708 0 0}.dark .bcmdk-root,.bcmdk-root.dark{--bcmdk-background:.145 0 0;--bcmdk-foreground:.985 0 0;--bcmdk-card:.145 0 0;--bcmdk-card-foreground:.985 0 0;--bcmdk-popover:.145 0 0;--bcmdk-popover-foreground:.985 0 0;--bcmdk-primary:.985 0 0;--bcmdk-primary-foreground:.205 0 0;--bcmdk-secondary:.269 0 0;--bcmdk-secondary-foreground:.985 0 0;--bcmdk-muted:.269 0 0;--bcmdk-muted-foreground:.708 0 0;--bcmdk-accent:.269 0 0;--bcmdk-accent-foreground:.985 0 0;--bcmdk-destructive:.396 .141 25.723;--bcmdk-destructive-foreground:.637 .237 25.331;--bcmdk-border:.269 0 0;--bcmdk-input:.269 0 0;--bcmdk-ring:.439 0 0}@keyframes bcmdk-enter{0%{opacity:var(--bcmdk-enter-opacity,1);transform:translate3d(var(--bcmdk-enter-x,0),var(--bcmdk-enter-y,0),0)scale(var(--bcmdk-enter-scale,1))}to{opacity:1;transform:translate(0)scale(1)}}@keyframes bcmdk-exit{0%{opacity:1;transform:translate(0)scale(1)}to{opacity:var(--bcmdk-exit-opacity,1);transform:translate3d(var(--bcmdk-exit-x,0),var(--bcmdk-exit-y,0),0)scale(var(--bcmdk-exit-scale,1))}}.bcmdk-root .animate-in{animation:.22s cubic-bezier(.16,1,.3,1) both bcmdk-enter}.bcmdk-root .animate-out{animation:.18s cubic-bezier(.4,0,1,1) both bcmdk-exit}.bcmdk-root .fade-in-0{--bcmdk-enter-opacity:0}.bcmdk-root .fade-out-0{--bcmdk-exit-opacity:0}.bcmdk-root .zoom-in-95{--bcmdk-enter-scale:.95}.bcmdk-root .zoom-out-95{--bcmdk-exit-scale:.95}.bcmdk-root .slide-in-from-bottom-8{--bcmdk-enter-y:2rem}.bcmdk-root .slide-out-to-bottom-8{--bcmdk-exit-y:2rem}.bcmdk-root .slide-in-from-top-2{--bcmdk-enter-y:-.5rem}.bcmdk-root .slide-out-to-top-2{--bcmdk-exit-y:-.5rem}@keyframes spin{to{transform:rotate(360deg)}}
@@ -51,85 +51,42 @@ bun add better-cmdk modifywithai @ai-sdk/react ai
51
51
 
52
52
  ## Step 3: CSS Setup
53
53
 
54
- better-cmdk uses Tailwind CSS and shadcn/ui design tokens.
54
+ better-cmdk ships precompiled styles with namespaced tokens.
55
55
 
56
56
  ### Tailwind v4
57
57
 
58
- Add to my main CSS file (next to the existing `@import "tailwindcss"`):
58
+ Add to my main CSS file:
59
59
 
60
60
  ```css
61
- @source "node_modules/better-cmdk";
61
+ @import "tailwindcss";
62
+ @import "better-cmdk";
62
63
  ```
63
64
 
64
- If my app **already has shadcn/ui CSS variables**, verify they include `--popover`, `--muted`, `--border`, `--ring`, `--primary`, `--primary-foreground`. Don't overwrite existing variables.
65
+ If my app wants custom theming, override better-cmdk's namespaced variables.
65
66
 
66
- If my app **does not have** these variables, add the minimal set:
67
+ Add this minimal override block only when needed:
67
68
 
68
69
  ```css
69
- :root {
70
- --radius: 0.625rem;
71
- --background: oklch(1 0 0);
72
- --foreground: oklch(0.145 0 0);
73
- --popover: oklch(1 0 0);
74
- --popover-foreground: oklch(0.145 0 0);
75
- --primary: oklch(0.205 0 0);
76
- --primary-foreground: oklch(0.985 0 0);
77
- --muted: oklch(0.97 0 0);
78
- --muted-foreground: oklch(0.556 0 0);
79
- --border: oklch(0.922 0 0);
80
- --input: oklch(0.922 0 0);
81
- --ring: oklch(0.708 0 0);
82
- }
83
-
84
- @theme inline {
85
- --color-background: var(--background);
86
- --color-foreground: var(--foreground);
87
- --color-popover: var(--popover);
88
- --color-popover-foreground: var(--popover-foreground);
89
- --color-primary: var(--primary);
90
- --color-primary-foreground: var(--primary-foreground);
91
- --color-muted: var(--muted);
92
- --color-muted-foreground: var(--muted-foreground);
93
- --color-border: var(--border);
94
- --color-input: var(--input);
95
- --color-ring: var(--ring);
96
- --radius-sm: calc(var(--radius) - 4px);
97
- --radius-md: calc(var(--radius) - 2px);
98
- --radius-lg: var(--radius);
99
- --radius-xl: calc(var(--radius) + 4px);
70
+ .bcmdk-root {
71
+ --bcmdk-radius: 0.625rem;
72
+ --bcmdk-background: 1 0 0;
73
+ --bcmdk-foreground: 0.145 0 0;
74
+ --bcmdk-primary: 0.205 0 0;
75
+ --bcmdk-primary-foreground: 0.985 0 0;
76
+ --bcmdk-muted: 0.97 0 0;
77
+ --bcmdk-muted-foreground: 0.556 0 0;
78
+ --bcmdk-border: 0.922 0 0;
79
+ --bcmdk-input: 0.922 0 0;
80
+ --bcmdk-ring: 0.708 0 0;
100
81
  }
101
82
  ```
102
83
 
103
84
  ### Tailwind v3
104
85
 
105
- Add to `tailwind.config.js` or `tailwind.config.ts`:
106
-
107
- ```js
108
- content: [
109
- // ... existing paths
110
- "./node_modules/better-cmdk/**/*.{js,ts,jsx,tsx}",
111
- ],
112
- ```
113
-
114
- If my app **does not have** shadcn/ui CSS variables, add the minimal set (hsl format):
86
+ Use the same CSS import approach:
115
87
 
116
88
  ```css
117
- @layer base {
118
- :root {
119
- --radius: 0.5rem;
120
- --background: 0 0% 100%;
121
- --foreground: 240 10% 3.9%;
122
- --popover: 0 0% 100%;
123
- --popover-foreground: 240 10% 3.9%;
124
- --primary: 240 5.9% 10%;
125
- --primary-foreground: 0 0% 98%;
126
- --muted: 240 4.8% 95.9%;
127
- --muted-foreground: 240 3.8% 46.1%;
128
- --border: 240 5.9% 90%;
129
- --input: 240 5.9% 90%;
130
- --ring: 240 5.9% 10%;
131
- }
132
- }
89
+ @import "better-cmdk";
133
90
  ```
134
91
 
135
92
  ---
@@ -51,85 +51,42 @@ bun add better-cmdk modifywithai @ai-sdk/react ai
51
51
 
52
52
  ## Step 3: CSS Setup
53
53
 
54
- better-cmdk uses Tailwind CSS and shadcn/ui design tokens.
54
+ better-cmdk ships precompiled styles with namespaced tokens.
55
55
 
56
56
  ### Tailwind v4
57
57
 
58
- Add to my main CSS file (next to the existing `@import "tailwindcss"`):
58
+ Add to my main CSS file:
59
59
 
60
60
  ```css
61
- @source "node_modules/better-cmdk";
61
+ @import "tailwindcss";
62
+ @import "better-cmdk";
62
63
  ```
63
64
 
64
- If my app **already has shadcn/ui CSS variables**, verify they include `--popover`, `--muted`, `--border`, `--ring`, `--primary`, `--primary-foreground`. Don't overwrite existing variables.
65
+ If my app wants custom theming, override better-cmdk's namespaced variables.
65
66
 
66
- If my app **does not have** these variables, add the minimal set:
67
+ Add this minimal override block only when needed:
67
68
 
68
69
  ```css
69
- :root {
70
- --radius: 0.625rem;
71
- --background: oklch(1 0 0);
72
- --foreground: oklch(0.145 0 0);
73
- --popover: oklch(1 0 0);
74
- --popover-foreground: oklch(0.145 0 0);
75
- --primary: oklch(0.205 0 0);
76
- --primary-foreground: oklch(0.985 0 0);
77
- --muted: oklch(0.97 0 0);
78
- --muted-foreground: oklch(0.556 0 0);
79
- --border: oklch(0.922 0 0);
80
- --input: oklch(0.922 0 0);
81
- --ring: oklch(0.708 0 0);
82
- }
83
-
84
- @theme inline {
85
- --color-background: var(--background);
86
- --color-foreground: var(--foreground);
87
- --color-popover: var(--popover);
88
- --color-popover-foreground: var(--popover-foreground);
89
- --color-primary: var(--primary);
90
- --color-primary-foreground: var(--primary-foreground);
91
- --color-muted: var(--muted);
92
- --color-muted-foreground: var(--muted-foreground);
93
- --color-border: var(--border);
94
- --color-input: var(--input);
95
- --color-ring: var(--ring);
96
- --radius-sm: calc(var(--radius) - 4px);
97
- --radius-md: calc(var(--radius) - 2px);
98
- --radius-lg: var(--radius);
99
- --radius-xl: calc(var(--radius) + 4px);
70
+ .bcmdk-root {
71
+ --bcmdk-radius: 0.625rem;
72
+ --bcmdk-background: 1 0 0;
73
+ --bcmdk-foreground: 0.145 0 0;
74
+ --bcmdk-primary: 0.205 0 0;
75
+ --bcmdk-primary-foreground: 0.985 0 0;
76
+ --bcmdk-muted: 0.97 0 0;
77
+ --bcmdk-muted-foreground: 0.556 0 0;
78
+ --bcmdk-border: 0.922 0 0;
79
+ --bcmdk-input: 0.922 0 0;
80
+ --bcmdk-ring: 0.708 0 0;
100
81
  }
101
82
  ```
102
83
 
103
84
  ### Tailwind v3
104
85
 
105
- Add to `tailwind.config.js` or `tailwind.config.ts`:
106
-
107
- ```js
108
- content: [
109
- // ... existing paths
110
- "./node_modules/better-cmdk/**/*.{js,ts,jsx,tsx}",
111
- ],
112
- ```
113
-
114
- If my app **does not have** shadcn/ui CSS variables, add the minimal set (hsl format):
86
+ Use the same CSS import approach:
115
87
 
116
88
  ```css
117
- @layer base {
118
- :root {
119
- --radius: 0.5rem;
120
- --background: 0 0% 100%;
121
- --foreground: 240 10% 3.9%;
122
- --popover: 0 0% 100%;
123
- --popover-foreground: 240 10% 3.9%;
124
- --primary: 240 5.9% 10%;
125
- --primary-foreground: 0 0% 98%;
126
- --muted: 240 4.8% 95.9%;
127
- --muted-foreground: 240 3.8% 46.1%;
128
- --border: 240 5.9% 90%;
129
- --input: 240 5.9% 90%;
130
- --ring: 240 5.9% 10%;
131
- }
132
- }
89
+ @import "better-cmdk";
133
90
  ```
134
91
 
135
92
  ---
package/index.css ADDED
@@ -0,0 +1 @@
1
+ @import "./dist/styles.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-cmdk",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "types": "./index.ts",
6
6
  "exports": {
@@ -8,20 +8,28 @@
8
8
  "./lib/utils": "./dist/lib/utils.js",
9
9
  "./package.json": "./package.json"
10
10
  },
11
+ "style": "./index.css",
12
+ "sideEffects": [
13
+ "**/*.css"
14
+ ],
11
15
  "files": [
12
16
  "dist",
13
- "AGENTS.md"
17
+ "AGENTS.md",
18
+ "index.css"
14
19
  ],
15
20
  "scripts": {
21
+ "build:css": "tailwindcss -i ./styles/index.css -o ./dist/styles.css --minify && bun run scripts/sanitize-library-css.ts",
16
22
  "build:prompts": "bun run scripts/build-prompts.ts",
17
- "build": "bun run --bun tsdown && bun run build:prompts",
18
- "build:publish": "bun run --bun tsdown --publish && bun run build:prompts"
23
+ "build": "bun run --bun tsdown && bun run build:css && bun run build:prompts",
24
+ "build:publish": "bun run --bun tsdown --publish && bun run build:css && bun run build:prompts"
19
25
  },
20
26
  "devDependencies": {
27
+ "@tailwindcss/cli": "^4.1.18",
21
28
  "@biomejs/biome": "^2.3.14",
22
29
  "@types/bun": "latest",
23
30
  "@types/react": "^19.2.14",
24
31
  "@types/react-dom": "^19.2.3",
32
+ "tailwindcss": "^4.1.18",
25
33
  "tsdown": "^0.20.3",
26
34
  "typescript": "^5.9.3"
27
35
  },