diff --git a/assets/index-BlvcM4VV.js b/assets/index-DXznYJjM.js similarity index 98% rename from assets/index-BlvcM4VV.js rename to assets/index-DXznYJjM.js index ff9e76b..4f2aa18 100644 --- a/assets/index-BlvcM4VV.js +++ b/assets/index-DXznYJjM.js @@ -43,4 +43,4 @@ Error generating stack: `+i.message+` dompurify/dist/purify.es.mjs: (*! @license DOMPurify 3.0.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.10/LICENSE *) -*/function dy({image:e,setImage:t,setImageUploaded:n,imageUploaded:r}){const o=h.useRef(null),[i,l]=h.useState([]);h.useEffect(()=>{const y=localStorage.getItem("uploadedImage");y&&(t(y),p(y))},[]);const s=y=>{const w=y.target.files[0],E=new FileReader;E.onloadend=()=>{const m=E.result;t(m),localStorage.setItem("uploadedImage",m),p(m)},E.readAsDataURL(w),n(!0),dt.success("Image uploaded successfully",{action:{text:"Close",onClick:()=>{dt.dismiss()}}})},a=y=>{y.preventDefault()},u=y=>{if(y.preventDefault(),!y.dataTransfer.files[0].type.includes("image")){dt.error("File type not supported",{action:{label:"Close",onClick:()=>{dt.dismiss()}}});return}const w=y.dataTransfer.files[0],E=new FileReader;E.onloadend=()=>{const m=E.result;t(m),localStorage.setItem("uploadedImage",m),p(m)},E.readAsDataURL(w),n(!0)},f=()=>{o.current.click()},c=()=>{t(null),l([]),localStorage.removeItem("uploadedImage")};h.useEffect(()=>{c()},[e]);const p=async y=>{try{const w=new Image;w.src=y,w.onload=()=>{const E=document.createElement("canvas");E.width=w.width,E.height=w.height;const m=E.getContext("2d");m.drawImage(w,0,0);const d=m.getImageData(0,0,E.width,E.height),g={};for(let C=0;CT.count-C.count).slice(0,12).map(([C,{r:T,g:N,b:A}])=>({hex:C,r:T,g:N,b:A}));l(S)}}catch(w){console.error("Error extracting colors:",w)}},v=(y,w,E)=>"#"+((1<<24)+(y<<16)+(w<<8)+E).toString(16).slice(1);return k.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-gray-100 dark:bg-gray-900",children:[k.jsx(om,{}),k.jsxs("div",{className:"max-w-4xl w-full p-4",children:[k.jsx("div",{className:"w-full aspect-video bg-gray-200 dark:bg-gray-800 rounded-lg overflow-hidden flex items-center justify-center cursor-pointer",onDragOver:a,onDrop:u,onClick:f,style:{border:r?"none":"3px dashed #ccc"},children:e?k.jsx("img",{src:e,alt:"Uploaded Image",className:"w-full h-full object-contain"}):k.jsx("div",{className:"text-gray-500 dark:text-gray-400 text-lg",children:"Click or Drop an Image to upload it"})}),k.jsx("input",{type:"file",accept:"image/jpeg,image/jpg,image/png,image/webp",ref:o,onChange:s,className:"hidden",limit:"1"})]})]})}function im(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function lm(e,t=[]){let n=[];function r(i,l){const s=h.createContext(l),a=n.length;n=[...n,l];function u(c){const{scope:p,children:v,...y}=c,w=(p==null?void 0:p[e][a])||s,E=h.useMemo(()=>y,Object.values(y));return h.createElement(w.Provider,{value:E},v)}function f(c,p){const v=(p==null?void 0:p[e][a])||s,y=h.useContext(v);if(y)return y;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const o=()=>{const i=n.map(l=>h.createContext(l));return function(s){const a=(s==null?void 0:s[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,fy(o,...t)]}function fy(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const c=a(i)[`__scope${u}`];return{...s,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function sm(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function py({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=my({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,s=sm(n),a=h.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&s(c)}else o(u)},[i,e,o,s]);return[l,a]}function my({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,o=h.useRef(r),i=sm(t);return h.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const hy=h.createContext(void 0);function gy(e){const t=h.useContext(hy);return e||t||"ltr"}function vy(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const yy=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{};function wy(e){const[t,n]=h.useState(void 0);return yy(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,s;if("borderBoxSize"in i){const a=i.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const xy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Tl=xy.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?Do:t;return h.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),h.createElement(s,Ge({},l,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Sy(e){const t=e+"CollectionProvider",[n,r]=lm(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=v=>{const{scope:y,children:w}=v,E=M.useRef(null),m=M.useRef(new Map).current;return M.createElement(o,{scope:y,itemMap:m,collectionRef:E},w)},s=e+"CollectionSlot",a=M.forwardRef((v,y)=>{const{scope:w,children:E}=v,m=i(s,w),d=On(y,m.collectionRef);return M.createElement(Do,{ref:d},E)}),u=e+"CollectionItemSlot",f="data-radix-collection-item",c=M.forwardRef((v,y)=>{const{scope:w,children:E,...m}=v,d=M.useRef(null),g=On(y,d),S=i(u,w);return M.useEffect(()=>(S.itemMap.set(d,{ref:d,...m}),()=>void S.itemMap.delete(d))),M.createElement(Do,{[f]:"",ref:g},E)});function p(v){const y=i(e+"CollectionConsumer",v);return M.useCallback(()=>{const E=y.collectionRef.current;if(!E)return[];const m=Array.from(E.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((S,C)=>m.indexOf(S.ref.current)-m.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:l,Slot:a,ItemSlot:c},p,r]}const am=["PageUp","PageDown"],um=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],cm={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Wo="Slider",[va,Ey,Cy]=Sy(Wo),[dm,Cx]=lm(Wo,[Cy]),[ky,Pl]=dm(Wo),Ny=h.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:f,onValueChange:c=()=>{},onValueCommit:p=()=>{},inverted:v=!1,...y}=e,[w,E]=h.useState(null),m=On(t,P=>E(P)),d=h.useRef(new Set),g=h.useRef(0),S=l==="horizontal",C=w?!!w.closest("form"):!0,T=S?by:Ty,[N=[],A]=py({prop:f,defaultProp:u,onChange:P=>{var R;(R=[...d.current][g.current])===null||R===void 0||R.focus(),c(P)}}),V=h.useRef(N);function D(P){const R=Dy(N,P);Q(P,R)}function Y(P){Q(P,g.current)}function H(){const P=V.current[g.current];N[g.current]!==P&&p(N)}function Q(P,R,{commit:U}={commit:!1}){const j=Fy(i),b=By(Math.round((P-r)/i)*i+r,j),_=im(b,[r,o]);A(($=[])=>{const L=Ly($,_,R);if(jy(L,a*i)){g.current=L.indexOf(_);const z=String(L)!==String($);return z&&U&&p(L),z?L:$}else return $})}return h.createElement(ky,{scope:e.__scopeSlider,disabled:s,min:r,max:o,valueIndexToChangeRef:g,thumbs:d.current,values:N,orientation:l},h.createElement(va.Provider,{scope:e.__scopeSlider},h.createElement(va.Slot,{scope:e.__scopeSlider},h.createElement(T,Ge({"aria-disabled":s,"data-disabled":s?"":void 0},y,{ref:m,onPointerDown:Sr(y.onPointerDown,()=>{s||(V.current=N)}),min:r,max:o,inverted:v,onSlideStart:s?void 0:D,onSlideMove:s?void 0:Y,onSlideEnd:s?void 0:H,onHomeKeyDown:()=>!s&&Q(r,0,{commit:!0}),onEndKeyDown:()=>!s&&Q(o,N.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:R})=>{if(!s){const b=am.includes(P.key)||P.shiftKey&&um.includes(P.key)?10:1,_=g.current,$=N[_],L=i*b*R;Q($+L,_,{commit:!0})}}})))),C&&N.map((P,R)=>h.createElement($y,{key:R,name:n?n+(N.length>1?"[]":""):void 0,value:P})))}),[fm,pm]=dm(Wo,{startEdge:"left",endEdge:"right",size:"width",direction:1}),by=h.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...f}=e,[c,p]=h.useState(null),v=On(t,g=>p(g)),y=h.useRef(),w=gy(o),E=w==="ltr",m=E&&!i||!E&&i;function d(g){const S=y.current||c.getBoundingClientRect(),C=[0,S.width],N=Nu(C,m?[n,r]:[r,n]);return y.current=S,N(g-S.left)}return h.createElement(fm,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width"},h.createElement(mm,Ge({dir:w,"data-orientation":"horizontal"},f,{ref:v,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:g=>{const S=d(g.clientX);l==null||l(S)},onSlideMove:g=>{const S=d(g.clientX);s==null||s(S)},onSlideEnd:()=>{y.current=void 0,a==null||a()},onStepKeyDown:g=>{const C=cm[m?"from-left":"from-right"].includes(g.key);u==null||u({event:g,direction:C?-1:1})}})))}),Ty=h.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,f=h.useRef(null),c=On(t,f),p=h.useRef(),v=!o;function y(w){const E=p.current||f.current.getBoundingClientRect(),m=[0,E.height],g=Nu(m,v?[r,n]:[n,r]);return p.current=E,g(w-E.top)}return h.createElement(fm,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1},h.createElement(mm,Ge({"data-orientation":"vertical"},u,{ref:c,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const E=y(w.clientY);i==null||i(E)},onSlideMove:w=>{const E=y(w.clientY);l==null||l(E)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:w=>{const m=cm[v?"from-bottom":"from-top"].includes(w.key);a==null||a({event:w,direction:m?-1:1})}})))}),mm=h.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,f=Pl(Wo,n);return h.createElement(Tl.span,Ge({},u,{ref:t,onKeyDown:Sr(e.onKeyDown,c=>{c.key==="Home"?(l(c),c.preventDefault()):c.key==="End"?(s(c),c.preventDefault()):am.concat(um).includes(c.key)&&(a(c),c.preventDefault())}),onPointerDown:Sr(e.onPointerDown,c=>{const p=c.target;p.setPointerCapture(c.pointerId),c.preventDefault(),f.thumbs.has(p)?p.focus():r(c)}),onPointerMove:Sr(e.onPointerMove,c=>{c.target.hasPointerCapture(c.pointerId)&&o(c)}),onPointerUp:Sr(e.onPointerUp,c=>{const p=c.target;p.hasPointerCapture(c.pointerId)&&(p.releasePointerCapture(c.pointerId),i(c))})}))}),Py="SliderTrack",Ry=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Pl(Py,n);return h.createElement(Tl.span,Ge({"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation},r,{ref:t}))}),yd="SliderRange",_y=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Pl(yd,n),i=pm(yd,n),l=h.useRef(null),s=On(t,l),a=o.values.length,u=o.values.map(p=>hm(p,o.min,o.max)),f=a>1?Math.min(...u):0,c=100-Math.max(...u);return h.createElement(Tl.span,Ge({"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0},r,{ref:s,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:c+"%"}}))}),wd="SliderThumb",Ay=h.forwardRef((e,t)=>{const n=Ey(e.__scopeSlider),[r,o]=h.useState(null),i=On(t,s=>o(s)),l=h.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return h.createElement(Oy,Ge({},e,{ref:i,index:l}))}),Oy=h.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,...o}=e,i=Pl(wd,n),l=pm(wd,n),[s,a]=h.useState(null),u=On(t,E=>a(E)),f=wy(s),c=i.values[r],p=c===void 0?0:hm(c,i.min,i.max),v=My(r,i.values.length),y=f==null?void 0:f[l.size],w=y?zy(y,p,l.direction):0;return h.useEffect(()=>{if(s)return i.thumbs.add(s),()=>{i.thumbs.delete(s)}},[s,i.thumbs]),h.createElement("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${p}% + ${w}px)`}},h.createElement(va.ItemSlot,{scope:e.__scopeSlider},h.createElement(Tl.span,Ge({role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0},o,{ref:u,style:c===void 0?{display:"none"}:e.style,onFocus:Sr(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})}))))}),$y=e=>{const{value:t,...n}=e,r=h.useRef(null),o=vy(t);return h.useEffect(()=>{const i=r.current,l=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==t&&a){const u=new Event("input",{bubbles:!0});a.call(i,t),i.dispatchEvent(u)}},[o,t]),h.createElement("input",Ge({style:{display:"none"}},n,{ref:r,defaultValue:t}))};function Ly(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function hm(e,t,n){const i=100/(n-t)*(e-t);return im(i,[0,100])}function My(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Dy(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function zy(e,t,n){const r=e/2,i=Nu([0,50],[0,r]);return(r-i(t)*n)*n}function Iy(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function jy(e,t){if(t>0){const n=Iy(e);return Math.min(...n)>=t}return!0}function Nu(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Fy(e){return(String(e).split(".")[1]||"").length}function By(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const gm=Ny,Uy=Ry,Hy=_y,Vy=Ay,Li=h.forwardRef(({className:e,...t},n)=>k.jsxs(gm,{ref:n,className:ku("relative flex w-full touch-none select-none items-center",e),...t,children:[k.jsx(Uy,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:k.jsx(Hy,{className:"absolute h-full bg-primary"})}),k.jsx(Vy,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Li.displayName=gm.displayName;function Qt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Wy(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function vm(...e){return t=>e.forEach(n=>Wy(n,t))}function Yo(...e){return h.useCallback(vm(...e),e)}function Yy(e,t=[]){let n=[];function r(i,l){const s=h.createContext(l),a=n.length;n=[...n,l];function u(c){const{scope:p,children:v,...y}=c,w=(p==null?void 0:p[e][a])||s,E=h.useMemo(()=>y,Object.values(y));return k.jsx(w.Provider,{value:E,children:v})}function f(c,p){const v=(p==null?void 0:p[e][a])||s,y=h.useContext(v);if(y)return y;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const o=()=>{const i=n.map(l=>h.createContext(l));return function(s){const a=(s==null?void 0:s[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,Ky(o,...t)]}function Ky(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const c=a(i)[`__scope${u}`];return{...s,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ym=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(Gy);if(i){const l=i.props.children,s=o.map(a=>a===i?h.Children.count(l)>1?h.Children.only(null):h.isValidElement(l)?l.props.children:null:a);return k.jsx(ya,{...r,ref:t,children:h.isValidElement(l)?h.cloneElement(l,void 0,s):null})}return k.jsx(ya,{...r,ref:t,children:n})});ym.displayName="Slot";var ya=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=Xy(n);return h.cloneElement(n,{...Qy(r,n.props),ref:t?vm(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});ya.displayName="SlotClone";var wm=({children:e})=>k.jsx(k.Fragment,{children:e});function Gy(e){return h.isValidElement(e)&&e.type===wm}function Qy(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Xy(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],bu=Zy.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?ym:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(s,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Jy(e,t){e&&Vo.flushSync(()=>e.dispatchEvent(t))}function Ko(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function qy(e,t=globalThis==null?void 0:globalThis.document){const n=Ko(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var e1="DismissableLayer",wa="dismissableLayer.update",t1="dismissableLayer.pointerDownOutside",n1="dismissableLayer.focusOutside",xd,xm=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sm=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...a}=e,u=h.useContext(xm),[f,c]=h.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=h.useState({}),y=Yo(t,N=>c(N)),w=Array.from(u.layers),[E]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=w.indexOf(E),d=f?w.indexOf(f):-1,g=u.layersWithOutsidePointerEventsDisabled.size>0,S=d>=m,C=i1(N=>{const A=N.target,V=[...u.branches].some(D=>D.contains(A));!S||V||(o==null||o(N),l==null||l(N),N.defaultPrevented||s==null||s())},p),T=l1(N=>{const A=N.target;[...u.branches].some(D=>D.contains(A))||(i==null||i(N),l==null||l(N),N.defaultPrevented||s==null||s())},p);return qy(N=>{d===u.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))},p),h.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(xd=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Sd(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=xd)}},[f,p,n,u]),h.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Sd())},[f,u]),h.useEffect(()=>{const N=()=>v({});return document.addEventListener(wa,N),()=>document.removeEventListener(wa,N)},[]),k.jsx(bu.div,{...a,ref:y,style:{pointerEvents:g?S?"auto":"none":void 0,...e.style},onFocusCapture:Qt(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Qt(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Qt(e.onPointerDownCapture,C.onPointerDownCapture)})});Sm.displayName=e1;var r1="DismissableLayerBranch",o1=h.forwardRef((e,t)=>{const n=h.useContext(xm),r=h.useRef(null),o=Yo(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),k.jsx(bu.div,{...e,ref:o})});o1.displayName=r1;function i1(e,t=globalThis==null?void 0:globalThis.document){const n=Ko(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let a=function(){Em(t1,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function l1(e,t=globalThis==null?void 0:globalThis.document){const n=Ko(e),r=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!r.current&&Em(n1,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Sd(){const e=new CustomEvent(wa);document.dispatchEvent(e)}function Em(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Jy(o,i):o.dispatchEvent(i)}var xa=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},s1=bh.useId||(()=>{}),a1=0;function u1(e){const[t,n]=h.useState(s1());return xa(()=>{n(r=>r??String(a1++))},[e]),t?`radix-${t}`:""}const c1=["top","right","bottom","left"],Dt=Math.min,qe=Math.max,sl=Math.round,yi=Math.floor,$n=e=>({x:e,y:e}),d1={left:"right",right:"left",bottom:"top",top:"bottom"},f1={start:"end",end:"start"};function Sa(e,t,n){return qe(e,Dt(t,n))}function rn(e,t){return typeof e=="function"?e(t):e}function on(e){return e.split("-")[0]}function Ur(e){return e.split("-")[1]}function Tu(e){return e==="x"?"y":"x"}function Pu(e){return e==="y"?"height":"width"}function Ln(e){return["top","bottom"].includes(on(e))?"y":"x"}function Ru(e){return Tu(Ln(e))}function p1(e,t,n){n===void 0&&(n=!1);const r=Ur(e),o=Ru(e),i=Pu(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=al(l)),[l,al(l)]}function m1(e){const t=al(e);return[Ea(e),t,Ea(t)]}function Ea(e){return e.replace(/start|end/g,t=>f1[t])}function h1(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}function g1(e,t,n,r){const o=Ur(e);let i=h1(on(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(Ea)))),i}function al(e){return e.replace(/left|right|bottom|top/g,t=>d1[t])}function v1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Cm(e){return typeof e!="number"?v1(e):{top:e,right:e,bottom:e,left:e}}function ul(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ed(e,t,n){let{reference:r,floating:o}=e;const i=Ln(t),l=Ru(t),s=Pu(l),a=on(t),u=i==="y",f=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let v;switch(a){case"top":v={x:f,y:r.y-o.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:c};break;case"left":v={x:r.x-o.width,y:c};break;default:v={x:r.x,y:r.y}}switch(Ur(t)){case"start":v[l]-=p*(n&&u?-1:1);break;case"end":v[l]+=p*(n&&u?-1:1);break}return v}const y1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:c}=Ed(u,r,a),p=r,v={},y=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:f=0}=rn(e,t)||{};if(u==null)return{};const c=Cm(f),p={x:n,y:r},v=Ru(o),y=Pu(v),w=await l.getDimensions(u),E=v==="y",m=E?"top":"left",d=E?"bottom":"right",g=E?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[v]-p[v]-i.floating[y],C=p[v]-i.reference[v],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let N=T?T[g]:0;(!N||!await(l.isElement==null?void 0:l.isElement(T)))&&(N=s.floating[g]||i.floating[y]);const A=S/2-C/2,V=N/2-w[y]/2-1,D=Dt(c[m],V),Y=Dt(c[d],V),H=D,Q=N-w[y]-Y,P=N/2-w[y]/2+A,R=Sa(H,P,Q),U=!a.arrow&&Ur(o)!=null&&P!==R&&i.reference[y]/2-(PP<=0)){var Y,H;const P=(((Y=i.flip)==null?void 0:Y.index)||0)+1,R=N[P];if(R)return{data:{index:P,overflows:D},reset:{placement:R}};let U=(H=D.filter(j=>j.overflows[0]<=0).sort((j,b)=>j.overflows[1]-b.overflows[1])[0])==null?void 0:H.placement;if(!U)switch(v){case"bestFit":{var Q;const j=(Q=D.filter(b=>{if(T){const _=Ln(b.placement);return _===d||_==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(_=>_>0).reduce((_,$)=>_+$,0)]).sort((b,_)=>b[1]-_[1])[0])==null?void 0:Q[0];j&&(U=j);break}case"initialPlacement":U=s;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function Cd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kd(e){return c1.some(t=>e[t]>=0)}const S1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=rn(e,t);switch(r){case"referenceHidden":{const i=await zo(t,{...o,elementContext:"reference"}),l=Cd(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:kd(l)}}}case"escaped":{const i=await zo(t,{...o,altBoundary:!0}),l=Cd(i,n.floating);return{data:{escapedOffsets:l,escaped:kd(l)}}}default:return{}}}}};async function E1(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=on(n),s=Ur(n),a=Ln(n)==="y",u=["left","top"].includes(l)?-1:1,f=i&&a?-1:1,c=rn(t,e);let{mainAxis:p,crossAxis:v,alignmentAxis:y}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return s&&typeof y=="number"&&(v=s==="end"?y*-1:y),a?{x:v*f,y:p*u}:{x:p*u,y:v*f}}const C1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await E1(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},k1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:E=>{let{x:m,y:d}=E;return{x:m,y:d}}},...a}=rn(e,t),u={x:n,y:r},f=await zo(t,a),c=Ln(on(o)),p=Tu(c);let v=u[p],y=u[c];if(i){const E=p==="y"?"top":"left",m=p==="y"?"bottom":"right",d=v+f[E],g=v-f[m];v=Sa(d,v,g)}if(l){const E=c==="y"?"top":"left",m=c==="y"?"bottom":"right",d=y+f[E],g=y-f[m];y=Sa(d,y,g)}const w=s.fn({...t,[p]:v,[c]:y});return{...w,data:{x:w.x-n,y:w.y-r}}}}},N1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=rn(e,t),f={x:n,y:r},c=Ln(o),p=Tu(c);let v=f[p],y=f[c];const w=rn(s,t),E=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(a){const g=p==="y"?"height":"width",S=i.reference[p]-i.floating[g]+E.mainAxis,C=i.reference[p]+i.reference[g]-E.mainAxis;vC&&(v=C)}if(u){var m,d;const g=p==="y"?"width":"height",S=["top","left"].includes(on(o)),C=i.reference[c]-i.floating[g]+(S&&((m=l.offset)==null?void 0:m[c])||0)+(S?0:E.crossAxis),T=i.reference[c]+i.reference[g]+(S?0:((d=l.offset)==null?void 0:d[c])||0)-(S?E.crossAxis:0);yT&&(y=T)}return{[p]:v,[c]:y}}}},b1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:l=()=>{},...s}=rn(e,t),a=await zo(t,s),u=on(n),f=Ur(n),c=Ln(n)==="y",{width:p,height:v}=r.floating;let y,w;u==="top"||u==="bottom"?(y=u,w=f===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(w=u,y=f==="end"?"top":"bottom");const E=v-a.top-a.bottom,m=p-a.left-a.right,d=Dt(v-a[y],E),g=Dt(p-a[w],m),S=!t.middlewareData.shift;let C=d,T=g;if(c?T=f||S?Dt(g,m):m:C=f||S?Dt(d,E):E,S&&!f){const A=qe(a.left,0),V=qe(a.right,0),D=qe(a.top,0),Y=qe(a.bottom,0);c?T=p-2*(A!==0||V!==0?A+V:qe(a.left,a.right)):C=v-2*(D!==0||Y!==0?D+Y:qe(a.top,a.bottom))}await l({...t,availableWidth:T,availableHeight:C});const N=await o.getDimensions(i.floating);return p!==N.width||v!==N.height?{reset:{rects:!0}}:{}}}};function Hr(e){return km(e)?(e.nodeName||"").toLowerCase():"#document"}function nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sn(e){var t;return(t=(km(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function km(e){return e instanceof Node||e instanceof nt(e).Node}function _t(e){return e instanceof Element||e instanceof nt(e).Element}function jt(e){return e instanceof HTMLElement||e instanceof nt(e).HTMLElement}function Nd(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nt(e).ShadowRoot}function Go(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function T1(e){return["table","td","th"].includes(Hr(e))}function Rl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function _u(e){const t=Au(),n=_t(e)?At(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function P1(e){let t=Mn(e);for(;jt(t)&&!Dr(t);){if(_u(t))return t;if(Rl(t))return null;t=Mn(t)}return null}function Au(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Dr(e){return["html","body","#document"].includes(Hr(e))}function At(e){return nt(e).getComputedStyle(e)}function _l(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mn(e){if(Hr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nd(e)&&e.host||sn(e);return Nd(t)?t.host:t}function Nm(e){const t=Mn(e);return Dr(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&Go(t)?t:Nm(t)}function Io(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Nm(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=nt(o);return i?t.concat(l,l.visualViewport||[],Go(o)?o:[],l.frameElement&&n?Io(l.frameElement):[]):t.concat(o,Io(o,[],n))}function bm(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=jt(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=sl(n)!==i||sl(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function Ou(e){return _t(e)?e:e.contextElement}function Pr(e){const t=Ou(e);if(!jt(t))return $n(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=bm(t);let l=(i?sl(n.width):n.width)/r,s=(i?sl(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const R1=$n(0);function Tm(e){const t=nt(e);return!Au()||!t.visualViewport?R1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nt(e)?!1:t}function qn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ou(e);let l=$n(1);t&&(r?_t(r)&&(l=Pr(r)):l=Pr(e));const s=_1(i,n,r)?Tm(i):$n(0);let a=(o.left+s.x)/l.x,u=(o.top+s.y)/l.y,f=o.width/l.x,c=o.height/l.y;if(i){const p=nt(i),v=r&&_t(r)?nt(r):r;let y=p,w=y.frameElement;for(;w&&r&&v!==y;){const E=Pr(w),m=w.getBoundingClientRect(),d=At(w),g=m.left+(w.clientLeft+parseFloat(d.paddingLeft))*E.x,S=m.top+(w.clientTop+parseFloat(d.paddingTop))*E.y;a*=E.x,u*=E.y,f*=E.x,c*=E.y,a+=g,u+=S,y=nt(w),w=y.frameElement}}return ul({width:f,height:c,x:a,y:u})}function A1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=sn(r),s=t?Rl(t.floating):!1;if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=$n(1);const f=$n(0),c=jt(r);if((c||!c&&!i)&&((Hr(r)!=="body"||Go(l))&&(a=_l(r)),jt(r))){const p=qn(r);u=Pr(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+f.x,y:n.y*u.y-a.scrollTop*u.y+f.y}}function O1(e){return Array.from(e.getClientRects())}function Pm(e){return qn(sn(e)).left+_l(e).scrollLeft}function $1(e){const t=sn(e),n=_l(e),r=e.ownerDocument.body,o=qe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=qe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Pm(e);const s=-n.scrollTop;return At(r).direction==="rtl"&&(l+=qe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}function L1(e,t){const n=nt(e),r=sn(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const u=Au();(!u||u&&t==="fixed")&&(s=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:s,y:a}}function M1(e,t){const n=qn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=jt(e)?Pr(e):$n(1),l=e.clientWidth*i.x,s=e.clientHeight*i.y,a=o*i.x,u=r*i.y;return{width:l,height:s,x:a,y:u}}function bd(e,t,n){let r;if(t==="viewport")r=L1(e,n);else if(t==="document")r=$1(sn(e));else if(_t(t))r=M1(t,n);else{const o=Tm(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ul(r)}function Rm(e,t){const n=Mn(e);return n===t||!_t(n)||Dr(n)?!1:At(n).position==="fixed"||Rm(n,t)}function D1(e,t){const n=t.get(e);if(n)return n;let r=Io(e,[],!1).filter(s=>_t(s)&&Hr(s)!=="body"),o=null;const i=At(e).position==="fixed";let l=i?Mn(e):e;for(;_t(l)&&!Dr(l);){const s=At(l),a=_u(l);!a&&s.position==="fixed"&&(o=null),(i?!a&&!o:!a&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Go(l)&&!a&&Rm(e,l))?r=r.filter(f=>f!==l):o=s,l=Mn(l)}return t.set(e,r),r}function z1(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?Rl(t)?[]:D1(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,f)=>{const c=bd(t,f,o);return u.top=qe(c.top,u.top),u.right=Dt(c.right,u.right),u.bottom=Dt(c.bottom,u.bottom),u.left=qe(c.left,u.left),u},bd(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function I1(e){const{width:t,height:n}=bm(e);return{width:t,height:n}}function j1(e,t,n){const r=jt(t),o=sn(t),i=n==="fixed",l=qn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=$n(0);if(r||!r&&!i)if((Hr(t)!=="body"||Go(o))&&(s=_l(t)),r){const c=qn(t,!0,i,t);a.x=c.x+t.clientLeft,a.y=c.y+t.clientTop}else o&&(a.x=Pm(o));const u=l.left+s.scrollLeft-a.x,f=l.top+s.scrollTop-a.y;return{x:u,y:f,width:l.width,height:l.height}}function hs(e){return At(e).position==="static"}function Td(e,t){return!jt(e)||At(e).position==="fixed"?null:t?t(e):e.offsetParent}function _m(e,t){const n=nt(e);if(Rl(e))return n;if(!jt(e)){let o=Mn(e);for(;o&&!Dr(o);){if(_t(o)&&!hs(o))return o;o=Mn(o)}return n}let r=Td(e,t);for(;r&&T1(r)&&hs(r);)r=Td(r,t);return r&&Dr(r)&&hs(r)&&!_u(r)?n:r||P1(e)||n}const F1=async function(e){const t=this.getOffsetParent||_m,n=this.getDimensions,r=await n(e.floating);return{reference:j1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function B1(e){return At(e).direction==="rtl"}const U1={convertOffsetParentRelativeRectToViewportRelativeRect:A1,getDocumentElement:sn,getClippingRect:z1,getOffsetParent:_m,getElementRects:F1,getClientRects:O1,getDimensions:I1,getScale:Pr,isElement:_t,isRTL:B1};function H1(e,t){let n=null,r;const o=sn(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),i();const{left:u,top:f,width:c,height:p}=e.getBoundingClientRect();if(s||t(),!c||!p)return;const v=yi(f),y=yi(o.clientWidth-(u+c)),w=yi(o.clientHeight-(f+p)),E=yi(u),d={rootMargin:-v+"px "+-y+"px "+-w+"px "+-E+"px",threshold:qe(0,Dt(1,a))||1};let g=!0;function S(C){const T=C[0].intersectionRatio;if(T!==a){if(!g)return l();T?l(!1,T):r=setTimeout(()=>{l(!1,1e-7)},1e3)}g=!1}try{n=new IntersectionObserver(S,{...d,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,d)}n.observe(e)}return l(!0),i}function V1(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Ou(e),f=o||i?[...u?Io(u):[],...Io(t)]:[];f.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const c=u&&s?H1(u,n):null;let p=-1,v=null;l&&(v=new ResizeObserver(m=>{let[d]=m;d&&d.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var g;(g=v)==null||g.observe(t)})),n()}),u&&!a&&v.observe(u),v.observe(t));let y,w=a?qn(e):null;a&&E();function E(){const m=qn(e);w&&(m.x!==w.x||m.y!==w.y||m.width!==w.width||m.height!==w.height)&&n(),w=m,y=requestAnimationFrame(E)}return n(),()=>{var m;f.forEach(d=>{o&&d.removeEventListener("scroll",n),i&&d.removeEventListener("resize",n)}),c==null||c(),(m=v)==null||m.disconnect(),v=null,a&&cancelAnimationFrame(y)}}const W1=C1,Y1=k1,K1=x1,G1=b1,Q1=S1,Pd=w1,X1=N1,Z1=(e,t,n)=>{const r=new Map,o={platform:U1,...n},i={...o.platform,_c:r};return y1(e,t,{...o,platform:i})};var Mi=typeof document<"u"?h.useLayoutEffect:h.useEffect;function cl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!cl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Am(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rd(e,t){const n=Am(e);return Math.round(t*n)/n}function _d(e){const t=h.useRef(e);return Mi(()=>{t.current=e}),t}function J1(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[f,c]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,v]=h.useState(r);cl(p,r)||v(r);const[y,w]=h.useState(null),[E,m]=h.useState(null),d=h.useCallback(j=>{j!==T.current&&(T.current=j,w(j))},[]),g=h.useCallback(j=>{j!==N.current&&(N.current=j,m(j))},[]),S=i||y,C=l||E,T=h.useRef(null),N=h.useRef(null),A=h.useRef(f),V=a!=null,D=_d(a),Y=_d(o),H=h.useCallback(()=>{if(!T.current||!N.current)return;const j={placement:t,strategy:n,middleware:p};Y.current&&(j.platform=Y.current),Z1(T.current,N.current,j).then(b=>{const _={...b,isPositioned:!0};Q.current&&!cl(A.current,_)&&(A.current=_,Vo.flushSync(()=>{c(_)}))})},[p,t,n,Y]);Mi(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,c(j=>({...j,isPositioned:!1})))},[u]);const Q=h.useRef(!1);Mi(()=>(Q.current=!0,()=>{Q.current=!1}),[]),Mi(()=>{if(S&&(T.current=S),C&&(N.current=C),S&&C){if(D.current)return D.current(S,C,H);H()}},[S,C,H,D,V]);const P=h.useMemo(()=>({reference:T,floating:N,setReference:d,setFloating:g}),[d,g]),R=h.useMemo(()=>({reference:S,floating:C}),[S,C]),U=h.useMemo(()=>{const j={position:n,left:0,top:0};if(!R.floating)return j;const b=Rd(R.floating,f.x),_=Rd(R.floating,f.y);return s?{...j,transform:"translate("+b+"px, "+_+"px)",...Am(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:b,top:_}},[n,s,R.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:H,refs:P,elements:R,floatingStyles:U}),[f,H,P,R,U])}const q1=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Pd({element:r.current,padding:o}).fn(n):{}:r?Pd({element:r,padding:o}).fn(n):{}}}},ew=(e,t)=>({...W1(e),options:[e,t]}),tw=(e,t)=>({...Y1(e),options:[e,t]}),nw=(e,t)=>({...X1(e),options:[e,t]}),rw=(e,t)=>({...K1(e),options:[e,t]}),ow=(e,t)=>({...G1(e),options:[e,t]}),iw=(e,t)=>({...Q1(e),options:[e,t]}),lw=(e,t)=>({...q1(e),options:[e,t]});function sw(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function aw(...e){return t=>e.forEach(n=>sw(n,t))}var Om=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(cw);if(i){const l=i.props.children,s=o.map(a=>a===i?h.Children.count(l)>1?h.Children.only(null):h.isValidElement(l)?l.props.children:null:a);return k.jsx(Ca,{...r,ref:t,children:h.isValidElement(l)?h.cloneElement(l,void 0,s):null})}return k.jsx(Ca,{...r,ref:t,children:n})});Om.displayName="Slot";var Ca=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=fw(n);return h.cloneElement(n,{...dw(r,n.props),ref:t?aw(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});Ca.displayName="SlotClone";var uw=({children:e})=>k.jsx(k.Fragment,{children:e});function cw(e){return h.isValidElement(e)&&e.type===uw}function dw(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function fw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],mw=pw.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?Om:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(s,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),hw="Arrow",$m=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return k.jsx(mw.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:k.jsx("polygon",{points:"0,0 30,0 15,10"})})});$m.displayName=hw;var gw=$m;function vw(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Lm(...e){return t=>e.forEach(n=>vw(n,t))}function Mm(...e){return h.useCallback(Lm(...e),e)}function yw(e,t=[]){let n=[];function r(i,l){const s=h.createContext(l),a=n.length;n=[...n,l];function u(c){const{scope:p,children:v,...y}=c,w=(p==null?void 0:p[e][a])||s,E=h.useMemo(()=>y,Object.values(y));return k.jsx(w.Provider,{value:E,children:v})}function f(c,p){const v=(p==null?void 0:p[e][a])||s,y=h.useContext(v);if(y)return y;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const o=()=>{const i=n.map(l=>h.createContext(l));return function(s){const a=(s==null?void 0:s[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,ww(o,...t)]}function ww(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const c=a(i)[`__scope${u}`];return{...s,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Dm=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(Sw);if(i){const l=i.props.children,s=o.map(a=>a===i?h.Children.count(l)>1?h.Children.only(null):h.isValidElement(l)?l.props.children:null:a);return k.jsx(ka,{...r,ref:t,children:h.isValidElement(l)?h.cloneElement(l,void 0,s):null})}return k.jsx(ka,{...r,ref:t,children:n})});Dm.displayName="Slot";var ka=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=Cw(n);return h.cloneElement(n,{...Ew(r,n.props),ref:t?Lm(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});ka.displayName="SlotClone";var xw=({children:e})=>k.jsx(k.Fragment,{children:e});function Sw(e){return h.isValidElement(e)&&e.type===xw}function Ew(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Cw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],zm=kw.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?Dm:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(s,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Nw(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Na=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{};function bw(e){const[t,n]=h.useState(void 0);return Na(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,s;if("borderBoxSize"in i){const a=i.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $u="Popper",[Im,jm]=yw($u),[Tw,Fm]=Im($u),Bm=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return k.jsx(Tw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Bm.displayName=$u;var Um="PopperAnchor",Hm=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Fm(Um,n),l=h.useRef(null),s=Mm(t,l);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:k.jsx(zm.div,{...o,ref:s})});Hm.displayName=Um;var Lu="PopperContent",[Pw,Rw]=Im(Lu),Vm=h.forwardRef((e,t)=>{var we,Me,wt,Be,st,be;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:c="partial",hideWhenDetached:p=!1,updatePositionStrategy:v="optimized",onPlaced:y,...w}=e,E=Fm(Lu,n),[m,d]=h.useState(null),g=Mm(t,xt=>d(xt)),[S,C]=h.useState(null),T=bw(S),N=(T==null?void 0:T.width)??0,A=(T==null?void 0:T.height)??0,V=r+(i!=="center"?"-"+i:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},Y=Array.isArray(u)?u:[u],H=Y.length>0,Q={padding:D,boundary:Y.filter(Aw),altBoundary:H},{refs:P,floatingStyles:R,placement:U,isPositioned:j,middlewareData:b}=J1({strategy:"fixed",placement:V,whileElementsMounted:(...xt)=>V1(...xt,{animationFrame:v==="always"}),elements:{reference:E.anchor},middleware:[ew({mainAxis:o+A,alignmentAxis:l}),a&&tw({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?nw():void 0,...Q}),a&&rw({...Q}),ow({...Q,apply:({elements:xt,rects:an,availableWidth:he,availableHeight:Qe})=>{const{width:un,height:nr}=an.reference,at=xt.floating.style;at.setProperty("--radix-popper-available-width",`${he}px`),at.setProperty("--radix-popper-available-height",`${Qe}px`),at.setProperty("--radix-popper-anchor-width",`${un}px`),at.setProperty("--radix-popper-anchor-height",`${nr}px`)}}),S&&lw({element:S,padding:s}),Ow({arrowWidth:N,arrowHeight:A}),p&&iw({strategy:"referenceHidden",...Q})]}),[_,$]=Km(U),L=Nw(y);Na(()=>{j&&(L==null||L())},[j,L]);const z=(we=b.arrow)==null?void 0:we.x,J=(Me=b.arrow)==null?void 0:Me.y,W=((wt=b.arrow)==null?void 0:wt.centerOffset)!==0,[G,X]=h.useState();return Na(()=>{m&&X(window.getComputedStyle(m).zIndex)},[m]),k.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:j?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(Be=b.transformOrigin)==null?void 0:Be.x,(st=b.transformOrigin)==null?void 0:st.y].join(" "),...((be=b.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:k.jsx(Pw,{scope:n,placedSide:_,onArrowChange:C,arrowX:z,arrowY:J,shouldHideArrow:W,children:k.jsx(zm.div,{"data-side":_,"data-align":$,...w,ref:g,style:{...w.style,animation:j?void 0:"none"}})})})});Vm.displayName=Lu;var Wm="PopperArrow",_w={top:"bottom",right:"left",bottom:"top",left:"right"},Ym=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Rw(Wm,r),l=_w[i.placedSide];return k.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:k.jsx(gw,{...o,ref:n,style:{...o.style,display:"block"}})})});Ym.displayName=Wm;function Aw(e){return e!==null}var Ow=e=>({name:"transformOrigin",options:e,fn(t){var E,m,d;const{placement:n,rects:r,middlewareData:o}=t,l=((E=o.arrow)==null?void 0:E.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,f]=Km(n),c={start:"0%",center:"50%",end:"100%"}[f],p=(((m=o.arrow)==null?void 0:m.x)??0)+s/2,v=(((d=o.arrow)==null?void 0:d.y)??0)+a/2;let y="",w="";return u==="bottom"?(y=l?c:`${p}px`,w=`${-a}px`):u==="top"?(y=l?c:`${p}px`,w=`${r.floating.height+a}px`):u==="right"?(y=`${-a}px`,w=l?c:`${v}px`):u==="left"&&(y=`${r.floating.width+a}px`,w=l?c:`${v}px`),{data:{x:y,y:w}}}});function Km(e){const[t,n="center"]=e.split("-");return[t,n]}var $w=Bm,Lw=Hm,Mw=Vm,Dw=Ym;function zw(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Gm=e=>{const{present:t,children:n}=e,r=Iw(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=Yo(r.ref,jw(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:i}):null};Gm.displayName="Presence";function Iw(e){const[t,n]=h.useState(),r=h.useRef({}),o=h.useRef(e),i=h.useRef("none"),l=e?"mounted":"unmounted",[s,a]=zw(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=wi(r.current);i.current=s==="mounted"?u:"none"},[s]),xa(()=>{const u=r.current,f=o.current;if(f!==e){const p=i.current,v=wi(u);e?a("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(f&&p!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),xa(()=>{if(t){const u=c=>{const v=wi(r.current).includes(c.animationName);c.target===t&&v&&Vo.flushSync(()=>a("ANIMATION_END"))},f=c=>{c.target===t&&(i.current=wi(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:h.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function wi(e){return(e==null?void 0:e.animationName)||"none"}function jw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Fw({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Bw({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,s=Ko(n),a=h.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&s(c)}else o(u)},[i,e,o,s]);return[l,a]}function Bw({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,o=h.useRef(r),i=Ko(t);return h.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Uw(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Hw(...e){return t=>e.forEach(n=>Uw(n,t))}var Qm=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(Ww);if(i){const l=i.props.children,s=o.map(a=>a===i?h.Children.count(l)>1?h.Children.only(null):h.isValidElement(l)?l.props.children:null:a);return k.jsx(ba,{...r,ref:t,children:h.isValidElement(l)?h.cloneElement(l,void 0,s):null})}return k.jsx(ba,{...r,ref:t,children:n})});Qm.displayName="Slot";var ba=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=Kw(n);return h.cloneElement(n,{...Yw(r,n.props),ref:t?Hw(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});ba.displayName="SlotClone";var Vw=({children:e})=>k.jsx(k.Fragment,{children:e});function Ww(e){return h.isValidElement(e)&&e.type===Vw}function Yw(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Kw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qw=Gw.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?Qm:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(s,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xw="VisuallyHidden",Xm=h.forwardRef((e,t)=>k.jsx(Qw.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Xm.displayName=Xw;var Zw=Xm,[Al,kx]=Yy("Tooltip",[jm]),Ol=jm(),Zm="TooltipProvider",Jw=700,Ta="tooltip.open",[qw,Mu]=Al(Zm),Jm=e=>{const{__scopeTooltip:t,delayDuration:n=Jw,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[l,s]=h.useState(!0),a=h.useRef(!1),u=h.useRef(0);return h.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),k.jsx(qw,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(u.current),s(!1)},[]),onClose:h.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(f=>{a.current=f},[]),disableHoverableContent:o,children:i})};Jm.displayName=Zm;var $l="Tooltip",[ex,Ll]=Al($l),qm=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:s}=e,a=Mu($l,e.__scopeTooltip),u=Ol(t),[f,c]=h.useState(null),p=u1(),v=h.useRef(0),y=l??a.disableHoverableContent,w=s??a.delayDuration,E=h.useRef(!1),[m=!1,d]=Fw({prop:r,defaultProp:o,onChange:N=>{N?(a.onOpen(),document.dispatchEvent(new CustomEvent(Ta))):a.onClose(),i==null||i(N)}}),g=h.useMemo(()=>m?E.current?"delayed-open":"instant-open":"closed",[m]),S=h.useCallback(()=>{window.clearTimeout(v.current),E.current=!1,d(!0)},[d]),C=h.useCallback(()=>{window.clearTimeout(v.current),d(!1)},[d]),T=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{E.current=!0,d(!0)},w)},[w,d]);return h.useEffect(()=>()=>window.clearTimeout(v.current),[]),k.jsx($w,{...u,children:k.jsx(ex,{scope:t,contentId:p,open:m,stateAttribute:g,trigger:f,onTriggerChange:c,onTriggerEnter:h.useCallback(()=>{a.isOpenDelayed?T():S()},[a.isOpenDelayed,T,S]),onTriggerLeave:h.useCallback(()=>{y?C():window.clearTimeout(v.current)},[C,y]),onOpen:S,onClose:C,disableHoverableContent:y,children:n})})};qm.displayName=$l;var Pa="TooltipTrigger",eh=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ll(Pa,n),i=Mu(Pa,n),l=Ol(n),s=h.useRef(null),a=Yo(t,s,o.onTriggerChange),u=h.useRef(!1),f=h.useRef(!1),c=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),k.jsx(Lw,{asChild:!0,...l,children:k.jsx(bu.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:a,onPointerMove:Qt(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Qt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Qt(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:Qt(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Qt(e.onBlur,o.onClose),onClick:Qt(e.onClick,o.onClose)})})});eh.displayName=Pa;var tx="TooltipPortal",[Nx,nx]=Al(tx,{forceMount:void 0}),zr="TooltipContent",th=h.forwardRef((e,t)=>{const n=nx(zr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,l=Ll(zr,e.__scopeTooltip);return k.jsx(Gm,{present:r||l.open,children:l.disableHoverableContent?k.jsx(nh,{side:o,...i,ref:t}):k.jsx(rx,{side:o,...i,ref:t})})}),rx=h.forwardRef((e,t)=>{const n=Ll(zr,e.__scopeTooltip),r=Mu(zr,e.__scopeTooltip),o=h.useRef(null),i=Yo(t,o),[l,s]=h.useState(null),{trigger:a,onClose:u}=n,f=o.current,{onPointerInTransitChange:c}=r,p=h.useCallback(()=>{s(null),c(!1)},[c]),v=h.useCallback((y,w)=>{const E=y.currentTarget,m={x:y.clientX,y:y.clientY},d=sx(m,E.getBoundingClientRect()),g=ax(m,d),S=ux(w.getBoundingClientRect()),C=dx([...g,...S]);s(C),c(!0)},[c]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(a&&f){const y=E=>v(E,f),w=E=>v(E,a);return a.addEventListener("pointerleave",y),f.addEventListener("pointerleave",w),()=>{a.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",w)}}},[a,f,v,p]),h.useEffect(()=>{if(l){const y=w=>{const E=w.target,m={x:w.clientX,y:w.clientY},d=(a==null?void 0:a.contains(E))||(f==null?void 0:f.contains(E)),g=!cx(m,l);d?p():g&&(p(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[a,f,l,u,p]),k.jsx(nh,{...e,ref:i})}),[ox,ix]=Al($l,{isInside:!1}),nh=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:l,...s}=e,a=Ll(zr,n),u=Ol(n),{onClose:f}=a;return h.useEffect(()=>(document.addEventListener(Ta,f),()=>document.removeEventListener(Ta,f)),[f]),h.useEffect(()=>{if(a.trigger){const c=p=>{const v=p.target;v!=null&&v.contains(a.trigger)&&f()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[a.trigger,f]),k.jsx(Sm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:c=>c.preventDefault(),onDismiss:f,children:k.jsxs(Mw,{"data-state":a.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[k.jsx(wm,{children:r}),k.jsx(ox,{scope:n,isInside:!0,children:k.jsx(Zw,{id:a.contentId,role:"tooltip",children:o||r})})]})})});th.displayName=zr;var rh="TooltipArrow",lx=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ol(n);return ix(rh,n).isInside?null:k.jsx(Dw,{...o,...r,ref:t})});lx.displayName=rh;function sx(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ax(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ux(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function cx(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,l=t.length-1;ir!=f>r&&n<(u-s)*(r-a)/(f-a)+s&&(o=!o)}return o}function dx(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),fx(t)}function fx(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(o.y-l.y)>=(i.y-l.y)*(o.x-l.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(o.y-l.y)>=(i.y-l.y)*(o.x-l.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var px=Jm,mx=qm,hx=eh,oh=th;const gs=px,vs=mx,ys=hx,Di=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>k.jsx(oh,{ref:r,sideOffset:t,className:ku("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",e),...n}));Di.displayName=oh.displayName;function gx(){const[e,t]=h.useState(null),[n,r]=h.useState(!1),[o,i]=h.useState(0),[l,s]=h.useState(100),[a,u]=h.useState(100),[f,c]=h.useState(255),[p,v]=h.useState(0),[y,w]=h.useState(0),[E,m]=h.useState("#FF0000"),d=(P,R,U)=>`#${((1<<24)+(P<<16)+(R<<8)+U).toString(16).slice(1)}`;h.useEffect(()=>{localStorage.removeItem("uploadedImage")},[]),h.useEffect(()=>{const P=localStorage.getItem("uploadedImage");P&&(t(P),g(P))},[n]);const g=P=>{const R=new Image;R.src=P,R.onload=()=>{const U=document.createElement("canvas"),j=U.getContext("2d");U.width=R.width,U.height=R.height,j.drawImage(R,0,0,R.width,R.height);const _=j.getImageData(0,0,R.width,R.height).data,$=[];for(let G=0;G<_.length;G+=4){const X=_[G],we=_[G+1],Me=_[G+2];if(_[G+3]>0){const Be=d(X,we,Me);$.push(Be)}}const L={};$.forEach(G=>{G in L?L[G]+=1:L[G]=1});const J=Object.keys(L).sort((G,X)=>L[X]-L[G])[0],W=T(J);N(W.r,W.g,W.b)}},S=P=>{const R=P.target,U=document.createElement("canvas"),j=U.getContext("2d");U.width=R.width,U.height=R.height,j.drawImage(R,0,0,R.width,R.height);const b=R.getBoundingClientRect(),_=R.width/b.width,$=R.height/b.height,L=(P.clientX-b.left)*_,z=(P.clientY-b.top)*$,J=j.getImageData(L,z,1,1).data,[W,G,X]=J;c(W),v(G),w(X),m(d(W,G,X));const we=N(W,G,X);i(we.h),s(we.s),u(we.l),dt.success("Color picked from image",{action:{label:"Close",onClick:()=>dt.dismiss()}})},C=(P,R,U)=>{P/=360,R/=100,U/=100;let j,b,_;if(R===0)j=b=_=U;else{const $=(J,W,G)=>(G<0&&(G+=1),G>1&&(G-=1),G<.16666666666666666?J+(W-J)*6*G:G<.5?W:G<.6666666666666666?J+(W-J)*(.6666666666666666-G)*6:J),L=U<.5?U*(1+R):U+R-U*R,z=2*U-L;j=$(z,L,P+1/3),b=$(z,L,P),_=$(z,L,P-1/3)}return{r:Math.round(j*255),g:Math.round(b*255),b:Math.round(_*255)}},T=P=>{const R=P.replace(/#/,"").match(/.{1,2}/g);return{r:parseInt(R[0],16),g:parseInt(R[1],16),b:parseInt(R[2],16)}},N=(P,R,U)=>{P/=255,R/=255,U/=255;const j=Math.max(P,R,U),b=Math.min(P,R,U);let _,$,L=(j+b)/2;if(j===b)_=$=0;else{const z=j-b;switch($=L>.5?z/(2-j-b):z/(j+b),j){case P:_=(R-U)/z+(Rdt.dismiss()}})}function V(){navigator.clipboard.writeText(E),dt.success("Copied HEX value to clipboard",{action:{label:"Close",onClick:()=>dt.dismiss()}})}function D(){navigator.clipboard.writeText(`${o}°, ${l}%, ${a}%`),dt.success("Copied HSL value to clipboard",{action:{label:"Close",onClick:()=>dt.dismiss()}})}const Y=P=>{i(P);const R=C(P,l,a);c(R.r),v(R.g),w(R.b),m(d(R.r,R.g,R.b))},H=P=>{s(P);const R=C(o,P,a);c(R.r),v(R.g),w(R.b),m(d(R.r,R.g,R.b))},Q=P=>{u(P);const R=C(o,l,P);c(R.r),v(R.g),w(R.b),m(d(R.r,R.g,R.b))};return n?k.jsxs("div",{className:"flex flex-col items-center justify-center p-4 h-screen bg-gray-100 dark:bg-gray-950 ",children:[k.jsx(om,{}),k.jsx("div",{className:"max-w-3xl w-full bg-white dark:bg-gray-900 rounded-lg shadow-lg overflow-hidden",style:{minHeight:"300px",minWidth:"700px"},children:k.jsxs("div",{className:"grid grid-cols-2 gap-6 p-6",children:[k.jsxs("div",{className:"relative flex justify-center items-center h-full",children:[k.jsx("img",{alt:"Uploaded Image",className:"w-full h-full object-cover rounded-lg",height:500,src:"/placeholder.svg",style:{aspectRatio:"500/500",objectFit:"cover"},width:500}),k.jsx("div",{className:"absolute inset-0 flex items-center justify-center border-black",style:{userSelect:"none",overflow:"hidden",scrollbarWidth:"none"},children:k.jsx("div",{className:"max-w-full max-h-full relative bg-black dark:bg-white rounded-lg border-black shadow-lg object-cover content-center overflow-auto",style:{aspectRatio:"500/500",objectFit:"cover",scrollbarWidth:"none"},children:e!==null?k.jsx("img",{src:e,onClick:S,alt:"Uploaded Image",className:"object-contain place-self-center"}):k.jsx(vx,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})})]}),k.jsxs("div",{className:"flex flex-col gap-6",children:[k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"w-16 h-16 rounded-full border-4 border-gray-200 dark:border-gray-800 flex items-center justify-center",children:k.jsx("div",{className:"w-10 h-10 rounded-full border",style:{backgroundColor:d(f,p,y)}})}),k.jsxs("div",{className:"flex-1 grid gap-1",children:[k.jsx("div",{className:"w-20 text-sm font-medium text-gray-500 dark:text-gray-400",children:"HEX"}),k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"text-lg font-semibold text-gray-900 dark:text-gray-50",children:E}),k.jsx(gs,{children:k.jsxs(vs,{children:[k.jsx(ys,{children:k.jsx(Oi,{variant:"ghost",onClick:V,className:"max-h-12 max-w-12",children:k.jsx(yx,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})})}),k.jsx(Di,{children:k.jsx("span",{className:"text-sm text-muted-foreground",children:"Copy HEX"})})]})})]})]})]}),k.jsxs("div",{className:"grid gap-4",children:[k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"Hue"}),k.jsx(Li,{className:"flex-1",value:[o],max:360,step:1,onValueChange:P=>Y(P)}),k.jsxs("div",{className:"w-16 text-right text-sm font-medium text-gray-900 dark:text-gray-50",children:[o,"°"]})]}),k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"Saturation"}),k.jsx(Li,{className:"flex-1",value:[l],max:100,step:1,onValueChange:P=>H(P)}),k.jsxs("div",{className:"w-16 text-right text-sm font-medium text-gray-900 dark:text-gray-50",children:[l,"%"]})]}),k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"Lightness"}),k.jsx(Li,{className:"flex-1",value:[a],max:100,step:1,onValueChange:P=>Q(P)}),k.jsxs("div",{className:"w-16 text-right text-sm font-medium text-gray-900 dark:text-gray-50",children:[a,"%"]})]})]}),k.jsxs("div",{className:"grid gap-2",children:[k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx(gs,{children:k.jsxs(vs,{children:[k.jsx(ys,{children:k.jsx(Oi,{variant:"ghost",onClick:A,className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"RGB"})}),k.jsx(Di,{children:k.jsx("span",{className:"text-sm text-muted-foreground",children:"Copy RGB"})})]})}),k.jsxs("div",{className:"flex-1 text-lg font-semibold text-gray-900 dark:text-gray-50",children:[f,", ",p,", ",y]})]}),k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx(gs,{children:k.jsxs(vs,{children:[k.jsx(ys,{children:k.jsx(Oi,{variant:"ghost",onClick:D,className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"HSL"})}),k.jsx(Di,{children:k.jsx("span",{className:"text-sm text-muted-foreground",children:"Copy HSL"})})]})}),k.jsxs("div",{className:"flex-1 text-lg font-semibold text-gray-900 dark:text-gray-50",children:[o,"°, ",l,"%, ",a,"%"]})]})]})]})]})})]}):k.jsx(dy,{setImage:t,setImageUploaded:r,image:e,imageUploaded:n})}function vx(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),k.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function yx(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",style:{enableBackground:"new 0 0 115.77 122.88"},xmlSpace:"preserve",children:[k.jsx("style",{type:"text/css",children:".st0{fill-rule:evenodd;clip-rule:evenodd;}"}),k.jsx("g",{children:k.jsx("path",{className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})]})}function wx(){return k.jsx("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-4 py-12 sm:px-6 lg:px-8",children:k.jsxs("div",{className:"mx-auto max-w-md text-center",children:[k.jsx(xx,{className:"mx-auto h-12 w-12 text-primary"}),k.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Sorry, this website is only available for desktop"}),k.jsx("p",{className:"mt-4 text-muted-foreground",children:"We apologize for the inconvenience, but our website is currently optimized for desktop devices only. Please try accessing this site from a computer or laptop."})]})})}function xx(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"blue",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}),k.jsx("path",{d:"M12 18h.01"})]})}const Sx=()=>{const e=window.navigator.userAgent.toLowerCase(),t=/mobile|android|iphone|ipad|tablet|touch|samsung|fridge/i.test(e),n=window.innerWidth<=1024;return!t&&!n};function Ex(){const[e,t]=M.useState(null);return M.useEffect(()=>{t(Sx())},[]),e===!0?k.jsx(gx,{}):k.jsx(wx,{})}ws.createRoot(document.getElementById("root")).render(k.jsx(M.StrictMode,{children:k.jsx(Ex,{})})); +*/function dy({image:e,setImage:t,setImageUploaded:n,imageUploaded:r}){const o=h.useRef(null),[i,l]=h.useState([]);h.useEffect(()=>{const y=localStorage.getItem("uploadedImage");y&&(t(y),p(y))},[]);const s=y=>{const w=y.target.files[0],E=new FileReader;E.onloadend=()=>{const m=E.result;t(m),localStorage.setItem("uploadedImage",m),p(m)},E.readAsDataURL(w),n(!0),dt.success("Image uploaded successfully",{action:{text:"Close",onClick:()=>{dt.dismiss()}}})},a=y=>{y.preventDefault()},u=y=>{if(y.preventDefault(),!y.dataTransfer.files[0].type.includes("image")){dt.error("File type not supported",{action:{label:"Close",onClick:()=>{dt.dismiss()}}});return}const w=y.dataTransfer.files[0],E=new FileReader;E.onloadend=()=>{const m=E.result;t(m),localStorage.setItem("uploadedImage",m),p(m)},E.readAsDataURL(w),n(!0)},f=()=>{o.current.click()},c=()=>{t(null),l([]),localStorage.removeItem("uploadedImage")};h.useEffect(()=>{c()},[e]);const p=async y=>{try{const w=new Image;w.src=y,w.onload=()=>{const E=document.createElement("canvas");E.width=w.width,E.height=w.height;const m=E.getContext("2d");m.drawImage(w,0,0);const d=m.getImageData(0,0,E.width,E.height),g={};for(let C=0;CT.count-C.count).slice(0,12).map(([C,{r:T,g:N,b:A}])=>({hex:C,r:T,g:N,b:A}));l(S)}}catch(w){console.error("Error extracting colors:",w)}},v=(y,w,E)=>"#"+((1<<24)+(y<<16)+(w<<8)+E).toString(16).slice(1);return k.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-gray-100 dark:bg-gray-900",children:[k.jsx(om,{}),k.jsxs("div",{className:"max-w-4xl w-full p-4",children:[k.jsx("div",{className:"w-full aspect-video bg-gray-200 dark:bg-gray-800 rounded-lg overflow-hidden flex items-center justify-center cursor-pointer",onDragOver:a,onDrop:u,onClick:f,style:{border:r?"none":"3px dashed #ccc"},children:e?k.jsx("img",{src:e,alt:"Uploaded Image",className:"w-full h-full object-contain"}):k.jsx("div",{className:"text-gray-500 dark:text-gray-400 text-lg",children:"Click or Drop an Image to upload it"})}),k.jsx("input",{type:"file",accept:"image/jpeg,image/jpg,image/png,image/webp",ref:o,onChange:s,className:"hidden",limit:"1"})]})]})}function im(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function lm(e,t=[]){let n=[];function r(i,l){const s=h.createContext(l),a=n.length;n=[...n,l];function u(c){const{scope:p,children:v,...y}=c,w=(p==null?void 0:p[e][a])||s,E=h.useMemo(()=>y,Object.values(y));return h.createElement(w.Provider,{value:E},v)}function f(c,p){const v=(p==null?void 0:p[e][a])||s,y=h.useContext(v);if(y)return y;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const o=()=>{const i=n.map(l=>h.createContext(l));return function(s){const a=(s==null?void 0:s[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,fy(o,...t)]}function fy(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const c=a(i)[`__scope${u}`];return{...s,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function sm(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function py({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=my({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,s=sm(n),a=h.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&s(c)}else o(u)},[i,e,o,s]);return[l,a]}function my({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,o=h.useRef(r),i=sm(t);return h.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const hy=h.createContext(void 0);function gy(e){const t=h.useContext(hy);return e||t||"ltr"}function vy(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const yy=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{};function wy(e){const[t,n]=h.useState(void 0);return yy(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,s;if("borderBoxSize"in i){const a=i.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const xy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Tl=xy.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?Do:t;return h.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),h.createElement(s,Ge({},l,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Sy(e){const t=e+"CollectionProvider",[n,r]=lm(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=v=>{const{scope:y,children:w}=v,E=M.useRef(null),m=M.useRef(new Map).current;return M.createElement(o,{scope:y,itemMap:m,collectionRef:E},w)},s=e+"CollectionSlot",a=M.forwardRef((v,y)=>{const{scope:w,children:E}=v,m=i(s,w),d=On(y,m.collectionRef);return M.createElement(Do,{ref:d},E)}),u=e+"CollectionItemSlot",f="data-radix-collection-item",c=M.forwardRef((v,y)=>{const{scope:w,children:E,...m}=v,d=M.useRef(null),g=On(y,d),S=i(u,w);return M.useEffect(()=>(S.itemMap.set(d,{ref:d,...m}),()=>void S.itemMap.delete(d))),M.createElement(Do,{[f]:"",ref:g},E)});function p(v){const y=i(e+"CollectionConsumer",v);return M.useCallback(()=>{const E=y.collectionRef.current;if(!E)return[];const m=Array.from(E.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((S,C)=>m.indexOf(S.ref.current)-m.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:l,Slot:a,ItemSlot:c},p,r]}const am=["PageUp","PageDown"],um=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],cm={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Wo="Slider",[va,Ey,Cy]=Sy(Wo),[dm,Cx]=lm(Wo,[Cy]),[ky,Pl]=dm(Wo),Ny=h.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:f,onValueChange:c=()=>{},onValueCommit:p=()=>{},inverted:v=!1,...y}=e,[w,E]=h.useState(null),m=On(t,P=>E(P)),d=h.useRef(new Set),g=h.useRef(0),S=l==="horizontal",C=w?!!w.closest("form"):!0,T=S?by:Ty,[N=[],A]=py({prop:f,defaultProp:u,onChange:P=>{var R;(R=[...d.current][g.current])===null||R===void 0||R.focus(),c(P)}}),V=h.useRef(N);function D(P){const R=Dy(N,P);Q(P,R)}function Y(P){Q(P,g.current)}function H(){const P=V.current[g.current];N[g.current]!==P&&p(N)}function Q(P,R,{commit:U}={commit:!1}){const j=Fy(i),b=By(Math.round((P-r)/i)*i+r,j),_=im(b,[r,o]);A(($=[])=>{const L=Ly($,_,R);if(jy(L,a*i)){g.current=L.indexOf(_);const z=String(L)!==String($);return z&&U&&p(L),z?L:$}else return $})}return h.createElement(ky,{scope:e.__scopeSlider,disabled:s,min:r,max:o,valueIndexToChangeRef:g,thumbs:d.current,values:N,orientation:l},h.createElement(va.Provider,{scope:e.__scopeSlider},h.createElement(va.Slot,{scope:e.__scopeSlider},h.createElement(T,Ge({"aria-disabled":s,"data-disabled":s?"":void 0},y,{ref:m,onPointerDown:Sr(y.onPointerDown,()=>{s||(V.current=N)}),min:r,max:o,inverted:v,onSlideStart:s?void 0:D,onSlideMove:s?void 0:Y,onSlideEnd:s?void 0:H,onHomeKeyDown:()=>!s&&Q(r,0,{commit:!0}),onEndKeyDown:()=>!s&&Q(o,N.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:R})=>{if(!s){const b=am.includes(P.key)||P.shiftKey&&um.includes(P.key)?10:1,_=g.current,$=N[_],L=i*b*R;Q($+L,_,{commit:!0})}}})))),C&&N.map((P,R)=>h.createElement($y,{key:R,name:n?n+(N.length>1?"[]":""):void 0,value:P})))}),[fm,pm]=dm(Wo,{startEdge:"left",endEdge:"right",size:"width",direction:1}),by=h.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...f}=e,[c,p]=h.useState(null),v=On(t,g=>p(g)),y=h.useRef(),w=gy(o),E=w==="ltr",m=E&&!i||!E&&i;function d(g){const S=y.current||c.getBoundingClientRect(),C=[0,S.width],N=Nu(C,m?[n,r]:[r,n]);return y.current=S,N(g-S.left)}return h.createElement(fm,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width"},h.createElement(mm,Ge({dir:w,"data-orientation":"horizontal"},f,{ref:v,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:g=>{const S=d(g.clientX);l==null||l(S)},onSlideMove:g=>{const S=d(g.clientX);s==null||s(S)},onSlideEnd:()=>{y.current=void 0,a==null||a()},onStepKeyDown:g=>{const C=cm[m?"from-left":"from-right"].includes(g.key);u==null||u({event:g,direction:C?-1:1})}})))}),Ty=h.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,f=h.useRef(null),c=On(t,f),p=h.useRef(),v=!o;function y(w){const E=p.current||f.current.getBoundingClientRect(),m=[0,E.height],g=Nu(m,v?[r,n]:[n,r]);return p.current=E,g(w-E.top)}return h.createElement(fm,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1},h.createElement(mm,Ge({"data-orientation":"vertical"},u,{ref:c,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const E=y(w.clientY);i==null||i(E)},onSlideMove:w=>{const E=y(w.clientY);l==null||l(E)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:w=>{const m=cm[v?"from-bottom":"from-top"].includes(w.key);a==null||a({event:w,direction:m?-1:1})}})))}),mm=h.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,f=Pl(Wo,n);return h.createElement(Tl.span,Ge({},u,{ref:t,onKeyDown:Sr(e.onKeyDown,c=>{c.key==="Home"?(l(c),c.preventDefault()):c.key==="End"?(s(c),c.preventDefault()):am.concat(um).includes(c.key)&&(a(c),c.preventDefault())}),onPointerDown:Sr(e.onPointerDown,c=>{const p=c.target;p.setPointerCapture(c.pointerId),c.preventDefault(),f.thumbs.has(p)?p.focus():r(c)}),onPointerMove:Sr(e.onPointerMove,c=>{c.target.hasPointerCapture(c.pointerId)&&o(c)}),onPointerUp:Sr(e.onPointerUp,c=>{const p=c.target;p.hasPointerCapture(c.pointerId)&&(p.releasePointerCapture(c.pointerId),i(c))})}))}),Py="SliderTrack",Ry=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Pl(Py,n);return h.createElement(Tl.span,Ge({"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation},r,{ref:t}))}),yd="SliderRange",_y=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Pl(yd,n),i=pm(yd,n),l=h.useRef(null),s=On(t,l),a=o.values.length,u=o.values.map(p=>hm(p,o.min,o.max)),f=a>1?Math.min(...u):0,c=100-Math.max(...u);return h.createElement(Tl.span,Ge({"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0},r,{ref:s,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:c+"%"}}))}),wd="SliderThumb",Ay=h.forwardRef((e,t)=>{const n=Ey(e.__scopeSlider),[r,o]=h.useState(null),i=On(t,s=>o(s)),l=h.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return h.createElement(Oy,Ge({},e,{ref:i,index:l}))}),Oy=h.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,...o}=e,i=Pl(wd,n),l=pm(wd,n),[s,a]=h.useState(null),u=On(t,E=>a(E)),f=wy(s),c=i.values[r],p=c===void 0?0:hm(c,i.min,i.max),v=My(r,i.values.length),y=f==null?void 0:f[l.size],w=y?zy(y,p,l.direction):0;return h.useEffect(()=>{if(s)return i.thumbs.add(s),()=>{i.thumbs.delete(s)}},[s,i.thumbs]),h.createElement("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${p}% + ${w}px)`}},h.createElement(va.ItemSlot,{scope:e.__scopeSlider},h.createElement(Tl.span,Ge({role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0},o,{ref:u,style:c===void 0?{display:"none"}:e.style,onFocus:Sr(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})}))))}),$y=e=>{const{value:t,...n}=e,r=h.useRef(null),o=vy(t);return h.useEffect(()=>{const i=r.current,l=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==t&&a){const u=new Event("input",{bubbles:!0});a.call(i,t),i.dispatchEvent(u)}},[o,t]),h.createElement("input",Ge({style:{display:"none"}},n,{ref:r,defaultValue:t}))};function Ly(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function hm(e,t,n){const i=100/(n-t)*(e-t);return im(i,[0,100])}function My(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Dy(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function zy(e,t,n){const r=e/2,i=Nu([0,50],[0,r]);return(r-i(t)*n)*n}function Iy(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function jy(e,t){if(t>0){const n=Iy(e);return Math.min(...n)>=t}return!0}function Nu(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Fy(e){return(String(e).split(".")[1]||"").length}function By(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const gm=Ny,Uy=Ry,Hy=_y,Vy=Ay,Li=h.forwardRef(({className:e,...t},n)=>k.jsxs(gm,{ref:n,className:ku("relative flex w-full touch-none select-none items-center",e),...t,children:[k.jsx(Uy,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:k.jsx(Hy,{className:"absolute h-full bg-primary"})}),k.jsx(Vy,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Li.displayName=gm.displayName;function Qt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Wy(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function vm(...e){return t=>e.forEach(n=>Wy(n,t))}function Yo(...e){return h.useCallback(vm(...e),e)}function Yy(e,t=[]){let n=[];function r(i,l){const s=h.createContext(l),a=n.length;n=[...n,l];function u(c){const{scope:p,children:v,...y}=c,w=(p==null?void 0:p[e][a])||s,E=h.useMemo(()=>y,Object.values(y));return k.jsx(w.Provider,{value:E,children:v})}function f(c,p){const v=(p==null?void 0:p[e][a])||s,y=h.useContext(v);if(y)return y;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const o=()=>{const i=n.map(l=>h.createContext(l));return function(s){const a=(s==null?void 0:s[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,Ky(o,...t)]}function Ky(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const c=a(i)[`__scope${u}`];return{...s,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var ym=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(Gy);if(i){const l=i.props.children,s=o.map(a=>a===i?h.Children.count(l)>1?h.Children.only(null):h.isValidElement(l)?l.props.children:null:a);return k.jsx(ya,{...r,ref:t,children:h.isValidElement(l)?h.cloneElement(l,void 0,s):null})}return k.jsx(ya,{...r,ref:t,children:n})});ym.displayName="Slot";var ya=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=Xy(n);return h.cloneElement(n,{...Qy(r,n.props),ref:t?vm(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});ya.displayName="SlotClone";var wm=({children:e})=>k.jsx(k.Fragment,{children:e});function Gy(e){return h.isValidElement(e)&&e.type===wm}function Qy(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Xy(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],bu=Zy.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?ym:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(s,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Jy(e,t){e&&Vo.flushSync(()=>e.dispatchEvent(t))}function Ko(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function qy(e,t=globalThis==null?void 0:globalThis.document){const n=Ko(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var e1="DismissableLayer",wa="dismissableLayer.update",t1="dismissableLayer.pointerDownOutside",n1="dismissableLayer.focusOutside",xd,xm=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sm=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...a}=e,u=h.useContext(xm),[f,c]=h.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=h.useState({}),y=Yo(t,N=>c(N)),w=Array.from(u.layers),[E]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=w.indexOf(E),d=f?w.indexOf(f):-1,g=u.layersWithOutsidePointerEventsDisabled.size>0,S=d>=m,C=i1(N=>{const A=N.target,V=[...u.branches].some(D=>D.contains(A));!S||V||(o==null||o(N),l==null||l(N),N.defaultPrevented||s==null||s())},p),T=l1(N=>{const A=N.target;[...u.branches].some(D=>D.contains(A))||(i==null||i(N),l==null||l(N),N.defaultPrevented||s==null||s())},p);return qy(N=>{d===u.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))},p),h.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(xd=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Sd(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=xd)}},[f,p,n,u]),h.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Sd())},[f,u]),h.useEffect(()=>{const N=()=>v({});return document.addEventListener(wa,N),()=>document.removeEventListener(wa,N)},[]),k.jsx(bu.div,{...a,ref:y,style:{pointerEvents:g?S?"auto":"none":void 0,...e.style},onFocusCapture:Qt(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Qt(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Qt(e.onPointerDownCapture,C.onPointerDownCapture)})});Sm.displayName=e1;var r1="DismissableLayerBranch",o1=h.forwardRef((e,t)=>{const n=h.useContext(xm),r=h.useRef(null),o=Yo(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),k.jsx(bu.div,{...e,ref:o})});o1.displayName=r1;function i1(e,t=globalThis==null?void 0:globalThis.document){const n=Ko(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let a=function(){Em(t1,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function l1(e,t=globalThis==null?void 0:globalThis.document){const n=Ko(e),r=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!r.current&&Em(n1,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Sd(){const e=new CustomEvent(wa);document.dispatchEvent(e)}function Em(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Jy(o,i):o.dispatchEvent(i)}var xa=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},s1=bh.useId||(()=>{}),a1=0;function u1(e){const[t,n]=h.useState(s1());return xa(()=>{n(r=>r??String(a1++))},[e]),t?`radix-${t}`:""}const c1=["top","right","bottom","left"],Dt=Math.min,qe=Math.max,sl=Math.round,yi=Math.floor,$n=e=>({x:e,y:e}),d1={left:"right",right:"left",bottom:"top",top:"bottom"},f1={start:"end",end:"start"};function Sa(e,t,n){return qe(e,Dt(t,n))}function rn(e,t){return typeof e=="function"?e(t):e}function on(e){return e.split("-")[0]}function Ur(e){return e.split("-")[1]}function Tu(e){return e==="x"?"y":"x"}function Pu(e){return e==="y"?"height":"width"}function Ln(e){return["top","bottom"].includes(on(e))?"y":"x"}function Ru(e){return Tu(Ln(e))}function p1(e,t,n){n===void 0&&(n=!1);const r=Ur(e),o=Ru(e),i=Pu(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=al(l)),[l,al(l)]}function m1(e){const t=al(e);return[Ea(e),t,Ea(t)]}function Ea(e){return e.replace(/start|end/g,t=>f1[t])}function h1(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}function g1(e,t,n,r){const o=Ur(e);let i=h1(on(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(Ea)))),i}function al(e){return e.replace(/left|right|bottom|top/g,t=>d1[t])}function v1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Cm(e){return typeof e!="number"?v1(e):{top:e,right:e,bottom:e,left:e}}function ul(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ed(e,t,n){let{reference:r,floating:o}=e;const i=Ln(t),l=Ru(t),s=Pu(l),a=on(t),u=i==="y",f=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let v;switch(a){case"top":v={x:f,y:r.y-o.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:c};break;case"left":v={x:r.x-o.width,y:c};break;default:v={x:r.x,y:r.y}}switch(Ur(t)){case"start":v[l]-=p*(n&&u?-1:1);break;case"end":v[l]+=p*(n&&u?-1:1);break}return v}const y1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:c}=Ed(u,r,a),p=r,v={},y=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:f=0}=rn(e,t)||{};if(u==null)return{};const c=Cm(f),p={x:n,y:r},v=Ru(o),y=Pu(v),w=await l.getDimensions(u),E=v==="y",m=E?"top":"left",d=E?"bottom":"right",g=E?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[v]-p[v]-i.floating[y],C=p[v]-i.reference[v],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let N=T?T[g]:0;(!N||!await(l.isElement==null?void 0:l.isElement(T)))&&(N=s.floating[g]||i.floating[y]);const A=S/2-C/2,V=N/2-w[y]/2-1,D=Dt(c[m],V),Y=Dt(c[d],V),H=D,Q=N-w[y]-Y,P=N/2-w[y]/2+A,R=Sa(H,P,Q),U=!a.arrow&&Ur(o)!=null&&P!==R&&i.reference[y]/2-(PP<=0)){var Y,H;const P=(((Y=i.flip)==null?void 0:Y.index)||0)+1,R=N[P];if(R)return{data:{index:P,overflows:D},reset:{placement:R}};let U=(H=D.filter(j=>j.overflows[0]<=0).sort((j,b)=>j.overflows[1]-b.overflows[1])[0])==null?void 0:H.placement;if(!U)switch(v){case"bestFit":{var Q;const j=(Q=D.filter(b=>{if(T){const _=Ln(b.placement);return _===d||_==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(_=>_>0).reduce((_,$)=>_+$,0)]).sort((b,_)=>b[1]-_[1])[0])==null?void 0:Q[0];j&&(U=j);break}case"initialPlacement":U=s;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function Cd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kd(e){return c1.some(t=>e[t]>=0)}const S1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=rn(e,t);switch(r){case"referenceHidden":{const i=await zo(t,{...o,elementContext:"reference"}),l=Cd(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:kd(l)}}}case"escaped":{const i=await zo(t,{...o,altBoundary:!0}),l=Cd(i,n.floating);return{data:{escapedOffsets:l,escaped:kd(l)}}}default:return{}}}}};async function E1(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=on(n),s=Ur(n),a=Ln(n)==="y",u=["left","top"].includes(l)?-1:1,f=i&&a?-1:1,c=rn(t,e);let{mainAxis:p,crossAxis:v,alignmentAxis:y}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return s&&typeof y=="number"&&(v=s==="end"?y*-1:y),a?{x:v*f,y:p*u}:{x:p*u,y:v*f}}const C1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await E1(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},k1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:E=>{let{x:m,y:d}=E;return{x:m,y:d}}},...a}=rn(e,t),u={x:n,y:r},f=await zo(t,a),c=Ln(on(o)),p=Tu(c);let v=u[p],y=u[c];if(i){const E=p==="y"?"top":"left",m=p==="y"?"bottom":"right",d=v+f[E],g=v-f[m];v=Sa(d,v,g)}if(l){const E=c==="y"?"top":"left",m=c==="y"?"bottom":"right",d=y+f[E],g=y-f[m];y=Sa(d,y,g)}const w=s.fn({...t,[p]:v,[c]:y});return{...w,data:{x:w.x-n,y:w.y-r}}}}},N1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=rn(e,t),f={x:n,y:r},c=Ln(o),p=Tu(c);let v=f[p],y=f[c];const w=rn(s,t),E=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(a){const g=p==="y"?"height":"width",S=i.reference[p]-i.floating[g]+E.mainAxis,C=i.reference[p]+i.reference[g]-E.mainAxis;vC&&(v=C)}if(u){var m,d;const g=p==="y"?"width":"height",S=["top","left"].includes(on(o)),C=i.reference[c]-i.floating[g]+(S&&((m=l.offset)==null?void 0:m[c])||0)+(S?0:E.crossAxis),T=i.reference[c]+i.reference[g]+(S?0:((d=l.offset)==null?void 0:d[c])||0)-(S?E.crossAxis:0);yT&&(y=T)}return{[p]:v,[c]:y}}}},b1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:l=()=>{},...s}=rn(e,t),a=await zo(t,s),u=on(n),f=Ur(n),c=Ln(n)==="y",{width:p,height:v}=r.floating;let y,w;u==="top"||u==="bottom"?(y=u,w=f===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(w=u,y=f==="end"?"top":"bottom");const E=v-a.top-a.bottom,m=p-a.left-a.right,d=Dt(v-a[y],E),g=Dt(p-a[w],m),S=!t.middlewareData.shift;let C=d,T=g;if(c?T=f||S?Dt(g,m):m:C=f||S?Dt(d,E):E,S&&!f){const A=qe(a.left,0),V=qe(a.right,0),D=qe(a.top,0),Y=qe(a.bottom,0);c?T=p-2*(A!==0||V!==0?A+V:qe(a.left,a.right)):C=v-2*(D!==0||Y!==0?D+Y:qe(a.top,a.bottom))}await l({...t,availableWidth:T,availableHeight:C});const N=await o.getDimensions(i.floating);return p!==N.width||v!==N.height?{reset:{rects:!0}}:{}}}};function Hr(e){return km(e)?(e.nodeName||"").toLowerCase():"#document"}function nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sn(e){var t;return(t=(km(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function km(e){return e instanceof Node||e instanceof nt(e).Node}function _t(e){return e instanceof Element||e instanceof nt(e).Element}function jt(e){return e instanceof HTMLElement||e instanceof nt(e).HTMLElement}function Nd(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nt(e).ShadowRoot}function Go(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function T1(e){return["table","td","th"].includes(Hr(e))}function Rl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function _u(e){const t=Au(),n=_t(e)?At(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function P1(e){let t=Mn(e);for(;jt(t)&&!Dr(t);){if(_u(t))return t;if(Rl(t))return null;t=Mn(t)}return null}function Au(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Dr(e){return["html","body","#document"].includes(Hr(e))}function At(e){return nt(e).getComputedStyle(e)}function _l(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mn(e){if(Hr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nd(e)&&e.host||sn(e);return Nd(t)?t.host:t}function Nm(e){const t=Mn(e);return Dr(t)?e.ownerDocument?e.ownerDocument.body:e.body:jt(t)&&Go(t)?t:Nm(t)}function Io(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Nm(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=nt(o);return i?t.concat(l,l.visualViewport||[],Go(o)?o:[],l.frameElement&&n?Io(l.frameElement):[]):t.concat(o,Io(o,[],n))}function bm(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=jt(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=sl(n)!==i||sl(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function Ou(e){return _t(e)?e:e.contextElement}function Pr(e){const t=Ou(e);if(!jt(t))return $n(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=bm(t);let l=(i?sl(n.width):n.width)/r,s=(i?sl(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const R1=$n(0);function Tm(e){const t=nt(e);return!Au()||!t.visualViewport?R1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nt(e)?!1:t}function qn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ou(e);let l=$n(1);t&&(r?_t(r)&&(l=Pr(r)):l=Pr(e));const s=_1(i,n,r)?Tm(i):$n(0);let a=(o.left+s.x)/l.x,u=(o.top+s.y)/l.y,f=o.width/l.x,c=o.height/l.y;if(i){const p=nt(i),v=r&&_t(r)?nt(r):r;let y=p,w=y.frameElement;for(;w&&r&&v!==y;){const E=Pr(w),m=w.getBoundingClientRect(),d=At(w),g=m.left+(w.clientLeft+parseFloat(d.paddingLeft))*E.x,S=m.top+(w.clientTop+parseFloat(d.paddingTop))*E.y;a*=E.x,u*=E.y,f*=E.x,c*=E.y,a+=g,u+=S,y=nt(w),w=y.frameElement}}return ul({width:f,height:c,x:a,y:u})}function A1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=sn(r),s=t?Rl(t.floating):!1;if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=$n(1);const f=$n(0),c=jt(r);if((c||!c&&!i)&&((Hr(r)!=="body"||Go(l))&&(a=_l(r)),jt(r))){const p=qn(r);u=Pr(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+f.x,y:n.y*u.y-a.scrollTop*u.y+f.y}}function O1(e){return Array.from(e.getClientRects())}function Pm(e){return qn(sn(e)).left+_l(e).scrollLeft}function $1(e){const t=sn(e),n=_l(e),r=e.ownerDocument.body,o=qe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=qe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Pm(e);const s=-n.scrollTop;return At(r).direction==="rtl"&&(l+=qe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}function L1(e,t){const n=nt(e),r=sn(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const u=Au();(!u||u&&t==="fixed")&&(s=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:s,y:a}}function M1(e,t){const n=qn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=jt(e)?Pr(e):$n(1),l=e.clientWidth*i.x,s=e.clientHeight*i.y,a=o*i.x,u=r*i.y;return{width:l,height:s,x:a,y:u}}function bd(e,t,n){let r;if(t==="viewport")r=L1(e,n);else if(t==="document")r=$1(sn(e));else if(_t(t))r=M1(t,n);else{const o=Tm(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ul(r)}function Rm(e,t){const n=Mn(e);return n===t||!_t(n)||Dr(n)?!1:At(n).position==="fixed"||Rm(n,t)}function D1(e,t){const n=t.get(e);if(n)return n;let r=Io(e,[],!1).filter(s=>_t(s)&&Hr(s)!=="body"),o=null;const i=At(e).position==="fixed";let l=i?Mn(e):e;for(;_t(l)&&!Dr(l);){const s=At(l),a=_u(l);!a&&s.position==="fixed"&&(o=null),(i?!a&&!o:!a&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Go(l)&&!a&&Rm(e,l))?r=r.filter(f=>f!==l):o=s,l=Mn(l)}return t.set(e,r),r}function z1(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?Rl(t)?[]:D1(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,f)=>{const c=bd(t,f,o);return u.top=qe(c.top,u.top),u.right=Dt(c.right,u.right),u.bottom=Dt(c.bottom,u.bottom),u.left=qe(c.left,u.left),u},bd(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function I1(e){const{width:t,height:n}=bm(e);return{width:t,height:n}}function j1(e,t,n){const r=jt(t),o=sn(t),i=n==="fixed",l=qn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=$n(0);if(r||!r&&!i)if((Hr(t)!=="body"||Go(o))&&(s=_l(t)),r){const c=qn(t,!0,i,t);a.x=c.x+t.clientLeft,a.y=c.y+t.clientTop}else o&&(a.x=Pm(o));const u=l.left+s.scrollLeft-a.x,f=l.top+s.scrollTop-a.y;return{x:u,y:f,width:l.width,height:l.height}}function hs(e){return At(e).position==="static"}function Td(e,t){return!jt(e)||At(e).position==="fixed"?null:t?t(e):e.offsetParent}function _m(e,t){const n=nt(e);if(Rl(e))return n;if(!jt(e)){let o=Mn(e);for(;o&&!Dr(o);){if(_t(o)&&!hs(o))return o;o=Mn(o)}return n}let r=Td(e,t);for(;r&&T1(r)&&hs(r);)r=Td(r,t);return r&&Dr(r)&&hs(r)&&!_u(r)?n:r||P1(e)||n}const F1=async function(e){const t=this.getOffsetParent||_m,n=this.getDimensions,r=await n(e.floating);return{reference:j1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function B1(e){return At(e).direction==="rtl"}const U1={convertOffsetParentRelativeRectToViewportRelativeRect:A1,getDocumentElement:sn,getClippingRect:z1,getOffsetParent:_m,getElementRects:F1,getClientRects:O1,getDimensions:I1,getScale:Pr,isElement:_t,isRTL:B1};function H1(e,t){let n=null,r;const o=sn(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),i();const{left:u,top:f,width:c,height:p}=e.getBoundingClientRect();if(s||t(),!c||!p)return;const v=yi(f),y=yi(o.clientWidth-(u+c)),w=yi(o.clientHeight-(f+p)),E=yi(u),d={rootMargin:-v+"px "+-y+"px "+-w+"px "+-E+"px",threshold:qe(0,Dt(1,a))||1};let g=!0;function S(C){const T=C[0].intersectionRatio;if(T!==a){if(!g)return l();T?l(!1,T):r=setTimeout(()=>{l(!1,1e-7)},1e3)}g=!1}try{n=new IntersectionObserver(S,{...d,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,d)}n.observe(e)}return l(!0),i}function V1(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Ou(e),f=o||i?[...u?Io(u):[],...Io(t)]:[];f.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const c=u&&s?H1(u,n):null;let p=-1,v=null;l&&(v=new ResizeObserver(m=>{let[d]=m;d&&d.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var g;(g=v)==null||g.observe(t)})),n()}),u&&!a&&v.observe(u),v.observe(t));let y,w=a?qn(e):null;a&&E();function E(){const m=qn(e);w&&(m.x!==w.x||m.y!==w.y||m.width!==w.width||m.height!==w.height)&&n(),w=m,y=requestAnimationFrame(E)}return n(),()=>{var m;f.forEach(d=>{o&&d.removeEventListener("scroll",n),i&&d.removeEventListener("resize",n)}),c==null||c(),(m=v)==null||m.disconnect(),v=null,a&&cancelAnimationFrame(y)}}const W1=C1,Y1=k1,K1=x1,G1=b1,Q1=S1,Pd=w1,X1=N1,Z1=(e,t,n)=>{const r=new Map,o={platform:U1,...n},i={...o.platform,_c:r};return y1(e,t,{...o,platform:i})};var Mi=typeof document<"u"?h.useLayoutEffect:h.useEffect;function cl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!cl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Am(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rd(e,t){const n=Am(e);return Math.round(t*n)/n}function _d(e){const t=h.useRef(e);return Mi(()=>{t.current=e}),t}function J1(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[f,c]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,v]=h.useState(r);cl(p,r)||v(r);const[y,w]=h.useState(null),[E,m]=h.useState(null),d=h.useCallback(j=>{j!==T.current&&(T.current=j,w(j))},[]),g=h.useCallback(j=>{j!==N.current&&(N.current=j,m(j))},[]),S=i||y,C=l||E,T=h.useRef(null),N=h.useRef(null),A=h.useRef(f),V=a!=null,D=_d(a),Y=_d(o),H=h.useCallback(()=>{if(!T.current||!N.current)return;const j={placement:t,strategy:n,middleware:p};Y.current&&(j.platform=Y.current),Z1(T.current,N.current,j).then(b=>{const _={...b,isPositioned:!0};Q.current&&!cl(A.current,_)&&(A.current=_,Vo.flushSync(()=>{c(_)}))})},[p,t,n,Y]);Mi(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,c(j=>({...j,isPositioned:!1})))},[u]);const Q=h.useRef(!1);Mi(()=>(Q.current=!0,()=>{Q.current=!1}),[]),Mi(()=>{if(S&&(T.current=S),C&&(N.current=C),S&&C){if(D.current)return D.current(S,C,H);H()}},[S,C,H,D,V]);const P=h.useMemo(()=>({reference:T,floating:N,setReference:d,setFloating:g}),[d,g]),R=h.useMemo(()=>({reference:S,floating:C}),[S,C]),U=h.useMemo(()=>{const j={position:n,left:0,top:0};if(!R.floating)return j;const b=Rd(R.floating,f.x),_=Rd(R.floating,f.y);return s?{...j,transform:"translate("+b+"px, "+_+"px)",...Am(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:b,top:_}},[n,s,R.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:H,refs:P,elements:R,floatingStyles:U}),[f,H,P,R,U])}const q1=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Pd({element:r.current,padding:o}).fn(n):{}:r?Pd({element:r,padding:o}).fn(n):{}}}},ew=(e,t)=>({...W1(e),options:[e,t]}),tw=(e,t)=>({...Y1(e),options:[e,t]}),nw=(e,t)=>({...X1(e),options:[e,t]}),rw=(e,t)=>({...K1(e),options:[e,t]}),ow=(e,t)=>({...G1(e),options:[e,t]}),iw=(e,t)=>({...Q1(e),options:[e,t]}),lw=(e,t)=>({...q1(e),options:[e,t]});function sw(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function aw(...e){return t=>e.forEach(n=>sw(n,t))}var Om=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(cw);if(i){const l=i.props.children,s=o.map(a=>a===i?h.Children.count(l)>1?h.Children.only(null):h.isValidElement(l)?l.props.children:null:a);return k.jsx(Ca,{...r,ref:t,children:h.isValidElement(l)?h.cloneElement(l,void 0,s):null})}return k.jsx(Ca,{...r,ref:t,children:n})});Om.displayName="Slot";var Ca=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=fw(n);return h.cloneElement(n,{...dw(r,n.props),ref:t?aw(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});Ca.displayName="SlotClone";var uw=({children:e})=>k.jsx(k.Fragment,{children:e});function cw(e){return h.isValidElement(e)&&e.type===uw}function dw(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function fw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],mw=pw.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?Om:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(s,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),hw="Arrow",$m=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return k.jsx(mw.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:k.jsx("polygon",{points:"0,0 30,0 15,10"})})});$m.displayName=hw;var gw=$m;function vw(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Lm(...e){return t=>e.forEach(n=>vw(n,t))}function Mm(...e){return h.useCallback(Lm(...e),e)}function yw(e,t=[]){let n=[];function r(i,l){const s=h.createContext(l),a=n.length;n=[...n,l];function u(c){const{scope:p,children:v,...y}=c,w=(p==null?void 0:p[e][a])||s,E=h.useMemo(()=>y,Object.values(y));return k.jsx(w.Provider,{value:E,children:v})}function f(c,p){const v=(p==null?void 0:p[e][a])||s,y=h.useContext(v);if(y)return y;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const o=()=>{const i=n.map(l=>h.createContext(l));return function(s){const a=(s==null?void 0:s[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,ww(o,...t)]}function ww(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const c=a(i)[`__scope${u}`];return{...s,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Dm=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(Sw);if(i){const l=i.props.children,s=o.map(a=>a===i?h.Children.count(l)>1?h.Children.only(null):h.isValidElement(l)?l.props.children:null:a);return k.jsx(ka,{...r,ref:t,children:h.isValidElement(l)?h.cloneElement(l,void 0,s):null})}return k.jsx(ka,{...r,ref:t,children:n})});Dm.displayName="Slot";var ka=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=Cw(n);return h.cloneElement(n,{...Ew(r,n.props),ref:t?Lm(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});ka.displayName="SlotClone";var xw=({children:e})=>k.jsx(k.Fragment,{children:e});function Sw(e){return h.isValidElement(e)&&e.type===xw}function Ew(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Cw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],zm=kw.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?Dm:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(s,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Nw(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Na=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{};function bw(e){const[t,n]=h.useState(void 0);return Na(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,s;if("borderBoxSize"in i){const a=i.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $u="Popper",[Im,jm]=yw($u),[Tw,Fm]=Im($u),Bm=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return k.jsx(Tw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Bm.displayName=$u;var Um="PopperAnchor",Hm=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Fm(Um,n),l=h.useRef(null),s=Mm(t,l);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:k.jsx(zm.div,{...o,ref:s})});Hm.displayName=Um;var Lu="PopperContent",[Pw,Rw]=Im(Lu),Vm=h.forwardRef((e,t)=>{var we,Me,wt,Be,st,be;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:c="partial",hideWhenDetached:p=!1,updatePositionStrategy:v="optimized",onPlaced:y,...w}=e,E=Fm(Lu,n),[m,d]=h.useState(null),g=Mm(t,xt=>d(xt)),[S,C]=h.useState(null),T=bw(S),N=(T==null?void 0:T.width)??0,A=(T==null?void 0:T.height)??0,V=r+(i!=="center"?"-"+i:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},Y=Array.isArray(u)?u:[u],H=Y.length>0,Q={padding:D,boundary:Y.filter(Aw),altBoundary:H},{refs:P,floatingStyles:R,placement:U,isPositioned:j,middlewareData:b}=J1({strategy:"fixed",placement:V,whileElementsMounted:(...xt)=>V1(...xt,{animationFrame:v==="always"}),elements:{reference:E.anchor},middleware:[ew({mainAxis:o+A,alignmentAxis:l}),a&&tw({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?nw():void 0,...Q}),a&&rw({...Q}),ow({...Q,apply:({elements:xt,rects:an,availableWidth:he,availableHeight:Qe})=>{const{width:un,height:nr}=an.reference,at=xt.floating.style;at.setProperty("--radix-popper-available-width",`${he}px`),at.setProperty("--radix-popper-available-height",`${Qe}px`),at.setProperty("--radix-popper-anchor-width",`${un}px`),at.setProperty("--radix-popper-anchor-height",`${nr}px`)}}),S&&lw({element:S,padding:s}),Ow({arrowWidth:N,arrowHeight:A}),p&&iw({strategy:"referenceHidden",...Q})]}),[_,$]=Km(U),L=Nw(y);Na(()=>{j&&(L==null||L())},[j,L]);const z=(we=b.arrow)==null?void 0:we.x,J=(Me=b.arrow)==null?void 0:Me.y,W=((wt=b.arrow)==null?void 0:wt.centerOffset)!==0,[G,X]=h.useState();return Na(()=>{m&&X(window.getComputedStyle(m).zIndex)},[m]),k.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:j?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(Be=b.transformOrigin)==null?void 0:Be.x,(st=b.transformOrigin)==null?void 0:st.y].join(" "),...((be=b.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:k.jsx(Pw,{scope:n,placedSide:_,onArrowChange:C,arrowX:z,arrowY:J,shouldHideArrow:W,children:k.jsx(zm.div,{"data-side":_,"data-align":$,...w,ref:g,style:{...w.style,animation:j?void 0:"none"}})})})});Vm.displayName=Lu;var Wm="PopperArrow",_w={top:"bottom",right:"left",bottom:"top",left:"right"},Ym=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Rw(Wm,r),l=_w[i.placedSide];return k.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:k.jsx(gw,{...o,ref:n,style:{...o.style,display:"block"}})})});Ym.displayName=Wm;function Aw(e){return e!==null}var Ow=e=>({name:"transformOrigin",options:e,fn(t){var E,m,d;const{placement:n,rects:r,middlewareData:o}=t,l=((E=o.arrow)==null?void 0:E.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,f]=Km(n),c={start:"0%",center:"50%",end:"100%"}[f],p=(((m=o.arrow)==null?void 0:m.x)??0)+s/2,v=(((d=o.arrow)==null?void 0:d.y)??0)+a/2;let y="",w="";return u==="bottom"?(y=l?c:`${p}px`,w=`${-a}px`):u==="top"?(y=l?c:`${p}px`,w=`${r.floating.height+a}px`):u==="right"?(y=`${-a}px`,w=l?c:`${v}px`):u==="left"&&(y=`${r.floating.width+a}px`,w=l?c:`${v}px`),{data:{x:y,y:w}}}});function Km(e){const[t,n="center"]=e.split("-");return[t,n]}var $w=Bm,Lw=Hm,Mw=Vm,Dw=Ym;function zw(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Gm=e=>{const{present:t,children:n}=e,r=Iw(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=Yo(r.ref,jw(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:i}):null};Gm.displayName="Presence";function Iw(e){const[t,n]=h.useState(),r=h.useRef({}),o=h.useRef(e),i=h.useRef("none"),l=e?"mounted":"unmounted",[s,a]=zw(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=wi(r.current);i.current=s==="mounted"?u:"none"},[s]),xa(()=>{const u=r.current,f=o.current;if(f!==e){const p=i.current,v=wi(u);e?a("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(f&&p!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),xa(()=>{if(t){const u=c=>{const v=wi(r.current).includes(c.animationName);c.target===t&&v&&Vo.flushSync(()=>a("ANIMATION_END"))},f=c=>{c.target===t&&(i.current=wi(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:h.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function wi(e){return(e==null?void 0:e.animationName)||"none"}function jw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Fw({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Bw({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,s=Ko(n),a=h.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&s(c)}else o(u)},[i,e,o,s]);return[l,a]}function Bw({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,o=h.useRef(r),i=Ko(t);return h.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Uw(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Hw(...e){return t=>e.forEach(n=>Uw(n,t))}var Qm=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(Ww);if(i){const l=i.props.children,s=o.map(a=>a===i?h.Children.count(l)>1?h.Children.only(null):h.isValidElement(l)?l.props.children:null:a);return k.jsx(ba,{...r,ref:t,children:h.isValidElement(l)?h.cloneElement(l,void 0,s):null})}return k.jsx(ba,{...r,ref:t,children:n})});Qm.displayName="Slot";var ba=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=Kw(n);return h.cloneElement(n,{...Yw(r,n.props),ref:t?Hw(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});ba.displayName="SlotClone";var Vw=({children:e})=>k.jsx(k.Fragment,{children:e});function Ww(e){return h.isValidElement(e)&&e.type===Vw}function Yw(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Kw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qw=Gw.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...l}=r,s=i?Qm:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(s,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xw="VisuallyHidden",Xm=h.forwardRef((e,t)=>k.jsx(Qw.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Xm.displayName=Xw;var Zw=Xm,[Al,kx]=Yy("Tooltip",[jm]),Ol=jm(),Zm="TooltipProvider",Jw=700,Ta="tooltip.open",[qw,Mu]=Al(Zm),Jm=e=>{const{__scopeTooltip:t,delayDuration:n=Jw,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[l,s]=h.useState(!0),a=h.useRef(!1),u=h.useRef(0);return h.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),k.jsx(qw,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(u.current),s(!1)},[]),onClose:h.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(f=>{a.current=f},[]),disableHoverableContent:o,children:i})};Jm.displayName=Zm;var $l="Tooltip",[ex,Ll]=Al($l),qm=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:s}=e,a=Mu($l,e.__scopeTooltip),u=Ol(t),[f,c]=h.useState(null),p=u1(),v=h.useRef(0),y=l??a.disableHoverableContent,w=s??a.delayDuration,E=h.useRef(!1),[m=!1,d]=Fw({prop:r,defaultProp:o,onChange:N=>{N?(a.onOpen(),document.dispatchEvent(new CustomEvent(Ta))):a.onClose(),i==null||i(N)}}),g=h.useMemo(()=>m?E.current?"delayed-open":"instant-open":"closed",[m]),S=h.useCallback(()=>{window.clearTimeout(v.current),E.current=!1,d(!0)},[d]),C=h.useCallback(()=>{window.clearTimeout(v.current),d(!1)},[d]),T=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{E.current=!0,d(!0)},w)},[w,d]);return h.useEffect(()=>()=>window.clearTimeout(v.current),[]),k.jsx($w,{...u,children:k.jsx(ex,{scope:t,contentId:p,open:m,stateAttribute:g,trigger:f,onTriggerChange:c,onTriggerEnter:h.useCallback(()=>{a.isOpenDelayed?T():S()},[a.isOpenDelayed,T,S]),onTriggerLeave:h.useCallback(()=>{y?C():window.clearTimeout(v.current)},[C,y]),onOpen:S,onClose:C,disableHoverableContent:y,children:n})})};qm.displayName=$l;var Pa="TooltipTrigger",eh=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ll(Pa,n),i=Mu(Pa,n),l=Ol(n),s=h.useRef(null),a=Yo(t,s,o.onTriggerChange),u=h.useRef(!1),f=h.useRef(!1),c=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),k.jsx(Lw,{asChild:!0,...l,children:k.jsx(bu.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:a,onPointerMove:Qt(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Qt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Qt(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:Qt(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Qt(e.onBlur,o.onClose),onClick:Qt(e.onClick,o.onClose)})})});eh.displayName=Pa;var tx="TooltipPortal",[Nx,nx]=Al(tx,{forceMount:void 0}),zr="TooltipContent",th=h.forwardRef((e,t)=>{const n=nx(zr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,l=Ll(zr,e.__scopeTooltip);return k.jsx(Gm,{present:r||l.open,children:l.disableHoverableContent?k.jsx(nh,{side:o,...i,ref:t}):k.jsx(rx,{side:o,...i,ref:t})})}),rx=h.forwardRef((e,t)=>{const n=Ll(zr,e.__scopeTooltip),r=Mu(zr,e.__scopeTooltip),o=h.useRef(null),i=Yo(t,o),[l,s]=h.useState(null),{trigger:a,onClose:u}=n,f=o.current,{onPointerInTransitChange:c}=r,p=h.useCallback(()=>{s(null),c(!1)},[c]),v=h.useCallback((y,w)=>{const E=y.currentTarget,m={x:y.clientX,y:y.clientY},d=sx(m,E.getBoundingClientRect()),g=ax(m,d),S=ux(w.getBoundingClientRect()),C=dx([...g,...S]);s(C),c(!0)},[c]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(a&&f){const y=E=>v(E,f),w=E=>v(E,a);return a.addEventListener("pointerleave",y),f.addEventListener("pointerleave",w),()=>{a.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",w)}}},[a,f,v,p]),h.useEffect(()=>{if(l){const y=w=>{const E=w.target,m={x:w.clientX,y:w.clientY},d=(a==null?void 0:a.contains(E))||(f==null?void 0:f.contains(E)),g=!cx(m,l);d?p():g&&(p(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[a,f,l,u,p]),k.jsx(nh,{...e,ref:i})}),[ox,ix]=Al($l,{isInside:!1}),nh=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:l,...s}=e,a=Ll(zr,n),u=Ol(n),{onClose:f}=a;return h.useEffect(()=>(document.addEventListener(Ta,f),()=>document.removeEventListener(Ta,f)),[f]),h.useEffect(()=>{if(a.trigger){const c=p=>{const v=p.target;v!=null&&v.contains(a.trigger)&&f()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[a.trigger,f]),k.jsx(Sm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:c=>c.preventDefault(),onDismiss:f,children:k.jsxs(Mw,{"data-state":a.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[k.jsx(wm,{children:r}),k.jsx(ox,{scope:n,isInside:!0,children:k.jsx(Zw,{id:a.contentId,role:"tooltip",children:o||r})})]})})});th.displayName=zr;var rh="TooltipArrow",lx=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ol(n);return ix(rh,n).isInside?null:k.jsx(Dw,{...o,...r,ref:t})});lx.displayName=rh;function sx(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ax(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ux(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function cx(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,l=t.length-1;ir!=f>r&&n<(u-s)*(r-a)/(f-a)+s&&(o=!o)}return o}function dx(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),fx(t)}function fx(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(o.y-l.y)>=(i.y-l.y)*(o.x-l.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(o.y-l.y)>=(i.y-l.y)*(o.x-l.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var px=Jm,mx=qm,hx=eh,oh=th;const gs=px,vs=mx,ys=hx,Di=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>k.jsx(oh,{ref:r,sideOffset:t,className:ku("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",e),...n}));Di.displayName=oh.displayName;function gx(){const[e,t]=h.useState(null),[n,r]=h.useState(!1),[o,i]=h.useState(0),[l,s]=h.useState(100),[a,u]=h.useState(100),[f,c]=h.useState(255),[p,v]=h.useState(0),[y,w]=h.useState(0),[E,m]=h.useState("#FF0000"),d=(P,R,U)=>`#${((1<<24)+(P<<16)+(R<<8)+U).toString(16).slice(1)}`;h.useEffect(()=>{localStorage.removeItem("uploadedImage")},[]),h.useEffect(()=>{const P=localStorage.getItem("uploadedImage");P&&(t(P),g(P))},[n]);const g=P=>{const R=new Image;R.src=P,R.onload=()=>{const U=document.createElement("canvas"),j=U.getContext("2d");U.width=R.width,U.height=R.height,j.drawImage(R,0,0,R.width,R.height);const _=j.getImageData(0,0,R.width,R.height).data,$=[];for(let G=0;G<_.length;G+=4){const X=_[G],we=_[G+1],Me=_[G+2];if(_[G+3]>0){const Be=d(X,we,Me);$.push(Be)}}const L={};$.forEach(G=>{G in L?L[G]+=1:L[G]=1});const J=Object.keys(L).sort((G,X)=>L[X]-L[G])[0],W=T(J);N(W.r,W.g,W.b)}},S=P=>{const R=P.target,U=document.createElement("canvas"),j=U.getContext("2d");U.width=R.width,U.height=R.height,j.drawImage(R,0,0,R.width,R.height);const b=R.getBoundingClientRect(),_=R.width/b.width,$=R.height/b.height,L=(P.clientX-b.left)*_,z=(P.clientY-b.top)*$,J=j.getImageData(L,z,1,1).data,[W,G,X]=J;c(W),v(G),w(X),m(d(W,G,X));const we=N(W,G,X);i(we.h),s(we.s),u(we.l),dt.success("Color picked from image",{action:{label:"Close",onClick:()=>dt.dismiss()}})},C=(P,R,U)=>{P/=360,R/=100,U/=100;let j,b,_;if(R===0)j=b=_=U;else{const $=(J,W,G)=>(G<0&&(G+=1),G>1&&(G-=1),G<.16666666666666666?J+(W-J)*6*G:G<.5?W:G<.6666666666666666?J+(W-J)*(.6666666666666666-G)*6:J),L=U<.5?U*(1+R):U+R-U*R,z=2*U-L;j=$(z,L,P+1/3),b=$(z,L,P),_=$(z,L,P-1/3)}return{r:Math.round(j*255),g:Math.round(b*255),b:Math.round(_*255)}},T=P=>{const R=P.replace(/#/,"").match(/.{1,2}/g);return{r:parseInt(R[0],16),g:parseInt(R[1],16),b:parseInt(R[2],16)}},N=(P,R,U)=>{P/=255,R/=255,U/=255;const j=Math.max(P,R,U),b=Math.min(P,R,U);let _,$,L=(j+b)/2;if(j===b)_=$=0;else{const z=j-b;switch($=L>.5?z/(2-j-b):z/(j+b),j){case P:_=(R-U)/z+(Rdt.dismiss()}})}function V(){navigator.clipboard.writeText(E),dt.success("Copied HEX value to clipboard",{action:{label:"Close",onClick:()=>dt.dismiss()}})}function D(){navigator.clipboard.writeText(`${o}°, ${l}%, ${a}%`),dt.success("Copied HSL value to clipboard",{action:{label:"Close",onClick:()=>dt.dismiss()}})}const Y=P=>{i(P);const R=C(P,l,a);c(R.r),v(R.g),w(R.b),m(d(R.r,R.g,R.b))},H=P=>{s(P);const R=C(o,P,a);c(R.r),v(R.g),w(R.b),m(d(R.r,R.g,R.b))},Q=P=>{u(P);const R=C(o,l,P);c(R.r),v(R.g),w(R.b),m(d(R.r,R.g,R.b))};return n?k.jsxs("div",{className:"flex flex-col items-center justify-center p-4 h-screen bg-gray-100 dark:bg-gray-950 ",children:[k.jsx(om,{}),k.jsx("div",{className:"max-w-3xl w-full bg-white dark:bg-gray-900 rounded-lg shadow-lg overflow-hidden",style:{minHeight:"300px",minWidth:"700px"},children:k.jsxs("div",{className:"grid grid-cols-2 gap-6 p-6",children:[k.jsxs("div",{className:"relative flex justify-center items-center h-full",children:[k.jsx("img",{alt:"Uploaded Image",className:"w-full h-full object-cover rounded-lg",height:500,src:"/placeholder.svg",style:{aspectRatio:"500/500",objectFit:"cover"},width:500}),k.jsx("div",{className:"absolute inset-0 flex items-center justify-center border-black",style:{userSelect:"none",overflow:"hidden",scrollbarWidth:"none"},children:k.jsx("div",{className:"max-w-full max-h-full relative bg-black dark:bg-white rounded-lg border-black shadow-lg object-cover content-center overflow-auto",style:{aspectRatio:"500/500",objectFit:"cover",scrollbarWidth:"none"},children:e!==null?k.jsx("img",{src:e,onClick:S,alt:"Uploaded Image",className:"object-contain place-self-center"}):k.jsx(vx,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})})]}),k.jsxs("div",{className:"flex flex-col gap-6",children:[k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"w-16 h-16 rounded-full border-4 border-gray-200 dark:border-gray-800 flex items-center justify-center",children:k.jsx("div",{className:"w-10 h-10 rounded-full border",style:{backgroundColor:d(f,p,y)}})}),k.jsxs("div",{className:"flex-1 grid gap-1",children:[k.jsx("div",{className:"w-20 text-sm font-medium text-gray-500 dark:text-gray-400",children:"HEX"}),k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"text-lg font-semibold text-gray-900 dark:text-gray-50",children:E}),k.jsx(gs,{children:k.jsxs(vs,{children:[k.jsx(ys,{children:k.jsx(Oi,{variant:"ghost",onClick:V,className:"max-h-12 max-w-12",children:k.jsx(yx,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})})}),k.jsx(Di,{children:k.jsx("span",{className:"text-sm text-muted-foreground",children:"Copy HEX"})})]})})]})]})]}),k.jsxs("div",{className:"grid gap-4",children:[k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"Hue"}),k.jsx(Li,{className:"flex-1",value:[o],max:360,step:1,onValueChange:P=>Y(P)}),k.jsxs("div",{className:"w-16 text-right text-sm font-medium text-gray-900 dark:text-gray-50",children:[o,"°"]})]}),k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"Saturation"}),k.jsx(Li,{className:"flex-1",value:[l],max:100,step:1,onValueChange:P=>H(P)}),k.jsxs("div",{className:"w-16 text-right text-sm font-medium text-gray-900 dark:text-gray-50",children:[l,"%"]})]}),k.jsxs("div",{className:"flex items-center gap-4",children:[k.jsx("div",{className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"Lightness"}),k.jsx(Li,{className:"flex-1",value:[a],max:100,step:1,onValueChange:P=>Q(P)}),k.jsxs("div",{className:"w-16 text-right text-sm font-medium text-gray-900 dark:text-gray-50",children:[a,"%"]})]})]}),k.jsxs("div",{className:"grid gap-2",children:[k.jsxs("div",{className:"flex items-center gap-4 group",children:[k.jsx(gs,{children:k.jsxs(vs,{children:[k.jsx(ys,{children:k.jsx(Oi,{variant:"ghost",onClick:A,className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"RGB"})}),k.jsx(Di,{children:k.jsx("span",{className:"text-sm text-muted-foreground",children:"Copy RGB"})})]})}),k.jsxs("div",{className:"flex-1 text-lg font-semibold text-gray-900 dark:text-gray-50",children:[f,", ",p,", ",y]})]}),k.jsxs("div",{className:"flex items-center gap-4 group",children:[k.jsx(gs,{children:k.jsxs(vs,{children:[k.jsx(ys,{children:k.jsx(Oi,{variant:"ghost",onClick:D,className:"w-16 text-right text-sm font-medium text-gray-500 dark:text-gray-400",children:"HSL"})}),k.jsx(Di,{children:k.jsx("span",{className:"text-sm text-muted-foreground",children:"Copy HSL"})})]})}),k.jsxs("div",{className:"flex-1 text-lg font-semibold text-gray-900 dark:text-gray-50",children:[o,"°, ",l,"%, ",a,"%"]})]})]})]})]})})]}):k.jsx(dy,{setImage:t,setImageUploaded:r,image:e,imageUploaded:n})}function vx(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),k.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function yx(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",style:{enableBackground:"new 0 0 115.77 122.88"},xmlSpace:"preserve",children:[k.jsx("style",{type:"text/css",children:".st0{fill-rule:evenodd;clip-rule:evenodd;}"}),k.jsx("g",{children:k.jsx("path",{className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})]})}function wx(){return k.jsx("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-4 py-12 sm:px-6 lg:px-8",children:k.jsxs("div",{className:"mx-auto max-w-md text-center",children:[k.jsx(xx,{className:"mx-auto h-12 w-12 text-primary"}),k.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Sorry, this website is only available for desktop"}),k.jsx("p",{className:"mt-4 text-muted-foreground",children:"We apologize for the inconvenience, but our website is currently optimized for desktop devices only. Please try accessing this site from a computer or laptop."})]})})}function xx(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"blue",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}),k.jsx("path",{d:"M12 18h.01"})]})}const Sx=()=>{const e=window.navigator.userAgent.toLowerCase(),t=/mobile|android|iphone|ipad|tablet|touch|samsung|fridge/i.test(e),n=window.innerWidth<=1024;return!t&&!n};function Ex(){const[e,t]=M.useState(null);return M.useEffect(()=>{t(Sx())},[]),e===!0?k.jsx(gx,{}):k.jsx(wx,{})}ws.createRoot(document.getElementById("root")).render(k.jsx(M.StrictMode,{children:k.jsx(Ex,{})})); diff --git a/index.html b/index.html index 3364bf8..f640e9b 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Tint Tracker - +