1import{setStorage as c,getStorage as d,updateCart as g,addFavorite as f,removeFavorite as v,SHEET_ID_PREFIX as u,FAVORITES_UPDATED_EVENT as p}from"woody_addon_favorites_tools";async function m(n){function r(s="remove"){const o=s==="add",e=document.getElementById("live-region-favs"),i=document.getElementById("favs-sr-button-info");e&&(e.textContent=o?"Ajout\xE9 aux favoris":"Supprim\xE9 des favoris"),i&&(i.textContent=o?"Supprimer des favoris":"Ajouter aux favoris")}const t=globals.sheet_id!==void 0?u+globals.sheet_id:globals.post_id;function l(){const s=d();if(t!==void 0){const o=s[t]==="f";n.forEach(e=>{e.classList.toggle("is-true",o),e.classList.toggle("is-false",!o),e.setAttribute("aria-pressed",o)})}document.querySelectorAll(".card[data-postid]").forEach(o=>{const e=o.querySelector(".button-add-to-favs");if(e===null)return;const i=o.getAttribute("data-postid"),a=i&&s[i]==="f";e.classList.toggle("is-true",a),e.classList.toggle("is-false",!a),e.setAttribute("aria-pressed",a)})}if(document.addEventListener(p,l),t!==void 0){const s=d();(!isNaN(t)||t.match(new RegExp(`^${u}[0-9]+$`))!==null)&&!Object.values(globals.woody_options_pages.favorites_url).includes(t)&&!(t in s)&&globals.page_type!=="front_page"&&(s[t]="v",c(s))}l(),n.length>0&&n.forEach(s=>{s.addEventListener("click",function(o){o.preventDefault();const e=d();let i=s.closest(".card");if(i!==null){let a=i.getAttribute("data-postid");a&&(e[a]==="f"?(r(),v(a)):(r("add"),f(a)))}else e[t]==="f"?(e[t]="v",r(),c(e),g()):(r("add"),f(t))})})}export{m as init};
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.