@app-studio/components 0.10.25 → 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/README.md +2 -0
- package/dist/native/components/Formik/Formik.Form.js +15 -1
- package/dist/native/components/Formik/Formik.Form.js.map +1 -1
- package/dist/web.cjs.js +1 -1
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.esm.js +16 -11
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.js +1 -1
- package/dist/web.umd.js.map +1 -1
- package/docs/README.md +1 -1
- package/docs/components/Center.mdx +3 -1
- package/docs/components/Form.mdx +34 -7
- package/docs/components/Formik.mdx +7 -0
- package/docs/components/Vertical.mdx +4 -2
- package/docs/getting-started/component-usage.md +40 -16
- package/docs/getting-started/react-native.md +66 -0
- package/package.json +1 -1
package/dist/web.umd.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
border-radius: 4px !important;
|
|
21
21
|
width: 100% !important;
|
|
22
22
|
}
|
|
23
|
-
`;function So(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const el=({id:e,name:o,label:t,value:n="",length:a=6,onChange:i,onChangeText:c,onComplete:s,helperText:d,placeholder:g="",shadow:f,views:m={},size:p="md",shape:u="rounded",variant:y="outline",gap:x=8,type:k="text",error:C=!1,isFocused:S=!1,isHovered:v=!1,isDisabled:w=!1,isReadOnly:b=!1,isAutoFocus:T=!1,setValue:F,setIsFocused:W,setIsHovered:j,inputRef:$,containerRef:z,mirrorSelectionStart:E,mirrorSelectionEnd:V,setMirrorSelectionStart:H,setMirrorSelectionEnd:P,handlePaste:M,handleChange:A,handleFocus:L,handleBlur:_,handleKeyDown:N,handleKeyPress:B,secureTextEntry:q,isFirstColumn:U,stepValues:O,setInputRef:X,onBlur:D=()=>{},onClick:K=()=>{},onFocus:R=()=>{},onKeyPress:Q,pattern:J,pasteTransformer:re,...ne})=>{l.useTheme();const te=!!t,Y=h.useMemo(()=>({slots:Array.from({length:a}).map((Z,oe)=>{const se=S&&E!==null&&V!==null&&(E===V&&oe===E||oe>=E&&oe<V),le=n[oe]!==void 0?n[oe]:null,fe=n[0]!==void 0?null:(g==null?void 0:g[oe])??null;return{char:le,placeholderChar:fe,isActive:se,hasFakeCaret:se&&le===null}}),isFocused:S,isHovering:!w&&v}),[S,v,w,a,V,E,g,n]);h.useEffect(()=>{T&&$.current&&$.current.focus()},[T,$]),h.useEffect(()=>{if(!document.getElementById("input-otp-style")){const Z=document.createElement("style");if(Z.id="input-otp-style",document.head.appendChild(Z),Z.sheet){const oe="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;";So(Z.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),So(Z.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),So(Z.sheet,`[data-input-otp]:autofill { ${oe} }`),So(Z.sheet,`[data-input-otp]:-webkit-autofill { ${oe} }`),So(Z.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; } }"),So(Z.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const ee=()=>r.jsx(l.Horizontal,{gap:x,width:"100%",justifyContent:"center",minHeight:p==="xs"?"32px":p==="sm"?"36px":p==="md"?"40px":p==="lg"?"48px":"56px",...m.container,children:Y.slots.map((Z,oe)=>r.jsxs(Xe,{size:p,error:C,shape:u,views:m,variant:y,value:Z.char||"",color:"theme-primary",isHovered:v,isDisabled:w,isReadOnly:b,isFocused:Z.isActive,showLabel:!1,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:p==="xs"?"32px":p==="sm"?"36px":p==="md"?"40px":p==="lg"?"48px":"56px",...m.container,children:[Z.char?r.jsx(l.View,{textAlign:"center",fontSize:p==="xs"?"14px":p==="sm"?"16px":p==="md"?"18px":p==="lg"?"20px":"24px",fontWeight:"medium",...m.text,children:k==="password"?"•":Z.char}):Z.placeholderChar?r.jsx(l.View,{textAlign:"center",fontSize:p==="xs"?"14px":p==="sm"?"16px":p==="md"?"18px":p==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...m.text,children:Z.placeholderChar}):null,Z.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}-${oe}`))}),ce={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:jh})}),r.jsxs(_e,{helperText:d,error:C,views:m,...ne,children:[te&&r.jsx(to,{htmlFor:e,color:"theme-primary",error:C,...m.label,children:t}),r.jsxs(l.View,{ref:z,"data-input-otp-container":!0,position:"relative",cursor:w?"default":"text",userSelect:"none",pointerEvents:"none",children:[r.jsx(Hh.Provider,{value:Y,children:ee()}),r.jsx(l.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(l.Input,{ref:Z=>X(Z),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":E,"data-input-otp-mse":V,id:e||o,name:o,type:k==="password"?"password":"text",inputMode:k!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:a,readOnly:b,disabled:w,placeholder:g,value:n,onChange:A,onKeyDown:N,onPaste:M,onFocus:L,onBlur:_,onClick:K,onMouseOver:()=>j(!0),onMouseLeave:()=>j(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${a} digits`,style:ce,...m.input})})]})]})]})},Ph=e=>{if(e==null)return"";if(typeof e=="string"||typeof e=="number"){const o=String(e);return o==="[object Object]"?"":o}return""},Ah=(e,o)=>{console.log(`[OTPInput] ${e}`,o)},ol=e=>e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:Object.prototype.toString.call(e),rl=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:a,setIsFocused:i,isHovered:c,setIsHovered:s,inputRef:d,containerRef:g,mirrorSelectionStart:f,mirrorSelectionEnd:m,setMirrorSelectionStart:p,setMirrorSelectionEnd:u,setInputRef:y,handleChange:x,handleFocus:k,handleBlur:C,handleKeyDown:S,handlePaste:v,handleKeyPress:w}=Ra(e),T=Ph(o!==void 0?o:t);return Ah("render",{name:e.name,controlledValue:ol(o),internalValue:ol(t),displayValue:T,length:e.length||6,hasOnChange:!!e.onChange,hasOnChangeText:!!e.onChangeText}),r.jsx(el,{...e,value:T,setValue:n,isFocused:a,setIsFocused:i,isHovered:c,setIsHovered:s,inputRef:d,containerRef:g,mirrorSelectionStart:f,mirrorSelectionEnd:m,setMirrorSelectionStart:p,setMirrorSelectionEnd:u,setInputRef:y,handleChange:x,handleFocus:k,handleBlur:C,handleKeyDown:S,handleKeyPress:w,handlePaste:v,stepValues:e.stepValues})},tl=h.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Vh=()=>h.useContext(tl),Eh=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...a})=>{const i=We.useFormikContext();h.useEffect(()=>{n(i.values)},[i.values]);const c=h.useRef({}),s=h.useRef([]),d=(m,p)=>{c.current[m]=p,p&&!s.current.includes(m)&&s.current.push(m)},g=m=>{var p,u;if(o){const x=s.current.indexOf(m)+1;x<s.current.length?(p=c.current[s.current[x]])==null||p.focus():(u=i.submitForm)==null||u.call(i)}},f={active:o,focusNextInput:g,setInputRef:d,handleSubmitEditing:g,getReturnKeyType:m=>s.current.indexOf(m)===s.current.length-1?"done":"next"};return h.useEffect(()=>{var m,p;o&&(t&&c.current[t]?(m=c.current[t])==null||m.focus():s.current[0]&&((p=c.current[s.current[0]])==null||p.focus()))},[o,t]),r.jsx(tl.Provider,{value:f,children:r.jsx(l.Form,{...a,children:e})})},Dh=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{}}},ue=({name:e,type:o,...t},n={})=>{const a=Vh(),{touched:i,errors:c,submitCount:s,values:d,setFieldTouched:g,setFieldValue:f}=We.useFormikContext(),m=b=>{var T;f(e,b),(T=t.onChangeText)==null||T.call(t,b)},p=b=>{var T;f(e,b),(T=t.onChange)==null||T.call(t,b)},u=()=>{g(e,!0)},y=b=>{b.key==="Enter"&&(b.preventDefault(),a.focusNextInput(e))},x=["text","password","email","digits"].includes(o),k=We.getIn(i,e)||s>0?We.getIn(c,e):void 0,C=We.getIn(d,e),S=typeof document<"u"&&typeof document.createElement=="function",v=!!n.focusable&&a.active,w=v?S?{onKeyPress:y}:{returnKeyType:a.getReturnKeyType(e),onSubmitEditing:()=>a.handleSubmitEditing(e),blurOnSubmit:!1}:{};return{...Dh(o),...t,value:C,error:k,onBlur:u,...x?{onChangeText:m}:{onChange:p},...w,...v?{inputRef:b=>a.setInputRef(e,b)}:{}}},$h=e=>{let{value:o,...t}=ue(e);t.isChecked=o;const n=za(e);return r.jsx(Wa,{...n,...t})},nl=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,n]=h.useState(!1),[a,i]=h.useState(o!==void 0?o:e);return h.useEffect(()=>{o!==void 0&&i(o)},[o]),{isHovered:t,setIsHovered:n,isSelected:a,setIsSelected:i}},Lh={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"}},Bh={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"}},_h={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",style:{backgroundColor:"transparent"}}},Oh={selected:{backgroundColor:"theme-primary"},unselected:{style:{backgroundColor:"transparent"}}},Vt={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"}}},Et={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"}}}},al=({id:e,icon:o,name:t,label:n,value:a,isChecked:i,onChange:c,onValueChange:s,shadow:d={},labelPosition:g="right",size:f="md",error:m=!1,isSelected:p=!1,isHovered:u=!1,isDisabled:y=!1,isReadOnly:x=!1,defaultIsSelected:k=!1,setIsSelected:C=()=>{},setIsHovered:S=()=>{},views:v={radio:{},label:{}},infoText:w,helperText:b,...T})=>{const F=()=>S(!u),W=()=>{!x&&!y&&(C&&C(!0),c&&c(a),s&&s(a))},j=i||p?"selected":"unselected",$=m?Vt.error[j]:y?Vt.disabled[j]:u?Vt.hover[j]:{},z=m?Et.error[j]:y?Et.disabled[j]:u?Et.hover[j]:{},E={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",selected:{borderColor:"theme-primary"},color:m?"color-red-600":y?"color-gray-400":"inherit",cursor:y?"not-allowed":x?"default":"pointer",opacity:y?.6:1,transition:"all 0.2s ease-in-out",...v.label},radio:{..._h[j],...$,borderRadius:"50%",selected:{backgroundColor:"theme-primary"},backgroundColor:"color-white",...Lh[f],transition:"all 0.2s ease-in-out",...d,...v.radio},dot:{...Oh[j],...z,borderRadius:"50%",...Bh[f],transition:"all 0.2s ease-in-out"}};return r.jsxs(qo,{htmlFor:e,as:"div",onClick:W,onMouseEnter:F,onMouseLeave:F,size:l.Typography.fontSizes[f],...E.container,...T,children:[r.jsxs(l.Vertical,{gap:8,children:[" ",r.jsxs(l.Horizontal,{gap:12,alignItems:"center",children:[" ",g==="left"&&n&&r.jsx(l.Text,{size:f,fontWeight:"500",...v==null?void 0:v.label,children:n}),r.jsx(l.Center,{...E.radio,children:(i||p)&&r.jsx(l.View,{...E.dot})}),g==="right"&&n&&r.jsx(l.Text,{size:f,fontWeight:"500",...v==null?void 0:v.label,children:n})]}),w&&r.jsx(l.Text,{marginLeft:g==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"20px",...v==null?void 0:v.infoText,children:w})]}),m&&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:m})]})},Nh=e=>{let{value:o,...t}=ue(e);t.isChecked=o===e.value;const n=nl(e);return r.jsx(al,{...n,...t})},ll=e=>{const{value:o,onChange:t,onSubmit:n,autoFocus:a=!0,loading:i=!1,disabled:c=!1,isAgentRunning:s=!1,onStopAgent:d,sandboxId:g,onUploadProgress:f,onUploadSuccess:m,onUploadError:p,onFileUpload:u}=e,y=o!==void 0&&t!==void 0,[x,k]=h.useState(""),C=y?o:x,[S,v]=h.useState([]),[w,b]=h.useState([]),[T,F]=h.useState(!1),[W,j]=h.useState(0),[$,z]=h.useState([]),[E,V]=h.useState(!1),H=h.useRef(null),[P,M]=h.useState(!1),[A,L]=h.useState("gpt-4"),[_]=h.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"}]),N=h.useRef(null),B=h.useRef(null),[q,U]=h.useState(e.showGuideTip||!1);h.useEffect(()=>{a&&N.current&&N.current.focus()},[a]),h.useEffect(()=>()=>{S.forEach(Z=>{})},[S]);const O=Z=>{y&&t?t(Z):k(Z)},X=Z=>{if(Z.preventDefault(),!C.trim()&&S.length===0||i||c&&!s)return;if(s&&d){d();return}let oe=C;if(S.length>0){const fe=S.map(Ve=>`[Uploaded File: ${URL.createObjectURL(Ve)}}]`).join(`
|
|
23
|
+
`;function So(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const el=({id:e,name:o,label:t,value:n="",length:a=6,onChange:i,onChangeText:c,onComplete:s,helperText:d,placeholder:g="",shadow:f,views:m={},size:p="md",shape:u="rounded",variant:y="outline",gap:x=8,type:k="text",error:C=!1,isFocused:S=!1,isHovered:v=!1,isDisabled:w=!1,isReadOnly:b=!1,isAutoFocus:T=!1,setValue:F,setIsFocused:W,setIsHovered:j,inputRef:$,containerRef:z,mirrorSelectionStart:E,mirrorSelectionEnd:V,setMirrorSelectionStart:H,setMirrorSelectionEnd:P,handlePaste:M,handleChange:A,handleFocus:L,handleBlur:_,handleKeyDown:N,handleKeyPress:B,secureTextEntry:q,isFirstColumn:U,stepValues:O,setInputRef:X,onBlur:D=()=>{},onClick:K=()=>{},onFocus:R=()=>{},onKeyPress:Q,pattern:J,pasteTransformer:re,...ne})=>{l.useTheme();const te=!!t,Y=h.useMemo(()=>({slots:Array.from({length:a}).map((Z,oe)=>{const se=S&&E!==null&&V!==null&&(E===V&&oe===E||oe>=E&&oe<V),le=n[oe]!==void 0?n[oe]:null,fe=n[0]!==void 0?null:(g==null?void 0:g[oe])??null;return{char:le,placeholderChar:fe,isActive:se,hasFakeCaret:se&&le===null}}),isFocused:S,isHovering:!w&&v}),[S,v,w,a,V,E,g,n]);h.useEffect(()=>{T&&$.current&&$.current.focus()},[T,$]),h.useEffect(()=>{if(!document.getElementById("input-otp-style")){const Z=document.createElement("style");if(Z.id="input-otp-style",document.head.appendChild(Z),Z.sheet){const oe="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;";So(Z.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),So(Z.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),So(Z.sheet,`[data-input-otp]:autofill { ${oe} }`),So(Z.sheet,`[data-input-otp]:-webkit-autofill { ${oe} }`),So(Z.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; } }"),So(Z.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const ee=()=>r.jsx(l.Horizontal,{gap:x,width:"100%",justifyContent:"center",minHeight:p==="xs"?"32px":p==="sm"?"36px":p==="md"?"40px":p==="lg"?"48px":"56px",...m.container,children:Y.slots.map((Z,oe)=>r.jsxs(Xe,{size:p,error:C,shape:u,views:m,variant:y,value:Z.char||"",color:"theme-primary",isHovered:v,isDisabled:w,isReadOnly:b,isFocused:Z.isActive,showLabel:!1,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:p==="xs"?"32px":p==="sm"?"36px":p==="md"?"40px":p==="lg"?"48px":"56px",...m.container,children:[Z.char?r.jsx(l.View,{textAlign:"center",fontSize:p==="xs"?"14px":p==="sm"?"16px":p==="md"?"18px":p==="lg"?"20px":"24px",fontWeight:"medium",...m.text,children:k==="password"?"•":Z.char}):Z.placeholderChar?r.jsx(l.View,{textAlign:"center",fontSize:p==="xs"?"14px":p==="sm"?"16px":p==="md"?"18px":p==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...m.text,children:Z.placeholderChar}):null,Z.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}-${oe}`))}),ce={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:jh})}),r.jsxs(_e,{helperText:d,error:C,views:m,...ne,children:[te&&r.jsx(to,{htmlFor:e,color:"theme-primary",error:C,...m.label,children:t}),r.jsxs(l.View,{ref:z,"data-input-otp-container":!0,position:"relative",cursor:w?"default":"text",userSelect:"none",pointerEvents:"none",children:[r.jsx(Hh.Provider,{value:Y,children:ee()}),r.jsx(l.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(l.Input,{ref:Z=>X(Z),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":E,"data-input-otp-mse":V,id:e||o,name:o,type:k==="password"?"password":"text",inputMode:k!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:a,readOnly:b,disabled:w,placeholder:g,value:n,onChange:A,onKeyDown:N,onPaste:M,onFocus:L,onBlur:_,onClick:K,onMouseOver:()=>j(!0),onMouseLeave:()=>j(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${a} digits`,style:ce,...m.input})})]})]})]})},Ph=e=>{if(e==null)return"";if(typeof e=="string"||typeof e=="number"){const o=String(e);return o==="[object Object]"?"":o}return""},Ah=(e,o)=>{console.log(`[OTPInput] ${e}`,o)},ol=e=>e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:Object.prototype.toString.call(e),rl=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:a,setIsFocused:i,isHovered:c,setIsHovered:s,inputRef:d,containerRef:g,mirrorSelectionStart:f,mirrorSelectionEnd:m,setMirrorSelectionStart:p,setMirrorSelectionEnd:u,setInputRef:y,handleChange:x,handleFocus:k,handleBlur:C,handleKeyDown:S,handlePaste:v,handleKeyPress:w}=Ra(e),T=Ph(o!==void 0?o:t);return Ah("render",{name:e.name,controlledValue:ol(o),internalValue:ol(t),displayValue:T,length:e.length||6,hasOnChange:!!e.onChange,hasOnChangeText:!!e.onChangeText}),r.jsx(el,{...e,value:T,setValue:n,isFocused:a,setIsFocused:i,isHovered:c,setIsHovered:s,inputRef:d,containerRef:g,mirrorSelectionStart:f,mirrorSelectionEnd:m,setMirrorSelectionStart:p,setMirrorSelectionEnd:u,setInputRef:y,handleChange:x,handleFocus:k,handleBlur:C,handleKeyDown:S,handleKeyPress:w,handlePaste:v,stepValues:e.stepValues})},tl=h.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Vh=()=>h.useContext(tl),Eh=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...a})=>{const i=We.useFormikContext();h.useEffect(()=>{n(i.values)},[i.values]);const c=h.useRef({}),s=h.useRef([]),d=(u,y)=>{c.current[u]=y,y&&!s.current.includes(u)&&s.current.push(u)},g=u=>{var y,x;if(o){const C=s.current.indexOf(u)+1;C<s.current.length?(y=c.current[s.current[C]])==null||y.focus():(x=i.submitForm)==null||x.call(i)}},f={active:o,focusNextInput:g,setInputRef:d,handleSubmitEditing:g,getReturnKeyType:u=>s.current.indexOf(u)===s.current.length-1?"done":"next"};h.useEffect(()=>{var u,y;o&&(t&&c.current[t]?(u=c.current[t])==null||u.focus():s.current[0]&&((y=c.current[s.current[0]])==null||y.focus()))},[o,t]);const p=typeof document<"u"&&typeof document.createElement=="function"?{onSubmit:i.handleSubmit,onReset:i.handleReset}:{};return r.jsx(tl.Provider,{value:f,children:r.jsx(l.Form,{...a,...p,children:e})})},Dh=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{}}},ue=({name:e,type:o,...t},n={})=>{const a=Vh(),{touched:i,errors:c,submitCount:s,values:d,setFieldTouched:g,setFieldValue:f}=We.useFormikContext(),m=b=>{var T;f(e,b),(T=t.onChangeText)==null||T.call(t,b)},p=b=>{var T;f(e,b),(T=t.onChange)==null||T.call(t,b)},u=()=>{g(e,!0)},y=b=>{b.key==="Enter"&&(b.preventDefault(),a.focusNextInput(e))},x=["text","password","email","digits"].includes(o),k=We.getIn(i,e)||s>0?We.getIn(c,e):void 0,C=We.getIn(d,e),S=typeof document<"u"&&typeof document.createElement=="function",v=!!n.focusable&&a.active,w=v?S?{onKeyPress:y}:{returnKeyType:a.getReturnKeyType(e),onSubmitEditing:()=>a.handleSubmitEditing(e),blurOnSubmit:!1}:{};return{...Dh(o),...t,value:C,error:k,onBlur:u,...x?{onChangeText:m}:{onChange:p},...w,...v?{inputRef:b=>a.setInputRef(e,b)}:{}}},$h=e=>{let{value:o,...t}=ue(e);t.isChecked=o;const n=za(e);return r.jsx(Wa,{...n,...t})},nl=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,n]=h.useState(!1),[a,i]=h.useState(o!==void 0?o:e);return h.useEffect(()=>{o!==void 0&&i(o)},[o]),{isHovered:t,setIsHovered:n,isSelected:a,setIsSelected:i}},Lh={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"}},Bh={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"}},_h={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",style:{backgroundColor:"transparent"}}},Oh={selected:{backgroundColor:"theme-primary"},unselected:{style:{backgroundColor:"transparent"}}},Vt={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"}}},Et={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"}}}},al=({id:e,icon:o,name:t,label:n,value:a,isChecked:i,onChange:c,onValueChange:s,shadow:d={},labelPosition:g="right",size:f="md",error:m=!1,isSelected:p=!1,isHovered:u=!1,isDisabled:y=!1,isReadOnly:x=!1,defaultIsSelected:k=!1,setIsSelected:C=()=>{},setIsHovered:S=()=>{},views:v={radio:{},label:{}},infoText:w,helperText:b,...T})=>{const F=()=>S(!u),W=()=>{!x&&!y&&(C&&C(!0),c&&c(a),s&&s(a))},j=i||p?"selected":"unselected",$=m?Vt.error[j]:y?Vt.disabled[j]:u?Vt.hover[j]:{},z=m?Et.error[j]:y?Et.disabled[j]:u?Et.hover[j]:{},E={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",selected:{borderColor:"theme-primary"},color:m?"color-red-600":y?"color-gray-400":"inherit",cursor:y?"not-allowed":x?"default":"pointer",opacity:y?.6:1,transition:"all 0.2s ease-in-out",...v.label},radio:{..._h[j],...$,borderRadius:"50%",selected:{backgroundColor:"theme-primary"},backgroundColor:"color-white",...Lh[f],transition:"all 0.2s ease-in-out",...d,...v.radio},dot:{...Oh[j],...z,borderRadius:"50%",...Bh[f],transition:"all 0.2s ease-in-out"}};return r.jsxs(qo,{htmlFor:e,as:"div",onClick:W,onMouseEnter:F,onMouseLeave:F,size:l.Typography.fontSizes[f],...E.container,...T,children:[r.jsxs(l.Vertical,{gap:8,children:[" ",r.jsxs(l.Horizontal,{gap:12,alignItems:"center",children:[" ",g==="left"&&n&&r.jsx(l.Text,{size:f,fontWeight:"500",...v==null?void 0:v.label,children:n}),r.jsx(l.Center,{...E.radio,children:(i||p)&&r.jsx(l.View,{...E.dot})}),g==="right"&&n&&r.jsx(l.Text,{size:f,fontWeight:"500",...v==null?void 0:v.label,children:n})]}),w&&r.jsx(l.Text,{marginLeft:g==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"20px",...v==null?void 0:v.infoText,children:w})]}),m&&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:m})]})},Nh=e=>{let{value:o,...t}=ue(e);t.isChecked=o===e.value;const n=nl(e);return r.jsx(al,{...n,...t})},ll=e=>{const{value:o,onChange:t,onSubmit:n,autoFocus:a=!0,loading:i=!1,disabled:c=!1,isAgentRunning:s=!1,onStopAgent:d,sandboxId:g,onUploadProgress:f,onUploadSuccess:m,onUploadError:p,onFileUpload:u}=e,y=o!==void 0&&t!==void 0,[x,k]=h.useState(""),C=y?o:x,[S,v]=h.useState([]),[w,b]=h.useState([]),[T,F]=h.useState(!1),[W,j]=h.useState(0),[$,z]=h.useState([]),[E,V]=h.useState(!1),H=h.useRef(null),[P,M]=h.useState(!1),[A,L]=h.useState("gpt-4"),[_]=h.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"}]),N=h.useRef(null),B=h.useRef(null),[q,U]=h.useState(e.showGuideTip||!1);h.useEffect(()=>{a&&N.current&&N.current.focus()},[a]),h.useEffect(()=>()=>{S.forEach(Z=>{})},[S]);const O=Z=>{y&&t?t(Z):k(Z)},X=Z=>{if(Z.preventDefault(),!C.trim()&&S.length===0||i||c&&!s)return;if(s&&d){d();return}let oe=C;if(S.length>0){const fe=S.map(Ve=>`[Uploaded File: ${URL.createObjectURL(Ve)}}]`).join(`
|
|
24
24
|
`);oe=oe?`${oe}
|
|
25
25
|
|
|
26
26
|
${fe}`:fe}let se=A,le=!1;A.endsWith("-thinking")&&(se=A.replace(/-thinking$/,""),le=!0),n==null||n(oe,{model_name:se,enable_thinking:le}),y||k(""),v([]),b([])},D=Z=>{v(oe=>oe.filter((se,le)=>le!==Z)),!g&&w.length>Z&&b(oe=>oe.filter((se,le)=>le!==Z))},K=Z=>{Z.preventDefault(),Z.stopPropagation(),M(!0)},R=Z=>{Z.preventDefault(),Z.stopPropagation(),M(!1)},Q=h.useCallback(Z=>{!Z||Z.length===0||(b(oe=>[...oe,...Z]),v(oe=>[...oe,...Z]),z(oe=>[...oe,...Z]),F(!0))},[b,v]),J=h.useCallback(()=>{if($.length>0&&!E&&u){V(!0);const Z=$[0];H.current=Z,j(0);try{u(Z)}catch(oe){z(se=>se.slice(1)),V(!1),H.current=null,j(0),F(se=>$.length-1>0||!1),p==null||p(oe)}}else $.length===0&&T&&(F(!1),j(0))},[$,E,u,T,p]);h.useEffect(()=>{J()},[$,E,J]);const re="active",ne=Z=>!0,te=()=>{U(!1),e.onGuideClose&&e.onGuideClose()},Y=Z=>{y&&t?t(Z.text):k(Z.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(Z),N.current&&N.current.focus()},ee=h.useCallback(()=>w,[w]),ce=h.useCallback(()=>b([]),[]);return{onSubmit:n,getPendingFiles:ee,clearPendingFiles:ce,value:C,handleChange:O,handleSubmit:X,editableRef:N,fileInputRef:B,isUploading:T,uploadProgress:W,isDraggingOver:P,uploadedFiles:S,pendingFiles:w,removeUploadedFile:D,setPendingFiles:b,setUploadedFiles:v,setIsUploading:F,startUpload:Q,selectedModel:A,handleModelChange:L,modelOptions:_,subscriptionStatus:re,canAccessModel:ne,handleDragOver:K,handleDragLeave:R,isGuideTipShown:q,hideGuideTip:te,handlePromptExampleSelect:Y}},qh={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}},il={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"}},Uh={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},Gh={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"}},Yh={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"}},cl=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,Kh=({openDelay:e=200,closeDelay:o=300}={})=>{const[t,n]=h.useState(!1),a=h.useRef(null),i=h.useRef(null),c=h.useRef(null),s=h.useRef(null),d=h.useMemo(()=>cl("hovercard-content"),[]),g=h.useMemo(()=>cl("hovercard-trigger"),[]),f=h.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),i.current&&(clearTimeout(i.current),i.current=null)},[]),m=h.useCallback(()=>{f(),t||(a.current=setTimeout(()=>{n(!0)},e))},[t,e,f]),p=h.useCallback(()=>{f(),t&&(i.current=setTimeout(()=>{n(!1)},o))},[t,o,f]),u=h.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);return h.useEffect(()=>()=>f(),[f]),{isOpen:t,openCard:m,closeCard:p,cancelCloseTimer:u,triggerRef:c,contentRef:s,contentId:d,triggerId:g}},sl=h.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Xh=({children:e,value:o})=>r.jsx(sl.Provider,{value:o,children:e}),dl=()=>{const e=h.useContext(sl);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},Jh=({children:e,views:o,asChild:t=!1,...n})=>{const{openCard:a,closeCard:i,triggerRef:c,contentId:s,triggerId:d}=dl(),u={ref:c,onMouseEnter:()=>a(),onMouseLeave:()=>i(),onFocus:()=>a(),onBlur:()=>i(),id:d,"aria-describedby":s,...o==null?void 0:o.container,...n};if(t&&h.isValidElement(e)){const y=h.Children.only(e);return h.cloneElement(y,{...u,...y.props})}return r.jsx(l.View,{position:"relative",display:"inline-block",...u,children:e})},Qh=({children:e,views:o,side:t="bottom",align:n="center",sideOffset:a=8,style:i,backgroundColor:c="color-white",borderRadius:s="4px",boxShadow:d="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:g="12px",minWidth:f="50px",maxWidth:m="300px",...p})=>{const{isOpen:u,cancelCloseTimer:y,closeCard:x,contentRef:k,triggerRef:C,contentId:S,triggerId:v}=dl(),{ref:w,relation:b}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});h.useEffect(()=>{C!=null&&C.current&&(w==null?void 0:w.current)!==C.current&&w&&(w.current=C.current)},[C,w,u]);const T=()=>y(),F=()=>x();if(!u)return null;const W=()=>{if(!b||!(C!=null&&C.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const z=C.current.getBoundingClientRect();let E=t;t==="bottom"&&b.space.vertical==="top"?E="top":t==="top"&&b.space.vertical==="bottom"?E="bottom":t==="right"&&b.space.horizontal==="left"?E="left":t==="left"&&b.space.horizontal==="right"&&(E="right");let V=0,H=0;switch(E){case"bottom":V=z.left+z.width/2,H=z.bottom+a;break;case"top":V=z.left+z.width/2,H=z.top-a;break;case"right":V=z.right+a,H=z.top+z.height/2;break;case"left":V=z.left-a,H=z.top+z.height/2;break}return{position:"fixed",left:V,top:H,zIndex:1e3,transform:j(E)}},j=z=>{switch(z){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)"}},$=W();return r.jsx(l.View,{ref:k,id:S,role:"tooltip","aria-labelledby":v,onMouseEnter:T,onMouseLeave:F,backgroundColor:c,borderRadius:s,boxShadow:d,padding:g,minWidth:f,maxWidth:m,style:{...$,...i},...o==null?void 0:o.container,...p,children:e})},ve=({children:e,views:o,openDelay:t,closeDelay:n,...a})=>{const i=Kh({openDelay:t,closeDelay:n});return r.jsx(Xh,{value:i,children:r.jsx(l.View,{position:"relative",display:"inline-block",...o==null?void 0:o.container,...a,children:e})})};ve.Trigger=Jh,ve.Content=Qh;const Zh=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:a="120px",showPreviews:i=!1,views:c={}})=>{if(e.length===0)return null;const s=h.useCallback(g=>g<1024?`${g} B`:g<1024*1024?`${(g/1024).toFixed(1)} KB`:`${(g/(1024*1024)).toFixed(1)} MB`,[]),d=h.useCallback(g=>g.type.startsWith("image/")?{backgroundColor:"#DBEAFE",color:"#2563EB"}:g.type.startsWith("video/")?{backgroundColor:"#EDE9FE",color:"#7C3AED"}:g.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",...c==null?void 0:c.container,children:e.map((g,f)=>{const m=(g==null?void 0:g.path)||(g==null?void 0:g.url)||(i?URL.createObjectURL(g):""),p=g.type.startsWith("image/"),u=g.type.startsWith("video/"),y=g.type.startsWith("audio/"),x=d(g);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,...c==null?void 0:c.item,children:i&&r.jsxs(ve,{children:[r.jsxs(ve.Trigger,{children:[p&&r.jsx(l.Image,{src:m,alt:g.name,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),u&&r.jsx(l.View,{as:"video",src:m,alt:g.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(yo,{widthHeight:24,color:"color-black"})}),!p&&!u&&!y&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(ro,{widthHeight:24,color:"color-black"})}),t&&r.jsx(l.Button,{...qh.attachmentRemove,onClick:k=>{k.stopPropagation(),t(f)},"aria-label":`Remove ${g.name}`,children:"×"})]}),r.jsxs(ve.Content,{children:[p&&r.jsx(l.Image,{src:m,alt:g.name,maxWidth:"100%"}),u&&r.jsx(l.View,{as:"video",src:m,controls:!0,maxWidth:"100%"}),y&&r.jsx(l.View,{as:"audio",src:m,controls:!0,width:"100%"}),r.jsxs(l.Text,{marginTop:"4px",maxLines:1,width:"100%",...c==null?void 0:c.name,children:[g.name," (",s(g.size),")"]})]})]})},f):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,...c==null?void 0:c.item,children:[r.jsx(l.Center,{width:"22px",height:"22px",minWidth:"22px",borderRadius:"9999px",backgroundColor:x.backgroundColor,color:x.color,children:y?r.jsx(yo,{widthHeight:12,color:"currentColor"}):r.jsx(ro,{widthHeight:12,color:"currentColor"})}),r.jsxs(l.Text,{fontSize:"12px",lineHeight:"16px",color:"color-gray-600",maxLines:1,maxWidth:"220px",...c==null?void 0:c.name,children:[g.name," · ",s(g.size)]}),t&&r.jsx(l.View,{as:"button",type:"button",onClick:()=>t(f),"aria-label":`Remove ${g.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:"×"})]},f)})})},gl=h.forwardRef(({value:e,onChange:o,placeholder:t="Type your message...",disabled:n=!1,autoFocus:a=!0,suggestions:i=[],onSuggestionSelect:c,showSuggestions:s=!1,mentionData:d=[],mentionTrigger:g="@",onMentionSelect:f,maxHeight:m="200px",minHeight:p="40px",views:u={}},y)=>{var ne,te;const x=h.useRef(e),[k,C]=h.useState(-1),[S,v]=h.useState(!e),w=h.useRef(null),[b,T]=h.useState(!1),[F,W]=h.useState(!1),[j,$]=h.useState(""),[z,E]=h.useState(-1),[V,H]=h.useState(-1),[P,M]=h.useState([]),{ref:A,relation:L}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[_,N]=h.useState({x:0,y:0}),[B,q]=h.useState({x:0,y:0});h.useEffect(()=>{const Y=y;Y.current&&e!==x.current&&(Y.current.textContent=e,x.current=e,v(!e))},[e,y]),h.useEffect(()=>{a&&y&&typeof y=="object"&&y.current&&y.current.focus()},[a,y]);const U=()=>{const Y=window.getSelection();if(!Y||Y.rangeCount===0)return-1;const ee=Y.getRangeAt(0),ce=ee.cloneRange();return ce.selectNodeContents(y&&typeof y=="object"&&y.current?y.current:document.body),ce.setEnd(ee.endContainer,ee.endOffset),ce.toString().length},O=h.useCallback((Y,ee)=>{const ce=Y.substring(0,ee),Z=ce.lastIndexOf(g);if(Z!==-1){const oe=ce.substring(Z+1);if(!oe.includes(" ")){const le=oe.toLowerCase(),fe=d.filter(Be=>Be.name.toLowerCase().includes(le));$(le),E(Z),M(fe),W(fe.length>0),H(0);const Ve=X();N(Ve);return}}W(!1),$(""),E(-1),H(-1)},[d,g]);h.useEffect(()=>{w.current&&A&&(A.current=w.current)},[w,A]);const X=h.useCallback((Y=200)=>{if(!w.current)return{x:0,y:0};const ee=w.current.getBoundingClientRect();if(L){const se=L.space.vertical==="top";return{x:ee.left,y:se?ee.top-Y-8:ee.bottom+8}}const ce=window.innerHeight,Z={top:ee.top,bottom:ce-ee.bottom},oe=Z.bottom<Y+8&&Z.top>Z.bottom;return{x:ee.left,y:oe?ee.top-Y-8:ee.bottom+8}},[L]),D=h.useCallback(()=>{T(!0);const Y=X();q(Y)},[X]),K=h.useCallback(()=>{setTimeout(()=>{T(!1),C(-1)},150)},[]),R=Y=>{const ee=Y.currentTarget.textContent||"";if(ee!==x.current){o(ee),x.current=ee,v(!ee);const ce=U();O(ee,ce)}},Q=h.useCallback(Y=>{if(y&&typeof y=="object"&&y.current){const ee=y.current.textContent||"",ce=ee.substring(0,z),Z=ee.substring(z+g.length+j.length),oe=ce+g+Y.name+" "+Z;o(oe),x.current=oe,y.current.textContent=oe;const se=ce.length+g.length+Y.name.length+1;setTimeout(()=>{var le;if(y.current){const fe=document.createRange(),Ve=window.getSelection(),Be=y.current.firstChild;Be&&Ve&&(fe.setStart(Be,Math.min(se,((le=Be.textContent)==null?void 0:le.length)||0)),fe.collapse(!0),Ve.removeAllRanges(),Ve.addRange(fe))}},0)}W(!1),$(""),E(-1),H(-1),f&&f(Y)},[z,g,j,o,f,y]),J=h.useCallback(Y=>{c&&c(Y),C(-1)},[c]),re=Y=>{if(F&&P.length>0){if(Y.key==="ArrowDown"){Y.preventDefault(),H(ee=>ee<P.length-1?ee+1:0);return}if(Y.key==="ArrowUp"){Y.preventDefault(),H(ee=>ee>0?ee-1:P.length-1);return}if((Y.key==="Tab"||Y.key==="Enter")&&V>=0){Y.preventDefault(),Q(P[V]);return}if(Y.key==="Escape"){W(!1),H(-1);return}}if(s&&i.length>0){if(Y.key==="ArrowDown"){Y.preventDefault(),C(ee=>ee<i.length-1?ee+1:0);return}if(Y.key==="ArrowUp"){Y.preventDefault(),C(ee=>ee>0?ee-1:i.length-1);return}if(Y.key==="Tab"&&k>=0){Y.preventDefault(),J(i[k]);return}if(Y.key==="Escape"){C(-1);return}}};return r.jsxs(l.View,{ref:w,width:"100%",position:"relative",...u==null?void 0:u.container,children:[r.jsxs(l.View,{width:"100%",minHeight:p,maxHeight:m,overflowY:"auto",position:"relative",children:[S&&r.jsx(l.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...u==null?void 0:u.placeholder,children:t}),r.jsx(l.View,{as:"div",ref:y,contentEditable:!n,suppressContentEditableWarning:!0,onInput:R,onKeyDown:re,onFocus:D,onBlur:K,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",...u==null?void 0:u.input})]}),F&&P.length>0&&r.jsx(l.View,{position:"fixed",left:_.x,top:_.y,width:((ne=w.current)==null?void 0:ne.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",...u==null?void 0:u.mentionContainer,children:r.jsxs(l.Vertical,{gap:0,children:[P.map((Y,ee)=>r.jsx(l.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:ee===V?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>Q(Y),onMouseEnter:()=>H(ee),_hover:{backgroundColor:"color-blue-50"},...u==null?void 0:u.mentionItem,children:r.jsxs(l.Vertical,{gap:4,children:[r.jsxs(l.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[g,Y.name]}),Y.description&&r.jsx(l.Text,{fontSize:"12px",color:"color-gray-600",children:Y.description})]})},Y.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",g,")",L&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})}),s&&i.length>0&&!F&&b&&!e&&r.jsx(l.View,{position:"fixed",left:B.x,top:B.y,width:((te=w.current)==null?void 0:te.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",...u==null?void 0:u.suggestionsContainer,children:r.jsxs(l.Vertical,{gap:0,children:[i.map((Y,ee)=>r.jsx(l.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:ee===k?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>J(Y),onMouseEnter:()=>C(ee),_hover:{backgroundColor:"color-blue-50"},...u==null?void 0:u.suggestionItem,children:r.jsxs(l.Vertical,{gap:4,children:[r.jsx(l.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:Y.text}),Y.description&&r.jsx(l.Text,{fontSize:"12px",color:"color-gray-600",children:Y.description})]})},Y.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",L&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})})]})});gl.displayName="EditableInput";const Rh=({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))})},ef=({onRecordingComplete:e,onRecordingStart:o,views:t={}})=>{const{recording:n,paused:a,audioBlob:i,analyserNode:c,startRecording:s,stopRecording:d}=Yn();h.useEffect(()=>{if(i){const f=new File([i],`recording-${Date.now()}.webm`,{type:i.type||"audio/webm;codecs=opus"});e(f)}},[i]);const g=h.useCallback(()=>{s(),o==null||o()},[]);return r.jsxs(l.Horizontal,{alignItems:"center",gap:4,children:[r.jsx(l.View,{minWidth:90,children:n&&c&&r.jsx(mt,{analyserNode:c,isPaused:a})}),r.jsx(l.View,{as:"button",type:"button",onClick:n?d:g,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(mr,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(lt,{widthHeight:16,color:"currentColor",filled:!1})})]})},hl=h.memo(({onSubmit:e,placeholder:o="Type your message… use @ to mention",loading:t=!1,disabled:n=!1,isAgentRunning:a=!1,enableAudioRecording:i=!1,leftButtons:c,rightButtons:s,onStopAgent:d,loadingText:g="Agent is working...",autoFocus:f=!0,sandboxId:m,hideAttachments:p=!1,attachmentText:u="",promptExamples:y=[],suggestions:x=[],errorMessage:k,size:C="md",shape:S="rounded",variant:v="default",views:w={},mentionData:b=[],mentionTrigger:T="@",onMentionSelect:F,onAudioRecordingStart:W,onAudioRecordingStop:j,showGuideTip:$,guideVideoUrl:z,onGuideClose:E,onFileBrowse:V,onUploadProgress:H,onUploadSuccess:P,onUploadError:M,onFileUpload:A,onPromptExampleSelect:L,value:_,handleChange:N,handleSubmit:B,editableRef:q,fileInputRef:U,isUploading:O,uploadProgress:X,isDraggingOver:D,uploadedFiles:K,pendingFiles:R,getPendingFiles:Q,clearPendingFiles:J,removeUploadedFile:re,setPendingFiles:ne,setUploadedFiles:te,setIsUploading:Y,startUpload:ee,selectedModel:ce,handleModelChange:Z,modelOptions:oe,subscriptionStatus:se,canAccessModel:le,isGuideTipShown:fe,hideGuideTip:Ve,handlePromptExampleSelect:Be,handleDragOver:Sn,handleDragLeave:sr,onChange:Cc,...Ue})=>{l.useTheme();const Do=h.useMemo(()=>({...il.container,...Uh[S],...w==null?void 0:w.container}),[S,w==null?void 0:w.container]),vn=h.useMemo(()=>({...il.content,...Gh[C],...Yh[v],...w==null?void 0:w.content}),[C,v,w==null?void 0:w.content]),dr=((_==null?void 0:_.trim().length)??0)>0||K.length>0,Ry=h.useCallback(Ce=>{ee([Ce]),j==null||j(Ce)},[ee,j]),Tn=h.useCallback(Ce=>{const $o=Ce.filter(wc=>wc.size>52428800?(console.error(`File size exceeds 50MB limit: ${wc.name}`),!1):!0);$o.length>0&&ee($o)},[ee]),eb=h.useCallback(Ce=>{if(Ce.preventDefault(),Ce.stopPropagation(),sr(Ce),Ce.dataTransfer.files.length>0){const $o=Array.from(Ce.dataTransfer.files);Tn($o)}},[sr,Tn]),ob=h.useMemo(()=>[...b||[],...K.map((Ce,$o)=>({id:`file-${$o}`,name:Ce.name}))],[b,K]);return r.jsxs(l.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...Do,...Ue,onDragOver:Sn,onDragLeave:sr,onDrop:eb,children:[y.length>0&&r.jsx(Rh,{examples:y,onSelect:Be,views:{container:w==null?void 0:w.promptExamples,item:w==null?void 0:w.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"},...w==null?void 0:w.loadingIndicator,children:[r.jsx(ct,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(l.Text,{color:"color-gray-500",children:g})]}),r.jsx(l.View,{position:"relative",width:"100%",overflow:"visible",children:r.jsxs(l.View,{as:"form",onSubmit:B,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...vn,...Do,paddingHorizontal:16,paddingVertical:10,backgroundColor:D?"color-blue-50":void 0,children:[r.jsx(Zh,{files:K,sandboxId:m,onRemove:re,showPreviews:!0,views:{container:w==null?void 0:w.attachments,item:w==null?void 0:w.attachmentItem,name:w==null?void 0:w.attachmentName,size:w==null?void 0:w.attachmentSize,removeButton:w==null?void 0:w.attachmentRemove}}),r.jsx(gl,{ref:q,value:_||"",onChange:N,placeholder:o,disabled:n&&!a,autoFocus:f,suggestions:x||[],showSuggestions:x&&x.length>0&&!_,onSuggestionSelect:Ce=>{N(Ce.text)},mentionData:ob,mentionTrigger:T,onMentionSelect:F,views:{container:{},input:w==null?void 0:w.editableInput}}),r.jsxs(l.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[r.jsxs(l.Horizontal,{gap:8,alignItems:"center",children:[!p&&r.jsx(br,{accept:"*/*",icon:r.jsx(Bo,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:Tn,isLoading:O,progress:X||0,text:u,fileType:"file",renderError:({errorMessage:Ce})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...w==null?void 0:w.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:S==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:Ce=>Ce.size>50*1024*1024?"File size exceeds 50MB limit":null}),c]}),r.jsxs(l.Horizontal,{gap:8,alignItems:"center",children:[i&&r.jsx(ef,{onRecordingStart:W,onRecordingComplete:Ry,views:{button:w==null?void 0:w.recordButton}}),r.jsx(l.View,{as:"button",type:"button",onClick:B,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:a?"theme-error":dr?"theme-primary":"color-gray-300",color:"color-white",borderRadius:S==="rounded"?"50%":4,border:"none",cursor:dr?"pointer":"not-allowed",disabled:!dr||t||n&&!a,transition:"background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease",_hover:{opacity:dr||a?.9:1},_active:{opacity:dr||a?.95:1},_focusVisible:{outline:"none",boxShadow:"0 0 0 2px white, 0 0 0 4px theme-primary"},...w==null?void 0:w.submitButton,children:a?r.jsx(mr,{widthHeight:16,color:"currentColor",filled:!1}):t?r.jsx(Ke,{type:"quarter",size:16,color:"color-white"}):r.jsx(it,{widthHeight:16,color:"currentColor",filled:!1})}),s]})]})]})}),k&&r.jsx(l.Text,{color:"theme-error",marginTop:"4px",...w==null?void 0:w.bottomTip,children:k})]})}),of=e=>{const{name:o,onSubmit:t,...n}=e,[a,i]=h.useState([]),c=ue({name:o,type:"text"}),s=p=>{c.onChangeText&&c.onChangeText(p)},d=(p,u)=>{t?t(p,u):s(p)},g=()=>a,f=()=>i([]),m=ll({...n,value:c.value||"",onChange:s,onSubmit:d});return r.jsx(hl,{...n,...m,value:c.value||"",onChange:s,onSubmit:d,error:c.error,getPendingFiles:g,clearPendingFiles:f})},rf=e=>{const o=ue(e),t=Ha(o);return r.jsx(ja,{...t,...o})},tf=e=>{const o=ue(e),t=Na();return r.jsx(qa,{...t,...o})},nf=e=>{const o=ue(e),t=Pa(e);return r.jsx(Va,{...t,...o})},af=e=>{let o=ue(e);o.selected=o.value;const t=ua(e);return r.jsx(xa,{...t,...o})},lf=e=>{const o=ue(e),t=ka(e);return r.jsx(Sa,{...t,...o})},cf=e=>{const{name:o,...t}=e,{values:n,errors:a,touched:i,submitCount:c,setFieldValue:s,setFieldTouched:d}=We.useFormikContext(),g=We.getIn(n,o)||[],f=We.getIn(i,o)||c>0?We.getIn(a,o):void 0,m=h.useCallback(k=>{var S;const C=Array.isArray(k)?k.filter(v=>typeof v=="string"):[];s(o,C),(S=e.onTagsChange)==null||S.call(e,C)},[o,s,e.onTagsChange]),p=h.useCallback(()=>{var k;d(o,!0),(k=e.onBlur)==null||k.call(e)},[o,d,e.onBlur]),u=Qa({...t,tags:g,onTagsChange:m,onBlur:p}),{tags:y,...x}=u;return r.jsx(Za,{...x,...t,tags:y,error:f})},sf=e=>{const o=ue(e),t=Ia(e);return r.jsx(Fa,{...t,...o})},df=e=>{const o=ue(e,{focusable:!0}),{value:t,...n}=Wt(e);return r.jsx(Go,{...n,...o})},gf=({visibleIcon:e=r.jsx(dt,{widthHeight:14}),hiddenIcon:o=r.jsx(st,{widthHeight:14}),...t})=>{const n=ue(t,{focusable:!0}),{isVisible:a,setIsVisible:i,...c}=Ua(n);return r.jsx(Go,{...c,type:a?"text":"password",isClearable:!1,right:r.jsx(l.View,{onClick:()=>{t.isDisabled||i(!a)},children:a?e:o})})},hf=({items:e,placeholder:o,searchPlaceholder:t,isMulti:n=!1,...a})=>{const i=ue(a),c=Ya(e,o,t);h.useEffect(()=>{if(n&&Array.isArray(i.value))c.setSelectedItems(i.value);else if(!n&&i.value){const d=typeof i.value=="object"?i.value:e.find(g=>g.value===i.value);d&&c.setSelectedItem(d)}},[i.value,n,e]);const s=d=>{i.onChange(d)};return r.jsx(Ja,{...c,...i,items:e,placeholder:o,isMulti:n,onSelect:s})},vo=(e,o,t)=>Math.min(Math.max(e,o),t),ff=(e,o,t,n,a,i,c)=>{const s=n-t;let d;if(i==="horizontal"){const g=o.width,f=e-o.left;d=vo(f/g,0,1)}else{const g=o.height,f=o.bottom-e;d=vo(f/g,0,1)}if(c&&c.length>0){const g=t+d*s;let f=c[0],m=Math.abs(g-f);for(let p=1;p<c.length;p++){const u=Math.abs(g-c[p]);u<m&&(m=u,f=c[p])}return f}else{const g=t+d*s,f=Math.round(g/a)*a;return vo(f,t,n)}},fl=({min:e=0,max:o=100,step:t=1,value:n,defaultValue:a,onChange:i,onDrag:c,orientation:s="horizontal",isDisabled:d=!1,stepValues:g})=>{const f=vo(n??a??e,e,o),[m,p]=h.useState(f),[u,y]=h.useState(!1),[x,k]=h.useState(!1),C=h.useRef(null),S=h.useRef(null),v=n!==void 0,w=n!==void 0?n:m;h.useEffect(()=>{n!==void 0&&p(vo(n,e,o))},[n,e,o]);const b=h.useCallback(E=>{const V=vo(E,e,o);v||p(V),i&&V!==w&&i(V),u&&c&&c(V)},[v,e,o,i,w,u,c]),T=h.useCallback(E=>{if(d||!C.current)return;const V=C.current;if(typeof V.getBoundingClientRect!="function")return;const H=V.getBoundingClientRect();let P;"touches"in E?P=s==="horizontal"?E.touches[0].clientX:E.touches[0].clientY:P=s==="horizontal"?E.clientX:E.clientY;const M=ff(P,H,e,o,t,s,g);b(M)},[e,o,t,s,b,d,g]),F=h.useCallback(E=>{if(d)return;E.preventDefault(),y(!0),T(E);const V=P=>{T(P)},H=()=>{y(!1),document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",H),document.removeEventListener("touchmove",V),document.removeEventListener("touchend",H)};typeof(document==null?void 0:document.addEventListener)=="function"&&(document.addEventListener("mousemove",V),document.addEventListener("mouseup",H),document.addEventListener("touchmove",V),document.addEventListener("touchend",H))},[T,d]),W=h.useCallback(E=>{const V=S.current;V&&typeof V.contains=="function"&&V.contains(E.target)||F(E)},[F]),j=h.useCallback(E=>{if(d)return;let V=w;switch(E.key){case"ArrowLeft":case"ArrowDown":V=w-t;break;case"ArrowRight":case"ArrowUp":V=w+t;break;case"Home":V=e;break;case"End":V=o;break;default:return}E.preventDefault(),b(V)},[w,e,o,t,b,d]),$=o-e,z=$===0?0:(w-e)/$*100;return{currentValue:w,isDragging:u,isHovered:x,setIsHovered:k,trackRef:C,thumbRef:S,handleThumbMouseDown:F,handleTrackMouseDown:W,handleKeyDown:j,thumbPositionPercent:z}},ml={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%"}},pl={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}},ul={square:0,rounded:4,pill:24},yl=(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"}}))(),mf={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}},pf={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},uf=e=>typeof e=="string"&&(/^(#|rgb\(|rgba\(|hsl\(|hsla\(|var\()/.test(e)||["black","currentColor","inherit","transparent","white"].includes(e)),Qo=(e,o)=>uf(o)?{style:{[e]:o}}:{[e]:o},bl=h.memo(({min:e=0,max:o=100,step:t=1,currentValue:n,stepValues:a,shape:i="rounded",size:c="md",variant:s="default",orientation:d="horizontal",isDisabled:g=!1,showValue:f=!1,showTooltip:m=!1,backgroundColor:p="theme-primary",label:u,helperText:y,themeMode:x,shadow:k={},isDragging:C,isHovered:S,setIsHovered:v,trackRef:w,thumbRef:b,handleThumbMouseDown:T,handleTrackMouseDown:F,handleKeyDown:W,thumbPositionPercent:j,ariaLabel:$="Slider",views:z={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:E,onDrag:V,value:H,defaultValue:P,...M})=>{var D,K;const A=p,L="theme-disabled",_=yl[s].backgroundColor,N=g?L:A,B=d==="vertical",{trackCrossAxisSize:q,thumbSize:U}=mf[c]||{trackCrossAxisSize:ml[c].height,thumbSize:pl[c].width||16},O=r.jsxs(l.Vertical,{width:"100%",gap:8,...z.container,...M,children:[u&&r.jsxs(l.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[r.jsx(l.Text,{fontSize:14,fontWeight:500,...z.label,children:u}),f&&r.jsx(l.Text,{fontSize:14,color:"color-gray-500",...z.valueLabel,children:n})]}),r.jsxs(l.View,{ref:w,position:"relative",cursor:g?"not-allowed":"pointer",opacity:g?.6:1,onMouseDown:F,onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),...ml[c],borderRadius:ul[i],backgroundColor:_,...yl[s],...k,...z.track,children:[a&&a.length>0&&r.jsx(r.Fragment,{children:a.map(R=>{const Q=(R-e)/(o-e)*100;return r.jsx(l.View,{position:"absolute",top:"50%",left:`${Q}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",zIndex:1,...Qo("backgroundColor",N),...z.stepMarks},R)})}),r.jsx(l.View,{position:"absolute",top:0,left:0,height:"100%",width:`${j}%`,borderRadius:ul[i],transition:"width 0.1s ease-in-out",...Qo("backgroundColor",N),...z.progress,...z.filledTrack}),r.jsx(l.View,{ref:b,role:"slider",tabIndex:g?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":d,"aria-disabled":g,"aria-label":$,position:"absolute",top:"50%",left:`${j}%`,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",...Qo("borderColor",N),transform:S?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:T,onTouchStart:T,onKeyDown:W,...pl[c],...z.thumb,children:m&&(S||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,...z.tooltip,children:r.jsx(l.Text,{...(D=z.tooltip)==null?void 0:D.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),y&&r.jsx(It,{children:y})]}),X=r.jsxs(l.Center,{...pf[d],position:"relative",onMouseEnter:()=>!g&&v(!0),onMouseLeave:()=>!g&&v(!1),...M,...z==null?void 0:z.container,children:[u&&r.jsxs(l.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[r.jsx(l.Text,{fontSize:14,fontWeight:500,...z.label,children:u}),f&&r.jsx(l.Text,{fontSize:14,color:"color-gray-500",...z.valueLabel,children:n})]}),r.jsxs(l.View,{ref:w,position:"relative",borderRadius:q/2,backgroundColor:g?L:_,cursor:g?"not-allowed":"pointer",width:B?`${q}px`:"100%",height:B?"100%":`${q}px`,onMouseDown:F,onTouchStart:F,...z==null?void 0:z.track,children:[a&&a.length>0&&r.jsx(r.Fragment,{children:a.map(R=>{const Q=(R-e)/(o-e)*100;return r.jsx(l.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:N,zIndex:1,...B?{bottom:`${Q}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${Q}%`,top:"50%",transform:"translate(-50%, -50%)"},...z.stepMarks},R)})}),r.jsx(l.View,{position:"absolute",borderRadius:q/2,...B?{bottom:0,left:0,width:"100%",height:`${j}%`}:{top:0,left:0,height:"100%",width:`${j}%`},...Qo("backgroundColor",N),...z==null?void 0:z.filledTrack,...z==null?void 0:z.progress}),r.jsx(l.View,{ref:b,role:"slider",tabIndex:g?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":d,"aria-disabled":g,"aria-label":$,position:"absolute",width:`${U}px`,height:`${U}px`,borderRadius:"50%",borderWidth:2,borderStyle:"solid",borderColor:"color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:g?"not-allowed":"grab",transform:B?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:C?"none":"left 0.1s, bottom 0.1s",...Qo("backgroundColor",N),...B?{left:"50%",bottom:`${j}%`}:{top:"50%",left:`${j}%`},onMouseDown:T,onTouchStart:T,onKeyDown:W,...z==null?void 0:z.thumb,children:m&&(S||C)&&r.jsx(l.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...B?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...z==null?void 0:z.tooltip,children:r.jsx(l.Text,{...(K=z==null?void 0:z.tooltip)==null?void 0:K.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),y&&r.jsx(It,{marginTop:8,children:y})]});return B||m?X:O}),yf=e=>{const o=ue(e),t=fl({...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(bl,{...e,...t,...o})},xl=e=>{if(e==null)return"";if(typeof e=="string"||typeof e=="number"){const o=String(e);return o==="[object Object]"?"":o}return""},Dt=(e,o)=>{console.log(`[FormikOTPInput] ${e}`,o)},bf=e=>e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:Object.prototype.toString.call(e),xf=e=>{const o=ue(e),t=xl(o.value).slice(0,e.length||6);Dt("render",{name:e.name,type:e.type,formValue:bf(o.value),displayValue:t,length:e.length||6,hasFormikOnChange:!!o.onChange,hasFormikOnChangeText:!!o.onChangeText});const{isFocused:n,setIsFocused:a,isHovered:i,setIsHovered:c,inputRef:s,containerRef:d,mirrorSelectionStart:g,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:p,setInputRef:u,handleFocus:y,handleBlur:x,handleKeyDown:k,handlePaste:C}=Ra(e),S=h.useCallback(w=>{const b=xl(w).slice(0,e.length||6);Dt("setValue",{name:e.name,incomingValue:w,nextValue:b,hasFormikOnChange:!!o.onChange,hasFormikOnChangeText:!!o.onChangeText}),o.onChange&&o.onChange(b),o.onChangeText&&o.onChangeText(b),e.onComplete&&b.length===(e.length||6)&&e.onComplete(b),s.current&&(s.current.value=b)},[o,e,s]),v=h.useCallback(w=>{var F,W,j;const b=typeof w=="string"?w:((F=w==null?void 0:w.currentTarget)==null?void 0:F.value)??((W=w==null?void 0:w.target)==null?void 0:W.value)??((j=w==null?void 0:w.nativeEvent)==null?void 0:j.text)??"",T=String(b).slice(0,e.length||6);Dt("handleChange normalized",{name:e.name,raw:b,newValue:T}),S(T),s.current&&(s.current.value=T)},[e.length,S,s]);return r.jsx(el,{...e,...o,value:t,setValue:S,isFocused:n,setIsFocused:a,isHovered:i,setIsHovered:c,inputRef:s,containerRef:d,mirrorSelectionStart:g,mirrorSelectionEnd:f,setMirrorSelectionStart:m,setMirrorSelectionEnd:p,setInputRef:u,handleChange:v,handleFocus:y,handleBlur:x,handleKeyDown:k,handlePaste:C,stepValues:e.stepValues})},kf=e=>Array.isArray(e)?e:e==null?[]:[e],kl=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:n,transformResponse:a,onMultipleFileSelect:i,onFileSelect:c,multiple:s=!0,...d})=>{const{setFieldValue:g,setFieldTouched:f,values:m}=We.useFormikContext(),[p,u]=h.useState(!1),[y,x]=h.useState(0),k=h.useCallback(async v=>{if(!v||v.length===0)return;f(e,!0,!0),u(!0);const w=[];for(const b of v){x(0);try{const T=await o(b,W=>{x(W??0)}),F=a?a(T,b):T;w.push(F),t==null||t(b,F)}catch(T){n==null||n(b,T)}}if(w.length>0){const b=kf(We.getIn(m,e));g(e,[...b,...w],!0),x(100)}else x(0);u(!1)},[e,n,t,f,g,a,o,m]),C=h.useCallback(async v=>{i==null||i(v),await k(v)},[k,i]),S=h.useCallback(async v=>{c==null||c(v),await k([v])},[k,c]);return r.jsx(br,{...d,multiple:s,onMultipleFileSelect:s?C:void 0,onFileSelect:s?void 0:S,isLoading:p,progress:y})};kl.displayName="FormikUploader";const Cf=e=>{let o=ue(e);o.selected=o.value;const t=va(e);return r.jsx(Ta,{...t,...o})},Cl=e=>{const[o,t]=h.useState(!1),[n,a]=h.useState(e);return{isHovered:o,setIsHovered:t,isToggle:n,setIsToggled:a}},wf={square:0,rounded:8,pill:999},Sf=(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"}}),wl=h.memo(({children:e,shape:o="rounded",variant:t="ghost",isHovered:n,setIsHovered:a,isDisabled:i,isToggle:c,setIsToggled:s,onToggle:d,views:g,backgroundColor:f,color:m,themeMode:p,...u})=>{const{getColor:y,themeMode:x}=l.useTheme(),k=p??x,S=y(i?"theme-disabled":f??m??"theme-primary",{themeMode:k}),w=h.useMemo(()=>Sf(S),[S,k])[t],b=!!c,T=h.useCallback(()=>a(!0),[a]),F=h.useCallback(()=>{i||s(W=>{const j=!W;return d&&d(j),j})},[i,s,d]);return r.jsx(l.Center,{role:"Toggle",padding:o==="pill"?"8px 12px":"8px",width:"fit-content",cursor:i?"not-allowed":"pointer",borderRadius:wf[o],onClick:F,onMouseEnter:T,onMouseLeave:()=>a(!1),...w,...b&&{...t==="link"?{backgroundColor:"transparent"}:{backgroundColor:"color-blue-50",borderWidth:1,borderStyle:"solid",borderColor:"color-blue-200"},color:S},...u,...g==null?void 0:g.container,children:e})}),vf=({children:e,shape:o,variant:t,isDisabled:n,isToggled:a=!1,onToggle:i,...c})=>{const s=ue(c),{isHovered:d,setIsHovered:g,isToggle:f,setIsToggled:m}=Cl(s.value??a);h.useEffect(()=>{m(s.value??a)},[s.value,a]);const p=u=>{m(u),s.onChange(u),i==null||i(u)};return r.jsx(wl,{shape:o,variant:t,isDisabled:n,isHovered:d,setIsHovered:g,isToggle:f,setIsToggled:m,onToggle:p,...c,children:e})},Sl=()=>{const[e,o]=h.useState([]);return{activeToggles:e,setActiveToggles:o}},$t=({children:e,shape:o,variant:t,isDisabled:n,isToggled:a=!1,onToggle:i,...c})=>{const{isHovered:s,setIsHovered:d,isToggle:g,setIsToggled:f}=Cl(a);return h.useEffect(()=>{f(a)},[a]),r.jsx(wl,{shape:o,variant:t,isDisabled:n,isHovered:s,setIsHovered:d,isToggle:g,setIsToggled:f,onToggle:i,...c,children:e})},vl=({items:e,onToggleChange:o,activeToggles:t,setActiveToggles:n,shape:a="rounded",variant:i="ghost",views:c})=>{const s=h.useCallback((d,g)=>{n(f=>{let m;return g?m=f.includes(d)?f:[...f,d]:m=f.filter(p=>p!==d),o==null||o(m),m})},[o,n]);return r.jsx(l.Horizontal,{role:"ToggleGroup",display:"flex",gap:8,flexWrap:"wrap",...c==null?void 0:c.container,children:e.map(d=>r.jsx($t,{role:`toggle-${d.id}`,shape:a,variant:i,isToggled:t.includes(d.id)||d.isActive,onToggle:g=>s(d.id,g),isDisabled:d.isDisabled,views:c==null?void 0:c.toggle,children:d.value},d.id))})},Tf=({items:e,shape:o,variant:t,onToggleChange:n,...a})=>{const i=ue(a),{activeToggles:c,setActiveToggles:s}=Sl();h.useEffect(()=>{Array.isArray(i.value)&&s(i.value)},[i.value]);const d=g=>{s(g),i.onChange(g),n==null||n(g)};return r.jsx(vl,{items:e,shape:o,variant:t,activeToggles:c,setActiveToggles:s,onToggleChange:d,...a})},Tl=["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"],Il=e=>{const{value:o,defaultValue:t,onChange:n,isOpen:a,onOpen:i,onClose:c,closeOnSelect:s=!0}=e,[d,g]=h.useState(a??!1),[f,m]=h.useState(o??t),[p,u]=h.useState(""),y=h.useRef(null),x=h.useRef(null);h.useEffect(()=>{o!==void 0&&m(o)},[o]),h.useEffect(()=>{a!==void 0&&g(a)},[a]);const k=h.useMemo(()=>p?Tl.filter(b=>b.toLowerCase().includes(p.toLowerCase())).slice(0,100):Tl.slice(0,100),[p]);h.useEffect(()=>{const b=T=>{d&&y.current&&x.current&&!y.current.contains(T.target)&&!x.current.contains(T.target)&&C()};if(typeof(document==null?void 0:document.addEventListener)=="function")return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[d]);const C=h.useCallback(()=>{a===void 0&&g(!1),c&&c()},[c,a]),S=h.useCallback(()=>{const b=!d;a===void 0&&g(b),b?(i&&i(),u("")):c&&c()},[d,i,c,a]),v=h.useCallback(b=>{o===void 0&&m(b),n&&n(b),s&&C()},[n,s,C,o]),w=h.useCallback(b=>{u(b)},[]);return{isOpen:d,selectedIcon:f,searchQuery:p,filteredIcons:k,handleToggle:S,handleIconSelect:v,handleSearchChange:w,handleClose:C,triggerRef:y,dropdownRef:x}},To={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"}},If={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"}},Ff={default:{borderRadius:8},square:{borderRadius:0},rounded:{borderRadius:8},pill:{borderRadius:9999}},zf={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"}},Fl=({label:e,placeholder:o="Select an icon",helperText:t,views:n={},size:a="md",shape:i="default",variant:c="default",error:s=!1,isDisabled:d=!1,isReadOnly:g=!1,showSearch:f=!0,isOpen:m,selectedIcon:p,searchQuery:u,filteredIcons:y,handleToggle:x,handleIconSelect:k,handleSearchChange:C,triggerRef:S,dropdownRef:v,handleClose:w,onChange:b,value:T,defaultValue:F,onOpen:W,onClose:j,closeOnSelect:$,...z})=>{const{getColor:E}=l.useTheme(),V={...To.container,...n==null?void 0:n.container},H={...To.trigger,...If[a],...Ff[i],...zf[c],...s&&{borderColor:"color-red-500"},...d&&{opacity:.6,cursor:"not-allowed"},...!d&&!g&&{_hover:{borderColor:"color-gray-300"}},...n==null?void 0:n.trigger},P={...To.dropdown,...n==null?void 0:n.dropdown},M={...To.iconGrid,...n==null?void 0:n.iconGrid};return r.jsxs(l.View,{...V,...z,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:S,onClick:d||g?void 0:x,...H,children:[r.jsx(l.Horizontal,{alignItems:"center",gap:8,width:"100%",children:p?r.jsxs(l.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[r.jsx(hr,{name:p,widthHeight:16}),r.jsx(l.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p})]}):r.jsx(l.Text,{color:"color-gray-500",fontSize:"inherit",children:o})}),!g&&!d&&r.jsx(de,{widthHeight:16,color:"color-gray-500",orientation:m?"up":"down"})]}),m&&r.jsxs(l.View,{ref:v,...P,children:[f&&r.jsx(l.View,{...To.searchInput,...n==null?void 0:n.searchInput,children:r.jsx(Ie,{placeholder:"Search icons...",value:u,onChange:A=>C(A),size:"sm",autoFocus:!0})}),r.jsx(l.View,{...M,children:y.length>0?y.map(A=>r.jsx(l.View,{...To.iconItem,onClick:()=>k(A),title:A,_hover:{backgroundColor:"color-gray-50",transform:"scale(1.05)"},backgroundColor:p===A?"#EFF6FF":"transparent",borderWidth:p===A?"1px":"0px",borderStyle:"solid",borderColor:p===A?"#BFDBFE":"transparent",...n==null?void 0:n.iconItem,children:r.jsx(hr,{name:A,widthHeight:20})},A)):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:s?"color-red-500":"color-gray-600",marginTop:"4px",...n==null?void 0:n.helperText,children:t})]})},Mf=e=>{const o=ue(e),t={...e,value:o.value??e.value??e.defaultValue},n=Il(t),a=i=>{n.handleIconSelect(i),o.onChange(i)};return r.jsx(Fl,{...n,...t,handleIconSelect:a})},Qe={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"}},Wf={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"}},Hf={default:{borderRadius:8},square:{borderRadius:0},rounded:{borderRadius:8},pill:{borderRadius:9999}},jf={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"}},Pf={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},Af=[{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"]}],zl=e=>{const{value:o,defaultValue:t="",onChange:n,onEmojiSelect:a,isOpen:i,onOpen:c,onClose:s,closeOnSelect:d=!0,maxRecentEmojis:g=16,showRecentEmojis:f=!0,enabledCategories:m=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:p=[]}=e,[u,y]=h.useState(i??!1),[x,k]=h.useState(o??t),[C,S]=h.useState(""),[v,w]=h.useState("smileys"),[b,T]=h.useState([]),F=h.useRef(null),W=h.useRef(null),j=h.useMemo(()=>[...Af,...p],[p]),$=h.useMemo(()=>{let A=j;if(v!=="recent"?A=A.filter(L=>L.category===v):A=b,C){const L=C.toLowerCase();A=A.filter(_=>_.name.toLowerCase().includes(L)||_.keywords.some(N=>N.toLowerCase().includes(L)))}return A},[j,v,b,C]);h.useEffect(()=>{o!==void 0&&k(o)},[o]),h.useEffect(()=>{i!==void 0&&y(i)},[i]),h.useEffect(()=>{if(f&&typeof localStorage<"u"){const A=localStorage.getItem("emojiPicker-recentEmojis");if(A)try{T(JSON.parse(A))}catch{}}},[f]),h.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)!="function")return;const A=L=>{u&&F.current&&W.current&&!F.current.contains(L.target)&&!W.current.contains(L.target)&&M()};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[u]);const z=h.useCallback(A=>{f&&T(L=>{const _=L.filter(B=>B.emoji!==A.emoji),N=[A,..._].slice(0,g);return typeof localStorage<"u"&&localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(N)),N})},[f,g]),E=h.useCallback(()=>{const A=!u;y(A),A?(c==null||c(),S(""),f&&b.length>0?w("recent"):w("smileys")):s==null||s()},[u,c,s,f,b.length]),V=h.useCallback(A=>{k(A.emoji),z(A),n==null||n(A.emoji),a==null||a(A),d&&(y(!1),s==null||s())},[n,a,d,s,z]),H=h.useCallback(A=>{S(A),A&&v==="recent"&&w("smileys")},[v]),P=h.useCallback(A=>{w(A),S("")},[]),M=h.useCallback(()=>{y(!1),s==null||s()},[s]);return{isOpen:u,selectedEmoji:x,recentEmojis:b,searchQuery:C,activeCategory:v,filteredEmojis:$,handleToggle:E,handleEmojiSelect:V,handleSearchChange:H,handleCategoryChange:P,handleClose:M,triggerRef:F,dropdownRef:W}},Ml=({id:e,name:o,label:t,placeholder:n="Select an emoji",helperText:a,views:i={},size:c="md",shape:s="default",variant:d="default",error:g=!1,isDisabled:f=!1,isReadOnly:m=!1,showSearch:p=!0,showCategories:u=!0,showRecentEmojis:y=!0,enabledCategories:x=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:k,selectedEmoji:C,recentEmojis:S,searchQuery:v,activeCategory:w,filteredEmojis:b,handleToggle:T,handleEmojiSelect:F,handleSearchChange:W,handleCategoryChange:j,handleClose:$,triggerRef:z,dropdownRef:E,onChange:V,onOpen:H,onClose:P,onEmojiSelect:M,customEmojis:A,closeOnSelect:L,maxRecentEmojis:_,value:N,defaultValue:B,...q})=>{const{getColor:U}=l.useTheme(),O={...Qe.container,...i==null?void 0:i.container},X={...Qe.trigger,...Wf[c],...Hf[s],...jf[d],...g&&{borderColor:"color-red-500"},...f&&{opacity:.6,cursor:"not-allowed"},...!f&&!m&&{_hover:{borderColor:"color-gray-300"}},...i==null?void 0:i.trigger},D={...Qe.dropdown,...i==null?void 0:i.dropdown},K={...Qe.categoryTabs,...i==null?void 0:i.categoryTabs},R={...Qe.emojiGrid,...i==null?void 0:i.emojiGrid},Q=x.filter(J=>J==="recent"?y&&S.length>0:!0);return r.jsxs(l.View,{...O,...q,children:[t&&r.jsx(l.Text,{fontSize:c==="xs"?"12px":c==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...i==null?void 0:i.label,children:t}),r.jsxs(l.View,{ref:z,onClick:f||m?void 0:T,...X,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})}),!m&&!f&&r.jsx(de,{widthHeight:16,color:"color-gray-500",orientation:k?"up":"down"})]}),k&&r.jsxs(l.View,{ref:E,...D,children:[p&&r.jsx(l.View,{...Qe.searchInput,...i==null?void 0:i.searchInput,children:r.jsx(Ie,{placeholder:"Search emojis...",value:v,onChange:J=>W(J.target.value),size:"sm"})}),u&&r.jsx(l.View,{...K,children:Q.map(J=>r.jsx(l.View,{...Qe.categoryTab,...w===J&&{borderBottomColor:"theme-primary",color:"theme-primary",backgroundColor:"color-blue-50"},onClick:()=>j(J),title:J.charAt(0).toUpperCase()+J.slice(1),...i==null?void 0:i.categoryTab,children:Pf[J]},J))}),r.jsx(l.View,{...R,children:b.length>0?b.map((J,re)=>r.jsx(l.View,{...Qe.emoji,onClick:()=>F(J),title:J.name,_hover:{backgroundColor:"color-gray-50",transform:"scale(1.05)"},color:"color-gray-800",...i==null?void 0:i.emoji,children:J.emoji},`${J.emoji}-${re}`)):r.jsx(l.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(l.Text,{fontSize:"14px",children:v?"No emojis found":"No emojis in this category"})})})]}),a&&r.jsx(l.Text,{color:g?"color-red-500":"color-gray-600",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},Vf=e=>{const o=ue(e),t={...e,value:o.value??e.value??e.defaultValue},n=zl(t),a=i=>{var c;n.handleEmojiSelect(i),o.onChange(i.emoji),(c=e.onEmojiSelect)==null||c.call(e,i)};return r.jsx(Ml,{...n,...t,handleEmojiSelect:a})},Ef=({files:e,onRemove:o,maxHeight:t="120px",views:n={}})=>{if(e.length===0)return null;const a=h.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,c)=>{const s=i.url||"",d=i.type.startsWith("image/"),g=i.type.startsWith("video/"),f=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(ve,{children:[r.jsx(ve.Trigger,{children:r.jsxs(l.View,{position:"relative",children:[d&&s&&r.jsx(l.Image,{src:s,alt:i.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"8px"}),g&&s&&r.jsx(l.View,{as:"video",src:s,alt:i.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"8px"}),f&&r.jsx(l.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-100",borderRadius:"8px",children:r.jsx(yo,{widthHeight:24,color:"color-black"})}),!d&&!g&&!f&&r.jsx(l.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-100",borderRadius:"8px",children:r.jsx(ro,{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:m=>{m.stopPropagation(),o(c)},"aria-label":`Remove ${i.name}`,children:"×"})]})}),r.jsxs(ve.Content,{children:[d&&s&&r.jsx(l.Image,{src:s,alt:i.name,maxWidth:"300px"}),g&&s&&r.jsx(l.View,{as:"video",src:s,controls:!0,maxWidth:"300px"}),f&&s&&r.jsx(l.View,{as:"audio",src:s,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),")"]})]})]})},c)})})},Wl=e=>{const o=me("slider",e),t=fl(o);return r.jsx(bl,{...o,...t})},Df=({url:e,type:o,name:t,onOpen:n})=>{const a=o.toLowerCase(),i=a.startsWith("image"),c=a.startsWith("video"),s=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"}),c&&r.jsx(l.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:g=>g.stopPropagation()}),s&&r.jsx(l.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:g=>g.stopPropagation()}),!i&&!c&&!s&&r.jsx(ro,{widthHeight:24,color:"color-gray-600"})]})},Ze=po.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}))}})),$f=(e,o={},t={})=>{Ze.getState().show(e,o,t),Ze.getState().onShow(e,o)},Lt=e=>{Ze.getState().onHide(e),Ze.getState().hide(typeof e=="string"?e:void 0)},Lf={square:{borderRadius:0},rounded:{borderRadius:8}},Bf={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"}},_f={xs:12,sm:16,md:20,lg:24,xl:28},Bt={body:{fontSize:"16px",fontWeight:"400",color:"color-gray-700"}},Hl=h.memo(({children:e,blur:o,isOpen:t=!1,isClosePrevented:n=!1,onClose:a=()=>{},position:i="center",views:c,...s})=>{const d=h.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",...c==null?void 0:c.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,...Bf[i],...s,...c==null?void 0:c.view,children:e})})}),Of={boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"},Nf={elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},qf=h.memo(({children:e,shadow:o,isFullScreen:t=!1,shape:n="rounded",views:a,isOpen:i=!0,position:c,...s})=>{const d=typeof document!==void 0?Of:Nf,g=h.useCallback(f=>{f&&f.stopPropagation&&f.stopPropagation()},[]);return r.jsx(l.Vertical,{cursor:"default",backgroundColor:"color-white",width:t?"100%":600,height:t?"100%":"fit-content",onClick:g,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,...Lf[n],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...s,...a==null?void 0:a.container,children:e})}),Uf=h.memo(({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:n="right",views:a,onClose:i,...c})=>{const s=i||Lt,d=r.jsx(l.View,{onClick:s,children:r.jsx(Te,{widthHeight:_f[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}},...c,...a==null?void 0:a.header,children:[n==="left"&&d,e,n==="right"&&d]})}),Gf=h.memo(({children:e,views:o,...t})=>r.jsx(l.View,{paddingVertical:16,paddingHorizontal:24,fontSize:Bt.body.fontSize,fontWeight:Bt.body.fontWeight,color:Bt.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e})),Yf=h.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})),_t=({modals:e,onShow:o,onHide:t})=>{const n=Ze(a=>a.modals);return h.useEffect(()=>{o&&Ze.getState().setOnShow(o)},[o]),h.useEffect(()=>{t&&Ze.getState().setOnHide(t)},[t]),n.length===0?null:r.jsx(h.Fragment,{children:n.map((a,i)=>{const c=e[a.name];return c?r.jsx(Hl,{isOpen:a.props.isVisible,onClose:()=>Lt(a.name),blur:5,...a.overlayProps,style:{zIndex:1e3+i},children:r.jsx(c,{...a.props})},i):(console.error(`${a.name} modal doesn't exist`),null)})})},io=({children:e})=>r.jsx(r.Fragment,{children:e});io.Overlay=Hl,io.Container=qf,io.Header=Uf,io.Body=Gf,io.Footer=Yf,io.Layout=_t;const jl={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},Kf={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"}},Ot=({isOpen:e,onClose:o,isClosePrevented:t,blur:n,children:a,...i})=>{const c=()=>{t||o()};return h.useEffect(()=>{const s=d=>{d.key==="Escape"&&e&&!t&&o()};return e&&document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[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:c,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})},Nt=({placement:e="right",size:o="md",isOpen:t=!1,children:n,...a})=>{const i=f=>{f.stopPropagation()},s=e==="top"||e==="bottom"?{height:o==="full"?"100vh":jl[o]||o,maxHeight:"100vh"}:{width:o==="full"?"100vw":jl[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",g=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,...Kf[e],...s,onClick:i,transform:g,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})},Xf=({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]})},Jf=({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}),Re=po.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}))}})),Zf=(e,o={},t={})=>{const n=Re.getState();n.hide(e),n.show(e,o,t),n.onShow(e,o),queueMicrotask(()=>{Re.setState(a=>({drawers:a.drawers.map(i=>i.name===e?{...i,props:{...i.props,isOpen:!0}}:i)}))})},Pl=e=>{Re.getState().onHide(e),Re.getState().hide(typeof e=="string"?e:void 0)},Rf=({drawers:e,onShow:o,onHide:t})=>{const n=Re(a=>a.drawers);return h.useEffect(()=>{o&&Re.getState().setOnShow(o)},[o]),h.useEffect(()=>{t&&Re.getState().setOnHide(t)},[t]),n.length===0?null:r.jsx(h.Fragment,{children:n.map((a,i)=>{var u;const c=e[a.name];if(!c)return console.error(`${a.name} drawer doesn't exist`),null;const{placement:s,size:d,isClosePrevented:g,blur:f,containerProps:m,...p}=a.props||{};return r.jsx(Ot,{isOpen:a.props.isOpen,onClose:()=>Pl(a.name),isClosePrevented:g,blur:f,...a.overlayProps,style:{zIndex:1e3+i,...((u=a.overlayProps)==null?void 0:u.style)||{}},children:r.jsx(Nt,{placement:s,size:d,isOpen:a.props.isOpen,...m||{},children:r.jsx(h.Suspense,{fallback:null,children:r.jsx(c,{...p})})})},i)})})},co=({isOpen:e,onClose:o,placement:t="right",size:n="md",isClosePrevented:a,children:i,...c})=>r.jsx(Ot,{isOpen:e,onClose:o,isClosePrevented:a,...c,children:r.jsx(Nt,{placement:t,size:n,isOpen:e,children:i})});co.Overlay=Ot,co.Container=Nt,co.Header=Xf,co.Body=Jf,co.Footer=Qf,co.Layout=Rf;const Al=({behavior:e,keyboardVerticalOffset:o,dismissOnTap:t,enabled:n,children:a,...i})=>r.jsx(l.View,{flex:1,width:"100%",...i,children:a}),em=({header:e,footer:o,children:t,isLoading:n=!1,safe:a=!0,scrollable:i=!0,dismissKeyboardOnTap:c=!0,keyboardVerticalOffset:s=0,views:d={},backgroundColor:g="color-white",...f})=>{const m=a?l.SafeArea:l.View,p=l.isBrowser()?{}:{keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:!1,contentContainerStyle:{flexGrow:1}},u=n?r.jsx(l.Center,{flex:1,width:"100%",...d.content,children:r.jsx(Ke,{})}):i?r.jsx(l.Scroll,{flex:1,width:"100%",...p,...d.content,children:t}):r.jsx(l.View,{flex:1,width:"100%",...d.content,children:t});return r.jsxs(m,{flex:1,height:"100%",width:"100%",flexDirection:"column",backgroundColor:g,...f,...d.container,children:[e!=null&&r.jsx(l.View,{width:"100%",flexShrink:0,...d.header,children:e}),r.jsxs(Al,{flexDirection:"column",dismissOnTap:c,keyboardVerticalOffset:s,children:[u,o!=null&&r.jsx(l.View,{width:"100%",flexShrink:0,...d.footer,children:o})]})]})},Pr=po.create(e=>({started:!1,loaded:!1,setStarted:(o=!0)=>e({started:o}),setLoaded:(o=!0)=>e({loaded:o}),reset:()=>e({started:!1,loaded:!1})})),om=(e=!0)=>Pr.getState().setLoaded(e),rm=(e=!0)=>Pr.getState().setStarted(e),tm=({logo:e,logoSrc:o,loader:t,showLoader:n=!0,duration:a=600,isLoaded:i,onHidden:c,backgroundColor:s="color-white",children:d,...g})=>{const f=Pr(v=>v.loaded),m=i!==void 0?i:f,[p,u]=h.useState(!0),[y,x]=h.useState(!1);if(h.useEffect(()=>{if(!m||y)return;x(!0);const v=setTimeout(()=>{u(!1),c==null||c()},a);return()=>clearTimeout(v)},[m,y,a,c]),!p)return null;const k=l.isBrowser()?"fixed":"absolute",C=y?l.Animation.fadeOut({duration:`${a}ms`}):void 0,S=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:s,animate:C,...g,children:[r.jsxs(l.Vertical,{alignItems:"center",gap:24,children:[S,n&&(t??r.jsx(Ke,{}))]}),d]})},Le=po.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})})),nm=(e,o)=>Le.getState().push(e,o),am=()=>Le.getState().back(),qt=()=>{const e=Le(d=>d.stack),o=Le(d=>d.index),t=Le(d=>d.push),n=Le(d=>d.replace),a=Le(d=>d.back),i=Le(d=>d.go),c=Le(d=>d.reset),s=e[o]||{path:"/",params:{}};return{path:s.path,params:s.params,stack:e,index:o,canGoBack:o>0,push:t,replace:n,back:a,go:i,reset:c,navigate:t}},Vl=(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 c=t[i];if(c.startsWith(":"))a[c.slice(1)]=decodeURIComponent(n[i]);else if(c!==n[i])return null}return a},lm=e=>Array.isArray(e)?e:Object.entries(e).map(([o,t])=>({path:o,component:t})),im=({routes:e,notFound:o})=>{const{path:t,params:n}=qt();for(const a of lm(e)){const i=Vl(a.path,t);if(i){const c=a.component;return r.jsx(c,{...n,...i})}}return o?r.jsx(o,{}):null},cm=({routes:e,notFound:o,initialPath:t,syncBrowserHistory:n=!1})=>{const{path:a,push:i,back:c,reset:s}=qt(),d=h.useRef(!1);return l.useMount(()=>{t&&s(t)}),h.useEffect(()=>{if(!(!n||typeof window>"u")){if(d.current){d.current=!1;return}try{window.history.pushState({path:a},"",a)}catch{}}},[a,n]),h.useEffect(()=>{if(!n||typeof window>"u")return;const g=()=>{d.current=!0,c()||(d.current=!1)};return window.addEventListener("popstate",g),()=>window.removeEventListener("popstate",g)},[n,c,i]),r.jsx(im,{routes:e,notFound:o})},sm=(e=null,o=[])=>{const[t,n]=h.useState(e),[a,i]=h.useState(o),c=h.useRef({});return{activeItemId:t,setActiveItemId:n,expandedItemIds:a,toggleExpandedItem:g=>{i(f=>f.includes(g)?f.filter(p=>p!==g):[...f,g])},isItemExpanded:g=>a.includes(g),triggerRefs:c}},Ut={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"}}}},Gt={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"}},El={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},Io={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"}},Dl=h.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),dm=({children:e,value:o})=>r.jsx(Dl.Provider,{value:o,children:e}),Zo=()=>{const e=h.useContext(Dl);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},Yt=({children:e,views:o})=>{const{orientation:t}=Zo(),n=t==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(n,{width:"100%",...El[t],transition:"background-color 0.2s ease, border-color 0.2s ease",borderRadius:"8px",...o==null?void 0:o.container,children:e})},$l=h.createContext({itemValue:null,isDisabled:!1}),gm=()=>{const e=h.useContext($l);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},Kt=({item:e,value:o,isDisabled:t=!1,children:n,views:a})=>{var C;const{activeItemId:i,setActiveItemId:c,orientation:s,size:d,variant:g,onItemActivate:f}=Zo(),m=(e==null?void 0:e.id)||o,p=i===m,u=(e==null?void 0:e.items)&&e.items.length>0,y=(e==null?void 0:e.disabled)||t,x=()=>{y||m&&(c(m),f&&f(m))},k=s==="horizontal"?l.Horizontal:l.Vertical;return n?r.jsx($l.Provider,{value:{itemValue:m||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",...Ut[d],...Gt[g],...p?Io.active:{},_hover:y?{}:Io.hover,...a==null?void 0:a.item,children:n})}):u&&e?r.jsxs(k,{width:"100%",flexDirection:"column",position:"relative",...a==null?void 0:a.item,children:[r.jsxs(Ll,{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(Bl,{itemId:e.id,children:r.jsx(Yt,{children:(C=e.items)==null?void 0:C.map(S=>r.jsx(Kt,{item:S},S.id))})})]}):e?r.jsxs(l.View,{as:e.href?"a":"div",href:e.href,onClick:x,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",...Ut[d],...Gt[g],...p?Io.active:{},_hover:e.disabled?{}:Io.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},Ll=({children:e,itemId:o,disabled:t,views:n})=>{const{activeItemId:a,toggleExpandedItem:i,isItemExpanded:c,size:s,variant:d,triggerRefs:g}=Zo(),f=h.useRef(null),m=a===o,p=c(o);h.useEffect(()=>(f.current&&o&&(g.current[o]=f.current),()=>{o&&delete g.current[o]}),[o,g]);const u=y=>{y.preventDefault(),!t&&i(o)};return r.jsxs(l.View,{ref:f,onClick:u,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",...Ut[s],...Gt[d],...m?Io.active:{},_hover:t?{}:Io.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:p?"rotate(180deg)":"rotate(0deg)",...n==null?void 0:n.indicator,children:r.jsx(de,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},Bl=({children:e,itemId:o,views:t})=>{const{isItemExpanded:n,orientation:a,triggerRefs:i}=Zo(),c=h.useRef(null),[s,d]=h.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),g=n(o);if(h.useEffect(()=>{if(g&&c.current&&o&&i.current[o]&&a==="horizontal"){const m=c.current.getBoundingClientRect(),p=i.current[o].getBoundingClientRect(),u=Math.max(m.width||200,200),y=Math.max(m.height||150,150),x=window.innerWidth,k=window.innerHeight,C={top:p.top,right:x-p.right,bottom:k-p.bottom,left:p.left},S=a==="horizontal"?[{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:p.left,y:p.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:p.left,y:p.top-y-8},{placement:"right",space:C.right,fits:C.right>=u+8,x:p.right+8,y:p.top},{placement:"left",space:C.left,fits:C.left>=u+8,x:p.left-u-8,y:p.top}]:[{placement:"right",space:C.right,fits:C.right>=u+8,x:p.right+8,y:p.top},{placement:"left",space:C.left,fits:C.left>=u+8,x:p.left-u-8,y:p.top},{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:p.left,y:p.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:p.left,y:p.top-y-8}],v=S.find(F=>F.fits);if(v){d({x:v.x,y:v.y,placement:v.placement});return}const w=S.reduce((F,W)=>W.space>F.space?W:F);let b=w.x,T=w.y;b+u>x&&(b=x-u-8),b<8&&(b=8),T+y>k&&(T=k-y-8),T<8&&(T=8),d({x:b,y:T,placement:w.placement})}},[g,a,o,i]),!g)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 f={position:"fixed",left:s.x,top:s.y,zIndex:1e3};return r.jsx(l.View,{ref:c,role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:f,...t==null?void 0:t.container,children:e})},hm=({href:e,children:o,views:t,underline:n,isExternal:a,iconSize:i,...c})=>{const{itemValue:s,isDisabled:d}=gm(),{activeItemId:g,setActiveItemId:f,onItemActivate:m}=Zo(),p=g===s,u=y=>{if(d){y.preventDefault();return}s&&(f(s),m&&m(s)),c.onClick&&c.onClick(y)};return r.jsx(l.View,{as:"a",href:d?void 0:e,onClick:u,cursor:d?"not-allowed":"pointer",opacity:d?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":p?"page":void 0,"aria-disabled":d,"data-active":p?"":void 0,"data-disabled":d?"":void 0,...p?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...c,children:o})},fm=({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%",...El[o],...t==null?void 0:t.container,children:r.jsx(Yt,{views:t,children:e.map(i=>r.jsx(Kt,{item:i,views:t},i.id))})})},so=e=>{const o=me("navigation",e),{items:t,children:n,orientation:a="vertical",size:i="md",variant:c="default",defaultActiveItemId:s=null,defaultExpandedItemIds:d=[],onItemActivate:g,views:f,...m}=o,{activeItemId:p,setActiveItemId:u,expandedItemIds:y,toggleExpandedItem:x,isItemExpanded:k,triggerRefs:C}=sm(s,d);return r.jsx(dm,{value:{activeItemId:p,setActiveItemId:u,expandedItemIds:y,toggleExpandedItem:x,isItemExpanded:k,orientation:a,size:i,variant:c,onItemActivate:g,triggerRefs:C},children:t?r.jsx(fm,{items:t,orientation:a,size:i,variant:c,views:f,...m}):n})};so.List=Yt,so.Item=Kt,so.Trigger=Ll,so.Content=Bl,so.Link=hm;const _l={},Ol=h.createContext({views:_l,onRowClick:()=>{}}),mm=({children:e,views:o=_l,onRowClick:t})=>r.jsx(Ol.Provider,{value:{views:o,onRowClick:t},children:e}),eo=()=>h.useContext(Ol),ye={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"}}}};({...ye.th},{...ye.td}),{...ye.tr},{...ye.td},{...ye.th},{...ye.table},{...ye.th},{...ye.td},{...ye.tr},{...ye.tfoot},{...ye.caption};const pm=({children:e})=>r.jsx(l.View,{width:"100%",style:{overflowX:"auto"},children:e}),Nl=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"table",...ye.table,...o==null?void 0:o.table,...e,style:{borderCollapse:"collapse",...e.style||{}}})},ql=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"thead",textAlign:"left",...ye.thead,...o==null?void 0:o.thead,...e})},Ul=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"th",whiteSpace:"nowrap",...ye.th,...o==null?void 0:o.th,...e})},Ar=e=>{const{views:o,onRowClick:t}=eo();return r.jsx(l.Element,{as:"tr",...ye.tr,...o==null?void 0:o.tr,onClick:t,...e})},Xt=({isFirstColumn:e,...o})=>{const{views:t}=eo();return r.jsx(l.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e?"500":"400",...ye.td,...t==null?void 0:t.td,...o})},Gl=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"tbody",...ye.tbody,...o==null?void 0:o.tbody,...e})},Yl=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"tfoot",...ye.tfoot,...o==null?void 0:o.tfoot,...e})},Kl=e=>{const{views:o}=eo();return r.jsx(l.Element,{as:"caption",...ye.caption,...o==null?void 0:o.caption,...e})},um=({data:e,columns:o,footer:t,caption:n,themeMode:a})=>{const i=Math.max(o.length*140,320);return r.jsx(pm,{children:r.jsxs(Nl,{role:"Table",minWidth:i,children:[n&&r.jsx(Kl,{children:n}),r.jsx(ql,{children:r.jsx(Ar,{children:o.map(c=>r.jsx(Ul,{children:c.title},c.field))})}),r.jsx(Gl,{children:e.map((c,s)=>r.jsx(Ar,{children:o.map((d,g)=>r.jsx(Xt,{isFirstColumn:g===0,children:c[d.field]},d.field))},s))}),t&&r.jsx(Yl,{children:r.jsx(Ar,{children:t.map((c,s)=>r.jsx(Xt,{...c.props,children:c.value},s))})})]})})},ze=({children:e,views:o,onClick:t})=>{const n=me("table",{views:o,onClick:t});return r.jsx(mm,{views:n.views,onRowClick:n.onClick,children:e})};ze.Head=ql,ze.HeadCell=Ul,ze.Body=Gl,ze.Row=Ar,ze.Cell=Xt,ze.Footer=Yl,ze.Caption=Kl,ze.Container=Nl,ze.Template=um;const ym=(e,o,t)=>{const n=g=>g.value!==void 0?g.value:g.title,a=()=>{if(!(!e||e.length===0)){if(o!==void 0){const g=e.find(f=>n(f)===o);if(g)return g}return e[0]}},[i,c]=h.useState(a()),s=t!==void 0?e.find(g=>n(g)===t):i,d=g=>{t===void 0&&c(g)};return h.useEffect(()=>{if(t!==void 0)return;const g=a(),f=i&&e.some(m=>n(m)===n(i));g&&(!f||o!==void 0&&i&&n(i)!==o)?c(g):!g&&i&&c(void 0)},[e,o]),{activeTab:s,setActiveTab:d}},bm=(e,o,t)=>{const[n,a]=h.useState(e||null);return{activeValue:o!==void 0?o:n,setActiveValue:s=>{o===void 0&&a(s),t&&t(s)}}},xm=h.memo(({tab:e,isActive:o,onClick:t,iconPosition:n="left",tabStyles:a,textStyles:i})=>{const c=()=>{switch(n){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},s=()=>["top","bottom"].includes(n)?"4px":"8px",d=e.icon&&h.isValidElement(e.icon)?h.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:c(),gap:s(),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})]})]})}),Jt=(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}}},km=({tabs:e=[],activeTab:o,handleTabClick:t,views:n={},renderTab:a,renderContent:i,variant:c="underline",iconPosition:s="left"})=>{const{themeMode:d}=l.useTheme(),g=Jt(c,d);return o?r.jsxs(l.Vertical,{width:"100%",height:"100%",...n.container,children:[r.jsx(l.Horizontal,{alignItems:"center",...g.header,...n.headerTabs,children:e.map(f=>{const m=(f.value!==void 0?f.value:f.title)===(o.value!==void 0?o.value:o.title),p=()=>t(f);return a?a(f,m,p):r.jsx(xm,{tab:f,isActive:m,onClick:p,iconPosition:s,tabStyles:{...g.tab,...n.tab,...m?g.activeTab:{},...m?n.activeTab:{}},textStyles:{...g.text,...n.title,...m?g.activeText:{},...m?n.activeText:{}}},f.title)})}),r.jsx(l.View,{height:"100%",...g.content,...n.content,children:i?i(o):o.content})]}):null},Xl=h.createContext(null),Qt=()=>{const e=h.useContext(Xl);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},Cm=h.memo(({children:e,views:o})=>{var s;const{themeMode:t}=l.useTheme(),{variant:n="underline"}=Qt(),a=Jt(n,t),i=uo("tabs"),c=Ee({container:(s=i.views)==null?void 0:s.headerTabs},o);return r.jsx(l.Horizontal,{alignItems:"center",...a.header,...c==null?void 0:c.container,children:e})}),wm=h.memo(({value:e,children:o,disabled:t=!1,views:n})=>{var u,y;const{themeMode:a}=l.useTheme(),{activeValue:i,setActiveValue:c,variant:s="underline"}=Qt(),d=i===e,g=Jt(s,a),f=uo("tabs"),m=Ee({trigger:(u=f.views)==null?void 0:u.tab,activeState:(y=f.views)==null?void 0:y.activeTab},n),p=h.useCallback(()=>{t||c(e)},[t,e,c]);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",...g.tab,...d?g.activeTab:{},_hover:t?{}:s==="underline"?{color:"theme-primary"}:{opacity:.9},onClick:p,...m==null?void 0:m.trigger,...d?m==null?void 0:m.activeState:{},children:r.jsx(l.View,{...g.text,...d?g.activeText:{},children:o})})}),Sm=h.memo(({value:e,children:o,views:t})=>{const{activeValue:n}=Qt();return n!==e?null:r.jsx(l.View,{width:"100%",padding:"24px",...t==null?void 0:t.content,children:o})}),vm=e=>{const o=me("tabs",e),{tabs:t,views:n,defaultValue:a,onTabChange:i,renderTab:c,renderContent:s,variant:d="underline",iconPosition:g="left",value:f,onValueChange:m,children:p}=o,u=bm(a,f,m),y=ym(t||[],a,f);if(p)return r.jsx(Xl.Provider,{value:{...u,variant:d},children:p});if(t){const x=k=>{const C=S=>S.value!==void 0?S.value:S.title;(!y.activeTab||C(y.activeTab)!==C(k))&&(y.setActiveTab(k),i&&i(k))};return r.jsx(km,{tabs:t,views:n,activeTab:y.activeTab,handleTabClick:x,renderTab:c,renderContent:s,variant:d,iconPosition:g})}return null},Fo=h.memo(vm);Fo.List=Cm,Fo.Trigger=wm,Fo.Content=Sm;const Tm=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:n=[],alternateAnimation:a=!1,alternateDuration:i=3e3,highlightText:c,highlightTypewriter:s=!1,highlightSlide:d=!1,highlightSlideDuration:g=500,highlightSlideStagger:f=50,highlightSlideSequential:m=!0}=e,[p,u]=h.useState(o),[y,x]=h.useState(c);return h.useEffect(()=>{if(!a||n.length===0||!t||typeof o!="string"||typeof c!="string")return u(o),x(c),()=>{};const k=o,C=c;let S=0;const v=b=>{const T=n[b],F=C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),W=new RegExp(F,"gi"),j=k.replace(W,T);u(j),x(T)};v(S);const w=setInterval(()=>{S=(S+1)%n.length,v(S)},i);return()=>clearInterval(w)},[a,n,i,c,o,t]),{finalDisplayedText:p,activeHighlightTarget:y,highlightTypewriter:s,highlightSlide:d,highlightSlideDuration:g,highlightSlideStagger:f,highlightSlideSequential:m}},Im={xs:24,sm:32,md:48,lg:96,xl:110},Fm={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}}}},zm={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:()=>({})},Mm=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:n,showCursor:a=!0,cursorColor:i="currentColor",textStyle:c,textComponent:s,as:d,...g})=>{const f=s||l.Text,m=Array.isArray(e)?e:[e],[p,u]=h.useState(m.map(()=>"")),[y,x]=h.useState(!1),[k,C]=h.useState(0),[S,v]=h.useState(0);h.useEffect(()=>{u(m.map(()=>"")),x(!1),C(0),v(0)},[e]),h.useEffect(()=>{if(y){n&&n();return}const b=m[k];if(S>=b.length){if(k>=m.length-1){x(!0);return}const F=setTimeout(()=>{C(W=>W+1),v(0)},t);return()=>clearTimeout(F)}const T=setTimeout(()=>{u(F=>{const W=[...F];return W[k]=b.substring(0,S+1),W}),v(F=>F+1)},o);return()=>clearTimeout(T)},[m,k,S,y,n,t,o]);const w=b=>{if(!b||typeof b!="string")return b;const T=b.split("|");return T.length===1?b:T.map((F,W)=>r.jsxs(h.Fragment,{children:[F,W<T.length-1&&r.jsx("br",{})]},W))};return r.jsx(r.Fragment,{children:p.map((b,T)=>r.jsxs(h.Fragment,{children:[w(b),a&&T===k&&!y&&r.jsx(f,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:i,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...c})]},T))})},Wm=({text:e,duration:o=500,direction:t="up",stagger:n=50,sequential:a=!1,textStyle:i,as:c,wordProps:s,textComponent:d,...g})=>{const[f,m]=h.useState(e),[p,u]=h.useState("entering"),[y,x]=h.useState(0),k=d||l.Text,C=h.useRef(null),S=h.useRef(null);h.useEffect(()=>{e===f&&p==="visible"||e!==f&&(p==="entering"||p==="visible"?(C.current=e,u("exiting")):p==="exiting"&&(C.current=e))},[e,f,p]);const{lines:v,totalWordCount:w}=h.useMemo(()=>{const M=f.split("|").map(L=>L.trim().split(/\s+/).filter(_=>_.length>0)),A=M.reduce((L,_)=>L+_.length,0);return{lines:M,totalWordCount:A}},[f]),b=h.useMemo(()=>a?w*(o+n):(w-1)*n+o,[w,o,n,a]),T=h.useMemo(()=>a?w*(o+n):(w-1)*n+o,[w,o,n,a]);h.useEffect(()=>(S.current&&clearTimeout(S.current),p==="entering"?S.current=setTimeout(()=>{u("visible")},b+50):p==="exiting"&&(S.current=setTimeout(()=>{C.current!==null&&(m(C.current),C.current=null),x(P=>P+1),u("entering")},T+50)),()=>{S.current&&clearTimeout(S.current)}),[p,b,T]);const{style:F,...W}=s||{},j=t==="up",$=P=>a?P*(o+n):P*n,z=h.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",...i}),[i]),E=h.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),V=h.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let H=0;return r.jsx(l.Element,{as:"span",style:z,...g,children:r.jsx("span",{style:E,children:v.map((P,M)=>r.jsx("span",{style:V,children:P.map((A,L)=>{const _=H++,N=$(_),B=L===P.length-1;let q;const U=`${o}ms`,O=`${N}ms`;p==="entering"?q=j?l.Animation.slideInUp({duration:U,delay:O,timingFunction:"ease-out",fillMode:"both"}):l.Animation.slideInDown({duration:U,delay:O,timingFunction:"ease-out",fillMode:"both"}):p==="exiting"&&(q=j?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:U,delay:O,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:U,delay:O,timingFunction:"ease-in",fillMode:"both"});const X={...F,display:"inline-block",marginRight:B?0:"0.25em",transform:p==="visible"?"translateY(0)":void 0,opacity:p==="visible"?1:void 0};return r.jsx(k,{as:"span",animate:q,...W,...X,children:A},`${y}-${M}-${L}`)})},`line-${M}`))})})};function Jl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Zt=e=>{if(!e||typeof e!="string")return e;const o=e.split("|");return o.length===1?e:o.map((t,n)=>r.jsxs(h.Fragment,{children:[t,n<o.length-1&&r.jsx("br",{})]},n))},Hm=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:n="theme-primary",highlightSecondaryColor:a,size:i="lg",views:c,highlightAnimate:s,animate:d,animationLoop:g=1,highlightAnimationLoop:f=1,highlightTypewriter:m=!1,highlightTypewriterDuration:p=3e3,highlightSlide:u=!1,highlightSlideDuration:y=500,highlightSlideStagger:x=50,highlightSlideSequential:k=!0,themeMode:C,responsive:S,alternateHighlightText:v,alternateAnimation:w,alternateDuration:b,_isInView:T,...F})=>{const{ref:W,inView:j}=l.useInView(),{finalDisplayedText:$,activeHighlightTarget:z,highlightTypewriter:E,highlightSlide:V,highlightSlideDuration:H,highlightSlideStagger:P,highlightSlideSequential:M}=Tm({children:e,highlightText:o,_isInView:j,highlightTypewriter:m,highlightSlide:u,highlightSlideDuration:y,highlightSlideStagger:x,highlightSlideSequential:k,alternateHighlightText:v,alternateAnimation:w,alternateDuration:b,...F}),A=Im[i],L={fontFamily:"Mulish, Inter, Geist, system-ui, sans-serif",fontWeight:i==="xl"?700:600,letterSpacing:i==="xl"?"-1.5px":"-0.01em"},_=zm[t](n,a),N=(D,K)=>D&&(Array.isArray(D)?D.map(R=>({...R,iterationCount:K.toString()})):{...D,iterationCount:K.toString()}),B=N(d,g),q=N(s,f),U=typeof $=="string"?$:typeof e=="string"?e:"",O={ref:W,animate:j?B:void 0,as:"h1",fontSize:A,...S?Fm[i]:{},...L},X=D=>!j&&(E||V)?r.jsx("span",{style:{opacity:0},children:D}):E?r.jsx(Mm,{text:D,typingSpeed:Math.max(30,p/(D.length*10)),cursorColor:"currentColor",..._}):V?r.jsx(Wm,{text:D,duration:H,stagger:P,sequential:M,direction:"up",wordProps:_}):Zt(D);if(typeof U=="string"&&z){const D=Array.isArray(z)?new RegExp(`(${z.map(J=>Jl(String(J))).join("|")})`,"gi"):new RegExp(`(${Jl(String(z))})`,"gi"),K=[];let R=0,Q;for(;Q=D.exec(U);)Q.index>R&&K.push(U.substring(R,Q.index)),K.push({highlight:!0,text:Q[0]}),R=Q.index+Q[0].length;return R<U.length&&K.push(U.substring(R)),r.jsx(l.Element,{...O,...c==null?void 0:c.container,...F,children:K.map((J,re)=>typeof J=="string"?r.jsx(l.Text,{as:"span",display:"inline",...c==null?void 0:c.text,children:Zt(J)},`text-${re}`):r.jsx(l.Text,{as:"span",display:"inline",animate:j?q:void 0,...V?{}:_,...c==null?void 0:c.highlight,children:X(J.text)},`highlight-${re}`))})}return t&&!z?r.jsx(l.Element,{...O,...F,...c==null?void 0:c.container,children:r.jsx(l.Text,{as:"span",display:"inline",animate:j?q:void 0,...V?{}:_,...c==null?void 0:c.highlight,children:X(U)})}):r.jsx(l.Text,{...O,...F,...c==null?void 0:c.container,...c==null?void 0:c.text,children:Zt(U)})},Ql=e=>r.jsx(Hm,{...e}),Zl=({items:e,shape:o,variant:t,onToggleChange:n})=>{const{activeToggles:a,setActiveToggles:i}=Sl();return r.jsx(vl,{items:e,shape:o,variant:t,activeToggles:a,setActiveToggles:i,onToggleChange:n})},jm=({items:e,onChange:o})=>{const[t,n]=h.useState(e),[a,i]=h.useState(null),[c,s]=h.useState(null),d=h.useRef({x:0,y:0}),g=h.useRef([]),f=h.useCallback((u,y)=>{u.preventDefault(),document.body.style.cursor="grabbing";const x="touches"in u?u.touches[0].clientX:u.clientX,k="touches"in u?u.touches[0].clientY:u.clientY;d.current={x,y:k},s(y),i(t[y])},[t]),m=h.useCallback(u=>{if(c===null)return;const y="touches"in u?u.touches[0].clientX:u.clientX,x="touches"in u?u.touches[0].clientY:u.clientY,k=g.current[c];if(!k)return;const C=y-d.current.x,S=x-d.current.y;k.style.transform=`translate(${C}px, ${S}px)`,k.style.zIndex="1000";const v=g.current.findIndex((w,b)=>{if(!w||b===c)return!1;const T=w.getBoundingClientRect();return x>=T.top&&x<=T.bottom});if(v!==-1&&v!==c){const w=[...t],[b]=w.splice(c,1);w.splice(v,0,b),n(w),s(v),o==null||o(w),d.current={x:y,y:x}}},[c,t,o]),p=h.useCallback(()=>{document.body.style.cursor="",g.current.forEach(u=>{u&&(u.style.transform="",u.style.zIndex="")}),s(null),i(null)},[c]);return h.useEffect(()=>{if(typeof(window==null?void 0:window.addEventListener)=="function")return c!==null&&(window.addEventListener("mousemove",m),window.addEventListener("touchmove",m),window.addEventListener("mouseup",p),window.addEventListener("touchend",p)),()=>{window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",p),window.removeEventListener("touchend",p)}},[c,m,p]),{items:t,draggedItem:a,draggedIndex:c,itemRefs:g,handleDragStart:f}},Pm=({items:e,renderItem:o,containerProps:t,itemProps:n,draggedIndex:a,itemRefs:i,handleDragStart:c,views:s,themeMode:d})=>r.jsx(l.View,{overflow:"hidden",position:"relative",...t,...s==null?void 0:s.container,children:e.map((g,f)=>r.jsx(l.View,{ref:m=>{i.current[f]=m},onMouseDown:m=>c(m,f),onTouchStart:m=>c(m,f),position:"relative",cursor:"grab",transition:"transform 0.2s",...n,...s==null?void 0:s.item,children:o?o(g,f):g},f))}),Rl=e=>{const{items:o,draggedIndex:t,itemRefs:n,handleDragStart:a}=jm(e);return r.jsx(Pm,{...e,items:o,draggedIndex:t,itemRefs:n,handleDragStart:a})},Am=Rl,Vm=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:n,multiple:a,disabled:i,previewUrl:c})=>{const[s,d]=h.useState(!1),[g,f]=h.useState(null),m=h.useRef(null),p=c!==void 0?c:g;h.useEffect(()=>()=>{g&&URL.revokeObjectURL(g)},[g]);const u=h.useCallback(w=>{w.preventDefault(),w.stopPropagation(),!i&&d(!0)},[i]),y=h.useCallback(w=>{w.preventDefault(),w.stopPropagation(),!i&&d(!1)},[i]),x=h.useCallback(w=>{w.preventDefault(),w.stopPropagation(),!i&&d(!0)},[i]),k=h.useCallback(w=>{if(!w||w.length===0)return;const b=Array.from(w);if(!a&&b.length>0){const T=b[0];if(T.type.startsWith("image/")){const F=URL.createObjectURL(T);f(W=>(W&&URL.revokeObjectURL(W),F))}else f(null)}a?o&&o(b):b.length>0&&e&&e(b[0])},[a,o,e]),C=h.useCallback(w=>{w.preventDefault(),w.stopPropagation(),d(!1),!i&&w.dataTransfer.files&&w.dataTransfer.files.length>0&&(k(w.dataTransfer.files),w.dataTransfer.clearData())},[i,k]),S=h.useCallback(()=>{var w;i||(w=m.current)==null||w.click()},[i]),v=h.useCallback(w=>{k(w.target.files),w.target.value&&(w.target.value="")},[k]);return{isDragActive:s,handleDragEnter:u,handleDragLeave:y,handleDragOver:x,handleDrop:C,handleClick:S,handleFileChange:v,inputRef:m,preview:p}},Em={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)"}},ei=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:a="120px",showPreviews:i=!1,views:c={}})=>{if(e.length===0)return null;const s=h.useCallback(g=>g<1024?`${g} B`:g<1024*1024?`${(g/1024).toFixed(1)} KB`:`${(g/(1024*1024)).toFixed(1)} MB`,[]),d=h.useCallback(g=>g.type.startsWith("image/")?{backgroundColor:"#DBEAFE",color:"#2563EB"}:g.type.startsWith("video/")?{backgroundColor:"#EDE9FE",color:"#7C3AED"}:g.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",...c==null?void 0:c.container,children:e.map((g,f)=>{const m=typeof URL<"u"&&typeof URL.createObjectURL=="function"&&typeof Blob<"u"&&g instanceof Blob,p=(g==null?void 0:g.path)||(g==null?void 0:g.url)||(i&&m?URL.createObjectURL(g):""),u=g.type.startsWith("image/"),y=g.type.startsWith("video/"),x=g.type.startsWith("audio/"),k=d(g);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,...c==null?void 0:c.item,children:i&&r.jsxs(ve,{children:[r.jsxs(ve.Trigger,{children:[u&&r.jsx(l.Image,{src:p,alt:g.name,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),y&&r.jsx(l.View,{as:"video",src:p,alt:g.name,controls:!1,muted:!0,width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}),x&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(yo,{widthHeight:24,color:"color-black"})}),!u&&!y&&!x&&r.jsx(l.Center,{width:"60px",height:"60px",borderRadius:"8px",backgroundColor:"color-gray-100",children:r.jsx(ro,{widthHeight:24,color:"color-black"})}),t&&r.jsx(l.Button,{...Em,onClick:C=>{C.stopPropagation(),t(f)},"aria-label":`Remove ${g.name}`,children:"×"})]}),r.jsxs(ve.Content,{children:[u&&r.jsx(l.Image,{src:p,alt:g.name,maxWidth:"100%"}),y&&r.jsx(l.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),x&&r.jsx(l.View,{as:"audio",src:p,controls:!0,width:"100%"}),r.jsxs(l.Text,{marginTop:"4px",maxLines:1,width:"100%",...c==null?void 0:c.name,children:[g.name," (",s(g.size),")"]})]})]})},f):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,...c==null?void 0:c.item,children:[r.jsx(l.Center,{width:"22px",height:"22px",minWidth:"22px",borderRadius:"9999px",backgroundColor:k.backgroundColor,color:k.color,children:x?r.jsx(yo,{widthHeight:12,color:"currentColor"}):r.jsx(ro,{widthHeight:12,color:"currentColor"})}),r.jsxs(l.Text,{fontSize:"12px",lineHeight:"16px",color:"color-gray-600",maxLines:1,maxWidth:"220px",...c==null?void 0:c.name,children:[g.name," · ",s(g.size)]}),t&&r.jsx(l.View,{as:"button",type:"button",onClick:()=>t(f),"aria-label":`Remove ${g.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:"×"})]},f)})})},Dm=({children:e,text:o="Drop files here or click to upload",textProps:t,containerProps:n,disabled:a,accept:i,multiple:c,isDragActive:s,handleDragEnter:d,handleDragLeave:g,handleDragOver:f,handleDrop:m,handleClick:p,handleFileChange:u,inputRef:y,preview:x,imageProps:k,selectedFiles:C,onRemove:S})=>r.jsxs(l.Center,{width:"100%",minHeight:"200px",height:C&&C.length>0?"auto":"200px",borderWidth:2,borderStyle:"dashed",borderColor:s?"theme-primary":"color-gray-300",borderRadius:12,backgroundColor:s?"#EFF6FF":"color-gray-50",flexDirection:"column",cursor:a?"not-allowed":"pointer",opacity:a?.6:1,onClick:p,onDragEnter:d,onDragLeave:g,onDragOver:f,onDrop:m,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:u,accept:i,multiple:c,style:{display:"none"},disabled:a}),x&&!c?r.jsxs(l.View,{width:"100%",height:"200px",position:"relative",children:[r.jsx(l.Image,{src:x,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(ht,{widthHeight:40,color:s?"theme-primary":"color-gray-500"}),r.jsx(l.Text,{marginTop:16,color:s?"theme-primary":"color-gray-600",fontWeight:500,textAlign:"center",...t,children:o})]}),c&&C&&C.length>0&&r.jsx(l.View,{marginTop:16,width:"100%",children:r.jsx(ei,{files:C,onRemove:S||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),$m=e=>{const o=Vm(e);return r.jsx(Dm,{...e,...o})},Lm=(e=!1)=>{const[o,t]=h.useState(e),[n,a]=h.useState(null);return h.useEffect(()=>{const i=d=>{!d.composedPath().some(m=>(m==null?void 0:m.id)==="dropdown-menu"||(m==null?void 0:m.id)==="dropdown-trigger")&&o&&(t(!1),a(null))},c=()=>{o&&(t(!1),a(null))},s=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",c),document.addEventListener("keydown",s),()=>{document.removeEventListener("mousedown",i),window.removeEventListener("resize",c),document.removeEventListener("keydown",s)}},[o]),{isOpen:o,setIsOpen:t,activeSubmenuId:n,setActiveSubmenuId:a}},Bm={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},_m={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"}},Om={hover:{backgroundColor:"color-gray-100"}},oi=h.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),Nm=({children:e,value:o})=>r.jsx(oi.Provider,{value:o,children:e}),Rt=()=>{const e=h.useContext(oi);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},ri=({children:e,views:o,...t})=>{const{isOpen:n,setIsOpen:a,triggerRef:i}=Rt(),c=s=>{s.stopPropagation(),a(!n)};return r.jsx(l.View,{ref:i,id:"dropdown-trigger",onClick:c,cursor:"pointer",position:"relative",display:"inline-block",...o==null?void 0:o.container,...t,children:e})},en=({items:e,side:o="bottom",align:t="start",views:n,...a})=>{const{isOpen:i,variant:c,triggerRef:s}=Rt(),d=h.useRef(null),{ref:g,relation:f}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[m,p]=h.useState({x:0,y:0,placement:o});if(h.useEffect(()=>{s.current&&g&&(g.current=s.current)},[s,g,i]),h.useEffect(()=>{if(i&&d.current&&s.current){const x=s.current.getBoundingClientRect();let k=o;f&&(o==="bottom"&&f.space.vertical==="top"?k="top":o==="top"&&f.space.vertical==="bottom"?k="bottom":o==="right"&&f.space.horizontal==="left"?k="left":o==="left"&&f.space.horizontal==="right"&&(k="right"));let C=0,S=0;switch(k){case"bottom":C=t==="start"?x.left:t==="end"?x.right-180:x.left+x.width/2-90,S=x.bottom+8;break;case"top":C=t==="start"?x.left:t==="end"?x.right-180:x.left+x.width/2-90,S=x.top-8;break;case"right":C=x.right+8,S=t==="start"?x.top:t==="end"?x.bottom-100:x.top+x.height/2-50;break;case"left":C=x.left-8,S=t==="start"?x.top:t==="end"?x.bottom-100:x.top+x.height/2-50;break}p({x:C,y:S,placement:k})}},[i,o,t,s,f]),!i)return null;const y=(()=>{const x={position:"fixed",left:m.x,top:m.y,zIndex:1e3};switch(m.placement){case"top":return{...x,transform:"translateY(-100%)"};case"left":return{...x,transform:"translateX(-100%)"};case"bottom":case"right":default:return x}})();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,..._m[c],...n==null?void 0:n.menu,...a,children:e.map((x,k)=>x.divider?r.jsx(ni,{views:n},`divider-${k}`):r.jsx(ti,{item:x,views:n},x.id))})},ti=({item:e,views:o,...t})=>{const{activeSubmenuId:n,setActiveSubmenuId:a,size:i}=Rt(),[c,s]=h.useState(!1),d=e.items&&e.items.length>0,g=n===e.id,f=h.useRef(null),m=()=>{s(!0),d&&a(e.id)},p=()=>{s(!1)},u=y=>{y.stopPropagation(),!e.disabled&&!d&&e.onClick&&e.onClick()};return r.jsxs(l.View,{ref:f,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...Bm[i],_hover:e.disabled?{}:Om.hover,backgroundColor:c&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:m,onMouseLeave:p,onClick:u,...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(de,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),g&&d&&r.jsx(en,{items:e.items||[],side:"right",align:"start",views:o})]})},ni=({views:e,...o})=>r.jsx(l.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...o}),qm=({trigger:e,items:o,side:t="bottom",align:n="start",views:a,themeMode:i,...c})=>r.jsxs(l.View,{position:"relative",display:"inline-block",...a==null?void 0:a.container,...c,children:[r.jsx(ri,{views:a,children:e}),r.jsx(en,{items:o,side:t,align:n,views:a})]}),Ro=({trigger:e,items:o,size:t="md",variant:n="default",side:a="bottom",align:i="start",defaultOpen:c=!1,views:s,...d})=>{const{isOpen:g,setIsOpen:f,activeSubmenuId:m,setActiveSubmenuId:p}=Lm(c),u=h.useRef(null);return r.jsx(Nm,{value:{isOpen:g,setIsOpen:f,activeSubmenuId:m,setActiveSubmenuId:p,size:t,variant:n,triggerRef:u},children:r.jsx(qm,{trigger:e,items:o,side:a,align:i,views:s,...d})})};Ro.Trigger=ri,Ro.Content=en,Ro.Item=ti,Ro.Divider=ni;const Um=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:a,isOpen:i,onOpen:c,onClose:s,closeOnSelect:d=!0,maxRecentColors:g=8,showRecentColors:f=!0}=e,[m,p]=h.useState(i??!1),[u,y]=h.useState(o??t),[x,k]=h.useState(""),[C,S]=h.useState([]),v=h.useRef(null),w=h.useRef(null);h.useEffect(()=>{o!==void 0&&y(o)},[o]),h.useEffect(()=>{i!==void 0&&p(i)},[i]),h.useEffect(()=>{if(f&&typeof localStorage<"u"){const z=localStorage.getItem("colorPicker-recentColors");if(z)try{S(JSON.parse(z))}catch{}}},[f]),h.useEffect(()=>{if(typeof document>"u"||typeof document.addEventListener!="function")return;const z=E=>{m&&v.current&&w.current&&!v.current.contains(E.target)&&!w.current.contains(E.target)&&$()};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[m]);const b=h.useCallback(z=>{f&&S(E=>{const V=E.filter(P=>P!==z),H=[z,...V].slice(0,g);return typeof localStorage<"u"&&localStorage.setItem("colorPicker-recentColors",JSON.stringify(H)),H})},[f,g]),T=h.useCallback(()=>{const z=!m;p(z),z?c==null||c():s==null||s()},[m,c,s]),F=h.useCallback(z=>{y(z),b(z),n==null||n(z),a==null||a(z),d&&(p(!1),s==null||s())},[n,a,d,s,b]),W=h.useCallback(z=>{k(z)},[]),j=h.useCallback(()=>{x&&(F(x),k(""))},[x,F]),$=h.useCallback(()=>{p(!1),s==null||s()},[s]);return{isOpen:m,selectedColor:u,recentColors:C,customColor:x,handleToggle:T,handleColorSelect:F,handleCustomColorChange:W,handleCustomColorSubmit:j,handleClose:$,triggerRef:v,dropdownRef:w}},zo={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"}},Gm={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"}},Ym={default:{borderRadius:8},square:{borderRadius:0},rounded:{borderRadius:8},pill:{borderRadius:9999}},Km={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"}},Xm=[{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"}],Jm=typeof navigator<"u"&&navigator.product!=="ReactNative"&&typeof document<"u"&&typeof document.createElement=="function",Qm=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:a,views:i={},size:c="md",shape:s="default",variant:d="default",error:g=!1,isDisabled:f=!1,isReadOnly:m=!1,predefinedColors:p=Xm,showCustomInput:u=!0,showRecentColors:y=!0,isOpen:x,selectedColor:k,recentColors:C,customColor:S,handleToggle:v,handleColorSelect:w,handleCustomColorChange:b,handleCustomColorSubmit:T,handleClose:F,triggerRef:W,dropdownRef:j,onChange:$,onChangeComplete:z,onOpen:E,onClose:V,colorFormat:H,maxRecentColors:P,closeOnSelect:M,defaultValue:A,value:L,..._})=>{const N={...zo.container,...i==null?void 0:i.container},B={...zo.trigger,...Gm[c],...Ym[s],...Km[d],...g&&{borderColor:"color-red-500"},...f&&{opacity:.6,cursor:"not-allowed"},...!f&&!m&&{_hover:{borderColor:"color-gray-400"}},...i==null?void 0:i.trigger},q={...zo.dropdown,...i==null?void 0:i.dropdown},U={...zo.colorGrid,...i==null?void 0:i.colorGrid},O={...zo.recentColors,...i==null?void 0:i.recentColors},X=k||"color-gray-200";return r.jsxs(l.View,{...N,..._,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:W,onClick:f||m?void 0:v,...B,children:[r.jsxs(l.Horizontal,{alignItems:"center",gap:8,children:[r.jsx(l.View,{width:"24px",height:"24px",borderRadius:"8px",backgroundColor:X,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})]}),!m&&!f&&r.jsx(de,{widthHeight:16,color:"color-gray-500",orientation:x?"up":"down"})]}),x&&r.jsxs(l.View,{ref:j,...q,children:[r.jsx(l.View,{...U,children:p.map((D,K)=>r.jsx(l.View,{width:"36px",height:"36px",borderRadius:"8px",backgroundColor:D.value,borderWidth:"1px",borderStyle:"solid",borderColor:k===D.value?"theme-primary":"transparent",cursor:"pointer",onClick:()=>w(D.value),title:D.name,_hover:{transform:"scale(1.05)",borderColor:"color-gray-300"},...i==null?void 0:i.colorSwatch},K))}),u&&r.jsxs(l.View,{...zo.customInput,...i==null?void 0:i.customInput,children:[r.jsxs(l.Horizontal,{gap:8,alignItems:"center",marginBottom:"10px",children:[Jm&&r.jsx("input",{type:"color",value:S||"#1D4ED8",onChange:D=>{const K=D.target.value;b(K),w(K)},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(Ie,{placeholder:"#1D4ED8",value:S,onChange:D=>{var K;return b(typeof D=="string"?D:((K=D==null?void 0:D.target)==null?void 0:K.value)??"")},onKeyPress:D=>{D.key==="Enter"&&T()},size:"sm",right:S&&r.jsx(l.View,{width:"18px",height:"18px",borderRadius:"6px",backgroundColor:S,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",cursor:"pointer",onClick:T})})]}),y&&C.length>0&&r.jsxs(l.View,{...O,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((D,K)=>r.jsx(l.View,{width:"24px",height:"24px",borderRadius:"8px",backgroundColor:D,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",cursor:"pointer",transition:"transform 0.2s ease, border-color 0.2s ease",onClick:()=>w(D),title:D,_hover:{transform:"scale(1.05)",borderColor:"color-gray-300"}},K))})]})]}),a&&r.jsx(l.Text,{fontSize:"11px",lineHeight:"16px",color:g?"color-red-500":"color-gray-500",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},ai=e=>{const o=Um(e);return r.jsx(Qm,{...o,...e})},Zm=e=>{const o=zl(e);return r.jsx(Ml,{...o,...e})},Rm=e=>{const o=Il(e);return r.jsx(Fl,{...o,...e})},li={"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"},Vr={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"},ep={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"}]},op=(e,o,t,n,a)=>{const i=o.map(c=>`${c.color} ${c.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${t&&li[t]?li[t]:t||"to right"}, ${i})`;case"radial":const s=a&&Vr[a]?Vr[a]:a||"center";return`radial-gradient(${n||"circle"} at ${s}, ${i})`;case"conic":return`conic-gradient(from 0deg at ${a&&Vr[a]?Vr[a]:a||"center"}, ${i})`;default:return`linear-gradient(to right, ${i})`}},rp={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)"}}}},ii={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"}},tp=({type:e="linear",direction:o="to-right",shape:t="circle",position:n="center",from:a,to:i,colors:c,animate:s=!1,animationDuration:d=3,children:g,views:f,themeMode:m,...p})=>{const u=h.useMemo(()=>c&&c.length>0?c:a&&i?[{color:a,position:"0%"},{color:i,position:"100%"}]:ep[e],[c,a,i,e]),y=h.useMemo(()=>{const k=u.map(C=>({...C,color:C.color}));return op(e,k,o,t,n)},[e,u,o,t,n]),x=h.useMemo(()=>{if(!s)return{};const k=rp[e];return{...k,transition:k.transition.replace("3s",`${d}s`),animationDuration:`${d}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[s,d,e]);return r.jsx(l.View,{background:y,...ii.container,...x,...f==null?void 0:f.container,...p,children:g&&r.jsx(l.View,{...ii.content,...f==null?void 0:f.content,children:g})})},ci=e=>r.jsx(tp,{...e}),np=(e=null,o=null)=>{const[t,n]=h.useState(e),[a,i]=h.useState(o),c=d=>a===d,s=d=>{i(g=>g===d?null:d)};return h.useEffect(()=>{const d=f=>{!f.composedPath().some(u=>(u==null?void 0:u.id)==="menubar-content"||(u==null?void 0:u.id)==="menubar-trigger")&&a!==null&&i(null)},g=f=>{f.key==="Escape"&&a!==null&&i(null)};if(typeof(document==null?void 0:document.addEventListener)=="function")return document.addEventListener("mousedown",d),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",g)}},[a]),{activeMenuId:t,setActiveMenuId:n,openMenuId:a,setOpenMenuId:i,isMenuOpen:c,toggleMenu:s}},si={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},ap={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"}},lp={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Er={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},di=h.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),Dr=()=>h.useContext(di),ip=({value:e,children:o})=>r.jsx(di.Provider,{value:e,children:o}),gi=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",views:a,...i})=>{const c=o==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(c,{role:"menubar","aria-orientation":o,...lp[o],...ap[n],...a==null?void 0:a.container,...i,children:e})},hi=({children:e,id:o,disabled:t=!1,views:n})=>{const{orientation:a}=Dr(),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:h.Children.map(e,c=>h.isValidElement(c)?h.cloneElement(c,{...c.props,menuId:o}):c)})},fi=({children:e,menuId:o,disabled:t=!1,views:n})=>{const{activeMenuId:a,setActiveMenuId:i,toggleMenu:c,isMenuOpen:s,size:d,triggerRefs:g}=Dr(),f=h.useRef(null),m=a===o,p=s(o);h.useEffect(()=>(f.current&&o&&(g.current[o]=f.current),()=>{o&&delete g.current[o]}),[o,g]);const u=()=>{t||(i(o),c(o))};return r.jsx(l.View,{ref:f,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":p,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...si[d],...m?Er.active:{},...t?Er.disabled:{},_hover:t?{}:Er.hover,onClick:u,...n==null?void 0:n.trigger,children:e})},mi=({children:e,menuId:o,views:t})=>{const{isMenuOpen:n,orientation:a,triggerRefs:i}=Dr(),c=h.useRef(null),[s,d]=h.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),g=n(o);if(h.useEffect(()=>{if(g&&c.current&&o&&i.current[o]){const m=c.current.getBoundingClientRect(),p=i.current[o].getBoundingClientRect(),u=Math.max(m.width||200,200),y=Math.max(m.height||150,150),x=window.innerWidth,k=window.innerHeight,C={top:p.top,right:x-p.right,bottom:k-p.bottom,left:p.left},S=a==="horizontal"?[{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:p.left,y:p.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:p.left,y:p.top-y-8},{placement:"right",space:C.right,fits:C.right>=u+8,x:p.right+8,y:p.top},{placement:"left",space:C.left,fits:C.left>=u+8,x:p.left-u-8,y:p.top}]:[{placement:"right",space:C.right,fits:C.right>=u+8,x:p.right+8,y:p.top},{placement:"left",space:C.left,fits:C.left>=u+8,x:p.left-u-8,y:p.top},{placement:"bottom",space:C.bottom,fits:C.bottom>=y+8,x:p.left,y:p.bottom+8},{placement:"top",space:C.top,fits:C.top>=y+8,x:p.left,y:p.top-y-8}],v=S.find(F=>F.fits);if(v){d({x:v.x,y:v.y,placement:v.placement});return}const w=S.reduce((F,W)=>W.space>F.space?W:F);let b=w.x,T=w.y;b+u>x&&(b=x-u-8),b<8&&(b=8),T+y>k&&(T=k-y-8),T<8&&(T=8),d({x:b,y:T,placement:w.placement})}},[g,a,o,i]),!g)return null;const f={position:"fixed",left:s.x,top:s.y,zIndex:1e3};return r.jsx(l.View,{ref:c,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:f,...t==null?void 0:t.content,children:e})},pi=({children:e,icon:o,disabled:t=!1,onClick:n,views:a})=>{const{size:i}=Dr(),c=()=>{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,...si[i],_hover:t?{}:Er.hover,onClick:c,...a==null?void 0:a.item,children:[o&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:o}),e]})},ui=({views:e})=>r.jsx(l.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),cp=({items:e,orientation:o,size:t,variant:n,views:a,themeMode:i})=>r.jsx(gi,{orientation:o,size:t,variant:n,views:a,children:e.map(c=>r.jsxs(hi,{id:c.id,disabled:c.disabled,views:a,children:[r.jsxs(fi,{menuId:c.id,views:a,children:[c.icon&&r.jsx(l.View,{marginRight:8,...a==null?void 0:a.icon,children:c.icon}),c.label]}),c.items&&c.items.length>0&&r.jsx(mi,{menuId:c.id,views:a,children:c.items.map((s,d)=>s.separator?r.jsx(ui,{views:a},`separator-${d}`):r.jsx(pi,{id:s.id,icon:s.icon,disabled:s.disabled,onClick:s.onClick,views:a,children:s.label},s.id))})]},c.id))}),go=({items:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultActiveMenuId:a=null,defaultOpenMenuId:i=null,views:c,...s})=>{const{activeMenuId:d,setActiveMenuId:g,openMenuId:f,setOpenMenuId:m,isMenuOpen:p,toggleMenu:u}=np(a,i),y=h.useRef({});return r.jsx(ip,{value:{activeMenuId:d,setActiveMenuId:g,openMenuId:f,setOpenMenuId:m,isMenuOpen:p,toggleMenu:u,orientation:o,size:t,variant:n,triggerRefs:y},children:r.jsx(cp,{items:e,orientation:o,size:t,variant:n,views:c,...s})})};go.Root=gi,go.Menu=hi,go.Trigger=fi,go.Content=mi,go.Item=pi,go.Separator=ui;const sp=(e,o,t)=>{const[n,a]=h.useState([]);return h.useEffect(()=>{a((()=>{const c=[];if(o<=t)for(let s=1;s<=o;s++)c.push(s);else{c.push(1);let s=Math.max(2,e-Math.floor((t-2)/2)),d=Math.min(o-1,s+t-3);d>=o-1&&(d=o-1,s=Math.max(2,d-(t-3))),s>2&&c.push("...");for(let g=s;g<=d;g++)c.push(g);d<o-1&&c.push("..."),c.push(o)}return c})())},[e,o,t]),{visiblePageNumbers:n}},Mo={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"}}}},er={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"}}},or={rounded:{borderRadius:8},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},dp={backgroundColor:"theme-primary",color:"color-white",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"theme-primary",opacity:.9}},$r={opacity:.5,cursor:"not-allowed",transition:"all 0.2s ease-in-out",_hover:{backgroundColor:"transparent"}},gp=({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:c=!1,showPageInfo:s=!0,maxPageButtons:d=5,showFirstLastButtons:g=!1,size:f="md",variant:m="default",shape:p="rounded",visiblePageNumbers:u=[],views:y,...x})=>{const k=v=>{v<1||v>o||v===e||t(v)},C=v=>{i&&i(Number(v.target.value))},S=(v,w)=>{if(v==="...")return r.jsx(l.View,{display:"flex",alignItems:"center",justifyContent:"center",...Mo[f],...y==null?void 0:y.ellipsis,children:"..."},`ellipsis-${w}`);const b=v===e;return r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:b?"default":"pointer",...Mo[f],...er[m],...or[p],...b?dp:{},onClick:()=>k(v),"aria-label":`Page ${v}`,"aria-current":b?"page":void 0,...b?y==null?void 0:y.activePageButton:y==null?void 0:y.pageButton,children:v},`page-${v}`)};return r.jsxs(l.Horizontal,{alignItems:"center",gap:8,...y==null?void 0:y.container,...x,children:[g&&r.jsxs(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Mo[f],...er[m],...or[p],...e===1?$r:{},onClick:()=>k(1),"aria-label":"First page",disabled:e===1,...y==null?void 0:y.navigationButton,children:[r.jsx(de,{orientation:"left",widthHeight:16}),r.jsx(de,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...Mo[f],...er[m],...or[p],...e===1?$r:{},onClick:()=>k(e-1),"aria-label":"Previous page",disabled:e===1,...y==null?void 0:y.navigationButton,children:r.jsx(de,{orientation:"left",widthHeight:16})}),u.map((v,w)=>S(v,w)),r.jsx(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Mo[f],...er[m],...or[p],...e===o?$r:{},onClick:()=>k(e+1),"aria-label":"Next page",disabled:e===o,...y==null?void 0:y.navigationButton,children:r.jsx(de,{orientation:"right",widthHeight:16})}),g&&r.jsxs(l.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...Mo[f],...er[m],...or[p],...e===o?$r:{},onClick:()=>k(o),"aria-label":"Last page",disabled:e===o,...y==null?void 0:y.navigationButton,children:[r.jsx(de,{orientation:"right",widthHeight:16}),r.jsx(de,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),s&&r.jsxs(l.Text,{marginLeft:16,color:"color-gray-600",...y==null?void 0:y.pageInfo,children:["Page ",e," of ",o]}),c&&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(v=>r.jsx("option",{value:v.value,children:v.label},v.value))})]})},yi=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:c=!1,showPageInfo:s=!0,maxPageButtons:d=5,showFirstLastButtons:g=!1,size:f="md",variant:m="default",shape:p="rounded",views:u,...y})=>{const{visiblePageNumbers:x}=sp(e,o,d);return r.jsx(gp,{currentPage:e,totalPages:o,onPageChange:t,pageSize:n,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:c,showPageInfo:s,maxPageButtons:d,showFirstLastButtons:g,size:f,variant:m,shape:p,visiblePageNumbers:x,views:u,...y})},hp=e=>typeof e=="string"&&(/^(#|rgb\(|rgba\(|hsl\(|hsla\(|var\()/.test(e)||["black","currentColor","inherit","transparent","white"].includes(e)),fp=h.memo(({shape:e="linear",value:o=0,max:t=100,color:n="theme-primary",backgroundColor:a="color-gray-200",height:i,size:c,radius:s=4,strokeWidth:d=10,showLabel:g=!1,labelColor:f="color-black-primary",animated:m=!0,animationDuration:p="0.5s",views:u,themeMode:y,...x})=>{var $;const{getColor:k,themeMode:C}=l.useTheme(),S=y||C,w=Math.min(t,Math.max(0,o))/t*100,b=z=>hp(z)?z:k(z,{themeMode:S}),T=h.useMemo(()=>b(a),[k,a,S]),F=h.useMemo(()=>b(n),[k,n,S]);if(e==="circle"){const z=c||(typeof i=="number"?i:100),E=(z-d)/2,V=2*Math.PI*E,H=V-w/100*V;return r.jsxs(l.View,{width:z,height:z,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...u==null?void 0:u.container,...x,children:[r.jsxs("svg",{width:z,height:z,viewBox:`0 0 ${z} ${z}`,style:{transform:"rotate(-90deg)"},children:[r.jsx("circle",{cx:z/2,cy:z/2,r:E,stroke:T,strokeWidth:d,fill:"transparent",...u==null?void 0:u.track}),r.jsx("circle",{cx:z/2,cy:z/2,r:E,stroke:F,strokeWidth:d,strokeDasharray:V,strokeDashoffset:H,strokeLinecap:"round",fill:"transparent",style:{transition:m?`stroke-dashoffset ${p} ease-in-out`:"none"},...u==null?void 0:u.indicator})]}),g&&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:f,fontSize:`${z*.2}px`,fontWeight:"bold",...u==null?void 0:u.text,children:[Math.round(w),"%"]})})]})}const W=i||8,j={backgroundColor:T,...(($=u==null?void 0:u.container)==null?void 0:$.style)||{},...x.style||{}};return r.jsxs(l.View,{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":t,width:"100%",height:W,borderRadius:s,overflow:"hidden",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...u==null?void 0:u.container,...x,style:j,children:[r.jsx("div",{style:{height:"100%",backgroundColor:F,borderRadius:typeof s=="number"?`${s}px`:s,position:"absolute",left:0,top:0,bottom:0,width:`${w}%`,transition:m?`width ${p} ease-in-out`:"none",...u==null?void 0:u.bar}}),g&&r.jsxs(l.Text,{color:f,fontSize:typeof W=="number"&&W>16?`${W*.6}px`:"10px",fontWeight:"bold",position:"relative",zIndex:1,...u==null?void 0:u.text,children:[Math.round(w),"%"]})]})}),bi=e=>{const o=me("progress",e);return r.jsx(fp,{...o})},mp=(e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}))(),pp={thin:"1px",medium:"2px",thick:"4px"},rr={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"}},up=e=>typeof e=="string"&&(/^(#|rgb\(|rgba\(|hsl\(|hsla\(|var\()/.test(e)||["black","currentColor","inherit","transparent","white"].includes(e)),yp=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:n,spacing:a="0px",label:i,decorative:c=!1,views:s,themeMode:d,...g})=>{const{themeMode:f}=l.useTheme(),m=n||"color-gray-200",p=mp[o],u=pp[t],y=c?{"aria-hidden":!0}:{role:"separator","aria-orientation":e},x=up(m)?{style:{borderColor:m}}:{borderColor:m};return i&&e==="horizontal"?r.jsxs(l.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:a,...y,...g,children:[r.jsx(l.View,{height:"0px",flexGrow:1,borderTop:`${u} ${p}`,...x,...rr.container,...s==null?void 0:s.container}),r.jsx(l.Text,{...rr.label,...s==null?void 0:s.label,children:i}),r.jsx(l.View,{height:"0px",flexGrow:1,borderTop:`${u} ${p}`,...x,...rr.container,...s==null?void 0:s.container})]}):e==="horizontal"?r.jsx(l.View,{height:"0px",width:"100%",borderTop:`${u} ${p}`,padding:a,...x,...rr.container,...y,...s==null?void 0:s.container,...g}):r.jsx(l.View,{width:"0px",height:"100%",borderLeft:`${u} ${p}`,padding:a,...x,...rr.container,...y,...s==null?void 0:s.container,...g})},xi=e=>{const o=me("separator",e);return r.jsx(yp,{...o})},Lr=xi,bp=xi,xp={xs:12,sm:14,md:16,lg:18,xl:20},kp=({isSupported:e,isSharing:o,onShare:t,label:n,children:a,icon:i,size:c,isDisabled:s,isLoading:d,iconPosition:g,disableWhenUnsupported:f=!0,...m})=>{const p=c??"md",u=i??r.jsx(En,{widthHeight:xp[p],strokeWidth:1.5,filled:!1}),y=!!s||!e&&f,x=!!d||o;return r.jsx(ie,{...m,size:p,icon:u,iconPosition:g??"left",isDisabled:y,isLoading:x,onClick:t,children:a??n??"Share"})},ki=()=>typeof navigator>"u"?void 0:navigator,Cp=(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},wp=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},Sp=e=>{const{shareData:o,onClick:t,onUnsupported:n,onShareStart:a,onShareSuccess:i,onShareCancel:c,onShareError:s}=e,[d,g]=h.useState(!1),f=h.useMemo(()=>Cp(ki(),o),[o]),m=h.useCallback((...p)=>{t==null||t(...p);const u=ki();if(!u||typeof u.share!="function"){n==null||n();return}if(!d){if(typeof u.canShare=="function")try{if(!u.canShare(o)){n==null||n();return}}catch(y){s==null||s(y);return}g(!0),a==null||a();try{u.share(o).then(()=>{i==null||i()}).catch(y=>{if(wp(y)==="AbortError"){c==null||c();return}s==null||s(y)}).finally(()=>{g(!1)})}catch(y){g(!1),s==null||s(y)}}},[d,t,c,s,a,i,n,o]);return{isSupported:f,isSharing:d,handleShare:m}},Ci=e=>{const{isSupported:o,isSharing:t,handleShare:n}=Sp(e),{shareData:a,onShareStart:i,onShareSuccess:c,onShareCancel:s,onShareError:d,onUnsupported:g,onClick:f,...m}=e;return r.jsx(kp,{...m,isSupported:o,isSharing:t,onShare:n})},vp=({label:e,status:o="default",views:t,themeMode:n,...a})=>{const{themeMode:i}=l.useTheme(),c=Jn();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%",...c[o].indicator,...t==null?void 0:t.indicator}),e&&r.jsx(l.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...c[o].label,...t==null?void 0:t.label,children:e})]})},Br=e=>{const o=me("status",e);return r.jsx(vp,{...o})},Tp=(e=!0,o,t,n)=>{const{on:a}=l.useResponsive(),i=a("mobile"),[c,s]=h.useState(o!==void 0?o:e);return h.useEffect(()=>{o!==void 0&&s(o)},[o]),{isExpanded:c,toggleExpanded:()=>{const m=!c;s(m),t&&t(m)},expand:()=>{c||(s(!0),t&&t(!0))},collapse:()=>{c&&(s(!1),t&&t(!1))},isMobile:i}},Ip={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},Fp=(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"}}))(),zp={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},Mp={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)"}},Wp={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)"},wi=h.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),_r=()=>h.useContext(wi),Hp=({value:e,children:o})=>r.jsx(wi.Provider,{value:e,children:o}),jp=({children:e,showToggleButton:o=!0,views:t,...n})=>{const{isExpanded:a,toggleExpanded:i,position:c}=_r();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(de,{orientation:c==="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(de,{orientation:c==="left"?"right":"left",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})})})},Pp=({children:e,views:o,...t})=>{const{isExpanded:n}=_r();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})},Ap=({children:e,views:o,...t})=>{const{isExpanded:n}=_r();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})},Vp=({children:e,position:o="left",size:t="md",variant:n="default",fixed:a=!1,hasBackdrop:i=!0,expandedWidth:c,collapsedWidth:s,breakpoint:d,breakpointBehavior:g="overlay",elevation:f="none",transitionPreset:m="normal",ariaLabel:p="Sidebar navigation",showToggleButton:u,toggleExpanded:y,expand:x,isExpanded:k,isMobile:C,collapse:S,views:v,themeMode:w,...b})=>{const T=Ip[t],F=k?c||T.expandedWidth:s||T.collapsedWidth,W=!C||C&&g!=="hide",j=a||C&&g==="overlay"?"fixed":"relative",$=i&&C&&k&&g==="overlay";return r.jsxs(r.Fragment,{children:[$&&r.jsx(l.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:S,...v==null?void 0:v.backdrop}),W&&r.jsx(l.Vertical,{position:j,top:0,height:"100vh",width:F,zIndex:999,transition:Wp[m],transform:C&&g==="overlay"&&!k?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":p,...Fp[n],...zp[o],...Mp[f],...v==null?void 0:v.container,...b,children:h.Children.map(e,z=>z)})]})},tr=({children:e,position:o="left",size:t="md",variant:n="default",defaultExpanded:a=!0,expanded:i,onExpandedChange:c,fixed:s=!1,hasBackdrop:d=!0,showToggleButton:g=!0,expandedWidth:f,collapsedWidth:m,breakpoint:p=768,breakpointBehavior:u="overlay",views:y,...x})=>{const{isExpanded:k,toggleExpanded:C,expand:S,collapse:v,isMobile:w}=Tp(a,i,c);return r.jsx(Hp,{value:{isExpanded:k,toggleExpanded:C,expand:S,collapse:v,position:o,size:t,variant:n,views:y},children:r.jsx(Vp,{position:o,size:t,variant:n,fixed:s,hasBackdrop:d,showToggleButton:g,expandedWidth:f,collapsedWidth:m,breakpoint:p,breakpointBehavior:u,isExpanded:k,isMobile:w,toggleExpanded:C,expand:S,collapse:v,views:y,...x,children:e})})};tr.Header=jp,tr.Content=Pp,tr.Footer=Ap,tr.useContext=_r;const Ep=()=>({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)}}}),Dp=(e,o,t,n=50,a=1/0,i=!1,c,s,d=10)=>{const[g,f]=h.useState(!1),[m,p]=h.useState([]),u=h.useRef(null),y=h.useRef(null),x=h.useRef(0),k=h.useRef([]),C=h.useRef(s||(typeof window<"u"?Ep():null)),S=h.useCallback(()=>u.current?e==="horizontal"?u.current.offsetWidth:u.current.offsetHeight:0,[e]),v=h.useCallback(()=>{if(!c||!C.current)return null;const P=C.current.getItem(c);if(!P)return null;try{const M=JSON.parse(P);return Array.isArray(M.sizes)?M.sizes:null}catch(M){return console.warn("Failed to parse saved panel sizes:",M),null}},[c]),w=h.useCallback(()=>{if(!c||!C.current||m.length===0)return;const P=m.map(M=>({id:M.id,size:M.size,collapsed:M.collapsed||!1}));C.current.setItem(c,JSON.stringify({sizes:P}))},[c,m]),b=h.useCallback((P,M,A,L,_)=>{p(N=>N.some(B=>B.id===P)?N:[...N,{id:P,size:M,minSize:A??n,maxSize:L??a,collapsible:_??i,collapsed:!1}])},[n,a,i]),T=h.useCallback(P=>{p(M=>M.filter(A=>A.id!==P))},[]),F=h.useCallback(P=>{const M=m.find(A=>A.id===P);return M?M.size:0},[m]),W=h.useCallback((P,M)=>{p(A=>A.map(L=>L.id===P?{...L,size:M}:L))},[]),j=h.useCallback(P=>{const M=m.find(A=>A.id===P);return M?!!M.collapsed:!1},[m]),$=h.useCallback(P=>{p(M=>{const A=M.findIndex(B=>B.id===P);if(A===-1)return M;const L=M[A];if(!L.collapsible)return M;const _={...L,collapsed:!L.collapsed},N=[...M];return N[A]=_,N})},[]),z=h.useCallback((P,M)=>{y.current=P,x.current=M,k.current=m.map(A=>A.size),f(!0)},[m]),E=h.useCallback(P=>{if(!g||!y.current)return;const M=y.current,A=P-x.current;let L=-1;const _=M.match(/\d+$/);if(_&&(L=parseInt(_[0],10)-1),L===-1&&m.length>=2&&(L=0),L<0||L>=m.length-1)return;const N=m[L],B=m[L+1];if(N.collapsed||B.collapsed)return;let q=k.current[L]+A,U=k.current[L+1]-A;q=Math.max(N.minSize??n,Math.min(N.maxSize??a,q)),U=Math.max(B.minSize??n,Math.min(B.maxSize??a,U)),p(O=>O.map((X,D)=>D===L?{...X,size:q}:D===L+1?{...X,size:U}:X))},[g,m,e,n,a]),V=h.useCallback(()=>{g&&t&&t(m.map(P=>P.size)),y.current=null,f(!1),c&&w()},[g,m,t,c,w]),H=h.useCallback(P=>{if(!g||!y.current)return;const M=y.current;let A=-1;const L=M.match(/\d+$/);if(L&&(A=parseInt(L[0],10)-1),A===-1&&m.length>=2&&(A=0),A<0||A>=m.length-1)return;let _=0;e==="horizontal"?(P.key==="ArrowLeft"&&(_=-d),P.key==="ArrowRight"&&(_=d),P.key==="Home"&&(_=-100),P.key==="End"&&(_=100)):(P.key==="ArrowUp"&&(_=-d),P.key==="ArrowDown"&&(_=d),P.key==="Home"&&(_=-100),P.key==="End"&&(_=100)),_!==0&&(P.preventDefault(),E(x.current+_)),P.key==="Escape"&&(p(N=>N.map((B,q)=>({...B,size:k.current[q]}))),V())},[g,m,e,E,V,d]);return h.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)!="function")return;const P=L=>{if(!g)return;const _=e==="horizontal"?L.clientX:L.clientY;E(_)},M=L=>{if(!g||L.touches.length===0)return;const _=L.touches[0],N=e==="horizontal"?_.clientX:_.clientY;E(N)},A=()=>{g&&V()};return g&&(document.addEventListener("mousemove",P),document.addEventListener("touchmove",M),document.addEventListener("mouseup",A),document.addEventListener("touchend",A),document.addEventListener("keydown",H),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("touchmove",M),document.removeEventListener("mouseup",A),document.removeEventListener("touchend",A),document.removeEventListener("keydown",H),document.body.style.cursor="",document.body.style.userSelect=""}},[g,e,E,V,H]),h.useEffect(()=>{if(m.length!==0){if(c){const P=v();if(P){p(M=>M.map(A=>{const L=P.find(_=>_.id===A.id);return L?{...A,size:L.size,collapsed:L.collapsed||!1}:A}));return}}if(!o){const M=S()/m.length;p(A=>A.map(L=>({...L,size:M})))}}},[m.length,o,S,c,v]),h.useEffect(()=>{if(!o||o.length===0||m.length===0)return;const P=S(),M=o.map(A=>typeof A=="string"&&A.endsWith("%")?parseFloat(A)/100*P:typeof A=="number"?A:parseFloat(A));p(A=>A.map((L,_)=>({...L,size:_<M.length?M[_]:L.size})))},[o,m.length,S]),h.useEffect(()=>{m.length>0&&c&&!g&&w()},[m,c,g,w]),{isResizing:g,setIsResizing:f,containerRef:u,panels:m,registerPanel:b,unregisterPanel:T,getPanelSize:F,setPanelSize:W,isPanelCollapsed:j,togglePanelCollapse:$,startResize:z,onResize:E,endResize:V}},$p={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Lp=(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],Bp=(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"}}}))(),Or={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},Si=h.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),vi=()=>h.useContext(Si),_p=({value:e,children:o})=>r.jsx(Si.Provider,{value:e,children:o}),Op=({children:e,id:o,defaultSize:t,minSize:n,maxSize:a,collapsible:i,defaultCollapsed:c,onCollapseChange:s,views:d,...g})=>{const{orientation:f,registerPanel:m,unregisterPanel:p,getPanelSize:u,isPanelCollapsed:y,togglePanelCollapse:x}=vi(),k=typeof t=="string"&&t.endsWith("%")?0:typeof t=="number"?t:0;h.useEffect(()=>(m(o,k,n,a,i),()=>p(o)),[o,k,n,a,i,m,p]);const C=u(o),S=y(o);return h.useEffect(()=>{s&&S!==void 0&&s(S)},[S,s]),h.useEffect(()=>{i&&c&&!S&&x(o)},[o,i,c,S,x]),S?r.jsx(l.View,{flex:"0 0 auto",width:f==="horizontal"?"10px":"100%",height:f==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>x(o),"aria-label":`Expand panel ${o}`,role:"button",tabIndex:0,...d==null?void 0:d.collapsedPanel,...g}):r.jsx(l.View,{flex:C>0?"0 0 auto":"1",width:f==="horizontal"?`${C}px`:"100%",height:f==="vertical"?`${C}px`:"100%",overflow:"auto",...d==null?void 0:d.panel,...g,children:e})},Np=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:n=!0,withCollapseButton:a=!1,collapseTarget:i,views:c,...s})=>{const{orientation:d,size:g,variant:f,startResize:m,isPanelCollapsed:p,togglePanelCollapse:u}=vi(),x=(()=>{if(i)return i;const b=e.match(/\d+$/);if(!b)return"";const T=parseInt(b[0],10);return isNaN(T)?"":`panel${T}`})(),k=p(x),C=b=>{if(t)return;b.preventDefault();const T=d==="horizontal"?b.clientX:b.clientY;m(e,T)},S=b=>{if(t||b.touches.length===0)return;b.preventDefault();const T=b.touches[0],F=d==="horizontal"?T.clientX:T.clientY;m(e,F)},v=b=>{t||(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),m(e,0))},w=b=>{b.stopPropagation(),x&&u(x)};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",...Lp(g,d),...Bp[f],onMouseDown:C,onTouchStart:S,onKeyDown:v,opacity:t?.5:1,pointerEvents:t?"none":"auto",...c==null?void 0:c.handle,...s,children:[n&&r.jsx(l.View,{display:"flex",alignItems:"center",justifyContent:"center",width:d==="horizontal"?"100%":"auto",height:d==="vertical"?"100%":"auto",pointerEvents:"none",...c==null?void 0:c.handleIcon,children:d==="horizontal"?r.jsxs(l.Horizontal,{gap:1,children:[r.jsx(l.View,{...Or.horizontal}),r.jsx(l.View,{...Or.horizontal})]}):r.jsxs(l.Vertical,{gap:1,children:[r.jsx(l.View,{...Or.vertical}),r.jsx(l.View,{...Or.vertical})]})}),a&&x&&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:w,"aria-label":k?`Expand panel ${x}`:`Collapse panel ${x}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...c==null?void 0:c.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"})})})]})},qp=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:a,minSize:i,maxSize:c,collapsible:s=!1,containerRef:d,autoSaveId:g,keyboardResizeBy:f,onLayout:m,views:p,...u})=>{const y=o==="horizontal"?l.Horizontal:l.Vertical;return r.jsx(y,{ref:d,width:"100%",height:"100%",position:"relative",overflow:"hidden",...$p[o],...p==null?void 0:p.container,...u,children:e})},on=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:a,onSizesChange:i,minSize:c=50,maxSize:s,collapsible:d=!1,autoSaveId:g,storage:f,keyboardResizeBy:m=10,views:p,...u})=>{const{isResizing:y,setIsResizing:x,containerRef:k,registerPanel:C,unregisterPanel:S,getPanelSize:v,setPanelSize:w,isPanelCollapsed:b,togglePanelCollapse:T,startResize:F,onResize:W,endResize:j}=Dp(o,a,i,c,s,d,g,f,m);return r.jsx(_p,{value:{orientation:o,size:t,variant:n,isResizing:y,setIsResizing:x,registerPanel:C,unregisterPanel:S,getPanelSize:v,setPanelSize:w,isPanelCollapsed:b,togglePanelCollapse:T,startResize:F,onResize:W,endResize:j},children:r.jsx(qp,{orientation:o,size:t,variant:n,defaultSizes:a,minSize:c,maxSize:s,collapsible:d,autoSaveId:g,keyboardResizeBy:m,containerRef:k,views:p,...u,children:e})})};on.Panel=Op,on.Handle=Np;const Nr={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"}}},Up={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"}},Gp=()=>Math.random().toString(36).substring(2,9);let Wo=new Map;const nr=po.create(e=>({toasts:[],add:(o,t,n,a={})=>{const i=a.id||Gp(),c={id:i,variant:o,title:t,description:n,createdAt:Date.now(),isVisible:!0,...a};if(e(s=>({toasts:[...s.toasts,c]})),a.duration!==0){const s=a.duration||5e3,d=setTimeout(()=>{nr.getState().remove(i)},s);Wo.set(i,d)}return i},remove:o=>{e(t=>({toasts:t.toasts.map(n=>n.id===o?{...n,isVisible:!1}:n)})),Wo.has(o)&&(clearTimeout(Wo.get(o)),Wo.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(n=>n.id!==o)}))},300)},removeAll:()=>{Wo.forEach(clearTimeout),Wo.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),ho=(e,o,t,n)=>nr.getState().add(e,o,t,n),Ti=(e,o,t)=>ho("info",e,o,t),Ii=(e,o,t)=>ho("success",e,o,t),Fi=(e,o,t)=>ho("warning",e,o,t),zi=(e,o,t)=>ho("error",e,o,t),Mi=e=>{nr.getState().remove(e)},Wi=()=>{nr.getState().removeAll()},Hi=({variant:e,title:o,description:t,onClose:n,isClosable:a=!0,action:i,actionText:c,showIcon:s=!0,theme:d,views:g,render:f,icon:m,id:p,isVisible:u=!0,themeMode:y})=>{const x=d??Nr,k=()=>{var w,b;if(m!==void 0)return m;const v=e?(b=(w=Nr[e])==null?void 0:w.icon)==null?void 0:b.color:Nr.info.icon.color;switch(e){case"info":return r.jsx(Ye,{widthHeight:20,color:v});case"success":return r.jsx(An,{widthHeight:20,color:v});case"warning":return r.jsx(Ye,{widthHeight:20,color:v,orientation:"down"});case"error":return r.jsx(fr,{widthHeight:20,color:v});default:return r.jsx(Ye,{widthHeight:20,color:Nr.info.icon.color})}};if(f)return r.jsx(r.Fragment,{children:f({id:p||"",onClose:n})});const C=e==="error"?"alert":"status",S=e==="error"||e==="warning"?"assertive":"polite";return r.jsxs(l.Horizontal,{role:C,"aria-live":S,"aria-atomic":"true","data-state":u?"open":"closed",gap:12,width:"100%",maxWidth:"380px",borderWidth:"1px",borderStyle:"solid",borderRadius:"12px",padding:"12px 14px",alignItems:"flex-start",position:"relative",backgroundColor:x[e].container.backgroundColor,borderColor:x[e].container.border,boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12)",opacity:u?1:0,transform:u?"translateY(0)":"translateY(4px)",transition:"opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",...g==null?void 0:g.container,children:[s&&r.jsx(l.View,{marginTop:"2px",...g==null?void 0:g.icon,children:k()}),r.jsxs(l.Vertical,{gap:4,flex:"1",children:[r.jsx(l.Text,{fontSize:"14px",lineHeight:"20px",fontWeight:"600",color:x[e].content.color,backgroundColor:x[e].container.backgroundColor,...g==null?void 0:g.title,children:o}),t&&r.jsx(l.Text,{fontSize:"12px",lineHeight:"18px",color:x[e].content.color,fontWeight:"400",backgroundColor:x[e].container.backgroundColor,...g==null?void 0:g.description,children:t}),i&&c&&r.jsx(l.Text,{fontSize:"14px",fontWeight:"600",marginTop:"6px",cursor:"pointer",color:x[e].content.color,backgroundColor:x[e].container.backgroundColor,onClick:v=>{v.stopPropagation(),i()},_hover:{textDecoration:"underline"},transition:"opacity 0.2s ease, color 0.2s ease",...g==null?void 0:g.actionButton,children:c})]}),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:v=>{v.stopPropagation(),n()},_hover:{backgroundColor:"color-blackAlpha-100"},transition:"background-color 0.2s ease, opacity 0.2s ease",...g==null?void 0:g.closeButton,children:r.jsx(Te,{widthHeight:16,color:x[e].content.color})})]})},Yp=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:n})=>{const{toasts:a,remove:i}=nr(),s=h.useMemo(()=>{const d={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return a.forEach(g=>{const f=g.position||e;d[f].push(g)}),Object.keys(d).forEach(g=>{d[g]=d[g].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",...Up[e],style:n,children:s.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(Hi,{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))})},Kp=()=>({toast:(e,o,t,n)=>ho(e,o,t,n),info:(e,o,t)=>Ti(e,o,t),success:(e,o,t)=>Ii(e,o,t),warning:(e,o,t)=>Fi(e,o,t),error:(e,o,t)=>zi(e,o,t),remove:e=>Mi(e),removeAll:()=>Wi()}),Xp=Object.assign(e=>r.jsx(Hi,{...e}),{Container:e=>r.jsx(Yp,{...e}),show:ho,info:Ti,success:Ii,warning:Fi,error:zi,remove:Mi,removeAll:Wi}),Jp=Kp,ji=(e,o)=>{var c,s;if(!e)return!0;const t=e.toLowerCase(),n=o.name.toLowerCase().includes(t),a=((c=o.description)==null?void 0:c.toLowerCase().includes(t))||!1,i=((s=o.keywords)==null?void 0:s.some(d=>d.toLowerCase().includes(t)))||!1;return n||a||i},Qp=({open:e,onOpenChange:o,groups:t=[],commands:n=[],filter:a})=>{const[i,c]=h.useState(""),[s,d]=h.useState(0),g=h.useRef(null),f=h.useMemo(()=>a||ji,[a]),m=h.useMemo(()=>[...t.flatMap(k=>k.commands),...n],[t,n]),p=h.useMemo(()=>i.trim()?m.filter(x=>f(i,x)):m,[m,i,f]),u=h.useMemo(()=>{if(!i)return t;const x=a||ji;return t.map(k=>({...k,commands:k.commands.filter(C=>x(i,C))})).filter(k=>k.commands.length)},[t,i,a]);h.useEffect(()=>{d(0)},[p.length]);const y=h.useCallback(x=>{if(e)switch(x.key){case"ArrowDown":x.preventDefault(),d(k=>k<p.length-1?k+1:k);break;case"ArrowUp":x.preventDefault(),d(k=>k>0?k-1:k);break;case"Enter":x.preventDefault(),p[s]&&(p[s].onSelect(),o(!1),c(""));break;case"Escape":x.preventDefault(),o(!1),c("");break}},[e,p,s,o]);return h.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)=="function")return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y]),h.useEffect(()=>{const x=g.current;if(x&&typeof x.querySelector=="function"&&e){const k=x.querySelector(`[data-index="${s}"]`);k&&typeof k.scrollIntoView=="function"&&k.scrollIntoView({block:"nearest"})}},[s,e]),h.useEffect(()=>{e?d(0):c("")},[e]),{search:i,setSearch:c,selectedIndex:s,setSelectedIndex:d,filteredCommands:p,filteredGroups:u,listRef:g}},Zp=({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}),Pi=h.forwardRef(({value:e,onValueChange:o,...t},n)=>r.jsx(l.Input,{value:e,onChange:a=>{var i,c;return o(typeof a=="string"?a:((i=a==null?void 0:a.target)==null?void 0:i.value)??((c=a==null?void 0:a.nativeEvent)==null?void 0:c.text)??"")},ref:n,...t}));Pi.displayName="CommandTextInput";const Rp={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},eu=(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)"}}))(),ou={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},ru={overflow:"auto",padding:"8px 0"},tu={marginBottom:"8px"},nu={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},au={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},lu={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},iu={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},cu={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},su={display:"flex",flexDirection:"column",flex:1},du={fontSize:"14px",fontWeight:"medium"},gu={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},hu={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},fu={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},mu={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},pu=h.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),uu=({value:e,children:o})=>r.jsx(pu.Provider,{value:e,children:o}),Ai=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:n,...a})=>{const i=h.useRef(null);return h.useEffect(()=>{i.current&&i.current.focus()},[]),r.jsxs(l.View,{...ou,...n==null?void 0:n.container,...a,children:[r.jsx(pr,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),r.jsx(Pi,{width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",...n==null?void 0:n.input,value:e,onValueChange:o,placeholder:t,ref:i})]})},yu=({children:e,views:o,...t})=>r.jsx(l.View,{...ru,...o==null?void 0:o.container,...t,children:e}),Vi=({heading:e,children:o,views:t,...n})=>r.jsxs(l.View,{...tu,...t==null?void 0:t.container,...n,children:[r.jsx(l.Text,{...nu,...t==null?void 0:t.heading,children:e}),o]}),rn=({item:e,selected:o=!1,onSelect:t,views:n,...a})=>{const i=()=>{!e.disabled&&t&&t()};return r.jsxs(l.Horizontal,{...au,...o?lu:{},...e.disabled?iu:{},onPress:i,onClick:i,...n==null?void 0:n.container,...a,children:[e.icon&&r.jsx(l.View,{...cu,...n==null?void 0:n.icon,children:e.icon}),r.jsxs(l.Vertical,{...su,...n==null?void 0:n.content,children:[r.jsx(l.Text,{...du,...n==null?void 0:n.name,children:e.name}),e.description&&r.jsx(l.Text,{...gu,...n==null?void 0:n.description,children:e.description})]}),e.shortcut&&r.jsx(l.Text,{...hu,...n==null?void 0:n.shortcut,children:e.shortcut})]})},Ei=({children:e="No results found.",views:o,...t})=>r.jsx(l.View,{...fu,...o==null?void 0:o.container,...t,children:e}),bu=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:a,size:i="md",variant:c="default",emptyState:s,footer:d,search:g,setSearch:f,selectedIndex:m,setSelectedIndex:p,filteredCommands:u,filteredGroups:y,listRef:x,views:k,filter:C,...S})=>{if(!e)return null;const v=h.useCallback(F=>{F.disabled||(F.onSelect(),o(!1),f(""))},[o,f]);h.useCallback(F=>F.target===F.currentTarget&&o(!1),[o]);const w=h.useMemo(()=>({search:g,setSearch:f,selectedIndex:m,setSelectedIndex:p,filteredCommands:u,onSelect:v}),[g,m,u,v,f,p]),b=t.length>0,T=u.length===0;return r.jsx(Zp,{onClose:()=>o(!1),...S,children:r.jsx(uu,{value:w,children:r.jsxs(l.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...Rp[i],...eu[c],...k==null?void 0:k.container,onClick:F=>F.stopPropagation(),children:[r.jsx(Ai,{value:g,onValueChange:f,placeholder:a,views:k==null?void 0:k.searchInput}),r.jsx(l.View,{ref:x,flex:1,overflow:"auto",...k==null?void 0:k.list,children:T?s||r.jsx(Ei,{views:k==null?void 0:k.empty}):b?y.map(F=>r.jsx(Vi,{heading:F.name,views:k==null?void 0:k.groupHeading,children:F.commands.map(W=>{const j=u.findIndex($=>$.id===W.id);return r.jsx(rn,{item:W,selected:j===m,onSelect:()=>v(W),"data-index":j,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}},W.id)})},F.id)):u.map((F,W)=>r.jsx(rn,{item:F,selected:W===m,onSelect:()=>v(F),"data-index":W,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}},F.id))}),d&&r.jsx(l.View,{...mu,...k==null?void 0:k.footer,children:d})]})})})},Ho=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:a,size:i="md",variant:c="default",filter:s,emptyState:d,footer:g,views:f,...m})=>{const{search:p,setSearch:u,selectedIndex:y,setSelectedIndex:x,filteredCommands:k,filteredGroups:C,listRef:S}=Qp({open:e,onOpenChange:o,groups:t,commands:n,filter:s});return r.jsx(bu,{open:e,onOpenChange:o,groups:t,commands:n,placeholder:a,size:i,variant:c,emptyState:d,footer:g,search:p,setSearch:u,selectedIndex:y,setSelectedIndex:x,filteredCommands:k,filteredGroups:C,listRef:S,views:f,...m})};Ho.Input=Ai,Ho.List=yu,Ho.Group=Vi,Ho.Item=rn,Ho.Empty=Ei;const Di=()=>Math.random().toString(36).substring(2,11),xu=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:n=!1}={})=>{const[a,i]=h.useState(e),c=h.useRef(null),s=h.useRef(null),d=h.useRef(null),g=h.useRef(null),f=h.useRef(`tooltip-trigger-${Di()}`).current,m=h.useRef(`tooltip-content-${Di()}`).current,p=h.useCallback(()=>{n||(g.current&&(clearTimeout(g.current),g.current=null),!a&&!d.current&&(d.current=setTimeout(()=>{i(!0),d.current=null},o)))},[a,o,n]),u=h.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),a&&!g.current&&(g.current=setTimeout(()=>{i(!1),g.current=null},t))},[a,t]),y=h.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null)},[]);return h.useEffect(()=>()=>{d.current&&clearTimeout(d.current),g.current&&clearTimeout(g.current)},[]),h.useEffect(()=>{if(typeof(document==null?void 0:document.addEventListener)!="function")return;const x=k=>{k.key==="Escape"&&a&&i(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[a]),{isOpen:a,openTooltip:p,closeTooltip:u,cancelCloseTimer:y,triggerRef:c,contentRef:s,triggerId:f,contentId:m}},ku={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},Cu=(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"}}))(),wu=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}},$i=h.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),tn=()=>h.useContext($i),Su=({value:e,children:o})=>r.jsx($i.Provider,{value:e,children:o}),Li=h.memo(({children:e,views:o,asChild:t=!1,...n})=>{const{openTooltip:a,closeTooltip:i,triggerRef:c,contentId:s,triggerId:d}=tn(),g=h.useCallback(()=>a(),[a]),f=h.useCallback(()=>i(),[i]),m=h.useCallback(()=>a(),[a]),p=h.useCallback(()=>i(),[i]),u={ref:c,onMouseEnter:g,onMouseLeave:f,onFocus:m,onBlur:p,id:d,"aria-describedby":s,...o==null?void 0:o.container,...n};return t&&h.isValidElement(e)?h.cloneElement(e,u):r.jsx(l.View,{display:"inline-block",...u,children:e})}),vu=h.memo(({children:e,views:o,...t})=>{const{isOpen:n,contentRef:a,contentId:i,triggerId:c}=tn();return n?r.jsx(l.View,{ref:a,id:i,role:"tooltip","aria-labelledby":c,...o==null?void 0:o.container,...t,children:e}):null}),Tu=({content:e,children:o,position:t="top",align:n="center",size:a="md",variant:i="default",showArrow:c=!0,views:s,themeMode:d,...g})=>{const{isOpen:f,triggerRef:m,contentRef:p,contentId:u,triggerId:y}=tn(),{ref:x,relation:k}=l.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[C,S]=h.useState({x:0,y:0,placement:t});h.useEffect(()=>{m!=null&&m.current&&x&&(x.current=m.current)},[m,x,f]),h.useEffect(()=>{if(f&&(p!=null&&p.current)&&(m!=null&&m.current)){const b=m.current.getBoundingClientRect();let T=t;k&&(t==="top"&&k.space.vertical==="bottom"?T="bottom":t==="bottom"&&k.space.vertical==="top"?T="top":t==="right"&&k.space.horizontal==="left"?T="left":t==="left"&&k.space.horizontal==="right"&&(T="right"));let F=0,W=0;switch(T){case"top":F=n==="start"?b.left:n==="end"?b.right-120:b.left+b.width/2-60,W=b.top-8;break;case"bottom":F=n==="start"?b.left:n==="end"?b.right-120:b.left+b.width/2-60,W=b.bottom+8;break;case"right":F=b.right+8,W=n==="start"?b.top:n==="end"?b.bottom-32:b.top+b.height/2-16;break;case"left":F=b.left-8,W=n==="start"?b.top:n==="end"?b.bottom-32:b.top+b.height/2-16;break}S({x:F,y:W,placement:T})}},[f,t,n,m,p,k]);const v=h.useMemo(()=>c?wu(C.placement):{},[c,C.placement]),w=h.useMemo(()=>{const b={position:"fixed",left:C.x,top:C.y,zIndex:1e3};switch(C.placement){case"top":return{...b,transform:"translateY(-100%)"};case"left":return{...b,transform:"translateX(-100%)"};case"bottom":case"right":default:return b}},[C.x,C.y,C.placement]);return r.jsxs(l.View,{position:"relative",display:"inline-block",...s==null?void 0:s.container,...g,children:[r.jsx(Li,{children:o}),f&&r.jsxs(l.View,{ref:p,id:u,role:"tooltip","aria-labelledby":y,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:w,...ku[a],...Cu[i],...s==null?void 0:s.content,children:[typeof e=="string"?r.jsx(l.Text,{...s==null?void 0:s.text,children:e}):e,c&&r.jsx(l.View,{...v,...s==null?void 0:s.arrow})]})]})},qr=({content:e,children:o,position:t="top",align:n="center",size:a="md",variant:i="default",openDelay:c=200,closeDelay:s=200,showArrow:d=!0,defaultOpen:g=!1,isDisabled:f=!1,views:m,...p})=>{const u=xu({defaultOpen:g,openDelay:c,closeDelay:s,isDisabled:f});return r.jsx(Su,{value:u,children:r.jsx(Tu,{content:e,position:t,align:n,size:a,variant:i,showArrow:d,views:m,...p,children:o})})};qr.Trigger=Li,qr.Content=vu;const Bi=h.forwardRef((e,o)=>{const t=ll(e);return r.jsx(hl,{...e,...t})});Bi.displayName="ChatInput";const Iu={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},_i={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%"}},nn={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}},an={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}},Fu=h.createContext({}),zu=({children:e,showRadialGradient:o=!0,views:t,themeMode:n,...a})=>{const i={white:"rgba(255,255,255,1)",transparent:"rgba(255,255,255,0)"},c=["rgb(59, 130, 246)","rgb(196, 181, 253)","rgb(147, 197, 253)","rgb(221, 214, 254)","rgb(96, 165, 250)"],s={..._i.gradient,backgroundImage:`
|