1import{c as Oe,r as n,j as e,d as U,f as Tt,g as It,h as Be,u as O,i as Pt,P as _,k as I,l as q,m as Ve,n as Rt,o as Et,R as _t,F as Mt,D as kt,C as At,p as Ee,q as Lt,V as Dt,s as Ot,t as Me,v as Bt,w as Vt,x as Ht,S as Wt,a as Ft,e as Ut,M as Kt,b as zt,y as $t,B as Gt,z as ye}from"./index-B2wrSxfc.js";import{I as ie}from"./input-DyFncjo7.js";import{o as Yt,s as G,L as qt}from"./label-fR-yehFa.js";import{u as Xt,C as He}from"./index-DryfrtoC.js";import{C as Zt}from"./check-ONwBfSDd.js";import{s as Jt}from"./client-CCqjQxUl.js";import{S as We}from"./send-DdpNxIA9.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Qt=Oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const eo=Oe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Fe=n.forwardRef(({className:o,...r},t)=>e.jsx("textarea",{className:U("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
11ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",o),ref:t,...r}));Fe.displayName="Textarea";function ke(o,[r,t]){return Math.min(t,Math.max(r,o))}function to(o){const r=n.useRef({value:o,previous:o});return n.useMemo(()=>(r.current.value!==o&&(r.current.previous=r.current.value,r.current.value=o),r.current.previous),[o])}var oo=[" ","Enter","ArrowUp","ArrowDown"],ro=[" ","Enter"],te="Select",[me,pe,no]=Tt(te),[ne,Ko]=It(te,[no,Be]),he=Be(),[ao,X]=ne(te),[so,io]=ne(te),Ue=o=>{const{__scopeSelect:r,children:t,open:s,defaultOpen:i,onOpenChange:m,value:d,defaultValue:l,onValueChange:a,dir:p,name:c,autoComplete:g,disabled:y,required:j,form:S}=o,u=he(r),[v,N]=n.useState(null),[h,x]=n.useState(null),[M,k]=n.useState(!1),ae=Xt(p),[P,L]=Me({prop:s,defaultProp:i??!1,onChange:m,caller:te}),[K,J]=Me({prop:d,defaultProp:l,onChange:a,caller:te}),B=n.useRef(null),V=v?S||!!v.closest("form"):!0,[z,H]=n.useState(new Set),W=Array.from(z).map(R=>R.props.value).join(";");return e.jsx(Bt,{...u,children:e.jsxs(ao,{required:j,scope:r,trigger:v,onTriggerChange:N,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:M,onValueNodeHasChildrenChange:k,contentId:Ee(),value:K,onValueChange:J,open:P,onOpenChange:L,dir:ae,triggerPointerDownPosRef:B,disabled:y,children:[e.jsx(me.Provider,{scope:r,children:e.jsx(so,{scope:o.__scopeSelect,onNativeOptionAdd:n.useCallback(R=>{H(D=>new Set(D).add(R))},[]),onNativeOptionRemove:n.useCallback(R=>{H(D=>{const F=new Set(D);return F.delete(R),F})},[]),children:t})}),V?e.jsxs(pt,{"aria-hidden":!0,required:j,tabIndex:-1,name:c,autoComplete:g,value:K,onChange:R=>J(R.target.value),disabled:y,form:S,children:[K===void 0?e.jsx("option",{value:""}):null,Array.from(z)]},W):null]})})};Ue.displayName=te;var Ke="SelectTrigger",ze=n.forwardRef((o,r)=>{const{__scopeSelect:t,disabled:s=!1,...i}=o,m=he(t),d=X(Ke,t),l=d.disabled||s,a=O(r,d.onTriggerChange),p=pe(t),c=n.useRef("touch"),[g,y,j]=ft(u=>{const v=p().filter(x=>!x.disabled),N=v.find(x=>x.value===d.value),h=gt(v,u,N);h!==void 0&&d.onValueChange(h.value)}),S=u=>{l||(d.onOpenChange(!0),j()),u&&(d.triggerPointerDownPosRef.current={x:Math.round(u.pageX),y:Math.round(u.pageY)})};return e.jsx(Pt,{asChild:!0,...m,children:e.jsx(_.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":ht(d.value)?"":void 0,...i,ref:a,onClick:I(i.onClick,u=>{u.currentTarget.focus(),c.current!=="mouse"&&S(u)}),onPointerDown:I(i.onPointerDown,u=>{c.current=u.pointerType;const v=u.target;v.hasPointerCapture(u.pointerId)&&v.releasePointerCapture(u.pointerId),u.button===0&&u.ctrlKey===!1&&u.pointerType==="mouse"&&(S(u),u.preventDefault())}),onKeyDown:I(i.onKeyDown,u=>{const v=g.current!=="";!(u.ctrlKey||u.altKey||u.metaKey)&&u.key.length===1&&y(u.key),!(v&&u.key===" ")&&oo.includes(u.key)&&(S(),u.preventDefault())})})})});ze.displayName=Ke;var $e="SelectValue",Ge=n.forwardRef((o,r)=>{const{__scopeSelect:t,className:s,style:i,children:m,placeholder:d="",...l}=o,a=X($e,t),{onValueNodeHasChildrenChange:p}=a,c=m!==void 0,g=O(r,a.onValueNodeChange);return q(()=>{p(c)},[p,c]),e.jsx(_.span,{...l,ref:g,style:{pointerEvents:"none"},children:ht(a.value)?e.jsx(e.Fragment,{children:d}):m})});Ge.displayName=$e;var lo="SelectIcon",Ye=n.forwardRef((o,r)=>{const{__scopeSelect:t,children:s,...i}=o;return e.jsx(_.span,{"aria-hidden":!0,...i,ref:r,children:s||"â¼"})});Ye.displayName=lo;var co="SelectPortal",qe=o=>e.jsx(Vt,{asChild:!0,...o});qe.displayName=co;var oe="SelectContent",Xe=n.forwardRef((o,r)=>{const t=X(oe,o.__scopeSelect),[s,i]=n.useState();if(q(()=>{i(new DocumentFragment)},[]),!t.open){const m=s;return m?Ve.createPortal(e.jsx(Ze,{scope:o.__scopeSelect,children:e.jsx(me.Slot,{scope:o.__scopeSelect,children:e.jsx("div",{children:o.children})})}),m):null}return e.jsx(Je,{...o,ref:r})});Xe.displayName=oe;var A=10,[Ze,Z]=ne(oe),uo="SelectContentImpl",mo=Ht("SelectContent.RemoveScroll"),Je=n.forwardRef((o,r)=>{const{__scopeSelect:t,position:s="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:m,onPointerDownOutside:d,side:l,sideOffset:a,align:p,alignOffset:c,arrowPadding:g,collisionBoundary:y,collisionPadding:j,sticky:S,hideWhenDetached:u,avoidCollisions:v,...N}=o,h=X(oe,t),[x,M]=n.useState(null),[k,ae]=n.useState(null),P=O(r,f=>M(f)),[L,K]=n.useState(null),[J,B]=n.useState(null),V=pe(t),[z,H]=n.useState(!1),W=n.useRef(!1);n.useEffect(()=>{if(x)return Rt(x)},[x]),Et();const R=n.useCallback(f=>{const[T,...E]=V().map(b=>b.ref.current),[C]=E.slice(-1),w=document.activeElement;for(const b of f)if(b===w||(b==null||b.scrollIntoView({block:"nearest"}),b===T&&k&&(k.scrollTop=0),b===C&&k&&(k.scrollTop=k.scrollHeight),b==null||b.focu
vendor: 13,615 bytes, line 11
11s(),document.activeElement!==w))return},[V,k]),D=n.useCallback(()=>R([L,x]),[R,L,x]);n.useEffect(()=>{z&&D()},[z,D]);const{onOpenChange:F,triggerPointerDownPosRef:$}=h;n.useEffect(()=>{if(x){let f={x:0,y:0};const T=C=>{var w,b;f={x:Math.abs(Math.round(C.pageX)-(((w=$.current)==null?void 0:w.x)??0)),y:Math.abs(Math.round(C.pageY)-(((b=$.current)==null?void 0:b.y)??0))}},E=C=>{f.x<=10&&f.y<=10?C.preventDefault():x.contains(C.target)||F(!1),document.removeEventListener("pointermove",T),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",E,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",E,{capture:!0})}}},[x,F,$]),n.useEffect(()=>{const f=()=>F(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[F]);const[fe,ce]=ft(f=>{const T=V().filter(w=>!w.disabled),E=T.find(w=>w.ref.current===document.activeElement),C=gt(T,f,E);C&&setTimeout(()=>C.ref.current.focus())}),ge=n.useCallback((f,T,E)=>{const C=!W.current&&!E;(h.value!==void 0&&h.value===T||C)&&(K(f),C&&(W.current=!0))},[h.value]),xe=n.useCallback(()=>x==null?void 0:x.focus(),[x]),re=n.useCallback((f,T,E)=>{const C=!W.current&&!E;(h.value!==void 0&&h.value===T||C)&&B(f)},[h.value]),de=s==="popper"?Se:Qe,se=de===Se?{side:l,sideOffset:a,align:p,alignOffset:c,arrowPadding:g,collisionBoundary:y,collisionPadding:j,sticky:S,hideWhenDetached:u,avoidCollisions:v}:{};return e.jsx(Ze,{scope:t,content:x,viewport:k,onViewportChange:ae,itemRefCallback:ge,selectedItem:L,onItemLeave:xe,itemTextRefCallback:re,focusSelectedItem:D,selectedItemText:J,position:s,isPositioned:z,searchRef:fe,children:e.jsx(_t,{as:mo,allowPinchZoom:!0,children:e.jsx(Mt,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:I(i,f=>{var T;(T=h.trigger)==null||T.focus({preventScroll:!0}),f.preventDefault()}),children:e.jsx(kt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:m,onPointerDownOutside:d,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:e.jsx(de,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...N,...se,onPlaced:()=>H(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:I(N.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ce(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let C=V().filter(w=>!w.disabled).map(w=>w.ref.current);if(["ArrowUp","End"].includes(f.key)&&(C=C.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const w=f.target,b=C.indexOf(w);C=C.slice(b+1)}setTimeout(()=>R(C)),f.preventDefault()}})})})})})})});Je.displayName=uo;var po="SelectItemAlignedPosition",Qe=n.forwardRef((o,r)=>{const{__scopeSelect:t,onPlaced:s,...i}=o,m=X(oe,t),d=Z(oe,t),[l,a]=n.useState(null),[p,c]=n.useState(null),g=O(r,P=>c(P)),y=pe(t),j=n.useRef(!1),S=n.useRef(!0),{viewport:u,selectedItem:v,selectedItemText:N,focusSelectedItem:h}=d,x=n.useCallback(()=>{if(m.trigger&&m.valueNode&&l&&p&&u&&v&&N){const P=m.trigger.getBoundingClientRect(),L=p.getBoundingClientRect(),K=m.valueNode.getBoundingClientRect(),J=N.getBoundingClientRect();if(m.dir!=="rtl"){const w=J.left-L.left,b=K.left-w,Q=P.left-b,ee=P.width+Q,ve=Math.max(ee,L.width),we=window.innerWidth-A,be=ke(b,[A,Math.max(A,we-ve)]);l.style.minWidth=ee+"px",l.style.left=be+"px"}else{const w=L.right-J.right,b=window.innerWidth-K.right-w,Q=window.innerWidth-P.right-b,ee=P.width+Q,ve=Math.max(ee,L.width),we=window.innerWidth-A,be=ke(b,[A,Math.max(A,we-ve)]);l.style.minWidth=ee+"px",l.style.right=be+"px"}const B=y(),V=window.innerHeight-A*2,z=u.scrollHeight,H=window.getComputedStyle(p),W=parseInt(H.borderTopWidth,10),R=parseInt(H.paddingTop,10),D=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),$=W+R+z+F+D,fe=Math.min(v.offsetHeight*5,$),ce=window.getComputedStyle(u),ge=parseInt(ce.paddingTop,10),xe=parseInt(ce.paddingBottom,10),re=P.top+P.height/2-A,de=V-re,se=v.offsetHeight/2,f=v.offsetTop+se,T=W+R+f,E=$-T;if(T<=re){const w=B.length>0&&v===B[B.length-1].ref.current;l.style.bottom="0px";const b=p.clientHeight-u.offsetTop-u.offsetHeight,Q=Math.max(de,se+(w?xe:0)+b+D),ee=T+Q;l.style.height=ee+"px"}else{const w=B.length>0&&v===B[0].ref.current;l.style.top="0px";const Q=Math.max(re,W+u.offsetTop+(w?ge:0)+se)+E;l.style.height=Q+"px",u.scrollTop=T-re+u.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=V+"px",s==null||s(),requestAnimationFrame(()=>j.current=!0)}},[y,m.trigger,m.valueNode,l,p,u,v,N,m.dir,s]);q(()=>x(),[x]);const[M,k]=n.useState();q(()=>{p&&k(window.getComputedStyle(p).zIndex)},[p]);const ae=n.useCallback(P=>{P&&S.current===!0&&(x(),h==null||h(),S.current=!1)},[x,h]);return e.jsx(fo,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:j,onScrollButtonChange:ae,children:e.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:e.jsx(_.div,{...i,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Qe.displayName=po;var ho="SelectPopperPosition",Se=n.forwardRef((o,r)=>{const{__scopeSelect:t,align:s="start",collisionPadding:i=A,...m}=o,d=he(t);return e.jsx(At,{...d,...m,ref:r,align:s,collisionPadding:i,style:{boxSizing:"border-box",...m.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=ho;var[fo,_e]=ne(oe,{}),Ne="SelectViewport",et=n.forwardRef((o,r)=>{const{__scopeSelect:t,nonce:s,...i}=o,m=Z(Ne,t),d=_e(Ne,t),l=O(r,m.onViewportChange),a=n.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(me.Slot,{scope:t,children:e.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:I(i.onScroll,p=>{const c=p.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:y}=d;if(y!=null&&y.current&&g){const j=Math.abs(a.current-c.scrollTop);if(j>0){const S=window.innerHeight-A*2,u=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),N=Math.max(u,v);if(N<S){const h=N+j,x=Math.min(S,h),M=h-x;g.style.height=x+"px",g.style.bottom==="0px"&&(c.scrollTop=M>0?M:0,g.style.justifyContent="flex-end")}}}a.current=c.scrollTop})})})]})});et.displayName=Ne;var tt="SelectGroup",[go,xo]=ne(tt),vo=n.forwardRef((o,r)=>{const{__scopeSelect:t,...s}=o,i=Ee();return e.jsx(go,{scope:t,id:i,children:e.jsx(_.div,{role:"group","aria-labelledby":i,...s,ref:r})})});vo.displayName=tt;var ot="SelectLabel",rt=n.forwardRef((o,r)=>{const{__scopeSelect:t,...s}=o,i=xo(ot,t);return e.jsx(_.div,{id:i.id,...s,ref:r})});rt.displayName=ot;var ue="SelectItem",[wo,nt]=ne(ue),at=n.forwardRef((o,r)=>{const{__scopeSelect:t,value:s,disabled:i=!1,textValue:m,...d}=o,l=X(ue,t),a=Z(ue,t),p=l.value===s,[c,g]=n.useState(m??""),[y,j]=n.useState(!1),S=O(r,h=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,h,s,i)}),u=Ee(),v=n.useRef("touch"),N=()=>{i||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(wo,{scope:t,value:s,disabled:i,textId:u,isSelected:p,onItemTextChange:n.useCallback(h=>{g(x=>x||((h==null?void 0:h.textContent)??"").trim())},[]),children:e.jsx(me.ItemSlot,{scope:t,value:s,disabled:i,textValue:c,children:e.jsx(_.div,{role:"option","aria-labelledby":u,"data-highlighted":y?"":void 0,"aria-selected":p&&y,"data-state":p?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...d,ref:S,onFocus:I(d.onFocus,()=>j(!0)),onBlur:I(d.onBlur,()=>j(!1)),onClick:I(d.onClick,()=>{v.current!=="mouse"&&N()}),onPointerUp:I(d.onPointerUp,()=>{v.current==="mouse"&&N()}),onPointerDown:I(d.onPointerDown,h=>{v.current=h.pointerType}),onPointerMove:I(d.onPointerMove,h=>{var x;v.current=h.pointerType,i?(x=a.onItemLeave)==null||x.call(a):v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:I(d.onPointerLeave,h=>{var x;h.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:I(d.onKeyDown,h=>{var M;((M=a.searchRef)==null?void 0:M.current)!==""&&h.key===" "||(ro.includes(h.key)&&N(),h.key===" "&&h.preventDefault())})})})})});at.displayName=ue;var le="SelectItemText",st=n.forwardRef((o,r)=>{const{__scopeSelect:t,className:s,style:i,...m}=o,d=X(le,t),l=Z(le,t),a=nt(le,t),p=io(le,t),[c,g]=n.useState(null),y=O(r,N=>g(N),a.onItemTextChange,N=>{var h;return(h=l.itemTextRefCallback)==null?void 0:h.call(l,N,a.value,a.disabled)}),j=c==null?void 0:c.textContent,S=n.useMemo(()=>e.jsx("option",{value:a.value,disabled:a.disabled,children:j},a.value),[a.disabled,a.value,j]),{onNativeOptionAdd:u,onNativeOptionRemove:v}=p;return q(()=>(u(S),()=>v(S)),[u,v,S]),e.jsxs(e.Fragment,{children:[e.jsx(_.span,{id:a.textId,...m,ref:y}),a.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Ve.createPortal(m.children,d.valueNode):null]})});st.displayName=le;var it="SelectItemIndicator",lt=n.forwardRef((o,r)=>{const{__scopeSelect:t,...s}=o;return nt(it,t).isSelected?e.jsx(_.span,{"aria-hidden":!0,...s,ref:r}):null});lt.displayName=it;var Ce="SelectScrollUpButton",ct=n.forwardRef((o,r)=>{const t=Z(Ce,o.__scopeSelect),s=_e(Ce,o.__scopeSelect),[i,m]=n.useState(!1),d=O(r,s.onScrollButtonChange);return q(()=>{if(t.viewport&&t.isPositioned){let l=function(){const p=a.scrollTop>0;m(p)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),i?e.jsx(ut,{...o,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});ct.displayName=Ce;var je="SelectScrollDownButton",dt=n.forwardRef((o,r)=>{const t=Z(je,o.__scopeSelect),s=_e(je,o.__scopeSelect),[i,m]=n.useState(!1),d=O(r,s.onScrollButtonChange);return q(()=>{if(t.viewport&&t.isPositioned){let l=function(){const p=a.scrollHeight-a.clientHeight,c=Math.ceil(a.scrollTop)<p;m(c)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),i?e.jsx(ut,{...o,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});dt.displayName=je;var ut=n.forwardRef((o,r)=>{const{__scopeSelect:t,onAutoScroll:s,...i}=o,m=Z("SelectScrollButton",t),d=n.useRef(null),l=pe(t),a=n.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return n.useEffect(()=>()=>a(),[a]),q(()=>{var c;const p=l().find(g=>g.ref.current===document.activeElement);(c=p==null?void 0:p.ref.current)==null||c.scrollIntoView({block:"nearest"})},[l]),e.jsx(_.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:I(i.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(s,50))}),onPointerMove:I(i.onPointerMove,()=>{var p;(p=m.onItemLeave)==null||p.call(m),d.current===null&&(d.current=window.setInterval(s,50))}),onPointerLeave:I(i.onPointerLeave,()=>{a()})})}),bo="SelectSeparator",mt=n.forwardRef((o,r)=>{const{__scopeSelect:t,...s}=o;return e.jsx(_.div,{"aria-hidden":!0,...s,ref:r})});mt.displayName=bo;var Te="SelectArrow",yo=n.forwardRef((o,r)=>{const{__scopeSelect:t,...s}=o,i=he(t),m=X(Te,t),d=Z(Te,t);return m.open&&d.position==="popper"?e.jsx(Lt,{...i,...s,ref:r}):null});yo.displayName=Te;var So="SelectBubbleInput",pt=n.forwardRef(({__scopeSelect:o,value:r,...t},s)=>{const i=n.useRef(null),m=O(s,i),d=to(r);return n.useEffect(()=>{const l=i.current;if(!l)return;const a=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(d!==r&&c){const g=new Event("change",{bubbles:!0});c.call(l,r),l.dispatchEvent(g)}},[d,r]),e.jsx(_.select,{...t,style:{...Dt,...t.style},ref:m,defaultValue:r})});pt.displayName=So;function ht(o){return o===""||o===void 0}function ft(o){const r=Ot(o),t=n.useRef(""),s=n.useRef(0),i=n.useCallback(d=>{const l=t.current+d;r(l),function a(p){t.current=p,window.clearTimeout(s.current),p!==""&&(s.current=window.setTimeout(()=>a(""),1e3))}(l)},[r]),m=n.useCallback(()=>{t.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[t,i,m]}function gt(o,r,t){const i=r.length>1&&Array.from(r).every(p=>p===r[0])?r[0]:r,m=t?o.indexOf(t):-1;let d=No(o,Math.max(m,0));i.length===1&&(d=d.filter(p=>p!==t));const a=d.find(p=>p.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==t?a:void 0}function No(o,r){return o.map((t,s)=>o[(r+s)%o.length])}var Co=Ue,xt=ze,jo=Ge,To=Ye,Io=qe,vt=Xe,Po=et,wt=rt,bt=at,Ro=st,Eo=lt,yt=ct,St=dt,Nt=mt;const Ae=Co,Le=jo,Ie=n.forwardRef(({className:o,children:r,...t},s)=>e.jsxs(xt,{ref:s,className:U("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
11ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",o),...t,children:[r,e.jsx(To,{asChild:!0,children:e.jsx(He,{className:"h-4 w-4 opacity-50"})})]}));Ie.displayName=xt.displayName;const Ct=n.forwardRef(({className:o,...r},t)=>e.jsx(yt,{ref:t,className:U("flex cursor-default items-center justify-center py-1",o),...r,children:e.jsx(Qt,{className:"h-4 w-4"})}));Ct.displayName=yt.displayName;const jt=n.forwardRef(({className:o,...r},t)=>e.jsx(St,{ref:t,className:U("flex cursor-default items-center justify-center py-1",o),...r,children:e.jsx(He,{className:"h-4 w-4"})}));jt.displayName=St.displayName;const Pe=n.forwardRef(({className:o,children:r,position:t="popper",...s},i)=>e.jsx(Io,{children:e.jsxs(vt,{ref:i,className:U("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o),position:t,...s,children:[e.jsx(Ct,{}),e.jsx(Po,{className:U("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),e.jsx(jt,{})]})}));Pe.displayName=vt.displayName;const _o=n.forwardRef(({className:o,...r},t)=>e.jsx(wt,{ref:t,className:U("py-1.5 pl-8 pr-2 text-sm font-semibold",o),...r}));_o.displayName=wt.displayName;const Re=n.forwardRef(({className:o,children:r,...t},s)=>e.jsxs(bt,{ref:s,className:U("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",o),...t,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Eo,{children:e.jsx(Zt,{className:"h-4 w-4"})})}),e.jsx(Ro,{children:r})]}));Re.displayName=bt.displayName;const Mo=n.forwardRef(({className:o,...r},t)=>e.jsx(Nt,{ref:t,className:U("-mx-1 my-1 h-px bg-muted",o),...r}));Mo.displayName=Nt.displayName;const ko=Yt({companyName:G().trim().min(2,{message:"Company name must be at least 2 characters"}).max(100,{message:"Company name must be less than 100 characters"}),brandName:G().trim().min(1,{message:"Brand name is required"}).max(100,{message:"Brand name must be less than 100 characters"}),website:G().trim().url({message:"Enter a valid URL (https://â¦)"}).max(255,{message:"URL must be less than 255 characters"}),category:G().min(1,{message:"Please choose a category"}).max(60),contactName:G().trim().min(2,{message:"Your name is required"}).max(100),email:G().trim().email({message:"Enter a valid email address"}).max(255),monthlyVisitors:G().min(1,{message:"Select an audience size"}),description:G().trim().min(20,{message:"Tell us a bit more (min 20 characters)"}).max(1e3,{message:"Keep it under 1000 characters"})}),De={companyName:"",brandName:"",website:"",category:"",contactName:"",email:"",monthlyVisitors:"",description:""},Ao=["E-commerce","Finance & Insurance","SaaS / Software","Travel & Hospitality","Health & Wellness","Education","Media & Entertainment","Other"],Lo=["Under 10K / month","10K â 100K / month","100K â 1M / month","1M â 10M / month","10M+ / month"],Do=[{icon:$t,title:"AI-matched offers",body:"Your brand surfaces only when a real high-intent power user is ready to act."},{icon:Gt,title:"Built for performance",body:"Pay for outcomes â meaningful conversions and retention, not impressions."},{icon:We,title:"Live in days",body:"Our team onboards your brand and integrates the AI agents in under a week."}],zo=()=>{const[o,r]=n.useState(De),[t,s]=n.useState({}),[i,m]=n.useState(!1),[d,l]=n.useState(!1),a=(c,g)=>{r(y=>({...y,[c]:g})),t[c]&&s(y=>({...y,[c]:void 0}))},p=async c=>{c.preventDefault();const g=ko.safeParse(o);if(!g.success){const j={};for(const S of g.error.issues){const u=S.path[0];j[u]||(j[u]=S.message)}s(j),ye({title:"Please review the form",description:"Some fields need your attention.",variant:"destructive"});return}m(!0);const{error:y}=await Jt.from("brand_submissions").insert({company_name:g.data.companyName,brand_name:g.data.brandName,website:g.data.website,category:g.data.category,contact_name:g.data.contactName,email:g.data.email,monthly_visitors:g.data.monthlyVisitors,description:g.data.description});if(m(!1),y){ye({title:"Submission failed",description:"Please try again, or email us at [email protected].",variant:"destructive"});return}l(!0),ye({title:"Brand submitted â¨",description:"We'll be in touch within 1â2 business days."})};return e.jsxs("div",{className:"relative min-h-screen overflow-hidden bg-background",children:[e.jsx(Wt,{title:"Add your Brand â SpreadTheMagic.ai",de
11scription:"List your brand on SpreadTheMagic.ai and get matched with high-intent power users at the exact moment they're ready to buy. Performance-based, live in days.",path:"/add",jsonLd:{"@context":"https://schema.org","@type":"WebPage",name:"Add your Brand to SpreadTheMagic.ai",url:"https://spreadthemagic.ai/add",description:"Submit your brand to be matched with high-intent power users via SpreadTheMagic.ai's AI engine.",potentialAction:{"@type":"RegisterAction",target:"https://spreadthemagic.ai/add",name:"Submit your brand"}}}),e.jsx("div",{"aria-hidden":!0,className:"glow-orb h-[480px] w-[480px] -top-32 left-1/2 -translate-x-1/2 bg-magic-purple/40"}),e.jsx("div",{"aria-hidden":!0,className:"glow-orb h-[400px] w-[400px] top-[40vh] -left-40 bg-magic-blue/30"}),e.jsx("div",{"aria-hidden":!0,className:"glow-orb h-[420px] w-[420px] top-[80vh] -right-40 bg-magic-pink/30"}),e.jsx(Ft,{}),e.jsxs("main",{className:"relative z-10",children:[e.jsxs("section",{className:"container px-4 pt-12 pb-16 md:pt-16",children:[e.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[e.jsxs("div",{className:"relative mx-auto w-fit",children:[e.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 -z-10 animate-pulse-glow rounded-full bg-magic-gold/20 blur-3xl"}),e.jsx("img",{src:Ut,alt:"SpreadTheMagic.ai emblem",width:1024,height:1024,className:"h-32 w-32 animate-float-slow object-contain md:h-40 md:w-40"})]}),e.jsxs("h1",{className:"mt-6 font-display text-4xl font-black leading-[1.05] tracking-tight md:text-6xl",children:["Add your"," ",e.jsx("span",{className:"text-gradient-magic",children:"Brand"})]}),e.jsx("p",{className:"mx-auto mt-6 max-w-2xl text-lg text-muted-foreground md:text-xl",children:"Get in front of high-intent power users at the exact moment they're ready to convert. Tell us about your brand and our team will reach out to onboard you."})]}),e.jsx("div",{className:"mx-auto mt-12 grid max-w-5xl gap-4 sm:grid-cols-3",children:Do.map(c=>{const g=c.icon;return e.jsxs("div",{className:"gradient-border rounded-2xl bg-card/40 p-5 backdrop-blur",children:[e.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-cta shadow-[var(--shadow-cta)]",children:e.jsx(g,{className:"h-5 w-5 text-white",strokeWidth:2.25})}),e.jsx("h2",{className:"font-display text-lg font-bold text-foreground",children:c.title}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:c.body})]},c.title)})})]}),e.jsx("section",{className:"container px-4 pb-24",children:e.jsxs("div",{className:"mx-auto max-w-3xl",children:[d?e.jsxs("div",{className:"gradient-border relative overflow-hidden rounded-3xl bg-card/50 p-10 text-center backdrop-blur",children:[e.jsx("div",{className:"mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-cta shadow-[var(--shadow-cta)]",children:e.jsx(eo,{className:"h-8 w-8 text-white"})}),e.jsx("h2",{className:"font-display text-3xl font-black md:text-4xl",children:e.jsx("span",{className:"text-gradient-magic",children:"Magic in motion"})}),e.jsxs("p",{className:"mx-auto mt-4 max-w-xl text-lg text-muted-foreground",children:["Thanks, ",e.jsx("strong",{className:"text-foreground",children:o.contactName}),"! We received ",e.jsx("strong",{className:"text-foreground",children:o.brandName})," ","and will reach out to"," ",e.jsx("strong",{className:"text-foreground",children:o.email})," within 1â2 business days."]}),e.jsx("button",{onClick:()=>{r(De),l(!1)},className:"mt-8 text-sm font-semibold text-magic-pink underline-offset-4 hover:underline",children:"Submit another brand"})]}):e.jsxs("form",{onSubmit:p,noValidate:!0,className:"gradient-border relative overflow-hidden rounded-3xl bg-card/50 p-6 backdrop-blur md:p-10",children:[e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsx(Y,{label:"Company name",id:"companyName",error:t.companyName,children:e.jsx(ie,{id:"companyName",value:o.companyName,onChange:c=>a("companyName",c.target.value),placeholder:"Acme Inc.",maxLength:100,autoComplete:"organization"})}),e.jsx(Y,{label:"Brand name",id:"brandName",error:t.brandName,children:e.jsx(ie,{id:"brandName",value:o.brandName,onChange:c=>a("brandName",c.target.value),placeholder:"Acme Pro",maxLength:100})}),e.jsx(Y,{label:"Website",id:"website",error:t.website,className:"md:col-span-2",children:e.jsx(ie,{id:"website",type:"url",inputMode:"url",value:o.website,onChange:c=>a("website",c.target.value),placeholder:"https://acme.com",maxLength:255,autoComplete:"url"})}),e.jsx(Y,{label:"Category",id:"category",error:t.category,children:e.jsxs(Ae,{value:o.category,onValueChange:c=>
11a("category",c),children:[e.jsx(Ie,{id:"category",children:e.jsx(Le,{placeholder:"Choose a category"})}),e.jsx(Pe,{children:Ao.map(c=>e.jsx(Re,{value:c,children:c},c))})]})}),e.jsx(Y,{label:"Monthly audience",id:"monthlyVisitors",error:t.monthlyVisitors,children:e.jsxs(Ae,{value:o.monthlyVisitors,onValueChange:c=>a("monthlyVisitors",c),children:[e.jsx(Ie,{id:"monthlyVisitors",children:e.jsx(Le,{placeholder:"Select an audience size"})}),e.jsx(Pe,{children:Lo.map(c=>e.jsx(Re,{value:c,children:c},c))})]})}),e.jsx(Y,{label:"Your name",id:"contactName",error:t.contactName,children:e.jsx(ie,{id:"contactName",value:o.contactName,onChange:c=>a("contactName",c.target.value),placeholder:"Jane Doe",maxLength:100,autoComplete:"name"})}),e.jsx(Y,{label:"Work email",id:"email",error:t.email,children:e.jsx(ie,{id:"email",type:"email",inputMode:"email",value:o.email,onChange:c=>a("email",c.target.value),placeholder:"[email protected]",maxLength:255,autoComplete:"email"})}),e.jsxs(Y,{label:"Tell us about your brand & ideal customer",id:"description",error:t.description,className:"md:col-span-2",children:[e.jsx(Fe,{id:"description",value:o.description,onChange:c=>a("description",c.target.value),placeholder:"What you sell, who you sell to, and what a great customer looks like for you.",maxLength:1e3,rows:5}),e.jsxs("div",{className:"mt-1 text-right text-xs text-muted-foreground",children:[o.description.length,"/1000"]})]})]}),e.jsxs("button",{type:"submit",disabled:i,className:"group relative mt-8 inline-flex w-full items-center justify-center gap-2 overflow-hidden rounded-full px-8 py-4 text-base font-semibold text-white shadow-[var(--shadow-cta)] transition-smooth hover:-translate-y-0.5 hover:shadow-[0_20px_60px_-10px_hsl(var(--magic-purple)/0.85)] disabled:cursor-not-allowed disabled:opacity-70 md:text-lg",children:[e.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 -z-10 rounded-full bg-[linear-gradient(90deg,hsl(var(--magic-pink)),hsl(var(--magic-purple)),hsl(var(--magic-blue)),hsl(var(--magic-purple)),hsl(var(--magic-pink)))] animate-shimmer"}),e.jsx(We,{className:"h-5 w-5 transition-transform duration-300 group-hover:translate-x-1"}),i?"Sendingâ¦":"Submit your brand"]}),e.jsx("p",{className:"mt-4 text-center text-xs text-muted-foreground",children:"By submitting, you agree to be contacted by the spreadthemagic.ai team about onboarding your brand."})]}),e.jsx("div",{className:"mt-10 text-center",children:e.jsxs("a",{href:"mailto:[email protected]",className:"inline-flex items-center gap-2 text-muted-foreground transition-smooth hover:text-magic-pink",children:[e.jsx(Kt,{className:"h-4 w-4"}),"Prefer email? [email protected]"]})})]})}),e.jsx(zt,{})]})]})},Y=({label:o,id:r,error:t,className:s,children:i})=>e.jsxs("div",{className:s,children:[e.jsx(qt,{htmlFor:r,className:"mb-2 block text-sm font-semibold",children:o}),i,t&&e.jsx("p",{className:"mt-1.5 text-xs text-destructive",role:"alert",children:t})]});export{zo as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.