Accesso al pannello di amministrazione dell'eshop >> (Questo messaggio lo vedi solo tu!)

KEVIN & COCO HIGHLIGHTER STICKS

Prezzo per confezione

Produktcode: ABx18KC245727
€0,00
0,00
Weiter einkaufen! Finden Sie andere Produkte in der Sektion illuminanti oder von KEVIN

Unsere Kundenbewertungen

Alle Bewertungen ansehen
/* R&F SHOP - Assistente comune v1.0 - JavaScript senza tag script. */ (()=>{'use strict'; const VERSION='1.0'; if(window.RFShopAssistenteComune){window.RFShopAssistenteComune.aggiorna();return;} const clean=v=>String(v??'').replace(/\s+/g,' ').trim(); const fold=v=>clean(v).normalize('NFD').replace(/[\u0300-\u036f]/g,'').toLowerCase(); const valid=v=>!!clean(v)&&!/^[-–—]$|^n\/?d$|^non disponibile$/i.test(clean(v)); const one=(n,s)=>n?.querySelector(s),all=(n,s)=>n?[...n.querySelectorAll(s)]:[]; const canonicalURL=(raw,base)=>{if(typeof raw!=='string'||!raw.trim())return '';try{const u=new URL(raw,base);if(u.protocol==='https:'&&['rfshop87.it','www.rfshop87.it'].includes(u.hostname)){u.hash='';return u.href;}}catch{}return '';}; function stripPrice(value){return clean(value).replace(/\(\s*#[^)]*\)/g,'').replace(/(?:EUR|€)\s*[\d.,]+|[\d.,]+\s*(?:EUR|€)/gi,'').replace(/[|·\s]+$/,'').trim();} function textLines(node){ if(!node)return [];const copy=node.cloneNode(true); all(copy,'script,style,form,nav,button,[data-rf-diagnostica],[data-rf-assortimento-comune],[data-rf-clausola-sconti],[data-rf-sconti-quantita],[data-rf-righe-quantita]').forEach(n=>n.remove()); all(copy,'br').forEach(n=>n.replaceWith('\n'));all(copy,'p,div,li,tr,h2,h3,h4').forEach(n=>n.appendChild(document.createTextNode('\n'))); return copy.textContent.replace(/\u00a0/g,' ').split(/[\r\n]+/).map(clean).filter(Boolean); } const labels={codice:/^(?:codice articolo|codice prodotto|codice|sku)$/i,marchio:/^(?:marchio|brand)$/i,tipo:/^(?:tipologia prodotto|tipo prodotto|tipologia|tipo articolo)$/i,formato:/^(?:formato\s*\/\s*contenuto|formato|contenuto)$/i,quantita:/^(?:quantit[àa] per confezione|pezzi per confezione|pezzi per conf\.?)$/i,assortimento:/^(?:assortimento|tipologia(?: di)? assortimento)$/i,varianti:/^(?:(?:varianti|referenze)(?:\s*[/–-]\s*(?:varianti|referenze))?(?: commerciali)?(?: per (?:la )?composizione)?)$/i,minimo:/^(?:quantita minima(?: assortimento)?|minimo richiesto|minimo assortimento|minimo d'acquisto|minimo acquisto)$/i,unita:/^unita commerciale$/i,imballo:/^imballo$/i,sottoimballo:/^sotto\s?imballo$/i,presentazione:/^presentazione$/i,componenti:/^componenti del kit$/i}; function keyFor(label){const n=fold(label);return Object.keys(labels).find(k=>labels[k].test(n));} function factsFromLines(lines){const facts={};for(const line of lines){const m=line.match(/^([^:]{1,75}):\s*(.+)$/);if(!m)continue;const key=keyFor(m[1]);if(key&&valid(m[2])&&!facts[key])facts[key]=clean(m[2]);}return facts;} function readProduct(scope=document){ const main=one(scope,'.main-product');if(!main)return null; const name=clean(one(main,'h1.product-name,h1[itemprop="name"],h1')?.textContent);if(!name)return null; const source=one(main,'.product-details')||one(main,'[itemprop="description"]');const lines=textLines(source),facts=factsFromLines(lines); const card=one(source,'.rf-scheda-mini')||one(main,'.rf-scheda-mini'); if(card){for(const tr of all(card,'tr')){if(tr.closest('[data-rf-sconti-quantita],[data-rf-righe-quantita],[data-rf-assortimento-comune]'))continue;const cells=[...tr.children].filter(n=>/^(TD|TH)$/.test(n.tagName));if(cells.length===2){const key=keyFor(cells[0].textContent);if(key&&valid(cells[1].textContent))facts[key]=clean(cells[1].textContent);}} for(const k of ['codice','marchio','tipo','formato','quantita','assortimento','varianti']){const v=clean(one(card,'[data-rf="'+k+'"]')?.textContent);if(valid(v))facts[k]=v;} } if(!facts.codice){const sku=one(main,'[itemprop="sku"]');facts.codice=clean(sku?.getAttribute('content')||sku?.textContent);} if(!facts.marchio){const brand=one(main,'meta[itemprop="brand"],[itemprop="brand"]');facts.marchio=clean(brand?.getAttribute('content')||brand?.textContent);} const titlePack=name.match(/\[(?:conf\.?|confezione)\s*(.*?)\]/i);if(!facts.quantita&&titlePack)facts.quantita=titlePack[1]; const descNode=card?one(card,'[data-rf="descrizione"]'):source; const narrative=textLines(descNode).filter(line=>!/^([^:]{1,75}):\s*/.test(line)&&!/^(?:caratteristiche tecniche|dati tecnici|sconti quantita)\s*:?$/i.test(fold(line))).slice(0,10); const options=[];for(const menu of all(main,'select.product-variants,select[name="variant_id"]'))for(const o of all(menu,'option')){if(o.disabled||o.hidden||o.getAttribute('value')===''||o.closest('optgroup[disabled]'))continue;const label=stripPrice(o.getAttribute('label')||o.textContent);if(valid(label)&&!options.includes(label))options.push(label);} const discounts=[];for(const tr of all(main,'[data-rf-righe-quantita] tr')){const label=clean(one(tr,'th')?.textContent),rate=clean(one(tr,'td')?.textContent);if(valid(label)&&/^\d+(?:[.,]\d+)?\s*%$/.test(rate)&&Number(rate.replace('%','').replace(',','.'))<=100)discounts.push(label+' — sconto '+rate);} if(!discounts.length)for(const label of options){if(/\bsconto\s*(?:del\s*)?[-−–]?\s*\d+(?:[.,]\d+)?\s*%|(?:^|\s)[−–-]\s*\d+(?:[.,]\d+)?\s*%/i.test(label))discounts.push(label);} return {main,name,facts,narrative,options,discounts:[...new Set(discounts)],url:canonicalURL(one(document,'link[rel="canonical"]')?.getAttribute('href'),location.href)||location.origin+location.pathname}; } /* Shared read-only catalog reader and Rome weekly date functions are inserted here. */ const normPath=p=>p.replace(/\/+$/,''); function ownURL(raw,base){if(typeof raw!=='string'||!raw.trim())return null;try{const u=new URL(raw,base);return u.protocol==='https:'&&['rfshop87.it','www.rfshop87.it'].includes(u.hostname)?u:null;}catch{return null;}} function parse(doc,pageURL){ const brands=[...new Set([...doc.querySelectorAll('.vendor-list a')].map(n=>clean(n.textContent)).filter(Boolean))].sort((a,b)=>b.length-a.length); const seen=new Set(),products=[]; for(const item of doc.querySelectorAll('.listing-item')){ if(item.closest('.sidebar,footer,.footer,rf-arrivals-live,rf-arrivals-assistant,rf-weekly-offers,#rf-assistenza-comune'))continue; const a=item.querySelector('a[href]'),name=clean(item.querySelector('.item-name')?.textContent),url=ownURL(a?.getAttribute('href'),pageURL); if(!url||!name||url.pathname.split('/').filter(Boolean).length<3)continue; url.hash='';const key=url.origin+url.pathname;if(seen.has(key))continue;seen.add(key); const imageNode=item.querySelector('.item-image img'),source=imageNode?.getAttribute('data-src')||imageNode?.getAttribute('src');let image=''; if(source&&!/missing-items|placeholder/i.test(source))try{const u=new URL(source,pageURL);if(u.protocol==='https:')image=u.href;}catch{} const brand=brands.find(b=>{const t=fold(name),v=fold(b);return t===v||t.startsWith(v+' ');})||''; const category=decodeURIComponent(url.pathname.split('/')[2]||'').replace(/-/g,' '); const gift=/\b(?:kit|cofanett[oi]|set|make.up book|libro)\b/i.test(name),group=gift?'Regali':/make.?up|trucco|rossett|blush|gloss|ombrett|illuminant|lip\b/i.test(category+' '+name)?'Make-up':/skin|cura|viso|corpo|crema|detergent|mascher|skincare/i.test(category+' '+name)?'Skincare':/profum|\bedp\b|\bedt\b/i.test(category+' '+name)?'Profumi':'Altri articoli'; const pack=name.match(/\[(?:conf\.?|confezione)\s*(.*?)\]/i)||name.match(/\bconfezione\s+(?:da\s+)?(\d+\s*(?:pezzi|kit|set|confezioni|flaconi))\b/i); products.push({id:key,code:'',name,brand,category,group,description:'',pack:pack?'Confezione '+pack[1]:'',image,url:url.href}); } const candidates=[...doc.querySelectorAll('a[rel~="next"],.pagination a[href]')]; const nextNode=candidates.find(a=>(a.getAttribute('rel')||'').split(/\s+/).includes('next')||/^(?:avanti|successiv[ao]|next|›|»|>)$/i.test(clean(a.textContent)||a.getAttribute('aria-label')||'')); let next=nextNode?ownURL(nextNode.getAttribute('href'),pageURL):null; if(next&&(next.origin!==new URL(pageURL).origin||normPath(next.pathname)!==normPath(new URL(pageURL).pathname)))next=null; return {products,next:next?.href||null}; } async function readAll(source,fetcher=fetch,Parser=DOMParser){ const products=[],seen=new Set(),visited=new Set();let url=source,truncated=false; for(let page=0;url&&page<5;page++){ if(visited.has(url))break;visited.add(url); const controller=new AbortController(),timer=setTimeout(()=>controller.abort(),15000);let response; try{response=await fetcher(url,{credentials:'same-origin',cache:'no-store',signal:controller.signal});if(!response.ok)throw Error('Pagina non disponibile');const final=new URL(response.url||url);if(final.origin!==new URL(source).origin||normPath(final.pathname)!==normPath(new URL(source).pathname))throw Error('Pagina reindirizzata'); const doc=new Parser().parseFromString(await response.text(),'text/html'),parsed=parse(doc,final.href); if(!parsed.products.length&&!products.length&&!doc.querySelector('.custom-block-products'))throw Error('Pagina non interpretabile'); for(const p of parsed.products){if(seen.has(p.id))continue;seen.add(p.id);products.push(p);if(products.length===300){truncated=true;break;}} url=parsed.next;if(truncated)break; }finally{clearTimeout(timer);} } if(url)truncated=true; return {products,truncated,pages:visited.size}; } const zone='Europe/Rome'; const partsFormat=new Intl.DateTimeFormat('en-GB',{timeZone:zone,year:'numeric',month:'2-digit',day:'2-digit',hour:'2-digit',minute:'2-digit',second:'2-digit',hourCycle:'h23'}); function parts(date){return Object.fromEntries(partsFormat.formatToParts(date).filter(x=>x.type!=='literal').map(x=>[x.type,Number(x.value)]));} function localInstant(y,m,d,h=0,minute=0,second=0){ const wanted=Date.UTC(y,m-1,d,h,minute,second);let ms=wanted; for(let i=0;i<4;i++){const p=parts(new Date(ms)),represented=Date.UTC(p.year,p.month-1,p.day,p.hour,p.minute,p.second),diff=wanted-represented;ms+=diff;if(!diff)break;} return ms; } const dateFormat=new Intl.DateTimeFormat('it-IT',{timeZone:zone,weekday:'long',day:'numeric',month:'long',year:'numeric'}); function week(now=new Date()){ const p=parts(now),day=new Date(Date.UTC(p.year,p.month-1,p.day)),distance=(day.getUTCDay()+6)%7; day.setUTCDate(day.getUTCDate()-distance);const end=new Date(day);end.setUTCDate(end.getUTCDate()+7); const startMs=localInstant(day.getUTCFullYear(),day.getUTCMonth()+1,day.getUTCDate()); const endMs=localInstant(end.getUTCFullYear(),end.getUTCMonth()+1,end.getUTCDate()); const deadlineMs=endMs-1000,key=day.toISOString().slice(0,10),seconds=Math.max(0,Math.floor((endMs-now.getTime())/1000)); return {key,startMs,endMs,deadlineMs,deadline:'Scade '+dateFormat.format(new Date(deadlineMs))+' alle 23:59',period:'Dal '+dateFormat.format(new Date(startMs))+' al '+dateFormat.format(new Date(deadlineMs)),days:Math.floor(seconds/86400),hours:Math.floor(seconds/3600)%24,minutes:Math.floor(seconds/60)%60,seconds:seconds%60}; } const paths={arrivals:'/it/nuovi-arrivi',offers:'/it/offerta-della-settimana',allOffers:'/it/scopri-le-nostre-offerte'}; let host,dialog,body,results,status,query,groupSelect,brandSelect,form,launch,tabNav,promo,contextLabel,allOffersLink; let mode='arrivals',topic='prodotto',product=null,cache=new Map(),pending=new Map(),generation=0,stopped=false,started=false,observer,timer,debounce,weekKey=week().key; const filters={q:'',group:'',brand:'',limit:6};let customAnswer=''; const node=(tag,text,cls)=>{const n=document.createElement(tag);if(text!==undefined)n.textContent=text;if(cls)n.className=cls;return n;}; function addLink(parent,text,url,secondary=false){const safe=canonicalURL(url,location.href);if(!safe)return;const a=node('a',text,secondary?'rfac-secondary':'rfac-primary');a.href=safe;a.target='_blank';a.rel='noopener noreferrer';parent.append(a);} function whatsapp(parent,p,label='Chiedi su WhatsApp'){ const message='Buongiorno, vorrei informazioni su '+p.name+(p.facts?.codice?' (codice '+p.facts.codice+')':'')+'. '+(p.url||''); const a=node('a',label,'rfac-primary');a.href='https://wa.me/393791316213?text='+encodeURIComponent(message);a.target='_blank';a.rel='noopener noreferrer';parent.append(a); } function updateTabs(){ const has=!!product;one(tabNav,'[data-mode="product"]').hidden=!has; for(const b of all(tabNav,'button'))b.setAttribute('aria-pressed',String(b.dataset.mode===mode)); form.hidden=false;one(host,'.rfac-filters').hidden=mode==='product';one(host,'.rfac-topics').hidden=mode!=='product';promo.hidden=mode!=='offers';allOffersLink.hidden=mode!=='offers'; query.placeholder=mode==='product'?'Es. confezione, assortimento, sconti':'Cerca prodotto o marchio';query.setAttribute('aria-label',mode==='product'?'Chiedi informazioni sul prodotto':'Cerca prodotti nel catalogo'); contextLabel.textContent=mode==='product'&&product?product.name:mode==='offers'?'Le occasioni della settimana':'Esplora i nuovi arrivi'; for(const b of all(host,'[data-topic]'))b.setAttribute('aria-pressed',String(b.dataset.topic===topic));paintClock(); } function renderProduct(){ updateTabs();results.replaceChildren();status.textContent=''; if(!product){status.textContent='Apri una scheda prodotto per ricevere assistenza sull’articolo.';return;} const p=product,f=p.facts,card=node('article',undefined,'rfac-answer');card.append(node('h3',p.name)); if(f.codice)card.append(node('p','Codice articolo: '+f.codice,'rfac-code')); const facts=entries=>{const dl=node('dl');for(const [label,value] of entries){if(!valid(value))continue;dl.append(node('dt',label),node('dd',value));}if(dl.childNodes.length)card.append(dl);}; if(customAnswer){card.append(node('p',customAnswer));} else if(topic==='prodotto'){ facts([['Marchio',f.marchio],['Tipologia',f.tipo],['Formato / contenuto',f.formato],['Componenti del kit',f.componenti]]); for(const text of p.narrative)card.append(node('p',text)); if(!p.narrative.length&&!f.formato&&!f.componenti)card.append(node('p','Per tutti i dettagli consulta la descrizione del prodotto nella pagina.')); }else if(topic==='confezione'){ facts([['Quantità per confezione',f.quantita],['Unità commerciale',f.unita],['Formato / contenuto',f.formato],['Imballo',f.imballo],['Sottoimballo',f.sottoimballo],['Presentazione',f.presentazione]]); if(!f.quantita)card.append(node('p','Per verificare la quantità della confezione, chiedi conferma a R&F Shop.')); if(p.options.length){card.append(node('h4','Opzioni di acquisto indicate'));const ul=node('ul');p.options.forEach(s=>ul.append(node('li',s)));card.append(ul);} }else if(topic==='assortimento'){ facts([['Assortimento',f.assortimento],['Referenze',f.varianti],['Quantità per confezione',f.quantita],['Unità commerciale',f.unita]]); if(/^a\s+(?:propria\s+)?scelta/i.test(f.assortimento||'')){ card.append(node('p','Puoi distribuire liberamente le quantità tra le referenze disponibili. Il minimo complessivo corrisponde alla quantità di una confezione: puoi raggiungerlo o superarlo senza obbligo di multipli.')); card.append(node('p','Se non comunichi una composizione, l’assortimento verrà preparato in base alle disponibilità di magazzino. Seleziona anche la quantità da acquistare per il carrello.')); const module=one(p.main,'[data-rf-assortimento-comune]');if(module){const b=node('button','Vai alla composizione','rfac-secondary');b.type='button';b.onclick=()=>{dialog.close();module.scrollIntoView({behavior:'smooth',block:'center'});one(module,'input,button')?.focus({preventScroll:true});};card.append(b);} }else card.append(node('p',valid(f.assortimento)?'L’assortimento segue le indicazioni della scheda. Per richieste particolari contatta R&F Shop.':'La scelta delle singole referenze non è indicata nella scheda. Chiedi conferma prima di richiedere una composizione personalizzata.')); }else if(topic==='sconti'){ if(p.discounts.length){card.append(node('h4','Condizioni indicate nella scheda'));const ul=node('ul');p.discounts.forEach(s=>ul.append(node('li',s)));card.append(ul);card.append(node('p','Seleziona la variante di acquisto corrispondente e verifica il prezzo applicato nel carrello. Gli sconti quantità sono riservati ai rivenditori; i grossisti possono richiedere un preventivo dedicato.'));} else card.append(node('p','Non risultano condizioni di sconto quantità esplicite leggibili nella scheda. Consulta le opzioni di acquisto o chiedi informazioni a R&F Shop.')); }else{ card.append(node('p','Consulta il riquadro di acquisto della scheda per il prezzo applicabile al tuo account. Se richiesto, accedi o registrati. Scegli la variante e la quantità da acquistare, poi aggiungi il prodotto al carrello.')); const buy=one(p.main,'.product-buy,.product-offer,.product-select');if(buy){const b=node('button','Vai al riquadro di acquisto','rfac-secondary');b.type='button';b.onclick=()=>{dialog.close();buy.scrollIntoView({behavior:'smooth',block:'center'});one(buy,'select,input,button')?.focus({preventScroll:true});};card.append(b);} } const actions=node('div',undefined,'rfac-actions');whatsapp(actions,p);card.append(actions);results.append(card); } function choices(select,values,title,current){select.replaceChildren(new Option(title,''));values.forEach(v=>select.add(new Option(v,v)));select.value=current;} function selectProducts(products,f=filters){const tokens=fold(f.q).split(/\s+/).filter(Boolean);return products.filter(p=>(!f.group||p.group===f.group)&&(!f.brand||p.brand===f.brand)&&tokens.every(t=>fold([p.name,p.brand,p.category].join(' ')).includes(t)));} function renderCatalog(){ updateTabs();results.replaceChildren();const entry=cache.get(mode);if(!entry){status.textContent=pending.has(mode)?'Caricamento degli articoli…':'Apri la sezione per cercare gli articoli.';return;} const groups=[...new Set(entry.products.map(p=>p.group))].sort();if(!groups.includes(filters.group))filters.group='';choices(groupSelect,groups,'Tutte le categorie',filters.group); const available=selectProducts(entry.products,{...filters,brand:''});const brands=[...new Set(available.map(p=>p.brand).filter(Boolean))].sort((a,b)=>a.localeCompare(b,'it'));if(!brands.includes(filters.brand))filters.brand='';choices(brandSelect,brands,'Tutti i marchi',filters.brand); const found=selectProducts(entry.products);status.textContent=found.length+' articoli · aggiornati '+new Date(entry.at).toLocaleTimeString('it-IT',{timeZone:'Europe/Rome',hour:'2-digit',minute:'2-digit'})+(entry.truncated?' · selezione parziale':''); if(!found.length)results.append(node('p','Nessun articolo corrispondente. Prova un’altra parola o premi Ricomincia.','rfac-empty')); for(const p of found.slice(0,filters.limit)){ const card=node('article',undefined,'rfac-card'),top=node('div',undefined,'rfac-card-top'); if(p.image){const img=node('img');img.className='rfac-photo';img.src=p.image;img.alt=p.name;img.loading='lazy';img.onerror=()=>{const ph=node('div','RF','rfac-placeholder');ph.setAttribute('aria-label','Foto non disponibile');img.replaceWith(ph);};top.append(img);}else{const ph=node('div','RF','rfac-placeholder');ph.setAttribute('aria-label','Foto non disponibile');top.append(ph);} const info=node('div');if(p.brand)info.append(node('div',p.brand,'rfac-brand'));info.append(node('h3',p.name));if(p.pack)info.append(node('p',p.pack,'rfac-pack'));top.append(info);card.append(top); const actions=node('div',undefined,'rfac-actions');addLink(actions,'Apri scheda prodotto',p.url);whatsapp(actions,p);card.append(actions);results.append(card); } if(found.length>filters.limit){const b=node('button','Mostra altri articoli','rfac-more');b.type='button';b.onclick=()=>{filters.limit+=6;renderCatalog();};results.append(b);} } async function loadCatalog(force=false){ const target=mode;if(target==='product')return;const token=++generation,entry=cache.get(target),currentWeek=week().key; if(!force&&entry&&Date.now()-entry.at<300000&&(target!=='offers'||entry.week===currentWeek)){renderCatalog();return;} status.textContent='Sto cercando '+(target==='offers'?'le offerte della settimana':'i nuovi arrivi')+'…';results.replaceChildren(); if(!pending.has(target)){const source=new URL(paths[target],location.origin).href;const req=readAll(source).then(r=>{if(target==='offers'&&week().key!==currentWeek)throw Error('Settimana cambiata');const data={...r,at:Date.now(),week:currentWeek};cache.set(target,data);return data;}).finally(()=>pending.delete(target));pending.set(target,req);} try{await pending.get(target);if(!stopped&&dialog.open&&mode===target&&token===generation)renderCatalog();} catch(err){if(stopped||mode!==target||token!==generation)return;if(err.message==='Settimana cambiata'){loadCatalog(true);return;}cache.delete(target);results.replaceChildren();status.textContent='Non riesco a caricare gli articoli. Puoi riprovare o aprire la pagina del negozio.';const b=node('button','Riprova','rfac-secondary');b.type='button';b.onclick=()=>loadCatalog(true);results.append(b);addLink(results,'Apri la pagina sul sito',new URL(paths[target],location.origin).href);} } function switchMode(next){ if(next==='product'&&!product)return;mode=next;customAnswer='';Object.assign(filters,{q:'',group:'',brand:'',limit:6});query.value='';generation++;if(mode==='product')renderProduct();else{updateTabs();loadCatalog();} } function paintClock(){if(!promo)return;const w=week();one(promo,'[data-deadline]').textContent=w.deadline;for(const k of ['days','hours','minutes','seconds'])one(promo,'[data-'+k+']').textContent=String(w[k]).padStart(2,'0');} function scanContext(){ if(stopped)return;const previous=product?.url;product=readProduct();if(!product&&mode==='product')switchMode('arrivals'); if(dialog.open&&mode==='product'){if(previous!==product?.url)topic='prodotto';renderProduct();}else updateTabs(); } function scheduleContext(){clearTimeout(debounce);debounce=setTimeout(scanContext,150);} function clock(){ if(stopped)return;const w=week();if(w.key!==weekKey){weekKey=w.key;cache.delete('offers');if(dialog.open&&mode==='offers')loadCatalog(true);}if(dialog.open)paintClock(); } function start(){ if(started||stopped)return;started=true;if(!document.body)return; host=node('div');host.id='rf-assistenza-comune'; host.innerHTML=`

Come posso aiutarti?

R&F Shop · Assistente guidato

`; document.body.append(host);dialog=one(host,'dialog');body=one(host,'.rfac-body');results=one(host,'.rfac-results');status=one(host,'.rfac-status');query=one(host,'input');form=one(host,'form');launch=one(host,'.rfac-launch');tabNav=one(host,'.rfac-tabs');promo=one(host,'.rfac-promo');contextLabel=one(host,'.rfac-context');allOffersLink=one(host,'.rfac-all-offers');groupSelect=one(host,'.rfac-group');brandSelect=one(host,'.rfac-brands'); product=readProduct();mode=product?'product':/\/(?:offerta-della-settimana|scopri-le-nostre-offerte)\/?$/.test(location.pathname)?'offers':'arrivals'; launch.onclick=()=>{product=readProduct();if(!product&&mode==='product')mode='arrivals';if(product&&mode==='arrivals'&&!cache.size)mode='product';dialog.showModal();launch.setAttribute('aria-expanded','true');if(mode==='product')renderProduct();else loadCatalog();query.focus();}; dialog.addEventListener('close',()=>{generation++;launch.setAttribute('aria-expanded','false');launch.focus();});one(host,'.rfac-close').onclick=()=>dialog.close();dialog.addEventListener('click',e=>{if(e.target===dialog){const r=dialog.getBoundingClientRect();if(e.clientXr.right||e.clientYr.bottom)dialog.close();}}); for(const b of all(tabNav,'button'))b.onclick=()=>switchMode(b.dataset.mode); for(const b of all(host,'[data-topic]'))b.onclick=()=>{product=readProduct();topic=b.dataset.topic;customAnswer='';renderProduct();body.scrollTop=0;}; groupSelect.onchange=()=>{filters.group=groupSelect.value;filters.brand='';filters.limit=6;renderCatalog();};brandSelect.onchange=()=>{filters.brand=brandSelect.value;filters.limit=6;renderCatalog();};one(host,'.rfac-reset').onclick=()=>{Object.assign(filters,{q:'',group:'',brand:'',limit:6});query.value='';renderCatalog();}; form.onsubmit=e=>{e.preventDefault();const q=clean(query.value);if(mode==='product'){product=readProduct();const n=fold(q);customAnswer='';if(/scont|offert|risparm/.test(n))topic='sconti';else if(/variant.*quant|quant.*variant/.test(n))topic='confezione';else if(/assort|referenz|color|scegl|variant/.test(n))topic='assortimento';else if(/prezz|acquist|carrell|ordin|pagament/.test(n))topic='acquisto';else if(/quant|confezion|pezz|imball|kit|minim|contenut|formato/.test(n))topic='confezione';else if(!n||/prodot|descriz|marchio|brand|cos.e|cosa|contien/.test(n))topic='prodotto';else customAnswer='Posso aiutarti con prodotto, confezione, assortimento, sconti e acquisto. Scegli uno dei pulsanti qui sopra oppure chiedi informazioni a R&F Shop.';renderProduct();}else{filters.q=q;filters.limit=6;renderCatalog();}}; document.addEventListener('change',contextChange);document.addEventListener('visibilitychange',visibility);window.addEventListener('popstate',scheduleContext);window.addEventListener('pageshow',scheduleContext); if(typeof MutationObserver!=='undefined'){observer=new MutationObserver(records=>{if(records.some(r=>{const n=r.target.nodeType===1?r.target:r.target.parentElement;return n&&!host.contains(n)&&(n.closest('.main-product')||[...r.addedNodes].some(x=>x.nodeType===1&&(x.matches?.('.main-product')||x.querySelector?.('.main-product'))));}))scheduleContext();});observer.observe(document.body,{childList:true,subtree:true,characterData:true});} timer=setInterval(clock,1000);updateTabs(); } function contextChange(e){if(e.target.closest?.('.main-product'))scheduleContext();} function visibility(){if(!document.hidden){clock();if(dialog?.open){scanContext();if(mode!=='product')loadCatalog();}}} window.RFShopAssistenteComune={versione:VERSION,aggiorna(){if(stopped||!started)return;scanContext();if(dialog?.open&&mode!=='product')loadCatalog(true);},diagnostica(){return {versione:VERSION,cssCaricato:host?getComputedStyle(host).getPropertyValue('--rf-assistente-ready').trim()==='1':false,schedaProdotto:!!product,sezione:mode,cataloghi:[...cache].map(([sezione,v])=>({sezione,articoli:v.products.length,aggiornato:new Date(v.at).toISOString()}))};},distruggi(){stopped=true;observer?.disconnect();clearInterval(timer);clearTimeout(debounce);document.removeEventListener('DOMContentLoaded',start);document.removeEventListener('change',contextChange);document.removeEventListener('visibilitychange',visibility);window.removeEventListener('popstate',scheduleContext);window.removeEventListener('pageshow',scheduleContext);host?.remove();delete window.RFShopAssistenteComune;}}; if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',start,{once:true});else start(); })();