1import{setStorage as l,getStorage as f,getUrlParamsFromStorage as v,updateCart as h,SHEET_ID_PREFIX as u}from"woody_addon_favorites_tools";async function L(o){const t=f(),e=E("fav");e!==null&&e.split("-").forEach(function(c){const s=c.split(":");if(s[0]==="f"){const r=w(o);let d=s[1].split(",");d=d.filter(a=>a!==""),d.forEach(function(a){r.includes(a)&&(t[a]="f")}),l(t)}});const n=v();n!=""&&e!=n&&(window.location=p(n))}document.addEventListener("woody:favorites-cells-added",function(o){o.detail&&o.detail.fragment&&y(o.detail.fragment)});function w(o){let t=[];return o.querySelectorAll(".card").forEach(function(e){const n=e.dataset.sheetid?u+e.dataset.sheetid:e.dataset.postid;t.push(n)}),t}function y(o){o.querySelectorAll(".card").forEach(function(t){if(t.querySelector(".removeFavorites")!==null)return;const e=t.dataset.sheetid?u+t.dataset.sheetid:t.dataset.postid;m(e,t)})}function _(o){o.querySelectorAll(".card").forEach(function(t){const e=t.dataset.sheetid?u+t.dataset.sheetid:t.dataset.postid;m(e,t),S(e,t)})}async function m(o,t){const e=document.createElement("div");e.classList.add("removeFavorites"),e.innerHTML=window.removeFavorites,t.insertBefore(e,t.firstChild),e.addEventListener("click",function(n){n.preventDefault();let i=f();delete i[o],l(i),t.closest(".cell").remove(),h(),g()})}async function S(o,t){const e=document.createElement("div");e.classList.add("addFavorites"),e.innerHTML=window.addFavorites,t.insertBefore(e,t.firstChild),e.addEventListener("click",function(n){n.preventDefault();let i=f();i[o]="f",l(i),t.querySelector(".addFavorites").remove();const c=t.closest(".cell"),s=document.querySelector(".favorites-section > p");s&&s.remove();const r=document.querySelector(".favorites-section .woody_list_grid");r&&r.appendChild(c),h(),g()})}async function g(){window.history.pushState({},"",p(v()))}function p(o){const t=new URL(window.location.href);t.searchParams.delete("fav");const e=t.searchParams.toString();let n=o===""?"":"fav="+o;return e!==""&&(n+=(n===""?"":"&")+e),t.origin+t.pathname+(n===""?"":"?"+n)+t.hash}function E(o){const t=new URLSearchParams(window.location.search);if(o)return t.has(o)?t.get(o):null;const e={};return t.forEach(function(n,i){e[i]=n}),e}export{y as favorites,w as getFavoritesIds,L as init,_ as visited};
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.