import{c as O,x as Fn,j as n,T as Ce,i as be,k as _e,l as ye,m as Ln,n as Se,K as Ie,r as i,M as Gn,G as Z,p as U,q as x,O as Kn,Q as Un,P as $,U as Pe,V as Bn,W as Ee,Y as zn,Z as Vn,_ as Yn,$ as Wn,o as Xn,v as je,a as D,f as Hn,t as ae,L as Ne}from"./index-BnqvTfda.js";import{C as qn,a as Zn}from"./card-0DNxHdEP.js";import{B as Te}from"./Footer-D3yiUcm3.js";import{O as Qn}from"./OptimizedImage-CJaMU9lB.js";import{C as Jn}from"./checkbox-DUmWkSIN.js";import{C as ce}from"./check-xk1slcF6.js";import{u as et}from"./index-B-44TBOv.js";import{k as nt,u as tt,F as ot,R as rt}from"./Header-KCLMYIRV.js";import{c as Ae,R as at,I as st}from"./index-Tu_SaZ1r.js";import{C as it}from"./chevron-right-D-Yshan1.js";import{B as Re}from"./badge-CbC-LCnk.js";import{E as ct}from"./external-link-7WLGoFFF.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lt=O("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dt=O("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ut=O("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pt=O("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const De=O("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ft=O("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]),mt=({productId:e,variant:o="default",className:t=""})=>{const{comparisonIds:r,addToComparison:a,removeFromComparison:s,isInComparison:l}=Fn(),d=l(e),u=!d&&r.length>=4,h=()=>{d?s(e):a(e)};return o==="button"?n.jsx(Ce,{children:n.jsxs(be,{children:[n.jsx(_e,{asChild:!0,children:n.jsx("button",{onClick:h,disabled:u,className:`flex items-center gap-2 px-4 py-2 rounded-md border transition-colors ${d?"bg-primary text-primary-foreground border-primary":u?"bg-muted text-muted-foreground border-muted cursor-not-allowed":"bg-background hover:bg-accent border-input"} ${t}`,children:d?n.jsxs(n.Fragment,{children:[n.jsx(ce,{className:"h-4 w-4"}),n.jsx("span",{className:"text-sm font-medium",children:"În comparație"})]}):n.jsx("span",{className:"text-sm font-medium",children:"Adaugă la comparație"})})}),u&&n.jsx(ye,{children:n.jsx("p",{children:"Maxim 4 produse pot fi comparate"})})]})}):n.jsx(Ce,{children:n.jsxs(be,{children:[n.jsx(_e,{asChild:!0,children:n.jsxs("div",{className:`flex items-center gap-2 ${t}`,children:[n.jsx(Jn,{id:`compare-${e}`,checked:d,onCheckedChange:h,disabled:u}),n.jsx("label",{htmlFor:`compare-${e}`,className:`text-sm cursor-pointer select-none ${u?"text-muted-foreground":""}`,children:d?"În comparație":"Compară"})]})}),u&&n.jsx(ye,{children:n.jsx("p",{children:"Maxim 4 produse pot fi comparate"})})]})})};var se=["Enter"," "],ht=["ArrowDown","PageUp","Home"],Oe=["ArrowUp","PageDown","End"],xt=[...ht,...Oe],wt={ltr:[...se,"ArrowRight"],rtl:[...se,"ArrowLeft"]},gt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},B="Menu",[G,vt,Mt]=Ln(B),[S,$e]=Se(B,[Mt,Ie,Ae]),Q=Ie(),Fe=Ae(),[Ct,I]=S(B),[bt,z]=S(B),Le=e=>{const{__scopeMenu:o,open:t=!1,children:r,dir:a,onOpenChange:s,modal:l=!0}=e,d=Q(o),[u,h]=i.useState(null),p=i.useRef(!1),c=Pe(s),m=et(a);return i.useEffect(()=>{const w=()=>{p.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>p.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),n.jsx(Wn,{...d,children:n.jsx(Ct,{scope:o,open:t,onOpenChange:c,content:u,onContentChange:h,children:n.jsx(bt,{scope:o,onClose:i.useCallback(()=>c(!1),[c]),isUsingKeyboardRef:p,dir:m,modal:l,children:r})})})};Le.displayName=B;var _t="MenuAnchor",le=i.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e,a=Q(t);return n.jsx(Gn,{...a,...r,ref:o})});le.displayName=_t;var de="MenuPortal",[yt,Ge]=S(de,{forceMount:void 0}),Ke=e=>{const{__scopeMenu:o,forceMount:t,children:r,container:a}=e,s=I(de,o);return n.jsx(yt,{scope:o,forceMount:t,children:n.jsx(Z,{present:t||s.open,children:n.jsx(Vn,{asChild:!0,container:a,children:r})})})};Ke.displayName=de;var b="MenuContent",[jt,ue]=S(b),Ue=i.forwardRef((e,o)=>{const t=Ge(b,e.__scopeMenu),{forceMount:r=t.forceMount,...a}=e,s=I(b,e.__scopeMenu),l=z(b,e.__scopeMenu);return n.jsx(G.Provider,{scope:e.__scopeMenu,children:n.jsx(Z,{present:r||s.open,children:n.jsx(G.Slot,{scope:e.__scopeMenu,children:l.modal?n.jsx(Nt,{...a,ref:o}):n.jsx(Rt,{...a,ref:o})})})})}),Nt=i.forwardRef((e,o)=>{const t=I(b,e.__scopeMenu),r=i.useRef(null),a=U(o,r);return i.useEffect(()=>{const s=r.current;if(s)return nt(s)},[]),n.jsx(pe,{...e,ref:a,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:x(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),Rt=i.forwardRef((e,o)=>{const t=I(b,e.__scopeMenu);return n.jsx(pe,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),Dt=Yn("MenuContent.ScrollLock"),pe=i.forwardRef((e,o)=>{const{__scopeMenu:t,loop:r=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:d,onEntryFocus:u,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:c,onInteractOutside:m,onDismiss:w,disableOutsideScroll:g,...y}=e,M=I(b,t),N=z(b,t),k=Q(t),P=Fe(t),V=vt(t),[Pn,xe]=i.useState(null),Y=i.useRef(null),En=U(o,Y,M.onContentChange),W=i.useRef(0),X=i.useRef(""),Tn=i.useRef(0),ne=i.useRef(null),we=i.useRef("right"),te=i.useRef(0),An=g?rt:i.Fragment,On=g?{as:Dt,allowPinchZoom:!0}:void 0,$n=f=>{var T,ve;const C=X.current+f,_=V().filter(j=>!j.disabled),R=document.activeElement,oe=(T=_.find(j=>j.ref.current===R))==null?void 0:T.textValue,re=_.map(j=>j.textValue),ge=Gt(re,C,oe),F=(ve=_.find(j=>j.textValue===ge))==null?void 0:ve.ref.current;(function j(Me){X.current=Me,window.clearTimeout(W.current),Me!==""&&(W.current=window.setTimeout(()=>j(""),1e3))})(C),F&&setTimeout(()=>F.focus())};i.useEffect(()=>()=>window.clearTimeout(W.current),[]),tt();const E=i.useCallback(f=>{var _,R;return we.current===((_=ne.current)==null?void 0:_.side)&&Ut(f,(R=ne.current)==null?void 0:R.area)},[]);return n.jsx(jt,{scope:t,searchRef:X,onItemEnter:i.useCallback(f=>{E(f)&&f.preventDefault()},[E]),onItemLeave:i.useCallback(f=>{var C;E(f)||((C=Y.current)==null||C.focus(),xe(null))},[E]),onTriggerLeave:i.useCallback(f=>{E(f)&&f.preventDefault()},[E]),pointerGraceTimerRef:Tn,onPointerGraceIntentChange:i.useCallback(f=>{ne.current=f},[]),children:n.jsx(An,{...On,children:n.jsx(ot,{asChild:!0,trapped:a,onMountAutoFocus:x(s,f=>{var C;f.preventDefault(),(C=Y.current)==null||C.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:n.jsx(Kn,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:c,onInteractOutside:m,onDismiss:w,children:n.jsx(at,{asChild:!0,...P,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:Pn,onCurrentTabStopIdChange:xe,onEntryFocus:x(u,f=>{N.isUsingKeyboardRef.current||f.preventDefault()}),preventScrollOnEntryFocus:!0,children:n.jsx(Un,{role:"menu","aria-orientation":"vertical","data-state":rn(M.open),"data-radix-menu-content":"",dir:N.dir,...k,...y,ref:En,style:{outline:"none",...y.style},onKeyDown:x(y.onKeyDown,f=>{const _=f.target.closest("[data-radix-menu-content]")===f.currentTarget,R=f.ctrlKey||f.altKey||f.metaKey,oe=f.key.length===1;_&&(f.key==="Tab"&&f.preventDefault(),!R&&oe&&$n(f.key));const re=Y.current;if(f.target!==re||!xt.includes(f.key))return;f.preventDefault();const F=V().filter(T=>!T.disabled).map(T=>T.ref.current);Oe.includes(f.key)&&F.reverse(),Ft(F)}),onBlur:x(e.onBlur,f=>{f.currentTarget.contains(f.target)||(window.clearTimeout(W.current),X.current="")}),onPointerMove:x(e.onPointerMove,K(f=>{const C=f.target,_=te.current!==f.clientX;if(f.currentTarget.contains(C)&&_){const R=f.clientX>te.current?"right":"left";we.current=R,te.current=f.clientX}}))})})})})})})});Ue.displayName=b;var kt="MenuGroup",fe=i.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e;return n.jsx($.div,{role:"group",...r,ref:o})});fe.displayName=kt;var St="MenuLabel",Be=i.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e;return n.jsx($.div,{...r,ref:o})});Be.displayName=St;var H="MenuItem",ke="menu.itemSelect",J=i.forwardRef((e,o)=>{const{disabled:t=!1,onSelect:r,...a}=e,s=i.useRef(null),l=z(H,e.__scopeMenu),d=ue(H,e.__scopeMenu),u=U(o,s),h=i.useRef(!1),p=()=>{const c=s.current;if(!t&&c){const m=new CustomEvent(ke,{bubbles:!0,cancelable:!0});c.addEventListener(ke,w=>r==null?void 0:r(w),{once:!0}),zn(c,m),m.defaultPrevented?h.current=!1:l.onClose()}};return n.jsx(ze,{...a,ref:u,disabled:t,onClick:x(e.onClick,p),onPointerDown:c=>{var m;(m=e.onPointerDown)==null||m.call(e,c),h.current=!0},onPointerUp:x(e.onPointerUp,c=>{var m;h.current||(m=c.currentTarget)==null||m.click()}),onKeyDown:x(e.onKeyDown,c=>{const m=d.searchRef.current!=="";t||m&&c.key===" "||se.includes(c.key)&&(c.currentTarget.click(),c.preventDefault())})})});J.displayName=H;var ze=i.forwardRef((e,o)=>{const{__scopeMenu:t,disabled:r=!1,textValue:a,...s}=e,l=ue(H,t),d=Fe(t),u=i.useRef(null),h=U(o,u),[p,c]=i.useState(!1),[m,w]=i.useState("");return i.useEffect(()=>{const g=u.current;g&&w((g.textContent??"").trim())},[s.children]),n.jsx(G.ItemSlot,{scope:t,disabled:r,textValue:a??m,children:n.jsx(st,{asChild:!0,...d,focusable:!r,children:n.jsx($.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:h,onPointerMove:x(e.onPointerMove,K(g=>{r?l.onItemLeave(g):(l.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:x(e.onPointerLeave,K(g=>l.onItemLeave(g))),onFocus:x(e.onFocus,()=>c(!0)),onBlur:x(e.onBlur,()=>c(!1))})})})}),It="MenuCheckboxItem",Ve=i.forwardRef((e,o)=>{const{checked:t=!1,onCheckedChange:r,...a}=e;return n.jsx(qe,{scope:e.__scopeMenu,checked:t,children:n.jsx(J,{role:"menuitemcheckbox","aria-checked":q(t)?"mixed":t,...a,ref:o,"data-state":he(t),onSelect:x(a.onSelect,()=>r==null?void 0:r(q(t)?!0:!t),{checkForDefaultPrevented:!1})})})});Ve.displayName=It;var Ye="MenuRadioGroup",[Pt,Et]=S(Ye,{value:void 0,onValueChange:()=>{}}),We=i.forwardRef((e,o)=>{const{value:t,onValueChange:r,...a}=e,s=Pe(r);return n.jsx(Pt,{scope:e.__scopeMenu,value:t,onValueChange:s,children:n.jsx(fe,{...a,ref:o})})});We.displayName=Ye;var Xe="MenuRadioItem",He=i.forwardRef((e,o)=>{const{value:t,...r}=e,a=Et(Xe,e.__scopeMenu),s=t===a.value;return n.jsx(qe,{scope:e.__scopeMenu,checked:s,children:n.jsx(J,{role:"menuitemradio","aria-checked":s,...r,ref:o,"data-state":he(s),onSelect:x(r.onSelect,()=>{var l;return(l=a.onValueChange)==null?void 0:l.call(a,t)},{checkForDefaultPrevented:!1})})})});He.displayName=Xe;var me="MenuItemIndicator",[qe,Tt]=S(me,{checked:!1}),Ze=i.forwardRef((e,o)=>{const{__scopeMenu:t,forceMount:r,...a}=e,s=Tt(me,t);return n.jsx(Z,{present:r||q(s.checked)||s.checked===!0,children:n.jsx($.span,{...a,ref:o,"data-state":he(s.checked)})})});Ze.displayName=me;var At="MenuSeparator",Qe=i.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e;return n.jsx($.div,{role:"separator","aria-orientation":"horizontal",...r,ref:o})});Qe.displayName=At;var Ot="MenuArrow",Je=i.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e,a=Q(t);return n.jsx(Bn,{...a,...r,ref:o})});Je.displayName=Ot;var $t="MenuSub",[Yo,en]=S($t),L="MenuSubTrigger",nn=i.forwardRef((e,o)=>{const t=I(L,e.__scopeMenu),r=z(L,e.__scopeMenu),a=en(L,e.__scopeMenu),s=ue(L,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:u}=s,h={__scopeMenu:e.__scopeMenu},p=i.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return i.useEffect(()=>p,[p]),i.useEffect(()=>{const c=d.current;return()=>{window.clearTimeout(c),u(null)}},[d,u]),n.jsx(le,{asChild:!0,...h,children:n.jsx(ze,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":a.contentId,"data-state":rn(t.open),...e,ref:Ee(o,a.onTriggerChange),onClick:c=>{var m;(m=e.onClick)==null||m.call(e,c),!(e.disabled||c.defaultPrevented)&&(c.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:x(e.onPointerMove,K(c=>{s.onItemEnter(c),!c.defaultPrevented&&!e.disabled&&!t.open&&!l.current&&(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{t.onOpenChange(!0),p()},100))})),onPointerLeave:x(e.onPointerLeave,K(c=>{var w,g;p();const m=(w=t.content)==null?void 0:w.getBoundingClientRect();if(m){const y=(g=t.content)==null?void 0:g.dataset.side,M=y==="right",N=M?-5:5,k=m[M?"left":"right"],P=m[M?"right":"left"];s.onPointerGraceIntentChange({area:[{x:c.clientX+N,y:c.clientY},{x:k,y:m.top},{x:P,y:m.top},{x:P,y:m.bottom},{x:k,y:m.bottom}],side:y}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(c),c.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:x(e.onKeyDown,c=>{var w;const m=s.searchRef.current!=="";e.disabled||m&&c.key===" "||wt[r.dir].includes(c.key)&&(t.onOpenChange(!0),(w=t.content)==null||w.focus(),c.preventDefault())})})})});nn.displayName=L;var tn="MenuSubContent",on=i.forwardRef((e,o)=>{const t=Ge(b,e.__scopeMenu),{forceMount:r=t.forceMount,...a}=e,s=I(b,e.__scopeMenu),l=z(b,e.__scopeMenu),d=en(tn,e.__scopeMenu),u=i.useRef(null),h=U(o,u);return n.jsx(G.Provider,{scope:e.__scopeMenu,children:n.jsx(Z,{present:r||s.open,children:n.jsx(G.Slot,{scope:e.__scopeMenu,children:n.jsx(pe,{id:d.contentId,"aria-labelledby":d.triggerId,...a,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var c;l.isUsingKeyboardRef.current&&((c=u.current)==null||c.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:x(e.onFocusOutside,p=>{p.target!==d.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:x(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:x(e.onKeyDown,p=>{var w;const c=p.currentTarget.contains(p.target),m=gt[l.dir].includes(p.key);c&&m&&(s.onOpenChange(!1),(w=d.trigger)==null||w.focus(),p.preventDefault())})})})})})});on.displayName=tn;function rn(e){return e?"open":"closed"}function q(e){return e==="indeterminate"}function he(e){return q(e)?"indeterminate":e?"checked":"unchecked"}function Ft(e){const o=document.activeElement;for(const t of e)if(t===o||(t.focus(),document.activeElement!==o))return}function Lt(e,o){return e.map((t,r)=>e[(o+r)%e.length])}function Gt(e,o,t){const a=o.length>1&&Array.from(o).every(h=>h===o[0])?o[0]:o,s=t?e.indexOf(t):-1;let l=Lt(e,Math.max(s,0));a.length===1&&(l=l.filter(h=>h!==t));const u=l.find(h=>h.toLowerCase().startsWith(a.toLowerCase()));return u!==t?u:void 0}function Kt(e,o){const{x:t,y:r}=e;let a=!1;for(let s=0,l=o.length-1;s<o.length;l=s++){const d=o[s],u=o[l],h=d.x,p=d.y,c=u.x,m=u.y;p>r!=m>r&&t<(c-h)*(r-p)/(m-p)+h&&(a=!a)}return a}function Ut(e,o){if(!o)return!1;const t={x:e.clientX,y:e.clientY};return Kt(t,o)}function K(e){return o=>o.pointerType==="mouse"?e(o):void 0}var Bt=Le,zt=le,Vt=Ke,Yt=Ue,Wt=fe,Xt=Be,Ht=J,qt=Ve,Zt=We,Qt=He,Jt=Ze,eo=Qe,no=Je,to=nn,oo=on,ee="DropdownMenu",[ro,Wo]=Se(ee,[$e]),v=$e(),[ao,an]=ro(ee),sn=e=>{const{__scopeDropdownMenu:o,children:t,dir:r,open:a,defaultOpen:s,onOpenChange:l,modal:d=!0}=e,u=v(o),h=i.useRef(null),[p,c]=Xn({prop:a,defaultProp:s??!1,onChange:l,caller:ee});return n.jsx(ao,{scope:o,triggerId:je(),triggerRef:h,contentId:je(),open:p,onOpenChange:c,onOpenToggle:i.useCallback(()=>c(m=>!m),[c]),modal:d,children:n.jsx(Bt,{...u,open:p,onOpenChange:c,dir:r,modal:d,children:t})})};sn.displayName=ee;var cn="DropdownMenuTrigger",ln=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,disabled:r=!1,...a}=e,s=an(cn,t),l=v(t);return n.jsx(zt,{asChild:!0,...l,children:n.jsx($.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Ee(o,s.triggerRef),onPointerDown:x(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(s.onOpenToggle(),s.open||d.preventDefault())}),onKeyDown:x(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&s.onOpenToggle(),d.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});ln.displayName=cn;var so="DropdownMenuPortal",dn=e=>{const{__scopeDropdownMenu:o,...t}=e,r=v(o);return n.jsx(Vt,{...r,...t})};dn.displayName=so;var un="DropdownMenuContent",pn=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=an(un,t),s=v(t),l=i.useRef(!1);return n.jsx(Yt,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...r,ref:o,onCloseAutoFocus:x(e.onCloseAutoFocus,d=>{var u;l.current||(u=a.triggerRef.current)==null||u.focus(),l.current=!1,d.preventDefault()}),onInteractOutside:x(e.onInteractOutside,d=>{const u=d.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,p=u.button===2||h;(!a.modal||p)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pn.displayName=un;var io="DropdownMenuGroup",co=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Wt,{...a,...r,ref:o})});co.displayName=io;var lo="DropdownMenuLabel",fn=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Xt,{...a,...r,ref:o})});fn.displayName=lo;var uo="DropdownMenuItem",mn=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Ht,{...a,...r,ref:o})});mn.displayName=uo;var po="DropdownMenuCheckboxItem",hn=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(qt,{...a,...r,ref:o})});hn.displayName=po;var fo="DropdownMenuRadioGroup",mo=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Zt,{...a,...r,ref:o})});mo.displayName=fo;var ho="DropdownMenuRadioItem",xn=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Qt,{...a,...r,ref:o})});xn.displayName=ho;var xo="DropdownMenuItemIndicator",wn=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Jt,{...a,...r,ref:o})});wn.displayName=xo;var wo="DropdownMenuSeparator",gn=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(eo,{...a,...r,ref:o})});gn.displayName=wo;var go="DropdownMenuArrow",vo=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(no,{...a,...r,ref:o})});vo.displayName=go;var Mo="DropdownMenuSubTrigger",vn=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(to,{...a,...r,ref:o})});vn.displayName=Mo;var Co="DropdownMenuSubContent",Mn=i.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(oo,{...a,...r,ref:o,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mn.displayName=Co;var bo=sn,_o=ln,yo=dn,Cn=pn,bn=fn,_n=mn,yn=hn,jn=xn,Nn=wn,Rn=gn,Dn=vn,kn=Mn;const jo=bo,No=_o,Ro=i.forwardRef(({className:e,inset:o,children:t,...r},a)=>n.jsxs(Dn,{ref:a,className:D("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",o&&"pl-8",e),...r,children:[t,n.jsx(it,{className:"ml-auto h-4 w-4"})]}));Ro.displayName=Dn.displayName;const Do=i.forwardRef(({className:e,...o},t)=>n.jsx(kn,{ref:t,className:D("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));Do.displayName=kn.displayName;const Sn=i.forwardRef(({className:e,sideOffset:o=4,...t},r)=>n.jsx(yo,{children:n.jsx(Cn,{ref:r,sideOffset:o,className:D("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));Sn.displayName=Cn.displayName;const A=i.forwardRef(({className:e,inset:o,...t},r)=>n.jsx(_n,{ref:r,className:D("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",o&&"pl-8",e),...t}));A.displayName=_n.displayName;const ko=i.forwardRef(({className:e,children:o,checked:t,...r},a)=>n.jsxs(yn,{ref:a,className:D("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:t,...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(Nn,{children:n.jsx(ce,{className:"h-4 w-4"})})}),o]}));ko.displayName=yn.displayName;const So=i.forwardRef(({className:e,children:o,...t},r)=>n.jsxs(jn,{ref:r,className:D("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...t,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(Nn,{children:n.jsx(lt,{className:"h-2 w-2 fill-current"})})}),o]}));So.displayName=jn.displayName;const Io=i.forwardRef(({className:e,inset:o,...t},r)=>n.jsx(bn,{ref:r,className:D("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",e),...t}));Io.displayName=bn.displayName;const ie=i.forwardRef(({className:e,...o},t)=>n.jsx(Rn,{ref:t,className:D("-mx-1 my-1 h-px bg-muted",e),...o}));ie.displayName=Rn.displayName;const Po=({url:e,title:o,description:t,price:r,variant:a="outline",size:s="default"})=>{const{toast:l}=Hn(),[d,u]=i.useState(!1),h=r?`${o} - doar ${r.toFixed(2)} RON! 🛍️`:o,p=encodeURIComponent(e),c=encodeURIComponent(h),m={facebook:`https://www.facebook.com/sharer/sharer.php?u=${p}&quote=${c}`,twitter:`https://twitter.com/intent/tweet?text=${c}&url=${p}`,whatsapp:`https://wa.me/?text=${c}%20${p}`},w=M=>{ae("share",{method:M,content_type:"product",item_id:e});const N=600,k=500,P=window.innerWidth/2-N/2,V=window.innerHeight/2-k/2;window.open(m[M],`share-${M}`,`width=${N},height=${k},left=${P},top=${V},toolbar=0,location=0,menubar=0`)},g=async()=>{try{await navigator.clipboard.writeText(e),u(!0),ae("share",{method:"copy_link",content_type:"product",item_id:e}),l({title:"Link copiat!",description:"Linkul a fost copiat în clipboard"}),setTimeout(()=>u(!1),2e3)}catch{l({title:"Eroare",description:"Nu s-a putut copia linkul",variant:"destructive"})}},y=async()=>{if(navigator.share)try{await navigator.share({title:h,text:t,url:e}),ae("share",{method:"native",content_type:"product",item_id:e})}catch(M){M.name!=="AbortError"&&console.error("Share failed:",M)}};return n.jsxs(jo,{children:[n.jsx(No,{asChild:!0,children:n.jsxs(Te,{variant:a,size:s,children:[n.jsx(De,{className:"h-4 w-4"}),s!=="icon"&&n.jsx("span",{className:"ml-2",children:"Distribuie"})]})}),n.jsxs(Sn,{align:"end",className:"w-56",children:[n.jsx(A,{onClick:()=>w("facebook"),children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#1877F2] flex items-center justify-center mr-3",children:n.jsx(ut,{className:"h-4 w-4 text-white",fill:"currentColor"})}),n.jsx("span",{children:"Facebook"})]})}),n.jsx(A,{onClick:()=>w("twitter"),children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#1DA1F2] flex items-center justify-center mr-3",children:n.jsx(ft,{className:"h-4 w-4 text-white",fill:"currentColor"})}),n.jsx("span",{children:"Twitter"})]})}),n.jsx(A,{onClick:()=>w("whatsapp"),children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#25D366] flex items-center justify-center mr-3",children:n.jsx(pt,{className:"h-4 w-4 text-white",fill:"currentColor"})}),n.jsx("span",{children:"WhatsApp"})]})}),navigator.share&&n.jsxs(n.Fragment,{children:[n.jsx(ie,{}),n.jsx(A,{onClick:y,children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center mr-3",children:n.jsx(De,{className:"h-4 w-4"})}),n.jsx("span",{children:"Mai multe opțiuni..."})]})})]}),n.jsx(ie,{}),n.jsx(A,{onClick:g,children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center mr-3",children:d?n.jsx(ce,{className:"h-4 w-4 text-green-600"}):n.jsx(dt,{className:"h-4 w-4"})}),n.jsx("span",{children:d?"Copiat!":"Copiază linkul"})]})})]})]})},Eo=({name:e,brand:o,category:t,store:r,price:a})=>{const s=[e];return o&&s.push(o),t&&s.push(t),r&&s.push(r),a&&s.push(`${a.toFixed(0)} RON`),s.join(" - ")},Xo=(e,o,t,r)=>{const a=t?` de la ${t}`:"",s=r?` în categoria ${r}`:"";let l=`${e}${a} - ${o.toFixed(2)} RON. Compară prețuri${s} și economisește cu Clyper.`;return l.length>160&&(l=l.substring(0,157)+"..."),l},In=({product:e,compact:o=!1,priority:t=!1})=>{const r=i.useCallback(a=>{window._affiliateClickTracker||(window._affiliateClickTracker=new Map);const s=Date.now(),l=window._affiliateClickTracker.get(e.id);if(l&&s-l<5e3)return console.log("🚫 Blocked duplicate click for:",e.id,e.name),a.preventDefault(),a.stopPropagation(),!1;window._affiliateClickTracker.set(e.id,s),console.log("✅ Allowed click for:",e.id,e.name);for(const[d,u]of window._affiliateClickTracker.entries())s-u>1e4&&window._affiliateClickTracker.delete(d)},[e.id,e.name]);return n.jsx(qn,{className:"hover:shadow-lg transition-shadow h-full group",children:n.jsxs(Zn,{className:o?"p-3":"p-4",children:[n.jsxs("div",{className:"relative",children:[e.old_price&&e.old_price>e.price&&n.jsx("div",{className:"absolute top-2 left-2 z-10",children:n.jsxs(Re,{variant:"destructive",className:"font-bold",children:["-",Math.round((e.old_price-e.price)/e.old_price*100),"%"]})}),n.jsx(Ne,{to:`/product/${e.slug||e.id}`,className:"block",children:n.jsx("div",{className:"aspect-square bg-muted rounded mb-4 overflow-hidden",children:n.jsx(Qn,{src:e.image_url||"/placeholder.svg",alt:Eo({name:e.name,brand:e.brand,category:e.category,store:e.store_name,price:e.price}),className:"w-full h-full group-hover:scale-105 transition-transform duration-300",objectFit:"contain",loading:t?"eager":"lazy",priority:t,sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw"})})}),n.jsxs("div",{className:"absolute top-2 right-2 flex gap-2",children:[n.jsx("div",{className:"bg-background/80 backdrop-blur-sm rounded",children:n.jsx(Po,{url:`https://clyper.ro/product/${e.slug||e.id}`,title:e.name,price:e.price,variant:"ghost",size:"icon"})}),n.jsx("div",{className:"bg-background/80 backdrop-blur-sm rounded px-2 py-1",children:n.jsx(mt,{productId:e.id})})]})]}),n.jsxs(Ne,{to:`/product/${e.slug||e.id}`,className:"block",children:[n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:e.store_name||"N/A"}),n.jsx("h3",{className:"font-medium mb-3 line-clamp-2 group-hover:text-primary transition-colors text-sm min-h-[2.5rem]",children:e.name})]}),n.jsxs("div",{className:"flex flex-col gap-1 mb-4",children:[n.jsxs("div",{className:"flex items-baseline gap-2",children:[n.jsxs("p",{className:"text-2xl font-bold",children:[e.price.toFixed(2)," ",n.jsx("span",{className:"text-sm",children:"RON"})]}),e.old_price&&e.old_price>e.price&&n.jsxs(Re,{variant:"destructive",className:"text-xs",children:["-",Math.round((e.old_price-e.price)/e.old_price*100),"%"]})]}),e.old_price&&e.old_price>e.price&&n.jsxs("p",{className:"text-sm text-muted-foreground line-through",children:[e.old_price.toFixed(2)," RON"]})]}),n.jsx(Te,{asChild:!0,className:"w-full bg-danger hover:bg-danger/90 text-danger-foreground",children:n.jsxs("a",{href:e.affiliate_link,target:"_blank",rel:"noopener",onClick:r,children:["Cumpără acum",n.jsx(ct,{className:"ml-2 h-4 w-4"})]})})]})})};In.displayName="ProductCard";const Ho=i.memo(In);export{mt as C,Ho as P,Po as S,Eo as a,Xo as g};