@app-studio/components 0.10.24 → 0.10.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/web.cjs.js CHANGED
@@ -20,10 +20,10 @@
20
20
  border-radius: 4px !important;
21
21
  width: 100% !important;
22
22
  }
23
- `;function xo(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const Ll=({id:e,name:o,label:t,value:n="",length:a=6,onChange:i,onChangeText:s,onComplete:c,helperText:d,placeholder:u="",shadow:m,views:g={},size:h="md",shape:f="rounded",variant:y="outline",gap:b=8,type:k="text",error:C=!1,isFocused:j=!1,isHovered:w=!1,isDisabled:S=!1,isReadOnly:x=!1,isAutoFocus:v=!1,setValue:T,setIsFocused:R,setIsHovered:M,inputRef:E,containerRef:I,mirrorSelectionStart:V,mirrorSelectionEnd:P,setMirrorSelectionStart:z,setMirrorSelectionEnd:W,handlePaste:F,handleChange:H,handleFocus:D,handleBlur:L,handleKeyDown:B,handleKeyPress:$,secureTextEntry:O,isFirstColumn:N,stepValues:_,setInputRef:Y,onBlur:A=()=>{},onClick:G=()=>{},onFocus:Q=()=>{},onKeyPress:X,pattern:K,pasteTransformer:oe,...te})=>{l.useTheme();const re=!!t,U=p.useMemo(()=>({slots:Array.from({length:a}).map((J,ee)=>{const ie=j&&V!==null&&P!==null&&(V===P&&ee===V||ee>=V&&ee<P),ae=n[ee]!==void 0?n[ee]:null,ue=n[0]!==void 0?null:(u==null?void 0:u[ee])??null;return{char:ae,placeholderChar:ue,isActive:ie,hasFakeCaret:ie&&ae===null}}),isFocused:j,isHovering:!S&&w}),[j,w,S,a,P,V,u,n]);p.useEffect(()=>{v&&E.current&&E.current.focus()},[v,E]),p.useEffect(()=>{if(!document.getElementById("input-otp-style")){const J=document.createElement("style");if(J.id="input-otp-style",document.head.appendChild(J),J.sheet){const ee="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";xo(J.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),xo(J.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),xo(J.sheet,`[data-input-otp]:autofill { ${ee} }`),xo(J.sheet,`[data-input-otp]:-webkit-autofill { ${ee} }`),xo(J.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),xo(J.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const Z=()=>r.jsx(l.Horizontal,{gap:b,width:"100%",justifyContent:"center",minHeight:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...g.container,children:U.slots.map((J,ee)=>r.jsxs(Ze,{size:h,error:C,shape:f,views:g,variant:y,value:J.char||"",color:"theme-primary",isHovered:w,isDisabled:S,isReadOnly:x,isFocused:J.isActive,showLabel:!1,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...g.container,children:[J.char?r.jsx(l.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",fontWeight:"medium",...g.text,children:k==="password"?"•":J.char}):J.placeholderChar?r.jsx(l.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...g.text,children:J.placeholderChar}):null,J.hasFakeCaret&&r.jsx(l.View,{position:"absolute",width:"2px",height:"60%",backgroundColor:"theme-primary",animation:"blink 1s step-start infinite",style:{animationName:"blink",animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"step-start"}})]},`${e||o}-${ee}`))}),le={position:"absolute",inset:0,width:"100%",height:"100%",display:"flex",textAlign:"center",opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"};return r.jsxs(r.Fragment,{children:[r.jsx("noscript",{children:r.jsx("style",{children:oh})}),r.jsxs(qe,{helperText:d,error:C,views:g,...te,children:[re&&r.jsx(io,{htmlFor:e,color:"theme-primary",error:C,...g.label,children:t}),r.jsxs(l.View,{ref:I,"data-input-otp-container":!0,position:"relative",cursor:S?"default":"text",userSelect:"none",pointerEvents:"none",children:[r.jsx(eh.Provider,{value:U,children:Z()}),r.jsx(l.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(l.Input,{ref:J=>Y(J),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":V,"data-input-otp-mse":P,id:e||o,name:o,type:k==="password"?"password":"text",inputMode:k!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:a,readOnly:x,disabled:S,placeholder:u,value:n,onChange:H,onKeyDown:B,onPaste:F,onFocus:D,onBlur:L,onClick:G,onMouseOver:()=>M(!0),onMouseLeave:()=>M(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${a} digits`,style:le,...g.input})})]})]})]})},rh=e=>{if(e==null)return"";if(typeof e=="string"||typeof e=="number"){const o=String(e);return o==="[object Object]"?"":o}return""},th=(e,o)=>{console.log(`[OTPInput] ${e}`,o)},Un=e=>e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:Object.prototype.toString.call(e),nh=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:a,setIsFocused:i,isHovered:s,setIsHovered:c,inputRef:d,containerRef:u,mirrorSelectionStart:m,mirrorSelectionEnd:g,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:y,handleChange:b,handleFocus:k,handleBlur:C,handleKeyDown:j,handlePaste:w,handleKeyPress:S}=$l(e),v=rh(o!==void 0?o:t);return th("render",{name:e.name,controlledValue:Un(o),internalValue:Un(t),displayValue:v,length:e.length||6,hasOnChange:!!e.onChange,hasOnChangeText:!!e.onChangeText}),r.jsx(Ll,{...e,value:v,setValue:n,isFocused:a,setIsFocused:i,isHovered:s,setIsHovered:c,inputRef:d,containerRef:u,mirrorSelectionStart:m,mirrorSelectionEnd:g,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:y,handleChange:b,handleFocus:k,handleBlur:C,handleKeyDown:j,handleKeyPress:S,handlePaste:w,stepValues:e.stepValues})},_l=nh,Bl=p.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),ah=()=>p.useContext(Bl),lh=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...a})=>{const i=He.useFormikContext();p.useEffect(()=>{n(i.values)},[i.values]);const s=p.useRef({}),c=p.useRef([]),d=(g,h)=>{s.current[g]=h,h&&!c.current.includes(g)&&c.current.push(g)},u=g=>{var h,f;if(o){const b=c.current.indexOf(g)+1;b<c.current.length?(h=s.current[c.current[b]])==null||h.focus():(f=i.submitForm)==null||f.call(i)}},m={active:o,focusNextInput:u,setInputRef:d,handleSubmitEditing:u,getReturnKeyType:g=>c.current.indexOf(g)===c.current.length-1?"done":"next"};return p.useEffect(()=>{var g,h;o&&(t&&s.current[t]?(g=s.current[t])==null||g.focus():c.current[0]&&((h=s.current[c.current[0]])==null||h.focus()))},[o,t]),r.jsx(Bl.Provider,{value:m,children:r.jsx(l.Form,{...a,children:e})})},ih=e=>{switch(e){case"email":return{autoCorrect:"off",inputMode:"email",autoCapitalize:"none"};case"password":return{autoCorrect:"off",secureTextEntry:!0,autoCapitalize:"none"};case"digits":return{inputMode:"tel"};case"numeric":return{inputMode:"numeric"};case"name":return{autoCorrect:"off"};default:return{}}},fe=({name:e,type:o,...t},n={})=>{const a=ah(),{touched:i,errors:s,submitCount:c,values:d,setFieldTouched:u,setFieldValue:m}=He.useFormikContext(),g=x=>{var v;m(e,x),(v=t.onChangeText)==null||v.call(t,x)},h=x=>{var v;m(e,x),(v=t.onChange)==null||v.call(t,x)},f=()=>{u(e,!0)},y=x=>{x.key==="Enter"&&(x.preventDefault(),a.focusNextInput(e))},b=["text","password","email","digits"].includes(o),k=He.getIn(i,e)||c>0?He.getIn(s,e):void 0,C=He.getIn(d,e),j=typeof document<"u"&&typeof document.createElement=="function",w=!!n.focusable&&a.active,S=w?j?{onKeyPress:y}:{returnKeyType:a.getReturnKeyType(e),onSubmitEditing:()=>a.handleSubmitEditing(e),blurOnSubmit:!1}:{};return{...ih(o),...t,value:C,error:k,onBlur:f,...b?{onChangeText:g}:{onChange:h},...S,...w?{inputRef:x=>a.setInputRef(e,x)}:{}}},sh=e=>{let{value:o,...t}=fe(e);t.isChecked=o;const n=jl(e);return r.jsx(wl,{...n,...t})},ch=sh,Ol=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,n]=p.useState(!1),[a,i]=p.useState(o!==void 0?o:e);return p.useEffect(()=>{o!==void 0&&i(o)},[o]),{isHovered:t,setIsHovered:n,isSelected:a,setIsSelected:i}},dh={xs:{height:"16px",width:"16px"},sm:{height:"20px",width:"20px"},md:{height:"24px",width:"24px"},lg:{height:"28px",width:"28px"},xl:{height:"32px",width:"32px"}},uh={xs:{height:"8px",width:"8px"},sm:{height:"10px",width:"10px"},md:{height:"12px",width:"12px"},lg:{height:"14px",width:"14px"},xl:{height:"16px",width:"16px"}},ph={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",style:{backgroundColor:"transparent"}}},mh={selected:{backgroundColor:"theme-primary"},unselected:{style:{backgroundColor:"transparent"}}},nt={hover:{selected:{borderColor:"color-blue-600"},unselected:{borderColor:"color-gray-400"}},disabled:{selected:{borderColor:"color-gray-300",opacity:.6},unselected:{borderColor:"color-gray-300",opacity:.6}},error:{selected:{borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"}}},at={hover:{selected:{backgroundColor:"color-blue-600"},unselected:{style:{backgroundColor:"transparent"}}},disabled:{selected:{backgroundColor:"color-gray-300",opacity:.6},unselected:{opacity:.6,style:{backgroundColor:"transparent"}}},error:{selected:{backgroundColor:"color-red-500"},unselected:{style:{backgroundColor:"transparent"}}}},Nl=({id:e,icon:o,name:t,label:n,value:a,isChecked:i,onChange:s,onValueChange:c,shadow:d={},labelPosition:u="right",size:m="md",error:g=!1,isSelected:h=!1,isHovered:f=!1,isDisabled:y=!1,isReadOnly:b=!1,defaultIsSelected:k=!1,setIsSelected:C=()=>{},setIsHovered:j=()=>{},views:w={radio:{},label:{}},infoText:S,helperText:x,...v})=>{const T=()=>j(!f),R=()=>{!b&&!y&&(C&&C(!0),s&&s(a),c&&c(a))},M=i||h?"selected":"unselected",E=g?nt.error[M]:y?nt.disabled[M]:f?nt.hover[M]:{},I=g?at.error[M]:y?at.disabled[M]:f?at.hover[M]:{},V={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",selected:{borderColor:"theme-primary"},color:g?"color-red-600":y?"color-gray-400":"inherit",cursor:y?"not-allowed":b?"default":"pointer",opacity:y?.6:1,transition:"all 0.2s ease-in-out",...w.label},radio:{...ph[M],...E,borderRadius:"50%",selected:{backgroundColor:"theme-primary"},backgroundColor:"color-white",...dh[m],transition:"all 0.2s ease-in-out",...d,...w.radio},dot:{...mh[M],...I,borderRadius:"50%",...uh[m],transition:"all 0.2s ease-in-out"}};return r.jsxs(tr,{htmlFor:e,as:"div",onClick:R,onMouseEnter:T,onMouseLeave:T,size:l.Typography.fontSizes[m],...V.container,...v,children:[r.jsxs(l.Vertical,{gap:8,children:[" ",r.jsxs(l.Horizontal,{gap:12,alignItems:"center",children:[" ",u==="left"&&n&&r.jsx(l.Text,{size:m,fontWeight:"500",...w==null?void 0:w.label,children:n}),r.jsx(l.Center,{...V.radio,children:(i||h)&&r.jsx(l.View,{...V.dot})}),u==="right"&&n&&r.jsx(l.Text,{size:m,fontWeight:"500",...w==null?void 0:w.label,children:n})]}),S&&r.jsx(l.Text,{marginLeft:u==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"20px",...w==null?void 0:w.infoText,children:S})]}),g&&r.jsx(l.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"color 0.2s ease, opacity 0.2s ease",children:g})]})},gh=e=>{let{value:o,...t}=fe(e);t.isChecked=o===e.value;const n=Ol(e);return r.jsx(Nl,{...n,...t})},hh=gh,ql=e=>{const{value:o,onChange:t,onSubmit:n,autoFocus:a=!0,loading:i=!1,disabled:s=!1,isAgentRunning:c=!1,onStopAgent:d,sandboxId:u,onUploadProgress:m,onUploadSuccess:g,onUploadError:h,onFileUpload:f}=e,y=o!==void 0&&t!==void 0,[b,k]=p.useState(""),C=y?o:b,[j,w]=p.useState([]),[S,x]=p.useState([]),[v,T]=p.useState(!1),[R,M]=p.useState(0),[E,I]=p.useState([]),[V,P]=p.useState(!1),z=p.useRef(null),[W,F]=p.useState(!1),[H,D]=p.useState("gpt-4"),[L]=p.useState([{id:"gpt-3.5-turbo",name:"GPT-3.5"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-4-thinking",name:"GPT-4 (Thinking)",isThinking:!0},{id:"claude-3-5-sonnet",name:"Claude 3.5 Sonnet"}]),B=p.useRef(null),$=p.useRef(null),[O,N]=p.useState(e.showGuideTip||!1);p.useEffect(()=>{a&&B.current&&B.current.focus()},[a]),p.useEffect(()=>()=>{j.forEach(J=>{})},[j]);const _=J=>{y&&t?t(J):k(J)},Y=J=>{if(J.preventDefault(),!C.trim()&&j.length===0||i||s&&!c)return;if(c&&d){d();return}let ee=C;if(j.length>0){const ue=j.map(Re=>`[Uploaded File: ${URL.createObjectURL(Re)}}]`).join(`
23
+ `;function xo(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const Ll=({id:e,name:o,label:t,value:n="",length:a=6,onChange:i,onChangeText:s,onComplete:c,helperText:d,placeholder:u="",shadow:m,views:g={},size:h="md",shape:f="rounded",variant:y="outline",gap:b=8,type:k="text",error:C=!1,isFocused:j=!1,isHovered:w=!1,isDisabled:S=!1,isReadOnly:x=!1,isAutoFocus:v=!1,setValue:T,setIsFocused:R,setIsHovered:M,inputRef:E,containerRef:I,mirrorSelectionStart:V,mirrorSelectionEnd:P,setMirrorSelectionStart:z,setMirrorSelectionEnd:W,handlePaste:F,handleChange:H,handleFocus:D,handleBlur:L,handleKeyDown:B,handleKeyPress:$,secureTextEntry:O,isFirstColumn:N,stepValues:_,setInputRef:Y,onBlur:A=()=>{},onClick:G=()=>{},onFocus:Q=()=>{},onKeyPress:X,pattern:K,pasteTransformer:oe,...te})=>{l.useTheme();const re=!!t,U=p.useMemo(()=>({slots:Array.from({length:a}).map((J,ee)=>{const ie=j&&V!==null&&P!==null&&(V===P&&ee===V||ee>=V&&ee<P),ae=n[ee]!==void 0?n[ee]:null,ue=n[0]!==void 0?null:(u==null?void 0:u[ee])??null;return{char:ae,placeholderChar:ue,isActive:ie,hasFakeCaret:ie&&ae===null}}),isFocused:j,isHovering:!S&&w}),[j,w,S,a,P,V,u,n]);p.useEffect(()=>{v&&E.current&&E.current.focus()},[v,E]),p.useEffect(()=>{if(!document.getElementById("input-otp-style")){const J=document.createElement("style");if(J.id="input-otp-style",document.head.appendChild(J),J.sheet){const ee="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";xo(J.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),xo(J.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),xo(J.sheet,`[data-input-otp]:autofill { ${ee} }`),xo(J.sheet,`[data-input-otp]:-webkit-autofill { ${ee} }`),xo(J.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),xo(J.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const Z=()=>r.jsx(l.Horizontal,{gap:b,width:"100%",justifyContent:"center",minHeight:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...g.container,children:U.slots.map((J,ee)=>r.jsxs(Ze,{size:h,error:C,shape:f,views:g,variant:y,value:J.char||"",color:"theme-primary",isHovered:w,isDisabled:S,isReadOnly:x,isFocused:J.isActive,showLabel:!1,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...g.container,children:[J.char?r.jsx(l.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",fontWeight:"medium",...g.text,children:k==="password"?"•":J.char}):J.placeholderChar?r.jsx(l.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...g.text,children:J.placeholderChar}):null,J.hasFakeCaret&&r.jsx(l.View,{position:"absolute",width:"2px",height:"60%",backgroundColor:"theme-primary",animation:"blink 1s step-start infinite",style:{animationName:"blink",animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"step-start"}})]},`${e||o}-${ee}`))}),le={position:"absolute",inset:0,width:"100%",height:"100%",display:"flex",textAlign:"center",opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"};return r.jsxs(r.Fragment,{children:[r.jsx("noscript",{children:r.jsx("style",{children:oh})}),r.jsxs(qe,{helperText:d,error:C,views:g,...te,children:[re&&r.jsx(io,{htmlFor:e,color:"theme-primary",error:C,...g.label,children:t}),r.jsxs(l.View,{ref:I,"data-input-otp-container":!0,position:"relative",cursor:S?"default":"text",userSelect:"none",pointerEvents:"none",children:[r.jsx(eh.Provider,{value:U,children:Z()}),r.jsx(l.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(l.Input,{ref:J=>Y(J),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":V,"data-input-otp-mse":P,id:e||o,name:o,type:k==="password"?"password":"text",inputMode:k!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:a,readOnly:x,disabled:S,placeholder:u,value:n,onChange:H,onKeyDown:B,onPaste:F,onFocus:D,onBlur:L,onClick:G,onMouseOver:()=>M(!0),onMouseLeave:()=>M(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${a} digits`,style:le,...g.input})})]})]})]})},rh=e=>{if(e==null)return"";if(typeof e=="string"||typeof e=="number"){const o=String(e);return o==="[object Object]"?"":o}return""},th=(e,o)=>{console.log(`[OTPInput] ${e}`,o)},Un=e=>e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:Object.prototype.toString.call(e),nh=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:a,setIsFocused:i,isHovered:s,setIsHovered:c,inputRef:d,containerRef:u,mirrorSelectionStart:m,mirrorSelectionEnd:g,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:y,handleChange:b,handleFocus:k,handleBlur:C,handleKeyDown:j,handlePaste:w,handleKeyPress:S}=$l(e),v=rh(o!==void 0?o:t);return th("render",{name:e.name,controlledValue:Un(o),internalValue:Un(t),displayValue:v,length:e.length||6,hasOnChange:!!e.onChange,hasOnChangeText:!!e.onChangeText}),r.jsx(Ll,{...e,value:v,setValue:n,isFocused:a,setIsFocused:i,isHovered:s,setIsHovered:c,inputRef:d,containerRef:u,mirrorSelectionStart:m,mirrorSelectionEnd:g,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:y,handleChange:b,handleFocus:k,handleBlur:C,handleKeyDown:j,handleKeyPress:S,handlePaste:w,stepValues:e.stepValues})},_l=nh,Bl=p.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),ah=()=>p.useContext(Bl),lh=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...a})=>{const i=He.useFormikContext();p.useEffect(()=>{n(i.values)},[i.values]);const s=p.useRef({}),c=p.useRef([]),d=(f,y)=>{s.current[f]=y,y&&!c.current.includes(f)&&c.current.push(f)},u=f=>{var y,b;if(o){const C=c.current.indexOf(f)+1;C<c.current.length?(y=s.current[c.current[C]])==null||y.focus():(b=i.submitForm)==null||b.call(i)}},m={active:o,focusNextInput:u,setInputRef:d,handleSubmitEditing:u,getReturnKeyType:f=>c.current.indexOf(f)===c.current.length-1?"done":"next"};p.useEffect(()=>{var f,y;o&&(t&&s.current[t]?(f=s.current[t])==null||f.focus():c.current[0]&&((y=s.current[c.current[0]])==null||y.focus()))},[o,t]);const h=typeof document<"u"&&typeof document.createElement=="function"?{onSubmit:i.handleSubmit,onReset:i.handleReset}:{};return r.jsx(Bl.Provider,{value:m,children:r.jsx(l.Form,{...a,...h,children:e})})},ih=e=>{switch(e){case"email":return{autoCorrect:"off",inputMode:"email",autoCapitalize:"none"};case"password":return{autoCorrect:"off",secureTextEntry:!0,autoCapitalize:"none"};case"digits":return{inputMode:"tel"};case"numeric":return{inputMode:"numeric"};case"name":return{autoCorrect:"off"};default:return{}}},fe=({name:e,type:o,...t},n={})=>{const a=ah(),{touched:i,errors:s,submitCount:c,values:d,setFieldTouched:u,setFieldValue:m}=He.useFormikContext(),g=x=>{var v;m(e,x),(v=t.onChangeText)==null||v.call(t,x)},h=x=>{var v;m(e,x),(v=t.onChange)==null||v.call(t,x)},f=()=>{u(e,!0)},y=x=>{x.key==="Enter"&&(x.preventDefault(),a.focusNextInput(e))},b=["text","password","email","digits"].includes(o),k=He.getIn(i,e)||c>0?He.getIn(s,e):void 0,C=He.getIn(d,e),j=typeof document<"u"&&typeof document.createElement=="function",w=!!n.focusable&&a.active,S=w?j?{onKeyPress:y}:{returnKeyType:a.getReturnKeyType(e),onSubmitEditing:()=>a.handleSubmitEditing(e),blurOnSubmit:!1}:{};return{...ih(o),...t,value:C,error:k,onBlur:f,...b?{onChangeText:g}:{onChange:h},...S,...w?{inputRef:x=>a.setInputRef(e,x)}:{}}},sh=e=>{let{value:o,...t}=fe(e);t.isChecked=o;const n=jl(e);return r.jsx(wl,{...n,...t})},ch=sh,Ol=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,n]=p.useState(!1),[a,i]=p.useState(o!==void 0?o:e);return p.useEffect(()=>{o!==void 0&&i(o)},[o]),{isHovered:t,setIsHovered:n,isSelected:a,setIsSelected:i}},dh={xs:{height:"16px",width:"16px"},sm:{height:"20px",width:"20px"},md:{height:"24px",width:"24px"},lg:{height:"28px",width:"28px"},xl:{height:"32px",width:"32px"}},uh={xs:{height:"8px",width:"8px"},sm:{height:"10px",width:"10px"},md:{height:"12px",width:"12px"},lg:{height:"14px",width:"14px"},xl:{height:"16px",width:"16px"}},ph={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",style:{backgroundColor:"transparent"}}},mh={selected:{backgroundColor:"theme-primary"},unselected:{style:{backgroundColor:"transparent"}}},nt={hover:{selected:{borderColor:"color-blue-600"},unselected:{borderColor:"color-gray-400"}},disabled:{selected:{borderColor:"color-gray-300",opacity:.6},unselected:{borderColor:"color-gray-300",opacity:.6}},error:{selected:{borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"}}},at={hover:{selected:{backgroundColor:"color-blue-600"},unselected:{style:{backgroundColor:"transparent"}}},disabled:{selected:{backgroundColor:"color-gray-300",opacity:.6},unselected:{opacity:.6,style:{backgroundColor:"transparent"}}},error:{selected:{backgroundColor:"color-red-500"},unselected:{style:{backgroundColor:"transparent"}}}},Nl=({id:e,icon:o,name:t,label:n,value:a,isChecked:i,onChange:s,onValueChange:c,shadow:d={},labelPosition:u="right",size:m="md",error:g=!1,isSelected:h=!1,isHovered:f=!1,isDisabled:y=!1,isReadOnly:b=!1,defaultIsSelected:k=!1,setIsSelected:C=()=>{},setIsHovered:j=()=>{},views:w={radio:{},label:{}},infoText:S,helperText:x,...v})=>{const T=()=>j(!f),R=()=>{!b&&!y&&(C&&C(!0),s&&s(a),c&&c(a))},M=i||h?"selected":"unselected",E=g?nt.error[M]:y?nt.disabled[M]:f?nt.hover[M]:{},I=g?at.error[M]:y?at.disabled[M]:f?at.hover[M]:{},V={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",selected:{borderColor:"theme-primary"},color:g?"color-red-600":y?"color-gray-400":"inherit",cursor:y?"not-allowed":b?"default":"pointer",opacity:y?.6:1,transition:"all 0.2s ease-in-out",...w.label},radio:{...ph[M],...E,borderRadius:"50%",selected:{backgroundColor:"theme-primary"},backgroundColor:"color-white",...dh[m],transition:"all 0.2s ease-in-out",...d,...w.radio},dot:{...mh[M],...I,borderRadius:"50%",...uh[m],transition:"all 0.2s ease-in-out"}};return r.jsxs(tr,{htmlFor:e,as:"div",onClick:R,onMouseEnter:T,onMouseLeave:T,size:l.Typography.fontSizes[m],...V.container,...v,children:[r.jsxs(l.Vertical,{gap:8,children:[" ",r.jsxs(l.Horizontal,{gap:12,alignItems:"center",children:[" ",u==="left"&&n&&r.jsx(l.Text,{size:m,fontWeight:"500",...w==null?void 0:w.label,children:n}),r.jsx(l.Center,{...V.radio,children:(i||h)&&r.jsx(l.View,{...V.dot})}),u==="right"&&n&&r.jsx(l.Text,{size:m,fontWeight:"500",...w==null?void 0:w.label,children:n})]}),S&&r.jsx(l.Text,{marginLeft:u==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"20px",...w==null?void 0:w.infoText,children:S})]}),g&&r.jsx(l.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"color 0.2s ease, opacity 0.2s ease",children:g})]})},gh=e=>{let{value:o,...t}=fe(e);t.isChecked=o===e.value;const n=Ol(e);return r.jsx(Nl,{...n,...t})},hh=gh,ql=e=>{const{value:o,onChange:t,onSubmit:n,autoFocus:a=!0,loading:i=!1,disabled:s=!1,isAgentRunning:c=!1,onStopAgent:d,sandboxId:u,onUploadProgress:m,onUploadSuccess:g,onUploadError:h,onFileUpload:f}=e,y=o!==void 0&&t!==void 0,[b,k]=p.useState(""),C=y?o:b,[j,w]=p.useState([]),[S,x]=p.useState([]),[v,T]=p.useState(!1),[R,M]=p.useState(0),[E,I]=p.useState([]),[V,P]=p.useState(!1),z=p.useRef(null),[W,F]=p.useState(!1),[H,D]=p.useState("gpt-4"),[L]=p.useState([{id:"gpt-3.5-turbo",name:"GPT-3.5"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-4-thinking",name:"GPT-4 (Thinking)",isThinking:!0},{id:"claude-3-5-sonnet",name:"Claude 3.5 Sonnet"}]),B=p.useRef(null),$=p.useRef(null),[O,N]=p.useState(e.showGuideTip||!1);p.useEffect(()=>{a&&B.current&&B.current.focus()},[a]),p.useEffect(()=>()=>{j.forEach(J=>{})},[j]);const _=J=>{y&&t?t(J):k(J)},Y=J=>{if(J.preventDefault(),!C.trim()&&j.length===0||i||s&&!c)return;if(c&&d){d();return}let ee=C;if(j.length>0){const ue=j.map(Re=>`[Uploaded File: ${URL.createObjectURL(Re)}}]`).join(`
24
24
  `);ee=ee?`${ee}
25
25
 
26
- ${ue}`:ue}let ie=H,ae=!1;H.endsWith("-thinking")&&(ie=H.replace(/-thinking$/,""),ae=!0),n==null||n(ee,{model_name:ie,enable_thinking:ae}),y||k(""),w([]),x([])},A=J=>{w(ee=>ee.filter((ie,ae)=>ae!==J)),!u&&S.length>J&&x(ee=>ee.filter((ie,ae)=>ae!==J))},G=J=>{J.preventDefault(),J.stopPropagation(),F(!0)},Q=J=>{J.preventDefault(),J.stopPropagation(),F(!1)},X=p.useCallback(J=>{!J||J.length===0||(x(ee=>[...ee,...J]),w(ee=>[...ee,...J]),I(ee=>[...ee,...J]),T(!0))},[x,w]),K=p.useCallback(()=>{if(E.length>0&&!V&&f){P(!0);const J=E[0];z.current=J,M(0);try{f(J)}catch(ee){I(ie=>ie.slice(1)),P(!1),z.current=null,M(0),T(ie=>E.length-1>0||!1),h==null||h(ee)}}else E.length===0&&v&&(T(!1),M(0))},[E,V,f,v,h]);p.useEffect(()=>{K()},[E,V,K]);const oe="active",te=J=>!0,re=()=>{N(!1),e.onGuideClose&&e.onGuideClose()},U=J=>{y&&t?t(J.text):k(J.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(J),B.current&&B.current.focus()},Z=p.useCallback(()=>S,[S]),le=p.useCallback(()=>x([]),[]);return{onSubmit:n,getPendingFiles:Z,clearPendingFiles:le,value:C,handleChange:_,handleSubmit:Y,editableRef:B,fileInputRef:$,isUploading:v,uploadProgress:R,isDraggingOver:W,uploadedFiles:j,pendingFiles:S,removeUploadedFile:A,setPendingFiles:x,setUploadedFiles:w,setIsUploading:T,startUpload:X,selectedModel:H,handleModelChange:D,modelOptions:L,subscriptionStatus:oe,canAccessModel:te,handleDragOver:G,handleDragLeave:Q,isGuideTipShown:O,hideGuideTip:re,handlePromptExampleSelect:U}},fh={attachmentRemove:{position:"absolute",top:"2px",right:"2px",width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"color-black-900",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",zIndex:1}},Gn={container:{width:"100%",maxWidth:"100%",borderRadius:"12px",backgroundColor:"color-white",transition:"background-color 0.2s ease, box-shadow 0.2s ease"},content:{width:"100%",padding:"12px",borderRadius:"12px",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"}},yh={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},xh={xs:{fontSize:"10px",padding:"4px 8px"},sm:{fontSize:"12px",padding:"6px 10px"},md:{fontSize:"14px",padding:"8px 12px"},lg:{fontSize:"16px",padding:"10px 14px"},xl:{fontSize:"20px",padding:"12px 16px"}},bh={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"},none:{backgroundColor:"transparent",border:"none"}},Yn=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,kh=({openDelay:e=200,closeDelay:o=300}={})=>{const[t,n]=p.useState(!1),a=p.useRef(null),i=p.useRef(null),s=p.useRef(null),c=p.useRef(null),d=p.useMemo(()=>Yn("hovercard-content"),[]),u=p.useMemo(()=>Yn("hovercard-trigger"),[]),m=p.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),i.current&&(clearTimeout(i.current),i.current=null)},[]),g=p.useCallback(()=>{m(),t||(a.current=setTimeout(()=>{n(!0)},e))},[t,e,m]),h=p.useCallback(()=>{m(),t&&(i.current=setTimeout(()=>{n(!1)},o))},[t,o,m]),f=p.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);return p.useEffect(()=>()=>m(),[m]),{isOpen:t,openCard:g,closeCard:h,cancelCloseTimer:f,triggerRef:s,contentRef:c,contentId:d,triggerId:u}},Ul=p.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Ch=({children:e,value:o})=>r.jsx(Ul.Provider,{value:o,children:e}),Gl=()=>{const e=p.useContext(Ul);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},Sh=({children:e,views:o,asChild:t=!1,...n})=>{const{openCard:a,closeCard:i,triggerRef:s,contentId:c,triggerId:d}=Gl(),f={ref:s,onMouseEnter:()=>a(),onMouseLeave:()=>i(),onFocus:()=>a(),onBlur:()=>i(),id:d,"aria-describedby":c,...o==null?void 0:o.container,...n};if(t&&p.isValidElement(e)){const y=p.Children.only(e);return p.cloneElement(y,{...f,...y.props})}return r.jsx(l.View,{position:"relative",display:"inline-block",...f,children:e})},jh=({children:e,views:o,side:t="bottom",align:n="center",sideOffset:a=8,style:i,backgroundColor:s="color-white",borderRadius:c="4px",boxShadow:d="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:u="12px",minWidth:m="50px",maxWidth:g="300px",...h})=>{const{isOpen:f,cancelCloseTimer:y,closeCard:b,contentRef:k,triggerRef:C,contentId:j,triggerId:w}=Gl(),{ref:S,relation:x}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});p.useEffect(()=>{C!=null&&C.current&&(S==null?void 0:S.current)!==C.current&&S&&(S.current=C.current)},[C,S,f]);const v=()=>y(),T=()=>b();if(!f)return null;const R=()=>{if(!x||!(C!=null&&C.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const I=C.current.getBoundingClientRect();let V=t;t==="bottom"&&x.space.vertical==="top"?V="top":t==="top"&&x.space.vertical==="bottom"?V="bottom":t==="right"&&x.space.horizontal==="left"?V="left":t==="left"&&x.space.horizontal==="right"&&(V="right");let P=0,z=0;switch(V){case"bottom":P=I.left+I.width/2,z=I.bottom+a;break;case"top":P=I.left+I.width/2,z=I.top-a;break;case"right":P=I.right+a,z=I.top+I.height/2;break;case"left":P=I.left-a,z=I.top+I.height/2;break}return{position:"fixed",left:P,top:z,zIndex:1e3,transform:M(V)}},M=I=>{switch(I){case"bottom":return"translate(-50%, 0)";case"top":return"translate(-50%, -100%)";case"right":return"translate(0, -50%)";case"left":return"translate(-100%, -50%)";default:return"translate(-50%, 0)"}},E=R();return r.jsx(l.View,{ref:k,id:j,role:"tooltip","aria-labelledby":w,onMouseEnter:v,onMouseLeave:T,backgroundColor:s,borderRadius:c,boxShadow:d,padding:u,minWidth:m,maxWidth:g,style:{...E,...i},...o==null?void 0:o.container,...h,children:e})},wh=({children:e,views:o,openDelay:t,closeDelay:n,...a})=>{const i=kh({openDelay:t,closeDelay:n});return r.jsx(Ch,{value:i,children:r.jsx(l.View,{position:"relative",display:"inline-block",...o==null?void 0:o.container,...a,children:e})})},Se=wh;Se.Trigger=Sh;Se.Content=jh;const vh=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:a="120px",showPreviews:i=!1,views:s={}})=>{if(e.length===0)return null;const c=p.useCallback(u=>u<1024?`${u} B`:u<1024*1024?`${(u/1024).toFixed(1)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`,[]),d=p.useCallback(u=>u.type.startsWith("image/")?{backgroundColor:"#DBEAFE",color:"#2563EB"}:u.type.startsWith("video/")?{backgroundColor:"#EDE9FE",color:"#7C3AED"}:u.type.startsWith("audio/")?{backgroundColor:"#DCFCE7",color:"#16A34A"}:{backgroundColor:"#E2E8F0",color:"#475569"},[]);return r.jsx(l.View,{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 0",maxHeight:a,overflowY:"auto",...s==null?void 0:s.container,children:e.map((u,m)=>{const g=(u==null?void 0:u.path)||(u==null?void 0:u.url)||(i?URL.createObjectURL(u):""),h=u.type.startsWith("image/"),f=u.type.startsWith("video/"),y=u.type.startsWith("audio/"),b=d(u);return i?r.jsx(l.Vertical,{alignItems:"center",gap:"6px",padding:"6px 10px",borderRadius:"8px",border:"1px solid #E2E8F0",backgroundColor:"color-white",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...s==null?void 0:s.item,children:i&&r.jsxs(Se,{children:[r.jsxs(Se.Trigger,{children:[h&&r.jsx(l.Image,{src:g,alt:u.name,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),f&&r.jsx(l.View,{as:"video",src:g,alt:u.name,controls:!1,muted:!0,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),y&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(Ro,{widthHeight:24,color:"color-black"})}),!h&&!f&&!y&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(ao,{widthHeight:24,color:"color-black"})}),t&&r.jsx(l.Button,{...fh.attachmentRemove,onClick:k=>{k.stopPropagation(),t(m)},"aria-label":`Remove ${u.name}`,children:"×"})]}),r.jsxs(Se.Content,{children:[h&&r.jsx(l.Image,{src:g,alt:u.name,maxWidth:"100%"}),f&&r.jsx(l.View,{as:"video",src:g,controls:!0,maxWidth:"100%"}),y&&r.jsx(l.View,{as:"audio",src:g,controls:!0,width:"100%"}),r.jsxs(l.Text,{marginTop:"4px",maxLines:1,width:"100%",...s==null?void 0:s.name,children:[u.name," (",c(u.size),")"]})]})]})},m):r.jsxs(l.Horizontal,{alignItems:"center",gap:"8px",padding:"6px 10px 6px 8px",borderRadius:"9999px",border:"1px solid #E2E8F0",backgroundColor:"color-white",maxWidth:"100%",animate:{from:{opacity:0,scale:.96},to:{opacity:1,scale:1}},animationDuration:.2,...s==null?void 0:s.item,children:[r.jsx(l.Center,{width:"22px",height:"22px",minWidth:"22px",borderRadius:"9999px",backgroundColor:b.backgroundColor,color:b.color,children:y?r.jsx(Ro,{widthHeight:12,color:"currentColor"}):r.jsx(ao,{widthHeight:12,color:"currentColor"})}),r.jsxs(l.Text,{fontSize:"12px",lineHeight:"16px",color:"color-gray-600",maxLines:1,maxWidth:"220px",...s==null?void 0:s.name,children:[u.name," · ",c(u.size)]}),t&&r.jsx(l.View,{as:"button",type:"button",onClick:()=>t(m),"aria-label":`Remove ${u.name}`,display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",minWidth:"16px",border:"none",backgroundColor:"transparent",color:"color-gray-400",padding:0,cursor:"pointer",transition:"color 0.2s ease, opacity 0.2s ease",_hover:{color:"color-gray-600"},children:"×"})]},m)})})},Yl=p.forwardRef(({value:e,onChange:o,placeholder:t="Type your message...",disabled:n=!1,autoFocus:a=!0,suggestions:i=[],onSuggestionSelect:s,showSuggestions:c=!1,mentionData:d=[],mentionTrigger:u="@",onMentionSelect:m,maxHeight:g="200px",minHeight:h="40px",views:f={}},y)=>{var te,re;const b=p.useRef(e),[k,C]=p.useState(-1),[j,w]=p.useState(!e),S=p.useRef(null),[x,v]=p.useState(!1),[T,R]=p.useState(!1),[M,E]=p.useState(""),[I,V]=p.useState(-1),[P,z]=p.useState(-1),[W,F]=p.useState([]),{ref:H,relation:D}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[L,B]=p.useState({x:0,y:0}),[$,O]=p.useState({x:0,y:0});p.useEffect(()=>{const U=y;U.current&&e!==b.current&&(U.current.textContent=e,b.current=e,w(!e))},[e,y]),p.useEffect(()=>{a&&y&&typeof y=="object"&&y.current&&y.current.focus()},[a,y]);const N=()=>{const U=window.getSelection();if(!U||U.rangeCount===0)return-1;const Z=U.getRangeAt(0),le=Z.cloneRange();return le.selectNodeContents(y&&typeof y=="object"&&y.current?y.current:document.body),le.setEnd(Z.endContainer,Z.endOffset),le.toString().length},_=p.useCallback((U,Z)=>{const le=U.substring(0,Z),J=le.lastIndexOf(u);if(J!==-1){const ee=le.substring(J+1);if(!ee.includes(" ")){const ae=ee.toLowerCase(),ue=d.filter(Ve=>Ve.name.toLowerCase().includes(ae));E(ae),V(J),F(ue),R(ue.length>0),z(0);const Re=Y();B(Re);return}}R(!1),E(""),V(-1),z(-1)},[d,u]);p.useEffect(()=>{S.current&&H&&(H.current=S.current)},[S,H]);const Y=p.useCallback((U=200)=>{if(!S.current)return{x:0,y:0};const Z=S.current.getBoundingClientRect();if(D){const ie=D.space.vertical==="top";return{x:Z.left,y:ie?Z.top-U-8:Z.bottom+8}}const le=window.innerHeight,J={top:Z.top,bottom:le-Z.bottom},ee=J.bottom<U+8&&J.top>J.bottom;return{x:Z.left,y:ee?Z.top-U-8:Z.bottom+8}},[D]),A=p.useCallback(()=>{v(!0);const U=Y();O(U)},[Y]),G=p.useCallback(()=>{setTimeout(()=>{v(!1),C(-1)},150)},[]),Q=U=>{const Z=U.currentTarget.textContent||"";if(Z!==b.current){o(Z),b.current=Z,w(!Z);const le=N();_(Z,le)}},X=p.useCallback(U=>{if(y&&typeof y=="object"&&y.current){const Z=y.current.textContent||"",le=Z.substring(0,I),J=Z.substring(I+u.length+M.length),ee=le+u+U.name+" "+J;o(ee),b.current=ee,y.current.textContent=ee;const ie=le.length+u.length+U.name.length+1;setTimeout(()=>{var ae;if(y.current){const ue=document.createRange(),Re=window.getSelection(),Ve=y.current.firstChild;Ve&&Re&&(ue.setStart(Ve,Math.min(ie,((ae=Ve.textContent)==null?void 0:ae.length)||0)),ue.collapse(!0),Re.removeAllRanges(),Re.addRange(ue))}},0)}R(!1),E(""),V(-1),z(-1),m&&m(U)},[I,u,M,o,m,y]),K=p.useCallback(U=>{s&&s(U),C(-1)},[s]),oe=U=>{if(T&&W.length>0){if(U.key==="ArrowDown"){U.preventDefault(),z(Z=>Z<W.length-1?Z+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),z(Z=>Z>0?Z-1:W.length-1);return}if((U.key==="Tab"||U.key==="Enter")&&P>=0){U.preventDefault(),X(W[P]);return}if(U.key==="Escape"){R(!1),z(-1);return}}if(c&&i.length>0){if(U.key==="ArrowDown"){U.preventDefault(),C(Z=>Z<i.length-1?Z+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),C(Z=>Z>0?Z-1:i.length-1);return}if(U.key==="Tab"&&k>=0){U.preventDefault(),K(i[k]);return}if(U.key==="Escape"){C(-1);return}}};return r.jsxs(l.View,{ref:S,width:"100%",position:"relative",...f==null?void 0:f.container,children:[r.jsxs(l.View,{width:"100%",minHeight:h,maxHeight:g,overflowY:"auto",position:"relative",children:[j&&r.jsx(l.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...f==null?void 0:f.placeholder,children:t}),r.jsx(l.View,{as:"div",ref:y,contentEditable:!n,suppressContentEditableWarning:!0,onInput:Q,onKeyDown:oe,onFocus:A,onBlur:G,role:"textbox","aria-multiline":"true","aria-placeholder":t,width:"100%",minHeight:"24px",padding:"8px",outline:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"14px",color:"color-gray-900",backgroundColor:"transparent",...f==null?void 0:f.input})]}),T&&W.length>0&&r.jsx(l.View,{position:"fixed",left:L.x,top:L.y,width:((te=S.current)==null?void 0:te.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-blue-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9999,maxHeight:"200px",overflowY:"auto",...f==null?void 0:f.mentionContainer,children:r.jsxs(l.Vertical,{gap:0,children:[W.map((U,Z)=>r.jsx(l.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:Z===P?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>X(U),onMouseEnter:()=>z(Z),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.mentionItem,children:r.jsxs(l.Vertical,{gap:4,children:[r.jsxs(l.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[u,U.name]}),U.description&&r.jsx(l.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",u,")",D&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",D.space.vertical,"-",D.space.horizontal]})]})]})}),c&&i.length>0&&!T&&x&&!e&&r.jsx(l.View,{position:"fixed",left:$.x,top:$.y,width:((re=S.current)==null?void 0:re.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-green-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9998,maxHeight:"200px",overflowY:"auto",...f==null?void 0:f.suggestionsContainer,children:r.jsxs(l.Vertical,{gap:0,children:[i.map((U,Z)=>r.jsx(l.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:Z===k?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>K(U),onMouseEnter:()=>C(Z),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.suggestionItem,children:r.jsxs(l.Vertical,{gap:4,children:[r.jsx(l.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:U.text}),U.description&&r.jsx(l.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",D&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",D.space.vertical,"-",D.space.horizontal]})]})]})})]})});Yl.displayName="EditableInput";const Th=({examples:e,onSelect:o,views:t={}})=>{const{getColor:n}=l.useTheme();return!e||e.length===0?null:r.jsx(l.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...t==null?void 0:t.container,children:e.map(a=>r.jsx(l.View,{as:"button",type:"button",padding:"8px 12px",borderRadius:"9999px",backgroundColor:"color-white",border:"1px solid #E2E8F0",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease",onClick:()=>o(a),_hover:{backgroundColor:"#F8FAFC",borderColor:"#CBD5E1"},...t==null?void 0:t.item,children:r.jsx(l.Text,{fontSize:"14px",color:"color-gray-700",...t==null?void 0:t.text,children:a.text})},a.id))})},Ih=({onRecordingComplete:e,onRecordingStart:o,views:t={}})=>{const{recording:n,paused:a,audioBlob:i,analyserNode:s,startRecording:c,stopRecording:d}=Ya();p.useEffect(()=>{if(i){const m=new File([i],`recording-${Date.now()}.webm`,{type:i.type||"audio/webm;codecs=opus"});e(m)}},[i]);const u=p.useCallback(()=>{c(),o==null||o()},[]);return r.jsxs(l.Horizontal,{alignItems:"center",gap:4,children:[r.jsx(l.View,{minWidth:90,children:n&&s&&r.jsx(Kt,{analyserNode:s,isPaused:a})}),r.jsx(l.View,{as:"button",type:"button",onClick:n?d:u,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n?"theme-error":"color-gray-100",color:n?"color-white":"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:n?"color-red-600":"color-gray-200"},...t.button,children:n?r.jsx(Er,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(_t,{widthHeight:16,color:"currentColor",filled:!1})})]})},Kl=p.memo(({onSubmit:e,placeholder:o="Type your message… use @ to mention",loading:t=!1,disabled:n=!1,isAgentRunning:a=!1,enableAudioRecording:i=!1,leftButtons:s,rightButtons:c,onStopAgent:d,loadingText:u="Agent is working...",autoFocus:m=!0,sandboxId:g,hideAttachments:h=!1,attachmentText:f="",promptExamples:y=[],suggestions:b=[],errorMessage:k,size:C="md",shape:j="rounded",variant:w="default",views:S={},mentionData:x=[],mentionTrigger:v="@",onMentionSelect:T,onAudioRecordingStart:R,onAudioRecordingStop:M,showGuideTip:E,guideVideoUrl:I,onGuideClose:V,onFileBrowse:P,onUploadProgress:z,onUploadSuccess:W,onUploadError:F,onFileUpload:H,onPromptExampleSelect:D,value:L,handleChange:B,handleSubmit:$,editableRef:O,fileInputRef:N,isUploading:_,uploadProgress:Y,isDraggingOver:A,uploadedFiles:G,pendingFiles:Q,getPendingFiles:X,clearPendingFiles:K,removeUploadedFile:oe,setPendingFiles:te,setUploadedFiles:re,setIsUploading:U,startUpload:Z,selectedModel:le,handleModelChange:J,modelOptions:ee,subscriptionStatus:ie,canAccessModel:ae,isGuideTipShown:ue,hideGuideTip:Re,handlePromptExampleSelect:Ve,handleDragOver:Xr,handleDragLeave:Do,onChange:Tn,...Le})=>{l.useTheme();const go=p.useMemo(()=>({...Gn.container,...yh[j],...S==null?void 0:S.container}),[j,S==null?void 0:S.container]),Jr=p.useMemo(()=>({...Gn.content,...xh[C],...bh[w],...S==null?void 0:S.content}),[C,w,S==null?void 0:S.content]),$o=((L==null?void 0:L.trim().length)??0)>0||G.length>0,js=p.useCallback(be=>{Z([be]),M==null||M(be)},[Z,M]),Qr=p.useCallback(be=>{const ho=be.filter(In=>In.size>52428800?(console.error(`File size exceeds 50MB limit: ${In.name}`),!1):!0);ho.length>0&&Z(ho)},[Z]),ws=p.useCallback(be=>{if(be.preventDefault(),be.stopPropagation(),Do(be),be.dataTransfer.files.length>0){const ho=Array.from(be.dataTransfer.files);Qr(ho)}},[Do,Qr]),vs=p.useMemo(()=>[...x||[],...G.map((be,ho)=>({id:`file-${ho}`,name:be.name}))],[x,G]);return r.jsxs(l.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...go,...Le,onDragOver:Xr,onDragLeave:Do,onDrop:ws,children:[y.length>0&&r.jsx(Th,{examples:y,onSelect:Ve,views:{container:S==null?void 0:S.promptExamples,item:S==null?void 0:S.promptExampleItem}}),a&&r.jsxs(l.Horizontal,{justifyContent:"center",alignItems:"center",gap:8,padding:"8px 0",animate:{from:{opacity:0,y:-10},to:{opacity:1,y:0},duration:"0.3s"},...S==null?void 0:S.loadingIndicator,children:[r.jsx(Ot,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(l.Text,{color:"color-gray-500",children:u})]}),r.jsx(l.View,{position:"relative",width:"100%",overflow:"visible",children:r.jsxs(l.View,{as:"form",onSubmit:$,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...Jr,...go,paddingHorizontal:16,paddingVertical:10,backgroundColor:A?"color-blue-50":void 0,children:[r.jsx(vh,{files:G,sandboxId:g,onRemove:oe,showPreviews:!0,views:{container:S==null?void 0:S.attachments,item:S==null?void 0:S.attachmentItem,name:S==null?void 0:S.attachmentName,size:S==null?void 0:S.attachmentSize,removeButton:S==null?void 0:S.attachmentRemove}}),r.jsx(Yl,{ref:O,value:L||"",onChange:B,placeholder:o,disabled:n&&!a,autoFocus:m,suggestions:b||[],showSuggestions:b&&b.length>0&&!L,onSuggestionSelect:be=>{B(be.text)},mentionData:vs,mentionTrigger:v,onMentionSelect:T,views:{container:{},input:S==null?void 0:S.editableInput}}),r.jsxs(l.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[r.jsxs(l.Horizontal,{gap:8,alignItems:"center",children:[!h&&r.jsx(Lr,{accept:"*/*",icon:r.jsx(er,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:Qr,isLoading:_,progress:Y||0,text:f,fileType:"file",renderError:({errorMessage:be})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...S==null?void 0:S.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:j==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:be=>be.size>50*1024*1024?"File size exceeds 50MB limit":null}),s]}),r.jsxs(l.Horizontal,{gap:8,alignItems:"center",children:[i&&r.jsx(Ih,{onRecordingStart:R,onRecordingComplete:js,views:{button:S==null?void 0:S.recordButton}}),r.jsx(l.View,{as:"button",type:"button",onClick:$,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:a?"theme-error":$o?"theme-primary":"color-gray-300",color:"color-white",borderRadius:j==="rounded"?"50%":4,border:"none",cursor:$o?"pointer":"not-allowed",disabled:!$o||t||n&&!a,transition:"background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease",_hover:{opacity:$o||a?.9:1},_active:{opacity:$o||a?.95:1},_focusVisible:{outline:"none",boxShadow:"0 0 0 2px white, 0 0 0 4px theme-primary"},...S==null?void 0:S.submitButton,children:a?r.jsx(Er,{widthHeight:16,color:"currentColor",filled:!1}):t?r.jsx(Je,{type:"quarter",size:16,color:"color-white"}):r.jsx(Bt,{widthHeight:16,color:"currentColor",filled:!1})}),c]})]})]})}),k&&r.jsx(l.Text,{color:"theme-error",marginTop:"4px",...S==null?void 0:S.bottomTip,children:k})]})}),Fh=e=>{const{name:o,onSubmit:t,...n}=e,[a,i]=p.useState([]),s=fe({name:o,type:"text"}),c=h=>{s.onChangeText&&s.onChangeText(h)},d=(h,f)=>{t?t(h,f):c(h)},u=()=>a,m=()=>i([]),g=ql({...n,value:s.value||"",onChange:c,onSubmit:d});return r.jsx(Kl,{...n,...g,value:s.value||"",onChange:c,onSubmit:d,error:s.error,getPendingFiles:u,clearPendingFiles:m})},Rh=Fh,zh=e=>{const o=fe(e),t=vl(o);return r.jsx(Tl,{...t,...o})},Mh=zh,Wh=e=>{const o=fe(e),t=Wl();return r.jsx(Hl,{...t,...o})},Hh=Wh,Ph=e=>{const o=fe(e),t=Il(e);return r.jsx(Fl,{...t,...o})},Vh=Ph,Ah=e=>{let o=fe(e);o.selected=o.value;const t=gl(e);return r.jsx(fl,{...t,...o})},Eh=Ah,Dh=e=>{const o=fe(e),t=yl(e);return r.jsx(xl,{...t,...o})},$h=Dh,Lh=e=>{const{name:o,...t}=e,{values:n,errors:a,touched:i,submitCount:s,setFieldValue:c,setFieldTouched:d}=He.useFormikContext(),u=He.getIn(n,o)||[],m=He.getIn(i,o)||s>0?He.getIn(a,o):void 0,g=p.useCallback(k=>{var j;const C=Array.isArray(k)?k.filter(w=>typeof w=="string"):[];c(o,C),(j=e.onTagsChange)==null||j.call(e,C)},[o,c,e.onTagsChange]),h=p.useCallback(()=>{var k;d(o,!0),(k=e.onBlur)==null||k.call(e)},[o,d,e.onBlur]),f=El({...t,tags:u,onTagsChange:g,onBlur:h}),{tags:y,...b}=f;return r.jsx(Dl,{...b,...t,tags:y,error:m})},_h=Lh,Bh=e=>{const o=fe(e),t=Cl(e);return r.jsx(Sl,{...t,...o})},Oh=Bh,Nh=e=>{const o=fe(e,{focusable:!0}),{value:t,...n}=ln(e);return r.jsx(nr,{...n,...o})},qh=Nh,Uh=({visibleIcon:e=r.jsx(qt,{widthHeight:14}),hiddenIcon:o=r.jsx(Nt,{widthHeight:14}),...t})=>{const n=fe(t,{focusable:!0}),{isVisible:a,setIsVisible:i,...s}=Pl(n);return r.jsx(nr,{...s,type:a?"text":"password",isClearable:!1,right:r.jsx(l.View,{onClick:()=>{t.isDisabled||i(!a)},children:a?e:o})})},Gh=Uh,Yh=({items:e,placeholder:o,searchPlaceholder:t,isMulti:n=!1,...a})=>{const i=fe(a),s=Vl(e,o,t);p.useEffect(()=>{if(n&&Array.isArray(i.value))s.setSelectedItems(i.value);else if(!n&&i.value){const d=typeof i.value=="object"?i.value:e.find(u=>u.value===i.value);d&&s.setSelectedItem(d)}},[i.value,n,e]);const c=d=>{i.onChange(d)};return r.jsx(Al,{...s,...i,items:e,placeholder:o,isMulti:n,onSelect:c})},Kh=Yh,To=(e,o,t)=>Math.min(Math.max(e,o),t),Xh=(e,o,t,n,a,i,s)=>{const c=n-t;let d;if(i==="horizontal"){const u=o.width,m=e-o.left;d=To(m/u,0,1)}else{const u=o.height,m=o.bottom-e;d=To(m/u,0,1)}if(s&&s.length>0){const u=t+d*c;let m=s[0],g=Math.abs(u-m);for(let h=1;h<s.length;h++){const f=Math.abs(u-s[h]);f<g&&(g=f,m=s[h])}return m}else{const u=t+d*c,m=Math.round(u/a)*a;return To(m,t,n)}},Xl=({min:e=0,max:o=100,step:t=1,value:n,defaultValue:a,onChange:i,onDrag:s,orientation:c="horizontal",isDisabled:d=!1,stepValues:u})=>{const m=To(n??a??e,e,o),[g,h]=p.useState(m),[f,y]=p.useState(!1),[b,k]=p.useState(!1),C=p.useRef(null),j=p.useRef(null),w=n!==void 0,S=n!==void 0?n:g;p.useEffect(()=>{n!==void 0&&h(To(n,e,o))},[n,e,o]);const x=p.useCallback(V=>{const P=To(V,e,o);w||h(P),i&&P!==S&&i(P),f&&s&&s(P)},[w,e,o,i,S,f,s]),v=p.useCallback(V=>{if(d||!C.current)return;const P=C.current;if(typeof P.getBoundingClientRect!="function")return;const z=P.getBoundingClientRect();let W;"touches"in V?W=c==="horizontal"?V.touches[0].clientX:V.touches[0].clientY:W=c==="horizontal"?V.clientX:V.clientY;const F=Xh(W,z,e,o,t,c,u);x(F)},[e,o,t,c,x,d,u]),T=p.useCallback(V=>{if(d)return;V.preventDefault(),y(!0),v(V);const P=W=>{v(W)},z=()=>{y(!1),document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",z),document.removeEventListener("touchmove",P),document.removeEventListener("touchend",z)};typeof(document==null?void 0:document.addEventListener)=="function"&&(document.addEventListener("mousemove",P),document.addEventListener("mouseup",z),document.addEventListener("touchmove",P),document.addEventListener("touchend",z))},[v,d]),R=p.useCallback(V=>{const P=j.current;P&&typeof P.contains=="function"&&P.contains(V.target)||T(V)},[T]),M=p.useCallback(V=>{if(d)return;let P=S;switch(V.key){case"ArrowLeft":case"ArrowDown":P=S-t;break;case"ArrowRight":case"ArrowUp":P=S+t;break;case"Home":P=e;break;case"End":P=o;break;default:return}V.preventDefault(),x(P)},[S,e,o,t,x,d]),E=o-e,I=E===0?0:(S-e)/E*100;return{currentValue:S,isDragging:f,isHovered:b,setIsHovered:k,trackRef:C,thumbRef:j,handleThumbMouseDown:T,handleTrackMouseDown:R,handleKeyDown:M,thumbPositionPercent:I}},Kn={xs:{height:4,width:"100%"},sm:{height:6,width:"100%"},md:{height:8,width:"100%"},lg:{height:10,width:"100%"},xl:{height:12,width:"100%"}},Xn={xs:{width:12,height:12},sm:{width:16,height:16},md:{width:20,height:20},lg:{width:24,height:24},xl:{width:28,height:28}},Jn={square:0,rounded:4,pill:24},Jh=e=>({default:{backgroundColor:"color-gray-200",transition:"background-color 0.15s ease"},outline:{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-300",style:{backgroundColor:"transparent"},transition:"border-color 0.15s ease"}}),Qn=Jh(),Qh={xs:{trackCrossAxisSize:4,thumbSize:12},sm:{trackCrossAxisSize:6,thumbSize:16},md:{trackCrossAxisSize:8,thumbSize:20},lg:{trackCrossAxisSize:10,thumbSize:24},xl:{trackCrossAxisSize:12,thumbSize:28}},Zh={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},ef=e=>typeof e=="string"&&(/^(#|rgb\(|rgba\(|hsl\(|hsla\(|var\()/.test(e)||["black","currentColor","inherit","transparent","white"].includes(e)),No=(e,o)=>ef(o)?{style:{[e]:o}}:{[e]:o},Jl=p.memo(({min:e=0,max:o=100,step:t=1,currentValue:n,stepValues:a,shape:i="rounded",size:s="md",variant:c="default",orientation:d="horizontal",isDisabled:u=!1,showValue:m=!1,showTooltip:g=!1,backgroundColor:h="theme-primary",label:f,helperText:y,themeMode:b,shadow:k={},isDragging:C,isHovered:j,setIsHovered:w,trackRef:S,thumbRef:x,handleThumbMouseDown:v,handleTrackMouseDown:T,handleKeyDown:R,thumbPositionPercent:M,ariaLabel:E="Slider",views:I={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:V,onDrag:P,value:z,defaultValue:W,...F})=>{var A,G;const H=h,D="theme-disabled",L=Qn[c].backgroundColor,B=u?D:H,$=d==="vertical",{trackCrossAxisSize:O,thumbSize:N}=Qh[s]||{trackCrossAxisSize:Kn[s].height,thumbSize:Xn[s].width||16},_=r.jsxs(l.Vertical,{width:"100%",gap:8,...I.container,...F,children:[f&&r.jsxs(l.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[r.jsx(l.Text,{fontSize:14,fontWeight:500,...I.label,children:f}),m&&r.jsx(l.Text,{fontSize:14,color:"color-gray-500",...I.valueLabel,children:n})]}),r.jsxs(l.View,{ref:S,position:"relative",cursor:u?"not-allowed":"pointer",opacity:u?.6:1,onMouseDown:T,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),...Kn[s],borderRadius:Jn[i],backgroundColor:L,...Qn[c],...k,...I.track,children:[a&&a.length>0&&r.jsx(r.Fragment,{children:a.map(Q=>{const X=(Q-e)/(o-e)*100;return r.jsx(l.View,{position:"absolute",top:"50%",left:`${X}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",zIndex:1,...No("backgroundColor",B),...I.stepMarks},Q)})}),r.jsx(l.View,{position:"absolute",top:0,left:0,height:"100%",width:`${M}%`,borderRadius:Jn[i],transition:"width 0.1s ease-in-out",...No("backgroundColor",B),...I.progress,...I.filledTrack}),r.jsx(l.View,{ref:x,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":d,"aria-disabled":u,"aria-label":E,position:"absolute",top:"50%",left:`${M}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",borderWidth:2,borderStyle:"solid",transition:C?"none":"transform 0.1s ease-in-out",...No("borderColor",B),transform:j?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:v,onTouchStart:v,onKeyDown:R,...Xn[s],...I.thumb,children:g&&(j||C)&&r.jsx(l.View,{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:8,padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:4,fontSize:12,whiteSpace:"nowrap",zIndex:3,...I.tooltip,children:r.jsx(l.Text,{...(A=I.tooltip)==null?void 0:A.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),y&&r.jsx(Ct,{children:y})]}),Y=r.jsxs(l.Center,{...Zh[d],position:"relative",onMouseEnter:()=>!u&&w(!0),onMouseLeave:()=>!u&&w(!1),...F,...I==null?void 0:I.container,children:[f&&r.jsxs(l.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[r.jsx(l.Text,{fontSize:14,fontWeight:500,...I.label,children:f}),m&&r.jsx(l.Text,{fontSize:14,color:"color-gray-500",...I.valueLabel,children:n})]}),r.jsxs(l.View,{ref:S,position:"relative",borderRadius:O/2,backgroundColor:u?D:L,cursor:u?"not-allowed":"pointer",width:$?`${O}px`:"100%",height:$?"100%":`${O}px`,onMouseDown:T,onTouchStart:T,...I==null?void 0:I.track,children:[a&&a.length>0&&r.jsx(r.Fragment,{children:a.map(Q=>{const X=(Q-e)/(o-e)*100;return r.jsx(l.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:B,zIndex:1,...$?{bottom:`${X}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${X}%`,top:"50%",transform:"translate(-50%, -50%)"},...I.stepMarks},Q)})}),r.jsx(l.View,{position:"absolute",borderRadius:O/2,...$?{bottom:0,left:0,width:"100%",height:`${M}%`}:{top:0,left:0,height:"100%",width:`${M}%`},...No("backgroundColor",B),...I==null?void 0:I.filledTrack,...I==null?void 0:I.progress}),r.jsx(l.View,{ref:x,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":d,"aria-disabled":u,"aria-label":E,position:"absolute",width:`${N}px`,height:`${N}px`,borderRadius:"50%",borderWidth:2,borderStyle:"solid",borderColor:"color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:u?"not-allowed":"grab",transform:$?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:C?"none":"left 0.1s, bottom 0.1s",...No("backgroundColor",B),...$?{left:"50%",bottom:`${M}%`}:{top:"50%",left:`${M}%`},onMouseDown:v,onTouchStart:v,onKeyDown:R,...I==null?void 0:I.thumb,children:g&&(j||C)&&r.jsx(l.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...$?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...I==null?void 0:I.tooltip,children:r.jsx(l.Text,{...(G=I==null?void 0:I.tooltip)==null?void 0:G.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),y&&r.jsx(Ct,{marginTop:8,children:y})]});return $||g?Y:_}),of=e=>{const o=fe(e),t=Xl({...e,value:o.value!==void 0?Number(o.value):void 0,onChange:n=>{var a;o.onChange(n),(a=e.onChange)==null||a.call(e,n)}});return r.jsx(Jl,{...e,...t,...o})},rf=of,Zn=e=>{if(e==null)return"";if(typeof e=="string"||typeof e=="number"){const o=String(e);return o==="[object Object]"?"":o}return""},lt=(e,o)=>{console.log(`[FormikOTPInput] ${e}`,o)},tf=e=>e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:Object.prototype.toString.call(e),nf=e=>{const o=fe(e),t=Zn(o.value).slice(0,e.length||6);lt("render",{name:e.name,type:e.type,formValue:tf(o.value),displayValue:t,length:e.length||6,hasFormikOnChange:!!o.onChange,hasFormikOnChangeText:!!o.onChangeText});const{isFocused:n,setIsFocused:a,isHovered:i,setIsHovered:s,inputRef:c,containerRef:d,mirrorSelectionStart:u,mirrorSelectionEnd:m,setMirrorSelectionStart:g,setMirrorSelectionEnd:h,setInputRef:f,handleFocus:y,handleBlur:b,handleKeyDown:k,handlePaste:C}=$l(e),j=p.useCallback(S=>{const x=Zn(S).slice(0,e.length||6);lt("setValue",{name:e.name,incomingValue:S,nextValue:x,hasFormikOnChange:!!o.onChange,hasFormikOnChangeText:!!o.onChangeText}),o.onChange&&o.onChange(x),o.onChangeText&&o.onChangeText(x),e.onComplete&&x.length===(e.length||6)&&e.onComplete(x),c.current&&(c.current.value=x)},[o,e,c]),w=p.useCallback(S=>{var T,R,M;const x=typeof S=="string"?S:((T=S==null?void 0:S.currentTarget)==null?void 0:T.value)??((R=S==null?void 0:S.target)==null?void 0:R.value)??((M=S==null?void 0:S.nativeEvent)==null?void 0:M.text)??"",v=String(x).slice(0,e.length||6);lt("handleChange normalized",{name:e.name,raw:x,newValue:v}),j(v),c.current&&(c.current.value=v)},[e.length,j,c]);return r.jsx(Ll,{...e,...o,value:t,setValue:j,isFocused:n,setIsFocused:a,isHovered:i,setIsHovered:s,inputRef:c,containerRef:d,mirrorSelectionStart:u,mirrorSelectionEnd:m,setMirrorSelectionStart:g,setMirrorSelectionEnd:h,setInputRef:f,handleChange:w,handleFocus:y,handleBlur:b,handleKeyDown:k,handlePaste:C,stepValues:e.stepValues})},af=nf,lf=e=>Array.isArray(e)?e:e==null?[]:[e],Ql=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:n,transformResponse:a,onMultipleFileSelect:i,onFileSelect:s,multiple:c=!0,...d})=>{const{setFieldValue:u,setFieldTouched:m,values:g}=He.useFormikContext(),[h,f]=p.useState(!1),[y,b]=p.useState(0),k=p.useCallback(async w=>{if(!w||w.length===0)return;m(e,!0,!0),f(!0);const S=[];for(const x of w){b(0);try{const v=await o(x,R=>{b(R??0)}),T=a?a(v,x):v;S.push(T),t==null||t(x,T)}catch(v){n==null||n(x,v)}}if(S.length>0){const x=lf(He.getIn(g,e));u(e,[...x,...S],!0),b(100)}else b(0);f(!1)},[e,n,t,m,u,a,o,g]),C=p.useCallback(async w=>{i==null||i(w),await k(w)},[k,i]),j=p.useCallback(async w=>{s==null||s(w),await k([w])},[k,s]);return r.jsx(Lr,{...d,multiple:c,onMultipleFileSelect:c?C:void 0,onFileSelect:c?void 0:j,isLoading:h,progress:y})};Ql.displayName="FormikUploader";const sf=e=>{let o=fe(e);o.selected=o.value;const t=bl(e);return r.jsx(kl,{...t,...o})},cf=sf,Zl=e=>{const[o,t]=p.useState(!1),[n,a]=p.useState(e);return{isHovered:o,setIsHovered:t,isToggle:n,setIsToggled:a}},df={square:0,rounded:8,pill:999},uf=(e,o)=>({outline:{backgroundColor:"color-white",color:e,borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",_hover:{backgroundColor:"color-gray-50",borderColor:"color-gray-300"},_active:{backgroundColor:"color-gray-100"},transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"},ghost:{backgroundColor:"transparent",color:e,borderWidth:0,borderStyle:"none",borderColor:"transparent",_hover:{backgroundColor:"color-gray-50"},_active:{backgroundColor:"color-gray-100"},transition:"background-color 0.2s ease, color 0.2s ease"},link:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"1px",textDecorationThickness:"1px",_hover:{opacity:.8},_active:{opacity:.9},transition:"opacity 0.2s ease"}}),ei=p.memo(({children:e,shape:o="rounded",variant:t="ghost",isHovered:n,setIsHovered:a,isDisabled:i,isToggle:s,setIsToggled:c,onToggle:d,views:u,backgroundColor:m,color:g,themeMode:h,...f})=>{const{getColor:y,themeMode:b}=l.useTheme(),k=h??b,j=y(i?"theme-disabled":m??g??"theme-primary",{themeMode:k}),S=p.useMemo(()=>uf(j),[j,k])[t],x=!!s,v=p.useCallback(()=>a(!0),[a]),T=p.useCallback(()=>{i||c(R=>{const M=!R;return d&&d(M),M})},[i,c,d]);return r.jsx(l.Center,{role:"Toggle",padding:o==="pill"?"8px 12px":"8px",width:"fit-content",cursor:i?"not-allowed":"pointer",borderRadius:df[o],onClick:T,onMouseEnter:v,onMouseLeave:()=>a(!1),...S,...x&&{...t==="link"?{backgroundColor:"transparent"}:{backgroundColor:"color-blue-50",borderWidth:1,borderStyle:"solid",borderColor:"color-blue-200"},color:j},...f,...u==null?void 0:u.container,children:e})}),pf=({children:e,shape:o,variant:t,isDisabled:n,isToggled:a=!1,onToggle:i,...s})=>{const c=fe(s),{isHovered:d,setIsHovered:u,isToggle:m,setIsToggled:g}=Zl(c.value??a);p.useEffect(()=>{g(c.value??a)},[c.value,a]);const h=f=>{g(f),c.onChange(f),i==null||i(f)};return r.jsx(ei,{shape:o,variant:t,isDisabled:n,isHovered:d,setIsHovered:u,isToggle:m,setIsToggled:g,onToggle:h,...s,children:e})},mf=pf,oi=()=>{const[e,o]=p.useState([]);return{activeToggles:e,setActiveToggles:o}},gf=({children:e,shape:o,variant:t,isDisabled:n,isToggled:a=!1,onToggle:i,...s})=>{const{isHovered:c,setIsHovered:d,isToggle:u,setIsToggled:m}=Zl(a);return p.useEffect(()=>{m(a)},[a]),r.jsx(ei,{shape:o,variant:t,isDisabled:n,isHovered:c,setIsHovered:d,isToggle:u,setIsToggled:m,onToggle:i,...s,children:e})},cn=gf,ri=({items:e,onToggleChange:o,activeToggles:t,setActiveToggles:n,shape:a="rounded",variant:i="ghost",views:s})=>{const c=p.useCallback((d,u)=>{n(m=>{let g;return u?g=m.includes(d)?m:[...m,d]:g=m.filter(h=>h!==d),o==null||o(g),g})},[o,n]);return r.jsx(l.Horizontal,{role:"ToggleGroup",display:"flex",gap:8,flexWrap:"wrap",...s==null?void 0:s.container,children:e.map(d=>r.jsx(cn,{role:`toggle-${d.id}`,shape:a,variant:i,isToggled:t.includes(d.id)||d.isActive,onToggle:u=>c(d.id,u),isDisabled:d.isDisabled,views:s==null?void 0:s.toggle,children:d.value},d.id))})},hf=({items:e,shape:o,variant:t,onToggleChange:n,...a})=>{const i=fe(a),{activeToggles:s,setActiveToggles:c}=oi();p.useEffect(()=>{Array.isArray(i.value)&&c(i.value)},[i.value]);const d=u=>{c(u),i.onChange(u),n==null||n(u)};return r.jsx(ri,{items:e,shape:o,variant:t,activeToggles:s,setActiveToggles:c,onToggleChange:d,...a})},ff=hf,ea=["zoom-out","zoom-in","zap","zap-off","youtube","x","wrench","worm","workflow","wine","wine-off","wind","wind-arrow-down","wifi","wifi-zero","wifi-sync","wifi-pen","wifi-off","wifi-low","wifi-high","wifi-cog","whole-word","wheat","wheat-off","weight","weight-tilde","webhook","webhook-off","webcam","waypoints","waves","waves-ladder","waves-arrow-up","waves-arrow-down","watch","washing-machine","warehouse","wand","wand-sparkles","wallpaper","wallet","wallet-minimal","wallet-cards","vote","volume","volume-x","volume-off","volume-2","volume-1","volleyball","voicemail","view","videotape","video","video-off","vibrate","vibrate-off","venus","venus-and-mars","venetian-mask","vegan","vector-square","vault","variable","van","utility-pole","utensils","utensils-crossed","users","users-round","user","user-x","user-star","user-search","user-round","user-round-x","user-round-search","user-round-plus","user-round-pen","user-round-minus","user-round-cog","user-round-check","user-plus","user-pen","user-minus","user-lock","user-cog","user-check","usb","upload","unplug","unlink","unlink-2","university","ungroup","unfold-vertical","unfold-horizontal","undo","undo-dot","undo-2","underline","umbrella","umbrella-off","type","type-outline","twitter","twitch","tv","tv-minimal","tv-minimal-play","turtle","turntable","turkish-lira","truck","truck-electric","trophy","triangle","triangle-right","triangle-dashed","triangle-alert","trending-up","trending-up-down","trending-down","trello","trees","tree-pine","tree-palm","tree-deciduous","trash","trash-2","transgender","tram-front","train-track","train-front","train-front-tunnel","traffic-cone","tractor","toy-brick","tower-control","touchpad","touchpad-off","torus","tornado","toolbox","tool-case","toilet","toggle-right","toggle-left","timer","timer-reset","timer-off","tickets","tickets-plane","ticket","ticket-x","ticket-slash","ticket-plus","ticket-percent","ticket-minus","ticket-check","thumbs-up","thumbs-down","thermometer","thermometer-sun","thermometer-snowflake","theater","text-wrap","text-select","text-search","text-quote","text-initial","text-cursor","text-cursor-input","text-align-start","text-align-justify","text-align-end","text-align-center","test-tubes","test-tube","test-tube-diagonal","terminal","tent","tent-tree","telescope","target","tangent","tally-5","tally-4","tally-3","tally-2","tally-1","tags","tag","tablets","tablet","tablet-smartphone","table","table-rows-split","table-properties","table-of-contents","table-columns-split","table-cells-split","table-cells-merge","table-2","syringe","swords","sword","switch-camera","swiss-franc","swatch-book","superscript","sunset","sunrise","sun","sun-snow","sun-moon","sun-medium","sun-dim","subscript","strikethrough","stretch-vertical","stretch-horizontal","store","stone","sticky-note","sticker","stethoscope","step-forward","step-back","star","star-off","star-half","stamp","squirrel","squircle","squircle-dashed","squares-unite","squares-subtract","squares-intersect","squares-exclude","square","square-x","square-user","square-user-round","square-terminal","square-stop","square-star","square-stack","square-square","square-split-vertical","square-split-horizontal","square-slash","square-sigma","square-scissors","square-round-corner","square-radical","square-power","square-plus","square-play","square-pilcrow","square-pi","square-percent","square-pen","square-pause","square-parking","square-parking-off","square-mouse-pointer","square-minus","square-menu","square-m","square-library","square-kanban","square-function","square-equal","square-dot","square-divide","square-dashed","square-dashed-top-solid","square-dashed-mouse-pointer","square-dashed-kanban","square-dashed-bottom","square-dashed-bottom-code","square-code","square-chevron-up","square-chevron-right","square-chevron-left","square-chevron-down","square-check","square-check-big","square-chart-gantt","square-bottom-dashed-scissors","square-asterisk","square-arrow-up","square-arrow-up-right","square-arrow-up-left","square-arrow-right","square-arrow-out-up-right","square-arrow-out-up-left","square-arrow-out-down-right","square-arrow-out-down-left","square-arrow-left","square-arrow-down","square-arrow-down-right","square-arrow-down-left","square-activity","sprout","spray-can","spotlight","spool","split","spline","spline-pointer","spell-check","spell-check-2","speech","speaker","sparkles","sparkle","spade","space","soup","solar-panel","sofa","soap-dispenser-droplet","snowflake","snail","smile","smile-plus","smartphone","smartphone-nfc","smartphone-charging","sliders-vertical","sliders-horizontal","slice","slash","slack","skull","skip-forward","skip-back","siren","signpost","signpost-big","signature","signal","signal-zero","signal-medium","signal-low","signal-high","sigma","shuffle","shrub","shrink","shrimp","shredder","shower-head","shovel","shopping-cart","shopping-basket","shopping-bag","shirt","ship","ship-wheel","shield","shield-x","shield-user","shield-question-mark","shield-plus","shield-off","shield-minus","shield-half","shield-ellipsis","shield-check","shield-ban","shield-alert","shell","sheet","share","share-2","shapes","settings","settings-2","server","server-off","server-crash","server-cog","separator-vertical","separator-horizontal","send","send-to-back","send-horizontal","section","search","search-x","search-slash","search-code","search-check","search-alert","scroll","scroll-text","screen-share","screen-share-off","scooter","scissors","scissors-line-dashed","school","scan","scan-text","scan-search","scan-qr-code","scan-line","scan-heart","scan-face","scan-eye","scan-barcode","scaling","scale","scale-3d","save","save-off","save-all","saudi-riyal","satellite","satellite-dish","sandwich","salad","sailboat","russian-ruble","ruler","ruler-dimension-line","rss","rows-4","rows-3","rows-2","router","route","route-off","rotate-cw","rotate-cw-square","rotate-ccw","rotate-ccw-square","rotate-ccw-key","rotate-3d","rose","roller-coaster","rocking-chair","rocket","ribbon","rewind","reply","reply-all","replace","replace-all","repeat","repeat-2","repeat-1","remove-formatting","regex","refrigerator","refresh-cw","refresh-cw-off","refresh-ccw","refresh-ccw-dot","redo","redo-dot","redo-2","recycle","rectangle-vertical","rectangle-horizontal","rectangle-goggles","rectangle-ellipsis","rectangle-circle","receipt","receipt-turkish-lira","receipt-text","receipt-swiss-franc","receipt-russian-ruble","receipt-pound-sterling","receipt-japanese-yen","receipt-indian-rupee","receipt-euro","receipt-cent","ratio","rat","rainbow","rail-symbol","radius","radio","radio-tower","radio-receiver","radical","radiation","radar","rabbit","quote","qr-code","pyramid","puzzle","proportions","projector","printer","printer-check","presentation","power","power-off","pound-sterling","popsicle","popcorn","pointer","pointer-off","podcast","pocket","pocket-knife","plus","plug","plug-zap","plug-2","play","plane","plane-takeoff","plane-landing","pizza","pipette","pin","pin-off","pill","pill-bottle","pilcrow","pilcrow-right","pilcrow-left","piggy-bank","picture-in-picture","picture-in-picture-2","pickaxe","piano","pi","phone","phone-outgoing","phone-off","phone-missed","phone-incoming","phone-forwarded","phone-call","philippine-peso","person-standing","percent","pentagon","pencil","pencil-ruler","pencil-off","pencil-line","pen","pen-tool","pen-off","pen-line","pc-case","paw-print","pause","party-popper","parking-meter","parentheses","paperclip","panels-top-left","panels-right-bottom","panels-left-bottom","panel-top","panel-top-open","panel-top-dashed","panel-top-close","panel-top-bottom-dashed","panel-right","panel-right-open","panel-right-dashed","panel-right-close","panel-left","panel-left-right-dashed","panel-left-open","panel-left-dashed","panel-left-close","panel-bottom","panel-bottom-open","panel-bottom-dashed","panel-bottom-close","panda","palette","paintbrush","paintbrush-vertical","paint-roller","paint-bucket","package","package-x","package-search","package-plus","package-open","package-minus","package-check","package-2","origami","orbit","option","omega","octagon","octagon-x","octagon-pause","octagon-minus","octagon-alert","nut","nut-off","notepad-text","notepad-text-dashed","notebook","notebook-text","notebook-tabs","notebook-pen","non-binary","nfc","newspaper","network","navigation","navigation-off","navigation-2","navigation-2-off","music","music-4","music-3","music-2","move","move-vertical","move-up","move-up-right","move-up-left","move-right","move-left","move-horizontal","move-down","move-down-right","move-down-left","move-diagonal","move-diagonal-2","move-3d","mouse","mouse-pointer","mouse-pointer-click","mouse-pointer-ban","mouse-pointer-2","mouse-pointer-2-off","mouse-off","mountain","mountain-snow","motorbike","moon","moon-star","monitor","monitor-x","monitor-up","monitor-stop","monitor-speaker","monitor-smartphone","monitor-play","monitor-pause","monitor-off","monitor-down","monitor-dot","monitor-cog","monitor-cloud","monitor-check","minus","minimize","minimize-2","milk","milk-off","milestone","microwave","microscope","microchip","mic","mic-vocal","mic-off","messages-square","message-square","message-square-x","message-square-warning","message-square-text","message-square-share","message-square-reply","message-square-quote","message-square-plus","message-square-off","message-square-more","message-square-lock","message-square-heart","message-square-dot","message-square-diff","message-square-dashed","message-square-code","message-circle","message-circle-x","message-circle-warning","message-circle-reply","message-circle-question-mark","message-circle-plus","message-circle-off","message-circle-more","message-circle-heart","message-circle-dashed","message-circle-code","merge","menu","memory-stick","meh","megaphone","megaphone-off","medal","maximize","maximize-2","martini","mars","mars-stroke","map","map-plus","map-pinned","map-pin","map-pin-x","map-pin-x-inside","map-pin-plus","map-pin-plus-inside","map-pin-pen","map-pin-off","map-pin-minus","map-pin-minus-inside","map-pin-house","map-pin-check","map-pin-check-inside","map-minus","mails","mailbox","mail","mail-x","mail-warning","mail-search","mail-question-mark","mail-plus","mail-open","mail-minus","mail-check","magnet","luggage","lollipop","logs","log-out","log-in","lock","lock-open","lock-keyhole","lock-keyhole-open","locate","locate-off","locate-fixed","loader","loader-pinwheel","loader-circle","list","list-x","list-video","list-tree","list-todo","list-start","list-restart","list-plus","list-ordered","list-music","list-minus","list-indent-increase","list-indent-decrease","list-filter","list-filter-plus","list-end","list-collapse","list-chevrons-up-down","list-chevrons-down-up","list-checks","list-check","linkedin","link","link-2","link-2-off","line-squiggle","lightbulb","lightbulb-off","ligature","life-buoy","library","library-big","lectern","leafy-green","leaf","layout-template","layout-panel-top","layout-panel-left","layout-list","layout-grid","layout-dashboard","layers","layers-plus","layers-2","laugh","lasso","lasso-select","laptop","laptop-minimal","laptop-minimal-check","languages","landmark","land-plot","lamp","lamp-wall-up","lamp-wall-down","lamp-floor","lamp-desk","lamp-ceiling","keyboard","keyboard-off","keyboard-music","key","key-square","key-round","kayak","kanban","joystick","japanese-yen","iteration-cw","iteration-ccw","italic","instagram","inspection-panel","info","infinity","indian-rupee","inbox","import","images","image","image-upscale","image-up","image-plus","image-play","image-off","image-minus","image-down","id-card","id-card-lanyard","ice-cream-cone","ice-cream-bowl","house","house-wifi","house-plus","house-plug","house-heart","hourglass","hotel","hospital","hop","hop-off","history","highlighter","hexagon","helicopter","heater","heart","heart-pulse","heart-plus","heart-off","heart-minus","heart-handshake","heart-crack","headset","headphones","headphone-off","heading","heading-6","heading-5","heading-4","heading-3","heading-2","heading-1","hdmi-port","hd","haze","hat-glasses","hash","hard-hat","hard-drive","hard-drive-upload","hard-drive-download","handshake","handbag","hand","hand-platter","hand-metal","hand-helping","hand-heart","hand-grab","hand-fist","hand-coins","hammer","hamburger","ham","guitar","group","grip","grip-vertical","grip-horizontal","grid-3x3","grid-3x2","grid-2x2","grid-2x2-x","grid-2x2-plus","grid-2x2-check","grape","graduation-cap","gpu","goal","globe","globe-lock","glasses","glass-water","gitlab","github","git-pull-request","git-pull-request-draft","git-pull-request-create","git-pull-request-create-arrow","git-pull-request-closed","git-pull-request-arrow","git-merge","git-graph","git-fork","git-compare","git-compare-arrows","git-commit-vertical","git-commit-horizontal","git-branch","git-branch-plus","git-branch-minus","gift","ghost","georgian-lari","gem","gavel","gauge","gamepad","gamepad-directional","gamepad-2","gallery-vertical","gallery-vertical-end","gallery-thumbnails","gallery-horizontal","gallery-horizontal-end","funnel","funnel-x","funnel-plus","fullscreen","fuel","frown","framer","frame","forward","form","forklift","footprints","folders","folder","folder-x","folder-up","folder-tree","folder-sync","folder-symlink","folder-search","folder-search-2","folder-root","folder-plus","folder-pen","folder-output","folder-open","folder-open-dot","folder-minus","folder-lock","folder-key","folder-kanban","folder-input","folder-heart","folder-git","folder-git-2","folder-down","folder-dot","folder-cog","folder-code","folder-closed","folder-clock","folder-check","folder-archive","fold-vertical","fold-horizontal","focus","flower","flower-2","flip-vertical","flip-vertical-2","flip-horizontal","flip-horizontal-2","flask-round","flask-conical","flask-conical-off","flashlight","flashlight-off","flame","flame-kindling","flag","flag-triangle-right","flag-triangle-left","flag-off","fishing-hook","fish","fish-symbol","fish-off","fire-extinguisher","fingerprint-pattern","film","files","file","file-x","file-x-corner","file-volume","file-video-camera","file-user","file-up","file-type","file-type-corner","file-text","file-terminal","file-symlink","file-stack","file-spreadsheet","file-sliders","file-signal","file-search","file-search-corner","file-scan","file-question-mark","file-plus","file-plus-corner","file-play","file-pen","file-pen-line","file-output","file-music","file-minus","file-minus-corner","file-lock","file-key","file-input","file-image","file-heart","file-headphone","file-exclamation-point","file-down","file-digit","file-diff","file-cog","file-code","file-code-corner","file-clock","file-check","file-check-corner","file-chart-pie","file-chart-line","file-chart-column","file-chart-column-increasing","file-braces","file-braces-corner","file-box","file-badge","file-axis-3d","file-archive","figma","ferris-wheel","fence","feather","fast-forward","fan","factory","facebook","eye","eye-off","eye-closed","external-link","expand","ev-charger","euro","ethernet-port","eraser","equal","equal-not","equal-approximately","ellipsis","ellipsis-vertical","egg","egg-off","egg-fried","eclipse","earth","earth-lock","ear","ear-off","dumbbell","drumstick","drum","droplets","droplet","droplet-off","drone","drill","dribbble","drama","drafting-compass","download","dot","door-open","door-closed","door-closed-locked","donut","dollar-sign","dog","dock","dna","dna-off","divide","disc","disc-album","disc-3","disc-2","diff","dices","dice-6","dice-5","dice-4","dice-3","dice-2","dice-1","diamond","diamond-plus","diamond-percent","diamond-minus","diameter","dessert","delete","decimals-arrow-right","decimals-arrow-left","database","database-zap","database-backup","dam","cylinder","currency","cup-soda","cuboid","crown","crosshair","cross","crop","croissant","credit-card","creative-commons","cpu","corner-up-right","corner-up-left","corner-right-up","corner-right-down","corner-left-up","corner-left-down","corner-down-right","corner-down-left","copyright","copyleft","copy","copy-x","copy-slash","copy-plus","copy-minus","copy-check","cooking-pot","cookie","contrast","container","contact","contact-round","construction","cone","concierge-bell","computer","component","compass","command","combine","columns-4","columns-3","columns-3-cog","columns-2","coins","cog","coffee","codesandbox","codepen","code","code-xml","club","clover","cloudy","cloud","cloud-upload","cloud-sync","cloud-sun","cloud-sun-rain","cloud-snow","cloud-rain","cloud-rain-wind","cloud-off","cloud-moon","cloud-moon-rain","cloud-lightning","cloud-hail","cloud-fog","cloud-drizzle","cloud-download","cloud-cog","cloud-check","cloud-backup","cloud-alert","closed-caption","clock","clock-plus","clock-fading","clock-check","clock-arrow-up","clock-arrow-down","clock-alert","clock-9","clock-8","clock-7","clock-6","clock-5","clock-4","clock-3","clock-2","clock-12","clock-11","clock-10","clock-1","clipboard","clipboard-x","clipboard-type","clipboard-plus","clipboard-pen","clipboard-pen-line","clipboard-paste","clipboard-minus","clipboard-list","clipboard-copy","clipboard-clock","clipboard-check","clapperboard","citrus","circuit-board","circle","circle-x","circle-user","circle-user-round","circle-stop","circle-star","circle-small","circle-slash","circle-slash-2","circle-question-mark","circle-power","circle-pound-sterling","circle-plus","circle-play","circle-pile","circle-percent","circle-pause","circle-parking","circle-parking-off","circle-off","circle-minus","circle-gauge","circle-fading-plus","circle-fading-arrow-up","circle-equal","circle-ellipsis","circle-dot","circle-dot-dashed","circle-dollar-sign","circle-divide","circle-dashed","circle-chevron-up","circle-chevron-right","circle-chevron-left","circle-chevron-down","circle-check","circle-check-big","circle-arrow-up","circle-arrow-right","circle-arrow-out-up-right","circle-arrow-out-up-left","circle-arrow-out-down-right","circle-arrow-out-down-left","circle-arrow-left","circle-arrow-down","circle-alert","cigarette","cigarette-off","church","chromium","chevrons-up","chevrons-up-down","chevrons-right","chevrons-right-left","chevrons-left","chevrons-left-right","chevrons-left-right-ellipsis","chevrons-down","chevrons-down-up","chevron-up","chevron-right","chevron-left","chevron-last","chevron-first","chevron-down","chess-rook","chess-queen","chess-pawn","chess-knight","chess-king","chess-bishop","cherry","chef-hat","check","check-line","check-check","chart-spline","chart-scatter","chart-pie","chart-no-axes-gantt","chart-no-axes-combined","chart-no-axes-column","chart-no-axes-column-increasing","chart-no-axes-column-decreasing","chart-network","chart-line","chart-gantt","chart-column","chart-column-stacked","chart-column-increasing","chart-column-decreasing","chart-column-big","chart-candlestick","chart-bar","chart-bar-stacked","chart-bar-increasing","chart-bar-decreasing","chart-bar-big","chart-area","cctv","cat","castle","cast","cassette-tape","case-upper","case-sensitive","case-lower","carrot","card-sim","caravan","car","car-taxi-front","car-front","captions","captions-off","cannabis","cannabis-off","candy","candy-off","candy-cane","camera","camera-off","calendars","calendar","calendar-x","calendar-x-2","calendar-sync","calendar-search","calendar-range","calendar-plus","calendar-plus-2","calendar-off","calendar-minus","calendar-minus-2","calendar-heart","calendar-fold","calendar-days","calendar-cog","calendar-clock","calendar-check","calendar-check-2","calendar-arrow-up","calendar-arrow-down","calendar-1","calculator","cake","cake-slice","cable","cable-car","bus","bus-front","building","building-2","bug","bug-play","bug-off","bubbles","brush","brush-cleaning","bring-to-front","briefcase","briefcase-medical","briefcase-conveyor-belt","briefcase-business","brick-wall","brick-wall-shield","brick-wall-fire","brain","brain-cog","brain-circuit","brackets","braces","boxes","box","bow-arrow","bottle-wine","bot","bot-off","bot-message-square","boom-box","bookmark","bookmark-x","bookmark-plus","bookmark-minus","bookmark-check","book","book-x","book-user","book-up","book-up-2","book-type","book-text","book-search","book-plus","book-open","book-open-text","book-open-check","book-minus","book-marked","book-lock","book-key","book-image","book-heart","book-headphones","book-down","book-dashed","book-copy","book-check","book-audio","book-alert","book-a","bone","bomb","bolt","bold","bluetooth","bluetooth-searching","bluetooth-off","bluetooth-connected","blocks","blinds","blend","bitcoin","birdhouse","bird","biohazard","binoculars","binary","bike","biceps-flexed","between-vertical-start","between-vertical-end","between-horizontal-start","between-horizontal-end","bell","bell-ring","bell-plus","bell-off","bell-minus","bell-electric","bell-dot","beer","beer-off","beef","bed","bed-single","bed-double","bean","bean-off","beaker","battery","battery-warning","battery-plus","battery-medium","battery-low","battery-full","battery-charging","bath","baseline","barrel","barcode","banknote","banknote-x","banknote-arrow-up","banknote-arrow-down","bandage","banana","ban","balloon","baggage-claim","badge","badge-x","badge-turkish-lira","badge-swiss-franc","badge-russian-ruble","badge-question-mark","badge-pound-sterling","badge-plus","badge-percent","badge-minus","badge-japanese-yen","badge-info","badge-indian-rupee","badge-euro","badge-dollar-sign","badge-check","badge-cent","badge-alert","backpack","baby","axis-3d","axe","award","audio-waveform","audio-lines","atom","at-sign","asterisk","arrows-up-from-line","arrow-up","arrow-up-z-a","arrow-up-wide-narrow","arrow-up-to-line","arrow-up-right","arrow-up-narrow-wide","arrow-up-left","arrow-up-from-line","arrow-up-from-dot","arrow-up-down","arrow-up-a-z","arrow-up-1-0","arrow-up-0-1","arrow-right","arrow-right-to-line","arrow-right-left","arrow-right-from-line","arrow-left","arrow-left-to-line","arrow-left-right","arrow-left-from-line","arrow-down","arrow-down-z-a","arrow-down-wide-narrow","arrow-down-up","arrow-down-to-line","arrow-down-to-dot","arrow-down-right","arrow-down-narrow-wide","arrow-down-left","arrow-down-from-line","arrow-down-a-z","arrow-down-1-0","arrow-down-0-1","arrow-big-up","arrow-big-up-dash","arrow-big-right","arrow-big-right-dash","arrow-big-left","arrow-big-left-dash","arrow-big-down","arrow-big-down-dash","armchair","archive","archive-x","archive-restore","apple","app-window","app-window-mac","aperture","anvil","antenna","annoyed","angry","anchor","amphora","ampersands","ampersand","ambulance","align-vertical-space-between","align-vertical-space-around","align-vertical-justify-start","align-vertical-justify-end","align-vertical-justify-center","align-vertical-distribute-start","align-vertical-distribute-end","align-vertical-distribute-center","align-start-vertical","align-start-horizontal","align-horizontal-space-between","align-horizontal-space-around","align-horizontal-justify-start","align-horizontal-justify-end","align-horizontal-justify-center","align-horizontal-distribute-start","align-horizontal-distribute-end","align-horizontal-distribute-center","align-end-vertical","align-end-horizontal","align-center-vertical","align-center-horizontal","album","alarm-smoke","alarm-clock","alarm-clock-plus","alarm-clock-off","alarm-clock-minus","alarm-clock-check","airplay","air-vent","activity","accessibility","a-large-small","a-arrow-up","a-arrow-down"],ti=e=>{const{value:o,defaultValue:t,onChange:n,isOpen:a,onOpen:i,onClose:s,closeOnSelect:c=!0}=e,[d,u]=p.useState(a??!1),[m,g]=p.useState(o??t),[h,f]=p.useState(""),y=p.useRef(null),b=p.useRef(null);p.useEffect(()=>{o!==void 0&&g(o)},[o]),p.useEffect(()=>{a!==void 0&&u(a)},[a]);const k=p.useMemo(()=>h?ea.filter(x=>x.toLowerCase().includes(h.toLowerCase())).slice(0,100):ea.slice(0,100),[h]);p.useEffect(()=>{const x=v=>{d&&y.current&&b.current&&!y.current.contains(v.target)&&!b.current.contains(v.target)&&C()};if(typeof(document==null?void 0:document.addEventListener)=="function")return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[d]);const C=p.useCallback(()=>{a===void 0&&u(!1),s&&s()},[s,a]),j=p.useCallback(()=>{const x=!d;a===void 0&&u(x),x?(i&&i(),f("")):s&&s()},[d,i,s,a]),w=p.useCallback(x=>{o===void 0&&g(x),n&&n(x),c&&C()},[n,c,C,o]),S=p.useCallback(x=>{f(x)},[]);return{isOpen:d,selectedIcon:m,searchQuery:h,filteredIcons:k,handleToggle:j,handleIconSelect:w,handleSearchChange:S,handleClose:C,triggerRef:y,dropdownRef:b}},bo={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease-in-out"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:12,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",padding:"16px",minWidth:"280px",maxHeight:"320px",overflow:"hidden",display:"flex",flexDirection:"column"},searchInput:{marginBottom:"12px",flexShrink:0},iconGrid:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",gap:"8px",overflowY:"auto",padding:"4px",color:"color-black",flexGrow:1},iconItem:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:8,transition:"all 0.2s ease-in-out"}},yf={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"14px",padding:"10px 14px"},xl:{height:"56px",fontSize:"16px",padding:"12px 16px"}},xf={default:{borderRadius:8},square:{borderRadius:0},rounded:{borderRadius:8},pill:{borderRadius:9999}},bf={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},ni=({label:e,placeholder:o="Select an icon",helperText:t,views:n={},size:a="md",shape:i="default",variant:s="default",error:c=!1,isDisabled:d=!1,isReadOnly:u=!1,showSearch:m=!0,isOpen:g,selectedIcon:h,searchQuery:f,filteredIcons:y,handleToggle:b,handleIconSelect:k,handleSearchChange:C,triggerRef:j,dropdownRef:w,handleClose:S,onChange:x,value:v,defaultValue:T,onOpen:R,onClose:M,closeOnSelect:E,...I})=>{const{getColor:V}=l.useTheme(),P={...bo.container,...n==null?void 0:n.container},z={...bo.trigger,...yf[a],...xf[i],...bf[s],...c&&{borderColor:"color-red-500"},...d&&{opacity:.6,cursor:"not-allowed"},...!d&&!u&&{_hover:{borderColor:"color-gray-300"}},...n==null?void 0:n.trigger},W={...bo.dropdown,...n==null?void 0:n.dropdown},F={...bo.iconGrid,...n==null?void 0:n.iconGrid};return r.jsxs(l.View,{...P,...I,children:[e&&r.jsx(l.Text,{fontSize:a==="xs"?"12px":a==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...n==null?void 0:n.label,children:e}),r.jsxs(l.View,{ref:j,onClick:d||u?void 0:b,...z,children:[r.jsx(l.Horizontal,{alignItems:"center",gap:8,width:"100%",children:h?r.jsxs(l.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[r.jsx(vr,{name:h,widthHeight:16}),r.jsx(l.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h})]}):r.jsx(l.Text,{color:"color-gray-500",fontSize:"inherit",children:o})}),!u&&!d&&r.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:g?"up":"down"})]}),g&&r.jsxs(l.View,{ref:w,...W,children:[m&&r.jsx(l.View,{...bo.searchInput,...n==null?void 0:n.searchInput,children:r.jsx(ve,{placeholder:"Search icons...",value:f,onChange:H=>C(H),size:"sm",autoFocus:!0})}),r.jsx(l.View,{...F,children:y.length>0?y.map(H=>r.jsx(l.View,{...bo.iconItem,onClick:()=>k(H),title:H,_hover:{backgroundColor:"color-gray-50",transform:"scale(1.05)"},backgroundColor:h===H?"#EFF6FF":"transparent",borderWidth:h===H?"1px":"0px",borderStyle:"solid",borderColor:h===H?"#BFDBFE":"transparent",...n==null?void 0:n.iconItem,children:r.jsx(vr,{name:H,widthHeight:20})},H)):r.jsx(l.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(l.Text,{fontSize:"14px",children:"No icons found"})})})]}),t&&r.jsx(l.Text,{color:c?"color-red-500":"color-gray-600",marginTop:"4px",...n==null?void 0:n.helperText,children:t})]})},kf=e=>{const o=fe(e),t={...e,value:o.value??e.value??e.defaultValue},n=ti(t),a=i=>{n.handleIconSelect(i),o.onChange(i)};return r.jsx(ni,{...n,...t,handleIconSelect:a})},Cf=kf,Ge={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease-in-out"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:12,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",padding:"16px",minWidth:"320px",maxHeight:"400px",overflow:"hidden"},searchInput:{marginBottom:"12px"},categoryTabs:{display:"flex",flexDirection:"row",flexWrap:"wrap",borderBottom:"1px solid color-gray-100",marginBottom:"12px",overflowX:"auto"},categoryTab:{padding:"8px 12px",cursor:"pointer",borderBottom:"2px solid transparent",transition:"all 0.2s ease-in-out",fontSize:"14px",fontWeight:"500",color:"color-gray-600",whiteSpace:"nowrap",borderRadius:"8px 8px 0 0"},emojiGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",gap:"4px",maxHeight:"240px",overflowY:"auto",padding:"4px",color:"color-black"},emoji:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:6,fontSize:"20px",transition:"all 0.2s ease-in-out"}},Sf={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"14px",padding:"10px 14px"},xl:{height:"56px",fontSize:"16px",padding:"12px 16px"}},jf={default:{borderRadius:8},square:{borderRadius:0},rounded:{borderRadius:8},pill:{borderRadius:9999}},wf={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},vf={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},Tf=[{emoji:"😀",name:"grinning face",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😃",name:"grinning face with big eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😄",name:"grinning face with smiling eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😁",name:"beaming face with smiling eyes",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😆",name:"grinning squinting face",category:"smileys",keywords:["happy","laugh","smile"]},{emoji:"😅",name:"grinning face with sweat",category:"smileys",keywords:["happy","sweat","relief"]},{emoji:"🤣",name:"rolling on the floor laughing",category:"smileys",keywords:["laugh","funny","rofl"]},{emoji:"😂",name:"face with tears of joy",category:"smileys",keywords:["laugh","cry","joy"]},{emoji:"🙂",name:"slightly smiling face",category:"smileys",keywords:["smile","happy"]},{emoji:"🙃",name:"upside-down face",category:"smileys",keywords:["silly","upside down"]},{emoji:"😉",name:"winking face",category:"smileys",keywords:["wink","flirt"]},{emoji:"😊",name:"smiling face with smiling eyes",category:"smileys",keywords:["happy","smile","blush"]},{emoji:"😇",name:"smiling face with halo",category:"smileys",keywords:["angel","innocent"]},{emoji:"🥰",name:"smiling face with hearts",category:"smileys",keywords:["love","hearts","adore"]},{emoji:"😍",name:"smiling face with heart-eyes",category:"smileys",keywords:["love","heart","eyes"]},{emoji:"🤩",name:"star-struck",category:"smileys",keywords:["star","struck","amazed"]},{emoji:"😘",name:"face blowing a kiss",category:"smileys",keywords:["kiss","love","flirt"]},{emoji:"😗",name:"kissing face",category:"smileys",keywords:["kiss","love"]},{emoji:"☺️",name:"smiling face",category:"smileys",keywords:["smile","happy","content"]},{emoji:"😚",name:"kissing face with closed eyes",category:"smileys",keywords:["kiss","love","closed eyes"]},{emoji:"😙",name:"kissing face with smiling eyes",category:"smileys",keywords:["kiss","love","smile"]},{emoji:"🥲",name:"smiling face with tear",category:"smileys",keywords:["happy","cry","tear","bittersweet"]},{emoji:"😋",name:"face savoring food",category:"smileys",keywords:["yum","delicious","food"]},{emoji:"😛",name:"face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"😜",name:"winking face with tongue",category:"smileys",keywords:["wink","tongue","silly"]},{emoji:"🤪",name:"zany face",category:"smileys",keywords:["crazy","silly","wild"]},{emoji:"😝",name:"squinting face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"🤑",name:"money-mouth face",category:"smileys",keywords:["money","rich","greedy"]},{emoji:"🤗",name:"hugging face",category:"smileys",keywords:["hug","love","care"]},{emoji:"🤭",name:"face with hand over mouth",category:"smileys",keywords:["oops","secret","quiet"]},{emoji:"🫢",name:"face with open eyes and hand over mouth",category:"smileys",keywords:["surprise","shock","oops"]},{emoji:"🫣",name:"face with peeking eye",category:"smileys",keywords:["peek","shy","embarrassed"]},{emoji:"🤫",name:"shushing face",category:"smileys",keywords:["quiet","secret","shh"]},{emoji:"🤔",name:"thinking face",category:"smileys",keywords:["think","consider","hmm"]},{emoji:"🫡",name:"saluting face",category:"smileys",keywords:["salute","respect","military"]},{emoji:"🤐",name:"zipper-mouth face",category:"smileys",keywords:["quiet","secret","zip"]},{emoji:"🤨",name:"face with raised eyebrow",category:"smileys",keywords:["suspicious","doubt","skeptical"]},{emoji:"😐",name:"neutral face",category:"smileys",keywords:["neutral","meh","blank"]},{emoji:"😑",name:"expressionless face",category:"smileys",keywords:["blank","deadpan","meh"]},{emoji:"😶",name:"face without mouth",category:"smileys",keywords:["quiet","speechless","silent"]},{emoji:"🫥",name:"dotted line face",category:"smileys",keywords:["invisible","depressed","disappear"]},{emoji:"😏",name:"smirking face",category:"smileys",keywords:["smirk","smug","confident"]},{emoji:"😒",name:"unamused face",category:"smileys",keywords:["unamused","bored","annoyed"]},{emoji:"🙄",name:"face with rolling eyes",category:"smileys",keywords:["eye roll","annoyed","whatever"]},{emoji:"😬",name:"grimacing face",category:"smileys",keywords:["grimace","awkward","oops"]},{emoji:"😮‍💨",name:"face exhaling",category:"smileys",keywords:["sigh","relief","tired"]},{emoji:"🤥",name:"lying face",category:"smileys",keywords:["lie","pinocchio","dishonest"]},{emoji:"😌",name:"relieved face",category:"smileys",keywords:["relief","calm","peaceful"]},{emoji:"😔",name:"pensive face",category:"smileys",keywords:["sad","thoughtful","pensive"]},{emoji:"😪",name:"sleepy face",category:"smileys",keywords:["sleepy","tired","drowsy"]},{emoji:"🤤",name:"drooling face",category:"smileys",keywords:["drool","desire","sleep"]},{emoji:"😴",name:"sleeping face",category:"smileys",keywords:["sleep","tired","zzz"]},{emoji:"😷",name:"face with medical mask",category:"smileys",keywords:["mask","sick","doctor"]},{emoji:"🤒",name:"face with thermometer",category:"smileys",keywords:["sick","fever","ill"]},{emoji:"🤕",name:"face with head-bandage",category:"smileys",keywords:["hurt","injured","bandage"]},{emoji:"🤢",name:"nauseated face",category:"smileys",keywords:["sick","nausea","disgusted"]},{emoji:"🤮",name:"face vomiting",category:"smileys",keywords:["vomit","sick","disgusted"]},{emoji:"🤧",name:"sneezing face",category:"smileys",keywords:["sneeze","sick","gesundheit"]},{emoji:"🥵",name:"hot face",category:"smileys",keywords:["hot","heat","sweat"]},{emoji:"🥶",name:"cold face",category:"smileys",keywords:["cold","freeze","blue"]},{emoji:"🥴",name:"woozy face",category:"smileys",keywords:["dizzy","drunk","confused"]},{emoji:"😵",name:"dizzy face",category:"smileys",keywords:["dizzy","confused","knocked out"]},{emoji:"😵‍💫",name:"face with spiral eyes",category:"smileys",keywords:["dizzy","hypnotized","confused"]},{emoji:"🤯",name:"exploding head",category:"smileys",keywords:["mind blown","shocked","amazed"]},{emoji:"🤠",name:"cowboy hat face",category:"smileys",keywords:["cowboy","hat","western"]},{emoji:"🥳",name:"partying face",category:"smileys",keywords:["party","celebration","birthday"]},{emoji:"🥸",name:"disguised face",category:"smileys",keywords:["disguise","glasses","incognito"]},{emoji:"😎",name:"smiling face with sunglasses",category:"smileys",keywords:["cool","sunglasses","awesome"]},{emoji:"🤓",name:"nerd face",category:"smileys",keywords:["nerd","geek","smart"]},{emoji:"🧐",name:"face with monocle",category:"smileys",keywords:["monocle","fancy","inspection"]},{emoji:"👋",name:"waving hand",category:"people",keywords:["wave","hello","goodbye"]},{emoji:"🤚",name:"raised back of hand",category:"people",keywords:["hand","stop"]},{emoji:"🖐️",name:"hand with fingers splayed",category:"people",keywords:["hand","five"]},{emoji:"✋",name:"raised hand",category:"people",keywords:["hand","stop","high five"]},{emoji:"🖖",name:"vulcan salute",category:"people",keywords:["spock","vulcan"]},{emoji:"👌",name:"OK hand",category:"people",keywords:["ok","perfect"]},{emoji:"🤌",name:"pinched fingers",category:"people",keywords:["italian","chef kiss"]},{emoji:"🤏",name:"pinching hand",category:"people",keywords:["small","tiny"]},{emoji:"✌️",name:"victory hand",category:"people",keywords:["peace","victory"]},{emoji:"🤞",name:"crossed fingers",category:"people",keywords:["luck","hope"]},{emoji:"🤟",name:"love-you gesture",category:"people",keywords:["love","you"]},{emoji:"🤘",name:"sign of the horns",category:"people",keywords:["rock","metal"]},{emoji:"🤙",name:"call me hand",category:"people",keywords:["call","phone"]},{emoji:"👈",name:"backhand index pointing left",category:"people",keywords:["point","left"]},{emoji:"👉",name:"backhand index pointing right",category:"people",keywords:["point","right"]},{emoji:"👆",name:"backhand index pointing up",category:"people",keywords:["point","up"]},{emoji:"🖕",name:"middle finger",category:"people",keywords:["middle finger","rude"]},{emoji:"👇",name:"backhand index pointing down",category:"people",keywords:["point","down"]},{emoji:"☝️",name:"index pointing up",category:"people",keywords:["point","up","one"]},{emoji:"👍",name:"thumbs up",category:"people",keywords:["thumbs up","good","yes"]},{emoji:"👎",name:"thumbs down",category:"people",keywords:["thumbs down","bad","no"]},{emoji:"✊",name:"raised fist",category:"people",keywords:["fist","power","solidarity"]},{emoji:"👊",name:"oncoming fist",category:"people",keywords:["fist","punch","bump"]},{emoji:"🤛",name:"left-facing fist",category:"people",keywords:["fist","bump","left"]},{emoji:"🤜",name:"right-facing fist",category:"people",keywords:["fist","bump","right"]},{emoji:"👏",name:"clapping hands",category:"people",keywords:["clap","applause","bravo"]},{emoji:"🙌",name:"raising hands",category:"people",keywords:["celebration","hooray","praise"]},{emoji:"👐",name:"open hands",category:"people",keywords:["open","hug","jazz hands"]},{emoji:"🤲",name:"palms up together",category:"people",keywords:["prayer","please","hope"]},{emoji:"🤝",name:"handshake",category:"people",keywords:["handshake","deal","agreement"]},{emoji:"🙏",name:"folded hands",category:"people",keywords:["prayer","thanks","please"]},{emoji:"✍️",name:"writing hand",category:"people",keywords:["write","author","signature"]},{emoji:"💅",name:"nail polish",category:"people",keywords:["nails","beauty","manicure"]},{emoji:"🤳",name:"selfie",category:"people",keywords:["selfie","camera","phone"]},{emoji:"💪",name:"flexed biceps",category:"people",keywords:["muscle","strong","flex"]},{emoji:"🦾",name:"mechanical arm",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦿",name:"mechanical leg",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦵",name:"leg",category:"people",keywords:["leg","limb","kick"]},{emoji:"🦶",name:"foot",category:"people",keywords:["foot","kick","stomp"]},{emoji:"👂",name:"ear",category:"people",keywords:["ear","hear","listen"]},{emoji:"🦻",name:"ear with hearing aid",category:"people",keywords:["hearing aid","deaf","accessibility"]},{emoji:"👃",name:"nose",category:"people",keywords:["nose","smell","sniff"]},{emoji:"🧠",name:"brain",category:"people",keywords:["brain","smart","think"]},{emoji:"🫀",name:"anatomical heart",category:"people",keywords:["heart","organ","love"]},{emoji:"🫁",name:"lungs",category:"people",keywords:["lungs","breathe","organ"]},{emoji:"🦷",name:"tooth",category:"people",keywords:["tooth","dental","smile"]},{emoji:"🦴",name:"bone",category:"people",keywords:["bone","skeleton","dog"]},{emoji:"👀",name:"eyes",category:"people",keywords:["eyes","look","see"]},{emoji:"👁️",name:"eye",category:"people",keywords:["eye","see","watch"]},{emoji:"👅",name:"tongue",category:"people",keywords:["tongue","taste","lick"]},{emoji:"👄",name:"mouth",category:"people",keywords:["mouth","lips","kiss"]},{emoji:"🫦",name:"biting lip",category:"people",keywords:["lip","bite","nervous"]},{emoji:"👶",name:"baby",category:"people",keywords:["baby","infant","child"]},{emoji:"🧒",name:"child",category:"people",keywords:["child","kid","young"]},{emoji:"👦",name:"boy",category:"people",keywords:["boy","child","male"]},{emoji:"👧",name:"girl",category:"people",keywords:["girl","child","female"]},{emoji:"🧑",name:"person",category:"people",keywords:["person","adult","human"]},{emoji:"👱",name:"person: blond hair",category:"people",keywords:["blond","hair","person"]},{emoji:"👨",name:"man",category:"people",keywords:["man","male","adult"]},{emoji:"🧔",name:"person: beard",category:"people",keywords:["beard","man","facial hair"]},{emoji:"👩",name:"woman",category:"people",keywords:["woman","female","adult"]},{emoji:"🧓",name:"older person",category:"people",keywords:["old","elderly","senior"]},{emoji:"👴",name:"old man",category:"people",keywords:["old","man","elderly"]},{emoji:"👵",name:"old woman",category:"people",keywords:["old","woman","elderly"]},{emoji:"🐶",name:"dog face",category:"animals",keywords:["dog","pet","animal"]},{emoji:"🐱",name:"cat face",category:"animals",keywords:["cat","pet","animal"]},{emoji:"🐭",name:"mouse face",category:"animals",keywords:["mouse","animal"]},{emoji:"🐹",name:"hamster",category:"animals",keywords:["hamster","pet"]},{emoji:"🐰",name:"rabbit face",category:"animals",keywords:["rabbit","bunny"]},{emoji:"🦊",name:"fox",category:"animals",keywords:["fox","animal"]},{emoji:"🐻",name:"bear",category:"animals",keywords:["bear","animal"]},{emoji:"🐼",name:"panda",category:"animals",keywords:["panda","bear"]},{emoji:"🐨",name:"koala",category:"animals",keywords:["koala","australia","marsupial"]},{emoji:"🐯",name:"tiger face",category:"animals",keywords:["tiger","cat","wild"]},{emoji:"🦁",name:"lion",category:"animals",keywords:["lion","king","cat"]},{emoji:"🐮",name:"cow face",category:"animals",keywords:["cow","moo","farm"]},{emoji:"🐷",name:"pig face",category:"animals",keywords:["pig","oink","farm"]},{emoji:"🐽",name:"pig nose",category:"animals",keywords:["pig","nose","snout"]},{emoji:"🐸",name:"frog",category:"animals",keywords:["frog","amphibian","green"]},{emoji:"🐵",name:"monkey face",category:"animals",keywords:["monkey","primate","banana"]},{emoji:"🙈",name:"see-no-evil monkey",category:"animals",keywords:["monkey","see no evil","eyes"]},{emoji:"🙉",name:"hear-no-evil monkey",category:"animals",keywords:["monkey","hear no evil","ears"]},{emoji:"🙊",name:"speak-no-evil monkey",category:"animals",keywords:["monkey","speak no evil","mouth"]},{emoji:"🐒",name:"monkey",category:"animals",keywords:["monkey","primate","zoo"]},{emoji:"🦍",name:"gorilla",category:"animals",keywords:["gorilla","ape","strong"]},{emoji:"🦧",name:"orangutan",category:"animals",keywords:["orangutan","ape","orange"]},{emoji:"🐺",name:"wolf",category:"animals",keywords:["wolf","howl","wild"]},{emoji:"🐗",name:"boar",category:"animals",keywords:["boar","pig","wild"]},{emoji:"🐴",name:"horse face",category:"animals",keywords:["horse","neigh","ride"]},{emoji:"🐎",name:"horse",category:"animals",keywords:["horse","racing","gallop"]},{emoji:"🦄",name:"unicorn",category:"animals",keywords:["unicorn","magical","horn"]},{emoji:"🦓",name:"zebra",category:"animals",keywords:["zebra","stripes","africa"]},{emoji:"🦌",name:"deer",category:"animals",keywords:["deer","antlers","forest"]},{emoji:"🦏",name:"rhinoceros",category:"animals",keywords:["rhino","horn","africa"]},{emoji:"🦛",name:"hippopotamus",category:"animals",keywords:["hippo","water","africa"]},{emoji:"🐘",name:"elephant",category:"animals",keywords:["elephant","trunk","memory"]},{emoji:"🦒",name:"giraffe",category:"animals",keywords:["giraffe","tall","neck"]},{emoji:"🦘",name:"kangaroo",category:"animals",keywords:["kangaroo","hop","australia"]},{emoji:"🦥",name:"sloth",category:"animals",keywords:["sloth","slow","lazy"]},{emoji:"🦦",name:"otter",category:"animals",keywords:["otter","water","cute"]},{emoji:"🦨",name:"skunk",category:"animals",keywords:["skunk","smell","stripe"]},{emoji:"🦡",name:"badger",category:"animals",keywords:["badger","honey","dig"]},{emoji:"🐾",name:"paw prints",category:"animals",keywords:["paw","prints","tracks"]},{emoji:"🐔",name:"chicken",category:"animals",keywords:["chicken","rooster","farm"]},{emoji:"🐓",name:"rooster",category:"animals",keywords:["rooster","cock","morning"]},{emoji:"🐣",name:"hatching chick",category:"animals",keywords:["chick","hatching","egg"]},{emoji:"🐤",name:"baby chick",category:"animals",keywords:["chick","baby","yellow"]},{emoji:"🐥",name:"front-facing baby chick",category:"animals",keywords:["chick","baby","cute"]},{emoji:"🦆",name:"duck",category:"animals",keywords:["duck","quack","water"]},{emoji:"🦅",name:"eagle",category:"animals",keywords:["eagle","bird","freedom"]},{emoji:"🦉",name:"owl",category:"animals",keywords:["owl","wise","night"]},{emoji:"🦇",name:"bat",category:"animals",keywords:["bat","vampire","night"]},{emoji:"",name:"bug",category:"animals",keywords:["bug","insect","crawl"]},{emoji:"🦋",name:"butterfly",category:"animals",keywords:["butterfly","beautiful","fly"]},{emoji:"🐌",name:"snail",category:"animals",keywords:["snail","slow","shell"]},{emoji:"🐞",name:"lady beetle",category:"animals",keywords:["ladybug","beetle","red"]},{emoji:"🐜",name:"ant",category:"animals",keywords:["ant","work","colony"]},{emoji:"🦟",name:"mosquito",category:"animals",keywords:["mosquito","bite","buzz"]},{emoji:"🕷️",name:"spider",category:"animals",keywords:["spider","web","eight legs"]},{emoji:"🦂",name:"scorpion",category:"animals",keywords:["scorpion","sting","desert"]},{emoji:"🐢",name:"turtle",category:"animals",keywords:["turtle","slow","shell"]},{emoji:"🐍",name:"snake",category:"animals",keywords:["snake","slither","reptile"]},{emoji:"🦎",name:"lizard",category:"animals",keywords:["lizard","gecko","reptile"]},{emoji:"🐙",name:"octopus",category:"animals",keywords:["octopus","tentacles","sea"]},{emoji:"🦑",name:"squid",category:"animals",keywords:["squid","tentacles","ocean"]},{emoji:"🦐",name:"shrimp",category:"animals",keywords:["shrimp","seafood","small"]},{emoji:"🦞",name:"lobster",category:"animals",keywords:["lobster","claws","red"]},{emoji:"🦀",name:"crab",category:"animals",keywords:["crab","claws","beach"]},{emoji:"🐡",name:"blowfish",category:"animals",keywords:["blowfish","puffer","spiky"]},{emoji:"🐠",name:"tropical fish",category:"animals",keywords:["fish","tropical","colorful"]},{emoji:"🐟",name:"fish",category:"animals",keywords:["fish","swim","water"]},{emoji:"🐬",name:"dolphin",category:"animals",keywords:["dolphin","smart","ocean"]},{emoji:"🐳",name:"spouting whale",category:"animals",keywords:["whale","spout","big"]},{emoji:"🐋",name:"whale",category:"animals",keywords:["whale","ocean","huge"]},{emoji:"🦈",name:"shark",category:"animals",keywords:["shark","teeth","dangerous"]},{emoji:"🐊",name:"crocodile",category:"animals",keywords:["crocodile","teeth","swamp"]},{emoji:"🌸",name:"cherry blossom",category:"animals",keywords:["flower","spring","pink"]},{emoji:"💐",name:"bouquet",category:"animals",keywords:["flowers","bouquet","gift"]},{emoji:"🌺",name:"hibiscus",category:"animals",keywords:["flower","tropical","red"]},{emoji:"🌻",name:"sunflower",category:"animals",keywords:["sunflower","yellow","big"]},{emoji:"🌹",name:"rose",category:"animals",keywords:["rose","love","red"]},{emoji:"🥀",name:"wilted flower",category:"animals",keywords:["flower","wilted","sad"]},{emoji:"🌷",name:"tulip",category:"animals",keywords:["tulip","spring","netherlands"]},{emoji:"🌼",name:"daisy",category:"animals",keywords:["daisy","white","simple"]},{emoji:"🌱",name:"seedling",category:"animals",keywords:["plant","grow","green"]},{emoji:"🌿",name:"herb",category:"animals",keywords:["herb","green","leaf"]},{emoji:"🍀",name:"four leaf clover",category:"animals",keywords:["clover","luck","green"]},{emoji:"🌳",name:"deciduous tree",category:"animals",keywords:["tree","nature","green"]},{emoji:"🌲",name:"evergreen tree",category:"animals",keywords:["tree","pine","christmas"]},{emoji:"🌴",name:"palm tree",category:"animals",keywords:["palm","tropical","beach"]},{emoji:"🌵",name:"cactus",category:"animals",keywords:["cactus","desert","spiky"]},{emoji:"🍎",name:"red apple",category:"food",keywords:["apple","fruit"]},{emoji:"🍊",name:"tangerine",category:"food",keywords:["orange","fruit"]},{emoji:"🍋",name:"lemon",category:"food",keywords:["lemon","fruit"]},{emoji:"🍌",name:"banana",category:"food",keywords:["banana","fruit"]},{emoji:"🍉",name:"watermelon",category:"food",keywords:["watermelon","fruit"]},{emoji:"🍇",name:"grapes",category:"food",keywords:["grapes","fruit"]},{emoji:"🍓",name:"strawberry",category:"food",keywords:["strawberry","fruit"]},{emoji:"🫐",name:"blueberries",category:"food",keywords:["blueberry","fruit"]},{emoji:"🥝",name:"kiwi fruit",category:"food",keywords:["kiwi","fruit","green"]},{emoji:"🍅",name:"tomato",category:"food",keywords:["tomato","red","vegetable"]},{emoji:"🫒",name:"olive",category:"food",keywords:["olive","green","oil"]},{emoji:"🥥",name:"coconut",category:"food",keywords:["coconut","tropical","milk"]},{emoji:"🥑",name:"avocado",category:"food",keywords:["avocado","green","healthy"]},{emoji:"🍆",name:"eggplant",category:"food",keywords:["eggplant","purple","vegetable"]},{emoji:"🥔",name:"potato",category:"food",keywords:["potato","vegetable","starch"]},{emoji:"🥕",name:"carrot",category:"food",keywords:["carrot","orange","vegetable"]},{emoji:"🌽",name:"ear of corn",category:"food",keywords:["corn","yellow","vegetable"]},{emoji:"🌶️",name:"hot pepper",category:"food",keywords:["pepper","hot","spicy"]},{emoji:"🫑",name:"bell pepper",category:"food",keywords:["pepper","bell","vegetable"]},{emoji:"🥒",name:"cucumber",category:"food",keywords:["cucumber","green","vegetable"]},{emoji:"🥬",name:"leafy greens",category:"food",keywords:["lettuce","greens","salad"]},{emoji:"🥦",name:"broccoli",category:"food",keywords:["broccoli","green","vegetable"]},{emoji:"🧄",name:"garlic",category:"food",keywords:["garlic","flavor","cooking"]},{emoji:"🧅",name:"onion",category:"food",keywords:["onion","cry","cooking"]},{emoji:"🍄",name:"mushroom",category:"food",keywords:["mushroom","fungi","cooking"]},{emoji:"🥜",name:"peanuts",category:"food",keywords:["peanuts","nuts","snack"]},{emoji:"🌰",name:"chestnut",category:"food",keywords:["chestnut","nut","autumn"]},{emoji:"🍞",name:"bread",category:"food",keywords:["bread","loaf","carbs"]},{emoji:"🥐",name:"croissant",category:"food",keywords:["croissant","french","pastry"]},{emoji:"🥖",name:"baguette bread",category:"food",keywords:["baguette","french","bread"]},{emoji:"🫓",name:"flatbread",category:"food",keywords:["flatbread","bread","thin"]},{emoji:"🥨",name:"pretzel",category:"food",keywords:["pretzel","twisted","snack"]},{emoji:"🥯",name:"bagel",category:"food",keywords:["bagel","round","breakfast"]},{emoji:"🥞",name:"pancakes",category:"food",keywords:["pancakes","breakfast","syrup"]},{emoji:"🧇",name:"waffle",category:"food",keywords:["waffle","breakfast","squares"]},{emoji:"🧀",name:"cheese wedge",category:"food",keywords:["cheese","dairy","yellow"]},{emoji:"🍖",name:"meat on bone",category:"food",keywords:["meat","bone","protein"]},{emoji:"🍗",name:"poultry leg",category:"food",keywords:["chicken","leg","meat"]},{emoji:"🥩",name:"cut of meat",category:"food",keywords:["steak","meat","red"]},{emoji:"🥓",name:"bacon",category:"food",keywords:["bacon","pork","breakfast"]},{emoji:"🍔",name:"hamburger",category:"food",keywords:["burger","hamburger","fast food"]},{emoji:"🍟",name:"french fries",category:"food",keywords:["fries","potato","fast food"]},{emoji:"🍕",name:"pizza",category:"food",keywords:["pizza","slice","italian"]},{emoji:"🌭",name:"hot dog",category:"food",keywords:["hot dog","sausage","fast food"]},{emoji:"🥪",name:"sandwich",category:"food",keywords:["sandwich","bread","lunch"]},{emoji:"🌮",name:"taco",category:"food",keywords:["taco","mexican","shell"]},{emoji:"🌯",name:"burrito",category:"food",keywords:["burrito","wrap","mexican"]},{emoji:"🫔",name:"tamale",category:"food",keywords:["tamale","mexican","corn"]},{emoji:"🥙",name:"stuffed flatbread",category:"food",keywords:["pita","flatbread","stuffed"]},{emoji:"🧆",name:"falafel",category:"food",keywords:["falafel","middle eastern","chickpea"]},{emoji:"🥚",name:"egg",category:"food",keywords:["egg","protein","breakfast"]},{emoji:"🍳",name:"cooking",category:"food",keywords:["cooking","frying pan","egg"]},{emoji:"🥘",name:"shallow pan of food",category:"food",keywords:["paella","pan","cooking"]},{emoji:"🍲",name:"pot of food",category:"food",keywords:["stew","pot","cooking"]},{emoji:"🫕",name:"fondue",category:"food",keywords:["fondue","cheese","pot"]},{emoji:"🥣",name:"bowl with spoon",category:"food",keywords:["bowl","cereal","soup"]},{emoji:"🥗",name:"green salad",category:"food",keywords:["salad","healthy","greens"]},{emoji:"🍿",name:"popcorn",category:"food",keywords:["popcorn","movie","snack"]},{emoji:"🧈",name:"butter",category:"food",keywords:["butter","dairy","spread"]},{emoji:"🧂",name:"salt",category:"food",keywords:["salt","seasoning","white"]},{emoji:"🥫",name:"canned food",category:"food",keywords:["can","canned","preserved"]},{emoji:"🍱",name:"bento box",category:"food",keywords:["bento","japanese","lunch box"]},{emoji:"🍘",name:"rice cracker",category:"food",keywords:["rice","cracker","japanese"]},{emoji:"🍙",name:"rice ball",category:"food",keywords:["rice ball","onigiri","japanese"]},{emoji:"🍚",name:"cooked rice",category:"food",keywords:["rice","cooked","bowl"]},{emoji:"🍛",name:"curry rice",category:"food",keywords:["curry","rice","spicy"]},{emoji:"🍜",name:"steaming bowl",category:"food",keywords:["ramen","noodles","soup"]},{emoji:"🍝",name:"spaghetti",category:"food",keywords:["spaghetti","pasta","italian"]},{emoji:"🍠",name:"roasted sweet potato",category:"food",keywords:["sweet potato","roasted","orange"]},{emoji:"🍢",name:"oden",category:"food",keywords:["oden","japanese","skewer"]},{emoji:"🍣",name:"sushi",category:"food",keywords:["sushi","japanese","fish"]},{emoji:"🍤",name:"fried shrimp",category:"food",keywords:["shrimp","fried","tempura"]},{emoji:"🍥",name:"fish cake with swirl",category:"food",keywords:["fish cake","japanese","swirl"]},{emoji:"🥮",name:"moon cake",category:"food",keywords:["moon cake","chinese","festival"]},{emoji:"🍡",name:"dango",category:"food",keywords:["dango","japanese","sweet"]},{emoji:"🥟",name:"dumpling",category:"food",keywords:["dumpling","chinese","steamed"]},{emoji:"🥠",name:"fortune cookie",category:"food",keywords:["fortune cookie","chinese","luck"]},{emoji:"🥡",name:"takeout box",category:"food",keywords:["takeout","chinese","box"]},{emoji:"🦀",name:"crab",category:"food",keywords:["crab","seafood","claws"]},{emoji:"🦞",name:"lobster",category:"food",keywords:["lobster","seafood","red"]},{emoji:"🦐",name:"shrimp",category:"food",keywords:["shrimp","seafood","small"]},{emoji:"🦑",name:"squid",category:"food",keywords:["squid","seafood","tentacles"]},{emoji:"🦪",name:"oyster",category:"food",keywords:["oyster","seafood","shell"]},{emoji:"🍦",name:"soft ice cream",category:"food",keywords:["ice cream","soft serve","cone"]},{emoji:"🍧",name:"shaved ice",category:"food",keywords:["shaved ice","snow cone","cold"]},{emoji:"🍨",name:"ice cream",category:"food",keywords:["ice cream","dessert","cold"]},{emoji:"🍩",name:"doughnut",category:"food",keywords:["donut","doughnut","sweet"]},{emoji:"🍪",name:"cookie",category:"food",keywords:["cookie","sweet","baked"]},{emoji:"🎂",name:"birthday cake",category:"food",keywords:["cake","birthday","celebration"]},{emoji:"🍰",name:"shortcake",category:"food",keywords:["cake","slice","dessert"]},{emoji:"🧁",name:"cupcake",category:"food",keywords:["cupcake","muffin","sweet"]},{emoji:"🥧",name:"pie",category:"food",keywords:["pie","dessert","slice"]},{emoji:"🍫",name:"chocolate bar",category:"food",keywords:["chocolate","bar","sweet"]},{emoji:"🍬",name:"candy",category:"food",keywords:["candy","sweet","wrapper"]},{emoji:"🍭",name:"lollipop",category:"food",keywords:["lollipop","candy","stick"]},{emoji:"🍮",name:"custard",category:"food",keywords:["custard","pudding","dessert"]},{emoji:"🍯",name:"honey pot",category:"food",keywords:["honey","sweet","bee"]},{emoji:"🍼",name:"baby bottle",category:"food",keywords:["bottle","baby","milk"]},{emoji:"🥛",name:"glass of milk",category:"food",keywords:["milk","glass","dairy"]},{emoji:"☕",name:"hot beverage",category:"food",keywords:["coffee","tea","hot"]},{emoji:"🫖",name:"teapot",category:"food",keywords:["teapot","tea","hot"]},{emoji:"🍵",name:"teacup without handle",category:"food",keywords:["tea","green tea","cup"]},{emoji:"🍶",name:"sake",category:"food",keywords:["sake","japanese","alcohol"]},{emoji:"🍾",name:"bottle with popping cork",category:"food",keywords:["champagne","celebration","cork"]},{emoji:"🍷",name:"wine glass",category:"food",keywords:["wine","glass","alcohol"]},{emoji:"🍸",name:"cocktail glass",category:"food",keywords:["cocktail","martini","alcohol"]},{emoji:"🍹",name:"tropical drink",category:"food",keywords:["tropical","cocktail","umbrella"]},{emoji:"🍺",name:"beer mug",category:"food",keywords:["beer","mug","alcohol"]},{emoji:"🍻",name:"clinking beer mugs",category:"food",keywords:["beer","cheers","celebration"]},{emoji:"🥂",name:"clinking glasses",category:"food",keywords:["champagne","cheers","celebration"]},{emoji:"🥃",name:"tumbler glass",category:"food",keywords:["whiskey","tumbler","alcohol"]},{emoji:"🫗",name:"pouring liquid",category:"food",keywords:["pour","liquid","drink"]},{emoji:"🥤",name:"cup with straw",category:"food",keywords:["soda","straw","drink"]},{emoji:"🧋",name:"bubble tea",category:"food",keywords:["bubble tea","boba","drink"]},{emoji:"🧃",name:"beverage box",category:"food",keywords:["juice box","drink","straw"]},{emoji:"🧉",name:"mate",category:"food",keywords:["mate","tea","south american"]},{emoji:"🧊",name:"ice",category:"food",keywords:["ice","cold","cube"]},{emoji:"⚽",name:"soccer ball",category:"activities",keywords:["soccer","football","sport"]},{emoji:"🏀",name:"basketball",category:"activities",keywords:["basketball","sport"]},{emoji:"🏈",name:"american football",category:"activities",keywords:["football","sport"]},{emoji:"⚾",name:"baseball",category:"activities",keywords:["baseball","sport"]},{emoji:"🥎",name:"softball",category:"activities",keywords:["softball","sport"]},{emoji:"🎾",name:"tennis",category:"activities",keywords:["tennis","sport"]},{emoji:"🚗",name:"automobile",category:"travel",keywords:["car","vehicle"]},{emoji:"🚕",name:"taxi",category:"travel",keywords:["taxi","car"]},{emoji:"🚙",name:"sport utility vehicle",category:"travel",keywords:["suv","car"]},{emoji:"🚌",name:"bus",category:"travel",keywords:["bus","vehicle"]},{emoji:"🚎",name:"trolleybus",category:"travel",keywords:["trolley","bus"]},{emoji:"🏎️",name:"racing car",category:"travel",keywords:["race","car","fast"]},{emoji:"💡",name:"light bulb",category:"objects",keywords:["idea","light","bulb"]},{emoji:"🔋",name:"battery",category:"objects",keywords:["battery","power"]},{emoji:"🖥️",name:"desktop computer",category:"objects",keywords:["computer","desktop"]},{emoji:"💻",name:"laptop",category:"objects",keywords:["laptop","computer"]},{emoji:"📱",name:"mobile phone",category:"objects",keywords:["phone","mobile"]},{emoji:"☎️",name:"telephone",category:"objects",keywords:["phone","telephone"]},{emoji:"❤️",name:"red heart",category:"symbols",keywords:["love","heart"]},{emoji:"🧡",name:"orange heart",category:"symbols",keywords:["love","heart"]},{emoji:"💛",name:"yellow heart",category:"symbols",keywords:["love","heart"]},{emoji:"💚",name:"green heart",category:"symbols",keywords:["love","heart"]},{emoji:"💙",name:"blue heart",category:"symbols",keywords:["love","heart"]},{emoji:"💜",name:"purple heart",category:"symbols",keywords:["love","heart"]},{emoji:"🖤",name:"black heart",category:"symbols",keywords:["love","heart"]},{emoji:"🤍",name:"white heart",category:"symbols",keywords:["love","heart"]},{emoji:"🏁",name:"chequered flag",category:"flags",keywords:["flag","race","finish"]},{emoji:"🚩",name:"triangular flag",category:"flags",keywords:["flag","warning"]},{emoji:"🏳️",name:"white flag",category:"flags",keywords:["flag","surrender"]},{emoji:"🏴",name:"black flag",category:"flags",keywords:["flag","pirate"]},{emoji:"🏳️‍🌈",name:"rainbow flag",category:"flags",keywords:["flag","rainbow","pride"]}],ai=e=>{const{value:o,defaultValue:t="",onChange:n,onEmojiSelect:a,isOpen:i,onOpen:s,onClose:c,closeOnSelect:d=!0,maxRecentEmojis:u=16,showRecentEmojis:m=!0,enabledCategories:g=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:h=[]}=e,[f,y]=p.useState(i??!1),[b,k]=p.useState(o??t),[C,j]=p.useState(""),[w,S]=p.useState("smileys"),[x,v]=p.useState([]),T=p.useRef(null),R=p.useRef(null),M=p.useMemo(()=>[...Tf,...h],[h]),E=p.useMemo(()=>{let H=M;if(w!=="recent"?H=H.filter(D=>D.category===w):H=x,C){const D=C.toLowerCase();H=H.filter(L=>L.name.toLowerCase().includes(D)||L.keywords.some(B=>B.toLowerCase().includes(D)))}return H},[M,w,x,C]);p.useEffect(()=>{o!==void 0&&k(o)},[o]),p.useEffect(()=>{i!==void 0&&y(i)},[i]),p.useEffect(()=>{if(m&&typeof localStorage<"u"){const H=localStorage.getItem("emojiPicker-recentEmojis");if(H)try{v(JSON.parse(H))}catch{}}},[m]),p.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)!="function")return;const H=D=>{f&&T.current&&R.current&&!T.current.contains(D.target)&&!R.current.contains(D.target)&&F()};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[f]);const I=p.useCallback(H=>{m&&v(D=>{const L=D.filter($=>$.emoji!==H.emoji),B=[H,...L].slice(0,u);return typeof localStorage<"u"&&localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(B)),B})},[m,u]),V=p.useCallback(()=>{const H=!f;y(H),H?(s==null||s(),j(""),m&&x.length>0?S("recent"):S("smileys")):c==null||c()},[f,s,c,m,x.length]),P=p.useCallback(H=>{k(H.emoji),I(H),n==null||n(H.emoji),a==null||a(H),d&&(y(!1),c==null||c())},[n,a,d,c,I]),z=p.useCallback(H=>{j(H),H&&w==="recent"&&S("smileys")},[w]),W=p.useCallback(H=>{S(H),j("")},[]),F=p.useCallback(()=>{y(!1),c==null||c()},[c]);return{isOpen:f,selectedEmoji:b,recentEmojis:x,searchQuery:C,activeCategory:w,filteredEmojis:E,handleToggle:V,handleEmojiSelect:P,handleSearchChange:z,handleCategoryChange:W,handleClose:F,triggerRef:T,dropdownRef:R}},li=({id:e,name:o,label:t,placeholder:n="Select an emoji",helperText:a,views:i={},size:s="md",shape:c="default",variant:d="default",error:u=!1,isDisabled:m=!1,isReadOnly:g=!1,showSearch:h=!0,showCategories:f=!0,showRecentEmojis:y=!0,enabledCategories:b=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:k,selectedEmoji:C,recentEmojis:j,searchQuery:w,activeCategory:S,filteredEmojis:x,handleToggle:v,handleEmojiSelect:T,handleSearchChange:R,handleCategoryChange:M,handleClose:E,triggerRef:I,dropdownRef:V,onChange:P,onOpen:z,onClose:W,onEmojiSelect:F,customEmojis:H,closeOnSelect:D,maxRecentEmojis:L,value:B,defaultValue:$,...O})=>{const{getColor:N}=l.useTheme(),_={...Ge.container,...i==null?void 0:i.container},Y={...Ge.trigger,...Sf[s],...jf[c],...wf[d],...u&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...!m&&!g&&{_hover:{borderColor:"color-gray-300"}},...i==null?void 0:i.trigger},A={...Ge.dropdown,...i==null?void 0:i.dropdown},G={...Ge.categoryTabs,...i==null?void 0:i.categoryTabs},Q={...Ge.emojiGrid,...i==null?void 0:i.emojiGrid},X=b.filter(K=>K==="recent"?y&&j.length>0:!0);return r.jsxs(l.View,{..._,...O,children:[t&&r.jsx(l.Text,{fontSize:s==="xs"?"12px":s==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...i==null?void 0:i.label,children:t}),r.jsxs(l.View,{ref:I,onClick:m||g?void 0:v,...Y,children:[r.jsx(l.Horizontal,{alignItems:"center",gap:8,children:r.jsx(l.Text,{color:C?"color-gray-800":"color-gray-500",fontSize:"inherit",children:C||n})}),!g&&!m&&r.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:k?"up":"down"})]}),k&&r.jsxs(l.View,{ref:V,...A,children:[h&&r.jsx(l.View,{...Ge.searchInput,...i==null?void 0:i.searchInput,children:r.jsx(ve,{placeholder:"Search emojis...",value:w,onChange:K=>R(K.target.value),size:"sm"})}),f&&r.jsx(l.View,{...G,children:X.map(K=>r.jsx(l.View,{...Ge.categoryTab,...S===K&&{borderBottomColor:"theme-primary",color:"theme-primary",backgroundColor:"color-blue-50"},onClick:()=>M(K),title:K.charAt(0).toUpperCase()+K.slice(1),...i==null?void 0:i.categoryTab,children:vf[K]},K))}),r.jsx(l.View,{...Q,children:x.length>0?x.map((K,oe)=>r.jsx(l.View,{...Ge.emoji,onClick:()=>T(K),title:K.name,_hover:{backgroundColor:"color-gray-50",transform:"scale(1.05)"},color:"color-gray-800",...i==null?void 0:i.emoji,children:K.emoji},`${K.emoji}-${oe}`)):r.jsx(l.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(l.Text,{fontSize:"14px",children:w?"No emojis found":"No emojis in this category"})})})]}),a&&r.jsx(l.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},If=e=>{const o=fe(e),t={...e,value:o.value??e.value??e.defaultValue},n=ai(t),a=i=>{var s;n.handleEmojiSelect(i),o.onChange(i.emoji),(s=e.onEmojiSelect)==null||s.call(e,i)};return r.jsx(li,{...n,...t,handleEmojiSelect:a})},Ff=If,Rf=({files:e,onRemove:o,maxHeight:t="120px",views:n={}})=>{if(e.length===0)return null;const a=p.useCallback(i=>i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(l.View,{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 0",maxHeight:t,overflowY:"auto",...n==null?void 0:n.container,children:e.map((i,s)=>{const c=i.url||"",d=i.type.startsWith("image/"),u=i.type.startsWith("video/"),m=i.type.startsWith("audio/");return r.jsx(l.Vertical,{alignItems:"center",gap:"6px",padding:"6px 10px",borderRadius:"8px",border:"1px solid #E2E8F0",backgroundColor:"color-white",position:"relative",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...n==null?void 0:n.item,children:r.jsxs(Se,{children:[r.jsx(Se.Trigger,{children:r.jsxs(l.View,{position:"relative",children:[d&&c&&r.jsx(l.Image,{src:c,alt:i.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"8px"}),u&&c&&r.jsx(l.View,{as:"video",src:c,alt:i.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"8px"}),m&&r.jsx(l.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-100",borderRadius:"8px",children:r.jsx(Ro,{widthHeight:24,color:"color-black"})}),!d&&!u&&!m&&r.jsx(l.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-100",borderRadius:"8px",children:r.jsx(ao,{widthHeight:24,color:"color-black"})}),o&&r.jsx(l.Button,{position:"absolute",top:"-4px",right:"-4px",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",backgroundColor:"color-red-500",color:"white",fontSize:14,fontWeight:"bold",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"2px solid white",transition:"background-color 0.2s ease, opacity 0.2s ease",_hover:{backgroundColor:"#DC2626"},onClick:g=>{g.stopPropagation(),o(s)},"aria-label":`Remove ${i.name}`,children:"×"})]})}),r.jsxs(Se.Content,{children:[d&&c&&r.jsx(l.Image,{src:c,alt:i.name,maxWidth:"300px"}),u&&c&&r.jsx(l.View,{as:"video",src:c,controls:!0,maxWidth:"300px"}),m&&c&&r.jsx(l.View,{as:"audio",src:c,controls:!0,width:"100%"}),r.jsxs(l.Text,{marginTop:"4px",maxLines:1,width:"100%",fontSize:12,...n==null?void 0:n.name,children:[i.name," (",a(i.size),")"]})]})]})},s)})})},zf=e=>{const o=ge("slider",e),t=Xl(o);return r.jsx(Jl,{...o,...t})},ii=zf,Mf=({url:e,type:o,name:t,onOpen:n})=>{const a=o.toLowerCase(),i=a.startsWith("image"),s=a.startsWith("video"),c=a.startsWith("audio"),d=()=>{n&&n()};return r.jsxs(l.View,{width:"60px",height:"60px",flexShrink:0,borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-200",cursor:"pointer",onClick:d,children:[i&&r.jsx(l.Image,{src:e,alt:t,width:"100%",height:"100%",objectFit:"cover"}),s&&r.jsx(l.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:u=>u.stopPropagation()}),c&&r.jsx(l.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:u=>u.stopPropagation()}),!i&&!s&&!c&&r.jsx(ao,{widthHeight:24,color:"color-gray-600"})]})},Ke=Ho.create(e=>({modals:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},n={})=>{e(a=>({...a,modals:[...a.modals,{name:o,props:{...t,isVisible:!0},overlayProps:n}]}))},hide:o=>{e(t=>o?{...t,modals:t.modals.filter(n=>n.name!==o)}:{modals:[]})},setOnHide:o=>{e(t=>({...t,onHide:o}))},setOnShow:o=>{e(t=>({...t,onShow:o}))}})),Wf=(e,o={},t={})=>{Ke.getState().show(e,o,t),Ke.getState().onShow(e,o)},dn=e=>{Ke.getState().onHide(e),Ke.getState().hide(typeof e=="string"?e:void 0)},Hf={square:{borderRadius:0},rounded:{borderRadius:8}},Pf={center:{justifyContent:"center",alignItems:"center"},top:{justifyContent:"center",alignItems:"flex-start"},right:{justifyContent:"flex-end",alignItems:"center"},bottom:{justifyContent:"center",alignItems:"flex-end"},left:{justifyContent:"flex-start",alignItems:"center"}},Vf={xs:12,sm:16,md:20,lg:24,xl:28},it={body:{fontSize:"16px",fontWeight:"400",color:"color-gray-700"}},si=p.memo(({children:e,blur:o,isOpen:t=!1,isClosePrevented:n=!1,onClose:a=()=>{},position:i="center",views:s,...c})=>{const d=p.useCallback(()=>{n||a()},[n,a]);return r.jsx(l.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:d,visibility:t?"visible":"hidden",opacity:t?1:0,transition:"opacity 0.2s ease, visibility 0.2s ease",...s==null?void 0:s.container,children:r.jsx(l.View,{position:"absolute",top:0,left:0,zIndex:1e3,width:"100vw",height:"100vh",display:"flex",backgroundColor:"color-blackAlpha-500",backdropFilter:o?`blur(${o}px)`:void 0,transition:"background-color 0.2s ease, backdrop-filter 0.2s ease",onClick:d,...Pf[i],...c,...s==null?void 0:s.view,children:e})})}),Af={boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"},Ef={elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},Df=p.memo(({children:e,shadow:o,isFullScreen:t=!1,shape:n="rounded",views:a,isOpen:i=!0,position:s,...c})=>{const d=typeof document!==void 0?Af:Ef,u=p.useCallback(m=>{m&&m.stopPropagation&&m.stopPropagation()},[]);return r.jsx(l.Vertical,{cursor:"default",backgroundColor:"color-white",width:t?"100%":600,height:t?"100%":"fit-content",onClick:u,transition:"opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",opacity:i?1:0,transform:i?"translateY(0)":"translateY(8px)",...o||d,...Hf[n],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...c,...a==null?void 0:a.container,children:e})}),$f=p.memo(({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:n="right",views:a,onClose:i,...s})=>{const c=i||dn,d=r.jsx(l.View,{onClick:c,children:r.jsx(Te,{widthHeight:Vf[t],color:o})});return r.jsxs(l.Horizontal,{justifyContent:n==="none"?"center":"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:24,borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",media:{mobile:{paddingVertical:12,paddingHorizontal:16}},...s,...a==null?void 0:a.header,children:[n==="left"&&d,e,n==="right"&&d]})}),Lf=p.memo(({children:e,views:o,...t})=>r.jsx(l.View,{paddingVertical:16,paddingHorizontal:24,fontSize:it.body.fontSize,fontWeight:it.body.fontWeight,color:it.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e})),_f=p.memo(({children:e,views:o,...t})=>r.jsx(l.Horizontal,{marginTop:"auto",alignItems:"center",justifyContent:"flex-end",paddingVertical:16,paddingHorizontal:24,borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",gap:12,media:{mobile:{paddingVertical:12,paddingHorizontal:16,gap:8}},...t,...o==null?void 0:o.container,children:e})),un=({modals:e,onShow:o,onHide:t})=>{const n=Ke(a=>a.modals);return p.useEffect(()=>{o&&Ke.getState().setOnShow(o)},[o]),p.useEffect(()=>{t&&Ke.getState().setOnHide(t)},[t]),n.length===0?null:r.jsx(p.Fragment,{children:n.map((a,i)=>{const s=e[a.name];return s?r.jsx(si,{isOpen:a.props.isVisible,onClose:()=>dn(a.name),blur:5,...a.overlayProps,style:{zIndex:1e3+i},children:r.jsx(s,{...a.props})},i):(console.error(`${a.name} modal doesn't exist`),null)})})},so=({children:e})=>r.jsx(r.Fragment,{children:e});so.Overlay=si;so.Container=Df;so.Header=$f;so.Body=Lf;so.Footer=_f;so.Layout=un;const oa={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},Bf={left:{top:0,left:0,bottom:0,height:"100vh",borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{top:0,right:0,bottom:0,height:"100vh",borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"},top:{top:0,left:0,right:0,width:"100vw",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},bottom:{bottom:0,left:0,right:0,width:"100vw",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200"}},pn=({isOpen:e,onClose:o,isClosePrevented:t,blur:n,children:a,...i})=>{const s=()=>{t||o()};return p.useEffect(()=>{const c=d=>{d.key==="Escape"&&e&&!t&&o()};return e&&document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[e,t,o]),r.jsx(l.View,{"data-testid":"drawer-overlay",role:"dialog","aria-modal":"true",position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:1e3,visibility:e?"visible":"hidden",onClick:s,opacity:e?1:0,transition:"opacity 0.2s ease, visibility 0.2s ease, background-color 0.2s ease",backgroundColor:e?"color-blackAlpha-500":"transparent",backdropFilter:n?`blur(${n}px)`:void 0,pointerEvents:e?"auto":"none",...i,children:a})},mn=({placement:e="right",size:o="md",isOpen:t=!1,children:n,...a})=>{const i=m=>{m.stopPropagation()},c=e==="top"||e==="bottom"?{height:o==="full"?"100vh":oa[o]||o,maxHeight:"100vh"}:{width:o==="full"?"100vw":oa[o]||o,maxWidth:"100vw"},d=e==="left"?"0 12px 12px 0":e==="right"?"12px 0 0 12px":e==="top"?"0 0 12px 12px":"12px 12px 0 0",u=t?"translate3d(0, 0, 0)":e==="left"?"translate3d(-100%, 0, 0)":e==="right"?"translate3d(100%, 0, 0)":e==="top"?"translate3d(0, -100%, 0)":"translate3d(0, 100%, 0)";return r.jsx(l.Vertical,{position:"absolute",backgroundColor:"color-white",borderRadius:d,...Bf[e],...c,onClick:i,transform:u,willChange:"transform",transition:"transform 0.24s ease, box-shadow 0.2s ease",boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12)",...a,children:n})},Of=({children:e,onClose:o,buttonPosition:t="right",...n})=>{const a=o&&r.jsx(l.View,{onClick:o,cursor:"pointer",padding:8,children:r.jsx(Te,{widthHeight:20,color:"color-gray-500"})});return r.jsxs(l.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:t==="none"?"center":"space-between",...n,children:[t==="left"&&a,e,t==="right"&&a]})},Nf=({children:e,...o})=>r.jsx(l.Vertical,{padding:24,flex:1,overflowY:"auto",...o,children:e}),qf=({children:e,...o})=>r.jsx(l.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...o,children:e}),Xe=Ho.create(e=>({drawers:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},n={})=>{e(a=>({...a,drawers:[...a.drawers,{name:o,props:{...t,isOpen:!1},overlayProps:n}]}))},hide:o=>{e(t=>o?{...t,drawers:t.drawers.filter(n=>n.name!==o)}:{drawers:[]})},setOnHide:o=>{e(t=>({...t,onHide:o}))},setOnShow:o=>{e(t=>({...t,onShow:o}))}})),Uf=(e,o={},t={})=>{const n=Xe.getState();n.hide(e),n.show(e,o,t),n.onShow(e,o),queueMicrotask(()=>{Xe.setState(a=>({drawers:a.drawers.map(i=>i.name===e?{...i,props:{...i.props,isOpen:!0}}:i)}))})},ci=e=>{Xe.getState().onHide(e),Xe.getState().hide(typeof e=="string"?e:void 0)},Gf=({drawers:e,onShow:o,onHide:t})=>{const n=Xe(a=>a.drawers);return p.useEffect(()=>{o&&Xe.getState().setOnShow(o)},[o]),p.useEffect(()=>{t&&Xe.getState().setOnHide(t)},[t]),n.length===0?null:r.jsx(p.Fragment,{children:n.map((a,i)=>{var f;const s=e[a.name];if(!s)return console.error(`${a.name} drawer doesn't exist`),null;const{placement:c,size:d,isClosePrevented:u,blur:m,containerProps:g,...h}=a.props||{};return r.jsx(pn,{isOpen:a.props.isOpen,onClose:()=>ci(a.name),isClosePrevented:u,blur:m,...a.overlayProps,style:{zIndex:1e3+i,...((f=a.overlayProps)==null?void 0:f.style)||{}},children:r.jsx(mn,{placement:c,size:d,isOpen:a.props.isOpen,...g||{},children:r.jsx(p.Suspense,{fallback:null,children:r.jsx(s,{...h})})})},i)})})},Yf=({isOpen:e,onClose:o,placement:t="right",size:n="md",isClosePrevented:a,children:i,...s})=>r.jsx(pn,{isOpen:e,onClose:o,isClosePrevented:a,...s,children:r.jsx(mn,{placement:t,size:n,isOpen:e,children:i})}),co=Yf;co.Overlay=pn;co.Container=mn;co.Header=Of;co.Body=Nf;co.Footer=qf;co.Layout=Gf;const di=({behavior:e,keyboardVerticalOffset:o,dismissOnTap:t,enabled:n,children:a,...i})=>r.jsx(l.View,{flex:1,width:"100%",...i,children:a}),Kf=({header:e,footer:o,children:t,isLoading:n=!1,safe:a=!0,scrollable:i=!0,dismissKeyboardOnTap:s=!0,keyboardVerticalOffset:c=0,views:d={},backgroundColor:u="color-white",...m})=>{const g=a?l.SafeArea:l.View,h=l.isBrowser()?{}:{keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:!1,contentContainerStyle:{flexGrow:1}},f=n?r.jsx(l.Center,{flex:1,width:"100%",...d.content,children:r.jsx(Je,{})}):i?r.jsx(l.Scroll,{flex:1,width:"100%",...h,...d.content,children:t}):r.jsx(l.View,{flex:1,width:"100%",...d.content,children:t});return r.jsxs(g,{flex:1,height:"100%",width:"100%",flexDirection:"column",backgroundColor:u,...m,...d.container,children:[e!=null&&r.jsx(l.View,{width:"100%",flexShrink:0,...d.header,children:e}),r.jsxs(di,{flexDirection:"column",dismissOnTap:s,keyboardVerticalOffset:c,children:[f,o!=null&&r.jsx(l.View,{width:"100%",flexShrink:0,...d.footer,children:o})]})]})},Nr=Ho.create(e=>({started:!1,loaded:!1,setStarted:(o=!0)=>e({started:o}),setLoaded:(o=!0)=>e({loaded:o}),reset:()=>e({started:!1,loaded:!1})})),Xf=(e=!0)=>Nr.getState().setLoaded(e),Jf=(e=!0)=>Nr.getState().setStarted(e),Qf=({logo:e,logoSrc:o,loader:t,showLoader:n=!0,duration:a=600,isLoaded:i,onHidden:s,backgroundColor:c="color-white",children:d,...u})=>{const m=Nr(w=>w.loaded),g=i!==void 0?i:m,[h,f]=p.useState(!0),[y,b]=p.useState(!1);if(p.useEffect(()=>{if(!g||y)return;b(!0);const w=setTimeout(()=>{f(!1),s==null||s()},a);return()=>clearTimeout(w)},[g,y,a,s]),!h)return null;const k=l.isBrowser()?"fixed":"absolute",C=y?l.Animation.fadeOut({duration:`${a}ms`}):void 0,j=e??(o?r.jsx(l.Image,{src:o,width:120,height:120,alt:"logo"}):null);return r.jsxs(l.Center,{position:k,top:0,left:0,right:0,bottom:0,zIndex:9999,backgroundColor:c,animate:C,...u,children:[r.jsxs(l.Vertical,{alignItems:"center",gap:24,children:[j,n&&(t??r.jsx(Je,{}))]}),d]})},Ee=Ho.create((e,o)=>({stack:[{path:"/",params:{}}],index:0,push:(t,n={})=>e(a=>{const i=a.stack.slice(0,a.index+1);return i.push({path:t,params:n}),{stack:i,index:i.length-1}}),replace:(t,n={})=>e(a=>{const i=a.stack.slice();return i[a.index]={path:t,params:n},{stack:i}}),back:()=>{const{index:t}=o();return t<=0?!1:(e({index:t-1}),!0)},go:t=>e(n=>({index:Math.min(Math.max(n.index+t,0),n.stack.length-1)})),reset:(t,n={})=>e({stack:[{path:t,params:n}],index:0})})),Zf=(e,o)=>Ee.getState().push(e,o),ey=()=>Ee.getState().back(),gn=()=>{const e=Ee(d=>d.stack),o=Ee(d=>d.index),t=Ee(d=>d.push),n=Ee(d=>d.replace),a=Ee(d=>d.back),i=Ee(d=>d.go),s=Ee(d=>d.reset),c=e[o]||{path:"/",params:{}};return{path:c.path,params:c.params,stack:e,index:o,canGoBack:o>0,push:t,replace:n,back:a,go:i,reset:s,navigate:t}},ui=(e,o)=>{const t=e.split("/").filter(Boolean),n=o.split("/").filter(Boolean);if(t.length!==n.length)return null;const a={};for(let i=0;i<t.length;i+=1){const s=t[i];if(s.startsWith(":"))a[s.slice(1)]=decodeURIComponent(n[i]);else if(s!==n[i])return null}return a},oy=e=>Array.isArray(e)?e:Object.entries(e).map(([o,t])=>({path:o,component:t})),ry=({routes:e,notFound:o})=>{const{path:t,params:n}=gn();for(const a of oy(e)){const i=ui(a.path,t);if(i){const s=a.component;return r.jsx(s,{...n,...i})}}return o?r.jsx(o,{}):null},ty=({routes:e,notFound:o,initialPath:t,syncBrowserHistory:n=!1})=>{const{path:a,push:i,back:s,reset:c}=gn(),d=p.useRef(!1);return l.useMount(()=>{t&&c(t)}),p.useEffect(()=>{if(!(!n||typeof window>"u")){if(d.current){d.current=!1;return}try{window.history.pushState({path:a},"",a)}catch{}}},[a,n]),p.useEffect(()=>{if(!n||typeof window>"u")return;const u=()=>{d.current=!0,s()||(d.current=!1)};return window.addEventListener("popstate",u),()=>window.removeEventListener("popstate",u)},[n,s,i]),r.jsx(ry,{routes:e,notFound:o})},ny=(e=null,o=[])=>{const[t,n]=p.useState(e),[a,i]=p.useState(o),s=p.useRef({});return{activeItemId:t,setActiveItemId:n,expandedItemIds:a,toggleExpandedItem:u=>{i(m=>m.includes(u)?m.filter(h=>h!==u):[...m,u])},isItemExpanded:u=>a.includes(u),triggerRefs:s}},jt={sm:{padding:"8px 12px",fontSize:"12px",fontWeight:"500",media:{mobile:{padding:"6px 10px",fontSize:"11px"}}},md:{padding:"10px 14px",fontSize:"14px",fontWeight:"500",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},lg:{padding:"12px 16px",fontSize:"14px",fontWeight:"600",media:{mobile:{padding:"10px 14px",fontSize:"12px"}}}},wt={default:{color:"color-gray-800",style:{backgroundColor:"transparent"},transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"},outline:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",style:{backgroundColor:"transparent"},transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"}},pi={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},vo={active:{backgroundColor:"color-blue-50",color:"color-blue-700",fontWeight:"600",borderLeft:"3px solid",borderColor:"color-blue-600"},hover:{backgroundColor:"color-gray-100",transition:"background-color 0.2s ease"}},mi=p.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),ay=({children:e,value:o})=>r.jsx(mi.Provider,{value:o,children:e}),ar=()=>{const e=p.useContext(mi);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},hn=({children:e,views:o})=>{const{orientation:t}=ar(),n=t==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(n,{width:"100%",...pi[t],transition:"background-color 0.2s ease, border-color 0.2s ease",borderRadius:"8px",...o==null?void 0:o.container,children:e})},gi=p.createContext({itemValue:null,isDisabled:!1}),ly=()=>{const e=p.useContext(gi);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},fn=({item:e,value:o,isDisabled:t=!1,children:n,views:a})=>{var C;const{activeItemId:i,setActiveItemId:s,orientation:c,size:d,variant:u,onItemActivate:m}=ar(),g=(e==null?void 0:e.id)||o,h=i===g,f=(e==null?void 0:e.items)&&e.items.length>0,y=(e==null?void 0:e.disabled)||t,b=()=>{y||g&&(s(g),m&&m(g))},k=c==="horizontal"?l.Horizontal:l.Vertical;return n?r.jsx(gi.Provider,{value:{itemValue:g||null,isDisabled:y},children:r.jsx(l.View,{width:"100%",cursor:y?"not-allowed":"pointer",opacity:y?.6:1,borderRadius:"8px",transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease",...jt[d],...wt[u],...h?vo.active:{},_hover:y?{}:vo.hover,...a==null?void 0:a.item,children:n})}):f&&e?r.jsxs(k,{width:"100%",flexDirection:"column",position:"relative",...a==null?void 0:a.item,children:[r.jsxs(hi,{itemId:e.id,disabled:e.disabled,views:a,children:[e.icon&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}),r.jsx(fi,{itemId:e.id,children:r.jsx(hn,{children:(C=e.items)==null?void 0:C.map(j=>r.jsx(fn,{item:j},j.id))})})]}):e?r.jsxs(l.View,{as:e.href?"a":"div",href:e.href,onClick:b,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.6:1,width:"100%",display:"flex",alignItems:"center",borderRadius:"8px",transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease",gap:"8px",...jt[d],...wt[u],...h?vo.active:{},_hover:e.disabled?{}:vo.hover,...a==null?void 0:a.item,children:[e.icon&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}):null},hi=({children:e,itemId:o,disabled:t,views:n})=>{const{activeItemId:a,toggleExpandedItem:i,isItemExpanded:s,size:c,variant:d,triggerRefs:u}=ar(),m=p.useRef(null),g=a===o,h=s(o);p.useEffect(()=>(m.current&&o&&(u.current[o]=m.current),()=>{o&&delete u.current[o]}),[o,u]);const f=y=>{y.preventDefault(),!t&&i(o)};return r.jsxs(l.View,{ref:m,onClick:f,cursor:t?"not-allowed":"pointer",opacity:t?.5:1,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:8,transition:"background-color 0.2s ease",...jt[c],...wt[d],...g?vo.active:{},_hover:t?{}:vo.hover,...n==null?void 0:n.trigger,children:[r.jsx(l.View,{display:"flex",alignItems:"center",children:e}),r.jsx(l.View,{transition:"transform 0.2s ease",transform:h?"rotate(180deg)":"rotate(0deg)",...n==null?void 0:n.indicator,children:r.jsx(ce,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},fi=({children:e,itemId:o,views:t})=>{const{isItemExpanded:n,orientation:a,triggerRefs:i}=ar(),s=p.useRef(null),[c,d]=p.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=n(o);if(p.useEffect(()=>{if(u&&s.current&&o&&i.current[o]&&a==="horizontal"){const g=s.current.getBoundingClientRect(),h=i.current[o].getBoundingClientRect(),f=Math.max(g.width||200,200),y=Math.max(g.height||150,150),b=window.innerWidth,k=window.innerHeight,C={top:h.top,right:b-h.right,bottom:k-h.bottom,left:h.left},j=a==="horizontal"?[{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:h.left,y:h.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:h.left,y:h.top-y-8},{placement:"right",space:C.right,fits:C.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:C.left,fits:C.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:C.right,fits:C.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:C.left,fits:C.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:h.left,y:h.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:h.left,y:h.top-y-8}],w=j.find(T=>T.fits);if(w){d({x:w.x,y:w.y,placement:w.placement});return}const S=j.reduce((T,R)=>R.space>T.space?R:T);let x=S.x,v=S.y;x+f>b&&(x=b-f-8),x<8&&(x=8),v+y>k&&(v=k-y-8),v<8&&(v=8),d({x,y:v,placement:S.placement})}},[u,a,o,i]),!u)return null;if(a==="vertical")return r.jsx(l.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...t==null?void 0:t.container,children:e});const m={position:"fixed",left:c.x,top:c.y,zIndex:1e3};return r.jsx(l.View,{ref:s,role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:m,...t==null?void 0:t.container,children:e})},iy=({href:e,children:o,views:t,underline:n,isExternal:a,iconSize:i,...s})=>{const{itemValue:c,isDisabled:d}=ly(),{activeItemId:u,setActiveItemId:m,onItemActivate:g}=ar(),h=u===c,f=y=>{if(d){y.preventDefault();return}c&&(m(c),g&&g(c)),s.onClick&&s.onClick(y)};return r.jsx(l.View,{as:"a",href:d?void 0:e,onClick:f,cursor:d?"not-allowed":"pointer",opacity:d?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":h?"page":void 0,"aria-disabled":d,"data-active":h?"":void 0,"data-disabled":d?"":void 0,...h?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...s,children:o})},sy=({items:e,orientation:o,views:t,themeMode:n})=>{const a=o==="horizontal"?l.Horizontal:l.Vertical;return!e||e.length===0?null:r.jsx(a,{width:"100%",...pi[o],...t==null?void 0:t.container,children:r.jsx(hn,{views:t,children:e.map(i=>r.jsx(fn,{item:i,views:t},i.id))})})},cy=e=>{const o=ge("navigation",e),{items:t,children:n,orientation:a="vertical",size:i="md",variant:s="default",defaultActiveItemId:c=null,defaultExpandedItemIds:d=[],onItemActivate:u,views:m,...g}=o,{activeItemId:h,setActiveItemId:f,expandedItemIds:y,toggleExpandedItem:b,isItemExpanded:k,triggerRefs:C}=ny(c,d);return r.jsx(ay,{value:{activeItemId:h,setActiveItemId:f,expandedItemIds:y,toggleExpandedItem:b,isItemExpanded:k,orientation:a,size:i,variant:s,onItemActivate:u,triggerRefs:C},children:t?r.jsx(sy,{items:t,orientation:a,size:i,variant:s,views:m,...g}):n})},uo=cy;uo.List=hn;uo.Item=fn;uo.Trigger=hi;uo.Content=fi;uo.Link=iy;const yi={},xi=p.createContext({views:yi,onRowClick:()=>{}}),dy=({children:e,views:o=yi,onRowClick:t})=>r.jsx(xi.Provider,{value:{views:o,onRowClick:t},children:e}),eo=()=>p.useContext(xi),he={table:{width:"100%",color:"inherit",borderRadius:"8px",overflow:"hidden",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04)",border:"1px solid",borderColor:"color-gray-200",transition:"box-shadow 0.2s ease",media:{mobile:{overflowX:"auto",display:"block",borderRadius:"4px"}}},thead:{backgroundColor:"color-gray-50",borderBottom:"1px solid",borderColor:"color-gray-200"},th:{padding:"12px 16px",fontWeight:"600",fontSize:"14px",color:"inherit",opacity:.72,textAlign:"left",flex:1,media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},td:{padding:"12px 16px",fontSize:"14px",borderBottom:"1px solid",borderColor:"color-gray-100",color:"inherit",flex:1,media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},tr:{flexDirection:"row",alignItems:"stretch",width:"100%",transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"}},tfoot:{backgroundColor:"color-gray-50",fontWeight:"600",borderTop:"2px solid",borderColor:"color-gray-200"},caption:{margin:"8px 0",color:"inherit",opacity:.62,fontSize:"14px",fontStyle:"italic",media:{mobile:{fontSize:"12px"}}}};({...he.th},{...he.td});({...he.tr});({...he.td},{...he.th});({...he.table},{...he.th}),{...he.td},{...he.tr},{...he.tfoot},{...he.caption};const uy=({children:e})=>r.jsx(l.View,{width:"100%",style:{overflowX:"auto"},children:e}),bi=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"table",...he.table,...o==null?void 0:o.table,...e,style:{borderCollapse:"collapse",...e.style||{}}})},ki=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"thead",textAlign:"left",...he.thead,...o==null?void 0:o.thead,...e})},Ci=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"th",whiteSpace:"nowrap",...he.th,...o==null?void 0:o.th,...e})},br=e=>{const{views:o,onRowClick:t}=eo();return r.jsx(l.Element,{as:"tr",...he.tr,...o==null?void 0:o.tr,onClick:t,...e})},vt=({isFirstColumn:e,...o})=>{const{views:t}=eo();return r.jsx(l.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e?"500":"400",...he.td,...t==null?void 0:t.td,...o})},Si=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"tbody",...he.tbody,...o==null?void 0:o.tbody,...e})},ji=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"tfoot",...he.tfoot,...o==null?void 0:o.tfoot,...e})},wi=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"caption",...he.caption,...o==null?void 0:o.caption,...e})},py=({data:e,columns:o,footer:t,caption:n,themeMode:a})=>{const i=Math.max(o.length*140,320);return r.jsx(uy,{children:r.jsxs(bi,{role:"Table",minWidth:i,children:[n&&r.jsx(wi,{children:n}),r.jsx(ki,{children:r.jsx(br,{children:o.map(s=>r.jsx(Ci,{children:s.title},s.field))})}),r.jsx(Si,{children:e.map((s,c)=>r.jsx(br,{children:o.map((d,u)=>r.jsx(vt,{isFirstColumn:u===0,children:s[d.field]},d.field))},c))}),t&&r.jsx(ji,{children:r.jsx(br,{children:t.map((s,c)=>r.jsx(vt,{...s.props,children:s.value},c))})})]})})},Fe=({children:e,views:o,onClick:t})=>{const n=ge("table",{views:o,onClick:t});return r.jsx(dy,{views:n.views,onRowClick:n.onClick,children:e})};Fe.Head=ki;Fe.HeadCell=Ci;Fe.Body=Si;Fe.Row=br;Fe.Cell=vt;Fe.Footer=ji;Fe.Caption=wi;Fe.Container=bi;Fe.Template=py;const my=(e,o,t)=>{const n=u=>u.value!==void 0?u.value:u.title,a=()=>{if(!(!e||e.length===0)){if(o!==void 0){const u=e.find(m=>n(m)===o);if(u)return u}return e[0]}},[i,s]=p.useState(a()),c=t!==void 0?e.find(u=>n(u)===t):i,d=u=>{t===void 0&&s(u)};return p.useEffect(()=>{if(t!==void 0)return;const u=a(),m=i&&e.some(g=>n(g)===n(i));u&&(!m||o!==void 0&&i&&n(i)!==o)?s(u):!u&&i&&s(void 0)},[e,o]),{activeTab:c,setActiveTab:d}},gy=(e,o,t)=>{const[n,a]=p.useState(e||null);return{activeValue:o!==void 0?o:n,setActiveValue:c=>{o===void 0&&a(c),t&&t(c)}}},hy=p.memo(({tab:e,isActive:o,onClick:t,iconPosition:n="left",tabStyles:a,textStyles:i})=>{const s=()=>{switch(n){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},c=()=>["top","bottom"].includes(n)?"4px":"8px",d=e.icon&&p.isValidElement(e.icon)?p.cloneElement(e.icon,{strokeWidth:o?2.5:2}):e.icon;return r.jsxs(l.Element,{as:"div",role:"tab","aria-selected":o,tabIndex:o?0:-1,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease",...a,flexDirection:s(),gap:c(),onClick:t,"data-state":o?"active":"inactive",children:[d&&r.jsx(l.Element,{children:d},o?"active-icon":"inactive-icon"),r.jsxs(l.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[r.jsx(l.Text,{...i,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),r.jsx(l.Text,{...i,fontWeight:o?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})}),yn=(e,o)=>{const t=o==="dark";return e==="segmented"?{header:{width:"fit-content",alignSelf:"flex-start",gap:6,padding:6,borderRadius:16,backgroundColor:"color-gray-100"},tab:{minHeight:44,padding:"0 22px",borderRadius:12,color:"color-gray-600",borderWidth:1,borderStyle:"solid",borderColor:"color-gray-100",style:{backgroundColor:"transparent"}},activeTab:{backgroundColor:"color-white",color:"color-gray-900",boxShadow:t?"0 1px 3px rgba(0, 0, 0, 0.35)":"0 1px 2px rgba(0, 0, 0, 0.06)"},text:{fontSize:14,lineHeight:"20px",letterSpacing:"-0.01em"},activeText:{},content:{width:"100%"}}:e==="pill"?{header:{width:"100%",flexWrap:"wrap",gap:12},tab:{minHeight:44,padding:"0 22px",borderRadius:"999px",backgroundColor:"color-white",color:"color-gray-600",borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200"},activeTab:{backgroundColor:"theme-primary",color:"color-white",borderColor:"theme-primary"},text:{fontSize:14,lineHeight:"20px",letterSpacing:"-0.01em",color:"inherit"},activeText:{color:"inherit"},content:{width:"100%"}}:{header:{width:"100%",gap:20,borderBottom:"none"},tab:{minHeight:44,padding:"0 4px",borderRadius:0,color:"color-gray-500",borderBottom:"3px solid",borderColor:"color-white",style:{backgroundColor:"transparent"}},activeTab:{color:"theme-primary",borderColor:"theme-primary"},text:{fontSize:14,lineHeight:"20px",letterSpacing:"-0.01em",color:"inherit"},activeText:{color:"inherit"},content:{width:"100%",paddingTop:12}}},fy=({tabs:e=[],activeTab:o,handleTabClick:t,views:n={},renderTab:a,renderContent:i,variant:s="underline",iconPosition:c="left"})=>{const{themeMode:d}=l.useTheme(),u=yn(s,d);return o?r.jsxs(l.Vertical,{width:"100%",height:"100%",...n.container,children:[r.jsx(l.Horizontal,{alignItems:"center",...u.header,...n.headerTabs,children:e.map(m=>{const g=(m.value!==void 0?m.value:m.title)===(o.value!==void 0?o.value:o.title),h=()=>t(m);return a?a(m,g,h):r.jsx(hy,{tab:m,isActive:g,onClick:h,iconPosition:c,tabStyles:{...u.tab,...n.tab,...g?u.activeTab:{},...g?n.activeTab:{}},textStyles:{...u.text,...n.title,...g?u.activeText:{},...g?n.activeText:{}}},m.title)})}),r.jsx(l.View,{height:"100%",...u.content,...n.content,children:i?i(o):o.content})]}):null},vi=p.createContext(null),xn=()=>{const e=p.useContext(vi);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},yy=p.memo(({children:e,views:o})=>{var c;const{themeMode:t}=l.useTheme(),{variant:n="underline"}=xn(),a=yn(n,t),i=Po("tabs"),s=De({container:(c=i.views)==null?void 0:c.headerTabs},o);return r.jsx(l.Horizontal,{alignItems:"center",...a.header,...s==null?void 0:s.container,children:e})}),xy=p.memo(({value:e,children:o,disabled:t=!1,views:n})=>{var f,y;const{themeMode:a}=l.useTheme(),{activeValue:i,setActiveValue:s,variant:c="underline"}=xn(),d=i===e,u=yn(c,a),m=Po("tabs"),g=De({trigger:(f=m.views)==null?void 0:f.tab,activeState:(y=m.views)==null?void 0:y.activeTab},n),h=p.useCallback(()=>{t||s(e)},[t,e,s]);return r.jsx(l.View,{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease-in-out",...u.tab,...d?u.activeTab:{},_hover:t?{}:c==="underline"?{color:"theme-primary"}:{opacity:.9},onClick:h,...g==null?void 0:g.trigger,...d?g==null?void 0:g.activeState:{},children:r.jsx(l.View,{...u.text,...d?u.activeText:{},children:o})})}),by=p.memo(({value:e,children:o,views:t})=>{const{activeValue:n}=xn();return n!==e?null:r.jsx(l.View,{width:"100%",padding:"24px",...t==null?void 0:t.content,children:o})}),ky=e=>{const o=ge("tabs",e),{tabs:t,views:n,defaultValue:a,onTabChange:i,renderTab:s,renderContent:c,variant:d="underline",iconPosition:u="left",value:m,onValueChange:g,children:h}=o,f=gy(a,m,g),y=my(t||[],a,m);if(h)return r.jsx(vi.Provider,{value:{...f,variant:d},children:h});if(t){const b=k=>{const C=j=>j.value!==void 0?j.value:j.title;(!y.activeTab||C(y.activeTab)!==C(k))&&(y.setActiveTab(k),i&&i(k))};return r.jsx(fy,{tabs:t,views:n,activeTab:y.activeTab,handleTabClick:b,renderTab:s,renderContent:c,variant:d,iconPosition:u})}return null},Cy=p.memo(ky),zo=Cy;zo.List=yy;zo.Trigger=xy;zo.Content=by;const Sy=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:n=[],alternateAnimation:a=!1,alternateDuration:i=3e3,highlightText:s,highlightTypewriter:c=!1,highlightSlide:d=!1,highlightSlideDuration:u=500,highlightSlideStagger:m=50,highlightSlideSequential:g=!0}=e,[h,f]=p.useState(o),[y,b]=p.useState(s);return p.useEffect(()=>{if(!a||n.length===0||!t||typeof o!="string"||typeof s!="string")return f(o),b(s),()=>{};const k=o,C=s;let j=0;const w=x=>{const v=n[x],T=C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(T,"gi"),M=k.replace(R,v);f(M),b(v)};w(j);const S=setInterval(()=>{j=(j+1)%n.length,w(j)},i);return()=>clearInterval(S)},[a,n,i,s,o,t]),{finalDisplayedText:h,activeHighlightTarget:y,highlightTypewriter:c,highlightSlide:d,highlightSlideDuration:u,highlightSlideStagger:m,highlightSlideSequential:g}},jy={xs:24,sm:32,md:48,lg:96,xl:110},wy={xl:{media:{mobile:{fontSize:48},tablet:{fontSize:96},desktop:{fontSize:110}}},lg:{media:{mobile:{fontSize:48},tablet:{fontSize:48},desktop:{fontSize:70}}},md:{media:{mobile:{fontSize:32},tablet:{fontSize:40},desktop:{fontSize:56}}},sm:{media:{mobile:{fontSize:20},tablet:{fontSize:24},desktop:{fontSize:32}}},xs:{media:{mobile:{fontSize:14},tablet:{fontSize:18},desktop:{fontSize:20}}}},vy={underline:e=>({textDecoration:"underline",textDecorationColor:e,textDecorationThickness:"4px",textUnderlineOffset:"4px"}),background:e=>({backgroundColor:e,color:"color-white",padding:"0 8px",borderRadius:"4px"}),gradient:(e,o)=>({background:`linear-gradient(135deg, ${e}, ${o||e})`,backgroundClip:"text",WebkitBackgroundClip:"text !important",WebkitTextFillColor:"transparent",color:"transparent",display:"inline-block",textShadow:"none"}),outline:e=>({WebkitTextStroke:`1px ${e}`,WebkitTextFillColor:"transparent !important",color:"transparent",textShadow:"none"}),glow:e=>({color:e,textShadow:`0 0 10px ${e}80, 0 0 20px ${e}40, 0 0 30px ${e}20`}),solid:e=>({color:e}),default:()=>({})},Ty=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:n,showCursor:a=!0,cursorColor:i="currentColor",textStyle:s,textComponent:c,as:d,...u})=>{const m=c||l.Text,g=Array.isArray(e)?e:[e],[h,f]=p.useState(g.map(()=>"")),[y,b]=p.useState(!1),[k,C]=p.useState(0),[j,w]=p.useState(0);p.useEffect(()=>{f(g.map(()=>"")),b(!1),C(0),w(0)},[e]),p.useEffect(()=>{if(y){n&&n();return}const x=g[k];if(j>=x.length){if(k>=g.length-1){b(!0);return}const T=setTimeout(()=>{C(R=>R+1),w(0)},t);return()=>clearTimeout(T)}const v=setTimeout(()=>{f(T=>{const R=[...T];return R[k]=x.substring(0,j+1),R}),w(T=>T+1)},o);return()=>clearTimeout(v)},[g,k,j,y,n,t,o]);const S=x=>{if(!x||typeof x!="string")return x;const v=x.split("|");return v.length===1?x:v.map((T,R)=>r.jsxs(p.Fragment,{children:[T,R<v.length-1&&r.jsx("br",{})]},R))};return r.jsx(r.Fragment,{children:h.map((x,v)=>r.jsxs(p.Fragment,{children:[S(x),a&&v===k&&!y&&r.jsx(m,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:i,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...s})]},v))})},Iy=({text:e,duration:o=500,direction:t="up",stagger:n=50,sequential:a=!1,textStyle:i,as:s,wordProps:c,textComponent:d,...u})=>{const[m,g]=p.useState(e),[h,f]=p.useState("entering"),[y,b]=p.useState(0),k=d||l.Text,C=p.useRef(null),j=p.useRef(null);p.useEffect(()=>{e===m&&h==="visible"||e!==m&&(h==="entering"||h==="visible"?(C.current=e,f("exiting")):h==="exiting"&&(C.current=e))},[e,m,h]);const{lines:w,totalWordCount:S}=p.useMemo(()=>{const F=m.split("|").map(D=>D.trim().split(/\s+/).filter(L=>L.length>0)),H=F.reduce((D,L)=>D+L.length,0);return{lines:F,totalWordCount:H}},[m]),x=p.useMemo(()=>a?S*(o+n):(S-1)*n+o,[S,o,n,a]),v=p.useMemo(()=>a?S*(o+n):(S-1)*n+o,[S,o,n,a]);p.useEffect(()=>(j.current&&clearTimeout(j.current),h==="entering"?j.current=setTimeout(()=>{f("visible")},x+50):h==="exiting"&&(j.current=setTimeout(()=>{C.current!==null&&(g(C.current),C.current=null),b(W=>W+1),f("entering")},v+50)),()=>{j.current&&clearTimeout(j.current)}),[h,x,v]);const{style:T,...R}=c||{},M=t==="up",E=W=>a?W*(o+n):W*n,I=p.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",...i}),[i]),V=p.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),P=p.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let z=0;return r.jsx(l.Element,{as:"span",style:I,...u,children:r.jsx("span",{style:V,children:w.map((W,F)=>r.jsx("span",{style:P,children:W.map((H,D)=>{const L=z++,B=E(L),$=D===W.length-1;let O;const N=`${o}ms`,_=`${B}ms`;h==="entering"?O=M?l.Animation.slideInUp({duration:N,delay:_,timingFunction:"ease-out",fillMode:"both"}):l.Animation.slideInDown({duration:N,delay:_,timingFunction:"ease-out",fillMode:"both"}):h==="exiting"&&(O=M?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:N,delay:_,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:N,delay:_,timingFunction:"ease-in",fillMode:"both"});const Y={...T,display:"inline-block",marginRight:$?0:"0.25em",transform:h==="visible"?"translateY(0)":void 0,opacity:h==="visible"?1:void 0};return r.jsx(k,{as:"span",animate:O,...R,...Y,children:H},`${y}-${F}-${D}`)})},`line-${F}`))})})};function ra(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const st=e=>{if(!e||typeof e!="string")return e;const o=e.split("|");return o.length===1?e:o.map((t,n)=>r.jsxs(p.Fragment,{children:[t,n<o.length-1&&r.jsx("br",{})]},n))},Fy=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:n="theme-primary",highlightSecondaryColor:a,size:i="lg",views:s,highlightAnimate:c,animate:d,animationLoop:u=1,highlightAnimationLoop:m=1,highlightTypewriter:g=!1,highlightTypewriterDuration:h=3e3,highlightSlide:f=!1,highlightSlideDuration:y=500,highlightSlideStagger:b=50,highlightSlideSequential:k=!0,themeMode:C,responsive:j,alternateHighlightText:w,alternateAnimation:S,alternateDuration:x,_isInView:v,...T})=>{const{ref:R,inView:M}=l.useInView(),{finalDisplayedText:E,activeHighlightTarget:I,highlightTypewriter:V,highlightSlide:P,highlightSlideDuration:z,highlightSlideStagger:W,highlightSlideSequential:F}=Sy({children:e,highlightText:o,_isInView:M,highlightTypewriter:g,highlightSlide:f,highlightSlideDuration:y,highlightSlideStagger:b,highlightSlideSequential:k,alternateHighlightText:w,alternateAnimation:S,alternateDuration:x,...T}),H=jy[i],D={fontFamily:"Mulish, Inter, Geist, system-ui, sans-serif",fontWeight:i==="xl"?700:600,letterSpacing:i==="xl"?"-1.5px":"-0.01em"},L=vy[t](n,a),B=(A,G)=>A&&(Array.isArray(A)?A.map(Q=>({...Q,iterationCount:G.toString()})):{...A,iterationCount:G.toString()}),$=B(d,u),O=B(c,m),N=typeof E=="string"?E:typeof e=="string"?e:"",_={ref:R,animate:M?$:void 0,as:"h1",fontSize:H,...j?wy[i]:{},...D},Y=A=>!M&&(V||P)?r.jsx("span",{style:{opacity:0},children:A}):V?r.jsx(Ty,{text:A,typingSpeed:Math.max(30,h/(A.length*10)),cursorColor:"currentColor",...L}):P?r.jsx(Iy,{text:A,duration:z,stagger:W,sequential:F,direction:"up",wordProps:L}):st(A);if(typeof N=="string"&&I){const A=Array.isArray(I)?new RegExp(`(${I.map(K=>ra(String(K))).join("|")})`,"gi"):new RegExp(`(${ra(String(I))})`,"gi"),G=[];let Q=0,X;for(;X=A.exec(N);)X.index>Q&&G.push(N.substring(Q,X.index)),G.push({highlight:!0,text:X[0]}),Q=X.index+X[0].length;return Q<N.length&&G.push(N.substring(Q)),r.jsx(l.Element,{..._,...s==null?void 0:s.container,...T,children:G.map((K,oe)=>typeof K=="string"?r.jsx(l.Text,{as:"span",display:"inline",...s==null?void 0:s.text,children:st(K)},`text-${oe}`):r.jsx(l.Text,{as:"span",display:"inline",animate:M?O:void 0,...P?{}:L,...s==null?void 0:s.highlight,children:Y(K.text)},`highlight-${oe}`))})}return t&&!I?r.jsx(l.Element,{..._,...T,...s==null?void 0:s.container,children:r.jsx(l.Text,{as:"span",display:"inline",animate:M?O:void 0,...P?{}:L,...s==null?void 0:s.highlight,children:Y(N)})}):r.jsx(l.Text,{..._,...T,...s==null?void 0:s.container,...s==null?void 0:s.text,children:st(N)})},Ry=e=>r.jsx(Fy,{...e}),Ti=Ry,zy=({items:e,shape:o,variant:t,onToggleChange:n})=>{const{activeToggles:a,setActiveToggles:i}=oi();return r.jsx(ri,{items:e,shape:o,variant:t,activeToggles:a,setActiveToggles:i,onToggleChange:n})},Ii=zy,My=({items:e,onChange:o})=>{const[t,n]=p.useState(e),[a,i]=p.useState(null),[s,c]=p.useState(null),d=p.useRef({x:0,y:0}),u=p.useRef([]),m=p.useCallback((f,y)=>{f.preventDefault(),document.body.style.cursor="grabbing";const b="touches"in f?f.touches[0].clientX:f.clientX,k="touches"in f?f.touches[0].clientY:f.clientY;d.current={x:b,y:k},c(y),i(t[y])},[t]),g=p.useCallback(f=>{if(s===null)return;const y="touches"in f?f.touches[0].clientX:f.clientX,b="touches"in f?f.touches[0].clientY:f.clientY,k=u.current[s];if(!k)return;const C=y-d.current.x,j=b-d.current.y;k.style.transform=`translate(${C}px, ${j}px)`,k.style.zIndex="1000";const w=u.current.findIndex((S,x)=>{if(!S||x===s)return!1;const v=S.getBoundingClientRect();return b>=v.top&&b<=v.bottom});if(w!==-1&&w!==s){const S=[...t],[x]=S.splice(s,1);S.splice(w,0,x),n(S),c(w),o==null||o(S),d.current={x:y,y:b}}},[s,t,o]),h=p.useCallback(()=>{document.body.style.cursor="",u.current.forEach(f=>{f&&(f.style.transform="",f.style.zIndex="")}),c(null),i(null)},[s]);return p.useEffect(()=>{if(typeof(window==null?void 0:window.addEventListener)=="function")return s!==null&&(window.addEventListener("mousemove",g),window.addEventListener("touchmove",g),window.addEventListener("mouseup",h),window.addEventListener("touchend",h)),()=>{window.removeEventListener("mousemove",g),window.removeEventListener("touchmove",g),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)}},[s,g,h]),{items:t,draggedItem:a,draggedIndex:s,itemRefs:u,handleDragStart:m}},Wy=({items:e,renderItem:o,containerProps:t,itemProps:n,draggedIndex:a,itemRefs:i,handleDragStart:s,views:c,themeMode:d})=>r.jsx(l.View,{overflow:"hidden",position:"relative",...t,...c==null?void 0:c.container,children:e.map((u,m)=>r.jsx(l.View,{ref:g=>{i.current[m]=g},onMouseDown:g=>s(g,m),onTouchStart:g=>s(g,m),position:"relative",cursor:"grab",transition:"transform 0.2s",...n,...c==null?void 0:c.item,children:o?o(u,m):u},m))}),Fi=e=>{const{items:o,draggedIndex:t,itemRefs:n,handleDragStart:a}=My(e);return r.jsx(Wy,{...e,items:o,draggedIndex:t,itemRefs:n,handleDragStart:a})},Hy=Fi,Py=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:n,multiple:a,disabled:i,previewUrl:s})=>{const[c,d]=p.useState(!1),[u,m]=p.useState(null),g=p.useRef(null),h=s!==void 0?s:u;p.useEffect(()=>()=>{u&&URL.revokeObjectURL(u)},[u]);const f=p.useCallback(S=>{S.preventDefault(),S.stopPropagation(),!i&&d(!0)},[i]),y=p.useCallback(S=>{S.preventDefault(),S.stopPropagation(),!i&&d(!1)},[i]),b=p.useCallback(S=>{S.preventDefault(),S.stopPropagation(),!i&&d(!0)},[i]),k=p.useCallback(S=>{if(!S||S.length===0)return;const x=Array.from(S);if(!a&&x.length>0){const v=x[0];if(v.type.startsWith("image/")){const T=URL.createObjectURL(v);m(R=>(R&&URL.revokeObjectURL(R),T))}else m(null)}a?o&&o(x):x.length>0&&e&&e(x[0])},[a,o,e]),C=p.useCallback(S=>{S.preventDefault(),S.stopPropagation(),d(!1),!i&&S.dataTransfer.files&&S.dataTransfer.files.length>0&&(k(S.dataTransfer.files),S.dataTransfer.clearData())},[i,k]),j=p.useCallback(()=>{var S;i||(S=g.current)==null||S.click()},[i]),w=p.useCallback(S=>{k(S.target.files),S.target.value&&(S.target.value="")},[k]);return{isDragActive:c,handleDragEnter:f,handleDragLeave:y,handleDragOver:b,handleDrop:C,handleClick:j,handleFileChange:w,inputRef:g,preview:h}},Vy={position:"absolute",top:"-4px",right:"-4px",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",border:"none",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"12px",zIndex:10,_hover:{backgroundColor:"rgba(0, 0, 0, 0.7)"}},Ri=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:a="120px",showPreviews:i=!1,views:s={}})=>{if(e.length===0)return null;const c=p.useCallback(u=>u<1024?`${u} B`:u<1024*1024?`${(u/1024).toFixed(1)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`,[]),d=p.useCallback(u=>u.type.startsWith("image/")?{backgroundColor:"#DBEAFE",color:"#2563EB"}:u.type.startsWith("video/")?{backgroundColor:"#EDE9FE",color:"#7C3AED"}:u.type.startsWith("audio/")?{backgroundColor:"#DCFCE7",color:"#16A34A"}:{backgroundColor:"#E2E8F0",color:"#475569"},[]);return r.jsx(l.View,{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 0",maxHeight:a,overflowY:"auto",...s==null?void 0:s.container,children:e.map((u,m)=>{const g=typeof URL<"u"&&typeof URL.createObjectURL=="function"&&typeof Blob<"u"&&u instanceof Blob,h=(u==null?void 0:u.path)||(u==null?void 0:u.url)||(i&&g?URL.createObjectURL(u):""),f=u.type.startsWith("image/"),y=u.type.startsWith("video/"),b=u.type.startsWith("audio/"),k=d(u);return i?r.jsx(l.Vertical,{alignItems:"center",gap:"6px",padding:"6px 10px",borderRadius:"8px",border:"1px solid #E2E8F0",backgroundColor:"color-white",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...s==null?void 0:s.item,children:i&&r.jsxs(Se,{children:[r.jsxs(Se.Trigger,{children:[f&&r.jsx(l.Image,{src:h,alt:u.name,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),y&&r.jsx(l.View,{as:"video",src:h,alt:u.name,controls:!1,muted:!0,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),b&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(Ro,{widthHeight:24,color:"color-black"})}),!f&&!y&&!b&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(ao,{widthHeight:24,color:"color-black"})}),t&&r.jsx(l.Button,{...Vy,onClick:C=>{C.stopPropagation(),t(m)},"aria-label":`Remove ${u.name}`,children:"×"})]}),r.jsxs(Se.Content,{children:[f&&r.jsx(l.Image,{src:h,alt:u.name,maxWidth:"100%"}),y&&r.jsx(l.View,{as:"video",src:h,controls:!0,maxWidth:"100%"}),b&&r.jsx(l.View,{as:"audio",src:h,controls:!0,width:"100%"}),r.jsxs(l.Text,{marginTop:"4px",maxLines:1,width:"100%",...s==null?void 0:s.name,children:[u.name," (",c(u.size),")"]})]})]})},m):r.jsxs(l.Horizontal,{alignItems:"center",gap:"8px",padding:"6px 10px 6px 8px",borderRadius:"9999px",border:"1px solid #E2E8F0",backgroundColor:"color-white",maxWidth:"100%",animate:{from:{opacity:0,scale:.96},to:{opacity:1,scale:1}},animationDuration:.2,...s==null?void 0:s.item,children:[r.jsx(l.Center,{width:"22px",height:"22px",minWidth:"22px",borderRadius:"9999px",backgroundColor:k.backgroundColor,color:k.color,children:b?r.jsx(Ro,{widthHeight:12,color:"currentColor"}):r.jsx(ao,{widthHeight:12,color:"currentColor"})}),r.jsxs(l.Text,{fontSize:"12px",lineHeight:"16px",color:"color-gray-600",maxLines:1,maxWidth:"220px",...s==null?void 0:s.name,children:[u.name," · ",c(u.size)]}),t&&r.jsx(l.View,{as:"button",type:"button",onClick:()=>t(m),"aria-label":`Remove ${u.name}`,display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",minWidth:"16px",border:"none",backgroundColor:"transparent",color:"color-gray-400",padding:0,cursor:"pointer",transition:"color 0.2s ease, opacity 0.2s ease",_hover:{color:"color-gray-600"},children:"×"})]},m)})})},Ay=({children:e,text:o="Drop files here or click to upload",textProps:t,containerProps:n,disabled:a,accept:i,multiple:s,isDragActive:c,handleDragEnter:d,handleDragLeave:u,handleDragOver:m,handleDrop:g,handleClick:h,handleFileChange:f,inputRef:y,preview:b,imageProps:k,selectedFiles:C,onRemove:j})=>r.jsxs(l.Center,{width:"100%",minHeight:"200px",height:C&&C.length>0?"auto":"200px",borderWidth:2,borderStyle:"dashed",borderColor:c?"theme-primary":"color-gray-300",borderRadius:12,backgroundColor:c?"#EFF6FF":"color-gray-50",flexDirection:"column",cursor:a?"not-allowed":"pointer",opacity:a?.6:1,onClick:h,onDragEnter:d,onDragLeave:u,onDragOver:m,onDrop:g,transition:"background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease",overflow:"hidden",position:"relative",padding:16,...n,children:[r.jsx("input",{type:"file",ref:y,onChange:f,accept:i,multiple:s,style:{display:"none"},disabled:a}),b&&!s?r.jsxs(l.View,{width:"100%",height:"200px",position:"relative",children:[r.jsx(l.Image,{src:b,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...k}),r.jsx(l.Center,{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.3)",opacity:0,_hover:{opacity:1},transition:"opacity 0.2s",children:r.jsx(l.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):r.jsxs(l.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||r.jsxs(l.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[r.jsx(Gt,{widthHeight:40,color:c?"theme-primary":"color-gray-500"}),r.jsx(l.Text,{marginTop:16,color:c?"theme-primary":"color-gray-600",fontWeight:500,textAlign:"center",...t,children:o})]}),s&&C&&C.length>0&&r.jsx(l.View,{marginTop:16,width:"100%",children:r.jsx(Ri,{files:C,onRemove:j||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),Ey=e=>{const o=Py(e);return r.jsx(Ay,{...e,...o})},Dy=(e=!1)=>{const[o,t]=p.useState(e),[n,a]=p.useState(null);return p.useEffect(()=>{const i=d=>{!d.composedPath().some(g=>(g==null?void 0:g.id)==="dropdown-menu"||(g==null?void 0:g.id)==="dropdown-trigger")&&o&&(t(!1),a(null))},s=()=>{o&&(t(!1),a(null))},c=d=>{d.key==="Escape"&&o&&(t(!1),a(null))};if(!(typeof(document==null?void 0:document.addEventListener)!="function"||typeof(window==null?void 0:window.addEventListener)!="function"))return document.addEventListener("mousedown",i),window.addEventListener("resize",s),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",i),window.removeEventListener("resize",s),document.removeEventListener("keydown",c)}},[o]),{isOpen:o,setIsOpen:t,activeSubmenuId:n,setActiveSubmenuId:a}},$y={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Ly={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},_y={hover:{backgroundColor:"color-gray-100"}},zi=p.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),By=({children:e,value:o})=>r.jsx(zi.Provider,{value:o,children:e}),bn=()=>{const e=p.useContext(zi);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},Mi=({children:e,views:o,...t})=>{const{isOpen:n,setIsOpen:a,triggerRef:i}=bn(),s=c=>{c.stopPropagation(),a(!n)};return r.jsx(l.View,{ref:i,id:"dropdown-trigger",onClick:s,cursor:"pointer",position:"relative",display:"inline-block",...o==null?void 0:o.container,...t,children:e})},kn=({items:e,side:o="bottom",align:t="start",views:n,...a})=>{const{isOpen:i,variant:s,triggerRef:c}=bn(),d=p.useRef(null),{ref:u,relation:m}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[g,h]=p.useState({x:0,y:0,placement:o});if(p.useEffect(()=>{c.current&&u&&(u.current=c.current)},[c,u,i]),p.useEffect(()=>{if(i&&d.current&&c.current){const b=c.current.getBoundingClientRect();let k=o;m&&(o==="bottom"&&m.space.vertical==="top"?k="top":o==="top"&&m.space.vertical==="bottom"?k="bottom":o==="right"&&m.space.horizontal==="left"?k="left":o==="left"&&m.space.horizontal==="right"&&(k="right"));let C=0,j=0;switch(k){case"bottom":C=t==="start"?b.left:t==="end"?b.right-180:b.left+b.width/2-90,j=b.bottom+8;break;case"top":C=t==="start"?b.left:t==="end"?b.right-180:b.left+b.width/2-90,j=b.top-8;break;case"right":C=b.right+8,j=t==="start"?b.top:t==="end"?b.bottom-100:b.top+b.height/2-50;break;case"left":C=b.left-8,j=t==="start"?b.top:t==="end"?b.bottom-100:b.top+b.height/2-50;break}h({x:C,y:j,placement:k})}},[i,o,t,c,m]),!i)return null;const y=(()=>{const b={position:"fixed",left:g.x,top:g.y,zIndex:1e3};switch(g.placement){case"top":return{...b,transform:"translateY(-100%)"};case"left":return{...b,transform:"translateX(-100%)"};case"bottom":case"right":default:return b}})();return r.jsx(l.View,{ref:d,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:y,...Ly[s],...n==null?void 0:n.menu,...a,children:e.map((b,k)=>b.divider?r.jsx(Hi,{views:n},`divider-${k}`):r.jsx(Wi,{item:b,views:n},b.id))})},Wi=({item:e,views:o,...t})=>{const{activeSubmenuId:n,setActiveSubmenuId:a,size:i}=bn(),[s,c]=p.useState(!1),d=e.items&&e.items.length>0,u=n===e.id,m=p.useRef(null),g=()=>{c(!0),d&&a(e.id)},h=()=>{c(!1)},f=y=>{y.stopPropagation(),!e.disabled&&!d&&e.onClick&&e.onClick()};return r.jsxs(l.View,{ref:m,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...$y[i],_hover:e.disabled?{}:_y.hover,backgroundColor:s&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:g,onMouseLeave:h,onClick:f,...o==null?void 0:o.item,...t,children:[e.icon&&r.jsx(l.View,{marginRight:8,...o==null?void 0:o.icon,children:e.icon}),r.jsx(l.View,{flexGrow:1,children:e.label}),d&&r.jsx(l.View,{marginLeft:8,...o==null?void 0:o.submenuIndicator,children:r.jsx(ce,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),u&&d&&r.jsx(kn,{items:e.items||[],side:"right",align:"start",views:o})]})},Hi=({views:e,...o})=>r.jsx(l.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...o}),Oy=({trigger:e,items:o,side:t="bottom",align:n="start",views:a,themeMode:i,...s})=>r.jsxs(l.View,{position:"relative",display:"inline-block",...a==null?void 0:a.container,...s,children:[r.jsx(Mi,{views:a,children:e}),r.jsx(kn,{items:o,side:t,align:n,views:a})]}),Ny=({trigger:e,items:o,size:t="md",variant:n="default",side:a="bottom",align:i="start",defaultOpen:s=!1,views:c,...d})=>{const{isOpen:u,setIsOpen:m,activeSubmenuId:g,setActiveSubmenuId:h}=Dy(s),f=p.useRef(null);return r.jsx(By,{value:{isOpen:u,setIsOpen:m,activeSubmenuId:g,setActiveSubmenuId:h,size:t,variant:n,triggerRef:f},children:r.jsx(Oy,{trigger:e,items:o,side:a,align:i,views:c,...d})})},lr=Ny;lr.Trigger=Mi;lr.Content=kn;lr.Item=Wi;lr.Divider=Hi;const qy=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:a,isOpen:i,onOpen:s,onClose:c,closeOnSelect:d=!0,maxRecentColors:u=8,showRecentColors:m=!0}=e,[g,h]=p.useState(i??!1),[f,y]=p.useState(o??t),[b,k]=p.useState(""),[C,j]=p.useState([]),w=p.useRef(null),S=p.useRef(null);p.useEffect(()=>{o!==void 0&&y(o)},[o]),p.useEffect(()=>{i!==void 0&&h(i)},[i]),p.useEffect(()=>{if(m&&typeof localStorage<"u"){const I=localStorage.getItem("colorPicker-recentColors");if(I)try{j(JSON.parse(I))}catch{}}},[m]),p.useEffect(()=>{if(typeof document>"u"||typeof document.addEventListener!="function")return;const I=V=>{g&&w.current&&S.current&&!w.current.contains(V.target)&&!S.current.contains(V.target)&&E()};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[g]);const x=p.useCallback(I=>{m&&j(V=>{const P=V.filter(W=>W!==I),z=[I,...P].slice(0,u);return typeof localStorage<"u"&&localStorage.setItem("colorPicker-recentColors",JSON.stringify(z)),z})},[m,u]),v=p.useCallback(()=>{const I=!g;h(I),I?s==null||s():c==null||c()},[g,s,c]),T=p.useCallback(I=>{y(I),x(I),n==null||n(I),a==null||a(I),d&&(h(!1),c==null||c())},[n,a,d,c,x]),R=p.useCallback(I=>{k(I)},[]),M=p.useCallback(()=>{b&&(T(b),k(""))},[b,T]),E=p.useCallback(()=>{h(!1),c==null||c()},[c]);return{isOpen:g,selectedColor:f,recentColors:C,customColor:b,handleToggle:v,handleColorSelect:T,handleCustomColorChange:R,handleCustomColorSubmit:M,handleClose:E,triggerRef:w,dropdownRef:S}},ko={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},dropdown:{position:"absolute",top:"calc(100% + 8px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:12,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 12px 32px rgba(15, 23, 42, 0.14)",padding:"16px",minWidth:"320px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(6, 36px)",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",gap:"12px",marginBottom:"16px"},customInput:{marginBottom:"12px"},recentColors:{borderTop:"1px solid color-gray-100",paddingTop:"12px"}},Uy={xs:{height:"32px",fontSize:"12px",padding:"4px 8px"},sm:{height:"40px",fontSize:"12px",padding:"8px 10px"},md:{height:"44px",fontSize:"14px",padding:"10px 12px"},lg:{height:"48px",fontSize:"16px",padding:"12px 14px"},xl:{height:"56px",fontSize:"18px",padding:"14px 16px"}},Gy={default:{borderRadius:8},square:{borderRadius:0},rounded:{borderRadius:8},pill:{borderRadius:9999}},Yy={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-900"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-900"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-900"}},Ky=[{name:"Blue",value:"#1D4ED8",category:"primary"},{name:"Purple",value:"#A855F7",category:"primary"},{name:"Green",value:"#22C55E",category:"primary"},{name:"Orange",value:"#F97316",category:"primary"},{name:"Red",value:"#EF4444",category:"primary"},{name:"Ink",value:"#111827",category:"neutral"}],Xy=typeof navigator<"u"&&navigator.product!=="ReactNative"&&typeof document<"u"&&typeof document.createElement=="function",Jy=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:a,views:i={},size:s="md",shape:c="default",variant:d="default",error:u=!1,isDisabled:m=!1,isReadOnly:g=!1,predefinedColors:h=Ky,showCustomInput:f=!0,showRecentColors:y=!0,isOpen:b,selectedColor:k,recentColors:C,customColor:j,handleToggle:w,handleColorSelect:S,handleCustomColorChange:x,handleCustomColorSubmit:v,handleClose:T,triggerRef:R,dropdownRef:M,onChange:E,onChangeComplete:I,onOpen:V,onClose:P,colorFormat:z,maxRecentColors:W,closeOnSelect:F,defaultValue:H,value:D,...L})=>{const B={...ko.container,...i==null?void 0:i.container},$={...ko.trigger,...Uy[s],...Gy[c],...Yy[d],...u&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...!m&&!g&&{_hover:{borderColor:"color-gray-400"}},...i==null?void 0:i.trigger},O={...ko.dropdown,...i==null?void 0:i.dropdown},N={...ko.colorGrid,...i==null?void 0:i.colorGrid},_={...ko.recentColors,...i==null?void 0:i.recentColors},Y=k||"color-gray-200";return r.jsxs(l.View,{...B,...L,children:[t&&r.jsx(l.Text,{fontSize:"12px",lineHeight:"16px",fontWeight:"500",color:"color-gray-600",marginBottom:"6px",...i==null?void 0:i.label,children:t}),r.jsxs(l.View,{ref:R,onClick:m||g?void 0:w,...$,children:[r.jsxs(l.Horizontal,{alignItems:"center",gap:8,children:[r.jsx(l.View,{width:"24px",height:"24px",borderRadius:"8px",backgroundColor:Y,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200"}),r.jsx(l.Text,{color:k?"color-gray-900":"color-gray-500",fontSize:"inherit",children:k||n})]}),!g&&!m&&r.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:b?"up":"down"})]}),b&&r.jsxs(l.View,{ref:M,...O,children:[r.jsx(l.View,{...N,children:h.map((A,G)=>r.jsx(l.View,{width:"36px",height:"36px",borderRadius:"8px",backgroundColor:A.value,borderWidth:"1px",borderStyle:"solid",borderColor:k===A.value?"theme-primary":"transparent",cursor:"pointer",onClick:()=>S(A.value),title:A.name,_hover:{transform:"scale(1.05)",borderColor:"color-gray-300"},...i==null?void 0:i.colorSwatch},G))}),f&&r.jsxs(l.View,{...ko.customInput,...i==null?void 0:i.customInput,children:[r.jsxs(l.Horizontal,{gap:8,alignItems:"center",marginBottom:"10px",children:[Xy&&r.jsx("input",{type:"color",value:j||"#1D4ED8",onChange:A=>{const G=A.target.value;x(G),S(G)},style:{width:"36px",height:"36px",border:"1px solid #E5E7EB",borderRadius:"8px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),r.jsx(l.Text,{fontSize:"12px",lineHeight:"16px",color:"color-gray-500",children:"HEX"})]}),r.jsx(ve,{placeholder:"#1D4ED8",value:j,onChange:A=>{var G;return x(typeof A=="string"?A:((G=A==null?void 0:A.target)==null?void 0:G.value)??"")},onKeyPress:A=>{A.key==="Enter"&&v()},size:"sm",right:j&&r.jsx(l.View,{width:"18px",height:"18px",borderRadius:"6px",backgroundColor:j,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",cursor:"pointer",onClick:v})})]}),y&&C.length>0&&r.jsxs(l.View,{..._,children:[r.jsx(l.Text,{fontSize:"11px",lineHeight:"16px",fontWeight:"500",color:"color-gray-500",marginBottom:"8px",children:"Recent Colors"}),r.jsx(l.Horizontal,{gap:8,flexWrap:"wrap",children:C.map((A,G)=>r.jsx(l.View,{width:"24px",height:"24px",borderRadius:"8px",backgroundColor:A,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",cursor:"pointer",transition:"transform 0.2s ease, border-color 0.2s ease",onClick:()=>S(A),title:A,_hover:{transform:"scale(1.05)",borderColor:"color-gray-300"}},G))})]})]}),a&&r.jsx(l.Text,{fontSize:"11px",lineHeight:"16px",color:u?"color-red-500":"color-gray-500",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},Qy=e=>{const o=qy(e);return r.jsx(Jy,{...o,...e})},Pi=Qy,Zy=e=>{const o=ai(e);return r.jsx(li,{...o,...e})},ex=Zy,ox=e=>{const o=ti(e);return r.jsx(ni,{...o,...e})},rx=ox,ta={"to-right":"to right","to-left":"to left","to-bottom":"to bottom","to-top":"to top","to-top-right":"to top right","to-top-left":"to top left","to-bottom-right":"to bottom right","to-bottom-left":"to bottom left"},gr={center:"center",top:"top",right:"right",bottom:"bottom",left:"left","top-right":"top right","top-left":"top left","bottom-right":"bottom right","bottom-left":"bottom left"},tx={linear:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],radial:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],conic:[{color:"color-red-500",position:"0deg"},{color:"color-yellow-500",position:"90deg"},{color:"color-green-500",position:"180deg"},{color:"color-blue-500",position:"270deg"},{color:"color-red-500",position:"360deg"}]},nx=(e,o,t,n,a)=>{const i=o.map(s=>`${s.color} ${s.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${t&&ta[t]?ta[t]:t||"to right"}, ${i})`;case"radial":const c=a&&gr[a]?gr[a]:a||"center";return`radial-gradient(${n||"circle"} at ${c}, ${i})`;case"conic":return`conic-gradient(from 0deg at ${a&&gr[a]?gr[a]:a||"center"}, ${i})`;default:return`linear-gradient(to right, ${i})`}},ax={linear:{backgroundSize:"200% 200%",transition:"background-position 3s ease-in-out",animate:{from:{backgroundPosition:"0% 50%"},"50%":{backgroundPosition:"100% 50%"},to:{backgroundPosition:"0% 50%"}}},radial:{backgroundSize:"100% 100%",transition:"background-position 3s ease-in-out, background-size 3s ease-in-out",animate:{from:{backgroundPosition:"center",backgroundSize:"100% 100%"},"50%":{backgroundSize:"120% 120%"},to:{backgroundPosition:"center",backgroundSize:"100% 100%"}}},conic:{transition:"transform 3s linear",animate:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}},na={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"border-radius 0.2s ease, opacity 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},lx=({type:e="linear",direction:o="to-right",shape:t="circle",position:n="center",from:a,to:i,colors:s,animate:c=!1,animationDuration:d=3,children:u,views:m,themeMode:g,...h})=>{const f=p.useMemo(()=>s&&s.length>0?s:a&&i?[{color:a,position:"0%"},{color:i,position:"100%"}]:tx[e],[s,a,i,e]),y=p.useMemo(()=>{const k=f.map(C=>({...C,color:C.color}));return nx(e,k,o,t,n)},[e,f,o,t,n]),b=p.useMemo(()=>{if(!c)return{};const k=ax[e];return{...k,transition:k.transition.replace("3s",`${d}s`),animationDuration:`${d}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[c,d,e]);return r.jsx(l.View,{background:y,...na.container,...b,...m==null?void 0:m.container,...h,children:u&&r.jsx(l.View,{...na.content,...m==null?void 0:m.content,children:u})})},Vi=e=>r.jsx(lx,{...e}),ix=(e=null,o=null)=>{const[t,n]=p.useState(e),[a,i]=p.useState(o),s=d=>a===d,c=d=>{i(u=>u===d?null:d)};return p.useEffect(()=>{const d=m=>{!m.composedPath().some(f=>(f==null?void 0:f.id)==="menubar-content"||(f==null?void 0:f.id)==="menubar-trigger")&&a!==null&&i(null)},u=m=>{m.key==="Escape"&&a!==null&&i(null)};if(typeof(document==null?void 0:document.addEventListener)=="function")return document.addEventListener("mousedown",d),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",u)}},[a]),{activeMenuId:t,setActiveMenuId:n,openMenuId:a,setOpenMenuId:i,isMenuOpen:s,toggleMenu:c}},Ai={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},sx={default:{backgroundColor:"transparent",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},cx={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},kr={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},Ei=p.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),qr=()=>p.useContext(Ei),dx=({value:e,children:o})=>r.jsx(Ei.Provider,{value:e,children:o}),Di=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",views:a,...i})=>{const s=o==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(s,{role:"menubar","aria-orientation":o,...cx[o],...sx[n],...a==null?void 0:a.container,...i,children:e})},$i=({children:e,id:o,disabled:t=!1,views:n})=>{const{orientation:a}=qr(),i=a==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(i,{role:"none",position:"relative",opacity:t?.5:1,pointerEvents:t?"none":"auto",...n==null?void 0:n.menu,children:p.Children.map(e,s=>p.isValidElement(s)?p.cloneElement(s,{...s.props,menuId:o}):s)})},Li=({children:e,menuId:o,disabled:t=!1,views:n})=>{const{activeMenuId:a,setActiveMenuId:i,toggleMenu:s,isMenuOpen:c,size:d,triggerRefs:u}=qr(),m=p.useRef(null),g=a===o,h=c(o);p.useEffect(()=>(m.current&&o&&(u.current[o]=m.current),()=>{o&&delete u.current[o]}),[o,u]);const f=()=>{t||(i(o),s(o))};return r.jsx(l.View,{ref:m,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":h,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...Ai[d],...g?kr.active:{},...t?kr.disabled:{},_hover:t?{}:kr.hover,onClick:f,...n==null?void 0:n.trigger,children:e})},_i=({children:e,menuId:o,views:t})=>{const{isMenuOpen:n,orientation:a,triggerRefs:i}=qr(),s=p.useRef(null),[c,d]=p.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=n(o);if(p.useEffect(()=>{if(u&&s.current&&o&&i.current[o]){const g=s.current.getBoundingClientRect(),h=i.current[o].getBoundingClientRect(),f=Math.max(g.width||200,200),y=Math.max(g.height||150,150),b=window.innerWidth,k=window.innerHeight,C={top:h.top,right:b-h.right,bottom:k-h.bottom,left:h.left},j=a==="horizontal"?[{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:h.left,y:h.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:h.left,y:h.top-y-8},{placement:"right",space:C.right,fits:C.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:C.left,fits:C.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:C.right,fits:C.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:C.left,fits:C.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:h.left,y:h.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:h.left,y:h.top-y-8}],w=j.find(T=>T.fits);if(w){d({x:w.x,y:w.y,placement:w.placement});return}const S=j.reduce((T,R)=>R.space>T.space?R:T);let x=S.x,v=S.y;x+f>b&&(x=b-f-8),x<8&&(x=8),v+y>k&&(v=k-y-8),v<8&&(v=8),d({x,y:v,placement:S.placement})}},[u,a,o,i]),!u)return null;const m={position:"fixed",left:c.x,top:c.y,zIndex:1e3};return r.jsx(l.View,{ref:s,id:"menubar-content",role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:m,...t==null?void 0:t.content,children:e})},Bi=({children:e,icon:o,disabled:t=!1,onClick:n,views:a})=>{const{size:i}=qr(),s=()=>{t||!n||n()};return r.jsxs(l.View,{role:"menuitem",cursor:t?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:t?.5:1,...Ai[i],_hover:t?{}:kr.hover,onClick:s,...a==null?void 0:a.item,children:[o&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:o}),e]})},Oi=({views:e})=>r.jsx(l.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),ux=({items:e,orientation:o,size:t,variant:n,views:a,themeMode:i})=>r.jsx(Di,{orientation:o,size:t,variant:n,views:a,children:e.map(s=>r.jsxs($i,{id:s.id,disabled:s.disabled,views:a,children:[r.jsxs(Li,{menuId:s.id,views:a,children:[s.icon&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:s.icon}),s.label]}),s.items&&s.items.length>0&&r.jsx(_i,{menuId:s.id,views:a,children:s.items.map((c,d)=>c.separator?r.jsx(Oi,{views:a},`separator-${d}`):r.jsx(Bi,{id:c.id,icon:c.icon,disabled:c.disabled,onClick:c.onClick,views:a,children:c.label},c.id))})]},s.id))}),px=({items:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultActiveMenuId:a=null,defaultOpenMenuId:i=null,views:s,...c})=>{const{activeMenuId:d,setActiveMenuId:u,openMenuId:m,setOpenMenuId:g,isMenuOpen:h,toggleMenu:f}=ix(a,i),y=p.useRef({});return r.jsx(dx,{value:{activeMenuId:d,setActiveMenuId:u,openMenuId:m,setOpenMenuId:g,isMenuOpen:h,toggleMenu:f,orientation:o,size:t,variant:n,triggerRefs:y},children:r.jsx(ux,{items:e,orientation:o,size:t,variant:n,views:s,...c})})},po=px;po.Root=Di;po.Menu=$i;po.Trigger=Li;po.Content=_i;po.Item=Bi;po.Separator=Oi;const mx=(e,o,t)=>{const[n,a]=p.useState([]);return p.useEffect(()=>{a((()=>{const s=[];if(o<=t)for(let c=1;c<=o;c++)s.push(c);else{s.push(1);let c=Math.max(2,e-Math.floor((t-2)/2)),d=Math.min(o-1,c+t-3);d>=o-1&&(d=o-1,c=Math.max(2,d-(t-3))),c>2&&s.push("...");for(let u=c;u<=d;u++)s.push(u);d<o-1&&s.push("..."),s.push(o)}return s})())},[e,o,t]),{visiblePageNumbers:n}},Co={sm:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px",media:{mobile:{fontSize:"11px",padding:"3px 6px",minWidth:"24px",height:"24px"}}},md:{fontSize:"14px",padding:"6px 10px",minWidth:"32px",height:"32px",media:{mobile:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px"}}},lg:{fontSize:"14px",padding:"8px 12px",minWidth:"36px",height:"36px",media:{mobile:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px"}}}},qo={default:{backgroundColor:"transparent",color:"color-gray-800",borderWidth:"0px",borderStyle:"none",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"color-gray-100"}},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",borderWidth:"0px",borderStyle:"none",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"color-gray-200"}},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"color-gray-100"}}},Uo={rounded:{borderRadius:8},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},gx={backgroundColor:"theme-primary",color:"color-white",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"theme-primary",opacity:.9}},hr={opacity:.5,cursor:"not-allowed",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"transparent"}},hx=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:a=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:i,showPageSizeSelector:s=!1,showPageInfo:c=!0,maxPageButtons:d=5,showFirstLastButtons:u=!1,size:m="md",variant:g="default",shape:h="rounded",visiblePageNumbers:f=[],views:y,...b})=>{const k=w=>{w<1||w>o||w===e||t(w)},C=w=>{i&&i(Number(w.target.value))},j=(w,S)=>{if(w==="...")return r.jsx(l.View,{display:"flex",alignItems:"center",justifyContent:"center",...Co[m],...y==null?void 0:y.ellipsis,children:"..."},`ellipsis-${S}`);const x=w===e;return r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:x?"default":"pointer",...Co[m],...qo[g],...Uo[h],...x?gx:{},onClick:()=>k(w),"aria-label":`Page ${w}`,"aria-current":x?"page":void 0,...x?y==null?void 0:y.activePageButton:y==null?void 0:y.pageButton,children:w},`page-${w}`)};return r.jsxs(l.Horizontal,{alignItems:"center",gap:8,...y==null?void 0:y.container,...b,children:[u&&r.jsxs(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Co[m],...qo[g],...Uo[h],...e===1?hr:{},onClick:()=>k(1),"aria-label":"First page",disabled:e===1,...y==null?void 0:y.navigationButton,children:[r.jsx(ce,{orientation:"left",widthHeight:16}),r.jsx(ce,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Co[m],...qo[g],...Uo[h],...e===1?hr:{},onClick:()=>k(e-1),"aria-label":"Previous page",disabled:e===1,...y==null?void 0:y.navigationButton,children:r.jsx(ce,{orientation:"left",widthHeight:16})}),f.map((w,S)=>j(w,S)),r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Co[m],...qo[g],...Uo[h],...e===o?hr:{},onClick:()=>k(e+1),"aria-label":"Next page",disabled:e===o,...y==null?void 0:y.navigationButton,children:r.jsx(ce,{orientation:"right",widthHeight:16})}),u&&r.jsxs(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Co[m],...qo[g],...Uo[h],...e===o?hr:{},onClick:()=>k(o),"aria-label":"Last page",disabled:e===o,...y==null?void 0:y.navigationButton,children:[r.jsx(ce,{orientation:"right",widthHeight:16}),r.jsx(ce,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),c&&r.jsxs(l.Text,{marginLeft:16,color:"color-gray-600",...y==null?void 0:y.pageInfo,children:["Page ",e," of ",o]}),s&&i&&r.jsx(l.View,{as:"select",marginLeft:16,padding:"4px 8px",borderRadius:"4px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",cursor:"pointer",value:n,onChange:C,...y==null?void 0:y.pageSizeSelector,children:a.map(w=>r.jsx("option",{value:w.value,children:w.label},w.value))})]})},fx=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:s=!1,showPageInfo:c=!0,maxPageButtons:d=5,showFirstLastButtons:u=!1,size:m="md",variant:g="default",shape:h="rounded",views:f,...y})=>{const{visiblePageNumbers:b}=mx(e,o,d);return r.jsx(hx,{currentPage:e,totalPages:o,onPageChange:t,pageSize:n,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:s,showPageInfo:c,maxPageButtons:d,showFirstLastButtons:u,size:m,variant:g,shape:h,visiblePageNumbers:b,views:f,...y})},Ni=fx,yx=e=>typeof e=="string"&&(/^(#|rgb\(|rgba\(|hsl\(|hsla\(|var\()/.test(e)||["black","currentColor","inherit","transparent","white"].includes(e)),xx=p.memo(({shape:e="linear",value:o=0,max:t=100,color:n="theme-primary",backgroundColor:a="color-gray-200",height:i,size:s,radius:c=4,strokeWidth:d=10,showLabel:u=!1,labelColor:m="color-black-primary",animated:g=!0,animationDuration:h="0.5s",views:f,themeMode:y,...b})=>{var E;const{getColor:k,themeMode:C}=l.useTheme(),j=y||C,S=Math.min(t,Math.max(0,o))/t*100,x=I=>yx(I)?I:k(I,{themeMode:j}),v=p.useMemo(()=>x(a),[k,a,j]),T=p.useMemo(()=>x(n),[k,n,j]);if(e==="circle"){const I=s||(typeof i=="number"?i:100),V=(I-d)/2,P=2*Math.PI*V,z=P-S/100*P;return r.jsxs(l.View,{width:I,height:I,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...f==null?void 0:f.container,...b,children:[r.jsxs("svg",{width:I,height:I,viewBox:`0 0 ${I} ${I}`,style:{transform:"rotate(-90deg)"},children:[r.jsx("circle",{cx:I/2,cy:I/2,r:V,stroke:v,strokeWidth:d,fill:"transparent",...f==null?void 0:f.track}),r.jsx("circle",{cx:I/2,cy:I/2,r:V,stroke:T,strokeWidth:d,strokeDasharray:P,strokeDashoffset:z,strokeLinecap:"round",fill:"transparent",style:{transition:g?`stroke-dashoffset ${h} ease-in-out`:"none"},...f==null?void 0:f.indicator})]}),u&&r.jsx(l.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:r.jsxs(l.Text,{color:m,fontSize:`${I*.2}px`,fontWeight:"bold",...f==null?void 0:f.text,children:[Math.round(S),"%"]})})]})}const R=i||8,M={backgroundColor:v,...((E=f==null?void 0:f.container)==null?void 0:E.style)||{},...b.style||{}};return r.jsxs(l.View,{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":t,width:"100%",height:R,borderRadius:c,overflow:"hidden",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...f==null?void 0:f.container,...b,style:M,children:[r.jsx("div",{style:{height:"100%",backgroundColor:T,borderRadius:typeof c=="number"?`${c}px`:c,position:"absolute",left:0,top:0,bottom:0,width:`${S}%`,transition:g?`width ${h} ease-in-out`:"none",...f==null?void 0:f.bar}}),u&&r.jsxs(l.Text,{color:m,fontSize:typeof R=="number"&&R>16?`${R*.6}px`:"10px",fontWeight:"bold",position:"relative",zIndex:1,...f==null?void 0:f.text,children:[Math.round(S),"%"]})]})}),bx=e=>{const o=ge("progress",e);return r.jsx(xx,{...o})},qi=bx,kx=e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}),Cx=kx(),Sx={thin:"1px",medium:"2px",thick:"4px"},Go={container:{transition:"opacity 0.15s ease"},label:{fontSize:"14px",fontWeight:"500",color:"color-gray-600",paddingHorizontal:"8px",backgroundColor:"color-white",transition:"color 0.15s ease"}},jx=e=>typeof e=="string"&&(/^(#|rgb\(|rgba\(|hsl\(|hsla\(|var\()/.test(e)||["black","currentColor","inherit","transparent","white"].includes(e)),wx=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:n,spacing:a="0px",label:i,decorative:s=!1,views:c,themeMode:d,...u})=>{const{themeMode:m}=l.useTheme(),g=n||"color-gray-200",h=Cx[o],f=Sx[t],y=s?{"aria-hidden":!0}:{role:"separator","aria-orientation":e},b=jx(g)?{style:{borderColor:g}}:{borderColor:g};return i&&e==="horizontal"?r.jsxs(l.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:a,...y,...u,children:[r.jsx(l.View,{height:"0px",flexGrow:1,borderTop:`${f} ${h}`,...b,...Go.container,...c==null?void 0:c.container}),r.jsx(l.Text,{...Go.label,...c==null?void 0:c.label,children:i}),r.jsx(l.View,{height:"0px",flexGrow:1,borderTop:`${f} ${h}`,...b,...Go.container,...c==null?void 0:c.container})]}):e==="horizontal"?r.jsx(l.View,{height:"0px",width:"100%",borderTop:`${f} ${h}`,padding:a,...b,...Go.container,...y,...c==null?void 0:c.container,...u}):r.jsx(l.View,{width:"0px",height:"100%",borderLeft:`${f} ${h}`,padding:a,...b,...Go.container,...y,...c==null?void 0:c.container,...u})},Ui=e=>{const o=ge("separator",e);return r.jsx(wx,{...o})},Pr=Ui,vx=Ui,Tx={xs:12,sm:14,md:16,lg:18,xl:20},Ix=({isSupported:e,isSharing:o,onShare:t,label:n,children:a,icon:i,size:s,isDisabled:c,isLoading:d,iconPosition:u,disableWhenUnsupported:m=!0,...g})=>{const h=s??"md",f=i??r.jsx($a,{widthHeight:Tx[h],strokeWidth:1.5,filled:!1}),y=!!c||!e&&m,b=!!d||o;return r.jsx(se,{...g,size:h,icon:f,iconPosition:u??"left",isDisabled:y,isLoading:b,onClick:t,children:a??n??"Share"})},aa=()=>typeof navigator>"u"?void 0:navigator,Fx=(e,o)=>{if(!e||typeof e.share!="function")return!1;if(typeof e.canShare=="function")try{return e.canShare(o)}catch{return!1}return!0},Rx=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},zx=e=>{const{shareData:o,onClick:t,onUnsupported:n,onShareStart:a,onShareSuccess:i,onShareCancel:s,onShareError:c}=e,[d,u]=p.useState(!1),m=p.useMemo(()=>Fx(aa(),o),[o]),g=p.useCallback((...h)=>{t==null||t(...h);const f=aa();if(!f||typeof f.share!="function"){n==null||n();return}if(!d){if(typeof f.canShare=="function")try{if(!f.canShare(o)){n==null||n();return}}catch(y){c==null||c(y);return}u(!0),a==null||a();try{f.share(o).then(()=>{i==null||i()}).catch(y=>{if(Rx(y)==="AbortError"){s==null||s();return}c==null||c(y)}).finally(()=>{u(!1)})}catch(y){u(!1),c==null||c(y)}}},[d,t,s,c,a,i,n,o]);return{isSupported:m,isSharing:d,handleShare:g}},Mx=e=>{const{isSupported:o,isSharing:t,handleShare:n}=zx(e),{shareData:a,onShareStart:i,onShareSuccess:s,onShareCancel:c,onShareError:d,onUnsupported:u,onClick:m,...g}=e;return r.jsx(Ix,{...g,isSupported:o,isSharing:t,onShare:n})},Gi=Mx,Wx=({label:e,status:o="default",views:t,themeMode:n,...a})=>{const{themeMode:i}=l.useTheme(),s=Xa();return r.jsxs(l.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...t==null?void 0:t.container,...a,children:[r.jsx(l.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...s[o].indicator,...t==null?void 0:t.indicator}),e&&r.jsx(l.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...s[o].label,...t==null?void 0:t.label,children:e})]})},Cr=e=>{const o=ge("status",e);return r.jsx(Wx,{...o})},Hx=(e=!0,o,t,n)=>{const{on:a}=l.useResponsive(),i=a("mobile"),[s,c]=p.useState(o!==void 0?o:e);return p.useEffect(()=>{o!==void 0&&c(o)},[o]),{isExpanded:s,toggleExpanded:()=>{const g=!s;c(g),t&&t(g)},expand:()=>{s||(c(!0),t&&t(!0))},collapse:()=>{s&&(c(!1),t&&t(!1))},isMobile:i}},Px={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},Vx=e=>({default:{backgroundColor:"color-white",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"},subtle:{backgroundColor:"color-gray-50",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease"},elevated:{backgroundColor:"color-white",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",color:"color-gray-800",transition:"all 0.2s ease-in-out"}}),Ax=Vx(),Ex={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},Dx={none:{},low:{boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},medium:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)"},high:{boxShadow:"0 10px 30px rgba(0, 0, 0, 0.15)"}},$x={fast:"all 0.2s ease-in-out",normal:"all 0.3s ease-in-out",slow:"all 0.5s ease-in-out",bounce:"all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55)"},Yi=p.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),Ur=()=>p.useContext(Yi),Lx=({value:e,children:o})=>r.jsx(Yi.Provider,{value:e,children:o}),_x=({children:e,showToggleButton:o=!0,views:t,...n})=>{const{isExpanded:a,toggleExpanded:i,position:s}=Ur();return r.jsx(l.Horizontal,{width:"100%",padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:"space-between",...t==null?void 0:t.header,...n,children:a?r.jsxs(l.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,o&&r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:i,"aria-label":a?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ce,{orientation:s==="left"?"left":"right",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})]}):r.jsx(l.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:o&&r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:i,"aria-label":a?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ce,{orientation:s==="left"?"right":"left",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})})})},Bx=({children:e,views:o,...t})=>{const{isExpanded:n}=Ur();return r.jsx(l.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:n?"16px":"8px",...o==null?void 0:o.content,...t,children:e})},Ox=({children:e,views:o,...t})=>{const{isExpanded:n}=Ur();return r.jsx(l.View,{width:"100%",padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...o==null?void 0:o.footer,...t,children:n?e:null})},Nx=({children:e,position:o="left",size:t="md",variant:n="default",fixed:a=!1,hasBackdrop:i=!0,expandedWidth:s,collapsedWidth:c,breakpoint:d,breakpointBehavior:u="overlay",elevation:m="none",transitionPreset:g="normal",ariaLabel:h="Sidebar navigation",showToggleButton:f,toggleExpanded:y,expand:b,isExpanded:k,isMobile:C,collapse:j,views:w,themeMode:S,...x})=>{const v=Px[t],T=k?s||v.expandedWidth:c||v.collapsedWidth,R=!C||C&&u!=="hide",M=a||C&&u==="overlay"?"fixed":"relative",E=i&&C&&k&&u==="overlay";return r.jsxs(r.Fragment,{children:[E&&r.jsx(l.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:j,...w==null?void 0:w.backdrop}),R&&r.jsx(l.Vertical,{position:M,top:0,height:"100vh",width:T,zIndex:999,transition:$x[g],transform:C&&u==="overlay"&&!k?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":h,...Ax[n],...Ex[o],...Dx[m],...w==null?void 0:w.container,...x,children:p.Children.map(e,I=>I)})]})},qx=({children:e,position:o="left",size:t="md",variant:n="default",defaultExpanded:a=!0,expanded:i,onExpandedChange:s,fixed:c=!1,hasBackdrop:d=!0,showToggleButton:u=!0,expandedWidth:m,collapsedWidth:g,breakpoint:h=768,breakpointBehavior:f="overlay",views:y,...b})=>{const{isExpanded:k,toggleExpanded:C,expand:j,collapse:w,isMobile:S}=Hx(a,i,s);return r.jsx(Lx,{value:{isExpanded:k,toggleExpanded:C,expand:j,collapse:w,position:o,size:t,variant:n,views:y},children:r.jsx(Nx,{position:o,size:t,variant:n,fixed:c,hasBackdrop:d,showToggleButton:u,expandedWidth:m,collapsedWidth:g,breakpoint:h,breakpointBehavior:f,isExpanded:k,isMobile:S,toggleExpanded:C,expand:j,collapse:w,views:y,...b,children:e})})},ir=qx;ir.Header=_x;ir.Content=Bx;ir.Footer=Ox;ir.useContext=Ur;const Ux=()=>({getItem:e=>{try{return typeof localStorage>"u"?null:localStorage.getItem(`resizable-${e}`)}catch(o){return console.warn("Failed to access localStorage:",o),null}},setItem:(e,o)=>{try{if(typeof localStorage>"u")return;localStorage.setItem(`resizable-${e}`,o)}catch(t){console.warn("Failed to write to localStorage:",t)}}}),Gx=(e,o,t,n=50,a=1/0,i=!1,s,c,d=10)=>{const[u,m]=p.useState(!1),[g,h]=p.useState([]),f=p.useRef(null),y=p.useRef(null),b=p.useRef(0),k=p.useRef([]),C=p.useRef(c||(typeof window<"u"?Ux():null)),j=p.useCallback(()=>f.current?e==="horizontal"?f.current.offsetWidth:f.current.offsetHeight:0,[e]),w=p.useCallback(()=>{if(!s||!C.current)return null;const W=C.current.getItem(s);if(!W)return null;try{const F=JSON.parse(W);return Array.isArray(F.sizes)?F.sizes:null}catch(F){return console.warn("Failed to parse saved panel sizes:",F),null}},[s]),S=p.useCallback(()=>{if(!s||!C.current||g.length===0)return;const W=g.map(F=>({id:F.id,size:F.size,collapsed:F.collapsed||!1}));C.current.setItem(s,JSON.stringify({sizes:W}))},[s,g]),x=p.useCallback((W,F,H,D,L)=>{h(B=>B.some($=>$.id===W)?B:[...B,{id:W,size:F,minSize:H??n,maxSize:D??a,collapsible:L??i,collapsed:!1}])},[n,a,i]),v=p.useCallback(W=>{h(F=>F.filter(H=>H.id!==W))},[]),T=p.useCallback(W=>{const F=g.find(H=>H.id===W);return F?F.size:0},[g]),R=p.useCallback((W,F)=>{h(H=>H.map(D=>D.id===W?{...D,size:F}:D))},[]),M=p.useCallback(W=>{const F=g.find(H=>H.id===W);return F?!!F.collapsed:!1},[g]),E=p.useCallback(W=>{h(F=>{const H=F.findIndex($=>$.id===W);if(H===-1)return F;const D=F[H];if(!D.collapsible)return F;const L={...D,collapsed:!D.collapsed},B=[...F];return B[H]=L,B})},[]),I=p.useCallback((W,F)=>{y.current=W,b.current=F,k.current=g.map(H=>H.size),m(!0)},[g]),V=p.useCallback(W=>{if(!u||!y.current)return;const F=y.current,H=W-b.current;let D=-1;const L=F.match(/\d+$/);if(L&&(D=parseInt(L[0],10)-1),D===-1&&g.length>=2&&(D=0),D<0||D>=g.length-1)return;const B=g[D],$=g[D+1];if(B.collapsed||$.collapsed)return;let O=k.current[D]+H,N=k.current[D+1]-H;O=Math.max(B.minSize??n,Math.min(B.maxSize??a,O)),N=Math.max($.minSize??n,Math.min($.maxSize??a,N)),h(_=>_.map((Y,A)=>A===D?{...Y,size:O}:A===D+1?{...Y,size:N}:Y))},[u,g,e,n,a]),P=p.useCallback(()=>{u&&t&&t(g.map(W=>W.size)),y.current=null,m(!1),s&&S()},[u,g,t,s,S]),z=p.useCallback(W=>{if(!u||!y.current)return;const F=y.current;let H=-1;const D=F.match(/\d+$/);if(D&&(H=parseInt(D[0],10)-1),H===-1&&g.length>=2&&(H=0),H<0||H>=g.length-1)return;let L=0;e==="horizontal"?(W.key==="ArrowLeft"&&(L=-d),W.key==="ArrowRight"&&(L=d),W.key==="Home"&&(L=-100),W.key==="End"&&(L=100)):(W.key==="ArrowUp"&&(L=-d),W.key==="ArrowDown"&&(L=d),W.key==="Home"&&(L=-100),W.key==="End"&&(L=100)),L!==0&&(W.preventDefault(),V(b.current+L)),W.key==="Escape"&&(h(B=>B.map(($,O)=>({...$,size:k.current[O]}))),P())},[u,g,e,V,P,d]);return p.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)!="function")return;const W=D=>{if(!u)return;const L=e==="horizontal"?D.clientX:D.clientY;V(L)},F=D=>{if(!u||D.touches.length===0)return;const L=D.touches[0],B=e==="horizontal"?L.clientX:L.clientY;V(B)},H=()=>{u&&P()};return u&&(document.addEventListener("mousemove",W),document.addEventListener("touchmove",F),document.addEventListener("mouseup",H),document.addEventListener("touchend",H),document.addEventListener("keydown",z),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("touchmove",F),document.removeEventListener("mouseup",H),document.removeEventListener("touchend",H),document.removeEventListener("keydown",z),document.body.style.cursor="",document.body.style.userSelect=""}},[u,e,V,P,z]),p.useEffect(()=>{if(g.length!==0){if(s){const W=w();if(W){h(F=>F.map(H=>{const D=W.find(L=>L.id===H.id);return D?{...H,size:D.size,collapsed:D.collapsed||!1}:H}));return}}if(!o){const F=j()/g.length;h(H=>H.map(D=>({...D,size:F})))}}},[g.length,o,j,s,w]),p.useEffect(()=>{if(!o||o.length===0||g.length===0)return;const W=j(),F=o.map(H=>typeof H=="string"&&H.endsWith("%")?parseFloat(H)/100*W:typeof H=="number"?H:parseFloat(H));h(H=>H.map((D,L)=>({...D,size:L<F.length?F[L]:D.size})))},[o,g.length,j]),p.useEffect(()=>{g.length>0&&s&&!u&&S()},[g,s,u,S]),{isResizing:u,setIsResizing:m,containerRef:f,panels:g,registerPanel:x,unregisterPanel:v,getPanelSize:T,setPanelSize:R,isPanelCollapsed:M,togglePanelCollapse:E,startResize:I,onResize:V,endResize:P}},Yx={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Kx=(e,o)=>({sm:{width:o==="horizontal"?"4px":"100%",height:o==="vertical"?"4px":"100%"},md:{width:o==="horizontal"?"6px":"100%",height:o==="vertical"?"6px":"100%"},lg:{width:o==="horizontal"?"8px":"100%",height:o==="vertical"?"8px":"100%"}})[e],Xx=e=>({default:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}},subtle:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-100"},_active:{backgroundColor:"color-gray-200"}},prominent:{backgroundColor:"color-gray-100",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}}}),Jx=Xx(),fr={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},Ki=p.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),Xi=()=>p.useContext(Ki),Qx=({value:e,children:o})=>r.jsx(Ki.Provider,{value:e,children:o}),Zx=({children:e,id:o,defaultSize:t,minSize:n,maxSize:a,collapsible:i,defaultCollapsed:s,onCollapseChange:c,views:d,...u})=>{const{orientation:m,registerPanel:g,unregisterPanel:h,getPanelSize:f,isPanelCollapsed:y,togglePanelCollapse:b}=Xi(),k=typeof t=="string"&&t.endsWith("%")?0:typeof t=="number"?t:0;p.useEffect(()=>(g(o,k,n,a,i),()=>h(o)),[o,k,n,a,i,g,h]);const C=f(o),j=y(o);return p.useEffect(()=>{c&&j!==void 0&&c(j)},[j,c]),p.useEffect(()=>{i&&s&&!j&&b(o)},[o,i,s,j,b]),j?r.jsx(l.View,{flex:"0 0 auto",width:m==="horizontal"?"10px":"100%",height:m==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>b(o),"aria-label":`Expand panel ${o}`,role:"button",tabIndex:0,...d==null?void 0:d.collapsedPanel,...u}):r.jsx(l.View,{flex:C>0?"0 0 auto":"1",width:m==="horizontal"?`${C}px`:"100%",height:m==="vertical"?`${C}px`:"100%",overflow:"auto",...d==null?void 0:d.panel,...u,children:e})},eb=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:n=!0,withCollapseButton:a=!1,collapseTarget:i,views:s,...c})=>{const{orientation:d,size:u,variant:m,startResize:g,isPanelCollapsed:h,togglePanelCollapse:f}=Xi(),b=(()=>{if(i)return i;const x=e.match(/\d+$/);if(!x)return"";const v=parseInt(x[0],10);return isNaN(v)?"":`panel${v}`})(),k=h(b),C=x=>{if(t)return;x.preventDefault();const v=d==="horizontal"?x.clientX:x.clientY;g(e,v)},j=x=>{if(t||x.touches.length===0)return;x.preventDefault();const v=x.touches[0],T=d==="horizontal"?v.clientX:v.clientY;g(e,T)},w=x=>{t||(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),g(e,0))},S=x=>{x.stopPropagation(),b&&f(b)};return r.jsxs(l.View,{role:"separator","aria-orientation":d,"aria-valuemin":0,"aria-valuemax":100,tabIndex:t?-1:0,cursor:d==="horizontal"?"col-resize":"row-resize",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",...Kx(u,d),...Jx[m],onMouseDown:C,onTouchStart:j,onKeyDown:w,opacity:t?.5:1,pointerEvents:t?"none":"auto",...s==null?void 0:s.handle,...c,children:[n&&r.jsx(l.View,{display:"flex",alignItems:"center",justifyContent:"center",width:d==="horizontal"?"100%":"auto",height:d==="vertical"?"100%":"auto",pointerEvents:"none",...s==null?void 0:s.handleIcon,children:d==="horizontal"?r.jsxs(l.Horizontal,{gap:1,children:[r.jsx(l.View,{...fr.horizontal}),r.jsx(l.View,{...fr.horizontal})]}):r.jsxs(l.Vertical,{gap:1,children:[r.jsx(l.View,{...fr.vertical}),r.jsx(l.View,{...fr.vertical})]})}),a&&b&&r.jsx(l.View,{position:"absolute",top:d==="horizontal"?"-20px":"50%",left:d==="horizontal"?"50%":"-20px",transform:d==="horizontal"?"translateX(-50%)":"translateY(-50%)",width:"16px",height:"16px",borderRadius:"full",backgroundColor:"color-gray-100",border:"1px solid",borderColor:"color-gray-300",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:1,onClick:S,"aria-label":k?`Expand panel ${b}`:`Collapse panel ${b}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...s==null?void 0:s.collapseIcon,children:r.jsx(l.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:k?r.jsxs(l.Horizontal,{children:[r.jsx(l.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),r.jsx(l.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):r.jsx(l.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},ob=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:a,minSize:i,maxSize:s,collapsible:c=!1,containerRef:d,autoSaveId:u,keyboardResizeBy:m,onLayout:g,views:h,...f})=>{const y=o==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(y,{ref:d,width:"100%",height:"100%",position:"relative",overflow:"hidden",...Yx[o],...h==null?void 0:h.container,...f,children:e})},rb=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:a,onSizesChange:i,minSize:s=50,maxSize:c,collapsible:d=!1,autoSaveId:u,storage:m,keyboardResizeBy:g=10,views:h,...f})=>{const{isResizing:y,setIsResizing:b,containerRef:k,registerPanel:C,unregisterPanel:j,getPanelSize:w,setPanelSize:S,isPanelCollapsed:x,togglePanelCollapse:v,startResize:T,onResize:R,endResize:M}=Gx(o,a,i,s,c,d,u,m,g);return r.jsx(Qx,{value:{orientation:o,size:t,variant:n,isResizing:y,setIsResizing:b,registerPanel:C,unregisterPanel:j,getPanelSize:w,setPanelSize:S,isPanelCollapsed:x,togglePanelCollapse:v,startResize:T,onResize:R,endResize:M},children:r.jsx(ob,{orientation:o,size:t,variant:n,defaultSizes:a,minSize:s,maxSize:c,collapsible:d,autoSaveId:u,keyboardResizeBy:g,containerRef:k,views:h,...f,children:e})})},Cn=rb;Cn.Panel=Zx;Cn.Handle=eb;const yr={info:{container:{backgroundColor:"color-blue-50",border:"color-blue-300"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",border:"color-green-300"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},warning:{container:{backgroundColor:"color-orange-50",border:"color-orange-300"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}},error:{container:{backgroundColor:"color-red-50",border:"color-red-300"},content:{color:"color-red-700"},icon:{color:"color-red-500"}}},tb={top:{top:"16px",left:"50%",transform:"translateX(-50%)"},"top-right":{top:"16px",right:"16px"},"top-left":{top:"16px",left:"16px"},bottom:{bottom:"16px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"}},nb=()=>Math.random().toString(36).substring(2,9);let So=new Map;const sr=Ho.create(e=>({toasts:[],add:(o,t,n,a={})=>{const i=a.id||nb(),s={id:i,variant:o,title:t,description:n,createdAt:Date.now(),isVisible:!0,...a};if(e(c=>({toasts:[...c.toasts,s]})),a.duration!==0){const c=a.duration||5e3,d=setTimeout(()=>{sr.getState().remove(i)},c);So.set(i,d)}return i},remove:o=>{e(t=>({toasts:t.toasts.map(n=>n.id===o?{...n,isVisible:!1}:n)})),So.has(o)&&(clearTimeout(So.get(o)),So.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(n=>n.id!==o)}))},300)},removeAll:()=>{So.forEach(clearTimeout),So.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),mo=(e,o,t,n)=>sr.getState().add(e,o,t,n),Ji=(e,o,t)=>mo("info",e,o,t),Qi=(e,o,t)=>mo("success",e,o,t),Zi=(e,o,t)=>mo("warning",e,o,t),es=(e,o,t)=>mo("error",e,o,t),os=e=>{sr.getState().remove(e)},rs=()=>{sr.getState().removeAll()},ts=({variant:e,title:o,description:t,onClose:n,isClosable:a=!0,action:i,actionText:s,showIcon:c=!0,theme:d,views:u,render:m,icon:g,id:h,isVisible:f=!0,themeMode:y})=>{const b=d??yr,k=()=>{var S,x;if(g!==void 0)return g;const w=e?(x=(S=yr[e])==null?void 0:S.icon)==null?void 0:x.color:yr.info.icon.color;switch(e){case"info":return r.jsx(Ye,{widthHeight:20,color:w});case"success":return r.jsx(Ea,{widthHeight:20,color:w});case"warning":return r.jsx(Ye,{widthHeight:20,color:w,orientation:"down"});case"error":return r.jsx(Ar,{widthHeight:20,color:w});default:return r.jsx(Ye,{widthHeight:20,color:yr.info.icon.color})}};if(m)return r.jsx(r.Fragment,{children:m({id:h||"",onClose:n})});const C=e==="error"?"alert":"status",j=e==="error"||e==="warning"?"assertive":"polite";return r.jsxs(l.Horizontal,{role:C,"aria-live":j,"aria-atomic":"true","data-state":f?"open":"closed",gap:12,width:"100%",maxWidth:"380px",borderWidth:"1px",borderStyle:"solid",borderRadius:"12px",padding:"12px 14px",alignItems:"flex-start",position:"relative",backgroundColor:b[e].container.backgroundColor,borderColor:b[e].container.border,boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12)",opacity:f?1:0,transform:f?"translateY(0)":"translateY(4px)",transition:"opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",...u==null?void 0:u.container,children:[c&&r.jsx(l.View,{marginTop:"2px",...u==null?void 0:u.icon,children:k()}),r.jsxs(l.Vertical,{gap:4,flex:"1",children:[r.jsx(l.Text,{fontSize:"14px",lineHeight:"20px",fontWeight:"600",color:b[e].content.color,backgroundColor:b[e].container.backgroundColor,...u==null?void 0:u.title,children:o}),t&&r.jsx(l.Text,{fontSize:"12px",lineHeight:"18px",color:b[e].content.color,fontWeight:"400",backgroundColor:b[e].container.backgroundColor,...u==null?void 0:u.description,children:t}),i&&s&&r.jsx(l.Text,{fontSize:"14px",fontWeight:"600",marginTop:"6px",cursor:"pointer",color:b[e].content.color,backgroundColor:b[e].container.backgroundColor,onClick:w=>{w.stopPropagation(),i()},_hover:{textDecoration:"underline"},transition:"opacity 0.2s ease, color 0.2s ease",...u==null?void 0:u.actionButton,children:s})]}),a&&r.jsx(l.View,{as:"button","aria-label":"Close toast",backgroundColor:"transparent",border:"none",cursor:"pointer",padding:"4px",marginLeft:"8px",marginTop:"-2px",marginRight:"-4px",borderRadius:"9999px",onClick:w=>{w.stopPropagation(),n()},_hover:{backgroundColor:"color-blackAlpha-100"},transition:"background-color 0.2s ease, opacity 0.2s ease",...u==null?void 0:u.closeButton,children:r.jsx(Te,{widthHeight:16,color:b[e].content.color})})]})},ab=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:n})=>{const{toasts:a,remove:i}=sr(),c=p.useMemo(()=>{const d={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return a.forEach(u=>{const m=u.position||e;d[m].push(u)}),Object.keys(d).forEach(u=>{d[u]=d[u].slice(-t)}),d},[a,e,t])[e];return r.jsx(l.View,{position:"fixed",zIndex:9999,display:"flex",flexDirection:e.includes("bottom")?"column-reverse":"column",gap:`${o}px`,width:"fit-content",maxWidth:"100%",pointerEvents:"none",...tb[e],style:n,children:c.map(d=>r.jsx(l.View,{pointerEvents:"auto",animation:e.includes("right")?"slideInRight 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("left")?"slideInLeft 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("top")?"slideInDown 0.3s ease-out, fadeIn 0.3s ease-out":"slideInUp 0.3s ease-out, fadeIn 0.3s ease-out",children:r.jsx(ts,{id:d.id,variant:d.variant,title:d.title,description:d.description,onClose:()=>i(d.id),isClosable:d.isClosable,action:d.action,actionText:d.actionText,showIcon:d.showIcon,views:d.views,render:d.render,icon:d.icon,isVisible:d.isVisible})},d.id))})},lb=()=>({toast:(e,o,t,n)=>mo(e,o,t,n),info:(e,o,t)=>Ji(e,o,t),success:(e,o,t)=>Qi(e,o,t),warning:(e,o,t)=>Zi(e,o,t),error:(e,o,t)=>es(e,o,t),remove:e=>os(e),removeAll:()=>rs()}),ib=e=>r.jsx(ts,{...e}),sb=Object.assign(ib,{Container:e=>r.jsx(ab,{...e}),show:mo,info:Ji,success:Qi,warning:Zi,error:es,remove:os,removeAll:rs}),cb=lb,la=(e,o)=>{var s,c;if(!e)return!0;const t=e.toLowerCase(),n=o.name.toLowerCase().includes(t),a=((s=o.description)==null?void 0:s.toLowerCase().includes(t))||!1,i=((c=o.keywords)==null?void 0:c.some(d=>d.toLowerCase().includes(t)))||!1;return n||a||i},db=({open:e,onOpenChange:o,groups:t=[],commands:n=[],filter:a})=>{const[i,s]=p.useState(""),[c,d]=p.useState(0),u=p.useRef(null),m=p.useMemo(()=>a||la,[a]),g=p.useMemo(()=>[...t.flatMap(k=>k.commands),...n],[t,n]),h=p.useMemo(()=>i.trim()?g.filter(b=>m(i,b)):g,[g,i,m]),f=p.useMemo(()=>{if(!i)return t;const b=a||la;return t.map(k=>({...k,commands:k.commands.filter(C=>b(i,C))})).filter(k=>k.commands.length)},[t,i,a]);p.useEffect(()=>{d(0)},[h.length]);const y=p.useCallback(b=>{if(e)switch(b.key){case"ArrowDown":b.preventDefault(),d(k=>k<h.length-1?k+1:k);break;case"ArrowUp":b.preventDefault(),d(k=>k>0?k-1:k);break;case"Enter":b.preventDefault(),h[c]&&(h[c].onSelect(),o(!1),s(""));break;case"Escape":b.preventDefault(),o(!1),s("");break}},[e,h,c,o]);return p.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)=="function")return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y]),p.useEffect(()=>{const b=u.current;if(b&&typeof b.querySelector=="function"&&e){const k=b.querySelector(`[data-index="${c}"]`);k&&typeof k.scrollIntoView=="function"&&k.scrollIntoView({block:"nearest"})}},[c,e]),p.useEffect(()=>{e?d(0):s("")},[e]),{search:i,setSearch:s,selectedIndex:c,setSelectedIndex:d,filteredCommands:h,filteredGroups:f,listRef:u}},ub=({onClose:e,children:o,...t})=>r.jsx(l.View,{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-blackAlpha-400",zIndex:9999,onClick:n=>{n.target===n.currentTarget&&(e==null||e())},...t,children:o}),ns=p.forwardRef(({value:e,onValueChange:o,...t},n)=>r.jsx(l.Input,{value:e,onChange:a=>{var i,s;return o(typeof a=="string"?a:((i=a==null?void 0:a.target)==null?void 0:i.value)??((s=a==null?void 0:a.nativeEvent)==null?void 0:s.text)??"")},ref:n,...t}));ns.displayName="CommandTextInput";const pb={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},mb=e=>({default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},outline:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"}}),gb=mb(),hb={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},fb={overflow:"auto",padding:"8px 0"},yb={marginBottom:"8px"},xb={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},bb={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},kb={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},Cb={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},Sb={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},jb={display:"flex",flexDirection:"column",flex:1},wb={fontSize:"14px",fontWeight:"medium"},vb={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},Tb={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},Ib={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},Fb={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},Rb=p.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),zb=({value:e,children:o})=>r.jsx(Rb.Provider,{value:e,children:o}),as=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:n,...a})=>{const i=p.useRef(null);return p.useEffect(()=>{i.current&&i.current.focus()},[]),r.jsxs(l.View,{...hb,...n==null?void 0:n.container,...a,children:[r.jsx(Tr,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),r.jsx(ns,{width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",...n==null?void 0:n.input,value:e,onValueChange:o,placeholder:t,ref:i})]})},Mb=({children:e,views:o,...t})=>r.jsx(l.View,{...fb,...o==null?void 0:o.container,...t,children:e}),ls=({heading:e,children:o,views:t,...n})=>r.jsxs(l.View,{...yb,...t==null?void 0:t.container,...n,children:[r.jsx(l.Text,{...xb,...t==null?void 0:t.heading,children:e}),o]}),Tt=({item:e,selected:o=!1,onSelect:t,views:n,...a})=>{const i=()=>{!e.disabled&&t&&t()};return r.jsxs(l.Horizontal,{...bb,...o?kb:{},...e.disabled?Cb:{},onPress:i,onClick:i,...n==null?void 0:n.container,...a,children:[e.icon&&r.jsx(l.View,{...Sb,...n==null?void 0:n.icon,children:e.icon}),r.jsxs(l.Vertical,{...jb,...n==null?void 0:n.content,children:[r.jsx(l.Text,{...wb,...n==null?void 0:n.name,children:e.name}),e.description&&r.jsx(l.Text,{...vb,...n==null?void 0:n.description,children:e.description})]}),e.shortcut&&r.jsx(l.Text,{...Tb,...n==null?void 0:n.shortcut,children:e.shortcut})]})},is=({children:e="No results found.",views:o,...t})=>r.jsx(l.View,{...Ib,...o==null?void 0:o.container,...t,children:e}),Wb=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:a,size:i="md",variant:s="default",emptyState:c,footer:d,search:u,setSearch:m,selectedIndex:g,setSelectedIndex:h,filteredCommands:f,filteredGroups:y,listRef:b,views:k,filter:C,...j})=>{if(!e)return null;const w=p.useCallback(T=>{T.disabled||(T.onSelect(),o(!1),m(""))},[o,m]);p.useCallback(T=>T.target===T.currentTarget&&o(!1),[o]);const S=p.useMemo(()=>({search:u,setSearch:m,selectedIndex:g,setSelectedIndex:h,filteredCommands:f,onSelect:w}),[u,g,f,w,m,h]),x=t.length>0,v=f.length===0;return r.jsx(ub,{onClose:()=>o(!1),...j,children:r.jsx(zb,{value:S,children:r.jsxs(l.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...pb[i],...gb[s],...k==null?void 0:k.container,onClick:T=>T.stopPropagation(),children:[r.jsx(as,{value:u,onValueChange:m,placeholder:a,views:k==null?void 0:k.searchInput}),r.jsx(l.View,{ref:b,flex:1,overflow:"auto",...k==null?void 0:k.list,children:v?c||r.jsx(is,{views:k==null?void 0:k.empty}):x?y.map(T=>r.jsx(ls,{heading:T.name,views:k==null?void 0:k.groupHeading,children:T.commands.map(R=>{const M=f.findIndex(E=>E.id===R.id);return r.jsx(Tt,{item:R,selected:M===g,onSelect:()=>w(R),"data-index":M,views:{container:k==null?void 0:k.item,icon:k==null?void 0:k.icon,content:k==null?void 0:k.content,name:k==null?void 0:k.name,description:k==null?void 0:k.description,shortcut:k==null?void 0:k.shortcut}},R.id)})},T.id)):f.map((T,R)=>r.jsx(Tt,{item:T,selected:R===g,onSelect:()=>w(T),"data-index":R,views:{container:k==null?void 0:k.item,icon:k==null?void 0:k.icon,content:k==null?void 0:k.content,name:k==null?void 0:k.name,description:k==null?void 0:k.description,shortcut:k==null?void 0:k.shortcut}},T.id))}),d&&r.jsx(l.View,{...Fb,...k==null?void 0:k.footer,children:d})]})})})},Hb=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:a,size:i="md",variant:s="default",filter:c,emptyState:d,footer:u,views:m,...g})=>{const{search:h,setSearch:f,selectedIndex:y,setSelectedIndex:b,filteredCommands:k,filteredGroups:C,listRef:j}=db({open:e,onOpenChange:o,groups:t,commands:n,filter:c});return r.jsx(Wb,{open:e,onOpenChange:o,groups:t,commands:n,placeholder:a,size:i,variant:s,emptyState:d,footer:u,search:h,setSearch:f,selectedIndex:y,setSelectedIndex:b,filteredCommands:k,filteredGroups:C,listRef:j,views:m,...g})},Eo=Hb;Eo.Input=as;Eo.List=Mb;Eo.Group=ls;Eo.Item=Tt;Eo.Empty=is;const ia=()=>Math.random().toString(36).substring(2,11),Pb=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:n=!1}={})=>{const[a,i]=p.useState(e),s=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),m=p.useRef(`tooltip-trigger-${ia()}`).current,g=p.useRef(`tooltip-content-${ia()}`).current,h=p.useCallback(()=>{n||(u.current&&(clearTimeout(u.current),u.current=null),!a&&!d.current&&(d.current=setTimeout(()=>{i(!0),d.current=null},o)))},[a,o,n]),f=p.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),a&&!u.current&&(u.current=setTimeout(()=>{i(!1),u.current=null},t))},[a,t]),y=p.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]);return p.useEffect(()=>()=>{d.current&&clearTimeout(d.current),u.current&&clearTimeout(u.current)},[]),p.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)!="function")return;const b=k=>{k.key==="Escape"&&a&&i(!1)};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[a]),{isOpen:a,openTooltip:h,closeTooltip:f,cancelCloseTimer:y,triggerRef:s,contentRef:c,triggerId:m,contentId:g}},Vb={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},Ab=e=>({default:{backgroundColor:"color-gray-900",color:"color-white",borderRadius:"8px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",transition:"opacity 0.15s ease"},light:{backgroundColor:"color-white",color:"color-gray-800",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"8px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.04)",transition:"opacity 0.15s ease"},dark:{backgroundColor:"color-gray-950",color:"color-white",borderRadius:"8px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.2), 0px 2px 4px rgba(0, 0, 0, 0.12)",transition:"opacity 0.15s ease"}}),Eb=Ab(),Db=e=>{const o={position:"absolute",width:"8px",height:"8px",backgroundColor:"inherit",borderStyle:"inherit",borderWidth:"inherit",borderColor:"inherit",transform:"rotate(45deg)"};switch(e){case"top":return{...o,bottom:"-4px",left:"50%",marginLeft:"-4px",borderTop:"none",borderLeft:"none"};case"right":return{...o,left:"-4px",top:"50%",marginTop:"-4px",borderRight:"none",borderTop:"none"};case"bottom":return{...o,top:"-4px",left:"50%",marginLeft:"-4px",borderBottom:"none",borderRight:"none"};case"left":return{...o,right:"-4px",top:"50%",marginTop:"-4px",borderLeft:"none",borderBottom:"none"};default:return o}},ss=p.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Sn=()=>p.useContext(ss),$b=({value:e,children:o})=>r.jsx(ss.Provider,{value:e,children:o}),cs=p.memo(({children:e,views:o,asChild:t=!1,...n})=>{const{openTooltip:a,closeTooltip:i,triggerRef:s,contentId:c,triggerId:d}=Sn(),u=p.useCallback(()=>a(),[a]),m=p.useCallback(()=>i(),[i]),g=p.useCallback(()=>a(),[a]),h=p.useCallback(()=>i(),[i]),f={ref:s,onMouseEnter:u,onMouseLeave:m,onFocus:g,onBlur:h,id:d,"aria-describedby":c,...o==null?void 0:o.container,...n};return t&&p.isValidElement(e)?p.cloneElement(e,f):r.jsx(l.View,{display:"inline-block",...f,children:e})}),Lb=p.memo(({children:e,views:o,...t})=>{const{isOpen:n,contentRef:a,contentId:i,triggerId:s}=Sn();return n?r.jsx(l.View,{ref:a,id:i,role:"tooltip","aria-labelledby":s,...o==null?void 0:o.container,...t,children:e}):null}),_b=({content:e,children:o,position:t="top",align:n="center",size:a="md",variant:i="default",showArrow:s=!0,views:c,themeMode:d,...u})=>{const{isOpen:m,triggerRef:g,contentRef:h,contentId:f,triggerId:y}=Sn(),{ref:b,relation:k}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[C,j]=p.useState({x:0,y:0,placement:t});p.useEffect(()=>{g!=null&&g.current&&b&&(b.current=g.current)},[g,b,m]),p.useEffect(()=>{if(m&&(h!=null&&h.current)&&(g!=null&&g.current)){const x=g.current.getBoundingClientRect();let v=t;k&&(t==="top"&&k.space.vertical==="bottom"?v="bottom":t==="bottom"&&k.space.vertical==="top"?v="top":t==="right"&&k.space.horizontal==="left"?v="left":t==="left"&&k.space.horizontal==="right"&&(v="right"));let T=0,R=0;switch(v){case"top":T=n==="start"?x.left:n==="end"?x.right-120:x.left+x.width/2-60,R=x.top-8;break;case"bottom":T=n==="start"?x.left:n==="end"?x.right-120:x.left+x.width/2-60,R=x.bottom+8;break;case"right":T=x.right+8,R=n==="start"?x.top:n==="end"?x.bottom-32:x.top+x.height/2-16;break;case"left":T=x.left-8,R=n==="start"?x.top:n==="end"?x.bottom-32:x.top+x.height/2-16;break}j({x:T,y:R,placement:v})}},[m,t,n,g,h,k]);const w=p.useMemo(()=>s?Db(C.placement):{},[s,C.placement]),S=p.useMemo(()=>{const x={position:"fixed",left:C.x,top:C.y,zIndex:1e3};switch(C.placement){case"top":return{...x,transform:"translateY(-100%)"};case"left":return{...x,transform:"translateX(-100%)"};case"bottom":case"right":default:return x}},[C.x,C.y,C.placement]);return r.jsxs(l.View,{position:"relative",display:"inline-block",...c==null?void 0:c.container,...u,children:[r.jsx(cs,{children:o}),m&&r.jsxs(l.View,{ref:h,id:f,role:"tooltip","aria-labelledby":y,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:S,...Vb[a],...Eb[i],...c==null?void 0:c.content,children:[typeof e=="string"?r.jsx(l.Text,{...c==null?void 0:c.text,children:e}):e,s&&r.jsx(l.View,{...w,...c==null?void 0:c.arrow})]})]})},Bb=({content:e,children:o,position:t="top",align:n="center",size:a="md",variant:i="default",openDelay:s=200,closeDelay:c=200,showArrow:d=!0,defaultOpen:u=!1,isDisabled:m=!1,views:g,...h})=>{const f=Pb({defaultOpen:u,openDelay:s,closeDelay:c,isDisabled:m});return r.jsx($b,{value:f,children:r.jsx(_b,{content:e,position:t,align:n,size:a,variant:i,showArrow:d,views:g,...h,children:o})})},Gr=Bb;Gr.Trigger=cs;Gr.Content=Lb;const ds=p.forwardRef((e,o)=>{const t=ql(e);return r.jsx(Kl,{...e,...t})});ds.displayName="ChatInput";const Ob={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},sa={container:{position:"relative",display:"flex",flexDirection:"column",height:"100vh",alignItems:"center",justifyContent:"center"},gradient:{position:"absolute",inset:"-10px",opacity:.5,pointerEvents:"none",filter:"blur(10px)",backgroundSize:"300% 200%",backgroundPosition:"50% 50%, 50% 50%"}},ct={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},image:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundAttachment:"scroll"},content:{position:"relative",width:"100%",height:"100%",zIndex:2}},dt={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},video:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"},content:{position:"relative",zIndex:2}},Nb=p.createContext({}),qb=({children:e,showRadialGradient:o=!0,views:t,themeMode:n,...a})=>{const i={white:"rgba(255,255,255,1)",transparent:"rgba(255,255,255,0)"},s=["rgb(59, 130, 246)","rgb(196, 181, 253)","rgb(147, 197, 253)","rgb(221, 214, 254)","rgb(96, 165, 250)"],c={...sa.gradient,backgroundImage:`
26
+ ${ue}`:ue}let ie=H,ae=!1;H.endsWith("-thinking")&&(ie=H.replace(/-thinking$/,""),ae=!0),n==null||n(ee,{model_name:ie,enable_thinking:ae}),y||k(""),w([]),x([])},A=J=>{w(ee=>ee.filter((ie,ae)=>ae!==J)),!u&&S.length>J&&x(ee=>ee.filter((ie,ae)=>ae!==J))},G=J=>{J.preventDefault(),J.stopPropagation(),F(!0)},Q=J=>{J.preventDefault(),J.stopPropagation(),F(!1)},X=p.useCallback(J=>{!J||J.length===0||(x(ee=>[...ee,...J]),w(ee=>[...ee,...J]),I(ee=>[...ee,...J]),T(!0))},[x,w]),K=p.useCallback(()=>{if(E.length>0&&!V&&f){P(!0);const J=E[0];z.current=J,M(0);try{f(J)}catch(ee){I(ie=>ie.slice(1)),P(!1),z.current=null,M(0),T(ie=>E.length-1>0||!1),h==null||h(ee)}}else E.length===0&&v&&(T(!1),M(0))},[E,V,f,v,h]);p.useEffect(()=>{K()},[E,V,K]);const oe="active",te=J=>!0,re=()=>{N(!1),e.onGuideClose&&e.onGuideClose()},U=J=>{y&&t?t(J.text):k(J.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(J),B.current&&B.current.focus()},Z=p.useCallback(()=>S,[S]),le=p.useCallback(()=>x([]),[]);return{onSubmit:n,getPendingFiles:Z,clearPendingFiles:le,value:C,handleChange:_,handleSubmit:Y,editableRef:B,fileInputRef:$,isUploading:v,uploadProgress:R,isDraggingOver:W,uploadedFiles:j,pendingFiles:S,removeUploadedFile:A,setPendingFiles:x,setUploadedFiles:w,setIsUploading:T,startUpload:X,selectedModel:H,handleModelChange:D,modelOptions:L,subscriptionStatus:oe,canAccessModel:te,handleDragOver:G,handleDragLeave:Q,isGuideTipShown:O,hideGuideTip:re,handlePromptExampleSelect:U}},fh={attachmentRemove:{position:"absolute",top:"2px",right:"2px",width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"color-black-900",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",zIndex:1}},Gn={container:{width:"100%",maxWidth:"100%",borderRadius:"12px",backgroundColor:"color-white",transition:"background-color 0.2s ease, box-shadow 0.2s ease"},content:{width:"100%",padding:"12px",borderRadius:"12px",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"}},yh={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},xh={xs:{fontSize:"10px",padding:"4px 8px"},sm:{fontSize:"12px",padding:"6px 10px"},md:{fontSize:"14px",padding:"8px 12px"},lg:{fontSize:"16px",padding:"10px 14px"},xl:{fontSize:"20px",padding:"12px 16px"}},bh={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"},none:{backgroundColor:"transparent",border:"none"}},Yn=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,kh=({openDelay:e=200,closeDelay:o=300}={})=>{const[t,n]=p.useState(!1),a=p.useRef(null),i=p.useRef(null),s=p.useRef(null),c=p.useRef(null),d=p.useMemo(()=>Yn("hovercard-content"),[]),u=p.useMemo(()=>Yn("hovercard-trigger"),[]),m=p.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),i.current&&(clearTimeout(i.current),i.current=null)},[]),g=p.useCallback(()=>{m(),t||(a.current=setTimeout(()=>{n(!0)},e))},[t,e,m]),h=p.useCallback(()=>{m(),t&&(i.current=setTimeout(()=>{n(!1)},o))},[t,o,m]),f=p.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);return p.useEffect(()=>()=>m(),[m]),{isOpen:t,openCard:g,closeCard:h,cancelCloseTimer:f,triggerRef:s,contentRef:c,contentId:d,triggerId:u}},Ul=p.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Ch=({children:e,value:o})=>r.jsx(Ul.Provider,{value:o,children:e}),Gl=()=>{const e=p.useContext(Ul);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},Sh=({children:e,views:o,asChild:t=!1,...n})=>{const{openCard:a,closeCard:i,triggerRef:s,contentId:c,triggerId:d}=Gl(),f={ref:s,onMouseEnter:()=>a(),onMouseLeave:()=>i(),onFocus:()=>a(),onBlur:()=>i(),id:d,"aria-describedby":c,...o==null?void 0:o.container,...n};if(t&&p.isValidElement(e)){const y=p.Children.only(e);return p.cloneElement(y,{...f,...y.props})}return r.jsx(l.View,{position:"relative",display:"inline-block",...f,children:e})},jh=({children:e,views:o,side:t="bottom",align:n="center",sideOffset:a=8,style:i,backgroundColor:s="color-white",borderRadius:c="4px",boxShadow:d="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:u="12px",minWidth:m="50px",maxWidth:g="300px",...h})=>{const{isOpen:f,cancelCloseTimer:y,closeCard:b,contentRef:k,triggerRef:C,contentId:j,triggerId:w}=Gl(),{ref:S,relation:x}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});p.useEffect(()=>{C!=null&&C.current&&(S==null?void 0:S.current)!==C.current&&S&&(S.current=C.current)},[C,S,f]);const v=()=>y(),T=()=>b();if(!f)return null;const R=()=>{if(!x||!(C!=null&&C.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const I=C.current.getBoundingClientRect();let V=t;t==="bottom"&&x.space.vertical==="top"?V="top":t==="top"&&x.space.vertical==="bottom"?V="bottom":t==="right"&&x.space.horizontal==="left"?V="left":t==="left"&&x.space.horizontal==="right"&&(V="right");let P=0,z=0;switch(V){case"bottom":P=I.left+I.width/2,z=I.bottom+a;break;case"top":P=I.left+I.width/2,z=I.top-a;break;case"right":P=I.right+a,z=I.top+I.height/2;break;case"left":P=I.left-a,z=I.top+I.height/2;break}return{position:"fixed",left:P,top:z,zIndex:1e3,transform:M(V)}},M=I=>{switch(I){case"bottom":return"translate(-50%, 0)";case"top":return"translate(-50%, -100%)";case"right":return"translate(0, -50%)";case"left":return"translate(-100%, -50%)";default:return"translate(-50%, 0)"}},E=R();return r.jsx(l.View,{ref:k,id:j,role:"tooltip","aria-labelledby":w,onMouseEnter:v,onMouseLeave:T,backgroundColor:s,borderRadius:c,boxShadow:d,padding:u,minWidth:m,maxWidth:g,style:{...E,...i},...o==null?void 0:o.container,...h,children:e})},wh=({children:e,views:o,openDelay:t,closeDelay:n,...a})=>{const i=kh({openDelay:t,closeDelay:n});return r.jsx(Ch,{value:i,children:r.jsx(l.View,{position:"relative",display:"inline-block",...o==null?void 0:o.container,...a,children:e})})},Se=wh;Se.Trigger=Sh;Se.Content=jh;const vh=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:a="120px",showPreviews:i=!1,views:s={}})=>{if(e.length===0)return null;const c=p.useCallback(u=>u<1024?`${u} B`:u<1024*1024?`${(u/1024).toFixed(1)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`,[]),d=p.useCallback(u=>u.type.startsWith("image/")?{backgroundColor:"#DBEAFE",color:"#2563EB"}:u.type.startsWith("video/")?{backgroundColor:"#EDE9FE",color:"#7C3AED"}:u.type.startsWith("audio/")?{backgroundColor:"#DCFCE7",color:"#16A34A"}:{backgroundColor:"#E2E8F0",color:"#475569"},[]);return r.jsx(l.View,{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 0",maxHeight:a,overflowY:"auto",...s==null?void 0:s.container,children:e.map((u,m)=>{const g=(u==null?void 0:u.path)||(u==null?void 0:u.url)||(i?URL.createObjectURL(u):""),h=u.type.startsWith("image/"),f=u.type.startsWith("video/"),y=u.type.startsWith("audio/"),b=d(u);return i?r.jsx(l.Vertical,{alignItems:"center",gap:"6px",padding:"6px 10px",borderRadius:"8px",border:"1px solid #E2E8F0",backgroundColor:"color-white",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...s==null?void 0:s.item,children:i&&r.jsxs(Se,{children:[r.jsxs(Se.Trigger,{children:[h&&r.jsx(l.Image,{src:g,alt:u.name,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),f&&r.jsx(l.View,{as:"video",src:g,alt:u.name,controls:!1,muted:!0,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),y&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(Ro,{widthHeight:24,color:"color-black"})}),!h&&!f&&!y&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(ao,{widthHeight:24,color:"color-black"})}),t&&r.jsx(l.Button,{...fh.attachmentRemove,onClick:k=>{k.stopPropagation(),t(m)},"aria-label":`Remove ${u.name}`,children:"×"})]}),r.jsxs(Se.Content,{children:[h&&r.jsx(l.Image,{src:g,alt:u.name,maxWidth:"100%"}),f&&r.jsx(l.View,{as:"video",src:g,controls:!0,maxWidth:"100%"}),y&&r.jsx(l.View,{as:"audio",src:g,controls:!0,width:"100%"}),r.jsxs(l.Text,{marginTop:"4px",maxLines:1,width:"100%",...s==null?void 0:s.name,children:[u.name," (",c(u.size),")"]})]})]})},m):r.jsxs(l.Horizontal,{alignItems:"center",gap:"8px",padding:"6px 10px 6px 8px",borderRadius:"9999px",border:"1px solid #E2E8F0",backgroundColor:"color-white",maxWidth:"100%",animate:{from:{opacity:0,scale:.96},to:{opacity:1,scale:1}},animationDuration:.2,...s==null?void 0:s.item,children:[r.jsx(l.Center,{width:"22px",height:"22px",minWidth:"22px",borderRadius:"9999px",backgroundColor:b.backgroundColor,color:b.color,children:y?r.jsx(Ro,{widthHeight:12,color:"currentColor"}):r.jsx(ao,{widthHeight:12,color:"currentColor"})}),r.jsxs(l.Text,{fontSize:"12px",lineHeight:"16px",color:"color-gray-600",maxLines:1,maxWidth:"220px",...s==null?void 0:s.name,children:[u.name," · ",c(u.size)]}),t&&r.jsx(l.View,{as:"button",type:"button",onClick:()=>t(m),"aria-label":`Remove ${u.name}`,display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",minWidth:"16px",border:"none",backgroundColor:"transparent",color:"color-gray-400",padding:0,cursor:"pointer",transition:"color 0.2s ease, opacity 0.2s ease",_hover:{color:"color-gray-600"},children:"×"})]},m)})})},Yl=p.forwardRef(({value:e,onChange:o,placeholder:t="Type your message...",disabled:n=!1,autoFocus:a=!0,suggestions:i=[],onSuggestionSelect:s,showSuggestions:c=!1,mentionData:d=[],mentionTrigger:u="@",onMentionSelect:m,maxHeight:g="200px",minHeight:h="40px",views:f={}},y)=>{var te,re;const b=p.useRef(e),[k,C]=p.useState(-1),[j,w]=p.useState(!e),S=p.useRef(null),[x,v]=p.useState(!1),[T,R]=p.useState(!1),[M,E]=p.useState(""),[I,V]=p.useState(-1),[P,z]=p.useState(-1),[W,F]=p.useState([]),{ref:H,relation:D}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[L,B]=p.useState({x:0,y:0}),[$,O]=p.useState({x:0,y:0});p.useEffect(()=>{const U=y;U.current&&e!==b.current&&(U.current.textContent=e,b.current=e,w(!e))},[e,y]),p.useEffect(()=>{a&&y&&typeof y=="object"&&y.current&&y.current.focus()},[a,y]);const N=()=>{const U=window.getSelection();if(!U||U.rangeCount===0)return-1;const Z=U.getRangeAt(0),le=Z.cloneRange();return le.selectNodeContents(y&&typeof y=="object"&&y.current?y.current:document.body),le.setEnd(Z.endContainer,Z.endOffset),le.toString().length},_=p.useCallback((U,Z)=>{const le=U.substring(0,Z),J=le.lastIndexOf(u);if(J!==-1){const ee=le.substring(J+1);if(!ee.includes(" ")){const ae=ee.toLowerCase(),ue=d.filter(Ve=>Ve.name.toLowerCase().includes(ae));E(ae),V(J),F(ue),R(ue.length>0),z(0);const Re=Y();B(Re);return}}R(!1),E(""),V(-1),z(-1)},[d,u]);p.useEffect(()=>{S.current&&H&&(H.current=S.current)},[S,H]);const Y=p.useCallback((U=200)=>{if(!S.current)return{x:0,y:0};const Z=S.current.getBoundingClientRect();if(D){const ie=D.space.vertical==="top";return{x:Z.left,y:ie?Z.top-U-8:Z.bottom+8}}const le=window.innerHeight,J={top:Z.top,bottom:le-Z.bottom},ee=J.bottom<U+8&&J.top>J.bottom;return{x:Z.left,y:ee?Z.top-U-8:Z.bottom+8}},[D]),A=p.useCallback(()=>{v(!0);const U=Y();O(U)},[Y]),G=p.useCallback(()=>{setTimeout(()=>{v(!1),C(-1)},150)},[]),Q=U=>{const Z=U.currentTarget.textContent||"";if(Z!==b.current){o(Z),b.current=Z,w(!Z);const le=N();_(Z,le)}},X=p.useCallback(U=>{if(y&&typeof y=="object"&&y.current){const Z=y.current.textContent||"",le=Z.substring(0,I),J=Z.substring(I+u.length+M.length),ee=le+u+U.name+" "+J;o(ee),b.current=ee,y.current.textContent=ee;const ie=le.length+u.length+U.name.length+1;setTimeout(()=>{var ae;if(y.current){const ue=document.createRange(),Re=window.getSelection(),Ve=y.current.firstChild;Ve&&Re&&(ue.setStart(Ve,Math.min(ie,((ae=Ve.textContent)==null?void 0:ae.length)||0)),ue.collapse(!0),Re.removeAllRanges(),Re.addRange(ue))}},0)}R(!1),E(""),V(-1),z(-1),m&&m(U)},[I,u,M,o,m,y]),K=p.useCallback(U=>{s&&s(U),C(-1)},[s]),oe=U=>{if(T&&W.length>0){if(U.key==="ArrowDown"){U.preventDefault(),z(Z=>Z<W.length-1?Z+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),z(Z=>Z>0?Z-1:W.length-1);return}if((U.key==="Tab"||U.key==="Enter")&&P>=0){U.preventDefault(),X(W[P]);return}if(U.key==="Escape"){R(!1),z(-1);return}}if(c&&i.length>0){if(U.key==="ArrowDown"){U.preventDefault(),C(Z=>Z<i.length-1?Z+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),C(Z=>Z>0?Z-1:i.length-1);return}if(U.key==="Tab"&&k>=0){U.preventDefault(),K(i[k]);return}if(U.key==="Escape"){C(-1);return}}};return r.jsxs(l.View,{ref:S,width:"100%",position:"relative",...f==null?void 0:f.container,children:[r.jsxs(l.View,{width:"100%",minHeight:h,maxHeight:g,overflowY:"auto",position:"relative",children:[j&&r.jsx(l.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...f==null?void 0:f.placeholder,children:t}),r.jsx(l.View,{as:"div",ref:y,contentEditable:!n,suppressContentEditableWarning:!0,onInput:Q,onKeyDown:oe,onFocus:A,onBlur:G,role:"textbox","aria-multiline":"true","aria-placeholder":t,width:"100%",minHeight:"24px",padding:"8px",outline:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"14px",color:"color-gray-900",backgroundColor:"transparent",...f==null?void 0:f.input})]}),T&&W.length>0&&r.jsx(l.View,{position:"fixed",left:L.x,top:L.y,width:((te=S.current)==null?void 0:te.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-blue-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9999,maxHeight:"200px",overflowY:"auto",...f==null?void 0:f.mentionContainer,children:r.jsxs(l.Vertical,{gap:0,children:[W.map((U,Z)=>r.jsx(l.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:Z===P?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>X(U),onMouseEnter:()=>z(Z),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.mentionItem,children:r.jsxs(l.Vertical,{gap:4,children:[r.jsxs(l.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[u,U.name]}),U.description&&r.jsx(l.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",u,")",D&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",D.space.vertical,"-",D.space.horizontal]})]})]})}),c&&i.length>0&&!T&&x&&!e&&r.jsx(l.View,{position:"fixed",left:$.x,top:$.y,width:((re=S.current)==null?void 0:re.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-green-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9998,maxHeight:"200px",overflowY:"auto",...f==null?void 0:f.suggestionsContainer,children:r.jsxs(l.Vertical,{gap:0,children:[i.map((U,Z)=>r.jsx(l.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:Z===k?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>K(U),onMouseEnter:()=>C(Z),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.suggestionItem,children:r.jsxs(l.Vertical,{gap:4,children:[r.jsx(l.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:U.text}),U.description&&r.jsx(l.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",D&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",D.space.vertical,"-",D.space.horizontal]})]})]})})]})});Yl.displayName="EditableInput";const Th=({examples:e,onSelect:o,views:t={}})=>{const{getColor:n}=l.useTheme();return!e||e.length===0?null:r.jsx(l.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...t==null?void 0:t.container,children:e.map(a=>r.jsx(l.View,{as:"button",type:"button",padding:"8px 12px",borderRadius:"9999px",backgroundColor:"color-white",border:"1px solid #E2E8F0",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease",onClick:()=>o(a),_hover:{backgroundColor:"#F8FAFC",borderColor:"#CBD5E1"},...t==null?void 0:t.item,children:r.jsx(l.Text,{fontSize:"14px",color:"color-gray-700",...t==null?void 0:t.text,children:a.text})},a.id))})},Ih=({onRecordingComplete:e,onRecordingStart:o,views:t={}})=>{const{recording:n,paused:a,audioBlob:i,analyserNode:s,startRecording:c,stopRecording:d}=Ya();p.useEffect(()=>{if(i){const m=new File([i],`recording-${Date.now()}.webm`,{type:i.type||"audio/webm;codecs=opus"});e(m)}},[i]);const u=p.useCallback(()=>{c(),o==null||o()},[]);return r.jsxs(l.Horizontal,{alignItems:"center",gap:4,children:[r.jsx(l.View,{minWidth:90,children:n&&s&&r.jsx(Kt,{analyserNode:s,isPaused:a})}),r.jsx(l.View,{as:"button",type:"button",onClick:n?d:u,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n?"theme-error":"color-gray-100",color:n?"color-white":"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:n?"color-red-600":"color-gray-200"},...t.button,children:n?r.jsx(Er,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(_t,{widthHeight:16,color:"currentColor",filled:!1})})]})},Kl=p.memo(({onSubmit:e,placeholder:o="Type your message… use @ to mention",loading:t=!1,disabled:n=!1,isAgentRunning:a=!1,enableAudioRecording:i=!1,leftButtons:s,rightButtons:c,onStopAgent:d,loadingText:u="Agent is working...",autoFocus:m=!0,sandboxId:g,hideAttachments:h=!1,attachmentText:f="",promptExamples:y=[],suggestions:b=[],errorMessage:k,size:C="md",shape:j="rounded",variant:w="default",views:S={},mentionData:x=[],mentionTrigger:v="@",onMentionSelect:T,onAudioRecordingStart:R,onAudioRecordingStop:M,showGuideTip:E,guideVideoUrl:I,onGuideClose:V,onFileBrowse:P,onUploadProgress:z,onUploadSuccess:W,onUploadError:F,onFileUpload:H,onPromptExampleSelect:D,value:L,handleChange:B,handleSubmit:$,editableRef:O,fileInputRef:N,isUploading:_,uploadProgress:Y,isDraggingOver:A,uploadedFiles:G,pendingFiles:Q,getPendingFiles:X,clearPendingFiles:K,removeUploadedFile:oe,setPendingFiles:te,setUploadedFiles:re,setIsUploading:U,startUpload:Z,selectedModel:le,handleModelChange:J,modelOptions:ee,subscriptionStatus:ie,canAccessModel:ae,isGuideTipShown:ue,hideGuideTip:Re,handlePromptExampleSelect:Ve,handleDragOver:Xr,handleDragLeave:Do,onChange:Tn,...Le})=>{l.useTheme();const go=p.useMemo(()=>({...Gn.container,...yh[j],...S==null?void 0:S.container}),[j,S==null?void 0:S.container]),Jr=p.useMemo(()=>({...Gn.content,...xh[C],...bh[w],...S==null?void 0:S.content}),[C,w,S==null?void 0:S.content]),$o=((L==null?void 0:L.trim().length)??0)>0||G.length>0,js=p.useCallback(be=>{Z([be]),M==null||M(be)},[Z,M]),Qr=p.useCallback(be=>{const ho=be.filter(In=>In.size>52428800?(console.error(`File size exceeds 50MB limit: ${In.name}`),!1):!0);ho.length>0&&Z(ho)},[Z]),ws=p.useCallback(be=>{if(be.preventDefault(),be.stopPropagation(),Do(be),be.dataTransfer.files.length>0){const ho=Array.from(be.dataTransfer.files);Qr(ho)}},[Do,Qr]),vs=p.useMemo(()=>[...x||[],...G.map((be,ho)=>({id:`file-${ho}`,name:be.name}))],[x,G]);return r.jsxs(l.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...go,...Le,onDragOver:Xr,onDragLeave:Do,onDrop:ws,children:[y.length>0&&r.jsx(Th,{examples:y,onSelect:Ve,views:{container:S==null?void 0:S.promptExamples,item:S==null?void 0:S.promptExampleItem}}),a&&r.jsxs(l.Horizontal,{justifyContent:"center",alignItems:"center",gap:8,padding:"8px 0",animate:{from:{opacity:0,y:-10},to:{opacity:1,y:0},duration:"0.3s"},...S==null?void 0:S.loadingIndicator,children:[r.jsx(Ot,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(l.Text,{color:"color-gray-500",children:u})]}),r.jsx(l.View,{position:"relative",width:"100%",overflow:"visible",children:r.jsxs(l.View,{as:"form",onSubmit:$,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...Jr,...go,paddingHorizontal:16,paddingVertical:10,backgroundColor:A?"color-blue-50":void 0,children:[r.jsx(vh,{files:G,sandboxId:g,onRemove:oe,showPreviews:!0,views:{container:S==null?void 0:S.attachments,item:S==null?void 0:S.attachmentItem,name:S==null?void 0:S.attachmentName,size:S==null?void 0:S.attachmentSize,removeButton:S==null?void 0:S.attachmentRemove}}),r.jsx(Yl,{ref:O,value:L||"",onChange:B,placeholder:o,disabled:n&&!a,autoFocus:m,suggestions:b||[],showSuggestions:b&&b.length>0&&!L,onSuggestionSelect:be=>{B(be.text)},mentionData:vs,mentionTrigger:v,onMentionSelect:T,views:{container:{},input:S==null?void 0:S.editableInput}}),r.jsxs(l.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[r.jsxs(l.Horizontal,{gap:8,alignItems:"center",children:[!h&&r.jsx(Lr,{accept:"*/*",icon:r.jsx(er,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:Qr,isLoading:_,progress:Y||0,text:f,fileType:"file",renderError:({errorMessage:be})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...S==null?void 0:S.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:j==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:be=>be.size>50*1024*1024?"File size exceeds 50MB limit":null}),s]}),r.jsxs(l.Horizontal,{gap:8,alignItems:"center",children:[i&&r.jsx(Ih,{onRecordingStart:R,onRecordingComplete:js,views:{button:S==null?void 0:S.recordButton}}),r.jsx(l.View,{as:"button",type:"button",onClick:$,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:a?"theme-error":$o?"theme-primary":"color-gray-300",color:"color-white",borderRadius:j==="rounded"?"50%":4,border:"none",cursor:$o?"pointer":"not-allowed",disabled:!$o||t||n&&!a,transition:"background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease",_hover:{opacity:$o||a?.9:1},_active:{opacity:$o||a?.95:1},_focusVisible:{outline:"none",boxShadow:"0 0 0 2px white, 0 0 0 4px theme-primary"},...S==null?void 0:S.submitButton,children:a?r.jsx(Er,{widthHeight:16,color:"currentColor",filled:!1}):t?r.jsx(Je,{type:"quarter",size:16,color:"color-white"}):r.jsx(Bt,{widthHeight:16,color:"currentColor",filled:!1})}),c]})]})]})}),k&&r.jsx(l.Text,{color:"theme-error",marginTop:"4px",...S==null?void 0:S.bottomTip,children:k})]})}),Fh=e=>{const{name:o,onSubmit:t,...n}=e,[a,i]=p.useState([]),s=fe({name:o,type:"text"}),c=h=>{s.onChangeText&&s.onChangeText(h)},d=(h,f)=>{t?t(h,f):c(h)},u=()=>a,m=()=>i([]),g=ql({...n,value:s.value||"",onChange:c,onSubmit:d});return r.jsx(Kl,{...n,...g,value:s.value||"",onChange:c,onSubmit:d,error:s.error,getPendingFiles:u,clearPendingFiles:m})},Rh=Fh,zh=e=>{const o=fe(e),t=vl(o);return r.jsx(Tl,{...t,...o})},Mh=zh,Wh=e=>{const o=fe(e),t=Wl();return r.jsx(Hl,{...t,...o})},Hh=Wh,Ph=e=>{const o=fe(e),t=Il(e);return r.jsx(Fl,{...t,...o})},Vh=Ph,Ah=e=>{let o=fe(e);o.selected=o.value;const t=gl(e);return r.jsx(fl,{...t,...o})},Eh=Ah,Dh=e=>{const o=fe(e),t=yl(e);return r.jsx(xl,{...t,...o})},$h=Dh,Lh=e=>{const{name:o,...t}=e,{values:n,errors:a,touched:i,submitCount:s,setFieldValue:c,setFieldTouched:d}=He.useFormikContext(),u=He.getIn(n,o)||[],m=He.getIn(i,o)||s>0?He.getIn(a,o):void 0,g=p.useCallback(k=>{var j;const C=Array.isArray(k)?k.filter(w=>typeof w=="string"):[];c(o,C),(j=e.onTagsChange)==null||j.call(e,C)},[o,c,e.onTagsChange]),h=p.useCallback(()=>{var k;d(o,!0),(k=e.onBlur)==null||k.call(e)},[o,d,e.onBlur]),f=El({...t,tags:u,onTagsChange:g,onBlur:h}),{tags:y,...b}=f;return r.jsx(Dl,{...b,...t,tags:y,error:m})},_h=Lh,Bh=e=>{const o=fe(e),t=Cl(e);return r.jsx(Sl,{...t,...o})},Oh=Bh,Nh=e=>{const o=fe(e,{focusable:!0}),{value:t,...n}=ln(e);return r.jsx(nr,{...n,...o})},qh=Nh,Uh=({visibleIcon:e=r.jsx(qt,{widthHeight:14}),hiddenIcon:o=r.jsx(Nt,{widthHeight:14}),...t})=>{const n=fe(t,{focusable:!0}),{isVisible:a,setIsVisible:i,...s}=Pl(n);return r.jsx(nr,{...s,type:a?"text":"password",isClearable:!1,right:r.jsx(l.View,{onClick:()=>{t.isDisabled||i(!a)},children:a?e:o})})},Gh=Uh,Yh=({items:e,placeholder:o,searchPlaceholder:t,isMulti:n=!1,...a})=>{const i=fe(a),s=Vl(e,o,t);p.useEffect(()=>{if(n&&Array.isArray(i.value))s.setSelectedItems(i.value);else if(!n&&i.value){const d=typeof i.value=="object"?i.value:e.find(u=>u.value===i.value);d&&s.setSelectedItem(d)}},[i.value,n,e]);const c=d=>{i.onChange(d)};return r.jsx(Al,{...s,...i,items:e,placeholder:o,isMulti:n,onSelect:c})},Kh=Yh,To=(e,o,t)=>Math.min(Math.max(e,o),t),Xh=(e,o,t,n,a,i,s)=>{const c=n-t;let d;if(i==="horizontal"){const u=o.width,m=e-o.left;d=To(m/u,0,1)}else{const u=o.height,m=o.bottom-e;d=To(m/u,0,1)}if(s&&s.length>0){const u=t+d*c;let m=s[0],g=Math.abs(u-m);for(let h=1;h<s.length;h++){const f=Math.abs(u-s[h]);f<g&&(g=f,m=s[h])}return m}else{const u=t+d*c,m=Math.round(u/a)*a;return To(m,t,n)}},Xl=({min:e=0,max:o=100,step:t=1,value:n,defaultValue:a,onChange:i,onDrag:s,orientation:c="horizontal",isDisabled:d=!1,stepValues:u})=>{const m=To(n??a??e,e,o),[g,h]=p.useState(m),[f,y]=p.useState(!1),[b,k]=p.useState(!1),C=p.useRef(null),j=p.useRef(null),w=n!==void 0,S=n!==void 0?n:g;p.useEffect(()=>{n!==void 0&&h(To(n,e,o))},[n,e,o]);const x=p.useCallback(V=>{const P=To(V,e,o);w||h(P),i&&P!==S&&i(P),f&&s&&s(P)},[w,e,o,i,S,f,s]),v=p.useCallback(V=>{if(d||!C.current)return;const P=C.current;if(typeof P.getBoundingClientRect!="function")return;const z=P.getBoundingClientRect();let W;"touches"in V?W=c==="horizontal"?V.touches[0].clientX:V.touches[0].clientY:W=c==="horizontal"?V.clientX:V.clientY;const F=Xh(W,z,e,o,t,c,u);x(F)},[e,o,t,c,x,d,u]),T=p.useCallback(V=>{if(d)return;V.preventDefault(),y(!0),v(V);const P=W=>{v(W)},z=()=>{y(!1),document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",z),document.removeEventListener("touchmove",P),document.removeEventListener("touchend",z)};typeof(document==null?void 0:document.addEventListener)=="function"&&(document.addEventListener("mousemove",P),document.addEventListener("mouseup",z),document.addEventListener("touchmove",P),document.addEventListener("touchend",z))},[v,d]),R=p.useCallback(V=>{const P=j.current;P&&typeof P.contains=="function"&&P.contains(V.target)||T(V)},[T]),M=p.useCallback(V=>{if(d)return;let P=S;switch(V.key){case"ArrowLeft":case"ArrowDown":P=S-t;break;case"ArrowRight":case"ArrowUp":P=S+t;break;case"Home":P=e;break;case"End":P=o;break;default:return}V.preventDefault(),x(P)},[S,e,o,t,x,d]),E=o-e,I=E===0?0:(S-e)/E*100;return{currentValue:S,isDragging:f,isHovered:b,setIsHovered:k,trackRef:C,thumbRef:j,handleThumbMouseDown:T,handleTrackMouseDown:R,handleKeyDown:M,thumbPositionPercent:I}},Kn={xs:{height:4,width:"100%"},sm:{height:6,width:"100%"},md:{height:8,width:"100%"},lg:{height:10,width:"100%"},xl:{height:12,width:"100%"}},Xn={xs:{width:12,height:12},sm:{width:16,height:16},md:{width:20,height:20},lg:{width:24,height:24},xl:{width:28,height:28}},Jn={square:0,rounded:4,pill:24},Jh=e=>({default:{backgroundColor:"color-gray-200",transition:"background-color 0.15s ease"},outline:{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-300",style:{backgroundColor:"transparent"},transition:"border-color 0.15s ease"}}),Qn=Jh(),Qh={xs:{trackCrossAxisSize:4,thumbSize:12},sm:{trackCrossAxisSize:6,thumbSize:16},md:{trackCrossAxisSize:8,thumbSize:20},lg:{trackCrossAxisSize:10,thumbSize:24},xl:{trackCrossAxisSize:12,thumbSize:28}},Zh={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},ef=e=>typeof e=="string"&&(/^(#|rgb\(|rgba\(|hsl\(|hsla\(|var\()/.test(e)||["black","currentColor","inherit","transparent","white"].includes(e)),No=(e,o)=>ef(o)?{style:{[e]:o}}:{[e]:o},Jl=p.memo(({min:e=0,max:o=100,step:t=1,currentValue:n,stepValues:a,shape:i="rounded",size:s="md",variant:c="default",orientation:d="horizontal",isDisabled:u=!1,showValue:m=!1,showTooltip:g=!1,backgroundColor:h="theme-primary",label:f,helperText:y,themeMode:b,shadow:k={},isDragging:C,isHovered:j,setIsHovered:w,trackRef:S,thumbRef:x,handleThumbMouseDown:v,handleTrackMouseDown:T,handleKeyDown:R,thumbPositionPercent:M,ariaLabel:E="Slider",views:I={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:V,onDrag:P,value:z,defaultValue:W,...F})=>{var A,G;const H=h,D="theme-disabled",L=Qn[c].backgroundColor,B=u?D:H,$=d==="vertical",{trackCrossAxisSize:O,thumbSize:N}=Qh[s]||{trackCrossAxisSize:Kn[s].height,thumbSize:Xn[s].width||16},_=r.jsxs(l.Vertical,{width:"100%",gap:8,...I.container,...F,children:[f&&r.jsxs(l.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[r.jsx(l.Text,{fontSize:14,fontWeight:500,...I.label,children:f}),m&&r.jsx(l.Text,{fontSize:14,color:"color-gray-500",...I.valueLabel,children:n})]}),r.jsxs(l.View,{ref:S,position:"relative",cursor:u?"not-allowed":"pointer",opacity:u?.6:1,onMouseDown:T,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),...Kn[s],borderRadius:Jn[i],backgroundColor:L,...Qn[c],...k,...I.track,children:[a&&a.length>0&&r.jsx(r.Fragment,{children:a.map(Q=>{const X=(Q-e)/(o-e)*100;return r.jsx(l.View,{position:"absolute",top:"50%",left:`${X}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",zIndex:1,...No("backgroundColor",B),...I.stepMarks},Q)})}),r.jsx(l.View,{position:"absolute",top:0,left:0,height:"100%",width:`${M}%`,borderRadius:Jn[i],transition:"width 0.1s ease-in-out",...No("backgroundColor",B),...I.progress,...I.filledTrack}),r.jsx(l.View,{ref:x,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":d,"aria-disabled":u,"aria-label":E,position:"absolute",top:"50%",left:`${M}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",borderWidth:2,borderStyle:"solid",transition:C?"none":"transform 0.1s ease-in-out",...No("borderColor",B),transform:j?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:v,onTouchStart:v,onKeyDown:R,...Xn[s],...I.thumb,children:g&&(j||C)&&r.jsx(l.View,{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:8,padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:4,fontSize:12,whiteSpace:"nowrap",zIndex:3,...I.tooltip,children:r.jsx(l.Text,{...(A=I.tooltip)==null?void 0:A.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),y&&r.jsx(Ct,{children:y})]}),Y=r.jsxs(l.Center,{...Zh[d],position:"relative",onMouseEnter:()=>!u&&w(!0),onMouseLeave:()=>!u&&w(!1),...F,...I==null?void 0:I.container,children:[f&&r.jsxs(l.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[r.jsx(l.Text,{fontSize:14,fontWeight:500,...I.label,children:f}),m&&r.jsx(l.Text,{fontSize:14,color:"color-gray-500",...I.valueLabel,children:n})]}),r.jsxs(l.View,{ref:S,position:"relative",borderRadius:O/2,backgroundColor:u?D:L,cursor:u?"not-allowed":"pointer",width:$?`${O}px`:"100%",height:$?"100%":`${O}px`,onMouseDown:T,onTouchStart:T,...I==null?void 0:I.track,children:[a&&a.length>0&&r.jsx(r.Fragment,{children:a.map(Q=>{const X=(Q-e)/(o-e)*100;return r.jsx(l.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:B,zIndex:1,...$?{bottom:`${X}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${X}%`,top:"50%",transform:"translate(-50%, -50%)"},...I.stepMarks},Q)})}),r.jsx(l.View,{position:"absolute",borderRadius:O/2,...$?{bottom:0,left:0,width:"100%",height:`${M}%`}:{top:0,left:0,height:"100%",width:`${M}%`},...No("backgroundColor",B),...I==null?void 0:I.filledTrack,...I==null?void 0:I.progress}),r.jsx(l.View,{ref:x,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":d,"aria-disabled":u,"aria-label":E,position:"absolute",width:`${N}px`,height:`${N}px`,borderRadius:"50%",borderWidth:2,borderStyle:"solid",borderColor:"color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:u?"not-allowed":"grab",transform:$?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:C?"none":"left 0.1s, bottom 0.1s",...No("backgroundColor",B),...$?{left:"50%",bottom:`${M}%`}:{top:"50%",left:`${M}%`},onMouseDown:v,onTouchStart:v,onKeyDown:R,...I==null?void 0:I.thumb,children:g&&(j||C)&&r.jsx(l.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...$?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...I==null?void 0:I.tooltip,children:r.jsx(l.Text,{...(G=I==null?void 0:I.tooltip)==null?void 0:G.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),y&&r.jsx(Ct,{marginTop:8,children:y})]});return $||g?Y:_}),of=e=>{const o=fe(e),t=Xl({...e,value:o.value!==void 0?Number(o.value):void 0,onChange:n=>{var a;o.onChange(n),(a=e.onChange)==null||a.call(e,n)}});return r.jsx(Jl,{...e,...t,...o})},rf=of,Zn=e=>{if(e==null)return"";if(typeof e=="string"||typeof e=="number"){const o=String(e);return o==="[object Object]"?"":o}return""},lt=(e,o)=>{console.log(`[FormikOTPInput] ${e}`,o)},tf=e=>e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:Object.prototype.toString.call(e),nf=e=>{const o=fe(e),t=Zn(o.value).slice(0,e.length||6);lt("render",{name:e.name,type:e.type,formValue:tf(o.value),displayValue:t,length:e.length||6,hasFormikOnChange:!!o.onChange,hasFormikOnChangeText:!!o.onChangeText});const{isFocused:n,setIsFocused:a,isHovered:i,setIsHovered:s,inputRef:c,containerRef:d,mirrorSelectionStart:u,mirrorSelectionEnd:m,setMirrorSelectionStart:g,setMirrorSelectionEnd:h,setInputRef:f,handleFocus:y,handleBlur:b,handleKeyDown:k,handlePaste:C}=$l(e),j=p.useCallback(S=>{const x=Zn(S).slice(0,e.length||6);lt("setValue",{name:e.name,incomingValue:S,nextValue:x,hasFormikOnChange:!!o.onChange,hasFormikOnChangeText:!!o.onChangeText}),o.onChange&&o.onChange(x),o.onChangeText&&o.onChangeText(x),e.onComplete&&x.length===(e.length||6)&&e.onComplete(x),c.current&&(c.current.value=x)},[o,e,c]),w=p.useCallback(S=>{var T,R,M;const x=typeof S=="string"?S:((T=S==null?void 0:S.currentTarget)==null?void 0:T.value)??((R=S==null?void 0:S.target)==null?void 0:R.value)??((M=S==null?void 0:S.nativeEvent)==null?void 0:M.text)??"",v=String(x).slice(0,e.length||6);lt("handleChange normalized",{name:e.name,raw:x,newValue:v}),j(v),c.current&&(c.current.value=v)},[e.length,j,c]);return r.jsx(Ll,{...e,...o,value:t,setValue:j,isFocused:n,setIsFocused:a,isHovered:i,setIsHovered:s,inputRef:c,containerRef:d,mirrorSelectionStart:u,mirrorSelectionEnd:m,setMirrorSelectionStart:g,setMirrorSelectionEnd:h,setInputRef:f,handleChange:w,handleFocus:y,handleBlur:b,handleKeyDown:k,handlePaste:C,stepValues:e.stepValues})},af=nf,lf=e=>Array.isArray(e)?e:e==null?[]:[e],Ql=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:n,transformResponse:a,onMultipleFileSelect:i,onFileSelect:s,multiple:c=!0,...d})=>{const{setFieldValue:u,setFieldTouched:m,values:g}=He.useFormikContext(),[h,f]=p.useState(!1),[y,b]=p.useState(0),k=p.useCallback(async w=>{if(!w||w.length===0)return;m(e,!0,!0),f(!0);const S=[];for(const x of w){b(0);try{const v=await o(x,R=>{b(R??0)}),T=a?a(v,x):v;S.push(T),t==null||t(x,T)}catch(v){n==null||n(x,v)}}if(S.length>0){const x=lf(He.getIn(g,e));u(e,[...x,...S],!0),b(100)}else b(0);f(!1)},[e,n,t,m,u,a,o,g]),C=p.useCallback(async w=>{i==null||i(w),await k(w)},[k,i]),j=p.useCallback(async w=>{s==null||s(w),await k([w])},[k,s]);return r.jsx(Lr,{...d,multiple:c,onMultipleFileSelect:c?C:void 0,onFileSelect:c?void 0:j,isLoading:h,progress:y})};Ql.displayName="FormikUploader";const sf=e=>{let o=fe(e);o.selected=o.value;const t=bl(e);return r.jsx(kl,{...t,...o})},cf=sf,Zl=e=>{const[o,t]=p.useState(!1),[n,a]=p.useState(e);return{isHovered:o,setIsHovered:t,isToggle:n,setIsToggled:a}},df={square:0,rounded:8,pill:999},uf=(e,o)=>({outline:{backgroundColor:"color-white",color:e,borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",_hover:{backgroundColor:"color-gray-50",borderColor:"color-gray-300"},_active:{backgroundColor:"color-gray-100"},transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"},ghost:{backgroundColor:"transparent",color:e,borderWidth:0,borderStyle:"none",borderColor:"transparent",_hover:{backgroundColor:"color-gray-50"},_active:{backgroundColor:"color-gray-100"},transition:"background-color 0.2s ease, color 0.2s ease"},link:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"1px",textDecorationThickness:"1px",_hover:{opacity:.8},_active:{opacity:.9},transition:"opacity 0.2s ease"}}),ei=p.memo(({children:e,shape:o="rounded",variant:t="ghost",isHovered:n,setIsHovered:a,isDisabled:i,isToggle:s,setIsToggled:c,onToggle:d,views:u,backgroundColor:m,color:g,themeMode:h,...f})=>{const{getColor:y,themeMode:b}=l.useTheme(),k=h??b,j=y(i?"theme-disabled":m??g??"theme-primary",{themeMode:k}),S=p.useMemo(()=>uf(j),[j,k])[t],x=!!s,v=p.useCallback(()=>a(!0),[a]),T=p.useCallback(()=>{i||c(R=>{const M=!R;return d&&d(M),M})},[i,c,d]);return r.jsx(l.Center,{role:"Toggle",padding:o==="pill"?"8px 12px":"8px",width:"fit-content",cursor:i?"not-allowed":"pointer",borderRadius:df[o],onClick:T,onMouseEnter:v,onMouseLeave:()=>a(!1),...S,...x&&{...t==="link"?{backgroundColor:"transparent"}:{backgroundColor:"color-blue-50",borderWidth:1,borderStyle:"solid",borderColor:"color-blue-200"},color:j},...f,...u==null?void 0:u.container,children:e})}),pf=({children:e,shape:o,variant:t,isDisabled:n,isToggled:a=!1,onToggle:i,...s})=>{const c=fe(s),{isHovered:d,setIsHovered:u,isToggle:m,setIsToggled:g}=Zl(c.value??a);p.useEffect(()=>{g(c.value??a)},[c.value,a]);const h=f=>{g(f),c.onChange(f),i==null||i(f)};return r.jsx(ei,{shape:o,variant:t,isDisabled:n,isHovered:d,setIsHovered:u,isToggle:m,setIsToggled:g,onToggle:h,...s,children:e})},mf=pf,oi=()=>{const[e,o]=p.useState([]);return{activeToggles:e,setActiveToggles:o}},gf=({children:e,shape:o,variant:t,isDisabled:n,isToggled:a=!1,onToggle:i,...s})=>{const{isHovered:c,setIsHovered:d,isToggle:u,setIsToggled:m}=Zl(a);return p.useEffect(()=>{m(a)},[a]),r.jsx(ei,{shape:o,variant:t,isDisabled:n,isHovered:c,setIsHovered:d,isToggle:u,setIsToggled:m,onToggle:i,...s,children:e})},cn=gf,ri=({items:e,onToggleChange:o,activeToggles:t,setActiveToggles:n,shape:a="rounded",variant:i="ghost",views:s})=>{const c=p.useCallback((d,u)=>{n(m=>{let g;return u?g=m.includes(d)?m:[...m,d]:g=m.filter(h=>h!==d),o==null||o(g),g})},[o,n]);return r.jsx(l.Horizontal,{role:"ToggleGroup",display:"flex",gap:8,flexWrap:"wrap",...s==null?void 0:s.container,children:e.map(d=>r.jsx(cn,{role:`toggle-${d.id}`,shape:a,variant:i,isToggled:t.includes(d.id)||d.isActive,onToggle:u=>c(d.id,u),isDisabled:d.isDisabled,views:s==null?void 0:s.toggle,children:d.value},d.id))})},hf=({items:e,shape:o,variant:t,onToggleChange:n,...a})=>{const i=fe(a),{activeToggles:s,setActiveToggles:c}=oi();p.useEffect(()=>{Array.isArray(i.value)&&c(i.value)},[i.value]);const d=u=>{c(u),i.onChange(u),n==null||n(u)};return r.jsx(ri,{items:e,shape:o,variant:t,activeToggles:s,setActiveToggles:c,onToggleChange:d,...a})},ff=hf,ea=["zoom-out","zoom-in","zap","zap-off","youtube","x","wrench","worm","workflow","wine","wine-off","wind","wind-arrow-down","wifi","wifi-zero","wifi-sync","wifi-pen","wifi-off","wifi-low","wifi-high","wifi-cog","whole-word","wheat","wheat-off","weight","weight-tilde","webhook","webhook-off","webcam","waypoints","waves","waves-ladder","waves-arrow-up","waves-arrow-down","watch","washing-machine","warehouse","wand","wand-sparkles","wallpaper","wallet","wallet-minimal","wallet-cards","vote","volume","volume-x","volume-off","volume-2","volume-1","volleyball","voicemail","view","videotape","video","video-off","vibrate","vibrate-off","venus","venus-and-mars","venetian-mask","vegan","vector-square","vault","variable","van","utility-pole","utensils","utensils-crossed","users","users-round","user","user-x","user-star","user-search","user-round","user-round-x","user-round-search","user-round-plus","user-round-pen","user-round-minus","user-round-cog","user-round-check","user-plus","user-pen","user-minus","user-lock","user-cog","user-check","usb","upload","unplug","unlink","unlink-2","university","ungroup","unfold-vertical","unfold-horizontal","undo","undo-dot","undo-2","underline","umbrella","umbrella-off","type","type-outline","twitter","twitch","tv","tv-minimal","tv-minimal-play","turtle","turntable","turkish-lira","truck","truck-electric","trophy","triangle","triangle-right","triangle-dashed","triangle-alert","trending-up","trending-up-down","trending-down","trello","trees","tree-pine","tree-palm","tree-deciduous","trash","trash-2","transgender","tram-front","train-track","train-front","train-front-tunnel","traffic-cone","tractor","toy-brick","tower-control","touchpad","touchpad-off","torus","tornado","toolbox","tool-case","toilet","toggle-right","toggle-left","timer","timer-reset","timer-off","tickets","tickets-plane","ticket","ticket-x","ticket-slash","ticket-plus","ticket-percent","ticket-minus","ticket-check","thumbs-up","thumbs-down","thermometer","thermometer-sun","thermometer-snowflake","theater","text-wrap","text-select","text-search","text-quote","text-initial","text-cursor","text-cursor-input","text-align-start","text-align-justify","text-align-end","text-align-center","test-tubes","test-tube","test-tube-diagonal","terminal","tent","tent-tree","telescope","target","tangent","tally-5","tally-4","tally-3","tally-2","tally-1","tags","tag","tablets","tablet","tablet-smartphone","table","table-rows-split","table-properties","table-of-contents","table-columns-split","table-cells-split","table-cells-merge","table-2","syringe","swords","sword","switch-camera","swiss-franc","swatch-book","superscript","sunset","sunrise","sun","sun-snow","sun-moon","sun-medium","sun-dim","subscript","strikethrough","stretch-vertical","stretch-horizontal","store","stone","sticky-note","sticker","stethoscope","step-forward","step-back","star","star-off","star-half","stamp","squirrel","squircle","squircle-dashed","squares-unite","squares-subtract","squares-intersect","squares-exclude","square","square-x","square-user","square-user-round","square-terminal","square-stop","square-star","square-stack","square-square","square-split-vertical","square-split-horizontal","square-slash","square-sigma","square-scissors","square-round-corner","square-radical","square-power","square-plus","square-play","square-pilcrow","square-pi","square-percent","square-pen","square-pause","square-parking","square-parking-off","square-mouse-pointer","square-minus","square-menu","square-m","square-library","square-kanban","square-function","square-equal","square-dot","square-divide","square-dashed","square-dashed-top-solid","square-dashed-mouse-pointer","square-dashed-kanban","square-dashed-bottom","square-dashed-bottom-code","square-code","square-chevron-up","square-chevron-right","square-chevron-left","square-chevron-down","square-check","square-check-big","square-chart-gantt","square-bottom-dashed-scissors","square-asterisk","square-arrow-up","square-arrow-up-right","square-arrow-up-left","square-arrow-right","square-arrow-out-up-right","square-arrow-out-up-left","square-arrow-out-down-right","square-arrow-out-down-left","square-arrow-left","square-arrow-down","square-arrow-down-right","square-arrow-down-left","square-activity","sprout","spray-can","spotlight","spool","split","spline","spline-pointer","spell-check","spell-check-2","speech","speaker","sparkles","sparkle","spade","space","soup","solar-panel","sofa","soap-dispenser-droplet","snowflake","snail","smile","smile-plus","smartphone","smartphone-nfc","smartphone-charging","sliders-vertical","sliders-horizontal","slice","slash","slack","skull","skip-forward","skip-back","siren","signpost","signpost-big","signature","signal","signal-zero","signal-medium","signal-low","signal-high","sigma","shuffle","shrub","shrink","shrimp","shredder","shower-head","shovel","shopping-cart","shopping-basket","shopping-bag","shirt","ship","ship-wheel","shield","shield-x","shield-user","shield-question-mark","shield-plus","shield-off","shield-minus","shield-half","shield-ellipsis","shield-check","shield-ban","shield-alert","shell","sheet","share","share-2","shapes","settings","settings-2","server","server-off","server-crash","server-cog","separator-vertical","separator-horizontal","send","send-to-back","send-horizontal","section","search","search-x","search-slash","search-code","search-check","search-alert","scroll","scroll-text","screen-share","screen-share-off","scooter","scissors","scissors-line-dashed","school","scan","scan-text","scan-search","scan-qr-code","scan-line","scan-heart","scan-face","scan-eye","scan-barcode","scaling","scale","scale-3d","save","save-off","save-all","saudi-riyal","satellite","satellite-dish","sandwich","salad","sailboat","russian-ruble","ruler","ruler-dimension-line","rss","rows-4","rows-3","rows-2","router","route","route-off","rotate-cw","rotate-cw-square","rotate-ccw","rotate-ccw-square","rotate-ccw-key","rotate-3d","rose","roller-coaster","rocking-chair","rocket","ribbon","rewind","reply","reply-all","replace","replace-all","repeat","repeat-2","repeat-1","remove-formatting","regex","refrigerator","refresh-cw","refresh-cw-off","refresh-ccw","refresh-ccw-dot","redo","redo-dot","redo-2","recycle","rectangle-vertical","rectangle-horizontal","rectangle-goggles","rectangle-ellipsis","rectangle-circle","receipt","receipt-turkish-lira","receipt-text","receipt-swiss-franc","receipt-russian-ruble","receipt-pound-sterling","receipt-japanese-yen","receipt-indian-rupee","receipt-euro","receipt-cent","ratio","rat","rainbow","rail-symbol","radius","radio","radio-tower","radio-receiver","radical","radiation","radar","rabbit","quote","qr-code","pyramid","puzzle","proportions","projector","printer","printer-check","presentation","power","power-off","pound-sterling","popsicle","popcorn","pointer","pointer-off","podcast","pocket","pocket-knife","plus","plug","plug-zap","plug-2","play","plane","plane-takeoff","plane-landing","pizza","pipette","pin","pin-off","pill","pill-bottle","pilcrow","pilcrow-right","pilcrow-left","piggy-bank","picture-in-picture","picture-in-picture-2","pickaxe","piano","pi","phone","phone-outgoing","phone-off","phone-missed","phone-incoming","phone-forwarded","phone-call","philippine-peso","person-standing","percent","pentagon","pencil","pencil-ruler","pencil-off","pencil-line","pen","pen-tool","pen-off","pen-line","pc-case","paw-print","pause","party-popper","parking-meter","parentheses","paperclip","panels-top-left","panels-right-bottom","panels-left-bottom","panel-top","panel-top-open","panel-top-dashed","panel-top-close","panel-top-bottom-dashed","panel-right","panel-right-open","panel-right-dashed","panel-right-close","panel-left","panel-left-right-dashed","panel-left-open","panel-left-dashed","panel-left-close","panel-bottom","panel-bottom-open","panel-bottom-dashed","panel-bottom-close","panda","palette","paintbrush","paintbrush-vertical","paint-roller","paint-bucket","package","package-x","package-search","package-plus","package-open","package-minus","package-check","package-2","origami","orbit","option","omega","octagon","octagon-x","octagon-pause","octagon-minus","octagon-alert","nut","nut-off","notepad-text","notepad-text-dashed","notebook","notebook-text","notebook-tabs","notebook-pen","non-binary","nfc","newspaper","network","navigation","navigation-off","navigation-2","navigation-2-off","music","music-4","music-3","music-2","move","move-vertical","move-up","move-up-right","move-up-left","move-right","move-left","move-horizontal","move-down","move-down-right","move-down-left","move-diagonal","move-diagonal-2","move-3d","mouse","mouse-pointer","mouse-pointer-click","mouse-pointer-ban","mouse-pointer-2","mouse-pointer-2-off","mouse-off","mountain","mountain-snow","motorbike","moon","moon-star","monitor","monitor-x","monitor-up","monitor-stop","monitor-speaker","monitor-smartphone","monitor-play","monitor-pause","monitor-off","monitor-down","monitor-dot","monitor-cog","monitor-cloud","monitor-check","minus","minimize","minimize-2","milk","milk-off","milestone","microwave","microscope","microchip","mic","mic-vocal","mic-off","messages-square","message-square","message-square-x","message-square-warning","message-square-text","message-square-share","message-square-reply","message-square-quote","message-square-plus","message-square-off","message-square-more","message-square-lock","message-square-heart","message-square-dot","message-square-diff","message-square-dashed","message-square-code","message-circle","message-circle-x","message-circle-warning","message-circle-reply","message-circle-question-mark","message-circle-plus","message-circle-off","message-circle-more","message-circle-heart","message-circle-dashed","message-circle-code","merge","menu","memory-stick","meh","megaphone","megaphone-off","medal","maximize","maximize-2","martini","mars","mars-stroke","map","map-plus","map-pinned","map-pin","map-pin-x","map-pin-x-inside","map-pin-plus","map-pin-plus-inside","map-pin-pen","map-pin-off","map-pin-minus","map-pin-minus-inside","map-pin-house","map-pin-check","map-pin-check-inside","map-minus","mails","mailbox","mail","mail-x","mail-warning","mail-search","mail-question-mark","mail-plus","mail-open","mail-minus","mail-check","magnet","luggage","lollipop","logs","log-out","log-in","lock","lock-open","lock-keyhole","lock-keyhole-open","locate","locate-off","locate-fixed","loader","loader-pinwheel","loader-circle","list","list-x","list-video","list-tree","list-todo","list-start","list-restart","list-plus","list-ordered","list-music","list-minus","list-indent-increase","list-indent-decrease","list-filter","list-filter-plus","list-end","list-collapse","list-chevrons-up-down","list-chevrons-down-up","list-checks","list-check","linkedin","link","link-2","link-2-off","line-squiggle","lightbulb","lightbulb-off","ligature","life-buoy","library","library-big","lectern","leafy-green","leaf","layout-template","layout-panel-top","layout-panel-left","layout-list","layout-grid","layout-dashboard","layers","layers-plus","layers-2","laugh","lasso","lasso-select","laptop","laptop-minimal","laptop-minimal-check","languages","landmark","land-plot","lamp","lamp-wall-up","lamp-wall-down","lamp-floor","lamp-desk","lamp-ceiling","keyboard","keyboard-off","keyboard-music","key","key-square","key-round","kayak","kanban","joystick","japanese-yen","iteration-cw","iteration-ccw","italic","instagram","inspection-panel","info","infinity","indian-rupee","inbox","import","images","image","image-upscale","image-up","image-plus","image-play","image-off","image-minus","image-down","id-card","id-card-lanyard","ice-cream-cone","ice-cream-bowl","house","house-wifi","house-plus","house-plug","house-heart","hourglass","hotel","hospital","hop","hop-off","history","highlighter","hexagon","helicopter","heater","heart","heart-pulse","heart-plus","heart-off","heart-minus","heart-handshake","heart-crack","headset","headphones","headphone-off","heading","heading-6","heading-5","heading-4","heading-3","heading-2","heading-1","hdmi-port","hd","haze","hat-glasses","hash","hard-hat","hard-drive","hard-drive-upload","hard-drive-download","handshake","handbag","hand","hand-platter","hand-metal","hand-helping","hand-heart","hand-grab","hand-fist","hand-coins","hammer","hamburger","ham","guitar","group","grip","grip-vertical","grip-horizontal","grid-3x3","grid-3x2","grid-2x2","grid-2x2-x","grid-2x2-plus","grid-2x2-check","grape","graduation-cap","gpu","goal","globe","globe-lock","glasses","glass-water","gitlab","github","git-pull-request","git-pull-request-draft","git-pull-request-create","git-pull-request-create-arrow","git-pull-request-closed","git-pull-request-arrow","git-merge","git-graph","git-fork","git-compare","git-compare-arrows","git-commit-vertical","git-commit-horizontal","git-branch","git-branch-plus","git-branch-minus","gift","ghost","georgian-lari","gem","gavel","gauge","gamepad","gamepad-directional","gamepad-2","gallery-vertical","gallery-vertical-end","gallery-thumbnails","gallery-horizontal","gallery-horizontal-end","funnel","funnel-x","funnel-plus","fullscreen","fuel","frown","framer","frame","forward","form","forklift","footprints","folders","folder","folder-x","folder-up","folder-tree","folder-sync","folder-symlink","folder-search","folder-search-2","folder-root","folder-plus","folder-pen","folder-output","folder-open","folder-open-dot","folder-minus","folder-lock","folder-key","folder-kanban","folder-input","folder-heart","folder-git","folder-git-2","folder-down","folder-dot","folder-cog","folder-code","folder-closed","folder-clock","folder-check","folder-archive","fold-vertical","fold-horizontal","focus","flower","flower-2","flip-vertical","flip-vertical-2","flip-horizontal","flip-horizontal-2","flask-round","flask-conical","flask-conical-off","flashlight","flashlight-off","flame","flame-kindling","flag","flag-triangle-right","flag-triangle-left","flag-off","fishing-hook","fish","fish-symbol","fish-off","fire-extinguisher","fingerprint-pattern","film","files","file","file-x","file-x-corner","file-volume","file-video-camera","file-user","file-up","file-type","file-type-corner","file-text","file-terminal","file-symlink","file-stack","file-spreadsheet","file-sliders","file-signal","file-search","file-search-corner","file-scan","file-question-mark","file-plus","file-plus-corner","file-play","file-pen","file-pen-line","file-output","file-music","file-minus","file-minus-corner","file-lock","file-key","file-input","file-image","file-heart","file-headphone","file-exclamation-point","file-down","file-digit","file-diff","file-cog","file-code","file-code-corner","file-clock","file-check","file-check-corner","file-chart-pie","file-chart-line","file-chart-column","file-chart-column-increasing","file-braces","file-braces-corner","file-box","file-badge","file-axis-3d","file-archive","figma","ferris-wheel","fence","feather","fast-forward","fan","factory","facebook","eye","eye-off","eye-closed","external-link","expand","ev-charger","euro","ethernet-port","eraser","equal","equal-not","equal-approximately","ellipsis","ellipsis-vertical","egg","egg-off","egg-fried","eclipse","earth","earth-lock","ear","ear-off","dumbbell","drumstick","drum","droplets","droplet","droplet-off","drone","drill","dribbble","drama","drafting-compass","download","dot","door-open","door-closed","door-closed-locked","donut","dollar-sign","dog","dock","dna","dna-off","divide","disc","disc-album","disc-3","disc-2","diff","dices","dice-6","dice-5","dice-4","dice-3","dice-2","dice-1","diamond","diamond-plus","diamond-percent","diamond-minus","diameter","dessert","delete","decimals-arrow-right","decimals-arrow-left","database","database-zap","database-backup","dam","cylinder","currency","cup-soda","cuboid","crown","crosshair","cross","crop","croissant","credit-card","creative-commons","cpu","corner-up-right","corner-up-left","corner-right-up","corner-right-down","corner-left-up","corner-left-down","corner-down-right","corner-down-left","copyright","copyleft","copy","copy-x","copy-slash","copy-plus","copy-minus","copy-check","cooking-pot","cookie","contrast","container","contact","contact-round","construction","cone","concierge-bell","computer","component","compass","command","combine","columns-4","columns-3","columns-3-cog","columns-2","coins","cog","coffee","codesandbox","codepen","code","code-xml","club","clover","cloudy","cloud","cloud-upload","cloud-sync","cloud-sun","cloud-sun-rain","cloud-snow","cloud-rain","cloud-rain-wind","cloud-off","cloud-moon","cloud-moon-rain","cloud-lightning","cloud-hail","cloud-fog","cloud-drizzle","cloud-download","cloud-cog","cloud-check","cloud-backup","cloud-alert","closed-caption","clock","clock-plus","clock-fading","clock-check","clock-arrow-up","clock-arrow-down","clock-alert","clock-9","clock-8","clock-7","clock-6","clock-5","clock-4","clock-3","clock-2","clock-12","clock-11","clock-10","clock-1","clipboard","clipboard-x","clipboard-type","clipboard-plus","clipboard-pen","clipboard-pen-line","clipboard-paste","clipboard-minus","clipboard-list","clipboard-copy","clipboard-clock","clipboard-check","clapperboard","citrus","circuit-board","circle","circle-x","circle-user","circle-user-round","circle-stop","circle-star","circle-small","circle-slash","circle-slash-2","circle-question-mark","circle-power","circle-pound-sterling","circle-plus","circle-play","circle-pile","circle-percent","circle-pause","circle-parking","circle-parking-off","circle-off","circle-minus","circle-gauge","circle-fading-plus","circle-fading-arrow-up","circle-equal","circle-ellipsis","circle-dot","circle-dot-dashed","circle-dollar-sign","circle-divide","circle-dashed","circle-chevron-up","circle-chevron-right","circle-chevron-left","circle-chevron-down","circle-check","circle-check-big","circle-arrow-up","circle-arrow-right","circle-arrow-out-up-right","circle-arrow-out-up-left","circle-arrow-out-down-right","circle-arrow-out-down-left","circle-arrow-left","circle-arrow-down","circle-alert","cigarette","cigarette-off","church","chromium","chevrons-up","chevrons-up-down","chevrons-right","chevrons-right-left","chevrons-left","chevrons-left-right","chevrons-left-right-ellipsis","chevrons-down","chevrons-down-up","chevron-up","chevron-right","chevron-left","chevron-last","chevron-first","chevron-down","chess-rook","chess-queen","chess-pawn","chess-knight","chess-king","chess-bishop","cherry","chef-hat","check","check-line","check-check","chart-spline","chart-scatter","chart-pie","chart-no-axes-gantt","chart-no-axes-combined","chart-no-axes-column","chart-no-axes-column-increasing","chart-no-axes-column-decreasing","chart-network","chart-line","chart-gantt","chart-column","chart-column-stacked","chart-column-increasing","chart-column-decreasing","chart-column-big","chart-candlestick","chart-bar","chart-bar-stacked","chart-bar-increasing","chart-bar-decreasing","chart-bar-big","chart-area","cctv","cat","castle","cast","cassette-tape","case-upper","case-sensitive","case-lower","carrot","card-sim","caravan","car","car-taxi-front","car-front","captions","captions-off","cannabis","cannabis-off","candy","candy-off","candy-cane","camera","camera-off","calendars","calendar","calendar-x","calendar-x-2","calendar-sync","calendar-search","calendar-range","calendar-plus","calendar-plus-2","calendar-off","calendar-minus","calendar-minus-2","calendar-heart","calendar-fold","calendar-days","calendar-cog","calendar-clock","calendar-check","calendar-check-2","calendar-arrow-up","calendar-arrow-down","calendar-1","calculator","cake","cake-slice","cable","cable-car","bus","bus-front","building","building-2","bug","bug-play","bug-off","bubbles","brush","brush-cleaning","bring-to-front","briefcase","briefcase-medical","briefcase-conveyor-belt","briefcase-business","brick-wall","brick-wall-shield","brick-wall-fire","brain","brain-cog","brain-circuit","brackets","braces","boxes","box","bow-arrow","bottle-wine","bot","bot-off","bot-message-square","boom-box","bookmark","bookmark-x","bookmark-plus","bookmark-minus","bookmark-check","book","book-x","book-user","book-up","book-up-2","book-type","book-text","book-search","book-plus","book-open","book-open-text","book-open-check","book-minus","book-marked","book-lock","book-key","book-image","book-heart","book-headphones","book-down","book-dashed","book-copy","book-check","book-audio","book-alert","book-a","bone","bomb","bolt","bold","bluetooth","bluetooth-searching","bluetooth-off","bluetooth-connected","blocks","blinds","blend","bitcoin","birdhouse","bird","biohazard","binoculars","binary","bike","biceps-flexed","between-vertical-start","between-vertical-end","between-horizontal-start","between-horizontal-end","bell","bell-ring","bell-plus","bell-off","bell-minus","bell-electric","bell-dot","beer","beer-off","beef","bed","bed-single","bed-double","bean","bean-off","beaker","battery","battery-warning","battery-plus","battery-medium","battery-low","battery-full","battery-charging","bath","baseline","barrel","barcode","banknote","banknote-x","banknote-arrow-up","banknote-arrow-down","bandage","banana","ban","balloon","baggage-claim","badge","badge-x","badge-turkish-lira","badge-swiss-franc","badge-russian-ruble","badge-question-mark","badge-pound-sterling","badge-plus","badge-percent","badge-minus","badge-japanese-yen","badge-info","badge-indian-rupee","badge-euro","badge-dollar-sign","badge-check","badge-cent","badge-alert","backpack","baby","axis-3d","axe","award","audio-waveform","audio-lines","atom","at-sign","asterisk","arrows-up-from-line","arrow-up","arrow-up-z-a","arrow-up-wide-narrow","arrow-up-to-line","arrow-up-right","arrow-up-narrow-wide","arrow-up-left","arrow-up-from-line","arrow-up-from-dot","arrow-up-down","arrow-up-a-z","arrow-up-1-0","arrow-up-0-1","arrow-right","arrow-right-to-line","arrow-right-left","arrow-right-from-line","arrow-left","arrow-left-to-line","arrow-left-right","arrow-left-from-line","arrow-down","arrow-down-z-a","arrow-down-wide-narrow","arrow-down-up","arrow-down-to-line","arrow-down-to-dot","arrow-down-right","arrow-down-narrow-wide","arrow-down-left","arrow-down-from-line","arrow-down-a-z","arrow-down-1-0","arrow-down-0-1","arrow-big-up","arrow-big-up-dash","arrow-big-right","arrow-big-right-dash","arrow-big-left","arrow-big-left-dash","arrow-big-down","arrow-big-down-dash","armchair","archive","archive-x","archive-restore","apple","app-window","app-window-mac","aperture","anvil","antenna","annoyed","angry","anchor","amphora","ampersands","ampersand","ambulance","align-vertical-space-between","align-vertical-space-around","align-vertical-justify-start","align-vertical-justify-end","align-vertical-justify-center","align-vertical-distribute-start","align-vertical-distribute-end","align-vertical-distribute-center","align-start-vertical","align-start-horizontal","align-horizontal-space-between","align-horizontal-space-around","align-horizontal-justify-start","align-horizontal-justify-end","align-horizontal-justify-center","align-horizontal-distribute-start","align-horizontal-distribute-end","align-horizontal-distribute-center","align-end-vertical","align-end-horizontal","align-center-vertical","align-center-horizontal","album","alarm-smoke","alarm-clock","alarm-clock-plus","alarm-clock-off","alarm-clock-minus","alarm-clock-check","airplay","air-vent","activity","accessibility","a-large-small","a-arrow-up","a-arrow-down"],ti=e=>{const{value:o,defaultValue:t,onChange:n,isOpen:a,onOpen:i,onClose:s,closeOnSelect:c=!0}=e,[d,u]=p.useState(a??!1),[m,g]=p.useState(o??t),[h,f]=p.useState(""),y=p.useRef(null),b=p.useRef(null);p.useEffect(()=>{o!==void 0&&g(o)},[o]),p.useEffect(()=>{a!==void 0&&u(a)},[a]);const k=p.useMemo(()=>h?ea.filter(x=>x.toLowerCase().includes(h.toLowerCase())).slice(0,100):ea.slice(0,100),[h]);p.useEffect(()=>{const x=v=>{d&&y.current&&b.current&&!y.current.contains(v.target)&&!b.current.contains(v.target)&&C()};if(typeof(document==null?void 0:document.addEventListener)=="function")return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[d]);const C=p.useCallback(()=>{a===void 0&&u(!1),s&&s()},[s,a]),j=p.useCallback(()=>{const x=!d;a===void 0&&u(x),x?(i&&i(),f("")):s&&s()},[d,i,s,a]),w=p.useCallback(x=>{o===void 0&&g(x),n&&n(x),c&&C()},[n,c,C,o]),S=p.useCallback(x=>{f(x)},[]);return{isOpen:d,selectedIcon:m,searchQuery:h,filteredIcons:k,handleToggle:j,handleIconSelect:w,handleSearchChange:S,handleClose:C,triggerRef:y,dropdownRef:b}},bo={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease-in-out"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:12,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",padding:"16px",minWidth:"280px",maxHeight:"320px",overflow:"hidden",display:"flex",flexDirection:"column"},searchInput:{marginBottom:"12px",flexShrink:0},iconGrid:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",gap:"8px",overflowY:"auto",padding:"4px",color:"color-black",flexGrow:1},iconItem:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:8,transition:"all 0.2s ease-in-out"}},yf={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"14px",padding:"10px 14px"},xl:{height:"56px",fontSize:"16px",padding:"12px 16px"}},xf={default:{borderRadius:8},square:{borderRadius:0},rounded:{borderRadius:8},pill:{borderRadius:9999}},bf={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},ni=({label:e,placeholder:o="Select an icon",helperText:t,views:n={},size:a="md",shape:i="default",variant:s="default",error:c=!1,isDisabled:d=!1,isReadOnly:u=!1,showSearch:m=!0,isOpen:g,selectedIcon:h,searchQuery:f,filteredIcons:y,handleToggle:b,handleIconSelect:k,handleSearchChange:C,triggerRef:j,dropdownRef:w,handleClose:S,onChange:x,value:v,defaultValue:T,onOpen:R,onClose:M,closeOnSelect:E,...I})=>{const{getColor:V}=l.useTheme(),P={...bo.container,...n==null?void 0:n.container},z={...bo.trigger,...yf[a],...xf[i],...bf[s],...c&&{borderColor:"color-red-500"},...d&&{opacity:.6,cursor:"not-allowed"},...!d&&!u&&{_hover:{borderColor:"color-gray-300"}},...n==null?void 0:n.trigger},W={...bo.dropdown,...n==null?void 0:n.dropdown},F={...bo.iconGrid,...n==null?void 0:n.iconGrid};return r.jsxs(l.View,{...P,...I,children:[e&&r.jsx(l.Text,{fontSize:a==="xs"?"12px":a==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...n==null?void 0:n.label,children:e}),r.jsxs(l.View,{ref:j,onClick:d||u?void 0:b,...z,children:[r.jsx(l.Horizontal,{alignItems:"center",gap:8,width:"100%",children:h?r.jsxs(l.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[r.jsx(vr,{name:h,widthHeight:16}),r.jsx(l.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h})]}):r.jsx(l.Text,{color:"color-gray-500",fontSize:"inherit",children:o})}),!u&&!d&&r.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:g?"up":"down"})]}),g&&r.jsxs(l.View,{ref:w,...W,children:[m&&r.jsx(l.View,{...bo.searchInput,...n==null?void 0:n.searchInput,children:r.jsx(ve,{placeholder:"Search icons...",value:f,onChange:H=>C(H),size:"sm",autoFocus:!0})}),r.jsx(l.View,{...F,children:y.length>0?y.map(H=>r.jsx(l.View,{...bo.iconItem,onClick:()=>k(H),title:H,_hover:{backgroundColor:"color-gray-50",transform:"scale(1.05)"},backgroundColor:h===H?"#EFF6FF":"transparent",borderWidth:h===H?"1px":"0px",borderStyle:"solid",borderColor:h===H?"#BFDBFE":"transparent",...n==null?void 0:n.iconItem,children:r.jsx(vr,{name:H,widthHeight:20})},H)):r.jsx(l.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(l.Text,{fontSize:"14px",children:"No icons found"})})})]}),t&&r.jsx(l.Text,{color:c?"color-red-500":"color-gray-600",marginTop:"4px",...n==null?void 0:n.helperText,children:t})]})},kf=e=>{const o=fe(e),t={...e,value:o.value??e.value??e.defaultValue},n=ti(t),a=i=>{n.handleIconSelect(i),o.onChange(i)};return r.jsx(ni,{...n,...t,handleIconSelect:a})},Cf=kf,Ge={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease-in-out"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:12,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",padding:"16px",minWidth:"320px",maxHeight:"400px",overflow:"hidden"},searchInput:{marginBottom:"12px"},categoryTabs:{display:"flex",flexDirection:"row",flexWrap:"wrap",borderBottom:"1px solid color-gray-100",marginBottom:"12px",overflowX:"auto"},categoryTab:{padding:"8px 12px",cursor:"pointer",borderBottom:"2px solid transparent",transition:"all 0.2s ease-in-out",fontSize:"14px",fontWeight:"500",color:"color-gray-600",whiteSpace:"nowrap",borderRadius:"8px 8px 0 0"},emojiGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",gap:"4px",maxHeight:"240px",overflowY:"auto",padding:"4px",color:"color-black"},emoji:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:6,fontSize:"20px",transition:"all 0.2s ease-in-out"}},Sf={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"14px",padding:"10px 14px"},xl:{height:"56px",fontSize:"16px",padding:"12px 16px"}},jf={default:{borderRadius:8},square:{borderRadius:0},rounded:{borderRadius:8},pill:{borderRadius:9999}},wf={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},vf={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},Tf=[{emoji:"😀",name:"grinning face",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😃",name:"grinning face with big eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😄",name:"grinning face with smiling eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😁",name:"beaming face with smiling eyes",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😆",name:"grinning squinting face",category:"smileys",keywords:["happy","laugh","smile"]},{emoji:"😅",name:"grinning face with sweat",category:"smileys",keywords:["happy","sweat","relief"]},{emoji:"🤣",name:"rolling on the floor laughing",category:"smileys",keywords:["laugh","funny","rofl"]},{emoji:"😂",name:"face with tears of joy",category:"smileys",keywords:["laugh","cry","joy"]},{emoji:"🙂",name:"slightly smiling face",category:"smileys",keywords:["smile","happy"]},{emoji:"🙃",name:"upside-down face",category:"smileys",keywords:["silly","upside down"]},{emoji:"😉",name:"winking face",category:"smileys",keywords:["wink","flirt"]},{emoji:"😊",name:"smiling face with smiling eyes",category:"smileys",keywords:["happy","smile","blush"]},{emoji:"😇",name:"smiling face with halo",category:"smileys",keywords:["angel","innocent"]},{emoji:"🥰",name:"smiling face with hearts",category:"smileys",keywords:["love","hearts","adore"]},{emoji:"😍",name:"smiling face with heart-eyes",category:"smileys",keywords:["love","heart","eyes"]},{emoji:"🤩",name:"star-struck",category:"smileys",keywords:["star","struck","amazed"]},{emoji:"😘",name:"face blowing a kiss",category:"smileys",keywords:["kiss","love","flirt"]},{emoji:"😗",name:"kissing face",category:"smileys",keywords:["kiss","love"]},{emoji:"☺️",name:"smiling face",category:"smileys",keywords:["smile","happy","content"]},{emoji:"😚",name:"kissing face with closed eyes",category:"smileys",keywords:["kiss","love","closed eyes"]},{emoji:"😙",name:"kissing face with smiling eyes",category:"smileys",keywords:["kiss","love","smile"]},{emoji:"🥲",name:"smiling face with tear",category:"smileys",keywords:["happy","cry","tear","bittersweet"]},{emoji:"😋",name:"face savoring food",category:"smileys",keywords:["yum","delicious","food"]},{emoji:"😛",name:"face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"😜",name:"winking face with tongue",category:"smileys",keywords:["wink","tongue","silly"]},{emoji:"🤪",name:"zany face",category:"smileys",keywords:["crazy","silly","wild"]},{emoji:"😝",name:"squinting face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"🤑",name:"money-mouth face",category:"smileys",keywords:["money","rich","greedy"]},{emoji:"🤗",name:"hugging face",category:"smileys",keywords:["hug","love","care"]},{emoji:"🤭",name:"face with hand over mouth",category:"smileys",keywords:["oops","secret","quiet"]},{emoji:"🫢",name:"face with open eyes and hand over mouth",category:"smileys",keywords:["surprise","shock","oops"]},{emoji:"🫣",name:"face with peeking eye",category:"smileys",keywords:["peek","shy","embarrassed"]},{emoji:"🤫",name:"shushing face",category:"smileys",keywords:["quiet","secret","shh"]},{emoji:"🤔",name:"thinking face",category:"smileys",keywords:["think","consider","hmm"]},{emoji:"🫡",name:"saluting face",category:"smileys",keywords:["salute","respect","military"]},{emoji:"🤐",name:"zipper-mouth face",category:"smileys",keywords:["quiet","secret","zip"]},{emoji:"🤨",name:"face with raised eyebrow",category:"smileys",keywords:["suspicious","doubt","skeptical"]},{emoji:"😐",name:"neutral face",category:"smileys",keywords:["neutral","meh","blank"]},{emoji:"😑",name:"expressionless face",category:"smileys",keywords:["blank","deadpan","meh"]},{emoji:"😶",name:"face without mouth",category:"smileys",keywords:["quiet","speechless","silent"]},{emoji:"🫥",name:"dotted line face",category:"smileys",keywords:["invisible","depressed","disappear"]},{emoji:"😏",name:"smirking face",category:"smileys",keywords:["smirk","smug","confident"]},{emoji:"😒",name:"unamused face",category:"smileys",keywords:["unamused","bored","annoyed"]},{emoji:"🙄",name:"face with rolling eyes",category:"smileys",keywords:["eye roll","annoyed","whatever"]},{emoji:"😬",name:"grimacing face",category:"smileys",keywords:["grimace","awkward","oops"]},{emoji:"😮‍💨",name:"face exhaling",category:"smileys",keywords:["sigh","relief","tired"]},{emoji:"🤥",name:"lying face",category:"smileys",keywords:["lie","pinocchio","dishonest"]},{emoji:"😌",name:"relieved face",category:"smileys",keywords:["relief","calm","peaceful"]},{emoji:"😔",name:"pensive face",category:"smileys",keywords:["sad","thoughtful","pensive"]},{emoji:"😪",name:"sleepy face",category:"smileys",keywords:["sleepy","tired","drowsy"]},{emoji:"🤤",name:"drooling face",category:"smileys",keywords:["drool","desire","sleep"]},{emoji:"😴",name:"sleeping face",category:"smileys",keywords:["sleep","tired","zzz"]},{emoji:"😷",name:"face with medical mask",category:"smileys",keywords:["mask","sick","doctor"]},{emoji:"🤒",name:"face with thermometer",category:"smileys",keywords:["sick","fever","ill"]},{emoji:"🤕",name:"face with head-bandage",category:"smileys",keywords:["hurt","injured","bandage"]},{emoji:"🤢",name:"nauseated face",category:"smileys",keywords:["sick","nausea","disgusted"]},{emoji:"🤮",name:"face vomiting",category:"smileys",keywords:["vomit","sick","disgusted"]},{emoji:"🤧",name:"sneezing face",category:"smileys",keywords:["sneeze","sick","gesundheit"]},{emoji:"🥵",name:"hot face",category:"smileys",keywords:["hot","heat","sweat"]},{emoji:"🥶",name:"cold face",category:"smileys",keywords:["cold","freeze","blue"]},{emoji:"🥴",name:"woozy face",category:"smileys",keywords:["dizzy","drunk","confused"]},{emoji:"😵",name:"dizzy face",category:"smileys",keywords:["dizzy","confused","knocked out"]},{emoji:"😵‍💫",name:"face with spiral eyes",category:"smileys",keywords:["dizzy","hypnotized","confused"]},{emoji:"🤯",name:"exploding head",category:"smileys",keywords:["mind blown","shocked","amazed"]},{emoji:"🤠",name:"cowboy hat face",category:"smileys",keywords:["cowboy","hat","western"]},{emoji:"🥳",name:"partying face",category:"smileys",keywords:["party","celebration","birthday"]},{emoji:"🥸",name:"disguised face",category:"smileys",keywords:["disguise","glasses","incognito"]},{emoji:"😎",name:"smiling face with sunglasses",category:"smileys",keywords:["cool","sunglasses","awesome"]},{emoji:"🤓",name:"nerd face",category:"smileys",keywords:["nerd","geek","smart"]},{emoji:"🧐",name:"face with monocle",category:"smileys",keywords:["monocle","fancy","inspection"]},{emoji:"👋",name:"waving hand",category:"people",keywords:["wave","hello","goodbye"]},{emoji:"🤚",name:"raised back of hand",category:"people",keywords:["hand","stop"]},{emoji:"🖐️",name:"hand with fingers splayed",category:"people",keywords:["hand","five"]},{emoji:"✋",name:"raised hand",category:"people",keywords:["hand","stop","high five"]},{emoji:"🖖",name:"vulcan salute",category:"people",keywords:["spock","vulcan"]},{emoji:"👌",name:"OK hand",category:"people",keywords:["ok","perfect"]},{emoji:"🤌",name:"pinched fingers",category:"people",keywords:["italian","chef kiss"]},{emoji:"🤏",name:"pinching hand",category:"people",keywords:["small","tiny"]},{emoji:"✌️",name:"victory hand",category:"people",keywords:["peace","victory"]},{emoji:"🤞",name:"crossed fingers",category:"people",keywords:["luck","hope"]},{emoji:"🤟",name:"love-you gesture",category:"people",keywords:["love","you"]},{emoji:"🤘",name:"sign of the horns",category:"people",keywords:["rock","metal"]},{emoji:"🤙",name:"call me hand",category:"people",keywords:["call","phone"]},{emoji:"👈",name:"backhand index pointing left",category:"people",keywords:["point","left"]},{emoji:"👉",name:"backhand index pointing right",category:"people",keywords:["point","right"]},{emoji:"👆",name:"backhand index pointing up",category:"people",keywords:["point","up"]},{emoji:"🖕",name:"middle finger",category:"people",keywords:["middle finger","rude"]},{emoji:"👇",name:"backhand index pointing down",category:"people",keywords:["point","down"]},{emoji:"☝️",name:"index pointing up",category:"people",keywords:["point","up","one"]},{emoji:"👍",name:"thumbs up",category:"people",keywords:["thumbs up","good","yes"]},{emoji:"👎",name:"thumbs down",category:"people",keywords:["thumbs down","bad","no"]},{emoji:"✊",name:"raised fist",category:"people",keywords:["fist","power","solidarity"]},{emoji:"👊",name:"oncoming fist",category:"people",keywords:["fist","punch","bump"]},{emoji:"🤛",name:"left-facing fist",category:"people",keywords:["fist","bump","left"]},{emoji:"🤜",name:"right-facing fist",category:"people",keywords:["fist","bump","right"]},{emoji:"👏",name:"clapping hands",category:"people",keywords:["clap","applause","bravo"]},{emoji:"🙌",name:"raising hands",category:"people",keywords:["celebration","hooray","praise"]},{emoji:"👐",name:"open hands",category:"people",keywords:["open","hug","jazz hands"]},{emoji:"🤲",name:"palms up together",category:"people",keywords:["prayer","please","hope"]},{emoji:"🤝",name:"handshake",category:"people",keywords:["handshake","deal","agreement"]},{emoji:"🙏",name:"folded hands",category:"people",keywords:["prayer","thanks","please"]},{emoji:"✍️",name:"writing hand",category:"people",keywords:["write","author","signature"]},{emoji:"💅",name:"nail polish",category:"people",keywords:["nails","beauty","manicure"]},{emoji:"🤳",name:"selfie",category:"people",keywords:["selfie","camera","phone"]},{emoji:"💪",name:"flexed biceps",category:"people",keywords:["muscle","strong","flex"]},{emoji:"🦾",name:"mechanical arm",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦿",name:"mechanical leg",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦵",name:"leg",category:"people",keywords:["leg","limb","kick"]},{emoji:"🦶",name:"foot",category:"people",keywords:["foot","kick","stomp"]},{emoji:"👂",name:"ear",category:"people",keywords:["ear","hear","listen"]},{emoji:"🦻",name:"ear with hearing aid",category:"people",keywords:["hearing aid","deaf","accessibility"]},{emoji:"👃",name:"nose",category:"people",keywords:["nose","smell","sniff"]},{emoji:"🧠",name:"brain",category:"people",keywords:["brain","smart","think"]},{emoji:"🫀",name:"anatomical heart",category:"people",keywords:["heart","organ","love"]},{emoji:"🫁",name:"lungs",category:"people",keywords:["lungs","breathe","organ"]},{emoji:"🦷",name:"tooth",category:"people",keywords:["tooth","dental","smile"]},{emoji:"🦴",name:"bone",category:"people",keywords:["bone","skeleton","dog"]},{emoji:"👀",name:"eyes",category:"people",keywords:["eyes","look","see"]},{emoji:"👁️",name:"eye",category:"people",keywords:["eye","see","watch"]},{emoji:"👅",name:"tongue",category:"people",keywords:["tongue","taste","lick"]},{emoji:"👄",name:"mouth",category:"people",keywords:["mouth","lips","kiss"]},{emoji:"🫦",name:"biting lip",category:"people",keywords:["lip","bite","nervous"]},{emoji:"👶",name:"baby",category:"people",keywords:["baby","infant","child"]},{emoji:"🧒",name:"child",category:"people",keywords:["child","kid","young"]},{emoji:"👦",name:"boy",category:"people",keywords:["boy","child","male"]},{emoji:"👧",name:"girl",category:"people",keywords:["girl","child","female"]},{emoji:"🧑",name:"person",category:"people",keywords:["person","adult","human"]},{emoji:"👱",name:"person: blond hair",category:"people",keywords:["blond","hair","person"]},{emoji:"👨",name:"man",category:"people",keywords:["man","male","adult"]},{emoji:"🧔",name:"person: beard",category:"people",keywords:["beard","man","facial hair"]},{emoji:"👩",name:"woman",category:"people",keywords:["woman","female","adult"]},{emoji:"🧓",name:"older person",category:"people",keywords:["old","elderly","senior"]},{emoji:"👴",name:"old man",category:"people",keywords:["old","man","elderly"]},{emoji:"👵",name:"old woman",category:"people",keywords:["old","woman","elderly"]},{emoji:"🐶",name:"dog face",category:"animals",keywords:["dog","pet","animal"]},{emoji:"🐱",name:"cat face",category:"animals",keywords:["cat","pet","animal"]},{emoji:"🐭",name:"mouse face",category:"animals",keywords:["mouse","animal"]},{emoji:"🐹",name:"hamster",category:"animals",keywords:["hamster","pet"]},{emoji:"🐰",name:"rabbit face",category:"animals",keywords:["rabbit","bunny"]},{emoji:"🦊",name:"fox",category:"animals",keywords:["fox","animal"]},{emoji:"🐻",name:"bear",category:"animals",keywords:["bear","animal"]},{emoji:"🐼",name:"panda",category:"animals",keywords:["panda","bear"]},{emoji:"🐨",name:"koala",category:"animals",keywords:["koala","australia","marsupial"]},{emoji:"🐯",name:"tiger face",category:"animals",keywords:["tiger","cat","wild"]},{emoji:"🦁",name:"lion",category:"animals",keywords:["lion","king","cat"]},{emoji:"🐮",name:"cow face",category:"animals",keywords:["cow","moo","farm"]},{emoji:"🐷",name:"pig face",category:"animals",keywords:["pig","oink","farm"]},{emoji:"🐽",name:"pig nose",category:"animals",keywords:["pig","nose","snout"]},{emoji:"🐸",name:"frog",category:"animals",keywords:["frog","amphibian","green"]},{emoji:"🐵",name:"monkey face",category:"animals",keywords:["monkey","primate","banana"]},{emoji:"🙈",name:"see-no-evil monkey",category:"animals",keywords:["monkey","see no evil","eyes"]},{emoji:"🙉",name:"hear-no-evil monkey",category:"animals",keywords:["monkey","hear no evil","ears"]},{emoji:"🙊",name:"speak-no-evil monkey",category:"animals",keywords:["monkey","speak no evil","mouth"]},{emoji:"🐒",name:"monkey",category:"animals",keywords:["monkey","primate","zoo"]},{emoji:"🦍",name:"gorilla",category:"animals",keywords:["gorilla","ape","strong"]},{emoji:"🦧",name:"orangutan",category:"animals",keywords:["orangutan","ape","orange"]},{emoji:"🐺",name:"wolf",category:"animals",keywords:["wolf","howl","wild"]},{emoji:"🐗",name:"boar",category:"animals",keywords:["boar","pig","wild"]},{emoji:"🐴",name:"horse face",category:"animals",keywords:["horse","neigh","ride"]},{emoji:"🐎",name:"horse",category:"animals",keywords:["horse","racing","gallop"]},{emoji:"🦄",name:"unicorn",category:"animals",keywords:["unicorn","magical","horn"]},{emoji:"🦓",name:"zebra",category:"animals",keywords:["zebra","stripes","africa"]},{emoji:"🦌",name:"deer",category:"animals",keywords:["deer","antlers","forest"]},{emoji:"🦏",name:"rhinoceros",category:"animals",keywords:["rhino","horn","africa"]},{emoji:"🦛",name:"hippopotamus",category:"animals",keywords:["hippo","water","africa"]},{emoji:"🐘",name:"elephant",category:"animals",keywords:["elephant","trunk","memory"]},{emoji:"🦒",name:"giraffe",category:"animals",keywords:["giraffe","tall","neck"]},{emoji:"🦘",name:"kangaroo",category:"animals",keywords:["kangaroo","hop","australia"]},{emoji:"🦥",name:"sloth",category:"animals",keywords:["sloth","slow","lazy"]},{emoji:"🦦",name:"otter",category:"animals",keywords:["otter","water","cute"]},{emoji:"🦨",name:"skunk",category:"animals",keywords:["skunk","smell","stripe"]},{emoji:"🦡",name:"badger",category:"animals",keywords:["badger","honey","dig"]},{emoji:"🐾",name:"paw prints",category:"animals",keywords:["paw","prints","tracks"]},{emoji:"🐔",name:"chicken",category:"animals",keywords:["chicken","rooster","farm"]},{emoji:"🐓",name:"rooster",category:"animals",keywords:["rooster","cock","morning"]},{emoji:"🐣",name:"hatching chick",category:"animals",keywords:["chick","hatching","egg"]},{emoji:"🐤",name:"baby chick",category:"animals",keywords:["chick","baby","yellow"]},{emoji:"🐥",name:"front-facing baby chick",category:"animals",keywords:["chick","baby","cute"]},{emoji:"🦆",name:"duck",category:"animals",keywords:["duck","quack","water"]},{emoji:"🦅",name:"eagle",category:"animals",keywords:["eagle","bird","freedom"]},{emoji:"🦉",name:"owl",category:"animals",keywords:["owl","wise","night"]},{emoji:"🦇",name:"bat",category:"animals",keywords:["bat","vampire","night"]},{emoji:"",name:"bug",category:"animals",keywords:["bug","insect","crawl"]},{emoji:"🦋",name:"butterfly",category:"animals",keywords:["butterfly","beautiful","fly"]},{emoji:"🐌",name:"snail",category:"animals",keywords:["snail","slow","shell"]},{emoji:"🐞",name:"lady beetle",category:"animals",keywords:["ladybug","beetle","red"]},{emoji:"🐜",name:"ant",category:"animals",keywords:["ant","work","colony"]},{emoji:"🦟",name:"mosquito",category:"animals",keywords:["mosquito","bite","buzz"]},{emoji:"🕷️",name:"spider",category:"animals",keywords:["spider","web","eight legs"]},{emoji:"🦂",name:"scorpion",category:"animals",keywords:["scorpion","sting","desert"]},{emoji:"🐢",name:"turtle",category:"animals",keywords:["turtle","slow","shell"]},{emoji:"🐍",name:"snake",category:"animals",keywords:["snake","slither","reptile"]},{emoji:"🦎",name:"lizard",category:"animals",keywords:["lizard","gecko","reptile"]},{emoji:"🐙",name:"octopus",category:"animals",keywords:["octopus","tentacles","sea"]},{emoji:"🦑",name:"squid",category:"animals",keywords:["squid","tentacles","ocean"]},{emoji:"🦐",name:"shrimp",category:"animals",keywords:["shrimp","seafood","small"]},{emoji:"🦞",name:"lobster",category:"animals",keywords:["lobster","claws","red"]},{emoji:"🦀",name:"crab",category:"animals",keywords:["crab","claws","beach"]},{emoji:"🐡",name:"blowfish",category:"animals",keywords:["blowfish","puffer","spiky"]},{emoji:"🐠",name:"tropical fish",category:"animals",keywords:["fish","tropical","colorful"]},{emoji:"🐟",name:"fish",category:"animals",keywords:["fish","swim","water"]},{emoji:"🐬",name:"dolphin",category:"animals",keywords:["dolphin","smart","ocean"]},{emoji:"🐳",name:"spouting whale",category:"animals",keywords:["whale","spout","big"]},{emoji:"🐋",name:"whale",category:"animals",keywords:["whale","ocean","huge"]},{emoji:"🦈",name:"shark",category:"animals",keywords:["shark","teeth","dangerous"]},{emoji:"🐊",name:"crocodile",category:"animals",keywords:["crocodile","teeth","swamp"]},{emoji:"🌸",name:"cherry blossom",category:"animals",keywords:["flower","spring","pink"]},{emoji:"💐",name:"bouquet",category:"animals",keywords:["flowers","bouquet","gift"]},{emoji:"🌺",name:"hibiscus",category:"animals",keywords:["flower","tropical","red"]},{emoji:"🌻",name:"sunflower",category:"animals",keywords:["sunflower","yellow","big"]},{emoji:"🌹",name:"rose",category:"animals",keywords:["rose","love","red"]},{emoji:"🥀",name:"wilted flower",category:"animals",keywords:["flower","wilted","sad"]},{emoji:"🌷",name:"tulip",category:"animals",keywords:["tulip","spring","netherlands"]},{emoji:"🌼",name:"daisy",category:"animals",keywords:["daisy","white","simple"]},{emoji:"🌱",name:"seedling",category:"animals",keywords:["plant","grow","green"]},{emoji:"🌿",name:"herb",category:"animals",keywords:["herb","green","leaf"]},{emoji:"🍀",name:"four leaf clover",category:"animals",keywords:["clover","luck","green"]},{emoji:"🌳",name:"deciduous tree",category:"animals",keywords:["tree","nature","green"]},{emoji:"🌲",name:"evergreen tree",category:"animals",keywords:["tree","pine","christmas"]},{emoji:"🌴",name:"palm tree",category:"animals",keywords:["palm","tropical","beach"]},{emoji:"🌵",name:"cactus",category:"animals",keywords:["cactus","desert","spiky"]},{emoji:"🍎",name:"red apple",category:"food",keywords:["apple","fruit"]},{emoji:"🍊",name:"tangerine",category:"food",keywords:["orange","fruit"]},{emoji:"🍋",name:"lemon",category:"food",keywords:["lemon","fruit"]},{emoji:"🍌",name:"banana",category:"food",keywords:["banana","fruit"]},{emoji:"🍉",name:"watermelon",category:"food",keywords:["watermelon","fruit"]},{emoji:"🍇",name:"grapes",category:"food",keywords:["grapes","fruit"]},{emoji:"🍓",name:"strawberry",category:"food",keywords:["strawberry","fruit"]},{emoji:"🫐",name:"blueberries",category:"food",keywords:["blueberry","fruit"]},{emoji:"🥝",name:"kiwi fruit",category:"food",keywords:["kiwi","fruit","green"]},{emoji:"🍅",name:"tomato",category:"food",keywords:["tomato","red","vegetable"]},{emoji:"🫒",name:"olive",category:"food",keywords:["olive","green","oil"]},{emoji:"🥥",name:"coconut",category:"food",keywords:["coconut","tropical","milk"]},{emoji:"🥑",name:"avocado",category:"food",keywords:["avocado","green","healthy"]},{emoji:"🍆",name:"eggplant",category:"food",keywords:["eggplant","purple","vegetable"]},{emoji:"🥔",name:"potato",category:"food",keywords:["potato","vegetable","starch"]},{emoji:"🥕",name:"carrot",category:"food",keywords:["carrot","orange","vegetable"]},{emoji:"🌽",name:"ear of corn",category:"food",keywords:["corn","yellow","vegetable"]},{emoji:"🌶️",name:"hot pepper",category:"food",keywords:["pepper","hot","spicy"]},{emoji:"🫑",name:"bell pepper",category:"food",keywords:["pepper","bell","vegetable"]},{emoji:"🥒",name:"cucumber",category:"food",keywords:["cucumber","green","vegetable"]},{emoji:"🥬",name:"leafy greens",category:"food",keywords:["lettuce","greens","salad"]},{emoji:"🥦",name:"broccoli",category:"food",keywords:["broccoli","green","vegetable"]},{emoji:"🧄",name:"garlic",category:"food",keywords:["garlic","flavor","cooking"]},{emoji:"🧅",name:"onion",category:"food",keywords:["onion","cry","cooking"]},{emoji:"🍄",name:"mushroom",category:"food",keywords:["mushroom","fungi","cooking"]},{emoji:"🥜",name:"peanuts",category:"food",keywords:["peanuts","nuts","snack"]},{emoji:"🌰",name:"chestnut",category:"food",keywords:["chestnut","nut","autumn"]},{emoji:"🍞",name:"bread",category:"food",keywords:["bread","loaf","carbs"]},{emoji:"🥐",name:"croissant",category:"food",keywords:["croissant","french","pastry"]},{emoji:"🥖",name:"baguette bread",category:"food",keywords:["baguette","french","bread"]},{emoji:"🫓",name:"flatbread",category:"food",keywords:["flatbread","bread","thin"]},{emoji:"🥨",name:"pretzel",category:"food",keywords:["pretzel","twisted","snack"]},{emoji:"🥯",name:"bagel",category:"food",keywords:["bagel","round","breakfast"]},{emoji:"🥞",name:"pancakes",category:"food",keywords:["pancakes","breakfast","syrup"]},{emoji:"🧇",name:"waffle",category:"food",keywords:["waffle","breakfast","squares"]},{emoji:"🧀",name:"cheese wedge",category:"food",keywords:["cheese","dairy","yellow"]},{emoji:"🍖",name:"meat on bone",category:"food",keywords:["meat","bone","protein"]},{emoji:"🍗",name:"poultry leg",category:"food",keywords:["chicken","leg","meat"]},{emoji:"🥩",name:"cut of meat",category:"food",keywords:["steak","meat","red"]},{emoji:"🥓",name:"bacon",category:"food",keywords:["bacon","pork","breakfast"]},{emoji:"🍔",name:"hamburger",category:"food",keywords:["burger","hamburger","fast food"]},{emoji:"🍟",name:"french fries",category:"food",keywords:["fries","potato","fast food"]},{emoji:"🍕",name:"pizza",category:"food",keywords:["pizza","slice","italian"]},{emoji:"🌭",name:"hot dog",category:"food",keywords:["hot dog","sausage","fast food"]},{emoji:"🥪",name:"sandwich",category:"food",keywords:["sandwich","bread","lunch"]},{emoji:"🌮",name:"taco",category:"food",keywords:["taco","mexican","shell"]},{emoji:"🌯",name:"burrito",category:"food",keywords:["burrito","wrap","mexican"]},{emoji:"🫔",name:"tamale",category:"food",keywords:["tamale","mexican","corn"]},{emoji:"🥙",name:"stuffed flatbread",category:"food",keywords:["pita","flatbread","stuffed"]},{emoji:"🧆",name:"falafel",category:"food",keywords:["falafel","middle eastern","chickpea"]},{emoji:"🥚",name:"egg",category:"food",keywords:["egg","protein","breakfast"]},{emoji:"🍳",name:"cooking",category:"food",keywords:["cooking","frying pan","egg"]},{emoji:"🥘",name:"shallow pan of food",category:"food",keywords:["paella","pan","cooking"]},{emoji:"🍲",name:"pot of food",category:"food",keywords:["stew","pot","cooking"]},{emoji:"🫕",name:"fondue",category:"food",keywords:["fondue","cheese","pot"]},{emoji:"🥣",name:"bowl with spoon",category:"food",keywords:["bowl","cereal","soup"]},{emoji:"🥗",name:"green salad",category:"food",keywords:["salad","healthy","greens"]},{emoji:"🍿",name:"popcorn",category:"food",keywords:["popcorn","movie","snack"]},{emoji:"🧈",name:"butter",category:"food",keywords:["butter","dairy","spread"]},{emoji:"🧂",name:"salt",category:"food",keywords:["salt","seasoning","white"]},{emoji:"🥫",name:"canned food",category:"food",keywords:["can","canned","preserved"]},{emoji:"🍱",name:"bento box",category:"food",keywords:["bento","japanese","lunch box"]},{emoji:"🍘",name:"rice cracker",category:"food",keywords:["rice","cracker","japanese"]},{emoji:"🍙",name:"rice ball",category:"food",keywords:["rice ball","onigiri","japanese"]},{emoji:"🍚",name:"cooked rice",category:"food",keywords:["rice","cooked","bowl"]},{emoji:"🍛",name:"curry rice",category:"food",keywords:["curry","rice","spicy"]},{emoji:"🍜",name:"steaming bowl",category:"food",keywords:["ramen","noodles","soup"]},{emoji:"🍝",name:"spaghetti",category:"food",keywords:["spaghetti","pasta","italian"]},{emoji:"🍠",name:"roasted sweet potato",category:"food",keywords:["sweet potato","roasted","orange"]},{emoji:"🍢",name:"oden",category:"food",keywords:["oden","japanese","skewer"]},{emoji:"🍣",name:"sushi",category:"food",keywords:["sushi","japanese","fish"]},{emoji:"🍤",name:"fried shrimp",category:"food",keywords:["shrimp","fried","tempura"]},{emoji:"🍥",name:"fish cake with swirl",category:"food",keywords:["fish cake","japanese","swirl"]},{emoji:"🥮",name:"moon cake",category:"food",keywords:["moon cake","chinese","festival"]},{emoji:"🍡",name:"dango",category:"food",keywords:["dango","japanese","sweet"]},{emoji:"🥟",name:"dumpling",category:"food",keywords:["dumpling","chinese","steamed"]},{emoji:"🥠",name:"fortune cookie",category:"food",keywords:["fortune cookie","chinese","luck"]},{emoji:"🥡",name:"takeout box",category:"food",keywords:["takeout","chinese","box"]},{emoji:"🦀",name:"crab",category:"food",keywords:["crab","seafood","claws"]},{emoji:"🦞",name:"lobster",category:"food",keywords:["lobster","seafood","red"]},{emoji:"🦐",name:"shrimp",category:"food",keywords:["shrimp","seafood","small"]},{emoji:"🦑",name:"squid",category:"food",keywords:["squid","seafood","tentacles"]},{emoji:"🦪",name:"oyster",category:"food",keywords:["oyster","seafood","shell"]},{emoji:"🍦",name:"soft ice cream",category:"food",keywords:["ice cream","soft serve","cone"]},{emoji:"🍧",name:"shaved ice",category:"food",keywords:["shaved ice","snow cone","cold"]},{emoji:"🍨",name:"ice cream",category:"food",keywords:["ice cream","dessert","cold"]},{emoji:"🍩",name:"doughnut",category:"food",keywords:["donut","doughnut","sweet"]},{emoji:"🍪",name:"cookie",category:"food",keywords:["cookie","sweet","baked"]},{emoji:"🎂",name:"birthday cake",category:"food",keywords:["cake","birthday","celebration"]},{emoji:"🍰",name:"shortcake",category:"food",keywords:["cake","slice","dessert"]},{emoji:"🧁",name:"cupcake",category:"food",keywords:["cupcake","muffin","sweet"]},{emoji:"🥧",name:"pie",category:"food",keywords:["pie","dessert","slice"]},{emoji:"🍫",name:"chocolate bar",category:"food",keywords:["chocolate","bar","sweet"]},{emoji:"🍬",name:"candy",category:"food",keywords:["candy","sweet","wrapper"]},{emoji:"🍭",name:"lollipop",category:"food",keywords:["lollipop","candy","stick"]},{emoji:"🍮",name:"custard",category:"food",keywords:["custard","pudding","dessert"]},{emoji:"🍯",name:"honey pot",category:"food",keywords:["honey","sweet","bee"]},{emoji:"🍼",name:"baby bottle",category:"food",keywords:["bottle","baby","milk"]},{emoji:"🥛",name:"glass of milk",category:"food",keywords:["milk","glass","dairy"]},{emoji:"☕",name:"hot beverage",category:"food",keywords:["coffee","tea","hot"]},{emoji:"🫖",name:"teapot",category:"food",keywords:["teapot","tea","hot"]},{emoji:"🍵",name:"teacup without handle",category:"food",keywords:["tea","green tea","cup"]},{emoji:"🍶",name:"sake",category:"food",keywords:["sake","japanese","alcohol"]},{emoji:"🍾",name:"bottle with popping cork",category:"food",keywords:["champagne","celebration","cork"]},{emoji:"🍷",name:"wine glass",category:"food",keywords:["wine","glass","alcohol"]},{emoji:"🍸",name:"cocktail glass",category:"food",keywords:["cocktail","martini","alcohol"]},{emoji:"🍹",name:"tropical drink",category:"food",keywords:["tropical","cocktail","umbrella"]},{emoji:"🍺",name:"beer mug",category:"food",keywords:["beer","mug","alcohol"]},{emoji:"🍻",name:"clinking beer mugs",category:"food",keywords:["beer","cheers","celebration"]},{emoji:"🥂",name:"clinking glasses",category:"food",keywords:["champagne","cheers","celebration"]},{emoji:"🥃",name:"tumbler glass",category:"food",keywords:["whiskey","tumbler","alcohol"]},{emoji:"🫗",name:"pouring liquid",category:"food",keywords:["pour","liquid","drink"]},{emoji:"🥤",name:"cup with straw",category:"food",keywords:["soda","straw","drink"]},{emoji:"🧋",name:"bubble tea",category:"food",keywords:["bubble tea","boba","drink"]},{emoji:"🧃",name:"beverage box",category:"food",keywords:["juice box","drink","straw"]},{emoji:"🧉",name:"mate",category:"food",keywords:["mate","tea","south american"]},{emoji:"🧊",name:"ice",category:"food",keywords:["ice","cold","cube"]},{emoji:"⚽",name:"soccer ball",category:"activities",keywords:["soccer","football","sport"]},{emoji:"🏀",name:"basketball",category:"activities",keywords:["basketball","sport"]},{emoji:"🏈",name:"american football",category:"activities",keywords:["football","sport"]},{emoji:"⚾",name:"baseball",category:"activities",keywords:["baseball","sport"]},{emoji:"🥎",name:"softball",category:"activities",keywords:["softball","sport"]},{emoji:"🎾",name:"tennis",category:"activities",keywords:["tennis","sport"]},{emoji:"🚗",name:"automobile",category:"travel",keywords:["car","vehicle"]},{emoji:"🚕",name:"taxi",category:"travel",keywords:["taxi","car"]},{emoji:"🚙",name:"sport utility vehicle",category:"travel",keywords:["suv","car"]},{emoji:"🚌",name:"bus",category:"travel",keywords:["bus","vehicle"]},{emoji:"🚎",name:"trolleybus",category:"travel",keywords:["trolley","bus"]},{emoji:"🏎️",name:"racing car",category:"travel",keywords:["race","car","fast"]},{emoji:"💡",name:"light bulb",category:"objects",keywords:["idea","light","bulb"]},{emoji:"🔋",name:"battery",category:"objects",keywords:["battery","power"]},{emoji:"🖥️",name:"desktop computer",category:"objects",keywords:["computer","desktop"]},{emoji:"💻",name:"laptop",category:"objects",keywords:["laptop","computer"]},{emoji:"📱",name:"mobile phone",category:"objects",keywords:["phone","mobile"]},{emoji:"☎️",name:"telephone",category:"objects",keywords:["phone","telephone"]},{emoji:"❤️",name:"red heart",category:"symbols",keywords:["love","heart"]},{emoji:"🧡",name:"orange heart",category:"symbols",keywords:["love","heart"]},{emoji:"💛",name:"yellow heart",category:"symbols",keywords:["love","heart"]},{emoji:"💚",name:"green heart",category:"symbols",keywords:["love","heart"]},{emoji:"💙",name:"blue heart",category:"symbols",keywords:["love","heart"]},{emoji:"💜",name:"purple heart",category:"symbols",keywords:["love","heart"]},{emoji:"🖤",name:"black heart",category:"symbols",keywords:["love","heart"]},{emoji:"🤍",name:"white heart",category:"symbols",keywords:["love","heart"]},{emoji:"🏁",name:"chequered flag",category:"flags",keywords:["flag","race","finish"]},{emoji:"🚩",name:"triangular flag",category:"flags",keywords:["flag","warning"]},{emoji:"🏳️",name:"white flag",category:"flags",keywords:["flag","surrender"]},{emoji:"🏴",name:"black flag",category:"flags",keywords:["flag","pirate"]},{emoji:"🏳️‍🌈",name:"rainbow flag",category:"flags",keywords:["flag","rainbow","pride"]}],ai=e=>{const{value:o,defaultValue:t="",onChange:n,onEmojiSelect:a,isOpen:i,onOpen:s,onClose:c,closeOnSelect:d=!0,maxRecentEmojis:u=16,showRecentEmojis:m=!0,enabledCategories:g=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:h=[]}=e,[f,y]=p.useState(i??!1),[b,k]=p.useState(o??t),[C,j]=p.useState(""),[w,S]=p.useState("smileys"),[x,v]=p.useState([]),T=p.useRef(null),R=p.useRef(null),M=p.useMemo(()=>[...Tf,...h],[h]),E=p.useMemo(()=>{let H=M;if(w!=="recent"?H=H.filter(D=>D.category===w):H=x,C){const D=C.toLowerCase();H=H.filter(L=>L.name.toLowerCase().includes(D)||L.keywords.some(B=>B.toLowerCase().includes(D)))}return H},[M,w,x,C]);p.useEffect(()=>{o!==void 0&&k(o)},[o]),p.useEffect(()=>{i!==void 0&&y(i)},[i]),p.useEffect(()=>{if(m&&typeof localStorage<"u"){const H=localStorage.getItem("emojiPicker-recentEmojis");if(H)try{v(JSON.parse(H))}catch{}}},[m]),p.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)!="function")return;const H=D=>{f&&T.current&&R.current&&!T.current.contains(D.target)&&!R.current.contains(D.target)&&F()};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[f]);const I=p.useCallback(H=>{m&&v(D=>{const L=D.filter($=>$.emoji!==H.emoji),B=[H,...L].slice(0,u);return typeof localStorage<"u"&&localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(B)),B})},[m,u]),V=p.useCallback(()=>{const H=!f;y(H),H?(s==null||s(),j(""),m&&x.length>0?S("recent"):S("smileys")):c==null||c()},[f,s,c,m,x.length]),P=p.useCallback(H=>{k(H.emoji),I(H),n==null||n(H.emoji),a==null||a(H),d&&(y(!1),c==null||c())},[n,a,d,c,I]),z=p.useCallback(H=>{j(H),H&&w==="recent"&&S("smileys")},[w]),W=p.useCallback(H=>{S(H),j("")},[]),F=p.useCallback(()=>{y(!1),c==null||c()},[c]);return{isOpen:f,selectedEmoji:b,recentEmojis:x,searchQuery:C,activeCategory:w,filteredEmojis:E,handleToggle:V,handleEmojiSelect:P,handleSearchChange:z,handleCategoryChange:W,handleClose:F,triggerRef:T,dropdownRef:R}},li=({id:e,name:o,label:t,placeholder:n="Select an emoji",helperText:a,views:i={},size:s="md",shape:c="default",variant:d="default",error:u=!1,isDisabled:m=!1,isReadOnly:g=!1,showSearch:h=!0,showCategories:f=!0,showRecentEmojis:y=!0,enabledCategories:b=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:k,selectedEmoji:C,recentEmojis:j,searchQuery:w,activeCategory:S,filteredEmojis:x,handleToggle:v,handleEmojiSelect:T,handleSearchChange:R,handleCategoryChange:M,handleClose:E,triggerRef:I,dropdownRef:V,onChange:P,onOpen:z,onClose:W,onEmojiSelect:F,customEmojis:H,closeOnSelect:D,maxRecentEmojis:L,value:B,defaultValue:$,...O})=>{const{getColor:N}=l.useTheme(),_={...Ge.container,...i==null?void 0:i.container},Y={...Ge.trigger,...Sf[s],...jf[c],...wf[d],...u&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...!m&&!g&&{_hover:{borderColor:"color-gray-300"}},...i==null?void 0:i.trigger},A={...Ge.dropdown,...i==null?void 0:i.dropdown},G={...Ge.categoryTabs,...i==null?void 0:i.categoryTabs},Q={...Ge.emojiGrid,...i==null?void 0:i.emojiGrid},X=b.filter(K=>K==="recent"?y&&j.length>0:!0);return r.jsxs(l.View,{..._,...O,children:[t&&r.jsx(l.Text,{fontSize:s==="xs"?"12px":s==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...i==null?void 0:i.label,children:t}),r.jsxs(l.View,{ref:I,onClick:m||g?void 0:v,...Y,children:[r.jsx(l.Horizontal,{alignItems:"center",gap:8,children:r.jsx(l.Text,{color:C?"color-gray-800":"color-gray-500",fontSize:"inherit",children:C||n})}),!g&&!m&&r.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:k?"up":"down"})]}),k&&r.jsxs(l.View,{ref:V,...A,children:[h&&r.jsx(l.View,{...Ge.searchInput,...i==null?void 0:i.searchInput,children:r.jsx(ve,{placeholder:"Search emojis...",value:w,onChange:K=>R(K.target.value),size:"sm"})}),f&&r.jsx(l.View,{...G,children:X.map(K=>r.jsx(l.View,{...Ge.categoryTab,...S===K&&{borderBottomColor:"theme-primary",color:"theme-primary",backgroundColor:"color-blue-50"},onClick:()=>M(K),title:K.charAt(0).toUpperCase()+K.slice(1),...i==null?void 0:i.categoryTab,children:vf[K]},K))}),r.jsx(l.View,{...Q,children:x.length>0?x.map((K,oe)=>r.jsx(l.View,{...Ge.emoji,onClick:()=>T(K),title:K.name,_hover:{backgroundColor:"color-gray-50",transform:"scale(1.05)"},color:"color-gray-800",...i==null?void 0:i.emoji,children:K.emoji},`${K.emoji}-${oe}`)):r.jsx(l.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(l.Text,{fontSize:"14px",children:w?"No emojis found":"No emojis in this category"})})})]}),a&&r.jsx(l.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},If=e=>{const o=fe(e),t={...e,value:o.value??e.value??e.defaultValue},n=ai(t),a=i=>{var s;n.handleEmojiSelect(i),o.onChange(i.emoji),(s=e.onEmojiSelect)==null||s.call(e,i)};return r.jsx(li,{...n,...t,handleEmojiSelect:a})},Ff=If,Rf=({files:e,onRemove:o,maxHeight:t="120px",views:n={}})=>{if(e.length===0)return null;const a=p.useCallback(i=>i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(l.View,{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 0",maxHeight:t,overflowY:"auto",...n==null?void 0:n.container,children:e.map((i,s)=>{const c=i.url||"",d=i.type.startsWith("image/"),u=i.type.startsWith("video/"),m=i.type.startsWith("audio/");return r.jsx(l.Vertical,{alignItems:"center",gap:"6px",padding:"6px 10px",borderRadius:"8px",border:"1px solid #E2E8F0",backgroundColor:"color-white",position:"relative",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...n==null?void 0:n.item,children:r.jsxs(Se,{children:[r.jsx(Se.Trigger,{children:r.jsxs(l.View,{position:"relative",children:[d&&c&&r.jsx(l.Image,{src:c,alt:i.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"8px"}),u&&c&&r.jsx(l.View,{as:"video",src:c,alt:i.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"8px"}),m&&r.jsx(l.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-100",borderRadius:"8px",children:r.jsx(Ro,{widthHeight:24,color:"color-black"})}),!d&&!u&&!m&&r.jsx(l.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-100",borderRadius:"8px",children:r.jsx(ao,{widthHeight:24,color:"color-black"})}),o&&r.jsx(l.Button,{position:"absolute",top:"-4px",right:"-4px",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",backgroundColor:"color-red-500",color:"white",fontSize:14,fontWeight:"bold",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"2px solid white",transition:"background-color 0.2s ease, opacity 0.2s ease",_hover:{backgroundColor:"#DC2626"},onClick:g=>{g.stopPropagation(),o(s)},"aria-label":`Remove ${i.name}`,children:"×"})]})}),r.jsxs(Se.Content,{children:[d&&c&&r.jsx(l.Image,{src:c,alt:i.name,maxWidth:"300px"}),u&&c&&r.jsx(l.View,{as:"video",src:c,controls:!0,maxWidth:"300px"}),m&&c&&r.jsx(l.View,{as:"audio",src:c,controls:!0,width:"100%"}),r.jsxs(l.Text,{marginTop:"4px",maxLines:1,width:"100%",fontSize:12,...n==null?void 0:n.name,children:[i.name," (",a(i.size),")"]})]})]})},s)})})},zf=e=>{const o=ge("slider",e),t=Xl(o);return r.jsx(Jl,{...o,...t})},ii=zf,Mf=({url:e,type:o,name:t,onOpen:n})=>{const a=o.toLowerCase(),i=a.startsWith("image"),s=a.startsWith("video"),c=a.startsWith("audio"),d=()=>{n&&n()};return r.jsxs(l.View,{width:"60px",height:"60px",flexShrink:0,borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-200",cursor:"pointer",onClick:d,children:[i&&r.jsx(l.Image,{src:e,alt:t,width:"100%",height:"100%",objectFit:"cover"}),s&&r.jsx(l.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:u=>u.stopPropagation()}),c&&r.jsx(l.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:u=>u.stopPropagation()}),!i&&!s&&!c&&r.jsx(ao,{widthHeight:24,color:"color-gray-600"})]})},Ke=Ho.create(e=>({modals:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},n={})=>{e(a=>({...a,modals:[...a.modals,{name:o,props:{...t,isVisible:!0},overlayProps:n}]}))},hide:o=>{e(t=>o?{...t,modals:t.modals.filter(n=>n.name!==o)}:{modals:[]})},setOnHide:o=>{e(t=>({...t,onHide:o}))},setOnShow:o=>{e(t=>({...t,onShow:o}))}})),Wf=(e,o={},t={})=>{Ke.getState().show(e,o,t),Ke.getState().onShow(e,o)},dn=e=>{Ke.getState().onHide(e),Ke.getState().hide(typeof e=="string"?e:void 0)},Hf={square:{borderRadius:0},rounded:{borderRadius:8}},Pf={center:{justifyContent:"center",alignItems:"center"},top:{justifyContent:"center",alignItems:"flex-start"},right:{justifyContent:"flex-end",alignItems:"center"},bottom:{justifyContent:"center",alignItems:"flex-end"},left:{justifyContent:"flex-start",alignItems:"center"}},Vf={xs:12,sm:16,md:20,lg:24,xl:28},it={body:{fontSize:"16px",fontWeight:"400",color:"color-gray-700"}},si=p.memo(({children:e,blur:o,isOpen:t=!1,isClosePrevented:n=!1,onClose:a=()=>{},position:i="center",views:s,...c})=>{const d=p.useCallback(()=>{n||a()},[n,a]);return r.jsx(l.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:d,visibility:t?"visible":"hidden",opacity:t?1:0,transition:"opacity 0.2s ease, visibility 0.2s ease",...s==null?void 0:s.container,children:r.jsx(l.View,{position:"absolute",top:0,left:0,zIndex:1e3,width:"100vw",height:"100vh",display:"flex",backgroundColor:"color-blackAlpha-500",backdropFilter:o?`blur(${o}px)`:void 0,transition:"background-color 0.2s ease, backdrop-filter 0.2s ease",onClick:d,...Pf[i],...c,...s==null?void 0:s.view,children:e})})}),Af={boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"},Ef={elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},Df=p.memo(({children:e,shadow:o,isFullScreen:t=!1,shape:n="rounded",views:a,isOpen:i=!0,position:s,...c})=>{const d=typeof document!==void 0?Af:Ef,u=p.useCallback(m=>{m&&m.stopPropagation&&m.stopPropagation()},[]);return r.jsx(l.Vertical,{cursor:"default",backgroundColor:"color-white",width:t?"100%":600,height:t?"100%":"fit-content",onClick:u,transition:"opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",opacity:i?1:0,transform:i?"translateY(0)":"translateY(8px)",...o||d,...Hf[n],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...c,...a==null?void 0:a.container,children:e})}),$f=p.memo(({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:n="right",views:a,onClose:i,...s})=>{const c=i||dn,d=r.jsx(l.View,{onClick:c,children:r.jsx(Te,{widthHeight:Vf[t],color:o})});return r.jsxs(l.Horizontal,{justifyContent:n==="none"?"center":"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:24,borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",media:{mobile:{paddingVertical:12,paddingHorizontal:16}},...s,...a==null?void 0:a.header,children:[n==="left"&&d,e,n==="right"&&d]})}),Lf=p.memo(({children:e,views:o,...t})=>r.jsx(l.View,{paddingVertical:16,paddingHorizontal:24,fontSize:it.body.fontSize,fontWeight:it.body.fontWeight,color:it.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e})),_f=p.memo(({children:e,views:o,...t})=>r.jsx(l.Horizontal,{marginTop:"auto",alignItems:"center",justifyContent:"flex-end",paddingVertical:16,paddingHorizontal:24,borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",gap:12,media:{mobile:{paddingVertical:12,paddingHorizontal:16,gap:8}},...t,...o==null?void 0:o.container,children:e})),un=({modals:e,onShow:o,onHide:t})=>{const n=Ke(a=>a.modals);return p.useEffect(()=>{o&&Ke.getState().setOnShow(o)},[o]),p.useEffect(()=>{t&&Ke.getState().setOnHide(t)},[t]),n.length===0?null:r.jsx(p.Fragment,{children:n.map((a,i)=>{const s=e[a.name];return s?r.jsx(si,{isOpen:a.props.isVisible,onClose:()=>dn(a.name),blur:5,...a.overlayProps,style:{zIndex:1e3+i},children:r.jsx(s,{...a.props})},i):(console.error(`${a.name} modal doesn't exist`),null)})})},so=({children:e})=>r.jsx(r.Fragment,{children:e});so.Overlay=si;so.Container=Df;so.Header=$f;so.Body=Lf;so.Footer=_f;so.Layout=un;const oa={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},Bf={left:{top:0,left:0,bottom:0,height:"100vh",borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{top:0,right:0,bottom:0,height:"100vh",borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"},top:{top:0,left:0,right:0,width:"100vw",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},bottom:{bottom:0,left:0,right:0,width:"100vw",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200"}},pn=({isOpen:e,onClose:o,isClosePrevented:t,blur:n,children:a,...i})=>{const s=()=>{t||o()};return p.useEffect(()=>{const c=d=>{d.key==="Escape"&&e&&!t&&o()};return e&&document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[e,t,o]),r.jsx(l.View,{"data-testid":"drawer-overlay",role:"dialog","aria-modal":"true",position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:1e3,visibility:e?"visible":"hidden",onClick:s,opacity:e?1:0,transition:"opacity 0.2s ease, visibility 0.2s ease, background-color 0.2s ease",backgroundColor:e?"color-blackAlpha-500":"transparent",backdropFilter:n?`blur(${n}px)`:void 0,pointerEvents:e?"auto":"none",...i,children:a})},mn=({placement:e="right",size:o="md",isOpen:t=!1,children:n,...a})=>{const i=m=>{m.stopPropagation()},c=e==="top"||e==="bottom"?{height:o==="full"?"100vh":oa[o]||o,maxHeight:"100vh"}:{width:o==="full"?"100vw":oa[o]||o,maxWidth:"100vw"},d=e==="left"?"0 12px 12px 0":e==="right"?"12px 0 0 12px":e==="top"?"0 0 12px 12px":"12px 12px 0 0",u=t?"translate3d(0, 0, 0)":e==="left"?"translate3d(-100%, 0, 0)":e==="right"?"translate3d(100%, 0, 0)":e==="top"?"translate3d(0, -100%, 0)":"translate3d(0, 100%, 0)";return r.jsx(l.Vertical,{position:"absolute",backgroundColor:"color-white",borderRadius:d,...Bf[e],...c,onClick:i,transform:u,willChange:"transform",transition:"transform 0.24s ease, box-shadow 0.2s ease",boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12)",...a,children:n})},Of=({children:e,onClose:o,buttonPosition:t="right",...n})=>{const a=o&&r.jsx(l.View,{onClick:o,cursor:"pointer",padding:8,children:r.jsx(Te,{widthHeight:20,color:"color-gray-500"})});return r.jsxs(l.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:t==="none"?"center":"space-between",...n,children:[t==="left"&&a,e,t==="right"&&a]})},Nf=({children:e,...o})=>r.jsx(l.Vertical,{padding:24,flex:1,overflowY:"auto",...o,children:e}),qf=({children:e,...o})=>r.jsx(l.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...o,children:e}),Xe=Ho.create(e=>({drawers:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},n={})=>{e(a=>({...a,drawers:[...a.drawers,{name:o,props:{...t,isOpen:!1},overlayProps:n}]}))},hide:o=>{e(t=>o?{...t,drawers:t.drawers.filter(n=>n.name!==o)}:{drawers:[]})},setOnHide:o=>{e(t=>({...t,onHide:o}))},setOnShow:o=>{e(t=>({...t,onShow:o}))}})),Uf=(e,o={},t={})=>{const n=Xe.getState();n.hide(e),n.show(e,o,t),n.onShow(e,o),queueMicrotask(()=>{Xe.setState(a=>({drawers:a.drawers.map(i=>i.name===e?{...i,props:{...i.props,isOpen:!0}}:i)}))})},ci=e=>{Xe.getState().onHide(e),Xe.getState().hide(typeof e=="string"?e:void 0)},Gf=({drawers:e,onShow:o,onHide:t})=>{const n=Xe(a=>a.drawers);return p.useEffect(()=>{o&&Xe.getState().setOnShow(o)},[o]),p.useEffect(()=>{t&&Xe.getState().setOnHide(t)},[t]),n.length===0?null:r.jsx(p.Fragment,{children:n.map((a,i)=>{var f;const s=e[a.name];if(!s)return console.error(`${a.name} drawer doesn't exist`),null;const{placement:c,size:d,isClosePrevented:u,blur:m,containerProps:g,...h}=a.props||{};return r.jsx(pn,{isOpen:a.props.isOpen,onClose:()=>ci(a.name),isClosePrevented:u,blur:m,...a.overlayProps,style:{zIndex:1e3+i,...((f=a.overlayProps)==null?void 0:f.style)||{}},children:r.jsx(mn,{placement:c,size:d,isOpen:a.props.isOpen,...g||{},children:r.jsx(p.Suspense,{fallback:null,children:r.jsx(s,{...h})})})},i)})})},Yf=({isOpen:e,onClose:o,placement:t="right",size:n="md",isClosePrevented:a,children:i,...s})=>r.jsx(pn,{isOpen:e,onClose:o,isClosePrevented:a,...s,children:r.jsx(mn,{placement:t,size:n,isOpen:e,children:i})}),co=Yf;co.Overlay=pn;co.Container=mn;co.Header=Of;co.Body=Nf;co.Footer=qf;co.Layout=Gf;const di=({behavior:e,keyboardVerticalOffset:o,dismissOnTap:t,enabled:n,children:a,...i})=>r.jsx(l.View,{flex:1,width:"100%",...i,children:a}),Kf=({header:e,footer:o,children:t,isLoading:n=!1,safe:a=!0,scrollable:i=!0,dismissKeyboardOnTap:s=!0,keyboardVerticalOffset:c=0,views:d={},backgroundColor:u="color-white",...m})=>{const g=a?l.SafeArea:l.View,h=l.isBrowser()?{}:{keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:!1,contentContainerStyle:{flexGrow:1}},f=n?r.jsx(l.Center,{flex:1,width:"100%",...d.content,children:r.jsx(Je,{})}):i?r.jsx(l.Scroll,{flex:1,width:"100%",...h,...d.content,children:t}):r.jsx(l.View,{flex:1,width:"100%",...d.content,children:t});return r.jsxs(g,{flex:1,height:"100%",width:"100%",flexDirection:"column",backgroundColor:u,...m,...d.container,children:[e!=null&&r.jsx(l.View,{width:"100%",flexShrink:0,...d.header,children:e}),r.jsxs(di,{flexDirection:"column",dismissOnTap:s,keyboardVerticalOffset:c,children:[f,o!=null&&r.jsx(l.View,{width:"100%",flexShrink:0,...d.footer,children:o})]})]})},Nr=Ho.create(e=>({started:!1,loaded:!1,setStarted:(o=!0)=>e({started:o}),setLoaded:(o=!0)=>e({loaded:o}),reset:()=>e({started:!1,loaded:!1})})),Xf=(e=!0)=>Nr.getState().setLoaded(e),Jf=(e=!0)=>Nr.getState().setStarted(e),Qf=({logo:e,logoSrc:o,loader:t,showLoader:n=!0,duration:a=600,isLoaded:i,onHidden:s,backgroundColor:c="color-white",children:d,...u})=>{const m=Nr(w=>w.loaded),g=i!==void 0?i:m,[h,f]=p.useState(!0),[y,b]=p.useState(!1);if(p.useEffect(()=>{if(!g||y)return;b(!0);const w=setTimeout(()=>{f(!1),s==null||s()},a);return()=>clearTimeout(w)},[g,y,a,s]),!h)return null;const k=l.isBrowser()?"fixed":"absolute",C=y?l.Animation.fadeOut({duration:`${a}ms`}):void 0,j=e??(o?r.jsx(l.Image,{src:o,width:120,height:120,alt:"logo"}):null);return r.jsxs(l.Center,{position:k,top:0,left:0,right:0,bottom:0,zIndex:9999,backgroundColor:c,animate:C,...u,children:[r.jsxs(l.Vertical,{alignItems:"center",gap:24,children:[j,n&&(t??r.jsx(Je,{}))]}),d]})},Ee=Ho.create((e,o)=>({stack:[{path:"/",params:{}}],index:0,push:(t,n={})=>e(a=>{const i=a.stack.slice(0,a.index+1);return i.push({path:t,params:n}),{stack:i,index:i.length-1}}),replace:(t,n={})=>e(a=>{const i=a.stack.slice();return i[a.index]={path:t,params:n},{stack:i}}),back:()=>{const{index:t}=o();return t<=0?!1:(e({index:t-1}),!0)},go:t=>e(n=>({index:Math.min(Math.max(n.index+t,0),n.stack.length-1)})),reset:(t,n={})=>e({stack:[{path:t,params:n}],index:0})})),Zf=(e,o)=>Ee.getState().push(e,o),ey=()=>Ee.getState().back(),gn=()=>{const e=Ee(d=>d.stack),o=Ee(d=>d.index),t=Ee(d=>d.push),n=Ee(d=>d.replace),a=Ee(d=>d.back),i=Ee(d=>d.go),s=Ee(d=>d.reset),c=e[o]||{path:"/",params:{}};return{path:c.path,params:c.params,stack:e,index:o,canGoBack:o>0,push:t,replace:n,back:a,go:i,reset:s,navigate:t}},ui=(e,o)=>{const t=e.split("/").filter(Boolean),n=o.split("/").filter(Boolean);if(t.length!==n.length)return null;const a={};for(let i=0;i<t.length;i+=1){const s=t[i];if(s.startsWith(":"))a[s.slice(1)]=decodeURIComponent(n[i]);else if(s!==n[i])return null}return a},oy=e=>Array.isArray(e)?e:Object.entries(e).map(([o,t])=>({path:o,component:t})),ry=({routes:e,notFound:o})=>{const{path:t,params:n}=gn();for(const a of oy(e)){const i=ui(a.path,t);if(i){const s=a.component;return r.jsx(s,{...n,...i})}}return o?r.jsx(o,{}):null},ty=({routes:e,notFound:o,initialPath:t,syncBrowserHistory:n=!1})=>{const{path:a,push:i,back:s,reset:c}=gn(),d=p.useRef(!1);return l.useMount(()=>{t&&c(t)}),p.useEffect(()=>{if(!(!n||typeof window>"u")){if(d.current){d.current=!1;return}try{window.history.pushState({path:a},"",a)}catch{}}},[a,n]),p.useEffect(()=>{if(!n||typeof window>"u")return;const u=()=>{d.current=!0,s()||(d.current=!1)};return window.addEventListener("popstate",u),()=>window.removeEventListener("popstate",u)},[n,s,i]),r.jsx(ry,{routes:e,notFound:o})},ny=(e=null,o=[])=>{const[t,n]=p.useState(e),[a,i]=p.useState(o),s=p.useRef({});return{activeItemId:t,setActiveItemId:n,expandedItemIds:a,toggleExpandedItem:u=>{i(m=>m.includes(u)?m.filter(h=>h!==u):[...m,u])},isItemExpanded:u=>a.includes(u),triggerRefs:s}},jt={sm:{padding:"8px 12px",fontSize:"12px",fontWeight:"500",media:{mobile:{padding:"6px 10px",fontSize:"11px"}}},md:{padding:"10px 14px",fontSize:"14px",fontWeight:"500",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},lg:{padding:"12px 16px",fontSize:"14px",fontWeight:"600",media:{mobile:{padding:"10px 14px",fontSize:"12px"}}}},wt={default:{color:"color-gray-800",style:{backgroundColor:"transparent"},transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"},outline:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",style:{backgroundColor:"transparent"},transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"}},pi={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},vo={active:{backgroundColor:"color-blue-50",color:"color-blue-700",fontWeight:"600",borderLeft:"3px solid",borderColor:"color-blue-600"},hover:{backgroundColor:"color-gray-100",transition:"background-color 0.2s ease"}},mi=p.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),ay=({children:e,value:o})=>r.jsx(mi.Provider,{value:o,children:e}),ar=()=>{const e=p.useContext(mi);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},hn=({children:e,views:o})=>{const{orientation:t}=ar(),n=t==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(n,{width:"100%",...pi[t],transition:"background-color 0.2s ease, border-color 0.2s ease",borderRadius:"8px",...o==null?void 0:o.container,children:e})},gi=p.createContext({itemValue:null,isDisabled:!1}),ly=()=>{const e=p.useContext(gi);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},fn=({item:e,value:o,isDisabled:t=!1,children:n,views:a})=>{var C;const{activeItemId:i,setActiveItemId:s,orientation:c,size:d,variant:u,onItemActivate:m}=ar(),g=(e==null?void 0:e.id)||o,h=i===g,f=(e==null?void 0:e.items)&&e.items.length>0,y=(e==null?void 0:e.disabled)||t,b=()=>{y||g&&(s(g),m&&m(g))},k=c==="horizontal"?l.Horizontal:l.Vertical;return n?r.jsx(gi.Provider,{value:{itemValue:g||null,isDisabled:y},children:r.jsx(l.View,{width:"100%",cursor:y?"not-allowed":"pointer",opacity:y?.6:1,borderRadius:"8px",transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease",...jt[d],...wt[u],...h?vo.active:{},_hover:y?{}:vo.hover,...a==null?void 0:a.item,children:n})}):f&&e?r.jsxs(k,{width:"100%",flexDirection:"column",position:"relative",...a==null?void 0:a.item,children:[r.jsxs(hi,{itemId:e.id,disabled:e.disabled,views:a,children:[e.icon&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}),r.jsx(fi,{itemId:e.id,children:r.jsx(hn,{children:(C=e.items)==null?void 0:C.map(j=>r.jsx(fn,{item:j},j.id))})})]}):e?r.jsxs(l.View,{as:e.href?"a":"div",href:e.href,onClick:b,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.6:1,width:"100%",display:"flex",alignItems:"center",borderRadius:"8px",transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease",gap:"8px",...jt[d],...wt[u],...h?vo.active:{},_hover:e.disabled?{}:vo.hover,...a==null?void 0:a.item,children:[e.icon&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}):null},hi=({children:e,itemId:o,disabled:t,views:n})=>{const{activeItemId:a,toggleExpandedItem:i,isItemExpanded:s,size:c,variant:d,triggerRefs:u}=ar(),m=p.useRef(null),g=a===o,h=s(o);p.useEffect(()=>(m.current&&o&&(u.current[o]=m.current),()=>{o&&delete u.current[o]}),[o,u]);const f=y=>{y.preventDefault(),!t&&i(o)};return r.jsxs(l.View,{ref:m,onClick:f,cursor:t?"not-allowed":"pointer",opacity:t?.5:1,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:8,transition:"background-color 0.2s ease",...jt[c],...wt[d],...g?vo.active:{},_hover:t?{}:vo.hover,...n==null?void 0:n.trigger,children:[r.jsx(l.View,{display:"flex",alignItems:"center",children:e}),r.jsx(l.View,{transition:"transform 0.2s ease",transform:h?"rotate(180deg)":"rotate(0deg)",...n==null?void 0:n.indicator,children:r.jsx(ce,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},fi=({children:e,itemId:o,views:t})=>{const{isItemExpanded:n,orientation:a,triggerRefs:i}=ar(),s=p.useRef(null),[c,d]=p.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=n(o);if(p.useEffect(()=>{if(u&&s.current&&o&&i.current[o]&&a==="horizontal"){const g=s.current.getBoundingClientRect(),h=i.current[o].getBoundingClientRect(),f=Math.max(g.width||200,200),y=Math.max(g.height||150,150),b=window.innerWidth,k=window.innerHeight,C={top:h.top,right:b-h.right,bottom:k-h.bottom,left:h.left},j=a==="horizontal"?[{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:h.left,y:h.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:h.left,y:h.top-y-8},{placement:"right",space:C.right,fits:C.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:C.left,fits:C.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:C.right,fits:C.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:C.left,fits:C.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:h.left,y:h.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:h.left,y:h.top-y-8}],w=j.find(T=>T.fits);if(w){d({x:w.x,y:w.y,placement:w.placement});return}const S=j.reduce((T,R)=>R.space>T.space?R:T);let x=S.x,v=S.y;x+f>b&&(x=b-f-8),x<8&&(x=8),v+y>k&&(v=k-y-8),v<8&&(v=8),d({x,y:v,placement:S.placement})}},[u,a,o,i]),!u)return null;if(a==="vertical")return r.jsx(l.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...t==null?void 0:t.container,children:e});const m={position:"fixed",left:c.x,top:c.y,zIndex:1e3};return r.jsx(l.View,{ref:s,role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:m,...t==null?void 0:t.container,children:e})},iy=({href:e,children:o,views:t,underline:n,isExternal:a,iconSize:i,...s})=>{const{itemValue:c,isDisabled:d}=ly(),{activeItemId:u,setActiveItemId:m,onItemActivate:g}=ar(),h=u===c,f=y=>{if(d){y.preventDefault();return}c&&(m(c),g&&g(c)),s.onClick&&s.onClick(y)};return r.jsx(l.View,{as:"a",href:d?void 0:e,onClick:f,cursor:d?"not-allowed":"pointer",opacity:d?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":h?"page":void 0,"aria-disabled":d,"data-active":h?"":void 0,"data-disabled":d?"":void 0,...h?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...s,children:o})},sy=({items:e,orientation:o,views:t,themeMode:n})=>{const a=o==="horizontal"?l.Horizontal:l.Vertical;return!e||e.length===0?null:r.jsx(a,{width:"100%",...pi[o],...t==null?void 0:t.container,children:r.jsx(hn,{views:t,children:e.map(i=>r.jsx(fn,{item:i,views:t},i.id))})})},cy=e=>{const o=ge("navigation",e),{items:t,children:n,orientation:a="vertical",size:i="md",variant:s="default",defaultActiveItemId:c=null,defaultExpandedItemIds:d=[],onItemActivate:u,views:m,...g}=o,{activeItemId:h,setActiveItemId:f,expandedItemIds:y,toggleExpandedItem:b,isItemExpanded:k,triggerRefs:C}=ny(c,d);return r.jsx(ay,{value:{activeItemId:h,setActiveItemId:f,expandedItemIds:y,toggleExpandedItem:b,isItemExpanded:k,orientation:a,size:i,variant:s,onItemActivate:u,triggerRefs:C},children:t?r.jsx(sy,{items:t,orientation:a,size:i,variant:s,views:m,...g}):n})},uo=cy;uo.List=hn;uo.Item=fn;uo.Trigger=hi;uo.Content=fi;uo.Link=iy;const yi={},xi=p.createContext({views:yi,onRowClick:()=>{}}),dy=({children:e,views:o=yi,onRowClick:t})=>r.jsx(xi.Provider,{value:{views:o,onRowClick:t},children:e}),eo=()=>p.useContext(xi),he={table:{width:"100%",color:"inherit",borderRadius:"8px",overflow:"hidden",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04)",border:"1px solid",borderColor:"color-gray-200",transition:"box-shadow 0.2s ease",media:{mobile:{overflowX:"auto",display:"block",borderRadius:"4px"}}},thead:{backgroundColor:"color-gray-50",borderBottom:"1px solid",borderColor:"color-gray-200"},th:{padding:"12px 16px",fontWeight:"600",fontSize:"14px",color:"inherit",opacity:.72,textAlign:"left",flex:1,media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},td:{padding:"12px 16px",fontSize:"14px",borderBottom:"1px solid",borderColor:"color-gray-100",color:"inherit",flex:1,media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},tr:{flexDirection:"row",alignItems:"stretch",width:"100%",transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"}},tfoot:{backgroundColor:"color-gray-50",fontWeight:"600",borderTop:"2px solid",borderColor:"color-gray-200"},caption:{margin:"8px 0",color:"inherit",opacity:.62,fontSize:"14px",fontStyle:"italic",media:{mobile:{fontSize:"12px"}}}};({...he.th},{...he.td});({...he.tr});({...he.td},{...he.th});({...he.table},{...he.th}),{...he.td},{...he.tr},{...he.tfoot},{...he.caption};const uy=({children:e})=>r.jsx(l.View,{width:"100%",style:{overflowX:"auto"},children:e}),bi=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"table",...he.table,...o==null?void 0:o.table,...e,style:{borderCollapse:"collapse",...e.style||{}}})},ki=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"thead",textAlign:"left",...he.thead,...o==null?void 0:o.thead,...e})},Ci=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"th",whiteSpace:"nowrap",...he.th,...o==null?void 0:o.th,...e})},br=e=>{const{views:o,onRowClick:t}=eo();return r.jsx(l.Element,{as:"tr",...he.tr,...o==null?void 0:o.tr,onClick:t,...e})},vt=({isFirstColumn:e,...o})=>{const{views:t}=eo();return r.jsx(l.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e?"500":"400",...he.td,...t==null?void 0:t.td,...o})},Si=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"tbody",...he.tbody,...o==null?void 0:o.tbody,...e})},ji=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"tfoot",...he.tfoot,...o==null?void 0:o.tfoot,...e})},wi=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"caption",...he.caption,...o==null?void 0:o.caption,...e})},py=({data:e,columns:o,footer:t,caption:n,themeMode:a})=>{const i=Math.max(o.length*140,320);return r.jsx(uy,{children:r.jsxs(bi,{role:"Table",minWidth:i,children:[n&&r.jsx(wi,{children:n}),r.jsx(ki,{children:r.jsx(br,{children:o.map(s=>r.jsx(Ci,{children:s.title},s.field))})}),r.jsx(Si,{children:e.map((s,c)=>r.jsx(br,{children:o.map((d,u)=>r.jsx(vt,{isFirstColumn:u===0,children:s[d.field]},d.field))},c))}),t&&r.jsx(ji,{children:r.jsx(br,{children:t.map((s,c)=>r.jsx(vt,{...s.props,children:s.value},c))})})]})})},Fe=({children:e,views:o,onClick:t})=>{const n=ge("table",{views:o,onClick:t});return r.jsx(dy,{views:n.views,onRowClick:n.onClick,children:e})};Fe.Head=ki;Fe.HeadCell=Ci;Fe.Body=Si;Fe.Row=br;Fe.Cell=vt;Fe.Footer=ji;Fe.Caption=wi;Fe.Container=bi;Fe.Template=py;const my=(e,o,t)=>{const n=u=>u.value!==void 0?u.value:u.title,a=()=>{if(!(!e||e.length===0)){if(o!==void 0){const u=e.find(m=>n(m)===o);if(u)return u}return e[0]}},[i,s]=p.useState(a()),c=t!==void 0?e.find(u=>n(u)===t):i,d=u=>{t===void 0&&s(u)};return p.useEffect(()=>{if(t!==void 0)return;const u=a(),m=i&&e.some(g=>n(g)===n(i));u&&(!m||o!==void 0&&i&&n(i)!==o)?s(u):!u&&i&&s(void 0)},[e,o]),{activeTab:c,setActiveTab:d}},gy=(e,o,t)=>{const[n,a]=p.useState(e||null);return{activeValue:o!==void 0?o:n,setActiveValue:c=>{o===void 0&&a(c),t&&t(c)}}},hy=p.memo(({tab:e,isActive:o,onClick:t,iconPosition:n="left",tabStyles:a,textStyles:i})=>{const s=()=>{switch(n){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},c=()=>["top","bottom"].includes(n)?"4px":"8px",d=e.icon&&p.isValidElement(e.icon)?p.cloneElement(e.icon,{strokeWidth:o?2.5:2}):e.icon;return r.jsxs(l.Element,{as:"div",role:"tab","aria-selected":o,tabIndex:o?0:-1,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease",...a,flexDirection:s(),gap:c(),onClick:t,"data-state":o?"active":"inactive",children:[d&&r.jsx(l.Element,{children:d},o?"active-icon":"inactive-icon"),r.jsxs(l.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[r.jsx(l.Text,{...i,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),r.jsx(l.Text,{...i,fontWeight:o?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})}),yn=(e,o)=>{const t=o==="dark";return e==="segmented"?{header:{width:"fit-content",alignSelf:"flex-start",gap:6,padding:6,borderRadius:16,backgroundColor:"color-gray-100"},tab:{minHeight:44,padding:"0 22px",borderRadius:12,color:"color-gray-600",borderWidth:1,borderStyle:"solid",borderColor:"color-gray-100",style:{backgroundColor:"transparent"}},activeTab:{backgroundColor:"color-white",color:"color-gray-900",boxShadow:t?"0 1px 3px rgba(0, 0, 0, 0.35)":"0 1px 2px rgba(0, 0, 0, 0.06)"},text:{fontSize:14,lineHeight:"20px",letterSpacing:"-0.01em"},activeText:{},content:{width:"100%"}}:e==="pill"?{header:{width:"100%",flexWrap:"wrap",gap:12},tab:{minHeight:44,padding:"0 22px",borderRadius:"999px",backgroundColor:"color-white",color:"color-gray-600",borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200"},activeTab:{backgroundColor:"theme-primary",color:"color-white",borderColor:"theme-primary"},text:{fontSize:14,lineHeight:"20px",letterSpacing:"-0.01em",color:"inherit"},activeText:{color:"inherit"},content:{width:"100%"}}:{header:{width:"100%",gap:20,borderBottom:"none"},tab:{minHeight:44,padding:"0 4px",borderRadius:0,color:"color-gray-500",borderBottom:"3px solid",borderColor:"color-white",style:{backgroundColor:"transparent"}},activeTab:{color:"theme-primary",borderColor:"theme-primary"},text:{fontSize:14,lineHeight:"20px",letterSpacing:"-0.01em",color:"inherit"},activeText:{color:"inherit"},content:{width:"100%",paddingTop:12}}},fy=({tabs:e=[],activeTab:o,handleTabClick:t,views:n={},renderTab:a,renderContent:i,variant:s="underline",iconPosition:c="left"})=>{const{themeMode:d}=l.useTheme(),u=yn(s,d);return o?r.jsxs(l.Vertical,{width:"100%",height:"100%",...n.container,children:[r.jsx(l.Horizontal,{alignItems:"center",...u.header,...n.headerTabs,children:e.map(m=>{const g=(m.value!==void 0?m.value:m.title)===(o.value!==void 0?o.value:o.title),h=()=>t(m);return a?a(m,g,h):r.jsx(hy,{tab:m,isActive:g,onClick:h,iconPosition:c,tabStyles:{...u.tab,...n.tab,...g?u.activeTab:{},...g?n.activeTab:{}},textStyles:{...u.text,...n.title,...g?u.activeText:{},...g?n.activeText:{}}},m.title)})}),r.jsx(l.View,{height:"100%",...u.content,...n.content,children:i?i(o):o.content})]}):null},vi=p.createContext(null),xn=()=>{const e=p.useContext(vi);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},yy=p.memo(({children:e,views:o})=>{var c;const{themeMode:t}=l.useTheme(),{variant:n="underline"}=xn(),a=yn(n,t),i=Po("tabs"),s=De({container:(c=i.views)==null?void 0:c.headerTabs},o);return r.jsx(l.Horizontal,{alignItems:"center",...a.header,...s==null?void 0:s.container,children:e})}),xy=p.memo(({value:e,children:o,disabled:t=!1,views:n})=>{var f,y;const{themeMode:a}=l.useTheme(),{activeValue:i,setActiveValue:s,variant:c="underline"}=xn(),d=i===e,u=yn(c,a),m=Po("tabs"),g=De({trigger:(f=m.views)==null?void 0:f.tab,activeState:(y=m.views)==null?void 0:y.activeTab},n),h=p.useCallback(()=>{t||s(e)},[t,e,s]);return r.jsx(l.View,{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease-in-out",...u.tab,...d?u.activeTab:{},_hover:t?{}:c==="underline"?{color:"theme-primary"}:{opacity:.9},onClick:h,...g==null?void 0:g.trigger,...d?g==null?void 0:g.activeState:{},children:r.jsx(l.View,{...u.text,...d?u.activeText:{},children:o})})}),by=p.memo(({value:e,children:o,views:t})=>{const{activeValue:n}=xn();return n!==e?null:r.jsx(l.View,{width:"100%",padding:"24px",...t==null?void 0:t.content,children:o})}),ky=e=>{const o=ge("tabs",e),{tabs:t,views:n,defaultValue:a,onTabChange:i,renderTab:s,renderContent:c,variant:d="underline",iconPosition:u="left",value:m,onValueChange:g,children:h}=o,f=gy(a,m,g),y=my(t||[],a,m);if(h)return r.jsx(vi.Provider,{value:{...f,variant:d},children:h});if(t){const b=k=>{const C=j=>j.value!==void 0?j.value:j.title;(!y.activeTab||C(y.activeTab)!==C(k))&&(y.setActiveTab(k),i&&i(k))};return r.jsx(fy,{tabs:t,views:n,activeTab:y.activeTab,handleTabClick:b,renderTab:s,renderContent:c,variant:d,iconPosition:u})}return null},Cy=p.memo(ky),zo=Cy;zo.List=yy;zo.Trigger=xy;zo.Content=by;const Sy=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:n=[],alternateAnimation:a=!1,alternateDuration:i=3e3,highlightText:s,highlightTypewriter:c=!1,highlightSlide:d=!1,highlightSlideDuration:u=500,highlightSlideStagger:m=50,highlightSlideSequential:g=!0}=e,[h,f]=p.useState(o),[y,b]=p.useState(s);return p.useEffect(()=>{if(!a||n.length===0||!t||typeof o!="string"||typeof s!="string")return f(o),b(s),()=>{};const k=o,C=s;let j=0;const w=x=>{const v=n[x],T=C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(T,"gi"),M=k.replace(R,v);f(M),b(v)};w(j);const S=setInterval(()=>{j=(j+1)%n.length,w(j)},i);return()=>clearInterval(S)},[a,n,i,s,o,t]),{finalDisplayedText:h,activeHighlightTarget:y,highlightTypewriter:c,highlightSlide:d,highlightSlideDuration:u,highlightSlideStagger:m,highlightSlideSequential:g}},jy={xs:24,sm:32,md:48,lg:96,xl:110},wy={xl:{media:{mobile:{fontSize:48},tablet:{fontSize:96},desktop:{fontSize:110}}},lg:{media:{mobile:{fontSize:48},tablet:{fontSize:48},desktop:{fontSize:70}}},md:{media:{mobile:{fontSize:32},tablet:{fontSize:40},desktop:{fontSize:56}}},sm:{media:{mobile:{fontSize:20},tablet:{fontSize:24},desktop:{fontSize:32}}},xs:{media:{mobile:{fontSize:14},tablet:{fontSize:18},desktop:{fontSize:20}}}},vy={underline:e=>({textDecoration:"underline",textDecorationColor:e,textDecorationThickness:"4px",textUnderlineOffset:"4px"}),background:e=>({backgroundColor:e,color:"color-white",padding:"0 8px",borderRadius:"4px"}),gradient:(e,o)=>({background:`linear-gradient(135deg, ${e}, ${o||e})`,backgroundClip:"text",WebkitBackgroundClip:"text !important",WebkitTextFillColor:"transparent",color:"transparent",display:"inline-block",textShadow:"none"}),outline:e=>({WebkitTextStroke:`1px ${e}`,WebkitTextFillColor:"transparent !important",color:"transparent",textShadow:"none"}),glow:e=>({color:e,textShadow:`0 0 10px ${e}80, 0 0 20px ${e}40, 0 0 30px ${e}20`}),solid:e=>({color:e}),default:()=>({})},Ty=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:n,showCursor:a=!0,cursorColor:i="currentColor",textStyle:s,textComponent:c,as:d,...u})=>{const m=c||l.Text,g=Array.isArray(e)?e:[e],[h,f]=p.useState(g.map(()=>"")),[y,b]=p.useState(!1),[k,C]=p.useState(0),[j,w]=p.useState(0);p.useEffect(()=>{f(g.map(()=>"")),b(!1),C(0),w(0)},[e]),p.useEffect(()=>{if(y){n&&n();return}const x=g[k];if(j>=x.length){if(k>=g.length-1){b(!0);return}const T=setTimeout(()=>{C(R=>R+1),w(0)},t);return()=>clearTimeout(T)}const v=setTimeout(()=>{f(T=>{const R=[...T];return R[k]=x.substring(0,j+1),R}),w(T=>T+1)},o);return()=>clearTimeout(v)},[g,k,j,y,n,t,o]);const S=x=>{if(!x||typeof x!="string")return x;const v=x.split("|");return v.length===1?x:v.map((T,R)=>r.jsxs(p.Fragment,{children:[T,R<v.length-1&&r.jsx("br",{})]},R))};return r.jsx(r.Fragment,{children:h.map((x,v)=>r.jsxs(p.Fragment,{children:[S(x),a&&v===k&&!y&&r.jsx(m,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:i,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...s})]},v))})},Iy=({text:e,duration:o=500,direction:t="up",stagger:n=50,sequential:a=!1,textStyle:i,as:s,wordProps:c,textComponent:d,...u})=>{const[m,g]=p.useState(e),[h,f]=p.useState("entering"),[y,b]=p.useState(0),k=d||l.Text,C=p.useRef(null),j=p.useRef(null);p.useEffect(()=>{e===m&&h==="visible"||e!==m&&(h==="entering"||h==="visible"?(C.current=e,f("exiting")):h==="exiting"&&(C.current=e))},[e,m,h]);const{lines:w,totalWordCount:S}=p.useMemo(()=>{const F=m.split("|").map(D=>D.trim().split(/\s+/).filter(L=>L.length>0)),H=F.reduce((D,L)=>D+L.length,0);return{lines:F,totalWordCount:H}},[m]),x=p.useMemo(()=>a?S*(o+n):(S-1)*n+o,[S,o,n,a]),v=p.useMemo(()=>a?S*(o+n):(S-1)*n+o,[S,o,n,a]);p.useEffect(()=>(j.current&&clearTimeout(j.current),h==="entering"?j.current=setTimeout(()=>{f("visible")},x+50):h==="exiting"&&(j.current=setTimeout(()=>{C.current!==null&&(g(C.current),C.current=null),b(W=>W+1),f("entering")},v+50)),()=>{j.current&&clearTimeout(j.current)}),[h,x,v]);const{style:T,...R}=c||{},M=t==="up",E=W=>a?W*(o+n):W*n,I=p.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",...i}),[i]),V=p.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),P=p.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let z=0;return r.jsx(l.Element,{as:"span",style:I,...u,children:r.jsx("span",{style:V,children:w.map((W,F)=>r.jsx("span",{style:P,children:W.map((H,D)=>{const L=z++,B=E(L),$=D===W.length-1;let O;const N=`${o}ms`,_=`${B}ms`;h==="entering"?O=M?l.Animation.slideInUp({duration:N,delay:_,timingFunction:"ease-out",fillMode:"both"}):l.Animation.slideInDown({duration:N,delay:_,timingFunction:"ease-out",fillMode:"both"}):h==="exiting"&&(O=M?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:N,delay:_,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:N,delay:_,timingFunction:"ease-in",fillMode:"both"});const Y={...T,display:"inline-block",marginRight:$?0:"0.25em",transform:h==="visible"?"translateY(0)":void 0,opacity:h==="visible"?1:void 0};return r.jsx(k,{as:"span",animate:O,...R,...Y,children:H},`${y}-${F}-${D}`)})},`line-${F}`))})})};function ra(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const st=e=>{if(!e||typeof e!="string")return e;const o=e.split("|");return o.length===1?e:o.map((t,n)=>r.jsxs(p.Fragment,{children:[t,n<o.length-1&&r.jsx("br",{})]},n))},Fy=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:n="theme-primary",highlightSecondaryColor:a,size:i="lg",views:s,highlightAnimate:c,animate:d,animationLoop:u=1,highlightAnimationLoop:m=1,highlightTypewriter:g=!1,highlightTypewriterDuration:h=3e3,highlightSlide:f=!1,highlightSlideDuration:y=500,highlightSlideStagger:b=50,highlightSlideSequential:k=!0,themeMode:C,responsive:j,alternateHighlightText:w,alternateAnimation:S,alternateDuration:x,_isInView:v,...T})=>{const{ref:R,inView:M}=l.useInView(),{finalDisplayedText:E,activeHighlightTarget:I,highlightTypewriter:V,highlightSlide:P,highlightSlideDuration:z,highlightSlideStagger:W,highlightSlideSequential:F}=Sy({children:e,highlightText:o,_isInView:M,highlightTypewriter:g,highlightSlide:f,highlightSlideDuration:y,highlightSlideStagger:b,highlightSlideSequential:k,alternateHighlightText:w,alternateAnimation:S,alternateDuration:x,...T}),H=jy[i],D={fontFamily:"Mulish, Inter, Geist, system-ui, sans-serif",fontWeight:i==="xl"?700:600,letterSpacing:i==="xl"?"-1.5px":"-0.01em"},L=vy[t](n,a),B=(A,G)=>A&&(Array.isArray(A)?A.map(Q=>({...Q,iterationCount:G.toString()})):{...A,iterationCount:G.toString()}),$=B(d,u),O=B(c,m),N=typeof E=="string"?E:typeof e=="string"?e:"",_={ref:R,animate:M?$:void 0,as:"h1",fontSize:H,...j?wy[i]:{},...D},Y=A=>!M&&(V||P)?r.jsx("span",{style:{opacity:0},children:A}):V?r.jsx(Ty,{text:A,typingSpeed:Math.max(30,h/(A.length*10)),cursorColor:"currentColor",...L}):P?r.jsx(Iy,{text:A,duration:z,stagger:W,sequential:F,direction:"up",wordProps:L}):st(A);if(typeof N=="string"&&I){const A=Array.isArray(I)?new RegExp(`(${I.map(K=>ra(String(K))).join("|")})`,"gi"):new RegExp(`(${ra(String(I))})`,"gi"),G=[];let Q=0,X;for(;X=A.exec(N);)X.index>Q&&G.push(N.substring(Q,X.index)),G.push({highlight:!0,text:X[0]}),Q=X.index+X[0].length;return Q<N.length&&G.push(N.substring(Q)),r.jsx(l.Element,{..._,...s==null?void 0:s.container,...T,children:G.map((K,oe)=>typeof K=="string"?r.jsx(l.Text,{as:"span",display:"inline",...s==null?void 0:s.text,children:st(K)},`text-${oe}`):r.jsx(l.Text,{as:"span",display:"inline",animate:M?O:void 0,...P?{}:L,...s==null?void 0:s.highlight,children:Y(K.text)},`highlight-${oe}`))})}return t&&!I?r.jsx(l.Element,{..._,...T,...s==null?void 0:s.container,children:r.jsx(l.Text,{as:"span",display:"inline",animate:M?O:void 0,...P?{}:L,...s==null?void 0:s.highlight,children:Y(N)})}):r.jsx(l.Text,{..._,...T,...s==null?void 0:s.container,...s==null?void 0:s.text,children:st(N)})},Ry=e=>r.jsx(Fy,{...e}),Ti=Ry,zy=({items:e,shape:o,variant:t,onToggleChange:n})=>{const{activeToggles:a,setActiveToggles:i}=oi();return r.jsx(ri,{items:e,shape:o,variant:t,activeToggles:a,setActiveToggles:i,onToggleChange:n})},Ii=zy,My=({items:e,onChange:o})=>{const[t,n]=p.useState(e),[a,i]=p.useState(null),[s,c]=p.useState(null),d=p.useRef({x:0,y:0}),u=p.useRef([]),m=p.useCallback((f,y)=>{f.preventDefault(),document.body.style.cursor="grabbing";const b="touches"in f?f.touches[0].clientX:f.clientX,k="touches"in f?f.touches[0].clientY:f.clientY;d.current={x:b,y:k},c(y),i(t[y])},[t]),g=p.useCallback(f=>{if(s===null)return;const y="touches"in f?f.touches[0].clientX:f.clientX,b="touches"in f?f.touches[0].clientY:f.clientY,k=u.current[s];if(!k)return;const C=y-d.current.x,j=b-d.current.y;k.style.transform=`translate(${C}px, ${j}px)`,k.style.zIndex="1000";const w=u.current.findIndex((S,x)=>{if(!S||x===s)return!1;const v=S.getBoundingClientRect();return b>=v.top&&b<=v.bottom});if(w!==-1&&w!==s){const S=[...t],[x]=S.splice(s,1);S.splice(w,0,x),n(S),c(w),o==null||o(S),d.current={x:y,y:b}}},[s,t,o]),h=p.useCallback(()=>{document.body.style.cursor="",u.current.forEach(f=>{f&&(f.style.transform="",f.style.zIndex="")}),c(null),i(null)},[s]);return p.useEffect(()=>{if(typeof(window==null?void 0:window.addEventListener)=="function")return s!==null&&(window.addEventListener("mousemove",g),window.addEventListener("touchmove",g),window.addEventListener("mouseup",h),window.addEventListener("touchend",h)),()=>{window.removeEventListener("mousemove",g),window.removeEventListener("touchmove",g),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)}},[s,g,h]),{items:t,draggedItem:a,draggedIndex:s,itemRefs:u,handleDragStart:m}},Wy=({items:e,renderItem:o,containerProps:t,itemProps:n,draggedIndex:a,itemRefs:i,handleDragStart:s,views:c,themeMode:d})=>r.jsx(l.View,{overflow:"hidden",position:"relative",...t,...c==null?void 0:c.container,children:e.map((u,m)=>r.jsx(l.View,{ref:g=>{i.current[m]=g},onMouseDown:g=>s(g,m),onTouchStart:g=>s(g,m),position:"relative",cursor:"grab",transition:"transform 0.2s",...n,...c==null?void 0:c.item,children:o?o(u,m):u},m))}),Fi=e=>{const{items:o,draggedIndex:t,itemRefs:n,handleDragStart:a}=My(e);return r.jsx(Wy,{...e,items:o,draggedIndex:t,itemRefs:n,handleDragStart:a})},Hy=Fi,Py=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:n,multiple:a,disabled:i,previewUrl:s})=>{const[c,d]=p.useState(!1),[u,m]=p.useState(null),g=p.useRef(null),h=s!==void 0?s:u;p.useEffect(()=>()=>{u&&URL.revokeObjectURL(u)},[u]);const f=p.useCallback(S=>{S.preventDefault(),S.stopPropagation(),!i&&d(!0)},[i]),y=p.useCallback(S=>{S.preventDefault(),S.stopPropagation(),!i&&d(!1)},[i]),b=p.useCallback(S=>{S.preventDefault(),S.stopPropagation(),!i&&d(!0)},[i]),k=p.useCallback(S=>{if(!S||S.length===0)return;const x=Array.from(S);if(!a&&x.length>0){const v=x[0];if(v.type.startsWith("image/")){const T=URL.createObjectURL(v);m(R=>(R&&URL.revokeObjectURL(R),T))}else m(null)}a?o&&o(x):x.length>0&&e&&e(x[0])},[a,o,e]),C=p.useCallback(S=>{S.preventDefault(),S.stopPropagation(),d(!1),!i&&S.dataTransfer.files&&S.dataTransfer.files.length>0&&(k(S.dataTransfer.files),S.dataTransfer.clearData())},[i,k]),j=p.useCallback(()=>{var S;i||(S=g.current)==null||S.click()},[i]),w=p.useCallback(S=>{k(S.target.files),S.target.value&&(S.target.value="")},[k]);return{isDragActive:c,handleDragEnter:f,handleDragLeave:y,handleDragOver:b,handleDrop:C,handleClick:j,handleFileChange:w,inputRef:g,preview:h}},Vy={position:"absolute",top:"-4px",right:"-4px",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",border:"none",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"12px",zIndex:10,_hover:{backgroundColor:"rgba(0, 0, 0, 0.7)"}},Ri=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:a="120px",showPreviews:i=!1,views:s={}})=>{if(e.length===0)return null;const c=p.useCallback(u=>u<1024?`${u} B`:u<1024*1024?`${(u/1024).toFixed(1)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`,[]),d=p.useCallback(u=>u.type.startsWith("image/")?{backgroundColor:"#DBEAFE",color:"#2563EB"}:u.type.startsWith("video/")?{backgroundColor:"#EDE9FE",color:"#7C3AED"}:u.type.startsWith("audio/")?{backgroundColor:"#DCFCE7",color:"#16A34A"}:{backgroundColor:"#E2E8F0",color:"#475569"},[]);return r.jsx(l.View,{display:"flex",flexWrap:"wrap",gap:"8px",padding:"8px 0",maxHeight:a,overflowY:"auto",...s==null?void 0:s.container,children:e.map((u,m)=>{const g=typeof URL<"u"&&typeof URL.createObjectURL=="function"&&typeof Blob<"u"&&u instanceof Blob,h=(u==null?void 0:u.path)||(u==null?void 0:u.url)||(i&&g?URL.createObjectURL(u):""),f=u.type.startsWith("image/"),y=u.type.startsWith("video/"),b=u.type.startsWith("audio/"),k=d(u);return i?r.jsx(l.Vertical,{alignItems:"center",gap:"6px",padding:"6px 10px",borderRadius:"8px",border:"1px solid #E2E8F0",backgroundColor:"color-white",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...s==null?void 0:s.item,children:i&&r.jsxs(Se,{children:[r.jsxs(Se.Trigger,{children:[f&&r.jsx(l.Image,{src:h,alt:u.name,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),y&&r.jsx(l.View,{as:"video",src:h,alt:u.name,controls:!1,muted:!0,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),b&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(Ro,{widthHeight:24,color:"color-black"})}),!f&&!y&&!b&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(ao,{widthHeight:24,color:"color-black"})}),t&&r.jsx(l.Button,{...Vy,onClick:C=>{C.stopPropagation(),t(m)},"aria-label":`Remove ${u.name}`,children:"×"})]}),r.jsxs(Se.Content,{children:[f&&r.jsx(l.Image,{src:h,alt:u.name,maxWidth:"100%"}),y&&r.jsx(l.View,{as:"video",src:h,controls:!0,maxWidth:"100%"}),b&&r.jsx(l.View,{as:"audio",src:h,controls:!0,width:"100%"}),r.jsxs(l.Text,{marginTop:"4px",maxLines:1,width:"100%",...s==null?void 0:s.name,children:[u.name," (",c(u.size),")"]})]})]})},m):r.jsxs(l.Horizontal,{alignItems:"center",gap:"8px",padding:"6px 10px 6px 8px",borderRadius:"9999px",border:"1px solid #E2E8F0",backgroundColor:"color-white",maxWidth:"100%",animate:{from:{opacity:0,scale:.96},to:{opacity:1,scale:1}},animationDuration:.2,...s==null?void 0:s.item,children:[r.jsx(l.Center,{width:"22px",height:"22px",minWidth:"22px",borderRadius:"9999px",backgroundColor:k.backgroundColor,color:k.color,children:b?r.jsx(Ro,{widthHeight:12,color:"currentColor"}):r.jsx(ao,{widthHeight:12,color:"currentColor"})}),r.jsxs(l.Text,{fontSize:"12px",lineHeight:"16px",color:"color-gray-600",maxLines:1,maxWidth:"220px",...s==null?void 0:s.name,children:[u.name," · ",c(u.size)]}),t&&r.jsx(l.View,{as:"button",type:"button",onClick:()=>t(m),"aria-label":`Remove ${u.name}`,display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",minWidth:"16px",border:"none",backgroundColor:"transparent",color:"color-gray-400",padding:0,cursor:"pointer",transition:"color 0.2s ease, opacity 0.2s ease",_hover:{color:"color-gray-600"},children:"×"})]},m)})})},Ay=({children:e,text:o="Drop files here or click to upload",textProps:t,containerProps:n,disabled:a,accept:i,multiple:s,isDragActive:c,handleDragEnter:d,handleDragLeave:u,handleDragOver:m,handleDrop:g,handleClick:h,handleFileChange:f,inputRef:y,preview:b,imageProps:k,selectedFiles:C,onRemove:j})=>r.jsxs(l.Center,{width:"100%",minHeight:"200px",height:C&&C.length>0?"auto":"200px",borderWidth:2,borderStyle:"dashed",borderColor:c?"theme-primary":"color-gray-300",borderRadius:12,backgroundColor:c?"#EFF6FF":"color-gray-50",flexDirection:"column",cursor:a?"not-allowed":"pointer",opacity:a?.6:1,onClick:h,onDragEnter:d,onDragLeave:u,onDragOver:m,onDrop:g,transition:"background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease",overflow:"hidden",position:"relative",padding:16,...n,children:[r.jsx("input",{type:"file",ref:y,onChange:f,accept:i,multiple:s,style:{display:"none"},disabled:a}),b&&!s?r.jsxs(l.View,{width:"100%",height:"200px",position:"relative",children:[r.jsx(l.Image,{src:b,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...k}),r.jsx(l.Center,{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.3)",opacity:0,_hover:{opacity:1},transition:"opacity 0.2s",children:r.jsx(l.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):r.jsxs(l.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||r.jsxs(l.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[r.jsx(Gt,{widthHeight:40,color:c?"theme-primary":"color-gray-500"}),r.jsx(l.Text,{marginTop:16,color:c?"theme-primary":"color-gray-600",fontWeight:500,textAlign:"center",...t,children:o})]}),s&&C&&C.length>0&&r.jsx(l.View,{marginTop:16,width:"100%",children:r.jsx(Ri,{files:C,onRemove:j||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),Ey=e=>{const o=Py(e);return r.jsx(Ay,{...e,...o})},Dy=(e=!1)=>{const[o,t]=p.useState(e),[n,a]=p.useState(null);return p.useEffect(()=>{const i=d=>{!d.composedPath().some(g=>(g==null?void 0:g.id)==="dropdown-menu"||(g==null?void 0:g.id)==="dropdown-trigger")&&o&&(t(!1),a(null))},s=()=>{o&&(t(!1),a(null))},c=d=>{d.key==="Escape"&&o&&(t(!1),a(null))};if(!(typeof(document==null?void 0:document.addEventListener)!="function"||typeof(window==null?void 0:window.addEventListener)!="function"))return document.addEventListener("mousedown",i),window.addEventListener("resize",s),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",i),window.removeEventListener("resize",s),document.removeEventListener("keydown",c)}},[o]),{isOpen:o,setIsOpen:t,activeSubmenuId:n,setActiveSubmenuId:a}},$y={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Ly={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},_y={hover:{backgroundColor:"color-gray-100"}},zi=p.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),By=({children:e,value:o})=>r.jsx(zi.Provider,{value:o,children:e}),bn=()=>{const e=p.useContext(zi);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},Mi=({children:e,views:o,...t})=>{const{isOpen:n,setIsOpen:a,triggerRef:i}=bn(),s=c=>{c.stopPropagation(),a(!n)};return r.jsx(l.View,{ref:i,id:"dropdown-trigger",onClick:s,cursor:"pointer",position:"relative",display:"inline-block",...o==null?void 0:o.container,...t,children:e})},kn=({items:e,side:o="bottom",align:t="start",views:n,...a})=>{const{isOpen:i,variant:s,triggerRef:c}=bn(),d=p.useRef(null),{ref:u,relation:m}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[g,h]=p.useState({x:0,y:0,placement:o});if(p.useEffect(()=>{c.current&&u&&(u.current=c.current)},[c,u,i]),p.useEffect(()=>{if(i&&d.current&&c.current){const b=c.current.getBoundingClientRect();let k=o;m&&(o==="bottom"&&m.space.vertical==="top"?k="top":o==="top"&&m.space.vertical==="bottom"?k="bottom":o==="right"&&m.space.horizontal==="left"?k="left":o==="left"&&m.space.horizontal==="right"&&(k="right"));let C=0,j=0;switch(k){case"bottom":C=t==="start"?b.left:t==="end"?b.right-180:b.left+b.width/2-90,j=b.bottom+8;break;case"top":C=t==="start"?b.left:t==="end"?b.right-180:b.left+b.width/2-90,j=b.top-8;break;case"right":C=b.right+8,j=t==="start"?b.top:t==="end"?b.bottom-100:b.top+b.height/2-50;break;case"left":C=b.left-8,j=t==="start"?b.top:t==="end"?b.bottom-100:b.top+b.height/2-50;break}h({x:C,y:j,placement:k})}},[i,o,t,c,m]),!i)return null;const y=(()=>{const b={position:"fixed",left:g.x,top:g.y,zIndex:1e3};switch(g.placement){case"top":return{...b,transform:"translateY(-100%)"};case"left":return{...b,transform:"translateX(-100%)"};case"bottom":case"right":default:return b}})();return r.jsx(l.View,{ref:d,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:y,...Ly[s],...n==null?void 0:n.menu,...a,children:e.map((b,k)=>b.divider?r.jsx(Hi,{views:n},`divider-${k}`):r.jsx(Wi,{item:b,views:n},b.id))})},Wi=({item:e,views:o,...t})=>{const{activeSubmenuId:n,setActiveSubmenuId:a,size:i}=bn(),[s,c]=p.useState(!1),d=e.items&&e.items.length>0,u=n===e.id,m=p.useRef(null),g=()=>{c(!0),d&&a(e.id)},h=()=>{c(!1)},f=y=>{y.stopPropagation(),!e.disabled&&!d&&e.onClick&&e.onClick()};return r.jsxs(l.View,{ref:m,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...$y[i],_hover:e.disabled?{}:_y.hover,backgroundColor:s&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:g,onMouseLeave:h,onClick:f,...o==null?void 0:o.item,...t,children:[e.icon&&r.jsx(l.View,{marginRight:8,...o==null?void 0:o.icon,children:e.icon}),r.jsx(l.View,{flexGrow:1,children:e.label}),d&&r.jsx(l.View,{marginLeft:8,...o==null?void 0:o.submenuIndicator,children:r.jsx(ce,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),u&&d&&r.jsx(kn,{items:e.items||[],side:"right",align:"start",views:o})]})},Hi=({views:e,...o})=>r.jsx(l.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...o}),Oy=({trigger:e,items:o,side:t="bottom",align:n="start",views:a,themeMode:i,...s})=>r.jsxs(l.View,{position:"relative",display:"inline-block",...a==null?void 0:a.container,...s,children:[r.jsx(Mi,{views:a,children:e}),r.jsx(kn,{items:o,side:t,align:n,views:a})]}),Ny=({trigger:e,items:o,size:t="md",variant:n="default",side:a="bottom",align:i="start",defaultOpen:s=!1,views:c,...d})=>{const{isOpen:u,setIsOpen:m,activeSubmenuId:g,setActiveSubmenuId:h}=Dy(s),f=p.useRef(null);return r.jsx(By,{value:{isOpen:u,setIsOpen:m,activeSubmenuId:g,setActiveSubmenuId:h,size:t,variant:n,triggerRef:f},children:r.jsx(Oy,{trigger:e,items:o,side:a,align:i,views:c,...d})})},lr=Ny;lr.Trigger=Mi;lr.Content=kn;lr.Item=Wi;lr.Divider=Hi;const qy=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:a,isOpen:i,onOpen:s,onClose:c,closeOnSelect:d=!0,maxRecentColors:u=8,showRecentColors:m=!0}=e,[g,h]=p.useState(i??!1),[f,y]=p.useState(o??t),[b,k]=p.useState(""),[C,j]=p.useState([]),w=p.useRef(null),S=p.useRef(null);p.useEffect(()=>{o!==void 0&&y(o)},[o]),p.useEffect(()=>{i!==void 0&&h(i)},[i]),p.useEffect(()=>{if(m&&typeof localStorage<"u"){const I=localStorage.getItem("colorPicker-recentColors");if(I)try{j(JSON.parse(I))}catch{}}},[m]),p.useEffect(()=>{if(typeof document>"u"||typeof document.addEventListener!="function")return;const I=V=>{g&&w.current&&S.current&&!w.current.contains(V.target)&&!S.current.contains(V.target)&&E()};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[g]);const x=p.useCallback(I=>{m&&j(V=>{const P=V.filter(W=>W!==I),z=[I,...P].slice(0,u);return typeof localStorage<"u"&&localStorage.setItem("colorPicker-recentColors",JSON.stringify(z)),z})},[m,u]),v=p.useCallback(()=>{const I=!g;h(I),I?s==null||s():c==null||c()},[g,s,c]),T=p.useCallback(I=>{y(I),x(I),n==null||n(I),a==null||a(I),d&&(h(!1),c==null||c())},[n,a,d,c,x]),R=p.useCallback(I=>{k(I)},[]),M=p.useCallback(()=>{b&&(T(b),k(""))},[b,T]),E=p.useCallback(()=>{h(!1),c==null||c()},[c]);return{isOpen:g,selectedColor:f,recentColors:C,customColor:b,handleToggle:v,handleColorSelect:T,handleCustomColorChange:R,handleCustomColorSubmit:M,handleClose:E,triggerRef:w,dropdownRef:S}},ko={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},dropdown:{position:"absolute",top:"calc(100% + 8px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:12,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 12px 32px rgba(15, 23, 42, 0.14)",padding:"16px",minWidth:"320px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(6, 36px)",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",gap:"12px",marginBottom:"16px"},customInput:{marginBottom:"12px"},recentColors:{borderTop:"1px solid color-gray-100",paddingTop:"12px"}},Uy={xs:{height:"32px",fontSize:"12px",padding:"4px 8px"},sm:{height:"40px",fontSize:"12px",padding:"8px 10px"},md:{height:"44px",fontSize:"14px",padding:"10px 12px"},lg:{height:"48px",fontSize:"16px",padding:"12px 14px"},xl:{height:"56px",fontSize:"18px",padding:"14px 16px"}},Gy={default:{borderRadius:8},square:{borderRadius:0},rounded:{borderRadius:8},pill:{borderRadius:9999}},Yy={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-900"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-900"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-900"}},Ky=[{name:"Blue",value:"#1D4ED8",category:"primary"},{name:"Purple",value:"#A855F7",category:"primary"},{name:"Green",value:"#22C55E",category:"primary"},{name:"Orange",value:"#F97316",category:"primary"},{name:"Red",value:"#EF4444",category:"primary"},{name:"Ink",value:"#111827",category:"neutral"}],Xy=typeof navigator<"u"&&navigator.product!=="ReactNative"&&typeof document<"u"&&typeof document.createElement=="function",Jy=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:a,views:i={},size:s="md",shape:c="default",variant:d="default",error:u=!1,isDisabled:m=!1,isReadOnly:g=!1,predefinedColors:h=Ky,showCustomInput:f=!0,showRecentColors:y=!0,isOpen:b,selectedColor:k,recentColors:C,customColor:j,handleToggle:w,handleColorSelect:S,handleCustomColorChange:x,handleCustomColorSubmit:v,handleClose:T,triggerRef:R,dropdownRef:M,onChange:E,onChangeComplete:I,onOpen:V,onClose:P,colorFormat:z,maxRecentColors:W,closeOnSelect:F,defaultValue:H,value:D,...L})=>{const B={...ko.container,...i==null?void 0:i.container},$={...ko.trigger,...Uy[s],...Gy[c],...Yy[d],...u&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...!m&&!g&&{_hover:{borderColor:"color-gray-400"}},...i==null?void 0:i.trigger},O={...ko.dropdown,...i==null?void 0:i.dropdown},N={...ko.colorGrid,...i==null?void 0:i.colorGrid},_={...ko.recentColors,...i==null?void 0:i.recentColors},Y=k||"color-gray-200";return r.jsxs(l.View,{...B,...L,children:[t&&r.jsx(l.Text,{fontSize:"12px",lineHeight:"16px",fontWeight:"500",color:"color-gray-600",marginBottom:"6px",...i==null?void 0:i.label,children:t}),r.jsxs(l.View,{ref:R,onClick:m||g?void 0:w,...$,children:[r.jsxs(l.Horizontal,{alignItems:"center",gap:8,children:[r.jsx(l.View,{width:"24px",height:"24px",borderRadius:"8px",backgroundColor:Y,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200"}),r.jsx(l.Text,{color:k?"color-gray-900":"color-gray-500",fontSize:"inherit",children:k||n})]}),!g&&!m&&r.jsx(ce,{widthHeight:16,color:"color-gray-500",orientation:b?"up":"down"})]}),b&&r.jsxs(l.View,{ref:M,...O,children:[r.jsx(l.View,{...N,children:h.map((A,G)=>r.jsx(l.View,{width:"36px",height:"36px",borderRadius:"8px",backgroundColor:A.value,borderWidth:"1px",borderStyle:"solid",borderColor:k===A.value?"theme-primary":"transparent",cursor:"pointer",onClick:()=>S(A.value),title:A.name,_hover:{transform:"scale(1.05)",borderColor:"color-gray-300"},...i==null?void 0:i.colorSwatch},G))}),f&&r.jsxs(l.View,{...ko.customInput,...i==null?void 0:i.customInput,children:[r.jsxs(l.Horizontal,{gap:8,alignItems:"center",marginBottom:"10px",children:[Xy&&r.jsx("input",{type:"color",value:j||"#1D4ED8",onChange:A=>{const G=A.target.value;x(G),S(G)},style:{width:"36px",height:"36px",border:"1px solid #E5E7EB",borderRadius:"8px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),r.jsx(l.Text,{fontSize:"12px",lineHeight:"16px",color:"color-gray-500",children:"HEX"})]}),r.jsx(ve,{placeholder:"#1D4ED8",value:j,onChange:A=>{var G;return x(typeof A=="string"?A:((G=A==null?void 0:A.target)==null?void 0:G.value)??"")},onKeyPress:A=>{A.key==="Enter"&&v()},size:"sm",right:j&&r.jsx(l.View,{width:"18px",height:"18px",borderRadius:"6px",backgroundColor:j,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",cursor:"pointer",onClick:v})})]}),y&&C.length>0&&r.jsxs(l.View,{..._,children:[r.jsx(l.Text,{fontSize:"11px",lineHeight:"16px",fontWeight:"500",color:"color-gray-500",marginBottom:"8px",children:"Recent Colors"}),r.jsx(l.Horizontal,{gap:8,flexWrap:"wrap",children:C.map((A,G)=>r.jsx(l.View,{width:"24px",height:"24px",borderRadius:"8px",backgroundColor:A,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",cursor:"pointer",transition:"transform 0.2s ease, border-color 0.2s ease",onClick:()=>S(A),title:A,_hover:{transform:"scale(1.05)",borderColor:"color-gray-300"}},G))})]})]}),a&&r.jsx(l.Text,{fontSize:"11px",lineHeight:"16px",color:u?"color-red-500":"color-gray-500",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},Qy=e=>{const o=qy(e);return r.jsx(Jy,{...o,...e})},Pi=Qy,Zy=e=>{const o=ai(e);return r.jsx(li,{...o,...e})},ex=Zy,ox=e=>{const o=ti(e);return r.jsx(ni,{...o,...e})},rx=ox,ta={"to-right":"to right","to-left":"to left","to-bottom":"to bottom","to-top":"to top","to-top-right":"to top right","to-top-left":"to top left","to-bottom-right":"to bottom right","to-bottom-left":"to bottom left"},gr={center:"center",top:"top",right:"right",bottom:"bottom",left:"left","top-right":"top right","top-left":"top left","bottom-right":"bottom right","bottom-left":"bottom left"},tx={linear:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],radial:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],conic:[{color:"color-red-500",position:"0deg"},{color:"color-yellow-500",position:"90deg"},{color:"color-green-500",position:"180deg"},{color:"color-blue-500",position:"270deg"},{color:"color-red-500",position:"360deg"}]},nx=(e,o,t,n,a)=>{const i=o.map(s=>`${s.color} ${s.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${t&&ta[t]?ta[t]:t||"to right"}, ${i})`;case"radial":const c=a&&gr[a]?gr[a]:a||"center";return`radial-gradient(${n||"circle"} at ${c}, ${i})`;case"conic":return`conic-gradient(from 0deg at ${a&&gr[a]?gr[a]:a||"center"}, ${i})`;default:return`linear-gradient(to right, ${i})`}},ax={linear:{backgroundSize:"200% 200%",transition:"background-position 3s ease-in-out",animate:{from:{backgroundPosition:"0% 50%"},"50%":{backgroundPosition:"100% 50%"},to:{backgroundPosition:"0% 50%"}}},radial:{backgroundSize:"100% 100%",transition:"background-position 3s ease-in-out, background-size 3s ease-in-out",animate:{from:{backgroundPosition:"center",backgroundSize:"100% 100%"},"50%":{backgroundSize:"120% 120%"},to:{backgroundPosition:"center",backgroundSize:"100% 100%"}}},conic:{transition:"transform 3s linear",animate:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}},na={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"border-radius 0.2s ease, opacity 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},lx=({type:e="linear",direction:o="to-right",shape:t="circle",position:n="center",from:a,to:i,colors:s,animate:c=!1,animationDuration:d=3,children:u,views:m,themeMode:g,...h})=>{const f=p.useMemo(()=>s&&s.length>0?s:a&&i?[{color:a,position:"0%"},{color:i,position:"100%"}]:tx[e],[s,a,i,e]),y=p.useMemo(()=>{const k=f.map(C=>({...C,color:C.color}));return nx(e,k,o,t,n)},[e,f,o,t,n]),b=p.useMemo(()=>{if(!c)return{};const k=ax[e];return{...k,transition:k.transition.replace("3s",`${d}s`),animationDuration:`${d}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[c,d,e]);return r.jsx(l.View,{background:y,...na.container,...b,...m==null?void 0:m.container,...h,children:u&&r.jsx(l.View,{...na.content,...m==null?void 0:m.content,children:u})})},Vi=e=>r.jsx(lx,{...e}),ix=(e=null,o=null)=>{const[t,n]=p.useState(e),[a,i]=p.useState(o),s=d=>a===d,c=d=>{i(u=>u===d?null:d)};return p.useEffect(()=>{const d=m=>{!m.composedPath().some(f=>(f==null?void 0:f.id)==="menubar-content"||(f==null?void 0:f.id)==="menubar-trigger")&&a!==null&&i(null)},u=m=>{m.key==="Escape"&&a!==null&&i(null)};if(typeof(document==null?void 0:document.addEventListener)=="function")return document.addEventListener("mousedown",d),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",u)}},[a]),{activeMenuId:t,setActiveMenuId:n,openMenuId:a,setOpenMenuId:i,isMenuOpen:s,toggleMenu:c}},Ai={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},sx={default:{backgroundColor:"transparent",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},cx={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},kr={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},Ei=p.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),qr=()=>p.useContext(Ei),dx=({value:e,children:o})=>r.jsx(Ei.Provider,{value:e,children:o}),Di=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",views:a,...i})=>{const s=o==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(s,{role:"menubar","aria-orientation":o,...cx[o],...sx[n],...a==null?void 0:a.container,...i,children:e})},$i=({children:e,id:o,disabled:t=!1,views:n})=>{const{orientation:a}=qr(),i=a==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(i,{role:"none",position:"relative",opacity:t?.5:1,pointerEvents:t?"none":"auto",...n==null?void 0:n.menu,children:p.Children.map(e,s=>p.isValidElement(s)?p.cloneElement(s,{...s.props,menuId:o}):s)})},Li=({children:e,menuId:o,disabled:t=!1,views:n})=>{const{activeMenuId:a,setActiveMenuId:i,toggleMenu:s,isMenuOpen:c,size:d,triggerRefs:u}=qr(),m=p.useRef(null),g=a===o,h=c(o);p.useEffect(()=>(m.current&&o&&(u.current[o]=m.current),()=>{o&&delete u.current[o]}),[o,u]);const f=()=>{t||(i(o),s(o))};return r.jsx(l.View,{ref:m,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":h,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...Ai[d],...g?kr.active:{},...t?kr.disabled:{},_hover:t?{}:kr.hover,onClick:f,...n==null?void 0:n.trigger,children:e})},_i=({children:e,menuId:o,views:t})=>{const{isMenuOpen:n,orientation:a,triggerRefs:i}=qr(),s=p.useRef(null),[c,d]=p.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=n(o);if(p.useEffect(()=>{if(u&&s.current&&o&&i.current[o]){const g=s.current.getBoundingClientRect(),h=i.current[o].getBoundingClientRect(),f=Math.max(g.width||200,200),y=Math.max(g.height||150,150),b=window.innerWidth,k=window.innerHeight,C={top:h.top,right:b-h.right,bottom:k-h.bottom,left:h.left},j=a==="horizontal"?[{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:h.left,y:h.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:h.left,y:h.top-y-8},{placement:"right",space:C.right,fits:C.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:C.left,fits:C.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:C.right,fits:C.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:C.left,fits:C.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:h.left,y:h.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:h.left,y:h.top-y-8}],w=j.find(T=>T.fits);if(w){d({x:w.x,y:w.y,placement:w.placement});return}const S=j.reduce((T,R)=>R.space>T.space?R:T);let x=S.x,v=S.y;x+f>b&&(x=b-f-8),x<8&&(x=8),v+y>k&&(v=k-y-8),v<8&&(v=8),d({x,y:v,placement:S.placement})}},[u,a,o,i]),!u)return null;const m={position:"fixed",left:c.x,top:c.y,zIndex:1e3};return r.jsx(l.View,{ref:s,id:"menubar-content",role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:m,...t==null?void 0:t.content,children:e})},Bi=({children:e,icon:o,disabled:t=!1,onClick:n,views:a})=>{const{size:i}=qr(),s=()=>{t||!n||n()};return r.jsxs(l.View,{role:"menuitem",cursor:t?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:t?.5:1,...Ai[i],_hover:t?{}:kr.hover,onClick:s,...a==null?void 0:a.item,children:[o&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:o}),e]})},Oi=({views:e})=>r.jsx(l.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),ux=({items:e,orientation:o,size:t,variant:n,views:a,themeMode:i})=>r.jsx(Di,{orientation:o,size:t,variant:n,views:a,children:e.map(s=>r.jsxs($i,{id:s.id,disabled:s.disabled,views:a,children:[r.jsxs(Li,{menuId:s.id,views:a,children:[s.icon&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:s.icon}),s.label]}),s.items&&s.items.length>0&&r.jsx(_i,{menuId:s.id,views:a,children:s.items.map((c,d)=>c.separator?r.jsx(Oi,{views:a},`separator-${d}`):r.jsx(Bi,{id:c.id,icon:c.icon,disabled:c.disabled,onClick:c.onClick,views:a,children:c.label},c.id))})]},s.id))}),px=({items:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultActiveMenuId:a=null,defaultOpenMenuId:i=null,views:s,...c})=>{const{activeMenuId:d,setActiveMenuId:u,openMenuId:m,setOpenMenuId:g,isMenuOpen:h,toggleMenu:f}=ix(a,i),y=p.useRef({});return r.jsx(dx,{value:{activeMenuId:d,setActiveMenuId:u,openMenuId:m,setOpenMenuId:g,isMenuOpen:h,toggleMenu:f,orientation:o,size:t,variant:n,triggerRefs:y},children:r.jsx(ux,{items:e,orientation:o,size:t,variant:n,views:s,...c})})},po=px;po.Root=Di;po.Menu=$i;po.Trigger=Li;po.Content=_i;po.Item=Bi;po.Separator=Oi;const mx=(e,o,t)=>{const[n,a]=p.useState([]);return p.useEffect(()=>{a((()=>{const s=[];if(o<=t)for(let c=1;c<=o;c++)s.push(c);else{s.push(1);let c=Math.max(2,e-Math.floor((t-2)/2)),d=Math.min(o-1,c+t-3);d>=o-1&&(d=o-1,c=Math.max(2,d-(t-3))),c>2&&s.push("...");for(let u=c;u<=d;u++)s.push(u);d<o-1&&s.push("..."),s.push(o)}return s})())},[e,o,t]),{visiblePageNumbers:n}},Co={sm:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px",media:{mobile:{fontSize:"11px",padding:"3px 6px",minWidth:"24px",height:"24px"}}},md:{fontSize:"14px",padding:"6px 10px",minWidth:"32px",height:"32px",media:{mobile:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px"}}},lg:{fontSize:"14px",padding:"8px 12px",minWidth:"36px",height:"36px",media:{mobile:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px"}}}},qo={default:{backgroundColor:"transparent",color:"color-gray-800",borderWidth:"0px",borderStyle:"none",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"color-gray-100"}},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",borderWidth:"0px",borderStyle:"none",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"color-gray-200"}},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"color-gray-100"}}},Uo={rounded:{borderRadius:8},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},gx={backgroundColor:"theme-primary",color:"color-white",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"theme-primary",opacity:.9}},hr={opacity:.5,cursor:"not-allowed",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"transparent"}},hx=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:a=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:i,showPageSizeSelector:s=!1,showPageInfo:c=!0,maxPageButtons:d=5,showFirstLastButtons:u=!1,size:m="md",variant:g="default",shape:h="rounded",visiblePageNumbers:f=[],views:y,...b})=>{const k=w=>{w<1||w>o||w===e||t(w)},C=w=>{i&&i(Number(w.target.value))},j=(w,S)=>{if(w==="...")return r.jsx(l.View,{display:"flex",alignItems:"center",justifyContent:"center",...Co[m],...y==null?void 0:y.ellipsis,children:"..."},`ellipsis-${S}`);const x=w===e;return r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:x?"default":"pointer",...Co[m],...qo[g],...Uo[h],...x?gx:{},onClick:()=>k(w),"aria-label":`Page ${w}`,"aria-current":x?"page":void 0,...x?y==null?void 0:y.activePageButton:y==null?void 0:y.pageButton,children:w},`page-${w}`)};return r.jsxs(l.Horizontal,{alignItems:"center",gap:8,...y==null?void 0:y.container,...b,children:[u&&r.jsxs(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Co[m],...qo[g],...Uo[h],...e===1?hr:{},onClick:()=>k(1),"aria-label":"First page",disabled:e===1,...y==null?void 0:y.navigationButton,children:[r.jsx(ce,{orientation:"left",widthHeight:16}),r.jsx(ce,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Co[m],...qo[g],...Uo[h],...e===1?hr:{},onClick:()=>k(e-1),"aria-label":"Previous page",disabled:e===1,...y==null?void 0:y.navigationButton,children:r.jsx(ce,{orientation:"left",widthHeight:16})}),f.map((w,S)=>j(w,S)),r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Co[m],...qo[g],...Uo[h],...e===o?hr:{},onClick:()=>k(e+1),"aria-label":"Next page",disabled:e===o,...y==null?void 0:y.navigationButton,children:r.jsx(ce,{orientation:"right",widthHeight:16})}),u&&r.jsxs(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Co[m],...qo[g],...Uo[h],...e===o?hr:{},onClick:()=>k(o),"aria-label":"Last page",disabled:e===o,...y==null?void 0:y.navigationButton,children:[r.jsx(ce,{orientation:"right",widthHeight:16}),r.jsx(ce,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),c&&r.jsxs(l.Text,{marginLeft:16,color:"color-gray-600",...y==null?void 0:y.pageInfo,children:["Page ",e," of ",o]}),s&&i&&r.jsx(l.View,{as:"select",marginLeft:16,padding:"4px 8px",borderRadius:"4px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",cursor:"pointer",value:n,onChange:C,...y==null?void 0:y.pageSizeSelector,children:a.map(w=>r.jsx("option",{value:w.value,children:w.label},w.value))})]})},fx=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:s=!1,showPageInfo:c=!0,maxPageButtons:d=5,showFirstLastButtons:u=!1,size:m="md",variant:g="default",shape:h="rounded",views:f,...y})=>{const{visiblePageNumbers:b}=mx(e,o,d);return r.jsx(hx,{currentPage:e,totalPages:o,onPageChange:t,pageSize:n,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:s,showPageInfo:c,maxPageButtons:d,showFirstLastButtons:u,size:m,variant:g,shape:h,visiblePageNumbers:b,views:f,...y})},Ni=fx,yx=e=>typeof e=="string"&&(/^(#|rgb\(|rgba\(|hsl\(|hsla\(|var\()/.test(e)||["black","currentColor","inherit","transparent","white"].includes(e)),xx=p.memo(({shape:e="linear",value:o=0,max:t=100,color:n="theme-primary",backgroundColor:a="color-gray-200",height:i,size:s,radius:c=4,strokeWidth:d=10,showLabel:u=!1,labelColor:m="color-black-primary",animated:g=!0,animationDuration:h="0.5s",views:f,themeMode:y,...b})=>{var E;const{getColor:k,themeMode:C}=l.useTheme(),j=y||C,S=Math.min(t,Math.max(0,o))/t*100,x=I=>yx(I)?I:k(I,{themeMode:j}),v=p.useMemo(()=>x(a),[k,a,j]),T=p.useMemo(()=>x(n),[k,n,j]);if(e==="circle"){const I=s||(typeof i=="number"?i:100),V=(I-d)/2,P=2*Math.PI*V,z=P-S/100*P;return r.jsxs(l.View,{width:I,height:I,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...f==null?void 0:f.container,...b,children:[r.jsxs("svg",{width:I,height:I,viewBox:`0 0 ${I} ${I}`,style:{transform:"rotate(-90deg)"},children:[r.jsx("circle",{cx:I/2,cy:I/2,r:V,stroke:v,strokeWidth:d,fill:"transparent",...f==null?void 0:f.track}),r.jsx("circle",{cx:I/2,cy:I/2,r:V,stroke:T,strokeWidth:d,strokeDasharray:P,strokeDashoffset:z,strokeLinecap:"round",fill:"transparent",style:{transition:g?`stroke-dashoffset ${h} ease-in-out`:"none"},...f==null?void 0:f.indicator})]}),u&&r.jsx(l.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:r.jsxs(l.Text,{color:m,fontSize:`${I*.2}px`,fontWeight:"bold",...f==null?void 0:f.text,children:[Math.round(S),"%"]})})]})}const R=i||8,M={backgroundColor:v,...((E=f==null?void 0:f.container)==null?void 0:E.style)||{},...b.style||{}};return r.jsxs(l.View,{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":t,width:"100%",height:R,borderRadius:c,overflow:"hidden",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...f==null?void 0:f.container,...b,style:M,children:[r.jsx("div",{style:{height:"100%",backgroundColor:T,borderRadius:typeof c=="number"?`${c}px`:c,position:"absolute",left:0,top:0,bottom:0,width:`${S}%`,transition:g?`width ${h} ease-in-out`:"none",...f==null?void 0:f.bar}}),u&&r.jsxs(l.Text,{color:m,fontSize:typeof R=="number"&&R>16?`${R*.6}px`:"10px",fontWeight:"bold",position:"relative",zIndex:1,...f==null?void 0:f.text,children:[Math.round(S),"%"]})]})}),bx=e=>{const o=ge("progress",e);return r.jsx(xx,{...o})},qi=bx,kx=e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}),Cx=kx(),Sx={thin:"1px",medium:"2px",thick:"4px"},Go={container:{transition:"opacity 0.15s ease"},label:{fontSize:"14px",fontWeight:"500",color:"color-gray-600",paddingHorizontal:"8px",backgroundColor:"color-white",transition:"color 0.15s ease"}},jx=e=>typeof e=="string"&&(/^(#|rgb\(|rgba\(|hsl\(|hsla\(|var\()/.test(e)||["black","currentColor","inherit","transparent","white"].includes(e)),wx=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:n,spacing:a="0px",label:i,decorative:s=!1,views:c,themeMode:d,...u})=>{const{themeMode:m}=l.useTheme(),g=n||"color-gray-200",h=Cx[o],f=Sx[t],y=s?{"aria-hidden":!0}:{role:"separator","aria-orientation":e},b=jx(g)?{style:{borderColor:g}}:{borderColor:g};return i&&e==="horizontal"?r.jsxs(l.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:a,...y,...u,children:[r.jsx(l.View,{height:"0px",flexGrow:1,borderTop:`${f} ${h}`,...b,...Go.container,...c==null?void 0:c.container}),r.jsx(l.Text,{...Go.label,...c==null?void 0:c.label,children:i}),r.jsx(l.View,{height:"0px",flexGrow:1,borderTop:`${f} ${h}`,...b,...Go.container,...c==null?void 0:c.container})]}):e==="horizontal"?r.jsx(l.View,{height:"0px",width:"100%",borderTop:`${f} ${h}`,padding:a,...b,...Go.container,...y,...c==null?void 0:c.container,...u}):r.jsx(l.View,{width:"0px",height:"100%",borderLeft:`${f} ${h}`,padding:a,...b,...Go.container,...y,...c==null?void 0:c.container,...u})},Ui=e=>{const o=ge("separator",e);return r.jsx(wx,{...o})},Pr=Ui,vx=Ui,Tx={xs:12,sm:14,md:16,lg:18,xl:20},Ix=({isSupported:e,isSharing:o,onShare:t,label:n,children:a,icon:i,size:s,isDisabled:c,isLoading:d,iconPosition:u,disableWhenUnsupported:m=!0,...g})=>{const h=s??"md",f=i??r.jsx($a,{widthHeight:Tx[h],strokeWidth:1.5,filled:!1}),y=!!c||!e&&m,b=!!d||o;return r.jsx(se,{...g,size:h,icon:f,iconPosition:u??"left",isDisabled:y,isLoading:b,onClick:t,children:a??n??"Share"})},aa=()=>typeof navigator>"u"?void 0:navigator,Fx=(e,o)=>{if(!e||typeof e.share!="function")return!1;if(typeof e.canShare=="function")try{return e.canShare(o)}catch{return!1}return!0},Rx=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},zx=e=>{const{shareData:o,onClick:t,onUnsupported:n,onShareStart:a,onShareSuccess:i,onShareCancel:s,onShareError:c}=e,[d,u]=p.useState(!1),m=p.useMemo(()=>Fx(aa(),o),[o]),g=p.useCallback((...h)=>{t==null||t(...h);const f=aa();if(!f||typeof f.share!="function"){n==null||n();return}if(!d){if(typeof f.canShare=="function")try{if(!f.canShare(o)){n==null||n();return}}catch(y){c==null||c(y);return}u(!0),a==null||a();try{f.share(o).then(()=>{i==null||i()}).catch(y=>{if(Rx(y)==="AbortError"){s==null||s();return}c==null||c(y)}).finally(()=>{u(!1)})}catch(y){u(!1),c==null||c(y)}}},[d,t,s,c,a,i,n,o]);return{isSupported:m,isSharing:d,handleShare:g}},Mx=e=>{const{isSupported:o,isSharing:t,handleShare:n}=zx(e),{shareData:a,onShareStart:i,onShareSuccess:s,onShareCancel:c,onShareError:d,onUnsupported:u,onClick:m,...g}=e;return r.jsx(Ix,{...g,isSupported:o,isSharing:t,onShare:n})},Gi=Mx,Wx=({label:e,status:o="default",views:t,themeMode:n,...a})=>{const{themeMode:i}=l.useTheme(),s=Xa();return r.jsxs(l.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...t==null?void 0:t.container,...a,children:[r.jsx(l.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...s[o].indicator,...t==null?void 0:t.indicator}),e&&r.jsx(l.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...s[o].label,...t==null?void 0:t.label,children:e})]})},Cr=e=>{const o=ge("status",e);return r.jsx(Wx,{...o})},Hx=(e=!0,o,t,n)=>{const{on:a}=l.useResponsive(),i=a("mobile"),[s,c]=p.useState(o!==void 0?o:e);return p.useEffect(()=>{o!==void 0&&c(o)},[o]),{isExpanded:s,toggleExpanded:()=>{const g=!s;c(g),t&&t(g)},expand:()=>{s||(c(!0),t&&t(!0))},collapse:()=>{s&&(c(!1),t&&t(!1))},isMobile:i}},Px={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},Vx=e=>({default:{backgroundColor:"color-white",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease"},subtle:{backgroundColor:"color-gray-50",color:"color-gray-800",transition:"background-color 0.2s ease, color 0.2s ease"},elevated:{backgroundColor:"color-white",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",color:"color-gray-800",transition:"all 0.2s ease-in-out"}}),Ax=Vx(),Ex={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},Dx={none:{},low:{boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},medium:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)"},high:{boxShadow:"0 10px 30px rgba(0, 0, 0, 0.15)"}},$x={fast:"all 0.2s ease-in-out",normal:"all 0.3s ease-in-out",slow:"all 0.5s ease-in-out",bounce:"all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55)"},Yi=p.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),Ur=()=>p.useContext(Yi),Lx=({value:e,children:o})=>r.jsx(Yi.Provider,{value:e,children:o}),_x=({children:e,showToggleButton:o=!0,views:t,...n})=>{const{isExpanded:a,toggleExpanded:i,position:s}=Ur();return r.jsx(l.Horizontal,{width:"100%",padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:"space-between",...t==null?void 0:t.header,...n,children:a?r.jsxs(l.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,o&&r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:i,"aria-label":a?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ce,{orientation:s==="left"?"left":"right",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})]}):r.jsx(l.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:o&&r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:i,"aria-label":a?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ce,{orientation:s==="left"?"right":"left",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})})})},Bx=({children:e,views:o,...t})=>{const{isExpanded:n}=Ur();return r.jsx(l.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:n?"16px":"8px",...o==null?void 0:o.content,...t,children:e})},Ox=({children:e,views:o,...t})=>{const{isExpanded:n}=Ur();return r.jsx(l.View,{width:"100%",padding:n?"16px":"8px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...o==null?void 0:o.footer,...t,children:e})},Nx=({children:e,position:o="left",size:t="md",variant:n="default",fixed:a=!1,hasBackdrop:i=!0,expandedWidth:s,collapsedWidth:c,breakpoint:d,breakpointBehavior:u="overlay",elevation:m="none",transitionPreset:g="normal",ariaLabel:h="Sidebar navigation",showToggleButton:f,toggleExpanded:y,expand:b,isExpanded:k,isMobile:C,collapse:j,views:w,themeMode:S,...x})=>{const v=Px[t],T=k?s||v.expandedWidth:c||v.collapsedWidth,R=!C||C&&u!=="hide",M=a||C&&u==="overlay"?"fixed":"relative",E=i&&C&&k&&u==="overlay";return r.jsxs(r.Fragment,{children:[E&&r.jsx(l.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:j,...w==null?void 0:w.backdrop}),R&&r.jsx(l.Vertical,{position:M,top:0,height:"100vh",width:T,zIndex:999,transition:$x[g],transform:C&&u==="overlay"&&!k?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":h,...Ax[n],...Ex[o],...Dx[m],...w==null?void 0:w.container,...x,children:p.Children.map(e,I=>I)})]})},qx=({children:e,position:o="left",size:t="md",variant:n="default",defaultExpanded:a=!0,expanded:i,onExpandedChange:s,fixed:c=!1,hasBackdrop:d=!0,showToggleButton:u=!0,expandedWidth:m,collapsedWidth:g,breakpoint:h=768,breakpointBehavior:f="overlay",views:y,...b})=>{const{isExpanded:k,toggleExpanded:C,expand:j,collapse:w,isMobile:S}=Hx(a,i,s);return r.jsx(Lx,{value:{isExpanded:k,toggleExpanded:C,expand:j,collapse:w,position:o,size:t,variant:n,views:y},children:r.jsx(Nx,{position:o,size:t,variant:n,fixed:c,hasBackdrop:d,showToggleButton:u,expandedWidth:m,collapsedWidth:g,breakpoint:h,breakpointBehavior:f,isExpanded:k,isMobile:S,toggleExpanded:C,expand:j,collapse:w,views:y,...b,children:e})})},ir=qx;ir.Header=_x;ir.Content=Bx;ir.Footer=Ox;ir.useContext=Ur;const Ux=()=>({getItem:e=>{try{return typeof localStorage>"u"?null:localStorage.getItem(`resizable-${e}`)}catch(o){return console.warn("Failed to access localStorage:",o),null}},setItem:(e,o)=>{try{if(typeof localStorage>"u")return;localStorage.setItem(`resizable-${e}`,o)}catch(t){console.warn("Failed to write to localStorage:",t)}}}),Gx=(e,o,t,n=50,a=1/0,i=!1,s,c,d=10)=>{const[u,m]=p.useState(!1),[g,h]=p.useState([]),f=p.useRef(null),y=p.useRef(null),b=p.useRef(0),k=p.useRef([]),C=p.useRef(c||(typeof window<"u"?Ux():null)),j=p.useCallback(()=>f.current?e==="horizontal"?f.current.offsetWidth:f.current.offsetHeight:0,[e]),w=p.useCallback(()=>{if(!s||!C.current)return null;const W=C.current.getItem(s);if(!W)return null;try{const F=JSON.parse(W);return Array.isArray(F.sizes)?F.sizes:null}catch(F){return console.warn("Failed to parse saved panel sizes:",F),null}},[s]),S=p.useCallback(()=>{if(!s||!C.current||g.length===0)return;const W=g.map(F=>({id:F.id,size:F.size,collapsed:F.collapsed||!1}));C.current.setItem(s,JSON.stringify({sizes:W}))},[s,g]),x=p.useCallback((W,F,H,D,L)=>{h(B=>B.some($=>$.id===W)?B:[...B,{id:W,size:F,minSize:H??n,maxSize:D??a,collapsible:L??i,collapsed:!1}])},[n,a,i]),v=p.useCallback(W=>{h(F=>F.filter(H=>H.id!==W))},[]),T=p.useCallback(W=>{const F=g.find(H=>H.id===W);return F?F.size:0},[g]),R=p.useCallback((W,F)=>{h(H=>H.map(D=>D.id===W?{...D,size:F}:D))},[]),M=p.useCallback(W=>{const F=g.find(H=>H.id===W);return F?!!F.collapsed:!1},[g]),E=p.useCallback(W=>{h(F=>{const H=F.findIndex($=>$.id===W);if(H===-1)return F;const D=F[H];if(!D.collapsible)return F;const L={...D,collapsed:!D.collapsed},B=[...F];return B[H]=L,B})},[]),I=p.useCallback((W,F)=>{y.current=W,b.current=F,k.current=g.map(H=>H.size),m(!0)},[g]),V=p.useCallback(W=>{if(!u||!y.current)return;const F=y.current,H=W-b.current;let D=-1;const L=F.match(/\d+$/);if(L&&(D=parseInt(L[0],10)-1),D===-1&&g.length>=2&&(D=0),D<0||D>=g.length-1)return;const B=g[D],$=g[D+1];if(B.collapsed||$.collapsed)return;let O=k.current[D]+H,N=k.current[D+1]-H;O=Math.max(B.minSize??n,Math.min(B.maxSize??a,O)),N=Math.max($.minSize??n,Math.min($.maxSize??a,N)),h(_=>_.map((Y,A)=>A===D?{...Y,size:O}:A===D+1?{...Y,size:N}:Y))},[u,g,e,n,a]),P=p.useCallback(()=>{u&&t&&t(g.map(W=>W.size)),y.current=null,m(!1),s&&S()},[u,g,t,s,S]),z=p.useCallback(W=>{if(!u||!y.current)return;const F=y.current;let H=-1;const D=F.match(/\d+$/);if(D&&(H=parseInt(D[0],10)-1),H===-1&&g.length>=2&&(H=0),H<0||H>=g.length-1)return;let L=0;e==="horizontal"?(W.key==="ArrowLeft"&&(L=-d),W.key==="ArrowRight"&&(L=d),W.key==="Home"&&(L=-100),W.key==="End"&&(L=100)):(W.key==="ArrowUp"&&(L=-d),W.key==="ArrowDown"&&(L=d),W.key==="Home"&&(L=-100),W.key==="End"&&(L=100)),L!==0&&(W.preventDefault(),V(b.current+L)),W.key==="Escape"&&(h(B=>B.map(($,O)=>({...$,size:k.current[O]}))),P())},[u,g,e,V,P,d]);return p.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)!="function")return;const W=D=>{if(!u)return;const L=e==="horizontal"?D.clientX:D.clientY;V(L)},F=D=>{if(!u||D.touches.length===0)return;const L=D.touches[0],B=e==="horizontal"?L.clientX:L.clientY;V(B)},H=()=>{u&&P()};return u&&(document.addEventListener("mousemove",W),document.addEventListener("touchmove",F),document.addEventListener("mouseup",H),document.addEventListener("touchend",H),document.addEventListener("keydown",z),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("touchmove",F),document.removeEventListener("mouseup",H),document.removeEventListener("touchend",H),document.removeEventListener("keydown",z),document.body.style.cursor="",document.body.style.userSelect=""}},[u,e,V,P,z]),p.useEffect(()=>{if(g.length!==0){if(s){const W=w();if(W){h(F=>F.map(H=>{const D=W.find(L=>L.id===H.id);return D?{...H,size:D.size,collapsed:D.collapsed||!1}:H}));return}}if(!o){const F=j()/g.length;h(H=>H.map(D=>({...D,size:F})))}}},[g.length,o,j,s,w]),p.useEffect(()=>{if(!o||o.length===0||g.length===0)return;const W=j(),F=o.map(H=>typeof H=="string"&&H.endsWith("%")?parseFloat(H)/100*W:typeof H=="number"?H:parseFloat(H));h(H=>H.map((D,L)=>({...D,size:L<F.length?F[L]:D.size})))},[o,g.length,j]),p.useEffect(()=>{g.length>0&&s&&!u&&S()},[g,s,u,S]),{isResizing:u,setIsResizing:m,containerRef:f,panels:g,registerPanel:x,unregisterPanel:v,getPanelSize:T,setPanelSize:R,isPanelCollapsed:M,togglePanelCollapse:E,startResize:I,onResize:V,endResize:P}},Yx={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Kx=(e,o)=>({sm:{width:o==="horizontal"?"4px":"100%",height:o==="vertical"?"4px":"100%"},md:{width:o==="horizontal"?"6px":"100%",height:o==="vertical"?"6px":"100%"},lg:{width:o==="horizontal"?"8px":"100%",height:o==="vertical"?"8px":"100%"}})[e],Xx=e=>({default:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}},subtle:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-100"},_active:{backgroundColor:"color-gray-200"}},prominent:{backgroundColor:"color-gray-100",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}}}),Jx=Xx(),fr={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},Ki=p.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),Xi=()=>p.useContext(Ki),Qx=({value:e,children:o})=>r.jsx(Ki.Provider,{value:e,children:o}),Zx=({children:e,id:o,defaultSize:t,minSize:n,maxSize:a,collapsible:i,defaultCollapsed:s,onCollapseChange:c,views:d,...u})=>{const{orientation:m,registerPanel:g,unregisterPanel:h,getPanelSize:f,isPanelCollapsed:y,togglePanelCollapse:b}=Xi(),k=typeof t=="string"&&t.endsWith("%")?0:typeof t=="number"?t:0;p.useEffect(()=>(g(o,k,n,a,i),()=>h(o)),[o,k,n,a,i,g,h]);const C=f(o),j=y(o);return p.useEffect(()=>{c&&j!==void 0&&c(j)},[j,c]),p.useEffect(()=>{i&&s&&!j&&b(o)},[o,i,s,j,b]),j?r.jsx(l.View,{flex:"0 0 auto",width:m==="horizontal"?"10px":"100%",height:m==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>b(o),"aria-label":`Expand panel ${o}`,role:"button",tabIndex:0,...d==null?void 0:d.collapsedPanel,...u}):r.jsx(l.View,{flex:C>0?"0 0 auto":"1",width:m==="horizontal"?`${C}px`:"100%",height:m==="vertical"?`${C}px`:"100%",overflow:"auto",...d==null?void 0:d.panel,...u,children:e})},eb=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:n=!0,withCollapseButton:a=!1,collapseTarget:i,views:s,...c})=>{const{orientation:d,size:u,variant:m,startResize:g,isPanelCollapsed:h,togglePanelCollapse:f}=Xi(),b=(()=>{if(i)return i;const x=e.match(/\d+$/);if(!x)return"";const v=parseInt(x[0],10);return isNaN(v)?"":`panel${v}`})(),k=h(b),C=x=>{if(t)return;x.preventDefault();const v=d==="horizontal"?x.clientX:x.clientY;g(e,v)},j=x=>{if(t||x.touches.length===0)return;x.preventDefault();const v=x.touches[0],T=d==="horizontal"?v.clientX:v.clientY;g(e,T)},w=x=>{t||(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),g(e,0))},S=x=>{x.stopPropagation(),b&&f(b)};return r.jsxs(l.View,{role:"separator","aria-orientation":d,"aria-valuemin":0,"aria-valuemax":100,tabIndex:t?-1:0,cursor:d==="horizontal"?"col-resize":"row-resize",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",...Kx(u,d),...Jx[m],onMouseDown:C,onTouchStart:j,onKeyDown:w,opacity:t?.5:1,pointerEvents:t?"none":"auto",...s==null?void 0:s.handle,...c,children:[n&&r.jsx(l.View,{display:"flex",alignItems:"center",justifyContent:"center",width:d==="horizontal"?"100%":"auto",height:d==="vertical"?"100%":"auto",pointerEvents:"none",...s==null?void 0:s.handleIcon,children:d==="horizontal"?r.jsxs(l.Horizontal,{gap:1,children:[r.jsx(l.View,{...fr.horizontal}),r.jsx(l.View,{...fr.horizontal})]}):r.jsxs(l.Vertical,{gap:1,children:[r.jsx(l.View,{...fr.vertical}),r.jsx(l.View,{...fr.vertical})]})}),a&&b&&r.jsx(l.View,{position:"absolute",top:d==="horizontal"?"-20px":"50%",left:d==="horizontal"?"50%":"-20px",transform:d==="horizontal"?"translateX(-50%)":"translateY(-50%)",width:"16px",height:"16px",borderRadius:"full",backgroundColor:"color-gray-100",border:"1px solid",borderColor:"color-gray-300",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:1,onClick:S,"aria-label":k?`Expand panel ${b}`:`Collapse panel ${b}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...s==null?void 0:s.collapseIcon,children:r.jsx(l.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:k?r.jsxs(l.Horizontal,{children:[r.jsx(l.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),r.jsx(l.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):r.jsx(l.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},ob=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:a,minSize:i,maxSize:s,collapsible:c=!1,containerRef:d,autoSaveId:u,keyboardResizeBy:m,onLayout:g,views:h,...f})=>{const y=o==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(y,{ref:d,width:"100%",height:"100%",position:"relative",overflow:"hidden",...Yx[o],...h==null?void 0:h.container,...f,children:e})},rb=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:a,onSizesChange:i,minSize:s=50,maxSize:c,collapsible:d=!1,autoSaveId:u,storage:m,keyboardResizeBy:g=10,views:h,...f})=>{const{isResizing:y,setIsResizing:b,containerRef:k,registerPanel:C,unregisterPanel:j,getPanelSize:w,setPanelSize:S,isPanelCollapsed:x,togglePanelCollapse:v,startResize:T,onResize:R,endResize:M}=Gx(o,a,i,s,c,d,u,m,g);return r.jsx(Qx,{value:{orientation:o,size:t,variant:n,isResizing:y,setIsResizing:b,registerPanel:C,unregisterPanel:j,getPanelSize:w,setPanelSize:S,isPanelCollapsed:x,togglePanelCollapse:v,startResize:T,onResize:R,endResize:M},children:r.jsx(ob,{orientation:o,size:t,variant:n,defaultSizes:a,minSize:s,maxSize:c,collapsible:d,autoSaveId:u,keyboardResizeBy:g,containerRef:k,views:h,...f,children:e})})},Cn=rb;Cn.Panel=Zx;Cn.Handle=eb;const yr={info:{container:{backgroundColor:"color-blue-50",border:"color-blue-300"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",border:"color-green-300"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},warning:{container:{backgroundColor:"color-orange-50",border:"color-orange-300"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}},error:{container:{backgroundColor:"color-red-50",border:"color-red-300"},content:{color:"color-red-700"},icon:{color:"color-red-500"}}},tb={top:{top:"16px",left:"50%",transform:"translateX(-50%)"},"top-right":{top:"16px",right:"16px"},"top-left":{top:"16px",left:"16px"},bottom:{bottom:"16px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"}},nb=()=>Math.random().toString(36).substring(2,9);let So=new Map;const sr=Ho.create(e=>({toasts:[],add:(o,t,n,a={})=>{const i=a.id||nb(),s={id:i,variant:o,title:t,description:n,createdAt:Date.now(),isVisible:!0,...a};if(e(c=>({toasts:[...c.toasts,s]})),a.duration!==0){const c=a.duration||5e3,d=setTimeout(()=>{sr.getState().remove(i)},c);So.set(i,d)}return i},remove:o=>{e(t=>({toasts:t.toasts.map(n=>n.id===o?{...n,isVisible:!1}:n)})),So.has(o)&&(clearTimeout(So.get(o)),So.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(n=>n.id!==o)}))},300)},removeAll:()=>{So.forEach(clearTimeout),So.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),mo=(e,o,t,n)=>sr.getState().add(e,o,t,n),Ji=(e,o,t)=>mo("info",e,o,t),Qi=(e,o,t)=>mo("success",e,o,t),Zi=(e,o,t)=>mo("warning",e,o,t),es=(e,o,t)=>mo("error",e,o,t),os=e=>{sr.getState().remove(e)},rs=()=>{sr.getState().removeAll()},ts=({variant:e,title:o,description:t,onClose:n,isClosable:a=!0,action:i,actionText:s,showIcon:c=!0,theme:d,views:u,render:m,icon:g,id:h,isVisible:f=!0,themeMode:y})=>{const b=d??yr,k=()=>{var S,x;if(g!==void 0)return g;const w=e?(x=(S=yr[e])==null?void 0:S.icon)==null?void 0:x.color:yr.info.icon.color;switch(e){case"info":return r.jsx(Ye,{widthHeight:20,color:w});case"success":return r.jsx(Ea,{widthHeight:20,color:w});case"warning":return r.jsx(Ye,{widthHeight:20,color:w,orientation:"down"});case"error":return r.jsx(Ar,{widthHeight:20,color:w});default:return r.jsx(Ye,{widthHeight:20,color:yr.info.icon.color})}};if(m)return r.jsx(r.Fragment,{children:m({id:h||"",onClose:n})});const C=e==="error"?"alert":"status",j=e==="error"||e==="warning"?"assertive":"polite";return r.jsxs(l.Horizontal,{role:C,"aria-live":j,"aria-atomic":"true","data-state":f?"open":"closed",gap:12,width:"100%",maxWidth:"380px",borderWidth:"1px",borderStyle:"solid",borderRadius:"12px",padding:"12px 14px",alignItems:"flex-start",position:"relative",backgroundColor:b[e].container.backgroundColor,borderColor:b[e].container.border,boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12)",opacity:f?1:0,transform:f?"translateY(0)":"translateY(4px)",transition:"opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",...u==null?void 0:u.container,children:[c&&r.jsx(l.View,{marginTop:"2px",...u==null?void 0:u.icon,children:k()}),r.jsxs(l.Vertical,{gap:4,flex:"1",children:[r.jsx(l.Text,{fontSize:"14px",lineHeight:"20px",fontWeight:"600",color:b[e].content.color,backgroundColor:b[e].container.backgroundColor,...u==null?void 0:u.title,children:o}),t&&r.jsx(l.Text,{fontSize:"12px",lineHeight:"18px",color:b[e].content.color,fontWeight:"400",backgroundColor:b[e].container.backgroundColor,...u==null?void 0:u.description,children:t}),i&&s&&r.jsx(l.Text,{fontSize:"14px",fontWeight:"600",marginTop:"6px",cursor:"pointer",color:b[e].content.color,backgroundColor:b[e].container.backgroundColor,onClick:w=>{w.stopPropagation(),i()},_hover:{textDecoration:"underline"},transition:"opacity 0.2s ease, color 0.2s ease",...u==null?void 0:u.actionButton,children:s})]}),a&&r.jsx(l.View,{as:"button","aria-label":"Close toast",backgroundColor:"transparent",border:"none",cursor:"pointer",padding:"4px",marginLeft:"8px",marginTop:"-2px",marginRight:"-4px",borderRadius:"9999px",onClick:w=>{w.stopPropagation(),n()},_hover:{backgroundColor:"color-blackAlpha-100"},transition:"background-color 0.2s ease, opacity 0.2s ease",...u==null?void 0:u.closeButton,children:r.jsx(Te,{widthHeight:16,color:b[e].content.color})})]})},ab=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:n})=>{const{toasts:a,remove:i}=sr(),c=p.useMemo(()=>{const d={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return a.forEach(u=>{const m=u.position||e;d[m].push(u)}),Object.keys(d).forEach(u=>{d[u]=d[u].slice(-t)}),d},[a,e,t])[e];return r.jsx(l.View,{position:"fixed",zIndex:9999,display:"flex",flexDirection:e.includes("bottom")?"column-reverse":"column",gap:`${o}px`,width:"fit-content",maxWidth:"100%",pointerEvents:"none",...tb[e],style:n,children:c.map(d=>r.jsx(l.View,{pointerEvents:"auto",animation:e.includes("right")?"slideInRight 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("left")?"slideInLeft 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("top")?"slideInDown 0.3s ease-out, fadeIn 0.3s ease-out":"slideInUp 0.3s ease-out, fadeIn 0.3s ease-out",children:r.jsx(ts,{id:d.id,variant:d.variant,title:d.title,description:d.description,onClose:()=>i(d.id),isClosable:d.isClosable,action:d.action,actionText:d.actionText,showIcon:d.showIcon,views:d.views,render:d.render,icon:d.icon,isVisible:d.isVisible})},d.id))})},lb=()=>({toast:(e,o,t,n)=>mo(e,o,t,n),info:(e,o,t)=>Ji(e,o,t),success:(e,o,t)=>Qi(e,o,t),warning:(e,o,t)=>Zi(e,o,t),error:(e,o,t)=>es(e,o,t),remove:e=>os(e),removeAll:()=>rs()}),ib=e=>r.jsx(ts,{...e}),sb=Object.assign(ib,{Container:e=>r.jsx(ab,{...e}),show:mo,info:Ji,success:Qi,warning:Zi,error:es,remove:os,removeAll:rs}),cb=lb,la=(e,o)=>{var s,c;if(!e)return!0;const t=e.toLowerCase(),n=o.name.toLowerCase().includes(t),a=((s=o.description)==null?void 0:s.toLowerCase().includes(t))||!1,i=((c=o.keywords)==null?void 0:c.some(d=>d.toLowerCase().includes(t)))||!1;return n||a||i},db=({open:e,onOpenChange:o,groups:t=[],commands:n=[],filter:a})=>{const[i,s]=p.useState(""),[c,d]=p.useState(0),u=p.useRef(null),m=p.useMemo(()=>a||la,[a]),g=p.useMemo(()=>[...t.flatMap(k=>k.commands),...n],[t,n]),h=p.useMemo(()=>i.trim()?g.filter(b=>m(i,b)):g,[g,i,m]),f=p.useMemo(()=>{if(!i)return t;const b=a||la;return t.map(k=>({...k,commands:k.commands.filter(C=>b(i,C))})).filter(k=>k.commands.length)},[t,i,a]);p.useEffect(()=>{d(0)},[h.length]);const y=p.useCallback(b=>{if(e)switch(b.key){case"ArrowDown":b.preventDefault(),d(k=>k<h.length-1?k+1:k);break;case"ArrowUp":b.preventDefault(),d(k=>k>0?k-1:k);break;case"Enter":b.preventDefault(),h[c]&&(h[c].onSelect(),o(!1),s(""));break;case"Escape":b.preventDefault(),o(!1),s("");break}},[e,h,c,o]);return p.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)=="function")return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y]),p.useEffect(()=>{const b=u.current;if(b&&typeof b.querySelector=="function"&&e){const k=b.querySelector(`[data-index="${c}"]`);k&&typeof k.scrollIntoView=="function"&&k.scrollIntoView({block:"nearest"})}},[c,e]),p.useEffect(()=>{e?d(0):s("")},[e]),{search:i,setSearch:s,selectedIndex:c,setSelectedIndex:d,filteredCommands:h,filteredGroups:f,listRef:u}},ub=({onClose:e,children:o,...t})=>r.jsx(l.View,{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-blackAlpha-400",zIndex:9999,onClick:n=>{n.target===n.currentTarget&&(e==null||e())},...t,children:o}),ns=p.forwardRef(({value:e,onValueChange:o,...t},n)=>r.jsx(l.Input,{value:e,onChange:a=>{var i,s;return o(typeof a=="string"?a:((i=a==null?void 0:a.target)==null?void 0:i.value)??((s=a==null?void 0:a.nativeEvent)==null?void 0:s.text)??"")},ref:n,...t}));ns.displayName="CommandTextInput";const pb={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},mb=e=>({default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},outline:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"}}),gb=mb(),hb={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},fb={overflow:"auto",padding:"8px 0"},yb={marginBottom:"8px"},xb={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},bb={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},kb={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},Cb={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},Sb={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},jb={display:"flex",flexDirection:"column",flex:1},wb={fontSize:"14px",fontWeight:"medium"},vb={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},Tb={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},Ib={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},Fb={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},Rb=p.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),zb=({value:e,children:o})=>r.jsx(Rb.Provider,{value:e,children:o}),as=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:n,...a})=>{const i=p.useRef(null);return p.useEffect(()=>{i.current&&i.current.focus()},[]),r.jsxs(l.View,{...hb,...n==null?void 0:n.container,...a,children:[r.jsx(Tr,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),r.jsx(ns,{width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",...n==null?void 0:n.input,value:e,onValueChange:o,placeholder:t,ref:i})]})},Mb=({children:e,views:o,...t})=>r.jsx(l.View,{...fb,...o==null?void 0:o.container,...t,children:e}),ls=({heading:e,children:o,views:t,...n})=>r.jsxs(l.View,{...yb,...t==null?void 0:t.container,...n,children:[r.jsx(l.Text,{...xb,...t==null?void 0:t.heading,children:e}),o]}),Tt=({item:e,selected:o=!1,onSelect:t,views:n,...a})=>{const i=()=>{!e.disabled&&t&&t()};return r.jsxs(l.Horizontal,{...bb,...o?kb:{},...e.disabled?Cb:{},onPress:i,onClick:i,...n==null?void 0:n.container,...a,children:[e.icon&&r.jsx(l.View,{...Sb,...n==null?void 0:n.icon,children:e.icon}),r.jsxs(l.Vertical,{...jb,...n==null?void 0:n.content,children:[r.jsx(l.Text,{...wb,...n==null?void 0:n.name,children:e.name}),e.description&&r.jsx(l.Text,{...vb,...n==null?void 0:n.description,children:e.description})]}),e.shortcut&&r.jsx(l.Text,{...Tb,...n==null?void 0:n.shortcut,children:e.shortcut})]})},is=({children:e="No results found.",views:o,...t})=>r.jsx(l.View,{...Ib,...o==null?void 0:o.container,...t,children:e}),Wb=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:a,size:i="md",variant:s="default",emptyState:c,footer:d,search:u,setSearch:m,selectedIndex:g,setSelectedIndex:h,filteredCommands:f,filteredGroups:y,listRef:b,views:k,filter:C,...j})=>{if(!e)return null;const w=p.useCallback(T=>{T.disabled||(T.onSelect(),o(!1),m(""))},[o,m]);p.useCallback(T=>T.target===T.currentTarget&&o(!1),[o]);const S=p.useMemo(()=>({search:u,setSearch:m,selectedIndex:g,setSelectedIndex:h,filteredCommands:f,onSelect:w}),[u,g,f,w,m,h]),x=t.length>0,v=f.length===0;return r.jsx(ub,{onClose:()=>o(!1),...j,children:r.jsx(zb,{value:S,children:r.jsxs(l.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...pb[i],...gb[s],...k==null?void 0:k.container,onClick:T=>T.stopPropagation(),children:[r.jsx(as,{value:u,onValueChange:m,placeholder:a,views:k==null?void 0:k.searchInput}),r.jsx(l.View,{ref:b,flex:1,overflow:"auto",...k==null?void 0:k.list,children:v?c||r.jsx(is,{views:k==null?void 0:k.empty}):x?y.map(T=>r.jsx(ls,{heading:T.name,views:k==null?void 0:k.groupHeading,children:T.commands.map(R=>{const M=f.findIndex(E=>E.id===R.id);return r.jsx(Tt,{item:R,selected:M===g,onSelect:()=>w(R),"data-index":M,views:{container:k==null?void 0:k.item,icon:k==null?void 0:k.icon,content:k==null?void 0:k.content,name:k==null?void 0:k.name,description:k==null?void 0:k.description,shortcut:k==null?void 0:k.shortcut}},R.id)})},T.id)):f.map((T,R)=>r.jsx(Tt,{item:T,selected:R===g,onSelect:()=>w(T),"data-index":R,views:{container:k==null?void 0:k.item,icon:k==null?void 0:k.icon,content:k==null?void 0:k.content,name:k==null?void 0:k.name,description:k==null?void 0:k.description,shortcut:k==null?void 0:k.shortcut}},T.id))}),d&&r.jsx(l.View,{...Fb,...k==null?void 0:k.footer,children:d})]})})})},Hb=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:a,size:i="md",variant:s="default",filter:c,emptyState:d,footer:u,views:m,...g})=>{const{search:h,setSearch:f,selectedIndex:y,setSelectedIndex:b,filteredCommands:k,filteredGroups:C,listRef:j}=db({open:e,onOpenChange:o,groups:t,commands:n,filter:c});return r.jsx(Wb,{open:e,onOpenChange:o,groups:t,commands:n,placeholder:a,size:i,variant:s,emptyState:d,footer:u,search:h,setSearch:f,selectedIndex:y,setSelectedIndex:b,filteredCommands:k,filteredGroups:C,listRef:j,views:m,...g})},Eo=Hb;Eo.Input=as;Eo.List=Mb;Eo.Group=ls;Eo.Item=Tt;Eo.Empty=is;const ia=()=>Math.random().toString(36).substring(2,11),Pb=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:n=!1}={})=>{const[a,i]=p.useState(e),s=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),m=p.useRef(`tooltip-trigger-${ia()}`).current,g=p.useRef(`tooltip-content-${ia()}`).current,h=p.useCallback(()=>{n||(u.current&&(clearTimeout(u.current),u.current=null),!a&&!d.current&&(d.current=setTimeout(()=>{i(!0),d.current=null},o)))},[a,o,n]),f=p.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),a&&!u.current&&(u.current=setTimeout(()=>{i(!1),u.current=null},t))},[a,t]),y=p.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]);return p.useEffect(()=>()=>{d.current&&clearTimeout(d.current),u.current&&clearTimeout(u.current)},[]),p.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)!="function")return;const b=k=>{k.key==="Escape"&&a&&i(!1)};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[a]),{isOpen:a,openTooltip:h,closeTooltip:f,cancelCloseTimer:y,triggerRef:s,contentRef:c,triggerId:m,contentId:g}},Vb={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},Ab=e=>({default:{backgroundColor:"color-gray-900",color:"color-white",borderRadius:"8px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",transition:"opacity 0.15s ease"},light:{backgroundColor:"color-white",color:"color-gray-800",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"8px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.04)",transition:"opacity 0.15s ease"},dark:{backgroundColor:"color-gray-950",color:"color-white",borderRadius:"8px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.2), 0px 2px 4px rgba(0, 0, 0, 0.12)",transition:"opacity 0.15s ease"}}),Eb=Ab(),Db=e=>{const o={position:"absolute",width:"8px",height:"8px",backgroundColor:"inherit",borderStyle:"inherit",borderWidth:"inherit",borderColor:"inherit",transform:"rotate(45deg)"};switch(e){case"top":return{...o,bottom:"-4px",left:"50%",marginLeft:"-4px",borderTop:"none",borderLeft:"none"};case"right":return{...o,left:"-4px",top:"50%",marginTop:"-4px",borderRight:"none",borderTop:"none"};case"bottom":return{...o,top:"-4px",left:"50%",marginLeft:"-4px",borderBottom:"none",borderRight:"none"};case"left":return{...o,right:"-4px",top:"50%",marginTop:"-4px",borderLeft:"none",borderBottom:"none"};default:return o}},ss=p.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Sn=()=>p.useContext(ss),$b=({value:e,children:o})=>r.jsx(ss.Provider,{value:e,children:o}),cs=p.memo(({children:e,views:o,asChild:t=!1,...n})=>{const{openTooltip:a,closeTooltip:i,triggerRef:s,contentId:c,triggerId:d}=Sn(),u=p.useCallback(()=>a(),[a]),m=p.useCallback(()=>i(),[i]),g=p.useCallback(()=>a(),[a]),h=p.useCallback(()=>i(),[i]),f={ref:s,onMouseEnter:u,onMouseLeave:m,onFocus:g,onBlur:h,id:d,"aria-describedby":c,...o==null?void 0:o.container,...n};return t&&p.isValidElement(e)?p.cloneElement(e,f):r.jsx(l.View,{display:"inline-block",...f,children:e})}),Lb=p.memo(({children:e,views:o,...t})=>{const{isOpen:n,contentRef:a,contentId:i,triggerId:s}=Sn();return n?r.jsx(l.View,{ref:a,id:i,role:"tooltip","aria-labelledby":s,...o==null?void 0:o.container,...t,children:e}):null}),_b=({content:e,children:o,position:t="top",align:n="center",size:a="md",variant:i="default",showArrow:s=!0,views:c,themeMode:d,...u})=>{const{isOpen:m,triggerRef:g,contentRef:h,contentId:f,triggerId:y}=Sn(),{ref:b,relation:k}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[C,j]=p.useState({x:0,y:0,placement:t});p.useEffect(()=>{g!=null&&g.current&&b&&(b.current=g.current)},[g,b,m]),p.useEffect(()=>{if(m&&(h!=null&&h.current)&&(g!=null&&g.current)){const x=g.current.getBoundingClientRect();let v=t;k&&(t==="top"&&k.space.vertical==="bottom"?v="bottom":t==="bottom"&&k.space.vertical==="top"?v="top":t==="right"&&k.space.horizontal==="left"?v="left":t==="left"&&k.space.horizontal==="right"&&(v="right"));let T=0,R=0;switch(v){case"top":T=n==="start"?x.left:n==="end"?x.right-120:x.left+x.width/2-60,R=x.top-8;break;case"bottom":T=n==="start"?x.left:n==="end"?x.right-120:x.left+x.width/2-60,R=x.bottom+8;break;case"right":T=x.right+8,R=n==="start"?x.top:n==="end"?x.bottom-32:x.top+x.height/2-16;break;case"left":T=x.left-8,R=n==="start"?x.top:n==="end"?x.bottom-32:x.top+x.height/2-16;break}j({x:T,y:R,placement:v})}},[m,t,n,g,h,k]);const w=p.useMemo(()=>s?Db(C.placement):{},[s,C.placement]),S=p.useMemo(()=>{const x={position:"fixed",left:C.x,top:C.y,zIndex:1e3};switch(C.placement){case"top":return{...x,transform:"translateY(-100%)"};case"left":return{...x,transform:"translateX(-100%)"};case"bottom":case"right":default:return x}},[C.x,C.y,C.placement]);return r.jsxs(l.View,{position:"relative",display:"inline-block",...c==null?void 0:c.container,...u,children:[r.jsx(cs,{children:o}),m&&r.jsxs(l.View,{ref:h,id:f,role:"tooltip","aria-labelledby":y,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:S,...Vb[a],...Eb[i],...c==null?void 0:c.content,children:[typeof e=="string"?r.jsx(l.Text,{...c==null?void 0:c.text,children:e}):e,s&&r.jsx(l.View,{...w,...c==null?void 0:c.arrow})]})]})},Bb=({content:e,children:o,position:t="top",align:n="center",size:a="md",variant:i="default",openDelay:s=200,closeDelay:c=200,showArrow:d=!0,defaultOpen:u=!1,isDisabled:m=!1,views:g,...h})=>{const f=Pb({defaultOpen:u,openDelay:s,closeDelay:c,isDisabled:m});return r.jsx($b,{value:f,children:r.jsx(_b,{content:e,position:t,align:n,size:a,variant:i,showArrow:d,views:g,...h,children:o})})},Gr=Bb;Gr.Trigger=cs;Gr.Content=Lb;const ds=p.forwardRef((e,o)=>{const t=ql(e);return r.jsx(Kl,{...e,...t})});ds.displayName="ChatInput";const Ob={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},sa={container:{position:"relative",display:"flex",flexDirection:"column",height:"100vh",alignItems:"center",justifyContent:"center"},gradient:{position:"absolute",inset:"-10px",opacity:.5,pointerEvents:"none",filter:"blur(10px)",backgroundSize:"300% 200%",backgroundPosition:"50% 50%, 50% 50%"}},ct={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},image:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundAttachment:"scroll"},content:{position:"relative",width:"100%",height:"100%",zIndex:2}},dt={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},video:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"},content:{position:"relative",zIndex:2}},Nb=p.createContext({}),qb=({children:e,showRadialGradient:o=!0,views:t,themeMode:n,...a})=>{const i={white:"rgba(255,255,255,1)",transparent:"rgba(255,255,255,0)"},s=["rgb(59, 130, 246)","rgb(196, 181, 253)","rgb(147, 197, 253)","rgb(221, 214, 254)","rgb(96, 165, 250)"],c={...sa.gradient,backgroundImage:`
27
27
  repeating-linear-gradient(100deg, ${s.join(", ")}),
28
28
  repeating-linear-gradient(100deg, ${i.white} 0%, ${i.white} 7%, ${i.transparent} 10%, ${i.transparent} 12%, ${i.white} 16%)
29
29
  `,animation:"aurora 4s ease infinite",...o?{maskImage:"radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%)"}:{}};return r.jsxs(l.View,{...sa.container,...t==null?void 0:t.container,...a,children:[r.jsx(l.View,{style:c}),e,r.jsx("style",{children:`