PageSourceSearch

https://tcgcrew.com/assets/RarityChips-8bND0Q-2.js

js tcgcrew.com collected 2026-09-25 03:38:44 UTC 30,885 bytes, 1 lines download raw bytes

1import{r as o,a as q}from"./vendor-react-SfNqDmFq.js";import{j as e,aj as Pe,c as $e,t as y,K as Z}from"./index-Fius1eoO.js";import{m as Ee}from"./mastersetApi-CdLGb5P1.js";import{f as Ce}from"./PriceBadge-CbVeheOk.js";import{X,c as se,R as Be,aT as Ge,c4 as Ve,au as qe,d as Xe,bk as He,aj as Ue,aw as Ke,ax as Je,Y as Me,$ as Ze,x as Qe,y as et,ba as tt}from"./vendor-icons-DoJ0T1W7.js";import{P as rt}from"./ProgressBar-BSX8FNh-.js";const Q="masterset.gridDensity",ht={compact:"grid-cols-4 sm:grid-cols-5 md:grid-cols-6 lg:grid-cols-6 xl:grid-cols-7",default:"grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-5 xl:grid-cols-6",comfortable:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-4 xl:grid-cols-5",xlarge:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4"};function Se(t){return t==="compact"||t==="default"||t==="comfortable"||t==="xlarge"}function gt(){const[t,n]=o.useState(()=>{if(typeof window>"u")return"default";try{const a=localStorage.getItem(Q);return Se(a)?a:"default"}catch{return"default"}}),r=a=>{n(a);try{localStorage.setItem(Q,a)}catch{}};return o.useEffect(()=>{if(typeof window>"u")return;const a=s=>{s.key===Q&&Se(s.newValue)&&n(s.newValue)};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),[t,r]}const ee="masterset.sort";function Le(t){return t==="default"||t==="price-asc"||t==="price-desc"}function vt(){const[t,n]=o.useState(()=>{if(typeof window>"u")return"default";try{const a=localStorage.getItem(ee);return Le(a)?a:"default"}catch{return"default"}}),r=a=>{n(a);try{localStorage.setItem(ee,a)}catch{}};return o.useEffect(()=>{if(typeof window>"u")return;const a=s=>{s.key===ee&&Le(s.newValue)&&n(s.newValue)};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),[t,r]}function yt(t,n,r){if(r==="default")return t;const a=[...t];return a.sort((s,c)=>{const x=n(s),u=n(c),d=x==null||!Number.isFinite(x)||x<=0?null:x,i=u==null||!Number.isFinite(u)||u<=0?null:u;return d==null&&i==null?0:d==null?1:i==null?-1:r==="price-asc"?d-i:i-d}),a}function jt({cardmarketId:t,cardName:n,currentPrice:r,onClose:a,onSaved:s}){const[c,x]=o.useState((r==null?void 0:r.trend)!=null?String(r.trend):""),[u,d]=o.useState((r==null?void 0:r.overrideReason)||""),[i,f]=o.useState(!1),[h,g]=o.useState(!1),[N,S]=o.useState(null);o.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const j=async()=>{S(null);const v=parseFloat(c.replace(",","."));if(!Number.isFinite(v)||v<0){S("Saisis un prix valide (ex: 12.50)");return}f(!0);try{await Ee.setPriceOverride(t,v,u||void 0),s(),a()}catch(_){S((_==null?void 0:_.message)||"Erreur lors de la sauvegarde")}finally{f(!1)}},A=async()=>{S(null),g(!0);try{await Ee.deletePriceOverride(t),s(),a()}catch(v){S((v==null?void 0:v.message)||"Erreur lors du retrait de l'override")}finally{g(!1)}};return q.createPortal(e.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-lab-elevated rounded-2xl w-full max-w-md border border-lab-border-subtle",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-lab-border-subtle",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-display font-semibold text-lab-text-primary",children:"Définir le prix"}),e.jsx("p",{className:"text-xs text-lab-text-tertiary truncate max-w-[280px]",children:n})]}),e.jsx("button",{onClick:a,className:"p-2 rounded-xl hover:bg-lab-surface text-lab-text-tertiary hover:text-lab-text-primary transition-colors",children:e.jsx(X,{size:18})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[r&&e.jsxs("div",{className:"text-xs text-lab-text-tertiary space-y-0.5",children:[e.jsxs("div",{children:["Cardmarket trend :"," ",e.jsx("span",{className:"font-mono text-lab-text-secondary",children:r.trend!=null?Ce(r.trend):"–"})]}),r.low!=null&&e.jsxs("div",{children:["Cardmarket low :"," ",e.jsx("span",{className:"font-mono text-lab-text-secondary",children:Ce(r.low)})]}),r.isOverride&&e.jsx("div",{className:"text-violet-400",children:"⚠ Un override est déjà défini"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"block text-xs font-medium text-lab-text-secondary",children:"Ton prix (€)"}),e.jsx("input",{type:"text",inputMode:"decimal",value:c,onChange:v=>x(v.target.value),placeholder:"12.50",className:"w-full px-3 py-2 rounded-lg bg-lab-surface border border-lab-border-subtle text-sm font-mono focus:outline-none focus:border-teal-500",autoFocus:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{className:"block text-xs font-medium text-lab-text-secondary",children:["Raison ",e.jsx("span",{className:"text-lab-text-tertiary",children:"(optionnel)"})]}),e.jsx("input",{type:"text",value:u,onChange:v=>d(v.target.value),placeholder:"ex: Master Ball pattern, version JP non listée…",maxLength:200,className:"w-full px-3 py-2 rounded-lg bg-lab-surface border border-lab-border-subtle text-sm focus:outline-none focus:border-teal-500"})]}),N&&e.jsx("div",{className:"text-xs text-accent-danger bg-accent-danger/10 border border-accent-danger/20 rounded-lg px-3 py-2",children:N})]}),e.jsxs("div",{className:"flex items-center gap-2 px-6 py-4 border-t border-lab-border-subtle",children:[(r==null?void 0:r.isOverride)&&e.jsxs("button",{onClick:A,disabled:h||i,className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-lab-border-subtle hover:bg-lab-surface text-xs text-lab-text-secondary disabled:opacity-50",children:[h?e.jsx(se,{size:13,className:"animate-spin"}):e.jsx(Be,{size:13}),"Retirer override"]}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:a,disabled:i||h,className:"px-3 py-2 rounded-lg border border-lab-border-subtle hover:bg-lab-surface text-xs text-lab-text-secondary disabled:opacity-50",children:"Annuler"}),e.jsxs("button",{onClick:j,disabled:i||h||!c.trim(),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg bg-teal-600 hover:bg-teal-500 text-white text-xs font-medium disabled:opacity-50",children:[i?e.jsx(se,{size:13,className:"animate-spin"}):e.jsx(Ge,{size:13}),"Enregistrer"]})]})]})}),document.body)}function wt(t){return[(t.tcg||"").toLowerCase(),(t.region||"").toUpperCase(),(t.setCode||"").toUpperCase(),String(t.cardLocalId||""),(t.language||"").toUpperCase()].join(":")}function Nt({identity:t,card:n,linked:r,onChange:a,className:s}
1){const[c,x]=o.useState(!1);async function u(d=!1){var f;if(c)return;const i=!r;x(!0);try{const g=(f=(await Pe.toggle({tcg:t.tcg,region:t.region,setCode:t.setCode,cardLocalId:t.cardLocalId,language:t.language,on:i,confirmListed:d,card:i?{tcg:t.tcg,...n}:void 0})).data)==null?void 0:f.data;if((g==null?void 0:g.blocked)==="listed"){x(!1),window.confirm("Cette carte est en vente active sur une marketplace. La retirer du portfolio quand même ?")&&await u(!0);return}a(i)}catch{}finally{x(!1)}}return e.jsxs("button",{type:"button",onClick:d=>{d.stopPropagation(),u()},disabled:c,"aria-pressed":r,className:`inline-flex items-center justify-center gap-2 px-3.5 py-2 rounded-full text-sm font-semibold transition-all touch-manipulation disabled:opacity-60 ${r?"bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/40 hover:bg-emerald-500/20":"bg-lab-surface/60 text-lab-text-secondary ring-1 ring-lab-border-subtle hover:text-lab-text-primary hover:ring-lab-border-hover"} ${s||""}`,children:[c?e.jsx(se,{size:16,className:"animate-spin"}):r?e.jsx(Ve,{size:16}):e.jsx(qe,{size:16}),r?"Dans le portfolio":"Ajouter au portfolio"]})}function at({name:t,url:n}){const[r,a]=o.useState(!1);o.useEffect(()=>{a(!1)},[n]);const s=(t||"?").trim().charAt(0).toUpperCase()||"?";return e.jsx("span",{className:"inline-flex h-[42px] w-[42px] shrink-0 rounded-full p-[2px]",style:{background:"linear-gradient(135deg, var(--dash-gold), var(--cert-accent))"},children:n&&!r?e.jsx("img",{src:n,alt:"",onError:()=>a(!0),className:"h-full w-full rounded-full object-cover"}):e.jsx("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-lab-subtle text-base font-bold text-lab-text-secondary",children:s})})}function kt({isOpen:t,onClose:n,cardName:r,variantLabel:a,cardNumber:s,friends:c}){o.useEffect(()=>{if(!t)return;const i=document.body.style.overflow;document.body.style.overflow="hidden";const f=h=>{h.key==="Escape"&&(h.stopImmediatePropagation(),n())};return window.addEventListener("keydown",f,!0),()=>{document.body.style.overflow=i,window.removeEventListener("keydown",f,!0)}},[t,n]);const x=o.useRef(n);if(x.current=n,o.useEffect(()=>{if(t)return $e(()=>x.current())},[t]),!t)return null;const u=c.length,d=a?"cette variante":"cette carte";return q.createPortal(e.jsx("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-lab-void/85 p-4",onClick:n,role:"dialog","aria-modal":"true","aria-label":`Amis possédant ${r} en double`,children:e.jsxs("div",{className:"relative w-full max-w-[392px] overflow-hidden rounded-2xl border border-lab-border-default bg-lab-elevated shadow-glass-lg animate-scale-in",onClick:i=>i.stopPropagation(),children:[e.jsx("div",{className:"h-0.5",style:{background:"linear-gradient(90deg, transparent, var(--cert-accent) 35%, var(--dash-gold) 65%, transparent)"}}),e.jsxs("div",{className:"flex items-start gap-3 px-4 pb-3 pt-4",children:[e.jsx("span",{className:"flex h-[38px] w-[38px] shrink-0 items-center justify-center rounded-xl border border-[#e7c271]/30 bg-[#e7c271]/15 text-[#e7c271]",children:e.jsx(Xe,{size:18,"aria-hidden":!0})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"truncate text-base font-semibold leading-tight text-lab-text-primary",title:r,children:r}),e.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-1.5",children:[s&&e.jsx("span",{className:"font-mono text-[11px] text-lab-text-tertiary",children:s}),a&&e.jsx("span",{className:"rounded-md border border-lab-border-subtle bg-white/[0.06] px-1.5 py-px text-[10px] font-medium text-lab-text-secondary",children:a})]})]}),e.jsx("button",{type:"button",onClick:n,"aria-label":"Fermer",className:"-mr-1 -mt-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-lab-text-tertiary transition-colors hover:bg-lab-subtle hover:text-lab-text-primary",children:e.jsx(X,{size:17,"aria-hidden":!0})})]}),e.jsxs("div",{className:"mx-4 mb-3 flex items-center gap-2 rounded-xl border px-3 py-2.5",style:{background:"linear-gradient(120deg, rgba(194,59,48,0.14), rgba(231,194,113,0.10))",borderColor:"rgba(231,194,113,0.22)"},children:[e.jsx(He,{size:16,className:"shrink-0 text-[#e7c271]","aria-hidden":!0}),e.jsxs("span",{className:"text-[12.5px] text-[#f0e6d0]",children:[e.jsxs("span",{className:"font-semibold",children:[u," ami",u>1?"s":""]})," ",u>1?"ont":"a"," ",d," en double — échange possible"]})]}),e.jsx("div",{className:"max-h-[46vh] overflow-y-auto px-3 pb-4",children:e.jsx("div",{className:"space-y-1.5",children:c.map(i=>e.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-lab-border-subtle bg-white/[0.025] px-3 py-2.5",children:[e.jsx(at,{name:i.name,url:i.avatarUrl}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-sm font-medium text-lab-text-primary",children:i.name||"Membre"}),e.jsxs("div",{className:"truncate font-mono text-[11px] text-lab-text-tertiary",children:["CREW-",i.crewCode]})]}),e.jsx("span",{className:"inline-flex shrink-0 items-center rounded-lg border-[1.5px] border-[#f5c451] bg-[#4a2f06] px-2.5 py-1 shadow-[0_0_14px_-3px_rgba(245,196,81,0.55)]",title:`${i.quantity} exemplaire${i.quantity>1?"s":""} en double`,children:e.jsxs("span",{className:"text-[15px] font-semibold leading-none text-[#fff3d6]",children:["×",i.quantity]})})]},i.crewCode))})})]})}),document.body)}const st=[{value:"compact",shortLabel:"Dense",fullLabel:"Dense",iconCount:4,description:"Plus de cartes par ligne (scan rapide)"},{value:"default",shortLabel:"Normal",fullLabel:"Normal",iconCount:3,description:"Équilibré (par défaut)"},{value:"comfortable",shortLabel:"Large",fullLabel:"Large",iconCount:2,description:"Cartes plus grandes"},{value:"xlarge",shortLabel:"XL",fullLabel:"XL",iconCount:1,description:"Très grand, mode détail"}];function nt({count:t}){const n=t,r=2,a=18,s=16,c=(a-(n-1)*r)/n;return e.jsx("svg",{viewBox:`0 0 ${a} ${s}`,width:a,height:s,"aria-hidden":"true",children:Array.from({length:n}).map((x,u)=>e.jsx("rect",{x:u*(c+r),y:0,width:c,height:s,rx:2,fill:"currentColor"},u))})}function Et({density:t,onChange:n,activeClass:r="bg-violet-500/20 text-violet-300 ring-1 ring-violet-500/40",disabled:a=!1,className:s=""}){return e.jsx("div",{role:"radiogroup","aria-label":"Densité de la grille","aria-disabled":a,className:`inline-flex items-center gap-0.5 p-1 rounded-full bg-lab-surface/70 border border-lab-border-subtle ${a?"opacity-40 pointer-events-none":""} ${s}`,style:{boxShadow:"inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 2px rgba(0,0,0,0.2)"},children:st.map(c=>{const x=t===c.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":x,"aria-label":`${c.fullLabel} — ${c.description}`,title:`${c.fullLabel} : ${c.description}`,onClick:()=>{x||(y(),n(c.value))},className:`flex items-center gap-1.5 h-10 px-3 rounded-full text-xs font-bold transition-all touch-manipulation ${x?`${r} shadow-[inset_0_1px_0_rgba(255,255,255,0.08),0_2px_8px_-2px_currentColor]`:"text-lab-text-tertiary hover:text-lab-text-primary hover:bg-lab-surface/60 active:scale-95"}`,children:[e.jsx(nt,{count:c.iconCount}),e.jsx("span",{className:"hidden md:inline",children:c.shortLabel})]},c.value)})})}const lt=[{value:"default",label:"Numéro",shortLabel:"N°",Icon:Ue,ariaLabel:"Tri par défaut (numéro de carte)"},{value:"price-asc",label:"Prix",shortLabel:"",Icon:Ke,prefix:"€",ariaLabel:"Tri par prix croissant"},{value:"price-desc",label:"Prix",shortLabel:"",Icon:Je,prefix:"€",ariaLabel:"Tri par prix décroissant"}];function Ct({sort:t,onChange:n,activeClass:r="bg-violet-500/20 text-violet-300 ring-1 ring-violet-500/40",className:a=""}){return e.jsx("div",{role:"radiogroup","aria-label":"Tri",className:`inline-flex items-center gap-0.5 p-1 rounded-full bg-lab-surface/70 border border-lab-border-subtle ${a}`,style:{boxShadow:"inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 2px rgba(0,0,0,0.2)"},children:lt.map(s=>{const c=t===s.value,x=s.Icon;return e.jsxs("button",{type:"button",role:"radio","aria-checked":c,"aria-label":s.ariaLabel,title:s.ariaLabel,onClick:()=>{c||(y(),n(s.value))},className:`flex items-center gap-1.5 h-10 px-3 rounded-full text-xs font-bold transition-all touch-manipulation ${c?`${r} shadow-[inset_0_1px_0_rgba(255,255,255,0.08),0_2px_8px_-2px_currentColor]`:"text-lab-text-tertiary hover:text-lab-text-primary hover:bg-lab-surface/60 active:scale-95"}`,children:[s.prefix&&e.jsx("span",{className:"text-sm font-bold tabular-nums leading-none",children:s.prefix}),e.jsx(x,{size:16,strokeWidth:2.75,"aria-hidden":"true"}
1),s.shortLabel&&e.jsx("span",{className:"md:hidden tabular-nums leading-none",children:s.shortLabel}),e.jsx("span",{className:"hidden md:inline",children:s.label})]},s.value)})})}const te=48,re=1.4,ot=.78,it=6,ct=72,ae=.45,D=320,V="cubic-bezier(0.32, 0.72, 0, 1)",Re=.55;function _e(t){const n=getComputedStyle(t).transform;if(!n||n==="none")return 0;const r=n.match(/matrix\(([^)]+)\)/);if(r)return Number(r[1].split(",")[5])||0;const a=n.match(/matrix3d\(([^)]+)\)/);return a?Number(a[1].split(",")[13])||0:null}function St({image:t,children:n,summary:r,title:a,meta:s,backdropImage:c,footer:x,onClose:u,onPrev:d,onNext:i,position:f,ariaLabel:h}){const g=o.useRef(u),N=o.useRef(d),S=o.useRef(i);o.useEffect(()=>{g.current=u,N.current=d,S.current=i});const[j,A]=o.useState(!1),[v,_]=o.useState(!1),Y=o.useRef(!1);o.useEffect(()=>{Y.current=j},[j]);const ne=o.useRef(null),le=o.useRef(null),oe=o.useRef(null),W=o.useRef(null),ie=o.useRef(null),[O,Ae]=o.useState(0),[T,Te]=o.useState(0),F=o.useRef(0),ce=o.useRef(0);o.useEffect(()=>{F.current=O,ce.current=T},[O,T]);const[I,Ie]=o.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1024px)").matches);o.useEffect(()=>{const l=window.matchMedia("(min-width: 1024px)"),b=k=>Ie(k.matches);return l.addEventListener("change",b),()=>l.removeEventListener("change",b)},[]),o.useLayoutEffect(()=>{if(I)return;const l=ne.current,b=oe.current;if(!l||!b)return;const k=()=>{Ae(b.offsetHeight),Te(Math.round(l.clientHeight*ot))};k();const m=new ResizeObserver(k);return m.observe(l),m.observe(b),()=>m.disconnect()},[I]),o.useEffect(()=>{if(I)return;const l=le.current;if(!l)return;const b=window.matchMedia("(prefers-reduced-motion: reduce)").matches,k=b?"none":`transform ${D}ms ${V}`,m=b?"none":`opacity ${D}ms ${V}`,w=()=>Math.max(0,ce.current-F.current),he=()=>Y.current?0:w(),U=(p,L)=>{l.style.transition=L?k:"none",l.style.transform=`translateY(${p}px)`;const E=ie.current;if(E){const C=w();E.style.transition=L?m:"none",E.style.opacity=String(C>0?Math.max(0,Math.min(1,1-p/C))*Re:0)}};let ge=0,ve=0,P=0,B=0,K=0,J=0,R="idle",ye=!1;const je=p=>{if(p.touches.length!==1){R="idle";return}ge=P=K=p.touches[0].clientY,B=J=p.timeStamp,ve=_e(l)??he(),ye=!!W.current&&W.current.contains(p.target),R="undecided"},we=p=>{var ke;if(R==="idle"||R==="scroll")return;const L=p.touches[0];if(!L)return;const E=L.clientY-ge;if(R==="undecided"){if(Math.abs(E)<it)return;if(ye&&Y.current){const Fe=((ke=W.current)==null?void 0:ke.scrollTop)??0;if(E<0||Fe>0){R="scroll";return}}R="drag",E<0&&_(!0),l.style.transition="none"}p.preventDefault();const C=w();let M=ve+E;M<0&&(M=M/3);const Ne=C+F.current;M>Ne&&(M=Ne),K=P,J=B,P=L.clientY,B=p.timeStamp,U(M,!1)},G=()=>{if(R!=="drag"){R="idle";return}R="idle";const p=w(),L=_e(l)??he(),E=(P-K)/Math.max(1,B-J);if(L>p+ct||L>=p-1&&E>ae){Z(),U(p+F.current,!0),window.setTimeout(()=>g.current(),b?0:D-60);return}let C;E<-ae?C=!0:E>ae?C=!1:C=L<p/2,U(C?0:p,!0),C!==Y.current&&(y(),C&&_(!0),A(C))};return l.addEventListener("touchstart",je,{passive:!0}),l.addEventListener("touchmove",we,{passive:!1}),l.addEventListener("touchend",G,{passive:!0}),l.addEventListener("touchcancel",G,{passive:!0}),()=>{l.removeEventListener("touchstart",je),l.removeEventListener("touchmove",we),l.removeEventListener("touchend",G),l.removeEventListener("touchcancel",G)}},[I]),o.useEffect(()=>{const l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=l}},[]),o.useEffect(()=>$e(()=>g.current()),[]),o.useEffect(()=>{function l(b){b.key==="Escape"?(Z(),g.current()):b.key==="ArrowLeft"&&N.current?(b.preventDefault(),y(),N.current()):b.key==="ArrowRight"&&S.current&&(b.preventDefault(),y(),S.current())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);function z(){Z(),u()}function de(){y(),_(!0),A(!0)}function ze(){y(),A(!1)}const $=l=>l.stopPropagation(),H=o.useRef(null),De=l=>{var m,w;const b=l.touches[0],k=!!((w=(m=l.target)==null?void 0:m.closest)!=null&&w.call(m,"[data-no-swipe-back]"));H.current=b?{x:b.clientX,y:b.clientY,retourne:k}:null},Ye=l=>{const b=H.current;H.current=null;
1const k=l.changedTouches[0];if(!b||!k)return;const m=k.clientX-b.x,w=k.clientY-b.y;if(Math.abs(m)>te&&Math.abs(m)>Math.abs(w)*re){if(b.retourne)return;m<0&&S.current?(y(),S.current()):m>0&&N.current&&(y(),N.current());return}w>te&&Math.abs(w)>Math.abs(m)*re&&!j&&z(),w<-te&&Math.abs(w)>Math.abs(m)*re&&!j&&de()},ue=e.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),z()},"aria-label":"Fermer",className:"w-11 h-11 rounded-full flex items-center justify-center bg-lab-surface/90 hover:bg-lab-surface active:bg-lab-surface/70 text-lab-text-primary border border-lab-border-subtle transition-colors touch-manipulation shadow-lg pointer-events-auto",children:e.jsx(X,{size:20,strokeWidth:2.5})}),xe=d&&e.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),y(),d()},"aria-label":"Carte précédente",className:"w-11 h-11 rounded-full flex items-center justify-center bg-lab-surface/90 hover:bg-lab-surface active:bg-lab-surface/70 text-lab-text-primary border border-lab-border-subtle transition-colors touch-manipulation shadow-lg pointer-events-auto",children:e.jsx(Qe,{size:20,strokeWidth:2.5})}),be=i&&e.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),y(),i()},"aria-label":"Carte suivante",className:"w-11 h-11 rounded-full flex items-center justify-center bg-lab-surface/90 hover:bg-lab-surface active:bg-lab-surface/70 text-lab-text-primary border border-lab-border-subtle transition-colors touch-manipulation shadow-lg pointer-events-auto",children:e.jsx(et,{size:20,strokeWidth:2.5})}),fe=f&&e.jsxs("span",{className:"text-xs font-mono tabular-nums text-lab-text-secondary px-3 py-1.5 rounded-full bg-lab-surface/60 border border-lab-border-subtle","aria-label":`Carte ${f.current} sur ${f.total}`,children:[f.current," / ",f.total]}),me={paddingTop:"env(safe-area-inset-top)",paddingBottom:"env(safe-area-inset-bottom)",paddingLeft:"env(safe-area-inset-left)",paddingRight:"env(safe-area-inset-right)"};if(I){const l=e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":h,onClick:z,className:"fixed inset-0 z-[9999] bg-lab-void/92 backdrop-blur-md flex flex-col",style:me,children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-3 py-2.5 gap-3",onClick:$,children:[ue,e.jsxs("div",{className:"flex-1 min-w-0 text-center",children:[e.jsx("p",{className:"text-base font-bold text-lab-text-primary leading-tight truncate",children:a??h}),s&&e.jsx("p",{className:"mt-0.5 text-[11px] font-mono tracking-wide text-lab-text-secondary truncate",children:s})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[fe,xe,be,!d&&!i&&e.jsx("div",{className:"w-11 h-11","aria-hidden":"true"})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-row items-stretch gap-2 px-4 pb-4",children:[e.jsx("div",{className:"flex-1 min-h-0 flex items-center justify-center px-2",children:e.jsx("div",{onClick:$,className:"rounded-2xl overflow-hidden bg-lab-void/40 ring-1 ring-lab-border-subtle shadow-2xl shadow-black/60",style:{height:"100%",aspectRatio:"5 / 7",maxWidth:"90vw"},children:t})}),e.jsxs("div",{onClick:$,className:"shrink-0 w-full flex flex-col gap-3 h-full lg:w-[520px] xl:w-[620px] 2xl:w-[720px]",children:[e.jsxs("div",{className:"flex-1 min-h-0 bg-lab-surface rounded-2xl border border-lab-border-subtle overflow-y-auto overscroll-contain px-3 py-3 flex flex-col gap-2",children:[r,n]}),x&&e.jsx("div",{className:"shrink-0",children:x})]})]})]});return q.createPortal(l,document.body)}const We=Math.max(0,T-O),pe=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Oe=e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":h,onClick:z,className:"fixed inset-0 z-[9999] bg-lab-void/95 overflow-hidden",children:[c&&e.jsx("div",{"aria-hidden":"true",className:"absolute -inset-16 bg-cover bg-center opacity-30 blur-3xl saturate-150 pointer-events-none",style:{backgroundImage:`url(${c})`}}),e.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 bg-gradient-to-b from-lab-void/90 via-lab-void/40 to-lab-void/95 pointer-events-none"}),e.jsx("div",{className:"relative h-full",style:me,children:e.jsxs("div",{ref:ne,className:"relative h-full",children:[e.jsxs("div",{className:"absolute top-0 left-0 right-0 z-20 flex items-start gap-2 px-3 pt-2 pb-8 bg-gradient-to-b from-lab-void/90 via-lab-void/55 to-transparent pointer-events-none",children:[ue,e.
1jsxs("div",{className:"flex-1 min-w-0 text-center pt-0.5",onClick:$,children:[e.jsx("p",{className:"text-[15px] font-bold text-lab-text-primary leading-tight truncate",children:a??h}),s&&e.jsx("p",{className:"mt-0.5 text-[10.5px] font-mono tracking-wide text-lab-text-secondary truncate",children:s})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[xe,be,!d&&!i&&fe]})]}),e.jsx("div",{className:"absolute top-0 left-0 right-0 flex items-end justify-center px-4 pt-16 pb-3",style:{bottom:O},onTouchStart:De,onTouchEnd:Ye,children:e.jsxs("div",{onClick:$,className:"relative rounded-2xl overflow-hidden bg-lab-void/40 ring-1 ring-lab-border-subtle shadow-2xl shadow-black/70",style:{height:"100%",aspectRatio:"5 / 7",maxWidth:"91%"},children:[t,e.jsx("div",{ref:ie,"aria-hidden":"true",className:"absolute inset-0 bg-lab-void pointer-events-none",style:{opacity:j?Re:0,transition:pe?"none":`opacity ${D}ms ${V}`}})]})}),e.jsxs("div",{ref:le,onClick:$,className:"absolute left-0 right-0 bottom-0 flex flex-col rounded-t-3xl bg-lab-surface border-t border-lab-border-subtle shadow-[0_-18px_40px_-18px_rgba(0,0,0,0.9)] will-change-transform after:content-[''] after:absolute after:left-0 after:right-0 after:top-full after:h-[env(safe-area-inset-bottom,0px)] after:bg-lab-surface",style:{height:T||void 0,visibility:T?"visible":"hidden",transform:`translateY(${j?0:We}px)`,transition:pe?"none":`transform ${D}ms ${V}`},children:[e.jsxs("div",{ref:oe,className:"shrink-0",children:[e.jsx("div",{className:"pt-2.5 pb-1 flex justify-center","aria-hidden":"true",children:e.jsx("span",{className:"w-9 h-1.5 rounded-full",style:{background:"var(--lab-text-tertiary)",opacity:.6}})}),r&&e.jsx("div",{className:"px-3 pb-1",children:r}),e.jsxs("div",{className:`px-3 pt-2 pb-3 flex items-center gap-2 ${j?"border-b border-lab-border-subtle":""}`,children:[e.jsxs("button",{type:"button",onClick:l=>{l.stopPropagation(),j?ze():de()},"aria-expanded":j,className:"flex-1 h-11 rounded-2xl flex items-center justify-center gap-1.5 bg-lab-subtle/60 hover:bg-lab-subtle active:bg-lab-subtle/40 border border-lab-border-subtle text-sm font-semibold text-lab-text-secondary transition-colors touch-manipulation",children:[j?"Réduire":"Détail complet",j?e.jsx(Me,{size:16,strokeWidth:2.5}):e.jsx(Ze,{size:16,strokeWidth:2.5})]}),e.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),z()},"aria-label":"Fermer la fiche",className:"shrink-0 w-11 h-11 rounded-2xl flex items-center justify-center bg-lab-subtle/60 hover:bg-lab-subtle active:bg-lab-subtle/40 border border-lab-border-subtle text-lab-text-secondary transition-colors touch-manipulation",children:e.jsx(X,{size:18,strokeWidth:2.5})})]})]}),e.jsxs("div",{ref:W,className:"flex-1 min-h-0 overflow-y-auto overscroll-contain px-3 pt-2 pb-3",children:[v&&n,v&&x&&e.jsx("div",{className:"pt-3 pb-1",children:x})]})]})]})})]});return q.createPortal(Oe,document.body)}function Lt({logoUrl:t,fallbackCode:n,name:r,meta:a,progress:s,accent:c="carmin",tintClass:x="",storageKey:u,ficheId:d="set-fiche",children:i}
1){const[f,h]=o.useState(()=>{if(!u)return!1;try{return localStorage.getItem(u)==="1"}catch{return!1}});o.useEffect(()=>{if(u)try{localStorage.setItem(u,f?"1":"0")}catch{}},[f,u]);const g=!!i;return e.jsxs("header",{className:`relative overflow-hidden rounded-2xl border border-lab-border-subtle bg-gradient-to-br ${x} bg-lab-surface/30`,children:[t&&e.jsx("div",{className:"absolute inset-0 opacity-[0.08] blur-2xl scale-150",style:{backgroundImage:`url(${t})`,backgroundSize:"contain",backgroundPosition:"center",backgroundRepeat:"no-repeat"},"aria-hidden":"true"}),e.jsxs("div",{className:"relative px-3.5 py-2.5 md:px-5 md:py-3 flex items-center gap-3 md:gap-4",children:[g&&e.jsx("button",{type:"button",onClick:()=>{y(),h(N=>!N)},"aria-expanded":f,"aria-controls":d,"aria-label":f?"Masquer les détails de l’extension":"Afficher les détails de l’extension",className:"absolute inset-0 z-10 touch-manipulation"}),e.jsx("div",{className:"w-[72px] h-12 md:w-[104px] md:h-16 flex items-center justify-center shrink-0",children:t?e.jsx("img",{src:t,alt:r,className:"max-h-full max-w-full object-contain drop-shadow-[0_4px_12px_rgba(0,0,0,0.55)]",loading:"eager",onError:N=>N.currentTarget.style.display="none"}):e.jsx("div",{className:"font-mono text-lab-text-tertiary text-base tracking-widest",children:n})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h1",{className:"font-display font-bold text-lab-text-primary leading-tight text-lg md:text-2xl line-clamp-2",title:r,children:r}),a&&e.jsx("div",{className:"flex items-center gap-1.5 flex-wrap text-[11px] text-lab-text-tertiary leading-none mt-0.5",children:a}),s&&s.total>0&&e.jsx("div",{className:"mt-1.5",children:e.jsx(rt,{className:"max-w-md",owned:s.owned,total:s.total,unit:s.unit,accent:c})})]}),g&&e.jsx(Me,{size:18,strokeWidth:2.5,"aria-hidden":"true",className:`shrink-0 text-lab-text-tertiary transition-transform duration-300 ease-smooth motion-reduce:transition-none ${f?"rotate-180":""}`})]}),g&&e.jsx("div",{id:d,className:"relative grid transition-[grid-template-rows] duration-300 ease-smooth motion-reduce:transition-none",style:{gridTemplateRows:f?"1fr":"0fr"},children:e.jsx("div",{className:"overflow-hidden",children:e.jsx("div",{className:"px-3.5 md:px-5 pb-3 md:pb-4",children:e.jsx("div",{className:"border-t border-lab-border-subtle pt-2.5",children:i})})})})]})}function dt(t){const n=t.split(/\s+/).filter(Boolean);return n.find(r=>r.startsWith("text-"))??n[0]??""}function Rt({items:t,selected:n,onToggle:r,onClear:a,total:s,allLabel:c="Toutes",className:x=""}){if(t.length<=1&&n.size===0)return null;const u=n.size===0;return e.jsxs("div",{role:"group","aria-label":"Filtrer par rareté",className:`flex items-center gap-1.5 overflow-x-auto scrollbar-hide ${x}`,children:[e.jsx(tt,{size:12,strokeWidth:2,"aria-hidden":"true",className:"shrink-0 text-lab-text-tertiary"}),e.jsxs("button",{type:"button",onClick:()=>{y(),a()},"aria-pressed":u,className:`shrink-0 inline-flex items-center gap-1.5 pl-3 pr-2.5 h-8 rounded-full border text-[11px] font-semibold transition-all active:scale-95 touch-manipulation ${u?"bg-lab-elevated border-lab-border-hover text-lab-text-primary":"bg-lab-surface/40 border-lab-border-subtle text-lab-text-secondary hover:text-lab-text-primary"}`,children:[c,e.jsx("span",{className:"font-mono text-[10px] text-lab-text-tertiary tabular-nums",children:s})]}),t.map(d=>{const i=n.has(d.key);return e.jsxs("button",{type:"button",onClick:()=>{y(),r(d.key)},"aria-pressed":i,"aria-label":d.title||d.label,title:d.title||d.label,className:`shrink-0 inline-flex items-center gap-1.5 px-2.5 h-8 rounded-full border border-current text-[11px] font-bold transition-all active:scale-95 touch-manipulation ${dt(d.colorClass)} ${i?"opacity-100 shadow-[inset_0_0_0_2px_currentColor] [background-color:color-mix(in_srgb,currentColor_16%,transparent)]":"opacity-60 hover:opacity-90 bg-lab-surface/40"}`,children:[e.jsx("span",{className:"tracking-wide",children:d.label}),e.jsx("span",{className:"font-mono text-[10px] tabular-nums opacity-75",children:d.count})]},d.key)})]})}export{kt as F,Et as G,Nt as I,St as M,jt as P,Rt as R,Lt as S,vt as a,Ct as b,ht as c,wt as d,yt as s,gt as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.